/* ==========================================================================
   GBP Extract — "Night Hunt" (domainhunt.us brand system)
   Tokens are copied from DomainHuntAgency/src/styles/global.css; rationale in docs/DESIGN.md.
   Pink = actions and the locked target only. Signal green = a passed check, on dark.
   ========================================================================== */

@font-face { font-family: 'Figtree Variable'; font-style: normal; font-display: swap; font-weight: 300 900; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'JetBrains Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 800; src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-display: swap; font-weight: 400; src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); }

:root {
  --night-950: #06061a;
  --night-900: #0b0a26;
  --night-850: #100e31;
  --night-800: #16133f;
  --night-700: #221b5b;
  --violet-600: #3a248f;
  --violet-500: #5a3fd6;
  --violet-400: #7d66f0;
  --lilac-300: #c3b5ff;
  --lilac-200: #ddd4ff;
  --lilac-100: #efeaff;

  --lock-400: #ff4d97;
  --lock-500: #ff2d87;
  --lock-600: #e0106a;
  --lock-700: #c40c5b;

  --signal-400: #4ff0b4;
  --signal-700: #0b7a54;
  --signal-tint: #e2f8ef;

  --drop-400: #ffc65c;
  --drop-700: #8a5a00;
  --drop-tint: #fff2d4;

  --paper: #f7f5fc;
  --paper-2: #efebf9;
  --card: #ffffff;
  --ink: #15122f;
  --ink-2: #2a2650;
  --muted: #57537a;
  --line: #e3ddf3;
  --line-dark: rgba(195, 181, 255, 0.14);
  --text-on-dark: rgba(236, 232, 255, 0.78);
  --lock-tint: #ffe7f1;

  /* Semantic roles. Components use ONLY these for theme-sensitive colour; the dark theme re-maps them. */
  --accent: var(--violet-500);          /* italic accent words, links, empty-state mark */
  --accent-strong: var(--violet-600);   /* text on tinted chips / category labels */
  --lock-text: var(--lock-700);         /* pink TEXT (never a button fill) */
  --signal-text: var(--signal-700);
  --drop-text: var(--drop-700);
  --field-bg: #ffffff;                  /* inputs, selects, tier rows, stepper */
  --btn-ink-bg: var(--ink);             /* ink buttons, selected segments & tabs */
  --btn-ink-fg: #ffffff;
  --btn-ink-hover: var(--violet-600);
  --ghost-border: rgba(21, 18, 47, 0.22);
  --ghost-hover: rgba(21, 18, 47, 0.04);
  --bar-bg: var(--ink);                 /* bulk bar + toasts (white text on top) */
  --star-off: #d9d3ec;
  --meter-fill: var(--violet-500);
  --focus-ring: rgba(90, 63, 214, 0.15);

  --font-sans: 'Figtree Variable', 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --shadow-soft: 0 1px 2px rgba(21, 18, 47, 0.06), 0 8px 24px -12px rgba(21, 18, 47, 0.18);
  --shadow-lift: 0 2px 4px rgba(21, 18, 47, 0.06), 0 24px 48px -20px rgba(21, 18, 47, 0.35);
  --glow-lock: 0 10px 30px -8px rgba(255, 45, 135, 0.55);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: 16px;
  --side-w: 272px;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --gutter: 40px; } }

/* Dark theme: the same Night Hunt navy, lifted for reading surfaces. Applied via <html data-theme="dark">,
   which theme-init.js / theme.js set from the saved choice (Light, Dark or System). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14113a;
  --paper-2: #1f1b52;
  --card: #1a1646;
  --ink: #f2efff;
  --ink-2: #ddd6ff;
  --muted: #a9a3d0;
  --line: rgba(195, 181, 255, 0.17);
  --lilac-100: rgba(125, 102, 240, 0.22);
  --signal-tint: rgba(79, 240, 180, 0.13);
  --drop-tint: rgba(255, 198, 92, 0.13);
  --lock-tint: rgba(255, 77, 151, 0.16);
  --accent: #a99bff;
  --accent-strong: #cfc4ff;
  --lock-text: #ff8fbf;
  --signal-text: #4ff0b4;
  --drop-text: #ffc65c;
  --field-bg: #100e32;
  --btn-ink-bg: #ddd4ff;
  --btn-ink-fg: #0b0a26;
  --btn-ink-hover: #c3b5ff;
  --ghost-border: rgba(195, 181, 255, 0.34);
  --ghost-hover: rgba(195, 181, 255, 0.08);
  --bar-bg: #2a2370;
  --star-off: rgba(195, 181, 255, 0.28);
  --meter-fill: #7d66f0;
  --focus-ring: rgba(169, 155, 255, 0.28);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}
:root[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9a3d0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}
:root[data-theme="dark"] .input::placeholder, :root[data-theme="dark"] .textarea::placeholder { color: #7f79aa; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0; background: var(--night-900); color: var(--ink);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11'; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--lock-500); color: #fff; }
:focus-visible { outline: 3px solid var(--lock-400); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: #fff; color: #15122f; padding: 10px 16px; border-radius: 10px; font-weight: 700; transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero', 'tnum'; letter-spacing: 0; }
.muted { color: var(--muted); }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }
.i-fill { fill: currentColor; stroke: none; }
.i .dot { fill: currentColor; stroke: none; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(195,181,255,.25); border-top-color: var(--lock-400); animation: spin .8s linear infinite; display: inline-block; }
.btn .spinner, .inline-spin { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; background: var(--night-900); }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 20px; padding: 24px 18px 20px;
  color: #fff; overflow-y: auto;
  background:
    radial-gradient(70% 40% at 100% 0%, rgba(255, 45, 135, .16), transparent 70%),
    radial-gradient(90% 50% at 0% 100%, rgba(90, 63, 214, .35), transparent 70%),
    linear-gradient(180deg, var(--night-850), var(--night-950));
}
.logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; color: #fff; }
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-bg { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.18); }
.logo-dot { fill: var(--lock-500); }
.logo-word { font-weight: 600; font-size: 1.25rem; letter-spacing: -.04em; }
.logo-word b { font-weight: 800; }
.side-app { font-family: var(--font-mono); font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--lilac-300); margin: 4px 0 0 46px; }
.nav { display: grid; gap: 4px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 14px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer;
  color: var(--text-on-dark); font-weight: 600; font-size: .9688rem; transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav a:hover, .nav button:hover { background: rgba(195,181,255,.09); color: #fff; }
.nav a[aria-current="page"] { background: rgba(195,181,255,.14); color: #fff; }
.nav a[aria-current="page"]::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--lock-500); box-shadow: 0 0 0 4px rgba(255,45,135,.18); }
.nav-label { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(195,181,255,.76); padding: 10px 14px 4px; }
.side-spacer { flex: 1; }
.side-card { border: 1px solid var(--line-dark); border-radius: 18px; padding: 14px; background: rgba(255,255,255,.03); display: grid; gap: 8px; }
.side-card .readout { font-size: 1.125rem; font-weight: 700; color: #fff; }
.side-card .cap { font-size: .75rem; color: var(--text-on-dark); }
.runner-pill { display: none; }
.runner-pill.on { display: block; }
.runner-pill a { display: grid; gap: 4px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--signal-400); box-shadow: 0 0 0 0 rgba(79,240,180,.6); animation: pulse 1.8s infinite; margin-right: 6px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(79,240,180,0); } 100% { box-shadow: 0 0 0 0 rgba(79,240,180,0); } }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #ddd4ff; color: #3a248f; font-weight: 750; font-size: .9375rem; flex: none; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9375rem; }
.user-chip .who span { font-size: .75rem; color: var(--text-on-dark); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: none; cursor: pointer; color: inherit; transition: background-color .2s var(--ease), border-color .2s var(--ease); flex: none; }
.side .icon-btn:hover { background: rgba(255,255,255,.1); }

.topbar, .scrim { display: none; }
.main {
  background: var(--paper); border-radius: var(--radius-xl) 0 0 var(--radius-xl); min-width: 0; position: relative; z-index: 2;
  min-height: 100dvh; box-shadow: -30px 0 60px -30px rgba(0,0,0,.45);
}
.page { width: 100%; max-width: 1180px; margin-inline: auto; padding: 44px var(--gutter) 96px; }
.page-narrow { max-width: 860px; }

@media (max-width: 959px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .28s var(--ease), box-shadow .28s; z-index: 60; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(6,6,26,.6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 var(--gutter); color: #fff; position: sticky; top: 0; z-index: 40; background: var(--night-900); }
  .topbar .icon-btn:hover { background: rgba(255,255,255,.1); }
  .main { border-radius: 28px 28px 0 0; min-height: calc(100dvh - 64px); box-shadow: none; }
  .page { padding-top: 28px; }
}

/* ---------- Typography ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lock-text); }
.eyebrow::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.h1 { font-size: clamp(2.1rem, 4.2vw, 3.3rem); line-height: 1.05; font-weight: 750; letter-spacing: -.035em; text-wrap: balance; }
.h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.12; font-weight: 700; letter-spacing: -.028em; text-wrap: balance; }
.h3 { font-size: 1.0938rem; line-height: 1.3; font-weight: 700; letter-spacing: -.012em; }
.h1 em, .h2 em, .h3 em, .accent { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; font-size: 1.08em; line-height: .9; color: var(--accent); }
.on-dark .h1 em, .on-dark .h2 em, .on-dark .accent { color: #ff8cbd; }
.lead { color: var(--muted); font-size: 1.0625rem; max-width: 62ch; }
.page-head { display: grid; gap: 12px; margin-bottom: 32px; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.crumb:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn { --btn-h: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--btn-h); padding: 0 24px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 650; font-size: 1rem; letter-spacing: -.005em; line-height: 1; white-space: nowrap; cursor: pointer; background: none; transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), opacity .2s; }
.btn .i { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-lock { background: var(--lock-600); color: #fff; box-shadow: var(--glow-lock); }
.btn-lock:hover { background: var(--lock-700); transform: translateY(-1px); }
.btn-ink { background: var(--btn-ink-bg); color: var(--btn-ink-fg); }
.btn-ink:hover { background: var(--btn-ink-hover); transform: translateY(-1px); }
.btn-ghost { border-color: var(--ghost-border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ghost-hover); }
.btn-danger { border-color: rgba(196,12,91,.35); color: var(--lock-text); }
.btn-danger:hover { background: var(--lock-tint); border-color: var(--lock-text); }
.btn-white { background: #fff; color: #15122f; }
.btn-white:hover { background: #efeaff; }
.btn-ghost-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-sm { --btn-h: 40px; padding: 0 16px; font-size: .9375rem; }
.btn-block { width: 100%; }
.icon-btn.ink { color: var(--muted); }
.icon-btn.ink:hover { background: var(--paper-2); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 24px; }
.card + .card, .stack > * + * { margin-top: 20px; }
.card-tight { padding: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head p { color: var(--muted); font-size: .9375rem; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
@media (max-width: 1179px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .card { padding: 18px; } }
.panel-dark { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-lg); color: #fff; padding: 28px;
  background: radial-gradient(60% 70% at 85% 10%, rgba(255,45,135,.18), transparent 60%), radial-gradient(70% 80% at 0% 100%, rgba(90,63,214,.45), transparent 60%), linear-gradient(160deg, var(--night-850), var(--night-950) 70%); }
.panel-dark .muted { color: var(--text-on-dark); }

/* ---------- Stat tiles / meter ---------- */
.stat { display: grid; gap: 6px; }
.stat .label { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--font-mono); font-feature-settings: 'zero','tnum'; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .value small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.stat .sub { font-size: .8125rem; color: var(--muted); }
.meter { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--meter-fill); transition: width .5s var(--ease); }
.meter[data-state="warn"] > span { background: var(--drop-400); }
.meter[data-state="full"] > span { background: var(--lock-600); }
.side .meter { background: rgba(255,255,255,.1); }
.side .meter > span { background: var(--signal-400); }
.side .meter[data-state="warn"] > span { background: var(--drop-400); }
.side .meter[data-state="full"] > span { background: var(--lock-400); }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .8125rem; font-weight: 650; line-height: 1.4; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip .i { width: 14px; height: 14px; }
.chip-ok { background: var(--signal-tint); color: var(--signal-text); }
.chip-err { background: var(--lock-tint); color: var(--lock-text); }
.chip-warn { background: var(--drop-tint); color: var(--drop-text); }
.chip-violet { background: var(--lilac-100); color: var(--accent-strong); }
.chip-mono { font-family: var(--font-mono); font-size: .75rem; font-weight: 600; }
.panel-dark .chip { background: rgba(195,181,255,.14); color: var(--lilac-200); }
.panel-dark .chip-ok { background: rgba(79,240,180,.14); color: var(--signal-400); }
.panel-dark .chip-err { background: rgba(255,77,151,.16); color: #ff9cc6; }
.panel-dark .chip-warn { background: rgba(255,198,92,.16); color: var(--drop-400); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field > label, .label { font-weight: 650; font-size: .9063rem; color: var(--ink-2); }
.hint { font-size: .8438rem; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field-bg); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--lilac-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
.input::placeholder, .textarea::placeholder { color: #9a96b8; }
.textarea { padding: 14px 16px; min-height: 200px; line-height: 1.5; resize: vertical; font-family: var(--font-mono); font-size: .875rem; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357537a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
.input-sm, .select-sm { min-height: 40px; border-radius: 12px; font-size: .9375rem; }
.input-lg { min-height: 60px; font-size: 1.0625rem; border-radius: 18px; padding: 0 20px; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 50px; }
.input-icon .reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 639px) { .form-grid { grid-template-columns: 1fr; } }
.span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9375rem; }
.check input { width: 20px; height: 20px; accent-color: var(--violet-500); margin: 2px 0 0; flex: none; }
.form-error { color: var(--lock-text); background: var(--lock-tint); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .9063rem; }
.form-ok { color: var(--signal-text); background: var(--signal-tint); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .9063rem; }

/* Segmented toggle: Single | Bulk */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); gap: 2px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 20px; border-radius: 999px; border: 0; background: none; cursor: pointer; font-weight: 650; color: var(--muted); transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--btn-ink-bg); color: var(--btn-ink-fg); box-shadow: var(--shadow-soft); }

/* Tier cards */
/* Tier picker: one roomy row per tier (dot · name + what you get · free allowance), never squeezed into columns. */
.tiers { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.tier { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "dot name free" "dot blurb free"; align-items: center; column-gap: 16px; row-gap: 2px; padding: 16px 20px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--field-bg); cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.tier:hover { border-color: var(--lilac-300); }
.tier input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tier:has(input:checked) { border-color: var(--ink); background: var(--lilac-100); box-shadow: 0 0 0 3px var(--focus-ring); }
.tier:has(input:focus-visible) { outline: 3px solid var(--lock-400); outline-offset: 2px; }
.tier .t-dot { grid-area: dot; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: var(--field-bg); }
.tier:has(input:checked) .t-dot { border-color: var(--lock-600); background: var(--lock-600); box-shadow: 0 0 0 4px rgba(224,16,106,.15), inset 0 0 0 3px var(--field-bg); }
.tier .t-name { grid-area: name; font-weight: 700; font-size: 1.0313rem; letter-spacing: -.01em; line-height: 1.3; }
.tier .t-blurb { grid-area: blurb; font-size: .875rem; color: var(--muted); line-height: 1.45; }
.tier .t-free { grid-area: free; justify-self: end; white-space: nowrap; font-family: var(--font-mono); font-size: .75rem; font-weight: 600; color: var(--accent-strong); background: var(--paper-2); border-radius: 999px; padding: 5px 12px; }
.tier:has(input:checked) .t-free { background: var(--card); }
@media (max-width: 559px) {
  .tier { grid-template-columns: 22px minmax(0, 1fr); grid-template-areas: "dot name" "dot blurb" "dot free"; padding: 14px 16px; }
  .tier .t-free { justify-self: start; margin-top: 6px; }
}

.stepper { display: inline-flex; align-items: center; width: max-content; justify-self: start; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field-bg); overflow: hidden; }
.stepper button { width: 44px; height: 46px; border: 0; background: none; cursor: pointer; font-size: 1.25rem; color: var(--muted); }
.stepper button:hover { background: var(--paper-2); color: var(--ink); }
.stepper output { min-width: 44px; text-align: center; font-family: var(--font-mono); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 16px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--paper); }
.table .biz { display: grid; gap: 2px; min-width: 0; }
.table td:nth-child(2) .biz { min-width: 200px; }
.table .biz a { font-weight: 650; letter-spacing: -.01em; }
.table .biz a:hover { color: var(--accent); }
.table .biz span { font-size: .8438rem; color: var(--muted); }
.table .biz .cat { color: var(--accent-strong); font-weight: 600; }
.table .biz .when { font-family: var(--font-mono); font-size: .8438rem; color: var(--ink); min-width: 118px; }
.table .biz .meter { margin: 4px 0; }
.table .num { font-family: var(--font-mono); font-feature-settings: 'zero','tnum'; white-space: nowrap; }
.table .act { text-align: right; white-space: nowrap; padding-right: 12px; }
.table .icon-btn { width: 34px; height: 34px; }
.table .id { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--violet-500); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: .9063rem; }

.filters, .filters-inner { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
.filters > *, .filters-inner > * { grid-column: span 3; }
.filters .f-wide { grid-column: span 6; }
.filters .f-more { grid-column: 1 / -1; }
.filters .f-more summary { cursor: pointer; font-weight: 650; color: var(--accent-strong); display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.filters .f-more .filters-inner { margin-top: 12px; }
@media (max-width: 639px) { .filters > *, .filters .f-wide, .filters-inner > * { grid-column: 1 / -1; } }
.filters .field > label { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pager .select { width: auto; min-width: 80px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.chips .mono { font-size: .75rem; color: var(--muted); }
.side { scrollbar-width: thin; scrollbar-color: rgba(195,181,255,.25) transparent; }

.bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: var(--bar-bg); color: #fff; margin-bottom: 12px; }

/* ---------- Result detail ---------- */
.hero-biz { display: grid; gap: 14px; }
.hero-biz .name { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.04; }
.hero-biz .addr { color: var(--text-on-dark); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 4px; }
.readout { font-family: var(--font-mono); font-feature-settings: 'zero','tnum'; font-size: .8125rem; font-weight: 600; letter-spacing: 0; }
.fact { display: grid; gap: 2px; }
.fact b { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; }
.fact span { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin: 24px 0 20px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: none; font-weight: 650; color: var(--muted); cursor: pointer; transition: background-color .2s var(--ease), color .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--btn-ink-bg); color: var(--btn-ink-fg); box-shadow: var(--shadow-soft); }
.kv { display: grid; grid-template-columns: minmax(104px, 34%) minmax(0, 1fr); gap: 10px 18px; font-size: .9688rem; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .875rem; }
.kv dd { overflow-wrap: anywhere; }
.kv dd a { color: var(--accent); font-weight: 600; }
.kv dd a:hover { text-decoration: underline; }
@media (max-width: 639px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dt { margin-top: 10px; } }
.hours-grid { display: grid; gap: 4px; max-width: 460px; }
.hours-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 14px; border-radius: 12px; }
.hours-row:nth-child(odd) { background: var(--paper); }
.hours-row.today { background: var(--lilac-100); font-weight: 700; }
.stars { display: inline-flex; gap: 1px; color: var(--drop-400); }
.stars .i { width: 15px; height: 15px; }
.stars .off { color: var(--star-off); }
.table .biz .stars { color: var(--drop-400); } /* beat the table's muted-span rule */
.review { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-head img, .review-head .avatar { width: 40px; height: 40px; border-radius: 50%; }
.review-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.review-imgs img { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.owner-reply { margin: 4px 0 0 20px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 0 14px 14px 0; font-size: .9375rem; }
.owner-reply p { margin-top: 4px; }
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.photo { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo .ph { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--muted); font-size: .8125rem; padding: 12px; text-align: center; }
.photo figcaption { padding: 10px 12px; font-size: .75rem; color: var(--muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cov-group { margin-top: 22px; }
.cov-group h3 { margin-bottom: 10px; }
.cov-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cov { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: .875rem; }
.cov .i { width: 16px; height: 16px; }
.cov.yes .i { color: var(--signal-text); }
.cov.no { color: var(--muted); background: var(--paper); }
.cov small { margin-left: auto; font-family: var(--font-mono); font-size: .6875rem; color: var(--muted); }
.code { position: relative; background: var(--night-950); color: var(--text-on-dark); border-radius: var(--radius); padding: 22px; font-family: var(--font-mono); font-size: .8125rem; line-height: 1.6; overflow: auto; max-height: 70vh; white-space: pre; tab-size: 2; }
.code .k { color: var(--lilac-300); } .code .s { color: var(--signal-400); } .code .n { color: var(--drop-400); } .code .b { color: #ff8cbd; }

/* ---------- Batch ---------- */
.big-count { font-family: var(--font-mono); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.progress { height: 12px; border-radius: 99px; background: rgba(195,181,255,.18); overflow: hidden; display: flex; }
.progress span { height: 100%; transition: width .5s var(--ease); }
.progress .p-done { background: var(--signal-400); }
.progress .p-skip { background: var(--lilac-300); }
.progress .p-fail { background: var(--lock-400); }

/* ---------- Dialog / toast ---------- */
dialog { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lift); color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(6,6,26,.62); backdrop-filter: blur(3px); }
.dlg { padding: 28px; display: grid; gap: 18px; }
.dlg-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--bar-bg); color: #fff; box-shadow: var(--shadow-lift); font-weight: 600; font-size: .9375rem; animation: toast-in .3s var(--ease); }
.toast .i { margin-top: 2px; }
.toast.ok .i { color: var(--signal-400); } .toast.err .i { color: var(--lock-400); } .toast.warn .i { color: var(--drop-400); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 18px; background: var(--drop-tint); color: var(--drop-text); margin-bottom: 24px; }
.banner.err { background: var(--lock-tint); color: var(--lock-text); }
.banner .i { margin-top: 2px; }
.banner a { font-weight: 700; text-decoration: underline; }
.empty { text-align: center; padding: 56px 20px; display: grid; gap: 14px; justify-items: center; color: var(--muted); }
.empty .reticle { width: 72px; height: 72px; color: var(--accent); }
.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--paper-2), var(--card), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 20px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Auth screens ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; background: var(--night-900); }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px clamp(24px, 5vw, 72px); color: #fff;
  background: radial-gradient(60% 70% at 85% 10%, rgba(255,45,135,.2), transparent 60%), radial-gradient(70% 80% at 0% 100%, rgba(90,63,214,.5), transparent 60%), linear-gradient(160deg, var(--night-850), var(--night-950) 70%); }
.auth-art .h1 { max-width: 14ch; }
.auth-art .lead { color: var(--text-on-dark); }
.radar { position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; opacity: .9; pointer-events: none; }
.radar circle { fill: none; stroke: rgba(195,181,255,.2); stroke-width: 1; }
.radar .sweep { transform-origin: 260px 260px; animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar .blip { fill: var(--signal-400); animation: blip 6s linear infinite; opacity: 0; }
.radar .blip:nth-of-type(2) { animation-delay: 1.4s; } .radar .blip:nth-of-type(3) { animation-delay: 3.1s; } .radar .blip:nth-of-type(4) { animation-delay: 4.6s; }
@keyframes blip { 0%, 6% { opacity: 1; } 40% { opacity: 0; } }
.auth-form { background: var(--paper); border-radius: var(--radius-xl) 0 0 var(--radius-xl); display: grid; place-items: center; padding: 40px var(--gutter); }
.auth-card { width: min(100%, 420px); display: grid; gap: 22px; }
.auth-points { display: grid; gap: 10px; color: var(--text-on-dark); font-size: .9688rem; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points .i { color: var(--signal-400); margin-top: 3px; }
@media (max-width: 859px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding-bottom: 72px; gap: 24px; }
  .auth-art .h1 { max-width: none; }
  .auth-form { border-radius: 28px 28px 0 0; margin-top: -28px; position: relative; padding-top: 36px; }
  .radar { width: 340px; height: 340px; right: -100px; bottom: auto; top: -60px; opacity: .5; }
}

/* ---------- Theme switcher ---------- */
.theme-seg button .i { width: 18px; height: 18px; }
.seg-compact { padding: 3px; }
.seg-compact button { min-height: 34px; min-width: 38px; padding: 0 10px; justify-content: center; }
.auth-form { position: relative; }
.theme-corner { position: absolute; top: 18px; right: 18px; z-index: 2; }
.user-chip .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .icon-btn { width: 36px; height: 36px; }
@media (max-width: 859px) { .theme-corner { top: 14px; right: 14px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
