* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}
.app {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
}
header, .card, .composer, .messages {
  background: #fff;
  border: 1px solid #dce3ef;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(24, 38, 67, 0.06);
}
header, .card { padding: 18px; }
h1 { margin: 0 0 6px; font-size: 26px; }
p { margin: 0; }
.messages {
  min-height: 360px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 14px;
}
.message {
  width: fit-content;
  max-width: 78%;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #edf3ff;
}
.message.agent { background: #efe9ff; }
.message.pending { opacity: .68; }
.message strong { display: block; margin-bottom: 4px; }
.message small { color: #62708a; font-weight: 500; }
.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
}
input, select, button {
  border: 1px solid #ccd6e6;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}
select { background: #fff; color: #172033; cursor: pointer; }
button {
  background: #1f66ff;
  color: #fff;
  border-color: #1f66ff;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.status { min-height: 22px; color: #62708a; }
.grid-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 10px;
  align-items: end;
}
label { display: grid; gap: 5px; color: #62708a; }
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #101828;
  color: #e6edf8;
  border-radius: 12px;
  padding: 12px;
}
.link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f7;
}
.revoked { opacity: .55; }
.created {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #eafaf0;
  border: 1px solid #b7e4c7;
  border-radius: 12px;
}
.created-label { color: #1a7f4b; font-weight: 600; }
.created-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.created-row input { background: #fff; }
.status { font-weight: 500; }
@media (max-width: 680px) {
  .app { padding: 10px; }
  .composer, .grid-form { grid-template-columns: 1fr; }
  .message { max-width: 96%; }
}
