/* ==========================================================================
   Chess.Observer — Cupertino / Apple HIG Light-Mode-First Design System (v2)
   Principles: Deference · One Elevation Per Context · First-Class Uncertainty
   ========================================================================== */

:root {
  /* Surfaces */
  --canvas: #F5F5F7;
  --surface: #FFFFFF;
  --surface-inset: #F5F5F7;
  --surface-well: #F9F9FB;
  --material: rgba(255, 255, 255, 0.76);
  --material-thick: rgba(255, 255, 255, 0.90);

  /* Typography Hierarchy */
  --label: #1D1D1F;
  --label-2: rgba(60, 60, 67, 0.68);
  --label-3: rgba(60, 60, 67, 0.44);
  --label-4: rgba(60, 60, 67, 0.22);

  /* System Fills (controls & pills only — never card borders) */
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --fill-3: rgba(118, 118, 128, 0.05);

  /* Hairlines */
  --hairline: rgba(0, 0, 0, 0.06);
  --separator: rgba(60, 60, 67, 0.11);
  --hairline-w: 1px;

  /* Semantic Accents (WCAG AA contrast calibrated on light surfaces) */
  --action: #0071E3;
  --action-hover: #0077ED;
  --action-text: #0066CC;
  --action-tint: rgba(0, 113, 227, 0.10);

  --clean: #1D9E34;
  --clean-text: #157A28;
  --clean-tint: rgba(29, 158, 52, 0.10);

  --advisory: #D97706;
  --advisory-text: #A85A04;
  --advisory-tint: rgba(217, 119, 6, 0.11);

  --escalation: #DC2626;
  --escalation-text: #C81E1E;
  --escalation-tint: rgba(220, 38, 38, 0.09);

  /* Whisper Multi-Layer Elevations */
  --shadow-card:
    0 0 0 0.5px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 6px 16px rgba(0, 0, 0, 0.035),
    0 18px 36px -10px rgba(0, 0, 0, 0.04);
  --shadow-raised:
    0 0 0 0.5px rgba(0, 0, 0, 0.05),
    0 2px 6px rgba(0, 0, 0, 0.04),
    0 14px 28px rgba(0, 0, 0, 0.06),
    0 32px 64px -16px rgba(0, 0, 0, 0.07);
  --shadow-thumb:
    0 0 0 0.5px rgba(0, 0, 0, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.11),
    0 1px 1px rgba(0, 0, 0, 0.05);
  --focus-ring: 0 0 0 4px rgba(0, 113, 227, 0.22);

  /* Concentric Radii */
  --r-card: 22px;
  --r-well: 14px;
  --r-control: 12px;
  --r-seg: 10px;
  --r-seg-thumb: 8px;
  --r-pill: 980px;

  /* Motion */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);

  /* System Font Stack (Renders SF Pro natively on macOS/iOS, Inter elsewhere) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (min-resolution: 2dppx) {
  :root { --hairline-w: 0.5px; }
}

/* Optional Quiet Dark Appearance */
[data-theme="dark"] {
  --canvas: #0B0C10;
  --surface: #15171E;
  --surface-inset: #1D202A;
  --surface-well: #191C25;
  --material: rgba(21, 23, 30, 0.76);
  --material-thick: rgba(21, 23, 30, 0.92);
  --label: #F5F5F7;
  --label-2: rgba(235, 235, 245, 0.68);
  --label-3: rgba(235, 235, 245, 0.44);
  --label-4: rgba(235, 235, 245, 0.22);
  --fill: rgba(120, 120, 136, 0.22);
  --fill-2: rgba(120, 120, 136, 0.14);
  --fill-3: rgba(120, 120, 136, 0.08);
  --hairline: rgba(255, 255, 255, 0.08);
  --separator: rgba(255, 255, 255, 0.10);
  --action: #2997FF;
  --action-hover: #40A2FF;
  --action-text: #52ACFF;
  --action-tint: rgba(41, 151, 255, 0.15);
  --clean: #30D158;
  --clean-text: #34D399;
  --clean-tint: rgba(48, 209, 88, 0.14);
  --advisory: #FF9F0A;
  --advisory-text: #FBBF24;
  --advisory-tint: rgba(255, 159, 10, 0.15);
  --escalation: #FF453A;
  --escalation-text: #F87171;
  --escalation-tint: rgba(255, 69, 58, 0.15);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-raised: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 48px rgba(0, 0, 0, 0.48);
  --shadow-thumb: 0 2px 6px rgba(0, 0, 0, 0.40);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--canvas);
  color: var(--label);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.48;
  letter-spacing: -0.014em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 460px at 50% -140px, rgba(0, 113, 227, 0.055), transparent 70%),
    var(--canvas);
  min-height: 100vh;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--action-text);
  text-decoration: none;
  transition: opacity 160ms ease;
}
a:hover { opacity: 0.78; }

/* ==========================================================================
   1. Sticky 52px Translucent Vibrancy Header
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 54px;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 calc(-1 * var(--hairline-w)) 0 var(--hairline);
}

.nav-inner {
  max-width: 1380px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-logo {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--label-2);
  white-space: nowrap;
  transition: color 160ms ease;
}
.nav-link:hover {
  color: var(--label);
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.engine-capsule {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--label-2);
  background: var(--fill-2);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clean);
  box-shadow: 0 0 0 3px var(--clean-tint);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--fill-2);
  color: var(--label-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 140ms ease;
}
.icon-btn:hover {
  background: var(--fill);
  color: var(--label);
}
.icon-btn:active { transform: scale(0.95); }

/* ==========================================================================
   2. Centered Editorial Hero & Raised Unified Command Scanner
   ========================================================================== */
.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 52px 24px 28px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--action-text);
  background: var(--action-tint);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.5vw, 50px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--label);
}

.hero-subtitle {
  font-size: 17.5px;
  line-height: 1.5;
  color: var(--label-2);
  max-width: 630px;
  margin: 0 auto 28px;
  font-weight: 400;
}

/* Raised Command Sheet */
.scanner-sheet {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-raised);
  padding: 18px 20px;
  text-align: left;
  transition: box-shadow 240ms var(--ease-out);
}

.scanner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Cupertino Segmented Control */
.seg-group {
  display: inline-flex;
  background: var(--fill);
  padding: 3px;
  border-radius: var(--r-seg);
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--label-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-seg-thumb);
  cursor: pointer;
  transition: all 180ms var(--ease-out);
  white-space: nowrap;
}
.seg-btn:hover { color: var(--label); }
.seg-btn.active {
  background: var(--surface);
  color: var(--label);
  box-shadow: var(--shadow-thumb);
}

/* Unified Spotlight Input Bar */
.spotlight-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-inset);
  border-radius: var(--r-well);
  padding: 6px 6px 6px 14px;
  transition: box-shadow 180ms ease, background 180ms ease;
}
.spotlight-bar:focus-within {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--action), var(--focus-ring);
}

.spotlight-icon {
  color: var(--label-3);
  flex-shrink: 0;
  display: flex;
}

.spotlight-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--label);
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 500;
  padding: 8px 4px;
  outline: none;
  min-width: 140px;
}
.spotlight-input::placeholder { color: var(--label-3); font-weight: 400; }

.quiet-select {
  border: none;
  background: var(--fill-2);
  color: var(--label-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
}
.quiet-select:hover { color: var(--label); background: var(--fill); }

.btn-action {
  border: none;
  background: var(--action);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease, opacity 160ms ease;
  white-space: nowrap;
}
.btn-action:hover:not(:disabled) { background: var(--action-hover); }
.btn-action:active:not(:disabled) { transform: scale(0.98); }
.btn-action:disabled { opacity: 0.55; cursor: wait; }

.pgn-well {
  width: 100%;
  min-height: 98px;
  border: none;
  background: var(--surface-inset);
  color: var(--label);
  border-radius: var(--r-well);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: box-shadow 180ms ease;
}
.pgn-well:focus {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--action), var(--focus-ring);
}

.quick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.quick-label {
  font-size: 12.5px;
  color: var(--label-3);
  margin-right: 2px;
}

.sample-pill {
  border: none;
  background: var(--fill-3);
  color: var(--label-2);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.sample-pill:hover {
  background: var(--action-tint);
  color: var(--action-text);
}

.toast {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--action-tint);
  color: var(--action-text);
  display: none;
}
.toast.error {
  background: var(--escalation-tint);
  color: var(--escalation-text);
}

/* ==========================================================================
   3. Main Observatory Container & Trust Disclosure
   ========================================================================== */
.workspace {
  max-width: 1380px;
  margin: 0 auto;
  padding: 8px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.trust-strip {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.trust-strip-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--label-2);
  max-width: 1020px;
}

.trust-icon {
  color: var(--action);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   4. Master-Detail Layout (Sidebar + Main Stage)
   ========================================================================== */
.master-detail {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar-card {
  position: sticky;
  top: 70px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px 14px 14px;
}

.sidebar-head {
  padding: 0 6px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-3);
  display: block;
  margin-bottom: 2px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label);
  margin: 0;
}

.dossier-list {
  margin-top: 10px;
  max-height: 640px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dossier-row {
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 150ms ease;
  position: relative;
}
.dossier-row + .dossier-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: var(--hairline-w);
  background: var(--separator);
}
.dossier-row:hover { background: var(--fill-3); }
.dossier-row.active {
  background: var(--action-tint);
}
.dossier-row.active::before,
.dossier-row.active + .dossier-row::before {
  background: transparent;
}

.d-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}
.dossier-row.active .d-row-top { color: var(--action-text); }

.d-row-sub {
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  color: var(--label-2);
}
.d-row-sub .num {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

/* Status & Score Pills */
.tint-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill-clean { background: var(--clean-tint); color: var(--clean-text); }
.pill-advisory { background: var(--advisory-tint); color: var(--advisory-text); }
.pill-escalation { background: var(--escalation-tint); color: var(--escalation-text); }
.pill-action { background: var(--action-tint); color: var(--action-text); }
.pill-neutral { background: var(--fill-2); color: var(--label-2); }

/* ==========================================================================
   5. Right Detail Stage: Subject Header + 4 Apple Health Ring Cards
   ========================================================================== */
.stage-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subject-header-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.subject-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.024em;
  margin: 2px 0 6px;
  color: var(--label);
}

.subject-desc {
  font-size: 14px;
  color: var(--label-2);
  margin: 0;
  max-width: 720px;
}

/* 4 Independent Apple Health-Style Ring Tiles on the Canvas */
.ring-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ring-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.ring-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ring-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}

.ring-val {
  font-family: var(--font-display);
  font-size: 31px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.026em;
  color: var(--label);
}

.ring-sub {
  font-size: 12.5px;
  color: var(--label-3);
}

.ring-svg {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

/* ==========================================================================
   6. Pool Prevalence (Base-Rate Reality) Cupertino Slider Card
   ========================================================================== */
.prevalence-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 16px 22px;
}

.prevalence-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cupertino-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--fill);
  outline: none;
}
.cupertino-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08), 0 3px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 120ms ease;
}
.cupertino-slider::-webkit-slider-thumb:hover { transform: scale(1.07); }

/* ==========================================================================
   7. Museum-Grade Chessboard + Move Inspector + Instruments Timeline Card
   ========================================================================== */
.board-stage-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}

.board-split {
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.board-bezel {
  background: var(--surface-inset);
  padding: 10px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}

.board-frame {
  width: 372px;
  height: 372px;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

#boardSvg {
  width: 100%;
  height: 100%;
  display: block;
}

.transport-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.transport-capsule {
  display: inline-flex;
  align-items: center;
  background: var(--fill-2);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
}

.t-btn {
  border: none;
  background: transparent;
  color: var(--label);
  height: 32px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease;
}
.t-btn:hover { background: var(--surface); box-shadow: var(--shadow-thumb); }

.board-legend {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--label-2);
  padding: 0 4px;
}

.ply-inspector-well {
  background: var(--surface-inset);
  border-radius: var(--r-well);
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 13.5px;
}

.scoresheet {
  background: var(--surface-inset);
  border-radius: var(--r-well);
  padding: 10px;
  height: 256px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  align-content: start;
}

.mv-chip {
  border: none;
  background: transparent;
  color: var(--label);
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: background 120ms ease;
}
.mv-chip:hover { background: var(--fill-2); }
.mv-chip.active {
  background: var(--action);
  color: #FFFFFF;
  font-weight: 600;
}
.mv-chip.active span { color: rgba(255, 255, 255, 0.88) !important; }
.mv-chip.flagged:not(.active) {
  background: var(--advisory-tint);
}

/* Instruments Spline Timeline */
.timeline-section {
  margin-top: 22px;
  padding-top: 18px;
  box-shadow: inset 0 var(--hairline-w) 0 var(--separator);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.timeline-well {
  background: var(--surface-inset);
  border-radius: var(--r-well);
  padding: 8px 10px;
  position: relative;
}

#timelineCanvas {
  width: 100%;
  height: 168px;
  display: block;
  cursor: crosshair;
}

/* ==========================================================================
   8. 6 Mechanistic Forensic Signals Grid (Zero Inner Card Borders)
   ========================================================================== */
.signals-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}

.signals-banner {
  background: var(--surface-inset);
  border-radius: var(--r-well);
  padding: 14px 18px;
  margin: 14px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.signals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
}

.signal-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.signal-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--label);
}

.signal-desc {
  font-size: 12.5px;
  color: var(--label-2);
  min-height: 34px;
}

.signal-track {
  height: 7px;
  border-radius: 999px;
  background: var(--fill);
  overflow: hidden;
}

.signal-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 320ms var(--ease-out);
}

.signal-foot {
  font-size: 11.5px;
  color: var(--label-3);
}

/* ==========================================================================
   9. Validation Tables & Responsible Fair-Play Charter
   ========================================================================== */
.bench-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.editorial-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 12px;
}

.clean-table th {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-3);
  padding: 8px 10px;
  border-bottom: var(--hairline-w) solid var(--separator);
}
.clean-table th:first-child,
.clean-table td:first-child {
  text-align: left;
}

.clean-table td {
  text-align: right;
  padding: 11px 10px;
  border-bottom: var(--hairline-w) solid var(--hairline);
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
}

.clean-table tr.highlight-row td {
  background: var(--action-tint);
  color: var(--label);
  font-weight: 600;
}
.clean-table tr.highlight-row td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
.clean-table tr.highlight-row td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.charter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.charter-col h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--label);
}
.charter-col p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--label-2);
  margin: 0;
}

.footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  box-shadow: inset 0 var(--hairline-w) 0 var(--separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--label-3);
}

/* ==========================================================================
   10. Cupertino "?" Quick-Guide Badges & Frosted Floating Popover Window
   ========================================================================== */
.title-with-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.section-lead {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--label-2);
  margin: 5px 0 0;
}

.help-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--fill);
  color: var(--label-2);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  transition: background 150ms ease, color 150ms ease, transform 140ms ease, box-shadow 150ms ease;
}

.help-btn:hover,
.help-btn:focus-visible,
.help-btn.is-open {
  background: var(--action);
  color: #FFFFFF;
  transform: scale(1.08);
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.28);
}

.tech-details {
  margin-top: 8px;
  font-size: 12px;
  color: var(--label-3);
}
.tech-details summary {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: var(--action-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tech-details p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--label-2);
  background: var(--surface-inset);
  padding: 8px 11px;
  border-radius: 10px;
}

.hig-popover {
  position: fixed;
  z-index: 9999;
  width: min(344px, calc(100vw - 24px));
  background: var(--material-thick);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  backdrop-filter: saturate(190%) blur(24px);
  border-radius: 16px;
  padding: 15px 17px;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 24px 48px -12px rgba(0, 0, 0, 0.14);
  color: var(--label);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

html[data-theme="dark"] .hig-popover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.55);
}

.hig-popover.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hig-pop-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--action-text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hig-pop-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--label);
  margin: 0 0 6px;
}

.hig-pop-body {
  font-size: 13px;
  line-height: 1.52;
  color: var(--label-2);
  margin: 0;
}

.hig-pop-guide {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-inset);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  font-size: 12px;
  line-height: 1.45;
  color: var(--label);
}
.hig-pop-guide strong {
  color: var(--action-text);
}

.hig-pop-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--material-thick);
  transform: rotate(45deg);
  pointer-events: none;
}
.hig-popover[data-placement="bottom"] .hig-pop-arrow {
  top: -5px;
  box-shadow: -0.5px -0.5px 0 rgba(0, 0, 0, 0.08);
}
.hig-popover[data-placement="top"] .hig-pop-arrow {
  bottom: -5px;
  box-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.08);
}

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  .workspace { padding: 8px 18px 56px; }
  .master-detail { grid-template-columns: 248px minmax(0, 1fr); gap: 16px; }
  .ring-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-split { grid-template-columns: 316px minmax(0, 1fr); gap: 16px; }
  .board-frame { width: 296px; height: 296px; }
  .signals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench-two-col { grid-template-columns: 1fr; }
  .charter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .master-detail { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
  .dossier-list { max-height: 280px; }
  .board-split { grid-template-columns: 1fr; }
  .board-bezel { max-width: 392px; margin: 0 auto; }
  .board-frame { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .signals-grid { grid-template-columns: 1fr; }
  .charter-grid { grid-template-columns: 1fr; }
  .spotlight-bar { flex-wrap: wrap; padding: 10px; }
  .btn-action { width: 100%; }
}
