:root {
  color-scheme: light;
  --ink: #111827;
  --ink-soft: #263244;
  --muted: #667085;
  --paper: #f4f6f9;
  --panel: #ffffff;
  --subpanel: #f6f8fb;
  --tile: #fbfcff;
  --secondary-bg: #eef2f6;
  --guide-bg: #eef4fb;
  --pass-bg: #edf8f5;
  --warn-bg: #fff8eb;
  --fix-bg: #fff1f2;
  --line: #d9dee8;
  --accent: #0a6f66;
  --accent-strong: #084f49;
  --accent-soft: #e4f4f1;
  --signal: #365b8c;
  --warm: #9a5b13;
  --rose: #be123c;
  --nav: #101828;
  --wash-top: rgba(255, 255, 255, 0.74);
  --wash-bottom: rgba(244, 246, 249, 0.96);
  --shadow: 0 18px 44px rgba(17, 24, 39, 0.1);
  --shadow-soft: 0 8px 22px rgba(17, 24, 39, 0.07);
}

body[data-calm-color="blue"] {
  --accent: #2f6fa8;
  --accent-strong: #1f4f7a;
  --accent-soft: #e6f1fb;
  --signal: #326ba0;
}

body[data-calm-color="green"] {
  --accent: #0a6f66;
  --accent-strong: #084f49;
  --accent-soft: #e4f4f1;
  --signal: #365b8c;
}

body[data-calm-color="soft-pink"] {
  --accent: #b65f78;
  --accent-strong: #874258;
  --accent-soft: #fae8ee;
  --signal: #7560a8;
}

body[data-calm-color="lavender"] {
  --accent: #7867ad;
  --accent-strong: #574983;
  --accent-soft: #eeeaf8;
  --signal: #3d6f86;
}

body[data-calm-color="warm-neutral"] {
  --accent: #7a6648;
  --accent-strong: #594832;
  --accent-soft: #f1ebe1;
  --signal: #536b78;
}

body[data-ui-mode="dark"] {
  color-scheme: dark;
  --ink: #f5f7fb;
  --ink-soft: #d9e0eb;
  --muted: #aeb8c8;
  --paper: #05070a;
  --panel: #11161d;
  --subpanel: #0c1118;
  --tile: #151b23;
  --secondary-bg: #202a36;
  --guide-bg: #142233;
  --pass-bg: #102d28;
  --warn-bg: #302516;
  --fix-bg: #351923;
  --line: #27313f;
  --nav: #05070a;
  --wash-top: rgba(5, 7, 10, 0.94);
  --wash-bottom: rgba(8, 13, 18, 0.98);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.24);
}

body[data-ui-mode="dark"][data-calm-color="blue"] {
  --accent: #7fb5e6;
  --accent-strong: #c5e0f7;
  --accent-soft: #122a3d;
}

body[data-ui-mode="dark"][data-calm-color="green"] {
  --accent: #78c9bb;
  --accent-strong: #bdf0e6;
  --accent-soft: #102d28;
}

body[data-ui-mode="dark"][data-calm-color="soft-pink"] {
  --accent: #efadc0;
  --accent-strong: #ffd8e3;
  --accent-soft: #3a1c28;
}

body[data-ui-mode="dark"][data-calm-color="lavender"] {
  --accent: #c5b8f0;
  --accent-strong: #e6dfff;
  --accent-soft: #26213b;
}

body[data-ui-mode="dark"][data-calm-color="warm-neutral"] {
  --accent: #d4c0a0;
  --accent-strong: #f0e4cf;
  --accent-soft: #2f281d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--wash-top), var(--wash-bottom)),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.onboarding-open .app-shell,
body.onboarding-open .bottom-nav,
body.onboarding-open .auth-shell,
body.onboarding-open .subscription-shell,
body.auth-open .app-shell,
body.auth-open .bottom-nav,
body.auth-open .onboarding-shell,
body.auth-open .subscription-shell,
body.subscription-open .app-shell,
body.subscription-open .bottom-nav,
body.subscription-open .onboarding-shell,
body.subscription-open .auth-shell {
  display: none;
}

button,
textarea,
input,
select {
  font: inherit;
}

.auth-shell,
.onboarding-shell,
.subscription-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: grid;
  align-items: center;
}

.auth-shell.hidden,
.onboarding-shell.hidden,
.subscription-shell.hidden {
  display: none;
}

.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.auth-panel h1 {
  margin: 18px 0 0;
  font-size: clamp(1.9rem, 9vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.42;
}

.auth-form,
.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form {
  gap: 12px;
}

.auth-form label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 16px 0;
  padding: 5px;
  border-radius: 8px;
  background: #eef2f6;
}

.segment {
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: #fff;
  color: var(--ink);
}

.consent-line {
  align-items: flex-start;
  font-weight: 700;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 800;
}

.privacy-note {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.plan-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.plan-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.plan-card input {
  width: auto;
  min-height: auto;
}

.plan-card strong,
.plan-card small {
  display: block;
}

.plan-card small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.28;
}

.feedback-summary {
  border-color: rgba(10, 111, 102, 0.34);
  background: var(--accent-soft);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.theme-grid span {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(10, 111, 102, 0.2);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.theme-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup.compact {
  gap: 9px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(10, 111, 102, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, #0a6f66, #243b64);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.brand-mark.logo-mark {
  overflow: hidden;
  background: #121212;
  border-color: rgba(255, 190, 65, 0.48);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.14);
}

.brand-mark.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-lockup.compact .brand-mark {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}

.brand-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -16px 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(244, 246, 249, 0.94);
  border-bottom: 1px solid rgba(217, 222, 232, 0.72);
  backdrop-filter: blur(18px);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.topbar h1,
.hero-panel h2,
.coach-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 1.42rem;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero-panel,
.section-band,
.coach-card,
.control-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(10, 111, 102, 0.08), rgba(54, 91, 140, 0.08)),
    var(--panel);
}

.hero-panel.compact {
  padding: 16px;
}

.hero-panel h2 {
  font-size: clamp(1.42rem, 7vw, 2.18rem);
  line-height: 1.05;
  max-width: 15ch;
}

.hero-panel p:last-child {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.hero-metrics span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 111, 102, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: clamp(0.68rem, 2.8vw, 0.78rem);
  font-weight: 900;
}

.field-label,
.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.field-label {
  display: block;
  margin: 6px 0;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  padding: 13px;
  resize: vertical;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

.button-row,
.reader-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}

.reader-timing-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

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

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.nav-button:active {
  transform: translateY(1px);
}

.secondary-button,
.icon-button {
  background: var(--secondary-bg);
  color: var(--ink);
}

.guided-path-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid rgba(54, 91, 140, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: var(--guide-bg);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.guided-path-banner.hidden {
  display: none;
}

.next-step-guide {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid rgba(40, 128, 116, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: var(--pass-bg);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.next-step-guide.hidden {
  display: none;
}

.actor-flow-rail {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid rgba(38, 76, 118, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-bg);
  box-shadow: var(--soft-shadow);
}

.actor-flow-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.actor-flow-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(86px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.actor-flow-step {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid rgba(38, 76, 118, 0.16);
  border-radius: 8px;
  padding: 8px;
  background: var(--secondary-bg);
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

.actor-flow-step strong {
  font-size: 0.76rem;
  line-height: 1.1;
}

.actor-flow-step span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.actor-flow-step.status-pass {
  border-color: rgba(40, 128, 116, 0.38);
  background: var(--pass-bg);
}

.actor-flow-step.status-warn {
  border-color: rgba(195, 140, 45, 0.38);
  background: var(--warn-bg);
}

.actor-flow-step.status-fix {
  border-color: rgba(176, 73, 80, 0.34);
  background: var(--fix-bg);
}

.actor-flow-step.current {
  outline: 2px solid rgba(38, 76, 118, 0.24);
  outline-offset: 1px;
}

.coach-route-prompt {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(54, 91, 140, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: var(--guide-bg);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.coach-route-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.secondary-button.small {
  min-height: 38px;
  padding: 0 12px;
}

.section-band {
  margin-top: 16px;
  padding: 15px;
}

.start-flow-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(10, 111, 102, 0.22);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.start-flow-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.start-flow-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.18rem;
}

.start-flow-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.simple-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.simple-flow-step {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
}

.simple-flow-step strong {
  font-size: 0.78rem;
  line-height: 1.15;
}

.simple-flow-step small {
  color: var(--muted);
  font-weight: 800;
}

.simple-flow-step.status-pass {
  border-color: rgba(10, 111, 102, 0.34);
  background: var(--pass-bg);
}

.simple-flow-step.status-warn,
.simple-flow-step.current {
  border-color: rgba(154, 91, 19, 0.32);
  background: var(--warn-bg);
}

.simple-flow-step.status-fix {
  border-color: rgba(190, 18, 60, 0.24);
  background: var(--fix-bg);
}

.guided-focus-pulse {
  outline: 3px solid rgba(255, 190, 65, 0.7);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(255, 190, 65, 0.16), var(--shadow-soft);
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.simple-upload-zone,
.simple-paste-box,
.start-flow-panel,
.actor-flow-rail,
.section-band,
.control-panel,
.coach-card {
  scroll-margin-top: 86px;
  scroll-margin-bottom: 112px;
}

.simple-start-actions,
.simple-upload-zone {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.simple-upload-zone {
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.simple-upload-zone label,
.simple-paste-box {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.simple-paste-box {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.simple-paste-box summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 900;
}

.simple-paste-box textarea {
  margin-top: 10px;
}

.advanced-tools {
  margin-top: 16px;
}

.advanced-tools > summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--secondary-bg);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.advanced-tools > summary small {
  color: var(--muted);
  font-weight: 800;
}

.advanced-tools-body {
  margin-top: 12px;
}

.section-band h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--ink-soft);
}

.mission-grid,
.profile-list,
.notes-list,
.checklist,
.platform-list,
.setup-grid,
.feature-grid {
  display: grid;
  gap: 10px;
}

.inner-band {
  margin-top: 14px;
  background: var(--subpanel);
}

.theme-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--tile);
}

.theme-preview span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset 0 0 0 5px var(--accent-soft);
}

.theme-preview small {
  color: var(--muted);
  font-weight: 750;
}

.avatar-shell {
  display: grid;
  gap: 10px;
}

.avatar-video-frame {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101821;
}

.avatar-loading .avatar-video-frame {
  border-color: var(--accent);
}

.avatar-speaking .avatar-video-frame {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.avatar-video-frame video,
.avatar-placeholder {
  width: 100%;
  min-height: 220px;
}

.avatar-video-frame video {
  display: block;
  object-fit: cover;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 6px;
  padding: 14px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(16, 24, 33, 0.22), rgba(16, 24, 33, 0.9)),
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.18), transparent 32%),
    #182430;
  background-size: cover;
  background-position: center;
}

.avatar-placeholder strong {
  font-size: 1.1rem;
}

.avatar-placeholder span,
.avatar-meta span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.avatar-placeholder span {
  color: rgba(255, 255, 255, 0.78);
}

.avatar-meta {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tile);
}

.feature-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

.feature-toggle input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
}

.feature-toggle strong,
.feature-toggle small {
  display: block;
}

.feature-toggle small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.compact-mode-toggle {
  margin-bottom: 8px;
}

.info-tile,
.check-item,
.platform-item,
.note-item,
.toggle-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--tile);
}

.info-tile {
  border-left: 3px solid rgba(10, 111, 102, 0.42);
}

.status-pass {
  border-color: #b7e4d5;
  background: var(--pass-bg);
}

.status-warn {
  border-color: #f6d59a;
  background: var(--warn-bg);
}

.status-fix {
  border-color: #fecdd3;
  background: var(--fix-bg);
}

.compact-checklist .check-item {
  border-left: 3px solid rgba(10, 111, 102, 0.42);
}

.final-fix-queue {
  margin-top: 10px;
}

.final-fix-head {
  border-color: rgba(54, 91, 140, 0.28);
  background: var(--guide-bg);
}

.take-item {
  display: grid;
  gap: 5px;
}

.take-item span,
.take-item small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.3;
}

.cue-card {
  font-size: 1rem;
  line-height: 1.35;
}

.cue-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}

.minimal-cue {
  font-size: 0.94rem;
}

.large-cue {
  font-size: 1.14rem;
}

.take-item.selected-take {
  border-color: #8ad7c3;
  background: #edf8f5;
  box-shadow: inset 3px 0 0 var(--accent);
}

.info-tile strong,
.platform-item strong {
  display: block;
  margin-bottom: 4px;
}

.info-tile span,
.platform-item span,
.note-item,
.check-item {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.platform-button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  color: var(--ink);
  text-align: left;
}

.platform-button img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
}

.platform-button small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.platform-button .platform-save-state {
  margin-top: 6px;
  color: var(--ink);
}

.platform-button.status-pass {
  border-color: rgba(22, 163, 74, 0.34);
}

.platform-button.status-warn {
  border-color: rgba(217, 119, 6, 0.34);
}

.platform-button.status-fix {
  border-color: rgba(220, 38, 38, 0.28);
}

.toggle-card {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.toggle-card label,
.save-option,
.slider-stack label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.toggle-card input,
.save-option input {
  width: auto;
  min-height: auto;
}

.toggle-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.slider-stack {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}

.slider-stack input {
  min-height: auto;
  padding: 0;
}

.muted-stack {
  opacity: 0.55;
}

.muted-stack.active {
  opacity: 1;
}

.save-option {
  justify-content: flex-start;
  margin: 8px 0 12px;
  color: var(--muted);
}

.full-width {
  width: 100%;
}

.setup-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.coach-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 340px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 14px 0;
}

.message {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.38;
}

.message.ai {
  align-self: flex-start;
  background: var(--accent-soft);
  border: 1px solid #b7e4d5;
}

.message.user {
  align-self: flex-end;
  background: #e9f0f8;
  border: 1px solid #c7d5eb;
}

.chat-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  position: sticky;
  bottom: 82px;
  background: rgba(247, 248, 251, 0.94);
  padding: 8px 0;
}

.camera-stage {
  position: relative;
  aspect-ratio: 9 / 13;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.2), rgba(17, 24, 39, 0.7)),
    #111827;
  box-shadow: var(--shadow);
}

.camera-stage.landscape-view {
  aspect-ratio: 13 / 9;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-stage.reading-active video {
  opacity: 0.18;
}

.camera-stage.reading-camera-off video {
  display: none;
}

.recording-setup-alert {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 7;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(183, 75, 43, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 244, 0.97);
  color: #4a1f12;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.16);
}

.recording-setup-alert strong {
  font-size: 0.9rem;
}

.recording-setup-alert span {
  font-size: 0.84rem;
  line-height: 1.35;
}

.reading-monitor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 4;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 48%;
  max-height: 86%;
  padding: 18px 18px 54px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -16px 30px rgba(17, 24, 39, 0.18);
  transform-origin: bottom center;
  animation: monitor-rise 180ms ease-out;
}

.camera-stage.landscape-view .reading-monitor {
  min-height: 62%;
  max-height: 92%;
}

.reading-monitor h3 {
  margin: 0;
  font-size: 1.25rem;
}

.reading-monitor .reader-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
  line-height: 1.35;
}

.reading-monitor .reader-line.user-line {
  border-color: rgba(10, 111, 102, 0.38);
  background: var(--accent-soft);
}

.reading-monitor-tab {
  position: absolute;
  z-index: 6;
  bottom: 10px;
  width: 92px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.28);
  touch-action: none;
  transition: left 180ms ease, right 180ms ease, transform 180ms ease, background 160ms ease;
}

.reading-monitor-tab::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.reading-monitor-tab.tab-left {
  left: 14px;
  right: auto;
  transform: translateX(0);
}

.reading-monitor-tab.tab-center {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.reading-monitor-tab.tab-right {
  left: auto;
  right: 14px;
  transform: translateX(0);
}

.reading-monitor-tab.dragging {
  background: var(--accent);
  transform: translateX(-50%) scale(1.04);
}

@keyframes monitor-rise {
  from {
    transform: translateY(18%);
    opacity: 0.74;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.frame-guide {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  pointer-events: none;
}

.record-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.safety-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.safety-dialog {
  width: min(100%, 420px);
  padding: 18px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fffafa;
  box-shadow: var(--shadow-strong);
}

.safety-dialog h2 {
  margin: 4px 0 8px;
  font-size: 1.24rem;
}

.safety-dialog p {
  color: var(--ink-soft);
}

.control-panel {
  margin-top: 14px;
  padding: 14px;
}

.meter-row {
  display: grid;
  grid-template-columns: 94px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.status-strip {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid #b7e4d5;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

meter {
  width: 100%;
}

#playback {
  width: 100%;
  min-height: 220px;
  border-radius: 8px;
  background: #101828;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  background: rgba(16, 24, 40, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.nav-button {
  min-height: 48px;
  padding: 4px;
  background: transparent;
  color: #cbd5e1;
  font-size: clamp(0.68rem, 2.7vw, 0.82rem);
}

.nav-button.active {
  background: #fff;
  color: var(--nav);
}

@media (max-width: 520px) {
  .start-flow-head,
  .simple-start-actions,
  .simple-upload-zone {
    grid-template-columns: 1fr;
  }

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

@media (max-height: 760px) {
  .hero-panel {
    margin-bottom: 10px;
    padding: 12px 14px;
  }

  .hero-panel h2 {
    max-width: none;
    font-size: 1.28rem;
    line-height: 1.08;
  }

  .hero-panel p {
    margin-top: 7px;
    font-size: 0.88rem;
    line-height: 1.3;
  }

  .status-pill {
    margin-bottom: 6px;
    padding: 4px 8px;
  }

  .hero-metrics {
    display: none;
  }

  .start-flow-panel {
    gap: 10px;
    margin-bottom: 116px;
    padding: 12px;
  }

  .start-flow-head {
    gap: 8px;
  }

  .start-flow-head h3 {
    font-size: 1.02rem;
  }

  .start-flow-head p:not(.eyebrow) {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.3;
  }

  .simple-flow-step {
    min-height: 44px;
    place-items: center;
    padding: 6px 4px;
    text-align: center;
  }

  .simple-flow-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .simple-flow-step small {
    display: none;
  }
}

@media (min-width: 720px) {
  body {
    background: linear-gradient(180deg, #e8eef5, #f8fafc);
  }

  .app-shell {
    padding-top: 26px;
  }
}
