/* ── Mona Sans — self-hosted so we never depend on a CDN being reachable.
   The VF TTF covers every weight + width axis we use. ── */
@font-face {
  font-family: 'Mona Sans';
  src: url('fonts/MonaSans-VF.ttf') format('truetype-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens — exact match to existing frontend/src/index.css ── */
:root {
  /* ── Instrument — the 37Q design language, rebuilt ──────────────
     Graphite instead of void: a deep neutral canvas with cool ink
     surfaces, so panels read as machined layers rather than holes in
     black. Gold is identity and emphasis, never wallpaper. */
  --accent:        #CFAF85;
  --accent-mid:    #D9BD96;
  --accent-l:      #E4CCA9;
  --accent-bg:     rgba(207, 175, 133, .10);
  --accent-border: rgba(207, 175, 133, .30);
  --lambda-gold:   #D4AF6A;

  --bg:            #0B0C0F;
  --bg2:           #0E1014;
  --surface:       #14171C;
  --surface2:      #1A1E25;
  --surface3:      #21262F;
  --rule:          #242932;
  --rule2:         #303743;

  --text:          #F2F3F5;
  --text2:         #C3C8D1;
  --muted:         #99A0AC;
  --muted2:        #7E8694;

  --bad:           #FF6B7A;
  --warn:          #F0A44A;
  --good:          #4ADE80;
  --info:          #7AA5FF;
  --bad-bg:        #C8102E;
  --warn-bg:       #B45309;
  --good-bg:       #15803D;
  --info-bg:       #1D4ED8;

  --r-sm:          6px;
  --r-md:          8px;
  --r-lg:          12px;
  --r-xl:          16px;
  --titlebar-h:    52px;
  --rail-w:        228px;
  --sans:          'Mona Sans', system-ui, -apple-system, sans-serif;
  --mono:          'Mona Sans', system-ui, -apple-system, sans-serif;

  --fs-xs:         11px;
  --fs-sm:         12px;
  --fs-base:       13px;
  --fs-md:         14px;
  --fs-lg:         15px;
  --fs-xl:         17px;
  --fs-2xl:        20px;
  --fs-metric:     24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.hidden { display: none !important; }

/* ── Custom scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── Global focus states ── */
input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  outline: none;
  box-shadow: 0 0 0 1px rgba(196,168,130,0.2);
}

/* ── Tool card buttons ── */
.tool-card-btn {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 14px;
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  align-items: flex-start;
}
.tool-card-btn:hover {
  border-color: var(--accent);
  background: rgba(196,168,130,0.03);
  transform: translateY(-1px);
}

/* ── Boot sequence ── */
.boot-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: flex-start;
  flex-direction: column; gap: 20px;
  background: var(--bg); z-index: 2000;
  padding-top: 14vh;
  transition: padding-top .9s cubic-bezier(.22,.9,.25,1);
}
/* When the boot is "clean" (done), we center vertically by bumping
   padding-top so the stack lifts into the middle. */
.boot-screen.boot-clean { padding-top: 34vh; }

.boot-stack {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.boot-byline {
  font-family: 'Mona Sans', system-ui, sans-serif;
  font-size: 13px; color: var(--text); font-weight: 400;
  letter-spacing: 0; text-transform: none;
  transition: opacity .4s ease;
}
.boot-byline .boot-credit-name { color: var(--text); font-weight: 400; }
.boot-screen.boot-clean .boot-byline { opacity: 0; }

/* The post-boot "Workspace" subtitle — hidden during boot, revealed after
   the brandmark transitions. */
.boot-post {
  font-family: 'Mona Sans', system-ui, sans-serif;
  font-size: 11px; color: var(--accent);
  letter-spacing: .32em; text-transform: uppercase; font-weight: 500;
  opacity: 0; transform: translateY(6px);
  transition: opacity .6s ease .8s, transform .6s cubic-bezier(.22,.9,.25,1) .8s;
}
.boot-screen.boot-clean .boot-post { opacity: 1; transform: translateY(0); }

/* ── Brandmark — "37Quant" → "37ℚ" crossfade with pulsing ℚ ──
   Two glyph layers are stacked on the same spot. The long wordmark
   ("37Quant") fades/scales out while the short wordmark ("37ℚ") fades and
   scales in. After the transition the ℚ pulses forever.               */
.brandmark {
  position: relative;
  display: inline-block;
  /* Wordmark — Mona Sans Thin (200), sand/gold accent. */
  color: var(--lambda-gold);
  font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
  font-weight: 200;
  letter-spacing: -.01em;
  line-height: 1.05;
  text-align: center;
}
.brandmark .bm-long,
.brandmark .bm-short {
  display: inline-block;
  white-space: nowrap;
  transform-origin: center;
  will-change: transform, opacity;
  font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
}
.brandmark .bm-short {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.78);
}
.brandmark .bm-long  { opacity: 1; transform: scale(1); }
/* "37" and "uant" render in white. Only the ℚ glyph is sand gold. */
.brandmark .bm-37    { color: #FFFFFF; font-family: 'Mona Sans', system-ui, -apple-system, sans-serif; }
.brandmark .bm-uant  { color: #FFFFFF; font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
                       display: inline; vertical-align: baseline; margin-left: .01em; }
/* Collapsable box only applies while the transition is running so the
   baseline sits correctly when "37ℚuant" is at rest. */
.brandmark.transitioning .bm-uant {
  display: inline-block; overflow: hidden; max-width: 4em;
  white-space: nowrap; vertical-align: baseline;
}
.brandmark .bm-q     { color: var(--lambda-gold);
                       font-family: 'Mona Sans', 'DejaVu Sans', 'STIX Two Math', serif;
                       display: inline; vertical-align: baseline;
                       margin-left: .22em; margin-right: .02em; }
.brandmark .bm-short { display: none; }   /* not needed — the long form collapses in place */

/* Boot splash sizing — Mona Sans Thin (200) for the wordmark. */
.brandmark-boot  { font-size: 64px; }
.brandmark-boot .bm-long  { font-size: 64px; font-weight: 200; letter-spacing: -.015em; }
.brandmark-boot .bm-short { font-size: 64px; font-weight: 200; }
.brandmark-boot .bm-q     { font-weight: 600; font-size: 60px; }
.brandmark-boot .bm-short .bm-q { font-size: 64px; }

/* Login card sizing — same thin weight, scaled down. */
.brandmark-login { font-size: 46px; }
.brandmark-login .bm-long  { font-size: 46px; font-weight: 200; letter-spacing: -.015em; }
.brandmark-login .bm-short { font-size: 48px; font-weight: 200; }
.brandmark-login .bm-q     { font-weight: 600; font-size: 44px; }
.brandmark-login .bm-short .bm-q { font-size: 48px; }

/* Default state: "37Quant" is visible. The ℚ inside it pulses forever.
   On successful login, shell.js adds `.transitioning` — the wordmark scales
   up, "uant" fades + collapses its width, and "37ℚ" re-centers. */
.brandmark .bm-q     { animation: bm-q-pulse 2.6s ease-in-out infinite; }
/* Two emphatic pulses right after the boot mark lands on center */
.boot-screen.boot-clean .brandmark-boot .bm-q {
  animation: bm-q-pulse 0.9s ease-in-out 0.8s 2;
}

/* Post-login transition: "uant" still collapses for the old 37Quant→37ℚ
   mark, but the wordmark no longer scales up. The new "Workspace" mark is
   a single word, so any scale animation here just looks like a glitch.
   bm-long-grow is kept as a no-op alias so any external CSS that triggers
   .transitioning still resolves the property cleanly. */
.brandmark.transitioning       .bm-uant { animation: bm-uant-out  1.4s cubic-bezier(.22,.9,.25,1) 0.15s forwards; }

@keyframes bm-long-grow {
  0%, 100% { transform: scale(1); }
}

/* "uant" fades then collapses its horizontal width so the parent re-centers
   the remaining "37ℚ". max-width is animatable; `width: auto` is not. */
@keyframes bm-uant-out {
  0%    { opacity: 1; max-width: 4em; }
  30%   { opacity: 1; max-width: 4em; }
  70%   { opacity: 0; max-width: 4em; }
  100%  { opacity: 0; max-width: 0;   margin-left: 0; }
}

/* ℚ pulses forever — subtle breath, sand glow */
@keyframes bm-q-pulse {
  0%,100% { color: var(--lambda-gold); text-shadow: 0 0 0 rgba(212,175,106,0); transform: scale(1); }
  50%     { color: #E4C99A;            text-shadow: 0 0 18px rgba(212,175,106,.55), 0 0 40px rgba(212,175,106,.22); transform: scale(1.03); }
}

/* Back-compat — old selectors still referenced in places */
.boot-logo   { font-size: 52px; font-weight: 200; color: var(--text); letter-spacing: -0.5px; }
.boot-lambda { color: var(--lambda-gold); font-weight: 300; }
.boot-sub {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 10px;
}
.boot-credit {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text);
  font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  margin-bottom: 20px;
  opacity: 0;
  transition: opacity .8s ease, transform .7s cubic-bezier(.2,.9,.3,1), letter-spacing .7s ease;
}
.boot-credit-name { font-weight: 300; }
.boot-log {
  width: 340px; font-size: 11px; color: var(--muted);
  font-family: var(--mono); line-height: 1.8; text-align: left;
  min-height: 120px;
}
.boot-log .done { color: var(--good); }
.boot-log .fail { color: var(--bad); }
.boot-log .label { color: var(--muted2); }
.boot-bar {
  width: 340px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
  margin: 22px auto 14px;
  position: relative;
}
/* Determinate fill — JS drives `width: N%` step-by-step. */
.boot-fill {
  height: 100%; width: 0%;
  background: var(--lambda-gold, #D4AF6A);
  border-radius: 2px;
  transition: width 0.45s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(212,175,106,.45);
  position: relative; z-index: 1;
}
/* Indeterminate shimmer — a soft gold sweep glides across the bar so
   there's visible motion even before the JS sets the first width.
   Kicks off the moment the splash renders. */
.boot-bar::after {
  content: "";
  position: absolute; top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212,175,106,.55) 50%,
    transparent 100%);
  animation: boot-shimmer 1.6s ease-in-out infinite;
  z-index: 0;
}
@keyframes boot-shimmer {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Small "by 37Quant" tag under the wordmark */
.boot-tag {
  font-family: 'Mona Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-top: 10px;
  transition: opacity .5s ease;
}
.boot-tag span { color: var(--lambda-gold, #D4AF6A); }
.boot-screen.boot-clean .boot-tag { opacity: 0; }

/* ── Boot splash finale ── */
.boot-screen { transition: opacity .5s ease; }
.boot-logo, .boot-sub, .boot-credit {
  transition: transform .7s cubic-bezier(.2,.9,.3,1), font-size .7s ease, letter-spacing .7s ease;
  transform-origin: center;
}
.boot-screen.boot-clean .boot-log,
.boot-screen.boot-clean .boot-bar,
.boot-screen.boot-clean .boot-sub {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.boot-screen.boot-clean .boot-logo   { transform: scale(1.3); }
/* boot brandmark no longer scales — the "uant" collapse handles the visual
   change; the stack slides vertically via padding-top on .boot-screen. */
.boot-screen.boot-credit-in .boot-credit {
  opacity: 1;
  transform: scale(1.1);
  letter-spacing: 0.20em;
}

.boot-screen.boot-pulse .boot-lambda {
  animation: boot-lambda-pulse 0.9s ease-in-out 2;
}
/* brandmark-boot ℚ already pulses on its own via bm-q-pulse — don't double-animate here */
.boot-screen.boot-fadeout { opacity: 0; }

@keyframes boot-lambda-pulse {
  0%   { color: var(--lambda-gold); text-shadow: none; }
  50%  { color: #FFECBA; text-shadow: 0 0 28px rgba(212,175,106,.9), 0 0 56px rgba(212,175,106,.45), 0 0 90px rgba(212,175,106,.2); }
  100% { color: var(--lambda-gold); text-shadow: none; }
}
.boot-lambda { display: inline-block; transition: color .2s; }

/* ── Login ── */
/* ── Login screen — premium polish ─────────────────────────────────
   Editorial dark surface with a subtle warm vignette behind the card.
   The card itself is intentionally restrained: hairline rule lines,
   one accent color, generous spacing, thin display type. */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000000; z-index: 1000;
  overflow: hidden;
}
/* Soft radial wash behind the card — adds depth without ornament. */
.login-screen::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 1100px 700px at 50% 38%,
      rgba(224, 203, 168, 0.07) 0%,
      rgba(224, 203, 168, 0.025) 40%,
      transparent 70%);
  pointer-events: none;
}
/* Fine top-of-card hairline — typographic mark of quality. */
.login-screen::after {
  content: ""; position: absolute;
  left: 50%; top: 0;
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, transparent, rgba(224,203,168,0.35));
  transform: translateX(-50%);
  pointer-events: none;
}
.login-card {
  width: 420px; max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, #0E1116 0%, #0A0B0D 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 56px 48px 36px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 32px 64px -16px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(224, 203, 168, 0.06);
}
/* Hairline gold accent strip across the top edge of the card. */
.login-card::before {
  content: ""; position: absolute;
  left: 24%; right: 24%; top: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(224, 203, 168, 0.4) 50%,
    transparent 100%);
}
/* ── Platform checkbox primitive ── Used anywhere we need a checkbox
   (tables with bulk-select, settings toggles, batch dialogs). Apply
   `class="plat-check"` to a native <input type="checkbox"> — the
   semantics + keyboard handling come free, only the pixels change. */
.plat-check {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--rule2);
  border-radius: 3px;
  background: var(--surface2);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin: 0;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
  flex-shrink: 0;
}
.plat-check:hover    { border-color: var(--accent); }
.plat-check:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(196,168,130,.28);
}
.plat-check:checked  { background: var(--accent); border-color: var(--accent); }
.plat-check:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 0;
  width: 5px; height: 10px;
  border: solid #0A0B0D;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.plat-check:indeterminate { background: var(--accent); border-color: var(--accent); }
.plat-check:indeterminate::after {
  content: "";
  position: absolute;
  left: 3px; top: 6px;
  width: 8px; height: 2px;
  background: #0A0B0D;
  border: none;
  transform: none;
}
.plat-check:disabled { opacity: .45; cursor: not-allowed; }

/* Back-compat selectors for legacy pop-out pages. */
.login-logo { font-size: 36px; font-weight: 300; letter-spacing: -0.5px; color: var(--text); }
.login-lambda { color: var(--lambda-gold); font-weight: 300; }

/* Login wordmark — "37" and "uant" white, ℚ in sand gold. */
.brandmark-login { margin-bottom: 38px; }
.brandmark-login .bm-37,
.brandmark-login .bm-uant { color: #FFFFFF !important; }
.brandmark-login .bm-q    { color: var(--lambda-gold) !important; }
/* The eyebrow "by 37ℚ" was removed — kept the rule so old markup
   that still renders it falls back to nothing. */
.login-sub { display: none; }

/* Tiny field label above each input — premium form pattern. */
.login-fields { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.login-fields > * { width: 100%; }

.login-fields input {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0;
  color: #F0E8D6;
  font-size: 15px;
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.01em;
  outline: none;            /* no UA focus square */
  box-shadow: none;
  transition: border-color .25s ease, color .15s;
}
.login-fields input:hover { border-bottom-color: rgba(255, 255, 255, 0.18); }
.login-fields input:focus,
.login-fields input:focus-visible {
  outline: none;            /* belt + suspenders */
  box-shadow: none;
  border-bottom-color: var(--lambda-gold);
  color: #FFFFFF;
}
.login-fields input::placeholder {
  color: rgba(255, 255, 255, 0.32);
  font-weight: 300;
  letter-spacing: 0.01em;
}
/* Suppress Chrome's yellow autofill background + black text. */
.login-fields input:-webkit-autofill,
.login-fields input:-webkit-autofill:focus,
.login-fields input:-webkit-autofill:hover {
  -webkit-text-fill-color: #F0E8D6;
  -webkit-box-shadow: 0 0 0 1000px transparent inset;
  caret-color: var(--lambda-gold);
  transition: background-color 9999s ease 0s;
  outline: none !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
}

/* Primary button — soft sand with refined hover. */
.btn-primary {
  width: 100%;
  margin-top: 14px;
  padding: 14px 18px;
  background: #B89668;            /* deeper sand — restrained, monied */
  color: #0A0B0D;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background .18s ease, transform .15s ease,
              box-shadow .18s ease;
  box-shadow: 0 0 0 1px rgba(184, 150, 104, 0.18);
}
.btn-primary:hover {
  background: #C9A574;
  box-shadow:
    0 0 0 1px rgba(201, 165, 116, 0.45),
    0 8px 24px -8px rgba(184, 150, 104, 0.45);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  opacity: 0.4; cursor: not-allowed;
  transform: none; box-shadow: none;
}

.login-error {
  color: #FF9A8E; font-size: 12px; text-align: center;
  padding: 10px 14px;
  background: rgba(200, 16, 46, 0.06);
  border-radius: 4px;
  border: 1px solid rgba(200, 16, 46, 0.18);
  width: 100%;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* Bottom-of-card meta line — small, restrained. */
.login-notice {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
/* CUI capability now surfaces in the Repository (above the toolbar)
   instead of the login card — see repository.js .repo-cui-bar */

/* ── Login success reveal ──
   Five-phase animation between login card and home:
     0–300ms   .fade-card-content : card contents fade out
     300–700ms .fade-card-block   : card body fades, "37ℚ" reveals + scales
     700–1000ms .flicker          : ℚ flickers electric (300ms)
     1000–1400ms hold             : steady
     1400–1900ms .dissolve        : 37ℚ fades, home cross-dissolves in
   Total: ~1.9s. Each phase is driven by a class added by shell.js. */
.login-card.fading .login-heading,
.login-card.fading .login-fields,
.login-card.fading .login-notice {
  opacity: 0;
  transition: opacity .3s ease;
}
.login-card.fading {
  background: var(--surface);
}
.login-card.fading-block {
  opacity: 0;
  transform: scale(.97);
  transition: opacity .4s ease, transform .4s cubic-bezier(.22,.9,.25,1);
}
.login-screen.dimming { background: var(--bg); transition: background .4s ease; }

/* Login-reveal kept for back-compat but not used in the previous brand
   sequence — the brandmark.transitioning class drives the reveal. */
.login-reveal { display: none; }

/* ── App shell ── */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Titlebar ── */
.titlebar {
  height: var(--titlebar-h);
  background: var(--bg); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center;
  flex-shrink: 0; position: relative;
  -webkit-app-region: drag;
  user-select: none;
}
.titlebar-drag {
  position: absolute; inset: 0;
  -webkit-app-region: drag; z-index: 0;
}
.titlebar-logo {
  padding: 0 24px; font-size: 18px; font-weight: 300;
  letter-spacing: -0.3px; position: relative; z-index: 1;
  -webkit-app-region: no-drag; color: var(--text);
}
.nav-arrows {
  display: flex; gap: 2px; padding-right: 12px; position: relative; z-index: 1;
  -webkit-app-region: no-drag;
}
.nav-arrow {
  width: 28px; height: 26px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; border: 1px solid transparent;
  color: var(--text2); border-radius: 4px; cursor: pointer;
  font-size: 20px; line-height: 1; font-family: var(--sans); padding: 0;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.nav-arrow:hover { background: var(--surface); color: var(--text); }
.nav-arrow.nav-disabled {
  opacity: 0.35; cursor: default; pointer-events: none;
}
.tab-nav {
  display: flex; gap: 2px;
  position: absolute;
  left: 50%; transform: translateX(-50%);
  z-index: 1; -webkit-app-region: no-drag;
  /* Respect the room the logo + window-controls take so the nav can't
     overflow into them. The titlebar is 44px tall; reserve ~190px for
     the logo on the left and ~210px for the right-side controls. */
  max-width: calc(100vw - 420px);
}
@media (max-width: 1280px) {
  .tab-nav { max-width: calc(100vw - 360px); }
}
@media (max-width: 1024px) {
  .tab-nav {
    /* On smaller screens the centered layout fights the right controls.
       Pin to the left of the controls instead and let it scroll. */
    position: relative;
    left: 0;
    transform: none;
    margin-left: 12px;
    max-width: calc(100vw - 320px);
  }
}
@media (max-width: 720px) {
  /* Phone-class widths: drop the right-control reservation since the
     pills are tiny — let the whole row scroll horizontally inside
     whatever space remains after logo + right pills. */
  .tab-nav {
    position: relative;
    left: 0;
    transform: none;
    margin-left: 0;
    max-width: 100%;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
  .titlebar { display: flex !important; align-items: center; gap: 6px; flex-wrap: nowrap; }
  .titlebar-logo { flex-shrink: 0; }
  .titlebar-right { flex-shrink: 0; margin-left: auto; }
  .nav-arrows { display: none; }
}
.tab {
  padding: 6px 15px; background: transparent;
  border: 0; border-radius: 7px;
  color: var(--muted); font-size: 13px; font-weight: 380;
  font-family: var(--sans); cursor: pointer;
  transition: color .12s, background .12s; position: relative;
  -webkit-app-region: no-drag;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  height: 30px;
  letter-spacing: .01em;
}
.tab:hover { color: var(--text2); background: var(--surface); }
.tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
/* SOC tab — plain white text with a single pulsing red dot. Every
   other Level 1 tab renders as a standard nav tab; the dot is the
   only navigation indicator platform-wide. */
.tab.tab-level1 {
  color: #ffffff !important;
  font-weight: 400 !important;
}
.tab.tab-level1.active {
  color: #ffffff !important;
}
.soc-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bad);
  margin-right: 7px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: soc-pulse 2s ease-in-out infinite;
}
@keyframes soc-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.4); }
  50%      { opacity: .7; box-shadow: 0 0 0 4px rgba(200, 16, 46, 0); }
}
.tab-level1-dot { display: none !important; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.tab-badge {
  position: absolute; top: 2px; right: 4px;
  background: var(--accent); color: #000;
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px;
}
.titlebar-right {
  margin-left: auto; display: flex; align-items: center;
  gap: 12px; padding-right: 16px;
  position: relative; z-index: 1; -webkit-app-region: no-drag;
}
.titlebar-user {
  font-size: 13px; color: var(--muted); font-weight: 400;
}
.win-ctrl { display: flex; gap: 4px; }
.win-ctrl button {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid var(--rule2); background: var(--surface2);
  color: var(--muted); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, color .1s; font-family: var(--sans);
}
.win-ctrl button:hover { background: var(--surface3); color: var(--text); }
.win-close:hover { background: var(--bad) !important; color: white !important; border-color: var(--bad) !important; }

/* ── Surfaces ── */
.surfaces { flex: 1; overflow: hidden; position: relative; }
.surface { position: absolute; inset: 0; overflow: hidden; }
.surface.active {
  display: flex; flex-direction: column;
  animation: surface-fade-in 0.15s ease;
}
.surface.hidden { display: none; }
@keyframes surface-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Download toasts ── */
.download-toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.dl-toast {
  background: var(--surface); border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent); border-radius: var(--r-lg);
  padding: 12px 16px; min-width: 300px; max-width: 380px; pointer-events: auto;
  animation: dl-slide-in .3s ease-out;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
@keyframes dl-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.dl-toast-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.dl-toast-status { font-size: 11px; color: var(--muted); }
.dl-toast-bar { height: 3px; background: var(--rule2); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.dl-toast-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

/* ── Output panel ── */
.output-panel {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60vh;
  background: var(--surface); border-top: 1px solid var(--accent-border);
  z-index: 200; display: flex; flex-direction: column;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.output-head {
  height: 52px; background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; flex-shrink: 0; font-weight: 600; font-size: 14px;
}
.output-body { flex: 1; overflow: auto; padding: 24px; }
.btn-ghost {
  padding: 6px 14px; background: transparent;
  border: 1px solid rgba(0,0,0,.25); border-radius: var(--r-sm);
  color: #000; font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: var(--sans);
}
.btn-ghost:hover { background: rgba(0,0,0,.1); }

/* ── Shared form elements ── */
input, textarea, select {
  font-family: var(--sans); font-size: inherit;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--rule2); border-radius: var(--r-md);
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted2); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── Assistant markdown ── */
.home-assistant { letter-spacing: 0.005em; }
.home-assistant .md-p { margin: 0 0 14px 0; }
.home-assistant .md-p:last-child { margin-bottom: 0; }

.home-assistant .md-h2,
.home-assistant .md-h3,
.home-assistant .md-h4 {
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 22px 0 10px 0;
  line-height: 1.35;
}
.home-assistant .md-h2 { font-size: 20px; }
.home-assistant .md-h3 { font-size: 17px; color: var(--accent-mid); }
.home-assistant .md-h4 {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--mono);
  margin-top: 18px;
}
.home-assistant .md-h2:first-child,
.home-assistant .md-h3:first-child,
.home-assistant .md-h4:first-child { margin-top: 0; }

.home-assistant .md-list {
  margin: 6px 0 14px 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-assistant .md-list li {
  color: var(--text2);
  line-height: 1.65;
}
.home-assistant .md-list li::marker { color: var(--accent); }

.home-assistant .md-code {
  font-family: ui-monospace, SFMono-Regular, Mona Sans, Mona Sans, sans-serif;
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--rule2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent-l);
}
.home-assistant .md-pre {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 10px 0 14px 0;
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
}
.home-assistant .md-pre code {
  font-family: ui-monospace, SFMono-Regular, Mona Sans, Mona Sans, sans-serif;
  color: var(--text2);
  white-space: pre;
}

.home-assistant .md-hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 20px 0;
}

.home-assistant .md-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-border);
}
.home-assistant .md-link:hover { color: var(--accent-mid); border-bottom-color: var(--accent-mid); }

.home-assistant strong { color: var(--text); font-weight: 500; }
.home-assistant em { color: var(--text2); font-style: italic; }

.home-caret {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: home-caret-blink 1s step-end infinite;
  border-radius: 1px;
}
@keyframes home-caret-blink { 50% { opacity: 0; } }

/* ── Tools dropdown ── */
.tools-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 14px;
  background: transparent; border: none;
  color: var(--text); font-size: 13px;
  font-family: var(--sans); cursor: pointer;
  text-align: left; transition: background .1s;
}
.tools-menu-item:hover { background: var(--surface2); }
.tools-menu-icon {
  width: 28px; height: 28px;
  background: var(--accent); color: #000;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  font-family: var(--mono);
}

/* ── Error banner ── */
.err-banner {
  background: rgba(200,16,46,.08); border: 1px solid rgba(200,16,46,.3);
  border-left: 3px solid var(--bad); color: var(--text);
  padding: 10px 14px; border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 13px; margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── TV / Radio: hide meaningless time displays on live streams ── */
#tv-audio::-webkit-media-controls-timeline,
#tv-audio::-webkit-media-controls-current-time-display,
#tv-audio::-webkit-media-controls-time-remaining-display,
#tv-video::-webkit-media-controls-timeline,
#tv-video::-webkit-media-controls-current-time-display,
#tv-video::-webkit-media-controls-time-remaining-display,
#tv-mini-audio::-webkit-media-controls-timeline,
#tv-mini-audio::-webkit-media-controls-current-time-display,
#tv-mini-audio::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

/* ── Option B panel headers — subtle tinted surface with hairline underline.
      Replaces both the old solid sand bars and the Option A left-border
      treatment platform-wide. Applies to .panel-title (Shield panels) plus
      any common panel-head/section-header/card-header class name. */
.panel-title,
.panel-head,
.section-header,
.card-header,
.soc-panel-header,
.compliance-panel-header,
[class*="panel-head"],
[class*="section-head"],
[class*="panel-header"],
[class*="section-header"] {
  background: rgba(196, 168, 130, 0.06);
  border-left: none;
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
  color: var(--accent);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px;
  line-height: 1.4;
}
.panel-title--mono {
  font-family: var(--mono);
}
/* Inherit accent color onto any direct children so mono/caps/subtitle
   spans render correctly against the tinted surface. */
.panel-title *,
.panel-head *,
[class*="panel-head"] * {
  color: inherit;
}
.panel-head .muted,
.panel-title .muted { color: var(--muted); }
.panel-head button:not(.primary),
.panel-title button:not(.primary) {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
}

/* ── Presence brief card ── */
.presence-brief-card {
  background: rgba(196, 168, 130, 0.04);
  border-left: 3px solid rgba(196, 168, 130, 0.3);
  border-radius: 0 4px 4px 0;
  padding: 14px 18px;
  margin: 0 auto 16px;
  max-width: 720px;
}
.presence-brief-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.presence-brief-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}
.presence-detection-dot { color: var(--good); font-size: 8px; }
.presence-detection-label { color: var(--muted); }
.presence-ready-time { color: var(--muted2); }

/* ── Wiki surface ─────────────────────────────────────────────── */

.wiki-layout {
  display: grid;
  grid-template-columns: 240px 1fr 200px;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.wiki-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wiki-search-wrap { padding: 12px; flex-shrink: 0; }
.wiki-search {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--sans);
  padding: 7px 10px;
  box-sizing: border-box;
}
.wiki-search:focus { outline: none; border-color: var(--accent); }

.wiki-tree { flex: 1; overflow-y: auto; padding: 0 0 24px; }

.wiki-category { border-bottom: 1px solid var(--rule); }
.wiki-category-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.wiki-category-label:hover { color: var(--accent); }
.wiki-cat-arrow { font-size: 10px; }
.wiki-category-pages { padding-bottom: 4px; }
.wiki-page-link {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 14px 6px 22px;
  cursor: pointer;
  display: block;
  transition: color 0.1s, background 0.1s;
}
.wiki-page-link:hover { color: var(--text); background: var(--surface2); }
.wiki-page-link.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(196, 168, 130, 0.06);
  border-left: 2px solid var(--accent);
  padding-left: 20px;
}

/* Main content */
.wiki-content { overflow-y: auto; padding: 0; }

.wiki-welcome {
  text-align: center;
  padding: 64px 48px 48px;
  max-width: 720px;
  margin: 0 auto;
}
.wiki-welcome-logo {
  font-size: 36px;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.wiki-welcome-title {
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 8px;
}
.wiki-welcome-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 48px;
}
.wiki-ql-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.wiki-ql-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wiki-ql-card {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.wiki-ql-card:hover { border-color: var(--accent); color: var(--accent); }

.wiki-page { padding: 40px 48px; max-width: 820px; }
.wiki-page-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.wiki-page-title {
  font-size: 26px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.wiki-page-body { font-size: 14px; line-height: 1.8; color: var(--text); }
.wiki-page-body h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}
.wiki-page-body h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--accent);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
}
.wiki-page-body h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text);
}
.wiki-page-body p { margin: 0 0 14px; color: var(--text); }
.wiki-page-body ul, .wiki-page-body ol { margin: 0 0 14px; padding-left: 22px; }
.wiki-page-body li { margin-bottom: 4px; }
.wiki-page-body a { color: var(--accent); text-decoration: none; }
.wiki-page-body a:hover { text-decoration: underline; }
.wiki-page-body code {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--accent);
}
.wiki-page-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}
.wiki-page-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 13px;
}
.wiki-page-body th {
  background: rgba(196, 168, 130, 0.06);
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
}
.wiki-page-body td {
  border-bottom: 1px solid var(--rule);
  padding: 8px 12px;
  color: var(--text);
}
.wiki-page-body tr:hover td { background: var(--surface2); }
.wiki-tip {
  background: rgba(196, 168, 130, 0.06);
  border-left: 3px solid rgba(196, 168, 130, 0.4);
  border-radius: 0 4px 4px 0;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.wiki-page-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.06em;
}

.wiki-anchors {
  padding: 24px 16px;
  border-left: 1px solid var(--rule);
  overflow-y: auto;
  font-size: 11px;
  background: var(--surface);
}
.wiki-anchors-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.wiki-anchor-item {
  color: var(--muted);
  padding: 4px 0;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.1s;
}
.wiki-anchor-item:hover { color: var(--accent); }
.wiki-anchor-h3 { padding-left: 12px; font-size: 10.5px; }

@media (max-width: 1100px) {
  .wiki-layout { grid-template-columns: 220px 1fr; }
  .wiki-anchors { display: none; }
}

/* ── Nav three-zone layout ─────────────────────────────────────── */

.nav-separator {
  width: 1px;
  height: 18px;
  background: var(--rule2);
  margin: 0 10px;
  align-self: center;
  flex-shrink: 0;
}

#tab-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#tab-nav::-webkit-scrollbar { display: none; }
#tab-nav .tab { flex-shrink: 0; white-space: nowrap; }

/* Hide Level 1 separator when there are no L1 tabs inserted yet */
#tab-nav:not(:has(.tab-level1)) #nav-sep-l1 { display: none; }

/* Narrow-width responsive label tweaks. Tighten tab padding before
   anything has to disappear — gives every visible tab full reach. */
@media (max-width: 1280px) {
  .tab { padding: 6px 14px; }
  .nav-separator { margin: 0 6px; }
}
@media (max-width: 1100px) {
  .tab { padding: 6px 11px; font-size: 12.5px; }
  .tab[data-surface="repository"] { font-size: 0; padding: 0 11px; }
  .tab[data-surface="repository"]::before {
    content: 'Repo';
    font-size: 12.5px;
    font-family: var(--sans);
  }
}
@media (max-width: 900px) {
  .tab[data-surface="internet"]::before { content: 'Web'; }
  .tab[data-surface="internet"] { font-size: 0; padding: 0 10px; }
  .tab[data-surface="internet"]::before {
    font-size: 12.5px;
    font-family: var(--sans);
  }
  #nav-sep-l1 { margin: 0 4px; }
}
@media (max-width: 760px) {
  /* Phone-width: titlebar logo shrinks, nav scrolls horizontally. */
  .tab { padding: 6px 9px; font-size: 12px; }
}

/* Chrome icon button — replaces the old text Pop Out */
.chrome-icon-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--rule2);
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
  -webkit-app-region: no-drag;
}
.chrome-icon-btn:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--accent-border);
}

/* ── Home shortcut bar (user-configurable in Settings → Home) ──── */
.home-shortcut-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}
.home-shortcut-btn {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--text2);
  font-size: 12px;
  font-family: var(--sans);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.home-shortcut-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

/* ── Home notifications ─────────────────────────────────────────── */
.home-notifications {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.home-section-header {
  background: rgba(196, 168, 130, 0.06);
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home-section-count { color: var(--muted); font-size: 9px; }
.home-notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: start;
}
.home-notif-item:last-child { border-bottom: none; }
.home-notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  grid-column: 1;
}
.home-notif-body {
  font-size: 12px;
  color: var(--muted);
  grid-column: 1;
  line-height: 1.45;
}
.home-notif-time {
  font-size: 10px;
  color: var(--muted2);
  grid-column: 2;
  white-space: nowrap;
  text-align: right;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.home-notif-security .home-notif-title { color: var(--bad); }

/* ── Settings header with warm gradient ────────────────────────── */
.settings-header {
  background: linear-gradient(
    135deg,
    rgba(196, 168, 130, 0.08) 0%,
    rgba(196, 168, 130, 0.02) 60%,
    transparent 100%
  );
  border-bottom: 1px solid rgba(196, 168, 130, 0.15);
  padding: 22px 40px 18px;
}
.settings-header-title {
  font-size: 20px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: .02em;
}
.settings-header-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── SOC Intel report collapsible sections ─────────────────────── */
.intel-sections { padding: 8px 20px 4px; }
.intel-section {
  border-bottom: 1px solid var(--rule);
}
.intel-section:last-child { border-bottom: none; }
.intel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.intel-section-header:hover { color: var(--accent); }
.intel-section-arrow {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.intel-section-body { padding: 0 0 10px; }
.intel-section-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}
.intel-section-content p { margin: 0 0 8px; }
.intel-section-content ul { padding-left: 18px; margin: 0 0 8px; }
.intel-section-content li { margin-bottom: 3px; }
.intel-section-content strong { color: var(--accent); }

/* ── Settings: Home shortcut configurator ──────────────────────── */
.home-shortcut-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shortcut-option { cursor: pointer; }
.shortcut-option-inner {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.shortcut-option:hover .shortcut-option-inner { border-color: var(--accent); }
.shortcut-selected .shortcut-option-inner {
  border-color: var(--accent);
  background: rgba(196, 168, 130, 0.06);
}
.shortcut-option-name { font-size: 13px; color: var(--text); }
.shortcut-option-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.shortcut-selected .shortcut-option-tag {
  color: var(--accent);
  border-color: rgba(196, 168, 130, 0.3);
}

/* ── Chrome controls group — pop-out + window controls tight cluster ─ */
.chrome-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}
.chrome-controls .chrome-icon-btn {
  width: 32px;
  height: 28px;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--rule);
  color: var(--muted);
}
.chrome-controls .chrome-icon-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-right-color: var(--rule2);
}

/* Let the nav area take all the freed space. */
#tab-nav { flex: 1; min-width: 0; }

/* ── Presence brief — at-a-glance counts embedded inside the card ─ */
.presence-brief-glance {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ── Internal admin panel ──────────────────────────────────────── */
.internal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100%;
  background: var(--bg);
}
.internal-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}
.internal-brand {
  padding: 0 18px 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 10px;
}
.internal-brand-logo {
  font-size: 20px;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.internal-brand-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--bad);
  text-transform: uppercase;
  margin-top: 3px;
  font-family: var(--mono);
}
.internal-nav-item {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--sans);
  text-align: left;
  padding: 9px 18px;
  cursor: pointer;
  width: 100%;
  transition: color .1s, background .1s;
  border-left: 2px solid transparent;
}
.internal-nav-item:hover { color: var(--text); background: var(--surface2); }
.internal-nav-item.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(196, 168, 130, 0.06);
  border-left-color: var(--accent);
}
.internal-footer {
  margin-top: auto;
  padding: 14px 18px;
  font-size: 9.5px;
  color: var(--muted2);
  letter-spacing: 0.04em;
}

.internal-content { overflow-y: auto; }
.internal-page { padding: 28px 36px; max-width: 1040px; }
.internal-page-title {
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.internal-loading { padding: 40px; color: var(--muted); }

.internal-section-header {
  background: rgba(196, 168, 130, 0.06);
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  margin: 20px 0 12px;
}

.internal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.internal-kpi {
  background: var(--surface);
  padding: 20px 16px;
  text-align: center;
}
.internal-kpi-value {
  font-size: 24px;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.internal-kpi-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--mono);
}

.internal-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  font-family: var(--mono);
}
.badge-god      { background: rgba(196, 168, 130, 0.15); color: var(--accent); }
.badge-standard { background: var(--surface2); color: var(--muted); border: 1px solid var(--rule); }
.badge-active   { background: rgba(21, 128, 61, 0.15); color: var(--good); }
.badge-revoked  { background: rgba(200, 16, 46, 0.12); color: var(--bad); }

.internal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.internal-table th {
  background: rgba(196, 168, 130, 0.06);
  border-bottom: 1px solid rgba(196, 168, 130, 0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
}
.internal-table td {
  border-bottom: 1px solid var(--rule);
  padding: 9px 12px;
  color: var(--text);
  vertical-align: middle;
}
.internal-table tr:hover td { background: var(--surface2); }

.internal-btn {
  background: var(--surface2);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 12px;
  font-family: var(--sans);
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .1s, color .1s;
}
.internal-btn:hover { border-color: var(--accent); color: var(--accent); }
.internal-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}
.internal-btn-xs {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--sans);
  margin-right: 4px;
}
.internal-btn-xs:hover { color: var(--text); border-color: var(--accent); }
.internal-btn-xs.danger:hover { color: var(--bad); border-color: var(--bad); }

.internal-form { margin-bottom: 20px; }
.internal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.internal-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: var(--mono);
}
.internal-field input,
.internal-field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--rule);
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  padding: 8px 10px;
  border-radius: 4px;
  box-sizing: border-box;
}
.internal-field input:focus,
.internal-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.internal-warning {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--warn);
  margin-bottom: 10px;
}
.internal-error {
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.3);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--bad);
  margin-bottom: 10px;
}
.internal-result {
  background: rgba(21, 128, 61, 0.06);
  border: 1px solid rgba(21, 128, 61, 0.3);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
}

.internal-license-status {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.internal-license-status.valid { border-color: rgba(21, 128, 61, 0.4); }
.internal-license-status.invalid { border-color: rgba(200, 16, 46, 0.4); }
.ils-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.ils-detail { font-size: 12px; color: var(--muted); }

.internal-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.internal-customer-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px;
}
.icc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}
.icc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.icc-contact { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.icc-meta {
  display: flex;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--mono);
}
.icc-tailscale {
  font-size: 11px;
  color: var(--good);
  margin-bottom: 8px;
  font-family: var(--mono);
}
.icc-arr {
  font-size: 16px;
  font-weight: 300;
  color: var(--accent);
}

.internal-checklist { margin-top: 8px; }
.icl-item {
  font-size: 13px;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.5;
}
.icl-item:last-child { border-bottom: none; }

/* ── Sandbox (admin-only developer environment) ──────────────────── */
.sandbox-layout { padding: 40px; max-width: 980px; margin: 0 auto; }
.sandbox-header { margin-bottom: 32px; }
.sandbox-title {
  font-size: 24px;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.sandbox-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.sandbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.sandbox-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sandbox-card:hover { border-color: var(--accent); background: var(--surface2); }
.sandbox-card-icon {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--mono);
}
.sandbox-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.sandbox-card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
}
.sandbox-footer {
  font-size: 10px;
  color: var(--muted2);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  letter-spacing: 0.04em;
}

/* ── SOC refresh button spinner ────────────────────────────────── */
@keyframes soc-spin { to { transform: rotate(360deg); } }

/* ── Ambient intelligence status (Home) ─────────────────────── */
.ambient-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  padding: 6px 24px 0;
  max-width: 800px;
  margin: 0 auto;
  letter-spacing: 0.04em;
  font-family: var(--mono);
  text-transform: uppercase;
}
.ambient-status .ambient-dot {
  color: var(--good);
  font-size: 7px;
  animation: pulse-dot 3s ease-in-out infinite;
}

/* ── Voice input ───────────────────────────────────────────── */
.home-voice-btn {
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.home-voice-btn:hover { color: var(--text); border-color: var(--accent); }
.home-voice-btn.recording {
  background: rgba(200,16,46,.15); border-color: var(--bad); color: var(--bad);
  animation: voice-pulse 1s ease-in-out infinite;
}
.home-voice-btn.processing {
  background: rgba(196,168,130,.1); border-color: var(--accent); color: var(--accent);
  animation: voice-pulse .5s ease-in-out infinite;
}
@keyframes voice-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Assistant thinking dots — three breathing dots in gold ──── */
.agent-typing-dots {
  display: flex;
  gap: 8px;
  padding: 10px 4px;
}
.agent-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D4AF6A;
  animation: thinking-breathe 1.2s ease-in-out infinite;
}
.agent-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.agent-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-breathe {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50%      { opacity: 1.0; transform: scale(1.0); }
}

/* ── MOBILE RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  #tab-nav {
    display: none;
    position: fixed;
    top: var(--nav-height, 44px);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    z-index: 1000;
    padding: 8px 0;
  }
  #tab-nav.mobile-open { display: flex; }
  .tab {
    height: 44px;
    padding: 0 20px;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    width: 100%;
    justify-content: flex-start;
  }
  .nav-separator { width: 100%; height: 1px; margin: 4px 0; }
  #mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--nav-height, 44px);
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }
  .chrome-controls { display: none !important; }
  .surface { padding: 0 !important; }
  .home-voice-btn { width: 44px; height: 44px; }
  .modal-card {
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }
}
@media (min-width: 769px) {
  #mobile-menu-btn { display: none !important; }
}
@media (max-width: 480px) {
  .home-chat-bubble { max-width: 92% !important; }
}

/* ── Follow-up suggestion chips ──────────────────────────────── */
.home-followup-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.home-followup-chip {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 16px; padding: 5px 12px;
  font-size: 11px; color: var(--muted);
  cursor: pointer; font-family: 'Mona Sans', sans-serif;
  transition: all .15s; white-space: nowrap;
}
.home-followup-chip:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(196,168,130,.06);
}

/* ── URL index banner ────────────────────────────────────────── */
.url-index-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--surface2);
  border-top: 1px solid var(--rule); flex-wrap: wrap;
}




/* ── Spreadsheet Intelligence (Apple-style) ──────────────────── */
.si-shell { display:flex; flex-direction:column; height:100%; background:var(--bg); }
.si-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 24px; border-bottom:1px solid var(--rule);
  background:rgba(196,168,130,.04); flex-shrink:0;
}
.si-header-tag { font-size:10px; letter-spacing:.16em; text-transform:uppercase; color:var(--accent); font-weight:700; font-family:var(--mono); }
.si-header-title { font-size:18px; font-weight:300; color:var(--text); margin-top:2px; }
.si-header-btn {
  padding:7px 14px; background:var(--surface2); border:1px solid var(--rule);
  color:var(--text); border-radius:4px; font-size:12px; cursor:pointer; font-family:var(--sans);
}
.si-body { flex:1; overflow-y:auto; }
.si-loading { text-align:center; padding:60px; color:var(--muted); font-size:13px; }
.si-loading-sm { text-align:center; padding:20px; }
.si-empty { text-align:center; padding:60px; color:var(--muted); font-size:13px; }

/* Zones — contained sections with generous spacing */
.si-zone { padding:20px 24px; border-bottom:1px solid var(--rule); }
.si-zone:last-child { border-bottom:none; }
.si-zone-title {
  font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--accent); margin-bottom:14px; font-family:var(--mono);
}

/* KPI strip */
.si-kpi-strip {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr));
  gap:1px; background:var(--rule); border:1px solid var(--rule); border-radius:4px;
  overflow:hidden; margin-bottom:16px;
}
.si-kpi { background:var(--surface); padding:14px 8px; text-align:center; }
.si-kpi-compact .si-kpi { padding:10px 6px; }
.si-kpi-num { font-size:20px; font-weight:300; color:var(--text); line-height:1.2; }
.si-kpi-label { font-size:8px; font-weight:700; letter-spacing:.1em; color:var(--muted); text-transform:uppercase; margin-top:3px; }

/* Numeric column cards — compact grid */
.si-num-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px;
}
.si-num-card {
  padding:12px 14px; background:var(--surface); border:1px solid var(--rule);
  border-radius:4px; cursor:pointer; transition:border-color .15s;
}
.si-num-card:hover { border-color:var(--accent); }
.si-num-name { font-size:11px; color:var(--muted); font-weight:600; margin-bottom:4px; }
.si-num-big { font-size:18px; font-weight:300; color:var(--text); margin-bottom:2px; }
.si-num-sub { font-size:10px; color:var(--muted); }

/* Spark bars (mini inline chart) */
.si-spark { display:flex; align-items:flex-end; gap:2px; height:24px; margin-top:8px; }
.si-spark-bar { flex:1; background:var(--accent); border-radius:1px; min-width:4px; opacity:.6; }

/* Category pills */
.si-cat-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.si-cat-pill {
  display:flex; align-items:center; gap:8px;
  padding:8px 14px; background:var(--surface); border:1px solid var(--rule);
  border-radius:4px; cursor:pointer; transition:border-color .15s;
}
.si-cat-pill:hover { border-color:var(--accent); }
.si-cat-name { font-size:12px; font-weight:600; color:var(--text); }
.si-cat-count { font-size:10px; color:var(--muted); font-family:var(--mono); }

/* Cards */
.si-card {
  background:var(--surface); border:1px solid var(--rule);
  border-radius:4px; padding:16px; margin-bottom:12px;
}
.si-card-label {
  font-size:9px; font-weight:700; letter-spacing:.1em; color:var(--accent);
  text-transform:uppercase; margin-bottom:10px; font-family:var(--mono);
}
.si-llm-text { font-size:13px; color:var(--text); line-height:1.7; }
.si-error { color:var(--bad); font-size:12px; }

/* Table */
.si-table-wrap { overflow-x:auto; }
.si-table { width:100%; border-collapse:collapse; font-size:12px; }
.si-table th {
  background:rgba(196,168,130,.06); border-bottom:1px solid rgba(196,168,130,.2);
  color:var(--accent); font-size:9px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; padding:6px 10px; text-align:left; white-space:nowrap;
}
.si-table td { border-bottom:1px solid var(--rule); padding:5px 10px; color:var(--text); }
.si-table tr:hover td { background:var(--surface2); }
.si-table-more { font-size:10px; color:var(--muted); padding:4px 0; }

/* Bar chart */
.si-bars { display:flex; flex-direction:column; gap:5px; }
.si-bar-row { display:flex; align-items:center; gap:8px; }
.si-bar-label { width:90px; font-size:11px; color:var(--text); text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-shrink:0; }
.si-bar-track { flex:1; height:16px; background:var(--surface2); border-radius:2px; overflow:hidden; }
.si-bar-fill { height:100%; border-radius:2px; transition:width .3s; }
.si-bar-val { width:55px; font-size:10px; color:var(--muted); font-family:var(--mono); text-align:right; flex-shrink:0; }

/* Donut chart */
.si-donut-wrap { display:flex; align-items:center; gap:20px; padding:4px 0; }
.si-donut {
  width:110px; height:110px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
.si-donut-hole {
  width:60px; height:60px; border-radius:50%; background:var(--surface);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.si-donut-total { font-size:16px; font-weight:300; color:var(--text); }
.si-donut-sub { font-size:8px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.si-donut-legend { display:flex; flex-direction:column; gap:4px; }
.si-legend-item { display:flex; align-items:center; gap:6px; font-size:11px; }
.si-legend-dot { width:8px; height:8px; border-radius:2px; flex-shrink:0; }
.si-legend-text { color:var(--text); }
.si-legend-pct { color:var(--muted); font-family:var(--mono); font-size:10px; }

/* Chips + ask */
.si-chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.si-chip {
  background:var(--surface); border:1px solid var(--rule); border-radius:16px;
  padding:6px 14px; font-size:12px; color:var(--text); cursor:pointer;
  font-family:'Mona Sans',sans-serif; transition:all .15s;
}
.si-chip:hover { border-color:var(--accent); color:var(--accent); }
.si-ask-row { display:flex; gap:8px; }
.si-ask-input {
  flex:1; background:var(--surface2); border:1px solid var(--rule); color:var(--text);
  padding:10px 14px; border-radius:4px; font-size:13px; font-family:'Mona Sans',sans-serif;
}
.si-ask-input:focus { outline:none; border-color:var(--accent); }
.si-ask-btn {
  padding:10px 20px; background:var(--accent); color:#000; border:none;
  border-radius:4px; font-size:13px; font-weight:600; cursor:pointer;
}
.si-zone-explore .si-chip-row { margin-bottom:14px; }
.si-result-q { font-size:11px; color:var(--muted); margin-bottom:6px; }
.si-result-a { font-size:14px; color:var(--text); line-height:1.6; margin-bottom:8px; }
.si-result-a strong { color:var(--accent); }

/* ── Right-click context menu ────────────────────────────────── */
.ctx-menu {
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  font-family: 'Mona Sans', sans-serif;
}
.ctx-item {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.ctx-item:hover { background: var(--surface2); color: var(--accent); }
.ctx-sep { height: 1px; background: var(--rule); margin: 4px 0; }

/* ── Draw toolbar ────────────────────────────────────────────── */
.dtb {
  background: var(--surface2);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  font-family: 'Mona Sans', sans-serif;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .15s;
}
.dtb:hover { color: var(--text); border-color: var(--accent); }
.dtb.active { background: rgba(196,168,130,.12); border-color: var(--accent); color: var(--accent); }

/* ── My Time tabs ────────────────────────────────────────────── */
.mt-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 12px;
  font-family: 'Mona Sans', sans-serif;
  padding: 10px 18px; cursor: pointer; transition: all .15s;
}
.mt-tab:hover { color: var(--text); }
.mt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── macOS Finder-style Repository ───────────────────────────── */
.finder-section { margin-bottom: 4px; }
.finder-section-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  user-select: none; cursor: default;
}
.finder-section-arrow { font-size: 10px; color: var(--muted2); }
.finder-section-count {
  font-size: 10px; font-weight: 400; color: var(--muted2);
  margin-left: auto;
}
.finder-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.finder-table thead th {
  padding: 4px 14px;
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-align: left; letter-spacing: .04em;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  user-select: none;
  white-space: nowrap;
}
.finder-row {
  cursor: pointer; transition: background .08s;
}
.finder-row:hover { background: var(--surface2) !important; }
.finder-row td {
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}
.finder-row:last-child td { border-bottom: 1px solid var(--rule); }
.finder-icon {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 3px;
  font-family: var(--mono); min-width: 36px; text-align: center;
}
.finder-name {
  font-size: 13px; color: var(--text); font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.finder-meta {
  font-size: 11px; color: var(--muted); white-space: nowrap;
}

/* ── Meeting Intelligence ───────────────────────────────────── */
.meetings-layout {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}
.meetings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--rule);
}
.meetings-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--rule); padding: 0 20px;
}
.mtg-tab {
  background: none; border: none; color: var(--muted); font-family: var(--sans);
  font-size: var(--fs-sm); font-weight: 400; padding: 8px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.mtg-tab:hover { color: var(--text2); }
.mtg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.meetings-content {
  flex: 1; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 6px;
}
.meetings-footer {
  padding: 8px 20px; border-top: 1px solid var(--rule);
  font-size: var(--fs-xs); color: var(--muted2); text-align: center;
}
.meeting-card {
  background: var(--surface2); border: 1px solid var(--rule); border-radius: 4px;
  transition: border-color .15s;
}
.meeting-card:hover { border-color: var(--rule2); }
.meeting-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
}
.meeting-card-title {
  font-size: var(--fs-lg); font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px;
}
.meeting-card-meta {
  font-size: var(--fs-xs); color: var(--muted); margin-top: 2px;
}
.meeting-platform-badge {
  font-size: var(--fs-xs); color: var(--accent); background: var(--accent-bg);
  border: 1px solid var(--accent-border); border-radius: 4px; padding: 2px 8px;
  letter-spacing: 0.04em;
}
.meeting-status {
  font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── MasterKey ────────────────────────────────────────────────────── */
.mk-layout { display:flex; flex-direction:column; height:100%; }
.mk-header { display:flex; justify-content:space-between; align-items:center; padding:16px 24px; border-bottom:1px solid var(--rule); flex-shrink:0; }
.mk-title { font-size:18px; font-weight:300; color:var(--text); }
.mk-subtitle { font-size:11px; color:var(--muted); margin-top:2px; }
.mk-tabs { display:flex; border-bottom:1px solid var(--rule); flex-shrink:0; }
.mk-content { flex:1; overflow-y:auto; }
.mk-section { padding:20px 24px; max-width:1000px; }
.mk-section-label { font-size:9px; font-weight:700; letter-spacing:.1em; color:var(--accent); text-transform:uppercase; margin-bottom:10px; display:block; }

/* ── Word Processor ──────────────────────────────────────────────── */
.word-layout { display:flex; height:100%; overflow:hidden; }
.word-sidebar {
  width:220px; min-width:220px; background:var(--surface); border-right:1px solid #1F2430;
  display:flex; flex-direction:column; overflow:hidden;
}
.word-main { flex:1; display:flex; flex-direction:column; overflow:hidden; background:#0A0B0D; }
.word-sb-header { padding:12px; display:flex; flex-direction:column; gap:6px; border-bottom:1px solid #1F2430; }
.word-btn-new {
  background:var(--accent); color:#000; border:none; padding:7px 0; border-radius:4px;
  font-size:12px; font-weight:500; cursor:pointer; font-family:var(--sans);
  text-align:center;
}
.word-btn-new:hover { opacity:.85; }
.word-btn-template {
  background:transparent; color:var(--muted); border:1px solid #1F2430; padding:5px 0;
  border-radius:4px; font-size:11px; cursor:pointer; font-family:var(--sans); text-align:center;
}
.word-btn-template:hover { color:var(--text); border-color:var(--accent); }
.word-sb-folders { padding:8px 0; border-bottom:1px solid #1F2430; }
.word-sb-label {
  font-size:9px; font-weight:700; letter-spacing:.12em; color:var(--accent);
  text-transform:uppercase; padding:4px 16px; font-family:var(--sans);
}
.word-folder-item {
  padding:5px 16px; font-size:12px; color:var(--muted); cursor:pointer;
  font-family:var(--sans); transition:background .15s;
}
.word-folder-item:hover { background:#111318; color:var(--text); }
.word-folder-item.active { color:var(--text); background:#111318; }
.word-sb-docs { flex:1; overflow-y:auto; padding:4px 0; }
.word-doc-row {
  padding:8px 16px; cursor:pointer; position:relative; border-left:2px solid transparent;
  transition:background .15s;
}
.word-doc-row:hover { background:#111318; }
.word-doc-row.active { background:#111318; border-left-color:var(--accent); }
.word-doc-row-title { font-size:12px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding-right:20px; }
.word-doc-row-meta { font-size:10px; color:var(--muted); display:flex; gap:8px; margin-top:2px; }
.word-doc-class { font-weight:600; font-size:9px; text-transform:uppercase; letter-spacing:.06em; }
.word-doc-del {
  position:absolute; top:8px; right:8px; background:none; border:none; color:var(--muted2);
  font-size:16px; cursor:pointer; line-height:1; padding:0 4px; display:none;
}
.word-doc-row:hover .word-doc-del { display:block; }
.word-doc-del:hover { color:var(--bad); }

/* Toolbar */
.word-toolbar {
  display:flex; align-items:center; gap:2px; padding:6px 12px;
  border-bottom:1px solid #1F2430; background:#111318; flex-wrap:wrap; min-height:40px;
}
.word-tb-group { display:flex; align-items:center; gap:2px; }
.word-tb-sep { width:1px; height:20px; background:#1F2430; margin:0 6px; }
.word-tb-spacer { flex:1; }
.word-tb-btn {
  background:transparent; border:1px solid transparent; color:var(--text);
  padding:4px 8px; border-radius:3px; font-size:12px; cursor:pointer;
  font-family:var(--sans); line-height:1.2;
}
.word-tb-btn:hover { background:#1F2430; }
.word-tb-btn b { font-weight:700; }
.word-tb-btn i { font-style:italic; }
.word-tb-btn u { text-decoration:underline; }
.word-tb-btn s { text-decoration:line-through; }
.word-tb-export { color:var(--accent); font-weight:500; font-size:11px; }
.word-tb-select {
  background:#0A0B0D; color:var(--text); border:1px solid #1F2430; border-radius:3px;
  padding:4px 8px; font-size:11px; font-family:var(--sans); cursor:pointer;
}
.word-save-status { font-size:11px; padding:0 8px; }

/* Canvas area */
.word-canvas-wrap {
  flex:1; overflow-y:auto; display:flex; justify-content:center;
  padding:32px 24px; background:#0A0B0D; position:relative;
}
.word-empty {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  position:absolute; inset:0;
}
.word-page {
  width:100%; max-width:816px; min-height:1056px; background:#fff;
  border-radius:2px; padding:0; display:flex; flex-direction:column;
  box-shadow:0 1px 8px rgba(0,0,0,.3); position:relative;
}
.word-class-banner {
  text-align:center; color:#fff; font-size:10px; font-weight:700;
  letter-spacing:.16em; text-transform:uppercase; padding:4px 0;
  font-family:var(--sans);
}
.word-title-input {
  border:none; outline:none; font-size:24px; font-weight:300; color:#111;
  padding:32px 48px 8px; background:transparent; font-family:var(--sans);
  width:100%;
}
.word-title-input::placeholder { color:#bbb; }
.word-editor {
  flex:1; padding:8px 48px 48px; outline:none; font-size:14px; line-height:1.7;
  color:#111; font-family:var(--sans); min-height:400px;
}
.word-editor h1 { font-size:28px; font-weight:400; margin:16px 0 8px; color:#111; }
.word-editor h2 { font-size:22px; font-weight:400; margin:14px 0 6px; color:#222; }
.word-editor h3 { font-size:18px; font-weight:500; margin:12px 0 4px; color:#333; }
.word-editor p { margin:0 0 8px; }
.word-editor ul, .word-editor ol { margin:0 0 8px; padding-left:24px; }
.word-editor a { color:#1D4ED8; text-decoration:underline; }
.word-editor img { max-width:100%; border-radius:2px; margin:8px 0; }
.word-editor table { border-collapse:collapse; width:100%; margin:12px 0; }
.word-editor td, .word-editor th { border:1px solid #ccc; padding:6px 8px; }
.word-page-footer {
  padding:8px 48px 12px; font-size:11px; color:#999; text-align:right;
  border-top:1px solid #eee; margin-top:auto;
}

/* Word toast (fallback) */
.word-toast {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:#111318; color:var(--text); border:1px solid #1F2430;
  padding:8px 20px; border-radius:4px; font-size:12px; font-family:var(--sans);
  opacity:0; transition:opacity .3s; z-index:9999; pointer-events:none;
}
.word-toast-visible { opacity:1; }

/* ── Spreadsheet ──────────────────────────────────────────────────── */
.ss-wrap { display:flex; height:100%; overflow:hidden; background:#000; }
.ss-sidebar {
  width:200px; flex-shrink:0; display:flex; flex-direction:column;
  background:#111318; border-right:1px solid #1F2430; overflow:hidden;
}
.ss-sidebar-head { padding:14px 14px 10px; border-bottom:1px solid #1F2430; }
.ss-brand-label {
  font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:#C4A882; font-weight:700; font-family:var(--sans); display:block; margin-bottom:10px;
}
.ss-btn {
  display:block; width:100%; padding:7px 12px; font-size:11px;
  font-family:var(--sans); font-weight:500; border:1px solid #1F2430;
  border-radius:4px; background:transparent; color:#F0F2F5; cursor:pointer;
  text-align:left; transition:background .15s;
}
.ss-btn:hover { background:rgba(196,168,130,.08); }
.ss-btn-new { margin-bottom:0; }
.ss-btn-sm { display:inline-block; width:auto; padding:5px 10px; font-size:10px; }
.ss-btn-accent { background:rgba(196,168,130,.12); color:#C4A882; border-color:rgba(196,168,130,.3); }
.ss-btn-accent:hover { background:rgba(196,168,130,.22); }
.ss-btn-import { margin-top:auto; }
.ss-wb-list { flex:1; overflow-y:auto; padding:6px 0; }
.ss-wb-empty { padding:14px; font-size:11px; color:#7a7a7a; }
.ss-wb-item {
  display:flex; align-items:center; padding:7px 14px; cursor:pointer;
  font-size:12px; color:#F0F2F5; transition:background .12s;
}
.ss-wb-item:hover { background:rgba(255,255,255,.04); }
.ss-wb-item.active { background:rgba(196,168,130,.1); border-left:2px solid #C4A882; }
.ss-wb-item-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ss-wb-del {
  background:none; border:none; color:#7a7a7a; cursor:pointer; font-size:14px;
  padding:0 4px; line-height:1; opacity:0; transition:opacity .15s;
}
.ss-wb-item:hover .ss-wb-del { opacity:1; }
.ss-wb-del:hover { color:#C8102E; }
.ss-sidebar-foot { padding:10px 14px; border-top:1px solid #1F2430; }

/* ── Main area ── */
.ss-main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.ss-toolbar {
  display:flex; align-items:center; gap:8px; padding:6px 12px;
  background:#111318; border-bottom:1px solid #1F2430; flex-shrink:0;
}
.ss-cell-label {
  font-size:11px; font-weight:600; color:#C4A882; min-width:36px;
  text-align:center; font-family:var(--sans);
}
.ss-formula-sep { font-size:10px; color:#7a7a7a; font-style:italic; }
.ss-formula-input {
  flex:1; background:transparent; border:1px solid #1F2430; border-radius:2px;
  color:#F0F2F5; font-size:12px; padding:4px 8px; font-family:var(--sans);
  outline:none;
}
.ss-formula-input:focus { border-color:#C4A882; }
.ss-toolbar-right { display:flex; gap:6px; align-items:center; margin-left:auto; }

/* ── Grid ── */
.ss-grid-wrap { flex:1; overflow:auto; position:relative; }
.ss-table {
  border-collapse:collapse; table-layout:fixed; width:max-content;
  font-size:12px; font-family:var(--sans); color:#F0F2F5;
}
.ss-table th, .ss-table td {
  border:1px solid #1F2430; padding:0; height:24px; min-height:24px;
}
.ss-corner {
  width:40px; min-width:40px; background:#111318; position:sticky;
  top:0; left:0; z-index:3; border-right:1px solid #1F2430;
  border-bottom:1px solid #1F2430;
}
.ss-col-hdr {
  width:90px; min-width:90px; background:#111318; text-align:center;
  font-size:10px; font-weight:600; color:#7a7a7a; position:sticky;
  top:0; z-index:2; cursor:pointer; user-select:none; letter-spacing:.05em;
  border-bottom:1px solid #1F2430;
}
.ss-col-hdr:hover { color:#C4A882; background:rgba(196,168,130,.06); }
.ss-col-hdr.ss-col-active { color:#C4A882; background:rgba(196,168,130,.08); }
.ss-row-hdr {
  width:40px; min-width:40px; background:#111318; text-align:center;
  font-size:10px; font-weight:600; color:#7a7a7a; position:sticky;
  left:0; z-index:1; user-select:none;
}
.ss-cell {
  width:90px; min-width:90px; padding:2px 6px !important;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  cursor:cell; outline:none;
}
.ss-cell:focus { outline:none; }
.ss-cell.ss-active { outline:2px solid #C4A882; outline-offset:-1px; z-index:1; position:relative; }
.ss-cell.ss-editing { background:rgba(196,168,130,.06); outline:2px solid #C4A882; outline-offset:-1px; }

/* Alternating rows */
.ss-table tbody tr:nth-child(even) td.ss-cell { background:rgba(255,255,255,.015); }
.ss-table tbody tr:nth-child(even) td.ss-cell.ss-active { background:rgba(196,168,130,.06); }

/* ── Empty state ── */
.ss-empty {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  height:100%; color:#7a7a7a; gap:8px;
}
.ss-empty-icon { font-size:32px; opacity:.3; }
.ss-empty-text { font-size:13px; }

/* ── AI Panel ── */
.ss-ai-panel {
  width:320px; flex-shrink:0; display:flex; flex-direction:column;
  background:#111318; border-left:1px solid #1F2430; overflow:hidden;
}
.ss-ai-head {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 14px; border-bottom:1px solid #1F2430;
  font-size:11px; font-weight:600; color:#C4A882;
  letter-spacing:.06em; text-transform:uppercase;
}
.ss-ai-body { flex:1; overflow-y:auto; padding:14px; }
.ss-ai-loading { font-size:12px; color:#7a7a7a; }
.ss-ai-error { font-size:12px; color:#C8102E; }
.ss-ai-content { font-size:12px; color:#F0F2F5; line-height:1.7; }
.ss-ai-content strong { color:#C4A882; font-weight:600; }

/* ── Query input ── */
.ss-query-wrap { display:flex; gap:6px; margin-bottom:12px; }
.ss-query-input {
  flex:1; background:transparent; border:1px solid #1F2430; border-radius:2px;
  color:#F0F2F5; font-size:12px; padding:6px 8px; outline:none; font-family:var(--sans);
}
.ss-query-input:focus { border-color:#C4A882; }

/* ── Import modal ── */
.ss-overlay {
  position:absolute; inset:0; background:rgba(0,0,0,.7);
  display:flex; align-items:center; justify-content:center; z-index:100;
}
.ss-modal {
  width:440px; max-width:90%; max-height:70vh; background:#111318;
  border:1px solid #1F2430; border-radius:4px; display:flex; flex-direction:column; overflow:hidden;
}
.ss-modal-head {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; border-bottom:1px solid #1F2430;
  font-size:12px; font-weight:600; color:#F0F2F5;
}
.ss-modal-body { flex:1; overflow-y:auto; padding:6px 0; }
.ss-import-row {
  display:flex; justify-content:space-between; padding:8px 16px;
  cursor:pointer; font-size:12px; color:#F0F2F5; transition:background .12s;
}
.ss-import-row:hover { background:rgba(196,168,130,.08); }
.ss-import-name { flex:1; }
.ss-import-meta { color:#7a7a7a; font-size:10px; margin-left:8px; }

/* ── PDF Reader ──────────────────────────────────────────────────── */
.pdf-shell { display:flex; height:100%; overflow:hidden; background:#000; }
.pdf-sidebar {
  width:220px; min-width:220px; background:#111318; border-right:1px solid #1F2430;
  display:flex; flex-direction:column; overflow:hidden;
}
.pdf-sidebar-head {
  padding:14px 16px 10px; border-bottom:1px solid #1F2430;
}
.pdf-sidebar-title {
  font-size:14px; font-weight:300; color:#F0F2F5; letter-spacing:.02em;
}
.pdf-upload-btn {
  margin:10px 12px; padding:7px 0; background:transparent; border:1px solid #C4A882;
  color:#C4A882; font-size:11px; font-weight:500; border-radius:4px; cursor:pointer;
  font-family:var(--sans); text-transform:uppercase; letter-spacing:.06em;
  transition:background .15s, color .15s;
}
.pdf-upload-btn:hover { background:#C4A882; color:#000; }
.pdf-file-list { flex:1; overflow-y:auto; padding:4px 0; }
.pdf-file-item {
  display:flex; flex-direction:column; width:100%; padding:8px 14px;
  background:transparent; border:none; border-bottom:1px solid #1F2430;
  text-align:left; cursor:pointer; font-family:var(--sans); transition:background .1s;
}
.pdf-file-item:hover { background:rgba(196,168,130,.06); }
.pdf-file-item.active { background:rgba(196,168,130,.10); border-left:2px solid #C4A882; }
.pdf-file-name { font-size:12px; color:#F0F2F5; font-weight:400; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pdf-file-meta { font-size:10px; color:#8892A4; margin-top:2px; }
.pdf-no-files { padding:16px; font-size:11px; color:#8892A4; text-align:center; }
.pdf-sidebar-label {
  font-size:9px; font-weight:700; letter-spacing:.1em; color:#C4A882;
  text-transform:uppercase; padding:12px 14px 6px;
}
.pdf-ann-section { border-top:1px solid #1F2430; }
.pdf-ann-list { overflow-y:auto; max-height:200px; }
.pdf-ann-item {
  display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px;
  width:100%; padding:6px 14px; background:transparent; border:none;
  border-bottom:1px solid rgba(31,36,48,.5); text-align:left; cursor:pointer;
  font-family:var(--sans); transition:background .1s;
}
.pdf-ann-item:hover { background:rgba(196,168,130,.06); }
.pdf-ann-type { font-size:10px; color:#C4A882; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.pdf-ann-page { font-size:10px; color:#8892A4; }
.pdf-ann-content { font-size:10px; color:#F0F2F5; width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pdf-ann-del {
  margin-left:auto; font-size:14px; color:#8892A4; cursor:pointer;
  padding:0 2px; line-height:1;
}
.pdf-ann-del:hover { color:#C8102E; }

/* PDF main area */
.pdf-main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.pdf-toolbar {
  display:flex; align-items:center; gap:12px; padding:6px 14px;
  background:#111318; border-bottom:1px solid #1F2430; flex-shrink:0; flex-wrap:wrap;
}
.pdf-toolbar-group { display:flex; align-items:center; gap:6px; }
.pdf-tb-btn {
  background:transparent; border:1px solid #1F2430; color:#F0F2F5;
  padding:4px 10px; font-size:11px; border-radius:4px; cursor:pointer;
  font-family:var(--sans); transition:border-color .15s, color .15s;
}
.pdf-tb-btn:hover { border-color:#C4A882; color:#C4A882; }
.pdf-tb-btn.active { background:rgba(196,168,130,.15); border-color:#C4A882; color:#C4A882; }
.pdf-tb-page { font-size:11px; color:#8892A4; display:flex; align-items:center; gap:4px; }
.pdf-page-num {
  width:42px; background:#000; border:1px solid #1F2430; color:#F0F2F5;
  padding:2px 6px; font-size:11px; text-align:center; border-radius:2px;
  font-family:var(--sans);
}
.pdf-page-num:focus { border-color:#C4A882; outline:none; }
.pdf-page-sep { color:#8892A4; }
.pdf-tb-zoom { font-size:11px; color:#8892A4; min-width:36px; text-align:center; }
.pdf-search-input {
  background:#000; border:1px solid #1F2430; color:#F0F2F5;
  padding:4px 8px; font-size:11px; border-radius:4px; width:140px;
  font-family:var(--sans);
}
.pdf-search-input:focus { border-color:#C4A882; outline:none; }
.pdf-search-count { font-size:10px; color:#8892A4; }

/* Canvas area */
.pdf-canvas-wrap {
  flex:1; overflow:auto; display:flex; justify-content:center; align-items:flex-start;
  background:#000; padding:20px;
}
.pdf-empty-state {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  height:100%; gap:12px;
}
.pdf-empty-icon {
  font-size:28px; font-weight:700; color:#1F2430; letter-spacing:.06em;
  border:2px solid #1F2430; padding:16px 24px; border-radius:4px;
}
.pdf-empty-text { font-size:12px; color:#8892A4; }
.pdf-canvas-container {
  position:relative; display:inline-block;
  box-shadow:0 0 40px rgba(0,0,0,.5);
}
#pdf-canvas { display:block; }

/* Annotation layer */
.pdf-annotation-layer {
  position:absolute; top:0; left:0; pointer-events:none;
}
.pdf-ann-el { position:absolute; pointer-events:auto; }
.pdf-ann-highlight {
  background:rgba(255,255,0,0.3); border:1px solid rgba(255,255,0,0.4);
  cursor:pointer; border-radius:2px;
}
.pdf-ann-highlight:hover { background:rgba(255,255,0,0.45); }
.pdf-highlight-preview {
  position:absolute; background:rgba(255,255,0,0.2); border:1px dashed rgba(255,255,0,0.5);
  pointer-events:none;
}

/* Note pins */
.pdf-ann-note-pin {
  width:16px; height:16px; border-radius:50%; background:#C4A882;
  cursor:pointer; position:absolute; border:2px solid #000;
  transition:transform .1s;
}
.pdf-ann-note-pin:hover { transform:scale(1.3); }
.pdf-ann-note-pin:hover .pdf-note-tooltip { display:block; }
.pdf-note-tooltip {
  display:none; position:absolute; left:20px; top:-4px;
  background:#111318; border:1px solid #1F2430; color:#F0F2F5;
  padding:6px 10px; font-size:11px; border-radius:4px; white-space:pre-wrap;
  max-width:200px; z-index:10; pointer-events:none;
}

/* Note popup */
.pdf-note-popup {
  position:absolute; z-index:20; background:#111318; border:1px solid #1F2430;
  border-radius:4px; padding:8px; pointer-events:auto; width:200px;
}
.pdf-note-input {
  width:100%; background:#000; border:1px solid #1F2430; color:#F0F2F5;
  padding:6px 8px; font-size:11px; border-radius:2px; resize:vertical;
  font-family:var(--sans);
}
.pdf-note-input:focus { border-color:#C4A882; outline:none; }
.pdf-note-actions { display:flex; gap:6px; margin-top:6px; justify-content:flex-end; }

/* ── Analytics Dashboard ── */
.ana-root { height:100%; display:flex; background:#000; color:var(--text); font-family:var(--sans); }
.ana-sidebar { width:240px; min-width:240px; border-right:1px solid var(--rule); display:flex; flex-direction:column; background:#000; }
.ana-sidebar-head { padding:20px 16px 12px; border-bottom:1px solid var(--rule); }
.ana-brand { font-size:18px; font-weight:500; color:#C4A882; }
.ana-brand-sub { font-size:11px; color:var(--muted); margin-top:2px; }
.ana-btn-new { display:block; width:calc(100% - 24px); margin:12px 12px 0; padding:8px 0; background:#C4A882; color:#000; border:none; border-radius:4px; cursor:pointer; font-weight:500; font-size:12px; font-family:var(--sans); }
.ana-btn-new:hover { background:#D4B896; }
.ana-dash-list { flex:1; overflow:auto; padding:8px 0; }
.ana-dash-empty { color:var(--muted2); font-size:11px; padding:16px; text-align:center; }
.ana-dash-item { display:flex; align-items:center; justify-content:space-between; padding:8px 16px; cursor:pointer; font-size:12px; color:var(--text2); border-left:2px solid transparent; }
.ana-dash-item:hover { background:var(--surface2); }
.ana-dash-item.active { background:var(--surface2); border-left-color:#C4A882; color:#C4A882; }
.ana-dash-item-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ana-dash-item-del { background:none; border:none; color:var(--muted2); cursor:pointer; font-size:16px; padding:0 4px; line-height:1; }
.ana-dash-item-del:hover { color:var(--bad); }
.ana-sidebar-foot { padding:12px; border-top:1px solid var(--rule); }
.ana-btn-csv { width:100%; padding:7px 0; background:transparent; border:1px solid var(--rule2); color:var(--text2); border-radius:4px; cursor:pointer; font-size:11px; font-family:var(--sans); }
.ana-btn-csv:hover { border-color:#C4A882; color:#C4A882; }
.ana-main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.ana-toolbar { display:flex; align-items:center; gap:12px; padding:10px 20px; border-bottom:1px solid var(--rule); flex-wrap:wrap; }
.ana-title-input { background:transparent; border:1px solid transparent; color:var(--text); font-size:14px; font-weight:500; padding:4px 8px; border-radius:4px; font-family:var(--sans); min-width:200px; }
.ana-title-input:focus { border-color:var(--rule2); outline:none; }
.ana-toolbar-actions { display:flex; gap:6px; margin-left:auto; flex-wrap:wrap; }
.ana-tb-btn { background:var(--surface2); border:1px solid var(--rule); color:var(--text2); padding:6px 12px; border-radius:4px; cursor:pointer; font-size:11px; font-family:var(--sans); white-space:nowrap; }
.ana-tb-btn:hover { border-color:#C4A882; color:#C4A882; }
.ana-content { flex:1; overflow:auto; }
.ana-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; }
.ana-empty-icon { font-size:36px; color:var(--muted2); margin-bottom:12px; }
.ana-empty-title { font-size:15px; font-weight:500; color:var(--text2); }
.ana-empty-sub { font-size:12px; color:var(--muted); margin-top:4px; }
.ana-no-widgets { color:var(--muted); font-size:12px; padding:40px; text-align:center; }
.analytics-widget { background:var(--surface); border:1px solid var(--rule); border-radius:4px; overflow:hidden; }
.analytics-widget-header { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-bottom:1px solid var(--rule); }
.analytics-widget-title { font-size:12px; font-weight:600; color:var(--text); }
.analytics-widget-menu { background:none; border:none; color:var(--muted); cursor:pointer; font-size:16px; padding:0 4px; line-height:1; }
.analytics-widget-menu:hover { color:var(--bad); }
.analytics-widget-body { padding:12px; height:280px; position:relative; }
.analytics-widget-body canvas { width:100% !important; height:100% !important; }
.analytics-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(380px,1fr)); gap:16px; padding:20px; }
.ana-table { width:100%; border-collapse:collapse; font-size:11px; }
.ana-table th { text-align:left; padding:6px 10px; background:var(--surface2); color:#C4A882; font-weight:600; border-bottom:1px solid var(--rule); white-space:nowrap; }
.ana-table td { padding:5px 10px; border-bottom:1px solid var(--rule); color:var(--text2); }
.ana-table tr:hover td { background:rgba(196,168,130,0.04); }
.ana-narrative-card { margin:0 20px 20px; padding:16px 20px; background:var(--surface); border:1px solid var(--rule); border-radius:4px; }
.ana-narrative-head { font-size:12px; font-weight:600; color:#C4A882; margin-bottom:8px; }
.ana-narrative-body { font-size:12px; color:var(--text2); line-height:1.65; white-space:pre-wrap; }
.ana-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:2000; display:flex; align-items:center; justify-content:center; }
.ana-modal { background:#111318; border:1px solid #1F2430; border-radius:4px; width:480px; max-width:90vw; max-height:80vh; overflow:auto; padding:24px; }
.ana-modal-title { font-size:15px; font-weight:500; color:var(--text); margin-bottom:4px; }
.ana-modal-desc { font-size:11px; color:var(--muted); margin-bottom:16px; }
.ana-label { display:block; font-size:10px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:4px; margin-top:12px; }
.ana-input { display:block; width:100%; background:#000; border:1px solid var(--rule2); color:var(--text); padding:8px 10px; border-radius:4px; font-size:12px; font-family:var(--sans); }
.ana-input:focus { border-color:#C4A882; outline:none; }
.ana-input-area { display:block; width:100%; background:#000; border:1px solid var(--rule2); color:var(--text); padding:8px 10px; border-radius:4px; font-size:12px; font-family:var(--sans); resize:vertical; }
.ana-input-area:focus { border-color:#C4A882; outline:none; }
.ana-modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }
.ana-btn-cancel { background:transparent; border:1px solid var(--rule2); color:var(--text2); padding:7px 16px; border-radius:4px; cursor:pointer; font-size:12px; font-family:var(--sans); }
.ana-btn-cancel:hover { border-color:var(--muted); }
.ana-btn-primary { background:#C4A882; color:#000; border:none; padding:7px 16px; border-radius:4px; cursor:pointer; font-weight:500; font-size:12px; font-family:var(--sans); }
.ana-btn-primary:hover { background:#D4B896; }

/* ── Tools Workspace (card grid — no sidebar) ── */

/* Proposal viewer — paper-safe defaults for raw-HTML content (e.g.
   pasted-in <table> blocks that came from Word / Google Docs). */
.prop-section-body .prop-raw-html table { width:100%; border-collapse:collapse; margin:14px 0; border:1px solid #D6D2C6; }
.prop-section-body .prop-raw-html th { background:#F4F1E9; border-bottom:2px solid #C4A882; padding:8px 10px; text-align:left; color:#1A1916; font-weight:600; font-size:13px; }
.prop-section-body .prop-raw-html td { border-bottom:1px solid #E5E1D5; padding:7px 10px; color:#1A1916; font-size:14px; vertical-align:top; }
.prop-section-body .prop-raw-html ul,
.prop-section-body .prop-raw-html ol { margin:8px 0 12px 22px; padding:0; color:#1A1916; line-height:1.7; }
.prop-section-body .prop-raw-html li { margin:3px 0; }
.prop-section-body .prop-raw-html br { display:none; }   /* Strip stray <br> from old saves */

/* ── Titlebar chrome pills (Voice / Search / Help / Auto) ────────── */
.chrome-pill {
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.chrome-pill:hover {
  background: rgba(196,168,130,0.08);
  border-color: var(--accent-border, var(--rule2));
  color: var(--text);
}
.chrome-pill .pill-label { font-size: 11.5px; letter-spacing: 0.01em; }
.chrome-pill .pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #555; flex-shrink: 0;
  transition: background .15s, box-shadow .15s;
}
.chrome-pill-icon { padding: 0 9px; min-width: 28px; justify-content: center; }
.chrome-pill-voice .pill-dot { background: #555; }
.chrome-pill-help svg { color: var(--accent); }
.chrome-pill-help:hover { color: var(--accent); }

/* ── Assistant response notification toast (when user is on another surface) ── */
.asst-toast {
  position: fixed; right: 18px; bottom: 18px;
  width: min(360px, calc(100vw - 24px));
  z-index: 9000;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17,19,24,0.96) 100%);
  border: 1px solid var(--accent-border, rgba(196,168,130,0.38));
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.48), 0 0 0 1px rgba(196,168,130,0.18) inset;
  font-family: var(--sans);
  color: var(--text);
  cursor: pointer;
  animation: asstoast-in .25s cubic-bezier(.22,.9,.25,1);
}
.asst-toast .asst-toast-eyebrow {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.asst-toast .asst-toast-eyebrow::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px rgba(196,168,130,0.7);
  animation: asstoast-pulse 1.6s ease-in-out infinite;
}
.asst-toast .asst-toast-body { font-size: 13px; line-height: 1.5; margin-top: 6px; max-height: 160px; overflow: hidden; }
.asst-toast .asst-toast-action { margin-top: 10px; display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.asst-toast .asst-toast-go { color: var(--accent); font-weight: 600; }
.asst-toast .asst-toast-close {
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: none; color: var(--muted2);
  font-size: 16px; cursor: pointer; line-height: 1; padding: 4px;
}
@keyframes asstoast-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes asstoast-pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ── iPhone / mobile responsive ─────────────────────────────────── */
@media (max-width: 720px) {
  .titlebar { height: 48px; padding: 0 6px; }
  .titlebar-logo { font-size: 14px !important; }
  .chrome-pill .pill-label { display: none; }
  .chrome-pill { padding: 0 8px; min-width: 28px; }
  .chrome-pill-voice { padding: 0 9px; }
  .nav-arrows { display: none; }
  /* Tab nav scrolls horizontally with momentum on iOS */
  .tab-nav {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0 4px;
  }
  .tab { scroll-snap-align: start; min-height: 44px; height: 44px; padding: 0 14px; font-size: 13.5px; }
  /* Make every modal full-screen on phone for thumb-reach */
  .surface { padding: 0 !important; }
  /* Bigger buttons everywhere — iOS touch target */
  button { min-height: 36px; }
  .home-input-shell { border-radius: 12px; }
  .home-input-textarea { font-size: 16px; padding: 14px 12px 14px 14px; } /* 16px stops iOS zoom */
  .home-input-actions { padding: 6px 6px 6px 0; }
  /* Settings sidebar stacks above the form */
  .settings-sidebar { width: 100% !important; max-height: 200px; overflow-y: auto; }
  .settings-body { padding: 16px !important; }
}

/* iOS safe-area: respect notch + home indicator */
@supports (padding: env(safe-area-inset-top)) {
  .titlebar { padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}


/* ── Post-login Workspace reveal ────────────────────────────────────
   Sequence: login card fades out → DEEP black background washes in →
   "Workspace" mark fades up from below, holds, then fades into the app.
*/
.workspace-reveal {
  position: fixed; inset: 0; z-index: 1500;
  background: #000000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
}
.workspace-reveal.show {
  opacity: 1; pointer-events: auto;
}
.workspace-reveal.fading {
  opacity: 0;
  transition: opacity .55s ease;
}
.workspace-reveal-mark {
  font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
  font-weight: 200;
  font-size: 64px;
  letter-spacing: -.015em;
  color: var(--lambda-gold);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .9s ease .25s, transform .9s cubic-bezier(.22,.9,.25,1) .25s;
}
.workspace-reveal.show .workspace-reveal-mark {
  opacity: 1; transform: translateY(0);
}

/* While the reveal is playing, fade the login card cleanly out. */
.login-card.handing-off {
  opacity: 0;
  transform: scale(.985);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}


/* ── Browser titlebar controls hidden ───────────────────────────────
   The Electron shell adds .body-electron to <body>; browsers don't.
   Hide the custom min/max/close trio so a regular browser tab shows
   only the OS chrome. */
body:not(.body-electron) .win-ctrl { display: none !important; }

/* ══ Workspace Prod ═══════════════════════════════════════════════
   Second-level navigation, accessibility baseline, layout discipline
   and the shared empty state. Appended rather than interleaved so the
   Workspace Prod delta is reviewable as one block.
   ═════════════════════════════════════════════════════════════════ */

/* ── Group menus ─────────────────────────────────────────────────
   The tab itself navigates; hovering reveals the menu. Menus float, and
   floating things carry real elevation: translucency with backdrop blur,
   a soft shadow, and a slightly larger radius than the flat surfaces.
   Panels on the canvas stay flat and square; things above the canvas are
   allowed depth — that distinction is the whole elevation language. */
.navgroup { position: relative; display: inline-flex; }

.navmenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 216px;
  padding: 6px;
  background: rgba(17, 19, 24, 0.88);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 18px 44px rgba(0, 0, 0, 0.55);
  z-index: 900;
  -webkit-app-region: no-drag;
}
.navgroup.open .navmenu { display: block; animation: menu-in .12s ease; }
@keyframes menu-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-3px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .navgroup.open .navmenu { animation: none; }
}

.navmenu-item {
  display: block;
  width: 100%;
  padding: 8px 13px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 350;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .09s, background .09s;
}
.navmenu-item:hover, .navmenu-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.navmenu-item.active { color: var(--accent); background: var(--accent-bg); }

/* ── Accessibility baseline ──────────────────────────────────────
   Federal buyers ask for a VPAT. Before this, the whole product had
   two :focus-visible rules, one tabindex and no reduced-motion
   handling at all. */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* Only suppress the default ring where a visible one is provided above. */
:focus:not(:focus-visible) { outline: none; }

/* The login sequence is a scripted 1.9s five-phase animation with a
   flicker step. That is exactly the class of motion this query exists
   to switch off. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visible only to screen readers — for labelling controls that carry
   an icon and nothing else. */
.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;
}

/* ── Layout discipline ───────────────────────────────────────────
   At 1600px several surfaces rendered a ~640px column with 700px of
   empty ground beside it. Content is centred and allowed to use the
   width it has, without becoming an unreadable full-bleed line. */
.surface-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}
.surface-split {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 0;
  height: 100%;
  min-height: 0;
}
@media (max-width: 1024px) {
  .surface-split { grid-template-columns: 1fr; }
}

/* ── Empty states ────────────────────────────────────────────────
   Every customer's first hour is an empty database. A surface that
   renders a heading over a blank container reads as broken; it should
   say what it is for and what to do first. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 64px 24px;
  margin: 0 auto;
  max-width: 460px;
  min-height: 320px;
}
.empty-title {
  font-family: var(--sans);
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text);
  margin: 0;
}
.empty-body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.empty-cta { margin-top: 8px; }
.empty-hint {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--muted2);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ── Export ──────────────────────────────────────────────────────
   A customer who cannot get their own data out is locked in, which
   sits badly next to "your data never leaves your infrastructure".
   Every table gets this control; files are built in the browser and
   never round-trip through the server. */
.export-bar { display: flex; justify-content: flex-end; padding: 6px 0; }
.exportgroup { position: relative; display: inline-flex; }

.btn-export {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--rule2);
  border-radius: var(--r-md);
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: color .1s, border-color .1s, background .1s;
}
.btn-export:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.exportmenu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 138px;
  padding: 5px;
  background: rgba(17, 19, 24, 0.88);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 14px 36px rgba(0, 0, 0, 0.5);
  z-index: 800;
}
.exportgroup.open .exportmenu { display: block; }

.exportmenu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 300;
  text-align: left;
  cursor: pointer;
}
.exportmenu-item:hover { background: var(--surface2); color: var(--text); }

/* The title bar sits inside .app, which is overflow:hidden — a menu
   anchored below it was being clipped at the 48px boundary. Raising the
   bar above the surfaces and letting it overflow is enough; the bar
   itself has no scrollable content to lose. */
.titlebar { overflow: visible; z-index: 500; }
/* ID selector: the responsive blocks set overflow-x on .tab-nav, and a
   scroll container clips an absolutely positioned menu no matter what the
   z-index says. Both longhands, higher specificity. */
#tab-nav { overflow-x: visible; overflow-y: visible; }
.surfaces { z-index: 0; }

/* ── Login brand — Workspace leads; 37ℚ is the byline ────────────
   The card used to open with the company wordmark, which inverts the
   product's own brand hierarchy. The product name carries the weight of
   the thin cut; the mark stays small and gold above it. */
.login-brand { text-align: center; margin-bottom: 34px; }
.login-brand-eyebrow {
  font-size: 11px;
  font-weight: 420;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-brand-q { color: var(--lambda-gold); font-weight: 500; }
.login-brand-name {
  font-size: 34px;
  font-weight: 200;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-top: 10px;
  line-height: 1;
}

/* Login fields — quiet filled rows, accent only on focus. */
.login-fields input {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  color: var(--text) !important;
  transition: background .12s, border-color .12s;
}
.login-fields input:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--accent-border) !important;
  outline: none !important;
}
.login-fields .btn-primary {
  border-radius: 8px !important;
  padding: 12px 0 !important;
  font-weight: 450 !important;
  letter-spacing: .02em;
}

/* ══ 37ℚ Glass — the platform material system ═════════════════════
   This block IS the 37 Quant software styling. Every current surface and
   every future tool draws from these classes and variables; if a new
   screen needs a panel, a bar, or a floating layer, it uses one of these
   and inherits the whole look. Design questions end here.

   The system has exactly three material layers:

     CANVAS   — the void. Pure black, no texture. Content floats on it.
     GLASS    — panels ON the canvas: barely-there translucent white over
                black, one hairline, a specular top edge that catches
                light the way glass does. Radius 14px.
     FLOAT    — layers ABOVE the canvas (menus, dialogs, popovers):
                deeper glass with backdrop blur and true shadow.
                Radius 10-16px.

   One accent (champagne), one type family (Mona Sans, thin-leaning),
   sentence case everywhere, color only where it means something. ══ */

:root {
  --glass-bg:        rgba(255, 255, 255, 0.035);
  --glass-bg-hover:  rgba(255, 255, 255, 0.055);
  --glass-hairline:  rgba(255, 255, 255, 0.07);
  --glass-specular:  rgba(255, 255, 255, 0.14);
  --float-bg:        rgba(17, 19, 24, 0.86);
  --float-hairline:  rgba(255, 255, 255, 0.09);
  --float-shadow:    0 0 0 1px rgba(0, 0, 0, 0.45), 0 20px 50px rgba(0, 0, 0, 0.55);
  --r-panel:         14px;
  --r-float:         12px;
  --r-control:       8px;
}

/* A panel sitting on the canvas. */
.glass, .glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-hairline);
  border-radius: var(--r-panel);
  position: relative;
}
/* The specular edge: a one-pixel light catch along the top, brighter in
   the center — the detail that reads as material instead of a gray box. */
.glass::before, .glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-specular), transparent);
  pointer-events: none;
}

/* A floating layer above the canvas. */
.glass-float {
  background: var(--float-bg);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid var(--float-hairline);
  border-radius: var(--r-float);
  box-shadow: var(--float-shadow);
}

/* ── Retrofit: the surfaces the eye lands on first ────────────────
   Home's cards and the login card were solid-fill rectangles; they are
   glass now. Inline-styled markup is matched by its stable attributes so
   the modules did not need a rewrite to adopt the material. */

/* Home cards (Getting Started, Today's Brief, ask box, Suggested Actions) */
#surface-home [style*="background:var(--surface)"],
#surface-home [style*="background: var(--surface)"] {
  background: var(--glass-bg) !important;
  border-color: var(--glass-hairline) !important;
  border-radius: var(--r-panel) !important;
}

/* The login card becomes the first pane of glass a customer sees. */
.login-card {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-hairline) !important;
  border-radius: 18px !important;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}

/* The consent dialog floats. */
#gca-monitor-modal > div {
  background: var(--float-bg) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid var(--float-hairline) !important;
  border-radius: 16px !important;
  box-shadow: var(--float-shadow) !important;
}

/* The titlebar is glass over the void: translucent, blurred, with the
   same specular catch along its lower hairline. */
.titlebar {
  background: rgba(0, 0, 0, 0.6) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--glass-hairline) !important;
}

/* Right-side chrome pills adopt the control radius. */
.chrome-pill { border-radius: var(--r-control) !important; }

/* Floating layers already built pick up the shared tokens. */
.navmenu, .exportmenu {
  background: var(--float-bg);
  border-color: var(--float-hairline);
  border-radius: var(--r-float);
  box-shadow: var(--float-shadow);
}

/* ── Glass, turned up ────────────────────────────────────────────
   The first pass was too quiet to register on a real monitor. The
   material stays the same; the values become visible: fills doubled,
   hairlines brightened, and the canvas gains depth — a faint champagne
   bloom high center, falling to black. Still no motion, no texture. */
:root {
  --glass-bg:        rgba(255, 255, 255, 0.055);
  --glass-bg-hover:  rgba(255, 255, 255, 0.08);
  --glass-hairline:  rgba(255, 255, 255, 0.11);
  --glass-specular:  rgba(255, 255, 255, 0.22);
}
.surfaces, .login-screen {
  background:
    radial-gradient(1100px 500px at 50% -80px, rgba(196, 168, 130, 0.07), transparent 60%),
    radial-gradient(900px 700px at 85% 110%, rgba(196, 168, 130, 0.03), transparent 55%),
    #000;
}
/* Panels inherit the brighter tokens; give them breathing room too. */
#surface-home [style*="background:var(--surface)"],
#surface-home [style*="background: var(--surface)"] {
  padding-left: 26px !important;
  padding-right: 26px !important;
}
/* Primary buttons: a touch of light through the accent. */
.btn-primary, button[style*="background:var(--accent)"] {
  border-radius: var(--r-control) !important;
}
/* Surface-level tables: quiet rules instead of boxed grids. */
.surface table { border-collapse: collapse; }
.surface thead th {
  font-weight: 420 !important;
  letter-spacing: .02em;
  color: var(--muted) !important;
  text-transform: none !important;
  font-family: var(--sans) !important;
}

/* ══ INSTRUMENT CHROME ════════════════════════════════════════════
   The rebuilt shell: rail + main. Appended last so it wins every
   earlier rule without touching module internals. ══ */

html, body { background: var(--bg) !important; }
.app { display: flex !important; flex-direction: row !important; height: 100vh; overflow: hidden; }

/* ── The rail ────────────────────────────────────────────────────── */
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border-right: 1px solid var(--rule);
}
.rail-brand {
  display: flex; align-items: baseline; gap: 8px;
  padding: 20px 20px 18px;
}
.rail-brand-mark { font-size: 17px; font-weight: 500; color: var(--text); letter-spacing: -.01em; }
.rail-brand-q    { color: var(--lambda-gold); font-weight: 400; }
.rail-brand-name { font-size: 12px; font-weight: 300; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }

.rail-scroll { flex: 1; overflow-y: auto; padding: 2px 12px 12px; scrollbar-width: thin; }

.rail-section {
  margin: 18px 8px 6px;
  font-size: 10.5px; font-weight: 460;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted2);
}
.rail-item {
  display: flex; align-items: center;
  width: 100%;
  padding: 7px 10px;
  margin: 1px 0;
  background: transparent;
  border: 0; border-radius: var(--r-md);
  color: var(--muted);
  font-family: var(--sans); font-size: 13px; font-weight: 340;
  text-align: left; cursor: pointer;
  transition: color .1s, background .1s;
  position: relative;
}
.rail-item:hover { color: var(--text2); background: var(--surface); }
.rail-item.active {
  color: var(--text);
  background: var(--surface2);
  font-weight: 430;
}
.rail-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: var(--accent);
}
.rail-foot { padding: 12px 16px; border-top: 1px solid var(--rule); }
.rail-user { display: flex; align-items: center; gap: 10px; }
.rail-user-dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 12px; font-weight: 500;
}
.rail-user-name { font-size: 12.5px; color: var(--text2); font-weight: 350; }
.rail-user-role { font-size: 10.5px; color: var(--muted2); letter-spacing: .06em; text-transform: uppercase; }

/* ── Main column ─────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar {
  height: var(--titlebar-h);
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 10px 0 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  -webkit-app-region: drag;
  position: relative; z-index: 500;
}
.topbar-title {
  font-size: 14px; font-weight: 430; color: var(--text);
  letter-spacing: .005em; margin-left: 6px;
  -webkit-app-region: no-drag;
}
.topbar .nav-arrows { -webkit-app-region: no-drag; }
.surfaces { flex: 1; position: relative; overflow: hidden; background: var(--bg); z-index: 0; }

/* Old chrome that no longer exists in this shell. */
.tab-nav, .titlebar-logo { display: none !important; }

/* ── Instrument content overrides — pulled through the whole product
   because every module styles itself with the tokens above. What the
   tokens cannot reach, these element rules do. ── */
.surface button { border-radius: var(--r-md); }
.surface input, .surface select, .surface textarea {
  border-radius: var(--r-md);
}
.surface input:focus, .surface select:focus, .surface textarea:focus {
  border-color: var(--accent-border) !important;
  outline: none;
}
.surface table thead th {
  font-weight: 430 !important;
  letter-spacing: .02em;
  color: var(--muted) !important;
  text-transform: none !important;
  font-family: var(--sans) !important;
  font-size: 12px !important;
}
.surface table tbody tr { border-color: var(--rule) !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Login sits on the graphite canvas with a hint of gold air. */
.login-screen {
  background:
    radial-gradient(900px 460px at 50% -60px, rgba(207,175,133,.08), transparent 60%),
    var(--bg) !important;
}
.login-card {
  background: var(--surface) !important;
  border: 1px solid var(--rule2) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.5) !important;
}

/* Floating layers keep depth; panels on the canvas stay flat. */
.navmenu, .exportmenu {
  background: rgba(20, 23, 28, .92);
  border: 1px solid var(--rule2);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 18px 44px rgba(0,0,0,.5);
}

/* Home canvas: quiet depth, no pure black hole. */
#surface-home {
  background:
    radial-gradient(1000px 480px at 50% -70px, rgba(207,175,133,.06), transparent 60%),
    var(--bg) !important;
}

/* ══ INSTRUMENT · FINISH ══════════════════════════════════════════
   The layer that separates a shipped product from a prototype: light
   behavior, machined edges, one gold signature, and motion that only
   ever answers the pointer. ══ */

/* The signature: one gold thread across the very top of the product. */
.app::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(212,175,106,.0) 20%,
    rgba(212,175,106,.28) 50%,
    rgba(212,175,106,.0) 80%, transparent);
  z-index: 2000; pointer-events: none;
}

/* Rail: machined panel — vertical light falloff + inner edge. */
.rail {
  background:
    linear-gradient(180deg, #101319 0%, #0C0E12 35%, #0A0C0F 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
}
.rail-brand { padding: 22px 20px 16px; }
.rail-brand-mark { font-size: 18px; }
.rail-ico {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-right: 10px; opacity: .75;
  transition: opacity .12s;
}
.rail-item { padding: 7.5px 10px; }
.rail-item:hover .rail-ico, .rail-item.active .rail-ico { opacity: 1; }
.rail-item.active {
  background: linear-gradient(90deg, rgba(207,175,133,.10), rgba(255,255,255,.045) 55%);
}
.rail-item.active .rail-ico { color: var(--accent); }
.rail-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-section { margin: 20px 8px 7px; }
.rail-foot { background: rgba(0,0,0,.25); }

/* Topbar: floating strip with a soft under-fade instead of a hard rule. */
.topbar {
  border-bottom: 0 !important;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(11,12,15,.0)) !important;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--rule), rgba(48,55,67,.25) 70%, transparent);
}
.topbar-title { font-size: 15px; }
.nav-arrow {
  width: 26px; height: 26px; border-radius: 7px;
  color: var(--muted2); background: transparent; border: 0;
  transition: color .1s, background .1s;
}
.nav-arrow:not(.nav-disabled):hover { color: var(--text); background: var(--surface); }
.chrome-pill {
  background: var(--surface) !important;
  border: 1px solid var(--rule) !important;
  transition: border-color .12s, color .12s;
}
.chrome-pill:hover { border-color: var(--rule2) !important; color: var(--text) !important; }

/* Canvas: barely-there grain so large fields read as material. */
.surfaces::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.017 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.surface { z-index: 2; }

/* Buttons: one confident primary, quiet secondaries — everywhere. */
.surface button[style*="background:var(--accent)"],
.btn-primary {
  background: linear-gradient(180deg, var(--accent-l), var(--accent)) !important;
  color: #14120D !important;
  border: 0 !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px rgba(207,175,133,.13);
  transition: filter .12s, transform .08s;
}
.surface button[style*="background:var(--accent)"]:hover,
.btn-primary:hover { filter: brightness(1.05); }
.surface button[style*="background:var(--accent)"]:active,
.btn-primary:active { transform: translateY(1px); }

.surface button[style*="background:var(--surface2)"],
.surface button[style*="background: var(--surface2)"] {
  background: transparent !important;
  border: 1px solid var(--rule2) !important;
  transition: border-color .12s, color .12s, background .12s;
}
.surface button[style*="background:var(--surface2)"]:hover {
  border-color: var(--accent-border) !important;
  color: var(--text) !important;
  background: var(--accent-bg) !important;
}

/* Inputs: recessed wells. */
.surface input[type="text"], .surface input[type="search"], .surface input[type="number"],
.surface input:not([type]), .surface textarea, .surface select {
  background: rgba(0,0,0,.32) !important;
  border: 1px solid var(--rule) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}

/* Tables: rows respond, numerals align. */
.surface tbody tr { transition: background .1s; }
.surface tbody tr:hover { background: rgba(255,255,255,.025) !important; }

/* Home cards: bolder presence on the wide stage. */
.home-stage > div[style*="background:var(--surface)"],
.home-stage > div[style*="background: var(--surface)"] {
  background: linear-gradient(180deg, var(--surface2), var(--surface)) !important;
  border: 1px solid var(--rule2) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  padding: 26px 28px !important;
}

/* ── Split-screen login ──────────────────────────────────────────── */
.login-screen { display: flex; align-items: stretch !important; justify-content: stretch !important; padding: 0 !important; }
.login-split { display: flex; width: 100%; height: 100vh; }
.login-brand-panel {
  flex: 1.15;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px;
  background:
    radial-gradient(900px 600px at 20% 0%, rgba(207,175,133,.10), transparent 55%),
    radial-gradient(700px 500px at 90% 100%, rgba(207,175,133,.05), transparent 60%),
    linear-gradient(160deg, #121722, #0A0C10 60%);
  border-right: 1px solid var(--rule);
  position: relative; overflow: hidden;
}
.login-brand-panel::after {
  content: ''; position: absolute; right: -180px; top: 50%; transform: translateY(-50%);
  width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid rgba(207,175,133,.14);
  box-shadow: 0 0 0 60px rgba(207,175,133,.045), 0 0 0 130px rgba(207,175,133,.025),
              0 0 0 210px rgba(207,175,133,.012);
}
.lbp-mark { font-size: 22px; font-weight: 500; color: var(--text); }
.lbp-q { color: var(--lambda-gold); font-weight: 400; }
.lbp-title { font-size: 52px; font-weight: 180; letter-spacing: -1.4px; color: var(--text); line-height: 1.05; }
.lbp-sub { font-size: 15px; font-weight: 300; color: var(--muted); margin-top: 18px; line-height: 1.65; }
.lbp-foot { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted2); }
.login-screen .login-card {
  flex: 1;
  max-width: none !important; width: auto !important;
  border: 0 !important; border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--bg) !important;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 48px 72px !important;
}
.login-card .login-fields { width: 320px; }
@media (max-width: 980px) {
  .login-brand-panel { display: none; }
}

/* ══ INSTRUMENT · CABIN ═══════════════════════════════════════════
   The post-login pass. The login promised a certain caliber; every
   screen after it now keeps that promise. ══ */

/* ── Rail, dressed to the login's standard ───────────────────────── */
:root { --rail-w: 244px; }
.rail {
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(207,175,133,.05), transparent 60%),
    linear-gradient(180deg, #11151C 0%, #0C0E13 40%, #090B0E 100%);
}
.rail-brand {
  padding: 24px 22px 20px;
  position: relative;
}
.rail-brand::after {
  content: ''; position: absolute; left: 22px; right: 22px; bottom: 6px; height: 1px;
  background: linear-gradient(90deg, rgba(212,175,106,.28), transparent 75%);
}
.rail-brand-mark { font-size: 19px; letter-spacing: -.02em; }
.rail-brand-name { font-size: 11.5px; letter-spacing: .2em; }
.rail-scroll { padding: 8px 14px 14px; }
.rail-section {
  margin: 22px 10px 8px;
  font-size: 10px; letter-spacing: .2em;
  color: rgba(207,175,133,.5);
}
.rail-item { padding: 8.5px 11px; font-size: 13.2px; border-radius: 9px; }
.rail-item .rail-ico { margin-right: 11px; }
.rail-item.active {
  background: linear-gradient(90deg, rgba(207,175,133,.13), rgba(255,255,255,.05) 60%);
  box-shadow: inset 0 0 0 1px rgba(207,175,133,.14);
}
.rail-item.active::before { display: none; }  /* the inset ring carries it */
.rail-foot {
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 14px 18px;
}
.rail-user-dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(180deg, var(--surface3), var(--surface2));
  box-shadow: inset 0 0 0 1px rgba(207,175,133,.22);
}

/* ── Every surface arrives, it does not appear ───────────────────── */
.surface.active { animation: surface-rise .22s cubic-bezier(.2,.7,.2,1); }
@keyframes surface-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .surface.active { animation: none; }
}

/* ── Module content, recomposed by rule ──────────────────────────
   The modules render inline-styled markup; these rules re-set the
   common patterns they all share, which is what makes eighty pages
   read as one product. */

/* Any bordered block on a surface becomes a proper panel. */
.surface div[style*="border:1px solid var(--rule)"],
.surface div[style*="border: 1px solid var(--rule)"] {
  border-radius: var(--r-lg);
  border-color: var(--rule) !important;
}

/* The modules' own header strips: flatten onto the canvas so pages
   stop looking like stacked toolbars. */
.surface > div > div[style*="border-bottom:1px solid var(--rule)"][style*="background:var(--surface)"],
.surface > div > div[style*="border-bottom: 1px solid var(--rule)"][style*="background: var(--surface)"] {
  background: transparent !important;
}

/* Tables become instruments: generous rows, calm rules, hover response. */
.surface table { width: 100%; }
.surface thead th { padding-top: 12px !important; padding-bottom: 12px !important; }
.surface tbody td { padding-top: 11px !important; padding-bottom: 11px !important; }
.surface tbody tr:hover { background: rgba(207,175,133,.035) !important; }

/* Stat pills (the LABEL-over-number blocks) get the machined look. */
.surface div[style*="letter-spacing"][style*="uppercase"] + div,
.home-stage div[style*="border:1px solid var(--rule)"][style*="padding"] {
  border-radius: var(--r-md);
}

/* ── Home: the command instrument ────────────────────────────────── */
.home-stage { max-width: 1240px !important; }
.home-hero { padding-bottom: 30px !important; }
.home-hero > div > div:first-child { letter-spacing: .34em !important; }

/* The ask bar is the product's centerpiece: a wide, confident field
   with a gold focus bloom. */
.home-stage textarea, .home-stage input[type="text"] {
  background: rgba(0,0,0,.4) !important;
  border: 1px solid var(--rule2) !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  padding: 16px 18px !important;
  transition: border-color .15s, box-shadow .15s;
}
.home-stage textarea:focus, .home-stage input[type="text"]:focus {
  border-color: rgba(207,175,133,.5) !important;
  box-shadow: 0 0 0 4px rgba(207,175,133,.08), inset 0 1px 3px rgba(0,0,0,.35) !important;
}

/* Numbered checklist badges: gold-ringed instead of gray boxes. */
.home-stage div[style*="border-radius:50%"],
.home-stage span[style*="border-radius:50%"] {
  background: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(207,175,133,.4);
  color: var(--accent) !important;
}

/* Uppercase ghost CTAs on Home become real buttons. */
.home-stage button[style*="letter-spacing"] {
  border: 1px solid var(--rule2) !important;
  background: rgba(255,255,255,.03) !important;
  border-radius: 9px !important;
  transition: border-color .12s, background .12s, color .12s;
}
.home-stage button[style*="letter-spacing"]:hover {
  border-color: var(--accent-border) !important;
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* ── The Workspace surface header: match the hero language ───────── */
#surface-morpheus-bd span[style*="font-size:22px"] {
  font-size: 26px !important;
  letter-spacing: -.6px !important;
}

/* ── Interior surfaces: presence ─────────────────────────────────
   The working pages render sparse when empty. These rules give the
   bare "no X yet" messages air and the surfaces a spine. */

/* Module-native centered empty messages: lift off the floor, give
   them breathing room and a quiet gold rule above. */
.surface [style*="text-align:center"][style*="var(--muted)"]:not(.empty-state):not(.empty-body) {
  padding-top: 56px !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
}

/* Workspace stage tabs: quiet the strip into pills that sit on the canvas. */
#surface-morpheus-bd #mbd-tabstrip {
  padding: 4px 0 !important;
  gap: 4px !important;
}
#surface-morpheus-bd .mbd-tab {
  border-radius: 9px !important;
  border-bottom: 0 !important;
  padding: 8px 15px !important;
}
#surface-morpheus-bd .mbd-tab[style*="var(--bg)"],
#surface-morpheus-bd .mbd-tab.active {
  background: rgba(255,255,255,.05) !important;
}

/* The floating "slim action row" under the tabs gets a hairline so it
   reads as a toolbar, not an orphan. */
#surface-morpheus-bd [style*="border-bottom:1px solid var(--rule)"][style*="justify-content:space-between"] {
  border-bottom-color: var(--rule) !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* Surface page titles across all modules: one commanding size. */
.surface span[style*="font-size:22px"],
.surface div[style*="font-size:22px"][style*="var(--text)"] {
  font-size: 26px !important;
  font-weight: 200 !important;
  letter-spacing: -.6px !important;
}
.surface span[style*="font-size:18px"][style*="var(--text)"],
.surface div[style*="font-size:18px"][style*="var(--text)"] {
  font-size: 20px !important;
  font-weight: 300 !important;
}

/* Action buttons in module headers: unify the ghost/primary split. */
.surface button[style*="background:var(--surface2)"][style*="border:1px solid var(--rule)"] {
  border-radius: 9px !important;
}

/* Empty-state block itself: gold-ringed presence. */
.empty-state {
  padding: 80px 24px !important;
}
.empty-title { font-size: 18px !important; font-weight: 300 !important; }
.empty-cta {
  margin-top: 18px !important;
  padding: 11px 22px !important;
}

/* ══ INSTRUMENT · SIGNATURE ═══════════════════════════════════════
   The login works because of three devices: display type at 180 weight,
   the concentric-ring motif, and deep radial fields. None of them ever
   crossed into the app — which is exactly why the app read as a
   competent dashboard and the login read as a brand. This block carries
   all three through. ══ */

/* ── The masthead ────────────────────────────────────────────────
   Not a title bar. A magazine masthead: gold section eyebrow over a
   large thin page title, the same voice as the login's wordmark. */
:root { --titlebar-h: 104px; }

.topbar {
  align-items: flex-end !important;
  padding: 0 26px 20px 22px !important;
  background:
    radial-gradient(720px 240px at 22% -60px, rgba(207,175,133,.07), transparent 62%),
    var(--bg) !important;
}
.masthead { display: flex; flex-direction: column; gap: 7px; margin-left: 10px; -webkit-app-region: no-drag; }
.masthead-eyebrow {
  font-size: 10px; font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(207,175,133,.72);
  line-height: 1;
}
.masthead-title {
  font-size: 32px; font-weight: 180;
  letter-spacing: -.9px; line-height: 1;
  color: var(--text);
}
.topbar .nav-arrows { align-self: flex-end; margin-bottom: 4px; }
.topbar .titlebar-right { align-self: flex-end; margin-bottom: 4px; margin-left: auto; }
.topbar::after {
  background: linear-gradient(90deg,
    rgba(207,175,133,.30), var(--rule) 22%, rgba(48,55,67,.2) 75%, transparent);
}

/* ── The ring motif, carried through ─────────────────────────────
   The login's concentric rings reappear behind every working surface —
   enormous, barely there, anchored off the bottom-right corner. One
   device, used twice, is what turns styling into identity. */
.surfaces::before {
  content: '';
  position: absolute;
  right: -420px; bottom: -380px;
  width: 1100px; height: 1100px;
  border-radius: 50%;
  border: 1px solid rgba(207,175,133,.055);
  box-shadow:
    0 0 0 120px rgba(207,175,133,.016),
    0 0 0 250px rgba(207,175,133,.010),
    0 0 0 390px rgba(207,175,133,.006);
  pointer-events: none;
  z-index: 0;
}

/* ── Metric slabs ────────────────────────────────────────────────
   The stat blocks were 24px numbers in bordered boxes — the single
   most dated pattern in the product. Editorial numerals on open
   ground, hairline-separated. This is what makes data look expensive. */
.home-stage div[style*="IN MOTION"],
.surface div[style*="border:1px solid var(--rule)"][style*="padding:12px"] { border: 0 !important; }

.surface [style*="letter-spacing:.1em"][style*="uppercase"][style*="var(--accent)"] {
  color: var(--muted2) !important;
  letter-spacing: .22em !important;
  font-size: 9.5px !important;
}

/* Big numerals wherever a module renders one. */
.surface div[style*="font-size:24px"],
.surface div[style*="font-size:22px"][style*="font-weight:300"] {
  font-size: 40px !important;
  font-weight: 180 !important;
  letter-spacing: -1px !important;
  line-height: 1 !important;
}

/* ── Editorial tables ────────────────────────────────────────────
   Rules only under the header and between rows, no cell borders, the
   identifier column carrying weight, numbers tabular and right-set. */
.surface table { border-spacing: 0 !important; }
.surface thead tr { border-bottom: 1px solid var(--rule2) !important; }
.surface thead th {
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  color: var(--muted2) !important;
  padding-bottom: 14px !important;
}
.surface tbody tr { border-bottom: 1px solid rgba(36,41,50,.7) !important; }
.surface tbody td { font-size: 13px !important; }
.surface tbody td:first-child { color: var(--text) !important; font-weight: 420 !important; }
/* Currency and quantity columns read as data, not prose. */
.surface tbody td[style*="text-align:right"],
.surface thead th[style*="text-align:right"] { font-variant-numeric: tabular-nums; }

/* ── Content rhythm ──────────────────────────────────────────────
   Editorial margins. The old 16-24px gutters made every page feel like
   a form; these give the content room to be looked at. */
.surface > div > div[style*="padding:16px 24px"],
.surface > div > div[style*="padding: 16px 24px"] { padding: 22px 34px !important; }
.surface > div > div[style*="flex:1"][style*="overflow:auto"] { padding: 8px 34px 34px !important; }

/* Module header strips float on the canvas instead of banding it. */
.surface [style*="border-bottom:1px solid var(--rule)"][style*="background:var(--surface)"] {
  background: transparent !important;
  border-bottom-color: rgba(36,41,50,.8) !important;
}

/* Filter/category chips: quiet pills, gold only when chosen. */
.surface button[style*="border-radius:4px"][style*="font-size:11px"] {
  border-radius: 999px !important;
  padding: 5px 13px !important;
  border-color: var(--rule) !important;
}

/* ── Rail masthead alignment ─────────────────────────────────────
   The rail's brand block now sits on the masthead baseline, so the two
   columns read as one composition rather than two stacked systems. */
.rail-brand { padding: 26px 22px 22px !important; }
.rail-brand-mark { font-size: 20px !important; }

/* The masthead names the page, so a module repeating that name directly
   beneath it is the stacked-header problem in its last hiding place.
   Suppress the echo; the action buttons stay where they are. */
#surface-morpheus-bd > div > div:first-child > div:first-child > span:first-child,
#surface-supply-chain [style*="font-size:16px"][style*="var(--text)"]:not(:hover) {
  display: none;
}
#surface-morpheus-bd > div > div:first-child { padding-top: 6px !important; }

/* ══ COMMAND PALETTE ══════════════════════════════════════════════
   The one place translucency and depth are fully earned: a floating
   layer above the whole environment. Everything else on the canvas
   stays flat. ══ */

.cp-overlay {
  position: fixed; inset: 0; z-index: 5000;
  display: none;
  align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  background: rgba(4, 5, 7, .58);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.cp-overlay.on { display: flex; animation: cp-fade .12s ease; }
@keyframes cp-fade { from { opacity: 0 } to { opacity: 1 } }

.cp-panel {
  width: 640px; max-width: calc(100vw - 40px);
  max-height: 62vh; display: flex; flex-direction: column;
  background: rgba(22, 25, 31, .93);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 32px 80px rgba(0,0,0,.6);
  overflow: hidden;
  animation: cp-rise .14s cubic-bezier(.2,.7,.2,1);
}
@keyframes cp-rise { from { opacity:0; transform: translateY(-8px) scale(.99) } to { opacity:1; transform:none } }
@media (prefers-reduced-motion: reduce) {
  .cp-overlay.on, .cp-panel { animation: none; }
}

.cp-inputwrap { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.cp-ico { width: 17px; height: 17px; color: var(--muted2); flex-shrink: 0; }
.cp-input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: var(--sans);
  font-size: 16px; font-weight: 300; letter-spacing: -.01em;
}
.cp-input::placeholder { color: var(--muted2); }

.cp-list { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.cp-group {
  padding: 12px 12px 6px;
  font-size: 9.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(207,175,133,.6);
}
.cp-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: var(--sans); color: var(--text2);
}
.cp-row.active { background: rgba(255,255,255,.07); color: var(--text); }
.cp-row.active .cp-badge { color: var(--accent); border-color: var(--accent-border); background: var(--accent-bg); }
.cp-label { font-size: 13.5px; font-weight: 380; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-hint  { font-size: 11.5px; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cp-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 3px 9px;
}
.cp-empty { padding: 34px; text-align: center; color: var(--muted2); font-size: 13px; }

.cp-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 11px 18px; border-top: 1px solid rgba(255,255,255,.06);
  font-size: 11px; color: var(--muted2);
}
.cp-foot-right { margin-left: auto; }
.cp-foot kbd {
  display: inline-block; min-width: 17px; text-align: center;
  padding: 2px 5px; margin-right: 3px;
  border: 1px solid var(--rule2); border-radius: 5px;
  background: rgba(255,255,255,.04);
  font-family: var(--sans); font-size: 10px; color: var(--text2);
}

/* ── Collapsible rail (⌘\) ───────────────────────────────────────
   Icons only at 68px. The label fades rather than reflowing, so the
   collapse reads as one motion instead of a layout jump. */
.rail { transition: width .18s cubic-bezier(.2,.7,.2,1); }
body.rail-collapsed .rail { width: 68px; }
body.rail-collapsed .rail-brand-name,
body.rail-collapsed .rail-item-label,
body.rail-collapsed .rail-section,
body.rail-collapsed .rail-user-name,
body.rail-collapsed .rail-user-role { opacity: 0; pointer-events: none; }
body.rail-collapsed .rail-item { justify-content: center; padding-left: 0; padding-right: 0; }
body.rail-collapsed .rail-item .rail-ico { margin-right: 0; }
body.rail-collapsed .rail-brand { padding-left: 0 !important; padding-right: 0 !important; justify-content: center; }
body.rail-collapsed .rail-foot { display: flex; justify-content: center; padding-left: 0; padding-right: 0; }
.rail-brand-name, .rail-item-label, .rail-section,
.rail-user-name, .rail-user-role { transition: opacity .12s; }
@media (prefers-reduced-motion: reduce) {
  .rail, .rail-brand-name, .rail-item-label, .rail-section { transition: none; }
}
