:root {
  --bg: #F6F1E7;
  --surface: #EFE8DA;
  --surface-elevated: #FBF8F2;
  --surface-pill: rgba(251, 248, 242, 0.94);
  --line: #D9CFBD;
  --line-strong: #C4B7A0;
  --ink: #1F1D1A;
  --ink-2: #575148;
  --seal: #B83A2E;
  --seal-hover: #9E3026;
  --seal-ink: #F6F1E7;
  --seal-soft: rgba(184, 58, 46, 0.11);
  --ocean: #2C5E72;
  --ocean-hover: #214B5C;
  --ocean-soft: rgba(44, 94, 114, 0.10);
  --ocean-line: rgba(44, 94, 114, 0.28);
  --ok: #2B6B4F;
  --ok-soft: rgba(43, 107, 79, 0.12);
  /* macOS 26 Liquid Glass candidate/prediction bar tokens (docs/spec/macos-shell.md §8.2, CandidateCells.swift) */
  --lg-bar-h: 30px; /* Matches macOS 26 28 pt view / 30 pt rendered pill height */
  --lg-capsule-h: 24px; /* Matches CellMetrics.capsuleHeight = 24 pt */
  --lg-accent: #007AFF; /* macOS light-mode controlAccentColor selection capsule */
  --lg-bg: rgba(255, 255, 255, 0.80);
  --lg-border: rgba(31, 29, 26, 0.11);
  --lg-highlight: rgba(255, 255, 255, 0.92);
  --lg-sep: rgba(31, 29, 26, 0.14);
  --lg-shadow: 0 8px 22px -6px rgba(31, 29, 26, 0.18), 0 1px 3px rgba(31, 29, 26, 0.08);
  --shadow-window: 0 18px 44px -18px rgba(31, 29, 26, 0.16), 0 2px 8px rgba(31, 29, 26, 0.06);
  --shadow-pill: 0 10px 24px -8px rgba(31, 29, 26, 0.16), 0 1px 4px rgba(31, 29, 26, 0.08);
  --backdrop-bar: rgba(246, 241, 231, 0.90);

  --serif: "Songti TC", "Noto Serif TC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 1240px;
  --gutter: 18px;
  --nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161413;
    --surface: #211E1B;
    --surface-elevated: #282420;
    --surface-pill: rgba(40, 36, 32, 0.95);
    --line: #3A352F;
    --line-strong: #514940;
    --ink: #EDE6D8;
    --ink-2: #B1A899;
    --seal: #D86652;
    --seal-hover: #E07866;
    --seal-ink: #161413;
    --seal-soft: rgba(216, 102, 82, 0.16);
    --ocean: #7AAEC4;
    --ocean-hover: #93C1D4;
    --ocean-soft: rgba(122, 174, 196, 0.14);
    --ocean-line: rgba(122, 174, 196, 0.30);
    --ok: #6DC098;
    --ok-soft: rgba(109, 192, 152, 0.14);
    --lg-accent: #0A84FF;
    --lg-bg: rgba(46, 44, 42, 0.86);
    --lg-border: rgba(255, 255, 255, 0.15);
    --lg-highlight: rgba(255, 255, 255, 0.12);
    --lg-sep: rgba(255, 255, 255, 0.16);
    --lg-shadow: 0 10px 26px -6px rgba(0, 0, 0, 0.62), 0 1px 4px rgba(0, 0, 0, 0.40);
    --shadow-window: 0 22px 48px -16px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-pill: 0 12px 26px -6px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35);
    --backdrop-bar: rgba(22, 20, 19, 0.90);
  }
}

:root[data-theme="dark"] {
  --bg: #161413;
  --surface: #211E1B;
  --surface-elevated: #282420;
  --surface-pill: rgba(40, 36, 32, 0.95);
  --line: #3A352F;
  --line-strong: #514940;
  --ink: #EDE6D8;
  --ink-2: #B1A899;
  --seal: #D86652;
  --seal-hover: #E07866;
  --seal-ink: #161413;
  --seal-soft: rgba(216, 102, 82, 0.16);
  --ocean: #7AAEC4;
  --ocean-hover: #93C1D4;
  --ocean-soft: rgba(122, 174, 196, 0.14);
  --ocean-line: rgba(122, 174, 196, 0.30);
  --ok: #6DC098;
  --ok-soft: rgba(109, 192, 152, 0.14);
  --lg-accent: #0A84FF;
  --lg-bg: rgba(46, 44, 42, 0.86);
  --lg-border: rgba(255, 255, 255, 0.15);
  --lg-highlight: rgba(255, 255, 255, 0.12);
  --lg-sep: rgba(255, 255, 255, 0.16);
  --lg-shadow: 0 10px 26px -6px rgba(0, 0, 0, 0.62), 0 1px 4px rgba(0, 0, 0, 0.40);
  --shadow-window: 0 22px 48px -16px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-pill: 0 12px 26px -6px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35);
  --backdrop-bar: rgba(22, 20, 19, 0.90);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}

::selection {
  background: var(--seal);
  color: var(--seal-ink);
}

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--seal);
  text-underline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-elevated);
  color: var(--ink);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 14px;
  background: var(--seal);
  color: var(--seal-ink);
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 900px) {
  :root {
    --gutter: 36px;
  }
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--nav-h);
  background: var(--backdrop-bar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--max-w);
  min-height: var(--nav-h);
  margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  border-radius: 7px;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.04em;
}

.brand-en {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ocean);
  background: var(--ocean-soft);
  border: 1px solid var(--ocean-line);
  padding: 1px 7px;
  border-radius: 999px;
}

@media (max-width: 440px) {
  .brand-en {
    display: none;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  order: 3;
  width: 100%;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.site-nav::-webkit-scrollbar {
  display: none;
}

@media (min-width: 860px) {
  .topbar-inner {
    flex-wrap: nowrap;
    padding: 0 var(--gutter);
  }
  .site-nav {
    order: 0;
    width: auto;
    flex: 1 1 auto;
    padding-top: 0;
    border-top: 0;
  }
}

.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.site-nav a.nav-sponsor {
  color: var(--seal);
  font-weight: 600;
}

.site-nav a.nav-sponsor:hover {
  color: var(--seal-hover);
}

@media (max-width: 390px) {
  .site-nav {
    gap: 10px;
  }
  .site-nav a {
    font-size: 13px;
  }
}

@media (max-width: 350px) {
  .site-nav {
    gap: 8px;
  }
  .site-nav a {
    font-size: 12.5px;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: 100%;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.theme-opt {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-opt:hover {
  color: var(--ink);
}

.theme-opt[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

@media (max-width: 460px) {
  .theme-opt {
    padding: 3px 6px;
    font-size: 11px;
  }
  .nav-dl {
    padding: 4px 10px;
    font-size: 12px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--seal);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--seal-hover);
  border-color: var(--seal-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--seal);
}

.btn-secondary:hover {
  background: var(--seal-soft);
}

.btn-sponsor {
  background: var(--seal-soft);
  color: var(--ink);
  border-color: var(--seal);
}

.btn-sponsor:hover {
  background: var(--seal);
  color: var(--seal-ink);
  border-color: var(--seal);
}

.btn-lg {
  padding: 10px 20px;
  font-size: 15px;
}

.nav-dl {
  padding: 5px 13px;
  font-size: 13px;
}

/* Headings */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(26px, 3.1vw, 38px);
  line-height: 1.24;
}

h2 {
  font-size: clamp(23px, 2.5vw, 31px);
  line-height: 1.28;
}

/* Hero Section (Single-Column Clean Editorial Layout) */
.hero {
  padding: 28px 0 36px;
  border-bottom: 1px solid var(--line);
}

.hero-single-inner {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-single h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.22;
}

.hero-single .hero-lead {
  max-width: 720px;
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  text-wrap: pretty;
}

.hero-single .hero-metrics {
  max-width: 640px;
  margin-top: 8px;
  padding-top: 20px;
}

@media (min-width: 1020px) {
  .hero {
    padding: 48px 0 52px;
  }
  .hero-single-inner {
    gap: 20px;
  }
}

/* Standalone Try Page (/try) */
.try-section {
  padding: 28px 0 42px;
  border-bottom: 1px solid var(--line);
}

.try-head {
  max-width: 780px;
  margin-bottom: 22px;
}

.try-head h1 {
  font-size: clamp(26px, 3.1vw, 36px);
  line-height: 1.24;
  margin-bottom: 8px;
}

.try-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}

.try-stage {
  min-width: 0;
}

.try-cta-section {
  padding: 36px 0 48px;
}

.try-cta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 20px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-elevated);
}

.try-cta-copy {
  flex: 1 1 260px;
  min-width: 0;
}

.try-cta-copy h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.try-cta-copy p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

.try-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 1 auto;
  max-width: 100%;
}

@media (min-width: 1020px) {
  .try-section {
    padding: 36px 0 52px;
  }
}

.mola-mark {
  display: inline-block;
  flex-shrink: 0;
  color: var(--ocean);
}

.hero-mark {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.h1-brand {
  display: block;
  font-size: clamp(14px, 1.35vw, 17px);
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ocean);
  margin-bottom: 4px;
}

.h1-tagline {
  display: block;
}

.app-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -6px rgba(31, 29, 26, 0.22);
}

@media (min-width: 1020px) {
  .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }
}

.hero-lead {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.brew-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.brew-pill:hover {
  border-color: var(--seal);
  background: var(--surface-elevated);
}

.brew-pill code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.copy-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--seal);
  flex-shrink: 0;
}

.brew-pill.is-copied .copy-state,
.copy-btn.is-copied .copy-label {
  color: var(--ok);
}

.hero-req {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.hero-sponsor-link {
  color: var(--seal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-sponsor-link:hover {
  color: var(--seal-hover);
}

.hero-metrics {
  margin: 4px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  min-width: 0;
}

.metric dt {
  font-size: 12px;
  color: var(--ink-2);
}

.metric dd {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(16px, 1.75vw, 21px);
  line-height: 1.2;
  color: var(--ink);
}

@media (max-width: 480px) {
  .hero-metrics {
    gap: 8px;
  }
  .metric dd {
    font-size: 15px;
  }
  .metric dt {
    font-size: 11px;
  }
}

/* Workbench Stage */
.workbench {
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-window);
  overflow: hidden;
  min-width: 0;
}

.workbench-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.window-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-close { background: #E36B5E; }
.dot-min   { background: #E2B44F; }
.dot-zoom  { background: #5BAE67; }

.mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-right: auto;
  max-width: 100%;
}

.mode-tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mode-tab.is-active {
  background: var(--surface-elevated);
  color: var(--ink);
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-toggle[aria-expanded="true"] {
  border-color: var(--seal);
  color: var(--seal);
}

.settings-summary-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}

/* Shared Settings Drawer */
.wb-settings-drawer {
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wb-settings-drawer[hidden] {
  display: none;
}

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

.drawer-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.drawer-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.setting-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  max-width: 100%;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.seg-btn.is-active {
  background: var(--seal);
  color: var(--seal-ink);
}

.setting-toggles,
.pack-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
}

.toggle-chip input {
  accent-color: var(--seal);
  margin: 0;
}

.pack-toggles.is-wasm-locked .toggle-chip {
  opacity: 0.56;
  cursor: not-allowed;
  background: var(--surface);
}

.pack-toggles.is-wasm-locked .toggle-chip input {
  cursor: not-allowed;
}

.packs-wasm-note {
  margin: 2px 0 0;
  width: 100%;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ocean);
}

.workbench-panel {
  padding: 14px 16px 16px;
}

.workbench-panel[hidden] {
  display: none;
}

/* Free Typing Mode */
.free-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip.is-active {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--seal-ink);
  font-weight: 600;
}

.free-sample-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sample-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 7px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-pill:hover,
.sample-pill.is-active {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
}

.free-inputs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.input-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  width: 34px;
  flex-shrink: 0;
}

.wb-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

.wb-main-input {
  font-family: var(--mono);
  font-size: 14px;
}

.ime-switch-warn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--seal);
  background: var(--seal-soft);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
}

.ime-switch-warn-text {
  flex: 1 1 220px;
  min-width: 0;
}

.ime-switch-warn strong {
  color: var(--seal);
}

/* Opt-in Browser WASM Engine Control Strip */
.wasm-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--ocean-line);
  background: var(--surface);
  min-width: 0;
}

.wasm-bar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  min-width: 0;
}

.wasm-enable-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--ocean);
  background: var(--bg);
  color: var(--ocean);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  max-width: 100%;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.wasm-enable-btn:hover:not(:disabled) {
  background: var(--ocean);
  border-color: var(--ocean);
  color: var(--seal-ink);
}

.wasm-enable-btn.is-active {
  background: var(--ocean);
  border-color: var(--ocean);
  color: var(--seal-ink);
}

.wasm-enable-btn.is-active:hover:not(:disabled) {
  background: var(--ocean-hover);
  border-color: var(--ocean-hover);
}

.wasm-enable-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.wasm-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 100%;
}

.workbench[data-wasm-stage="loading-stage1"] .wasm-status-badge,
.workbench[data-engine-mode="wasm"] .wasm-status-badge {
  border-color: var(--ocean-line);
  color: var(--ocean);
}

.workbench[data-engine-mode="wasm"][data-wasm-stage="stage2-ready"] .wasm-status-badge {
  border-color: var(--ok);
  color: var(--ok);
}

.wasm-memory-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.workbench[data-engine-mode="wasm"] .sim-mode-tag {
  background: var(--bg);
  border: 1px solid var(--ocean-line);
  color: var(--ocean);
}

.sim-stage {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 10px;
}

.sim-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sim-mode-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 1px 8px;
  border-radius: 999px;
}

.sim-bopomofo {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.sim-composition-line {
  font-size: 20px;
  line-height: 1.5;
  min-height: 32px;
  word-break: break-word;
}

.editor-context {
  color: var(--ink-2);
}

.editor-output.is-wrong {
  text-decoration: underline wavy var(--seal);
  text-underline-offset: 4px;
}

.editor-output.is-composing {
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink-2); /* macOS IMK single underline for marked text */
  padding-bottom: 1px;
}

.editor-output.is-right {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--ok); /* Settled composition underline */
  padding-bottom: 1px;
}

.editor-en-run {
  border-bottom: 2.5px solid var(--lg-accent); /* NSUnderlineStyle.thick for open English run */
  padding-bottom: 1px;
}

.editor-output.is-unmatched {
  color: var(--ink-2);
  font-size: 15.5px;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  vertical-align: -0.15em;
  background: var(--lg-accent);
  margin-left: 1px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.pill-stage-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: var(--lg-bar-h);
}

/* Authentic macOS 26 single-row horizontal Liquid Glass candidate / prediction pill
 * Matches c1-c.png, mpa-5-cand-tilde.png, lw-lw-kpredict-row.png & docs/spec/macos-shell.md §8.2. */
.liquid-pill {
  margin-top: 8px;
  padding: 3px 4px;
  border-radius: 999px;
  border: 1px solid var(--lg-border);
  background: var(--lg-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--lg-shadow), inset 0 1px 0 var(--lg-highlight);
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: var(--lg-bar-h);
  max-width: 100%;
  overflow: hidden;
}

.pill-stage-row .liquid-pill {
  margin-top: 0;
}

.liquid-pill[hidden],
.liquid-pill[data-bar-mode="none"] {
  display: none !important;
}

.pill-candidates {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px; /* CellMetrics cellSpacing = 2 pt */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.pill-candidates::-webkit-scrollbar {
  display: none;
}

.cand {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px; /* numberToCandidate = 6 pt scaled */
  height: var(--lg-capsule-h);
  padding: 0 7px 0 5px;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.cand:hover {
  background: rgba(128, 128, 128, 0.14);
}

.cand b {
  font-weight: 500;
  font-size: 9.5px; /* CellMetrics.numberFont = 9 pt */
  color: var(--ink-2);
  opacity: 0.85;
  line-height: 1;
}

.cand.is-selected {
  background: var(--lg-accent);
  color: #FFFFFF;
  font-weight: 500;
}

.cand.is-selected:hover {
  background: var(--lg-accent);
}

.cand.is-selected b {
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}

.cand-hint {
  display: inline-flex;
  align-items: center;
  height: var(--lg-capsule-h);
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.pill-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 18px;
  margin-left: 2px;
  border-left: 1px solid var(--lg-sep);
  color: var(--ink-2);
  opacity: 0.72;
}

.liquid-pill[data-bar-mode="english-hint"] .pill-chevron {
  display: none;
}

.pill-right-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.duel-pill-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.duel-pill-row .liquid-pill {
  margin-top: 0;
}

.pred-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px dashed var(--seal);
  background: var(--seal-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pred-pill[hidden] {
  display: none;
}

.sim-compare-row {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 13px;
}

.cmp-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.cmp-badge-err {
  background: var(--seal-soft);
  color: var(--seal);
}

.sim-apple-text {
  color: var(--seal);
  font-weight: 600;
}

.sim-source-note {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-2);
}

/* Virtual Daqian Keypad */
.keypad-wrap {
  margin-bottom: 10px;
}

.keypad-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.keypad-label {
  font-size: 12px;
  color: var(--ink-2);
}

.virtual-keypad {
  margin-top: 8px;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.virtual-keypad[hidden] {
  display: none;
}

.vk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vk-key {
  flex: 1 1 28px;
  min-width: 26px;
  padding: 5px 3px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.vk-key small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-2);
}

.vk-key:hover {
  border-color: var(--seal);
  background: var(--surface-elevated);
}

.trace-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trace-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trace-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.honest-notice {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}

/* Corpus Browser Mode */
.corpus-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.corpus-count {
  font-size: 12px;
  color: var(--ink-2);
}

.corpus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 410px;
  overflow-y: auto;
  padding-right: 2px;
}

.corpus-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.corpus-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.corpus-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
}

.corpus-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.corpus-zy {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.corpus-out {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ok);
}

.corpus-ctx {
  color: var(--ink-2);
  font-weight: 400;
}

.corpus-meta {
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* Duel Mode */
.duel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.scenario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 240px;
}

.playback-controls {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.ctrl-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.ctrl-btn[aria-pressed="true"] {
  border-color: var(--seal);
  color: var(--seal);
}

.keystream-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  min-height: 34px;
}

.keystream-label {
  font-size: 12px;
  color: var(--ink-2);
  flex-shrink: 0;
}

.keystream-seq {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  min-width: 0;
}

.tracks {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.track {
  padding: 11px 14px;
}

.track + .track {
  border-top: 1px solid var(--line);
}

.track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.track-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.track-status {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

.track-status-err {
  color: var(--seal);
  background: var(--seal-soft);
}

.track-status-ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.track-editor {
  font-size: 19px;
  line-height: 1.5;
  min-height: 30px;
}

.pill-rerank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok);
  color: #F6F1E7;
  font-size: 11.5px;
  font-weight: 600;
}

.pill-rerank[hidden] {
  display: none;
}

.engine-readout {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.engine-readout svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--ok);
}

/* Mobile compact workbench (<= 768px):
 * Hide desktop-centric free-typing + 300 MiB WASM panel so mobile visitors get a
 * single-viewport Duel + Corpus workbench instead of a ~960px wall of keyboard controls. */
.wb-mobile-desktop-note {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --wb-mobile-corpus-max-h: 320px; /* Keep corpus browser bounded inside one mobile viewport */
  }

  html.has-js #tab-free,
  html.has-js #panel-free,
  html.has-js .corpus-load-btn,
  html.has-js .trap-try-link {
    display: none !important;
  }

  html.has-js .wb-mobile-desktop-note {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.4;
  }

  html.has-js .wb-mobile-desktop-note svg {
    flex-shrink: 0;
    color: var(--ocean);
  }

  html.has-js .workbench-bar {
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 8px 10px;
  }

  html.has-js .workbench-bar .window-dots {
    display: none;
  }

  html.has-js .mode-tabs {
    flex-wrap: wrap;
    min-width: 0;
  }

  html.has-js #tab-duel {
    order: -1;
  }

  html.has-js .mode-tab {
    font-size: 11.5px;
    padding: 4px 8px;
  }

  html.has-js .settings-toggle {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  html.has-js .workbench-panel {
    padding: 12px;
  }

  html.has-js .duel-controls {
    gap: 8px;
    margin-bottom: 10px;
  }

  html.has-js .scenario-chips {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  html.has-js .scenario-chips::-webkit-scrollbar {
    display: none;
  }

  html.has-js .scenario-chips .chip {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    padding: 3px 9px;
  }

  html.has-js .keystream-bar {
    padding: 6px 9px;
    margin-bottom: 10px;
    min-height: 30px;
  }

  html.has-js .track {
    padding: 9px 11px;
  }

  html.has-js .track-editor {
    font-size: 17px;
    min-height: 26px;
  }

  html.has-js .liquid-pill {
    margin-top: 6px;
    padding: 3px 4px;
    min-height: var(--lg-bar-h);
  }

  html.has-js .engine-readout {
    margin-top: 9px;
    font-size: 12.5px;
  }

  html.has-js #corpus-cat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  html.has-js #corpus-cat-tabs::-webkit-scrollbar {
    display: none;
  }

  html.has-js #corpus-cat-tabs .chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  html.has-js .corpus-list {
    max-height: var(--wb-mobile-corpus-max-h);
  }
}

/* Shared Section Spacing */
.section {
  padding: 58px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-sub {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--ink-2);
}

.section-link {
  margin: 20px 0 0;
  font-size: 15px;
}

/* Section 2: VM Theatre + Homophone Trap Cycler */
.theatre-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

@media (min-width: 960px) {
  .theatre-layout {
    grid-template-columns: minmax(0, 1.24fr) minmax(0, 0.76fr);
    gap: 22px;
    align-items: stretch;
  }
}

.theatre-stage {
  min-width: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theatre-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.theatre-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.theatre-frame {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1B1917;
}

.theatre-frame .theatre-video,
.theatre-frame .theatre-poster-img {
  width: 100%;
  height: auto;
  display: block;
}

.theatre-caption-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theatre-keys {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-2);
}

.cap-label {
  font-weight: 700;
  color: var(--ink);
}

.theatre-outputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 14.5px;
}

.out-apple strong {
  color: var(--seal);
}

.out-shanjie strong {
  color: var(--ok);
}

.theatre-ledger {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-elevated);
  overflow: hidden;
}

.ledger-item {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-family: var(--sans);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.ledger-item:last-child {
  border-bottom: 0;
}

.ledger-item:hover,
.ledger-item.is-active {
  background: var(--surface);
}

.ledger-code {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.ledger-item.is-active .ledger-code {
  color: var(--seal);
}

.ledger-pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.l-bad {
  color: var(--seal);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.l-good {
  color: var(--ok);
  font-weight: 700;
}

/* Homophone Traps Cycler */
.trap-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-elevated);
  padding: 18px 20px;
}

.trap-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.trap-heading-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.trap-heading-group h3 {
  font-size: 19px;
}

.trap-sub {
  font-size: 13.5px;
  color: var(--ink-2);
}

.trap-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trap-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.trap-tab.is-active {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--seal-ink);
}

.trap-item {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.trap-item.is-active {
  display: flex;
}

.trap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trap-bopomofo {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.trap-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .trap-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cmp-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 16px;
  min-width: 0;
}

.cmp-wrong {
  background: var(--seal-soft);
}

.cmp-wrong .cmp-tag,
.cmp-wrong strong {
  color: var(--seal);
}

.cmp-right {
  background: var(--ok-soft);
}

.cmp-right .cmp-tag,
.cmp-right strong {
  color: var(--ok);
}

.cmp-tag {
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.trap-note {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* Section 3: Full Feature Interactive Showcase */
.lab-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 920px) {
  .lab-shell {
    grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
  }
}

.lab-nav {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 4px;
  min-width: 0;
}

@media (min-width: 920px) {
  .lab-nav {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.lab-tab {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 920px) {
  .lab-tab {
    white-space: normal;
  }
}

.lab-tab:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.lab-tab.is-active {
  border-color: var(--seal);
  background: var(--seal);
  color: var(--seal-ink);
}

.lab-stage {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-elevated);
  padding: 20px;
}

.lab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.lab-pane.is-active {
  display: flex;
}

.lab-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lab-pane-head h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.lab-meta-line {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.switch-pill input {
  accent-color: var(--seal);
}

.lab-demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 720px) {
  .lab-demo-grid,
  .lab-english-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lab-english-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.lab-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.lab-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

.lab-example {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink);
}

.lab-pairs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.lab-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  max-width: 100%;
}

.lab-keys,
.lab-out {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.lab-result {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 15.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lab-foot-note,
.lab-explain {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.lab-demo-box {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lab-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 15px;
}

.lab-line.is-ok strong {
  color: var(--ok);
}

.lab-rerank-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 720px) {
  .lab-rerank-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rerank-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rerank-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.lab-pred-bar {
  align-self: flex-start;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border-radius: 999px;
  background: var(--lg-bg);
  border: 1px solid var(--lg-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--lg-shadow), inset 0 1px 0 var(--lg-highlight);
  min-height: var(--lg-bar-h);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.lab-pred-bar::-webkit-scrollbar {
  display: none;
}

.pred-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--seal);
  margin-right: 4px;
}

.mini-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.packs-interactive {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.pack-live {
  font-size: 13.5px;
  color: var(--ok);
  font-weight: 600;
}

/* Section 4: Sticky 3-Layer Engine Story (Demo D) */
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.story-stage-col {
  display: none;
}

@media (min-width: 960px) {
  .story-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 36px;
    align-items: start;
  }
  .story-stage-col {
    display: block;
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    min-width: 0;
  }
}

.sticky-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stage-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.stage-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.macos-stage {
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-window);
}

.macos-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.traffic-lights {
  display: inline-flex;
  gap: 6px;
}

.traffic-lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
  display: block;
}

.chrome-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.chrome-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--ocean);
  background: var(--ocean-soft);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ocean-line);
}

.stage-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.stage-view.is-active {
  display: flex;
}

.stage-context-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface);
}

.stage-context-line.is-highlighted {
  background: var(--ok-soft);
}

.ctx-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}

.ctx-body {
  font-size: 14px;
  color: var(--ink);
}

.stage-compose-box {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
}

.compose-active {
  color: var(--ok);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.compose-bopomofo {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.stage-candidates,
.stage-memory-rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cand-item,
.mem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
}

.cand-item.is-winner,
.cand-item.is-promoted {
  background: var(--ok-soft);
}

.cand-item.is-demoted {
  background: var(--seal-soft);
}

.cand-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  min-width: 40px;
}

.cand-item.is-winner .cand-num,
.cand-item.is-promoted .cand-num {
  color: var(--ok);
}

.cand-word {
  font-weight: 700;
  flex: 1;
}

.cand-score {
  font-size: 12px;
  color: var(--ink-2);
}

.stage-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}

.tel-badge {
  color: var(--ok);
  font-weight: 700;
}

.story-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

@media (min-width: 960px) {
  .story-steps {
    gap: 36px;
  }
}

.story-step {
  opacity: 1;
  padding: 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.story-step.is-active {
  border-color: var(--seal);
  background: var(--surface);
}

.story-step h3 {
  font-size: clamp(19px, 1.9vw, 23px);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.step-index {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--seal);
}

.step-lead {
  margin: 10px 0 12px;
  font-size: 15.5px;
}

.step-specs {
  margin: 0;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.step-specs strong {
  color: var(--ink);
}

.step-mini-diagram {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

@media (min-width: 960px) {
  .step-mini-diagram {
    display: none;
  }
}

.mini-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.mini-line.is-ok strong {
  color: var(--ok);
}

/* Section 5: Benchmark Monuments & 7 Local Models Table */
.monuments {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

@media (min-width: 800px) {
  .monuments {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
}

.monument {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.monument-num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.12;
  color: var(--ink);
}

.monument-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ok);
}

.monument-detail {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.sub-metrics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0 28px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .sub-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sub-metric {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-metric-val {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  color: var(--seal);
}

.sub-metric-desc {
  font-size: 14px;
  color: var(--ink-2);
}

.models-block {
  margin-top: 28px;
}

.models-block h3 {
  font-size: 20px;
  margin-bottom: 14px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-elevated);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.table-wrap th,
.table-wrap td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap th {
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Section 6: Install + FAQ + Privacy Seal */
.install-section {
  border-bottom: 0;
  padding-bottom: 68px;
}

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

@media (min-width: 780px) {
  .install-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

.install-panel {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.install-panel h3 {
  font-size: 19px;
}

.badge-rec {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-sub {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.install-panel p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.install-note {
  font-size: 13.5px !important;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 6px;
}

.text-link {
  font-size: 14.5px;
  font-weight: 600;
}

.code-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  min-width: 0;
}

.code-row pre {
  max-width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  overflow-x: auto;
}

.code-row pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-row .copy-btn {
  align-self: flex-start;
}

.recent-block {
  margin-bottom: 34px;
}

.recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.recent-head h3 {
  font-size: 21px;
  margin: 0;
}

.recent-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.recent-list li {
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}

.recent-list a {
  font-weight: 600;
}

.recent-list time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

.faq-block {
  margin-bottom: 34px;
}

.faq-block h3 {
  font-size: 21px;
  margin-bottom: 12px;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 4px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink-2);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--seal);
}

.faq-body {
  padding: 0 4px 16px;
  color: var(--ink-2);
  font-size: 15px;
}

.faq-body p {
  margin: 0;
  max-width: 740px;
}

.faq-body p + p {
  margin-top: 10px;
}

.faq-body ul {
  margin: 10px 0 0;
  padding-left: 1.3em;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.faq-body strong {
  color: var(--ink);
}

.privacy-seal-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  padding: 22px 24px;
  border: 1px solid var(--ocean-line);
  border-radius: 14px;
  background: var(--surface);
}

.closing-seal {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  flex-shrink: 0;
}

.privacy-seal-body {
  flex: 1 1 260px;
  min-width: 0;
}

.privacy-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.privacy-seal-body h3 {
  font-size: 22px;
  margin-bottom: 0;
}

.mola-companion-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--ocean-line);
  background: var(--ocean-soft);
  color: var(--ocean);
  font-size: 12px;
  font-weight: 600;
}

.privacy-seal-body p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.privacy-seal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 1 auto;
  max-width: 100%;
}

.sponsor-card {
  margin: 0 0 32px;
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--seal);
  background: var(--surface-elevated);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.sponsor-copy {
  flex: 1 1 260px;
  min-width: 0;
}

.sponsor-copy h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
}

.sponsor-copy p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 0 36px;
  font-size: 14px;
  color: var(--ink-2);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

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

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.footer-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.footer-colophon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-colophon em {
  font-style: italic;
}

.noscript-duels {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-2);
}

@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;
  }
  .caret {
    animation: none;
    opacity: 1;
  }
  .theatre-frame:not([data-motion-override="play"]) .theatre-video {
    display: none;
  }
  .theatre-frame:not([data-motion-override="play"]) .theatre-poster-img {
    display: block !important;
  }
}
