:root {
  --navy: #001f3f;
  --blue: #073b71;
  --red: #e5222c;
  --gold: #d7a628;
  --ink: #172033;
  --muted: #657087;
  --line: #dfe5ee;
  --surface: #ffffff;
  --canvas: #f3f6fa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, #edf2f8, #ffffff);
}
.shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.chat {
  width: min(100%, 520px);
  height: min(780px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 31, 63, 0.18);
}
.chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-bottom: 4px solid var(--red);
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  letter-spacing: -1px;
}
.chat__header h1 { margin: 0; font-size: 1.1rem; }
.chat__header p { margin: 3px 0 0; font-size: .8rem; opacity: .86; }
.status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #39d98a; }
.reset { margin-left: auto; border: 0; background: transparent; color: #fff; font-size: 1.5rem; cursor: pointer; }
.messages { overflow-y: auto; padding: 20px; background: var(--canvas); }
.message { display: flex; margin-bottom: 14px; }
.message.user { justify-content: flex-end; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; }
.assistant .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 5px; }
.user .bubble { color: #fff; background: var(--navy); border-top-right-radius: 5px; }
.typing .bubble { color: var(--muted); font-style: italic; }
.quick-actions { display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto; }
.quick-actions button { flex: 0 0 auto; padding: 8px 11px; border: 1px solid #c8d4e2; border-radius: 999px; background: #fff; color: var(--navy); cursor: pointer; }
.composer { display: grid; grid-template-columns: 1fr 46px; gap: 10px; padding: 12px 14px; }
.composer textarea { resize: none; max-height: 120px; padding: 12px; border: 1px solid #c8d4e2; border-radius: 14px; font: inherit; outline: none; }
.composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7, 59, 113, .12); }
.composer button { border: 0; border-radius: 14px; background: var(--red); color: #fff; font-size: 1.1rem; cursor: pointer; }
.composer button:disabled { opacity: .55; cursor: wait; }
footer { padding: 0 16px 14px; color: var(--muted); text-align: center; font-size: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (max-width: 560px) {
  .shell { padding: 0; }
  .chat { width: 100%; height: 100vh; border: 0; border-radius: 0; }
}
