/* Agent Architect engine. Dark by default, indigo/purple/pink accents, glass cards. Mobile first. */

:root {
  --font-head: "Space Grotesk", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --indigo: #6366f1; --purple: #a855f7; --indigo-soft: #818cf8; --purple-soft: #c084fc; --pink: #f472b6;

  --bg: #f5f4ff;
  --ink: #17143a;
  --ink-soft: #4a4672;
  --muted: #5b5785;
  --card: #ffffff;
  --card-line: rgba(79, 70, 229, 0.18);
  --glow-1: rgba(99, 102, 241, 0.28);
  --glow-2: rgba(168, 85, 247, 0.22);
  --glow-3: rgba(244, 114, 182, 0.18);
  --link: #4338ca;
  --chip-bg: #ebe9ff; --chip-ink: #3730a3;
  --bubble-user: #4f46e5; --bubble-user-ink: #ffffff;
  --bubble-bot: #f3f2ff; --bubble-bot-ink: #17143a;
  --field-bg: #ffffff; --field-line: rgba(79, 70, 229, 0.35);
  --btn-bg: #4f46e5; --btn-ink: #ffffff; --btn-hover: #4338ca;
  --icon-bg: #f0efff; --icon-ink: #312e81; --icon-line: rgba(79, 70, 229, 0.3);
  --coral: #b23a26;
  --dot: #6d28d9;
  --gauge-track: rgba(79, 70, 229, 0.15); --gauge-fill: #7e22ce; --grad: linear-gradient(90deg, #4338ca, #7e22ce 50%, #be185d); --grad-fallback: #6d28d9;
  --nav-bg: #f5f4ff;
  --shadow: 0 1px 2px rgba(23, 20, 58, 0.06), 0 18px 40px -24px rgba(79, 70, 229, 0.45);
  --pref-bg: #ffffff; --pref-line: rgba(79, 70, 229, 0.3); --pref-ink: #17143a;
  --pref-on-bg: #4f46e5; --pref-on-ink: #ffffff; --focus: #4f46e5;
  --skip-bg: #17143a; --skip-ink: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0a1d; --ink: #eef0ff; --ink-soft: #c9c8ee; --muted: #aeacd8;
    --card: rgba(22, 20, 52, 0.82); --card-line: rgba(129, 140, 248, 0.28);
    --glow-1: rgba(99, 102, 241, 0.42); --glow-2: rgba(168, 85, 247, 0.34); --glow-3: rgba(244, 114, 182, 0.26);
    --link: #a5b4fc; --chip-bg: rgba(129, 140, 248, 0.18); --chip-ink: #dcdcff;
    --bubble-user: #5b4fe0; --bubble-user-ink: #ffffff; --bubble-bot: rgba(255, 255, 255, 0.06); --bubble-bot-ink: #eef0ff;
    --field-bg: rgba(10, 9, 30, 0.75); --field-line: rgba(165, 180, 252, 0.4);
    --btn-bg: #5b4fe0; --btn-ink: #ffffff; --btn-hover: #4f46e5;
    --icon-bg: rgba(255, 255, 255, 0.06); --icon-ink: #e0e1ff; --icon-line: rgba(165, 180, 252, 0.35);
    --coral: #ff9e8a; --dot: #c084fc; --gauge-track: rgba(165, 180, 252, 0.18); --gauge-fill: #c084fc; --grad: linear-gradient(90deg, #818cf8, #c084fc 50%, #f472b6); --grad-fallback: #c084fc; --nav-bg: #0b0a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 22px 46px -26px rgba(0, 0, 0, 0.8);
    --pref-bg: rgba(255, 255, 255, 0.06); --pref-line: rgba(165, 180, 252, 0.35); --pref-ink: #eef0ff;
    --pref-on-bg: #818cf8; --pref-on-ink: #0b0a1d; --focus: #c084fc;
    --skip-bg: #eef0ff; --skip-ink: #0b0a1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a1d; --ink: #eef0ff; --ink-soft: #c9c8ee; --muted: #aeacd8;
  --card: rgba(22, 20, 52, 0.82); --card-line: rgba(129, 140, 248, 0.28);
  --glow-1: rgba(99, 102, 241, 0.42); --glow-2: rgba(168, 85, 247, 0.34); --glow-3: rgba(244, 114, 182, 0.26);
  --link: #a5b4fc; --chip-bg: rgba(129, 140, 248, 0.18); --chip-ink: #dcdcff;
  --bubble-user: #5b4fe0; --bubble-user-ink: #ffffff; --bubble-bot: rgba(255, 255, 255, 0.06); --bubble-bot-ink: #eef0ff;
  --field-bg: rgba(10, 9, 30, 0.75); --field-line: rgba(165, 180, 252, 0.4);
  --btn-bg: #5b4fe0; --btn-ink: #ffffff; --btn-hover: #4f46e5;
  --icon-bg: rgba(255, 255, 255, 0.06); --icon-ink: #e0e1ff; --icon-line: rgba(165, 180, 252, 0.35);
  --coral: #ff9e8a; --dot: #c084fc; --gauge-track: rgba(165, 180, 252, 0.18); --gauge-fill: #c084fc; --grad: linear-gradient(90deg, #818cf8, #c084fc 50%, #f472b6); --grad-fallback: #c084fc; --nav-bg: #0b0a1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 22px 46px -26px rgba(0, 0, 0, 0.8);
  --pref-bg: rgba(255, 255, 255, 0.06); --pref-line: rgba(165, 180, 252, 0.35); --pref-ink: #eef0ff;
  --pref-on-bg: #818cf8; --pref-on-ink: #0b0a1d; --focus: #c084fc;
  --skip-bg: #eef0ff; --skip-ink: #0b0a1d;
  color-scheme: dark;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 36rem at 12% -8%, var(--glow-1), transparent 62%),
    radial-gradient(52rem 34rem at 92% 4%, var(--glow-2), transparent 60%),
    radial-gradient(48rem 30rem at 50% 108%, var(--glow-3), transparent 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
}
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 0.16em; }
a:focus-visible, button:focus-visible, textarea:focus-visible, .log:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
ul, ol { text-align: left; }

/* Nav: sticky full-width glass bar */
.nav { position: sticky; top: 0; z-index: 30; background: var(--nav-bg); border-bottom: 1px solid var(--card-line);
  padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav { background: color-mix(in srgb, var(--nav-bg) 78%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); }
}
.nav-row { width: min(100% - 2rem, 83.75rem); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.25rem; padding: 0.55rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; text-align: left; min-width: 0; }
.brand-mark { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: none; border-radius: 0.7rem;
  background: linear-gradient(135deg, #4f46e5, #9333ea 55%, #db2777); color: #ffffff; font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.brand-sub { font-size: 0.78rem; color: var(--muted); }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 0.3rem 0.1rem; }
.nav-links a:hover { color: var(--link); }
.nav-links a[aria-current="page"] { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }

/* Compact hero */
.hero { width: min(100% - 3rem, 60rem); margin: 0 auto; padding: 1.25rem 0 1.1rem; }
.chip { display: inline-block; padding: 0.22rem 0.75rem; border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink);
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 0.55rem; }
.hero h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.45rem; }
.grad { color: var(--grad-fallback); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad { background-image: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
}
.subline { font-weight: 700; font-size: 0.98rem; color: var(--ink-soft); margin-bottom: 0.7rem; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.chip-link { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.3rem 0.9rem; border-radius: 999px; border: 1px solid var(--card-line);
  background: var(--icon-bg); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.chip-link:hover { border-color: var(--indigo-soft); color: var(--link); }

/* Board */
.board {
  width: min(100% - 3rem, clamp(56.25rem, 66vw, 83.75rem));
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.card {
  position: relative; min-width: 0; text-align: left;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 1.1rem; box-shadow: var(--shadow);
  padding: 1rem; overflow: hidden;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card { -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--indigo), var(--purple)); }
.top-card::before { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.short-card::before { background: linear-gradient(90deg, var(--indigo-soft), var(--purple-soft)); }
.detail-card::before { background: linear-gradient(90deg, var(--pink), var(--indigo)); }
.card h2 { font-size: 1.1rem; }

/* Chat cell keeps its size when the chat goes full page, so nothing behind it reflows */
.chat-cell { min-width: 0; height: var(--chat-h, clamp(26rem, 72svh, 36rem)); }
.chat-card { height: 100%; display: flex; flex-direction: column; gap: 0.55rem; container-type: inline-size; container-name: chat; }
.chat-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.chat-titles { min-width: 0; flex: 1 1 10rem; }
.chat-sub { color: var(--muted); font-size: 0.86rem; }
.chat-actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.icon-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--icon-line);
  background: var(--icon-bg); color: var(--icon-ink); cursor: pointer; padding: 0; }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }
.icon-btn:hover:not(:disabled) { border-color: var(--indigo-soft); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.text-btn { min-height: 2.4rem; padding: 0.3rem 0.85rem; border-radius: 999px; border: 1px solid var(--icon-line); background: var(--icon-bg);
  color: var(--icon-ink); font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.text-btn:hover { border-color: var(--indigo-soft); }
.chat-meta { display: flex; }
.count-chip { display: inline-block; white-space: nowrap; margin-right: 0.15rem; padding: 0.12rem 0.6rem; border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink); font-size: 0.76rem; font-weight: 700; }

.log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 0.6rem;
  padding: 0.25rem 0.15rem 0.25rem 0; border-radius: 0.6rem; }
.empty { margin: auto 0; color: var(--muted); font-size: 0.92rem; text-align: center; padding: 0.5rem; }
.empty-title { color: var(--ink); font-weight: 700; margin-bottom: 0.3rem; }
.msg { max-width: 92%; border-radius: 1rem; padding: 0.6rem 0.8rem; font-size: 0.95rem; min-width: 0; overflow-wrap: anywhere; }
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 0.5rem; }
.msg ul { margin: 0.35rem 0 0; padding-left: 1.15rem; display: grid; gap: 0.2rem; }
.msg.user { align-self: flex-end; background: var(--bubble-user); color: var(--bubble-user-ink); border-bottom-right-radius: 0.3rem; }
.msg.bot { align-self: flex-start; background: var(--bubble-bot); color: var(--bubble-bot-ink); border: 1px solid var(--card-line); border-bottom-left-radius: 0.3rem; }
.msg.bot a { color: var(--link); }
.msg.error { align-self: flex-start; background: transparent; border: 1px solid var(--coral); color: var(--coral); font-weight: 600; }
.msg-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; margin-bottom: 0.15rem; }

/* Thinking indicator */
.thinking { display: flex; flex-direction: column; gap: 0.35rem; }
.dots { display: inline-flex; gap: 0.35rem; align-items: center; height: 1.1rem; }
.dots span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dot); animation: pulse 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: 0.9; transform: none; } }
.wait-note { color: var(--muted); font-size: 0.84rem; }

/* Composer: narrow layout first, one row when the card is at least 18.5rem wide */
.composer { display: grid; gap: 0.45rem; grid-template-columns: minmax(0, 1fr); }
.composer textarea {
  width: 100%; min-width: 0; resize: none; overflow-y: hidden; min-height: 2.75rem; max-height: 8rem;
  padding: 0.6rem 0.8rem; border-radius: 1.2rem; border: 1px solid var(--field-line); background: var(--field-bg); color: var(--ink); line-height: 1.4;
}
.composer textarea::placeholder { color: var(--muted); opacity: 1; }
.composer-buttons { display: flex; gap: 0.45rem; justify-content: flex-end; align-items: center; }
.mic-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; border-radius: 50%; border: 1px solid var(--icon-line);
  background: var(--icon-bg); color: var(--icon-ink); cursor: pointer; padding: 0; }
.mic-btn svg { width: 1.2rem; height: 1.2rem; }
.mic-btn[hidden] { display: none; }
.mic-btn[aria-pressed="true"] { background: linear-gradient(135deg, #db2777, #9333ea); color: #ffffff; border-color: transparent; box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.25); }
.send-btn { min-height: 2.75rem; min-width: 4.75rem; padding: 0.5rem 1.1rem; border-radius: 999px; border: 0; background: var(--btn-bg); color: var(--btn-ink);
  font-weight: 700; cursor: pointer; flex: none; }
.send-btn:hover:not(:disabled) { background: var(--btn-hover); }
.send-btn:disabled { opacity: 0.6; cursor: progress; }
@container chat (min-width: 18.5rem) {
  .composer { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}
.mic-status { color: var(--muted); font-size: 0.84rem; }
.mic-error { color: var(--coral); font-size: 0.86rem; font-weight: 600; }
.mic-status[hidden], .mic-error[hidden] { display: none; }
.chat-note { color: var(--muted); font-size: 0.76rem; }

/* Full page chat overlay */
.chat-card.is-full {
  position: fixed; inset: 0; z-index: 60; height: auto; border-radius: 0; border: 0;
  padding: calc(1rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
  background: var(--bg);
}
.chat-card.is-full .log { width: min(100%, 56rem); margin: 0 auto; }
.chat-card.is-full .composer, .chat-card.is-full .mic-status, .chat-card.is-full .mic-error, .chat-card.is-full .chat-note { width: min(100%, 56rem); margin-left: auto; margin-right: auto; }

/* Side cards */
.side-card { display: flex; flex-direction: column; gap: 0.7rem; }
.pill { align-self: flex-start; padding: 0.15rem 0.65rem; border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink); font-size: 0.76rem; font-weight: 700; }
.tile { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem; border-radius: 0.9rem; color: #ffffff;
  background: linear-gradient(135deg, #4338ca 0%, #7e22ce 55%, #be185d 100%); min-height: 5.5rem; justify-content: flex-end; }
.tile-kind { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #f1eaff; }
.tile-title { font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.fit { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.fit-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.fit-score { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; }
.fit-why { color: var(--ink-soft); font-size: 0.9rem; }

.gauge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.8rem; }
.gauge { width: 4.5rem; height: 4.5rem; flex: none; }
.gauge-track { stroke: var(--gauge-track); }
.gauge-fill { stroke: var(--gauge-fill); transition: stroke-dasharray 0.4s ease; }
.gauge-text { fill: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.rank-note { color: var(--muted); font-size: 0.84rem; min-width: 0; flex: 1 1 9rem; }
.short-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.short-empty { color: var(--muted); font-size: 0.88rem; }
.short-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; text-align: left;
  padding: 0.5rem 0.65rem; border-radius: 0.7rem; border: 1px solid var(--card-line); background: var(--icon-bg); color: var(--ink); cursor: pointer; font-size: 0.9rem; }
.short-item:hover { border-color: var(--indigo-soft); }
.short-item[aria-current="true"] { border-color: var(--purple-soft); box-shadow: inset 3px 0 0 var(--purple-soft); }
.short-title { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.short-score { flex: none; font-family: var(--font-head); font-weight: 700; color: var(--ink-soft); }

.detail-name { font-family: var(--font-head); font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.detail-list { margin: 0; display: grid; border-radius: 0.7rem; background: var(--icon-bg); border: 1px solid var(--card-line); overflow: hidden; }
.detail-list div { padding: 0.4rem 0.6rem; min-width: 0; }
.detail-list div + div { border-top: 1px solid var(--card-line); }
.detail-list dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.detail-list dd { margin: 0; font-size: 0.86rem; line-height: 1.4; overflow-wrap: anywhere; }
.guide-link { font-weight: 700; font-size: 0.9rem; }
.next-step { border-top: 1px solid var(--card-line); padding-top: 0.65rem; flex: none; }
.card-scroll { min-height: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.card-scroll > * { flex: none; } /* lists never shrink inside the card; the card scrolls instead */
.more-cue { display: none; margin: -0.35rem 0 0; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-align: center; }
.more-cue::after { content: " \2193"; }
.side-card.has-more .more-cue { display: block; }
.next-step h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.next-step p { font-size: 0.9rem; color: var(--ink-soft); overflow-wrap: anywhere; }

/* About + footer */
.about { width: min(100% - 3rem, clamp(56.25rem, 66vw, 83.75rem)); margin: 2.5rem auto 0; }
.about h2 { font-size: 1.35rem; margin-bottom: 0.9rem; }
.about-grid { display: grid; gap: 0.75rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.about-card h3 { font-size: 1rem; margin-bottom: 0.45rem; }
.about-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; color: var(--ink-soft); font-size: 0.92rem; }
.footer { width: min(100% - 3rem, 83.75rem); margin: 2.5rem auto 0; padding: 1.25rem 0 calc(1.5rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--card-line);
  color: var(--muted); font-size: 0.85rem; display: grid; gap: 0.35rem; }

@media (min-width: 700px) {
  .hero h1 { font-size: 2.15rem; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chat-cell { grid-column: 1 / -1; grid-row: 1; height: var(--chat-h, clamp(24rem, 62svh, 34rem)); }
  .top-card { grid-column: 1; grid-row: 2; }
  .short-card { grid-column: 2; grid-row: 2; }
  .detail-card { grid-column: 3; grid-row: 2; }
  .about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  body { text-align: left; }
  .nav-row { justify-content: space-between; }
  .hero { width: min(100% - 3rem, clamp(56.25rem, 66vw, 83.75rem)); text-align: center; padding-top: 1.1rem; padding-bottom: 1rem; }
  .hero h1 { font-size: clamp(2.2rem, 2.6vw, 2.75rem); text-wrap: balance; }
  .board { grid-template-columns: 1.36fr 1.06fr 0.98fr 0.98fr; }
  .chat-cell { grid-column: 1; grid-row: 1; height: var(--chat-h, clamp(22rem, 100svh - 21rem, 38rem)); }
  .top-card { grid-column: 2; grid-row: 1; }
  .short-card { grid-column: 3; grid-row: 1; }
  .detail-card { grid-column: 4; grid-row: 1; }
  .footer { text-align: left; }
  /* No card may run past the window: each side card is capped at the chat box height (measured to fit
     the window), its list scrolls inside the card, and "Scroll for more" shows when there is more. */
  .side-card { max-height: var(--chat-h, none); }
  .card-scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-right: 0.15rem; }
  .card-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
}

/* Short laptop screens: tighten the hero so the whole board still fits the window */
@media (min-width: 1100px) and (max-height: 860px) {
  .hero { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .chip { margin-bottom: 0.3rem; }
  .hero h1 { font-size: clamp(2rem, 2.3vw, 2.4rem); margin-bottom: 0.25rem; }
  .subline { font-size: 0.9rem; margin-bottom: 0.45rem; }
  .chip-link { min-height: 2rem; padding-top: 0.2rem; padding-bottom: 0.2rem; }
  .chat-card { gap: 0.45rem; }
}
