/* LM Subs Web Application Stylesheet (`docs/styles.css`)
 *
 * Design tokens & editorial restraint:
 * - Ground: Alabaster stone (#F6F7F8), never pure #FFFFFF
 * - Sheet: Quiet paper (#FDFDFE), used sparingly without nested card wrappers
 * - Ink: Graphite (#111315) and Slate (#525866)
 * - Accent: Optical Cobalt (#0055D4), one restrained action color
 * - Typography: Plus Jakarta Sans (display & prose) + JetBrains Mono (timecodes & byte counts only)
 */

:root {
  --bg-canvas: #f6f7f8;
  --bg-sheet: #fdfdfe;
  --bg-subtle: #edeff3;
  --bg-theater: #0f1114;
  --bg-theater-bar: #171a1f;

  --border-hairline: #dfe3e8;
  --border-control: #c5cbd4;
  --border-theater: #272b33;

  --ink-primary: #111315;
  --ink-secondary: #525866;
  --ink-tertiary: #737a87;

  --accent: #0055d4;
  --accent-hover: #0044aa;
  --accent-soft: #e8f0fe;
  --accent-ink: #fdfdfe;

  --status-ok: #166534;
  --status-ok-bg: #e7f5ec;
  --status-warn: #9a3412;
  --status-warn-bg: #fdefe6;
  --status-err: #b91c1c;
  --status-err-bg: #fdecec;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --max-page: 1120px;
  --max-prose: 64ch;
  --nav-h: 54px;

  /* Padding scale: one source of truth for page gutters, sheet insets and
     section rhythm so every page breathes the same way. */
  --pad-gutter: 24px;
  --pad-sheet: 26px;
  --pad-sheet-sm: 20px;
  --pad-section-y: clamp(56px, 7vw, 96px);
  --pad-card-y: 18px;
  --pad-card-x: 20px;
}

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

html {
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  min-height: 100vh;
}

.tabular,
code,
pre,
td[data-num="true"] {
  font-variant-numeric: tabular-nums;
}

/* Skip to main content for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  padding: 8px 14px;
  background: var(--ink-primary);
  color: var(--bg-sheet);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.skip-link:focus-visible {
  left: 16px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Accessible focus rings across all interactive primitives */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[role="switch"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sticky Top Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  background: rgba(246, 247, 248, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-hairline);
}

.site-header-inner {
  max-width: var(--max-page);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}

.nav-tab:hover {
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.nav-tab[aria-current="page"],
.nav-tab[data-active="true"] {
  color: var(--ink-primary);
  font-weight: 600;
  background: var(--bg-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--bg-sheet);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ink {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--bg-sheet);
}

.btn-ink:hover:not(:disabled) {
  background: #22262b;
  border-color: #22262b;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
}

.btn-danger {
  color: var(--status-err);
  border-color: #efb8b8;
  background: var(--bg-sheet);
}

.btn-danger:hover:not(:disabled) {
  background: var(--status-err-bg);
}

/* Page Container & Editorial Rhythm */
.page-wrap {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--pad-gutter);
}

.section-block {
  padding: var(--pad-section-y) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.section-block:last-child {
  border-bottom: 0;
}

/* Hero Typography */
.hero-header {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(52px, 7vw, 88px) 0 40px;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.25rem, 4.6vw, 3.65rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.034em;
  text-wrap: balance;
  color: var(--ink-primary);
}

.hero-lead {
  margin: 18px auto 0;
  max-width: 58ch;
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.58;
  color: var(--ink-secondary);
}

.hero-cta-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-footnote {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-tertiary);
}

/* Focal Artifact: Interactive NotebookLM Screening Stage */
.screening-stage {
  background: var(--bg-theater);
  color: #f3f4f6;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-theater);
  overflow: hidden;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-theater-bar);
  border-bottom: 1px solid var(--border-theater);
  font-size: 13px;
}

.stage-video-title {
  font-weight: 500;
  color: #f3f4f6;
}

.stage-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.stage-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  min-height: 410px;
}

.stage-viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 28px 20px;
  border-right: 1px solid var(--border-theater);
  background: #0c0e11;
}

.stage-slide-canvas {
  margin: auto 0;
  padding: 24px 0 36px;
}

.stage-slide-topic {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 10px;
}

.stage-slide-heading {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f9fafb;
  max-width: 34ch;
}

.stage-slide-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: #9ca3af;
  font-size: 14px;
  max-width: 46ch;
}

.stage-caption-overlay {
  margin: 12px auto 18px;
  max-width: 92%;
  text-align: center;
  padding: 9px 16px;
  border-radius: 6px;
  background: rgba(15, 17, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fdfdfe;
  line-height: 1.42;
  font-weight: 500;
}

.stage-caption-overlay[data-size="small"] {
  font-size: 13.5px;
}
.stage-caption-overlay[data-size="medium"] {
  font-size: 15.5px;
}
.stage-caption-overlay[data-size="large"] {
  font-size: 18px;
}
.stage-caption-overlay[data-size="xlarge"] {
  font-size: 20.5px;
}

.stage-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-theater);
}

/* Seekbar: a thin rail with the played portion in optical cobalt. The filled
   width comes from the --pct custom property the component sets. */
.stage-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.stage-scrubber::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--pct, 0%),
    #343944 var(--pct, 0%) 100%
  );
}

.stage-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 2px solid var(--accent);
}

.stage-scrubber::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #343944;
}

.stage-scrubber::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.stage-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #f3f4f6;
}

.stage-scrubber:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.stage-btn[data-active="true"] {
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.stage-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.stage-btn {
  appearance: none;
  border: 1px solid #343944;
  background: #1a1e24;
  color: #f3f4f6;
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.stage-btn:hover {
  background: #252a33;
}

.stage-btn[data-active="true"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.stage-sidepanel {
  display: flex;
  flex-direction: column;
  background: #13161b;
}

.stage-cue-list {
  flex: 1;
  overflow-y: auto;
  max-height: 310px;
  padding: 8px;
}

.stage-cue-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.stage-cue-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.stage-cue-btn[data-current="true"] {
  background: rgba(59, 130, 246, 0.16);
  color: #ffffff;
}

.stage-cue-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #93c5fd;
  font-variant-numeric: tabular-nums;
}

.stage-export-preview {
  margin: 0;
  padding: 12px 14px;
  background: #0c0e11;
  color: #d1d5db;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  max-height: 310px;
  overflow: auto;
  white-space: pre-wrap;
}

.stage-footer-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--border-theater);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #9ca3af;
}

/* Editorial Split Layouts (No Card Grids) */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.split-section > * {
  min-width: 0;
  max-width: 100%;
}

/* Proportional Codebase Telemetry Bar & Spec Matrix */
.loc-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
}

.loc-bar-track {
  flex: 1;
  height: 7px;
  border-radius: 3px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.loc-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.spec-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border-hairline);
}

.spec-matrix-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px 13px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.spec-matrix-row:nth-child(odd) {
  border-right: 1px solid var(--border-hairline);
  padding-right: 22px;
}

.spec-matrix-row:nth-child(even) {
  padding-left: 22px;
}

@media (max-width: 760px) {
  .spec-matrix {
    grid-template-columns: 1fr;
  }
  .spec-matrix-row:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }
  .spec-matrix-row:nth-child(even) {
    padding-left: 0;
  }
}

.section-heading {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-prose {
  margin: 0 0 16px;
  max-width: var(--max-prose);
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.62;
}

/* Stream Comparison Bars */
.stream-compare {
  padding: 24px 0;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

.stream-row {
  margin-bottom: 18px;
}

.stream-row:last-child {
  margin-bottom: 0;
}

.stream-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.stream-track {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.stream-fill-video {
  height: 100%;
  width: 100%;
  background: #9aa3b2;
}

.stream-fill-audio {
  height: 100%;
  width: 7%;
  min-width: 14px;
  background: var(--accent);
}

.product-figure {
  margin: 24px 0 0;
}

.product-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
}

.product-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-tertiary);
}

/* Two-by-two product screenshot gallery
   Real captures, one uniform crop, hairline frames only. No shadows, no
   nested card wrappers, no decorative badges. */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 24px;
  margin-top: 26px;
}

.shot-cell {
  margin: 0;
  min-width: 0;
}

.shot-cell picture,
.shot-grid picture {
  display: block;
}

.shot-cell img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  transition:
    transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 260ms ease;
}

.shot-cell:hover img,
.shot-cell:focus-within img {
  transform: translateY(-3px);
  border-color: var(--border-control);
}

.shot-cell figcaption {
  display: grid;
  gap: 4px;
  margin-top: 11px;
}

.shot-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.shot-caption {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 46ch;
}

@media (max-width: 760px) {
  .shot-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
}

/* Radix Switch Primitive Styling */
.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.switch-row:first-child {
  border-top: 1px solid var(--border-hairline);
}

.switch-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  display: block;
  cursor: pointer;
}

.switch-desc {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  max-width: 50ch;
}

.radix-switch-root {
  all: unset;
  box-sizing: border-box;
  width: 42px;
  height: 24px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-control);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.radix-switch-root[data-state="checked"] {
  background-color: var(--accent);
  border-color: var(--accent);
}

.radix-switch-thumb {
  display: block;
  width: 18px;
  height: 18px;
  background-color: var(--ink-secondary);
  border-radius: 999px;
  transition: transform 140ms ease, background-color 140ms ease;
  transform: translateX(2px);
}

.radix-switch-root[data-state="checked"] .radix-switch-thumb {
  background-color: #ffffff;
  transform: translateX(20px);
}

/* Radix Tabs Primitive Styling */
.radix-tabs-list {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.radix-tabs-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.radix-tabs-trigger[data-state="active"] {
  background: var(--bg-sheet);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 19, 21, 0.06);
}

/* Flat Specification & Transcript Tables */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--border-hairline);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.data-table th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

/* Unboxed KPI Strip for Statistics View (No Stat Cards!) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  margin: 24px 0 36px;
}

.kpi-cell {
  padding: 22px 20px 22px 0;
  border-right: 1px solid var(--border-hairline);
}

.kpi-cell:not(:first-child) {
  padding-left: 22px;
}

.kpi-cell:last-child {
  border-right: 0;
}

.kpi-value {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.kpi-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-tertiary);
}

/* 14-Day Activity Chart */
.chart-bars {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  align-items: end;
  height: 164px;
  padding: 20px 0 10px;
  border-bottom: 1px solid var(--border-hairline);
}

/* Narrow screens: fewer bars stay legible, the rest scroll horizontally */
.chart-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

@media (max-width: 620px) {
  .chart-bars {
    min-width: 460px;
    gap: 6px;
  }
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  max-width: 28px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transition: opacity 120ms ease;
}

.chart-bar[data-zero="true"] {
  background: var(--border-hairline);
}

.chart-day {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Forms & Inline Validation */
.form-field {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--bg-sheet);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
}

.form-input-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--status-err);
}

.notice-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-sheet);
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.notice-banner[data-tone="sample"] {
  background: var(--status-warn-bg);
  border-color: #f3c8ad;
  color: var(--status-warn);
}

.notice-banner[data-tone="ok"] {
  background: var(--status-ok-bg);
  border-color: #b8e1c6;
  color: var(--status-ok);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.tag-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok);
}

/* Radix Dialog & DropdownMenu Overlays */
.radix-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 19, 21, 0.46);
}

.radix-dialog-content {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 20px 48px rgba(17, 19, 21, 0.18);
}

.radix-dialog-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.radix-dialog-desc {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.radix-dropdown-content {
  z-index: 95;
  min-width: 170px;
  background: var(--bg-sheet);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: 0 10px 24px rgba(17, 19, 21, 0.12);
}

.radix-dropdown-item {
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink-primary);
  cursor: pointer;
  user-select: none;
}

.radix-dropdown-item[data-highlighted] {
  background: var(--bg-subtle);
  outline: none;
}

.radix-tooltip-content {
  z-index: 100;
  padding: 6px 10px;
  border-radius: 5px;
  background: var(--ink-primary);
  color: var(--bg-sheet);
  font-size: 12px;
  line-height: 1.35;
}

/* Skeleton Loader */
.skeleton-row {
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  margin-bottom: 8px;
}

/* Legal Document Layout */
.legal-article {
  max-width: 68ch;
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 104px);
}

.legal-article h1 {
  margin: 0 0 8px;
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  letter-spacing: -0.028em;
}

.legal-article h2 {
  margin: 32px 0 10px;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.legal-article p,
.legal-article li {
  color: var(--ink-secondary);
  font-size: 15.5px;
  line-height: 1.65;
}

.draft-callout {
  padding: 14px 16px;
  border: 1px solid #f3c8ad;
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin: 18px 0 26px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 32px 0 48px;
  margin-top: 40px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.site-footer-inner {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--pad-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a,
.footer-links button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink-secondary);
  text-decoration: none;
  cursor: pointer;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--ink-primary);
  text-decoration: underline;
}

/* Padding scale responds to the viewport instead of hard-coded per page */
@media (max-width: 760px) {
  :root {
    --pad-gutter: 18px;
    --pad-sheet: 20px;
    --pad-sheet-sm: 16px;
  }
}

@media (min-width: 1280px) {
  :root {
    --pad-gutter: 32px;
    --pad-sheet: 30px;
  }
}

@media (max-width: 420px) {
  :root {
    --pad-gutter: 14px;
  }
}

/* Responsive Breakpoints (Desktop -> Tablet -> Mobile 375px) */
@media (max-width: 900px) {
  .stage-body {
    grid-template-columns: 1fr;
  }
  .stage-viewport {
    border-right: 0;
    border-bottom: 1px solid var(--border-theater);
  }
  .split-section {
    grid-template-columns: 1fr;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }
  .kpi-cell:nth-child(2) {
    border-right: 0;
  }
  .kpi-cell:nth-child(3) {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: auto;
    padding: 10px 0;
  }
  .site-header-inner {
    padding: 0 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .page-wrap {
    padding: 0 var(--pad-gutter);
  }
  .stage-viewport {
    padding: 18px 16px 16px;
  }
  .kpi-strip {
    grid-template-columns: 1fr;
  }
  .kpi-cell,
  .kpi-cell:not(:first-child) {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border-hairline);
  }
  .kpi-cell:last-child {
    border-bottom: 0;
  }
}

.local-code-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

.local-code-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.local-code-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.local-code-panel {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-sheet);
  display: grid;
  gap: 12px;
}

.local-code-panel[data-highlight="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.local-code-panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.local-code-panel-controls .form-input {
  flex: 1 1 260px;
}

/* Notification Center & Inline Cue Editor */
.notif-bell-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.notif-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg-sheet);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.notif-dialog-content {
  max-width: 520px;
}

.notif-perm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  color: var(--ink-primary);
}

.notif-perm-bar[data-granted="true"] {
  border-color: var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.status-tag[data-tone="ok"] {
  background: var(--status-ok-bg);
  color: var(--status-ok);
}

.status-tag[data-tone="err"] {
  background: #fdecec;
  color: var(--status-err);
}

.notif-feed-list {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border-hairline);
}

.notif-brand-logo,
.notif-row-logo {
  display: block;
  flex-shrink: 0;
  border-radius: 6px;
}

.notif-row-logo {
  margin-top: 2px;
}

.notif-feed-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-hairline);
}

.notif-feed-content {
  min-width: 0;
  flex: 1;
}

.notif-feed-row[data-unread="true"] {
  background: rgba(0, 85, 212, 0.04);
  padding-left: 10px;
  padding-right: 10px;
  border-radius: var(--radius-sm);
}

.notif-feed-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-time {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.notif-feed-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.notif-feed-body {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.notif-empty-state {
  padding: 26px 6px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.cue-editor-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.cue-editor-row {
  display: grid;
  grid-template-columns: 96px 96px 1fr auto;
  gap: 8px;
  align-items: start;
}

@media (max-width: 720px) {
  .cue-editor-row {
    grid-template-columns: 1fr 1fr;
  }
}

@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;
  }
}

/* Blog: server-rendered, crawlable article pages */
.prose-list {
  margin: 0 0 16px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.prose-list li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-secondary);
}

.prose-list li strong {
  color: var(--ink);
  font-weight: 600;
}

.blog-card {
  border-top: 1px solid var(--border-hairline);
  padding: 26px 0 8px;
}

.faq-item {
  border-top: 1px solid var(--border-hairline);
  padding: 22px 0 6px;
}

/* Blog articles keep a readable measure instead of stretching to the full grid */
.page-wrap article.section-block > *:not(nav):not(figure):not(img) {
  max-width: 72ch;
}

/* Structural blog blocks are allowed to use the full page width */
.page-wrap article.section-block > .post-shell,
.page-wrap article.section-block > .post-nav,
.page-wrap article.section-block > .related-grid,
.page-wrap article.section-block > .author-box {
  max-width: none;
}

/* Release notes rendered by the extension UI and the update banner */
.update-notes {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.update-notes-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.update-notes-lede {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.update-notes-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.update-notes-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.faq-q {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.brand-mark-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Blog article experience
   Editorial, not templated: one dominant reading column, a sticky on-page
   index, and hairline rules instead of nested card wrappers.
   --------------------------------------------------------------------------- */

.post-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.post-kicker-dot {
  display: inline-block;
  margin: 0 8px;
  color: var(--border-control);
}

.post-title {
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  text-wrap: balance;
}

.post-lede {
  margin: 0 0 22px;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-secondary);
  max-width: 62ch;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 30px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.post-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink-primary);
  color: var(--bg-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.post-byline-text {
  display: block;
}

.post-byline-meta {
  display: block;
  font-size: 13px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 46px;
  align-items: start;
}

/* The reading column keeps a comfortable measure even when the shell is wide */
.post-main {
  min-width: 0;
  max-width: 72ch;
}

.post-side {
  position: sticky;
  top: calc(var(--nav-h) + 22px);
  display: grid;
  gap: 22px;
}

.post-toc-title,
.post-side-title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  letter-spacing: 0.02em;
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--border-hairline);
  display: grid;
  gap: 9px;
}

.post-toc-link {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 180ms ease;
}

.post-toc-link:hover,
.post-toc-link:focus-visible {
  color: var(--accent);
}

.post-toc-link:target {
  color: var(--accent);
  font-weight: 600;
}

.post-side-card {
  padding: 18px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-sheet);
}

.post-side-body {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

/* Block types ------------------------------------------------------------- */

.post-note {
  margin: 26px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
}

.post-note-body {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.post-quote {
  margin: 28px 0;
  padding-left: 18px;
  border-left: 2px solid var(--border-control);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-primary);
  font-weight: 500;
}

.post-code {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--bg-theater);
  color: #e6e9ef;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.post-steps {
  margin: 22px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 16px;
}

.post-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.post-steps li::before {
  content: counter(step) ".";
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.post-step-lead {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.post-step-body {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Prev and next ---------------------------------------------------------- */

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--border-hairline);
}

.post-nav-link {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--bg-sheet);
  transition:
    border-color 200ms ease,
    transform 200ms ease;
}

.post-nav-link.is-next {
  text-align: right;
}

.post-nav-link:hover {
  border-color: var(--border-control);
  transform: translateY(-2px);
}

.post-nav-link.is-empty {
  border-style: dashed;
  background: transparent;
  color: var(--ink-tertiary);
}

.post-nav-dir {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  letter-spacing: 0.02em;
}

.post-nav-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.4;
}

.post-nav-link:hover .post-nav-title {
  color: var(--accent);
}

/* Related reading -------------------------------------------------------- */

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.related-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-sheet);
  text-decoration: none;
  transition:
    border-color 200ms ease,
    transform 200ms ease;
}

.related-card:hover {
  border-color: var(--border-control);
  transform: translateY(-2px);
}

.related-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
}

.related-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-primary);
}

.related-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

/* Author ----------------------------------------------------------------- */

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
}

.author-name {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.author-bio {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 62ch;
}

.author-links {
  margin: 0;
  display: flex;
  gap: 16px;
  font-size: 13.5px;
}

/* Blog index ------------------------------------------------------------- */

.blog-lead {
  display: grid;
  gap: 12px;
  padding: 28px 0 30px;
  margin: 22px 0 30px;
  border-top: 2px solid var(--ink-primary);
  border-bottom: 1px solid var(--border-hairline);
  text-decoration: none;
}

.blog-lead-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.blog-lead-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink-primary);
  text-wrap: balance;
  max-width: 34ch;
}

.blog-lead-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 66ch;
}

.blog-lead-more {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
}

.blog-lead:hover .blog-lead-more {
  text-decoration: underline;
}

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

.blog-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px 0 22px;
  border-top: 1px solid var(--border-hairline);
  text-decoration: none;
}

.blog-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.blog-card-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
}

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.blog-card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  max-width: 34ch;
}

.blog-card-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 58ch;
}

.blog-card-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-tertiary);
}

.blog-card:hover .blog-card-title {
  color: var(--accent);
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 980px) {
  .post-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .post-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .blog-grid,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav-link.is-next {
    text-align: left;
  }
}

/* Scrollbars are hidden site wide at the author's request, including the main
   page scrollbar. Scrolling still works with the wheel, trackpad, keyboard,
   touch, and the space bar; only the visible chrome is removed. */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
