/* ==========================================================================
   TWK Radar — design system
   Implements DESIGN.md exactly: iOS-grade light UI, three buckets always
   visible, evidence over assertion, two weights only (300/600), mono for
   machine truth, calm outreach. Light mode only — no dark mode, ever.
   ========================================================================== */

/* ---------- FONT FACES — the only three real files we have --------------- */
@font-face {
  font-family: "TWK Lausanne";
  src: url("/static/fonts/TWKLausanne-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: block; /* internal tool, local files: never render fallback */
}
@font-face {
  font-family: "TWK Lausanne";
  src: url("/static/fonts/TWKLausanne-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "TWK Lausanne Mono";
  src: url("/static/fonts/TWKLausanneMono-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: block;
}

/* ---------- TOKENS (copied verbatim from DESIGN.md §2) -------------------- */
:root {
  /* ============ SURFACES & GREYS (iOS light) ============ */
  --bg:            #F2F2F7;
  --surface:       #FFFFFF;
  --surface-alt:   #FAFAFC;
  --fill:          #E9E9EC;
  --fill-hover:    #E2E2E7;
  --hairline:      #E5E5EA;
  --hairline-2:    #D1D1D6;

  /* ============ INK (never pure black) ============ */
  --ink:           #1D1D1F;
  --ink-2:         #6E6E73;
  --ink-3:         #8E8E93;
  --ink-inverse:   #FFFFFF;

  /* ============ INTERACTIVE (not a status) ============ */
  --tint:          #007AFF;
  --tint-ink:      #0040DD;
  --tint-wash:     #E6F2FF;

  /* ============ STATUS — vivid rainbow accents ============ */
  --st-unlicensed:        #FF3B30;
  --st-unlicensed-ink:    #D70015;
  --st-unlicensed-wash:   #FFEBEA;

  --st-licensed:          #34C759;
  --st-licensed-ink:      #248A3D;
  --st-licensed-wash:     #EBF9EE;

  --st-trial:             #FF9500;
  --st-trial-ink:         #C93400;
  --st-trial-wash:        #FFF4E6;

  --st-breach:            #FF2D55;
  --st-breach-ink:        #D30F45;
  --st-breach-wash:       #FFEAEE;

  --st-review:            #AF52DE;
  --st-review-ink:        #8944AB;
  --st-review-wash:       #F7EEFC;

  --st-possible:          #5856D6;
  --st-possible-ink:      #3634A3;
  --st-possible-wash:     #EEEEFB;

  --st-watch:             #30B0C7;
  --st-watch-ink:         #008299;
  --st-watch-wash:        #EAF7F9;

  --st-unknown:           #8E8E93;
  --st-unknown-ink:       #6E6E73;
  --st-unknown-wash:      #F2F2F7;

  --st-reply:             #00C7BE;
  --st-reply-ink:         #0C817B;
  --st-reply-wash:        #E6F9F9;

  /* ============ FAMILY ACCENTS (rounded-square swatches only) ============ */
  --fam-lausanne:      #007AFF;
  --fam-lausanne-pan:  #5856D6;
  --fam-everett:       #FF2D55;
  --fam-everett-mono:  #00C7BE;
  --fam-ghost:         #AF52DE;
  --fam-burns:         #FF9500;
  --fam-continental:   #30B0C7;
  --fam-issey:         #A2845E;
  --fam-default:       #8E8E93;

  /* ============ RADII ============ */
  --r-xs:   6px;
  --r-s:   10px;
  --r-m:   14px;
  --r-l:   18px;
  --r-full: 999px;

  /* ============ SHADOWS ============ */
  --sh-1: 0 1px 2px rgba(0,0,0,0.04);
  --sh-2: 0 2px 8px rgba(0,0,0,0.06);
  --sh-3: 0 8px 24px rgba(0,0,0,0.10);
  --sh-4: 0 16px 48px rgba(0,0,0,0.14);

  /* ============ SPACING (4px base) ============ */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 48px; --sp-10: 64px;

  /* ============ TYPE SCALE ============ */
  --t-eyebrow: 11px; --t-eyebrow-lh: 14px;
  --t-caption: 12px; --t-caption-lh: 16px;
  --t-meta:    13px; --t-meta-lh:    18px;
  --t-body:    15px; --t-body-lh:    22px;
  --t-title-s: 17px; --t-title-s-lh: 24px;
  --t-title:   22px; --t-title-lh:   28px;
  --t-stat:    28px; --t-stat-lh:    34px;
  --t-display: 34px; --t-display-lh: 40px;

  /* ============ MOTION ============ */
  --dur-fast:   120ms;
  --dur-base:   180ms;
  --dur-slow:   240ms;
  --dur-panel:  320ms;
  --ease:       cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-panel: cubic-bezier(0.32, 0.72, 0, 1);

  /* ============ LAYOUT ============ */
  --nav-h: 52px;
  --content-max: 1120px;
  --panel-w: 480px;
}

/* ---------- RESET ---------------------------------------------------------- */
* { box-sizing: border-box; }
*, *::before, *::after { font-synthesis: none; } /* HARD FOUNDRY RULE */
html, body { margin: 0; padding: 0; }

html {
  font-family: "TWK Lausanne", -apple-system, sans-serif;
  font-weight: 300;
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

code, kbd, .mono {
  font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  font-weight: 300;
}

.w600 { font-weight: 600; }
.muted   { color: var(--ink-2); }
.muted-3 { color: var(--ink-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* Eyebrow — the one place tracking is allowed */
.eyebrow {
  font-size: var(--t-eyebrow);
  line-height: var(--t-eyebrow-lh);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}

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

/* ---------- LAYOUT --------------------------------------------------------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
main.page {
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-10);
}
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.page-head h1 {
  font-size: var(--t-title);
  line-height: var(--t-title-lh);
}
.page-head .page-meta {
  font-size: var(--t-meta);
  line-height: var(--t-meta-lh);
  color: var(--ink-2);
}
.page-meta .mono { color: var(--ink-2); }

.breadcrumb {
  font-size: var(--t-meta);
  color: var(--ink-3);
  margin-bottom: var(--sp-3);
}
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--tint); }

section + section { margin-top: var(--sp-6); }

/* ---------- TOP NAV --------------------------------------------------------- */
.topnav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.topnav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--ink);
  flex: none;
}
.brand .radar-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tint);
  flex: none;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
}
.navlinks a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--t-body);
  font-weight: 300;
  color: var(--ink-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-s);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.navlinks a:hover { background: var(--fill); color: var(--ink); }
.navlinks a.active { color: var(--ink); font-weight: 600; background: transparent; }
.navlinks a .ghost {
  display: block; height: 0; overflow: hidden; font-weight: 600; visibility: hidden;
}
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--st-review);
  color: #fff;
  font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: var(--t-caption);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-s);
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- CARDS ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
}
.card-pad { padding: var(--sp-5); }
.card-section + .card-section {
  border-top: 1px solid var(--hairline);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

/* ---------- STAT CARDS (Overview) -------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  display: block;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  padding: var(--sp-5);
  min-height: 108px;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.stat-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.stat-card .stat-eyebrow { margin-bottom: var(--sp-2); }
.stat-card .stat-value {
  font-size: var(--t-stat); line-height: var(--t-stat-lh);
  font-weight: 300; color: var(--ink);
  font-feature-settings: "tnum" 1;
  margin-bottom: var(--sp-1);
}
.stat-card .stat-delta { font-size: var(--t-meta); color: var(--ink-2); }

/* ---------- BUTTONS ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border-radius: var(--r-s);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: filter var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn.disabled { opacity: 0.4; pointer-events: none; }
.btn-compact { height: 28px; padding: 0 10px; font-size: var(--t-caption); }
.btn-default { height: 36px; padding: 0 14px; font-size: var(--t-meta); }
.btn-large   { height: 44px; padding: 0 18px; font-size: var(--t-body); }
.btn-primary      { background: var(--tint); color: #fff; }
.btn-primary:hover     { filter: brightness(0.94); }
.btn-secondary    { background: var(--fill); color: var(--ink); }
.btn-secondary:hover   { background: var(--fill-hover); }
.btn-ghost        { background: transparent; color: var(--tint-ink); }
.btn-ghost:hover       { background: var(--tint-wash); }
.btn-destructive  { background: var(--st-unlicensed); color: #fff; }
.btn-destructive:hover { filter: brightness(0.94); }
.btn-destr-ghost  { background: transparent; color: var(--st-unlicensed-ink); }
.btn-destr-ghost:hover { background: var(--st-unlicensed-wash); }
.btn-icon-only { width: 36px; padding: 0; }

/* ---------- PILLS & DOTS -------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-full);
  font-size: var(--t-caption);
  font-weight: 600;
  white-space: nowrap;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.pill-solid { color: #fff; }

.pill-unlicensed { background: var(--st-unlicensed-wash); color: var(--st-unlicensed-ink); }
.pill-unlicensed.pill-solid { background: var(--st-unlicensed); }
.pill-licensed   { background: var(--st-licensed-wash); color: var(--st-licensed-ink); }
.pill-trial      { background: var(--st-trial-wash); color: var(--st-trial-ink); }
.pill-breach     { background: var(--st-breach-wash); color: var(--st-breach-ink); }
.pill-breach.pill-solid { background: var(--st-breach); }
.pill-review     { background: var(--st-review-wash); color: var(--st-review-ink); }
.pill-review.pill-solid { background: var(--st-review); }
.pill-possible   { background: var(--st-possible-wash); color: var(--st-possible-ink); }
.pill-possible.pill-solid { background: var(--st-possible); }
.pill-watch      { background: var(--st-watch-wash); color: var(--st-watch-ink); }
.pill-unknown    { background: var(--st-unknown-wash); color: var(--st-unknown-ink); }
.pill-sent       { background: var(--tint-wash); color: var(--tint-ink); }
.pill-draft      { background: var(--fill); color: var(--ink-2); }
.pill-replied    { background: var(--st-reply-wash); color: var(--st-reply-ink); }
.pill-followup   { background: var(--st-trial-wash); color: var(--st-trial-ink); }
.pill-escalated  { background: var(--st-unlicensed-wash); color: var(--st-unlicensed-ink); }
.pill-source     { background: var(--fill); color: var(--ink-2); }
.pill-priority-p1 { background: var(--st-unlicensed); color: #fff; }
.pill-priority-p2 { background: var(--st-trial-wash); color: var(--st-trial-ink); }
.pill-priority-p3 { background: var(--fill); color: var(--ink-2); }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot-unlicensed { background: var(--st-unlicensed); }
.dot-licensed   { background: var(--st-licensed); }
.dot-trial      { background: var(--st-trial); }
.dot-breach     { background: var(--st-breach); }
.dot-review     { background: var(--st-review); }
.dot-possible   { background: var(--st-possible); }
.dot-watch      { background: var(--st-watch); }
.dot-unknown    { background: var(--st-unknown); }

/* Family swatch — rounded SQUARE, never a circle */
.swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  flex: none;
}
.swatch-lausanne     { background: var(--fam-lausanne); }
.swatch-lausanne-pan  { background: var(--fam-lausanne-pan); }
.swatch-everett       { background: var(--fam-everett); }
.swatch-everett-mono  { background: var(--fam-everett-mono); }
.swatch-ghost         { background: var(--fam-ghost); }
.swatch-burns         { background: var(--fam-burns); }
.swatch-continental   { background: var(--fam-continental); }
.swatch-issey         { background: var(--fam-issey); }
.swatch-default       { background: var(--fam-default); }

.family-chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-caption); color: var(--ink-2); }

/* ---------- SEGMENTED CONTROL --------------------------------------------------- */
.segmented {
  display: inline-flex;
  background: var(--fill);
  border-radius: var(--r-s);
  padding: 2px;
  gap: 2px;
}
.segmented a, .segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: var(--t-meta);
  font-weight: 300;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.segmented a.active, .segmented button.active {
  background: var(--surface);
  box-shadow: var(--sh-2);
  color: var(--ink);
  font-weight: 600;
}
.segmented .seg-count { font-family: "TWK Lausanne Mono", ui-monospace, monospace; margin-left: 5px; color: var(--ink-3); }
.segmented a.active .seg-count { color: var(--ink-2); }

/* ---------- INPUTS -------------------------------------------------------------- */
input[type=text], input[type=email], input[type=search], input[type=number], textarea, select {
  font-family: "TWK Lausanne", -apple-system, sans-serif;
  font-weight: 300;
  font-size: var(--t-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-s);
  padding: 8px 12px;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--tint);
  box-shadow: 0 0 0 3px var(--tint-wash);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-caption); color: var(--ink-2); }
.field-error input { border-color: var(--st-unlicensed); }
.field-error-msg { font-size: var(--t-caption); color: var(--st-unlicensed-ink); }

/* ---------- SITE ROW (core list, DESIGN §5.5) ----------------------------------- */
.site-list-card { overflow: hidden; }
.site-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px auto 1fr auto auto auto 44px;
  align-items: center;
  gap: var(--sp-3);
  height: 64px;
  padding: 0 var(--sp-4) 0 0;
  padding-left: calc(var(--sp-4) + 16px);
  transition: background var(--dur-fast) var(--ease);
}
.site-row.row-compact { height: 44px; }
.site-row + .site-row { border-top: 1px solid var(--hairline); }
.site-row:hover { background: var(--surface-alt); }
.site-row .row-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px;
}
.site-row .favicon {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  object-fit: cover; flex: none;
}
.site-row .row-main { min-width: 0; }
.site-row .row-domain {
  font-size: var(--t-body); font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-row .row-sub {
  font-size: var(--t-meta); color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-row .row-families { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.site-row .row-fontcount { font-size: var(--t-meta); color: var(--ink-2); white-space: nowrap; }
.site-row .row-conf { font-size: var(--t-meta); font-weight: 600; white-space: nowrap; text-align: right; min-width: 40px; }
.conf-high { color: var(--ink); }
.conf-mid  { color: var(--st-review-ink); }
.conf-low  { color: var(--ink-3); }
.site-row .row-chevron { color: var(--ink-3); width: 16px; text-align: center; }
.site-row a.row-link { position: absolute; inset: 0; }

/* ---------- FILTER BAR ----------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.filter-bar .filters-right { display: flex; align-items: center; gap: var(--sp-3); }
.select-inline {
  height: 28px; padding: 0 8px; border-radius: var(--r-s);
  border: 1px solid var(--hairline-2); background: var(--surface);
  font-size: var(--t-meta); color: var(--ink-2);
}

/* ---------- SITE DETAIL ------------------------------------------------------------ */
.site-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 1080px) { .site-detail-layout { grid-template-columns: 1fr; } }
.site-detail-main { max-width: 760px; min-width: 0; }

.site-header { margin-bottom: var(--sp-5); }
.site-header .eyebrow { margin-bottom: var(--sp-2); }
.site-header h1 {
  font-size: var(--t-title); line-height: var(--t-title-lh);
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
/* Small "visit the actual website" icon, reused next to every domain
   mention (site rows, review cards, watchlist, outreach, case header — not
   just the site-detail hero). Relative+z-index so it stays clickable above
   any full-row overlay link (.row-link) sitting in the same stacking
   context. 20px hit target even though the glyph itself is small. */
.ext-link {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: 0 0 auto;
  color: var(--ink-3); text-decoration: none; font-size: 13px;
  border-radius: var(--r-xs);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.ext-link:hover { color: var(--tint); background: var(--fill); }
.site-header .ext-link { font-size: 15px; }
.site-header .pills-row {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin: var(--sp-3) 0;
}
.site-header .actions-row {
  display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: var(--sp-5);
}
@media (max-width: 640px) { .summary-strip { grid-template-columns: repeat(2, 1fr); } }
.summary-strip .strip-item {
  padding: var(--sp-4);
  border-right: 1px solid var(--hairline);
}
.summary-strip .strip-item:last-child { border-right: none; }
.summary-strip .strip-label { font-size: var(--t-caption); color: var(--ink-3); margin-bottom: 4px; }
.summary-strip .strip-value { font-size: var(--t-meta); color: var(--ink); }

.meta-rail .kv-item { padding: var(--sp-3) var(--sp-5); }
.meta-rail .kv-item + .kv-item { border-top: 1px solid var(--hairline); }
.meta-rail .kv-label { font-size: var(--t-caption); color: var(--ink-3); margin-bottom: 3px; }
.meta-rail .kv-value { font-size: var(--t-meta); color: var(--ink); }

/* ---------- PER-FONT ROW (DESIGN §5.7) --------------------------------------------- */
.font-row {
  padding: var(--sp-3) 0;
  cursor: pointer;
}
.font-row + .font-row { border-top: 1px solid var(--hairline); }
.font-row-head {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 32px;
}
.font-row-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.font-row-name .fname { font-size: var(--t-body); font-weight: 600; color: var(--ink); white-space: nowrap; }
.font-row-name .fstyle { font-size: var(--t-body); font-weight: 300; color: var(--ink-2); white-space: nowrap; }
.font-row .format-chip {
  font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  font-size: var(--t-caption); background: var(--fill); color: var(--ink-2);
  border-radius: var(--r-xs); padding: 2px 6px; text-transform: none;
}
.font-row .fchevron { transition: transform var(--dur-base) var(--ease); color: var(--ink-3); flex: none; }
.font-row.expanded .fchevron { transform: rotate(180deg); }
.font-row-sub {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--t-meta); color: var(--ink-2);
  margin-top: 4px; padding-left: 18px;
}
.font-row-sub .served-url {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px;
}
.font-row-sub .copy-btn {
  border: none; background: transparent; color: var(--ink-3); cursor: pointer; padding: 2px;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease);
}
.font-row-head:hover ~ .font-row-sub .copy-btn,
.font-row-sub:hover .copy-btn { opacity: 1; }
.font-row-expand {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease);
}
.font-row.expanded .font-row-expand {
  max-height: 900px;
  opacity: 1;
  padding-top: var(--sp-4);
}

/* ---------- SPECIMEN (DESIGN §5.8) -------------------------------------------------- */
.specimen { }
.specimen-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-3);
}
.specimen-toolbar .sample-field { display: flex; align-items: center; gap: 8px; }
.specimen-toolbar .sample-field input { width: 220px; }
.specimen-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 640px) { .specimen-pair { grid-template-columns: 1fr; } }
.specimen-pane {
  background: var(--surface-alt);
  border-radius: var(--r-m);
  padding: var(--sp-5);
  min-height: 120px;
}
.specimen-pane .pane-label { margin-bottom: var(--sp-3); }
.specimen-pane .pane-label .pdot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.specimen-text {
  color: var(--ink);
  line-height: 1.15;
  word-break: break-word;
  font-weight: 300;
}
.specimen-missing { font-size: var(--t-meta); color: var(--ink-3); }
.specimen-overlay-pane { position: relative; }
.specimen-overlay-pane .layer-ref {
  position: absolute; inset: var(--sp-5);
  color: var(--tint); opacity: 0.45;
}
.specimen-overlay-pane .layer-served { position: relative; color: var(--ink); }
.specimen-subset-note { font-size: var(--t-caption); color: var(--ink-3); margin-top: var(--sp-2); }

/* ---------- REVIEW QUEUE (DESIGN §5.9) --------------------------------------------- */
.review-list { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 760px; }
.review-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  padding: var(--sp-5);
  padding-left: calc(var(--sp-5) + 6px);
  transition: box-shadow var(--dur-fast) var(--ease), max-height var(--dur-slow) var(--ease),
              opacity var(--dur-slow) var(--ease);
}
.review-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 2px; background: var(--st-review);
}
.review-card.focused { box-shadow: var(--sh-2); outline: 2px solid var(--tint); outline-offset: 0; }
.review-card.exiting { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.review-card-head {
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2);
}
.review-card-head h2 { font-size: var(--t-title-s); line-height: var(--t-title-s-lh); font-weight: 600; }
.review-card-head h2 a:hover { color: var(--tint); }
.review-reason { font-size: var(--t-meta); color: var(--ink-2); margin-bottom: var(--sp-4); }
.review-served-url { font-size: var(--t-caption); color: var(--ink-2); margin-top: var(--sp-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
  margin-top: var(--sp-4); flex-wrap: wrap;
}
.review-actions .kbd-hint { margin-right: auto; font-size: var(--t-caption); color: var(--ink-3); }
.review-empty-hint { font-size: var(--t-meta); color: var(--ink-2); }

/* ---------- WATCHLIST (DESIGN §5.12) ------------------------------------------------ */
.watch-row {
  position: relative;
  display: grid;
  grid-template-columns: 16px auto 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  height: 56px;
  padding: 0 var(--sp-4) 0 calc(var(--sp-4) + 16px);
}
.watch-row + .watch-row { border-top: 1px solid var(--hairline); }
.watch-row .row-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--st-watch); }
.watch-row .row-actions { display: flex; align-items: center; gap: var(--sp-2); opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.watch-row:hover .row-actions, .watch-row .row-actions:focus-within { opacity: 1; }

/* ---------- EMPTY STATES ----------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-6);
}
.empty-state .empty-line1 { font-size: var(--t-body); color: var(--ink-2); margin-bottom: var(--sp-2); }
.empty-state .empty-line2 { font-size: var(--t-meta); color: var(--ink-3); margin-bottom: var(--sp-4); }

/* ---------- OUTREACH / THREAD (DESIGN §5.10) --------------------------------------- */
.outreach-groups { display: flex; flex-direction: column; gap: var(--sp-6); }
.outreach-group-title { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.outreach-thread-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
}
.outreach-thread-row + .outreach-thread-row { border-top: 1px solid var(--hairline); }
.outreach-thread-row .domain { font-weight: 600; font-size: var(--t-body); flex: 1; min-width: 0; }
.outreach-thread-row .snippet { font-size: var(--t-meta); color: var(--ink-2); flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outreach-thread-row .when { font-size: var(--t-caption); color: var(--ink-3); font-family: "TWK Lausanne Mono", ui-monospace, monospace; }

.thread { display: flex; flex-direction: column; gap: var(--sp-3); }
.msg {
  border-radius: var(--r-m);
  padding: 14px 16px;
  max-width: 92%;
}
.msg.msg-out { background: var(--tint-wash); }
.msg.msg-in  { background: var(--surface-alt); }
.msg-head {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--t-caption); color: var(--ink-2);
  font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  margin-bottom: 6px;
}
.msg-head .spacer { flex: 1; }
.msg-head .ts { color: var(--ink-3); }
.msg-seq { margin-bottom: 6px; }
.msg-subject { font-size: var(--t-caption); color: var(--ink-2); margin-bottom: 4px; }
.msg-body { font-size: var(--t-body); color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.msg-body a { color: var(--tint-ink); text-decoration: underline; }
.thread-footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  flex-wrap: wrap; margin-top: var(--sp-4);
}
.thread-footer .followup-note { font-size: var(--t-meta); color: var(--ink-2); }

/* ---------- COMPOSE SLIDE-OVER (DESIGN §5.11) -------------------------------------- */
.composer-scrim {
  position: fixed; inset: 0; background: rgba(29,29,31,0.2);
  z-index: 90;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}
.composer-scrim.open { opacity: 1; pointer-events: auto; }
.composer-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--panel-w); max-width: 100vw;
  background: var(--surface);
  box-shadow: var(--sh-4);
  border-radius: var(--r-l) 0 0 var(--r-l);
  z-index: 91;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-panel) var(--ease-panel);
}
.composer-panel.open { transform: translateX(0); }
.composer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5); border-bottom: 1px solid var(--hairline);
  font-size: var(--t-title-s); font-weight: 600;
}
.composer-body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.composer-from-row {
  display: flex; align-items: center; gap: 8px;
  font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  font-size: var(--t-meta); color: var(--ink-2);
}
.composer-snippets { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: var(--sp-4) 0; }
.snippet-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.snippet-chip {
  border-radius: var(--r-full); background: var(--fill); border: none; cursor: pointer;
  padding: 6px 12px; font-size: var(--t-caption); color: var(--ink-2);
}
.snippet-chip.selected { background: var(--tint-wash); color: var(--tint-ink); font-weight: 600; }
.composer-textarea {
  border: none; resize: vertical; min-height: 280px; flex: 1;
  font-size: var(--t-body); line-height: var(--t-body-lh); padding: 0;
}
.composer-textarea:focus { box-shadow: none; }
.var-chip { border-radius: var(--r-xs); padding: 1px 6px; font-family: "TWK Lausanne Mono", ui-monospace, monospace; font-size: 0.9em; }
.var-chip.resolved { background: var(--tint-wash); color: var(--tint-ink); }
.var-chip.unresolved { background: var(--st-trial-wash); color: var(--st-trial-ink); }
.composer-warning { font-size: var(--t-meta); color: var(--st-trial-ink); background: var(--st-trial-wash); border-radius: var(--r-s); padding: var(--sp-3); }
.composer-footer {
  border-top: 1px solid var(--hairline); padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap;
}
.composer-attach { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); color: var(--ink-2); }

.confirm-sheet-scrim {
  position: fixed; inset: 0; background: rgba(29,29,31,0.3); z-index: 95;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease);
}
.confirm-sheet-scrim.open { opacity: 1; pointer-events: auto; }
.confirm-sheet {
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-4);
  width: 480px; max-width: 92vw; padding: var(--sp-5);
  transform: translateY(8px); transition: transform var(--dur-panel) var(--ease-panel);
}
.confirm-sheet-scrim.open .confirm-sheet { transform: translateY(0); }
.confirm-preview {
  background: var(--surface-alt); border-radius: var(--r-s); padding: var(--sp-4);
  font-family: "TWK Lausanne Mono", ui-monospace, monospace; font-size: var(--t-meta);
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto;
  margin: var(--sp-4) 0;
}
.send-result { font-size: var(--t-meta); margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-s); }
.send-result.ok { background: var(--st-licensed-wash); color: var(--st-licensed-ink); }
.send-result.dry { background: var(--st-trial-wash); color: var(--st-trial-ink); }
.send-result.err { background: var(--st-unlicensed-wash); color: var(--st-unlicensed-ink); }

/* ---------- TOASTS ------------------------------------------------------------------ */
#toast-container {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: rgba(29,29,31,0.9); color: #fff; border-radius: var(--r-s);
  padding: 10px 16px; font-size: var(--t-meta);
  display: flex; align-items: center; gap: var(--sp-3);
  box-shadow: var(--sh-3);
  animation: toast-in var(--dur-base) var(--ease);
}
.toast button { background: transparent; border: none; color: var(--tint); font-weight: 600; cursor: pointer; padding: 0; font-size: var(--t-meta); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- ACTIVITY LOG ------------------------------------------------------------- */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { font-size: var(--t-meta); color: var(--ink-2); padding: 6px 0; }
.activity-list .ts { font-family: "TWK Lausanne Mono", ui-monospace, monospace; color: var(--ink-3); margin-right: var(--sp-2); }

/* ---------- EVIDENCE ----------------------------------------------------------------- */
.evidence-shot { border-radius: var(--r-xs); max-height: 160px; display: block; cursor: pointer; }
.css-extract { background: var(--surface-alt); font-family: "TWK Lausanne Mono", ui-monospace, monospace; font-size: var(--t-caption); padding: var(--sp-3); border-radius: var(--r-s); max-height: 200px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.evidence-row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }

/* ---------- LOGIN --------------------------------------------------------------------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 320px; text-align: center; }
.login-card h1 { font-size: var(--t-title); margin: var(--sp-3) 0 var(--sp-2); }
.login-card form { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-5); }
.login-error { font-size: var(--t-caption); color: var(--st-unlicensed-ink); background: var(--st-unlicensed-wash); border-radius: var(--r-s); padding: var(--sp-2) var(--sp-3); }

/* ---------- MENU DROPDOWN (site detail "⋯") ----------------------------------------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 200px; padding: 6px; z-index: 40;
  box-shadow: var(--sh-3);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-xs);
  font-size: var(--t-meta); color: var(--ink); font-weight: 300;
}
.menu-item:hover { background: var(--fill); }

/* ---------- MISC / LEGACY (sightings, case detail technical views) --------------------- */
.simple-table { width: 100%; border-collapse: collapse; font-size: var(--t-meta); }
.simple-table th {
  text-align: left; color: var(--ink-3); font-family: "TWK Lausanne Mono", ui-monospace, monospace;
  font-weight: 300; font-size: var(--t-caption); padding: var(--sp-3);
  border-bottom: 1px solid var(--hairline-2);
}
.simple-table td { padding: var(--sp-3); border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.back-link { display: inline-block; margin-bottom: var(--sp-4); color: var(--ink-2); font-size: var(--t-meta); }
.back-link:hover { color: var(--tint); }
.tab-panel { overflow: hidden; }
.tabs-strip { display: flex; border-bottom: 1px solid var(--hairline); padding: 0 var(--sp-2); }
.tabs-strip label {
  padding: var(--sp-4) var(--sp-3); font-size: var(--t-meta); font-weight: 600; color: var(--ink-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tabs-strip label:hover { color: var(--ink); }
.tab-body { padding: var(--sp-5); }
.tab-content { display: none; }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
#tab-overview:checked ~ .tabs-strip label[for="tab-overview"],
#tab-sources:checked ~ .tabs-strip label[for="tab-sources"],
#tab-checkout:checked ~ .tabs-strip label[for="tab-checkout"],
#tab-snippets:checked ~ .tabs-strip label[for="tab-snippets"],
#tab-notes:checked ~ .tabs-strip label[for="tab-notes"] { color: var(--ink); border-bottom-color: var(--tint); }
#tab-overview:checked ~ .tab-body .tab-content.panel-overview,
#tab-sources:checked ~ .tab-body .tab-content.panel-sources,
#tab-checkout:checked ~ .tab-body .tab-content.panel-checkout,
#tab-snippets:checked ~ .tab-body .tab-content.panel-snippets,
#tab-notes:checked ~ .tab-body .tab-content.panel-notes { display: block; }
.dispute-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 1000px) { .dispute-layout { grid-template-columns: 1fr; } }
.thread-panel { display: flex; flex-direction: column; max-height: 82vh; }
.thread-panel .thread-header { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--hairline); font-weight: 600; font-size: var(--t-meta); }
.thread-panel .thread-scroll { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-5); }
.thread-panel .compose-box { border-top: 1px solid var(--hairline); padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: 8px; }
.thread-panel textarea, .thread-panel input { width: 100%; }
.notes-textarea { width: 100%; min-height: 260px; resize: vertical; }
.site-shot { border-radius: var(--r-m); overflow: hidden; background: var(--surface-alt); max-height: 320px; display: flex; align-items: flex-start; justify-content: center; }
.site-shot img { width: 100%; display: block; }
.kv-row { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.notice-box {
  font-size: var(--t-meta); color: var(--ink-2); background: var(--surface-alt);
  border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
}
.error-box {
  font-size: var(--t-meta); color: var(--st-unlicensed-ink); background: var(--st-unlicensed-wash);
  border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
}
