/*
 * TT Phase 1.5 Precision Acoustic Instrument & Four-Beat Anti-Rush Stylesheet (Buildless Pure CSS)
 * Theme A (default): Obsidian Night (#0B0F19)
 * Theme B: Cold-White Medical Atlas (#F8FAFC)
 * Iron Rules: 0 Emoji, 0 Neon Green, 0 Glaring White Plaster, 0 <12px font, explicit property transitions only.
 */

:root,
[data-theme="obsidian"] {
  --bg-page: #0B0F19;
  --bg-panel: #111827;
  --bg-elevated: #172135;
  --bg-control: #1E293B;
  --bg-key-natural: #22304C;
  --bg-frosted-card: rgba(13, 19, 33, 0.88);
  --bg-hero-grad: linear-gradient(145deg, rgba(200, 164, 93, 0.19) 0%, rgba(23, 33, 53, 0.86) 58%, rgba(17, 24, 39, 0.94) 100%);
  --border-subtle: rgba(200, 164, 93, 0.20);
  --border-strong: rgba(230, 199, 134, 0.58);
  --hairline-divider: rgba(203, 213, 225, 0.10);
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --slate-calm-text: #CBD5E1;
  --slate-calm-bg: rgba(148, 163, 184, 0.16);
  --slate-calm-border: rgba(148, 163, 184, 0.36);
  --gold-primary: #E6C786;
  --gold-accent: #C8A45D;
  --gold-bar-grad: linear-gradient(90deg, #B89146 0%, #E6C786 100%);
  --gold-soft-bg: rgba(200, 164, 93, 0.16);
  --gold-pass-bg: rgba(200, 164, 93, 0.08);
  --ice-blue: #7DD3FC;
  --ice-soft-bg: rgba(125, 211, 252, 0.15);
  --cinnabar: #DC2626;
  --cinnabar-deep: #B91C1C;
  --cinnabar-soft-bg: rgba(185, 28, 28, 0.22);
  --shadow-panel: 0 10px 28px rgba(0, 0, 0, 0.44);
  --shadow-center-card: 0 14px 36px rgba(0, 0, 0, 0.55);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

[data-theme="atlas"] {
  --bg-page: #F8FAFC;
  --bg-panel: #F1F5F9;
  --bg-elevated: #E7EEF6;
  --bg-control: #DCE5F0;
  --bg-key-natural: #F8FAFC;
  --bg-frosted-card: rgba(241, 245, 249, 0.92);
  --bg-hero-grad: linear-gradient(145deg, rgba(200, 164, 93, 0.20) 0%, rgba(231, 238, 246, 0.92) 65%, rgba(241, 245, 249, 0.98) 100%);
  --border-subtle: rgba(100, 116, 139, 0.22);
  --border-strong: #8C6A28;
  --hairline-divider: rgba(15, 23, 42, 0.09);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #475569;
  --slate-calm-text: #334155;
  --slate-calm-bg: rgba(71, 85, 105, 0.11);
  --slate-calm-border: rgba(71, 85, 105, 0.30);
  --gold-primary: #785716;
  --gold-accent: #9A742B;
  --gold-bar-grad: linear-gradient(90deg, #9A742B 0%, #785716 100%);
  --gold-soft-bg: rgba(200, 164, 93, 0.18);
  --gold-pass-bg: rgba(200, 164, 93, 0.09);
  --ice-blue: #0284C7;
  --ice-soft-bg: rgba(2, 132, 199, 0.13);
  --cinnabar: #B91C1C;
  --cinnabar-deep: #991B1B;
  --cinnabar-soft-bg: rgba(185, 28, 28, 0.12);
  --shadow-panel: 0 8px 22px rgba(15, 23, 42, 0.07);
  --shadow-center-card: 0 12px 28px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
select,
input {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
}

button {
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-control);
  border-radius: var(--radius-sm);
  transition: transform 40ms ease-out, background-color 140ms ease, border-color 140ms ease, box-shadow 180ms ease, opacity 140ms ease;
  user-select: none;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-accent);
  outline-offset: 1px;
}

/* Single-Viewport App Shell */
.app-shell {
  width: 100%;
  max-width: 1120px;
  height: 100dvh;
  margin: 0 auto;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Minimalist Instrument Top Bar */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 10px;
  background-color: var(--bg-panel);
  border-radius: var(--radius-md);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.mic-dot.is-live {
  background-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-accent);
}

.mic-dot.is-strained {
  background-color: var(--cinnabar);
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.calib-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background-color: var(--gold-soft-bg);
  border: 1px solid var(--border-strong);
  color: var(--gold-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 198px;
  font-variant-numeric: tabular-nums;
}

.calib-pill:not(.is-calibrated)::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-accent);
  flex-shrink: 0;
}

.calib-pill.is-calibrated {
  background-color: var(--bg-elevated);
  border-color: transparent;
  color: var(--text-secondary);
  font-weight: 600;
}

.ghost-btn {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.ghost-btn.is-active {
  border-color: var(--border-strong);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
}

/* Primary Mirror Stage (>= 74% Viewport Height Guaranteed) */
.stage-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
  background-color: var(--bg-panel);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-page);
}

#anatomy-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes amberPulse {
  0%, 100% {
    opacity: 0.95;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.84);
  }
}

/* KTV Anti-Rush Traffic Light Capsule (0 Neon Green: Calm Slate -> Ice Blue -> Breathe -> Warm Amber Gold) */
.traffic-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.traffic-pill.is-idle {
  background-color: var(--slate-calm-bg);
  color: var(--text-muted);
}

.traffic-pill.is-read {
  background-color: var(--slate-calm-bg);
  border-color: var(--slate-calm-border);
  color: var(--slate-calm-text);
}

.traffic-pill.is-listen {
  background-color: var(--ice-soft-bg);
  border-color: var(--ice-blue);
  color: var(--ice-blue);
}

.traffic-pill.is-breathe {
  background-color: var(--slate-calm-bg);
  border-color: var(--border-subtle);
  color: var(--gold-primary);
}

.traffic-pill.is-sing {
  background-color: var(--gold-soft-bg);
  border-color: var(--border-strong);
  color: var(--gold-primary);
}

.traffic-pill.is-rest {
  background-color: var(--gold-pass-bg);
  border-color: var(--border-subtle);
  color: var(--gold-primary);
}

/* Persistent Top Stage Command Plate (2-Row Anti-Rush Layout: Meta/Traffic + Large Constant Target Vowel) */
.stage-coach-banner {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 10px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-frosted-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-bottom-width: 1.5px;
  pointer-events: none;
  min-width: 0;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stage-coach-banner[hidden] {
  display: none !important;
}

.banner-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.banner-step-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stage-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-muted);
  opacity: 0.45;
  flex-shrink: 0;
}

.seq-dots-inline {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-primary);
  white-space: nowrap;
}

.seq-dots-inline[hidden] {
  display: none !important;
}

.stage-coach-banner.is-listening {
  border-color: var(--border-strong);
  border-bottom-color: var(--gold-primary);
  box-shadow: 0 4px 18px rgba(200, 164, 93, 0.22);
}

.stage-coach-banner.is-listening .stage-live-dot {
  background-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-accent);
  opacity: 1;
  animation: amberPulse 1.4s ease-in-out infinite;
}

.stage-coach-banner.is-listen-demo {
  border-bottom-color: var(--ice-blue);
}

.stage-coach-banner.is-listen-demo .stage-live-dot {
  background-color: var(--ice-blue);
  opacity: 0.9;
}

.stage-coach-banner.is-clear {
  background-color: var(--gold-soft-bg);
  border-color: var(--border-strong);
  box-shadow: 0 0 16px rgba(230, 199, 134, 0.28);
}

.stage-banner-step {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-primary);
  background-color: var(--gold-soft-bg);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stage-banner-prompt {
  width: 100%;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.28;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-coach-banner.is-listening .stage-banner-prompt {
  color: var(--gold-primary);
}

/* Center-Stage Frosted Glass Stage Announcement Card (Visible across READ + LISTEN) */
.stage-center-card {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: min(88%, 376px);
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-frosted-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-center-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.stage-center-card[hidden] {
  display: none !important;
}

.center-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.center-card-step {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gold-primary);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--gold-soft-bg);
  font-variant-numeric: tabular-nums;
}

.center-card-prompt {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.32;
  color: var(--text-primary);
}

.center-card-subtip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .center-card-prompt {
    font-size: 23px;
  }
}

/* 1-Second Manual Sample Feed Capsule at Bottom-Center of Mirror Stage */
.quick-evolve-bar {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: calc(100% - 16px);
}

.quick-flag-btn {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background-color: var(--bg-frosted-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.quick-flag-btn:hover {
  border-color: var(--border-strong);
  color: var(--gold-primary);
}

.evolve-toast-pill {
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  border-radius: var(--radius-md);
  background-color: var(--bg-frosted-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  color: var(--gold-primary);
  max-width: 100%;
  white-space: normal;
}

.evolve-toast-pill[hidden] {
  display: none !important;
}

/* Floating <=8-Char Single-Practice Prompt Pill */
.audition-prompt-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  background-color: var(--bg-frosted-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--border-strong);
  pointer-events: none;
  white-space: nowrap;
}

.audition-prompt-pill[hidden] {
  display: none !important;
}

.audition-prompt-pill.is-leak {
  color: var(--ice-blue);
  background-color: var(--ice-soft-bg);
  border-bottom-color: var(--ice-blue);
}

.audition-prompt-pill.is-hit {
  color: var(--gold-primary);
  background-color: var(--gold-soft-bg);
  border-bottom-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(230, 199, 134, 0.28);
}

.audition-prompt-pill.is-strain {
  color: var(--cinnabar);
  background-color: var(--cinnabar-soft-bg);
  border-bottom-color: var(--cinnabar);
}

/* Compact Single-Row Live Note & Cue Readout Bar */
.pitch-rail-card {
  flex: 0 0 auto;
  padding: 4px 10px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.pitch-readout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.note-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.note-main {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
}

.solfege-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-control);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.state-cue {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  background-color: var(--gold-soft-bg);
  white-space: nowrap;
}

.state-cue.is-locked {
  box-shadow: 0 0 10px rgba(230, 199, 134, 0.34);
}

.state-cue.is-leak {
  color: var(--ice-blue);
  background-color: var(--ice-soft-bg);
}

.state-cue.is-strain {
  color: var(--cinnabar);
  background-color: var(--cinnabar-soft-bg);
}

.cents-readout {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 3-State Bottom Control Dock (Strictly <= 98px height) */
.bottom-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 8px;
  background-color: var(--bg-panel);
  border-radius: var(--radius-md);
  transition: box-shadow 220ms ease;
}

.bottom-dock.is-celebrating {
  box-shadow: 0 0 20px rgba(230, 199, 134, 0.38);
}

.dock-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.dock-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.dock-tab-btn {
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid transparent;
  white-space: nowrap;
}

.dock-tab-btn.is-active {
  background-color: var(--gold-soft-bg);
  border-color: var(--border-strong);
  color: var(--gold-primary);
}

/* Mode 1: One-Click Auto-Guided 5-Stage Strip */
.guide-capsule,
.piano-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 34px;
}

.guide-idle-bar,
.guide-running-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.guide-idle-bar[hidden],
.guide-running-bar[hidden],
.audition-strip[hidden],
.guide-capsule[hidden],
.piano-strip[hidden] {
  display: none !important;
}

.stage-dots-row {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.stage-dot {
  width: 22px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background-color: var(--bg-elevated);
  border: 1px solid transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.stage-dot.is-done {
  color: var(--gold-primary);
  background-color: var(--gold-pass-bg);
}

.stage-dot.is-current {
  background-color: var(--gold-soft-bg);
  border-color: var(--border-strong);
  color: var(--gold-primary);
}

.auto-start-cta {
  flex: 1 1 auto;
  height: 34px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 800;
  background-color: var(--gold-accent);
  border-color: var(--gold-primary);
  color: #0B0F19;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="atlas"] .auto-start-cta {
  color: #F8FAFC;
  background-color: #8C6A28;
  border-color: #785716;
}

.compact-aux-btn {
  padding: 4px 7px;
  font-size: 12px;
  flex-shrink: 0;
}

/* Mode 2: 4 Instant Single-Practice Capsules */
.audition-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.audition-card {
  height: 34px;
  padding: 2px 3px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.audition-card.is-selected {
  border-color: var(--border-strong);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
}

.audition-card.is-hit-ice {
  border-color: var(--ice-blue);
  background-color: var(--ice-soft-bg);
  color: var(--ice-blue);
}

.audition-card.is-hit-gold {
  border-color: var(--gold-primary);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(230, 199, 134, 0.25);
}

.audition-card.is-hit-strain {
  border-color: var(--cinnabar);
  background-color: var(--cinnabar-soft-bg);
  color: var(--cinnabar);
}

.progress-ring {
  flex: 0 0 24px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--bg-control);
  stroke-width: 2.6;
}

.ring-fill {
  fill: none;
  stroke: var(--gold-primary);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
  transition: stroke-dashoffset 80ms linear;
}

.guide-goal-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-mic-btn {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background-color: var(--gold-soft-bg);
  border: 1px solid var(--border-strong);
  color: var(--gold-primary);
  white-space: nowrap;
}

.primary-mic-btn.is-live {
  background-color: var(--gold-accent);
  color: #0B0F19;
}

[data-theme="atlas"] .primary-mic-btn.is-live {
  color: #F8FAFC;
}

/* High-Contrast Solid Gold CTA vs Clean Ghost Secondary */
.btn-gold-solid {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md);
  background-color: var(--gold-accent);
  border: 1px solid var(--gold-primary);
  color: #0B0F19;
  white-space: nowrap;
}

[data-theme="atlas"] .btn-gold-solid {
  background-color: #8C6A28;
  border-color: #785716;
  color: #F8FAFC;
}

.calib-main-cta {
  height: 44px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.btn-ghost-clean {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  border: 1px solid transparent;
  color: var(--text-secondary);
  white-space: nowrap;
}

.calib-corner-skip-btn {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.calib-corner-skip-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.compact-close-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.full-btn {
  width: 100%;
}

.flex-1-btn {
  flex: 1 1 0;
}

/* Single-Row Piano Strip */
.piano-keys-grid {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}

.piano-key {
  height: 34px;
  padding: 2px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-key-natural);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  min-width: 0;
}

.piano-key.is-target {
  border-color: var(--border-strong);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
}

.key-solfege {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.key-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 410px) {
  .key-note {
    display: none;
  }
}

/* Modals & Unified Bottom Drawer */
.overlay-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(8, 12, 21, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

.overlay-drawer[hidden] {
  display: none !important;
}

.drawer-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================================================
   Frameless Oura-Inspired 【我的声音长板名片】 (Zero Nested 1px Wireframe Boxes)
   ========================================================================= */
.hero-strength-card {
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-hero-grad);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hero-main-strength {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--gold-primary);
  line-height: 1.25;
}

.victory-subline {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tag-row,
.stage-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row:empty {
  display: none;
}

.strength-tag {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
}

.stage-chip {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background-color: var(--bg-elevated);
  border: none;
  color: var(--text-secondary);
}

.stage-chip.is-done {
  color: var(--gold-primary);
  background-color: var(--gold-pass-bg);
}

.stage-chip.is-current {
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
}

.pillars-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 2px 4px;
}

.pillar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pillar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pillar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pillar-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.pillar-bar-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-elevated);
  overflow: hidden;
}

.pillar-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gold-bar-grad);
  transition: width 220ms ease;
}

.highlights-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.highlights-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 2px;
}

.highlights-list {
  display: flex;
  flex-direction: column;
}

.highlight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px;
  font-size: 12px;
  border-top: 1px solid var(--hairline-divider);
  color: var(--text-secondary);
}

.highlight-row:first-child {
  border-top: none;
}

.hl-stage {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 56px;
}

.hl-desc {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hl-note-pill {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Calibration Wizard & Settings Elements */
.section-head,
.motto-header,
.calib-preset-bar,
.calib-step-head,
.calib-meter-row,
.calib-subtip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calib-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.calib-intro-desc {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
}

.calib-preset-route {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.calib-step-card {
  padding: 13px 14px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.calib-step-card.is-sing {
  border-color: var(--border-strong);
  box-shadow: 0 4px 18px rgba(200, 164, 93, 0.18);
}

.calib-step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.calib-prompt-line {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.32;
  color: var(--gold-primary);
  min-height: 24px;
}

.calib-step-subtip {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.calib-live-note {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
}

.calib-progress-track {
  flex: 1 1 auto;
  height: 6px;
  background-color: var(--bg-page);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.calib-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-bar-grad);
  transition: width 80ms linear;
}

.calib-vitality-track {
  width: 100%;
  height: 4px;
  background-color: var(--bg-page);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.calib-vitality-fill {
  height: 100%;
  width: 0%;
  background-color: var(--ice-blue);
  transition: width 60ms linear;
}

.calib-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.calib-summary-item {
  padding: 7px 9px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.consent-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
}

.consent-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--gold-accent);
  cursor: pointer;
}

.consent-label-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

.evolve-drawer-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--hairline-divider);
}

.corpus-stats-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

.calib-actions-row[hidden],
#calib-skip-high-btn[hidden],
#calib-skip-start-btn[hidden] {
  display: none !important;
}

.drawer-tabs,
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drawer-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-pane[hidden] {
  display: none !important;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.motto-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
}

.snapshot-feedback {
  font-size: 12px;
  color: var(--gold-primary);
  min-height: 18px;
}

.tuning-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.compact-select {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

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

.telemetry-cell {
  padding: 6px 8px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-label {
  font-size: 12px;
  color: var(--text-muted);
}

.telemetry-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold-accent);
}

/* =========================================================================
   Phase 1.6 Share Result Block & Frameless In-App Anti-Denoise Guard Overlay
   (Strictly 0 Emoji, 0 Neon Green, 0 Nested Wireframe Boxes, >=12px, Explicit Transitions)
   ========================================================================= */
.victory-share-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.btn-share-clean {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  background-color: var(--gold-soft-bg);
  border: 1px solid var(--border-strong);
  color: var(--gold-primary);
  white-space: nowrap;
}

.btn-share-clean:hover {
  background-color: var(--bg-elevated);
}

.share-feedback-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-primary);
  text-align: center;
  line-height: 1.35;
}

.share-feedback-line[hidden] {
  display: none !important;
}

@keyframes amberArrowFloat {
  0%, 100% {
    opacity: 0.96;
    transform: translate(0, 0);
  }
  50% {
    opacity: 0.62;
    transform: translate(3px, -4px);
  }
}

.inapp-guard-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background-color: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

[data-theme="atlas"] .inapp-guard-overlay {
  background-color: rgba(248, 250, 252, 0.94);
}

.inapp-guard-overlay[hidden] {
  display: none !important;
}

.inapp-guard-pointer {
  position: fixed;
  top: 10px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}

.inapp-menu-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--gold-soft-bg);
  color: var(--gold-primary);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  box-shadow: 0 0 16px rgba(200, 164, 93, 0.28);
}

.inapp-arrow-svg {
  display: block;
  margin-right: 6px;
  color: var(--gold-primary);
  filter: drop-shadow(0 0 8px rgba(200, 164, 93, 0.34));
  animation: amberArrowFloat 2.2s ease-in-out infinite;
}

.inapp-arrow-svg .arrow-stop-tail {
  stop-color: var(--gold-accent);
}

.inapp-arrow-svg .arrow-stop-mid,
.inapp-arrow-svg .arrow-stop-tip {
  stop-color: var(--gold-primary);
}

.inapp-guard-sheet {
  width: 100%;
  max-width: 420px;
  margin-top: 44px;
  padding: 20px 18px 18px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-panel);
  border-top: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-center-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inapp-guard-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inapp-guard-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ice-blue);
  box-shadow: 0 0 8px var(--ice-blue);
  flex-shrink: 0;
}

.inapp-guard-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--ice-blue);
  letter-spacing: 0.03em;
}

.inapp-guard-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.32;
  color: var(--text-primary);
}

.inapp-guard-reason {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.52;
  color: var(--text-secondary);
}

.inapp-steps-list {
  padding: 4px 14px;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  display: flex;
  flex-direction: column;
}

.inapp-step-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
}

.inapp-step-row + .inapp-step-row {
  border-top: 1px solid var(--hairline-divider);
}

.inapp-step-num {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.inapp-step-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}

.inapp-guard-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.inapp-copy-btn {
  height: 44px;
  font-size: 14px;
  white-space: normal;
  line-height: 1.25;
}

.inapp-escape-btn {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: center;
}

.inapp-escape-btn:hover {
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .inapp-arrow-svg,
  .stage-coach-banner.is-listening .stage-live-dot {
    animation: none;
  }
}
