/* OSINT Analytica — one stylesheet, no build step.
   Colours are defined once as tokens (docs/BRAND.md). The brand look is "Midnight": near-black with a faint grid,
   purple-to-blue gradient accents and soft glows. A light theme is the option.
   Every text/background pair below is checked for contrast in tests/test_brand.py. */

:root, [data-theme="dark"] {
  --bg: #07060d; --surface: #100e1a; --surface-2: #191628; --line: #2b2742; --line-soft: #1e1b30;
  --text: #ecebf5; --text-2: #bfbbd2; --muted: #9993b0; --link: #a5b4fc;
  --accent: #5b4bdb; --accent-ink: #ffffff; --focus: #a5b4fc;
  --ok: #6ee7a8; --ok-bg: #0d3326; --warn: #fbbf5a; --warn-bg: #3f2c0b; --err: #ff9d9d; --err-bg: #47181d;
  --info: #93c5fd; --info-bg: #132a4d; --neutral: #c8c4dc; --neutral-bg: #25213a;
  --code-bg: #04030a; --code-text: #dcd9ec; --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --grad-a: #c084fc; --grad-b: #818cf8; --grad-c: #60a5fa;          /* gradient as text: light enough to read on dark */
  --grid: rgba(129, 140, 248, .055); --glow: rgba(124, 92, 246, .35); --tile-ink: #ffffff;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f5fb; --surface: #ffffff; --surface-2: #efedf8; --line: #d9d5ea; --line-soft: #e9e6f4;
  --text: #14101f; --text-2: #3b3552; --muted: #5f5978; --link: #4338ca;
  --accent: #5b47e0; --accent-ink: #ffffff; --focus: #5b47e0;
  --ok: #0f6b3f; --ok-bg: #dcf5e6; --warn: #8a5200; --warn-bg: #fdecc8; --err: #a11a1a; --err-bg: #fde2e2;
  --info: #1e4fa3; --info-bg: #e1ebfc; --neutral: #423b5c; --neutral-bg: #e8e5f3;
  --code-bg: #14101f; --code-text: #ecebf5; --shadow: 0 1px 2px rgba(20, 16, 31, .07);
  --grad-a: #7e22ce; --grad-b: #4338ca; --grad-c: #1d4ed8;          /* gradient as text: dark enough to read on light */
  --grid: rgba(67, 56, 202, .045); --glow: rgba(91, 71, 224, .22); --tile-ink: #ffffff;
  color-scheme: light;
}
:root {
  --ink: #07060d; --ink-2: #131022; --ink-line: #2b2742; --ink-text: #ecebf5; --ink-muted: #b3aecb;   /* the top bar and report cover: always near-black, like the logo's ground */
  --brand-a: #a855f7; --brand-b: #6366f1; --brand-c: #3b82f6;                                          /* the brand gradient, used as fills and lines */
  --gradient: linear-gradient(120deg, var(--brand-a), var(--brand-b) 55%, var(--brand-c));
  --gradient-text: linear-gradient(120deg, var(--grad-a), var(--grad-b) 55%, var(--grad-c));
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }   /* body text 16px; secondary text never under 14px; small labels never under 12.5px */
body { margin: 0; background-color: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.55;
       background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
       background-size: 34px 34px; background-attachment: fixed; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.6rem; margin: 0 0 .35rem; letter-spacing: -.015em; font-weight: 700; }
h1, .gradient-text { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; max-width: 100%; }
@media (forced-colors: active) { h1, .gradient-text { background: none; color: CanvasText; } }
h2 { font-size: 1.08rem; margin: 0 0 .8rem; font-weight: 650; }
h3 { font-size: .93rem; margin: 1.1rem 0 .4rem; font-weight: 650; }
p { margin: .5rem 0; }
code, .selector { font-family: var(--mono); }
code { font-size: .88em; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.lead { color: var(--text-2); margin: 0 0 1.2rem; max-width: 72ch; }
.hint { color: var(--muted); font-size: .875rem; margin: .6rem 0 0; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* ---------- top bar: always navy, like the logo's own background ---------- */
.topbar { background: var(--ink); color: var(--ink-text); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--ink-line); }
.topbar::after { content: ""; display: block; height: 2px; background: var(--gradient); box-shadow: 0 0 14px var(--glow); }
.topbar-main { display: flex; align-items: center; gap: 1rem; padding: .55rem 1.2rem; }
.brand { display: flex; align-items: center; flex-shrink: 0; } .brand img { height: 40px; width: auto; display: block; }
.brand-text { color: #fff; font-size: 1.15rem; font-weight: 500; letter-spacing: .02em; }
.gsearch { flex: 1; display: flex; gap: .4rem; max-width: 760px; min-width: 0; }
.gsearch input, .gsearch select { background: var(--ink-2); border: 1px solid var(--ink-line); color: var(--ink-text); }
.gsearch input { flex: 1; min-width: 0; font-family: var(--mono); }
.gsearch input::placeholder { color: var(--ink-muted); font-family: var(--sans); }
.gsearch select { max-width: 200px; }
.gsearch .btn { white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: .55rem; margin-left: auto; font-size: .875rem; flex-shrink: 0; }
.who { color: var(--ink-muted); }
.iconbtn { background: transparent; border: 1px solid var(--ink-line); color: var(--ink-text); border-radius: 8px; width: 2.3rem; height: 2.3rem; cursor: pointer; font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover { background: var(--ink-2); }
.topnav { display: flex; gap: .2rem; padding: 0 1.2rem; }
.topnav a { color: var(--ink-muted); padding: .45rem .8rem; font-weight: 550; font-size: .9rem; border-bottom: 2px solid transparent; }
.topnav a:hover { color: #fff; text-decoration: none; } .topnav a.on { color: #fff; border-image: var(--gradient) 1; border-bottom-width: 2px; border-bottom-style: solid; }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.topbar .linkbtn { color: #c7d2ff; }
.adminarea .topbar .muted { color: var(--ink-muted); }   /* the console's bar stays dark in both themes: its quiet text uses the bar's own colour (light theme: 3.06 to 1 before) */

/* ---------- page ---------- */
.page { padding: 1.4rem 1.6rem 4rem; max-width: 1500px; margin: 0 auto; }
.page-narrow { max-width: 1100px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.3rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card-glow { position: relative; } .card-glow:hover { border-color: var(--brand-b); box-shadow: 0 0 0 1px var(--brand-b), 0 8px 30px -12px var(--glow); }
/* coloured icon tiles: a rounded square carrying one icon */
.tile { width: 2.3rem; height: 2.3rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--tile-ink); flex-shrink: 0; background: var(--gradient); box-shadow: 0 6px 18px -8px var(--glow); }
.tile .ico { width: 1.15rem; height: 1.15rem; stroke-width: 2; }
.tile-violet { background: linear-gradient(135deg, #a855f7, #7c3aed); } .tile-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.tile-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); } .tile-teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.tile-rose { background: linear-gradient(135deg, #f43f5e, #be123c); } .tile-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }
.tile-slate { background: linear-gradient(135deg, #64748b, #334155); } .tile-small { width: 1.7rem; height: 1.7rem; border-radius: 8px; } .tile-small .ico { width: .9rem; height: .9rem; }
.card-title { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; } .card-title h2 { margin: 0; }
.narrow { max-width: 460px; margin: 2.5rem auto; padding: 0; overflow: hidden; }
.narrow .card-body { padding: 1.3rem 1.5rem 1.5rem; }
.brand-band { background: var(--ink); padding: 1.3rem 1.5rem; border-bottom: 2px solid transparent; border-image: var(--gradient) 1; } .brand-band img { height: 46px; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; } .grid2 > .card { margin-bottom: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-bottom: 1.1rem; } .grid3 > .card { margin-bottom: 0; }
@media (max-width: 1050px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; } .spread { justify-content: space-between; align-items: center; }
.grow { flex: 1; }

label { font-size: .875rem; font-weight: 600; color: var(--text-2); display: flex; flex-direction: column; gap: .25rem; }
input, select, textarea { font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=file] { padding: .35rem; }
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); box-shadow: 0 6px 20px -10px var(--glow); border-radius: 7px; padding: .5rem .95rem; font: inherit; font-weight: 600; cursor: pointer; display: inline-block; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn-quiet { background: transparent; color: var(--link); border-color: var(--line); box-shadow: none; }
.btn-quiet:hover { background: var(--surface-2); filter: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.searchbar { display: flex; gap: .6rem; flex-wrap: wrap; } .searchbar input[name=selector] { flex: 1; min-width: 240px; font-family: var(--mono); font-size: 1rem; padding: .65rem .8rem; }
.photobar { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-family: var(--mono); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--text); }

.alert { border-radius: 8px; padding: .65rem .9rem; margin: 0 0 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-error { background: var(--err-bg); color: var(--err); } .alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); } .alert-info { background: var(--info-bg); color: var(--info); }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- status vocabulary: one colour and one icon per meaning, everywhere ---------- */
.badge, .pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 6px; padding: .14rem .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); vertical-align: middle; }
.pill { border-radius: 999px; padding: .18rem .7rem; } .pill:hover { text-decoration: none; }
.ico { width: .85em; height: .85em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.s-offline, .s-recorded, .s-skipped, .s-empty, .s-pending { background: var(--neutral-bg); color: var(--neutral); }
.s-local { background: var(--info-bg); color: var(--info); }
.s-sample { background: transparent; color: var(--warn); border: 1px dashed var(--warn); }
.s-ok, .s-verified, .s-approved, .s-done { background: var(--ok-bg); color: var(--ok); }
.s-lead { background: var(--neutral-bg); color: var(--neutral); }
.s-corroborated, .s-running { background: var(--info-bg); color: var(--info); }
.s-rejected, .s-error { background: var(--err-bg); color: var(--err); }
.s-held, .s-needs_key { background: var(--warn-bg); color: var(--warn); }
.s-assess { background: var(--neutral-bg); color: var(--neutral); }
.s-proto { background: var(--ink-2); color: var(--ink-muted); border: 1px solid var(--ink-line); }
/* old class names kept as aliases */
.badge-sample { background: transparent; color: var(--warn); border: 1px dashed var(--warn); }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-skipped { background: var(--neutral-bg); color: var(--neutral); }
.spinner { display: inline-block; width: .8rem; height: .8rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.dot { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; margin-right: .4rem; flex-shrink: 0; }
.tag { display: inline-block; border: 1px solid var(--line); color: var(--text-2); border-radius: 5px; padding: 0 .4rem; font-size: .8rem; white-space: nowrap; }

/* ---------- tables and lists ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .65rem .8rem; border-bottom: 1px solid var(--line); font-weight: 650; white-space: nowrap; }
.table td { padding: .8rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: break-word; line-height: 1.5; }
.table-tight td { padding: .55rem .8rem; }
.table .subline { color: var(--muted); font-size: .875rem; margin-top: .2rem; } .table td.when span { white-space: nowrap; display: inline-block; }
.table-sources { table-layout: fixed; min-width: 980px; } .table-sources td { font-size: .92rem; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: var(--surface-2); }
.plain, .caselist { list-style: none; padding: 0; margin: 0; } .plain li { padding: .28rem 0; overflow-wrap: anywhere; }
.caselist li { padding: .7rem 0; border-bottom: 1px solid var(--line-soft); } .caselist li:last-child { border-bottom: 0; }
.cols { columns: 2; column-gap: 2rem; } @media (max-width: 1300px) { .cols { columns: 1; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .4rem 1rem; margin: 0 0 1rem; } .kv dt { color: var(--muted); font-size: .875rem; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-size: .8rem; color: var(--text-2); overflow-wrap: anywhere; }
.raw { background: var(--code-bg); color: var(--code-text); padding: .9rem; border-radius: 8px; font-size: .8rem; max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); }
.kvpair { margin-right: .6rem; }
.stat { font-size: 1.8rem; font-weight: 700; line-height: 1.1; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; } .stat-label { color: var(--muted); font-size: .8rem; }
.statrow { display: flex; gap: 1.6rem; flex-wrap: wrap; }
/* the one list of capabilities, wherever it is drawn */
.capgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1.2rem 1.6rem; margin-top: .7rem; } .capgroup h3 { display: flex; align-items: center; gap: .45rem; font-size: 1rem; margin: 0 0 .35rem; }
.caprows li { padding: .5rem 0; border-top: 1px solid var(--line-soft); } .caprows li:first-child { border-top: 0; } .caprows .badge { margin-left: .25rem; }
/* figures under a heading with a button beside it keep their distance from the button */
.entity-head + .statrow { margin-top: 1.15rem; padding-top: 1.05rem; border-top: 1px solid var(--line-soft); } .stat-sub { white-space: nowrap; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--text-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--text); } .empty p { max-width: 56ch; margin: .3rem auto; }
/* A numbered list of steps starts at the left edge of its card, like everything else on the page. Only inside the centred "nothing here yet" box is it centred. */
.steps { text-align: left; margin: .6rem 0 0; padding-left: 1.3rem; max-width: 80ch; } .steps li { margin: .3rem 0; } .empty .steps { max-width: 52ch; margin: .8rem auto 0; }

/* ---------- case workspace: list on the left, profile in the centre, details on the right ---------- */
.case-head { margin-bottom: .9rem; } .crumbs { font-size: .8rem; color: var(--muted); }
.case-title { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; } .case-title h1 { margin: 0; }
.purpose { color: var(--text-2); margin: .15rem 0 .7rem; max-width: 100ch; font-size: .9rem; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.tabs a { padding: .65rem 1rem; font-size: 1rem; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-image: var(--gradient) 1; border-bottom-width: 2px; border-bottom-style: solid; } .tabs a:hover { text-decoration: none; color: var(--text); }
.tabs kbd { margin-left: .35rem; opacity: .6; }
.sample-toggle { margin-left: auto; display: flex; gap: .5rem; align-items: center; font-size: .875rem; padding: .3rem 0; }
.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.workspace.has-panel { grid-template-columns: 250px minmax(0, 1fr) 360px; }
.rail { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .8rem 1rem; font-size: .88rem; }
.rail h3 { margin: .9rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .rail h3:first-child { margin-top: 0; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail a { display: flex; align-items: center; gap: .15rem; padding: .22rem .4rem; border-radius: 6px; color: var(--text-2); overflow-wrap: anywhere; }
.rail a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); } .rail a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.rail input { width: 100%; padding: .35rem .5rem; font-size: .875rem; margin-bottom: .2rem; }
.rail .count { margin-left: auto; color: var(--muted); font-size: .8rem; padding-left: .4rem; }
.content { min-width: 0; }
.panel { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: .9rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; margin-bottom: .5rem; } .panel-head h2 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.panel .kv { grid-template-columns: 92px 1fr; font-size: .875rem; }
.panel-close { background: transparent; border: 1px solid var(--line); color: var(--text-2); border-radius: 6px; cursor: pointer; width: 1.7rem; height: 1.7rem; flex-shrink: 0; }
@media (max-width: 1280px) {
  .workspace.has-panel { grid-template-columns: 250px minmax(0, 1fr); }
  .panel { position: fixed; top: 96px; right: 12px; width: min(400px, 92vw); max-height: calc(100vh - 110px); z-index: 20; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
}
@media (max-width: 900px) { .workspace, .workspace.has-panel { grid-template-columns: 1fr; } .rail { position: static; max-height: 260px; } }

.entity-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.entity-head h2 { font-size: 1.3rem; margin: .3rem 0; overflow-wrap: anywhere; }
.assessment { border-left: 3px solid var(--brand-b); background: var(--surface-2); padding: .7rem 1rem; border-radius: 0 8px 8px 0; margin-top: .9rem; }
.assessment p { margin: .35rem 0; color: var(--text); } .assessment-label { font-weight: 650; font-size: .875rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fact { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: .9rem; padding: .7rem .6rem; border-bottom: 1px solid var(--line-soft); align-items: baseline; cursor: pointer; border-radius: 6px; color: inherit; }
.fact:hover, .fact.on { background: var(--surface-2); text-decoration: none; }
.fact-prop { color: var(--muted); font-size: .875rem; } .fact-value { font-family: var(--mono); font-size: .92rem; overflow-wrap: anywhere; color: var(--text); }
.fact-meta { display: flex; gap: .5rem; align-items: center; white-space: nowrap; font-size: .875rem; }
.fact-rejected .fact-value { text-decoration: line-through; color: var(--muted); }
@media (max-width: 1100px) { .fact { grid-template-columns: 1fr; gap: .15rem; } }
.statusform { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.rule { font-size: .82rem; color: var(--muted); margin: -.45rem 0 .1rem; padding-left: 1.1rem; position: relative; }
.rule::before { content: "•"; position: absolute; left: .25rem; }
.rule-ok { color: var(--ok); } .rule-ok::before { content: "✓"; }
.rule-bad { color: var(--err); font-weight: 600; } .rule-bad::before { content: "✕"; }

/* ---------- graph and timeline ---------- */
#graph-wrap { position: relative; }
#graph { height: 580px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.graph-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: #f8fafc; border: 1px solid var(--ink-line); border-radius: 6px; padding: .4rem .6rem; font-size: .875rem; max-width: 420px; overflow-wrap: anywhere; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.graph-tip .tip-type { color: var(--ink-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.graph-info { padding: .6rem .2rem 0; } .legend { display: flex; gap: 1.1rem; flex-wrap: wrap; padding-top: .5rem; font-size: .875rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; }
#timeline { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.vis-timeline { border: 0 !important; }
.vis-text, .vis-label, .vis-time-axis .vis-text { color: var(--text-2) !important; }
.vis-panel, .vis-foreground .vis-group, .vis-labelset .vis-label, .vis-time-axis .vis-grid.vis-minor, .vis-time-axis .vis-grid.vis-major { border-color: var(--line) !important; }
.vis-item { color: #0b1b33; border-radius: 5px !important; font-size: .8rem; }
.vis-item.tl-facts { background: #b8f0d6; border-color: #0f766e; } .vis-item.tl-research { background: #cdd7ff; border-color: #4054e0; }
.vis-item.tl-sample { background: #fdecc8; border-color: #b45309; border-style: dashed; }
.vis-item.vis-selected { box-shadow: 0 0 0 2px var(--focus); }

/* ---------- help dialog and keyboard hints ---------- */
kbd { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; color: var(--text-2); }
.topbar kbd { background: var(--ink-2); border-color: var(--ink-line); color: var(--ink-muted); }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem 1.5rem; width: min(680px, 92vw); max-height: 86vh; }
dialog::backdrop { background: rgba(4, 10, 20, .65); }
.keys { display: grid; grid-template-columns: 120px 1fr; gap: .5rem 1rem; margin: .4rem 0 1rem; font-size: .95rem; }
.legend-grid { display: grid; grid-template-columns: 160px 1fr; gap: .55rem 1rem; font-size: .95rem; align-items: center; }
details.enable summary { cursor: pointer; color: var(--link); } details.enable { margin-top: .3rem; }

/* a fact row is a real button, so it works from the keyboard */
button.fact { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-soft); font: inherit; text-align: left; }
button.fact:hover, button.fact.on { background: var(--surface-2); }
tr.on td { background: var(--surface-2); }
.page > h1 { margin-bottom: .6rem; }
.card > .crumbs { margin-bottom: .3rem; }

.s-unavailable { background: var(--err-bg); color: var(--err); }
.btn-small { padding: .25rem .7rem; font-size: .875rem; }

/* the case tabs stay in view, just under the top bar, instead of sliding beneath it */
.case-head .tabs { position: sticky; top: var(--topbar-h, 84px); z-index: 20; background: var(--bg); padding-top: .2rem; }
.rail, .panel { top: calc(var(--topbar-h, 84px) + 56px); max-height: calc(100vh - var(--topbar-h, 84px) - 72px); }
.table td.num, .table th.num { white-space: nowrap; width: 1%; }

details.tech summary { cursor: pointer; color: var(--muted); } details.tech .raw { margin-top: .4rem; max-height: 260px; }

.s-unverified { background: var(--neutral-bg); color: var(--neutral); } .s-alleged { background: var(--warn-bg); color: var(--warn); }
.s-reported { background: var(--info-bg); color: var(--info); } .s-confirmed { background: var(--ok-bg); color: var(--ok); }
.s-assessment { background: var(--neutral-bg); color: var(--text); border: 1px solid var(--line); }

.checkline { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 500; margin-top: .5rem; } .checkline input { margin-top: .25rem; }
.map-layers { margin: .5rem 0 0; } .map-key { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: baseline; margin-left: .25rem; } .map-key-infra { background: #0f766e; }
.match-list { padding-left: 1.2rem; } .match-list li { margin: .6rem 0; } ul.match-list { padding-left: 0; } .match-list .btn { margin-top: .25rem; }
.tag-full { border-color: var(--ok, #16a34a); } .tag-strong { border-color: var(--warn, #d97706); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .25rem .75rem; margin-top: .25rem; } .chips .checkline { margin-top: 0; font-weight: 400; }
/* A tick box or a choice always sits at the left of the first line of its own sentence (tests/test_e2e_access.py checks every one). */
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; padding: 0; flex: none; accent-color: var(--accent); }
.checkline > span { flex: 1; min-width: 0; }
details.danger summary { cursor: pointer; color: var(--err); font-weight: 600; } .btn-danger { background: var(--err-bg); color: var(--err); border-color: var(--err); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.request { padding: 1rem 0; border-bottom: 1px solid var(--line-soft); } .request:last-child { border-bottom: 0; }
.s-pending { background: var(--warn-bg); color: var(--warn); }

.demobar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .5rem 1.2rem; background: var(--warn-bg); color: var(--warn); font-size: .9rem; border-bottom: 1px solid var(--line); }
.s-demo { background: transparent; color: var(--warn); border: 1px dashed var(--warn); }

/* =====================================================================================================
   Workspace shell, laid out like a mailbox: sidebar | list of rows | reading pane.
   Each area scrolls by itself, so nothing slides under the top bar. (Rules here override the earlier layout.)
   ===================================================================================================== */
body.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100vh; overflow: hidden; }
body.app.side-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
body.app.no-side { display: block; height: auto; overflow: auto; }
.sidebar { background: var(--ink); color: var(--ink-text); border-right: 1px solid var(--ink-line); display: flex; flex-direction: column; padding: 1.1rem .8rem .85rem; overflow-y: auto; min-height: 0; }
.side-brand { display: flex; align-items: center; padding: .45rem .55rem .5rem; } .side-brand .logo-full { height: 37px; width: auto; max-width: 100%; } .side-brand .logo-mark { display: none; height: 42px; width: 42px; border-radius: 10px; }
.btn-new { display: flex; gap: .5rem; align-items: center; justify-content: center; width: 100%; margin: 1.1rem 0 .9rem; padding: .82rem .9rem; border: 0; border-radius: 12px;
           background: var(--gradient); color: #fff; font-weight: 650; font-size: 1.06rem; box-shadow: 0 0 24px -6px var(--glow); }
.btn-new .ico { width: 1.05em; height: 1.05em; stroke-width: 2.6; } .btn-new.is-off { opacity: .45; cursor: not-allowed; box-shadow: none; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a, .side-sec > a { display: flex; align-items: center; gap: .85rem; padding: .62rem .8rem; border-radius: 10px; color: var(--ink-muted); font-weight: 550; font-size: 1rem; position: relative; }
.side-nav a:hover, .side-sec > a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.side-nav a.on, .side-sec > a.on { background: var(--ink-2); color: #fff; } .side-nav a.on::before, .side-sec > a.on::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--gradient); }
.sidebar .ico { width: 1.3em; height: 1.3em; flex-shrink: 0; stroke-width: 1.9; } .sidebar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .count { margin-left: auto; background: var(--brand-b); color: #fff; border-radius: 999px; font-size: .8rem; padding: 0 .45rem; font-weight: 700; }
.side-sec { margin-top: .9rem; } .side-sec > summary { cursor: pointer; text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; font-weight: 700; color: var(--ink-text); padding: .7rem .8rem .5rem; }
.side-add > summary { list-style: none; display: flex; align-items: center; gap: .85rem; padding: .58rem .8rem; color: var(--ink-muted); cursor: pointer; font-size: .97rem; border-radius: 10px; }
.side-add > summary::-webkit-details-marker { display: none; } .side-add > summary:hover { background: var(--ink-2); color: #fff; }
.side-add form { display: flex; gap: .4rem; padding: .4rem .6rem .6rem; } .side-add input { flex: 1; min-width: 0; background: var(--ink-2); border-color: var(--ink-line); color: var(--ink-text); padding: .45rem .6rem; font-size: .95rem; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding-top: .8rem; border-top: 1px solid var(--ink-line); }
.sidebar .iconbtn { color: var(--ink-text); border-color: var(--ink-line); } .side-collapse .ico { transform: rotate(180deg); }
.side-collapsed .lbl, .side-collapsed .logo-full, .side-collapsed .sidebar .count, .side-collapsed .side-add form, .side-collapsed .side-mode { display: none; }
.side-collapsed .side-brand .logo-mark { display: block; } .side-collapsed .side-brand { justify-content: center; padding: 0; }
.side-collapsed .side-nav a, .side-collapsed .side-sec > a, .side-collapsed .side-add > summary { justify-content: center; padding: .7rem 0; }
.side-collapsed .side-sec > summary { height: 1px; padding: 0; margin: .5rem .6rem; background: var(--ink-line); overflow: hidden; list-style: none; }
.side-collapsed .side-foot { justify-content: center; } .side-collapsed .side-collapse .ico { transform: none; } .side-collapsed .btn-new { padding: .82rem 0; }
.dot-violet { background: #a855f7; } .dot-indigo { background: #6366f1; } .dot-blue { background: #3b82f6; } .dot-teal { background: #14b8a6; } .dot-amber { background: #f59e0b; } .dot-rose { background: #f43f5e; } .dot-slate { background: #64748b; }

.mainarea { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; } body.no-side .mainarea { height: auto; min-height: 100vh; }
.topbar { position: static; display: flex; align-items: center; gap: 1rem; padding: .65rem 1.2rem; background: var(--ink); border-bottom: 2px solid transparent; border-image: var(--gradient) 1; flex-shrink: 0; }
.topbar::after { display: none; }
.gsearch { flex: 1; max-width: 860px; display: flex; align-items: center; gap: .55rem; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 11px; padding: 0 .85rem; color: var(--ink-muted); }
.gsearch:focus-within { border-color: var(--brand-b); box-shadow: 0 0 0 3px rgba(99, 102, 241, .22); }
.gsearch input { border: 0; background: transparent; flex: 1; min-width: 0; padding: .7rem 0; font-size: 1rem; font-family: var(--sans); color: var(--ink-text); } .gsearch input:focus { outline: none; }
.gsearch .ico { width: 1.05em; height: 1.05em; }
.usermenu { position: relative; } .avatar { width: 2.35rem; height: 2.35rem; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 700; font-size: .86rem; display: flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; letter-spacing: .02em; }
.avatar::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 2.9rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; min-width: 220px; z-index: 60; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: .5rem; }
.menu-who { display: flex; flex-direction: column; padding-bottom: .5rem; border-bottom: 1px solid var(--line-soft); } .usermenu .linkbtn { color: var(--link); }

.view { flex: 1; min-height: 0; overflow: auto; } body.no-side .view { overflow: visible; padding: 1.4rem 1.6rem 3rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.view-page { padding: 1.4rem 1.7rem 3rem; } .view-narrow { max-width: 1040px; }
.view > .alert { margin: 1rem 1.2rem 0; } .view-page > .alert { margin: 0 0 1rem; }
.view-split { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.view-split > .alert { grid-column: 1 / -1; }
.listcol { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.list-head { padding: .95rem 1rem .6rem; position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.list-title { font-size: 1.35rem; margin: .1rem 0 0; } .list-head .purpose { margin: .2rem 0 0; font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kindtabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .7rem; }
.kindtabs a { white-space: nowrap; padding: .32rem .75rem; border-radius: 999px; font-size: .875rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); }
.kindtabs a:hover { text-decoration: none; border-color: var(--brand-b); } .kindtabs a.on { background: var(--accent); color: #fff; border-color: transparent; } .kindtabs .n { opacity: .75; margin-left: .35rem; font-weight: 500; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .55rem; } .list-tools .sample-toggle { padding: 0; }
#rail-filter { width: 100%; margin-top: .45rem; }
.rows { list-style: none; margin: 0; padding: 0; } .row { position: relative; border-bottom: 1px solid var(--line-soft); }
.row:hover { background: var(--surface-2); } .row.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand-b); }
.row-main { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1.1rem; color: inherit; } .row-main:hover { text-decoration: none; } .row-main:focus-visible { outline-offset: -2px; }
.row-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .16rem; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; } .row-title { font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; color: var(--text); }
.row-when { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.row-preview { color: var(--text-2); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .22rem; }
.chip-s { font-size: .8rem; color: var(--muted); display: inline-flex; gap: .25rem; align-items: center; } .chip-warn { color: var(--err); font-weight: 600; }
.chip-ev { font-size: .8rem; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; padding: 0 .38rem; display: inline-flex; gap: .25rem; align-items: center; color: var(--text-2); background: var(--surface); }
.row-actions { position: absolute; right: .55rem; top: .5rem; display: none; gap: .2rem; background: var(--surface); border: 1px solid var(--line); padding: .15rem; border-radius: 9px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
.row:hover .row-actions, .row:focus-within .row-actions { display: flex; }
.row-actions .iconbtn, .view .iconbtn { color: var(--text-2); border-color: transparent; width: 2.05rem; height: 2.05rem; } .row-actions .iconbtn:hover { background: var(--surface-2); color: var(--text); }
.row-actions form { display: inline-flex; } .rows-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; } .rows-card .row:last-child { border-bottom: 0; }
.list-foot { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; margin-top: auto; }
.pages { display: flex; gap: .25rem; } .pages a { padding: .2rem .7rem; border-radius: 7px; border: 1px solid var(--line); font-size: .9rem; color: var(--text-2); } .pages a.on { background: var(--accent); border-color: transparent; color: #fff; }
.tips { padding: 0 1rem 1rem; } .tip { display: none; } .tip.show { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; font-size: .875rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; margin: 0; }
.tip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; } .empty-list { margin: 1rem; }
.new-case { margin: .8rem 1rem 0; }
.pane { position: relative; overflow-y: auto; min-height: 0; }
.pane > .tabs { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: .35rem 1.3rem 0; }
.pane-body { padding: 1.1rem 1.4rem 3rem; max-width: 1150px; }
.pane .panel { position: fixed; right: 16px; top: 108px; width: min(410px, 92vw); max-height: calc(100vh - 128px); z-index: 25; box-shadow: 0 18px 50px -10px rgba(0, 0, 0, .65), 0 0 0 1px var(--line); }
.pane-empty { text-align: center; padding: 1.6rem 1rem 1.3rem; } .pane-empty h2 { font-size: 1.3rem; margin: .4rem 0 .2rem; } .empty-art { width: 190px; height: auto; } .empty .empty-art { display: block; margin: 0 auto .4rem; }
.checks { border: 1px solid var(--line); border-radius: 9px; padding: .4rem .8rem .6rem; } .checks legend { font-size: .875rem; font-weight: 600; color: var(--text-2); padding: 0 .3rem; }
#graph { height: calc(100vh - 330px); min-height: 380px; }
dialog#new-research { width: min(560px, 92vw); }
/* 13–14 inch laptops: a slimmer sidebar and list so the reading pane keeps its room */
@media (max-width: 1540px) { body.app { grid-template-columns: 256px minmax(0, 1fr); } .view-split { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); } .side-brand .logo-full { height: 35px; } }
@media (max-width: 1400px) { body.app { grid-template-columns: 244px minmax(0, 1fr); } .view-split { grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); } .pane > .tabs kbd { display: none; } .pane > .tabs a { padding: .65rem .8rem; } .side-brand .logo-full { height: 33px; } }
@media (max-width: 1180px) { .view-split { grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  body.app { grid-template-columns: 76px minmax(0, 1fr); }
  body.app .lbl, body.app .logo-full, body.app .sidebar .count, body.app .side-add form, body.app .side-mode { display: none; } body.app .side-brand .logo-mark { display: block; }
  body.app .side-nav a, body.app .side-sec > a, body.app .side-add > summary { justify-content: center; padding: .7rem 0; } body.app .side-sec > summary { height: 1px; padding: 0; margin: .5rem .6rem; background: var(--ink-line); overflow: hidden; }
  .view-split { display: block; overflow: auto; } .listcol { border-right: 0; border-bottom: 1px solid var(--line); max-height: 55vh; } .pane { overflow: visible; }
  .topbar .s-proto { display: none; }
}

/* =====================================================================================================
   Security: lock, privacy screen, session warning, the Security centre.
   ===================================================================================================== */
body.lock-now { background: var(--ink); } body.lock-now > * { visibility: hidden !important; }
body.bare { display: block; min-height: 100vh; padding: 8vh 1rem 2rem; }
.lock-who { display: flex; align-items: center; gap: .8rem; margin-bottom: .4rem; } .lock-who h1 { margin: 0; } .lock-out { margin-top: 1rem; }
.iconbtn .ico { width: 1.15rem; height: 1.15rem; } .iconbtn.is-on { background: var(--brand-b); border-color: transparent; color: #fff; } .iconbtn[disabled] { cursor: not-allowed; }
.idle-warn { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 90; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); border-radius: 12px;
             padding: .8rem 1rem; display: flex; gap: 1rem; align-items: center; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); width: max-content; max-width: min(700px, 92vw); }
.sr, .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* privacy screen: for people looking at the screen. The text is still on the page; pointing at it shows it. */
body.privacy :is(.selector, .row-title, .row-preview, .fact-value, .entity-head h2, .raw, .hash, .assessment p, .kv dd, .pane-body .table td, .list-title, .list-head .purpose,
                 .chip-ev, .graph-tip, #graph, #timeline, .audit-what, .panel-head h2, .caselist a, .gsearch input, .codes, .purpose, .note-body, .brief-text) { filter: blur(7px); transition: filter .12s; }
body.privacy :is(.selector, .row-title, .row-preview, .fact-value, .entity-head h2, .raw, .hash, .assessment p, .kv dd, .pane-body .table td, .list-title, .list-head .purpose,
                 .chip-ev, .graph-tip, #graph, #timeline, .audit-what, .panel-head h2, .caselist a, .gsearch input, .codes, .purpose, .note-body, .brief-text):is(:hover, :focus, :focus-within),
body.privacy :is(.row, .fact, .pane-body .table td, .kv dd, .assessment, .caselist li):hover :is(.selector, .row-title, .row-preview, .fact-value, .hash, .chip-ev, p, a) { filter: none; }
.sec-list { list-style: none; margin: 0; padding: 0; } .sec-item { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 0; border-top: 1px solid var(--line-soft); } .sec-item:first-child { border-top: 0; }
.sec-mark { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .1rem; } .sec-mark .ico { width: 1rem; height: 1rem; }
.sec-ok { background: var(--ok-bg); color: var(--ok); } .sec-warn { background: var(--warn-bg); color: var(--warn); } .sec-info { background: var(--neutral-bg); color: var(--neutral); }
.sec-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; } .sec-text span { color: var(--text-2); font-size: .95rem; }
.sec-new { color: var(--warn); } .sec-welcome { border-color: var(--brand-b); box-shadow: 0 0 0 1px var(--brand-b), 0 8px 30px -12px var(--glow); } .sec-codes { border-color: var(--warn); }
.codes { columns: 2; column-gap: 2rem; padding-left: 1.8rem; margin: .8rem 0; max-width: 540px; } .codes li { padding: .3rem 0; } .codes code { font-size: 1.05rem; letter-spacing: .04em; }
.qr-row { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; } .qr { background: #fff; padding: .4rem; border-radius: 10px; line-height: 0; } .qr svg { width: 168px; height: 168px; display: block; }
.level { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .05rem .65rem; font-size: .8rem; font-weight: 650; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.level-sensitive { color: var(--warn); border-color: var(--warn); } .level-high { color: var(--err); border-color: var(--err); }
.exposure { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 0 10px 10px 0; padding: .8rem 1rem; background: var(--surface-2); } .exposure-none { border-left-color: var(--ok); } .exposure p { margin: .25rem 0; }
.case-meta { margin: .35rem 0 0; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; } .retry-check { display: inline-flex; margin: 0 .4rem 0 0; font-size: .875rem; }
.export-form { margin: .8rem 0 .4rem; } .export-form .row { align-items: center; }

/* =====================================================================================================
   Workspace tools: command palette, notebook (brief, leads, research log), list research, comparison.
   ===================================================================================================== */
.palette-open { display: inline-flex; align-items: center; gap: .5rem; background: var(--ink-2); border: 1px solid var(--ink-line); color: var(--ink-muted); border-radius: 11px; padding: .5rem .8rem; font: inherit; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.palette-open:hover { color: #fff; border-color: var(--brand-b); } .palette-open .ico { width: 1.05em; height: 1.05em; }
dialog#palette { width: min(640px, 94vw); padding: 0; margin-top: 12vh; overflow: hidden; border-color: var(--brand-b); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px var(--brand-b); }
#palette-q { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 1rem 1.2rem; font-size: 1.1rem; } #palette-q:focus { outline: none; }
#palette-list { list-style: none; margin: 0; padding: .4rem; max-height: min(52vh, 440px); overflow-y: auto; }
#palette-list a, #palette-list button { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .6rem .8rem; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
#palette-list a:hover, #palette-list button:hover, #palette-list li.on > * { background: var(--surface-2); text-decoration: none; } #palette-list li.on > * { box-shadow: inset 3px 0 0 var(--brand-b); }
#palette-list .ico { width: 1.15em; height: 1.15em; color: var(--muted); } #palette-list .muted { margin-left: auto; font-size: .875rem; white-space: nowrap; }
.palette-none { padding: 1rem 1.2rem; margin: 0; } .palette-foot { margin: 0; padding: .6rem 1.2rem; border-top: 1px solid var(--line-soft); }
textarea { width: 100%; resize: vertical; line-height: 1.5; } textarea.mono { font-family: var(--mono); } .label-help { font-weight: 400; }
.tasklist { list-style: none; margin: .8rem 0 0; padding: 0; } .tasklist li { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line-soft); } .tasklist li:first-child { border-top: 0; }
.tick { width: 1.5rem; height: 1.5rem; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; margin-top: .1rem; }
.tick .ico { width: 1rem; height: 1rem; } .tasklist .done .tick { background: var(--ok-bg); border-color: var(--ok); } .tasklist .done .task-text { color: var(--muted); text-decoration: line-through; } .task-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.loglist { list-style: none; margin: .9rem 0 0; padding: 0; } .loglist li { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line-soft); }
.loglist li:first-child { border-top: 0; } .log-when { color: var(--muted); font-size: .875rem; } .log-text { overflow-wrap: anywhere; white-space: pre-line; } .log-event .log-text { color: var(--text-2); } .log-note .log-text { border-left: 3px solid var(--brand-b); padding-left: .8rem; }
@media (max-width: 1100px) { .loglist li { grid-template-columns: 1fr; gap: .1rem; } }
.brief-text { white-space: pre-line; }
.compare-sum { margin: 0 0 .8rem; } .table.compare th, .table.compare td { width: 38%; } .table.compare th:first-child, .table.compare td:first-child { width: 24%; color: var(--muted); }
.table.compare .match { background: var(--info-bg); color: var(--info); border-radius: 6px; padding: .05rem .4rem; width: fit-content; } .table.compare td div + div { margin-top: .25rem; }
body.privacy :is(.table.compare td, .task-text, .log-text):not(:hover) { filter: blur(7px); }
@media (max-width: 1400px) { .palette-open span, .palette-open kbd { display: none; } }

/* =====================================================================================================================
   The browser application (app/static/app/). Pages are written in the browser; nothing here is specific to one case.
   ===================================================================================================================== */
.mt { margin-top: .9rem; } .mt-s { margin-top: .5rem; } .mb { margin-bottom: .9rem; } .mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- starting, and pages with nothing of the workspace on them (sign in, set-up, lock) ---------- */
.boot { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; padding: 2rem 1rem; }
.boot-logo { height: 52px; width: auto; } .boot-text { color: var(--text-2); margin: 0; max-width: 46ch; }
noscript .boot { min-height: 0; padding-top: 0; }
.authcard { max-width: 500px; margin: 0 auto; } .authcard-wide { max-width: 640px; }
.authcard .card-body { padding: 1.4rem 1.6rem 1.6rem; }
.auth-title { font-size: 1.45rem; margin-bottom: .7rem; }
.auth-links { margin-top: 1.1rem; font-size: .93rem; } .authfoot { text-align: center; color: var(--muted); font-size: .875rem; margin: 1.2rem auto 0; }
.authfoot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.pwrow { display: flex; gap: .4rem; align-items: stretch; } .pwrow input { flex: 1; min-width: 0; }
.pwrow .iconbtn { color: var(--text-2); border-color: var(--line); height: auto; min-height: 2.5rem; flex-shrink: 0; } .pwrow .iconbtn:hover { background: var(--surface-2); }
.pwrow .iconbtn[aria-pressed="true"] { color: var(--link); border-color: var(--focus); }
.working { color: var(--text-2); font-size: .93rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.working::before { content: ""; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand-b); animation: turn .8s linear infinite; flex-shrink: 0; }
@keyframes turn { to { transform: rotate(360deg); } }
.working.working-long { align-items: flex-start; } .working.working-long::before { margin-top: .2rem; }
.working-body { display: flex; flex-direction: column; gap: .3rem; } .working-text { color: var(--text); font-weight: 600; }
.working-more { font-size: .875rem; line-height: 1.45; } .working-time { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.boot-steps { text-align: left; max-width: 46ch; margin: 0; padding-left: 1.2rem; color: var(--text-2); } .boot-steps li { margin: .35rem 0; }
.rules { margin: -.3rem 0 0; } .rules .rule { margin: .15rem 0; padding-left: 0; display: flex; gap: .4rem; align-items: flex-start; font-size: .875rem; }
.rules .rule::before { content: none; } .rules .rule .ico { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: .15rem; }
.setup-steps { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0 0 1.1rem; font-size: .875rem; color: var(--muted); flex-wrap: wrap; }
.setup-steps li { display: flex; align-items: center; gap: .35rem; padding: .25rem .6rem .25rem .3rem; border: 1px solid var(--line-soft); border-radius: 999px; }
.setup-steps li span { width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--neutral-bg); color: var(--neutral); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.setup-steps li.on { color: var(--text); border-color: var(--brand-b); } .setup-steps li.on span { background: var(--accent); color: var(--accent-ink); }
.setup-steps li.done span { background: var(--ok-bg); color: var(--ok); }
.secret { font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; margin: .2rem 0 .5rem; user-select: all; }
.kit { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: .9rem 1rem; margin: .9rem 0; }
.kit-head { font-size: .875rem; color: var(--text-2); margin-bottom: .6rem; }
.phrase { list-style: none; counter-reset: g; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr)); gap: .45rem; padding: 0; margin: 0; }
.phrase li { counter-increment: g; background: var(--code-bg); color: var(--code-text); border-radius: 8px; padding: .4rem .5rem .4rem 1.75rem; position: relative; font-size: 1.02rem; letter-spacing: .08em; user-select: all; }
.phrase li::before { content: counter(g); position: absolute; left: .4rem; top: .45rem; font-size: .8rem; color: var(--ink-muted); font-family: var(--sans); letter-spacing: 0; }
.codes li { font-size: 1.02rem; letter-spacing: .04em; }

/* ---------- messages and dialogs ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 90; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 10px; padding: .65rem .9rem; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); font-size: .93rem; }
.toast-error { border-left-color: var(--err); } .toast-ok { border-left-color: var(--ok); } .toast-warn { border-left-color: var(--warn); }
dialog.dlg { width: min(520px, 94vw); } dialog.dlg-wide { width: min(760px, 96vw); }
.dlg h2 { font-size: 1.15rem; margin-bottom: .5rem; } .dlg-actions { justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
button[aria-busy="true"] { opacity: .7; cursor: progress; }
[data-errors] { margin-bottom: .9rem; }

/* ---------- network mode: one calm signal. Cyan means "connected to sources"; amber stays for warnings ---------- */
:root, [data-theme="dark"] { --live: #7ee8f7; --live-bg: #0a3540; --live-dot: #22d3ee; }
[data-theme="light"] { --live: #0a5566; --live-bg: #d8f4fa; --live-dot: #0891b2; }
.s-live, .topbar .s-live { background: var(--live-bg); color: var(--live); }
.topbar .s-live { background: #0a3540; color: #7ee8f7; } .topbar .s-offline { background: #25213a; color: #c8c4dc; }
.netmode { display: inline-flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .2rem .75rem .2rem .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .05em; border: 0; cursor: pointer; font-family: inherit; }
.netmode:hover { text-decoration: none; filter: brightness(1.12); }
.netmode .signal { width: .6rem; height: .6rem; border-radius: 50%; flex-shrink: 0; }
.netmode-live { background: #0a3540; color: #7ee8f7; } .netmode-live .signal { background: #22d3ee; box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); animation: live-pulse 2.6s ease-out infinite; }
.netmode-offline { background: #25213a; color: #c8c4dc; } .netmode-offline .signal { background: transparent; border: 2px solid #9993b0; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); } 70% { box-shadow: 0 0 0 .5rem rgba(34, 211, 238, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } }
@media (prefers-reduced-motion: reduce) { .netmode-live .signal { animation: none; box-shadow: 0 0 0 .18rem rgba(34, 211, 238, .28); } .working::before { animation-duration: 2.4s; } }
[data-motion="reduce"] .netmode-live .signal { animation: none; box-shadow: 0 0 0 .18rem rgba(34, 211, 238, .28); }
.localbar { margin: 0; padding: .4rem 1.1rem; background: var(--warn-bg); color: var(--warn); font-size: .875rem; border-bottom: 1px solid var(--line); }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--accent-ink); padding: .5rem .9rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: .5rem; }

/* ---------- the workspace written in the browser: small pieces ---------- */
.side-open { display: none; } .side-shade { position: fixed; inset: 0; background: rgba(4, 6, 14, .6); z-index: 48; }
.topbar { display: flex; align-items: center; gap: .7rem; padding: .55rem 1.1rem; flex-wrap: nowrap; } .topbar::after { position: absolute; left: 0; right: 0; bottom: -2px; } .topbar { position: sticky; }
.feedback-open { color: var(--ink-text); border-color: var(--ink-line); background: transparent; } .feedback-open:hover { background: var(--ink-2); }
.usermenu .menu a, .usermenu .menu .linkbtn { display: block; padding: .4rem 0; text-align: left; width: 100%; }
.case-counts { margin: .1rem 0 .4rem; } .list-more { padding: .7rem 1rem; text-align: center; margin: 0; } .tab-back { display: none; }
.filebtn { cursor: pointer; } .filebtn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.checklist { margin: .2rem 0 .6rem; } .checklist li { display: flex; gap: .5rem; align-items: flex-start; padding: .22rem 0; font-size: .93rem; } .checklist .ico { width: 1.05rem; height: 1.05rem; margin-top: .2rem; flex-shrink: 0; }
.checklist .sec-ok .ico { color: var(--ok); } .checklist .sec-warn .ico { color: var(--warn); } .checklist .sec-warn a { color: var(--warn); text-decoration: underline; }
.usage-line { display: flex; justify-content: space-between; font-size: .875rem; color: var(--text-2); margin-top: .5rem; }
.meter { height: .45rem; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; margin-top: .2rem; } .meter span { display: block; height: 100%; background: var(--gradient); border-radius: 999px; min-width: 2px; }
.home-start { margin-bottom: 1rem; } .home-start .searchbar select { max-width: 240px; }
.safety { font-size: 1.15rem; letter-spacing: .1em; margin: .4rem 0 0; user-select: all; }
.evidence-image { max-width: 100%; max-height: 60vh; border: 1px solid var(--line); border-radius: 8px; display: block; }
.match { color: var(--ok); font-weight: 600; } .match-row td:first-child { color: var(--text); font-weight: 600; } .compare-pick { margin-bottom: .8rem; } .compare-pick select { width: 100%; }
.pre { white-space: pre-line; } .run-result .spinner { vertical-align: -2px; }
.tl, .tl-items { list-style: none; margin: 0; padding: 0; } .tl-year { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .2rem 1rem; padding: .7rem 0; border-top: 1px solid var(--line-soft); }
.tl-year:first-child { border-top: 0; } .tl-year h3 { margin: .2rem 0 0; font-size: 1.05rem; color: var(--text-2); }
.tl-item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .8rem; padding: .35rem 0 .35rem .9rem; border-left: 2px solid var(--line); position: relative; }
.tl-item::before { content: ""; position: absolute; left: -5px; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-b); }
.tl-date { color: var(--text-2); font-size: .9rem; } .tl-what { overflow-wrap: anywhere; } .tl-label { color: var(--muted); margin: 0 .4rem; font-size: .9rem; }
.tour { position: fixed; right: 1rem; bottom: 1rem; width: min(380px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); border: 1px solid var(--brand-b); border-radius: 14px; padding: 1rem 1.1rem; z-index: 95;
        box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .75), 0 0 0 1px var(--brand-b); } .tour h2 { font-size: 1.05rem; margin: .1rem 0 .3rem; } .tour p { margin: 0 0 .7rem; font-size: .95rem; }
.tour-step { font-size: .8rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.tour-focus { outline: 3px solid var(--live-dot) !important; outline-offset: 3px; border-radius: 8px; }
#palette-list { list-style: none; margin: 0; padding: .3rem; max-height: 52vh; overflow: auto; } #palette-list li button { display: flex; align-items: center; gap: .6rem; width: 100%; background: none; border: 0; color: var(--text); font: inherit;
  padding: .55rem .7rem; border-radius: 8px; cursor: pointer; text-align: left; } #palette-list li button .muted { margin-left: auto; font-size: .875rem; } #palette-list li.on button, #palette-list li button:hover { background: var(--surface-2); }
#palette-q { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .9rem 1rem; font-size: 1.05rem; background: transparent; color: var(--text); } #palette-q:focus { outline: none; }

/* ---------- phones and small tablets: one column at a time, the menu slides in ---------- */
@media (max-width: 900px) {
  body.app, body.app.side-collapsed { display: block; height: auto; overflow: visible; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .18s ease; }
  body.side-shown .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  body.app .lbl, body.app .logo-full, body.app .sidebar .count, body.app .side-add form { display: revert; } body.app .side-brand .logo-mark { display: none; }
  body.app .side-nav a, body.app .side-sec > a, body.app .side-add > summary { justify-content: flex-start; padding: .62rem .75rem; }
  body.app .side-sec > summary { height: auto; padding: .5rem .75rem .25rem; margin: 0; background: none; overflow: visible; } .side-collapse { display: none; }
  .side-open { display: inline-flex; flex-shrink: 0; } .mainarea { height: auto; min-height: 100vh; } .view { overflow: visible; }
  .topbar { flex-wrap: wrap; row-gap: .45rem; padding: .5rem .7rem; } .gsearch { order: 5; flex-basis: 100%; max-width: none; } .palette-open { padding: .5rem .6rem; }
  .topbar-right { gap: .35rem; } .feedback-open { font-size: .8rem; padding: .25rem .5rem; }
  .view-page { padding: 1rem .9rem 3rem; }
  .view-split { display: block; overflow: visible; } .listcol { border-right: 0; max-height: none; overflow: visible; } .pane { overflow: visible; }
  .view-split > .pane { display: none; } .case-top > .pane, .case-sub > .pane { display: block; } .case-sub > .listcol { display: none; }
  .case-top > .pane > .tabs .tab-back { display: none; } .case-sub .tab-back { display: inline-flex; align-items: center; gap: .2rem; } .tab-back .ico { transform: rotate(180deg); width: 1em; height: 1em; }
  .pane > .tabs { position: static; padding: .3rem .6rem 0; overflow-x: auto; flex-wrap: nowrap; } .pane > .tabs a { white-space: nowrap; padding: .6rem .7rem; } .pane-body { padding: .9rem .8rem 3rem; }
  .pane .panel { position: fixed; inset: auto 0 0 0; top: auto; right: 0; width: auto; max-height: 78vh; border-radius: 16px 16px 0 0; }
  .row-actions { display: flex; position: static; box-shadow: none; border: 0; background: none; padding: 0 .6rem .5rem 3.6rem; }
  .entity-head { flex-direction: column; align-items: flex-start; gap: .7rem; } .statrow { gap: 1rem; }
  .kv { grid-template-columns: 1fr; gap: .1rem 0; } .kv dd { margin-bottom: .5rem; } .tl-year, .tl-item { grid-template-columns: 1fr; gap: .1rem; }
  .searchbar input[name=selector] { min-width: 0; flex-basis: 100%; } .searchbar select, .searchbar .btn { flex: 1; }
  .btn { white-space: normal; }      /* a long label wraps on a phone instead of widening the page */
  .demobar { padding: .5rem .8rem; } #graph { height: 60vh; min-height: 320px; } .codes { columns: 1; }
  body.bare { padding: 3vh .7rem 2rem; } .authcard .card-body { padding: 1.1rem 1.1rem 1.3rem; } .setup-steps li { padding-right: .45rem; }
  .table-wrap { overflow-x: auto; } .table { min-width: 520px; } .dlg-actions { flex-wrap: wrap; }
}
@media (max-width: 520px) { .palette-open { display: none; } .feedback-open { display: none; } .usermenu .menu { right: -.4rem; } .setup-steps li { font-size: 0; gap: 0; padding: .2rem; } .setup-steps li span { font-size: .8rem; } }

/* ---------- the report on paper (the browser's own "Save as PDF") ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 16mm 15mm 18mm; }
  body.printing { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  body.printing > :not(#app), body.printing .sidebar, body.printing .topbar, body.printing .demobar, body.printing .listcol, body.printing .tabs, body.printing .panel, body.printing .idle-warn,
  body.printing .pane-body > :not(#print-root), body.printing .tour, body.printing .toasts { display: none !important; }
  body.printing .mainarea, body.printing .view, body.printing .pane, body.printing .pane-body { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; max-width: none !important; }
  body.printing #print-root { display: block !important; }
  body.bare .authfoot, body.bare .brand-band, body.bare form, body.bare .setup-steps { display: none !important; } body.bare { background: #fff; color: #000; padding: 0; }
}
.report { color: #14101f; font: 10.5pt/1.45 var(--sans); } .report h1, .report h2, .report h3 { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #14101f; width: auto; }
.report-cover { background: #07060d; color: #ecebf5; padding: 14mm 12mm; margin: 0 0 8mm; border-bottom: 3px solid #6366f1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-cover img { height: 11mm; display: block; margin-bottom: 9mm; } .report-cover h1 { color: #fff; font-size: 22pt; margin: 0 0 3mm; } .report-cover p { margin: 0; color: #bfbbd2; }
.report h2 { font-size: 13pt; color: #4338ca; margin: 7mm 0 2mm; break-after: avoid; } .report h3 { font-size: 11pt; margin: 4mm 0 1.5mm; break-after: avoid; }
.report table { width: 100%; border-collapse: collapse; margin: 1.5mm 0 3mm; font-size: 9pt; } .report th, .report td { border: .3pt solid #c9c4de; padding: 1.2mm 1.6mm; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.report th { background: #edeaf7; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .report tr { break-inside: avoid; } .report .small { font-size: 8.5pt; color: #5f5978; }
.report-type { font-weight: 400; color: #5f5978; font-size: 9.5pt; margin-left: 2mm; } .report-assessment { border-left: 2pt solid #6366f1; padding-left: 3mm; font-style: italic; }
.report-redacted { border: 1pt solid #a11a1a; color: #a11a1a; padding: 2mm 3mm; font-weight: 600; } .report-hash { font-family: var(--mono); font-size: 7.5pt; }
.report-entity { break-inside: auto; } .report ul { padding-left: 5mm; }

/* The workspace's frame is written inside #app; its two parts (sidebar, main area) take their places in the page's own grid. */
body.app > #app { display: contents; }
@media (max-width: 900px) { body.app > #app { display: block; } }

.pane > .tabs a { padding: .6rem .8rem; font-size: .97rem; } .pane > .tabs kbd { font-size: .8rem; }
@media (max-width: 1700px) { .pane > .tabs kbd { display: none; } }
h2[tabindex="-1"]:focus { outline: none; }

/* ---------- the administrator's area ---------- */
body.adminarea { display: block; height: auto; overflow: auto; } body.adminarea > #app { display: block; } body.adminarea .mainarea { height: auto; min-height: 100vh; }
body.adminarea .view { max-width: 1280px; margin: 0 auto; width: 100%; overflow: visible; padding: 1.2rem 1.5rem 3rem; }
.admin-title { color: var(--ink-text); font-size: 1.05rem; letter-spacing: .02em; padding-left: .8rem; border-left: 1px solid var(--ink-line); }
.admin-tabs { padding: .3rem 1.5rem 0; max-width: 1280px; margin: 0 auto; width: 100%; } .admin-tabs .n { margin-left: .4rem; background: var(--brand-b); color: #fff; border-radius: 999px; font-size: .8rem; padding: 0 .45rem; font-weight: 700; }
.section-title { margin: 1.4rem 0 .6rem; font-size: 1.1rem; } .is-done { opacity: .72; } .linkbox { background: var(--code-bg); color: var(--code-text); padding: .8rem 1rem; border-radius: 10px; overflow-wrap: anywhere; user-select: all; font-size: .92rem; }
.danger-link { color: var(--err); } .meter-warn span { background: var(--warn); } .meter-critical span { background: var(--err); } .meter-unknown span { background: var(--neutral); }
.error-code { color: var(--muted); font-size: .875rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .2rem; } .errorpage .actions { margin-top: 1rem; }

/* the checklist's own marks (the Security centre's larger ones keep theirs) */
.checklist .ck-ok .ico { color: var(--ok); } .checklist .ck-warn .ico { color: var(--warn); } .checklist .ck-warn a { color: var(--warn); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none !important; } }
[data-motion="reduce"] .sidebar { transition: none !important; }

.phone-tabs { display: none; } .side-feedback { display: flex; align-items: center; gap: .8rem; width: 100%; background: none; border: 0; color: var(--ink-muted); font: inherit; font-weight: 600; padding: .62rem .75rem; border-radius: 10px; cursor: pointer; text-align: left; }
.side-feedback:hover { background: var(--ink-2); color: var(--ink-text); } .side-collapsed .side-feedback { justify-content: center; padding: .7rem 0; }
@media (max-width: 900px) {
  .phone-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .6rem; }
  .case-top > .pane { display: none; }
  body.app .side-feedback { justify-content: flex-start; padding: .62rem .75rem; }
}

/* ---------- the graph, drawn as page elements ---------- */
#graph { height: auto; min-height: 0; padding: 0; overflow: hidden; } svg.graph { --k: 1; display: block; width: 100%; height: auto; max-height: calc(100vh - 250px); min-height: 300px; cursor: grab; touch-action: none; } svg.graph.dragging { cursor: grabbing; }
.g-edge line { stroke: var(--muted); stroke-width: 1.3; opacity: .55; } .g-arrow { fill: var(--muted); opacity: .8; } .g-kind { display: none; font-size: calc(12.5px * var(--k)); fill: var(--muted); paint-order: stroke; stroke: var(--surface-2); stroke-width: calc(4px * var(--k)); }
.g-edge.near line { stroke: var(--focus); stroke-width: 2; opacity: 1; } .g-edge.near .g-kind, svg.graph.named .g-kind { display: block; fill: var(--text-2); }
.g-node circle { stroke: var(--surface); stroke-width: 2.5; } .g-node text { font-size: calc(13px * var(--k)); fill: var(--text); paint-order: stroke; stroke: var(--surface-2); stroke-width: calc(4px * var(--k)); stroke-linejoin: round; }
.g-node.g-root circle { stroke: var(--focus); stroke-width: 3; } .g-node.g-root text { font-weight: 700; font-size: calc(14px * var(--k)); }
.g-node:hover circle, .g-node:focus circle { stroke: var(--warn); stroke-width: 3.5; } .g-node:focus { outline: none; } .g-node:hover text, .g-node:focus text { fill: var(--link); }
.g-blue circle { fill: #3b82f6; } .g-teal circle { fill: #14b8a6; } .g-indigo circle { fill: #6366f1; } .g-rose circle { fill: #f43f5e; } .g-slate circle { fill: #64748b; } .g-amber circle { fill: #f59e0b; } .g-violet circle { fill: #a855f7; }
@media (max-width: 900px) { svg.graph { max-height: 70vh; min-height: 260px; } }
.g-node text.g-quiet { display: none; } .g-node:hover text.g-quiet, .g-node:focus text.g-quiet, .g-node.near text.g-quiet, svg.graph.all-names .g-node text.g-quiet { display: block; }
.pan-pad { display: inline-flex; gap: .15rem; } .pan-pad .btn { padding-left: .6rem; padding-right: .6rem; min-width: 2.4rem; }
svg.graph:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---------- found by the accessibility checks (tests/test_e2e_access.py) ---------- */
.sidebar .count, .admin-tabs .n { background: var(--accent); }
.tip button { min-width: 1.6rem; min-height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; } .tip button:hover { background: var(--line-soft); color: var(--text); }
select { min-height: 2.5rem; } .checkline { min-height: 1.6rem; align-items: flex-start; }
.crumbs a { display: inline-block; padding: .25rem 0; min-height: 1.5rem; }
.kindtabs .n { opacity: 1; color: var(--muted); } .kindtabs a.on .n { color: #fff; opacity: .92; }
/* A list to choose from, drawn by us: browsers draw their own very small on some systems, too small to tap. */
/* The chosen option never makes the list wider than its place: a long one is cut short with an ellipsis. */
select { appearance: none; -webkit-appearance: none; min-height: 2.5rem; padding: .5rem 2.1rem .5rem .7rem; line-height: 1.3; text-overflow: ellipsis;
  max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b86a3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: .75rem auto; }
.pane-title { display: none; }
@media (max-width: 900px) { .case-sub .pane-title { display: block; font-size: 1.15rem; margin: 0; padding: .7rem .8rem 0; } }
details > summary { min-height: 1.6rem; padding: .12rem 0; cursor: pointer; } .linkbtn { min-height: 1.5rem; }

/* ---------- before a lookup runs: one tick box per source ---------- */
.tick-source .checkline { margin-top: 0; font-weight: 400; } .tick-source .subline { display: block; }
.table-plan .plan-divider th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--warn); background: var(--warn-bg); white-space: normal; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; min-height: 0; }
.linklike:hover { text-decoration-thickness: 2px; }

/* ---------- the operator's console (version 1) ---------- */
.bars { width: 100%; height: 64px; display: block; margin-top: .7rem; } .bars .bar { fill: var(--info); } .bars .bar-none { fill: var(--line); }
.bars-axis { display: flex; justify-content: space-between; font-size: .875rem; color: var(--muted); margin-top: .2rem; }
.filters { gap: 1rem; align-items: flex-end; margin: .2rem 0 .9rem; flex-wrap: wrap; } .filters label { min-width: 11rem; }
.sortbtn { background: none; border: 0; padding: 0; min-height: 1.6rem; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; } .sortbtn:hover { text-decoration: underline; }
.table-users td { vertical-align: top; } .table-users .meter { min-width: 4.5rem; max-width: 7rem; } .table-users td:first-child { min-width: 9.5rem; }
.table-users th, .table-users td { padding-left: .55rem; padding-right: .55rem; } .table-users td:nth-child(4) { min-width: 8.2rem; }
.ck-line { display: flex; gap: .5rem; align-items: center; } .ck-line .ico { color: var(--ok); width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
/* read by screen readers, not shown. Pinned to the corner so that, inside a table that scrolls, it never widens the page */
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-tabs { flex-wrap: nowrap; overflow-x: auto; } .admin-tabs a { white-space: nowrap; }
/* the operator's banner, shown to everyone who is signed in */
.broadcast { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: .5rem 1.1rem; font-size: .93rem; border-bottom: 1px solid var(--line); background: var(--info-bg); color: var(--text); }
.broadcast-warn { background: var(--warn-bg); color: var(--warn); } .broadcast .ico { width: 1.05rem; height: 1.05rem; flex-shrink: 0; margin-top: .18rem; }
.broadcast > span { flex: 1; min-width: 0; overflow-wrap: anywhere; } .broadcast .linkbtn { white-space: nowrap; color: inherit; text-decoration: underline; }
.card .broadcast { border: 1px solid var(--line); border-radius: 8px; }
.new-signins ul { margin: .5rem 0 0; }
.new-signins .signin-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; padding: .35rem 0; border-top: 1px solid var(--line); }
/* the operator's own link to the console, with the number of things waiting */
.console-link .n { margin-left: .35rem; background: var(--accent); color: #fff; border-radius: 999px; font-size: .8rem; padding: 0 .42rem; font-weight: 700; }
@media (max-width: 760px) { .console-link .lbl { display: none; } }
/* the console's own header buttons stay on a phone (the workspace's Feedback button may hide there; these may not) */
@media (max-width: 520px) { body.adminarea .topbar .feedback-open { display: inline-flex; } body.adminarea #admin-left { display: none; } body.adminarea .topbar-right { flex-wrap: wrap; justify-content: flex-end; } }
.table-sources th, .table-users th { white-space: normal; }
/* on a phone, each account is a card instead of a row: nothing to scroll sideways (sorting is for a wider screen) */
@media (max-width: 760px) {
  .table-users { min-width: 0; } .table-users thead { display: none; }
  .table-users tr { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); } .table-users td { display: block; border: 0; padding: .15rem 0; min-width: 0 !important; }
  .table-users td:last-child { padding-top: .5rem; } .table-users .meter { max-width: 12rem; }
}
/* "Follow the company" */
#follow h3 { margin: 1rem 0 .35rem; font-size: 1rem; } .follow-list li { padding: .22rem 0; overflow-wrap: anywhere; } .follow-list .btn-small { margin-left: .4rem; }
/* documents */
.doc-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; background: var(--code-bg); color: var(--code-text); padding: .8rem 1rem; border-radius: 8px; font-size: .9rem; }
#doc-keep { position: sticky; bottom: 0; background: var(--bg); padding: .6rem 0; }
/* "Summarise this case" */
.summary-doc h3 { margin: 1.2rem 0 .4rem; } .summary-doc h4 { margin: .8rem 0 .3rem; font-size: 1rem; } .summary-doc h2 { margin-top: 0; }
body.printing .print-summary { color: #000; }


/* ---------- phones: the bar at the bottom, large touch targets, the desktop-only screens ---------- */
.bottomnav { display: none; }
@media (max-width: 700px) {
  .bottomnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .2rem; position: fixed; inset: auto 0 0 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--line); padding: .3rem .35rem calc(.3rem + env(safe-area-inset-bottom)); }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 54px;
    color: var(--muted); font: inherit; font-size: .875rem; font-weight: 600; background: none; border: 0; border-radius: 12px; text-decoration: none; cursor: pointer; }
  .bottomnav .ico { width: 23px; height: 23px; }
  /* five places on one row at the readable size, the long word given the room it needs (Tools is under More); the demonstration's bar has four */
  .bottomnav.bn-full { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
  .bottomnav.bn-demo { grid-template-columns: minmax(0, 1.9fr) repeat(3, minmax(0, 1fr)); }
  .bottomnav a, .bottomnav button { min-width: 0; }
  .bottomnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottomnav a.on { color: var(--text); background: var(--surface-2); }
  .bottomnav a.bn-main { color: var(--link); } .bottomnav a.bn-main.on { color: var(--accent-ink); background: var(--accent); }
  body.app .mainarea { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar .side-open, .topbar .gsearch { display: none; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); } .idle-warn { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .quick .btn-big, .find-box .btn { width: 100%; justify-content: center; }
}
@media (pointer: coarse) {
  .btn, .iconbtn, .pane > .tabs a, .side-nav a, .kindtabs a, .side-feedback, select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { min-height: 44px; }
  .iconbtn { min-width: 44px; } .row-main { min-height: 56px; } .checkline input[type=checkbox], .checkline input[type=radio] { width: 22px; height: 22px; }
}
.find-box { margin: 0 0 1rem; } .find-box input { flex: 1; min-width: 0; }
.quick { max-width: 640px; } .quick .checks { min-width: 0; } .quick .checks select { display: block; box-sizing: border-box; width: calc(100% - 2rem); margin: .1rem 0 .4rem 2rem; }
.desk-only .mono { letter-spacing: .04em; } .hidden-note { display: flex; align-items: center; gap: .4rem; margin: -.4rem 0 1rem; } .hidden-note .ico { width: 1.1em; height: 1.1em; }

/* ---------- leaving the app: the cover; the panic button ---------- */
body.covered > * { visibility: hidden !important; }
body.covered { background: var(--bg) url("/static/img/app-192.png") center / 96px no-repeat; }
.panic-top { display: none; color: var(--err); }
@media (max-width: 700px) { .panic-top { display: inline-flex; } }

/* version 1.1: the plan page */
.narrow-num { width: 6rem; }
#plan-subscription p { margin-bottom: 0; }
.switch-item + .switch-item { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); }
.switch-item p { margin: .35rem 0 0; }

/* Lists of outside links in the Guide (roadmap R18): every link a comfortable target (WCAG 2.5.8, 24 by 24). */
.resource-list { padding-left: 1.2rem; }
.resource-list li { margin: 2px 0; }
.resource-list a { display: inline-block; min-height: 24px; min-width: 24px; line-height: 24px; padding: 2px 0; }

/* The investigator's own record and working together (roadmap v2, Phase A). */
.tag-restricted { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.tag-restricted .ico { width: .85em; height: .85em; vertical-align: -1px; }
.tag-mine { border-color: var(--info); color: var(--info); background: var(--info-bg); }
.tag-answered, .tag-checked { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.tag-doubtful { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.tag-false, .tag-dropped { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.inline-more { display: inline-block; margin-left: .4rem; }
.inline-more > summary { cursor: pointer; min-height: 24px; line-height: 24px; }
.inline-more[open] { display: block; margin: .3rem 0 .2rem; }
.hand-entity, .hand-link { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; }
.comp-card h3 { margin-top: .8rem; }
/* The analytical engine (roadmap v2, Phase B). */
.tag-supported { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.tag-contested { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.tag-unsupported, .tag-abandoned { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.contra, .candidate, .hyp { border-top: 1px solid var(--line-soft); padding: .6rem 0; }
.contra.decided { opacity: .8; }
.candidate .grid2 { gap: .6rem; }
.net-pick > label { flex: 1 1 16rem; min-width: 0; max-width: 100%; }
.net-pick select { width: 100%; max-width: 100%; }

/* Pictures that follow the theme (the logo, the homepage's picture of the workspace): the version for a dark ground by
   default and in the dark theme, the version for a light ground in the light theme, and the system's choice on a page
   that carries no theme. A logo on a band that stays near-black in both themes (the top bars, the sign-in band, the
   sidebar, the public footer) is the white one, always: that is where it has contrast. */
.for-light { display: none !important; }
[data-theme="light"] .for-dark { display: none !important; }
[data-theme="light"] .for-light { display: revert !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .for-dark { display: none !important; }
  :root:not([data-theme]) .for-light { display: revert !important; }
}

/* the capability list in the workspace: one group at a time, a balanced grid, a filter by state */
.capnav-app { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.captabs-app { display: flex; flex-wrap: wrap; gap: .4rem; }
.captab-app { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; }
.captab-app[aria-selected="true"] { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.capfilter-app { display: flex; flex-wrap: wrap; gap: .35rem; }
.capgrid { display: block; }
.capcards-app { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .7rem; margin: 0; }
.capcards-app li { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; background: var(--surface-2, var(--surface)); }
.capcards-app .badge { margin-left: .25rem; }

/* the Map page (round 1 of the review) */
.case-map { height: min(62vh, 560px); min-height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-top: .6rem; }
.case-map .maplibregl-popup-content { background: var(--surface); color: var(--text); }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: .6rem; margin: .8rem 0; }
.frames figure { margin: 0; } .frames img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; } .frames figcaption { font-size: .95rem; color: var(--muted); }
/* the map's credit (OpenStreetMap, ODbL), on the map itself */
.case-map-frame { position: relative; margin-top: .6rem; } .case-map-frame .case-map { margin-top: 0; }
.map-credit { position: absolute; left: .5rem; bottom: .5rem; margin: 0; padding: .2rem .55rem; font-size: .875rem; line-height: 1.4; border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); border: 1px solid var(--line); z-index: 2; max-width: calc(100% - 1rem); }
.map-credit a { color: inherit; }
/* manipulation checks (roadmap v3, Phase 3): the views at their natural width, never wider than the card */
.media-view { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: .4rem 0 1rem; background: #000; }
/* linked views (roadmap v3, Phase 4): what is outside the focus stays visible, faintly */
#graph-svg .g-dim { opacity: .16; }
