/* 沉思波 · 试讲体态镜 — paper, ink, and a precise coach overlay */

:root {
  --paper: #f3eee4;
  --paper-soft: #faf7f0;
  --paper-deep: #e6dccb;
  --ink: #1b1712;
  --ink-soft: #3a342c;
  --ink-faint: #6f675c;
  --line: rgba(27, 23, 18, 0.12);
  --line-strong: rgba(27, 23, 18, 0.28);
  --cinnabar: #a33b28;
  --cinnabar-deep: #7c2c1e;
  --cinnabar-soft: rgba(163, 59, 40, 0.14);
  --gold: #c4a36a;
  --gold-bright: #e6c98a;
  --teal: #2f6f6a;
  --teal-soft: #4d8c86;
  --board: #24332c;
  --stage-bg: #161410;
  --shadow: 0 22px 50px rgba(40, 28, 16, 0.16);
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

[hidden] { display: none !important; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

#grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ——— file:// warning ——— */

.file-warning {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  padding-left: max(18px, var(--safe-l));
  padding-right: max(18px, var(--safe-r));
  background: #2a2318;
  color: #f3eee4;
  font-size: 13px;
  line-height: 1.55;
}

.file-warning code {
  font-family: "Noto Sans Mono CJK SC", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--gold-bright);
}

/* ——— screens ——— */

#app {
  height: 100dvh;
  height: 100svh;
}

.screen {
  position: relative;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ——— cover ——— */

.screen-cover {
  display: flex;
  flex-direction: column;
  padding: calc(18px + var(--safe-t)) 28px calc(16px + var(--safe-b));
  padding-left: max(28px, calc(20px + var(--safe-l)));
  padding-right: max(28px, calc(20px + var(--safe-r)));
  background: var(--paper);
}

.cover-head, .sub-head, .stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.brand-mark em {
  font-style: normal;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-left: 8px;
  vertical-align: middle;
}

.privacy-pill {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 2px;
  background: transparent;
}

.cover-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 420px);
  gap: 48px;
  align-items: center;
  min-height: 0;
  margin: 12px 0;
}

.cover-copy { max-width: 36rem; }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--cinnabar);
  margin-bottom: 14px;
}

.cover-copy h1, .plain-card h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 68px);
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.lead, .plain-lead {
  margin-top: 18px;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 32em;
}

.cover-points {
  list-style: none;
  margin: 22px 0 0;
  display: grid;
  gap: 8px;
}

.cover-points li {
  position: relative;
  padding-left: 1.15em;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.cover-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 1px;
  background: var(--cinnabar);
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.cover-note, .cover-foot, .dock-note, .coach-sub {
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.6;
}

.cover-note { margin-top: 16px; max-width: 36em; }
.local-import { margin-top: 18px; max-width: 36em; font-size: 13px; line-height: 1.5; }
.local-import label { display: block; margin-bottom: 6px; font-weight: 700; }
.local-import input { max-width: 100%; }
.local-import p { margin: 6px 0; color: var(--ink-faint); }
.local-import #local-video-status { color: var(--ink); }
.local-import #local-video-cancel { margin-top: 6px; }

.cover-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* preview */

.cover-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
}

.preview-frame {
  position: relative;
  height: min(74vh, 720px);
  aspect-ratio: 9 / 16;
  max-width: 100%;
  background: var(--stage-bg);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(27, 23, 18, 0.18), 0 12px 28px rgba(40, 28, 16, 0.10);
}

.preview-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f3eee4;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3533c;
  box-shadow: 0 0 0 0 rgba(211, 83, 60, 0.6);
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(211, 83, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 83, 60, 0); }
}

/* ——— buttons ——— */

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 12px 22px;
  border-radius: 3px;
  text-align: left;
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s;
  user-select: none;
}

.btn-lg {
  min-height: 62px;
  min-width: min(100%, 240px);
  align-items: center;
}

.btn-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.78;
}

.btn-label {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper-soft);
  box-shadow: none;
}

.btn-primary:hover { background: #2a241c; }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.4); }

.btn-ghost {
  background: transparent;
  color: var(--ink-faint);
  min-height: 48px;
  align-items: center;
}

.btn-stop {
  background: var(--cinnabar);
  color: #fff8f4;
  box-shadow: none;
  align-items: center;
}

.btn-stop:disabled {
  background: #8a7d72;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ——— plain screens ——— */

.screen-plain {
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-t)) 24px calc(20px + var(--safe-b));
  background: var(--paper);
}

.sub-head { margin-bottom: 12px; }
.head-spacer { width: 48px; }

.text-back {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  min-height: 44px;
  padding: 0 4px;
}

.text-back.subtle { opacity: 0.8; }

.plain-card {
  margin: auto;
  max-width: 36rem;
  width: 100%;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.plain-card h2 {
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.1em;
}

.plain-list {
  margin: 22px 0 0;
  padding-left: 1.15em;
  color: var(--ink-soft);
  line-height: 1.8;
}

.plain-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.error-line {
  margin-top: 16px;
  color: var(--cinnabar-deep);
  line-height: 1.6;
  font-size: 14px;
}

/* ——— stage (coach / live) ——— */

.screen-stage, .screen-replay {
  display: flex;
  flex-direction: column;
  background: #0e0c0a;
  color: var(--paper-soft);
  overflow: hidden;
}
.screen-replay { overflow: auto; }

.stage-head {
  padding: calc(8px + var(--safe-t)) 16px 8px;
  padding-left: max(16px, var(--safe-l));
  padding-right: max(16px, var(--safe-r));
  color: #ece4d6;
}

.stage-head .brand-mark { color: #ece4d6; }

.head-hint, .timer-hint {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(243, 238, 228, 0.62);
}

.live-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.stage {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  background: var(--stage-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.stage-video, .stage-scene, .stage-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stage-video { background: #111; }
.stage-scene, .stage-overlay { pointer-events: none; }

.coach-copy {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 12, 10, 0.62);
  backdrop-filter: blur(8px);
  color: #f3eee4;
}

.coach-copy p { font-size: 15px; line-height: 1.55; }
.coach-sub { margin-top: 4px; color: rgba(243, 238, 228, 0.7); }

.stage-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 16px calc(14px + var(--safe-b));
}

.dock-note { color: rgba(243, 238, 228, 0.58); }
.kbd-hint { margin: 0; font-size: 12px; color: rgba(243, 238, 228, 0.5); text-align: center; }
.replay-kbd-hint { text-align: left; }
@media (hover: none) and (pointer: coarse), (max-width: 720px) { .replay-kbd-hint { display: none; } }
.kbd-hint kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 0 6px;
  border: 1px solid rgba(243, 238, 228, 0.28);
  border-radius: 3px;
  background: rgba(243, 238, 228, 0.08);
}

/* HUD */

.hud-left {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 108px;
  pointer-events: none;
}

.hud-flags {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.flag-chip {
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.72);
  color: #f6efe3;
  border: 1px solid rgba(230, 201, 138, 0.45);
}

.flag-chip.warn {
  border-color: rgba(211, 83, 60, 0.7);
  color: #ffd8cf;
}

.flag-chip.ok {
  border-color: rgba(77, 140, 134, 0.7);
  color: #d7ece9;
}

.hud-fillers {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.filler-flash {
  font-family: var(--serif);
  font-size: clamp(36px, 8vw, 64px);
  letter-spacing: 0.16em;
  color: #fff6ee;
  text-shadow: 0 2px 0 rgba(122, 36, 22, 0.4), 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: filler-in 1.15s var(--ease) both;
  background: rgba(163, 59, 40, 0.82);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

@keyframes filler-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.96); }
  18% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.hud-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  text-align: center;
  color: #f6efe3;
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.demo-source {
  position: absolute; z-index: 4; top: 10px; left: 10px; right: 10px;
  padding: 6px 9px; border-radius: 8px; pointer-events: none;
  background: rgba(20, 16, 12, 0.82); color: #f6efe3;
  font-size: 11px; line-height: 1.45; text-align: center;
}

.speech-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #ece4d6;
  background: rgba(20, 16, 12, 0.72);
  border: 1px solid rgba(196, 163, 106, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  pointer-events: none;
}

.play-fab { display: none; }

.btn-play-dock {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: #f3eee4;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
  border: 1px solid rgba(230, 201, 138, 0.45);
  background: rgba(27, 23, 18, 0.4);
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* ——— replay ——— */

.screen-replay { background: #12100e; }

.replay-layout {
  flex: 1 0 auto;
  min-height: min(62vh, 640px);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 380px);
  gap: 16px;
  padding: 0 16px;
  align-items: stretch;
}

.diag-panel {
  overflow: auto;
  padding: 8px 4px 8px 8px;
  color: #ece4d6;
}

.diag-panel h2 {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.16em;
  font-weight: 500;
  margin-bottom: 14px;
}

.diag-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.diag-count {
  border: 1px solid rgba(243, 238, 228, 0.12);
  border-radius: 2px;
  padding: 10px 12px;
  background: transparent;
}

.diag-count .n {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.diag-count .k {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(243, 238, 228, 0.62);
}

.diag-count[data-kind="sway"] .n { color: var(--gold-bright); }
.diag-count[data-kind="gaze"] .n { color: #8fd0c9; }
.diag-count[data-kind="filler"] .n { color: #f0a090; }
.diag-count[data-kind="board"] .n { color: #e8d6a8; }

.diag-quote {
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(243, 238, 228, 0.1);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0.04em;
}

.diag-quote::before {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
  color: rgba(243, 238, 228, 0.5);
}

.diag-quote.good::before { content: "可以留下的地方"; color: #c8ddd6; }
.diag-quote.next::before { content: "下一次可以试的一招"; color: var(--gold-bright); }

.timeline-dock {
  flex-shrink: 0;
  padding: 6px 18px calc(10px + var(--safe-b));
}

.timeline {
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(243, 238, 228, 0.16);
}

.timeline-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--gold);
  border-radius: inherit;
}

.timeline-head {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #f3eee4;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.45);
}

.timeline-marks { position: absolute; inset: 0; }

.mark-pin {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-left: -1.5px;
  transform: translateY(-50%);
  border-radius: 2px;
}

.mark-pin.sway { background: var(--gold-bright); }
.mark-pin.gaze { background: #5fbfb6; }
.mark-pin.filler { background: #d3533c; }
.mark-pin.board { background: #e8d6a8; }
.mark-pin.posture { background: #d4a35a; }

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(243, 238, 228, 0.7);
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  list-style: none;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.legend i.sway { background: var(--gold-bright); }
.legend i.gaze { background: #5fbfb6; }
.legend i.filler { background: #d3533c; }
.legend i.board { background: #e8d6a8; }
.legend i.posture { background: #d4a35a; }

.replay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.replay-actions .btn {
  min-height: 44px;
  padding: 6px 14px;
}

.replay-actions .btn-label { font-size: 16px; }

/* ——— responsive ——— */

@media (max-width: 900px) {
  .cover-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(220px, 42vh);
    gap: 16px;
    align-items: stretch;
  }

  .cover-preview { order: -1; }

  .preview-frame {
    height: 100%;
    max-height: 42vh;
    aspect-ratio: 9 / 16;
  }

  .cover-copy h1 { font-size: 40px; }

  .cover-actions { flex-direction: column; }
  .cover-actions .btn { width: 100%; align-items: flex-start; }

  .replay-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 0 10px;
  }

  .diag-panel {
    max-height: 34vh;
    padding: 4px 2px 0;
  }

  .plain-card { padding: 28px 20px; }
}

@media (max-width: 640px) {
  .screen-cover {
    padding-left: max(16px, var(--safe-l));
    padding-right: max(16px, var(--safe-r));
  }

  .cover-foot { font-size: 12px; }
  .cover-points { display: none; }

  .stage {
    width: 100%;
    aspect-ratio: auto;
    height: 100%;
    border-radius: 0;
  }

  .btn-label { font-size: 18px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .cover-layout {
    grid-template-columns: 1.1fr 0.8fr;
    grid-template-rows: 1fr;
  }

  .cover-preview { order: 0; }
  .preview-frame { height: min(64vh, 520px); }
  .cover-points { display: none; }
  .cover-note { display: none; }

  .cover-copy h1 { font-size: 36px; }
  .lead { font-size: 14px; margin-top: 8px; }
  .cover-actions { margin-top: 14px; }
  .btn { min-height: 52px; padding: 8px 16px; }

  .replay-layout {
    grid-template-columns: minmax(200px, 1fr) minmax(220px, 320px);
  }

  .diag-panel { max-height: none; }
  .stage-dock { flex-direction: row; justify-content: center; padding-top: 6px; }
  .hud-caption { font-size: 13px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .filler-flash { animation: none; opacity: 1; }
  .btn { transition: none; }
}


.screen-replay .btn-secondary,
.screen-stage .btn-secondary {
  color: #f3eee4;
  box-shadow: inset 0 0 0 1px rgba(243, 238, 228, 0.38);
  background: transparent;
}
.screen-replay .btn-secondary:hover,
.screen-stage .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}
.screen-replay .btn-primary {
  background: #f3eee4;
  color: #1b1712;
  box-shadow: none;
}
.screen-replay .btn-primary:hover { background: #fff8ee; }

/* ════════════ v1.0 additions ════════════ */

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

.update-bar {
  position: fixed; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%);
  z-index: 120; display: flex; gap: 12px; align-items: center;
  background: #1b1712; color: #f3eee4; padding: 8px 10px 8px 16px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow);
}
.update-bar button { background: var(--gold-bright); color: #1b1712; border-radius: 999px; padding: 6px 12px; font-size: 13px; }

/* cover nav */
.cover-head { flex-wrap: wrap; row-gap: 6px; }
.cover-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; letter-spacing: 0.06em; }
.cover-nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.cover-nav a:hover { border-bottom-color: var(--cinnabar); color: var(--ink); }
.cover-recent {
  margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,0.4); font-size: 13px; color: var(--ink-soft); line-height: 1.7;
}
.cover-recent a { margin-left: 8px; }
.install-chip {
  margin-top: 12px; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-soft); background: rgba(255,255,255,0.5);
}
.version-link { color: var(--ink-faint); text-decoration: none; font-variant-numeric: tabular-nums; }
.version-link:hover { color: var(--cinnabar); }

/* segmented + small controls */
.seg { display: inline-flex; margin-top: 20px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.seg-btn { padding: 10px 18px; font-size: 15px; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.on { background: var(--ink); color: var(--paper); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg.small { margin-top: 0; }
.seg.small .seg-btn { padding: 6px 14px; font-size: 14px; position: relative; }
.check-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.check-line input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--cinnabar); }

.btn-mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 14px; border-radius: 10px; font-size: 14px; letter-spacing: 0.04em;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,0.55); color: var(--ink);
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn-mini:hover { background: #fff; }
.btn-mini.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-mini.danger { color: var(--cinnabar-deep); border-color: rgba(163,59,40,0.4); }
.btn-mini:disabled { opacity: 0.5; cursor: default; }
a.btn { text-decoration: none; color: inherit; }

.steps { list-style: decimal; }
.copy-url { display: flex; gap: 8px; margin-top: 16px; }
.copy-url input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13px; background: #fff; }

/* coach */
.model-progress {
  position: absolute; left: 12px; right: 12px; top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(14, 12, 10, 0.72); color: #f3eee4; font-size: 13px; letter-spacing: 0.04em;
  transition: opacity 0.4s;
}
.model-progress.done { opacity: 0.85; }
.mp-bar { height: 4px; border-radius: 4px; background: rgba(243,238,228,0.18); margin-top: 8px; overflow: hidden; }
.mp-bar i { display: block; height: 100%; width: 3%; background: var(--gold-bright); transition: width 0.3s; }
.model-progress .btn-mini { margin-top: 8px; min-height: 32px; background: rgba(243,238,228,0.9); }
.coach-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: rgba(243,238,228,0.75); }
.mini-check { display: inline-flex; gap: 6px; align-items: center; }
.mini-check input { accent-color: var(--gold-bright); }
.mini-select { max-width: 200px; background: rgba(255,255,255,0.08); color: #f3eee4; border: 1px solid rgba(243,238,228,0.3); border-radius: 8px; padding: 4px 6px; font-size: 13px; }
.mini-select option { color: #1b1712; }
.mirrored { transform: scaleX(-1); }

.pause-veil {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; background: rgba(14,12,10,0.82); color: #f3eee4; z-index: 5;
}
.pv-title { font-family: var(--serif); font-size: 28px; letter-spacing: 0.2em; }
.pv-sub { font-size: 14px; line-height: 1.7; color: rgba(243,238,228,0.8); max-width: 22em; }
.pv-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* replay */
.stage-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.25; }
.replay-note {
  position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; font-size: 12px; color: rgba(243,238,228,0.75);
  background: rgba(20,16,12,0.6); border-radius: 10px; padding: 6px 10px;
}
.diag-meta { font-size: 12px; color: rgba(243,238,228,0.6); margin: -6px 0 12px; letter-spacing: 0.04em; line-height: 1.6; }
.diag-compare { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(243,238,228,0.1); font-size: 13px; }
.diag-compare a, .save-status a { color: var(--gold-bright); }
.dc-title { color: rgba(243,238,228,0.75); margin-bottom: 8px; }
.dc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dc { padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.dc.better { color: #8fd0c9; } .dc.worse { color: #f0a090; } .dc.same { color: rgba(243,238,228,0.7); }
.dc-note { margin-top: 6px; font-size: 11px; color: rgba(243,238,228,0.5); }
.save-status { margin-top: 14px; font-size: 12px; color: rgba(243,238,228,0.65); line-height: 1.6; }

/* pages */
.screen-page { background: var(--paper); padding: 0 0 calc(24px + var(--safe-b)); }
.page-head { max-width: 960px; margin: 0 auto 8px; padding: calc(10px + var(--safe-t)) max(20px, var(--safe-r)) 6px max(20px, var(--safe-l)); position: sticky; top: 0; z-index: 3; background: var(--paper); }
.page-head .text-back { display: inline-flex; align-items: center; text-decoration: none; min-width: 64px; }
.page-head .text-back:last-child { justify-content: flex-end; }
.page-title { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: 0.14em; }
.page-body { max-width: 960px; margin: 0 auto; padding: 0 max(20px, var(--safe-l)) 0 max(20px, var(--safe-r)); }
.page-lead { font-size: 15px; line-height: 1.8; color: var(--ink-soft); margin-bottom: 8px; }
.page-note { font-size: 13px; line-height: 1.7; color: var(--ink-faint); margin-top: 12px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.file-btn { position: relative; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-soft); line-height: 2; border: 1px dashed var(--line-strong); border-radius: 16px; background: rgba(255,255,255,0.35); }

.usage-card { padding: 14px 16px; border-radius: 14px; background: var(--paper-soft); border: 1px solid var(--line); margin-bottom: 14px; }
.usage-row { font-size: 15px; } .usage-row b { font-family: var(--serif); font-size: 18px; }
.usage-row.sub { font-size: 13px; color: var(--ink-faint); margin-top: 4px; }

.history-list { display: grid; gap: 12px; }
.hist-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px; border-radius: 14px; background: var(--paper-soft); border: 1px solid var(--line); }
.hist-thumb { display: block; width: 96px; height: 128px; border-radius: 10px; overflow: hidden; background: #1b1712; color: #999; font-size: 12px; text-decoration: none; }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-thumb span { display: flex; height: 100%; align-items: center; justify-content: center; }
.hist-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.hist-date { color: var(--ink); font-size: 15px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(27,23,18,0.07); color: var(--ink-soft); }
.tag.camera { background: rgba(47,111,106,0.12); color: var(--teal); }
.tag.demo { background: rgba(196,163,106,0.18); color: #7a5f2c; }
.tag.video { background: rgba(163,59,40,0.1); color: var(--cinnabar-deep); }
.hist-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.hist-counts i, .trend-legend i, .pr-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.hist-counts b { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.hist-next { margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--ink-faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hist-actions .btn-mini { min-height: 34px; padding: 4px 12px; font-size: 13px; }

/* compare */
.cmp-pick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.cmp-pick label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-faint); flex: 1; min-width: 220px; }
.cmp-pick select, .field select, .field input[type=text], .field textarea, .activate-row input {
  font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
.cmp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-card { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: var(--paper-soft); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.cmp-card img { width: 60px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cmp-when { font-size: 13px; color: var(--ink-faint); }
.cmp-next { font-size: 13px; line-height: 1.6; margin-top: 4px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: var(--paper-soft); border-radius: 12px; overflow: hidden; font-variant-numeric: tabular-nums; }
.cmp-table th, .cmp-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp-table thead th { font-size: 12px; color: var(--ink-faint); font-weight: 500; }
.cmp-table tbody th { font-weight: 500; white-space: nowrap; }
.cmp-table small { color: var(--ink-faint); margin-left: 4px; }
.delta { font-size: 13px; white-space: nowrap; }
.delta.better { color: var(--teal); } .delta.worse { color: var(--cinnabar); } .delta.same { color: var(--ink-faint); }
.trend-card { margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: var(--paper-soft); border: 1px solid var(--line); }
.trend-card h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.08em; }
.trend-card h3 small { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--ink-faint); margin-left: 6px; letter-spacing: 0.02em; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0; font-size: 13px; }
.trend-legend label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.trend-svg { width: 100%; height: auto; display: block; }
.trend-svg .grid { stroke: rgba(27,23,18,0.08); }
.trend-svg .tick { font-size: 11px; fill: #6f675c; font-family: var(--sans); }

/* settings / feedback forms */
.settings-form fieldset, .feedback-form .field { border: 0; }
.settings-form fieldset { padding: 14px 16px; border-radius: 14px; background: var(--paper-soft); border: 1px solid var(--line); margin-bottom: 14px; }
.settings-form legend { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.1em; padding: 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
.field.check { flex-direction: row; align-items: flex-start; gap: 8px; line-height: 1.5; }
.field.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--cinnabar); flex-shrink: 0; }
.field small { font-size: 12px; color: var(--ink-faint); line-height: 1.6; }
.fs-note { font-size: 13px; color: var(--ink-faint); line-height: 1.7; margin: 6px 0 10px; }
.sens-grid { display: grid; gap: 10px; }
.sens-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 0 calc(8px + var(--safe-b)); margin-top: 0; z-index: 2; }
/* 页面底部留白会让吸底的按钮条下方露出一截表单文字；用同色阴影盖住这段留白 */
.sticky-actions { box-shadow: 0 calc(24px + var(--safe-b)) 0 var(--paper), -24px calc(24px + var(--safe-b)) 0 var(--paper), 24px calc(24px + var(--safe-b)) 0 var(--paper); }
.save-hint { font-size: 13px; color: var(--teal); }
.feedback-out textarea { width: 100%; margin-top: 18px; font-family: "Noto Sans Mono CJK SC", ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; }

/* about */
.about-body { display: grid; gap: 14px; }
.about-card { padding: 16px 18px; border-radius: 14px; background: var(--paper-soft); border: 1px solid var(--line); line-height: 1.8; font-size: 14px; color: var(--ink-soft); }
.about-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: 0.1em; color: var(--ink); margin-bottom: 6px; }
.about-card .plain-list { margin-top: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kv dt { color: var(--ink-faint); }
.activate-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.activate-row input { flex: 1; min-width: 160px; width: auto; }

/* toast + modal */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 140;
  background: #1b1712; color: #f3eee4; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
.modal { position: fixed; inset: 0; z-index: 130; background: rgba(14,12,10,0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--paper-soft); color: var(--ink); border-radius: 18px; padding: 20px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); line-height: 1.7; }
.modal-title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.modal-sub { font-size: 13px; color: var(--ink-faint); }
.modal-img { width: 100%; margin-top: 10px; border-radius: 10px; border: 1px solid var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* print report: hidden on screen */
.print-report { display: none; }

@media (max-width: 640px) {
  .cover-nav { font-size: 13px; gap: 2px 12px; width: 100%; }
  .hist-item { grid-template-columns: 72px 1fr; }
  .hist-thumb { width: 72px; height: 96px; }
  .cmp-cards { grid-template-columns: 1fr; }
  .cmp-table th, .cmp-table td { padding: 8px 6px; font-size: 13px; }
  .cmp-table small { display: block; margin: 0; }
  .page-title { font-size: 19px; }
  .replay-actions .btn { padding: 4px 10px; }
  .replay-actions .btn-label { font-size: 14px; }
}

@media (max-width: 900px) {
  .screen-replay { overflow: auto; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  #app, #grain, #toast, #modal, .file-warning, .update-bar { display: none !important; }
  .print-report { display: block !important; color: #1b1712; font-family: var(--sans); font-size: 11pt; }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1b1712; padding-bottom: 6pt; }
  .pr-brand { font-family: var(--serif); letter-spacing: 0.2em; font-size: 10pt; color: #6f675c; }
  .pr-head h1 { font-family: var(--serif); font-size: 22pt; letter-spacing: 0.1em; }
  .pr-mark { color: #a33b28; border: 1px solid #a33b28; padding: 2pt 8pt; border-radius: 4pt; font-size: 10pt; }
  .pr-meta { margin: 6pt 0 10pt; color: #6f675c; font-size: 10pt; }
  .pr-top { display: flex; gap: 14pt; align-items: flex-start; }
  .pr-still { width: 42%; max-height: 120mm; object-fit: contain; border-radius: 6pt; background: #161410; }
  .pr-side { flex: 1; }
  .pr-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6pt; }
  .pr-count { border: 1px solid #ddd5c6; border-radius: 6pt; padding: 6pt 8pt; }
  .pr-count b { font-family: var(--serif); font-size: 20pt; color: #a33b28; display: block; line-height: 1.1; }
  .pr-count span { font-size: 10pt; } .pr-count small { display: block; color: #6f675c; font-size: 8.5pt; }
  .pr-quote { margin-top: 10pt; } .pr-quote h3 { font-size: 9pt; letter-spacing: 0.12em; color: #2f6f6a; }
  .pr-quote.next h3 { color: #8a6a2e; } .pr-quote p { font-family: var(--serif); font-size: 11.5pt; line-height: 1.7; }
  .pr-trend { margin-top: 12pt; break-inside: avoid; } .pr-trend h3, .pr-events h3 { font-size: 10pt; letter-spacing: 0.1em; margin-bottom: 4pt; }
  .pr-legend { font-size: 9pt; color: #6f675c; }
  .pr-events { margin-top: 12pt; } .pr-events table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .pr-events th, .pr-events td { border-bottom: 1px solid #e6dccb; padding: 3pt 6pt; text-align: left; }
  .pr-foot { margin-top: 14pt; padding-top: 6pt; border-top: 1px solid #ddd5c6; font-size: 8.5pt; color: #6f675c; }
  .trend-svg .grid { stroke: #e6dccb; } .trend-svg .tick { font-size: 10px; fill: #6f675c; }
}

a.text-back { text-decoration: none; }
.stage-head a.text-back { color: rgba(243,238,228,0.75); display: inline-flex; align-items: center; }
.pr-trend .trend-svg { max-height: 62mm; }

@media (max-width: 900px) {
  .screen-cover { overflow: auto; }
  .cover-layout { flex: none; grid-template-rows: auto auto; }
  .cover-preview { height: 42vh; min-height: 240px; }
  .screen-replay { display: flex; flex-direction: column; overflow: auto; }
  .screen-replay .stage-head { position: sticky; top: 0; z-index: 4; background: #12100e; }
  .replay-layout { display: contents; }
  #replay-wrap { order: 1; flex: none; height: 58vh; min-height: 240px; padding: 0 10px; }
  .timeline-dock { order: 2; flex: none; padding-top: 8px; }
  .diag-panel { order: 3; flex: none; max-height: none; overflow: visible; padding: 14px 16px calc(20px + var(--safe-b)); border-top: 1px solid rgba(243,238,228,0.08); }
  .observe-sheet { order: 4; flex: none; }
}

/* ——— 转写（回放） ——— */
.transcript-card {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.transcript-card h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.transcript {
  list-style: none;
  max-height: 240px;
  overflow: auto;
  padding: 0;
  margin: 0 0 8px;
}
.transcript li {
  display: grid;
  grid-template-columns: 3.5em 1fr;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.transcript li:hover, .transcript li.on { background: var(--cinnabar-soft); }
.transcript .tx-t { color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }
mark.shuici, .shuici {
  background: none;
  color: inherit;
  border-bottom: 2px solid #c47a3a;
  padding: 0 1px;
  font-style: inherit;
  border-radius: 0;
}
.legend-note { font-size: 12px; color: var(--ink-faint); }
.screen-replay mark.shuici, .screen-replay .transcript { color: #f3eee4; }
.screen-replay .transcript li { color: rgba(243,238,228,0.88); }
.screen-replay .transcript .tx-t { color: rgba(243,238,228,0.45); }
.screen-replay .transcript li:hover, .screen-replay .transcript li.on { background: rgba(196,122,58,0.22); }
.screen-replay .transcript-card { border-top-color: rgba(243,238,228,0.12); }
.screen-replay .transcript-card h3 { color: #f3eee4; }
.screen-replay .legend-note, .screen-replay #transcript-empty { color: rgba(243,238,228,0.55); }

/* ——— 使用说明（首次） ——— */
.consent-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(27, 23, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.consent-card {
  background: var(--paper-soft);
  color: var(--ink);
  max-width: 520px;
  width: 100%;
  max-height: min(90vh, 720px);
  overflow: auto;
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.consent-card h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 4px 0 12px; }
.consent-card p, .consent-card li { font-size: 15px; line-height: 1.65; }
.consent-card .plain-list { margin: 12px 0 16px; padding-left: 1.2em; }
.consent-card .experience-opt { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 16px 0; font-size: 14px; line-height: 1.6; }
.consent-card .experience-opt input { margin-top: 4px; }
.perm-modes { margin: 16px 0 8px; }
.perm-modes .field-label { font-size: 13px; color: var(--ink-faint); margin: 10px 0 6px; }
.xp-queue { list-style: none; margin: 8px 0; font-size: 13px; color: var(--ink-soft); }
.xp-queue li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ——— v1.1.0 ——— */
.whats-new {
  max-width: 920px;
  margin: 8px auto 0;
  padding: 0 20px 12px;
}
.whats-new-inner {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px 16px;
}
.whats-new-inner .changelog-block h3 { margin-bottom: 2px; }
.whats-new-inner .btn-mini { margin-top: 8px; }
.changelog-meta { font-size: 13px; color: var(--ink-faint); margin-bottom: 8px; }
.asr-state, .live-asr, .mic-state {
  font-size: 12px;
  color: var(--ink-soft, #5c5348);
}
.live-asr { margin: 4px 0 0; text-align: center; }
.preflight-result {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--paper, #f3eee4);
  max-width: 52rem;
}
.screen-plain .preflight-result, .screen-page .preflight-result { color: var(--ink-soft); }
.filler-card, .board-stills-card {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(230, 201, 138, 0.25);
}
.filler-card h3, .board-stills-card h3, .transcript-card h3 {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.filler-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 10px; font-size: 13px; }
.filler-stats b { font-variant-numeric: tabular-nums; }
.filler-words { list-style: none; margin: 0 0 10px; padding: 0; }
.filler-words li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(230,201,138,0.18); font-size: 14px; }
.filler-words button { background: none; border: 0; color: var(--gold, #e6c98a); cursor: pointer; font: inherit; padding: 0; }
.filler-words button:hover { text-decoration: underline; }
.filler-method { margin: 10px 0; font-size: 14px; line-height: 1.7; color: var(--ink-soft, #d9d0c4); }
.filler-method b { display: block; color: var(--paper, #f6efe3); font-weight: 600; margin-bottom: 2px; }
.screen-page .filler-method, .print-report .filler-method { color: var(--ink-soft); }
.screen-page .filler-method b { color: var(--ink); }
.filler-reason { font-size: 14px; line-height: 1.7; }
.board-stills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.board-stills figure { margin: 0; width: calc(50% - 6px); max-width: 200px; }
.board-stills img { width: 100%; border-radius: 8px; display: block; background: #1a1714; cursor: pointer; }
.board-stills figcaption, .pr-stills figcaption { font-size: 12px; color: var(--ink-faint, #8a8175); margin-top: 4px; }
.pr-fillers, .pr-board { margin: 16px 0; }
.pr-stills { display: flex; flex-wrap: wrap; gap: 10px; }
.pr-stills figure { margin: 0; width: 140px; }
.pr-stills img { width: 100%; border-radius: 6px; }
.coach-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* v1.2.0 本机听写下载 */
.local-asr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.local-asr .la-text { flex: 1 1 260px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.local-asr .la-err { color: var(--cinnabar-deep); }
.local-asr .la-bar { flex: 1 1 100%; height: 6px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.local-asr .la-bar i { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.3s var(--ease); }
.local-asr.compact { justify-content: center; margin-top: 8px; }
.local-asr.compact .la-text { flex: 0 1 auto; color: inherit; font-size: 12px; }
.speech-banner .local-asr .la-bar { background: rgba(255, 255, 255, 0.15); }
.speech-banner .local-asr .la-bar i { background: var(--gold-bright); }
.speech-banner .btn-mini { pointer-events: auto; }
.speech-banner .banner-close { margin-left: 8px; opacity: 0.8; }
#speech-preflight-local { margin: 4px 0 8px; }


/* ——— 听写包角落进度 ——— */
.asr-dl-chip {
  position: fixed;
  right: max(16px, var(--safe-r));
  bottom: max(16px, var(--safe-b));
  z-index: 60;
}
.asr-dl-chip-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 132px;
  padding: 8px 12px;
  background: var(--paper-soft);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(27, 23, 18, 0.08);
}
.asr-dl-chip-bar {
  display: block;
  height: 2px;
  background: var(--paper-deep);
  overflow: hidden;
}
.asr-dl-chip-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
}
.banner-local-note {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

/* ——— 观察记录（评课表） ——— */
.observe-sheet {
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 28px 22px calc(36px + var(--safe-b));
  padding-left: max(22px, var(--safe-l));
  padding-right: max(22px, var(--safe-r));
}
.ob-sheet-head h3, .ob-sec-title, .ob-row h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ob-sheet-head h3 { font-size: 22px; margin-bottom: 6px; }
.ob-sheet-head p, .ob-kicker-lead, .ob-hint, .ob-lead, .ob-why, .ob-empty, .ob-quote {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.ob-sheet-head { margin-bottom: 22px; max-width: 42em; padding-bottom: 16px; border-bottom: 2px solid var(--cinnabar); }
.ob-section { max-width: 920px; margin: 0 auto 28px; }
.ob-sec-title { font-size: 18px; margin: 0 0 14px; }
.ob-kicker, .ob-kicker-lead { color: var(--ink-faint); font-size: 13px; margin-bottom: 8px; }
.ob-row {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-soft);
  padding: 14px 16px 16px;
  margin-bottom: 10px;
}
.ob-row.is-missing { background: #efeae0; opacity: 0.92; }
.ob-row h4 { font-size: 16px; margin: 0 0 4px; }
.ob-hint { font-size: 13px; color: var(--ink-faint); margin-bottom: 10px; }
.ob-why { color: var(--ink-faint); }
.ob-pills, .ob-jumps, .ob-segs, .ob-style { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; }
.ob-jumps, .ob-segs, .ob-style { flex-direction: column; }
.ob-pills li, .ob-jumps li, .ob-segs li { font-size: 14px; }
.ob-jump {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--cinnabar-deep);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ob-jump:hover { border-color: var(--cinnabar); }
.ob-svg { display: block; max-width: 100%; margin: 8px 0; }
.ob-bar { fill: var(--teal); }
.ob-bar-lab { font-size: 9px; fill: var(--ink-faint); }
.ob-line { stroke: var(--cinnabar-deep); }
.ob-heat { border: 1px solid var(--line); background: #f7f3ea; }
.ob-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ob-table th, .ob-table td { border-bottom: 1px solid var(--line); text-align: left; padding: 4px 6px; }
.ob-table th { color: var(--ink-faint); font-weight: 500; }
.ob-board-span { margin: 6px 0; font-size: 14px; }
.ob-quote { margin-top: 4px; }
@media (max-width: 800px) {
  .observe-sheet { padding: 20px 14px 28px; }
}


/* ——— 模拟课堂（练习用） ——— */
.perm-sim { margin: 16px 0 4px; }
.perm-sim-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #a33b28;
  border: 1px solid #d9cbb8;
  border-radius: 2px;
  vertical-align: 1px;
}
.stage-wrap.has-sim {
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
  padding-right: 10px;
}
.classroom-sim {
  flex: 0 0 300px;
  width: 300px;
  max-width: 46vw;
  max-height: 100%;
  overflow: auto;
  background: #f6efe4;
  color: #2c241c;
  border: 1px solid #d4c4ae;
  border-radius: 4px;
  padding: 12px 12px 14px;
  box-shadow: 1px 1px 0 #eadfcf;
}
.classroom-sim[hidden] { display: none; }
.sim-head h2 {
  margin: 2px 0 6px;
  font-family: "Noto Serif CJK SC", "Songti SC", "Source Han Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  color: #2c241c;
}
.sim-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #a33b28;
}
.sim-note, .sim-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #5c5146;
}
.sim-hint { margin-top: 10px; }
.sim-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 8px;
  margin-top: 14px;
}
.classroom-sim[data-mode="roadshow"] .sim-row {
  grid-template-columns: 1fr;
  gap: 16px;
}
.sim-seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 8px 8px 10px;
  background: #fbf6ee;
  color: #2c241c;
  border: 1px solid #d4c4ae;
  border-radius: 3px;
  font: inherit;
  text-align: center;
  cursor: default;
  box-shadow: none;
}
.sim-seat[data-pick] { cursor: pointer; }
.sim-seat[data-pick]:hover { border-color: #a33b28; }
.sim-seat.is-hand { border-color: #a33b28; background: #f8efe6; }
.sim-seat.is-speaking, .sim-seat.is-asking { border-color: #3d5a66; }
.sim-seat.is-confused { background: #f3eee6; }
.sim-seat.is-distracted { opacity: 0.86; }
.sim-avatar-svg { display: block; margin: 0 auto; }
.sim-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.sim-meta {
  font-size: 11px;
  color: #6a5e52;
}
.sim-seat.has-bubble { grid-column: 1 / -1; }
.sim-bubble {
  position: static;
  width: auto;
  margin-top: 8px;
  background: #fffdf8;
  color: #2c241c;
  border: 1px solid #2c241c;
  border-radius: 2px 8px 8px 8px;
  padding: 7px 9px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 2px 2px 0 #e6d8c4;
}
.sim-bubble p { margin: 0; }
.sim-timer {
  position: relative;
  margin-top: 12px;
  padding: 8px 10px 10px;
  border: 1px solid #d4c4ae;
  background: #fffdf8;
  font-size: 13px;
}
.sim-timer[data-left="low"] { border-color: #a33b28; color: #a33b28; }
.sim-timer-bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  background: #a33b28;
}
@media (max-width: 860px) {
  .stage-wrap.has-sim {
    flex-direction: column;
    align-items: center;
  }
  .classroom-sim {
    flex: 0 0 auto;
    width: min(100%, 420px);
    max-width: none;
    max-height: 46%;
  }
}


/* 开讲页题干、语文观察表 */
.perm-stem { margin: 14px 0 4px; }
.perm-stem textarea {
  width: 100%;
  min-height: 4.6em;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #faf7f0;
  color: var(--ink);
  border-radius: 2px;
}
.ob-law { background: #f6f1e6; border-left: 3px solid var(--cinnabar); }
.ob-checks { list-style: none; padding: 0; margin: 8px 0 0; }
.ob-checks li { margin: 0 0 10px; }
.ob-checks label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.ob-check-title { font-weight: 600; }
.ob-credit { font-size: 12px; color: var(--ink-faint); margin-top: 18px; }
@media print {
  .ob-hint, .ob-kicker-lead { color: #444; }
  .plain-actions, .live-dock, nav, .ob-jump { /* keep jumps visible as text */ }
}


.stage-scene { z-index: 2; }
.stage-overlay { z-index: 3; }

/* 听写包角落进度不要盖住封面页脚的版本号，也不要在手机上压住「对着镜头试讲」 */
body:has(#asr-dl-chip:not([hidden])) .cover-foot { padding-right: 168px; }
@media (max-width: 720px) {
  .asr-dl-chip { top: max(10px, var(--safe-t)); bottom: auto; right: max(10px, var(--safe-r)); }
  .asr-dl-chip-btn { min-width: 0; padding: 6px 10px; box-shadow: none; }
  body:has(#asr-dl-chip:not([hidden])) .cover-foot { padding-right: 0; }
}

/* Desktop report length must not determine the fitted video stage height. */
@media (min-width: 901px) {
  .screen-replay .replay-layout {
    flex: 0 0 auto;
    height: clamp(320px, calc(100svh - 220px), 720px);
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  .screen-replay .diag-panel { min-height: 0; }
  .screen-replay .timeline-dock { flex-shrink: 0; }
}

/* Responsive finish: every screen scrolls within the app, while stage/overlay share one fitted box. */
.start-guide { max-width: 36em; margin-top: 18px; padding: 14px 16px; border-left: 2px solid var(--cinnabar); background: var(--paper-soft); font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.start-guide strong { display: block; font-family: var(--serif); font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.start-guide p + p { margin-top: 6px; }
.start-guide a { display: inline-block; margin-top: 8px; color: var(--cinnabar-deep); }
:where(a, button, input, select, textarea, [role="slider"], .seg-btn):focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
.stage-head :where(a, button):focus-visible, .screen-replay :where(button, [role="slider"]):focus-visible { outline-color: var(--gold-bright); }
.btn-mini, .install-chip, .cover-nav a, .hist-actions .btn-mini, .ob-jump { min-height: 44px; }
.cover-nav a, .ob-jump { display: inline-flex; align-items: center; }
.stage-video { object-fit: fill; } /* fitStage matches this exact source aspect; no hidden crop. */
.replay-layout, .diag-panel, .timeline-dock, .timeline-meta, .replay-actions, .cover-layout, .cover-copy { min-width: 0; }
.diag-panel, .transcript li, .ob-row, .about-card, .start-guide { overflow-wrap: anywhere; }
.modal { padding: max(12px, var(--safe-t)) max(12px, var(--safe-r)) max(12px, var(--safe-b)) max(12px, var(--safe-l)); }
.modal-card, .consent-card { max-height: calc(100dvh - 24px - var(--safe-t) - var(--safe-b)); overscroll-behavior: contain; }
@media (max-width: 900px) {
  .screen-stage { overflow-y: auto; }
  .screen-stage .stage-wrap { flex: 1 0 auto; min-height: min(52svh, 380px); }
  .screen-replay #replay-wrap { min-height: 0; max-height: 58svh; }
  .screen-replay .stage-head { position: sticky; top: 0; z-index: 5; }
  .timeline-dock { padding-left: max(12px, var(--safe-l)); padding-right: max(12px, var(--safe-r)); }
  .diag-panel { width: 100%; }
}
@media (max-width: 640px) {
  .screen-cover { padding-top: calc(12px + var(--safe-t)); }
  .cover-head { align-items: flex-start; }
  .cover-nav { gap: 0 8px; }
  .cover-nav a { font-size: 13px; padding: 8px 4px; }
  .cover-layout { margin: 8px 0 16px; gap: 14px; }
  .cover-preview { min-height: 180px; height: min(29svh, 240px); }
  .preview-frame { max-height: 100%; }
  .cover-copy h1 { font-size: clamp(30px, 10vw, 40px); }
  .cover-actions { gap: 8px; margin-top: 18px; }
  .cover-actions .btn { min-height: 56px; }
  .stage-head { gap: 6px; }
  .stage-head .brand-mark { font-size: clamp(13px, 3.5vw, 17px); white-space: nowrap; }
  .stage-head :where(.text-back, .live-timer) { flex-shrink: 0; }
  .timer-hint { display: none; }
  .stage-dock { padding: 8px 12px calc(12px + var(--safe-b)); }
  .coach-tools { gap: 4px 10px; }
  .mini-select { max-width: min(70vw, 200px); min-height: 44px; }
  .coach-copy { padding: 8px 10px; bottom: 8px; }
  .coach-copy p { font-size: 13px; }
  .coach-sub { display: none; } /* full explanation remains on the stationing screen. */
  .timeline-meta { align-items: flex-start; }
  .timeline-meta > :where(.legend, .replay-actions) { width: 100%; }
  .replay-actions { justify-content: flex-start; }
  .replay-actions .btn { flex: 1 1 calc(50% - 8px); min-width: 0; justify-content: center; align-items: center; text-align: center; }
  .replay-actions .btn-label { letter-spacing: 0; }
  .diag-panel { padding: 14px max(14px, var(--safe-l)) calc(24px + var(--safe-b)); }
  .transcript li { grid-template-columns: 3.5em minmax(0, 1fr); }
  .page-head, .page-body { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
  .page-head { gap: 6px; }
  .page-head .head-spacer { min-width: 64px; }
  .consent-veil { padding: max(8px, var(--safe-t)) max(8px, var(--safe-r)) max(8px, var(--safe-b)) max(8px, var(--safe-l)); }
  .consent-card { padding: 18px 16px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .screen-stage .stage-wrap { min-height: 210px; }
  .screen-replay #replay-wrap { max-height: 48svh; }
  .screen-cover .cover-layout { align-items: start; }
  .screen-cover .cover-preview { min-height: 200px; }
  .stage-dock { flex-wrap: wrap; }
  .diag-panel { max-height: none; }
}

/* 入口工作台：内容由文档流撑开，通知不参与舞台叠层。 */
.screen-cover { gap: 20px; }
.screen-cover .cover-head, .screen-cover .cover-layout, .screen-cover .cover-foot, .screen-cover .whats-new { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; }
.screen-cover .cover-head { flex-wrap: nowrap; align-items: center; }
.screen-cover .brand-mark { white-space: nowrap; }
.screen-cover .cover-nav { width: auto; flex-wrap: nowrap; gap: 18px; align-items: center; }
.cover-nav summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.nav-more { position: relative; }
.nav-more summary::after { content: "⌄"; margin-left: 6px; }
.nav-more-links { position: absolute; right: 0; top: 100%; z-index: 20; width: 180px; display: grid; padding: 8px 14px; background: var(--paper-soft); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); }
.screen-cover .cover-layout { flex: 1 0 auto; min-height: auto; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto; gap: 64px; align-items: center; margin-top: 24px; margin-bottom: 24px; }
.screen-cover .cover-copy { max-width: 560px; }
.screen-cover .cover-copy h1 { font-size: clamp(38px, 4.7vw, 64px); line-height: 1.2; letter-spacing: .02em; }
.screen-cover .cover-copy .lead { font-size: 17px; margin-top: 18px; }
.screen-cover .cover-actions { flex-direction: row; flex-wrap: nowrap; gap: 12px; margin-top: 26px; }
.screen-cover .cover-actions .btn { flex: 1; width: auto; min-height: 88px; align-items: flex-start; padding: 16px 20px; }
.screen-cover .cover-note { display: block; margin: 12px 0 24px; font-size: 12px; }
.screen-cover .local-import, .screen-cover .start-guide { max-width: none; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; font-size: 14px; }
.screen-cover summary { cursor: pointer; }
.local-import summary, .start-guide summary { padding: 13px 0; min-height: 48px; color: var(--ink-soft); }
.local-import summary span { float: right; }
.entry-detail-body { padding: 0 0 18px; line-height: 1.7; color: var(--ink-soft); }
.entry-detail-body p + p { margin-top: 8px; }
.local-import input { width: 100%; padding: 8px 0; }
.entry-preview { align-self: center; padding: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-soft); }
.entry-preview h2 { font: 500 25px/1.5 var(--serif); }
.entry-steps { list-style: none; margin: 26px 0; display: grid; gap: 22px; }
.entry-steps li { display: flex; gap: 18px; align-items: baseline; }
.entry-steps li > span { font: 22px var(--serif); color: var(--cinnabar); }
.entry-steps strong { font-weight: 600; font-size: 16px; }
.entry-steps p { font-size: 13px; color: var(--ink-faint); margin-top: 4px; }
.entry-example { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-faint); font-size: 12px; line-height: 1.7; }
.screen-cover .whats-new { position: static; flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 8px 12px; margin-top: 0; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--paper-soft); }
.whats-new > span { flex: 1; }
.screen-cover .cover-foot { flex: 0 0 auto; padding-bottom: 8px; }
/* 舞台层级：图像 0–2，骨架 3，文字 5；文字不拦截操作。 */
.hud-left, .hud-flags, .hud-fillers, .hud-caption, .coach-copy, .speech-banner { z-index: 5; }
.hud-caption { background: rgba(20,16,12,.88); border-radius: 6px; padding: 8px; font-size: 14px; }
.hud-flags { top: 64px; max-width: 46%; }
.hud-fillers { top: auto; bottom: 92px; transform: translateX(-50%); }
.filler-flash { font-size: clamp(20px, 4vw, 30px); }
.stage-dock .dock-note { max-width: 640px; text-align: center; line-height: 1.6; }
.modal-card, .consent-card { position: relative; flex-shrink: 1; }
.consent-card { display: flex; flex-direction: column; overflow: visible; max-height: calc(100dvh - 48px); }
.consent-card > .eyebrow, .consent-card > h2, .consent-actions { flex: 0 0 auto; }
.consent-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; }
.consent-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.consent-actions .btn { min-height: 52px; width: 100%; }
.stage-dock .demo-source, .timeline-dock .demo-source { position: static; flex-basis: 100%; background: none; padding: 0; color: #d8cfc0; font-size: 11px; }
.stage-dock { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.stage-dock > * { min-width: 0; max-width: 100%; }
.stage-dock .demo-source { width: 100%; text-align: center; }
.stage-dock .dock-note { color: #d8cfc0; }
#btn-skip-demo:not(:disabled) { color: #f3eee4; }
.update-bar { position: static; transform: none; flex: 0 0 auto; align-self: center; justify-content: center; flex-wrap: wrap; border-radius: 6px; max-width: 100%; }
#app:has(#screen-cover[hidden]) > .update-bar,
body:has(.consent-veil:not([hidden])) .update-bar,
body:has(.modal:not([hidden])) .update-bar { display: none; }
@media (max-height: 500px) { .consent-card { padding: 14px 20px; } .consent-card > .eyebrow { display: none; } .consent-card > h2 { font-size: 22px; margin: 0 0 8px; } }
@media (max-width: 900px) {
  .screen-cover .cover-layout { gap: 28px; }
  .entry-preview { padding: 24px; }
}
@media (max-width: 600px) {
  .screen-cover { gap: 10px; padding-left: 20px; padding-right: 20px; }
  .screen-cover .cover-head { flex-wrap: wrap; gap: 2px; }
  .screen-cover .cover-nav { gap: 18px; font-size: 13px; }
  .screen-cover .cover-nav a { padding: 4px 0; }
  .screen-cover .cover-layout { display: flex; flex-direction: column; align-items: stretch; margin-top: 12px; gap: 24px; }
  .screen-cover .cover-copy h1 { font-size: 40px; }
  .screen-cover .cover-copy .lead { font-size: 15px; margin-top: 14px; }
  .screen-cover .cover-actions { margin-top: 22px; gap: 8px; }
  .screen-cover .cover-actions .btn { min-height: 82px; padding: 14px 12px; }
  .screen-cover .cover-actions .btn-label { font-size: 18px; }
  .screen-cover .cover-actions .btn-kicker { font-size: 10px; letter-spacing: 0; }
  .entry-preview { width: 100%; }
  .entry-preview h2 { font-size: 22px; }
  .entry-steps { margin: 20px 0; gap: 16px; }
  .hud-flags { top: 58px; right: 6px; }
  .flag-chip { font-size: 11px; padding: 3px 6px; }
  .hud-caption { left: 6px; right: 6px; bottom: 6px; font-size: 12px; letter-spacing: 0; }
  .stage-dock .dock-note { font-size: 12px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .screen-cover .cover-layout { margin-top: 0; gap: 28px; align-items: start; }
  .screen-cover .cover-copy h1 { font-size: 32px; }
  .screen-cover .cover-copy .lead { margin-top: 8px; font-size: 14px; }
  .screen-cover .cover-actions { margin-top: 12px; }
  .screen-cover .cover-actions .btn { min-height: 70px; padding: 10px; }
  .entry-preview { padding: 20px; }
}
