@font-face{font-family:"Roboto";font-weight:300;font-display:swap;src:url("../../assets/fonts/roboto-300.woff2") format("woff2"),url("../../assets/fonts/roboto-300.woff") format("woff")}
@font-face{font-family:"Roboto";font-weight:400;font-display:swap;src:url("../../assets/fonts/roboto-400.woff2") format("woff2"),url("../../assets/fonts/roboto-400.woff") format("woff")}
@font-face{font-family:"Roboto";font-weight:700;font-display:swap;src:url("../../assets/fonts/roboto-700.woff2") format("woff2"),url("../../assets/fonts/roboto-700.woff") format("woff")}
/* Retina Evidence Hub simulated demo: styles. System fonts only, no external assets.
   Palette after the portfolio and the other demos: navy ink, blue actions, purple for AI. */

:root {
  --navy: #071D49;
  --bg: #F6F7FC;
  --surface: #FFFFFF;
  --surface-2: #F1F3FF;
  --surface-3: #E5E9FB;
  --ink: #071D49;
  --text: #1B2850;
  --muted: #4E5A79;
  --border: #D8DDF1;
  --border-strong: #B4BEDF;
  --primary: #0066F5;
  --primary-ink: #FFFFFF;
  --primary-soft: #EBF2FF;
  --primary-text: #0057D1;
  --ai: #8A2ECC;
  --ai-ink: #FFFFFF;
  --ai-soft: #F4EBFC;
  --ai-ring: rgba(138, 46, 204, .22);
  --ok: #2E7D0F;
  --ok-soft: #EBF6E3;
  --warn: #A85200;
  --warn-soft: #FFF2E4;
  --err: #C23B12;
  --err-soft: #FDEDE8;
  --t-disease: #A3266E;
  --t-treatment: #0058D6;
  --t-study: #00787A;
  --t-outcome: #2E7D0F;
  --t-population: #8F5600;
  --t-custom: #4E5A79;
  --banner-bg: #071D49;
  --banner-ink: #FFFFFF;
  --mark-bg: #071D49;
  --scrim: rgba(7, 29, 73, .45);
  --shadow-sm: 0 1px 2px rgba(7, 29, 73, .06);
  --shadow: 0 1px 2px rgba(7, 29, 73, .06), 0 8px 24px rgba(7, 29, 73, .10);
  --shadow-lg: 0 2px 6px rgba(7, 29, 73, .10), 0 18px 48px rgba(7, 29, 73, .22);
  --font: "Roboto",system-ui,-apple-system,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  --mono: "Roboto",system-ui,-apple-system,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1430; --surface: #0F1B3D; --surface-2: #15234D; --surface-3: #1C2C5C;
    --ink: #EFF2FF; --text: #D5DCF1; --muted: #A6B1CE; --border: #263868; --border-strong: #3B5090;
    --primary: #5C9DFF; --primary-ink: #071D49; --primary-soft: #16305F; --primary-text: #8DBBFF;
    --ai: #BB86F2; --ai-ink: #1A0B2E; --ai-soft: #2A1E4E; --ai-ring: rgba(187, 134, 242, .28);
    --ok: #7DC657; --ok-soft: #18321F; --warn: #F2A55E; --warn-soft: #3A2815; --err: #FF8867; --err-soft: #3E1F19;
    --t-disease: #F08BC0; --t-treatment: #79B2FF; --t-study: #5ED3D0; --t-outcome: #8BD36A; --t-population: #F2B866; --t-custom: #B8C2DE;
    --banner-bg: #18285A; --mark-bg: #24357A; --scrim: rgba(0, 0, 0, .6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1430; --surface: #0F1B3D; --surface-2: #15234D; --surface-3: #1C2C5C;
  --ink: #EFF2FF; --text: #D5DCF1; --muted: #A6B1CE; --border: #263868; --border-strong: #3B5090;
  --primary: #5C9DFF; --primary-ink: #071D49; --primary-soft: #16305F; --primary-text: #8DBBFF;
  --ai: #BB86F2; --ai-ink: #1A0B2E; --ai-soft: #2A1E4E; --ai-ring: rgba(187, 134, 242, .28);
  --ok: #7DC657; --ok-soft: #18321F; --warn: #F2A55E; --warn-soft: #3A2815; --err: #FF8867; --err-soft: #3E1F19;
  --t-disease: #F08BC0; --t-treatment: #79B2FF; --t-study: #5ED3D0; --t-outcome: #8BD36A; --t-population: #F2B866; --t-custom: #B8C2DE;
  --banner-bg: #18285A; --mark-bg: #24357A; --scrim: rgba(0, 0, 0, .6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Base ── */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }
a { color: var(--primary-text); }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 80; padding: 8px 12px; background: var(--primary); color: var(--primary-ink); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.lead { margin: 0 0 12px; }
.empty { color: var(--muted); padding: 12px 4px; }
.noscript { padding: 16px; text-align: center; }

.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.ico svg, .pipe-ico svg, .st-ico svg, .icon-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico .fillc, .pipe-ico .fillc { fill: currentColor; stroke: none; }
.spin svg { animation: spin 1s linear infinite; }
.chev svg { transition: transform .15s; }
details[open] > summary > .chev svg { transform: rotate(90deg); }
.rot90 svg { transform: rotate(90deg); }

/* ── Banner and top bar ── */

.banner {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px;
  padding: 6px 16px; background: var(--banner-bg); color: var(--banner-ink); font-size: 12.5px; line-height: 1.4; text-align: center;
}
.banner-link { color: var(--banner-ink); font-weight: 600; text-underline-offset: 2px; }
.banner-link:focus-visible { outline-color: #FFFFFF; }

.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark {
  position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--mark-bg); color: #FFFFFF; font: 700 11.5px/1 var(--font); letter-spacing: .05em;
}
.mark::after { content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ai); border: 2px solid var(--surface); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-badge {
  flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3;
  color: var(--ai); background: var(--ai-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.sim-short { display: none; }
.tb-right { display: flex; align-items: center; gap: 4px; flex: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; margin-right: 4px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.status-pill:hover { border-color: var(--border-strong); }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: #3FB45F; box-shadow: 0 0 0 3px rgba(63, 180, 95, .2); flex: none; }
.icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; padding: 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; padding: 7px; border-radius: 8px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ── Shell: sidebar, main and the phone tab bar ── */

.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.sidebar { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; }
.nav-title { margin: 2px 10px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nav a[aria-current="page"] .ico { color: var(--primary); }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; text-align: center; color: var(--muted); }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.sb-foot { margin-top: auto; padding: 10px 8px 2px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sb-foot .linklike { font-size: 12px; }
.linklike { border: 0; background: none; padding: 0; color: var(--primary-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

main { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabbar { display: none; }

/* ── Page head, panes ── */

.page-head {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.ph-text { min-width: 0; }
.page-head h2 { margin: 0; font-size: 19px; }
.ph-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.view-body { flex: 1; min-height: 0; }
.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.pane { min-height: 0; overflow-y: auto; padding: 16px; }
.list-pane { border-right: 1px solid var(--border); }
.detail-pane { padding: 18px 24px 24px; }
.back { display: none; align-items: center; gap: 4px; margin: 0 0 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
body.guide-open .pane, body.guide-open .settings { padding-bottom: 250px; }
body.guide-min .pane, body.guide-min .settings { padding-bottom: 80px; }

/* ── Buttons, chips, tags ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; min-height: 38px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ai { background: var(--ai); color: var(--ai-ink); }
.btn.ai:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.strong { border-color: var(--primary); color: var(--primary-text); }
.btn.danger { background: var(--err); color: #FFFFFF; }
.btn.danger-ghost { background: transparent; border-color: var(--err); color: var(--err); }
.btn.danger-ghost:hover { background: var(--err-soft); }
.btn.danger-ghost[data-armed="1"] { background: var(--err); color: #FFFFFF; }
.btn.link { background: none; border: 0; padding: 4px 6px; min-height: 0; color: var(--primary-text); font-weight: 600; }
.btn.link:hover { text-decoration: underline; }
.btn.is-busy, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }

.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 0; align-items: center; }
.more { font-size: 12px; color: var(--muted); }
.tag {
  --tc: var(--t-custom);
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; font-size: 12px; line-height: 1.5;
  color: var(--tc); background: var(--surface-2); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--tc) 9%, transparent); border-color: color-mix(in srgb, var(--tc) 32%, transparent);
}
.tag .dot, .dtag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tc-disease { --tc: var(--t-disease); }
.tc-treatment { --tc: var(--t-treatment); }
.tc-study { --tc: var(--t-study); }
.tc-outcome { --tc: var(--t-outcome); }
.tc-population { --tc: var(--t-population); }
.tc-custom { --tc: var(--t-custom); }
.new-mark { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; border-radius: 4px; background: var(--ai-soft); color: var(--ai); }
.dtag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); }
.dt-new { color: var(--primary-text); border-color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); }
.dt-include { color: var(--ok); border-color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.dt-exclude { color: var(--err); border-color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: var(--err-soft); }
.dt-published { color: var(--ink); border-color: var(--border-strong); background: var(--surface-2); }
.score { display: inline-block; padding: 1px 7px; border-radius: 6px; font: 600 11.5px/1.55 var(--mono); border: 1px solid; white-space: nowrap; }
.score.hi { color: var(--ok); border-color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.score.lo { color: var(--err); border-color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: var(--err-soft); }
.dchip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.dchip.inc { color: var(--ok); background: var(--ok-soft); }
.dchip.exc { color: var(--err); background: var(--err-soft); }
.ft { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.ft .ico { width: 14px; height: 14px; }
.ft.ok { color: var(--ok); }
.ft.warn { color: var(--warn); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.b-running { color: var(--ai); background: var(--ai-soft); border-color: transparent; }
.badge.b-done { color: var(--ok); background: transparent; border-color: var(--ok); }
.badge.b-stopped { color: var(--warn); background: transparent; border-color: var(--warn); }
.badge.b-human { color: var(--ink); background: var(--surface-2); }
.cat, .lvl { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.cat { color: var(--ink); background: var(--surface-3); }
.lvl { color: var(--primary-text); background: var(--primary-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chip .n { font-size: 11.5px; opacity: .75; }

/* Forms */
input[type="text"], input[type="search"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--ink); min-height: 38px;
}
textarea { resize: vertical; line-height: 1.5; min-height: 160px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
select:disabled { opacity: .65; }
label, legend { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.field.inline select { width: auto; flex: 1 1 220px; max-width: 360px; }

/* ── Cards ── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.card-head h4 { margin: 0; font-size: 15px; flex: 1; }
.card-head .ico { width: 19px; height: 19px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.card.ok { border-color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); }
.card.warn { border-color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); }
.card.tight { padding: 12px 16px; }
.card.error { margin: 24px; }
.card.error pre { white-space: pre-wrap; font-size: 12px; }
.k-ai { color: var(--ai); }
.k-det { color: var(--primary); }
.k-human { color: var(--ink); }
.k-ok { color: var(--ok); }
.k-warn { color: var(--warn); }
.abstract { margin: 0; color: var(--text); }
.note.warn { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--text); font-size: 13px; border-left: 3px solid var(--warn); }
details.more { margin-top: 8px; }
details.more > summary, .log > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary-text); }
details.more > summary::-webkit-details-marker, .log > summary::-webkit-details-marker, .agent > summary::-webkit-details-marker { display: none; }
details.more .ico { width: 15px; height: 15px; }
.prompt-text { margin: 8px 0 6px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; border-left: 3px solid var(--border-strong); }
.lines { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.lines li { display: flex; gap: 8px; align-items: flex-start; }
.lines li .ico { width: 16px; height: 16px; margin-top: 2px; }
.lines li.ok .ico { color: var(--ok); }
.lines li.run { color: var(--ai); }

/* ── Literature Library ── */

.coll-split { grid-template-columns: 250px minmax(0, 1fr); }
.coll-nav { padding: 10px 12px 16px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.coll-group { margin: 12px 8px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.coll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.coll-link { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.coll-link:hover { background: var(--surface-2); }
.coll-link[aria-current="true"] { background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.coll-link .cl-name { flex: 1; min-width: 0; }
.coll-pane { padding: 18px 24px; }
.coll-head h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 17px; }
.coll-head h3 .count { font-weight: 500; }
.tag-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 0; font-size: 13px; }
.ts { display: inline-flex; align-items: center; gap: 6px; }
.src-list { list-style: none; margin: 10px 0 0; padding: 0; }
.src-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.src-main { min-width: 0; flex: 1; }
.src-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 3px; font-size: 12.5px; color: var(--muted); }
.id { font-size: 12px; font-weight: 600; color: var(--ink); }
.src-title { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.src-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.src-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.state-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.state-note .ico { width: 15px; height: 15px; }

/* ── REH Review ── */

.tabs-row { flex: none; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs { display: flex; gap: 4px; min-width: max-content; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab .ico { width: 16px; height: 16px; }
.tab[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); }
.tab[aria-selected="true"] .count { background: rgba(255, 255, 255, .22); color: inherit; }
.tab-s { display: none; }
.banner-in { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 0 0 10px; border-radius: 9px; font-size: 13px; border: 1px solid; }
.banner-in .ico { width: 16px; height: 16px; }
.banner-in span:not(.ico) { flex: 1; }
.banner-in.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.banner-in.ok > .ico { color: var(--ok); }
.banner-in.info { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 30%, transparent); color: var(--text); }
.banner-in.info > .ico { color: var(--ai); }
.q-list, .h-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-item, .h-item {
  display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
}
.q-item:hover, .h-item:hover { border-color: var(--border-strong); }
.q-item[aria-current="true"], .h-item[aria-current="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.q-item > span, .h-item > span { display: block; }
.q-item > .q-top, .h-item > .h-top, .q-item > .q-tags, .h-item > .chips { display: flex; }
.q-top, .h-top { align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.h-top { justify-content: flex-start; flex-wrap: wrap; }
.h-top .score { margin-left: auto; }
.stage { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: right; }
.stage.st-evaluated { color: var(--ai); }
.stage.st-approved, .stage.st-complete { color: var(--primary-text); }
.stage.st-published { color: var(--ok); }
.stage.st-excluded { color: var(--err); }
.stage.busy { color: var(--ai); }
.q-title, .h-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.q-meta, .h-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-tags { flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.h-sum { font-size: 13px; margin-top: 4px; color: var(--text); }
.new-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px; background: var(--ai); color: var(--ai-ink); font-size: 10.5px; font-weight: 700; vertical-align: 2px; letter-spacing: .03em; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; padding: 24px; text-align: center; color: var(--muted); }
.placeholder > .ico { width: 40px; height: 40px; opacity: .55; }
.placeholder p { max-width: 380px; }

/* Workbench */
.wb { container-type: inline-size; }
.wb-head h3 { margin: 2px 0 4px; font-size: 18px; }
.wb-head { margin-bottom: 14px; }
.wb-grid { display: grid; gap: 14px; }
.wb-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pipe-wrap { min-width: 0; }
.pipe-title { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pipe-step {
  --kc: var(--primary);
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; color: var(--muted);
}
.pipe-step.k-ai { --kc: var(--ai); }
.pipe-step.k-human { --kc: var(--ink); }
.pipe-ico { width: 16px; height: 16px; flex: none; display: inline-grid; color: var(--border-strong); }
.pipe-step[data-s="done"] { color: var(--ink); }
.pipe-step[data-s="done"] .pipe-ico { color: var(--ok); }
.pipe-step[data-s="current"] { color: var(--ink); font-weight: 600; border-color: var(--kc); }
.pipe-step[data-s="current"] .pipe-ico { color: var(--kc); }
.pipe-step[data-s="running"] { color: var(--ai); font-weight: 600; border-color: var(--ai); }
.pipe-step[data-s="running"] .pipe-ico { color: var(--ai); }
.pipe-step[data-s="stopped"] .pipe-ico { color: var(--warn); }
.pipe-step[data-s="excluded"] { color: var(--err); }
.pipe-step[data-s="excluded"] .pipe-ico { color: var(--err); }
.pipe-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--kc); }
.lg.k-det { --kc: var(--primary); }
.lg.k-ai { --kc: var(--ai); }
.lg.k-human { --kc: var(--ink); }
@container (min-width: 700px) {
  .wb-grid { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .pipe-wrap { position: sticky; top: 0; padding-top: 2px; }
  .pipe { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .pipe-step { position: relative; width: 100%; border: 0; border-radius: 8px; padding: 7px 8px 7px 10px; background: transparent; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--kc) 55%, transparent); }
  .pipe-step[data-s="current"], .pipe-step[data-s="running"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--kc), var(--shadow-sm); }
  .pipe-step:not(:last-child)::after { content: ""; position: absolute; left: 17px; bottom: -5px; height: 10px; border-left: 2px solid var(--border); z-index: 1; }
}

/* Agent card */
.agent > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; }
.agent > summary .ico { width: 18px; height: 18px; }
.agent-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.agent-sum { display: inline-flex; gap: 6px; align-items: center; }
.meter { margin-left: auto; width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--ai)); transition: width .35s ease; }
.agent-body { margin-top: 10px; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.step { position: relative; padding: 0 0 14px 30px; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 9px; top: 24px; bottom: 2px; border-left: 2px solid var(--border); }
.step[data-s="done"]:not(:last-child)::before { border-left-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.st-head { display: flex; align-items: flex-start; gap: 8px; }
.st-ico { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; color: var(--border-strong); display: inline-grid; }
.step[data-s="running"] .st-ico { color: var(--ai); }
.step[data-s="done"] .st-ico { color: var(--ok); }
.step[data-s="stopped"] .st-ico { color: var(--warn); }
.st-text { display: flex; flex-direction: column; }
.st-name { font-weight: 600; color: var(--muted); font-size: 14px; }
.step[data-s="running"] .st-name, .step[data-s="done"] .st-name { color: var(--ink); }
.st-desc { font-size: 12.5px; color: var(--muted); }
.st-body { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; min-width: 0; }
.step[data-s="running"] .st-body { background: color-mix(in srgb, var(--ai-soft) 65%, var(--surface-2)); }
.notes, .findings, .rationale, .prov { margin: 0; padding-left: 18px; }
.notes li, .findings li, .rationale li, .prov li { margin: 2px 0; }
.notes li.tone-warn { color: var(--warn); }
.notes li.tone-ok { color: var(--ok); }
.rationale { margin-top: 8px; font-size: 13px; }
.crit { display: flex; flex-direction: column; gap: 5px; }
.crit-row { display: grid; grid-template-columns: 74px minmax(60px, 1fr) 44px; align-items: center; gap: 8px; font-size: 12.5px; }
.crit-l { color: var(--muted); text-align: right; }
.crit-bar { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.crit-fill { display: block; height: 100%; border-radius: 4px; transition: width .45s ease; }
.crit-fill.hi { background: var(--ok); }
.crit-fill.mid { background: var(--warn); }
.crit-fill.lo { background: var(--err); }
.crit-v { font-size: 12px; color: var(--ink); }
.crit-row.empty .crit-v { color: var(--muted); }
.score-row, .level-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; }
.meta-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 10px 0 0; font-size: 13px; }
.meta-dl dt { color: var(--muted); }
.meta-dl dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.meta-dl.tight { font-size: 12.5px; }
.draft.live { white-space: pre-wrap; }
.summary p { margin: 0 0 8px; }
.summary p:last-child { margin-bottom: 0; }
.sum-head { font-weight: 700; color: var(--ink); font-size: 15px; }
.caret::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--ai); animation: blink 1s steps(2) infinite; }

/* Reviewer gate */
.review { border-color: var(--border-strong); border-color: color-mix(in srgb, var(--ink) 30%, var(--border)); box-shadow: var(--shadow); }
.fs { border: 0; margin: 0 0 14px; padding: 12px 0 0; border-top: 1px solid var(--border); min-width: 0; }
.fs legend { padding: 0 8px 0 0; display: flex; align-items: center; gap: 8px; }
.chips.edit { margin-top: 2px; gap: 6px; }
.tag-toggle { cursor: pointer; padding: 3px 8px; font-size: 12.5px; }
.tag-toggle .tg-i { width: 14px; height: 14px; }
.tag-toggle:hover { background: color-mix(in srgb, var(--tc) 16%, transparent); }
.tag-toggle.off { color: var(--muted); background: transparent; border-style: dashed; border-color: var(--border-strong); text-decoration: line-through; }
.tag-toggle.off .tg-i { text-decoration: none; }
.tag.added { padding-right: 3px; }
.tag-x { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 3px; border: 0; border-radius: 5px; background: transparent; color: inherit; }
.tag-x:hover { background: color-mix(in srgb, var(--tc) 18%, transparent); }
.tag-x svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tag-add { display: grid; grid-template-columns: auto minmax(140px, 1fr) auto; align-items: center; gap: 8px; margin-top: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 6px; }
.row .hint { margin: 0; flex: 1 1 220px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; }
.field.wide { grid-column: 1 / -1; }
.decide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.decide .hint { flex-basis: 100%; margin: 2px 0 0; }

/* Log viewer */
.log { margin-top: 4px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.list-pane .log { margin-top: 14px; }
.log > summary { color: var(--ink); width: 100%; gap: 6px; }
.log .ico { width: 15px; height: 15px; }
.log-count { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.log-warn { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--warn); }
.log-empty { margin: 8px 0 2px; font-size: 12.5px; color: var(--muted); }
.log-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow-y: auto; font-size: 12px; }
.log-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; padding: 4px 2px; border-top: 1px solid var(--border); }
.log-time { color: var(--muted); }
.log-lvl { font-weight: 700; color: var(--primary-text); }
.lv-ok .log-lvl { color: var(--ok); }
.lv-warn .log-lvl { color: var(--warn); }
.lv-err .log-lvl { color: var(--err); }
.log-msg { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.log-det { display: block; color: var(--muted); }
.log-actions { margin-top: 6px; }

/* ── Evidence Hub ── */

.toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search > .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; order: 3; }
.selects { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 380px; }
.sel { position: relative; flex: 1 1 150px; min-width: 0; }
.sel > .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.sel select { padding-left: 30px; }
.result-row { display: flex; align-items: center; gap: 10px; order: 4; flex-basis: 100%; font-size: 13px; color: var(--muted); }
.count-text { font-weight: 600; }
.h-list .empty { padding: 20px 8px; text-align: center; }
.h-detail h3 { margin: 6px 0 4px; font-size: 19px; }
.hd-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.hd-sec h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tag-groups { display: flex; flex-direction: column; gap: 6px; }
.tg { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: start; }
.tg-cat { font-size: 12px; color: var(--muted); padding-top: 3px; }
.tg .chips { margin: 0; }
.tag-btn { cursor: pointer; }
.tag-btn:hover { background: color-mix(in srgb, var(--tc) 18%, transparent); }
.prov { margin-top: 10px; font-size: 13px; color: var(--text); }
.hd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── Settings ── */

.settings { overflow-y: auto; padding: 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-content: start; }
.radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.radios legend { margin-bottom: 6px; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); cursor: pointer; font-weight: 400; }
.radio:hover { background: var(--surface-2); }
.radio input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.radio > span { display: flex; flex-direction: column; }
.radio b { color: var(--ink); font-weight: 600; }
.radio .muted { font-size: 12.5px; }

/* ── Guided path ── */

.guide { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(370px, calc(100vw - 32px)); }
body.guide-min .guide { width: auto; }
.g-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--ai); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 16px 14px; }
.g-card.done { border-top-color: var(--ok); }
.g-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.g-kicker { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ai); }
.g-card.done .g-kicker { color: var(--ok); }
.g-title { margin: 0 0 4px; font-size: 16px; }
.g-text { margin: 0 0 10px; font-size: 13.5px; color: var(--text); }
.g-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.g-dots { list-style: none; display: flex; gap: 5px; margin: 0 0 12px; padding: 0; }
.g-dots li { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.g-dots li.done { background: var(--ok); }
.g-dots li.now { background: var(--ai); }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.g-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--ai); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); }
.g-pill .ico { color: var(--ai); }
.guide-hl { outline: 3px solid var(--ai) !important; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ai-ring); animation: hlpulse 1.8s ease-in-out infinite; }

/* ── Dialog and toast ── */

.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: var(--scrim); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 20px; }
.dlg-head h2 { margin: 0; font-size: 17px; flex: 1; }
.dlg-body { padding: 4px 20px 8px; overflow-y: auto; font-size: 14.5px; }
.dlg-body ul { margin: 0 0 8px; padding-left: 20px; }
.dlg-body li { margin: 3px 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60; max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Motion ── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes hlpulse { 50% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Responsive ── */

@media (max-width: 1240px) {
  .brand-sub { display: none; }
}
@media (max-width: 1079px) {
  main { display: block; overflow-y: auto; }
  .view { display: block; }
  .view-body { display: block; }
  .pane { overflow: visible; }
  .review-split, .hub-split { display: block; }
  .review-split.has-detail .list-pane, .hub-split.has-detail .list-pane { display: none; }
  .review-split:not(.has-detail) .detail-pane, .hub-split:not(.has-detail) .detail-pane { display: none; }
  .list-pane { border-right: 0; padding: 14px 16px; }
  .detail-pane { padding: 14px 16px 20px; }
  .back { display: inline-flex; }
  .coll-split { display: grid; align-items: start; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto; }
  .coll-nav { position: sticky; top: 0; align-self: start; }
  .settings { display: grid; overflow: visible; }
  body.guide-open main { padding-bottom: 230px; }
  body.guide-min main { padding-bottom: 70px; }
  body.guide-open .pane, body.guide-open .settings, body.guide-min .pane, body.guide-min .settings { padding-bottom: 16px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .tabbar {
    display: flex; flex: none; height: auto; min-height: var(--tabbar-h); padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 2px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .tabbar a .ico { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--primary-text); background: var(--primary-soft); }
  .tabbar .nav-count { position: absolute; top: 1px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 16px; background: var(--primary); color: var(--primary-ink); border: 0; }
  .guide { left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); width: auto; }
  body.guide-min .guide { left: auto; }
  .toast { bottom: calc(var(--tabbar-h) + 16px); }
  .page-head { padding: 12px 16px; }
  .toolbar { padding: 10px 16px; }
  .tabs-row { padding: 6px 10px; }
  .coll-split { display: block; }
  .coll-nav { position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; display: flex; gap: 6px; overflow-x: auto; }
  .coll-group { display: none; }
  .coll-list { flex-direction: row; gap: 6px; }
  .coll-link { white-space: nowrap; border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }
  .coll-pane { padding: 14px 16px; }
  .settings { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 6px 10px; gap: 6px; }
  .sim-long, .tab-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sim-short, .tab-s { display: inline; }
  .status-pill .sp-text { display: none; }
  .status-pill { padding: 6px; margin-right: 0; }
  .src-row { flex-direction: column; gap: 8px; }
  .src-act { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .tag-add { grid-template-columns: minmax(0, 1fr) auto; }
  .tag-add label { grid-column: 1 / -1; }
  .meta-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .meta-dl dt { margin-top: 6px; }
  .tg { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .crit-row { grid-template-columns: 66px minmax(40px, 1fr) 40px; }
  .card { padding: 12px 13px; }
  .tab { padding: 6px 9px; font-size: 13px; gap: 5px; }
  .tab .ico { display: none; }
  .tabs { flex-wrap: wrap; min-width: 0; }
  .pipe-step { font-size: 12px; padding: 3px 8px 3px 6px; gap: 5px; }
  .pipe-ico { width: 14px; height: 14px; }
}
@media (max-width: 640px) {
  .g-card { padding: 10px 12px 12px; }
  .g-text { font-size: 13px; margin-bottom: 8px; }
  .g-dots { margin-bottom: 9px; }
}
@media (max-width: 420px) {
  .status-pill { display: none; }
}
@media (max-width: 400px) {
  .brand { gap: 8px; }
  .brand-name { font-size: 13.5px; line-height: 1.15; white-space: normal; }
  .sim-badge { padding: 2px 7px; letter-spacing: .03em; }
  .mark { width: 30px; height: 30px; font-size: 10.5px; }
  .icon-btn { width: 34px; height: 34px; }
  .page-head h2 { font-size: 17px; }
  .btn { padding: 7px 11px; }
}
@media print {
  .banner, .topbar, .sidebar, .tabbar, .guide, .toast, .ph-actions, .tabs-row, .toolbar, .list-pane, .back, .hd-actions, .card-actions { display: none !important; }
  body { height: auto; overflow: visible; display: block; }
  .shell, main, .view, .view-body, .split { display: block; overflow: visible; }
  .pane { overflow: visible; }
}
