/* ======================================================================
   Parley — "Afterglow"
   A warm dusk canvas with a living, glowing voice at its center. See
   DESIGN.md for the full rationale. Two typefaces: Fraunces speaks
   (the tutor's transcript, screen headlines), Manrope organizes
   (everything else).
   ====================================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin-ext.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* Dusk neutrals */
  --bg: #181320;
  --surface: #241D2C;
  --surface-sunk: #2C2436;
  --ink: #F3ECE6;
  --ink-soft: #B2A2AC;
  --ink-faint: #7C6E78;
  --hairline: rgba(243, 236, 230, .10);

  /* Afterglow accents — pulled from the hero gradient, each with a role */
  --ember: #E2637A;
  --ember-deep: #C94D66;
  --ember-soft: rgba(226, 99, 122, .24);
  --gold: #F0B860;
  --violet: #8571C4;

  /* Themes card jewel tones (deep, muted, one per category) */
  --card-rose: #3D2531;
  --card-plum: #332C4A;
  --card-moss: #2A372F;
  --card-amber: #3C3226;

  --radius-card: 20px;
  --radius-control: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, .30);
  --shadow-float: 0 16px 36px rgba(0, 0, 0, .40);

  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --scale: 1;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: calc(16px * var(--scale));
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
  color: inherit;
}

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

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
}

.hidden { display: none !important; }

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------- */
/* App shell                                                              */
/* --------------------------------------------------------------------- */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 18px 20px calc(120px + env(safe-area-inset-bottom, 0px));
}

/* Talk screen: the header stays pinned to the top; everything else (the
   voice, transcript, controls) is one "stage" group centered in the
   remaining space via auto margins. Auto-margin centering degrades safely
   to top-aligned when content is taller than the viewport (long
   transcript + score card) — unlike justify-content:center, it never
   makes the top of the content unreachable by scrolling. This is what
   keeps the idle state anchored instead of stretched, without risking the
   active state's overflow behavior. */
.screen-talk {
  justify-content: flex-start;
}

.talk-stage {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 100%;
  margin: auto 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.brand-dot {
  width: 16px;
  height: 16px;
  border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%;
  background: radial-gradient(circle at 32% 28%, var(--gold), var(--ember) 55%, var(--violet) 100%);
  flex: none;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: none;
}

.icon-btn svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------- */
/* Talk screen                                                            */
/* --------------------------------------------------------------------- */

.topic-chip {
  align-self: center;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  border: 1px solid var(--hairline);
}

.orb-wrap {
  align-self: center;
  width: 66vw;
  max-width: 300px;
  aspect-ratio: 1;
  margin: 8px auto 18px;
}

.orb-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

.status-line {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 14px;
}

.waveform-canvas {
  width: 100%;
  max-width: 220px;
  height: 24px;
  margin: 0 auto 8px;
  display: block;
}

.transcript {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 4px 0;
}

.empty-prompt {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(19px, 5.5vw, 23px);
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}

.tutor-line {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(19px, 5.5vw, 23px);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  overflow-wrap: break-word;
}

.tutor-line.streaming::after {
  content: '';
  display: inline-block;
  width: 0.4ch;
  height: 0.9em;
  margin-left: 3px;
  background: var(--ember);
  vertical-align: -0.05em;
  animation: caret-blink 1s steps(1) infinite;
}

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

.tutor-translation {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

.user-line {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.you-label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-right: 6px;
}

/* score meter — a slim horizontal bar, not another circle (the orb owns
   circular/organic shape language) */

.score-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: 10px 0;
  text-align: left;
  border: 1px solid var(--hairline);
}

.score-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  flex: none;
  min-width: 2.2ch;
}

.score-meter-track {
  flex: 1;
  min-width: 0;
}

.score-meter-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  overflow: hidden;
}

.score-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--violet), var(--ember) 55%, var(--gold));
  transition: width 0.8s ease;
}

.score-tip {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 6px 0 0;
  display: block;
}

.score-message {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  flex: 1;
}

/* controls */

.controls-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 26px;
  margin: 8px 0 10px;
}

.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.control-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
}

.control-btn svg { width: 22px; height: 22px; }

/* No session yet: End has nothing to end. Kept in the layout (so the mic
   button stays centered) but visually and functionally inert. */
.control-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

#end-control.is-disabled .control-label {
  opacity: 0.35;
}

.control-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.mic-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--gold), var(--ember) 60%, var(--violet));
  color: #1A1420;
  box-shadow: var(--shadow-float);
  transition: transform 0.15s ease;
}

.mic-btn svg { width: 27px; height: 27px; }

.mic-btn.on {
  transform: scale(1.05);
  box-shadow: 0 18px 40px rgba(226, 99, 122, .32);
}

.mic-status {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
}

.quiet-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.quiet-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 4px;
  min-height: 44px;
}

.quiet-btn svg { width: 18px; height: 18px; }

.type-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 18px;
  margin-top: 10px;
  border: 1px solid var(--hairline);
}

.type-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  padding: 10px 0;
}

.type-input::placeholder { color: var(--ink-faint); }
.type-input:focus { outline: none; }

.type-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ember);
  color: #1A1420;
  display: grid;
  place-items: center;
  flex: none;
}

.type-send svg { width: 20px; height: 20px; }

.error-card {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  text-align: center;
}

.error-card p {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

/* --------------------------------------------------------------------- */
/* Themes + Words shared bits                                             */
/* --------------------------------------------------------------------- */

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  color: var(--ink-faint);
  margin-bottom: 20px;
  border: 1px solid var(--hairline);
}

.search-pill svg { width: 19px; height: 19px; flex: none; }

.search-pill input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}

.search-pill input::placeholder { color: var(--ink-faint); }
.search-pill input:focus { outline: none; }

.screen-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--ink);
}

.screen-subtitle {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 18px;
}

.empty-note {
  color: var(--ink-soft);
  font-weight: 500;
  text-align: center;
  margin-top: 24px;
}

/* Words screen, no words saved yet: balanced vertically (auto margins,
   same technique as the Talk stage) instead of one big note stranded near
   the top with dead space below, and a clear way forward. */
.words-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: auto 0;
  padding: 12px 0;
}

.words-empty .empty-note {
  margin-top: 0;
}

/* Combined with .just-talk-pill so specificity wins regardless of source
   order, instead of relying on cascade position against that shared rule. */
.just-talk-pill.words-empty-cta {
  width: auto;
  margin-bottom: 0;
  padding: 14px 26px;
  justify-content: center;
}

/* --------------------------------------------------------------------- */
/* Themes screen                                                          */
/* --------------------------------------------------------------------- */

.just-talk-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 18px;
  text-align: left;
}

.just-talk-pill svg { width: 20px; height: 20px; }

.just-talk-arrow { margin-left: auto; color: var(--ember); }

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--hairline);
}

.chip.active {
  background: var(--ember);
  color: #1A1420;
  border-color: var(--ember);
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-card {
  border-radius: var(--radius-card);
  padding: 18px;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  /* Top-anchored, not space-between: with space-between, a card whose
     subtitle wraps to two lines pushed its icon+title noticeably higher
     than a neighbor with a one-line subtitle, so titles never lined up
     across a row. Top-anchoring keeps every icon/title at the same
     position regardless of how long the subtitle is. */
  justify-content: flex-start;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.theme-card--rose { background: var(--card-rose); }
.theme-card--plum { background: var(--card-plum); }
.theme-card--moss { background: var(--card-moss); }
.theme-card--amber { background: var(--card-amber); }

.theme-card-icon {
  color: var(--gold);
}

.theme-card-icon svg {
  width: 26px;
  height: 26px;
}

.theme-card-title {
  font-weight: 700;
  font-size: 16px;
  margin: 12px 0 3px;
}

.theme-card-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
}

/* --------------------------------------------------------------------- */
/* Words screen                                                           */
/* --------------------------------------------------------------------- */

.word-list {
  border-top: 1px solid var(--hairline);
}

.word-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  width: 100%;
}

.word-main {
  min-width: 0;
}

.word-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 2px;
}

.word-meaning {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
}

.word-sentences {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--hairline);
}

.word-sentences p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.word-sentences .no-sentences {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 500;
  color: var(--ink-faint);
}

.word-meter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.meter-segments {
  display: flex;
  gap: 4px;
}

.meter-segment {
  width: 16px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--ember-soft);
}

.meter-segment.filled { background: var(--ember); }

.meter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
}

.word-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--ember);
}

.legend-dot--1 { opacity: 0.4; }
.legend-dot--2 { opacity: 0.7; }

.word-footnote {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
  line-height: 1.5;
}

/* --------------------------------------------------------------------- */
/* Bottom nav — a flush tab bar, not a floating pill                     */
/* --------------------------------------------------------------------- */

/* A soft fade for scrollable screens so content is never seen ending
   abruptly right at the nav — content still stops well above it (see the
   screen's reserved bottom padding), this is a visual cue, not a clip. */
.nav-scrim {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  height: 36px;
  background: linear-gradient(to bottom, rgba(24, 19, 32, 0), var(--bg));
  pointer-events: none;
  z-index: 15;
}

.tab-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding: 8px calc(50% - 260px + 20px) calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
}

@media (min-width: 520px) {
  .tab-nav { padding-left: calc(50% - 260px + 20px); padding-right: calc(50% - 260px + 20px); }
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-faint);
  min-height: 44px;
}

.tab-btn svg { width: 24px; height: 24px; }

.tab-btn[aria-current="page"] {
  color: var(--ember);
}

/* --------------------------------------------------------------------- */
/* Sheets (settings / score detail)                                       */
/* --------------------------------------------------------------------- */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 13, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(28px + env(safe-area-inset-bottom, 0px));
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  margin: 6px auto 16px;
}

.sheet-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 18px;
  color: var(--ink);
}

.field-group {
  margin-bottom: 20px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.field-label {
  font-weight: 700;
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.field-hint {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
}

.field-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.field-input::placeholder { color: var(--ink-faint); }
.field-input:focus { outline: none; }

.pill-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-option {
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--hairline);
}

.pill-option.active {
  background: var(--ember);
  color: #1A1420;
  border-color: var(--ember);
}

/* 44px-tall tap target with a slimmer visual track */
.toggle {
  width: 46px;
  height: 44px;
  position: relative;
  flex: none;
}

.toggle::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  transition: background 0.2s ease;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s ease;
}

.toggle[aria-checked="true"]::before {
  background: var(--ember);
  border-color: var(--ember);
}

.toggle[aria-checked="true"]::after {
  transform: translateX(18px);
  background: #1A1420;
}

.about-block {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 22px;
}

.about-block p { margin: 0 0 8px; }

.sheet-close {
  margin-bottom: 0;
  justify-content: center;
  text-align: center;
}

.score-breakdown {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.score-metric {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
}

.score-metric-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  display: block;
  color: var(--ink);
}

.score-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: capitalize;
}

.corrections-list {
  margin-bottom: 20px;
}

.correction-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.correction-from {
  color: var(--ink-faint);
  text-decoration: line-through;
  font-size: 14px;
  font-weight: 500;
}

.correction-to {
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  margin: 2px 0 4px;
}

.correction-why {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.no-corrections {
  color: var(--ink-soft);
  font-weight: 500;
  text-align: center;
  padding: 10px 0;
}

/* --------------------------------------------------------------------- */
/* Reduced motion                                                         */
/* --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------- */
/* Small screens                                                          */
/* --------------------------------------------------------------------- */

@media (max-width: 340px) {
  .controls-row { gap: 14px; }
  .quiet-actions { gap: 12px; }
}

/* --------------------------------------------------------------------- */
/* Rotate guard — iOS Safari ignores the manifest orientation lock, so    */
/* this in-app overlay covers phones/tablets held sideways. Scoped to     */
/* coarse-pointer, no-hover devices so a landscape desktop viewport       */
/* (landscape by definition) never matches.                               */
/* --------------------------------------------------------------------- */

.rotate-guard {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}

.rotate-guard-card {
  max-width: 280px;
}

.rotate-guard-phone {
  width: 42px;
  height: 72px;
  margin: 0 auto 20px;
  border: 2px solid var(--ink-soft);
  border-radius: 10px;
  animation: rotate-guard-spin 1.8s ease-in-out infinite;
}

.rotate-guard-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 6px;
}

.rotate-guard-hint {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

@keyframes rotate-guard-spin {
  0%, 15% { transform: rotate(0deg); }
  50%, 65% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: landscape) and (pointer: coarse) and (hover: none) {
  .rotate-guard {
    display: flex;
  }
}
