/* Industry Tracker portal - vanilla CSS, no framework.
   Palette tokens named per DESIGN-DIRECTION.md, refined toward a premium
   institutional feel: subtle depth, soft shadows, restrained motion. */

/* Self-hosted brand fonts (2026-07-16, owner pick round 3 option 1): Lora
   (Tiempos-class editorial serif, single-stroke dollar) + Libre Franklin (body). Variable woff2, latin subset, same-origin
   (CSP font-src 'self'). */
@font-face {
  font-family: "Lora";
  src: url("fonts/lora.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/libre-franklin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* THEMING (owner request 2026-07-05): two palettes behind one token set,
   switched by html[data-theme]. DARK (the default) is a deep desaturated
   slate with light text; LIGHT is the original DESIGN-DIRECTION palette.
   The page BACKGROUND + map art are themed too (2026-07-06): deep blue
   field with re-inked map layers in dark, the original light field in
   light (see the body rule and the map-layer overrides below).
   In dark mode --accent is a greyed light azure because it is mostly
   text/links on dark panels. --fill-* tokens carry the solid navy for
   controls that need a FILL (primary buttons, brand mark, segment/day
   actives); the header block and tab pill stay navy in both themes via
   --head-* / --pill-*. A tiny inline script in each page's <head> sets
   data-theme from localStorage BEFORE this sheet paints. */
:root {
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", "Consolas", "Liberation Mono", "Courier New", monospace;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;

  /* Brand logo tile: ONE fixed blue for the "SB" square everywhere (favicon,
     portal header, sign-in, onboarding, landing nav). Theme-independent on
     purpose so the mark is a consistent brand color; bright enough to hold on
     the dark navy header and clean on white, with a light rim for definition
     on dark. Keep in sync with the favicon hex (#0F2D52) and landing.css. */
  --brand-logo: #0F2D52;
}

/* Dark, the default theme. */
:root, html[data-theme="dark"] {
  --paper: #060D16;
  --surface: #0D1B2A;
  --surface-2: #122537;
  --ink: #EDF2F7;
  --ink-body: #CBD6E1;
  --muted: #8494A6;
  --hairline: #22344A;
  --hairline-strong: #31465E;
  --zebra: #101F30;
  --accent: #82A8D3;
  --accent-2: #9DBCDE;
  --accent-hover: #B4CCE7;
  --accent-tint: #16283C;
  --accent-line: #35506E;
  --gain: #46C08D;
  --loss: #F08A7C;
  --loss-tint: rgba(240, 138, 124, 0.14);
  --policy: #D9AE5F;
  --policy-tint: #2E2410;
  --policy-line: #55401A;
  --marker: #EDF2F7;
  --track: #22344A;
  --placeholder: #66788D;

  --fill-a: #2A4C71;
  --fill-b: #1F3C5C;
  --fill-hover-a: #33587F;
  --fill-hover-b: #2A4C71;
  --fill-border: #3E5C7E;
  --head-glow: rgba(228, 185, 91, 0.09);
  --head-a: #070F19;
  --head-b: #0D1B2A;
  --head-c: #13273A;
  --pill-a: #070F19;
  --pill-b: #122537;
  --banner-bg: rgba(9, 17, 27, 0.85);
  --memo-border: rgba(255, 255, 255, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.34), 0 2px 6px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.48), 0 4px 12px rgba(0, 0, 0, 0.32);
  --ring: 0 0 0 3px rgba(130, 168, 211, 0.25);
}

/* Light, the original palette. */
html[data-theme="light"] {
  --paper: #FBFAF8;
  --surface: #FFFFFE;
  --surface-2: #F3F5F8;
  --ink: #1A1D23;
  --ink-body: #33373D;
  --muted: #5B6470;
  --hairline: #E4E7EC;
  --hairline-strong: #D3D8E0;
  --zebra: #F5F6F8;
  --accent: #10457E;
  --accent-2: #16599E;
  --accent-hover: #0A3765;
  --accent-tint: #EAF1F9;
  --accent-line: #D3E1F1;
  --gain: #157347;
  --loss: #B42318;
  --loss-tint: #FBEBE9;
  --policy: #B45309;
  --policy-tint: #FBF1E4;
  --policy-line: #EAD6BC;
  --marker: #1A1D23;
  --track: #E6E9EE;
  --placeholder: #9AA1AC;

  --fill-a: #16599E;
  --fill-b: #10457E;
  --fill-hover-a: #10457E;
  --fill-hover-b: #0A3765;
  --fill-border: #10457E;
  --head-glow: rgba(228, 185, 91, 0.14);
  --head-a: #0A2A4D;
  --head-b: #10457E;
  --head-c: #16599E;
  --pill-a: #0A2A4D;
  --pill-b: #10457E;
  --banner-bg: rgba(255, 255, 255, 0.72);
  --memo-border: #E4E7EC;

  --shadow-sm: 0 1px 2px rgba(20, 28, 40, 0.05), 0 1px 3px rgba(20, 28, 40, 0.05);
  --shadow-md: 0 6px 16px rgba(20, 28, 40, 0.07), 0 2px 6px rgba(20, 28, 40, 0.05);
  --shadow-lg: 0 20px 48px rgba(20, 28, 40, 0.16), 0 4px 12px rgba(20, 28, 40, 0.06);
  --ring: 0 0 0 3px rgba(16, 69, 126, 0.16);
}

* { box-sizing: border-box; }

/* Make the hidden attribute authoritative over any class display rule. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink-body);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  /* Solid fallback close to the dark gradient's midpoint; the actual page
     gradients live on the two fixed pseudo-layers below so a theme switch
     CROSSFADES them (gradients cannot transition, opacity can). */
  background: #071322;
}
html[data-theme="light"] body { background: #D3DCE5; }
/* Dark mode (the default) pairs the slate panels with a DEEP BLUE page
   gradient (owner request 2026-07-06), darker and bluer than --surface so
   the central sheet still pops; light mode gets the grey-blue gradient
   (owner request 2026-07-05). Both layers always exist; the active theme
   fades its layer in (owner request 2026-07-07: smooth theme switch). */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2; /* under .bg-graphic (-1), over the body fallback color */
  pointer-events: none;
  /* No permanent transition: the View Transitions crossfade owns the
     theme switch; the html.theme-anim rules below are the fallback. */
}

/* THEME SWITCH v5 (owner 2026-07-07: per-element transitions still read
   choppy; every element repainting for 1.4s tanks the frame rate). The
   toggle now runs document.startViewTransition(): the browser snapshots
   the old and new page and crossfades them ON THE COMPOSITOR, one smooth
   GPU fade regardless of page complexity. These rules set its pace. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.45, 0.05, 0.25, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.001ms; }
}
body::before {
  background: linear-gradient(180deg, #05101F 0%, #081A33 100%);
  opacity: 1;
}
body::after {
  background: linear-gradient(180deg, #DCE3EB 0%, #C9D3DF 100%);
  opacity: 0;
}
html[data-theme="light"] body::before { opacity: 0; }
html[data-theme="light"] body::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  body::before, body::after,
  .bg-graphic *::before, .bg-graphic *::after,
  #world-map, #world-map-hi, #city-dots circle, .bg-scanline { transition: none; }
}

/* FALLBACK ONLY (browsers without the View Transitions API): while
   html.theme-anim is present (1.6s), color-bearing properties transition
   everywhere at a shared pace. Opacity and transform are deliberately NOT
   on this list: the map animator drives those per-frame and a transition
   would fight it. */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition:
    background-color 1.4s cubic-bezier(0.45, 0.05, 0.25, 1),
    color 1.4s cubic-bezier(0.45, 0.05, 0.25, 1),
    border-color 1.4s cubic-bezier(0.45, 0.05, 0.25, 1),
    box-shadow 1.4s cubic-bezier(0.45, 0.05, 0.25, 1),
    fill 1.4s cubic-bezier(0.45, 0.05, 0.25, 1),
    stroke 1.4s cubic-bezier(0.45, 0.05, 0.25, 1) !important;
}
/* The blanket rule above would otherwise REPLACE the background layers'
   opacity crossfades and the map ink transitions (a transition shorthand
   overwrites, never merges); restore them explicitly at the same 1s pace. */
html.theme-anim body::before,
html.theme-anim body::after,
html.theme-anim .bg-graphic *::before,
html.theme-anim .bg-graphic *::after {
  transition: opacity 1.4s cubic-bezier(0.45, 0.05, 0.25, 1) !important;
}
html.theme-anim #world-map,
html.theme-anim #world-map-hi {
  transition: stroke 1.4s cubic-bezier(0.45, 0.05, 0.25, 1), stroke-opacity 1.4s cubic-bezier(0.45, 0.05, 0.25, 1) !important;
}
html.theme-anim #city-dots circle {
  transition: fill 1.4s cubic-bezier(0.45, 0.05, 0.25, 1) !important;
}
html.theme-anim .bg-scanline {
  transition: background-color 1.4s cubic-bezier(0.45, 0.05, 0.25, 1), box-shadow 1.4s cubic-bezier(0.45, 0.05, 0.25, 1) !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-anim *,
  html.theme-anim *::before,
  html.theme-anim *::after { transition: none !important; }
}

/* Focus visibility everywhere. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.top-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--fill-b), var(--fill-a));
  width: 100%;
}

/* --------------------- Finance/tech background layer ---------------- */
.bg-graphic {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-graphic svg { display: block; width: 100%; height: 100%; }
.bg-graphic .it-skyline { will-change: transform; animation: itDrift 60s ease-in-out infinite alternate; }
@keyframes itDrift { from { transform: translateX(0); } to { transform: translateX(-8px); } }
@media (prefers-reduced-motion: reduce) { .bg-graphic .it-skyline { animation: none; } }

.proto-banner {
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-align: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--banner-bg);
  backdrop-filter: saturate(1.2) blur(2px);
}

/* ------------------------------- Brand mark ---------------------------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand-logo);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  /* No inset top highlight: it sat over the border and read as a thicker top
     edge. A plain even rim only. */
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

/* ------------------------------- Buttons ------------------------------- */
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 11px 16px;
  cursor: pointer;
  background: none;
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    color 0.15s ease, transform 0.06s ease;
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary {
  background: linear-gradient(180deg, var(--fill-a), var(--fill-b));
  color: #ffffff;
  border-color: var(--fill-a);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--fill-hover-a), var(--fill-hover-b));
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); }

.btn-outline {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); }

.btn-text {
  background: none;
  color: var(--accent);
  border-color: transparent;
  padding: 11px 8px;
}
.btn-text:hover:not(:disabled) { color: var(--accent-hover); text-decoration: underline; }
.btn-text-danger { color: var(--loss); }
.btn-text-danger:hover:not(:disabled) { color: var(--loss); }

.btn-block { display: block; width: 100%; }

/* ------------------------------- Inputs -------------------------------- */
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}
.label-soft { font-weight: 400; color: var(--placeholder); }

.text-input, .select-input, .textarea-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input::placeholder, .textarea-input::placeholder { color: var(--placeholder); }
.text-input:focus, .select-input:focus, .textarea-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.textarea-input { resize: vertical; line-height: 1.55; }

.select-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2382A8D3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
/* Navy chevron for the light theme (url() cannot read CSS variables). */
html[data-theme="light"] .select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2310457E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Light/dark switch in the navy header, left of Sign out. Glass style
   works in both themes because the header is navy in both. */
.theme-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 7px 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.5); }

.field-error {
  font-size: 14px;
  color: var(--loss);
  margin: 8px 0 0;
}

/* =========================== SIGN-IN SCREEN =========================== */
.signin-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 40px 20px 64px;
}
/* Sized up to the wizard card's scale (owner 2026-07-14): the sign-in box
   is the first product surface a visitor meets, it should not read as a
   little modal. */
.signin-col {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 50px 56px 44px;
}
.signin-col .brand-mark { margin-bottom: 22px; }
.wordmark {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.signin-dek {
  color: var(--muted);
  font-size: 16px;
  margin: 12px 0 30px;
  line-height: 1.55;
  text-wrap: pretty;
}
.signin-form, #signin-form { margin: 0; }
.signin-col .field-label { font-size: 15px; }
.signin-col .text-input { font-size: 17px; padding: 12px 14px; }
#signin-form .btn-primary { margin-top: 18px; font-size: 16px; padding: 12px 16px; }

.access-note {
  font-size: 12px;
  color: var(--muted);
  margin: 20px 0 0;
  line-height: 1.5;
}
/* The request-access link shipped unstyled (browser default blue on the
   dark card, caught in the 2026-07-12 mobile pass). Theme it. */
.access-note a { color: var(--accent); text-decoration-color: var(--accent-line); }
.access-note a:hover { color: var(--accent-hover); }

.sent-title {
  font-family: var(--serif);
  font-size: 23px;
  color: var(--ink);
  margin: 0 0 10px;
  font-weight: 600;
}
.sent-body {
  font-size: 15px;
  color: var(--ink-body);
  margin: 0 0 18px;
  line-height: 1.55;
}
.sent-email { color: var(--ink); font-weight: 600; }
.sent-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Tiny muted mode badge under the sign-in card content (mock mode only). */
.mode-badge {
  font-size: 12px;
  color: var(--muted);
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

/* Calm amber informational panel: expired link, preview engine offline.
   Policy states are informational, never red. */
.policy-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--policy);
  background: var(--policy-tint);
  border: 1px solid var(--policy-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 18px;
}

.sim-block {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.sim-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.sim-note {
  color: var(--policy);
  background: var(--policy-tint);
  border: 1px solid var(--policy-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
}

/* =========================== DASHBOARD =============================== */
.dashboard-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px 0;
}
/* Navy header block (owner request 2026-07-05): the header sits on its
   own blue panel, same gradient family as the old masthead. Tabs stay on
   their frosted pill below it. */
.dash-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 20px;
  background:
    radial-gradient(720px 200px at 85% -40%, var(--head-glow), rgba(228, 185, 91, 0) 70%),
    linear-gradient(135deg, var(--head-a) 0%, var(--head-b) 78%, var(--head-c) 100%);
  border-radius: 16px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
}
.dash-header .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 17px;
  background: var(--brand-logo);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: none;
}
.dash-heading-text { min-width: 0; }
.page-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 3px;
  letter-spacing: 0.01em;
}
.page-subline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}
.sub-dot { margin: 0 7px; color: rgba(255, 255, 255, 0.35); }
#dash-email { color: #FFFFFF; font-weight: 600; }
.sub-sector { color: #E4B95B; font-weight: 600; }
.dash-signout {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.85);
}
.dash-signout:hover:not(:disabled) { color: #FFFFFF; }

/* Phone header (2026-07-12 mobile pass): at desktop width the heading sits
   between the brand tile and the buttons; under 640px that middle column
   collapsed to one word per line with the theme pill overlapping it. Wrap
   instead: tile + buttons on the first row, heading full-width beneath. */
@media (max-width: 640px) {
  .dash-header { flex-wrap: wrap; row-gap: 4px; }
  .dash-header .brand-mark { order: 1; }
  .dash-header .theme-toggle { order: 2; margin-left: auto; }
  .dash-header .dash-signout { order: 3; }
  .dash-heading-text { order: 4; flex: 1 1 100%; }
}

/* Sections live on one continuous dossier sheet (see .desk-content below),
   separated by hairlines instead of floating as separate cards. */
.card {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 24px 16px;
  margin: 0;
  border-bottom: 1px solid var(--hairline);
}
.card:last-child { border-bottom: none; }
.card-quiet { background: var(--surface-2); }

/* Section titles speak the memo's own kicker language: small caps, tracked
   out, accent colored, with a trailing hairline rule. */
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.card-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ------------------------------ Info tips ----------------------------- */
/* Small "i" button that replaces the grey helper paragraphs. Clicking it
   opens the singleton .info-tip-popover (info-tip.js). */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  text-transform: lowercase;
  vertical-align: middle;
  margin-left: 6px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.info-tip:hover,
.info-tip:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.info-tip-popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: var(--ink-body);
  max-width: 280px;
  z-index: 200;
}

/* ------------------------ Profile + coverage ------------------------ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
/* ----------------------------- Watchlist ----------------------------- */
.autocomplete { position: relative; }
.ac-listbox {
  list-style: none;
  margin: 6px 0 0;
  padding: 5px;
  position: absolute;
  left: 0; right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 264px;
  overflow-y: auto;
}
.ac-option {
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: background 0.1s ease;
}
.ac-option:hover, .ac-option.is-active { background: var(--accent-tint); }
.ac-symbol {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.ac-company { color: var(--ink-body); font-size: 15px; flex: 1; }
.ac-exchange { color: var(--muted); font-size: 13px; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 11px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.chip:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.chip-symbol {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chip-company { color: var(--muted); font-size: 13px; }
.chip-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--policy);
  background: var(--policy-tint);
  border: 1px solid var(--policy-line);
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
  transition: background 0.12s ease, color 0.12s ease;
}
.chip-x:hover { color: var(--loss); background: var(--loss-tint); }

.empty-note {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin: 16px 0 0;
}

/* --------------------------- Cadence card --------------------------- */
.control-row { margin-top: 12px; }
.control-row:first-of-type { margin-top: 0; }
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
}
.seg-btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.seg-btn:hover:not(.is-active) { color: var(--ink); }
.seg-btn.is-active {
  background: var(--fill-b);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.day-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.day-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 48px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.day-btn:hover:not(.is-active) { border-color: var(--accent-line); color: var(--ink); }
.day-btn.is-active {
  background: var(--fill-b);
  color: #ffffff;
  border-color: var(--fill-border);
  box-shadow: var(--shadow-sm);
}
.time-wrap { max-width: 220px; }

.echo-line {
  margin: 20px 0 0;
  font-size: 15px;
  color: var(--ink-body);
  padding: 12px 15px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* --------------------------- Guidance card -------------------------- */
.char-counter {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  font-variant-numeric: tabular-nums;
}
.char-counter.is-near { color: var(--policy); font-weight: 600; }

/* --------------------------- Preview card --------------------------- */
.preview-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.preview-count {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.preview-count.is-exhausted { color: var(--policy); }
.preview-reassure {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.5;
}
.preview-building {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}
.preview-frame-wrap {
  margin-top: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.preview-frame-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px 6px 13px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
/* Memo text-size control (accessibility). */
.memo-zoom-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
}
.memo-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: normal;
}
.zoom-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 3px 9px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.zoom-btn:hover { color: var(--accent-hover); border-color: var(--accent-line); }
.zoom-level {
  font-size: 11px;
  color: var(--muted);
  min-width: 38px;
  text-align: center;
}
.preview-progress {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.card .policy-note { margin: 18px 0 0; }
.preview-email-stage {
  background: var(--paper);
  padding: 24px 12px;
}
.preview-email {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  /* Reader-adjustable memo scale (A- / A+ control in the preview card);
     applies to Past Briefs too since they share this class. */
  zoom: var(--memo-zoom, 1);
  /* The memo follows the theme: memo-render.js inlines var(--...) tokens,
     so it renders dark-on-light in light mode and light-on-dark in dark. */
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
}

/* --------------------------- Account card --------------------------- */
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}
.account-row:first-of-type { border-top: none; padding-top: 4px; }
.account-copy { display: flex; flex-direction: column; gap: 2px; }
.account-label { font-size: 16px; color: var(--ink); font-weight: 600; }
.account-sub { font-size: 12px; color: var(--muted); }

.toggle {
  width: 44px; height: 24px;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
  background: var(--track);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.toggle[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: left 0.16s ease;
}
.toggle[aria-checked="true"] .toggle-knob { left: 22px; }

.dash-spacer { height: 104px; }

/* ---------------------------- Save bar ------------------------------ */
.save-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  padding: 11px 12px 11px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 40;
  box-shadow: var(--shadow-lg);
  animation: bar-pop 0.2s ease;
}
.save-bar-inner { display: flex; align-items: center; gap: 16px; margin: 0; }
.save-bar-msg { font-size: 14px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.save-bar-actions { display: flex; align-items: center; gap: 6px; }
@keyframes bar-pop {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ------------------------------ Toast ------------------------------- */
.toast-host {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  padding: 11px 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast-undo {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}
.toast-undo:hover { opacity: 0.85; }

@media (max-width: 480px) {
  .control-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .preview-email-stage { padding: 12px 4px; }
  .account-row { flex-wrap: wrap; }
  .signin-col { padding: 30px 24px 26px; }
  .save-bar { left: 12px; right: 12px; transform: none; }
  .save-bar-inner { justify-content: space-between; width: 100%; }
  @keyframes bar-pop {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

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

/* -------------------- Preview run loader (percentage) ------------------- */
/* 2026-07-07: replaces the 3-dot stepper. A 0-100% bar with live source
   and story counts plus a one-line activity narration. */
.preview-loader {
  margin: 16px 2px 2px;
}
.loader-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}
.loader-phase {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.loader-pct {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.loader-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--fill-b), var(--fill-a));
  transition: width 0.35s ease;
}
.loader-counts {
  font-size: 12px;
  color: var(--ink-body);
  margin: 8px 0 0;
  min-height: 16px;
}
.loader-activity {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 2px 0 0;
  min-height: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .loader-fill { transition: none; }
}
.preview-eta {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 2px 0;
}
/* In the wizard finale the lead already says how long the preview takes;
   the relocated ETA line would repeat it (owner 2026-07-14). The
   preferences-page preview keeps the line untouched. */
#ob-finale-slot .preview-eta { display: none; }

/* Back-to-home link at the bottom of the sign-in card (2026-07-08).
   Points at /landing.html locally; the landing becomes the root at
   deploy and this becomes "/". */
.signin-back {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}
.signin-back a {
  color: var(--muted);
  text-decoration: none;
}
.signin-back a:hover { color: var(--accent); }

/* Enter-to-add affordance under free-text commit inputs. */
.enter-hint {
  font-size: 11px;
  color: var(--accent);
  margin: 5px 2px 0;
}

/* Download PDF button (preview header + open Past Briefs). */
.preview-frame-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-transform: none;
  letter-spacing: normal;
}
.pdf-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 3px 10px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.pdf-btn:hover { color: var(--accent-hover); border-color: var(--accent-line); }
.debrief-tools {
  display: flex;
  justify-content: flex-end;
  /* Tight to the row above, clear gap below so the button is not flush against
     the memo card (owner 2026-07-15). */
  padding: 2px 12px 12px;
}

/* ------------------------------ Activity card --------------------------- */
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-body);
}
.activity-row:last-child { border-bottom: none; }
.activity-badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
}
.activity-badge.is-preview { color: var(--policy); background: var(--policy-tint); }
.activity-badge.is-email { color: var(--accent); background: var(--accent-tint); }
.activity-meta { color: var(--muted); }

/* -------------------------- Private companies row ----------------------- */
.private-row { margin-top: 18px; }

/* --------------------------- Required fields ---------------------------- */
.req {
  color: var(--muted);
  margin-left: 2px;
  font-weight: 600;
}
.req-note {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin: -8px 2px 14px;
}
.text-input.is-missing, .textarea-input.is-missing {
  border-color: var(--loss);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

/* ------------------- Dashboard view tabs (Preferences / Debriefs) ------- */
.view-tabs {
  display: flex;
  width: fit-content;
  gap: 4px;
  /* Bottom margin matches the desk-body column gap, so the space above
     the rail/sheet equals the space between them (owner rule). */
  margin: 0 0 12px;
  padding: 3px 6px;
  /* Dark navy rounded pill (owner request 2026-07-05), same gradient
     family as the header block; the sliding indicator goes gold. */
  background: linear-gradient(135deg, var(--pill-a) 0%, var(--pill-b) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.view-tab {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px 11px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.view-tab:hover { color: #FFFFFF; }
.view-tab.is-active {
  color: #FFFFFF;
  border-bottom-color: transparent;
}

/* --------------------- Multi-area coverage switcher --------------------- */
/* Sits at the top of the Preferences view (Pro only). Each pill repoints the
   whole form at one coverage area; the active area gets the navy fill. Hidden
   for base single-area accounts, so their view is unchanged. */
.area-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.area-switch[hidden] { display: none; }
.area-switch-kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.area-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.area-tab-wrap { display: inline-flex; align-items: center; }
.area-tab {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-body);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.area-tab:hover { border-color: var(--accent); color: var(--accent); }
.area-tab.is-active {
  color: #FFFFFF;
  background: linear-gradient(180deg, var(--fill-a), var(--fill-b));
  border-color: var(--fill-border);
}
.area-tab-remove {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  margin-left: -2px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.area-tab-remove:hover { color: var(--loss, #C0453B); background: var(--accent-tint); }
.area-add {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px dashed var(--hairline-strong);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.area-add:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* ----------------------------- Past Debriefs ---------------------------- */
.debrief-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.debrief-item { border-bottom: 1px solid var(--hairline); }
.debrief-item:last-child { border-bottom: none; }
/* Collapsible month/year groups (shown only once briefs span multiple
   months / years; a single-month account stays a flat list). */
.debrief-group { border-bottom: 1px solid var(--hairline); }
.debrief-group:last-child { border-bottom: none; }
.debrief-group > details > .debrief-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.debrief-group-head::-webkit-details-marker { display: none; }
.debrief-group-head::before {
  content: "\25B8";
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.15s ease;
}
.debrief-group > details[open] > .debrief-group-head::before { transform: rotate(90deg); }
.debrief-group-head:hover { background: var(--zebra); }
.debrief-group-label { font-weight: 700; font-size: 14px; color: var(--ink); }
.debrief-group-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.debrief-sublist { padding-left: 14px; }
.debrief-sublist .debrief-group-label { font-size: 13px; }
.debrief-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-body);
  background: none;
  border: none;
  padding: 12px 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.debrief-head:hover:not(:disabled) { background: var(--zebra); }
.debrief-head:disabled { cursor: default; }
.debrief-meta { flex: 1; color: var(--ink-body); }
.debrief-hint {
  flex: none;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.debrief-head:disabled .debrief-hint {
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}
.debrief-item.is-open .debrief-hint { color: var(--muted); }
.debrief-body { padding: 4px 0 18px; }
.debrief-body .preview-email-stage { border-radius: var(--radius-sm); }

/* ====================== RESEARCH DESK LAYOUT (2026-07-04) =============== */
/* The dashboard reads as the desk that produces the memo: an inverted navy
   masthead with a folio line, a sticky contents rail, and one continuous
   dossier sheet of sections. The masthead is the single loud element. */

.desk-masthead {
  background:
    radial-gradient(720px 200px at 85% -40%, rgba(228, 185, 91, 0.14), rgba(228, 185, 91, 0) 70%),
    linear-gradient(135deg, #0A2A4D 0%, #10457E 78%, #16599E 100%);
  border-radius: 16px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  padding: 24px 28px 0;
  color: #FFFFFF;
}
.masthead-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.desk-masthead .brand-mark {
  background: var(--brand-logo);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: none;
}
.masthead-title-wrap { min-width: 0; }
.desk-masthead .page-title {
  color: #FFFFFF;
  font-size: 27px;
  margin: 0;
}
.masthead-tagline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #E4B95B;
  margin: 3px 0 0;
}
.desk-masthead .dash-signout { color: rgba(255, 255, 255, 0.85); }
.desk-masthead .dash-signout:hover:not(:disabled) { color: #FFFFFF; }

.masthead-folio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 16px;
  padding: 11px 0 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}
.masthead-folio > span:not(:last-child)::after {
  content: "\00B7";
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.35);
}
.masthead-folio .folio-sector { color: #E4B95B; font-weight: 600; }
.masthead-folio .folio-sector:empty { display: none; }
.desk-masthead #dash-email { color: #FFFFFF; font-weight: 600; }

/* Tabs sit on the masthead's bottom edge. */
.desk-masthead .view-tabs {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin: 0 -28px;
  padding: 0 18px;
  gap: 0;
}
.desk-masthead .view-tab {
  color: rgba(255, 255, 255, 0.62);
  border-bottom: 2px solid transparent;
  margin-bottom: 0;
  padding: 13px 16px 14px;
}
.desk-masthead .view-tab:hover { color: #FFFFFF; }
.desk-masthead .view-tab.is-active {
  color: #FFFFFF;
  border-bottom-color: #E4B95B;
}

/* Two-column desk: contents rail + dossier sheet. The rail column
   COLLAPSES smoothly when leaving Preferences (animated grid track), so
   the sheet glides to full width instead of snapping. */
.desk-body {
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
  align-items: start;
  transition: grid-template-columns 0.32s cubic-bezier(0.25, 0.1, 0.25, 1),
    gap 0.32s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.desk-rail {
  position: sticky;
  top: 12px;
  padding: 12px 12px 10px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.22s ease;
  /* Solid panel, same surface as the dossier sheet. */
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.desk-body.no-rail .desk-rail {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0s linear 0.32s;
}
.rail-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.rail-link {
  display: block;
  font-size: 13.5px;
  color: var(--ink-body);
  text-decoration: none;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--hairline);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rail-link:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}
.rail-status {
  margin-top: 12px;
  border-top: 1px solid var(--hairline);
  padding-top: 10px;
  /* The rail itself is nowrap for the collapse animation; status lines
     are the one place long text lives, so let them wrap. */
  white-space: normal;
  overflow-wrap: break-word;
}
.rail-line {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 6px;
}
.rail-line:empty { display: none; }

/* The dossier sheet: the WRAPPER carries the white surface, so switching
   views never moves the sheet itself; only the content inside transitions. */
.desk-content {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.desk-content .req-note {
  margin: 0;
  padding: 10px 24px 0;
  text-align: right;
}

@media (max-width: 960px) {
  .desk-body { display: block; }
  .desk-rail { display: none; }
  .card { padding: 26px 22px 28px; }
  .desk-content .req-note { padding: 12px 22px 0; }
  .desk-masthead { padding: 20px 20px 0; }
  .desk-masthead .view-tabs { margin: 0 -20px; padding: 0 10px; }
}

/* Debriefs view has no rail: the rail track collapses to zero and the
   sheet takes the full width, animated by the .desk-body transition. */
.desk-body.no-rail { grid-template-columns: 0px minmax(0, 1fr); gap: 0px; }
@media (prefers-reduced-motion: reduce) {
  .desk-body { transition: none; }
}

/* ================= AURORA TECH BACKGROUND (2026-07-04, v3) ============== */
/* Layered like modern fintech marketing sites: saturated blurred gradient
   blobs that drift slowly, a diagonal sheen ribbon, a fading dot matrix,
   floating glass geometry, and film grain to keep gradients premium. */

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}
/* Blob colors: dark theme (default) mutes the warm/teal washes toward the
   blue family (gold/teal over deep blue read muddy brown/green); light
   theme keeps the original owner-tuned aurora. BOTH variants are always
   painted (::before = dark, ::after = light) and CROSSFADE on theme switch
   (owner 2026-07-07: gradient swaps snapped and read blotty; gradients
   cannot transition, opacity can). The blur and drift stay on the parent. */
.bg-blob::before, .bg-blob::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.bg-blob::before { opacity: 1; }
.bg-blob::after { opacity: 0; }
html[data-theme="light"] .bg-blob::before { opacity: 0; }
html[data-theme="light"] .bg-blob::after { opacity: 1; }
.bg-blob-1 {
  width: 54vw; height: 54vw;
  top: -16%; left: -12%;
  animation: bgDriftA 70s ease-in-out infinite alternate;
}
.bg-blob-1::before { background: radial-gradient(circle, rgba(56, 132, 222, 0.16) 0%, rgba(56, 132, 222, 0) 68%); }
.bg-blob-1::after { background: radial-gradient(circle, rgba(56, 132, 222, 0.24) 0%, rgba(56, 132, 222, 0) 68%); }
.bg-blob-2 {
  width: 46vw; height: 46vw;
  top: -10%; right: -12%;
  animation: bgDriftB 85s ease-in-out infinite alternate;
}
.bg-blob-2::before { background: radial-gradient(circle, rgba(42, 138, 168, 0.10) 0%, rgba(42, 138, 168, 0) 68%); }
.bg-blob-2::after { background: radial-gradient(circle, rgba(18, 160, 148, 0.20) 0%, rgba(18, 160, 148, 0) 68%); }
.bg-blob-3 {
  width: 48vw; height: 48vw;
  bottom: -20%; right: -10%;
  animation: bgDriftA 95s ease-in-out infinite alternate-reverse;
}
.bg-blob-3::before { background: radial-gradient(circle, rgba(124, 111, 222, 0.12) 0%, rgba(124, 111, 222, 0) 68%); }
.bg-blob-3::after { background: radial-gradient(circle, rgba(124, 111, 222, 0.18) 0%, rgba(124, 111, 222, 0) 68%); }
.bg-blob-4 {
  width: 42vw; height: 42vw;
  bottom: -16%; left: -10%;
  animation: bgDriftB 80s ease-in-out infinite alternate-reverse;
}
.bg-blob-4::before { background: radial-gradient(circle, rgba(236, 178, 74, 0.06) 0%, rgba(236, 178, 74, 0) 68%); }
.bg-blob-4::after { background: radial-gradient(circle, rgba(236, 178, 74, 0.18) 0%, rgba(236, 178, 74, 0) 68%); }
.bg-blob-5 {
  width: 30vw; height: 30vw;
  top: 26%; left: 40%;
  animation: bgDriftA 65s ease-in-out infinite alternate;
}
.bg-blob-5::before { background: radial-gradient(circle, rgba(233, 112, 122, 0.05) 0%, rgba(233, 112, 122, 0) 68%); }
.bg-blob-5::after { background: radial-gradient(circle, rgba(233, 112, 122, 0.09) 0%, rgba(233, 112, 122, 0) 68%); }
@keyframes bgDriftA {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vw, 3vh) scale(1.08); }
}
@keyframes bgDriftB {
  from { transform: translate(0, 0) scale(1.05); }
  to { transform: translate(-3vw, 4vh) scale(0.97); }
}

/* The market chart layer: jagged price line over volume bars, with event
   chips (the memo's own categories) pinned along the price path. */
.bg-chart {
  position: absolute;
  inset: 0;
}
/* Map ink per theme. The SVG carries light-theme attributes (#10457E
   stroke, #3884DE dot fill from app.js); CSS presentation properties
   override attributes, so dark mode re-inks here without touching the
   animator. Dot/scanline OPACITY stays attribute-driven (the animation). */
/* No permanent transitions on map ink: the View Transitions crossfade
   handles the theme switch; the html.theme-anim fallback rules carry the
   non-VT browsers. Opacity is NEVER transitioned (animator, per-frame). */
#world-map { stroke: #6FA0D6; stroke-opacity: 0.28; }
#world-map-hi { stroke: #B7D2F0; }
/* Dots: deep azure (owner 2026-07-08, was #72D2FF; darker now that dots
   form at full opacity). */
#city-dots circle { fill: #3D7BB8; }
html[data-theme="light"] #world-map { stroke: #10457E; stroke-opacity: 0.24; }
html[data-theme="light"] #world-map-hi { stroke: #10457E; }
html[data-theme="light"] #city-dots circle { fill: #3884DE; }
/* The scan line is a plain DOM element (NOT inside the SVG: CSS
   transforms on SVG children proved unreliable across machines). It is
   composited on its own layer, so the sweep never repaints the map. */
.bg-scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 1.5px;
  /* Dark theme: brighter beam so the sweep reads on the deep-blue field. */
  background: rgba(122, 184, 255, 0.5);
  box-shadow: 0 0 7px 1.5px rgba(122, 184, 255, 0.18);
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
}
html[data-theme="light"] .bg-scanline {
  background: rgba(56, 132, 222, 0.32);
  box-shadow: 0 0 6px 1.5px rgba(56, 132, 222, 0.10);
}
/* The root reserves a stable scrollbar gutter for the scrolling dashboard.
   The wizard never scrolls, so that 15px reservation just paints as a dark
   strip down the right edge (owner 2026-07-13). Release it while the wizard
   is up so the fixed map field reaches the true viewport edge; the finale
   memo (which can scroll) shows a real scrollbar as usual. */
html:has(#onboarding-screen:not([hidden])) { scrollbar-gutter: auto; }
/* Same release for the sign-in screen (owner 2026-07-16): it never scrolls
   either, so the reserved gutter painted as the same dead strip. */
html:has(#signin-screen:not([hidden])) { scrollbar-gutter: auto; }

/* Native scrollbars follow the surface they sit on (owner 2026-07-14):
   dark scrollbars in dark mode, light in light mode, and the wizard is
   always dark regardless of a stored theme. The white memo paper keeps a
   light scrollbar even inside the dark portal. */
:root, html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html:has(#onboarding-screen:not([hidden])) { color-scheme: dark; }
.preview-email, .memo-scroll { color-scheme: light; }

/* Cursor spotlight: a circular window that follows the pointer and
   reveals a BRIGHTER copy of the map outline + grid (the flashlight
   trick: the window and its full-viewport contents carry inverse
   composited transforms, so following the mouse never repaints the
   heavy map path). Driven from the animator rAF loop in app.js. */
.bg-spot {
  position: absolute;
  top: 0;
  left: 0;
  /* 360px (owner 2026-07-08, was 440): a bit smaller on the main page. */
  width: 360px;
  height: 360px;
  border-radius: 50%;
  overflow: hidden;
  transform: translate(-1000px, -1000px);
  will-change: transform;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0.5) 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0.5) 62%, transparent 100%);
}
.bg-spot-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  transform: translate(1000px, 1000px);
  will-change: transform;
}
/* Grid layers: line-color gradients cannot transition, so each grid paints
   BOTH theme variants (::before dark, ::after light) and crossfades. */
.bg-grid-hi { position: absolute; inset: 0; }
.bg-grid-hi::before, .bg-grid-hi::after,
.bg-grid::before, .bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  /* 36px cells (owner 2026-07-08, was 56px): denser, more drafting-table. */
  background-size: 36px 36px;
}
.bg-grid-hi::before, .bg-grid::before { opacity: 1; }
.bg-grid-hi::after, .bg-grid::after { opacity: 0; }
html[data-theme="light"] .bg-grid-hi::before,
html[data-theme="light"] .bg-grid::before { opacity: 0; }
html[data-theme="light"] .bg-grid-hi::after,
html[data-theme="light"] .bg-grid::after { opacity: 1; }
.bg-grid-hi::before {
  background-image:
    linear-gradient(to right, rgba(150, 192, 236, 0.32) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(150, 192, 236, 0.32) 1px, transparent 1px);
}
.bg-grid-hi::after {
  background-image:
    linear-gradient(to right, rgba(16, 69, 126, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 69, 126, 0.3) 1px, transparent 1px);
}

/* Soft square grid in front of the world map, behind the film grain.
   (The old dot-matrix layer is gone; the grid is the only texture.)
   Dark theme: pale blue lines instead of navy so they read on deep blue. */
.bg-grid { position: absolute; inset: 0; }
.bg-grid::before {
  background-image:
    linear-gradient(to right, rgba(150, 192, 236, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(150, 192, 236, 0.09) 1px, transparent 1px);
}
.bg-grid::after {
  background-image:
    linear-gradient(to right, rgba(16, 69, 126, 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 69, 126, 0.10) 1px, transparent 1px);
}

.bg-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.10;
  mix-blend-mode: soft-light;
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none; }
}
@media (max-width: 720px) {
  .bg-blob { filter: blur(52px); }
}

/* ---------------- Tab slide + anchor cushion + stable layout ------------ */
/* Keep the scrollbar gutter reserved so switching between a tall and a
   short view never shifts the page (the background used to "move"). */
html { scrollbar-gutter: stable; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Rail anchor jumps land with breathing room above the section title. */
.card-title { scroll-margin-top: 28px; }

/* One sliding underline shared by both tabs (per-button borders off). */
.view-tabs { position: relative; }
.view-tab.is-active { border-bottom-color: transparent; }
.tab-indicator {
  position: absolute;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: #E4B95B;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) { .tab-indicator { transition: none; } }

/* View entrance: the white sheet stays put (it lives on .desk-content);
   the content inside simply fades, unhurried. */
@keyframes viewFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.slide-in-right, .slide-in-left {
  animation: viewFadeIn 0.55s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .slide-in-right, .slide-in-left { animation: none; }
}

/* Lift behind the left rail so the nav reads evenly over the map.
   Dark theme: a soft navy glow (a white radial would blow out the deep
   blue field); light theme keeps the original near-white lift. Both
   variants painted, crossfaded on theme switch (radials cannot
   transition). */
.bg-whiten {
  position: absolute;
  left: -4vw;
  top: 8%;
  width: 46vw;
  height: 80vh;
}
.bg-whiten::before, .bg-whiten::after {
  content: "";
  position: absolute;
  inset: 0;
}
.bg-whiten::before {
  background: radial-gradient(closest-side,
    rgba(16, 40, 72, 0.55) 0%,
    rgba(16, 40, 72, 0.3) 55%,
    rgba(16, 40, 72, 0) 100%);
  opacity: 1;
}
.bg-whiten::after {
  background: radial-gradient(closest-side,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.5) 55%,
    rgba(255, 255, 255, 0) 100%);
  opacity: 0;
}
html[data-theme="light"] .bg-whiten::before { opacity: 0; }
html[data-theme="light"] .bg-whiten::after { opacity: 1; }

/* ==================== FIRST-RUN SETUP (onboarding) ====================== */
.ob-wrap {
  display: flex;
  /* Vertically centered with a slight downward bias (owner 2026-07-13). The
     wizard screen has no header, so the -56px in min-height leaves the wrap
     short of the viewport; the top-heavy padding compensates AND lands the
     card ~25px below true viewport center (pixel-measured). Tall steps
     (watchlist, finale) simply grow the wrap and flow from the top. */
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 96px 20px 24px;
}
/* The finale card (memo + plan box) is taller than the viewport: the
   centering bias would just add dead space above it, so restore the tighter
   top padding for that state. */
.ob-wrap:has(.ob-card-wide) { padding-top: 48px; }
.ob-card {
  position: relative; /* anchors the finale's corner sign-out */
  width: 100%;
  /* 640px (owner 2026-07-13): narrow enough that the intro lede and setup
     hint each wrap into two balanced rows with no short orphan/early cliff,
     while the welcome title stays on one line. The finale widens to
     .ob-card-wide for the memo. */
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 44px 52px 46px;
}
/* Wizard type runs larger than the dashboard (owner 2026-07-12 "quite
   small", enlarged again 2026-07-13): a one-time, one-question-at-a-time
   surface that reads like a form cover page, not dense preferences. */
.ob-card .field-label { font-size: 20px; }
.ob-card .text-input, .ob-card .select-input, .ob-card .textarea-input { font-size: 21px; }
.ob-card .field-error { font-size: 19px; }
.ob-card .em-opt { font-size: 20px; }
.ob-card .em-foot { font-size: 16px; }
.ob-card .btn { font-size: 20px; }
.ob-progress { display: flex; gap: 8px; margin: 0 0 26px; }
.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hairline-strong);
  transition: background 0.2s ease;
}
.ob-dot.is-current { background: var(--accent); }
.ob-dot.is-done { background: var(--accent-2); opacity: 0.55; }
.ob-title {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 12px;
  text-wrap: balance; /* no hanging words on multi-line titles */
}
.ob-card .brand-mark { margin-bottom: 4px; }
/* text-wrap: pretty reflows paragraph breaks so no line ends as a single
   hanging word (owner 2026-07-13); older engines simply ignore it. */
.ob-lead { font-size: 22px; color: var(--ink-body); line-height: 1.6; margin: 0 0 24px; text-wrap: pretty; }
.ob-hint { font-size: 19px; color: var(--muted); margin: 8px 0 0; text-wrap: pretty; }
.ob-card .field-error { text-wrap: pretty; }
/* Keeps a phrase together so a lead breaks at its comma, never mid-phrase. */
.ob-lead .nowrap { white-space: nowrap; }
/* After the cover page (step 1), the wizard becomes a working form: dial the
   type back down a step so the questions read as functional, not oversized
   (owner 2026-07-14). Scoped to every step except the first. */
.ob-step:not([data-step="1"]) .ob-title { font-size: 34px; }
/* "Who is this brief prepared for?" is 3px over the one-line width at 34px;
   nudge just this title down so it stays on a single line (owner 2026-07-14). */
.ob-step:not([data-step="1"]) .ob-title-fit { font-size: 32px; }
.ob-step:not([data-step="1"]) .ob-lead { font-size: 18px; }
.ob-step:not([data-step="1"]) .ob-hint { font-size: 16px; }
.ob-step:not([data-step="1"]) .field-label { font-size: 16px; }
.ob-step:not([data-step="1"]) .text-input,
.ob-step:not([data-step="1"]) .select-input,
.ob-step:not([data-step="1"]) .textarea-input { font-size: 17px; }
.ob-step:not([data-step="1"]) .field-error { font-size: 16px; }
.ob-step:not([data-step="1"]) .em-opt { font-size: 16px; }
.ob-step:not([data-step="1"]) .em-foot { font-size: 14px; }
.ob-step:not([data-step="1"]) .btn { font-size: 17px; }
.ob-step:not([data-step="1"]) .ob-summary { font-size: 17px; }
.ob-gap { margin-top: 16px; }
.ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}
.ob-actions-single { justify-content: flex-end; }
.ob-actions-right { display: flex; align-items: center; gap: 6px; }
.ob-step { animation: viewFadeIn 0.3s ease; }
.ob-summary {
  margin: 0;
  display: grid;
  grid-template-columns: 185px 1fr;
  row-gap: 12px;
  column-gap: 18px;
  font-size: 20px;
}
.ob-summary dt { color: var(--muted); font-weight: 600; }
.ob-summary dd { margin: 0; color: var(--ink-body); overflow-wrap: anywhere; }
#ob-chips, #ob-private-chips { margin-top: 10px; }

/* ------------------ Trial prompt (owner funnel 2026-07-12) -------------- */
.trial-card {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  background: var(--accent-tint);
}
.trial-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.trial-lede { font-size: 15px; color: var(--ink-body); line-height: 1.55; margin: 0 0 18px; }
/* billing period toggle sits between the lede and the plan tiles */
.trial-billing-wrap { display: flex; justify-content: flex-start; margin: 0 0 16px; }
.trial-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .trial-plans { grid-template-columns: 1fr; } }
.trial-plan {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trial-plan-featured { border-color: var(--accent-line); box-shadow: var(--ring); }
.trial-plan-name {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.trial-plan-free { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0; }
.trial-plan-price { font-size: 26px; font-weight: 750; color: var(--ink); margin: 0; }
.trial-plan-price span { font-size: 13px; font-weight: 500; color: var(--muted); }
.trial-plan-diff {
  margin: 4px 0 10px; padding-left: 18px; flex: 1;
  font-size: 14px; color: var(--ink-body); line-height: 1.55;
}
.trial-plan-diff li { margin: 2px 0; }
.trial-transparency { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.trial-note { font-size: 13px; color: var(--loss); margin: 12px 0 0; }

/* Slim repeat CTA under the memo: catches the reader who finished the
   brief; the full plan box above stays the primary. */
.trial-footer {
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-tint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.trial-footer-copy { font-size: 14px; font-weight: 600; color: var(--ink); }
.trial-footer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Payment overlay: sits over the unchanged page during checkout confirm. */
.pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-box {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pay-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--hairline-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: paySpin 0.9s linear infinite;
  flex: none;
}
@keyframes paySpin { to { transform: rotate(360deg); } }
.pay-msg { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .pay-spinner { animation: none; } }

/* Dark-mode scrollbar for the end-market dropdown (owner 2026-07-12): the
   default light scrollbar glared inside the dark listbox. Light theme keeps
   browser defaults. */
html[data-theme="dark"] .em-listbox {
  scrollbar-color: var(--hairline-strong) var(--surface-2);
}
html[data-theme="dark"] .em-listbox::-webkit-scrollbar { width: 10px; }
html[data-theme="dark"] .em-listbox::-webkit-scrollbar-track { background: var(--surface-2); }
html[data-theme="dark"] .em-listbox::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 5px;
  border: 2px solid var(--surface-2);
}

/* Wizard finale: the card widens to hold the memo; the relocated preview
   nodes keep their dashboard styling. */
.ob-card-wide { max-width: 900px; }
.ob-signout {
  position: absolute;
  top: 14px;
  right: 18px;
  color: var(--muted);
}
#ob-finale-slot { margin-top: 8px; }
#ob-finale-slot .trial-card { margin: 0 0 18px; }
#ob-finale-slot .preview-frame-wrap { margin-top: 4px; }
#ob-finale-retry-wrap { margin: 4px 0 14px; }

/* Post-setup nudge on the preview button. */
@keyframes previewAttn {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 6px rgba(16, 69, 126, 0.15); }
}
.btn.attn { animation: previewAttn 1.2s ease-in-out 3; border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .btn.attn { animation: none; } }

@media (max-width: 640px) {
  .ob-card { padding: 26px 22px; }
  .ob-summary { grid-template-columns: 1fr; }
}


/* ---------------- Preferences load-failure lock (2026-07-11) ---------------- */
/* When loadPrefs fails the dashboard renders as empty scaffolding; editing it
   and saving would reconcile-delete the stored watchlist and extra areas.
   The banner stays interactive; every card underneath is locked. */
.load-error-banner {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid var(--loss, #c0392b);
  border-radius: 10px;
  background: color-mix(in srgb, var(--loss, #c0392b) 12%, transparent);
  font-size: 14px;
  line-height: 1.5;
}
.load-error-banner .btn { margin-left: 10px; vertical-align: baseline; }
.load-error-detail { opacity: 0.75; }
.prefs-load-failed .card {
  pointer-events: none;
  opacity: 0.55;
  user-select: none;
}


/* ------------------------------ Feedback card ------------------------------ */
.feedback-lede {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
#feedback-kind { margin-bottom: 12px; }
.feedback-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.feedback-note { font-size: 13px; color: var(--muted); }
.feedback-note.is-error { color: var(--loss); }


/* ------------------- End-market combobox (2026-07-12) ------------------- */
.em-combo-wrap { position: relative; }
.em-listbox {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
}
.em-group {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
}
.em-opt {
  padding: 7px 12px 7px 20px;
  font-size: 14px;
  cursor: pointer;
}
.em-opt:hover, .em-opt.is-active { background: color-mix(in srgb, var(--accent, #c9a54c) 16%, transparent); }
.em-foot {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  cursor: default;
}

/* ------------- Watchlist recommendations (2026-07-12) ------------------- */
.rec-block { margin-top: 14px; }
.rec-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.rec-chip {
  border-style: dashed !important;
  opacity: 0.85;
  background: transparent !important;
  cursor: pointer;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}
/* The whole chip adds, so the whole chip reads as clickable; hovering the
   dismiss x cancels the invitation so the two actions never look like one. */
.rec-chip:hover {
  opacity: 1;
  border-color: var(--accent, #c9a54c) !important;
  background: color-mix(in srgb, var(--accent, #c9a54c) 10%, transparent) !important;
}
.rec-chip:has(.chip-x:hover) {
  border-color: var(--hairline) !important;
  background: transparent !important;
  opacity: 0.85;
}
.rec-chip .chip-symbol { opacity: 0.9; }
.rec-add {
  border: 0;
  background: none;
  color: var(--accent, #c9a54c);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.rec-add:hover { transform: scale(1.15); }
