/*
 * IBM Plex Sans + Mono, self-hosted.
 *
 * These were loaded from fonts.googleapis.com, which meant every page view sent
 * the visitor's IP and User-Agent to a third party. On a tool whose whole point
 * is screening sanctioned parties — where WHO is searching is the sensitive part,
 * and whose own notice bar promises queries are never stored — that was the wrong
 * trade for a typeface. Serving the files ourselves also lets the CSP collapse to
 * default-src 'self' and removes a render-blocking cross-origin request.
 *
 * IBM Plex is SIL Open Font License 1.1; see public/fonts/LICENSE.txt.
 * Subsets kept: latin, latin-ext, cyrillic, greek — the scripts the snapshot
 * actually renders. Arabic, Hebrew and CJK names fall back to the system stack,
 * which Plex never covered either.
 */
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-on-primary: #FFFFFF;
  --color-secondary: #1D4ED8;
  --color-accent: #7C3AED;
  --color-background: #EEF2F8;
  --color-surface: #FFFFFF;
  --color-surface-2: #F1F5F9;
  --color-input: #F8FAFC;
  --color-foreground: #0F172A;
  --color-body: #334155;
  --color-muted-fg: #64748B;
  --color-muted: #CBD5E1;
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;
  --color-destructive: #DC2626;
  --color-destructive-fg: #B91C1C;
  --color-destructive-bg: #FEF2F2;
  --color-warn: #D97706;
  --color-warn-fg: #B45309;
  --color-warn-bg: #FFFBEB;
  --color-ok: #16A34A;
  --color-ok-fg: #15803D;
  --color-ok-bg: #F0FDF4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 10px 30px -14px rgba(15,23,42,.18);
  --shadow-lg: 0 20px 60px -18px rgba(15,23,42,.3);
  --ring: 0 0 0 3px rgba(37,99,235,.28);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Dark theme — overrides the palette; components use these vars so most adapt. */
:root[data-theme="dark"] {
  --color-on-primary: #0B1220;
  --color-secondary: #93C5FD;
  --color-accent: #A78BFA;
  --color-background: #0B1220;
  --color-surface: #131C31;
  --color-surface-2: #1B2540;
  --color-input: #0F1830;
  --color-foreground: #F1F5F9;
  --color-body: #CBD5E1;
  --color-muted-fg: #94A3B8;
  --color-muted: #334155;
  --color-border: #2A3550;
  --color-border-strong: #3A4870;
  --color-destructive-fg: #FCA5A5;
  --color-destructive-bg: #2A1518;
  --color-warn-fg: #FCD34D;
  --color-warn-bg: #2A2410;
  --color-ok-fg: #86EFAC;
  --color-ok-bg: #12261A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.7);
}

/* Dark overrides for the remaining hardcoded light surfaces/tints. */
:root[data-theme="dark"] body { background:
    radial-gradient(900px 500px at 88% -8%, #16233E 0%, transparent 60%),
    radial-gradient(800px 500px at 5% 0%, #1C1836 0%, transparent 55%),
    var(--color-background); }
:root[data-theme="dark"] .site-header { background: rgba(11,18,32,.82); }
:root[data-theme="dark"] .site-footer { background: rgba(19,28,49,.5); }
:root[data-theme="dark"] .notice-bar { background: linear-gradient(90deg, rgba(37,99,235,.14), rgba(124,58,237,.12)); border-color: #2A3B66; }
:root[data-theme="dark"] .btn-ghost:hover { background: #16233E; }
.tag.tag-auth.auth-bis { border-color: #C4B5FD; background: #F5F3FF; color: #5B21B6; }
.tag.tag-auth.auth-state { border-color: #99F6E4; background: #F0FDFA; color: #115E59; }
:root[data-theme="dark"] .tag.tag-auth.auth-bis { background: #1F1633; border-color: #4C3A7A; color: #C4B5FD; }
:root[data-theme="dark"] .tag.tag-auth.auth-state { background: #0E2A28; border-color: #2A5A54; color: #5EEAD4; }
:root[data-theme="dark"] .tag.tag-list { background: #251C3E; border-color: #4C3A7A; color: #C4B5FD; }
:root[data-theme="dark"] .tag.tag-type { background: #142544; border-color: #2C4A7A; color: #93C5FD; }
:root[data-theme="dark"] .tag.tag-id { border-color: #4C3A7A; }
:root[data-theme="dark"] .rel-note, :root[data-theme="dark"] .graph-note { border-color: #4A3E1A; color: #FCD34D; }
:root[data-theme="dark"] .lowq { border-color: #6B5A1E; }
:root[data-theme="dark"] .score-badge.s-hi { border-color: #7F2A2A; }
:root[data-theme="dark"] .score-badge.s-mid { border-color: #6B5A1E; }
:root[data-theme="dark"] .no-hits.clear { border-color: #2E5A3A; }
:root[data-theme="dark"] .graph-stage { background: radial-gradient(700px 460px at 42% 46%, #16233E 0%, #0B1220 82%); }
:root[data-theme="dark"] .empty-state svg { color: #2C3E63; }
:root[data-theme="dark"] .chip { color: #93C5FD; }
:root[data-theme="dark"] .compliance-banner { background: var(--color-warn-bg); border-color: #4A3E1A; color: #FCD34D; }
:root[data-theme="dark"] .compliance-banner strong { color: #FDE68A; }

.theme-toggle {
  background: var(--color-surface); color: var(--color-muted-fg);
  border: 1px solid var(--color-border-strong); border-radius: 999px;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 88% -8%, #E7EEFB 0%, transparent 60%),
    radial-gradient(800px 500px at 5% 0%, #EFEAFB 0%, transparent 55%),
    var(--color-background);
  color: var(--color-foreground);
  line-height: 1.55;
  min-height: 100dvh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--color-primary); color: var(--color-on-primary);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 15px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { display: flex; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(37,99,235,.28)); }
.wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.32rem; font-weight: 700; letter-spacing: -.02em; color: var(--color-foreground); }
.brand-tag { margin-top: 2px; color: var(--color-muted-fg); font-size: .76rem; font-weight: 500; }

.status-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 999px; padding: 7px 14px 7px 12px; box-shadow: var(--shadow);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-muted-fg); flex-shrink: 0; box-shadow: 0 0 0 4px rgba(100,116,139,.14); }
.status-dot.live { background: var(--color-ok); box-shadow: 0 0 0 4px rgba(22,163,74,.18); }
.status-dot.demo { background: var(--color-warn); box-shadow: 0 0 0 4px rgba(217,119,6,.16); }
.status-dot.loading { background: var(--color-primary); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(37,99,235,.35); } 50% { box-shadow: 0 0 0 6px rgba(37,99,235,.08); } }
.status-body { display: flex; align-items: baseline; gap: 8px; }
.status-text { font-size: .82rem; font-weight: 600; }
.status-text::after { content: ''; }
.status-meta { font-size: .74rem; color: var(--color-muted-fg); }
.status-meta::before { content: '·'; margin-right: 8px; color: var(--color-border-strong); }

.btn-ghost {
  background: var(--color-surface); color: var(--color-primary);
  border: 1px solid var(--color-border-strong); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; margin-left: 2px;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn-ghost:hover { background: #F5F8FF; border-color: var(--color-primary); box-shadow: var(--shadow); }
.btn-ghost:disabled { opacity: .5; cursor: progress; }
a.btn-ghost { text-decoration: none; display: inline-block; }

/* Notice bar (legal, slim) */
.notice-bar {
  display: flex; gap: 10px; align-items: center;
  margin: 14px clamp(16px, 4vw, 40px) 0;
  padding: 9px 14px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(37,99,235,.06), rgba(124,58,237,.05));
  border: 1px solid #DBEAFE; color: var(--color-body);
}
.notice-bar svg { color: var(--color-primary); flex-shrink: 0; }
.notice-bar p { margin: 0; font-size: .8rem; }
.notice-bar strong { color: var(--color-foreground); }
.notice-bar a { color: var(--color-primary); }

/* Incomplete-coverage alert. Deliberately louder than the notice bar: it means
   a whole authority is going unscreened, which a user would otherwise read as
   a clean result. Hidden unless /api/meta reports a missing authority. */
.coverage-bar {
  display: flex; gap: 10px; align-items: center;
  margin: 14px clamp(16px, 4vw, 40px) 0;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(220, 38, 38, .07);
  border: 1px solid rgba(220, 38, 38, .38);
  color: var(--color-body);
}
.coverage-bar[hidden] { display: none; }
.coverage-bar svg { color: #DC2626; flex-shrink: 0; }
.coverage-bar p { margin: 0; font-size: .8rem; }
.coverage-bar strong { color: #B91C1C; }
.coverage-bar a { color: #B91C1C; text-decoration: underline; }
.coverage-why { opacity: .75; }
:root[data-theme="dark"] .coverage-bar { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .42); }
:root[data-theme="dark"] .coverage-bar svg,
:root[data-theme="dark"] .coverage-bar strong,
:root[data-theme="dark"] .coverage-bar a { color: #FCA5A5; }

/* 50% Rule panel. Amber, not red: a derivative-blocking lead is something to
   investigate against the cap table, not a determination the tool has made. */
.deriv-group {
  border-left: 3px solid #D97706;
  padding-left: 12px;
}
.deriv-head { margin: 0 0 6px; font-size: .82rem; }
.deriv-agg {
  margin: 0 0 6px; padding: 7px 10px; border-radius: 8px;
  background: rgba(217, 119, 6, .1); font-size: .78rem;
}
.deriv-limit { margin: 0; font-size: .74rem; opacity: .8; }
:root[data-theme="dark"] .deriv-group { border-left-color: #FBBF24; }
:root[data-theme="dark"] .deriv-agg { background: rgba(251, 191, 36, .12); }

/* Cross-authority listings panel. */
.cross-group { border-left: 3px solid #2563EB; padding-left: 12px; }
.cross-group.cross-weak { border-left-style: dashed; }
.cross-note { margin: 0 0 8px; font-size: .8rem; }
.cross-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 5px; }
.cross-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; }
.cross-list a { font-weight: 500; }
.cross-list-name { font-size: .72rem; color: var(--color-muted-fg); }
.cross-limit { margin: 0; font-size: .74rem; opacity: .8; }
:root[data-theme="dark"] .cross-group { border-left-color: #60A5FA; }

/* What-changed page. */
.changes-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 14px 0 18px; }
.changes-controls .field { min-width: 180px; }
.changes-list { display: grid; gap: 6px; margin-bottom: 10px; }
.chg-row {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
}
.chg-name { display: block; font-size: .88rem; font-weight: 500; overflow-wrap: anywhere; }
.chg-name a { color: var(--color-foreground); text-decoration: none; }
.chg-name a:hover { text-decoration: underline; }
.chg-meta { display: block; font-size: .72rem; color: var(--color-muted-fg); margin-top: 2px; overflow-wrap: anywhere; }
/* A removed party has no record page — say so instead of offering a dead link. */
.chg-gone { font-size: .68rem; color: var(--color-muted-fg); font-style: italic; }

/* Ownership-group headings. Sticky so the group you are reading stays named
   while you scroll a long structure. */
.grp { margin-bottom: 20px; }
.grp-head {
  position: sticky; top: 62px; z-index: 2;
  margin-bottom: 10px; padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  backdrop-filter: blur(6px);
}
.grp-head-none { border-left-color: var(--color-muted); }
.grp-name { font-size: .88rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.grp-meta { font-size: .72rem; color: var(--color-muted-fg); margin: 3px 0 0; }
@media (max-width: 640px) { .grp-head { position: static; } }

/* Tied top scores — the ordering disclaiming itself. */
.tie-note {
  display: block; margin-top: 8px; padding: 8px 11px;
  border-radius: var(--radius-sm); font-size: .76rem; line-height: 1.5;
  background: var(--color-warn-bg); border: 1px solid rgba(217, 119, 6, .3);
  color: var(--color-body); font-weight: 400;
}
.tie-note strong { color: var(--color-warn-fg); }
:root[data-theme="dark"] .tie-note { border-color: rgba(251, 191, 36, .3); }

/* Below-the-line testing panel. */
.btl-btn { width: 100%; justify-content: center; margin-top: 4px; }
.btl-panel {
  margin: 14px 0 4px; padding: 16px 18px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--color-surface);
}
.btl-panel[hidden] { display: none; }
.btl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btl-head h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.btl-sub { font-weight: 400; color: var(--color-muted-fg); }
.btl-close {
  font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer;
  background: none; border: 0; color: var(--color-muted-fg); padding: 2px 8px; border-radius: 6px;
}
.btl-close:hover { color: var(--color-foreground); background: var(--color-surface-2); }
.btl-close:focus-visible { outline: none; box-shadow: var(--ring); }
.btl-lede { font-size: .82rem; margin: 8px 0 14px; color: var(--color-body); }

/* Cumulative hit curve: one bar per 0.01 step, the active threshold picked out. */
.btl-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 90px; padding: 0 2px;
  border-bottom: 1px solid var(--color-border-strong);
}
.btl-bar {
  flex: 1; height: var(--h); min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  opacity: .35;
}
.btl-bar.active { opacity: 1; box-shadow: 0 0 0 1px var(--color-primary); }
.btl-axis {
  display: flex; justify-content: space-between;
  font-size: .66rem; color: var(--color-muted-fg); margin-top: 5px;
  font-family: var(--mono);
}
.btl-h4 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-destructive-fg); margin: 18px 0 8px;
}
.btl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.btl-row {
  display: grid; grid-template-columns: 58px 1fr; gap: 4px 12px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--color-surface-2); border: 1px dashed var(--color-border-strong);
}
.btl-score { font-family: var(--mono); font-size: .82rem; color: var(--color-destructive-fg); font-weight: 500; }
.btl-name { font-size: .85rem; font-weight: 500; overflow-wrap: anywhere; }
.btl-name a { color: var(--color-foreground); text-decoration: none; }
.btl-name a:hover { text-decoration: underline; }
.btl-meta { grid-column: 2; font-size: .72rem; color: var(--color-muted-fg); overflow-wrap: anywhere; }
.btl-note { font-size: .76rem; color: var(--color-body); margin: 12px 0 0; }
.btl-loading { font-size: .8rem; color: var(--color-muted-fg); margin: 0 0 12px; }

/* Prefix matches are not scored, so they get a quieter heading and a dot in
   place of the score column — the row must not look like a near-miss. */
.btl-h4-prefix { color: var(--color-secondary); }
.btl-h4-info { color: var(--color-muted-fg); }
.btl-row-prefix { border-style: dotted; }
.btl-row-prefix .btl-score { color: var(--color-muted-fg); text-align: center; }

.btl-details { margin-top: 8px; }
.btl-details summary {
  font-size: .74rem; color: var(--color-primary); cursor: pointer;
  padding: 4px 0; list-style: revert;
}
.btl-details summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.btl-idlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; max-width: 420px; }
.btl-idlist li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: .74rem; font-family: var(--mono);
  padding: 4px 8px; border-radius: 6px; background: var(--color-surface-2);
  color: var(--color-body);
}

@media (max-width: 640px) {
  .btl-row { grid-template-columns: 1fr; }
  .btl-meta { grid-column: 1; }
}

/* Permalink page — one party, everything expanded. */
.entity-loading { color: var(--color-muted-fg); font-size: .85rem; padding: 24px 0; }
.entity-breadcrumb { font-size: .75rem; color: var(--color-muted-fg); margin: 0 0 10px; }
.entity-breadcrumb a { color: var(--color-primary); }
.entity-name { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; overflow-wrap: anywhere; }
.entity-sub { font-size: .82rem; color: var(--color-muted-fg); margin: 0 0 14px; }
.entity-determination { margin-top: 14px; }
.entity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
/* On a card these groups sit inside a collapsed panel that already has its own
   padding; standing alone on the record page they need their own rhythm. */
.entity-detail { margin-top: 18px; }
.entity-detail .attr-group + .attr-group { margin-top: 20px; }
.entity-provenance {
  margin: 22px 0 6px; font-family: var(--mono); font-size: .72rem;
  color: var(--color-muted-fg); overflow-wrap: anywhere;
}
.entity-foot { font-size: .76rem; color: var(--color-muted-fg); margin: 0 0 8px; }

/* The record name doubles as its own permalink. */
.rc-permalink { color: inherit; text-decoration: none; }
.rc-permalink:hover { text-decoration: underline; text-underline-offset: 3px; }
.rc-permalink:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
/* .rc-link now inherits everything from .rc-act; the old standalone rule set a
   third font size and an align-self that lifted it off the row's baseline. */
/* Related-party ids link straight to that party's own record. */
a.rel-id { color: var(--color-primary); text-decoration: none; }
a.rel-id:hover { text-decoration: underline; }

/* Compact single-row sticky header on phones */
@media (max-width: 640px) {
  .site-header { padding: 10px 14px; gap: 10px; flex-wrap: nowrap; }
  .brand-logo svg { width: 26px; height: 26px; }
  /* Two words, one line: wrapping the wordmark doubles the height of a sticky
     header that then eats a third of a phone screen. */
  .brand-name { font-size: 1rem; white-space: nowrap; }
  .brand-tag { display: none; }
  .status-pill { padding: 5px 10px; }
  .status-meta { display: none; }
  /* Header buttons must never wrap. "← Back to screening" broke onto three
     lines and pushed the nav and theme toggle off the right edge of the phone;
     the header is nowrap, so a wrapping child silently overflows it. */
  .header-right { gap: 6px; flex-shrink: 0; }
  .header-right .btn-ghost { white-space: nowrap; padding: 5px 9px; font-size: .74rem; }
  /* The subpages' "Back to screening" is redundant with the brand logo, which
     already links home — drop the words and keep the arrow. */
  .header-right a.btn-ghost[href="./"] { font-size: 0; padding: 6px 9px; }
  .header-right a.btn-ghost[href="./"]::before { content: "←"; font-size: .95rem; }
  .notice-bar, .coverage-bar { margin: 10px 14px 0; padding: 8px 12px; align-items: flex-start; }
  .notice-bar p, .coverage-bar p { font-size: .72rem; line-height: 1.45; }
  .notice-bar svg, .coverage-bar svg { margin-top: 2px; }
}

/* Layout */
.layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 24px;
  padding: 24px clamp(16px, 4vw, 40px) 48px; align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* Search panel */
.search-panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  position: sticky; top: 92px;
}
@media (max-width: 900px) { .search-panel { position: static; } }
.search-panel form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--color-body); display: flex; justify-content: space-between; }
.field-help { font-size: .72rem; color: var(--color-muted-fg); line-height: 1.4; }

input[type=search], select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--color-foreground);
  background: var(--color-input); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm); transition: border-color .16s ease, box-shadow .16s ease;
}
input[type=search]::placeholder { color: #94A3B8; }
input:focus-visible, select:focus-visible, button:focus-visible, [type=range]:focus-visible {
  outline: none; border-color: var(--color-primary); box-shadow: var(--ring);
}
.filters { display: flex; flex-direction: column; gap: 18px; }

output#threshOut { font-family: var(--mono); color: var(--color-primary); font-weight: 500; }

.corrob { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 12px 12px 10px; margin: 0; }
.corrob legend { font-size: .72rem; font-weight: 600; color: var(--color-body); padding: 0 6px; }
.corrob legend .opt { color: var(--color-muted-fg); font-weight: 400; font-size: .68rem; }
.corrob-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.corrob input[type=text] { width: 100%; padding: 9px 10px; font: inherit; color: var(--color-foreground); background: var(--color-input); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); }
.corrob input:focus-visible { outline: none; border-color: var(--color-primary); box-shadow: var(--ring); }
@media (max-width: 380px) { .corrob-row { grid-template-columns: 1fr; } }

.corrob-flag { display: block; margin-top: 4px; font-size: .6rem; font-weight: 700; letter-spacing: .04em; border-radius: 4px; padding: 1px 4px; }
.corrob-flag.ok { color: var(--color-ok-fg); background: var(--color-ok-bg); border: 1px solid #86EFAC; }
.corrob-flag.bad { color: var(--color-destructive-fg); background: var(--color-destructive-bg); border: 1px solid #FCA5A5; }
input[type=range] { width: 100%; accent-color: var(--color-primary); height: 22px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--color-primary); color: var(--color-on-primary);
  border: none; border-radius: var(--radius-sm); padding: 12px 16px;
  font: inherit; font-weight: 600; cursor: pointer; min-height: 46px;
  box-shadow: 0 6px 16px -8px rgba(37,99,235,.6);
  transition: background .16s ease, transform .1s ease, box-shadow .16s ease;
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 8px 20px -8px rgba(37,99,235,.7); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: progress; }

/* Results */
.result-summary {
  font-size: .88rem; color: var(--color-muted-fg); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--color-border);
}
.result-summary strong { color: var(--color-foreground); }
.result-list { display: flex; flex-direction: column; gap: 14px; }

.result-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left-width: 4px; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: border-color .16s ease, box-shadow .16s ease, transform .1s ease;
}
.result-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-lg); }
.result-card.mt-exact, .result-card.mt-strong, .result-card.mt-strong_alias, .result-card.mt-identifier { border-left-color: var(--color-destructive); }
.result-card.mt-fuzzy, .result-card.mt-weak_alias { border-left-color: var(--color-warn); }
.result-card.mt-weak { border-left-color: var(--color-border-strong); }

.rc-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.rc-name { font-size: 1.05rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.rc-sub { font-size: .78rem; color: var(--color-muted-fg); margin: 3px 0 0; }
.rc-sub .matched-alias { color: var(--color-secondary); font-style: italic; }

.score-badge {
  flex-shrink: 0; text-align: center; min-width: 88px;
  border-radius: var(--radius-sm); padding: 8px 10px; border: 1px solid var(--color-border);
  background: var(--color-surface-2); color: var(--color-foreground);
}
.score-badge .score-num { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; display: block; line-height: 1; }
.score-badge .score-type { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted-fg); margin-top: 4px; display: block; }
.score-badge.s-hi { border-color: #FCA5A5; color: var(--color-destructive-fg); background: var(--color-destructive-bg); }
.score-badge.s-mid { border-color: #FCD34D; color: var(--color-warn-fg); background: var(--color-warn-bg); }
.score-badge.s-low { color: var(--color-muted-fg); }

/* Identity strip: the fields that separate a real hit from a namesake, kept on
   the collapsed card so triage never requires expanding every result. */
.rc-facts {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  margin: 11px 0 0; padding: 9px 12px;
  border-radius: 9px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.rc-facts > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rc-facts dt {
  font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-muted-fg); flex-shrink: 0;
}
.rc-facts dd { margin: 0; font-size: .8rem; color: var(--color-foreground); overflow-wrap: anywhere; }

.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
/* Programme codes are the noisiest row — a Russia entry can carry six. Kept on
   their own line, one step quieter, so authority and list stay the thing the
   eye lands on first. */
.rc-programs { margin-top: 6px; opacity: .85; }
.tag {
  font-size: .72rem; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-body);
}
.tag.tag-auth { font-weight: 700; letter-spacing: .02em; }
.tag.tag-auth.auth-ofac { border-color: #BFDBFE; background: #EFF6FF; color: var(--color-primary-hover); }
.tag.tag-auth.auth-un { border-color: #A7C7E7; background: #EEF4FB; color: #1E4E8C; }
.tag.tag-auth.auth-uk { border-color: #FBB6B6; background: #FEF2F2; color: #9B1C1C; }
.tag.tag-auth.auth-eu { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }
:root[data-theme="dark"] .tag.tag-auth.auth-eu { background: #2A2410; border-color: #4A3E1A; color: #FCD34D; }
:root[data-theme="dark"] .tag.tag-auth.auth-ofac { background: #142544; border-color: #2C4A7A; color: #93C5FD; }
:root[data-theme="dark"] .tag.tag-auth.auth-un { background: #10233E; border-color: #2A4468; color: #93C5FD; }
:root[data-theme="dark"] .tag.tag-auth.auth-uk { background: #2A1518; border-color: #7F2A2A; color: #FCA5A5; }
.tag.tag-list { border-color: #DDD6FE; background: #F5F3FF; color: #6D28D9; }
.tag.tag-prog { font-family: var(--mono); font-size: .68rem; }

.rc-detail { margin: 14px 0 0; border-top: 1px solid var(--color-border); padding-top: 14px; display: grid; gap: 16px; }
.attr-group-title { margin: 0 0 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-primary); font-weight: 600; }
.attr-grid { margin: 0; display: grid; gap: 7px; }
.detail-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; font-size: .82rem; align-items: baseline; }
.detail-row dt { color: var(--color-muted-fg); font-weight: 500; }
.detail-row dd { margin: 0; }
.detail-row dd.raw { font-family: var(--mono); font-size: .74rem; color: var(--color-muted-fg); }
.detail-row dd ul { margin: 0; padding-left: 16px; }
.name-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.name-list li { line-height: 1.4; }
.alias-type { display: inline-block; min-width: 52px; font-family: var(--mono); font-size: .66rem; color: var(--color-accent); }
.lowq { font-size: .66rem; color: var(--color-warn-fg); border: 1px solid #FCD34D; background: var(--color-warn-bg); border-radius: 4px; padding: 0 4px; }
@media (max-width: 520px) { .detail-row { grid-template-columns: 1fr; gap: 2px; } }

.rc-explain { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: .76rem; color: var(--color-muted-fg); font-family: var(--mono); }
.rc-explain svg { color: var(--color-primary); flex-shrink: 0; }
.determination { font-size: .8rem; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-surface-2); border: 1px solid var(--color-border); }
.determination strong { color: var(--color-secondary); }

.native { font-size: .95em; color: var(--color-foreground); direction: auto; unicode-bidi: plaintext; }
.script-tag { font-family: var(--mono); font-size: .62rem; color: var(--color-muted-fg); border: 1px solid var(--color-border-strong); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.rel-type { display: inline-block; min-width: 120px; font-family: var(--mono); font-size: .66rem; color: var(--color-accent); }
.rel-id { font-family: var(--mono); font-size: .66rem; color: var(--color-muted-fg); }
.rel-note { font-size: .74rem; color: #92400E; margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--color-warn-bg); border: 1px solid #FDE68A; }

.doc-table { display: grid; gap: 6px; }
.doc-row { display: grid; grid-template-columns: 160px 130px 1fr; gap: 10px; font-size: .8rem; align-items: baseline; }
.doc-type { color: var(--color-muted-fg); font-weight: 500; }
.doc-num { font-family: var(--mono); font-size: .76rem; color: var(--color-foreground); }
.doc-meta { font-size: .72rem; color: var(--color-muted-fg); }
@media (max-width: 640px) { .doc-row { grid-template-columns: 1fr; gap: 1px; } }

.tag.tag-own { border-color: #FCA5A5; color: var(--color-destructive-fg); background: var(--color-destructive-bg); font-weight: 600; }
/* Cross-authority link. Blue, not red: it says the same party appears elsewhere,
   which is information about the search result rather than about the party's
   risk. The weak variant is dashed, because a name-and-country link is a lead
   the reviewer still has to confirm. */
.tag.tag-cross { border-color: #93C5FD; color: #1D4ED8; background: rgba(59, 130, 246, .1); font-weight: 600; }
.tag.tag-cross.tag-cross-weak { border-style: dashed; font-weight: 500; }
:root[data-theme="dark"] .tag.tag-cross { border-color: rgba(147, 197, 253, .5); color: #BFDBFE; background: rgba(59, 130, 246, .14); }
.rc-tags.ids { margin-top: 0; }
.tag.tag-id { font-family: var(--mono); font-size: .68rem; background: var(--color-input); border-color: #DDD6FE; }
.tag.tag-id .id-type { color: var(--color-muted-fg); margin-right: 5px; }
.tag.tag-type { border-color: #BFDBFE; background: #EFF6FF; color: var(--color-primary-hover); }

/*
 * Card action row.
 *
 * This was three competing visual languages on one line — a 0.8rem semibold
 * sans button, a 0.74rem monospace muted button, and a 0.78rem link that
 * `align-self: center` lifted off the shared baseline. One type scale now, one
 * alignment, and two groups that say what the actions are FOR:
 *
 *   left  — change what you are looking at (expand the record, open the network)
 *   right — take the record somewhere else (link, print, CSV, JSON)
 *
 * The separator between them is the point: without it six equal-weight verbs
 * read as one undifferentiated pile.
 */
.rc-actions {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--color-border);
}
.rc-act-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* Push the export cluster right, and mark the boundary. */
.rc-act-export { margin-left: auto; padding-left: 18px; border-left: 1px solid var(--color-border); }

.rc-act {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: .77rem; font-weight: 500; line-height: 1;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 8px; cursor: pointer; text-decoration: none;
  color: var(--color-muted-fg);
}
.rc-act svg { flex-shrink: 0; opacity: .8; }
.rc-act:hover { background: var(--color-surface-2); color: var(--color-foreground); }
.rc-act:focus-visible { outline: none; box-shadow: var(--ring); }

/* The two view actions carry the weight; exports stay quiet until hovered. */
.rc-act-view { font-weight: 600; }
.rc-toggle { color: var(--color-primary); }
.rc-graph { color: var(--color-accent); }
.rc-toggle:hover { color: var(--color-primary); background: rgba(37, 99, 235, .08); }
.rc-graph:hover { color: var(--color-accent); background: rgba(124, 58, 237, .08); }

/* Chevron follows the disclosure state rather than needing its own bookkeeping. */
.rc-toggle svg { transition: transform .15s ease; }
.rc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Outcome of a clipboard write — both branches, because a failed copy that
   looks like a successful one sends the user off with an empty clipboard. */
.rc-act.is-done { color: var(--color-ok-fg); background: var(--color-ok-bg); }
.rc-act.is-failed { color: var(--color-destructive-fg); background: var(--color-destructive-bg); }

@media (prefers-reduced-motion: reduce) {
  .rc-toggle svg { transition: none; }
}

/* On a phone the export cluster cannot sit on the same line — let it wrap to
   its own row instead of squeezing the labels. */
@media (max-width: 640px) {
  .rc-act-export { margin-left: 0; padding-left: 0; border-left: 0; }
  .rc-actions { gap: 4px; }
}

.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-head .result-summary { flex: 1; min-width: 220px; }
.results-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Visually hidden but read aloud — labels for controls whose meaning is carried
   by the control itself for sighted users. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sort-field select {
  font: inherit; font-size: .78rem; color: var(--color-body);
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: 999px; padding: 6px 28px 6px 12px; cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.sort-field select:focus-visible { outline: none; box-shadow: var(--ring); }

/* Active-filter chips: what is narrowing the result set, and how to undo it. */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.active-filters[hidden] { display: none; }
.af-label {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-muted-fg); margin-right: 2px;
}
.af-chip {
  font: inherit; font-size: .75rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .3);
  color: var(--color-secondary);
}
.af-chip:hover { background: rgba(37, 99, 235, .16); }
.af-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.af-key { font-weight: 600; opacity: .75; }
.af-clear {
  font: inherit; font-size: .75rem; cursor: pointer;
  background: none; border: 0; color: var(--color-muted-fg); text-decoration: underline;
  padding: 4px 6px;
}
.af-clear:hover { color: var(--color-foreground); }
.af-clear:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
:root[data-theme="dark"] .af-chip { background: rgba(147, 197, 253, .12); border-color: rgba(147, 197, 253, .32); }
:root[data-theme="dark"] .af-chip:hover { background: rgba(147, 197, 253, .2); }
#copyLinkBtn { flex-shrink: 0; }

/* Print / PDF: show only the determination memo */
#printArea { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; padding: 0; color: #0F172A; font-size: 12px; }
  #printArea h1 { font-size: 18px; margin: 0 0 2px; }
  #printArea h2 { font-size: 15px; margin: 18px 0 4px; }
  #printArea .memo-sub { color: #64748B; font-size: 11px; margin: 0 0 4px; }
  #printArea table { width: 100%; border-collapse: collapse; margin-top: 10px; }
  #printArea th { text-align: left; vertical-align: top; width: 160px; padding: 6px 10px 6px 0; color: #475569; font-weight: 600; border-bottom: 1px solid #E2E8F0; }
  #printArea td { padding: 6px 0; border-bottom: 1px solid #E2E8F0; }
  #printArea .memo-foot { margin-top: 16px; font-size: 10.5px; color: #64748B; }
}

/* States */
.empty-state, .no-hits {
  text-align: center; color: var(--color-muted-fg); padding: 60px 24px;
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow);
}
.empty-state svg { color: #C7D2FE; margin-bottom: 8px; }
.empty-state h2 { margin: 6px 0 6px; font-size: 1.15rem; font-weight: 600; color: var(--color-foreground); letter-spacing: -.01em; }
.empty-state p { margin: 0 auto; max-width: 380px; font-size: .86rem; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; font-size: .8rem; }
.chip {
  background: var(--color-surface-2); border: 1px solid var(--color-border-strong); color: var(--color-primary-hover);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.chip:hover { background: #EFF6FF; border-color: var(--color-primary); }
.chip:active { transform: scale(.97); }
.no-hits.clear { border: 1px solid #86EFAC; color: var(--color-ok-fg); background: var(--color-ok-bg); box-shadow: none; }
.summary-sub { color: var(--color-muted-fg); font-weight: 400; }
.truncation-note { display: block; margin-top: 4px; font-size: .76rem; font-weight: 500; color: var(--color-warn-fg); }

.skeleton { height: 96px; border-radius: var(--radius); border: 1px solid var(--color-border); background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-2) 50%, var(--color-surface) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.site-footer {
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between;
  margin-top: 20px; padding: 22px clamp(16px, 4vw, 40px) 34px;
  border-top: 1px solid var(--color-border); color: var(--color-muted-fg); font-size: .78rem;
  background: rgba(255,255,255,.5);
}
.foot-brand { display: flex; flex-direction: column; }
.foot-brand strong { color: var(--color-foreground); font-size: .92rem; letter-spacing: -.01em; }
.foot-brand span { font-size: .74rem; }
.foot-meta { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.site-footer a { color: var(--color-primary); }
code { font-family: var(--mono); color: var(--color-primary); }
@media (max-width: 560px) { .foot-meta { text-align: left; } }

/* Graph modal */
.graph-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.graph-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(4px); }
.graph-dialog {
  position: relative; width: min(1100px, 94vw); height: min(760px, 92vh);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.graph-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--color-border);
}
.graph-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.graph-sub { margin: 3px 0 0; font-size: .78rem; color: var(--color-muted-fg); }
.graph-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.depth-toggle { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.depth-toggle button { background: var(--color-surface); color: var(--color-muted-fg); border: none; padding: 7px 12px; font: inherit; font-size: .78rem; cursor: pointer; transition: background .14s ease; }
.depth-toggle button:hover { background: var(--color-surface-2); }
.depth-toggle button + button { border-left: 1px solid var(--color-border-strong); }
.depth-toggle button.active { background: var(--color-primary); color: var(--color-on-primary); font-weight: 600; }

/* Diagram view switch — same control language as the hop depth toggle. */
.view-toggle { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { background: var(--color-surface); color: var(--color-muted-fg); border: none; padding: 7px 12px; font: inherit; font-size: .78rem; cursor: pointer; transition: background .14s ease; }
.view-toggle button:hover { background: var(--color-surface-2); }
.view-toggle button + button { border-left: 1px solid var(--color-border-strong); }
.view-toggle button.active { background: var(--color-accent); color: #fff; font-weight: 600; }

.graph-body { flex: 1; display: grid; grid-template-columns: 1fr 260px; min-height: 0; }
.graph-stage { position: relative; overflow: hidden; background: radial-gradient(700px 460px at 42% 46%, #FFFFFF 0%, #EEF2F8 82%); }
.graph-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The hierarchy has a legibility floor: on a narrow screen 48 subsidiaries
   cannot be squeezed into the stage and stay readable, so the diagram grows
   past it and the stage scrolls rather than shrinking the boxes to stripes. */
.graph-modal.view-ownership .graph-stage { overflow-y: auto; overflow-x: hidden; }
.graph-modal.view-ownership #graphCanvas { position: relative; height: auto; }
.graph-modal.view-ownership #graphGL { display: none; }
/* The stage scrolls in this view, so a corner-pinned badge would either scroll
   away with the diagram or sit on top of a row of boxes. The counts move into
   the side panel instead. */
.graph-modal.view-ownership .graph-renderer { display: none; }
.graph-view-count { display: block; font-weight: 600; color: var(--color-foreground); margin-bottom: 3px; }
#graphGL { z-index: 1; pointer-events: none; }
#graphCanvas { z-index: 2; }
.graph-renderer { position: absolute; right: 12px; bottom: 10px; z-index: 3; font-family: var(--mono); font-size: .62rem; color: var(--color-muted-fg); background: rgba(255,255,255,.78); border: 1px solid var(--color-border); border-radius: 6px; padding: 2px 7px; pointer-events: none; }
.graph-panel { border-left: 1px solid var(--color-border); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--color-surface); }
.graph-panel h3 { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-primary); }
.graph-legend { display: grid; gap: 6px; font-size: .74rem; color: var(--color-body); }
.graph-legend span { display: flex; align-items: center; gap: 8px; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.dot-center { background: #2563EB; } .dot-block { background: #DC2626; } .dot-restrict { background: #D97706; } .dot-ext { background: #94A3B8; border: 1px dashed #64748B; }
.edge-own { width: 16px; height: 0; border-top: 2.4px solid #DC2626; flex-shrink: 0; }
.edge-interest { width: 16px; height: 0; border-top: 1.6px dashed #D97706; flex-shrink: 0; }
.edge-other { width: 16px; height: 0; border-top: 1.6px dashed var(--color-border-strong); flex-shrink: 0; }
.edge-peer { width: 16px; height: 0; border-top: 1.5px dotted var(--color-muted-fg); flex-shrink: 0; }
/* These link kinds are only distinguished in the hierarchy view. */
.legend-ownership-only { display: none !important; }
.graph-modal.view-ownership .legend-ownership-only { display: flex !important; }
.graph-view-note { font-size: .7rem; line-height: 1.45; color: var(--color-muted-fg); margin: 2px 0 0; padding: 8px 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.graph-metrics { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: .8rem; }
.graph-metrics li { display: flex; justify-content: space-between; gap: 8px; }
.graph-metrics li span:first-child { color: var(--color-foreground); }
.graph-metrics .wd { font-family: var(--mono); color: var(--color-primary); font-weight: 500; }
.graph-note { font-size: .72rem; color: #92400E; line-height: 1.45; padding: 10px; background: var(--color-warn-bg); border: 1px solid #FDE68A; border-radius: var(--radius-sm); }
.graph-audit { font-size: .66rem; color: var(--color-muted-fg); font-family: var(--mono); line-height: 1.4; margin: 0; }
@media (max-width: 720px) {
  /* Full-screen modal on phones */
  .graph-dialog { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
  .graph-header { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .graph-header h2 { font-size: .95rem; }
  .graph-sub { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .graph-controls { width: 100%; justify-content: space-between; }
  .depth-toggle, .view-toggle { flex: 1; }
  .depth-toggle button, .view-toggle button { flex: 1; padding: 8px 6px; }
  /* Stage must keep real height in the single-column grid (canvases are
     position:absolute and collapse without it) */
  .graph-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .graph-stage { min-height: 46dvh; }
  .graph-panel { border-left: none; border-top: 1px solid var(--color-border); max-height: 38dvh; }
}

/* About / methodology page */
.doc { max-width: 820px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 40px; }
.doc h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 10px; }
.doc .lede { font-size: 1rem; color: var(--color-body); margin: 0 0 24px; }
.doc section { margin-top: 30px; }
.doc h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.doc h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-primary); margin: 18px 0 8px; }
.h3-note { text-transform: none; letter-spacing: 0; color: var(--color-muted-fg); font-weight: 400; }
.doc p { color: var(--color-body); margin: 0 0 12px; }
.doc a { color: var(--color-primary); }
.doc-list { margin: 0; padding-left: 20px; display: grid; gap: 7px; color: var(--color-body); font-size: .9rem; }
.doc-list strong { color: var(--color-foreground); }
.doc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 8px; }
.stat { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.stat-lbl { display: block; font-size: .72rem; color: var(--color-muted-fg); margin-top: 4px; }
.pub-table { width: 100%; border-collapse: collapse; font-size: .86rem; max-width: 340px; }
.pub-table th { text-align: left; color: var(--color-muted-fg); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid var(--color-border); }
.pub-table td { padding: 7px 10px; border-bottom: 1px solid var(--color-border); font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
.prog-cov { display: flex; flex-wrap: wrap; gap: 5px; }
.prog-chip { font-family: var(--mono); font-size: .68rem; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 6px; padding: 2px 7px; color: var(--color-body); }
@media (max-width: 640px) { .doc-stats { grid-template-columns: repeat(2, 1fr); } .two-col { grid-template-columns: 1fr; } }

/* Insights page — snapshot composition, timelines, recent designations */
.doc-wide { max-width: 1080px; }
.snap-provenance { font-family: var(--mono); font-size: .72rem; color: var(--color-muted-fg); margin: -14px 0 22px; }
.stat-sub { display: block; font-size: .66rem; color: var(--color-muted-fg); margin-top: 3px; opacity: .85; }

.bar-chart { display: grid; gap: 7px; margin: 4px 0 6px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .8rem; }
.bar-name { color: var(--color-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 999px; height: 15px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); border-radius: 999px; }
.bar-fill.auth-ofac { background: linear-gradient(90deg, #2563EB, #3B82F6); }
.bar-fill.auth-eu { background: linear-gradient(90deg, #D97706, #FBBF24); }
.bar-fill.auth-un { background: linear-gradient(90deg, #1E4E8C, #60A5FA); }
.bar-fill.auth-uk { background: linear-gradient(90deg, #B91C1C, #F87171); }
.bar-fill.auth-bis { background: linear-gradient(90deg, #6D28D9, #A78BFA); }
.bar-fill.auth-state { background: linear-gradient(90deg, #0F766E, #2DD4BF); }
.bar-val { font-family: var(--mono); font-size: .74rem; color: var(--color-foreground); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-val em { font-style: normal; color: var(--color-muted-fg); margin-left: 6px; font-size: .68rem; }

.col-chart {
  display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 18px 2px 0;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 6px; overflow-x: auto;
}
.col { flex: 1 1 0; min-width: 16px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.col-bar { width: 72%; max-width: 26px; background: linear-gradient(180deg, var(--color-primary), var(--color-accent)); border-radius: 4px 4px 0 0; position: relative; transition: filter .15s ease; }
.col:hover .col-bar { filter: brightness(1.15); }
.col-bar em { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: .58rem; color: var(--color-muted-fg); }
.col-lbl { font-size: .58rem; color: var(--color-muted-fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-note { font-size: .74rem; color: var(--color-muted-fg); }
.chart-empty { font-size: .8rem; color: var(--color-muted-fg); font-style: italic; }

.recent-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 12px; }
.recent-controls input[type=search] { padding: 9px 11px; }
.recent-count { font-size: .74rem; color: var(--color-muted-fg); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.recent-list { display: grid; gap: 10px; }
.recent-item {
  display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: start;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow);
}
.recent-date { font-family: var(--mono); font-size: .72rem; color: var(--color-primary); font-weight: 500; padding-top: 2px; }
.recent-name { margin: 0; font-size: .95rem; font-weight: 600; letter-spacing: -.01em; color: var(--color-foreground); }
.recent-title { margin: 2px 0 0; font-size: .78rem; color: var(--color-muted-fg); }
.recent-item .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.recent-screen { white-space: nowrap; text-decoration: none; align-self: center; }
.more-btn { margin: 14px auto 0; display: block; }
@media (max-width: 640px) {
  .recent-controls { grid-template-columns: 1fr; }
  .recent-item { grid-template-columns: 1fr; gap: 8px; }
  .recent-screen { justify-self: start; }
  .bar-row { grid-template-columns: minmax(72px, 40%) 1fr auto; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
