/* ==========================================================================
   Harmonious — flat coffee-house interface
   Warm paper, espresso ink, caramel accents. Solid surfaces, square edges,
   thin rules and a single restrained type scale. No glass, glow or gradients.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #f3ece2;
  --bg-soft: #ece2d5;
  --surface: #fbf7f0;
  --surface-2: #f6eee3;
  --surface-3: #eaddcd;
  --sidebar: #e9ddcd;

  --border: #d7c6b1;
  --border-strong: #b7a089;
  --text: #2b211a;
  --text-soft: #46362b;
  --muted: #6f5a4a;
  --muted-2: #7c6654;

  --accent: #7b4a2e;
  --accent-hover: #623820;
  --accent-strong: #512d1a;
  --accent-soft: #ead6c1;
  --accent-ink: #fff9f1;
  --caramel: #a56b3c;
  --rust: #984b32;
  --sage: #596a55;

  --mint: var(--accent);
  --mint-bright: #8c5a3a;
  --mint-deep: #5a3420;
  --mint-ink: var(--accent-ink);
  --pink: var(--rust);
  --blue: var(--sage);

  --amber: #81531a;
  --amber-bg: #f4e7cd;
  --danger: #933b2d;
  --danger-bg: #f6e1da;
  --status-good: #4e654a;
  --status-good-bg: #e4eadf;

  --radius: 4px;
  --radius-lg: 6px;
  --radius-sm: 2px;

  --font-sans: "Avenir Next", "Segoe UI", "Cantarell", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-mono: var(--font-sans);
  --content-max: 1440px;
}

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

html {
  background: var(--bg);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open,
body.sidebar-open { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
audio { color-scheme: light; accent-color: var(--accent); }
h1, h2, h3, h4, p { margin-top: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: calc(24px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.brand-word span {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-item:hover { color: var(--text); background: rgba(123, 74, 46, 0.08); }
.nav-item.active { color: var(--accent-ink); background: var(--accent); }
.nav-icon { width: 20px; height: 20px; flex: none; opacity: 0.9; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-item span:nth-child(2) { font-size: 13.5px; font-weight: 600; }
.nav-kbd {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 9px;
  opacity: 0.65;
}
.sidebar-spacer { flex: 1; }

.sidebar-card {
  margin: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.sidebar-card p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-soft); }
.sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding: 0; }

.profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  transition: background-color 120ms ease;
}
.profile-mini:hover { background: rgba(123, 74, 46, 0.08); }
.profile-mini-text { display: flex; flex-direction: column; min-width: 0; }
.profile-mini-text strong { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini-text span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini-arrow { margin-left: auto; width: 15px; height: 15px; color: var(--muted-2); }
.local-note { display: flex; align-items: center; gap: 7px; padding: 0 6px; font-size: 10.5px; color: var(--muted); }
.local-note svg { width: 13px; height: 13px; flex: none; }
.local-note span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar-sm { width: 34px; height: 34px; font-size: 14px; }

/* ---------- Top bar & shell ---------- */
.main-wrap { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: calc(12px + env(safe-area-inset-top)) calc(clamp(18px, 3.2vw, 44px) + env(safe-area-inset-right)) 12px calc(clamp(18px, 3.2vw, 44px) + env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.icon-btn.menu-btn { display: none; }
.topbar-title-wrap { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.topbar-kicker { font-size: 10px; font-weight: 600; color: var(--muted-2); }
.topbar-title { font-size: 13px; font-weight: 650; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.streak-chip,
.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.streak-chip:hover,
.xp-chip:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.streak-chip svg { width: 14px; height: 14px; color: var(--amber); }
.streak-chip #streak-count { color: var(--text); font-weight: 700; }
.streak-label { color: var(--muted-2); }
.xp-chip { color: var(--text-soft); border-color: var(--border-strong); }
.xp-chip svg { width: 14px; height: 14px; color: var(--accent); }
.xp-chip #xp-level { color: var(--accent); font-weight: 700; }
.xp-chip .xp-rank { color: var(--muted); font-weight: 500; }
.topbar-avatar { cursor: pointer; }
.topbar-avatar:hover { background: var(--accent-hover); }

.view {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px calc(clamp(18px, 3.2vw, 44px) + env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) calc(clamp(18px, 3.2vw, 44px) + env(safe-area-inset-left));
  flex: 1;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px clamp(18px, 3.2vw, 44px) 24px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 10.5px;
}
.app-footer p { margin: 0; }
.app-footer-sub { text-align: right; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }
.sidebar-close { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(43, 33, 26, 0.52); }

/* ---------- Typography & common ---------- */
.panel-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.page-title em,
.hero h1 em,
.detail-title em,
.practice-hero-copy h1 em,
.progress-hero h1 em,
.empty-state h2 em {
  color: inherit;
  font-style: normal;
  font-weight: inherit;
}
.page-lede { max-width: 680px; margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.view-header { margin-bottom: 24px; }
.view-header.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.view-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 12px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.section-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.section-link:hover { text-decoration-color: currentColor; }
.section-link svg { width: 13px; height: 13px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.micro { font-size: 10.5px; color: var(--muted-2); }
.mono { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-mint { color: var(--accent); }
.text-pink { color: var(--rust); }
.text-amber { color: var(--amber); }
.text-danger { color: var(--danger); }
.align-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Surfaces ---------- */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.card-pad { padding: clamp(18px, 2.4vw, 24px); }
.card-quiet { background: var(--surface-2); border-color: transparent; }
.card-glow { background: var(--surface); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-header h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-header p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-header > svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.card-header > .pill { flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover { transform: none; }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

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

.btn-mint {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-mint:hover { background: #e2c9af; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-soft);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }

.btn-ghost { color: var(--muted); padding: 0 10px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.btn-danger:hover { background: #f0d2c9; }

.btn-sm { min-height: 32px; padding: 0 11px; font-size: 11px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-icononly { width: 34px; min-height: 34px; padding: 0; }
.btn-link { padding: 0; min-height: auto; border: 0; color: var(--accent); font-size: 12px; }
.btn.is-loading { pointer-events: none; opacity: 0.8; }
.btn.is-loading svg { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pills, chips, status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.pill svg { display: none; }
.pill-mint { color: var(--accent); border-color: #c9ab8c; background: var(--accent-soft); }
.pill-pink { color: var(--rust); border-color: #caa494; background: #f2e0d8; }
.pill-amber { color: var(--amber); border-color: #d6bd93; background: var(--amber-bg); }
.pill-blue { color: var(--sage); border-color: #b3bfad; background: #e7ece2; }
.pill-danger { color: var(--danger); border-color: #d4a99f; background: var(--danger-bg); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.status::before { display: none; content: none; }
.status-within,
.status-strong { color: var(--status-good); }
.status-below,
.status-above { color: var(--amber); }
.status-unavailable { color: var(--muted-2); }
.status-developing { color: var(--sage); }
.status-explore { color: var(--rust); }

.chip {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.chip.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.chip-toggle { display: inline-flex; align-items: center; gap: 5px; }
.chip-toggle svg { width: 12px; height: 12px; }

/* ---------- Loading, empty, error ---------- */
.loading-page {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
.loading-mark,
.busy-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-page p { margin: 0; }

.empty-state {
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h2,
.empty-state h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.empty-state p { max-width: 440px; margin: 0 auto 18px; color: var(--muted); font-size: 13px; }
.error-state { border-color: #d4a99f; }

.skeleton {
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  align-items: stretch;
  min-height: 340px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero h1 {
  margin: 0 0 16px;
  max-width: 680px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-lede { max-width: 500px; margin: 0 0 22px; color: var(--text-soft); font-size: 14px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 20px; color: var(--muted-2); font-size: 10.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta svg { width: 12px; height: 12px; }

.voice-art {
  position: relative;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-left: clamp(16px, 3vw, 34px);
  border-left: 1px solid var(--border);
}
.voice-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 160px;
}
.voice-bars i {
  display: block;
  width: 7px;
  height: var(--h, 40%);
  min-height: 10px;
  border-radius: 1px;
  background: var(--caramel);
}
.voice-bars i:nth-child(3n) { background: var(--accent); }
.voice-bars i:nth-child(3n + 2) { background: var(--muted-2); }
.voice-caption {
  color: var(--muted-2);
  font-size: 10.5px;
}

/* ---------- Metric cards ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card {
  --status: var(--muted);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card.status-within { --status: var(--status-good); }
.metric-card.status-below,
.metric-card.status-above { --status: var(--amber); }
.metric-card.status-unavailable { --status: var(--muted-2); }
.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0;
}
.metric-value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.7vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}
.metric-value .unit { margin-left: 3px; font-family: var(--font-sans); font-size: 0.42em; font-weight: 650; letter-spacing: 0; color: var(--muted); }
.metric-sub { margin-top: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; color: var(--muted-2); font-size: 9.5px; }
.meter { position: relative; height: 4px; margin-top: 12px; background: var(--surface-3); overflow: hidden; }
.meter-target { position: absolute; top: 0; bottom: 0; background: #d9bfa3; }
.meter-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--status); }
.metric-card.quality-card { --status: var(--sage); }
.metric-card.quality-card .metric-value { font-size: 2rem; }

/* ---------- Voice signature / scoring ---------- */
.signature-banner {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.signature-read { padding: clamp(20px, 2.6vw, 26px); border-right: 1px solid var(--border); }
.signature-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}
.signature-kicker em { color: var(--rust); font-style: normal; }
.score-info-btn {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}
.score-info-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.score-info-btn svg { width: 12px; height: 12px; }
.signature-score { display: flex; align-items: baseline; gap: 5px; margin: 2px 0 9px; font-family: var(--font-display); line-height: 0.9; }
.signature-score strong { font-size: clamp(3rem, 5vw, 4.2rem); font-weight: 600; letter-spacing: -0.04em; color: var(--accent); }
.signature-score span { color: var(--muted-2); font-family: var(--font-sans); font-size: 14px; font-weight: 600; }
.signature-meter { height: 6px; overflow: hidden; background: var(--surface-3); }
.signature-meter span { display: block; height: 100%; background: var(--accent); }
.signature-label { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; color: var(--accent); font-size: 11px; font-weight: 650; }
.signature-label > span { color: var(--muted-2); font-weight: 500; }
.signature-label .pill { font-size: 9px; }
.signature-summary { margin: 12px 0 8px; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.signature-consensus { margin: 0 0 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; line-height: 1.45; }
.signature-consensus strong { color: var(--text-soft); }
.signature-footnote { margin: 0 0 12px; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.signature-archetype { padding: clamp(20px, 2.6vw, 26px); }
.signature-archetype h3 { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.archetype-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.archetype-title-row .pill { flex: none; margin-top: 3px; }
.archetype-tagline { margin: 0 0 9px; color: var(--rust); font-family: var(--font-display); font-size: 1.04rem; }
.signature-archetype .small { margin: 0; color: var(--muted); line-height: 1.6; }
.archetype-blend { display: inline-block; margin-top: 12px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-soft); font-size: 10px; }
.archetype-strengths { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.archetype-strengths .pill { font-size: 9px; }
.signature-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.signature-banner.compact .signature-summary { margin-bottom: 5px; }
.signature-banner.compact .signature-actions { margin-top: 0; }

.signature-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  align-content: start;
  padding: clamp(18px, 2.4vw, 24px);
}
.signature-insights .section-link { grid-column: 1 / -1; margin-top: 12px; }
.signature-panel { min-width: 0; padding: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.signature-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.signature-panel-head .btn { font-size: 8px; min-height: 26px; padding: 0 8px; }
.signature-panel-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.signature-panel-score strong { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--accent); }
.signature-panel-score span { color: var(--muted); font-size: 9px; line-height: 1.3; }
.signature-panel .small { margin: 6px 0 8px; color: var(--text-soft); font-size: 10px; line-height: 1.5; }
.signature-panel-note { margin: 9px 0 0; color: var(--muted-2); font-size: 8.5px; line-height: 1.45; }
.signature-components { display: flex; flex-direction: column; gap: 7px; }
.signature-component-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 9px; }
.signature-component-head strong { color: var(--text-soft); font-size: 9px; }
.signature-component .score-bar { height: 3px; margin-top: 4px; }
.signature-quickstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 12px; border-top: 1px solid var(--border); }
.signature-quickstats div { padding: 8px 8px 0 0; }
.signature-quickstats div + div { padding-left: 10px; border-left: 1px solid var(--border); }
.signature-quickstats span { display: block; color: var(--muted-2); font-size: 8px; }
.signature-quickstats strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.signature-gate { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; padding: 8px 9px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--text-soft); font-size: 9px; line-height: 1.45; }
.signature-gate svg { width: 12px; height: 12px; flex: none; margin-top: 1px; color: var(--amber); }

.score-breakdown { margin-top: 16px; padding: clamp(20px, 2.6vw, 26px); }
.score-breakdown-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.score-breakdown h3 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.score-breakdown-head p { max-width: 600px; margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.score-dimension-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
.voice-map { display: grid; grid-template-columns: minmax(280px, 0.95fr) minmax(230px, 1fr); gap: clamp(12px, 2.5vw, 28px); align-items: center; margin-bottom: 18px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.voice-radar-wrap { min-width: 0; }
.voice-radar { display: block; width: 100%; height: auto; max-height: 500px; }
.voice-map-copy h4 { margin: 2px 0 6px; font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.75rem); font-weight: 600; letter-spacing: -0.015em; }
.voice-map-copy > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.voice-map-legend { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; color: var(--muted); font-size: 9.5px; }
.voice-map-legend span { display: flex; align-items: center; gap: 7px; }
.axis-dot { width: 7px; height: 7px; display: inline-block; }
.axis-dot.core { background: var(--accent); }
.axis-dot.support { background: var(--muted-2); }
.voice-map-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.voice-map-stats .pill { font-size: 8.5px; }
.domain-score-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 12px; }
.domain-score-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px 34px; align-items: center; gap: 7px; padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.domain-score-row strong { color: var(--text-soft); font-size: 10px; text-align: right; }
.domain-score-row em { color: var(--muted-2); font-size: 8px; font-style: normal; text-align: right; }
.domain-breakdown { margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.domain-breakdown > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.domain-breakdown > summary::-webkit-details-marker { display: none; }
.domain-breakdown > summary > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.domain-breakdown > summary strong { font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.domain-breakdown > summary em { color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.4; }
.domain-summary-score { flex: none; color: var(--rust); font-size: 9px; font-weight: 650; }
.domain-breakdown .score-dimension-grid { padding: 0 14px 8px; }
.score-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; padding-top: 13px; border-top: 1px solid var(--border); }
.score-group-head:first-of-type { border-top: 0; padding-top: 0; }
.score-group-head h4 { margin: 0; color: var(--text-soft); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.score-group-head p { max-width: 620px; margin: 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.score-dimension.support-axis { background: transparent; }
.score-dimension.support-axis .score-dimension-head { color: var(--muted-2); }
.support-weight-list .weight-row strong { color: var(--muted); font-weight: 600; }
.score-dimension {
  --tone: var(--accent);
  padding: 13px 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.score-dimension.band-strong { --tone: var(--status-good); }
.score-dimension.band-developing { --tone: var(--amber); }
.score-dimension.band-explore { --tone: var(--rust); }
.score-dimension.band-unavailable { --tone: var(--muted-2); }
.score-dimension-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 0; }
.score-dimension-head strong { color: var(--tone); font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; }
.score-dimension-head em { color: var(--muted-2); font-family: var(--font-sans); font-size: 8px; font-style: normal; font-weight: 500; }
.score-bar { height: 4px; margin: 7px 0 10px; overflow: hidden; background: var(--surface-3); }
.score-bar span { display: block; height: 100%; background: var(--tone); }
.score-dimension > p { margin: 0 0 9px; color: var(--text-soft); font-size: 10.5px; line-height: 1.5; }
.score-more { margin: 0 0 8px; }
.score-more summary { cursor: pointer; color: var(--muted-2); font-size: 9.5px; }
.score-more summary:hover { color: var(--accent); }
.score-more p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.score-evidence { min-height: 13px; color: var(--muted-2); font-size: 8px; line-height: 1.4; }
.score-weight { margin-top: 7px; color: var(--muted-2); font-size: 8px; letter-spacing: 0; }
.score-weight-note { margin-top: 14px; padding: 11px 0 0; border-top: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 10px; line-height: 1.5; }
.score-weight-note strong { color: var(--text-soft); }
.score-disclaimer { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.score-disclaimer svg { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--amber); }
.score-disclaimer.subtle { border-color: var(--border); background: var(--surface-2); }
.score-disclaimer.subtle svg { color: var(--rust); }
.score-info-body { display: flex; flex-direction: column; gap: 16px; }
.score-info-block h3 { margin: 0 0 5px; font-size: 13px; }
.score-info-block > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.weight-list { display: flex; flex-direction: column; margin: 8px 0; border-top: 1px solid var(--border); }
.weight-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10.5px; }
.weight-row strong { color: var(--accent); font-weight: 650; }
.archetype-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.archetype-info { padding: 9px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.archetype-info strong { display: block; font-size: 10.5px; font-weight: 650; }
.archetype-info span { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }

.score-target { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 8px 0 6px; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 8.5px; }
.score-target span { color: var(--muted); }
.score-target strong { color: var(--text-soft); font-size: 9px; }
.score-target em { flex-basis: 100%; color: var(--muted-2); font-style: normal; font-size: 8px; }
.score-target.target-within { border-color: #b3bfad; }
.score-target.target-below,
.score-target.target-above { border-color: #d6bd93; }
.score-action { margin: 8px 0; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-soft); font-size: 9px; line-height: 1.5; }
.score-action strong { color: var(--accent); }

.summary-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.delta { display: inline-flex; align-items: baseline; gap: 4px; font-size: 11px; color: var(--muted); }
.delta strong { font-size: 12px; color: var(--text-soft); font-weight: 650; }

/* ---------- Charts ---------- */
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: var(--font-sans); fill: var(--muted-2); }
.chart-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.legend::before { content: ""; width: 7px; height: 7px; background: var(--accent); }
.chart-empty { min-height: 170px; display: grid; place-items: center; color: var(--muted-2); font-size: 12px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.chart-stack { display: flex; flex-direction: column; gap: 16px; }
.chart-card { padding: 20px; }
.chart-card h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.chart-card .chart-sub { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

/* ---------- Dashboard ---------- */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.72fr); gap: 16px; align-items: start; }
.dashboard-aside { display: flex; flex-direction: column; gap: 14px; }
.session-list { display: flex; flex-direction: column; }
.session-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1.3fr) minmax(0, 0.9fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background-color 120ms ease;
}
.session-row:last-child { border-bottom: 0; }
.session-row:hover { background: var(--surface-2); }
.session-date { color: var(--muted); font-size: 11px; }
.session-date strong { display: block; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.session-main { min-width: 0; }
.session-main strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-main span { color: var(--muted); font-size: 10.5px; }
.session-mini-metrics { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 10.5px; }
.session-mini-metrics b { display: block; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.session-row > svg { width: 16px; height: 16px; color: var(--muted-2); }

.practice-snapshot { padding: 20px; }
.practice-snapshot-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.streak-ring {
  position: relative;
  width: 74px;
  height: 74px;
  flex: none;
  display: grid;
  place-items: center;
}
.streak-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.streak-ring-track { fill: none; stroke: var(--border); stroke-width: 4; }
.streak-ring-value { fill: none; stroke: var(--accent); stroke-width: 4; }
.streak-ring-inner { position: relative; z-index: 1; text-align: center; line-height: 1; }
.streak-ring-inner strong { display: block; font-family: var(--font-display); font-size: 23px; font-weight: 600; }
.streak-ring-inner span { font-size: 8px; color: var(--muted); }
.practice-snapshot h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.practice-snapshot p { margin: 0; font-size: 11.5px; color: var(--muted); }
.practice-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.practice-meta div { padding: 9px 8px 9px 0; }
.practice-meta div + div { padding-left: 10px; border-left: 1px solid var(--border); }
.practice-meta strong { display: block; font-size: 15px; font-weight: 650; }
.practice-meta span { font-size: 8.5px; color: var(--muted-2); }

/* ---------- Record ---------- */
.record-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 18px; align-items: start; }
.recorder-card { padding: clamp(20px, 3vw, 28px); }
.recorder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.recorder-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.recorder-stage { display: flex; flex-direction: column; align-items: center; padding: 12px 0 8px; }
.waveform-shell {
  position: relative;
  width: 100%;
  height: 168px;
  margin: 8px 0 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.waveform-shell canvas { width: 100%; height: 100%; display: block; }
.waveform-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted-2); font-size: 11px; pointer-events: none; }
.waveform-idle svg { width: 22px; height: 22px; color: var(--accent); opacity: 0.7; }
.record-timer { font-family: var(--font-sans); font-size: clamp(2rem, 4vw, 2.8rem); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.record-timer span { color: var(--muted-2); font-size: 0.45em; }
.record-status { min-height: 18px; margin: 5px 0 14px; color: var(--muted); font-size: 11.5px; text-align: center; }
.record-actions { display: flex; align-items: center; justify-content: center; gap: 16px; }
.mic-button {
  position: relative;
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  transition: background-color 120ms ease;
}
.mic-button:hover { background: var(--accent-hover); }
.mic-button:active { background: var(--accent-strong); }
.mic-button svg { width: 29px; height: 29px; }
.mic-button.recording { background: var(--rust); outline: 4px solid #ecd0c6; }
.mic-button.recording::before,
.mic-button.recording::after { display: none; content: none; }
.record-secondary { display: grid; place-items: center; gap: 4px; color: var(--muted); font-size: 9.5px; }
.record-secondary .icon-btn { border: 1px solid var(--border); background: var(--surface); }
.record-secondary .icon-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.draft-audio { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.draft-audio audio { width: 100%; height: 36px; }
.draft-audio-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 10.5px; }
.draft-audio-meta strong { color: var(--text-soft); font-weight: 600; }
.upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: border-color 120ms ease, background-color 120ms ease;
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragover { border-color: var(--accent); background: var(--surface-2); }
.upload-zone svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.upload-zone strong { display: block; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.upload-zone span { font-size: 10.5px; }
.record-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: var(--muted-2); font-size: 10.5px; }
.record-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.record-input-status { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.record-input-bar { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; padding: 12px 0 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.record-input-field { display: flex; flex-direction: column; gap: 5px; min-width: 190px; flex: 1 1 190px; }
.record-input-field label { color: var(--muted-2); font-size: 10px; font-weight: 650; }
.record-input-field .select { width: 100%; }
.live-quality { min-width: 120px; padding-left: 10px; border-left: 1px solid var(--border); color: var(--muted-2); font-size: 9.5px; font-weight: 650; text-align: left; }
.live-quality[data-state="good"] { color: var(--status-good); }
.live-quality[data-state="loud"],
.live-quality[data-state="noisy"] { color: var(--amber); }
.live-quality[data-state="quiet"] { color: var(--rust); }
.live-quality[data-state="calibrating"] { color: var(--sage); }
.record-live.calibrating .live-pill { opacity: 0.75; }
.record-quality-warning { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 9px 11px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 10px; line-height: 1.5; }
.record-quality-warning svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

.form-card { padding: clamp(20px, 3vw, 26px); }
.form-card h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; }
.form-card > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label,
.field > .field-label { font-size: 11px; font-weight: 650; color: var(--text-soft); }
.field .optional { color: var(--muted-2); font-weight: 400; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--muted-2); }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--accent); }
.input:focus,
.select:focus,
.textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select { appearance: auto; padding-right: 32px; }
.field-help { color: var(--muted-2); font-size: 10px; line-height: 1.45; }

.goal-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.goal-option { position: relative; }
.goal-option input { position: absolute; opacity: 0; pointer-events: none; }
.goal-option label { display: flex; flex-direction: column; gap: 3px; min-height: 62px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.goal-option label strong { font-size: 11.5px; font-weight: 650; }
.goal-option label span { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.goal-option input:checked + label { border-color: var(--accent); background: var(--accent-soft); }
.goal-option input:checked + label strong { color: var(--accent); }
.goal-option input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.submit-row .btn-primary { flex: 1; }

.passage-card { margin-top: 16px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.passage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.passage-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--text-soft); }
.passage-head h3 { margin: 0; }
.passage-card h3 svg { width: 15px; height: 15px; color: var(--rust); }
.passage-text { margin: 0; color: var(--text-soft); font-family: var(--font-display); font-size: 15.5px; line-height: 1.65; }
.passage-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted-2); font-size: 9.5px; }
.tips-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.tips-list li { display: flex; gap: 9px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.tips-list svg { width: 14px; height: 14px; color: var(--accent); flex: none; margin-top: 2px; }

.record-live { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 28px; margin-top: 10px; }
.record-live[hidden] { display: none !important; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 650; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.live-pill.speech,
.record-live.hearing .live-pill { color: var(--accent); border-color: var(--border-strong); background: var(--accent-soft); }
.live-pill.speech i,
.record-live.hearing .live-pill i { background: var(--accent); }
.live-pitch { min-width: 74px; color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.live-pitch.has-pitch { color: var(--accent); }
.live-level { width: 110px; height: 5px; overflow: hidden; background: var(--surface-3); }
.live-level i { display: block; width: 0; height: 100%; background: var(--accent); transition: width 90ms linear; }

/* ---------- Session detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 13px; height: 13px; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.detail-title { margin: 0 0 8px; font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.025em; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.detail-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr); gap: 16px; align-items: start; }
.audio-bar { display: flex; align-items: center; gap: 13px; padding: 12px 15px; }
.audio-bar audio { width: 100%; height: 35px; }
.audio-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.audio-icon svg { width: 18px; height: 18px; }
.quality-panel { padding: 18px 20px; }
.quality-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.quality-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.quality-list li:last-child { border-bottom: 0; }
.quality-list span { color: var(--muted); }
.quality-list strong { font-weight: 650; color: var(--text-soft); text-align: right; }
.formant-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.formant-row { display: grid; grid-template-columns: 24px 1fr 65px; align-items: center; gap: 9px; font-size: 10.5px; color: var(--muted); }
.formant-track { height: 5px; background: var(--surface-3); overflow: hidden; }
.formant-fill { height: 100%; background: var(--accent); }
.formant-row strong { text-align: right; color: var(--text-soft); font-weight: 600; }
.recording-warning { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 10.5px; line-height: 1.45; }
.recording-warning svg { width: 14px; height: 14px; flex: none; }

/* ---------- Transcript ---------- */
.transcript-card { margin-top: 16px; padding: clamp(20px, 2.6vw, 26px); }
.transcript-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.transcript-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.transcript-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.transcript-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.transcript-text { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-soft); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.transcript-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; color: var(--muted-2); font-size: 9.5px; }
.transcript-empty { padding: 15px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 11px; line-height: 1.55; }
.transcript-empty strong { display: block; margin-bottom: 3px; color: var(--text-soft); }
.transcript-error { border-color: #d6bd93; background: var(--amber-bg); color: var(--amber); }
.transcript-segments { margin-top: 12px; }
.transcript-segments summary { cursor: pointer; color: var(--muted); font-size: 10px; }
.transcript-segments ol { display: flex; flex-direction: column; gap: 6px; margin: 9px 0 0; padding: 0; list-style: none; }
.transcript-segments li { display: grid; grid-template-columns: 56px 1fr; gap: 9px; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.transcript-segments time { color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; padding-top: 2px; }

/* ---------- Reading library ---------- */
.library-console { margin-bottom: 18px; padding: clamp(17px, 2.2vw, 22px); }
.library-search-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.library-search { position: relative; display: flex; align-items: center; flex: 1 1 320px; min-width: 0; }
.library-search > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.library-search .input { width: 100%; padding-left: 38px; }
.library-search-meta { display: flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.library-search-meta strong { color: var(--accent); font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 11px; }
.library-toolbar .filter-chips { margin-top: 0; }
.library-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.select-sm { width: auto; min-width: 138px; min-height: 32px; padding: 6px 28px 6px 9px; font-size: 10.5px; }
.library-tagbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 11px; border-top: 1px solid var(--border); }
.library-taglabel { margin-right: 2px; color: var(--muted-2); font-size: 9px; font-weight: 650; }
.reading-tag { min-height: 23px; padding: 0 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: inherit; font-size: 9px; cursor: pointer; }
.reading-tag span { color: var(--muted-2); font-size: 8px; }
.reading-tag:hover { color: var(--text); border-color: var(--border-strong); }
.reading-tag.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.reading-tag.active span { color: var(--accent-ink); }
.library-results-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.library-results-meta span:last-child { max-width: 620px; }
.library-notice { margin: 18px 0 16px; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reading-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}
.reading-card[hidden],
.reading-grid[hidden] { display: none !important; }
.reading-featured { margin-bottom: 14px; padding: clamp(24px, 3.4vw, 34px); border-color: var(--border-strong); background: var(--surface-2); }
.reading-featured .reading-text { max-width: 900px; font-size: clamp(17px, 2.1vw, 22px); line-height: 1.56; }
.reading-featured h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.reading-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.reading-kind { color: var(--rust); font-size: 9px; font-weight: 700; }
.reading-year { color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.reading-card h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: clamp(1.3rem, 1.8vw, 1.65rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.12; }
.reading-by { margin: 0 0 14px; color: var(--muted); font-size: 10.5px; }
.reading-by em { font-style: normal; }
.reading-text { margin: 0; color: var(--text-soft); font-family: var(--font-display); font-size: 15px; line-height: 1.62; white-space: pre-line; }
.reading-note { margin: 12px 0 0; padding: 9px 11px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.reading-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.reading-meta .pill { font-size: 8.5px; }
.reading-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.reading-tags .pill { font-size: 8.5px; }
.reading-practice { margin-top: 12px; }
.reading-practice summary { cursor: pointer; color: var(--muted-2); font-size: 9.5px; }
.reading-practice summary:hover { color: var(--accent); }
.reading-practice p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.reading-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.reading-preview { margin: 0 0 8px; color: var(--text-soft); font-family: var(--font-display); font-size: 1rem; line-height: 1.6; }
.reading-long-text { margin: 8px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.reading-long-text summary { padding: 10px 11px; cursor: pointer; color: var(--accent); font-size: 9.5px; font-weight: 650; }
.reading-long-text .reading-text { padding: 0 12px 12px; }
.reading-extended { border-color: var(--border-strong); }

/* ---------- Deep read ---------- */
.deep-read { margin-top: 16px; }
.deep-read-headline { max-width: 60ch; margin: 0; font-family: var(--font-display); font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.deep-read-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr); gap: clamp(20px, 3vw, 34px); }
.deep-read-columns > * { min-width: 0; }
.deep-read-handoff { margin: 0; color: var(--text-soft); line-height: 1.65; }
.deep-read-assistant { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); line-height: 1.5; }

/* ---------- Coaching ---------- */
.coach-section { margin-top: 32px; }
.coach-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.coach-header h2 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.015em; }
.coach-header p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.coach-source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coach-summary { padding: clamp(20px, 3vw, 26px); font-family: var(--font-display); font-size: 1.2rem; line-height: 1.62; color: var(--text-soft); }
.coach-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.insight-card { padding: 15px 0 0; border: 0; border-top: 2px solid var(--border); border-radius: 0; background: transparent; }
.insight-card h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--text-soft); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.insight-card h3 svg { display: none; }
.insight-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.insight-list li { position: relative; padding-left: 12px; color: var(--text-soft); font-size: 11.5px; line-height: 1.5; }
.insight-list li::before { content: "—"; position: absolute; left: 0; color: var(--muted-2); }
.insight-list.focus li::before { color: var(--rust); }
.insight-list.strength li::before { color: var(--sage); }
.practice-plan-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 28px 0 12px; }
.practice-plan-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.015em; }
.practice-plan-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.plan-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 2px 2px 10px; }
.plan-day { min-width: 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.plan-day .day-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--accent); font-size: 9px; font-weight: 700; }
.plan-day .day-label span { color: var(--muted-2); font-weight: 500; }
.plan-day h4 { margin: 0 0 9px; font-size: 12px; line-height: 1.35; font-weight: 650; }
.plan-day ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.plan-day li { position: relative; padding-left: 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.plan-day li::before { content: "·"; position: absolute; left: 0; color: var(--muted-2); }
.exercise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 13px; }
.exercise-card { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; overflow: hidden; }
.exercise-card summary { display: flex; align-items: center; gap: 12px; padding: 14px 15px; cursor: pointer; list-style: none; }
.exercise-card summary::-webkit-details-marker { display: none; }
.exercise-title-wrap { min-width: 0; flex: 1; }
.exercise-title-wrap strong { display: block; font-size: 12px; font-weight: 650; line-height: 1.35; }
.exercise-title-wrap span { color: var(--muted); font-size: 9.5px; }
.exercise-chevron { width: 15px; height: 15px; color: var(--muted-2); transition: transform 120ms ease; flex: none; }
.exercise-card[open] .exercise-chevron { transform: rotate(180deg); }
.exercise-body { padding: 0 15px 15px; }
.exercise-body p { margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.exercise-body ol { display: flex; flex-direction: column; gap: 6px; margin: 0 0 9px; padding-left: 16px; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.exercise-body .focus-tag { display: inline-block; padding: 2px 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 8.5px; font-weight: 650; }
.caution-box { display: flex; gap: 10px; margin-top: 16px; padding: 13px 15px; border: 1px solid #d6bd93; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 11px; line-height: 1.5; }
.caution-box svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.caution-box ul { margin: 0; padding-left: 15px; }
.encouragement { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-soft); font-family: var(--font-display); font-size: 1.1rem; line-height: 1.55; }

/* ---------- Exercise library ---------- */
.exercise-starter { margin-bottom: 16px; padding: clamp(18px, 2.4vw, 24px); }
.exercise-starter-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.exercise-starter-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-soft); font: inherit; text-align: left; cursor: pointer; }
.exercise-starter-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.exercise-starter-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.exercise-starter-copy strong { font-size: 10.5px; font-weight: 650; line-height: 1.35; }
.exercise-starter-copy em { margin-top: 2px; color: var(--muted-2); font-size: 8.5px; font-style: normal; }
.exercise-starter-item svg { width: 13px; height: 13px; flex: none; color: var(--muted-2); }
.exercise-console { margin-bottom: 16px; padding: clamp(17px, 2.2vw, 22px); }
.exercise-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 13px 0 10px; }
.exercise-toolbar .filter-chips { margin-top: 0; }
.exercise-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.exercise-library-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}
.exercise-library-card[hidden] { display: none !important; }
.exercise-library-top { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 11px; }
.exercise-library-top .pill { font-size: 8.5px; }
.exercise-library-card h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: clamp(1.3rem, 1.8vw, 1.6rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.14; }
.exercise-library-why { margin: 0 0 12px; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.exercise-library-setup { display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; padding: 10px 0 0; border-top: 1px solid var(--border); background: transparent; color: var(--text-soft); font-size: 9.5px; line-height: 1.5; }
.exercise-library-setup strong { color: var(--accent); font-size: 9px; font-weight: 700; }
.exercise-step-preview { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.exercise-step-preview li { display: grid; grid-template-columns: 23px 1fr; gap: 8px; align-items: start; }
.exercise-step-preview li > span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted-2); font-size: 8px; }
.exercise-step-preview p { margin: 2px 0 0; color: var(--text-soft); font-size: 10.2px; line-height: 1.5; }
.exercise-more-steps { margin-top: 8px; color: var(--muted-2); font-size: 9px; }
.exercise-library-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 16px; }
.exercise-modal-body { margin-top: 14px; }
.exercise-setup-box { padding: 11px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: transparent; }
.exercise-setup-box p { margin: 4px 0 0; color: var(--text-soft); font-size: 11px; line-height: 1.55; }
.exercise-modal-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr); gap: 18px; margin-top: 16px; }
.exercise-modal-grid h3 { margin: 0 0 9px; font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.exercise-step-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.exercise-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.exercise-step-num { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--accent); font-size: 9px; font-weight: 700; }
.exercise-step div { color: var(--text-soft); font-size: 11.5px; line-height: 1.55; padding-top: 6px; }
.exercise-modal-aside { display: flex; flex-direction: column; gap: 13px; }
.exercise-side-block { padding: 11px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.exercise-side-block h3 { font-size: 0.95rem; margin-bottom: 7px; }
.exercise-side-block p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.exercise-side-block p + p { margin-top: 6px; }
.exercise-safety { border-top-color: #d6bd93; }
.exercise-safety h3 { color: var(--amber); }
.exercise-safety p { color: var(--muted); }

/* ---------- Archetype goals & reference voices ---------- */
.archetype-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 14px; }
.archetype-goal-option { position: relative; display: block; min-width: 0; padding: 13px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; cursor: pointer; transition: background-color 120ms ease; }
.archetype-goal-option:hover { background: var(--surface-2); }
.archetype-goal-option.selected { background: var(--accent-soft); }
.archetype-goal-option.selected .micro,
.archetype-goal-option.selected .archetype-goal-tagline { color: var(--muted); }
.archetype-goal-option input { position: absolute; opacity: 0; pointer-events: none; }
.archetype-goal-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; cursor: pointer; }
.archetype-goal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.archetype-goal-top strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.archetype-goal-tagline { color: var(--muted); font-size: 10px; line-height: 1.5; }
.archetype-goal-targets { display: flex; flex-wrap: wrap; gap: 5px; }
.archetype-goal-targets .pill { font-size: 8px; }
.archetype-goal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.archetype-goal-actions .micro { max-width: 260px; line-height: 1.35; }
.identity-options .goal-option label { min-height: 78px; }
.custom-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.custom-target-pair { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.custom-target-pair legend { padding: 0 4px; color: var(--text-soft); font-size: 10.5px; font-weight: 650; }
.custom-target-pair legend .micro { font-weight: 400; }
.custom-target-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.custom-target-fields .field { gap: 3px; }
.custom-target-fields .input { min-width: 0; }
.custom-target-pair > .field-help { display: block; margin-top: 6px; }
.field-error { min-height: 1em; color: var(--danger); font-size: 10.5px; line-height: 1.45; }
.record-archetype-goal { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.record-archetype-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.record-archetype-copy strong { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.record-archetype-copy span { color: var(--muted); font-size: 10px; }
.record-archetype-goal .row { gap: 6px; }
.signature-goal { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 13px; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.signature-goal-copy { display: flex; flex-direction: column; gap: 2px; }
.signature-goal-copy strong { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.signature-goal-copy > span:last-child { color: var(--muted-2); font-size: 9px; }

.goal-target-list { display: flex; flex-direction: column; gap: 7px; }
.goal-target-row { padding: 7px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.goal-target-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.goal-target-copy span { color: var(--muted); font-size: 8.5px; }
.goal-target-copy strong { color: var(--text-soft); font-size: 9px; font-weight: 650; }
.goal-target-meter { height: 3px; margin-top: 5px; background: var(--surface-3); overflow: hidden; }
.goal-target-meter span { display: block; height: 100%; background: var(--status, var(--rust)); }
.goal-target-foot { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 4px; color: var(--muted-2); font-size: 7.5px; line-height: 1.3; }
.goal-target-row.status-within { --status: var(--status-good); }
.goal-target-row.status-below,
.goal-target-row.status-above { --status: var(--amber); }
.goal-target-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.goal-target-detail { padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.goal-target-detail.status-within { --status: var(--status-good); }
.goal-target-detail.status-below,
.goal-target-detail.status-above { --status: var(--amber); }

/* ---------- Gamification ---------- */
.game-hud { display: grid; grid-template-columns: minmax(0, 1.35fr) auto; gap: 14px 26px; align-items: center; margin-top: 16px; padding: clamp(16px, 2.2vw, 22px); }
.game-empty { color: var(--muted); font-size: 12px; }
.game-level-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.level-orb { width: 68px; height: 68px; flex: none; display: grid; place-items: center; align-content: center; gap: 1px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); }
.level-orb span { color: var(--accent-ink); font-size: 8px; font-weight: 700; opacity: 0.8; }
.level-orb strong { font-family: var(--font-display); font-size: 1.85rem; font-weight: 600; line-height: 0.9; }
.game-level-copy { min-width: 0; flex: 1; }
.game-level-copy h2 { margin: 2px 0 8px; font-family: var(--font-display); font-size: clamp(1.4rem, 2.1vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; }
.xp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.xp-row span:first-child { color: var(--text-soft); font-weight: 650; }
.xp-bar,
.quest-progress,
.badge-progress { height: 6px; margin-top: 6px; background: var(--surface-3); overflow: hidden; }
.xp-bar span,
.quest-progress span,
.badge-progress span { display: block; height: 100%; background: var(--accent); }
.game-stats { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.game-stats div { padding: 9px 10px; }
.game-stats div + div { border-left: 1px solid var(--border); }
.game-stats strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.game-stats span { display: block; margin-top: 2px; color: var(--muted-2); font-size: 7.5px; }
.game-hud-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.game-next-badge { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.game-next-badge svg { width: 13px; height: 13px; color: var(--amber); }
.game-next-badge strong { color: var(--text-soft); }
.dashboard-game-grid,
.practice-game-grid,
.quests-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 16px; align-items: start; margin-top: 16px; }

.quest-card { padding: clamp(16px, 2.2vw, 22px); }
.quest-card h3,
.badge-shelf h3,
.xp-explainer h3 { margin: 3px 0 0; font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; }
.quest-card > p { margin: 8px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-row { display: flex; gap: 10px; padding: 10px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.quest-row.complete { background: var(--status-good-bg); }
.quest-check { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted-2); }
.quest-check svg { width: 14px; height: 14px; }
.quest-row.complete .quest-check { color: var(--status-good); border-color: #b3bfad; background: transparent; }
.quest-copy { min-width: 0; flex: 1; }
.quest-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest-title-row strong { font-size: 10.5px; font-weight: 650; }
.quest-title-row .pill { flex: none; font-size: 7.5px; }
.quest-copy p { margin: 3px 0 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.quest-progress-label { display: block; margin-top: 3px; color: var(--muted); font-size: 7.5px; }
.quest-note { margin: 10px 0 0 !important; }
.weekly-card { background: var(--surface-2); }
.weekly-progress { margin-top: 12px; height: 8px; }
.quest-complete { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--status-good); font-size: 9px; }
.quest-complete svg { width: 13px; height: 13px; }
.quest-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 7px; }
.quest-foot .quest-progress-label { margin-top: 0; }
.quest-action { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--accent); font-size: 9px; font-weight: 650; line-height: 1.2; white-space: nowrap; cursor: pointer; }
.quest-action svg { width: 11px; height: 11px; flex: none; }
.quest-action:hover { background: var(--accent-soft); }
.quest-action-done { border-color: #b3bfad; background: var(--status-good-bg); color: var(--status-good); cursor: default; }
.quest-action-done:hover { background: var(--status-good-bg); }

.badge-shelf { margin-top: 16px; padding: clamp(16px, 2.2vw, 22px); }
.badge-next-callout { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; }
.badge-next-callout svg { width: 13px; height: 13px; color: var(--amber); }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.badge-tile { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: center; padding: 10px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.badge-tile.earned { background: var(--accent-soft); }
.badge-tile.locked { opacity: 0.62; }
.badge-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--rust); }
.badge-icon svg { width: 16px; height: 16px; }
.badge-copy { min-width: 0; }
.badge-copy strong { display: block; font-size: 9.5px; font-weight: 650; }
.badge-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.badge-progress { grid-column: 1 / -1; height: 3px; margin-top: 0; }
.xp-explainer { margin-top: 16px; padding: clamp(16px, 2.2vw, 22px); }
.xp-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.xp-rules div { padding: 9px 0; border-top: 1px solid var(--border); background: transparent; }
.xp-rules strong { display: block; font-size: 9.5px; }
.xp-rules span { display: block; margin-top: 2px; color: var(--rust); font-size: 9px; font-weight: 650; }
.xp-rules p { margin: 4px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.4; }

.consistency-card { margin-top: 16px; padding: clamp(16px, 2.2vw, 22px); }
.consistency-card .history-card-head { padding: 0; border-bottom: 0; }
.consistency-card h3 { margin: 3px 0 0; font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; }
.consistency-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; margin: 14px 0 10px; }
.consistency-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; aspect-ratio: 0.88; padding: 6px 2px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted-2); }
.consistency-day i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); opacity: 0.6; }
.consistency-day em { font-size: 7.5px; font-style: normal; font-weight: 650; line-height: 1; }
.consistency-day.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text-soft); }
.consistency-day.active i { background: var(--accent); opacity: 1; }
.consistency-day.today { outline: 1px solid var(--accent); outline-offset: 2px; }
.consistency-day:hover { border-color: var(--border-strong); }
.consistency-card > .micro { margin: 0; }

/* ---------- Measurement confidence ---------- */
.measurement-card { margin-top: 16px; padding: clamp(16px, 2.2vw, 22px); }
.measurement-card .history-card-head { padding: 0; border-bottom: 0; }
.measurement-card h3 { margin: 3px 0 0; font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.015em; }
.measurement-grid { display: grid; grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr); gap: 18px; align-items: center; margin: 16px 0; }
.measurement-score-number { display: flex; align-items: baseline; gap: 5px; }
.measurement-score-number strong { font-family: var(--font-display); font-size: clamp(2.3rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -0.04em; line-height: 0.9; color: var(--accent); }
.measurement-score-number span { color: var(--muted-2); font-size: 12px; font-weight: 640; }
.measurement-score .score-bar { height: 7px; margin-top: 12px; }
.measurement-score .micro { margin: 8px 0 0; max-width: 230px; }
.measurement-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.measurement-facts div { padding: 9px 8px; }
.measurement-facts div + div { border-left: 1px solid var(--border); }
.measurement-facts span { display: block; color: var(--muted-2); font-size: 7.5px; }
.measurement-facts strong { display: block; margin-top: 3px; color: var(--text-soft); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.measurement-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.measurement-component { display: grid; grid-template-columns: minmax(0, 1fr) 90px 28px; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.measurement-component .score-bar { height: 3px; margin: 0; }
.measurement-component strong { color: var(--text-soft); font-size: 9px; text-align: right; }
.measurement-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.measurement-limits li { font-size: 9px; color: var(--muted); }

/* ---------- Progress ---------- */
.progress-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr); gap: 16px; align-items: stretch; }
.progress-hero { padding: clamp(24px, 4vw, 36px); }
.progress-hero h1 { margin-bottom: 12px; }
.progress-hero .page-lede { max-width: 600px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.trend-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; margin-top: 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trend-stat { padding: 10px 10px 10px 0; border: 0; border-radius: 0; background: transparent; }
.trend-stat span { display: block; font-size: 8.5px; color: var(--muted-2); }
.trend-stat strong { display: block; margin-top: 3px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.baseline-card { padding: 20px; }
.baseline-card h3 { margin: 0 0 5px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.baseline-card p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.baseline-deltas { display: flex; flex-direction: column; gap: 0; }
.baseline-delta { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.baseline-delta:last-child { border-bottom: 0; }
.baseline-delta span { color: var(--muted); }
.baseline-delta strong { font-weight: 650; }
.progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.progress-grid .chart-card.wide { grid-column: 1 / -1; }
.calendar-card { padding: 20px; }
.calendar-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.calendar-card p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 390px; }
.cal-day { aspect-ratio: 1; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--surface-3); }
.cal-day.active { background: var(--accent); border-color: var(--accent); }
.cal-day.today { border-color: var(--accent); }
.cal-day.future { opacity: 0.3; }
.calendar-range { margin: 0 0 7px; color: var(--muted); font-size: 10px; }
.calendar-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 390px; margin-bottom: 6px; color: var(--muted-2); font-size: 8px; text-align: center; }
.calendar-legend { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--muted-2); font-size: 9px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-swatch { width: 8px; height: 8px; border-radius: var(--radius-sm); background: var(--surface-3); }
.calendar-swatch.active { background: var(--accent); }
.history-card { margin-top: 16px; overflow: hidden; }
.history-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.history-card-head h3 { margin: 0; font-size: 13px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 10px 16px; text-align: left; color: var(--muted-2); font-size: 9px; font-weight: 650; border-bottom: 1px solid var(--border); }
.history-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 11.5px; vertical-align: middle; }
.history-table tr:last-child td { border-bottom: 0; }
.history-table tbody tr { cursor: pointer; transition: background-color 120ms ease; }
.history-table tbody tr:hover { background: var(--surface-2); }
.history-table .num { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.history-table .muted { color: var(--muted-2); font-size: 10px; }

/* ---------- Practice ---------- */
.practice-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 16px; align-items: stretch; }
.practice-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(24px, 4vw, 36px); }
.practice-hero-copy h1 { margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 2.9rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.06; }
.practice-hero-copy p { max-width: 490px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.practice-hero .streak-ring { width: 120px; height: 120px; }
.practice-hero .streak-ring-inner strong { font-size: 38px; }
.practice-hero .streak-ring-inner span { font-size: 9px; }
.practice-week-card { padding: 20px; }
.practice-week-card h3 { margin: 0 0 5px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.practice-week-card p { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.practice-week-card .practice-meta { margin: 12px 0; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 16px; align-items: start; margin-top: 16px; }
.day-list { display: flex; flex-direction: column; gap: 0; }
.day-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.day-row:last-child { border-bottom: 0; }
.day-row .day-num { color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.day-row h4 { margin: 0 0 3px; font-size: 12px; }
.day-row p { margin: 0; color: var(--muted); font-size: 10.5px; }
.day-row .day-min { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.log-card { padding: 20px; }
.log-card h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.log-card > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.log-history { margin-top: 16px; padding: 0; overflow: hidden; }
.log-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--border); }
.log-item:last-child { border-bottom: 0; }
.log-item-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--accent); }
.log-item-icon svg { width: 14px; height: 14px; }
.log-item-main { flex: 1; min-width: 0; }
.log-item-main strong { display: block; font-size: 11.5px; font-weight: 650; }
.log-item-main span { color: var(--muted); font-size: 10px; }
.log-item-main p { margin: 2px 0 0; color: var(--muted-2); font-size: 10px; }
.log-item .icon-btn { width: 28px; height: 28px; color: var(--muted-2); }
.log-item .icon-btn:hover { color: var(--danger); background: var(--danger-bg); border-color: #d4a99f; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.settings-card { padding: clamp(20px, 2.6vw, 26px); }
.archetype-goal-card { min-width: 0; }
.settings-card h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; }
.settings-card > p { margin: 0 0 19px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.settings-card h3 { margin: 20px 0 7px; font-size: 12px; font-weight: 650; }
.settings-card hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.notice { display: flex; gap: 9px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.notice svg { width: 14px; height: 14px; flex: none; color: var(--accent); margin-top: 1px; }
.notice.warm { background: var(--amber-bg); border-color: #d6bd93; }
.notice.warm svg { color: var(--amber); }
.notice.danger { background: var(--danger-bg); border-color: #d4a99f; }
.notice.danger svg { color: var(--danger); }
.settings-card .notice + .notice { margin-top: 8px; }
.record-billing:empty { display: none; }
.record-billing { margin-bottom: 16px; }
.plan-banner {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border: 1px solid #b3bfad;
  border-left: 3px solid var(--sage);
  border-radius: var(--radius-sm);
  background: #e7ece2;
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.5;
}
.plan-banner strong { font-weight: 650; }
.plan-banner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.plan-banner-actions .section-link { margin-left: 0; }
.plan-lock { align-items: center; flex-wrap: wrap; }
.plan-lock-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 560px) {
  .plan-banner-actions,
  .plan-lock-actions { margin-left: 22px; }
}
.history-window {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--caramel);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}
.history-window-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.history-window-mark svg { width: 14px; height: 14px; }
.history-window-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.history-window-copy strong { color: var(--text); font-size: 11px; font-weight: 650; }
.history-window-copy span { color: var(--muted); }
.history-window-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 640px) {
  .history-window { flex-wrap: wrap; }
  .history-window-copy { flex-basis: calc(100% - 40px); }
  .history-window-actions { width: 100%; margin-left: 40px; }
}
.pdf-lock { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pdf-lock-btn { border-style: dashed; color: var(--text-soft); }
.pdf-lock-btn svg { color: var(--muted); }
.pdf-lock-tag {
  margin-left: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pdf-lock-note { color: var(--muted-2); font-size: 9.5px; line-height: 1.4; }
.settings-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.range-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.range-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.range-list li:last-child { border-bottom: 0; }
.range-list span { color: var(--muted); }
.range-list strong { color: var(--text-soft); font-weight: 650; }
.about-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 10px; line-height: 1.6; }

/* ---------- Modals, toasts, busy ---------- */
.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); background: rgba(43, 33, 26, 0.55); animation: fade-in 140ms ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(560px, 100%);
  max-height: min(90vh, 850px);
  overflow-y: auto;
  padding: clamp(22px, 3.5vw, 30px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.modal-card.wide { width: min(760px, 100%); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-card .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.modal-card h2 { margin: 0; font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
.modal-card .modal-sub { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.modal-card .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.onboarding-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.onboarding-brand .brand-mark { width: 34px; height: 34px; border-radius: var(--radius); color: var(--accent-ink); }
.onboarding-brand span { color: var(--muted); font-size: 10px; font-weight: 600; }
.onboarding-goals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  max-height: 44vh;
  overflow-y: auto;
  margin-top: 6px;
  padding-right: 4px;
}
.onboarding-goal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border-top: 1px solid var(--border);
}
.onboarding-goal input { position: absolute; opacity: 0; }
.onboarding-goal label { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 0; cursor: pointer; }
.onboarding-goal label > span { grid-column: 2; min-width: 0; }
.onboarding-goal label::before { content: ""; width: 15px; height: 15px; margin-top: 1px; border: 1px solid var(--border-strong); border-radius: 50%; background: transparent; }
.onboarding-goal input:checked + label { background: var(--accent-soft); }
.onboarding-goal input:checked + label::before { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent); }
.onboarding-goal strong { display: block; font-size: 11.5px; font-weight: 650; }
.onboarding-goal span { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.onboarding-goal .goal-icon { display: none; }
.onboarding-play { width: 28px; height: 28px; color: var(--accent); border-color: var(--border); }
.onboarding-play:hover { color: var(--text); background: var(--surface-2); }
.onboarding-play svg { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .onboarding-goals { grid-template-columns: 1fr; max-height: 40vh; }
}
.modal-note { margin-top: 12px; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.modal-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.toast-root { position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 9px; max-width: min(390px, calc(100vw - 40px)); padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); font-size: 11.5px; line-height: 1.45; animation: toast-in 140ms ease both; }
.toast.out { animation: toast-out 120ms ease both; }
@keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-out { to { opacity: 0; } }
.toast svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.toast-success { border-color: #b3bfad; }
.toast-success svg { color: var(--status-good); }
.toast-error { border-color: #d4a99f; }
.toast-error svg { color: var(--danger); }
.toast-info svg { color: var(--sage); }

.busy-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(43, 33, 26, 0.55); }
.busy-card { width: min(400px, 100%); padding: 26px; text-align: center; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.busy-spinner { margin: 0 auto 15px; }
.busy-card h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.busy-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.busy-card .busy-detail { margin-top: 12px; color: var(--muted-2); font-size: 10px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--bg); z-index: 200; text-align: center; }

/* ---------- Account screen ---------- */
body.auth-mode .sidebar,
body.auth-mode .sidebar-backdrop,
body.auth-mode .topbar,
body.auth-mode .app-footer { display: none !important; }
body.auth-mode .app-shell { display: block; }
body.auth-mode .main-wrap { min-height: 100vh; min-height: 100dvh; }
body.auth-mode .view { max-width: none; padding: 0; }

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding:
    calc(clamp(28px, 5vw, 64px) + env(safe-area-inset-top))
    calc(clamp(24px, 5vw, 64px) + env(safe-area-inset-right))
    calc(clamp(28px, 5vw, 56px) + env(safe-area-inset-bottom))
    calc(clamp(24px, 5vw, 64px) + env(safe-area-inset-left));
  background: var(--accent-strong);
  color: var(--accent-ink);
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -190px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 249, 241, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 46px; height: 46px; background: var(--accent-ink); color: var(--accent-strong); }
.auth-word {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--accent-ink);
}
.auth-word span {
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 249, 241, 0.66);
}

.auth-aside-copy { position: relative; z-index: 1; max-width: 510px; margin: auto 0; }
.auth-kicker {
  margin: 0 0 14px;
  color: var(--accent-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.auth-aside h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.auth-copy {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 249, 241, 0.82);
  font-size: 14px;
  line-height: 1.7;
}
.auth-footnote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 249, 241, 0.56);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding:
    calc(clamp(24px, 4vw, 56px) + env(safe-area-inset-top))
    calc(clamp(20px, 4vw, 56px) + env(safe-area-inset-right))
    calc(clamp(24px, 4vw, 56px) + env(safe-area-inset-bottom))
    calc(clamp(20px, 4vw, 56px) + env(safe-area-inset-left));
}

.auth-card {
  width: min(440px, 100%);
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 48px -40px rgba(43, 33, 26, 0.5);
}
.auth-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.auth-lede { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .input { min-height: 46px; }
.auth-error { min-height: 0; }
.auth-error:empty { display: none; }
.auth-switch {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.auth-switch-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.auth-switch-btn:hover { color: var(--accent-hover); }
.auth-fineprint { margin: 14px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.auth-fineprint .section-link { font-size: 10px; }
.auth-card.wide { width: min(540px, 100%); }
.auth-recover-line { margin: 14px 0 0; }
.auth-link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.auth-link-btn:hover { color: var(--accent); }

/* ---------- Recovery phrase ---------- */
.phrase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.phrase-grid li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.phrase-index { flex: none; width: 1.4em; color: var(--muted-2); font-size: 9.5px; font-variant-numeric: tabular-nums; text-align: right; }
.phrase-word { font-size: 12.5px; font-weight: 650; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.phrase-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.check-line input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

.sidebar-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}
.sidebar-signout:hover { color: var(--text); background: rgba(123, 74, 46, 0.08); }
.sidebar-signout svg { width: 15px; height: 15px; flex: none; }
.sidebar-signout:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-aside {
    gap: 20px;
    padding:
      calc(24px + env(safe-area-inset-top))
      calc(20px + env(safe-area-inset-right))
      22px
      calc(20px + env(safe-area-inset-left));
  }
  .auth-aside::after { right: -180px; bottom: -230px; width: 380px; height: 380px; }
  .auth-aside-copy { margin: 0; }
  .auth-aside h1 { font-size: clamp(2rem, 8vw, 2.7rem); }
  .auth-main { justify-content: flex-start; padding-top: 24px; }
  .auth-card { width: min(520px, 100%); }
}

@media (max-width: 480px) {
  .auth-aside h1 { font-size: 1.95rem; }
  .auth-copy { font-size: 13px; }
  .auth-card { padding: 20px; }
  .phrase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-main {
    padding-left: calc(14px + env(safe-area-inset-left));
    padding-right: calc(14px + env(safe-area-inset-right));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border: 2px solid var(--bg); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Responsive ---------- */
.hide-mobile { display: initial; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score-dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr); }
  .voice-art { min-height: 240px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr); }
  .signature-insights { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(280px, 84vw); transform: translateX(-105%); transition: transform 180ms ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close,
  .icon-btn.menu-btn { display: inline-grid; }
  .sidebar-backdrop { display: block; }
  .main-wrap { min-height: 100vh; }
  .topbar { min-height: 64px; }
  .view { padding-top: 22px; }
  .hero { min-height: 320px; }
  .dashboard-grid,
  .record-grid,
  .detail-grid,
  .progress-top,
  .practice-top,
  .practice-layout,
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .practice-top > *,
  .practice-layout > * { min-width: 0; }
  .progress-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { gap: 14px; }
  .dashboard-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .signature-banner { grid-template-columns: 1fr; }
  .signature-read { border-right: 0; border-bottom: 1px solid var(--border); }
  .progress-top .baseline-card { order: 2; }
  .practice-layout .log-card { order: 1; }
  .practice-layout .log-history { order: 2; }
  .exercise-starter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-modal-grid { grid-template-columns: 1fr; }
  .game-hud { grid-template-columns: 1fr; }
  .game-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-game-grid,
  .practice-game-grid,
  .quests-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .chip { min-height: 40px; }
  .nav-item { min-height: 48px; }
  .topbar-record { width: 44px; min-height: 44px; }
  .topbar-avatar { width: 44px; height: 44px; }
  .input,
  .select,
  .textarea { min-height: 46px; font-size: 16px; }
}

@media (max-width: 760px) {
  .topbar { padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left)); gap: 8px; }
  .topbar-title { font-size: 12px; }
  .streak-chip { padding: 0 8px; }
  .streak-label { display: none; }
  .topbar-record span { display: none; }
  .topbar-record { width: 44px; padding: 0; min-height: 44px; }
  .topbar-avatar { width: 34px; height: 34px; font-size: 14px; }
  .topbar-right { gap: 6px; }
  .view { padding: 18px 16px 44px; }
  .app-footer { flex-direction: column; padding: 16px; gap: 3px; }
  .app-footer-sub { text-align: left; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; min-height: auto; }
  .hero h1 { font-size: clamp(2.4rem, 10vw, 3.4rem); }
  .voice-art { display: none; }
  .hero-meta { gap: 10px; margin-top: 16px; font-size: 9.5px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 1.7rem; }
  .metric-label { font-size: 9px; }
  .dashboard-aside { grid-template-columns: 1fr; }
  .section-head { margin-top: 25px; }
  .session-row { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .session-mini-metrics { display: none; }
  .record-grid { gap: 13px; }
  .record-form .form-row { grid-template-columns: 1fr; }
  .goal-options { grid-template-columns: 1fr; }
  .goal-option label { min-height: 48px; }
  .deep-read-columns { grid-template-columns: 1fr; gap: 20px; }
  .coach-columns { grid-template-columns: 1fr; gap: 16px; }
  .exercise-grid { grid-template-columns: 1fr; }
  .coach-summary { font-size: 1.08rem; }
  .score-dimension-grid { grid-template-columns: 1fr; }
  .voice-map { grid-template-columns: 1fr; }
  .voice-radar { max-height: 430px; }
  .voice-map-copy { padding-bottom: 4px; }
  .archetype-info-grid { grid-template-columns: 1fr; }
  .reading-grid { grid-template-columns: 1fr; }
  .library-controls { width: 100%; }
  .library-controls .select-sm { flex: 1 1 140px; }
  .library-results-meta span:last-child { max-width: none; }
  .transcript-head { flex-direction: column; }
  .plan-days { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-color: var(--border-strong) transparent; }
  .plan-day { flex: 0 0 210px; scroll-snap-align: start; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .detail-actions .btn-icononly { flex: 0 0 auto; }
  .progress-hero { padding: 22px 20px; }
  .trend-stats { gap: 0; }
  .trend-stat { padding: 9px 8px 9px 0; }
  .trend-stat strong { font-size: 1.1rem; }
  .history-table th:nth-child(4), .history-table td:nth-child(4),
  .history-table th:nth-child(5), .history-table td:nth-child(5),
  .history-table th:nth-child(7), .history-table td:nth-child(7) { display: none; }
  .practice-hero { padding: 22px 20px; }
  .practice-hero .streak-ring { width: 92px; height: 92px; }
  .practice-hero .streak-ring-inner strong { font-size: 30px; }
  .practice-hero .streak-ring-inner span { font-size: 8px; }
  .practice-hero-copy h1 { font-size: 2.2rem; }
  .form-row { grid-template-columns: 1fr; }
  .modal-card { padding: 21px; }
  .modal-card h2 { font-size: 1.6rem; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
  .hide-mobile { display: none !important; }
  .exercise-library-grid { grid-template-columns: 1fr; }
  .exercise-starter-list { grid-template-columns: 1fr; }
  .game-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge-grid { grid-template-columns: 1fr; }
  .xp-rules { grid-template-columns: 1fr; }
  .measurement-grid { grid-template-columns: 1fr; gap: 12px; }
  .measurement-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .measurement-components { grid-template-columns: 1fr; }
  .measurement-limits { grid-template-columns: 1fr; }
  .goal-target-table { grid-template-columns: 1fr; }
  .signature-insights { padding: 16px; }
  .signature-quickstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-title,
  .detail-title { font-size: clamp(2.2rem, 11vw, 3.1rem); }
  .xp-chip .xp-rank { display: none; }
  .xp-chip { padding: 0 8px; }
  .archetype-goal-grid { grid-template-columns: 1fr; }
  .custom-target-grid { grid-template-columns: 1fr; }
  .plan-days { margin-right: -14px; }
  .modal-backdrop { padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
  .modal-card { width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 18px; }
  .view { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .btn { white-space: normal; max-width: 100%; padding-top: 8px; padding-bottom: 8px; line-height: 1.2; text-align: center; }
  .btn-icononly { padding: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-meta { gap: 10px 14px; }
  .hero-meta span { white-space: normal; }
  .consistency-strip { gap: 3px; }
  .consistency-day { padding: 4px 1px; }
  .consistency-day em { display: none; }
  .live-quality { width: 100%; padding-left: 0; border-left: 0; text-align: center; }
}

@media (max-width: 520px) {
  .practice-hero { flex-direction: column; align-items: flex-start; }
  .practice-hero .streak-ring { align-self: flex-end; margin-top: -8px; }
  .practice-hero-copy { min-width: 0; }
}

@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 1.5rem; }
  .topbar-left { gap: 7px; }
  .topbar-kicker { display: none; }
  .section-head { align-items: flex-start; }
  .signature-quickstats { grid-template-columns: 1fr; }
  .signature-quickstats div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
  .archetype-goal-option { padding: 12px; }
  .archetype-goal-actions .micro { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
