/* Search results styles, ported from the claude-chatbot search page
   (public/demo.html <style>). Page-wide rules (html, body, headings,
   scrollbars) are left out or scoped to .results-main so the landing pages
   keep their own look. */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap');

:root {
  --cardinal-red: #8C1515;
  --cardinal-dark: #6D0F0F;
  --ink: #1F2937;
  --ink-soft: #4B5563;
  --ink-muted: #6B7280;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --page: #F3F4F6;
  --line: #E5E7EB;
  --ok: #166534;
  --warn: #B45309;
  --err: #991B1B;
  --highlight: #FEF08A;
  --radius: 0.65rem;
  --hairline: rgba(31,35,46,.08);
  --muted-ink: #6B7280;
  --stanford-cardinal: #8C1515;
  --stanford-cardinal-dark: #6D0F0F;
}
* { box-sizing: border-box; }
/* Themed scrollbars — subtle cardinal tint so they sit with the theme instead
   of the stark default browser bar. */
.results-main h1, .results-main h2, .results-main h3 { font-family: "Noto Serif", "Source Serif 4", Georgia, serif; color: var(--ink); letter-spacing: -0.025em; }
button, input, textarea { font: inherit; }
button:not(:disabled), [role="button"]:not([aria-disabled="true"]), a[href], select:not(:disabled), input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(140, 21, 21, .55); outline-offset: 2px; }
.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; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.chrome-shell, .content-shell { width: min(1260px, calc(100% - 28px)); margin: 0 auto; }
/* Widen the layout on large monitors so the results don't sit in a narrow
   column with huge side gaps (~30% tighter than before). Steps at 1600/2048px. */
@media (min-width: 1600px) { .chrome-shell, .content-shell { width: min(1540px, calc(100% - 64px)); } }
@media (min-width: 2048px) { .chrome-shell, .content-shell { width: min(1960px, calc(100% - 96px)); } }
.site-header { position: sticky; top: 0; z-index: 50; height: 64px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.skip-link { position: absolute; left: 1rem; top: -4rem; padding: .65rem 1rem; background: white; color: var(--cardinal-red); border: 1px solid var(--cardinal-red); border-radius: 8px; z-index: 100; }
.skip-link:focus { top: .75rem; }
.brand, .footer-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: 1.08rem; }
.brand:hover { color: var(--cardinal-dark); }
.brand-mark { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--cardinal-red); color: white; font-family: "Source Serif 4", Georgia, serif; font-weight: 800; line-height: 1; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); }
.desktop-nav { display: flex; align-items: center; gap: .25rem; }
.desktop-nav button, .hamburger, .drawer-card button, .summary-header button, .feedback-strip button, .result-feedback button { border: 0; background: transparent; color: var(--ink-soft); border-radius: 8px; min-height: 44px; padding: .55rem .75rem; }
.desktop-nav button:hover, .hamburger:hover, .drawer-card button:hover { color: var(--cardinal-red); background: rgba(140,21,21,.06); }
.hamburger { display: none; }
.mobile-drawer { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 80; display: flex; justify-content: flex-end; }
.drawer-card { width: min(360px, 88vw); background: white; padding: 1rem; box-shadow: -20px 0 50px rgba(15,23,42,.18); display: flex; flex-direction: column; gap: .5rem; }
.drawer-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: .75rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.site-footer { margin-top: auto; min-height: 96px; background: var(--cardinal-red); color: white; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.25rem; align-items: center; min-height: 96px; }
.footer-grid .brand-mark { background: white; color: var(--cardinal-red); }
.footer-brand { color: white; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: .85rem; }
.footer-grid a { color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }
.footer-grid p { color: rgba(255,255,255,.86); margin: 0; font-size: .9rem; }
.footer-grid p span { font-family: Consolas, ui-monospace, monospace; opacity: .8; }
.first-nudge { width: min(1120px, calc(100% - 32px)); margin: 1rem auto 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; background: rgba(140,21,21,.08); color: var(--cardinal-dark); border: 1px solid rgba(140,21,21,.12); border-radius: 12px; }
.first-nudge span { display: inline-flex; align-items: center; gap: .55rem; }
.first-nudge button { border: 0; background: transparent; color: var(--cardinal-dark); min-width: 44px; min-height: 44px; border-radius: 999px; display: grid; place-items: center; }
.hero-section { min-height: calc(80vh - 64px); display: grid; place-items: center; background-color: #f2f4f4; background-size: cover; background-position: center; padding: 4rem 1rem; position: relative; z-index: 10; overflow: hidden; }
.hero-content { position: relative; z-index: 1; }
.hero-card { position: relative; z-index: 1; width: min(820px, 100%); background: rgba(255,255,255,.78); border: 1px solid rgba(229,231,235,.9); box-shadow: 0 22px 70px rgba(15,23,42,.12); backdrop-filter: blur(8px); border-radius: 24px; padding: clamp(1.5rem, 4vw, 3rem); text-align: center; }
.eyebrow { margin: 0 0 .75rem; color: var(--cardinal-red); text-transform: uppercase; letter-spacing: .11em; font-weight: 800; font-size: .78rem; }
.hero-card h1 { font-size: clamp(2rem, 7vw, 4.25rem); line-height: .94; margin: 0; }
.hero-subtitle { max-width: 620px; margin: 1rem auto 1.5rem; color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.65; }
.search-form { width: min(820px, 100%); margin: 0 auto; }
.search-shell { display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; min-height: 56px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 36px rgba(15,23,42,.09); overflow: visible; }
.search-form-compact .search-shell { min-height: 50px; box-shadow: 0 8px 24px rgba(15,23,42,.07); }
.search-form-no-scope .search-shell { grid-template-columns: minmax(0, 1fr) auto; }
.search-form-no-scope .search-shell input { min-width: 0; border-radius: 14px 0 0 14px; }
.source-filter { position: relative; min-width: 0; }
.source-trigger { height: 100%; min-height: 50px; display: inline-flex; align-items: center; gap: .45rem; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 1rem; border-radius: 14px 0 0 14px; white-space: nowrap; }
.source-trigger:hover { color: var(--cardinal-red); background: rgba(140,21,21,.04); }
.search-shell input { min-width: 320px; border: 0; padding: 0 1rem; color: var(--ink); background: white; }
.search-shell input:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(140,21,21,.45); }
.search-button { min-width: 132px; border: 0; background: var(--cardinal-red); color: white; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: 0 1.1rem; border-radius: 0 13px 13px 0; font-weight: 800; }
.search-button:hover:not(:disabled) { background: var(--cardinal-dark); }
.search-button:disabled { opacity: .72; }
.spin { animation: spin 1s linear infinite; }
.input-note { text-align: left; color: var(--err); font-size: .9rem; margin: .45rem 0 0; }
.source-popover { position: fixed; width: min(360px, 92vw); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(15,23,42,.16); padding: .75rem; z-index: 999; text-align: left; }
.source-popover > input { width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 .75rem; font-size: .9rem; }
.source-popover > input:focus { outline: none; border-color: var(--cardinal-red); box-shadow: 0 0 0 3px rgba(140,21,21,.12); }
.domain-list { max-height: 320px; overflow-x: hidden; overflow-y: auto; padding: .5rem 0; display: grid; gap: .15rem; }
.domain-option { display: grid; grid-template-columns: 20px 1fr; gap: .6rem; align-items: center; padding: .5rem .55rem; border-radius: 10px; cursor: pointer; }
.domain-option:hover { background: var(--surface-soft); }
.domain-option input { width: 18px; height: 18px; accent-color: var(--cardinal-red); margin: 0; pointer-events: none; }
.domain-option:focus-visible { outline: 2px solid var(--cardinal-red); outline-offset: 1px; }
.domain-option strong { font-weight: 500; color: var(--ink); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: .65rem; }
.popover-actions button { border: 0; background: transparent; color: var(--cardinal-red); font-weight: 800; border-radius: 8px; padding: .55rem .75rem; }
.popover-actions button:last-child { background: var(--cardinal-red); color: white; }
.try-line { color: var(--ink-muted); font-size: .9rem; }
.try-line button { border: 0; background: transparent; color: var(--cardinal-red); text-decoration: underline; text-underline-offset: 3px; padding: .25rem .35rem; border-radius: 6px; }
.try-line em { font-style: normal; color: var(--ink-muted); }
.topics-section, .how-section { padding: 5rem 0; background-size: cover; background-position: center; }
.how-section { background: #fff; }
.section-heading { display: grid; gap: .45rem; margin-bottom: 1.5rem; }
.section-heading h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); line-height: 1.08; margin: 0; max-width: 720px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.topic-chip { min-height: 56px; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--ink); border-radius: 999px; padding: .6rem 1rem; font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.topic-chip:hover { border-color: rgba(140,21,21,.45); color: var(--cardinal-red); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,23,42,.08); }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step-card, .summary-card, .result-card, .no-results { background: white; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.step-card { min-height: 160px; border-radius: 14px; padding: 1.5rem; position: relative; overflow: hidden; }
.step-card::after { content: ""; position: absolute; width: 9rem; height: 9rem; border: 1px solid rgba(140,21,21,.14); border-radius: 999px; right: -4rem; top: -4rem; }
.step-card span { color: var(--cardinal-red); font-family: "Source Serif 4", Georgia, serif; font-size: 2rem; font-weight: 800; }
.step-card h3 { font-size: 1.2rem; margin: .75rem 0 .35rem; }
.step-card p { color: var(--ink-soft); line-height: 1.55; margin: 0; }
.sticky-search { position: sticky; top: 64px; z-index: 30; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); padding: 1rem 0; backdrop-filter: blur(14px); box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.results-shell { padding: 2rem 0 4.5rem; display: grid; gap: 1rem; }
.summary-card { display: grid; grid-template-columns: 1fr minmax(220px, 340px); border-radius: 18px; overflow: hidden; }
.summary-copy { padding: 1.5rem; }
.summary-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.summary-header > span { display: inline-flex; align-items: center; gap: .45rem; color: var(--cardinal-red); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 800; }
.summary-header div { display: flex; gap: .35rem; }
.summary-header button { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; border: 1px solid var(--line); background: white; }
/* Answer typography — clean sans body, tight heading hierarchy.
   NOTE: the Tailwind CDN preflight sets `ul,ol { list-style: none; padding: 0 }`,
   so bullets rendered as bare indented text with no markers until list-style
   was restored here explicitly. */
.summary-body { font-family: "Public Sans", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); }
/* Weights kept deliberately light: emphasis should guide the eye, not shout.
   Inline <strong> sits one step above body text (600 vs 400) and section
   headings use the sans face at 600 rather than serif 700, which read as
   heavy blocks. */
.summary-body h2 { font-size: 1.3rem; font-weight: 600; margin: 0 0 .6rem; line-height: 1.3; letter-spacing: -0.01em; }
.summary-body h3, .summary-body h4 { font-family: "Public Sans", "Source Sans 3", -apple-system, sans-serif; font-weight: 600; color: var(--ink); }
.summary-body h3 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; line-height: 1.35; }
.summary-body h4 { font-size: .95rem; margin: 1rem 0 .35rem; }
.summary-body p, .summary-body li { color: var(--ink-soft); line-height: 1.62; }
.summary-body p { margin: 0 0 .7rem; }
.summary-body ul { list-style: disc outside; padding-left: 1.35rem; margin: .35rem 0 .8rem; }
.summary-body ol { list-style: decimal outside; padding-left: 1.6rem; margin: .35rem 0 .8rem; }
.summary-body li { margin: .28rem 0; padding-left: .15rem; }
.summary-body li::marker { color: var(--cardinal-red); }
.summary-body strong { color: var(--ink); font-weight: 600; }
/* Prevent horizontal overflow on narrow screens: long slash/URL-joined tokens
   ("Morale/Event/Recruitment/…") must wrap instead of pushing past the card
   edge (which the card's overflow:hidden then clips). */
.summary-body, .summary-body p, .summary-body li, .summary-body h2, .summary-body h3, .summary-body h4 { overflow-wrap: anywhere; word-break: break-word; }
.summary-copy, .answer-workbench > *, .summary-card > * { min-width: 0; }
.result-card .snippet, .result-card h3, .citation-row strong, .citation-row em { overflow-wrap: anywhere; }
.citation-chip { display: inline-flex; position: relative; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 .35rem; margin: 0 .1rem; border-radius: 999px; background: rgba(140,21,21,.1); border: 1px solid rgba(140,21,21,.3); color: var(--cardinal-red); text-decoration: none; font-weight: 800; font-size: .78rem; vertical-align: middle; }
/* Floating citation tooltip — body-mounted, position:fixed (set by JS), so it
   never clips inside the summary card's overflow:hidden. */
.cite-tip { position: fixed; display: none; width: min(300px, 90vw); max-height: 240px; overflow: hidden; background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(15,23,42,.14); padding: .75rem; z-index: 1000; pointer-events: none; }
.cite-tip strong { display: block; color: var(--ink); margin-bottom: .35rem; font-family: Consolas, ui-monospace, monospace; font-size: .8rem; }
.cite-tip em { color: var(--ink-soft); font-weight: 500; font-style: normal; }
.feedback-strip { display: flex; align-items: center; gap: .5rem; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .9rem; color: var(--ink-muted); font-size: .9rem; }
.feedback-strip button, .result-feedback button { min-width: 40px; min-height: 32px; border: 1px solid var(--line); background: white; border-radius: 999px; }
.feedback-strip button:hover:first-of-type, .result-feedback button:hover:first-of-type { border-color: var(--ok); background: rgba(22,101,52,.07); }
.feedback-strip button:hover:last-of-type, .result-feedback button:hover:last-of-type { border-color: var(--err); background: rgba(153,27,27,.07); }
.comment-box { margin-top: .8rem; display: grid; gap: .45rem; }
.comment-box label { color: var(--ink-muted); font-size: .9rem; }
.comment-box textarea { height: 80px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.comment-box button { justify-self: start; background: var(--cardinal-red); color: white; border: 0; border-radius: 8px; padding: .6rem 1rem; font-weight: 800; }
.comment-box button.feedback-cancel { background: transparent; color: var(--ink-muted); font-weight: 600; padding: .55rem .8rem; }
.comment-box button.feedback-cancel:hover { color: var(--ink); }
/* Replace the per-result thumbs prompt's inline 'window.prompt' with focus
   ring on the down button so the inline comment box shows clearly. */
[data-feedback-summary] button[data-vote]:disabled { opacity: 0.5; cursor: default; }
.related-strip { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.related-strip > span { display: block; color: var(--ink-muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6rem; }
.related-strip div { display: flex; flex-wrap: wrap; gap: .5rem; }
.related-strip button { min-height: 34px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); border-radius: 999px; padding: .35rem .75rem; }
.related-strip button:hover { border-color: var(--cardinal-red); background: white; color: var(--cardinal-red); }
.summary-art { display: grid; place-items: center; background: linear-gradient(135deg, rgba(140,21,21,.05), rgba(248,250,252,.95)); border-left: 1px solid var(--line); }
.summary-art img { width: min(92%, 320px); height: auto; filter: drop-shadow(0 16px 24px rgba(15,23,42,.09)); }
.status-strip, .results-count-strip { min-height: 32px; display: flex; align-items: center; color: var(--ink-muted); background: var(--surface-soft); border-radius: 10px; padding: .4rem .8rem; font-size: .9rem; }
.results-count-strip { justify-self: start; border: 1px solid var(--line); background: white; }
.result-list { display: grid; gap: 1rem; }

/* ===================== Result-page layout variants =====================
   'a' (Classic) is the retained default. Five alternative samples:
   console / editorial / grid / minimal / slate. All render the SAME data
   and handlers — these blocks only restyle the arrangement. */
/* Switcher (segmented control under the search bar) */
.layout-switcher { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .6rem; }
.layout-switcher-label { font-size: .72rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-right: .15rem; }
.layout-opt { border: 1px solid var(--line); background: white; color: var(--ink-soft); padding: .3rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.layout-opt:hover:not(.is-active) { background: var(--surface-soft); }
.layout-opt.is-active { background: var(--cardinal-red); color: #fff; border-color: var(--cardinal-red); }

/* Shared source visual variants (used by several layouts) */
.source-chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.source-chip { display: inline-flex; align-items: center; gap: .5rem; max-width: 340px; border: 1px solid var(--line); border-radius: 12px; padding: .45rem .7rem; background: var(--surface-soft); text-decoration: none; color: var(--ink); }
.source-chip:hover { border-color: rgba(140,21,21,.4); background: #fff; }
.source-chip-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--cardinal-red); color: #fff; font-size: .72rem; font-weight: 800; flex-shrink: 0; }
.source-chip-text { display: flex; flex-direction: column; min-width: 0; }
.source-chip-text strong { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.source-chip-text small { font-size: .72rem; color: var(--ink-muted); font-family: Consolas, ui-monospace, monospace; }
.source-chip-ext { width: 14px; height: 14px; opacity: .6; flex-shrink: 0; }
.source-chip-ext svg { width: 100%; height: 100%; }
.source-footnotes { margin: 0; padding-left: 1.4rem; display: grid; gap: .65rem; }
.source-footnotes li { font-size: .92rem; line-height: 1.5; }
.source-footnotes li::marker { color: var(--cardinal-red); font-weight: 700; }
.source-footnotes a { color: var(--cardinal-red); text-decoration: none; }
.source-footnotes a svg { width: 12px; height: 12px; opacity: .65; }
.source-footnotes a:hover { text-decoration: underline; }
.source-footnotes .fn-host { color: var(--ink-muted); font-family: Consolas, ui-monospace, monospace; font-size: .78rem; }
.source-footnotes .fn-span { display: block; color: var(--ink-soft); font-style: italic; margin-top: .15rem; }

/* ---- ANSWER (id "console"): answer-engine pattern — source tile strip on
   top, full-width answer, result list. Single page scroll, centered column. ---- */
.results-layout-console .results-shell { display: block; }
.results-layout-console .results-shell > * { max-width: 940px; margin: 0 auto 1rem; }
.engine-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; }
.engine-tile { display: flex; flex-direction: column; gap: .45rem; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: border-color .15s ease, box-shadow .15s ease; }
.engine-tile:hover, .engine-tile:focus-visible { border-color: rgba(140,21,21,.4); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.engine-tile-title { font-size: .84rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.engine-tile-meta { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-muted); font-size: .74rem; font-family: Consolas, ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine-tile-num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--cardinal-red); color: #fff; font-size: .68rem; font-weight: 800; font-family: "Public Sans", sans-serif; flex-shrink: 0; }
.engine-answer { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.3rem, 2.5vw, 1.9rem); box-shadow: 0 10px 30px rgba(15,23,42,.05); }
.engine-answer .summary-body { font-size: 1.04rem; line-height: 1.7; }
.engine-answer .summary-body p { max-width: none; }
.results-layout-console .results-count-strip { background: transparent; border: 0; padding-left: 0; }
.engine-results { display: grid; gap: .85rem; }
.results-layout-console .result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; border: 1px solid var(--line); border-radius: 14px; padding: 1.05rem 1.2rem; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.results-layout-console .result-card:hover { border-color: rgba(140,21,21,.3); }
/* Numbering language: rounded-square filled chips (app / engine style) */
.results-layout-console .result-rank { display: grid; place-items: start center; padding: .15rem 0 0; background: transparent; border: 0; }
.results-layout-console .result-rank span { width: 28px; height: 28px; border-radius: 8px; background: var(--cardinal-red); color: #fff; border: 0; font-family: "Public Sans", sans-serif; font-size: .78rem; font-weight: 800; }
.results-layout-console .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-console .result-card h3 { white-space: normal; overflow: visible; text-overflow: clip; font-size: 1.1rem; }
.results-layout-console .snippet { font-size: .93rem; }

/* ---- CARDINAL: flagship — source tiles on top, serif Editorial-quality
   answer at full card width (cardinal top rule), results as one unified
   numbered list card. Centered column, single scroll. ---- */
.results-layout-cardinal .results-shell { display: block; }
.results-layout-cardinal .results-shell > * { max-width: 980px; margin: 0 auto 1.1rem; }
.cardinal-answer { position: relative; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--cardinal-red); border-radius: 18px; padding: clamp(1.6rem, 3vw, 2.4rem) clamp(1.4rem, 3.5vw, 2.8rem); box-shadow: 0 16px 44px rgba(15,23,42,.07); }
.cardinal-answer .summary-header { border-bottom: 0; padding-bottom: 0; margin-bottom: 1.1rem; }
.cardinal-answer .summary-body { font-family: "Noto Serif", "Source Serif 4", Georgia, serif; font-size: 1.13rem; line-height: 1.8; color: var(--ink); }
.cardinal-answer .summary-body p { max-width: none; }
.cardinal-answer .summary-body h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.25; margin: 0 0 1.1rem; }
.cardinal-answer .summary-body h2::after { content: ""; display: block; width: 56px; height: 3px; background: var(--cardinal-red); margin-top: .65rem; }
.cardinal-answer .summary-body h3 { font-size: 1.22rem; margin-top: 1.5rem; }
.results-layout-cardinal .results-count-strip { background: transparent; border: 0; padding-left: 0; }
/* Unified results card: one bordered container, hairline-divided entries */
.cardinal-results { display: grid; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.results-layout-cardinal .result-card { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 1.1rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1.3rem 1.5rem; background: #fff; box-shadow: none; }
.results-layout-cardinal .result-card:last-child { border-bottom: 0; }
.results-layout-cardinal .result-card:hover { transform: none; box-shadow: none; background: var(--surface-soft); }
/* Numbering language: bare serif numerals against a hairline divider —
   law-journal enumeration, no circles. */
.results-layout-cardinal .result-rank { display: grid; place-items: start end; padding: 0 .75rem 0 0; background: transparent; border-right: 1px solid var(--line); }
.results-layout-cardinal .result-rank span { width: auto; height: auto; background: transparent; border: 0; color: var(--cardinal-red); font-family: "Noto Serif", "Source Serif 4", Georgia, serif; font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
/* Source tiles: outlined squares (vs Answer's filled circles) */
.results-layout-cardinal .engine-tile-num { border-radius: 5px; background: transparent; border: 1px solid rgba(140,21,21,.45); color: var(--cardinal-red); }
/* Citation pills squared to match the brief aesthetic */
.results-layout-cardinal .citation-chip { border-radius: 6px; }
.results-layout-cardinal .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-cardinal .result-card h3 { font-family: "Noto Serif", "Source Serif 4", Georgia, serif; font-size: 1.24rem; white-space: normal; overflow: visible; text-overflow: clip; }
.results-layout-cardinal .snippet { font-size: .95rem; line-height: 1.65; }
@media (max-width: 600px) {
  .results-layout-cardinal .result-card { grid-template-columns: 1fr; padding: 1.1rem 1rem; }
  .results-layout-cardinal .result-rank { display: none; }
}

/* ---- EDITORIAL: centered serif reading column, drop cap, footnotes ---- */
.results-layout-editorial .results-shell { display: block; }
.results-layout-editorial .results-shell > * { max-width: 840px; margin: 0 auto 1.1rem; }
.answer-editorial { position: relative; padding-top: .5rem; }
.answer-editorial .ed-kicker { margin: 0 0 1.1rem; text-align: center; color: var(--cardinal-red); text-transform: uppercase; letter-spacing: .3em; padding-left: .3em; font-size: .74rem; font-weight: 800; }
.answer-editorial .ed-actions { position: absolute; top: .2rem; right: 0; }
.answer-editorial .ed-actions button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; display: inline-flex; gap: .35rem; align-items: center; color: var(--ink-soft); }
.answer-editorial .ed-actions button:hover { color: var(--cardinal-red); border-color: rgba(140,21,21,.35); }
.answer-editorial .summary-body { font-family: "Noto Serif", "Source Serif 4", Georgia, serif; font-size: 1.14rem; line-height: 1.85; color: var(--ink); }
.answer-editorial .summary-body h2 { text-align: center; font-size: clamp(1.6rem, 3vw, 2.05rem); line-height: 1.2; margin: 0 0 1.2rem; }
.answer-editorial .summary-body h2::after { content: ""; display: block; width: 64px; height: 3px; background: var(--cardinal-red); margin: .85rem auto 0; }
.answer-editorial .summary-body h3 { font-size: 1.28rem; margin-top: 1.6rem; }
.answer-editorial .summary-body > p:first-of-type::first-letter { float: left; font-family: "Noto Serif", Georgia, serif; font-size: 3.3em; line-height: .82; padding: .08em .14em 0 0; color: var(--cardinal-red); font-weight: 700; }
.answer-editorial .summary-body p { max-width: none; }
.answer-editorial .ed-sources { margin-top: 2rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.answer-editorial .ed-sources h3 { font-family: "Public Sans", sans-serif; font-size: .74rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-muted); margin: 0 0 .7rem; }
.ed-divider { text-align: center; color: var(--cardinal-red); letter-spacing: .9em; padding-left: .9em; font-size: .68rem; margin: 1.5rem auto; }
.ed-results { display: block; }
.results-layout-editorial .results-count-strip { background: transparent; border: 0; justify-content: center; }
.results-layout-editorial .result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1.35rem .25rem; box-shadow: none; }
.results-layout-editorial .result-card:hover { transform: none; box-shadow: none; background: var(--surface-soft); }
/* Numbering language: italic serif numerals, plain ink — print folio style */
.results-layout-editorial .result-rank { display: block; padding: 0; background: transparent; border: 0; }
.results-layout-editorial .result-rank span { width: auto; height: auto; background: transparent; border: 0; color: var(--ink-muted); font-family: "Noto Serif", "Source Serif 4", Georgia, serif; font-style: italic; font-size: 1.3rem; font-weight: 500; line-height: 1.2; }
/* Citations as academic superscripts instead of pills */
.results-layout-editorial .citation-chip { min-width: 0; height: auto; padding: 0 .12rem; margin: 0; background: transparent; border: 0; color: var(--cardinal-red); font-size: .68em; vertical-align: super; font-weight: 700; }
.results-layout-editorial .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-editorial .result-card h3 { font-family: "Noto Serif", Georgia, serif; font-size: 1.32rem; white-space: normal; overflow: visible; text-overflow: clip; }
.results-layout-editorial .snippet { font-family: "Noto Serif", Georgia, serif; font-size: .97rem; line-height: 1.75; }

/* ---- GRID: dashboard — stat bar, prominent answer card, 3-col results ---- */
.grid-statbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.grid-stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--cardinal-red); border-radius: 14px; padding: .9rem 1.1rem; display: flex; align-items: baseline; gap: .6rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.grid-stat strong { font-family: "Noto Serif", Georgia, serif; font-size: 1.7rem; color: var(--cardinal-red); line-height: 1; }
.grid-stat span { color: var(--ink-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
/* Answer card is a two-column grid: summary fills the left (no 66ch cap →
   no dead right gap), sources stack in a right rail. */
.grid-answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: clamp(1.2rem, 2.5vw, 2rem); background: linear-gradient(135deg, #ffffff, #fdf9f8); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.3rem, 2.6vw, 2rem); box-shadow: 0 10px 34px rgba(15,23,42,.06); }
.grid-answer-main { min-width: 0; }
.grid-answer .summary-body p { max-width: none; }
.grid-answer .eyebrow { margin-bottom: .6rem; }
.grid-sources { min-width: 0; border-left: 1px solid var(--line); padding-left: clamp(1rem, 2vw, 1.5rem); }
.grid-sources .source-chips { flex-direction: column; }
.grid-sources .source-chip { max-width: none; width: 100%; }
.grid-sources .source-chip-text strong { max-width: none; }
@media (max-width: 900px) {
  .grid-answer { grid-template-columns: 1fr; }
  .grid-sources { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .grid-sources .source-chips { flex-direction: row; flex-wrap: wrap; }
  .grid-sources .source-chip { width: auto; max-width: 340px; }
}
.grid-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; align-items: stretch; }
.results-layout-grid .result-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 3px solid var(--cardinal-red); border-radius: 14px; padding: 1.05rem 1.1rem; background: #fff; }
/* Numbering language: corner tag — small mono badge pinned top-right of the card */
.results-layout-grid .result-rank { display: block; position: absolute; top: .65rem; right: .65rem; padding: 0; background: transparent; border: 0; }
.results-layout-grid .result-rank span { width: 26px; height: 26px; border-radius: 7px; background: rgba(140,21,21,.08); border: 1px solid rgba(140,21,21,.22); color: var(--cardinal-red); font-family: Consolas, ui-monospace, monospace; font-size: .72rem; font-weight: 700; }
.results-layout-grid .result-kicker { padding-right: 2.4rem; }
.results-layout-grid .source-chip-num { border-radius: 6px; }
.results-layout-grid .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-grid .result-card h3 { white-space: normal; overflow: visible; text-overflow: clip; font-size: 1.05rem; }
.results-layout-grid .snippet { font-size: .88rem; }
@media (max-width: 1100px) { .grid-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-results { grid-template-columns: 1fr; } .grid-statbar { grid-template-columns: 1fr; } }

/* ---- MINIMAL: borderless, whitespace-led, plain reading list ---- */
/* One centered reading column, every block flush to the SAME left edge —
   no indents, no boxes, just hairline rules and whitespace. */
.results-layout-minimal .results-shell { display: block; }
.results-layout-minimal .results-shell > * { max-width: 820px; margin: 0 auto 1.15rem; }
.answer-min { padding-top: .4rem; border-bottom: 1px solid var(--line); padding-bottom: 1.6rem; }
.min-label { display: flex; align-items: center; gap: .8rem; margin: 0 0 .75rem; color: var(--ink-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.min-label button { border: 0; background: transparent; color: var(--cardinal-red); font-size: .78rem; display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .45rem; border-radius: 6px; letter-spacing: normal; text-transform: none; font-weight: 700; }
.min-label button:hover { background: rgba(140,21,21,.06); }
.answer-min .summary-body { font-size: 1.03rem; }
.answer-min .summary-body h2 { font-size: 1.5rem; margin-top: 0; }
.answer-min .summary-body p { max-width: none; }
.min-sources { margin-top: 1.6rem; }
.results-layout-minimal .results-count-strip { background: transparent; border: 0; padding-left: 0; }
.min-results { display: block; }
.results-layout-minimal .result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1.15rem 0; box-shadow: none; }
.results-layout-minimal .result-card:hover { transform: none; box-shadow: none; }
/* Numbering language: bare mono digits, no enclosure — pure zen */
.results-layout-minimal .result-rank { display: block; padding: .25rem 0 0; background: transparent; border: 0; }
.results-layout-minimal .result-rank span { width: auto; height: auto; background: transparent; border: 0; color: var(--ink-muted); font-family: Consolas, ui-monospace, monospace; font-size: .82rem; font-weight: 500; }
.results-layout-minimal .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-minimal .result-card h3 { white-space: normal; overflow: visible; text-overflow: clip; font-family: "Public Sans", sans-serif; font-weight: 700; font-size: 1.16rem; }
.results-layout-minimal .result-card h3 a { color: var(--cardinal-red); }
.results-layout-minimal .result-kicker span { background: transparent; padding: 0; color: var(--ink-muted); font-weight: 500; font-family: Consolas, ui-monospace, monospace; font-size: .78rem; letter-spacing: 0; }

/* ---- IVORY: light twin of Slate — identical composition on a soft light
   palette (white cards, cardinal-ring numbering with a subtle halo). ---- */
.results-layout-ivory { background: linear-gradient(180deg, #fbfbfc, #f1f3f6 45%, #fbfbfc); }
.ivory-answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: clamp(1.2rem, 2.5vw, 2rem); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.3rem, 2.6vw, 2rem); box-shadow: 0 20px 60px rgba(15,23,42,.08); }
.ivory-answer-main { min-width: 0; }
.results-layout-ivory .summary-body p { max-width: none; }
.ivory-sources { min-width: 0; border-left: 1px solid var(--line); padding-left: clamp(1rem, 2vw, 1.5rem); }
.ivory-sources .eyebrow { margin-bottom: .6rem; }
.ivory-sources .source-chips { flex-direction: column; }
.ivory-sources .source-chip { max-width: none; width: 100%; }
.ivory-sources .source-chip-text strong { max-width: none; }
.ivory-results { display: grid; gap: .8rem; }
.results-layout-ivory .result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.results-layout-ivory .result-card:hover { border-color: rgba(140,21,21,.35); background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.09); transform: none; }
/* Numbering language: cardinal-ring circles with a soft halo (light mirror
   of Slate's glow rings) */
.results-layout-ivory .result-rank { display: grid; place-items: start center; padding: .1rem 0 0; background: transparent; border: 0; }
.results-layout-ivory .result-rank span { width: 30px; height: 30px; border-radius: 50%; background: rgba(140,21,21,.07); border: 1px solid rgba(140,21,21,.42); color: var(--cardinal-red); font-family: "Public Sans", sans-serif; font-size: .78rem; font-weight: 800; box-shadow: 0 0 12px rgba(140,21,21,.16); }
.results-layout-ivory .source-chip-num { background: rgba(140,21,21,.09); color: var(--cardinal-red); border: 1px solid rgba(140,21,21,.4); box-shadow: 0 0 8px rgba(140,21,21,.14); }
.results-layout-ivory .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-ivory .result-card h3 { white-space: normal; overflow: visible; text-overflow: clip; }
@media (max-width: 900px) {
  .ivory-answer { grid-template-columns: 1fr; }
  .ivory-sources { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .ivory-sources .source-chips { flex-direction: row; flex-wrap: wrap; }
  .ivory-sources .source-chip { width: auto; max-width: 340px; }
}

/* ---- SLATE: dark executive theme — deep navy, glass cards, cardinal accents ---- */
.results-layout-slate { background: linear-gradient(180deg, #0f172a, #141d33 45%, #0f172a); color: #cbd5e1; }
.results-layout-slate .sticky-search { background: rgba(15,23,42,.9); border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 1px 12px rgba(0,0,0,.4); }
.results-layout-slate .layout-switcher-label { color: #64748b; }
.results-layout-slate .layout-opt { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #cbd5e1; }
.results-layout-slate .layout-opt:hover:not(.is-active) { background: rgba(255,255,255,.12); }
.results-layout-slate .layout-opt.is-active { background: var(--cardinal-red); border-color: var(--cardinal-red); color: #fff; }
.results-layout-slate .search-mode-toggle .mode-pill--followup { background: rgba(59,130,246,.16); border-color: rgba(147,197,253,.35); color: #93c5fd; }
.results-layout-slate .search-mode-toggle .mode-pill--reset { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #cbd5e1; }
.results-layout-slate .conversation-chain { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.results-layout-slate .chain-label { color: #94a3b8; }
.results-layout-slate .chain-chip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fca5a5; }
.results-layout-slate .chain-chip--current { background: var(--cardinal-red); color: #fff; }
.results-layout-slate .chain-arrow { color: #64748b; }
.results-layout-slate .rewrite-caption { color: #94a3b8; }
.results-layout-slate .rewrite-caption em { color: #e2e8f0; }
.slate-answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: clamp(1.2rem, 2.5vw, 2rem); background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.10); border-radius: 18px; padding: clamp(1.3rem, 2.6vw, 2rem); backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.slate-answer-main { min-width: 0; }
.results-layout-slate .summary-body p { max-width: none; }
.results-layout-slate .summary-header { border-bottom-color: rgba(255,255,255,.1); }
.results-layout-slate .summary-header > span { color: #f87171; }
.results-layout-slate .summary-header button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #cbd5e1; }
.results-layout-slate .summary-body h2, .results-layout-slate .summary-body h3, .results-layout-slate .summary-body h4 { color: #f8fafc; }
.results-layout-slate .summary-body p, .results-layout-slate .summary-body li { color: #cbd5e1; }
.results-layout-slate .summary-body li::marker { color: #f87171; }
.results-layout-slate .citation-chip { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.4); color: #fca5a5; }
.results-layout-slate .ask-next-under-summary { border-top-color: rgba(255,255,255,.1); }
.results-layout-slate .ask-next-under-summary .eyebrow { color: #f87171; }
.results-layout-slate .related-mini-list button { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #e2e8f0; box-shadow: none; }
.results-layout-slate .related-mini-list button:hover, .results-layout-slate .related-mini-list button:focus-visible { background: rgba(248,113,113,.12); color: #fecaca; border-color: rgba(248,113,113,.35); }
.results-layout-slate .feedback-strip { border-top-color: rgba(255,255,255,.1); color: #94a3b8; }
.results-layout-slate .feedback-strip button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); }
.results-layout-slate .comment-box label { color: #94a3b8; }
.results-layout-slate .comment-box textarea { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #e2e8f0; }
.slate-sources { min-width: 0; border-left: 1px solid rgba(255,255,255,.1); padding-left: clamp(1rem, 2vw, 1.5rem); }
.slate-sources .eyebrow { color: #f87171; margin-bottom: .6rem; }
.slate-sources .source-chips { flex-direction: column; }
.slate-sources .source-chip { max-width: none; width: 100%; }
.slate-sources .source-chip-text strong { max-width: none; }
@media (max-width: 900px) {
  .slate-answer { grid-template-columns: 1fr; }
  .slate-sources { border-left: 0; border-top: 1px solid rgba(255,255,255,.1); padding: 1rem 0 0; }
  .slate-sources .source-chips { flex-direction: row; flex-wrap: wrap; }
  .slate-sources .source-chip { width: auto; max-width: 340px; }
}
.results-layout-slate .source-chip { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #e2e8f0; }
.results-layout-slate .source-chip:hover { background: rgba(255,255,255,.1); border-color: rgba(248,113,113,.4); }
.results-layout-slate .source-chip-text small { color: #94a3b8; }
.results-layout-slate .results-count-strip { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color: #94a3b8; }
.slate-results { display: grid; gap: .8rem; }
.results-layout-slate .result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: none; }
.results-layout-slate .result-card:hover { border-color: rgba(248,113,113,.35); background: rgba(255,255,255,.07); box-shadow: 0 12px 30px rgba(0,0,0,.3); transform: none; }
/* Numbering language: glowing red-ring circles tuned for the dark theme */
.results-layout-slate .result-rank { display: grid; place-items: start center; padding: .1rem 0 0; background: transparent; border: 0; }
.results-layout-slate .result-rank span { width: 30px; height: 30px; border-radius: 50%; background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.45); color: #fca5a5; font-family: "Public Sans", sans-serif; font-size: .78rem; font-weight: 800; box-shadow: 0 0 12px rgba(248,113,113,.25); }
.results-layout-slate .source-chip-num { background: rgba(248,113,113,.18); color: #fca5a5; box-shadow: 0 0 8px rgba(248,113,113,.2); }
.results-layout-slate .result-main-copy { padding: 0; min-width: 0; overflow-wrap: anywhere; }
.results-layout-slate .result-card h3 { color: #f1f5f9; white-space: normal; overflow: visible; text-overflow: clip; }
.results-layout-slate .result-card h3 a { color: #f1f5f9; }
.results-layout-slate .result-card h3 a:hover { color: #fca5a5; }
.results-layout-slate .result-title-icon { color: #f87171; }
.results-layout-slate .result-kicker span { background: rgba(248,113,113,.12); color: #fca5a5; }
.results-layout-slate .breadcrumbs, .results-layout-slate .context-note { color: #94a3b8; border-color: rgba(255,255,255,.14); background: transparent; }
.results-layout-slate .snippet { color: #cbd5e1; }
.results-layout-slate mark { background: rgba(254,240,138,.22); color: #fef9c3; }
.results-layout-slate .pagination button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #e2e8f0; }
.results-layout-slate .pagination button.active-page { background: var(--cardinal-red); border-color: var(--cardinal-red); color: #fff; }
.results-layout-slate .md-table-wrap { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.results-layout-slate .md-table th { background: rgba(255,255,255,.06); color: #e2e8f0; border-bottom-color: rgba(255,255,255,.14); }
.results-layout-slate .md-table td { border-bottom-color: rgba(255,255,255,.08); color: #cbd5e1; }
.results-layout-slate .md-table tr:nth-child(even) td { background: rgba(255,255,255,.03); }
.results-layout-slate .search-stages { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
.results-layout-slate .search-stage { color: #94a3b8; }
.results-layout-slate .shimmer { background: linear-gradient(90deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.05) 100%); background-size: 220% 100%; border-color: rgba(255,255,255,.08); }
.results-layout-slate .no-results { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: #cbd5e1; }
.results-layout-slate .no-results h2 { color: #f1f5f9; }
.results-layout-slate .no-results button, .results-layout-slate .no-results a { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fca5a5; }
/* ======================================================================= */

.result-card { border-radius: 12px; padding: 1rem; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.result-card:hover, .result-card-focused { border-color: rgba(140,21,21,.35); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(15,23,42,.07); }
.result-card h3 { font-size: 1.16rem; margin: 0 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-card h3 a { color: var(--ink); text-decoration: none; }
.result-card h3 a:hover { color: var(--cardinal-red); text-decoration: underline; text-underline-offset: 3px; }
.result-title-icon { display: inline; margin-left: 0.38rem; color: var(--cardinal-red); vertical-align: -0.15em; }
.section-path, .breadcrumbs { color: var(--ink-muted); margin: .25rem 0; font-size: .88rem; }
.breadcrumbs { font-size: .78rem; }
.context-note { color: var(--ink-muted); font-size: .83rem; font-style: italic; border-left: 2px solid var(--line); padding-left: .6rem; margin: .75rem 0; }
.snippet { font-size: .95rem; color: var(--ink-soft); line-height: 1.62; }
mark { background: var(--highlight); color: var(--ink); border-radius: 3px; padding: 0 .12rem; }
.result-footer { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .8rem; }
.result-footer > a { color: var(--cardinal-red); display: inline-flex; align-items: center; gap: .25rem; font-weight: 800; text-decoration: none; }
.result-footer > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.updated-pill, .domain-pill { border-radius: 999px; padding: .28rem .55rem; font-size: .78rem; }
.updated-pill { background: rgba(180,83,9,.11); color: var(--warn); }
.domain-pill { background: var(--surface-soft); color: var(--ink-muted); }
.result-feedback { margin-left: auto; display: flex; align-items: center; gap: .35rem; color: var(--ink-muted); font-size: .86rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: .4rem; margin-top: 1rem; }
.pagination button { width: 36px; height: 36px; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 10px; display: grid; place-items: center; }
.pagination button.active-page { background: var(--cardinal-red); color: white; border-color: var(--cardinal-red); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.loading-stack { display: grid; gap: 1rem; }
/* Search-progress stages — three stages cycle through dim → spinning → done
   via staggered animation-delay. animation-fill-mode: forwards pins the last
   keyframe so if the search is slow the final stage stays in spinning state
   until render() replaces this DOM. */
.search-stages { display: grid; gap: .85rem; padding: 1rem 1.25rem 1.1rem; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.search-stages-title { display: flex; align-items: center; color: var(--cardinal-red); }
.search-stages-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.search-stage { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: .65rem; color: var(--ink-muted); font-size: .92rem; opacity: .45; }
.search-stage .stage-icon { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; box-sizing: border-box; position: relative; }
.search-stage.stage-1 { animation: stageRun 8s ease-out 0s 1 forwards; }
.search-stage.stage-2 { animation: stageRun 8s ease-out 1.8s 1 forwards; }
.search-stage.stage-3 { animation: stageRunFinal 8s ease-out 4.0s 1 forwards; }
.search-stage.stage-1 .stage-icon { animation: stageIcon 8s ease-out 0s 1 forwards; }
.search-stage.stage-2 .stage-icon { animation: stageIcon 8s ease-out 1.8s 1 forwards; }
.search-stage.stage-3 .stage-icon { animation: stageIconFinal 1.2s linear 4.0s infinite; }
@keyframes stageRun {
  0%   { opacity: 1; color: var(--cardinal-red); }
  35%  { opacity: 1; color: var(--cardinal-red); }
  45%  { opacity: 1; color: var(--ok); }
  100% { opacity: 1; color: var(--ok); }
}
@keyframes stageRunFinal {
  0%, 100% { opacity: 1; color: var(--cardinal-red); }
}
@keyframes stageIcon {
  0%   { transform: rotate(0deg);   border-color: transparent var(--cardinal-red) var(--cardinal-red) var(--cardinal-red); }
  35%  { transform: rotate(900deg); border-color: transparent var(--cardinal-red) var(--cardinal-red) var(--cardinal-red); }
  45%  { transform: rotate(0deg);   border-color: var(--ok); background: var(--ok); }
  100% { transform: rotate(0deg);   border-color: var(--ok); background: var(--ok); }
}
@keyframes stageIconFinal {
  0%   { transform: rotate(0deg);   border-color: transparent var(--cardinal-red) var(--cardinal-red) var(--cardinal-red); }
  100% { transform: rotate(360deg); border-color: transparent var(--cardinal-red) var(--cardinal-red) var(--cardinal-red); }
}
.search-stage.stage-1 .stage-icon::after,
.search-stage.stage-2 .stage-icon::after { content: ''; position: absolute; left: 3.5px; top: 0px; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
.search-stage.stage-1 .stage-icon::after { animation: checkFade 8s ease-out 0s 1 forwards; }
.search-stage.stage-2 .stage-icon::after { animation: checkFade 8s ease-out 1.8s 1 forwards; }
@keyframes checkFade { 0%, 44% { opacity: 0; } 46%, 100% { opacity: 1; } }

.shimmer { border-radius: 14px; background: linear-gradient(90deg, #f3f4f6 0%, #fff 50%, #f3f4f6 100%); background-size: 220% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }
.summary-placeholder { height: 320px; }
.result-placeholder { height: 150px; }
.no-results { border-radius: 16px; padding: 2rem; text-align: center; color: var(--ink-soft); }
.no-results svg { color: var(--cardinal-red); margin: 0 auto .75rem; }
.no-results h2 { margin: 0 0 .5rem; }
.no-results div { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.no-results button, .no-results a { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--cardinal-red); padding: .6rem .9rem; text-decoration: none; font-weight: 800; }
.reveal { animation: reveal .42s ease both; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; } }
@media (max-width: 1023px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } .summary-card { grid-template-columns: 1fr; } .summary-art { display: none; } .search-button span { display: none; } .search-button { min-width: 64px; } }
@media (max-width: 767px) { .desktop-nav { display: none; } .hamburger { display: inline-grid; place-items: center; } .footer-grid { grid-template-columns: 1fr; padding: 1.25rem 0; } .hero-section { padding: 2.5rem 1rem; } .hero-card { border-radius: 18px; } .search-shell { grid-template-columns: 1fr; overflow: hidden; } .source-trigger { width: 100%; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; } .search-shell input { min-width: 0; min-height: 52px; } .search-button { min-height: 52px; width: 100%; border-radius: 0 0 13px 13px; } .search-button span { display: inline; } .source-popover { position: fixed; inset: auto 1rem 1rem 1rem; top: auto; width: auto; max-height: 70vh; } .topic-grid, .step-grid { grid-template-columns: 1fr; } .summary-header, .result-footer { align-items: flex-start; flex-direction: column; } .result-feedback { margin-left: 0; } .sticky-search { top: 64px; } }
@media (max-width: 480px) { .chrome-shell, .content-shell { width: min(100% - 24px, 1120px); } .hero-card h1 { font-size: 2rem; } .first-nudge { align-items: flex-start; } .brand span { font-size: .98rem; } .topics-section, .how-section { padding: 3rem 0; } .summary-copy { padding: 1rem; } }

.evidence-workspace { position: relative; grid-template-columns: 4.75rem minmax(0, 1.18fr) minmax(280px, .82fr); border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,255,255,.88)), radial-gradient(circle at 78% 20%, rgba(140,21,21,.16), transparent 22rem); box-shadow: 0 28px 70px rgba(15,23,42,.12); border: 1px solid rgba(140,21,21,.12); }
.answer-workbench { grid-template-columns: minmax(0, 1.34fr) minmax(21rem, 0.66fr); overflow: hidden; border-color: rgba(140, 21, 21, 0.12); box-shadow: 0 24px 70px rgba(31, 35, 46, 0.08); }
.simplified-answer { position: relative; padding-block: clamp(0.85rem, 1.8vw, 1.25rem); }
.simplified-answer p { max-width: 66ch; font-size: clamp(1.02rem, 1.5vw, 1.13rem); }
.answer-disclaimer { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.55rem; border: 1px solid color-mix(in oklch, var(--stanford-cardinal) 24%, transparent); background: color-mix(in oklch, var(--stanford-cardinal) 6%, white); color: var(--stanford-cardinal-dark); padding: 0.68rem 0.85rem; border-radius: 999px; font-size: 0.86rem; }
.answer-side-panel { position: relative; border-left: 1px solid rgba(140, 21, 21, 0.12); background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(247,242,238,.88)), radial-gradient(circle at 50% 5%, rgba(140,21,21,.12), transparent 32%); padding: clamp(1.15rem, 2vw, 1.65rem); display: flex; align-items: stretch; }
.answer-side-panel::before { content: ""; position: absolute; left: -1px; top: 4.4rem; bottom: 4.4rem; width: 3px; border-radius: 999px; background: linear-gradient(180deg, var(--stanford-cardinal), rgba(140,21,21,.12)); }
.answer-side-panel .citations-only-card { position: sticky; top: 8.5rem; align-self: stretch; width: 100%; min-height: 100%; }
.source-panel-card { border: 1px solid rgba(140,21,21,.14); background: rgba(255,255,255,.84); border-radius: 1.4rem; padding: clamp(1rem, 1.8vw, 1.25rem); box-shadow: 0 18px 44px rgba(31,35,46,.08); backdrop-filter: blur(12px); display: flex; flex-direction: column; }
.citation-panel-top { display: grid; gap: 0.22rem; margin-bottom: 0.95rem; }
.citation-panel-top .eyebrow { margin-bottom: 0; }
.citation-panel-top strong { color: var(--ink); font-size: 0.98rem; line-height: 1.28; }
.citation-panel-top span { color: var(--muted-ink); font-size: 0.86rem; line-height: 1.45; }
.citation-thread { position: relative; display: grid; align-content: start; gap: 0.68rem; flex: 1; }
.citation-thread::before { content: ""; position: absolute; left: 1.36rem; top: 1.15rem; bottom: -1.15rem; width: 1px; background: linear-gradient(180deg, rgba(140,21,21,.18), rgba(140,21,21,.08)); }
.citation-row { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.72rem; padding: 0.78rem; color: var(--ink); text-decoration: none; border: 1px solid rgba(31,35,46,.08); border-radius: 1rem; background: rgba(255,255,255,.82); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.citation-row .citation-badge { grid-row: span 3; width: 2.55rem; height: 2.55rem; aspect-ratio: 1 / 1; display: inline-flex; align-items: center; justify-content: center; align-self: center; color: white; background: var(--cardinal-red); border: 2px solid rgba(255,255,255,.95); border-radius: 50%; font-family: "Source Serif 4", Georgia, serif; font-weight: 900; font-size: 1.05rem; line-height: 1; box-shadow: 0 0 0 4px rgba(140,21,21,.09), 0 8px 18px rgba(140,21,21,.16); }
.citation-row strong { font-size: 0.94rem; }
.citation-row .citation-title { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.94rem; color: var(--cardinal-red); }
.citation-row .citation-ext { display: inline-flex; width: 0.95rem; height: 0.95rem; opacity: 0.7; }
.citation-row .citation-ext svg { width: 100%; height: 100%; }
.citation-row .citation-host { font-size: 0.78rem; color: var(--ink-muted); font-family: Consolas, ui-monospace, monospace; letter-spacing: 0.01em; }
.citation-row em { color: var(--muted-ink); font-style: normal; font-size: 0.82rem; line-height: 1.4; }
.citation-row:hover, .citation-row:focus-visible { transform: translateX(-2px) translateY(-1px); border-color: rgba(140,21,21,.24); box-shadow: 0 12px 26px rgba(31,35,46,.08); outline: none; }
.citation-row:hover .citation-title, .citation-row:focus-visible .citation-title { text-decoration: underline; text-underline-offset: 3px; }
.citation-row:hover .citation-ext, .citation-row:focus-visible .citation-ext { opacity: 1; }
.ask-next-under-summary { margin-top: clamp(0.95rem, 1.8vw, 1.35rem); padding-top: clamp(0.85rem, 1.5vw, 1rem); border-top: 1px solid rgba(140,21,21,.12); }
.ask-next-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.ask-next-heading .eyebrow { margin-bottom: 0; }
.ask-next-heading span { color: var(--muted-ink); font-size: 0.86rem; }
.ask-next-under-summary .related-mini-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.related-mini-list { display: grid; gap: 0.75rem; }
.related-mini-list button { min-height: 2.8rem; display: inline-flex; align-items: flex-start; justify-content: flex-start; gap: 0.45rem; border: 1px solid rgba(31,35,46,.09); background: rgba(255,255,255,.92); color: var(--ink); text-align: left; border-radius: 999px; padding: 0.68rem 0.9rem; cursor: pointer; box-shadow: 0 6px 14px rgba(31,35,46,.035); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.related-mini-list button span { overflow: visible; text-overflow: clip; white-space: normal; font-size: 0.9rem; line-height: 1.32; }
.related-mini-list button:hover, .related-mini-list button:focus-visible { border-color: color-mix(in oklch, var(--stanford-cardinal) 34%, transparent); background: color-mix(in oklch, var(--stanford-cardinal) 5%, white); color: var(--stanford-cardinal-dark); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31,35,46,.07); outline: none; }
.simplified-lanes .result-card { grid-template-columns: auto minmax(0, 1fr); }
.evidence-lanes { position: relative; gap: .85rem; }
.evidence-lanes::before { content: ""; position: absolute; left: 1.9rem; top: 1rem; bottom: 1rem; width: 2px; background: linear-gradient(var(--cardinal-red), rgba(140,21,21,.08)); opacity: .28; }
.evidence-lanes .result-card { position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: stretch; padding: 0; overflow: hidden; background: linear-gradient(120deg, rgba(255,255,255,.96), rgba(255,255,255,.88)), radial-gradient(circle at 92% 16%, rgba(140,21,21,.08), transparent 12rem); border-radius: 20px; }
.result-rank { display: grid; place-items: start center; padding-top: 1rem; background: linear-gradient(180deg, rgba(140,21,21,.08), rgba(140,21,21,.015)); border-right: 1px solid rgba(140,21,21,.10); }
.result-rank span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 999px; background: white; color: var(--cardinal-red); border: 1px solid rgba(140,21,21,.25); font-family: "Source Serif 4", Georgia, serif; font-weight: 800; }
/* Cards the answer cited carry their [n] marker instead of a positional
   number, styled like the inline citation chips so the two read as the same
   reference. Uncited cards keep the muted positional badge. */
.result-rank span.rank-cite { background: rgba(140,21,21,.1); border-color: rgba(140,21,21,.35); font-family: "Public Sans", sans-serif; font-weight: 800; font-size: .84rem; letter-spacing: -.02em; }
.result-card--cited { border-color: rgba(140,21,21,.28); }
.results-layout-slate .result-rank span.rank-cite { background: rgba(248,113,113,.16); border-color: rgba(248,113,113,.5); color: #fca5a5; }
.results-layout-ivory .result-rank span.rank-cite { background: rgba(140,21,21,.09); }
.result-main-copy { padding: 1rem 1rem 1rem 0; min-width: 0; }
.result-kicker { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .45rem; }
.result-kicker span { border-radius: 999px; background: rgba(140,21,21,.07); color: var(--cardinal-red); padding: .25rem .55rem; font-size: .78rem; font-weight: 900; letter-spacing: .02em; }
.evidence-lanes .result-card h3 { font-size: 1.32rem; white-space: normal; overflow: visible; text-overflow: clip; }
.evidence-lanes .section-path { color: var(--cardinal-dark); font-weight: 700; }
.evidence-lanes .context-note { background: rgba(248,250,252,.75); border-left-color: rgba(140,21,21,.34); border-radius: 0 10px 10px 0; padding-top: .55rem; padding-bottom: .55rem; }
@media (max-width: 900px) { .answer-workbench { grid-template-columns: 1fr; } .answer-side-panel { border-left: 0; border-top: 1px solid var(--line); } .answer-side-panel .citations-only-card { position: static; } .ask-next-under-summary .related-mini-list { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .evidence-lanes::before { display: none; } .evidence-lanes .result-card { grid-template-columns: 1fr; } .result-rank { display: none; } .result-main-copy { padding: 1rem; } }

/* ---- Conversational follow-up ----
   Breadcrumb chip strip at the top of the results shell, "Searched as:"
   caption above the AI Summary, and the always-visible follow-up input bar
   at the bottom of the results stream. State lives client-side for v1; see
   ADMIN_RUNBOOK.md for the migration path to server-side conversations. */
.conversation-chain { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .65rem; padding: .65rem .9rem; margin-bottom: 1rem; background: rgba(140,21,21,.04); border: 1px solid rgba(140,21,21,.14); border-radius: 12px; }
.conversation-chain .chain-label { color: var(--ink-soft); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.conversation-chain .chain-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; flex: 1 1 auto; min-width: 0; }
.conversation-chain .chain-arrow { color: var(--ink-muted); font-size: .9rem; padding: 0 .15rem; }
.conversation-chain .chain-chip { border: 1px solid rgba(140,21,21,.28); background: white; color: var(--cardinal-red); padding: .3rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; cursor: pointer; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-chain .chain-chip:hover:not([disabled]) { background: rgba(140,21,21,.07); }
.conversation-chain .chain-chip--current { background: var(--cardinal-red); color: white; cursor: default; }
.conversation-chain .chain-reset { border: 0; background: transparent; color: var(--cardinal-red); font-size: .82rem; font-weight: 700; padding: .3rem .55rem; border-radius: 8px; cursor: pointer; }
.conversation-chain .chain-reset:hover { background: rgba(140,21,21,.08); }

.rewrite-caption { margin: 0 0 .8rem; font-size: .82rem; color: var(--ink-muted); }
.rewrite-caption em { color: var(--ink-soft); font-style: normal; font-weight: 600; }

/* Mode-toggle pill below the search bar — flips between "Ask follow-up" (a
   light-blue affordance, attention-getting since it surfaces a new
   capability) and "New search" (a neutral grey "back to default" pill).
   Sits flush under the search bar, right-aligned. */
.search-mode-toggle { display: flex; justify-content: flex-end; padding: .5rem .25rem 0; }
.search-mode-toggle .mode-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.search-mode-toggle .mode-pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.search-mode-toggle .mode-pill:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
/* Default (search mode) → "Ask follow-up" — light-blue pill with chat+ icon */
.search-mode-toggle .mode-pill--followup {
  background: #eff6ff;        /* sky-50 */
  color: #1d4ed8;             /* blue-700 */
  border: 1px solid #bfdbfe;  /* blue-200 */
}
.search-mode-toggle .mode-pill--followup:hover { background: #dbeafe; border-color: #93c5fd; }
/* Follow-up mode active → "New search" — neutral pill (de-emphasized "go back" action) */
.search-mode-toggle .mode-pill--reset {
  background: #f1f5f9;        /* slate-100 */
  color: #475569;             /* slate-600 */
  border: 1px solid #cbd5e1;  /* slate-300 */
}
.search-mode-toggle .mode-pill--reset:hover { background: #e2e8f0; border-color: #94a3b8; }
@media (max-width: 600px) {
  .conversation-chain { gap: .35rem .5rem; padding: .55rem .65rem; }
  .conversation-chain .chain-chip { max-width: 18ch; font-size: .78rem; }
}

/* Markdown tables — used in result snippets and in the AI Summary when the
   crawled content (or LLM) emits a pipe-table. Wrapper is horizontally
   scrollable so wide tables don't blow out the column width. */
.md-table-wrap { overflow-x: auto; margin: .55rem 0 .55rem; border: 1px solid var(--line); border-radius: 8px; background: white; }
.md-table { width: 100%; border-collapse: collapse; font-size: .86rem; line-height: 1.4; }
.md-table th, .md-table td { padding: .45rem .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md-table th { background: #f8fafc; color: var(--ink); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom-color: #e2e8f0; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table tr:nth-child(even) td { background: rgba(248, 250, 252, .55); }
.summary-body .md-table-wrap { margin: .65rem 0; }

/* --- Debug pane (?debug=1) -------------------------------------------------
   Deliberately plain and dense: a diagnostic surface, not product UI.
   Monospace, tight rows, and red/green rows so a bad citation is obvious. */
.debug-pane { margin-top: 2rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfc; padding: 1rem 1.15rem; font-family: Consolas, ui-monospace, monospace; }
.debug-pane h3 { font-family: "Public Sans", sans-serif; font-size: 1rem; margin: 0 0 .8rem; display: flex; align-items: baseline; gap: .6rem; }
.debug-hint { font-size: .72rem; color: var(--ink-muted); font-weight: 400; font-family: Consolas, monospace; }
.debug-step { border-top: 1px solid var(--line); padding: .5rem 0; }
.debug-step:first-of-type { border-top: 0; }
.debug-step > summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .5rem; list-style: none; }
.debug-step > summary::-webkit-details-marker { display: none; }
.debug-step > summary::after { content: '▸'; margin-left: auto; color: var(--ink-muted); }
.debug-step[open] > summary::after { content: '▾'; }
.debug-step-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--cardinal-red); color: #fff; font-size: .68rem; }
.debug-step-body { padding: .6rem 0 .3rem; overflow-x: auto; }
.debug-table { width: 100%; border-collapse: collapse; font-size: .74rem; margin-bottom: .5rem; }
.debug-table th, .debug-table td { border: 1px solid var(--line); padding: .3rem .45rem; text-align: left; vertical-align: top; }
.debug-table th { background: #f1f3f5; font-weight: 700; white-space: nowrap; }
.debug-table code { font-size: .72rem; word-break: break-word; }
.debug-table tr.debug-good td { background: rgba(22,101,52,.06); }
.debug-table tr.debug-bad td { background: rgba(153,27,27,.08); }
.debug-table tr.debug-span td { background: #f8f9fa; color: var(--ink-soft); }
.debug-mini { margin: 0; padding-left: 1.1rem; }
.debug-mini li { font-size: .72rem; line-height: 1.35; }
.debug-note { font-size: .72rem; color: var(--ink-muted); line-height: 1.45; margin: .3rem 0 0; font-family: "Public Sans", sans-serif; }
.debug-raw pre { max-height: 340px; overflow: auto; background: #f1f3f5; padding: .6rem; border-radius: 6px; font-size: .68rem; line-height: 1.4; }
.debug-raw > summary { cursor: pointer; font-size: .74rem; color: var(--cardinal-red); margin-top: .4rem; }
/* Nested detail blocks: full prompts, raw responses, per-page evidence, chunks */
.debug-sub { border: 1px solid var(--line); border-radius: 6px; margin: .35rem 0; background: #fff; }
.debug-sub > summary { cursor: pointer; padding: .35rem .5rem; font-size: .73rem; color: var(--ink); }
.debug-sub[open] > summary { border-bottom: 1px solid var(--line); background: #f8f9fa; }
.debug-sub-body { padding: .45rem .5rem; }
.debug-text { max-height: 420px; overflow: auto; background: #f8f9fa; border: 1px solid var(--line); border-radius: 4px; padding: .5rem; font-size: .68rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin: .25rem 0; }
.debug-chunk { margin: .4rem 0; }
.debug-chunk-head { font-size: .68rem; color: var(--cardinal-red); font-weight: 700; }
.debug-null { color: var(--err); font-style: italic; }
.debug-table tr.debug-skipped td { opacity: .55; }
.results-layout-slate .debug-sub { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.results-layout-slate .debug-text { background: rgba(255,255,255,.05); color: #cbd5e1; border-color: rgba(255,255,255,.12); }
.results-layout-slate .debug-pane { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); color: #cbd5e1; }
.results-layout-slate .debug-table th { background: rgba(255,255,255,.06); }
.results-layout-slate .debug-raw pre { background: rgba(255,255,255,.05); color: #cbd5e1; }

/* (Chatbot widget positioning rules removed — the widget is not loaded on this
   page. demo-v2.html keeps its own copy.) */
  