/* App layout and page components, on top of the design tokens in /static/brand.css. */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- shell: fixed sidebar on desktop, top bar on phones ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) 247px, var(--line) 247px 248px, var(--bg) 248px); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 4px 10px 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .nav-label { font: 600 .68rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a[aria-current="page"] svg { opacity: 1; }
.who { margin-top: auto; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.profile-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: none; color: var(--ink);
  border-radius: var(--radius-sm); padding: 6px 8px; font: 500 .88rem var(--sans); cursor: pointer; text-align: left; }
.profile-btn:hover { background: var(--surface-2); }
.profile-btn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; flex: none;
  font: 700 .8rem var(--sans); color: #fff; background: linear-gradient(135deg, var(--logo-a), var(--logo-b)); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--radius-sm); width: 34px; height: 34px; cursor: pointer; flex: none; }
.iconbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.menu { position: fixed; left: 14px; bottom: 70px; z-index: 30; width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: var(--ink);
  font: inherit; font-size: .9rem; text-align: left; border-radius: 6px; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu form { margin: 0; }
.menu .sep { border-top: 1px solid var(--line); margin: 6px 0; }

.content { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 36px 64px; }
footer { color: var(--muted); font-size: .8rem; padding: 18px 36px 28px; border-top: 1px solid var(--line); }
footer a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; }
  .nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav .nav-label { display: none; }
  .nav a { flex: none; padding: 6px 10px; }
  .nav a svg { display: none; }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; }
  .profile-btn { flex: none; }
  .profile-btn .nm { display: none; }
  .menu { left: auto; right: 16px; top: 60px; bottom: auto; }
  main { padding: 22px 16px 48px; }
  footer { padding: 18px 16px 24px; }
}

/* ---- page header ---- */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { color: var(--muted); max-width: 64ch; margin: 0; }
.eyebrow-label, .rp-label { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.narrow { max-width: 440px; margin: 7vh auto 0; }
.narrow .page-head { display: block; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- notices ---- */
.flash { max-width: 1160px; width: 100%; margin: 20px auto 0; padding: 0 36px; }
.flash > div { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; border: 1px solid; }
.flash .ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.flash .err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
@media (max-width: 900px) { .flash { padding: 0 16px; } }

/* ---- forms ---- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: .84rem; color: var(--ink-2); margin-bottom: 6px; }
.field .opt { color: var(--muted); font-weight: 400; }
.help { font-size: .82rem; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=url], input[type=email], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; background: var(--surface); color: var(--ink); min-height: 40px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; box-shadow: var(--shadow);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 150px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.toggle input { margin-top: 4px; accent-color: var(--brand); }
.steps { margin: 0 0 18px; padding-left: 1.3em; display: grid; gap: 8px; color: var(--ink-2); }
.steps select { width: auto; display: inline-block; min-height: 34px; padding: 5px 10px; }

/* ---- stat tiles (the overview strip) ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat .k { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font: 650 1.5rem/1.3 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .v.text { font-size: .98rem; font-weight: 600; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .s { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.stat .s a { color: var(--brand); }

/* ---- ask page ---- */
.wb { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .wb { grid-template-columns: 1fr; } }
.composer { padding: 0; overflow: hidden; }
.composer .composer-body { padding: 20px 22px 6px; }
.composer textarea { border: 0; box-shadow: none; padding: 4px 0; min-height: 130px; font-size: 1.02rem; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.composer .composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.about-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; font-size: .86rem; }
.chipbtn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 11px; font: 500 .82rem var(--sans); cursor: pointer; text-decoration: none; }
.chipbtn:hover { border-color: var(--ink-2); color: var(--ink); }
.chipbtn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chipbtn.add { border-style: dashed; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mode { display: block; cursor: pointer; position: relative; }
.mode input { position: absolute; opacity: 0; }
.mode-body { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .12s; }
.mode:hover .mode-body { border-color: var(--line-strong); }
.mode input:checked + .mode-body { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.mode input:focus-visible + .mode-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.mode-name { font-weight: 600; font-size: .9rem; }
.mode-blurb { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.emergency { font-size: .82rem; color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--bad) 22%, var(--line)); background: var(--bad-soft);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 16px 0 0; }
.emergency strong { color: var(--bad); }
.progress { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; box-shadow: var(--shadow); }
.progress-head { display: flex; align-items: center; gap: 10px; }
.stages { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: .88rem; }
.stages .st-ok { color: var(--good); } .stages .st-running { color: var(--brand); font-weight: 600; }
.stages .st-blocked, .stages .st-failed { color: var(--warn); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.side { display: flex; flex-direction: column; gap: 16px; }
.side .card { padding: 16px 18px; }
.side h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); font-weight: 600; margin-bottom: 10px; }
.runlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.runlist li + li a { border-top: 1px solid var(--line); }
.runlist a { display: block; padding: 10px 2px; color: inherit; text-decoration: none; }
.runlist a:hover .t { color: var(--ink); }
.runlist .t { font-size: .84rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.examples { display: flex; flex-direction: column; gap: 6px; }
.example { text-align: left; padding: 9px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font: 500 .86rem var(--sans); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.example:hover { border-color: var(--brand); }
.example small { color: var(--muted); font-size: .72rem; font-weight: 500; white-space: nowrap; }

/* ---- choice cards (settings, admin) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.choice { display: block; cursor: pointer; position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice-body { display: block; height: 100%; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .12s; }
.choice:hover .choice-body { border-color: var(--line-strong); }
.choice input:checked + .choice-body { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-body strong { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-bottom: 2px; }
.choice-body span { font-size: .8rem; color: var(--muted); }
.choice-body .pill { font-size: .66rem; }
.testout { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem; border: 1px solid; }
.testout.ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.testout.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.card > h2 { margin-bottom: 14px; }
.kids, .people { display: grid; gap: 0; margin: 0 0 14px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.kids li, .people li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); }
.kids li + li, .people li + li { border-top: 1px solid var(--line); }
.kids li.help, .people li.help { margin: 0; }
.kids li .grow, .people li .grow { flex: 1; min-width: 0; }

/* ---- history ---- */
.hist { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hist li + li { border-top: 1px solid var(--line); }
.hist a { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 12px 18px; color: inherit; text-decoration: none; }
.hist a:hover { background: var(--surface-2); }
.hist .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hist .meta { grid-column: 2 / 4; font-size: .78rem; color: var(--muted); }
.hist .meta:empty { display: none; }
@media (max-width: 640px) { .hist a { grid-template-columns: 1fr; } .hist .meta { grid-column: auto; } }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---- answer page ---- */
.rp { display: flex; flex-direction: column; gap: 16px; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rp-quote { white-space: pre-wrap; padding: 12px 16px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); color: var(--ink-2); }
.rp-card h2 { font-size: 1.05rem; }
.rp-card h3 { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.rp-verdict { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rp-claim { font-size: 1.12rem; font-weight: 500; line-height: 1.55; margin: 2px 0 14px; }
.rp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.rp-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.rp-mono td { font-family: var(--mono); font-size: .78rem; }
.rp-finding { padding: 12px 0; border-bottom: 1px solid var(--line); } .rp-finding p { margin: 4px 0; }
.answer p { font-size: 1.04rem; line-height: 1.7; color: var(--ink); }
.say { display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.say li { border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); background: var(--brand-soft); color: var(--ink); border-radius: 12px 12px 12px 4px; padding: 10px 14px; font-weight: 500; }
.checkin { border: 1px solid color-mix(in srgb, var(--good) 25%, var(--line)); background: var(--good-soft); padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 18px; }
details.more { margin-top: 12px; } details.more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .88rem; }
details.card.more summary { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { font: 500 .78rem var(--sans); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
@media print { .sidebar, footer, .noprint { display: none !important; } .shell { display: block; } body { background: #fff; } }

/* ---- library ---- */
.kn { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .kn { grid-template-columns: 1fr; } }
.kn-list { display: flex; flex-direction: column; gap: 1px; max-height: 75vh; overflow-y: auto; }
.kn-list .grp { font: 600 .68rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 8px 6px; }
.kn-list a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: .86rem; }
.kn-list a:hover { background: var(--surface-2); color: var(--ink); }
.kn-list a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.prose { max-width: 72ch; } .prose h1 { font-size: 1.5rem; } .prose h2 { font-size: 1.1rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin: .25em 0; }
.prose table { margin: 1em 0; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } .stat .v { font-size: 1.25rem; } }
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; max-width: 440px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(4, 6, 14, .6); }
dialog.modal form { padding: 24px; }
.menu .cur { font-weight: 700; }
.profile-btn[hidden] { display: none !important; }
/* ---- voice input ---- */
.mic { gap: 6px; }
.mic[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.mic[aria-pressed="true"] svg { animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mic[aria-pressed="true"] svg { animation: none; } }
.mic-status { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--bad); font-weight: 600; margin-bottom: 6px; }
.mic-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.mic-status.busy { color: var(--muted); } .mic-status.busy::before { background: var(--muted); }
@media (max-width: 640px) { .mic .mic-label { display: none; } }
/* ---- follow-up chat ---- */
.chat { margin-top: 16px; }
.chat-log { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 86%; }
.chat-msg.me { align-self: flex-end; }
.chat-who { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.chat-msg.me .chat-who { text-align: right; }
.chat-body { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.chat-msg.me .chat-body { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.chat-msg.bot .chat-body { border-bottom-left-radius: 4px; }
.chat-body p { margin: 0 0 .6em; } .chat-body p:last-child { margin-bottom: 0; }
.chat-msg.pending .chat-body { color: var(--muted); font-style: italic; }
.chat-form textarea { min-height: 64px; }
.chat-actions { justify-content: flex-end; margin-top: 10px; }
.chat-actions .help { margin: 0 auto 0 0; color: var(--bad); }
@media (max-width: 640px) { .chat-msg { max-width: 100%; } }
.more-examples { margin-top: 8px; }
.more-examples > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .86rem; padding: 4px 0; }
.more-examples[open] > summary { margin-bottom: 6px; }
.role-select { width: auto; min-height: 30px; padding: 3px 8px; font-size: .82rem; }
/* ---- intro: what Cradle is for ---- */
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 32px; align-items: start; margin-bottom: 24px;
  padding: 24px 26px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 55%),
              radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--surface); }
.intro h1 { margin-bottom: .35em; }
.eyebrow { font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin-bottom: 8px; }
.lede { font-size: 1rem; line-height: 1.65; color: var(--ink-2); margin: 0; max-width: 60ch; }
.uses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.uses li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .86rem; color: var(--muted); line-height: 1.45; }
.uses strong { display: block; color: var(--ink); font-size: .92rem; margin-bottom: 1px; }
.use-ico { flex: none; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); font: 700 .85rem var(--sans); }
.intro-foot { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; padding: 20px; } }

/* ---- presets (in the side column) ---- */
.side .presets { padding: 16px 16px 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tab { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 600 .78rem var(--sans); padding: 5px 11px;
  border-radius: 999px; cursor: pointer; }
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.preset-list { display: flex; flex-direction: column; gap: 6px; max-height: min(62vh, 560px); overflow-y: auto; margin: 0 -4px; padding: 0 4px 2px; }
.preset-list .example { flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; }
.ex-title { font-weight: 600; font-size: .86rem; }
.ex-q { font-weight: 400; font-size: .78rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: left; }
.stats { margin: 24px 0 0; }

/* ---- light Markdown in answers and chat ---- */
.answer ul, .answer ol { margin: 0 0 1em; padding-left: 1.3em; font-size: 1.04rem; line-height: 1.7; }
.answer li + li { margin-top: .25em; }
.answer h4, .chat-body h4 { margin: 1em 0 .35em; }
.chat-body ul, .chat-body ol { margin: 0 0 .6em; padding-left: 1.2em; }
.chat-body ul:last-child, .chat-body ol:last-child { margin-bottom: 0; }
.answer strong, .chat-body strong { font-weight: 650; }

/* ---- resources ---- */
.res-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 26px; }
.res-section { margin-bottom: 34px; scroll-margin-top: 24px; }
@media (max-width: 900px) { .res-section { scroll-margin-top: 130px; } }
.res-section > h2 { margin: 0 0 14px; }
.res-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.res-card h3 { margin: 0; font-size: 1rem; }
.res-card p { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.5; }
.res-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 6px; font-size: .86rem; font-weight: 500; }
.res-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.res-list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; }
.res-list li + li { border-top: 1px solid var(--line); }
.res-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-list cite { font-style: normal; font-weight: 600; }
.res-list .by { color: var(--muted); font-size: .84rem; }
.res-list .pill { color: var(--brand); background: var(--brand-soft); }
@media (max-width: 640px) { .res-list li { padding: 10px 14px; } .res-list .pill { white-space: normal; text-align: center; } }
