/* Private LLM Platform console. Corey Mathie, 2026. Light blue / white identity. */
:root {
  --bg: #f5f8fe; --panel: #ffffff; --panel-2: #f8faff; --fg: #0f172a; --muted: #5b6b82; --subtle: #8a99ad;
  --border: #e2e8f0; --border-strong: #cbd5e1; --accent: #2563eb; --accent-ink: #1d4ed8; --accent-soft: #eaf1ff; --on-accent: #ffffff;
  --ok: #15803d; --ok-soft: #e9f8ef; --warn: #b45309; --warn-soft: #fff6e5; --danger: #c81e1e; --danger-soft: #fdeeee;
  --code-bg: #f1f5f9; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .05);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --grid: #e7ecf3;
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 236px; --sample: #6d28d9; --sample-soft: #f3edff; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1424; --panel: #131c30; --panel-2: #172238; --fg: #e6edf8; --muted: #9fb0c8; --subtle: #7486a0;
    --border: #23314b; --border-strong: #31415f; --accent: #6aa0ff; --accent-ink: #9cc0ff; --accent-soft: #1a2a4a; --on-accent: #0d1424;
    --ok: #4ade80; --ok-soft: #12301f; --warn: #fbbf24; --warn-soft: #33270c; --danger: #f87171; --danger-soft: #3a1717;
    --code-bg: #0f1a2d; --shadow: none; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #22304a; --sample: #c4b5fd; --sample-soft: #251a45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1424; --panel: #131c30; --panel-2: #172238; --fg: #e6edf8; --muted: #9fb0c8; --subtle: #7486a0;
  --border: #23314b; --border-strong: #31415f; --accent: #6aa0ff; --accent-ink: #9cc0ff; --accent-soft: #1a2a4a; --on-accent: #0d1424;
  --ok: #4ade80; --ok-soft: #12301f; --warn: #fbbf24; --warn-soft: #33270c; --danger: #f87171; --danger-soft: #3a1717;
  --code-bg: #0f1a2d; --shadow: none; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #22304a; --sample: #c4b5fd; --sample-soft: #251a45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; word-break: break-word; }
h1, h2, h3 { letter-spacing: -.01em; margin: 0; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--panel) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), transparent var(--sidebar)); }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--panel); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted);
  font-weight: 550; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--panel-2); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.sidebar .foot { margin-top: auto; padding: 12px 8px 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.sidebar .foot a { color: var(--muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 650; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.menu-btn, .mobile-brand { display: none; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; border: 1px solid var(--border); background: var(--panel-2); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); flex: none; }
.badge.demo .dot { background: var(--series-1); }
.badge.live .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.view { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 760px; }

/* ---------- building blocks ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
[hidden] { display: none !important; }
#view:focus { outline: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head > div:first-child { flex: 1 1 200px; min-width: 0; }
.card-head p { color: var(--muted); margin: 2px 0 0; font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grid.side { grid-template-columns: 300px minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12.5px; }
.kpi .value.ok { color: var(--ok); }
.kpi .value.bad { color: var(--danger); }

button, .btn {
  font: inherit; font-weight: 600; font-size: 13px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--fg); padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center;
  gap: 6px; line-height: 1.3; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { background: var(--accent-ink); }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
button.ghost { border-color: transparent; background: transparent; }
button.sm, .btn.sm { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .55; cursor: not-allowed; }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 10px; min-width: 0; max-width: 100%;
}
input[type=text], input[type=password], input[type=number], select { height: 33px; }
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; min-height: 260px; background: var(--code-bg); }
textarea.code:not(:placeholder-shown) { white-space: pre; overflow-wrap: normal; overflow-x: auto; }
textarea.code.tall { min-height: 400px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--border-strong); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 650; background: var(--code-bg); color: var(--muted); white-space: nowrap; border: 1px solid transparent;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); }
.pill.sim { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--panel-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td code, td.mono, td.nowrap { white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--panel-2); }
tbody tr.selected td { background: var(--accent-soft); }

.banner { border-radius: 10px; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border); background: var(--panel-2); }
.banner.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.banner.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.banner.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.banner.info { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.banner strong { color: inherit; }
.empty, .loading, .error-state { padding: 28px 16px; text-align: center; color: var(--muted); }
.error-state { color: var(--danger); }
.loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
pre.json { background: var(--code-bg); border-radius: 8px; padding: 10px; overflow: auto; font: 12px/1.5 var(--mono); max-height: 360px; margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .bar:hover, .chart .hit:hover + .bar { opacity: .85; }
.legend { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tooltip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12px; padding: 6px 9px;
  border-radius: 7px; max-width: 260px; box-shadow: var(--shadow); display: none;
}

/* ---------- chat ---------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.thread { display: flex; flex-direction: column; gap: 14px; min-height: 260px; max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); padding: 9px 13px; border-radius: 14px 14px 4px 14px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.bot { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 11px 13px; }
.msg.bot .answer { white-space: pre-wrap; word-break: break-word; }
.msg .meta { color: var(--muted); font-size: 12px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cite { padding: 0 6px; font-size: 11px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); border: 0; font-weight: 700; vertical-align: 1px; }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.compare > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--panel); min-width: 0; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.composer textarea { min-height: 44px; max-height: 160px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggest button { font-weight: 500; white-space: normal; text-align: left; border-radius: 999px; font-size: 12.5px; }
.source { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.source + .source { margin-top: 10px; }
.source.hl { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.source .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.source .title { font-weight: 650; word-break: break-word; }
.source .excerpt { font-size: 12.5px; color: var(--muted); margin-top: 6px; white-space: pre-wrap; max-height: 9.5em; overflow: hidden; word-break: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; }
.scores { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.whocard { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }

/* ---------- matrix ---------- */
.matrix td.cell { text-align: center; font-weight: 700; }
.matrix td.yes { color: var(--ok); }
.matrix td.no { color: var(--subtle); }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: inset -1px 0 0 var(--border); }
.matrix th:first-child { background: var(--panel-2); }
.matrix th.doc { white-space: normal; min-width: 120px; text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------- drawer, modal, tour, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 60; display: none; }
.scrim.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 70;
  border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .2s ease, visibility .2s; display: flex; flex-direction: column;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer .dh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer .db { padding: 16px; overflow-y: auto; flex: 1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }
.timeline li.deny::before { background: var(--danger); }
.timeline li.warn::before { background: var(--warn); }
.timeline .st { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.timeline .sd { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.modal {
  position: fixed; z-index: 80; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); padding: 18px; display: none;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal.open { display: block; }
.tour-ring { position: fixed; z-index: 85; border: 2px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .35); pointer-events: none; transition: all .2s ease; display: none; }
.tour-card {
  position: fixed; z-index: 86; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); display: none; right: 24px; bottom: 24px;
}
.tour-card .steps { color: var(--muted); font-size: 12px; }
.toasts { position: fixed; z-index: 95; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); color: var(--bg); }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.boot.hidden { display: none; }
.boot .box { width: min(520px, 100%); }
.boot ol, .boot-steps { list-style: none; padding: 0; margin: 14px 0; }
.boot li, .boot-steps li { padding: 6px 0 6px 26px; position: relative; color: var(--muted); text-align: left; }
.boot li::before, .boot-steps li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); }
.boot li.active, .boot-steps li.active { color: var(--fg); font-weight: 600; }
.boot li.active::before, .boot-steps li.active::before { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.boot li.done::before, .boot-steps li.done::before { background: var(--ok); border-color: var(--ok); }
.boot li.fail, .boot-steps li.fail { color: var(--danger); }
.boot li.fail::before, .boot-steps li.fail::before { background: var(--danger); border-color: var(--danger); }
.boot-panel { display: grid; justify-items: center; max-width: 460px; width: 100%; }
.boot-panel .boot-steps { margin: 4px 0 6px; justify-self: center; }
.boot-note { text-align: center; margin: 0; }
.sugg.skeleton { display: grid; justify-content: stretch; align-content: center; gap: 8px; border: 1px solid var(--border); cursor: default; }
.sk-line { display: block; height: 10px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--border); width: 88%; animation: pulse 1.6s ease-in-out infinite; }
.sk-line.short { width: 55%; }
.sk-item { padding: 9px 8px; }
.modules { display: flex; flex-wrap: wrap; gap: 6px; }
.module { font: 11.5px var(--mono); background: var(--code-bg); border-radius: 6px; padding: 2px 7px; color: var(--fg); }
.module small { color: var(--muted); }
.tries { display: flex; flex-wrap: wrap; gap: 12px; }
.tries > .try { flex: 1 1 180px; min-width: 0; }
.try { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--panel); color: var(--fg); }
.try:hover { border-color: var(--accent); text-decoration: none; }
.try b { display: block; margin-bottom: 4px; }
.try span { color: var(--muted); font-size: 12.5px; }
.diff { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.errors { margin: 8px 0 0; padding-left: 18px; color: var(--danger); font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .chat-layout, .grid.split, .grid.side { grid-template-columns: minmax(0, 1fr); }
  .grid.kpis.four { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .thread { max-height: none; }
  td.nowrap { white-space: normal; }
}
@media (max-width: 900px) {
  .app { background: none; }
  .sidebar { position: fixed; z-index: 75; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .view { padding: 16px; }
  .grid.two, .compare, .diff, .grid.kpis.six { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.two, .compare, .diff { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none !important; }
}
@media (max-width: 480px) {
  .grid.kpis.six, .grid.kpis.four { grid-template-columns: minmax(0, 1fr); }
  .tour-card { right: 16px; bottom: 16px; }
  button.sm, .btn.sm { padding: 6px 10px; }
  .kpi .value { font-size: 24px; }
  .badge .long { display: none; }
  .composer { flex-direction: column; align-items: stretch; }
  .msg.user { max-width: 100%; }
  .toolbar > * { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .pill, .badge { border: 1px solid CanvasText; } }

/* ---------- navigation shell (demo/shell.js) ---------- */
.nav { gap: 12px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: 0 10px 2px; }
.nav-items { display: grid; gap: 2px; }
.nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.in-section { color: var(--fg); }
.nav .sub { padding-left: 28px; display: grid; gap: 1px; margin-top: 1px; }
.nav .sub a { font-size: 13px; font-weight: 500; padding: 6px 10px; position: relative; }
.nav .sub a::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--border); }
.nav .sub a[aria-current="page"]::before { background: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.nav-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding: 10px 4px 10px; }
.nav-foot + .foot { margin-top: 0; }
.nav-foot .icon { padding: 6px; line-height: 0; }
kbd { font-family: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 18px; white-space: nowrap; }
.nav-foot kbd { margin-right: 4px; }
@media (min-width: 901px) {
  body.nav-collapsed { --sidebar: 68px; }
  body.nav-collapsed .sidebar { padding: 16px 8px; }
  body.nav-collapsed .brand > span:not(.logo), body.nav-collapsed .nav a span, body.nav-collapsed .nav .count,
  body.nav-collapsed .nav .sub, body.nav-collapsed .sidebar .foot, body.nav-collapsed #keys-btn { display: none; }
  body.nav-collapsed .brand { justify-content: center; padding: 4px 0 16px; }
  body.nav-collapsed .nav a { justify-content: center; padding: 10px 0; }
  body.nav-collapsed .nav-label { font-size: 0; padding: 0; height: 1px; background: var(--border); margin: 4px 8px; }
  body.nav-collapsed .nav-foot { justify-content: center; }
  body.nav-collapsed #nav-collapse svg { transform: rotate(180deg); }
}
@media (max-width: 900px) { #nav-collapse { display: none; } }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--subtle); min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs i { font-style: normal; color: var(--border-strong); }
.crumbs [aria-current] { color: var(--fg); font-weight: 650; }
.topbar .title { overflow: visible; }

.workspace { position: relative; flex: none; }
.workspace summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); font-weight: 600; font-size: 13px; white-space: nowrap; }
.workspace summary::-webkit-details-marker { display: none; }
.workspace summary:hover { border-color: var(--border-strong); }
.ws-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--sample); color: var(--panel); font-size: 11px; font-weight: 800; }
.chev { color: var(--subtle); }
.ws-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: min(360px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 14px; display: grid; gap: 8px; font-size: 13px; }
.ws-pop p { margin: 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pill.sample { background: var(--sample-soft); color: var(--sample); border: 0; }
.search-btn { display: flex; align-items: center; gap: 8px; flex: 0 1 280px; min-width: 0; padding: 6px 8px 6px 10px; border: 1px solid var(--border); background: var(--panel); color: var(--subtle); font-weight: 500; font-size: 13px; border-radius: 10px; cursor: pointer; }
.search-btn:hover { border-color: var(--border-strong); color: var(--muted); }
.search-btn svg { flex: none; }
.search-text { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1280px) { .search-btn { flex: none; } .search-btn .search-text { display: none; } }
@media (max-width: 1060px) { .search-btn kbd { display: none; } .workspace .ws-name { display: none; } }
@media (max-width: 640px) { .workspace .pill, .workspace .chev { display: none; } .topbar .crumbs > :not([aria-current]), .topbar .crumbs i { display: none; } }

.palette, .keys { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .36); display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; }
.palette[hidden], .keys[hidden] { display: none; }
.palette-panel, .keys-panel { width: min(620px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--subtle); }
.palette-search input { flex: 1; border: 0; background: transparent; padding: 4px 0; font: inherit; font-size: 16px; color: var(--fg); outline: none; min-width: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.palette-list li[role=option] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--accent-soft); }
.pal-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pal-hint { color: var(--subtle); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pal-section { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: 10px 10px 4px; }
.pal-empty { padding: 18px 10px; color: var(--muted); text-align: center; }
.palette-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 9px 14px; margin: 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--subtle); background: var(--panel-2); }
.palette-foot kbd { margin-right: 3px; }
.keys-panel { padding: 16px; display: grid; gap: 10px; }
.keys-panel td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.keys-panel td:first-child { width: 110px; }

/* ---------- Overview › Business impact ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.banner.sample { background: var(--sample-soft); color: var(--sample); border-color: transparent; }
.banner.sample a { color: inherit; font-weight: 650; text-decoration: underline; }
.period { margin: 10px 0 12px; }
.kpi.sample { border-top: 3px solid var(--sample); }
.kpi.sample .value { font-size: 26px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 4px; min-height: 28px; }
.spark { flex: 0 1 120px; max-width: 50%; height: 28px; }
.delta { font-size: 12px; font-weight: 700; white-space: nowrap; border-radius: 999px; padding: 1px 7px; }
.delta.good { background: var(--ok-soft); color: var(--ok); }
.delta.bad { background: var(--danger-soft); color: var(--danger); }
.delta.flat { background: var(--panel-2); color: var(--subtle); font-weight: 600; }
.card-head h2 .pill { margin-left: 6px; vertical-align: 2px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
table .share { display: block; font-size: 12px; color: var(--subtle); }
table.sources .src-cite { margin: 0; }
table.sources .src-cite + .src-cite { margin-top: 6px; }
.meter-bar { display: inline-block; vertical-align: middle; width: 80px; max-width: 30vw; height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
.nw { white-space: nowrap; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; }
.checklist b { display: block; }
.checklist .cv { font-weight: 700; font-variant-numeric: tabular-nums; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.events li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
.events p { margin: 0; color: var(--muted); font-size: 13px; }
.events h3 { margin: 1px 0 2px; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--subtle); }
.ev-access .ev-dot { background: var(--sample); }
.ev-ops .ev-dot { background: var(--accent); }
.ev-compliance .ev-dot { background: var(--ok); }
.ev-meta { font-size: 12px; color: var(--subtle); font-weight: 600; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--subtle); font-weight: 600; }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .grid.kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid.kpis.four, .facts { grid-template-columns: minmax(0, 1fr); } }
.split-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.split-stats .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.split-stats .value { font-size: 22px; font-weight: 650; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .split-stats { grid-template-columns: minmax(0, 1fr); } }
.topbar .title { flex: 1 1 auto; min-width: 0; }
.topbar .crumbs { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.topbar .crumbs > * { flex: none; }
@media (max-width: 1440px) { #modeText .long { display: none; } .workspace .ws-name { display: none; } }

/* ---------- business / technical view ---------- */
body:not(.tech) .tech-only { display: none !important; }
.view-switch button { padding: 5px 10px; font-size: 12px; }
@media (max-width: 1240px) { .view-switch { display: none; } }
.badge.starting .dot { animation: pulse 1.2s ease-in-out infinite; }
.badge.error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .25; } }
button.icon { padding: 6px; }
button.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.engine-wait { max-width: 620px; margin: 6vh auto; text-align: center; display: grid; justify-items: center; gap: 10px; }
.engine-wait.error { text-align: left; justify-items: start; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.notfound { margin-top: 8vh; }
.tour-invite { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: min(340px, calc(100vw - 32px)); display: grid; gap: 10px; }
.tour-target { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.banner.sample { display: flex; gap: 12px; align-items: flex-start; }
.banner.sample > span { flex: 1 1 auto; }
.banner.sample button { color: inherit; flex: none; }

/* ---------- assistant ---------- */
body[data-screen="chat"] .view { max-width: none; padding: 0; }
.assistant { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: calc(100vh - 58px); min-height: 520px; }
.assistant.with-pane { grid-template-columns: 250px minmax(0, 1fr) minmax(320px, 400px); }
.history { border-right: 1px solid var(--border); background: var(--panel); padding: 16px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.new-chat { justify-content: center; width: 100%; margin-bottom: 8px; }
.new-chat svg, .send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hist-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: 10px 8px 4px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hist-list button { width: 100%; border: 0; background: transparent; text-align: left; font-weight: 500; color: var(--muted); padding: 7px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.hist-list button:hover { background: var(--panel-2); color: var(--fg); }
.hist-list button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.convo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--panel); }
.asking { display: flex; align-items: center; gap: 10px; }
.asking-text, .scope { display: flex; flex-direction: column; gap: 1px; }
.asking small, .scope small { font-size: 11px; color: var(--subtle); font-weight: 600; }
.asking select, .scope select { height: 28px; padding: 2px 6px; font-weight: 600; border-color: transparent; background: transparent; }
.asking select:hover, .scope select:hover { border-color: var(--border-strong); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.compare-toggle { margin-left: auto; }
.advanced { width: 100%; }
.advanced summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.adv-grid { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 8px; }
.whocard { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin-top: 8px; }
.assistant .thread { flex: 1 1 auto; max-height: none; min-height: 0; overflow-y: auto; padding: 24px; gap: 22px; }
.assistant .thread > * { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
.hero { text-align: center; padding: 6vh 0 10px; display: grid; justify-items: center; gap: 10px; }
.hero-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; }
.hero-mark svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero h1 { font-size: 28px; }
.hero-sub { color: var(--muted); max-width: 560px; }
.sugg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 10px; }
.sugg { justify-content: space-between; text-align: left; white-space: normal; padding: 12px 14px; border-radius: 12px; font-weight: 500; background: var(--panel); min-height: 58px; }
.sugg svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--subtle); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sugg:hover svg { stroke: var(--accent); }
.sugg-note { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.sugg.expect-refusal { border-style: dashed; }
.assistant .msg.user { align-self: auto; background: none; color: inherit; padding: 0; max-width: 820px; display: flex; justify-content: flex-end; }
.assistant .msg.user .bubble { background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 16px 16px 4px 16px; max-width: 80%; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant .msg.bot { background: none; border: 0; padding: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.bot-avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.bot-avatar svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.bot-body { min-width: 0; }
.assistant .answer { font-size: 15px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.answer.not-found, .answer.refused { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.answer.not-found b { display: block; margin-bottom: 2px; }
.answer.not-found .hint { display: block; }
.assistant .cite { margin: 0 1px; padding: 0 6px; height: 18px; vertical-align: 2px; cursor: pointer; }
.assistant .cite:hover { background: var(--accent); color: var(--on-accent); }
.caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: pulse 1s steps(1) infinite; }
.typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); animation: pulse 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.src-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.src-chip { white-space: normal; text-align: left; font-weight: 500; padding: 6px 10px 6px 6px; border-radius: 10px; max-width: 100%; }
.src-chip span { display: flex; flex-direction: column; min-width: 0; }
.src-chip b { font-weight: 600; font-size: 13px; }
.src-chip small { color: var(--subtle); font-size: 11.5px; }
.doc-ico { display: inline-grid; place-items: center; width: 30px; height: 34px; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; background: #64748b; flex: none; }
.doc-ico.t-pdf { background: #c2410c; } .doc-ico.t-docx { background: #1d4ed8; } .doc-ico.t-xlsx { background: #15803d; } .doc-ico.t-md { background: #475569; }
.msg-actions { display: flex; gap: 2px; margin-top: 8px; }
.icon-act { border: 0; background: transparent; padding: 5px; border-radius: 6px; color: var(--subtle); }
.icon-act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-act:hover, .icon-act.on { color: var(--accent-ink); background: var(--accent-soft); }
.answer-details { margin-top: 10px; font-size: 12.5px; }
.answer-details summary { cursor: pointer; color: var(--muted); }
.answer-details .meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); margin: 6px 0; }
.assistant .compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmp-col { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel); min-width: 0; }
.cmp-who { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; margin-bottom: 8px; }
.assistant .composer { margin: 0 auto; width: calc(100% - 48px); max-width: 820px; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 14px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.assistant .composer:focus-within { border-color: var(--accent); }
.assistant .composer textarea { border: 0; resize: none; min-height: 24px; max-height: 180px; padding: 6px 0; background: transparent; font-size: 15px; outline: none; }
.send { border-radius: 10px; padding: 8px 10px; }
.composer-note { text-align: center; color: var(--subtle); font-size: 12px; margin: 8px 24px 14px; }
.source-pane { border-left: 1px solid var(--border); background: var(--panel); padding: 16px; overflow-y: auto; }
.pane-head { display: flex; gap: 10px; align-items: flex-start; }
.pane-head > div { flex: 1 1 auto; min-width: 0; }
.pane-head h2 { font-size: 16px; }
.pane-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12px; flex: none; }
.pane-n.sm { min-width: 20px; height: 20px; font-size: 11px; margin-right: 6px; }
.pane-meta { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; font-size: 12.5px; color: var(--muted); }
.pane-access { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pane-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); margin: 16px 0 6px; }
.passage { font-size: 13.5px; line-height: 1.6; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
.passage mark { background: #fde68a; color: #111827; border-radius: 3px; padding: 0 2px; }
.others { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.others button { width: 100%; border: 0; background: transparent; text-align: left; white-space: normal; font-weight: 500; padding: 6px; }
.others button:hover { background: var(--panel-2); }
@media (max-width: 1240px) { .assistant, .assistant.with-pane { grid-template-columns: 220px minmax(0, 1fr); } .assistant.with-pane .source-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); } .assistant { height: auto; } .assistant .thread { min-height: 55vh; } }
@media (max-width: 900px) {
  .assistant, .assistant.with-pane { grid-template-columns: minmax(0, 1fr); height: auto; }
  .history { display: none; }
  .convo-head { padding: 10px 16px; }
  .compare-toggle { margin-left: 0; }
  .assistant .thread { padding: 16px; min-height: 50vh; }
  .assistant .composer { width: calc(100% - 32px); }
  .sugg-grid, .assistant .compare { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 3vh; }
  .hero h1 { font-size: 23px; }
}

/* ---------- documents, policy ---------- */
.doc-cell { display: flex; align-items: center; gap: 10px; }
.doc-cell .doc-ico { width: 26px; height: 30px; }
.doc-search input { height: 33px; width: 220px; max-width: 100%; font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 10px; }
.policy-summary .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .policy-summary .facts { grid-template-columns: minmax(0, 1fr); } }
.passage h4 { font-size: 13px; margin: 12px 0 4px; }
.passage h4:first-child { margin-top: 0; }
.passage p { margin: 0 0 8px; }
.passage p:last-child { margin-bottom: 0; }

/* Header: the controls keep their size; the breadcrumb gives way first. */
.topbar > .view-switch, .topbar > .badge, .topbar > button:not(.search-btn):not(.menu-btn) { flex: none; }
@media (max-width: 1600px) { .topbar .crumbs > :first-child, .topbar .crumbs > :first-child + i { display: none; } }
@media (max-width: 1440px) { .search-btn { flex: none; } .search-btn .search-text { display: none; } }
