/* ══ 2026 refresh ═══════════════════════════════════════════════════════════════
   Loaded after styles.css and layered over it, so the whole refresh is one file
   to read, review or remove. Nothing in styles.css was rewritten: this sheet
   remaps its tokens and restyles its components by the same class names.

   The direction is recorded in full in the mockups' DIRECTION.md. The short form:
   - Geist, quiet 1px borders, tabular figures, more air.
   - Colour by subject: industry blue, group green, country orange, each a
     two-stop "Electric" family. Colour sits on data and status, not on chrome.
   - Red is for bad news only.
   - The primary action is solid brand blue with a faint cyan wash from its
     top-right corner (the "G6" button), filled to its outer edge with no
     visible border, and keeping the wash on hover. No diagonal blue-to-cyan sweeps on
     controls; those two-stop gradients are kept for data marks and soft tints.
   - A selected option in any switch is a borderless pill with a soft shadow
     that slides between options. A highlighted box (selected or hovered card,
     selected list row) lifts on the one --lift-shadow, not an outline.
   Dark is still the default (:root); body.light is the light theme. */

/* ── Tokens ──────────────────────────────────────────────────────────────────── */
/* ── Control heights ────────────────────────────────────────────────────────
   One scale for every control, so a row of them lines up whatever they are.
   --ctl-h        buttons, dropdowns, search; the outer edge of a segmented control
   --ctl-inner    an option inside a segmented control (--ctl-h less its 2px padding)
   --ctl-h-xs     small actions inside a row or card
   --ctl-h-field  stacked form fields
   The nav and the floating pagination are their own tier and don't use these.
   Set a height from here rather than from padding or a new value. */
:root {
  --ctl-h:       32px;
  --ctl-inner:   28px;
  --ctl-h-xs:    24px;
  --ctl-h-field: 40px;
}
@media (max-width: 768px) {
  :root {
    --ctl-h:       44px;
    --ctl-inner:   40px;
    --ctl-h-xs:    36px;
    --ctl-h-field: 44px;
  }
  /* The avatar stays 32px to look at; this is the rest of its tap target. */
  .user-avatar-btn::after { content: ''; position: absolute; inset: -6px; }
}

:root {
  --bg:               #0f0f11;
  --bg-surface:       #141416;
  --bg-elevated:      #1c1c1f;
  --bg-elevated-hover:#26262a;
  --surface-raised:   #1a1a1d;
  --subnav-cast:      rgba(0, 0, 0, 0);
  --subnav-bg:        #141416;
  /* About 82% of the surface: content passing under the bar is a hint of colour,
     not readable shapes. Lower read as bright patches under the pies. */
  --subnav-glass:     rgba(20, 20, 22, 0.84);
  --pill-bg:          #141416;
  --subnav-rule:      #26262a;
  --switch-knob:      #ffffff;
  --switch-knob-cast: rgba(0, 0, 0, 0.5);
  --surface-hover:    #1c1c1f;
  --border:           #26262a;
  --border-soft:      #1d1d20;
  --text:             #ededee;
  --text-muted:       #a3a5aa;
  --text-dim:         #86888e;
  --accent:           #3d7dff;
  --accent-fg:        #ffffff;
  --accent-dim:       rgba(61, 125, 255, 0.14);
  --ok:               #1fd896;
  --warn:             #ffcc33;
  --error:            #ff4d6a;
  --info:             #3d7dff;
  --radius:           10px;
  --radius-sm:        8px;
  --shadow:           0 12px 32px rgba(0, 0, 0, 0.55);
  --card-shadow:      none;
  /* Box highlights share one shadow: see --lift-shadow below. */
  --card-hover-shadow:var(--lift-shadow);

  /* Electric. Each subject is a pair: the first stop is the strong end, the
     second the light end its gradients run towards. */
  --brand:   #3d7dff;  --brand2: #33c2ff;
  --ind:     #3d7dff;  --ind2:   #33d6ff;
  --grp:     #1fd896;  --grp2:   #b8f04a;
  --cty:     #ff6a3d;  --cty2:   #ffc04d;
  /* The same hues, readable as small text on the surface. */
  --ind-ink: #8fb4ff;  --grp-ink: #5fe3b0;  --cty-ink: #ffa07a;
  --bad:     #ff4d6a;
  --grid:    #1f1f23;
  --empty:   #232428;
  --rule:    #1d1d20;
  --pill:        #2a2b2f;
  --pill-shadow: 0 1px 2px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  --lift:        #1d1d21;
  /* The one shadow for a highlighted box: a selected or hovered card, a selected
     list row, the update in the reader. Switch pills and toggles keep
     --pill-shadow; menus and popovers float on --float-shadow. */
  --lift-shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
  --float-shadow:0 10px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05);
  /* G6: the primary button, the avatar and anything filled with the brand. */
  --g6: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--brand2) 75%, transparent), transparent 60%);
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  /* Reading prose: the Topics brief's bottom line and section text. */
  --font-serif: 'Source Serif 4', Charter, Georgia, 'Times New Roman', serif;
}
body.light {
  --bg:               #f9fafb;
  --bg-surface:       #ffffff;
  --bg-elevated:      #f4f5f7;
  --bg-elevated-hover:#eceef1;
  --surface-raised:   #ffffff;
  --subnav-cast:      rgba(0, 0, 0, 0);
  --subnav-bg:        #ffffff;
  --subnav-glass:     rgba(255, 255, 255, 0.82);
  --pill-bg:          #ffffff;
  --subnav-rule:      #e6e6e8;
  --switch-knob:      #ffffff;
  --switch-knob-cast: rgba(16, 24, 40, 0.22);
  --surface-hover:    #f4f5f7;
  --border:           #e6e6e8;
  --border-soft:      #f0f0f2;
  --text:             #0a0a0a;
  --text-muted:       #666a70;
  --text-dim:         #8a8e95;
  --accent:           #0a5cff;
  --accent-fg:        #ffffff;
  --accent-dim:       rgba(10, 92, 255, 0.08);
  --ok:               #00764f;
  --warn:             #a16207;
  --error:            #e5133d;
  --info:             #0a5cff;
  --shadow:           0 12px 32px rgba(16, 24, 40, 0.12);
  --card-hover-shadow:var(--lift-shadow);

  --brand:   #0a5cff;  --brand2: #00a3ff;
  --ind:     #0a5cff;  --ind2:   #00c2ff;
  --grp:     #00b37a;  --grp2:   #8fd61f;
  --cty:     #ff4d1a;  --cty2:   #ffb020;
  --ind-ink: #0047cc;  --grp-ink: #00764f;  --cty-ink: #c2360a;
  --bad:     #e5133d;
  --grid:    #eeeff1;
  --empty:   #e9ebee;
  --rule:    #f0f0f2;
  --pill:        #ffffff;
  --pill-shadow: 0 1px 2px rgba(16,24,40,.06), 0 3px 10px rgba(16,24,40,.09);
  --lift:        #ffffff;
  --lift-shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.07);
  --float-shadow:0 8px 28px rgba(16,24,40,.12), 0 1px 3px rgba(16,24,40,.08);
}
html { background: #0f0f11; }
html:has(body.light) { background: #f9fafb; }

body {
  font-family: var(--font);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}
button, input, select, textarea { font-family: inherit; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
/* The header was already pinned above the scrolling view; it now frosts like
   the filter bar so the two read as one pinned band. */
.app-header {
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
          backdrop-filter: blur(20px) saturate(1.7);
  border-bottom-color: var(--border);
}
body.light .app-header { background: color-mix(in srgb, var(--bg-surface) 82%, transparent); }
.header-brand { color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.header-brand svg { color: var(--brand); }

/* Nightwatch wordmark — Matchday's treatment (uppercase, a radial gradient from
   the bottom centre clipped to the letters) in midnight purples. The light theme
   takes deeper stops: the dark theme's pale ends disappear on white. */
.brand-wordmark {
  display: inline-block;
  font-family: 'Funnel Display', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  background: radial-gradient(ellipse farthest-corner at 50% 100%, #4f46e5 0%, #7c3aed 35%, #a5b4fc 65%, #eef2ff 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body.light .brand-wordmark {
  background-image: radial-gradient(ellipse farthest-corner at 50% 100%, #8b5cf6 0%, #6d28d9 35%, #4338ca 65%, #1e1b4b 100%);
}
.auth-page .auth-logo .brand-wordmark { font-size: 1.6rem; }

/* Main nav: the same slider, without the track behind it. */
.app-nav { background: transparent; border-color: transparent; padding: 3px; gap: 2px; }
.nav-slider {
  background: var(--pill); box-shadow: var(--pill-shadow); border-radius: 999px;
  /* Transform only: updateNavSlider folds the resize into a scaleX from the left
     edge, so move and resize stay in step even while a heavy view renders. */
  transform-origin: 0 50%;
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
}
.nav-tab { font-size: .86rem; padding: .38rem .95rem; border-radius: 999px; }
.nav-tab.active svg { color: var(--brand); }
/* Eight tabs don't fit beside the wordmark and icons on a laptop-width window:
   there, the tabs drop their icons and close up (the phone menu takes over at 768px). */
@media (min-width: 769px) and (max-width: 1440px) {
  .app-nav .nav-tab { padding: .38rem .7rem; }
  .app-nav .nav-tab svg { display: none; }
}

.header-icon-group .btn-icon { width: 32px; height: 32px; border-radius: 999px; }
.header-icon-group .btn-icon:hover { background: var(--bg-elevated); }
/* The G6 fill is on the round button only: given to the initials as well, it
   painted a second, offset gradient box behind the letters. */
.user-avatar-btn {
  background-color: var(--brand) !important;
  background-image: var(--g6) !important;
  background-origin: border-box;
  color: #fff !important;
}
.user-avatar-initials { background: none !important; color: #fff !important; }

/* ── Filter bar ─────────────────────────────────────────────────────────────── */
/* Flat and frosted: no cast under it, one quiet rule. */
.subnav { box-shadow: none; border-bottom-color: var(--subnav-rule); }
.subnav::after { display: none; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn { height: var(--ctl-h); border-radius: var(--radius-sm); font-weight: 500; transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out, filter .15s ease-out, transform .1s ease-out; }
.btn-icon, .btn-xs { height: auto; }
.btn-sm { height: var(--ctl-h-xs); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary,
.btn-smart-export,
#btn-add {
  background-color: var(--brand);
  background-image: var(--g6);
  /* No visible border: the 1px stays, transparent, so these keep the height of
     the outlined buttons beside them, and the gradient is laid from the outer
     edge. Laid from the default padding edge, it repeated into the border strip
     and showed as a lighter seam along the right and bottom. */
  background-origin: border-box;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 2px rgba(10, 40, 120, .18);
}
/* Hover keeps the gradient and brightens 6%. The older hover rules in
   styles.css use the `background` shorthand, which reset the image (and its
   origin) and left the button flat blue while hovered, so both are restated. */
.btn-primary:hover:not(:disabled),
.btn-smart-export:hover,
#btn-add:hover {
  background-color: var(--brand); background-image: var(--g6); background-origin: border-box;
  filter: brightness(1.06); border-color: transparent; color: #fff;
}
.btn-secondary { background: var(--bg-surface); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-elevated); border-color: color-mix(in srgb, var(--text) 18%, var(--border)); }
.btn-danger, .btn-danger:hover:not(:disabled) { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, var(--border)); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.btn-icon { border-radius: 8px; }
.btn-icon:hover { background: var(--bg-elevated); }

/* Pill-height controls on the bars keep their height, square up a little. */
#btn-add, #btn-cancel-add-2, #btn-confirm-add, #btn-edit-mode, #btn-delete,
.btn-view-density, .btn-smart-export, .btn-export-csv { border-radius: var(--radius-sm); }

/* ── Filter triggers, search ────────────────────────────────────────────────── */
.filter-dropdown-trigger,
.victim-search-pill {
  height: var(--ctl-h);
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: .82rem;
}
.victim-search-pill::placeholder { color: var(--text-dim); }
@media (hover: hover) {
  .filter-dropdown-trigger:hover,
  [data-filter-id] .filter-dropdown-trigger:hover,
  .saved-filters-dropdown .filter-dropdown-trigger:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--border)); color: var(--text); }
}
.filter-dropdown-trigger.open,
.filter-dropdown-trigger.has-selection {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 5%, var(--bg-surface)), color-mix(in srgb, var(--brand2) 7%, var(--bg-surface)));
}
.victim-search-pill:focus,
.search-input:focus, .form-input:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.filter-dropdown-panel {
  border-radius: 12px;
  border-color: var(--border);
  background: var(--bg-surface);
  box-shadow: var(--float-shadow);
}

/* Round view toggles: no ring; the active one floats like a selected option. */
.btn-toggle-circle { border-color: transparent; background: transparent; width: var(--ctl-h); height: var(--ctl-h); }
.btn-toggle-circle:hover { border-color: transparent; background: var(--bg-elevated); color: var(--text); }
.btn-toggle-circle.active { border-color: transparent; background: var(--pill); box-shadow: var(--pill-shadow); color: var(--brand); }

/* ── Floating pagination ────────────────────────────────────────────────────── */
.victims-pagination, .victims-perpage, .victims-perpage-select-wrap,
body:not(.light) .victims-pagination, body:not(.light) .victims-perpage, body:not(.light) .victims-perpage-select-wrap {
  border-color: transparent;
  box-shadow: var(--float-shadow);
  padding: 4px;
}
body:not(.light) .victims-pagination, body:not(.light) .victims-perpage { background: #1c1c1f; }
.pp-btn.active, .pg-btn.active, .victims-pagination .active {
  background: var(--pill) !important;
  color: var(--text) !important;
  box-shadow: var(--pill-shadow);
}
.pp-btn:hover:not(.active) { background: var(--bg-elevated); }

/* ── Subject tags (shared) ──────────────────────────────────────────────────── */
/* Group green, country orange, industry blue: a soft two-stop tint behind ink
   of the same hue. Used on victim cards, trends, news and Topics. */
.victim-group-badge, .tag-grp {
  font-size: .76rem; font-weight: 500; letter-spacing: 0;
  padding: 2px 8px; border-radius: 6px; border: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--grp) 12%, var(--bg-surface)), color-mix(in srgb, var(--grp2) 19%, var(--bg-surface)));
  color: var(--grp-ink);
}
.victim-group-badge:hover, .victim-group-badge--active, .victim-group-badge--active:hover,
.victim-card--group-view .victim-card-header .victim-group-badge {
  border: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--grp) 20%, var(--bg-surface)), color-mix(in srgb, var(--grp2) 28%, var(--bg-surface)));
  color: var(--grp-ink);
}
.victim-flag {
  font-size: .76rem; font-weight: 500; gap: 5px;
  padding: 2px 8px; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cty) 11%, var(--bg-surface)), color-mix(in srgb, var(--cty2) 18%, var(--bg-surface)));
  color: var(--cty-ink);
}
.victim-flag .victim-flag-emoji { font-size: .9rem; line-height: 1; }
.victim-country-name { font-size: .76rem; color: inherit; font-weight: 500; }
.victim-flag.victim-flag-none { background: var(--bg-elevated); color: var(--text-muted); }
.victim-industry-tag {
  display: inline-flex; font-size: .76rem; font-weight: 500; padding: 2px 8px; border-radius: 6px; white-space: nowrap;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ind) 9%, var(--bg-surface)), color-mix(in srgb, var(--ind2) 15%, var(--bg-surface)));
  color: var(--ind-ink);
}

/* ── Victim cards ───────────────────────────────────────────────────────────── */
.victim-cards-grid { gap: 16px; }
.victim-month-heading { font-size: 1.1rem; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.victim-card { padding: 16px 18px 14px; gap: 10px; border-color: var(--border); }
.victim-card:hover { border-color: color-mix(in srgb, var(--text) 16%, var(--border)); box-shadow: var(--card-hover-shadow); }
.victim-org-name { font-size: 1.06rem; letter-spacing: -.01em; }
.victim-divider { display: none; }
.victim-meta { gap: 4px; font-size: .82rem; }
.victim-meta div { align-items: center; gap: 8px; }
.victim-meta-primary { flex-wrap: wrap; }
.victim-description { font-size: .82rem; line-height: 1.5; }
.victim-link { font-size: .82rem; font-weight: 500; color: var(--brand); }

/* Source badges: the source's own colour as ink, on grey. */
.victim-source-badge { font-size: .64rem; font-weight: 600; letter-spacing: .02em; opacity: 1; border: 0 !important; background: var(--bg-elevated) !important; border-radius: 5px; padding: 2px 6px; }
.victim-source-rlv { color: var(--ind-ink) !important; }
.victim-source-rfd { color: #a16207 !important; }
body:not(.light) .victim-source-rfd { color: #e0b252 !important; }
.victim-source-rlk { color: var(--grp-ink) !important; }
.victim-source-legend-btn:hover, .victim-source-legend-btn.active { border-color: transparent; background: var(--bg-elevated); color: var(--text); }
/* The source switches (on/off per source): off is faded and struck through, so
   it still reads as off on a phone, where only the badge shows. */
.victim-source-legend-btn { transition: opacity .15s ease-out, background-color .15s ease-out; }
.victim-source-legend-btn:not(.active) { opacity: .45; }
.victim-source-legend-btn:not(.active) .victim-source-badge { text-decoration: line-through; }
@media (hover: hover) { .victim-source-legend-btn:not(.active):hover { opacity: .75; } }
.victim-source-legend-btn.is-last { cursor: default; }
.victim-delete-btn:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }
@media (hover: none) { .victim-delete-btn { opacity: 1; } }
/* The icon stays small so rows keep their height; the target is the --ctl-h-xs square. */
.victim-delete-btn { position: relative; }
.victim-delete-btn::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: var(--ctl-h-xs); height: var(--ctl-h-xs); transform: translate(-50%, -50%);
}

/* Desktop: tighter triggers and a slightly narrower search, so the bars hold
   one row. Search keeps its width on focus. */
@media (min-width: 769px) {
  .subnav .filter-dropdown-trigger { padding: 0 .6rem; }
  .victim-search-pill { width: 140px; }
  .victims-controls { gap: .5rem; }
}
/* Sort direction as an icon-only control. */
.filter-dropdown-trigger.sort-dir-icon { width: var(--ctl-h); padding: 0; justify-content: center; color: var(--text); }

/* ── Soft-pill switches ─────────────────────────────────────────────────────── */
/* No track. The options are plain text; the selected one sits on a pill
   (.seg-ind, placed by initSegPills in app.js) that slides between them. */
.seg-group { position: relative; isolation: isolate; }
.seg-ind {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  border-radius: 999px; background: var(--pill); box-shadow: var(--pill-shadow); opacity: 0;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), width .18s cubic-bezier(.2,.8,.2,1), opacity .12s ease-out;
}
.seg-group > button, .seg-group > .pg-num, .seg-group > .pp-btn { position: relative; z-index: 1; }
.chart-tb-group, #viz-switcher { gap: 2px; }
.chart-tb-btn, .viz-tab, .feed-filter-btn, .victim-region-tab {
  background: transparent !important; border: 0 !important; box-shadow: none;
  color: var(--text-muted); border-radius: 999px; height: var(--ctl-h); padding: 0 .8rem; font-size: .84rem;
  transition: color .15s ease-out, transform .1s ease-out;
}
.chart-tb-btn:hover, .viz-tab:hover, .feed-filter-btn:hover, .victim-region-tab:hover { color: var(--text); background: transparent !important; }
.chart-tb-btn.active, .viz-tab.active, .feed-filter-btn.active, .victim-region-tab.active { color: var(--text) !important; font-weight: 500; }
.chart-tb-btn:active, .viz-tab:active { transform: scale(.97); }
.chart-tb-sep { height: 18px; background: var(--border); margin: 0 .5rem; }
#chart-reset-zoom { margin-left: auto; }
.pg-nums { display: inline-flex; gap: 2px; }
.pg-num, .pp-btn { background: transparent !important; border-radius: 999px; }
.pg-num.active, .pp-btn.active { background: transparent !important; box-shadow: none !important; color: var(--text) !important; }

/* ── Visualisation panel ────────────────────────────────────────────────────── */
#victim-chart-container { box-shadow: none; border-bottom: 1px solid var(--border); }
#viz-switcher { border-bottom: 0; padding: .9rem 0 .3rem; margin-bottom: .2rem; }
.viz-tab { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 0; border-radius: 999px !important; }
#victim-chart-toolbar { gap: 2px; padding: .4rem 0 .6rem; }

/* Heatmap: horizontal flag + code headers, rounded cells. */


/* ── Breakdown pies ─────────────────────────────────────────────────────────── */
#victims-insights { border-bottom-color: var(--border); background: var(--bg-surface); }
.vi-panel { padding: 1.1rem 1.25rem; }
.vi-panel-title { font-size: .92rem; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--text); }
.vi-legend { gap: .25rem; }
.vi-legend-item { gap: .5rem; font-size: .82rem; }
.vi-legend-dot { width: 9px; height: 9px; }
.vi-legend-label { flex: 1; }
.vi-legend-n { font-weight: 500; font-variant-numeric: tabular-nums; }
.vi-legend-pct { width: 2.6rem; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── Trends strip ───────────────────────────────────────────────────────────── */
#victim-trends-container { background: var(--bg-surface); }
.trend-card-label { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.trend-card-value { font-weight: 600; letter-spacing: -.02em; }
.trend-card-delta.up { color: var(--bad); }
.trend-card-delta.down { color: var(--grp-ink); }

/* Victims dashboard: every section is a rounded panel like Victims per week
   (.rd-panel), on the page's 1.5rem side margin. The six figures and the three
   pies are one panel each, with their dividers kept inside it. */
#victim-trends-grid,
#viz-container,
#victims-insights { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); }
#victim-trends-container { background: transparent; border-bottom: 0; padding: 0 1.5rem; }
#victim-trends-meta { padding: .6rem .25rem .35rem; }
#victim-trends-grid { overflow: hidden; }
#viz-container { margin: 0 1.5rem 1rem; }   /* in .vd-row it's the row's */
/* The pies sit straight under the six figures; Victims per week's own top padding follows them. */
#victims-insights { margin: 1rem 1.5rem 0; }
#viz-switcher { padding-left: 1rem; padding-right: 1rem; }
#victim-chart-container { background: transparent; border-bottom: 0; padding: 0 1rem .25rem; border-radius: 0 0 12px 12px; }
#victim-chart-resize-handle { margin: 0 -1rem; }
.viz-panel[data-view="map"], .viz-panel[data-view="heatmap"] { padding: 0 1rem 1rem; }
/* Three figures to a row: a divider under the first row, none at the box's right edge. */
@media (min-width: 769px) and (max-width: 1200px) {
  #victim-trends-grid .trend-card:nth-child(3n) { border-right: none; }
  #victim-trends-grid .trend-card:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
/* Two to a row on a phone: the box's own edge closes the last row. */
@media (max-width: 768px) {
  #victim-trends-grid .trend-card:nth-last-child(-n+2) { border-bottom: none; }
  /* The change goes under the figure when the half-width cell can't fit both. */
  #victim-trends-grid .trend-card-value-row { flex-wrap: wrap; row-gap: 0; }
}
/* The chart's switches (Time series / Map / …, Bar / Line / …, Daily / Weekly / …)
   in the quick switches' style (.tp-brief-periods): a tinted track, the chosen
   option on a rounded pill (.seg-ind) that slides. */
#viz-switcher, #viz-container .chart-tb-group {
  gap: 0; padding: 2px; border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}
#viz-switcher { width: fit-content; margin: .9rem 1rem .5rem; }
#viz-switcher .seg-ind, #viz-container .chart-tb-group .seg-ind { border-radius: 7px; }
#viz-switcher .viz-tab, #viz-container .chart-tb-group .chart-tb-btn {
  height: var(--ctl-inner); padding: 0 .8rem; border-radius: 7px !important; font-size: .78rem; font-weight: 500;
}
#viz-switcher .viz-tab.active, #viz-container .chart-tb-group .chart-tb-btn.active { color: var(--text); }
/* Side by side, two tracks would read as one. */
#viz-container .chart-tb-group ~ .chart-tb-group { margin-left: .5rem; }
@media (max-width: 480px) {
  #viz-switcher { margin: .75rem .75rem .5rem; }
}
@media (max-width: 480px) {
  #victim-trends-container { padding: 0 .75rem; }
  #viz-container { margin: 0 .75rem .75rem; }
  #victims-insights { margin: .75rem .75rem 0; }
}
@media (min-width: 769px) {
  /* Pies at a size that leaves their legends room for the names. */
  .vi-donut-wrap { max-width: min(46%, 220px); }
  .vi-legend { min-width: 150px; }
}
/* Rising and new-entrant groups as group tags. */
.trend-card-movers-name {
  display: inline-flex; flex: 0 1 auto; width: fit-content; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .78rem; font-weight: 500; padding: 1px 8px; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--grp) 12%, var(--bg-surface)), color-mix(in srgb, var(--grp2) 19%, var(--bg-surface)));
  color: var(--grp-ink);
}
.trend-card-movers-meta.up { color: var(--bad); }

/* ── Profiles ───────────────────────────────────────────────────────────────── */
.profile-grid { gap: 16px; }
.profile-card { padding: 18px 18px 14px; gap: 12px; border-color: var(--border); }
.profile-card:hover { border-color: color-mix(in srgb, var(--text) 16%, var(--border)); box-shadow: var(--card-hover-shadow); }
.card-name { font-size: 1.12rem; font-weight: 600; letter-spacing: -.015em; }
.card-field-label { font-size: .76rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.card-preview { font-size: .84rem; line-height: 1.5; color: var(--text-muted); }
.card-footer { border-top: 0 !important; padding-top: 4px; }
.card-timestamps { font-size: .76rem; color: var(--text-dim); }
.alias-chip, .alias-tag {
  font-family: inherit; font-size: .76rem; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted);
}
.alias-tag-custom { background: var(--bg-elevated); border-color: color-mix(in srgb, var(--grp) 35%, var(--border)); color: var(--text); }

/* ── Profile header in edit mode ─────────────────────────────────────────────
   One control per job, the same everywhere: a pencil edits (name, country), a
   dashed chip labelled with what it adds ("+ Category", "+ Alias") adds, and
   a small × inside a chip removes it. Before, there were five different ones:
   a pencil, a ✎ glyph, a loose ×, and grey and green bordered + squares. */
.profile-edit-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 999px; opacity: 1;
  background: transparent; color: var(--text-dim); cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.profile-edit-btn:hover { background: var(--bg-elevated); color: var(--text); }
.profile-edit-btn svg { width: 14px; height: 14px; display: block; }
.secondary-cat-add-btn, .alias-add-btn {
  width: auto; height: auto; display: inline-flex; align-items: center;
  padding: 1px 8px; border: 1px dashed color-mix(in srgb, var(--text) 24%, var(--border));
  background: transparent; color: var(--text-muted);
  font: inherit; font-size: .76rem; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.secondary-cat-add-btn { border-radius: 6px; }   /* the shape of the category chips */
.alias-add-btn { border-radius: 999px; }        /* the shape of the alias chips */
.secondary-cat-add-btn:hover, .alias-add-btn:hover {
  background: var(--bg-elevated); color: var(--text); border-style: solid; border-color: var(--border);
}
/* The category's × sits inside its chip's right end. */
.modal--edit-mode .cat-slot > .category-badge { padding-right: 1.55rem; }
.cat-slot > .secondary-cat-clear-btn {
  margin-left: -1.45rem; width: 1.15rem; height: 1.15rem; padding: 0; justify-content: center;
  border-radius: 4px; opacity: .7; color: inherit; font-size: .9rem;
}
.cat-slot > .secondary-cat-clear-btn:hover { opacity: 1; color: inherit; background: color-mix(in srgb, var(--text) 10%, transparent); }
.alias-tag-custom { gap: 2px; padding-right: 4px; }
.alias-remove-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem;
  border-radius: 999px; font-size: .85rem; opacity: .6;
}
.alias-remove-btn:hover { opacity: 1; background: color-mix(in srgb, var(--text) 10%, transparent); }
/* The new-alias field is a chip in the same type as the others. */
.alias-inline-input-wrap { border-style: dashed; }
.alias-inline-input { font-family: inherit; font-size: .76rem; color: var(--text); height: auto; line-height: 1.5; width: 12rem; }
.view-title-row { gap: .5rem; }
.view-title-row .profile-edit-btn { margin-left: -.2rem; }
.country-row { gap: .35rem; }
/* The title row reads: name, category, attribution. A little more space before
   the attribution, which is a different kind of fact from the category. */
.view-title-row > #view-country-container { margin-left: .25rem; }
/* In edit mode the name and the country pill are themselves the way in: a soft
   highlight on hover (drawn as a shadow, so nothing moves) says they're live,
   and a click opens the same editor as the pencil. */
.modal--edit-mode #view-name { cursor: text; border-radius: 6px; transition: background-color .15s ease-out, box-shadow .15s ease-out; }
.modal--edit-mode #view-name:hover { background: var(--bg-elevated); box-shadow: 0 0 0 5px var(--bg-elevated); }
.modal--edit-mode #view-country-display { cursor: pointer; transition: box-shadow .15s ease-out; }
.modal--edit-mode #view-country-display:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--cty) 35%, transparent); }
/* Editors sit where the thing they edit was: the name's field is the name's
   size, the country's the pill's height. Enter saves, Escape cancels. */
.profile-name-edit-row .form-input-sm#profile-name-input {
  min-width: 16rem; height: 2.4rem; padding: 0 .6rem; border-radius: 8px;
  font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em;
}
.country-edit { gap: .35rem; }
#view-country-input { height: 1.75rem; width: 11rem; padding: 0 .55rem; border-radius: 6px; font-size: .82rem; }
.country-edit .btn-sm, .profile-name-edit-row .btn-sm { height: 1.75rem; padding: 0 .65rem; font-size: .8rem; }
.profile-name-edit-row .btn-sm { height: 2.1rem; }
/* Category badges take their colour from badgeStyle() in app.js. */
.category-badge-secondary { background: transparent !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 38%, transparent); }
.category-badge { font-size: .76rem; font-weight: 500; border-radius: 6px; padding: 2px 8px; letter-spacing: 0; text-transform: none; }
.country-tag {
  font-size: .76rem; font-weight: 500; border-radius: 6px; padding: 2px 8px; border: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cty) 11%, var(--bg-surface)), color-mix(in srgb, var(--cty2) 18%, var(--bg-surface)));
  color: var(--cty-ink);
}
.country-tag.country-unknown { background: var(--bg-elevated); color: var(--text-muted); font-style: normal; }
/* Attribution confidence inside a profile's country tag: an inset segment of the
   tag rather than a bordered capsule laid over it. Same 2px inset on three
   sides, so its 4px corners sit concentric with the tag's 6px. The level is in
   the text colour; Low is muted rather than red, because low confidence is
   uncertainty, not bad news (red is kept for that). */
#view-country-display:has(.confidence-badge) { padding-top: 2px; padding-bottom: 2px; padding-right: 2px; }
#view-country-display .confidence-badge {
  align-self: stretch; display: inline-flex; align-items: center; margin-left: .15rem;
  padding: 0 6px; border: 0; border-radius: 4px;
  font-size: .7rem; font-weight: 600; line-height: 1;
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}
#view-country-display .confidence-badge.confidence-high   { color: var(--ok); }
#view-country-display .confidence-badge.confidence-medium { color: var(--warn); }
#view-country-display .confidence-badge.confidence-low    { color: var(--text-muted); }
.btn-view-density { border-color: var(--border); background: var(--bg-surface); color: var(--text); transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out, filter .15s ease-out, transform .1s ease-out, width .18s ease; }
.btn-view-density[data-level="1"], .btn-view-density[data-level="2"] { border-color: transparent; background: var(--pill); box-shadow: var(--pill-shadow); color: var(--text); }

/* ── Dialogs ────────────────────────────────────────────────────────────────── */
.modal-overlay.modal-visible { background: rgba(11, 13, 18, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body:not(.light) .modal-overlay.modal-visible { background: rgba(0, 0, 0, .55); }
.modal { border-radius: 16px; border-color: var(--border); box-shadow: 0 24px 70px rgba(16,24,40,.22), 0 2px 6px rgba(16,24,40,.08); }
body:not(.light) .modal { background: #17171a; box-shadow: 0 24px 70px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05); }
.modal-header { padding: 22px 26px 18px; border-bottom-color: var(--border); }
.modal-header h2 { font-size: 1.1rem; }
#view-name { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }

/* Profile header and footer: frosted like the app header, with the profile
   scrolling under both. They're lifted out of flow over the ends of the
   scroller, and its contents are padded by their heights (--view-header-h,
   --view-footer-h, published by syncViewHeaderHeight() in app.js). So at rest
   nothing moves. The header's is its *expanded* height, so when the alias row
   collapses the header shrinks over the content instead of dragging it up. The
   opaque fill is the fallback: without a backdrop-filter, text showing through
   a bar is worse than a solid one.
   Thinner and less blurred than the app header's glass: what passes under the
   app header is coloured cards, but here it's mostly body text, which at that
   setting averages away to nothing. This keeps it as soft lines, not words. */
#modal-view .modal { position: relative; }
#modal-view .modal-header,
#modal-view .modal-footer {
  position: absolute; left: 0; right: 0; z-index: 2;
  border-radius: inherit;
  background: var(--bg-surface);
}
#modal-view .modal-header { top: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
#modal-view .modal-footer { bottom: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
body:not(.light) #modal-view .modal-header,
body:not(.light) #modal-view .modal-footer { background: #17171a; }
#modal-view .modal-scroll {
  padding-top: calc(var(--view-header-h, 0px) + 1.1rem);
  padding-bottom: calc(var(--view-footer-h, 0px) + 1.1rem);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #modal-view .modal-header,
  #modal-view .modal-footer {
    background: color-mix(in srgb, var(--bg-surface) 68%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.7);
            backdrop-filter: blur(10px) saturate(1.7);
  }
  body:not(.light) #modal-view .modal-header,
  body:not(.light) #modal-view .modal-footer { background: color-mix(in srgb, #17171a 70%, transparent); }
}
.modal-footer { border-top-color: var(--border); padding: 14px 26px; }

/* Profile pop-up sections: a chevron and a heading, no grey bar. */
.profile-section > details > summary { background: none; padding: 4px 0; border-radius: 0; }
.profile-section > details > summary h3, .profile-section h3 { font-size: .95rem; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--text); }
.profile-section > details > summary h3::after { border-left-color: var(--text-dim); }
/* The side column's sections (Recent Victims, Latest News) are each their own
   panel with a gap between, not one shared panel they ran together in. */
.profile-col-side { gap: 12px; }
.profile-col-side > .profile-section { background: color-mix(in srgb, var(--bg-elevated) 55%, var(--bg-surface)); border-radius: 12px; padding: 12px 16px; }
/* Dark: a step above the window (#17171a), as light mode's panels sit just off its white. */
body:not(.light) .profile-col-side > .profile-section { background: var(--bg-elevated); }
.profile-text { font-size: .92rem; line-height: 1.65; }
.inline-refs summary.refs-summary { display: inline-flex; width: fit-content; padding: 3px 10px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-muted); font-size: .8rem; }
.references-list a { color: var(--brand); }
/* The tabs were pulled up and down by the old grey bar's 0.35rem padding to fill
   it; the bar is gone (4px padding now), so that left the fixed-height tabs
   riding high. Centre everything in the row instead: heading, tabs, chevron. */
#victims-details > summary { align-items: center; }
#victim-region-tabs { gap: 2px; margin-top: 0; margin-bottom: 0; align-items: center; }
.victim-region-tab { height: var(--ctl-inner); padding: 0 .7rem; font-size: .8rem; text-transform: none; }
.profile-victims-name { font-weight: 500; }
.profile-victims-meta { color: var(--text-muted); }
.profile-victims-nocountry { color: var(--text-dim); }
.news-source-badge { font-size: .74rem; font-weight: 500; border-radius: 5px; background: var(--bg-elevated); border: 0; color: var(--text-muted); padding: 1px 7px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.profile-news-title:hover { color: var(--brand); }

/* ── Actor News ─────────────────────────────────────────────────────────────── */
/* The list sits on the page, not in a panel: hairlines between articles, a
   faint fill on hover, and the open article lifts as a card. */
.news-article {
  background: transparent; border: 0; border-radius: 10px; padding: 14px 16px; position: relative;
  transition: background-color .15s ease-out, box-shadow .18s ease-out, transform .18s ease-out;
}
.news-article + .news-article::before { content: ''; position: absolute; left: 16px; right: 16px; top: -1px; border-top: 1px solid var(--border); }
.news-article:hover { border: 0; box-shadow: none; background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.news-article.selected { background: var(--lift); border: 0; box-shadow: var(--lift-shadow); transform: translateY(-1px); z-index: 1; }
.news-article:hover::before, .news-article:hover + .news-article::before,
.news-article.selected::before, .news-article.selected + .news-article::before { opacity: 0; }
.news-article-unread .news-article-meta::before { background-color: var(--brand); background-image: var(--g6); }
.news-article-title { font-size: .98rem; font-weight: 600; letter-spacing: -.005em; }
.news-article-desc { color: var(--text-muted); }
.news-article-url { color: var(--text-dim); }
.news-actor-link {
  font-size: .76rem; font-weight: 500; padding: 1px 8px; border-radius: 6px; text-decoration: none !important;
  background: linear-gradient(90deg, color-mix(in srgb, var(--grp) 12%, var(--bg-surface)), color-mix(in srgb, var(--grp2) 19%, var(--bg-surface)));
  color: var(--grp-ink) !important;
}
.news-panel { border-radius: 12px; border-color: var(--border); }
/* The list scrolls inside its own box, which clipped the lifted card's shadow.
   Room for the shadow inside the scroller, pulled back out with a negative
   margin so the cards stay where they were. */
.news-list { padding: 6px 18px 1.5rem 14px; margin-left: -14px; }
/* The divider is a short grip, centred; the whole strip still drags. */
.news-divider { width: 20px; }
.news-divider::after {
  top: 50%; bottom: auto; height: 44px; width: 4px;
  transform: translate(-50%, -50%); border-radius: 999px;
  background: var(--border);
  transition: background-color .15s ease-out, height .18s cubic-bezier(.2,.8,.2,1);
}
.news-divider:hover::after, .news-divider.dragging::after { background: var(--brand); height: 64px; }

/* ── Trend cards: the Countries-hit tooltip ────────────────────────────────── */
/* The panel clips its overflow, so the in-card copy never shows; app.js floats a
   copy at page level on hover (bindTrendCardTooltips). No help cursor: the card
   shows its detail on hover without asking. */
.trend-card.has-tooltip { cursor: default; }
.trend-card.has-tooltip:hover .trend-card-tooltip:not(.is-floating) { display: none; }
.trend-card-tooltip.is-floating {
  position: fixed; display: block; z-index: 1000; max-width: 280px; pointer-events: none;
  border-radius: 12px; box-shadow: var(--float-shadow);
}

/* ── AI reports ─────────────────────────────────────────────────────────────── */
/* List: rows on the page, lifting on hover, like the other lists. */
.reports-table { gap: 2px; max-width: 1000px; }
.report-row { background: transparent; border: 0; border-radius: 10px; padding: 14px 14px; position: relative; transition: background-color .15s ease-out, box-shadow .18s ease-out, transform .18s ease-out; }
.report-row + .report-row::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; border-top: 1px solid var(--border); }
.report-row:hover { background: var(--lift); border: 0; box-shadow: var(--lift-shadow); transform: translateY(-1px); }
.report-row:hover::before, .report-row:hover + .report-row::before { opacity: 0; }
.report-row-title { font-size: .98rem; font-weight: 600; }
.report-status { background: transparent !important; padding: 0; gap: 6px; }
.report-status-ready { color: var(--grp-ink); }
.report-status-ready::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--grp); display: inline-block; margin-right: 6px; vertical-align: 1px; }
.report-status-analysing { color: var(--brand); }
.report-status-error { color: var(--bad); }

/* Report: the AI's changes carry a faint brand wash, never a dashed edge;
   your own edits a darker border. The original column is reference only. */
:root, body.light {
  --ai-tint: color-mix(in srgb, var(--brand) 7%, var(--bg-surface));
  --ai-border: color-mix(in srgb, var(--brand) 30%, var(--border));
  --ai-text: var(--brand);
  --user-edit-tint: var(--bg-surface);
}
.report-title-input { font-weight: 600; letter-spacing: -.02em; border-radius: 8px; }
.report-card { border-radius: 10px; }
.report-card-orig { background: transparent; border-style: dashed; border-color: var(--border); }
.report-card-edit:focus-within { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.rc-input, .rc-country-host .filter-dropdown-trigger, .rc-sector-host .filter-dropdown-trigger { background: var(--bg-surface); border-radius: 8px; }
.rc-input.rc-ai, .rc-select.rc-ai, .rc-country-host.rc-ai .filter-dropdown-trigger, .rc-sector-host.rc-ai .filter-dropdown-trigger {
  border-style: solid; border-color: transparent;
  background-color: color-mix(in srgb, var(--brand) 7%, var(--bg-surface));
  background-image: radial-gradient(70% 160% at 100% 0%, color-mix(in srgb, var(--brand2) 14%, transparent), transparent 65%);
}
.rc-input.rc-edited:not(.rc-ai), .rc-select.rc-edited:not(.rc-ai) { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.rc-reset-btn { border: 0; background: transparent; color: var(--text-muted); border-radius: 7px; }
.rc-reset-btn:hover { background: var(--bg-elevated); color: var(--text); }

/* Assistant chat */
.report-chat { border-color: var(--border); }
.report-chat-header { font-weight: 600; font-size: .92rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.report-msg { border-radius: 12px; font-size: .88rem; line-height: 1.55; }
.report-msg-ai { background: transparent; border: 0; padding-left: 28px; position: relative; }
.report-msg-ai::before { content: ''; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 6px; background-color: var(--brand); background-image: var(--g6); }
.report-msg-user { background: var(--bg-elevated); color: var(--text); border-radius: 12px 12px 4px 12px; border: 0; }
.report-msg-proposals { display: inline-flex; margin-top: 6px; font-style: normal; font-size: .8rem; font-weight: 500; color: var(--brand); }
.report-chat-textarea { border-radius: 10px; border-color: var(--border); background: var(--bg-surface); }
.report-chat-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.report-chat-send { background-color: var(--brand) !important; background-image: var(--g6) !important; color: #fff !important; border: 0 !important; border-radius: 10px; }

/* ── Topics: list ───────────────────────────────────────────────────────────── */
/* More air and a hairline between topics; the trend's timeline colour as a dot;
   one quiet meta line (momentum · severity · updates · last seen). */
.tp-list { gap: 1.2rem; }
.tp-group { gap: 0; }
.tp-group-title { font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); margin: 0 0 .3rem .75rem; }
/* Every group folds under its heading; the chevron at the right points down when
   open and right when closed. The whole heading is the control. */
.tp-fold > summary {
  display: flex; align-items: center; gap: .25rem; margin: 0 0 .1rem; padding: .35rem .75rem;
  border-radius: 8px; cursor: pointer; list-style: none; transition: color .15s ease-out, background-color .15s ease-out;
}
.tp-fold > summary::-webkit-details-marker { display: none; }
.tp-fold > summary::after {
  content: ''; margin-left: auto; width: 6px; height: 6px; opacity: .75;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .18s ease-out;
}
.tp-fold:not([data-open]) > summary::after { transform: rotate(-45deg); }   /* follows the click, not the end of the fold */
.tp-fold > summary:hover { color: var(--text); background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.tp-fold > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .tp-fold > summary::after { transition: none; } }
@media (max-width: 768px) { .tp-fold > summary { min-height: 2.75rem; } }   /* a full-size tap target */
.tp-row {
  position: relative; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; row-gap: .3rem;
  padding: .85rem .75rem; border: 0; border-radius: 10px; transition: background-color .15s ease-out, box-shadow .18s ease-out;
}
.tp-row:hover { background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
/* No dividers between rows: a little space instead, so each hover and selection reads as its own. */
.tp-row + .tp-row, .tp-row + .tp-row-wrap, .tp-row-wrap + .tp-row-wrap, .tp-row-wrap + .tp-row { margin-top: 4px; }
/* A round "→" to the topic page: bottom right of the row, under the sparkline and
   clear of the text; shown on hover or keyboard focus, always on touch. */
.tp-row-wrap { position: relative; }
.tp-row-wrap .tp-row-meta, .tp-row-wrap .tp-row-missing { padding-right: 2.4rem; }   /* the button's corner stays clear */
.tp-row-open {
  position: absolute; right: .6rem; bottom: .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  border-radius: 999px; color: var(--accent);
  background: var(--bg-surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  opacity: 0; transform: translateY(2px); pointer-events: none;
  transition: opacity .15s ease-out, transform .15s ease-out, background-color .15s ease-out;
}
.tp-row-wrap:hover .tp-row-open, .tp-row-wrap:focus-within .tp-row-open { opacity: 1; transform: none; pointer-events: auto; }
.tp-row-open:hover { background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface)); }
.tp-row-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
@media (hover: none) { .tp-row-open { opacity: 1; transform: none; pointer-events: auto; } }
@media (prefers-reduced-motion: reduce) { .tp-row-open { transition: none; } }
.tp-row.is-selected { background: var(--pill); box-shadow: var(--lift-shadow); }
.tp-row.is-selected .tp-row-name { color: var(--text); }
.tp-row-name { grid-column: 1; font-size: .9rem; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-row-meta { grid-column: 1 / -1; align-items: center; gap: .1rem 0; font-size: .76rem; color: var(--text-dim); }
.tp-row-week { color: var(--text-muted); font-weight: 500; }
/* The sort menu sits above the rows it orders, its panel opening down from the
   left edge. "Group by stage" is a toggle, so it carries a tick when on. */
.tp-sort { align-self: flex-start; }
#tp-sort-dropdown .filter-dropdown-panel { left: 0; right: auto; min-width: 210px; z-index: 5; }
.tp-sort-extra { border-top: 1px solid var(--border); }
.tp-sort-group::before { content: '✓'; display: inline-block; width: 1.1em; visibility: hidden; }
.tp-sort-group.selected::before { visibility: visible; }
@media (max-width: 1024px) { .tp-side:not(.is-open) > .tp-sort { display: none; } }
/* Twelve weeks of activity at the row's right edge, beside the name; the meta
   line runs the full width under both. */
.tp-spark { grid-column: 2; grid-row: 1; align-self: center; display: block; line-height: 0; }
.tp-spark svg { display: block; overflow: visible; }
.tp-spark-line { fill: none; stroke: var(--text-dim); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: .7; }
.tp-spark-now { fill: var(--brand); }
.tp-row.is-selected .tp-spark-line, .tp-row:hover .tp-spark-line { opacity: 1; }
.tp-row-meta > * + *::before { content: '·'; margin: 0 .45rem; opacity: .6; color: var(--text-dim); }
.tp-mom { font-weight: 500; }
.tp-mom-rising { color: var(--bad); }
.tp-mom-cooling { color: var(--grp-ink); }
.tp-req-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.tp-side-title { font-size: 1.1rem; font-weight: 600; }

/* ── Topics: the subnav ─────────────────────────────────────────────────────── */
/* The same bar as the other views: the list filter on the left, the timeline
   switch and (admins) Add topic on the right. The list and the reader are pinned
   below it, so they start the bar's height further down. */
#view-topics { --tp-subnav-h: calc(3.65rem + 1px); }
.tp-controls { display: flex; align-items: center; gap: .5rem; padding: .8rem var(--tp-gutter); }
.tp-controls-end { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tp-controls .tp-search { order: 0; width: 220px; }   /* the shared pill is order 5, for the Victims bar */
/* The timeline switch reads like the Full/Compact switch: on, it floats as a pill. */
.tp-evtl-toggle { display: inline-flex; align-items: center; gap: .45rem; color: var(--text); }
.tp-evtl-toggle.active { border-color: transparent; background: var(--pill); box-shadow: var(--pill-shadow); color: var(--text); }
.tp-evtl-toggle svg { color: var(--text-muted); }
.tp-evtl-toggle.active svg { color: var(--brand); }
.tp-req-add { height: var(--ctl-h); border-radius: var(--radius-sm); }
/* Feed status sits after the search, quiet; a failed refresh follows on the same line. */
.tp-controls .tp-feed-meta { min-width: 0; font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-controls .tp-feed-warn { display: inline; margin: 0 0 0 .5rem; }
/* Desktop: the bar uses the page's own three columns, so the search is exactly as
   wide as the topic list under it and the feed status starts where the updates
   column does. Keep the columns and gap in step with .tp-layout (styles.css). */
@media (min-width: 1025px) {
  .tp-controls { display: grid; grid-template-columns: minmax(230px, 0.85fr) minmax(0, 1.6fr) minmax(0, 1.22fr); column-gap: 1.5rem; }
  .tp-controls .tp-search { width: 100%; }
  .tp-controls-end { justify-self: end; margin-left: 0; }
}
/* Desktop: no "Topics" heading over the list (the subnav and the list say what
   this is), so All updates, the first month and the reader all start on one
   line. Tablets and phones keep it: it labels the button that folds the list. */
@media (min-width: 1025px) { .tp-side-head { display: none; } }
.tp-stream-head:empty + .tp-updates > .tp-month:first-child { margin-top: 0; line-height: 1; }
/* The middle column's head: only for a selected topic, and no rule under it. */
.tp-stream-head { border-bottom: 0; }
/* The brief: a full-width box at the top of the page, above the timeline and
   the three columns. Bottom line first, then the sections side by side as
   tinted panels, lead first, the tint fading left to right so the order reads
   at a glance; every panel is set the same, so the tint alone carries it. The
   prose (bottom line and section text) is serif, titles stay in Geist. --cols (set from the section count) keeps a row of four or
   five from leaving one panel alone on a second row. */
.tp-brief-wrap { padding: 1rem var(--tp-gutter) 0; }
/* The Brief switch in the subnav folds it away: the same grid-row collapse as
   the timeline, the box and its top gap together. */
#tp-brief, #vn-brief, #ir-add {
  display: grid; grid-template-rows: 1fr; opacity: 1;
  transition: grid-template-rows .35s ease, opacity .3s ease, padding-top .35s ease;
}
#tp-brief[hidden], #vn-brief[hidden], #ir-add[hidden] { display: none; }
#tp-brief > *, #vn-brief > *, #ir-add > * { min-height: 0; overflow: hidden; transition: padding .35s ease, border-width .35s ease; }
#tp-brief.collapsed, #vn-brief.collapsed, #ir-add.collapsed { grid-template-rows: 0fr; opacity: 0; padding-top: 0; pointer-events: none; visibility: hidden; }
#tp-brief.collapsed > *, #vn-brief.collapsed > *, #ir-add.collapsed > * { padding-top: 0; padding-bottom: 0; border-width: 0; }   /* the box's own padding folds too */
#tp-brief.no-transition > *, #vn-brief.no-transition > *, #ir-add.no-transition > * { transition: none; }
#tp-brief.no-transition, #vn-brief.no-transition, #ir-add.no-transition { transition: none; }
@media (prefers-reduced-motion: reduce) { #tp-brief, #vn-brief, #ir-add { transition: none; } }
/* Opening a brief section scrolls the columns to the top, clear of the sticky subnav. */
#view-topics .tp-layout { scroll-margin-top: calc(var(--subnav-h, 0px) + .25rem); }
.tp-brief {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 22px 18px;
}
body:not(.light) .tp-brief { background: color-mix(in srgb, var(--bg-elevated) 55%, var(--bg)); }
.tp-brief-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.tp-brief-heading { display: flex; align-items: baseline; gap: .1rem .75rem; flex-wrap: wrap; min-width: 0; }
.tp-brief-title { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.tp-brief-when { font-size: .76rem; color: var(--text-dim); }
/* Equal-width buttons over one pill (the thumb) that slides to the chosen
   period: --n buttons, --i the chosen one, both set inline. The switch is
   kept across a period change (tpRenderBrief), so the move animates. */
.tp-brief-periods {
  position: relative; display: inline-grid; grid-template-columns: repeat(var(--n, 3), 1fr);
  padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}
.tp-brief-period-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 3));
  border-radius: 7px; background: var(--pill); box-shadow: var(--pill-shadow);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.tp-brief-period {
  position: relative; z-index: 1;
  font: inherit; font-size: .76rem; font-weight: 500; color: var(--text-muted); background: transparent;
  border: 0; border-radius: 7px; height: var(--ctl-inner); padding: 0 13px; cursor: pointer; transition: color .2s ease-out;
}
.tp-brief-period:hover { color: var(--text); }
.tp-brief-period.is-on { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tp-brief-period-thumb { transition: none; } }
.tp-brief-period:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tp-brief-bluf { margin: .7rem 0 0; font-family: var(--font-serif); font-size: 1.16rem; font-weight: 500; line-height: 1.55; color: var(--text); max-width: 95ch; text-wrap: pretty; text-align: justify; }
.tp-brief-details {
  --cols: 3;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: .75rem; margin-top: 1rem;
}
.tp-brief-detail {
  --tint: 1.5%; --tint-dark: 4%; --lift: 0%;
  display: flex; flex-direction: column; padding: 14px 16px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--brand) calc(var(--tint) + var(--lift)), var(--bg-surface));
}
.tp-brief-detail:nth-child(1) { --tint: 6%;   --tint-dark: 13%; }
.tp-brief-detail:nth-child(2) { --tint: 4%;   --tint-dark: 9%; }
.tp-brief-detail:nth-child(3) { --tint: 2.5%; --tint-dark: 6%; }
body:not(.light) .tp-brief-detail { background: color-mix(in srgb, var(--brand) calc(var(--tint-dark) + var(--lift) * 1.5), transparent); }
.tp-brief-detail-title { margin: 0; font-size: .9rem; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.tp-brief-detail-text { margin: .35rem 0 0; font-family: var(--font-serif); font-size: .95rem; line-height: 1.55; color: var(--text); text-wrap: pretty; }
/* A panel opens the topic it's mostly about (tpOpenBriefTopic): the tint
   deepens a step under the pointer, like a row in the list. */
.tp-brief-detail[data-brief-topic] { cursor: pointer; transition: background-color .15s ease-out; }
.tp-brief-detail[data-brief-topic]:hover { --lift: 3%; }
.tp-brief-detail[data-brief-topic]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tp-brief-foot { margin: .9rem 0 0; font-size: .74rem; color: var(--text-dim); }
@media (max-width: 1024px) { .tp-brief-details { grid-template-columns: repeat(var(--cols-narrow, 2), minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .tp-brief { padding: 16px 16px 14px; }
  .tp-brief-bluf { font-size: 1.08rem; }
  .tp-brief-details { grid-template-columns: minmax(0, 1fr); }
}
.tp-stream-head:empty { display: none; }
/* A selected topic's AI summary, in the brief's style: a serif bottom line,
   the rest in serif below, on the brief's lead tint; a quiet caption says it's
   AI-written. */
.tp-head-summary {
  max-width: 78ch; margin: .35rem 0 0; padding: 14px 18px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--bg-surface));
}
body:not(.light) .tp-head-summary { background: color-mix(in srgb, var(--brand) 13%, transparent); }
.tp-head-summary-lead { margin: 0; font-family: var(--font-serif); font-size: 1.08rem; font-weight: 500; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.tp-head-summary-rest { margin: .4rem 0 0; font-family: var(--font-serif); font-size: .95rem; line-height: 1.58; color: var(--text); text-wrap: pretty; }
/* The second paragraph (what is changing, or what to do) starts a new block. */
.tp-head-summary-para { margin-top: .75rem; }
/* At the top of a topic or vulnerability page the summary is the main read:
   larger serif, more room, the line held to a comfortable measure. */
.tp-head-summary-primary { max-width: 68ch; margin: 1rem 0 1.25rem; padding: 20px 24px 20px; border-radius: 14px; }
.tp-head-summary-primary .tp-head-summary-lead { font-size: 1.3rem; line-height: 1.45; letter-spacing: -.005em; }
.tp-head-summary-primary .tp-head-summary-rest { font-size: 1.02rem; line-height: 1.65; margin-top: .55rem; }
.tp-head-summary-primary .tp-head-summary-para { margin-top: .9rem; }
@media (max-width: 640px) {
  .tp-head-summary-primary { padding: 16px 16px; }
  .tp-head-summary-primary .tp-head-summary-lead { font-size: 1.16rem; }
}
.tp-head-row { align-items: flex-start; flex-wrap: nowrap; }
.tp-head-title { flex: 1; min-width: 0; }
.tp-head-row .btn { flex: none; }
@media (min-width: 1025px) {
  .tp-reader { top: calc(var(--tp-subnav-h) + 1rem); }
  /* The list's box starts 14px above its rows (room for the first row's shadow),
     so it pins 14px higher and runs 14px taller: rows line up with the reader. */
  .tp-side { top: calc(var(--tp-subnav-h) + 1rem - 14px); max-height: calc(100vh - 88px - var(--tp-subnav-h) + 14px); }
  .tp-reader { height: calc(100vh - 88px - var(--tp-subnav-h)); }
}
/* Phones: the same touch-height row as the other views' bars, the switch icon-only. */
@media (max-width: 768px) {
  .tp-controls { padding: .55rem .75rem; flex-wrap: wrap; row-gap: .4rem; }
  .tp-controls .tp-feed-meta { order: 3; flex-basis: 100%; white-space: normal; }   /* its own line under the controls */
  .tp-controls .tp-search { flex: 1; min-width: 0; width: auto; height: 2.75rem; }
  .tp-evtl-toggle, .tp-req-add { height: 2.75rem; flex-shrink: 0; }
  .tp-evtl-toggle { padding: 0 .8rem; }
  .tp-evtl-toggle-label { display: none; }
}
/* The timeline's heading sits inside the part that folds, so it goes with the chart. */
.tp-evtl { transition: padding-top .35s ease; }
.tp-evtl.is-collapsed { padding-top: 0; }
.tp-evtl:has(.no-transition) { transition: none; }
@media (prefers-reduced-motion: reduce) { .tp-evtl { transition: none; } }
/* The list scrolls inside its own box on desktop, which cut the selected row's
   shadow off at both sides. Room for it inside the scroller, pulled back out
   with a negative margin so the rows stay where they were (as .news-list). */
@media (min-width: 1025px) { .tp-side { padding-inline: 14px 12px; margin-inline: -14px 0; } }
/* Not on the right, though: pulled out into the column gap, the
   scrollbar sat against the middle column's text. Flush with the column, it
   keeps the whole gap. It also shows only while the list is being scrolled
   (.is-scrolling, set by tpBindScrollbarFade), so it never sits beside the
   rows at rest. */
.tp-side { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.tp-side.is-scrolling { scrollbar-color: color-mix(in srgb, var(--text-dim) 55%, transparent) transparent; }
.tp-side::-webkit-scrollbar { width: 8px; }
.tp-side::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.tp-side.is-scrolling::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-dim) 55%, transparent); }
/* With no heading above it, the first row's shadow needs the same room on top
   (pinned position and height allow for it in the subnav section below). */
@media (min-width: 1025px) { .tp-side { padding-top: 14px; margin-top: -14px; } }

/* ── Topics: update cards ─────────────────────────────────────────────────── */
.tp-month { font-size: .84rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
/* Updates sit on the page with no dividers, separated by space alone; a faint
   fill on hover, and the update in the reader lifts as a card. Source quotes
   stay on the topic page; the list is headlines only. The topic list on the
   left works the same way. */
.tp-card {
  background: transparent; border: 0; border-radius: 10px; padding: 20px 16px; margin-bottom: 0;
  transition: background-color .15s ease-out, box-shadow .18s ease-out, transform .18s ease-out;
}
.tp-card:hover { border: 0; background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.tp-card.is-reading { background: var(--lift); border: 0; box-shadow: var(--lift-shadow); transform: translateY(-1px); z-index: 1; }
.tp-card-related { background: transparent; border: 0; }
.tp-card-title { font-size: 1rem; letter-spacing: -.005em; }
.tp-card-top { flex-wrap: nowrap; }
.tp-card-date { white-space: nowrap; flex: none; }
.news-source-badge { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The topic stays on the date line in every row: a long name truncates (the
   full name is its tooltip), and the related tag shrinks and wraps inside itself. */
.tp-card-trend { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "+N topics": the one marker for an update listed under more than one topic,
   wherever it's seen (tpAlsoHtml). Opens on hover or focus; a click pins it
   (.is-open) for touch. The card holding an open one rises above the next. */
.tp-also { position: relative; flex: none; display: inline-flex; }
.tp-also-btn {
  font: inherit; font-size: .7rem; font-weight: 500; line-height: 1.5; color: var(--text-muted); background: none; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--text) 22%, var(--border)); border-radius: 999px; padding: 0 7px;
  transition: color .15s ease-out, border-color .15s ease-out;
}
.tp-also-btn:hover, .tp-also.is-open .tp-also-btn { color: var(--text); border-color: color-mix(in srgb, var(--text) 40%, var(--border)); }
.tp-also-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tp-also-pop {
  position: absolute; top: 100%; left: 0; z-index: 30; padding-top: 6px;   /* the gap is part of the hover target */
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity .14s ease-out, transform .14s ease-out, visibility 0s linear .14s;
}
.tp-also:hover .tp-also-pop, .tp-also:focus-within .tp-also-pop, .tp-also.is-open .tp-also-pop {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.tp-also-panel {
  display: block; width: max-content; min-width: 240px; max-width: min(380px, 80vw); padding: 6px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--float-shadow);
}
body:not(.light) .tp-also-panel { background: #1c1c20; }
.tp-also-head { display: block; padding: 2px 8px 4px; font-size: .68rem; color: var(--text-dim); }
.tp-also-panel ul { list-style: none; margin: 0; padding: 0; }
.tp-also-panel li { display: flex; align-items: baseline; gap: .5rem; }
.tp-also-link {
  flex: 1; min-width: 0; font: inherit; font-size: .8rem; line-height: 1.35; text-align: left; color: var(--text);
  background: none; border: 0; border-radius: 6px; padding: 5px 8px; cursor: pointer;
}
.tp-also-link:hover, .tp-also-link:focus-visible { background: color-mix(in srgb, var(--bg-elevated) 85%, transparent); color: var(--brand); outline: none; }
.tp-also-home { flex: none; padding-right: 8px; font-size: .68rem; color: var(--text-dim); }
.tp-card:has(.tp-also:hover, .tp-also:focus-within, .tp-also.is-open),
.tpd-update-kicker:has(.tp-also:hover, .tp-also:focus-within, .tp-also.is-open) { position: relative; z-index: 6; }
@media (prefers-reduced-motion: reduce) { .tp-also-pop { transition: none; } }
/* Space between update cards, so a hovered card's fill never runs into the
   lifted card in the reader beside it. */
.tp-updates .tp-card + .tp-card, .vn-updates .tp-card + .tp-card { margin-top: 6px; }
.tp-card-trend, .tp-link { color: var(--brand); font-weight: 500; }
.cti-chip { font-family: inherit; font-size: .76rem; padding: 2px 8px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); }
.cti-evidence { font-style: normal !important; background: var(--bg-elevated); border: 0 !important; border-radius: 8px; padding: .65rem .85rem; color: var(--text); line-height: 1.55; }
.cti-evidence-label { font-style: normal; font-size: .74rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.cti-reader { border-radius: 12px; border-color: var(--border); }
.cti-reader-bar { border-bottom-color: var(--border); }

/* Severity, confidence and stage badges: soft tints, no borders. */
.cti-badge { border: 0 !important; border-radius: 6px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.cti-badge-danger { background: color-mix(in srgb, var(--bad) 10%, var(--bg-surface)); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.cti-badge-neutral { background: var(--bg-elevated); color: var(--text-muted); }
.tp-stage { border-radius: 6px; font-weight: 500; text-transform: none; letter-spacing: 0; background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--border); border: 0; color: var(--text); }

/* ── Topic detail ───────────────────────────────────────────────────────────── */
.tpd-title { font-size: 1.75rem; font-weight: 600; letter-spacing: -.025em; }
.tpd-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 0; margin: 1rem 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; font-size: .76rem; color: var(--text-muted); }
.tpd-metrics span { display: flex; flex-direction: column; padding: .7rem .85rem; line-height: 1.3; }
.tpd-metrics span + span { border-left: 1px solid var(--border); }
.tpd-metrics span + span::before { content: none; }
.tpd-metrics b { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
/* The AI assessment: a faint brand tint instead of a dashed box; still labelled. */
.cti-ai-panel {
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, var(--bg-surface)), var(--bg-surface) 40%);
  border-radius: 10px;
}
.cti-ai-tag { color: var(--brand); font-weight: 500; }
.tpd-rail-bar { background: linear-gradient(180deg, var(--brand2), var(--brand)); opacity: .85; border-radius: 3px 3px 1px 1px; }
.tpd-rail-bar:hover, .tpd-rail-bar:focus-visible { background: linear-gradient(180deg, var(--brand2), var(--brand)); opacity: 1; }
.tpd-rail-bar.is-empty { background: var(--empty); }
.tpd-item { border-radius: 9px; transition: background-color .15s ease-out, box-shadow .18s ease-out; }
.tpd-item.is-current { background: var(--pill); box-shadow: var(--lift-shadow); }
.tpd-item.is-current .tpd-dot { background-color: var(--brand); background-image: var(--g6); box-shadow: none; }
.tpd-tl { border-left-color: var(--border); }
/* The timeline's sticky heading (month bars) frosts like the other pinned bars,
   so items scrolling under it soften rather than being cut off at its edge. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tpd-tl-head {
    background: color-mix(in srgb, var(--bg) 68%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.7);
            backdrop-filter: blur(10px) saturate(1.7);
  }
}
/* The timeline scrolls in its own box too: room on the open sides for the
   current item's shadow, with the items left where they were. */
.tpd-tl { padding-right: 14px; margin-right: -8px; }
@media (max-width: 1024px) { .tpd-tl { padding-inline: 14px; margin-inline: -14px; } }

/* ── Settings ───────────────────────────────────────────────────────────────── */
/* The sections live in the page's subnav, one row on every screen size, styled
   like the other bars' option switches: the active section is the pill. When
   they don't fit, the row scrolls sideways instead of wrapping: the clipped
   edge fades and an arrow appears on that side (app.js, settingsBarSync). */
/* Inset to match the page below (2rem; 1rem on phones), less the row's 2px inner padding. */
.settings-bar { display: flex; align-items: center; gap: .25rem; padding: .8rem calc(2rem - 2px); }
.settings-nav {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px;
  position: relative;   /* tabs' offsetLeft is then measured within the row */
  overflow-x: auto; overscroll-behavior-x: contain; scroll-behavior: smooth; scrollbar-width: none;
  /* Room inside the scroller for the active pill's shadow, pulled back out. */
  padding: 6px 2px; margin: -6px 0;
}
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav.fade-left  { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
.settings-nav.fade-right { -webkit-mask-image: linear-gradient(to left, transparent, #000 28px); mask-image: linear-gradient(to left, transparent, #000 28px); }
.settings-nav.fade-left.fade-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
/* Account and Workspace are a hairline between the two groups, not headings. */
.settings-nav-group { flex: none; width: 1px; height: 1.1rem; margin: 0 .45rem; background: var(--border); font-size: 0; overflow: hidden; }
.settings-nav-group:first-child { display: none; }
.settings-nav-item {
  flex: none; display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  height: var(--ctl-h); padding: 0 .85rem; border-radius: 999px; font-size: .84rem; color: var(--text-muted);
  transition: background-color .15s ease-out, color .15s ease-out, box-shadow .18s ease-out;
}
.settings-nav-icon { flex: none; color: var(--text-dim); }
.settings-nav-item:hover { color: var(--text); }
.settings-nav-item.active { background: var(--pill); box-shadow: var(--pill-shadow); color: var(--text); font-weight: 500; }
.settings-nav-item.active .settings-nav-icon { color: var(--brand); }
.settings-bar-arrow {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.settings-bar-arrow[hidden] { display: none; }
.settings-bar-arrow:hover { background: var(--bg-elevated); color: var(--text); }
@media (max-width: 768px) {
  .settings-bar { padding: .55rem calc(1rem - 2px); }
}
.settings-section-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.settings-section-count, .settings-section-hint, .settings-section-subtitle { color: var(--text-muted); }
.pw-card, .profile-meta { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.feed-status-filters { background: transparent; border: 0; padding: 0; }
.pw-card-title { font-size: .95rem; font-weight: 600; }
.settings-input { height: var(--ctl-h-field); border-radius: var(--radius-sm); border-color: var(--border); background: var(--bg-surface); }
.settings-input-sm { height: var(--ctl-h-xs); }
.form-input, .form-select:not(.form-select-sm) { height: var(--ctl-h-field); }
.feed-action-btn { height: var(--ctl-h-xs); padding-block: 0; }
.settings-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); outline: 0; }
.profile-role-badge { border: 0; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, var(--bg-surface)), color-mix(in srgb, var(--brand2) 16%, var(--bg-surface))); color: var(--brand); font-weight: 500; text-transform: capitalize; }

/* Tables: no grey header band, quiet headers, hairline rows. */
.users-table thead th, .activity-log-table thead th, .feed-status-table thead th {
  background: transparent; font-weight: 500; font-size: .76rem; color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.users-table tbody td, .activity-log-table tbody td, .feed-status-table tbody td { border-bottom-color: var(--rule); }
.users-table tbody tr, .activity-log-table tbody tr, .feed-status-table tbody tr { transition: background-color .15s ease-out; }
.users-table tbody tr:hover, .activity-log-table tbody tr:hover, .feed-status-table tbody tr:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.activity-log-badge { border: 0 !important; border-radius: 6px; font-weight: 500; }
.activity-log-badge-success { background: color-mix(in srgb, var(--grp) 12%, var(--bg-surface)); color: var(--grp-ink); }
.activity-log-badge-danger  { background: color-mix(in srgb, var(--bad) 9%, var(--bg-surface)); color: var(--bad); }
.activity-log-badge-warn    { background: color-mix(in srgb, #f2b400 14%, var(--bg-surface)); color: var(--warn); }
.feed-status-pill { border: 0 !important; background: transparent !important; padding: 0; font-weight: 500; }
.feed-pill-ok { color: var(--grp-ink); }
.feed-pill-error, .feed-pill-blocked, .feed-pill-timeout { color: var(--bad); }
.feed-pill-redirect { color: var(--warn); }
.feed-pill-unknown { color: var(--text-dim); }
.feed-dot-ok { background: var(--grp) !important; }
.feed-dot-error, .feed-dot-blocked, .feed-dot-timeout { background: var(--bad) !important; }
.feed-status-ms, .feed-status-when, .users-date { font-variant-numeric: tabular-nums; }
.deleted-victim-row { border-color: var(--border); border-radius: 10px; }

/* ── Sign-in, set password, invitation ──────────────────────────────────────── */
.auth-page .auth-card {
  max-width: 400px; padding: 30px 30px 26px; border-radius: 16px; border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 40px rgba(16,24,40,.08);
}
body:not(.light) .auth-page .auth-card { background: #17171a; box-shadow: 0 12px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); }
.auth-page { flex-direction: column; gap: 20px; background: var(--bg); }
.auth-page .auth-logo { gap: .65rem; font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: 1.6rem; }
.auth-page .auth-logo svg {
  box-sizing: content-box; padding: 8px; border-radius: 10px; color: #fff; stroke: #fff;
  background-color: var(--brand); background-image: var(--g6); box-shadow: 0 1px 3px rgba(10,40,120,.18);
}
.auth-page .auth-title { font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 1.25rem; }
.auth-page .auth-label { font-size: .82rem; color: var(--text); }
.auth-page .auth-input { height: 42px; border-radius: 10px; background: var(--bg-surface); font-size: .92rem; padding: 0 12px; }
body:not(.light) .auth-page .auth-input { background: #111113; }
.auth-page .auth-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.auth-page .auth-input[readonly] { background: var(--bg-elevated); color: var(--text-muted); }
.auth-page .auth-submit { height: 44px; border-radius: 10px; font-size: .92rem; }
.auth-page .auth-error:not(:empty) { background: color-mix(in srgb, var(--bad) 7%, var(--bg-surface)); color: var(--bad); border-radius: 9px; padding: 9px 12px; }
.auth-pw { position: relative; }
.auth-pw .auth-input { padding-right: 40px; }
.auth-eye { all: unset; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--text-dim); cursor: pointer; }
.auth-eye:hover { color: var(--text); background: var(--bg-elevated); }
.auth-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.auth-foot { font-size: .8rem; color: var(--text-dim); text-align: center; max-width: 340px; }

/* ── Mobile reader sheet ──────────────────────────────────────────────────────── */
/* A sheet with a grab handle, a frosted bar of round icon buttons and the
   article set for reading. The iOS Safari rules at the end of styles.css still
   hold: the sheet and backdrop stay transparent and paint through ::before, and
   are visibility:hidden once closed. Only their colours and timings change here. */
.mobile-reader-sheet { height: calc(100% - 52px); border-radius: 18px 18px 0 0; }
.mobile-reader-sheet.open { box-shadow: 0 -10px 40px rgba(16, 24, 40, .18); }
body:not(.light) .mobile-reader-sheet.open { box-shadow: 0 -10px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255,255,255,.06); }
.mobile-reader-grab { flex: none; display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
.mobile-reader-grab span { width: 38px; height: 5px; border-radius: 999px; background: var(--border); }
body:not(.light) .mobile-reader-grab span { background: #3a3b40; }
.mobile-reader-bar {
  gap: 6px; padding: 6px 12px 10px; touch-action: none;
  background: transparent; border-bottom: 1px solid var(--border);
}
.mobile-reader-bar .btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 999px; color: var(--text-muted); flex: none; }
.mobile-reader-bar .btn-icon:hover { background: var(--bg-elevated); color: var(--text); }
.mobile-reader-bar .btn-icon:active { transform: scale(.94); }
.mobile-reader-bar .btn-reader.active { background: var(--pill); box-shadow: var(--pill-shadow); color: var(--brand); }
.mobile-reader-bar-url {
  flex: 1; min-width: 0; text-align: center; font-size: .8rem; font-weight: 500; color: var(--text-muted);
}
.mobile-reader-content {
  font-family: var(--font); font-size: 1.04rem; line-height: 1.7; padding: 1.4rem 1.25rem 3.5rem; background: transparent;
}
.mobile-reader-content .reader-title { font-size: 1.55rem; line-height: 1.22; letter-spacing: -.02em; margin-bottom: .6rem; }
.mobile-reader-content .reader-byline { font-size: .84rem; color: var(--text-muted); border-bottom-color: var(--border); padding-bottom: 1rem; margin-bottom: 1.4rem; }
.mobile-reader-content .reader-body h2, .mobile-reader-content .reader-body h3 { letter-spacing: -.01em; }
.mobile-reader-content .reader-body p { margin-bottom: 1.05rem; }
.mobile-reader-content .reader-body a { color: var(--brand); text-underline-offset: 2px; }
.mobile-reader-content .reader-body img { border-radius: 10px; }
.mobile-reader-content .reader-body blockquote { font-style: normal; border-left: 0; background: var(--bg-elevated); border-radius: 10px; padding: .75rem 1rem; color: var(--text); }
.mobile-reader-content .reader-body pre, .mobile-reader-content .reader-body code { background: var(--bg-elevated); border-radius: 6px; }
.mobile-reader-content .reader-source { border-top-color: var(--border); font-size: .8rem; color: var(--text-dim); overflow-wrap: anywhere; }
.mobile-reader-content .reader-source a { color: var(--brand); }
.mobile-reader-fallback { padding: 2rem 1.5rem; }
.news-fallback-title { letter-spacing: -.015em; }

/* The loaded article settles in. */
.reader-reveal { animation: readerReveal .24s cubic-bezier(.2,.8,.2,1) both; }
@keyframes readerReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 768px) {
  /* Open: a quick ease-out rise, no bounce. Close: a little faster. Visibility
     still waits for the slide to finish so Safari's toolbar rule holds. */
  .mobile-reader-sheet    { transition: transform .22s cubic-bezier(.4,0,1,1), visibility 0s .22s; }
  .mobile-reader-sheet.open { transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s 0s; }
  .mobile-reader-backdrop { transition: opacity .22s ease-out, visibility 0s .22s; }
  .mobile-reader-backdrop.open { transition: opacity .26s ease-out, visibility 0s 0s; }
  .mobile-reader-sheet::before { background: var(--bg-surface); }
  body:not(.light) .mobile-reader-sheet::before { background: #17171a; }
  .mobile-reader-backdrop::before {
    background: rgba(11, 13, 18, .32);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
  body:not(.light) .mobile-reader-backdrop::before { background: rgba(0, 0, 0, .55); }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-reader-sheet, .mobile-reader-sheet.open, .mobile-reader-backdrop, .mobile-reader-backdrop.open { transition-duration: 0s, 0s !important; transition-delay: 0s !important; }
  .reader-reveal { animation: none; }
}

/* ── Notification panel ─────────────────────────────────────────────────────── */
/* Desktop: two columns, actor news on the left and topic updates on the right,
   each scrolling on its own under a sticky heading. Phones keep them stacked,
   since half a phone is too narrow to read a headline. */
.notification-overlay {
  border-radius: 14px; border-color: var(--border); box-shadow: var(--float-shadow);
  transform-origin: top right; animation: notifIn .18s cubic-bezier(.2,.8,.2,1);
}
body:not(.light) .notification-overlay { background: #17171a; }
@keyframes notifIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.notification-header { padding: .85rem 1.1rem; border-bottom-color: var(--border); }
.notification-title { font-size: .95rem; }
/* Frosted, so items scrolling under the sticky heading soften instead of
   showing through it; the solid fill is the fallback without backdrop-filter. */
.notification-section-head { z-index: 2; background: var(--bg-surface); padding: .75rem 1.1rem .55rem; border-bottom: 1px solid var(--rule); }
body:not(.light) .notification-section-head { background: #17171a; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .notification-section-head {
    background: color-mix(in srgb, var(--bg-surface) 68%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.7);
            backdrop-filter: blur(10px) saturate(1.7);
  }
  body:not(.light) .notification-section-head { background: color-mix(in srgb, #17171a 70%, transparent); }
}
.notification-section-title { font-size: .84rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.notification-new { color: var(--brand); font-weight: 500; }
.notification-section-link { color: var(--brand); font-weight: 500; }
.notification-item { position: relative; padding: .8rem 1.1rem; border-bottom: 1px solid var(--rule); transition: background-color .15s ease-out; }
.notification-item:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.notification-item.unread { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.notification-item.unread .notification-item-meta::before { background-color: var(--brand); background-image: var(--g6); }
.notification-item-title { font-size: .86rem; font-weight: 500; line-height: 1.45; }
.notification-item-title:hover { color: var(--brand); text-decoration: none; }
.notification-actor {
  font-size: .74rem; font-weight: 500; padding: 1px 8px; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--grp) 12%, var(--bg-surface)), color-mix(in srgb, var(--grp2) 19%, var(--bg-surface)));
  color: var(--grp-ink);
}
.notification-trend { color: var(--brand); font-weight: 500; }
.notification-item-source { color: var(--text-dim); }
.notification-empty { color: var(--text-dim); }

/* Topic updates: one row per topic, expanding to a compact list of its updates. */
.notif-topic { border-bottom: 1px solid var(--rule); }
.notif-topic.unread { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.notif-topic-head {
  display: flex; align-items: flex-start; gap: .55rem; width: 100%;
  padding: .7rem 1.1rem .7rem .8rem; background: none; border: 0; margin: 0;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: background-color .15s ease-out;
}
.notif-topic-head:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.notif-topic-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.notif-topic-chevron { flex: none; width: 14px; height: 1.35rem; display: grid; place-items: center; }
[data-notif-toggle] .notif-topic-chevron::before {
  content: ''; width: 6px; height: 6px; margin-left: -2px;
  border-right: 1.5px solid var(--text-dim); border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(-45deg); transition: transform .15s ease-out;
}
.notif-topic.open .notif-topic-chevron::before { transform: rotate(45deg); margin: -3px 0 0; }
.notif-topic-label { flex: 1; min-width: 0; font-size: .86rem; font-weight: 500; line-height: 1.35rem; }
.notif-topic-flag {
  display: inline-block; margin-right: .35rem; padding: 0 6px; border-radius: 5px;
  font-size: .68rem; font-weight: 600; line-height: 1.15rem; vertical-align: 1px;
  color: #fff; background-color: var(--brand); background-image: var(--g6);
}
.notif-topic-time { margin-left: .4rem; font-size: .74rem; font-weight: 400; color: var(--text-dim); white-space: nowrap; }
.notif-topic-count {
  flex: none; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 500;
  line-height: 1.35rem; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.notif-topic-count.is-new { color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, transparent); }

.notif-topic-body { padding: 0 1.1rem .55rem calc(.8rem + 14px + .55rem); }
.notif-update-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.notif-update {
  display: block; width: 100%; padding: .32rem 0 .32rem .7rem; margin: 0; background: none; border: 0;
  font: inherit; text-align: left; color: var(--text); cursor: pointer; border-radius: 0 6px 6px 0;
}
.notif-update:hover { background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.notif-update:hover .notif-update-title { color: var(--brand); }
.notif-update:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.notif-update-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: .8rem; line-height: 1.32; transition: color .12s ease-out;
}
.notif-update-meta {
  display: block; margin-top: 1px; font-size: .7rem; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-topic-more, .notif-topic-rest {
  display: inline-block; margin: .3rem 0 0 .7rem; padding: 0; background: none; border: 0;
  font: inherit; font-size: .74rem; font-weight: 500; color: var(--brand); cursor: pointer; text-decoration: none;
}
.notif-topic-more:hover, .notif-topic-rest:hover { text-decoration: underline; }
.notif-topic-rest { display: block; margin: 0; padding: .7rem 1.1rem; }
.notif-topic-caption { padding: .55rem 1.1rem .15rem; font-size: .74rem; color: var(--text-dim); }

@media (min-width: 769px) {
  .notification-overlay { width: min(780px, calc(100vw - 2rem)); }
  .notification-body {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden; min-height: min(420px, calc(100vh - 160px));
  }
  .notification-section { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .notification-section + .notification-section { border-top: 0; border-left: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) { .notification-overlay { animation: none; } }

/* ── Vulnerability News (#view-vulns) ─────────────────────────────────────── */
/* The Topics layout and pieces (.tp-layout, .tp-side, .tp-reader, .tp-brief,
   .tp-card, the summary panel) with its own vn- parts: the filter chips, the
   list rows, the selected vulnerability's head, "What to do" and the links. */
#view-vulns { --tp-gutter: 1.5rem; --tp-subnav-h: calc(3.65rem + 1px); }
@media (max-width: 640px) { #view-vulns { --tp-gutter: 0.9rem; } }
.vn-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.vn-filter {
  font: inherit; font-size: .76rem; font-weight: 500; color: var(--text-muted); cursor: pointer;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  transition: color .15s ease-out, background-color .15s ease-out;
}
.vn-filter:hover { color: var(--text); }
.vn-filter.is-on { color: var(--text); background: var(--pill); box-shadow: var(--pill-shadow); border-color: transparent; }
.vn-filter:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.vn-filter-n { color: var(--text-dim); font-variant-numeric: tabular-nums; margin-left: .15rem; }
.vn-list { display: flex; flex-direction: column; }
.vn-row {
  display: flex; flex-direction: column; gap: .25rem; width: 100%; text-align: left; font: inherit; color: var(--text);
  padding: .85rem .75rem; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  transition: background-color .15s ease-out, box-shadow .18s ease-out;
}
.vn-row + .vn-row { margin-top: 4px; }
.vn-row:hover { background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.vn-row.is-selected { background: var(--pill); box-shadow: var(--lift-shadow); }
.vn-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.vn-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.vn-row-name { font-size: .92rem; font-weight: 600; line-height: 1.35; min-width: 0; }
.vn-row-cves { font-size: .72rem; font-family: var(--font-mono, ui-monospace, monospace); color: var(--text-muted); overflow-wrap: anywhere; }
.vn-row-product { font-size: .74rem; color: var(--text-muted); }
.vn-row-badges, .vn-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.vn-row-badges:empty { display: none; }
.vn-row-meta { font-size: .72rem; color: var(--text-dim); }
.vn-badge {
  display: inline-flex; align-items: center; font-size: .68rem; font-weight: 600; line-height: 1.5;
  padding: 0 7px; border-radius: 999px; color: var(--text-muted); border: 1px solid var(--border);
}
.vn-badge-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.vn-badge-cvss { font-variant-numeric: tabular-nums; }
.vn-archive { margin-top: 1rem; }
.vn-archive > summary {
  cursor: pointer; list-style: none; font-size: .78rem; font-weight: 600; color: var(--text-muted);
  padding: .5rem .75rem; border-radius: 8px;
}
.vn-archive > summary::-webkit-details-marker { display: none; }
.vn-archive > summary:hover { color: var(--text); background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.vn-detail { padding-bottom: 3rem; scroll-margin-top: calc(var(--subnav-h, 0px) + .5rem); }
/* The selected vulnerability sits on one white card, like the brief, filling the
   middle column; inside it the summary and "What to do" run its full width. */
/* Topics' middle column (.tp-panel) uses the same card. */
.vn-panel, .tp-panel {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 26px 20px; min-width: 0;
}
body:not(.light) .vn-panel, body:not(.light) .tp-panel { background: color-mix(in srgb, var(--bg-elevated) 55%, var(--bg)); }
.vn-panel .tp-head-summary-primary, .vn-panel .vn-todo, .tp-panel .tp-head-summary-primary,
#tpd-body > .tp-head-summary-primary { max-width: none; }   /* the topic page: as wide as the metrics and Selected update */
@media (max-width: 640px) { .vn-panel, .tp-panel { padding: 16px 16px 14px; border-radius: 12px; } }
/* In the Topics card: the title at the vulnerability's size, no rule under the
   head (the summary panel separates it), and the update cards spaced alike. */
.tp-panel .tp-head-title { font-size: 1.5rem; letter-spacing: -.01em; line-height: 1.25; }
.tp-panel .tp-stream-head { padding-bottom: 0; margin-bottom: 0; }
.tp-panel .tp-head-summary-primary { margin-bottom: .5rem; }
.tp-panel .tp-card { padding: 16px 14px; }
@media (max-width: 640px) { .tp-panel .tp-head-title, .vn-title { font-size: 1.25rem; } }
.vn-head { display: flex; flex-direction: column; gap: .35rem; }
.vn-title { margin: .2rem 0 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.vn-cves { margin: 0; font-size: .82rem; font-family: var(--font-mono, ui-monospace, monospace); color: var(--text-muted); overflow-wrap: anywhere; }
.vn-product { margin: 0; font-size: .86rem; color: var(--text-muted); line-height: 1.45; }
/* Exploited by: one row per actor, its name then a pill listing the sources
   that name it (the "+N topics" popover, opened by hover, focus or a click). */
.vn-actors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.vn-actor { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.vn-srcs .tp-also-btn { font-size: .7rem; }
.vn-srcs .tp-also-pop { min-width: 280px; }
.vn-srcs .tp-also-panel { max-width: min(420px, 80vw); }
.vn-srcs-note { display: block; padding: 0 8px 6px; font-size: .74rem; color: var(--text-muted); line-height: 1.4; }
.vn-src-link { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; row-gap: .1rem; text-align: left; width: 100%; }
.vn-src-pub { font-weight: 600; color: var(--text); }
.vn-src-date { justify-self: end; font-size: .72rem; color: var(--text-dim); }
.vn-src-title { grid-column: 1 / -1; font-size: .76rem; color: var(--text-muted); line-height: 1.35; }
.vn-src-link:hover .vn-src-title, .vn-src-link:focus-visible .vn-src-title { color: var(--text); }
.tpd-facts .tpd-fact:has(.tp-also:hover, .tp-also:focus-within, .tp-also.is-open) { position: relative; z-index: 6; }
/* A row of chips (actors, sectors…) wraps with even gaps rather than each
   chip's own margin, so chips, links and Track buttons line up. */
.tpd-fact dd:has(> .cti-chip, > .vn-track-wrap) { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .4rem; }
.tpd-fact dd > .cti-chip { margin: 0; }
.vn-todo {
  max-width: 68ch; margin: 0 0 1.25rem; padding: 12px 16px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); background: var(--bg-surface);
}
.vn-todo-title { margin: 0 0 .25rem; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.vn-todo p { margin: 0; font-size: .95rem; line-height: 1.55; }
.vn-facts { margin: 0 0 1rem; }
.vn-section { margin-top: 1.25rem; }
.vn-updates .tp-card { padding: 16px 14px; }
.vn-updates .cti-evidence { margin: .5rem 0 .4rem; }
.vn-kind { font-size: .7rem; font-weight: 600; color: var(--text-muted); }
.vn-kind-exploitation, .vn-kind-kev, .vn-kind-ransomware { color: var(--bad); }
/* Part of a trend: one line beside the severity label. A long one is cut off
   and its end fades out (.is-cut, set by vnFitTrendLine only when it's cut). */
.vn-head .tp-head-badges { flex-wrap: nowrap; min-width: 0; }
.vn-trendline {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: .45rem;
  white-space: nowrap; overflow: hidden; font-size: .8rem; color: var(--text-muted);
}
.vn-trendline.is-cut { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.vn-trendline-label { flex: none; }
.vn-trendline-sep { flex: none; color: var(--text-dim); }
.vn-trend-link { flex: none; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.vn-trend-link:hover { text-decoration: underline; }
.vn-trend-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.vn-coverage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.vn-coverage-list li { display: flex; flex-direction: column; gap: .1rem; }
.vn-coverage-link { font-size: .88rem; font-weight: 500; }
.vn-coverage-meta { font-size: .72rem; color: var(--text-dim); }
.vn-ai-note { margin: 1.5rem 0 0; font-size: .74rem; color: var(--text-dim); display: flex; align-items: center; gap: .4rem; }
/* The link from a trend update, a news article or a profile to a tracked vulnerability. */
.vn-link-badge {
  flex: none; font: inherit; font-size: .7rem; font-weight: 600; line-height: 1.5; cursor: pointer;
  padding: 0 7px; border-radius: 999px; color: var(--bad); background: transparent;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--border));
  max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vn-link-badge::before { content: '⚠ '; }
.vn-link-badge:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.vn-link-badge:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
/* An actor chip we hold a profile for opens it. */
/* "+ Track": add an actor named here as a profile (analysts and admins). Each
   chip and its button sit together; a little more space follows the pair, so
   the button reads as belonging to the chip before it. */
.vn-track-wrap { display: inline-flex; align-items: center; gap: .3rem; margin-right: .3rem; }
.vn-track-wrap > .cti-chip { margin: 0; }
.vn-track {
  font: inherit; font-size: .72rem; font-weight: 600; line-height: 1.45; cursor: pointer;
  padding: 2px 8px; border-radius: 999px; color: var(--accent); background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  transition: background-color .15s ease-out;
}
.vn-track:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.vn-track:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cti-chip-link { cursor: pointer; text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cti-chip-link:hover { color: var(--accent); }

/* "This week in vulnerabilities": the bottom line, then the hottest three (and
   any other point of the brief) as rows of name, CVSS and status beside one
   line (vnBriefHtml). A row selects its vulnerability. */
.vn-brief-label { margin: .9rem 0 .15rem; padding-top: .75rem; border-top: 1px solid var(--border-soft); font-size: .72rem; color: var(--text-dim); }
.vn-brief-rows + .vn-brief-label { margin-top: .5rem; }
.vn-brief-rows { list-style: none; margin: 0 -.5rem; padding: 0; }
.vn-brief-row {
  display: grid; grid-template-columns: minmax(12rem, 19rem) minmax(0, 1fr); gap: .3rem 1.5rem; align-items: baseline;
  padding: .55rem .5rem; border-radius: 8px;
}
.vn-brief-row + .vn-brief-row { border-top: 1px solid var(--border-soft); }
.vn-brief-row[data-vuln-id] { cursor: pointer; }
.vn-brief-row[data-vuln-id]:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.vn-brief-row[data-vuln-id]:hover .vn-brief-name b { color: var(--brand); }
.vn-brief-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.vn-brief-name { min-width: 0; }
.vn-brief-name b { font-size: .9rem; font-weight: 600; }
.vn-brief-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .3rem; }
.vn-brief-cvss { margin-right: .2rem; font-size: .72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.vn-brief-tag { display: inline-flex; padding: .1rem .5rem; border-radius: 999px; background: var(--bg-elevated); font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.vn-brief-tag.is-bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.vn-brief-text {
  margin: 0; font-family: var(--font-serif); font-size: .92rem; line-height: 1.5; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 1100px) { .vn-brief-row { grid-template-columns: minmax(0, 1fr); } }

/* ── Reports (#view-intel-reports) ──────────────────────────────────────────── */
/* Threat reports filed by country: the Topics layout (.tp-layout, .tp-side,
   .tp-panel, .tp-reader) with the countries on the left, that country's
   reports on the white card in the middle, and an in-page reader on the right
   (the report's own text, not a framed site). The Add report panel at the top
   folds like the brief (#ir-add joins the brief fold rules above). */
#view-intel-reports { --tp-gutter: 1.5rem; --tp-subnav-h: calc(3.65rem + 1px); }
@media (max-width: 640px) { #view-intel-reports { --tp-gutter: 0.9rem; } }
.ir-add-toggle .tp-evtl-toggle-label { white-space: nowrap; }

/* Add report */
.ir-add-box {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
}
body:not(.light) .ir-add-box { background: color-mix(in srgb, var(--bg-elevated) 55%, var(--bg)); }
.ir-add-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 768px) { .ir-add-grid { grid-template-columns: minmax(0, 1fr); } }
.ir-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  min-height: 9.5rem; padding: 14px; border-radius: 12px; color: var(--text-muted);
  border: 1.5px dashed color-mix(in srgb, var(--text-dim) 55%, var(--border));
  transition: border-color .15s ease-out, background-color .15s ease-out;
}
.ir-drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }
.ir-drop-title { margin: .2rem 0 0; font-weight: 600; color: var(--text); font-size: .9rem; }
.ir-drop-hint { margin: 0; font-size: .76rem; line-height: 1.5; max-width: 34ch; }
.ir-link-btn {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.ir-link-btn:hover { text-decoration-color: currentColor; }
.ir-files { list-style: none; margin: .4rem 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.ir-file { display: flex; align-items: center; gap: .5rem; font-size: .76rem; padding: 4px 8px; border-radius: 8px; background: var(--bg-elevated); text-align: left; }
.ir-file-name { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-file-size { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ir-urls { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ir-urls textarea {
  flex: 1; min-height: 7.5rem; resize: vertical; font: inherit; font-size: .8rem; line-height: 1.5;
  font-family: var(--font-mono, ui-monospace, monospace); color: var(--text);
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
}
.ir-urls textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 0; border-color: transparent; }
.ir-field-label { display: block; font-size: .72rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.ir-urls .ir-field-label { margin-bottom: 0; }
.ir-field-hint { font-size: .72rem; color: var(--text-dim); }
.ir-add-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ir-add-countries { flex: 1 1 320px; min-width: 0; }
.ir-add-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ir-ai-line { margin: 0; font-size: .74rem; color: var(--text-muted); max-width: 46ch; text-align: right; }
.ir-ai-line:empty { display: none; }
.ir-chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 2.2rem; cursor: text;
  padding: 4px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
}
.ir-chip-input:focus-within { outline: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); border-color: transparent; }
.ir-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; padding: 2px 4px 2px 8px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); }
.ir-chip-x { font: inherit; font-size: .85rem; line-height: 1; color: var(--text-dim); background: none; border: 0; padding: 0 4px; cursor: pointer; border-radius: 999px; }
.ir-chip-x:hover { color: var(--text); }
.ir-chip-field { flex: 1; min-width: 12ch; font: inherit; font-size: .8rem; color: var(--text); border: 0; background: transparent; padding: 3px 4px; outline: none; }
.ir-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ir-queue:empty { display: none; }
.ir-q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; font-size: .78rem; padding: 6px 8px; border-radius: 8px; }
.ir-q:nth-child(odd) { background: color-mix(in srgb, var(--bg-elevated) 60%, transparent); }
.ir-q-kind { font-size: .64rem; font-weight: 700; letter-spacing: .04em; color: var(--text-dim); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.ir-q-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-q-status { color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; }
.ir-q-msg { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.ir-q-added .ir-q-status { color: var(--ok); }
.ir-q-failed .ir-q-status { color: var(--bad); white-space: normal; }
.ir-q-act { display: inline-flex; gap: .6rem; }
.ir-q-spin { width: 12px; height: 12px; border-width: 2px; }
.ir-q-foot { padding: 4px 8px 0; font-size: .76rem; }
@media (max-width: 640px) {
  .ir-add-box { padding: 14px; }
  .ir-q { grid-template-columns: auto minmax(0, 1fr); }
  .ir-q-status, .ir-q-act { grid-column: 2; }
}

/* Countries */
.ir-country-filter {
  font: inherit; font-size: .8rem; color: var(--text); height: var(--ctl-h); padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; width: 100%;
}
.ir-countries { display: flex; flex-direction: column; gap: 2px; }
.ir-country {
  display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; gap: .45rem;
  width: 100%; text-align: left; font: inherit; font-size: .86rem; color: var(--text); cursor: pointer;
  padding: .5rem .65rem; border: 0; border-radius: 10px; background: transparent;
  transition: background-color .15s ease-out, box-shadow .18s ease-out;
}
.ir-country:hover { background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); }
.ir-country.is-selected { background: var(--pill); box-shadow: var(--lift-shadow); font-weight: 600; }
.ir-country:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ir-country-flag { font-size: 1.05rem; line-height: 1; display: inline-flex; justify-content: center; color: var(--text-muted); }
.ir-country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-country-n { font-size: .74rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Reports list */
.ir-stream-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.ir-stream-title { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; }
.ir-stream-sub { margin: 0; font-size: .76rem; color: var(--text-muted); white-space: nowrap; }
.ir-list { display: flex; flex-direction: column; }
.ir-row { gap: .3rem; }
.ir-row-title { font-size: .95rem; font-weight: 600; line-height: 1.35; }
.ir-row-meta { font-size: .76rem; color: var(--text-muted); }
.ir-badge-lang { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ir-badge-country { font-variant-numeric: tabular-nums; }

/* Reader */
.ir-reader-bar { justify-content: flex-end; min-height: 2.35rem; }
.ir-back { display: none; margin-right: auto; }
.ir-reader-bar [hidden] { display: none; }   /* .cti-reader-open sets its own display */
.ir-lang-switch { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--bg-elevated); margin-right: auto; }
.ir-lang-switch[hidden] { display: none; }
.ir-lang {
  font: inherit; font-size: .74rem; font-weight: 500; color: var(--text-muted); cursor: pointer;
  padding: 3px 10px; border-radius: 999px; border: 0; background: transparent;
}
.ir-lang.is-on { color: var(--text); background: var(--pill); box-shadow: var(--pill-shadow); }
.ir-reader-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.ir-article { padding: 22px 26px 3rem; }
.ir-article-head { padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border-soft); }
.ir-article-title { margin: 0 0 .6rem; font-family: var(--font-serif); font-size: 1.55rem; font-weight: 600; line-height: 1.25; letter-spacing: -.005em; text-wrap: balance; }
.ir-article-countries { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .8rem; }
.ir-chip-country { cursor: pointer; }
.ir-chip-country:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ir-chip-guess { font-size: .66rem; color: var(--text-dim); margin-left: .15rem; }
.ir-chip-none { color: var(--text-muted); }
.ir-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem .9rem; margin: 0; font-size: .8rem; }
.ir-fact { display: contents; }
.ir-fact dt { color: var(--text-dim); }
.ir-fact dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.ir-fact dd a { color: var(--accent); }
.ir-fact .cti-chip { display: inline-block; margin: 0 .2rem .2rem 0; }
.ir-unknown { color: var(--text-dim); }
.ir-article-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.ir-note {
  margin: 0 0 .9rem; padding: 8px 12px; border-radius: 10px; font-size: .8rem; line-height: 1.5; color: var(--text-muted);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
/* The report itself: serif prose at a reading measure. */
.ir-doc { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.68; color: var(--text); max-width: 72ch; overflow-wrap: break-word; }
.ir-doc > :first-child { margin-top: 0; }
.ir-doc p { margin: 0 0 1em; text-wrap: pretty; }
.ir-doc h2, .ir-doc h3, .ir-doc h4, .ir-doc h5, .ir-doc h6 { font-family: var(--font); line-height: 1.3; margin: 1.6em 0 .55em; letter-spacing: -.005em; }
.ir-doc h2 { font-size: 1.3rem; font-weight: 650; }
.ir-doc h3 { font-size: 1.1rem; font-weight: 650; }
.ir-doc h4, .ir-doc h5, .ir-doc h6 { font-size: .98rem; font-weight: 650; }
.ir-doc a { color: var(--accent); text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ir-doc a:hover { text-decoration-color: currentColor; }
.ir-doc ul, .ir-doc ol { margin: 0 0 1em; padding-left: 1.4em; }
.ir-doc li { margin: .25em 0; }
.ir-doc li > ul, .ir-doc li > ol { margin: .25em 0 0; }
.ir-doc blockquote { margin: 0 0 1em; padding: .1em 0 .1em 1em; border-left: 3px solid var(--border); color: var(--text-muted); }
.ir-doc code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .86em; padding: .05em .3em; border-radius: 4px; background: var(--bg-elevated); }
.ir-doc pre { margin: 0 0 1em; padding: 10px 12px; border-radius: 8px; background: var(--bg-elevated); overflow-x: auto; font-size: .84rem; line-height: 1.5; }
.ir-doc pre code { padding: 0; background: none; font-size: inherit; }
.ir-doc hr { border: 0; border-top: 1px solid var(--border-soft); margin: 1.6em 0; }
.ir-table-wrap { overflow-x: auto; margin: 0 0 1em; }
.ir-doc table { border-collapse: collapse; font-family: var(--font); font-size: .84rem; line-height: 1.45; }
.ir-doc th, .ir-doc td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; vertical-align: top; }
.ir-doc th { background: var(--bg-elevated); font-weight: 600; }

/* Editing a report's details */
.ir-edit { display: flex; flex-direction: column; gap: .7rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border-soft); }
.ir-edit input:not(.ir-chip-field) {
  width: 100%; font: inherit; font-size: .86rem; color: var(--text); padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
}
.ir-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: .7rem; }
.ir-edit-error { margin: 0; font-size: .78rem; color: var(--bad); }
.ir-edit-actions { display: flex; justify-content: flex-end; gap: .4rem; }

/* Tablets and phones: the columns stack (styles.css hides .tp-reader); an open
   report takes the page, with ← Reports back to the list. The document stays
   the scroller on phones, so the reader body doesn't scroll on its own. */
@media (max-width: 1024px) {
  .ir-back { display: inline-flex; }
  #view-intel-reports.ir-reading .ir-side,
  #view-intel-reports.ir-reading .ir-stream,
  #view-intel-reports.ir-reading #ir-add { display: none; }
  #view-intel-reports.ir-reading .ir-reader { display: flex; position: static; height: auto; min-height: 60vh; margin-bottom: 2rem; }
  #view-intel-reports.ir-reading .ir-reader-body { overflow: visible; }
  #view-intel-reports.ir-reading .tp-layout { padding-top: .75rem; }
  .ir-article { padding: 18px 18px 2rem; }
}
@media (max-width: 640px) {
  .ir-article { padding: 14px 14px 2rem; }
  .ir-article-title { font-size: 1.3rem; }
  .ir-doc { font-size: .98rem; }
  .ir-edit-row { grid-template-columns: minmax(0, 1fr); }
}

/* ── Briefing (/, the landing page) ──────────────────────────────────────────
   trend-watch's executive brief for a reader with a minute to spare: up to
   five stories in columns, each told the same three ways. The three parts
   line up across the cards (subgrid), so a reader can run along one row,
   "What should be done" say, and get every story's answer. Serif for
   prose, as in the other briefs; the period switch is the Topics brief's. */
#view-briefing { --br-gutter: 1.75rem; --br-labels: 7rem; --br-pad: 1.4rem; }
.br-page { max-width: 1600px; margin: 0 auto; padding: 1rem var(--br-gutter) 4rem; }
/* A slim heading (the title and dates, with the period switch at the right)
   over the stories, level with the row names. */
.br-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; }
.br-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .85rem; min-width: 0; }
.br-title { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.br-when { margin: 0; font-size: .78rem; line-height: 1.3; color: var(--text-dim); }
.br-periods .tp-brief-period { font-size: .78rem; padding: 0 14px; }
.br-quiet { margin: 1.5rem 0 0; font-size: .95rem; color: var(--text-muted); }

/* The stories: a column each, separated by hairlines that fade at both ends,
   with no boxes. Rows are shared across the columns (subgrid), named once at
   the left in the app's sentence-case label style. */
.br-stories { display: flex; flex-direction: column; gap: 2.5rem; margin-top: 1.5rem; }
.br-row {
  display: grid; grid-template-columns: var(--br-labels) repeat(var(--cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(8, auto); row-gap: .85rem;
}
.br-row-labels { grid-column: 1; grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; }
.br-row-label { padding-top: .5px; font-size: .82rem; font-weight: 500; line-height: 1.55rem; color: var(--text-muted); text-wrap: balance; }
/* Each name sits on the baseline of its row's first line: the serif rows
   above, and the APJ note and Read more, whose smaller sans lines it matches. */
.br-row-labels > :nth-child(6) { padding-top: .5px; line-height: calc(.86rem * 1.5); }
.br-row-labels > :nth-child(7) { padding-top: 0; line-height: 1.45; }
.br-story {
  position: relative; grid-row: 1 / -1; display: grid; grid-template-rows: subgrid;
  min-width: 0; padding: 0 var(--br-pad);
}
.br-story::before {
  content: ''; position: absolute; left: 0; top: .4rem; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 14%, var(--border) 86%, transparent);
}
/* The numeral is also a quiet toggle that picks its story out (brFocus): it
   looks the same, and its hit area runs across the column, hairline to
   hairline. Picked, the other stories' text fades back; the band, hairlines
   and row names stay as they are. */
.br-num {
  position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none;
  overflow: visible; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent;
  font-family: var(--font-serif); font-size: 2.5rem; font-weight: 400; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: lining-nums; color: var(--text-dim);
  transition: color .15s ease-out, opacity .3s ease-out;
}
.br-num::after { content: ''; position: absolute; inset: -.4rem calc(-1 * var(--br-pad)); }
.br-num:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.br-headline, .br-part > * { transition: opacity .3s ease-out; }
.br-stories.has-focus .br-story:not(.is-focus) :is(.br-num, .br-headline, .br-part > *) { opacity: .4; }
@media (hover: hover) {
  .br-num:hover { color: var(--text-muted); }
  .br-stories.has-focus .br-story:not(.is-focus) .br-num:hover { opacity: 1; }
}
.br-headline { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; text-wrap: balance; }
.br-part { min-width: 0; }
/* A faint band behind the middle row, "Why it matters", so the eye keeps its
   place along the rows: each cell and the row's name are shaded out to their
   column's edges, which meet, and into the gaps above and below. The band
   overhangs the text by --br-band at each end. */
.br-row { --br-band-bg: color-mix(in srgb, var(--text) 3.5%, transparent); --br-band: .75rem; --br-half-gap: .425rem; }
body:not(.light) .br-row { --br-band-bg: color-mix(in srgb, var(--text) 4.5%, transparent); }
.br-part-why_it_matters, .br-row-labels > :nth-child(4) { background: var(--br-band-bg); }
.br-part-why_it_matters {
  margin: calc(-1 * var(--br-half-gap)) calc(-1 * var(--br-pad));
  padding: var(--br-half-gap) var(--br-pad);
}
.br-row-labels > :nth-child(4) {
  margin: calc(-1 * var(--br-half-gap)) 0 calc(-1 * var(--br-half-gap)) calc(-1 * var(--br-band));
  padding: calc(var(--br-half-gap) + .5px) 0 var(--br-half-gap) var(--br-band);
  border-radius: 10px 0 0 10px;
}
.br-story:last-child .br-part-why_it_matters {
  margin-right: calc(-1 * var(--br-band)); padding-right: var(--br-band); border-radius: 0 10px 10px 0;
}
/* Each story names its own rows only where the names column is gone. */
.br-part-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  margin: 0; font-size: .8rem; font-weight: 500; color: var(--text-muted);
}
.br-part-text { margin: 0; font-family: var(--font-serif); font-size: .96rem; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.br-apj { font-family: var(--font); font-size: .86rem; line-height: 1.5; color: var(--text-muted); }

/* The Trellix talking point: the idea to remember in the serif, the detail
   behind it in smaller sans, with each line led by its name. */
.br-tp-key { margin: 0 0 .5rem; font-family: var(--font-serif); font-size: .96rem; font-weight: 600; line-height: 1.45; color: var(--text); text-wrap: pretty; }
.br-tp-products { margin: 0 0 .5rem; padding: 0; list-style: none; }
.br-tp-products li, .br-tp-line { font-family: var(--font); font-size: .86rem; line-height: 1.5; color: var(--text-muted); }
.br-tp-products li + li { margin-top: .4rem; }
.br-tp-line { margin: .4rem 0 0; }
.br-tp-name { font-weight: 600; color: var(--text); }
.br-tp-source { white-space: nowrap; color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.br-tp-source:hover { color: var(--text); }

/* Read more: what a story cites, as quiet links under it, faded as far as
   small text stays readable. A name sits at the 4.5:1 contrast floor against
   the page; the kind ("Topic ·", "Vuln ·") a step under it. Both are mixed from
   the theme's text and page colours, per theme, so they hold in each. A long
   name keeps to two lines; hovering brings a link up to full text. */
.br-more {
  --br-faint: color-mix(in srgb, var(--text) 56%, var(--bg));
  --br-fainter: color-mix(in srgb, var(--text) 44%, var(--bg));
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem;
}
body:not(.light) .br-more {
  --br-faint: color-mix(in srgb, var(--text) 49%, var(--bg));
  --br-fainter: color-mix(in srgb, var(--text) 36%, var(--bg));
}
.br-more-link, .br-more-toggle {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: .82rem; line-height: 1.45; color: var(--br-faint);
}
.br-more-link {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s ease-out;
}
.br-more-kind { color: var(--br-fainter); transition: color .15s ease-out; }
.br-more-link:hover .br-more-kind { color: var(--text-muted); }
.br-more-link:hover, .br-more-toggle:hover { color: var(--text); }
.br-more-link:hover { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.br-more-link:focus-visible, .br-more-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
/* What you should know today: the one main update of the morning, as a
   banner at the top of the Analyst brief page (it was the Briefing's; the
   br- names stayed with the markup, brTodayHtml). A faint brand wash marks it out from the
   brief below (no accent bar at the side, by the owner's choice); the text
   is the brief's serif, a step larger. Related links sit under it as small
   pills. A banner from an earlier day keeps its place but loses the colour. */
.br-today {
  --br-today-wash: color-mix(in srgb, var(--brand) 7%, transparent);
  margin: 0 0 2rem; padding: 1.1rem 1.4rem 1.2rem;
  border-radius: 12px; background: var(--br-today-wash);
}
body:not(.light) .br-today { --br-today-wash: color-mix(in srgb, var(--brand) 12%, transparent); }
.br-today.is-stale { --br-today-wash: color-mix(in srgb, var(--text) 4%, transparent); }
.br-today-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .85rem; margin-bottom: .45rem; }
/* A newspaper kicker, not a coloured eyebrow: ink colour, tight tracking. */
.br-today-title { margin: 0; font-size: .76rem; font-weight: 700; letter-spacing: .015em; text-transform: uppercase; color: var(--text); }
.br-today.is-stale .br-today-title { color: var(--text-muted); }
.br-today-date { margin: 0; font-size: .78rem; color: var(--text-dim); }
.br-today-text {
  margin: 0; max-width: 95ch; font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.55;
  color: var(--text); text-wrap: pretty;
}
.br-today-links { list-style: none; margin: .85rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.br-today-links li { min-width: 0; max-width: 100%; }
.br-today-link {
  display: inline-block; box-sizing: border-box; max-width: 32ch; padding: 3px 11px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg); cursor: pointer;
  font: inherit; font-size: .8rem; line-height: 1.45; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s ease-out, border-color .15s ease-out;
}
.br-today-kind { margin-right: .4rem; font-size: .72rem; color: var(--text-dim); }
.br-today-link:hover { color: var(--text); border-color: var(--brand); }
.br-today-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 768px) {
  .br-today { margin-bottom: 1rem; padding: 1rem 1rem 1.05rem; }
  .br-today-text { font-size: 1.05rem; }
  .br-today-link { max-width: 100%; }
}

.br-empty { max-width: 46ch; margin: 3rem auto; text-align: center; }
.br-empty h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .5rem; }

/* Narrower: the names column goes and each story names its own rows; the
   rows still line up across the columns until they stack. */
@media (max-width: 1100px) {
  .br-row { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .br-row-labels { display: none; }
  #view-briefing { --br-pad: 1.25rem; }
  .br-story { padding: 0 var(--br-pad); }
  .br-row .br-story:first-of-type .br-part-why_it_matters {
    margin-left: calc(-1 * var(--br-band)); padding-left: var(--br-band); border-radius: 10px 0 0 10px;
  }
  .br-row .br-story:only-of-type .br-part-why_it_matters { border-radius: 10px; }
  .br-story:first-of-type::before { display: none; }
  .br-row .br-story:first-of-type { padding-left: 0; }
  .br-row .br-story:first-of-type .br-num::after { left: 0; }
  .br-part-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; margin: 0 0 .15rem; }
}
@media (max-width: 768px) {
  #view-briefing { --br-gutter: 1rem; }
  .br-page { padding-top: 1.25rem; }
  .br-stories { gap: 0; margin-top: .25rem; }
  .br-row { display: block; }
  .br-row .br-story .br-part.br-part-why_it_matters { margin: 0; padding: 0; background: none; border-radius: 0; }
  .br-story { display: flex; flex-direction: column; gap: .85rem; }
  .br-story, .br-row .br-story:first-of-type { padding: 1.5rem 0; }
  .br-story::before { display: block; top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 1px;
    background: linear-gradient(to right, var(--border), var(--border) 70%, transparent); }
  .br-num { font-size: 2.4rem; }
  .br-num::after { left: 0; right: 0; }
  .br-row + .br-row .br-story:first-of-type::before { display: block; }
  .br-periods { width: 100%; }
  .br-periods .tp-brief-period { padding: 0 6px; }
}

/* ── Victims dashboard (#victims-dashboard, above the list) ──────────────────
   One fold over every panel; all of them follow the subnav's filters. The bar
   is one row: the Filters button, the quick region and period switches, sort
   and search, then the Dashboard switch, Reports, CSV and Smart Export. The full
   filters fold out under it (.vf-drawer). */
.vq-switches { display: flex; align-items: center; gap: .4rem; flex: none; }
.vq-switch .tp-brief-period { padding: 0 7px; font-size: .72rem; white-space: nowrap; }
/* No quick switch matches (two regions, a country, a custom range): no pill. */
.vq-switch.is-none .tp-brief-period-thumb { opacity: 0; }

/* How many filters are in use, on the Filters button. */
.vf-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.1rem; height: 1.1rem; padding: 0 4px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .66rem; font-weight: 600; line-height: 1;
}
.vf-count[hidden] { display: none; }

@media (min-width: 769px) {
  #victims-controls { gap: .45rem; }
  /* On the desktop bar the phone's Filters button opens the drawer instead. */
  #victims-filter-toggle {
    display: inline-flex; align-items: center; gap: .4rem; order: 0;
    height: var(--ctl-h); padding: 0 .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-surface); color: var(--text); font-size: .82rem; font-weight: 500; cursor: pointer;
    transition: background-color .15s ease-out, border-color .15s ease-out;
  }
  #victims-filter-toggle .mobile-filter-chevron { width: 12px; height: 12px; color: var(--text-muted); transition: transform .3s ease; }
  #victims-filter-toggle.open { border-color: transparent; background: var(--pill); box-shadow: var(--pill-shadow); }
  #victims-filter-toggle.open .mobile-filter-chevron { transform: rotate(180deg); }
  @media (hover: hover) {
    #victims-filter-toggle:not(.open):hover { border-color: color-mix(in srgb, var(--text) 22%, var(--border)); }
  }
  /* Search gives way first, from 220px down to 120px, before anything wraps: the
     line breaks on the flex basis, so a 220px basis wrapped the bar while there
     was still room to shrink. One row at 1024 and 1280 with the CSV button. */
  #victims-controls .victim-search-pill { flex: 1 1 120px; max-width: 220px; min-width: 120px; width: auto; }
}
/* Too narrow for the labels: the Dashboard switch and exports go to icons. */
@media (min-width: 769px) and (max-width: 1180px) {
  .victims-tools .btn-label,
  .victims-tools .tp-evtl-toggle-label { display: none; }
  .victims-tools .btn { width: var(--ctl-h); padding: 0; justify-content: center; gap: 0; }
}

/* The filters drawer: a third row under the bar, folding like the dashboard.
   Its padding folds with it (padding on a 0fr row would still show). */
.vf-drawer {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .3s ease, opacity .25s ease, visibility 0s linear .3s;
}
.vf-drawer.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .3s ease, opacity .25s ease; }
.vf-drawer-inner {
  min-height: 0; min-width: 0; overflow: hidden;
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding: 0 1.5rem; transition: padding .3s ease;
}
.vf-drawer.open .vf-drawer-inner { padding: .6rem 1.5rem; }
/* Open and settled, the dropdowns may hang out over the page. */
.vf-drawer.settled .vf-drawer-inner,
#victims-filter-collapsible.settled,
#victims-filter-collapsible.settled > .mobile-filter-inner { overflow: visible; }
.vf-drawer.no-transition, .vf-drawer.no-transition .vf-drawer-inner,
#victims-filter-collapsible.no-transition { transition: none; }
@media (prefers-reduced-motion: reduce) { .vf-drawer, .vf-drawer-inner { transition: none; } }
@media (max-width: 768px) {
  .vf-drawer-inner { padding: 0 .75rem; }
  /* As much room above the first row as below the last: the drawer's top rule
     sat on the dropdowns with .1rem. */
  .vf-drawer.open .vf-drawer-inner { padding: .65rem .75rem; }
}

/* The bar's glass is painted per row on this view, so the drawer and the chip
   row under it can be a thinner pane of the same glass: one blur behind the
   whole bar (on .subnav), a lighter tint over its lower rows. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #view-victims > .subnav { background: transparent; }
  #victims-controls { background: var(--subnav-glass); }
  .vf-drawer, #victims-active-filters { background: color-mix(in srgb, var(--subnav-glass) 62%, transparent); }
  .vf-drawer.open { box-shadow: inset 0 1px 0 var(--subnav-rule); }
}

.vd-fold { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .35s ease, opacity .3s ease; }
/* min-width 0 too: a grid item is otherwise as wide as its widest content, which on a phone was the trends grid. */
.vd-inner { min-height: 0; min-width: 0; }
/* Clipped only while folded or folding, so the chart toolbar's menus aren't cut off when open. */
.vd-fold.collapsed > .vd-inner, .vd-fold.is-folding > .vd-inner { overflow: hidden; }
.vd-fold.collapsed { grid-template-rows: 0fr; opacity: 0; visibility: hidden; pointer-events: none; }
.vd-fold.no-transition { transition: none; }
@media (prefers-reduced-motion: reduce) { .vd-fold { transition: none; } }

/* The same gutter as the victim list (.victim-grid), so the two line up. */
.rd-root { container-type: inline-size; min-width: 0; }
/* One row: the tabbed panel, and most active groups beside it at the same height. */
.vd-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem 1.5rem 0; margin-bottom: 1rem; }
@media (min-width: 1100px) { .vd-row { grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); align-items: stretch; } }
@media (max-width: 480px) { .vd-row { padding: .75rem .75rem 0; gap: .75rem; } }
.vd-row #viz-container { margin: 0; height: 100%; }
.vd-row .rd-root > .rd-panel { height: 100%; }
.viz-panel[data-view="weekly"] { padding: .35rem 1rem 1rem; }

/* Widen: the chart panel takes the row; most active groups folds to a slim tab
   with its name down it, which brings the list back. Desktop only. */
.vd-wide-toggle, .rd-side-tab { display: none; }
@media (min-width: 1100px) {
  /* The widen motion is setVictimsChartWide's: it moves the two columns frame by
     frame. Meanwhile the groups box narrows with its column into the side tab
     (same border, background and corners, so the hand-off is seamless); its
     content keeps its own width (--vd-groups-w), clipped by the box, and fades
     (--vd-fade). The side tab takes over at the end. */
  .vd-row { position: relative; }
  .vd-row #viz-container { position: relative; z-index: 1; }
  .vd-row.is-sliding { overflow: clip; }
  .vd-row.is-sliding .rd-root { min-width: 0; }
  .vd-row.is-sliding .rd-root > .rd-panel,
  .vd-row.is-wide.is-sliding .rd-root > .rd-panel { display: block; width: auto; height: 100%; overflow: hidden; }
  .vd-row.is-sliding .rd-root > .rd-panel > * { width: calc(var(--vd-groups-w) - 2rem - 2px); opacity: var(--vd-fade, 1); }
  .vd-row.is-sliding .rd-side-tab,
  .vd-row.is-wide.is-sliding .rd-side-tab { display: none; }   /* outranks the is-wide rule below */
  .vd-wide-toggle {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: .9rem; right: .9rem; z-index: 2;
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; cursor: pointer;
    background: transparent; color: var(--text-dim);
    transition: color .15s ease-out, background-color .15s ease-out;
  }
  @media (hover: hover) and (pointer: fine) {
    .vd-wide-toggle:hover { color: var(--text); background: var(--bg-elevated); }
  }
  .vd-wide-toggle svg { transition: transform .24s cubic-bezier(0.23, 1, 0.32, 1); }
  .vd-row.is-wide .vd-wide-toggle svg { transform: rotate(180deg); }

  .vd-row.is-wide { grid-template-columns: minmax(0, 1fr) 44px; }
  /* Keeps its height when the groups no longer set it. */
  .vd-row.is-wide #viz-container { min-height: 450px; }
  .vd-row.is-wide .rd-root > .rd-panel { display: none; }
  /* Out of the row's sizing: sideways text with no set height takes the window's
     height as its own, which held the row open at 900px. It fills what the chart sets. */
  .vd-row.is-wide .rd-root { position: relative; }
  .vd-row.is-wide .rd-side-tab {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: flex-start;
    padding: 1rem 0; cursor: pointer;
    border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface);
    font: inherit; font-size: .84rem; font-weight: 600; color: var(--text-muted);
    writing-mode: vertical-rl; transition: color .15s ease-out, background-color .15s ease-out;
  }
  @media (hover: hover) and (pointer: fine) {
    .vd-row.is-wide .rd-side-tab:hover { color: var(--text); background: color-mix(in srgb, var(--bg-elevated) 60%, var(--bg-surface)); }
  }
}
@media (prefers-reduced-motion: reduce) { .vd-wide-toggle svg { transition: none; } }
/* In the row, the open tab fills the panel's height: the charts stretch to it. */
@media (min-width: 1100px) {
  .vd-row #viz-container { display: flex; flex-direction: column; }
  .vd-row .viz-panel:not(.hidden) { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .vd-row #rd-weekly { position: relative; flex: 1 1 auto; min-height: 200px; }
  .vd-row #rd-weekly > svg { position: absolute; inset: 0; }   /* never props the box open */
  .vd-row #victim-chart-container { flex: 1 1 auto; display: flex; flex-direction: column; }
  .vd-row #victim-chart-wrap { flex: 1 1 auto; height: auto !important; min-height: 200px; }
  .vd-row #victim-chart-resize-handle { display: none; }      /* the row sets the height */
}
.rd-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@container (min-width: 1000px) { .rd-charts { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.rd-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .25rem; }
.rd-panel-head .rd-panel-title { margin: 0; }
.rd-rank li { cursor: pointer; border-radius: 6px; }
.rd-rank li:hover { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.rd-rank li:hover .rd-rank-name { color: var(--brand); }

/* Panels and figures */
.rd-panel { padding: .9rem 1rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); min-width: 0; }
.rd-panel-title { margin: 0 0 .25rem; font-size: .88rem; font-weight: 600; }
.rd-caption { margin: 0 0 .75rem; font-size: .8rem; line-height: 1.45; color: var(--text-muted); text-wrap: pretty; }
.rd-caption b { color: var(--text); font-weight: 600; }
.rd-delta { font-size: .74rem; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rd-delta.is-bad { color: var(--bad); }

.rd-chart svg { display: block; overflow: visible; }
.rd-axis line { stroke: var(--grid); stroke-width: 1; }
.rd-axis text, .rd-avg-label { fill: var(--text-dim); font-size: 11px; }
.rd-bar { fill: color-mix(in srgb, var(--brand) 28%, transparent); }
.rd-bar.is-hot { fill: var(--brand); }
.rd-bar:hover { fill: color-mix(in srgb, var(--brand) 70%, transparent); }
.rd-avg { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; }

.rd-legend { display: flex; gap: .9rem; margin: 0 0 .5rem; font-size: .74rem; color: var(--text-muted); }
.rd-legend i { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.rd-sw-bar { width: 12px; height: 8px; border-radius: 0 3px 3px 0; background: var(--brand); }
.rd-sw-tick { width: 2px; height: 12px; background: var(--text-muted); }
.rd-rank { list-style: none; margin: 0; padding: 0; }
.rd-rank li { display: grid; grid-template-columns: minmax(80px, 140px) minmax(0, 1fr) 2.75rem 3.25rem; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .82rem; }
.rd-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rd-rank-track { position: relative; height: 12px; }
.rd-rank-bar { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--brand); }
.rd-rank-prev { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text-muted); }
.rd-rank-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rd-rank-d { text-align: right; }


.rd-scroll { overflow-x: auto; }
/* The heatmaps, in the chart's Heatmap tab: a tab per grid, and the same height
   whichever shows (every axis is its top 10; blank rows make up a short one).
   Flat inside the chart's panel, which is already the box. */
#rd-grid .rd-hm-panel { padding: .25rem 0 0; border: 0; border-radius: 0; background: none; }
.rd-hm-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: -.2rem 0 .1rem; border-bottom: 1px solid var(--border-soft); }
.rd-hm-tabs { display: flex; gap: 1rem; overflow-x: auto; }
.rd-hm-tab {
  border: 0; background: none; padding: .35rem 0 .55rem; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: .86rem; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; transition: color .15s ease-out, border-color .15s ease-out;
}
.rd-hm-tab:hover { color: var(--text); }
.rd-hm-tab.is-on { color: var(--text); border-bottom-color: var(--brand); }
.rd-hm-head .rd-switch { margin-bottom: .35rem; }
.rd-hm-q { margin: .55rem 0 .15rem; font-size: .78rem; color: var(--text-muted); }
.rd-hm-panel .rd-caption { min-height: 1.45em; margin-bottom: .6rem; }
.rd-hm {
  display: grid; gap: 2px; min-width: 100%;
  grid-template-columns: minmax(96px, 150px) repeat(var(--cols), minmax(44px, 1fr)) 3rem;
  font-size: .72rem; font-variant-numeric: tabular-nums;
}
.rd-hm-ch { align-self: end; padding: 0 1px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: .66rem; color: var(--text-dim); min-height: 1.1rem; }
.rd-hm-ch.is-total, .rd-hm-tot { text-align: right; }
.rd-hm-rh {
  border: 0; background: none; padding: 0 6px 0 0; height: 26px; cursor: pointer; text-align: left;
  font: inherit; font-size: .74rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-hm-rh:hover { color: var(--brand); }
.rd-hm-c {
  height: 26px; padding: 0; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--bg-elevated); color: var(--text); font: inherit; font-family: var(--font-mono, ui-monospace, monospace); font-size: .68rem;
  outline: 1.5px solid transparent; outline-offset: -1.5px; transition: outline-color .1s;
}
.rd-hm-c:hover, .rd-hm-c:focus-visible { outline-color: var(--text); }
.rd-hm-c.is-dark { color: #fff; font-weight: 600; }
.rd-hm-c.is-thin { color: var(--text-dim); }
.rd-hm-c.is-pad, .rd-hm-rh.is-pad { background: transparent; cursor: default; pointer-events: none; }
.rd-hm-tot { align-self: center; padding-left: 4px; font-size: .68rem; color: var(--text-muted); }
.rd-hm-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .72rem; color: var(--text-dim); }
.rd-hm-key { display: inline-flex; align-items: center; gap: .4rem; }
.rd-hm-ramp { display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, var(--bg-surface)), var(--brand)); }
.rd-hm-ramp.is-lift { background: linear-gradient(90deg, color-mix(in srgb, var(--brand2) 70%, var(--bg-surface)), var(--bg-elevated), color-mix(in srgb, var(--bad) 90%, var(--bg-surface))); }

/* ── Motion ─────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nav-slider, .seg-ind, .btn, .btn-toggle-circle { transition: none !important; }
}

/* ── Settings → Email Briefing ─────────────────────────────────────────────── */
/* Settings → Email Briefing: one card per email (Executive Briefing, analyst
   brief), each laid out the same: name, what it sends and its switch; a status
   line; When | Recipients; then Save and a test. Each card saves on its own. */
.eb-cards { display: flex; flex-direction: column; gap: 1.25rem; max-width: 900px; margin-top: 1.25rem; }
.eb-card { max-width: none; padding: 1.25rem 1.4rem 1.1rem; }
.eb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem 2rem; }
.eb-head-text { min-width: 0; }
.eb-title { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -.005em; }
.eb-desc { margin: .2rem 0 0; font-size: .82rem; color: var(--text-muted); line-height: 1.45; }
.eb-switch { flex: none; gap: .65rem; padding: .1rem 0; }
.eb-switch-text { font-size: .82rem; color: var(--text-muted); }
.eb-status { margin: .85rem 0 0; padding: .5rem .7rem; border-radius: 8px; font-size: .8rem; line-height: 1.45;
  background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--text-muted); }
.eb-status:empty { display: none; }
.eb-status-on { color: var(--text); }
.eb-status-dirty { background: color-mix(in srgb, var(--brand) 9%, transparent); color: var(--brand); }
.eb-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 2rem; margin-top: 1.1rem; }
.eb-label { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .6rem; font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.eb-label-count { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .78rem; }
.eb-when { margin: 0; font-size: .85rem; line-height: 1.55; color: var(--text-muted); }
.eb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.eb-card .be-fields { margin-top: 0; }
.eb-card .be-recipients { max-height: 260px; }
/* The cards on the left and the Email usage panel on the right, sticky as the
   cards scroll; on a narrower screen the panel comes first, above the cards. */
.eb-layout { display: grid; grid-template-columns: minmax(0, 900px) minmax(250px, 300px); gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.eb-layout .eb-cards { margin-top: 0; }
.eb-usage { max-width: none; position: sticky; top: 1rem; padding: 1.15rem 1.2rem 1.1rem; }
.eb-usage .eb-label { margin-top: 1.1rem; }
.eb-meter { margin-bottom: .7rem; }
.eb-meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .8rem; color: var(--text-muted); }
.eb-meter-row b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.eb-meter-row b span { font-weight: 400; color: var(--text-dim); }
.eb-meter-bar { height: 6px; margin-top: .35rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.eb-meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.eb-meter-warn .eb-meter-bar span { background: var(--warn); }
.eb-meter-over .eb-meter-bar span { background: var(--error); }
.eb-meter-over .eb-meter-row b { color: var(--error); }
.eb-meter-note { margin: .35rem 0 0; font-size: .74rem; line-height: 1.45; color: var(--text-dim); }
.eb-plan, .eb-room { list-style: none; margin: 0 0 .7rem; padding: 0; }
.eb-plan li { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .4rem 0; border-top: 1px solid var(--rule, var(--border)); font-size: .82rem; }
.eb-plan li:first-child { border-top: 0; padding-top: 0; }
.eb-plan-name { display: flex; flex-direction: column; min-width: 0; }
.eb-plan-name span { font-size: .74rem; color: var(--text-dim); }
.eb-plan b { font-weight: 600; font-variant-numeric: tabular-nums; }
.eb-room li { font-size: .82rem; color: var(--text-muted); padding: .15rem 0; }
.eb-room b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.eb-usage-warn { margin: .5rem 0 0; font-size: .78rem; line-height: 1.45; color: var(--warn); }
@media (max-width: 1024px) {
  .eb-layout { grid-template-columns: minmax(0, 900px); }
  .eb-usage { position: static; order: -1; }
}
@media (max-width: 720px) {
  .eb-body { grid-template-columns: minmax(0, 1fr); }
  .eb-head { flex-direction: column; }
}
.be-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.be-fields .auth-field { margin-bottom: 0; }
.be-fields .auth-field[hidden] { display: none; }
.be-field-wide { grid-column: 1 / -1; }
.be-add { display: flex; flex-direction: column; gap: .5rem; }
.be-add-row { display: flex; gap: .5rem; align-items: center; }
.be-add-row .settings-input { flex: 1; min-width: 0; height: var(--ctl-h); }
.be-add-error { font-size: .75rem; color: var(--error); }
.be-add-error:empty { display: none; }
.be-recipients { list-style: none; margin: .85rem 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.be-recipient { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--rule, var(--border)); }
.be-recipient-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.be-recipient-name { font-size: .85rem; font-weight: 500; color: var(--text); }
.be-recipient-email { font-size: .78rem; color: var(--text-muted); overflow-wrap: anywhere; }
.be-recipient-tag { font-size: .7rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.be-recipient-remove { flex: none; width: var(--ctl-h-xs); height: var(--ctl-h-xs); border: 0; border-radius: 6px; background: none; color: var(--text-dim); cursor: pointer; font-size: .8rem; }
.be-recipient-remove:hover, .be-recipient-remove:focus-visible { background: var(--bg-elevated); color: var(--text); }
.be-quota { margin: .75rem 0 0; font-size: .78rem; line-height: 1.5; color: var(--text-muted); }
.be-quota:empty { display: none; }
.be-quota-over { color: var(--error); }
.be-empty { padding: .55rem 0; font-size: .8rem; color: var(--text-muted); border-top: 1px solid var(--rule, var(--border)); }
.be-test { display: flex; gap: .5rem; align-items: center; flex: 0 1 22rem; min-width: 0; }
.be-test-to { flex: 1; min-width: 0; height: var(--ctl-h); }
@media (max-width: 480px) { .be-test { flex-basis: 100%; } }
.be-last { display: flex; flex-direction: column; gap: .3rem; margin: .75rem 0 0; font-size: .8rem; color: var(--text-muted); max-width: 900px; }
.be-last:empty { display: none; }
.be-last-warn { color: var(--warn); }
@media (max-width: 480px) { .be-fields { grid-template-columns: 1fr; } }

/* ── Analyst brief (/analyst-brief) ──────────────────────────────────────────
   One reading column (the brief), with the days beside it on a wide screen
   and a menu above it on a phone. Serif prose like the other briefs; New and
   Update are tagged in two quiet tints that hold in both themes. */
.ab-page { max-width: 1120px; margin: 0 auto; padding: 1.25rem 24px 4rem; }
.ab-layout { display: grid; grid-template-columns: 180px minmax(0, 720px); gap: 2.5rem; justify-content: center; }
/* What you should know today (.br-today, above), as wide as the days and the brief together. */
.ab-page > .br-today { box-sizing: border-box; max-width: calc(180px + 2.5rem + 720px); margin: 0 auto 2rem; }
.ab-side { position: sticky; top: 0; align-self: start; padding-top: .2rem; }
.ab-days-title { margin: 0 0 .5rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.ab-days ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 10rem); overflow-y: auto; }
.ab-day {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  padding: .4rem .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.ab-day:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.ab-day.active { background: var(--pill, var(--bg-surface)); box-shadow: var(--pill-shadow, none); }
.ab-day-name { font-size: .84rem; font-weight: 500; }
.ab-day-meta { font-size: .72rem; color: var(--text-dim); }
.ab-days-menu { display: none; }

.ab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.ab-title { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.ab-date { font-weight: 400; color: var(--text-muted); margin-left: .35rem; }
.ab-meta { margin: .3rem 0 0; font-size: .8rem; color: var(--text-dim); }
.ab-latest { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

.ab-quiet {
  margin: 1.5rem 0 0; padding: .9rem 1.1rem; border-radius: 10px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.55;
}
.ab-section-label { margin: 0 0 .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.ab-toc { margin-top: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.ab-toc ol { list-style: none; margin: 0; padding: 0; }
.ab-toc li + li { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.ab-toc button {
  display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: baseline; width: 100%;
  padding: .55rem 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .9rem;
  line-height: 1.45; text-align: left; cursor: pointer;
}
.ab-toc button:hover span:last-child { color: var(--accent); }

.ab-tag {
  display: inline-block; justify-self: start; padding: 3px 7px; border-radius: 4px;
  font-size: .64rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
}
.ab-tag-new { background: color-mix(in srgb, #7c3aed 16%, transparent); color: #6d28d9; }
.ab-tag-update { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #92400e; }
body:not(.light) .ab-tag-new { color: #c4b5fd; }
body:not(.light) .ab-tag-update { color: #fcd34d; }

.ab-story { padding: 1.6rem 0 1.7rem; border-bottom: 1px solid var(--border); scroll-margin-top: 1rem; }
.ab-kind { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--text-dim); }
.ab-headline { margin: .55rem 0 .6rem; font-family: var(--font-serif); font-size: 1.32rem; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.ab-text p { margin: 0 0 .75rem; font-family: var(--font-serif); font-size: 1.04rem; line-height: 1.62; }
.ab-facts {
  margin: .25rem 0 .8rem; padding: .5rem .7rem; border-radius: 6px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: .76rem; line-height: 1.7; color: var(--text-muted);
  overflow-wrap: anywhere;
}
.ab-facts b { font-weight: 500; color: var(--text); }
.ab-prev { margin: 0 0 .8rem; padding: .1rem 0 .1rem .8rem; border-left: 3px solid var(--border); font-size: .88rem; line-height: 1.55; color: var(--text-muted); }
.ab-prev b { font-weight: 600; }
.ab-sources, .ab-links { margin: .2rem 0 0; font-size: .8rem; line-height: 1.6; color: var(--text-dim); }
.ab-sources a { color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.ab-sources a:hover { color: var(--accent); }
.ab-links span { margin-right: .2rem; }
.ab-open { border: 0; background: none; padding: 0 .6rem 0 0; color: var(--accent); font: inherit; cursor: pointer; }
.ab-not-repeated {
  margin: 1.5rem 0 0; padding: .85rem 1.1rem; border-radius: 10px;
  background: color-mix(in srgb, var(--text) 4%, transparent); font-size: .84rem; color: var(--text-muted);
}

@media (max-width: 900px) {
  .ab-page > .br-today { max-width: none; margin-bottom: 1rem; }
  .ab-page { padding: 1rem 16px 3rem; }
  .ab-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .ab-side { position: static; }
  .ab-days { display: none; }
  .ab-days-menu { display: block; }
  .ab-days-menu select {
    width: 100%; padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-surface); color: var(--text); font: inherit; font-size: 16px;
  }
  .ab-date { display: none; }   /* the day menu above says which day */
  .ab-toc button { grid-template-columns: 64px minmax(0, 1fr); }
  .ab-headline { font-size: 1.18rem; }
  .ab-text p { font-size: 1rem; }
}

/* ── LinkedIn coach (admin-only; li* in app.js) ─────────────────────────────
   Three columns: the brief, your post, Ask Claude. On a desktop each column
   scrolls on its own inside the window; below 1024px they stack and the
   document scrolls (iOS Safari needs the document to be the scroller). */
#btn-user-linkedin[hidden], .nav-tab[data-view="linkedin"][hidden] { display: none; }
.li-page { box-sizing: border-box; max-width: 1600px; margin: 0 auto; padding: 1rem 24px 1.25rem; }
/* The round's topics: five card slots (fewer topics leave slots empty), the
   round menu at the right. */
.li-top { display: flex; align-items: stretch; gap: .75rem; margin-bottom: .9rem; min-width: 0; }
.li-topics { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.li-topic {
  display: flex; flex-direction: column; gap: .15rem; min-width: 0; box-sizing: border-box; padding: .45rem .7rem;
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.li-topic:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.li-topic:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-dim); }
.li-topic.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-surface)); }
.li-topic-label { font-size: .7rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-topic.is-active .li-topic-label { color: var(--accent); }
.li-topic-done { color: color-mix(in srgb, var(--ok) 60%, var(--text)); }
.li-topic-title {
  font-size: .84rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.li-picker {
  flex: 0 0 auto; align-self: center; max-width: 260px; height: var(--ctl-h, 32px); padding: 0 .6rem; font: inherit; font-size: .84rem;
  color: var(--text); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.li-empty { color: var(--text-muted); font-size: .9rem; }
.li-hint { margin: .25rem 0 .6rem; font-size: .84rem; color: var(--text-muted); }
.li-setup, .li-flash, .li-failed {
  box-sizing: border-box; padding: .65rem .9rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-surface); font-size: .86rem;
}
.li-setup, .li-flash { margin: 0 0 .9rem; }
.li-setup ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.li-flash { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.li-failed { margin: 0 0 .6rem; border-color: color-mix(in srgb, var(--error) 45%, var(--border)); }
.li-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .9fr); gap: 1rem;
  height: calc(100vh - 11.25rem); min-height: 520px;
}
.li-col {
  display: flex; flex-direction: column; min-height: 0; box-sizing: border-box;
  padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface);
}
.li-brief { overflow-y: auto; }
.li-col-label { margin: 0 0 .5rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.li-col-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.li-col-head .li-col-label { margin: 0; }
.li-col-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.li-col-actions .active { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); color: color-mix(in srgb, var(--ok) 60%, var(--text)); }
.li-edited { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); }
.li-title { margin: 0; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; }
.li-meta { margin: .3rem 0 .9rem; font-size: .8rem; color: var(--text-dim); }
.li-prose { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.6; }
.li-prose p { margin: 0 0 .65rem; }
.li-prose h2, .li-prose h3, .li-prose h4 { margin: 1rem 0 .35rem; font-family: var(--font); font-size: .9rem; font-weight: 600; }
.li-prose ul, .li-prose ol { margin: .2rem 0 .65rem; padding-left: 1.3rem; }
.li-prose > :last-child { margin-bottom: 0; }
.li-sources-label { margin-top: 1.1rem; }
.li-sources { margin: 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.5; }
.li-text {
  flex: 1; min-height: 16rem; width: 100%; box-sizing: border-box; resize: none;
  padding: .85rem 1rem; font: inherit; font-size: .98rem; line-height: 1.6; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.li-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.li-post-foot { display: flex; justify-content: space-between; margin-top: .45rem; font-size: .76rem; color: var(--text-dim); }
.li-save-error { color: var(--error); }
.li-count-over { color: var(--error); font-weight: 600; }
.li-chat-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.li-turns { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding-bottom: .5rem; }
.li-turn { max-width: 92%; padding: .55rem .8rem; border-radius: 14px; font-size: .9rem; }
.li-turn p { margin: 0; white-space: pre-wrap; }
.li-turn-user { align-self: flex-end; background: var(--accent-dim); }
.li-turn-coach { align-self: flex-start; background: var(--bg-elevated); }
.li-turn-coach .li-prose { font-size: .95rem; line-height: 1.55; }
.li-suggest { margin-top: .6rem; padding: .6rem .7rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.li-suggest-text { white-space: pre-wrap; font-size: .88rem; line-height: 1.5; margin-bottom: .55rem; max-height: 14rem; overflow-y: auto; }
.li-thinking { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 .6rem; font-size: .85rem; color: var(--text-muted); }
.li-thinking a { color: var(--accent); text-decoration: none; }
.li-thinking a:hover { text-decoration: underline; }
.li-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: li-spin .9s linear infinite; }
@keyframes li-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .li-spinner { animation-duration: 3s; } }
.li-link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: .85rem; cursor: pointer; }
.li-link-btn:hover { text-decoration: underline; }
.li-ask { display: flex; gap: .5rem; align-items: flex-end; padding-top: .6rem; border-top: 1px solid var(--border); }
.li-ask textarea {
  flex: 1; box-sizing: border-box; resize: none; padding: .5rem .7rem; font: inherit; font-size: .9rem; line-height: 1.45;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
@media (max-width: 1023px) {
  .li-page { padding: 1rem 16px 3rem; }
  .li-top { flex-direction: column; gap: .5rem; }
  .li-picker { align-self: stretch; max-width: none; font-size: 16px; }   /* 16px: iOS zooms into smaller fields */
  /* Cards scroll sideways in their own strip rather than squeezing. */
  .li-topics {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 30%);
    overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .2rem;
  }
  .li-topic { scroll-snap-align: start; }
  .li-cols { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .li-brief, .li-turns { overflow: visible; }
  .li-text { min-height: 22rem; resize: vertical; }
  .li-turn { max-width: 100%; }
}

/* ── Feed token notice (admins): the trend-watch feed token is about to
   expire, or has. In the page's flow under the header, never fixed: see the
   iOS Safari pitfall in CLAUDE.md. ── */
.feed-token-notice {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.5rem;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: color-mix(in srgb, var(--warn) 14%, var(--bg-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.feed-token-notice.is-error {
  background: color-mix(in srgb, var(--error) 12%, var(--bg-surface));
  border-bottom-color: color-mix(in srgb, var(--error) 40%, transparent);
}
.feed-token-notice-text { flex: 1; min-width: 0; }
.feed-token-notice-link { flex-shrink: 0; font-weight: 600; color: inherit; text-decoration: underline; }
.feed-token-notice-close {
  flex-shrink: 0;
  width: var(--ctl-h-xs);
  height: var(--ctl-h-xs);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.feed-token-notice-close:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
@media (max-width: 768px) {
  .feed-token-notice { padding: .5rem 1rem; flex-wrap: wrap; }
  .feed-token-notice-text { flex-basis: calc(100% - var(--ctl-h-xs) - .75rem); }
  .feed-token-notice-link { order: 3; }
}
