/* HireSpeak · 外企面试英语口语教练 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  /* Disclosure chevron, drawn with currentColor through a mask. */
  --chevron-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  color-scheme: light;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --faint: #5b6670;
  --brand: #be123c;
  --brand-soft: #ffe4e6;
  --brand-ink: #ffffff;
  --accent: #92400e;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --line: #e5e7eb;
  --control-border: #d1d5db;
  --hover: #f9fafb;
  --selected: #f3f4f6;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --surface: #ffffff;
  --chrome: #fffffff0;
  --overlay: #fffffff8;
  --edge: #e5e7eb;
  --ambient: transparent;
  --ambient-warm: transparent;
  --font-ui: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --tabbar-h: 62px;
  --font-en: var(--font-ui);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
    --bg: #0b0d11;
    --card: #14171e;
    --ink: #f9fafb;
    --muted: #9ca3af;
    --faint: #9ca3af;
    --brand: #fb7185;
    --brand-soft: #2e0f17;
    --brand-ink: #0b0d11;
    --accent: #fbbf24;
    --ok: #34d399;
    --ok-soft: #062e20;
    --warn: #fbb024;
    --warn-soft: #2e2106;
    --bad: #f87171;
    --bad-soft: #331111;
    --line: #272e3b;
    --control-border: #374151;
    --hover: #1e2430;
    --selected: #252d3d;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --surface: #14171ecc;
    --chrome: #0b0d11ea;
    --overlay: #14171ef8;
    --edge: rgba(255, 255, 255, 0.08);
    --ambient: transparent;
    --ambient-warm: transparent;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  --bg: #0b0d11;
  --card: #14171e;
  --ink: #f9fafb;
  --muted: #9ca3af;
  --faint: #9ca3af;
  --brand: #fb7185;
  --brand-soft: #2e0f17;
  --brand-ink: #0b0d11;
  --accent: #fbbf24;
  --ok: #34d399;
  --ok-soft: #062e20;
  --warn: #fbb024;
  --warn-soft: #2e2106;
  --bad: #f87171;
  --bad-soft: #331111;
  --line: #272e3b;
  --control-border: #374151;
  --hover: #1e2430;
  --selected: #252d3d;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --surface: #14171ecc;
  --chrome: #0b0d11ea;
  --overlay: #14171ef8;
  --edge: rgba(255, 255, 255, 0.08);
  --ambient: transparent;
  --ambient-warm: transparent;
}

html { height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--chrome);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--edge);
}
.topbar h1 { font-size: 22px; font-weight: 600; flex: 1; min-width: 0; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 6px; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ---------- 主视图 ---------- */
.view { flex: 1; min-width: 0; padding: 8px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.view > * + * { margin-top: 20px; }
main.view:focus, main.view:focus-visible { outline: none; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; z-index: 30;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--chrome);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; min-height: 60px; color: var(--muted); font-size: 12px; font-family: inherit;
  position: relative;
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--brand); font-weight: 600; }
.tabbar .nav-badge {
  position: absolute; top: 5px; right: calc(50% - 20px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 7px 16px; font-size: 14px; font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  font-family: inherit; cursor: pointer; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.btn:active:not(:disabled) { background: var(--selected); transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.switch:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 12px; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
/* Icons beside button text follow the text size, so buttons with and without an icon are equally tall. */
.btn > svg { width: 18px; height: 18px; }
/* Icons and label text share one optical centre in every button-like control. */
:is(.btn, .chip, .icon-btn, .text-button) > svg { display: block; }
.btn, .chip, .text-button, .tabbar button { line-height: 1.25; }
.btn-sm > svg, .chip > svg { width: 16px; height: 16px; }
.btn-big > svg { width: 20px; height: 20px; }
/* A lone icon wrapped in a span inside a flex row: block, so it centres instead of sitting on the text baseline. */
:is(.list-item, .practice-row, .action-card, .tabbar button, .btn, .chip) > span > svg:only-child { display: block; }
.ai-hint { margin-top: 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.ai-hint > svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: transparent; color: var(--brand-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); font-weight: 600; }
.btn-primary:active:not(:disabled) { filter: brightness(0.92); transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-big { font-size: 15px; padding: 10px 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 12px; font-size: 13px; color: var(--muted); background: var(--card);
  cursor: pointer; font-family: inherit; min-height: 34px;
}
.chip.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 600; }
.chip.static { cursor: default; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block; border-radius: 6px; padding: 2px 8px;
  font-size: 11px; font-weight: 500; background: var(--brand-soft); color: var(--brand);
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.neutral { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

input[type="text"], input[type="password"], input[type="url"], input[type="search"], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  border-bottom-color: var(--control-border); background: var(--card); color: var(--ink);
  font-size: 14px; font-family: inherit; padding: 8px 12px; min-height: 36px;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.65; }
/* One chevron on every platform, inset by the same 12px as the text (native arrows sit flush and differ on Windows). */
select {
  appearance: none; padding-right: 36px; text-overflow: ellipsis; cursor: pointer;
  background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px;
}
select:disabled { cursor: not-allowed; opacity: .6; }
select.inline-select { width: auto; max-width: 100%; }
.storage-clean { margin-top: 12px; flex-wrap: wrap; align-items: center; gap: 8px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field-wrap + .field-wrap { margin-top: 14px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hidden { display: none !important; }

.en { font-family: var(--font-en); font-size: 17px; line-height: 1.65; }
.en-big { font-family: var(--font-en); font-size: 21px; line-height: 1.5; font-weight: 500; letter-spacing: .1px; }
/* Chinese questions, samples and phrases (1.29): body font, slightly larger line height for Han text. */
.zh-big { font-size: 21px; line-height: 1.55; font-weight: 600; }
.zh-sample { font-size: 16px; line-height: 1.8; white-space: pre-wrap; }
.zh-phrase, .zh-anchor { font-size: 16px; line-height: 1.65; }
.bubble { font-family: var(--font-en); }

/* ---------- 首页 ---------- */
.hero {
  padding: 0 0 4px; color: var(--ink);
  background: transparent;
}
.hero h2 { font-size: 20px; margin-bottom: 12px; font-weight: 600; }
.hero p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.hero .row { gap: 10px; flex-wrap: wrap; }
.hero .btn { background: var(--card); color: var(--ink); }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: left; }
.stat-tile b { display: block; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: 12px; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-card {
  text-align: left; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius); padding: 15px; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.action-card:active { background: var(--selected); }
.action-card .ic { display: inline-flex; color: var(--brand); }
.action-card .ic svg { width: 22px; height: 22px; }
.action-card b { font-size: 15px; }
.action-card span { font-size: 12.5px; color: var(--muted); }
.list-item {
  width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: var(--ink);
  display: flex; align-items: center; gap: 12px; padding: 14px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.list-item .sub { font-size: 12.5px; color: var(--muted); }
.sum-ic { display: inline-flex; color: var(--brand); }
.sum-ic svg { width: 42px; height: 42px; }
.chip-glyph { display: inline-flex; width: 15px; height: 15px; margin-right: -2px; }
.chip-glyph svg { width: 15px; height: 15px; }
.cat-glyph { display: inline-flex; width: 17px; height: 17px; color: var(--brand); vertical-align: -3px; margin-right: 4px; }
.cat-glyph svg { width: 17px; height: 17px; }

/* ---------- 训练页 ---------- */
.progress-line { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s; }

.q-card { padding: 22px; }
.q-card .cat-line { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.answer-tools { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.mic-btn {
  position: relative;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(190, 18, 60, 0.25);
  transition: transform var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.mic-btn svg { width: 24px; height: 24px; }
.mic-btn:hover:not(:disabled) { transform: scale(1.04); }
.mic-btn:active:not(:disabled) { transform: scale(0.96); }
.mic-btn.rec {
  background: var(--brand); color: var(--brand-ink);
  animation: rec-pulse 1.4s ease-in-out infinite;
}
@keyframes rec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(190, 18, 60, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(190, 18, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(190, 18, 60, 0); }
}
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
.mic-wrap .hint { font-size: 13px; color: var(--muted); }
.answer-clock {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--hover);
}
.answer-clock-read { display: flex; align-items: baseline; gap: 8px; min-width: 9em; }
.answer-clock-read .timer-chip { font-size: 16px; font-weight: 700; font-family: monospace; }
.answer-clock-actions { display: flex; gap: 8px; }
.answer-clock-target { margin-left: auto; width: auto; min-height: 32px; font-size: 14px; }
.answer-clock.over .timer-chip { color: var(--warn); }

.transcript-box { margin-top: 14px; }
.partial { color: var(--faint); font-style: italic; }

.kw-chip { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; background: var(--bg); }
.kw-chip.hit { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
.kw-chip.miss { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.sample-block { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 14px; margin-top: 10px; }
.sample-block .en { font-size: 15.5px; }
.zh-block { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; font-size: 14px; color: var(--muted); }

.phrase-line { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.phrase-line:last-child { border-bottom: 0; }
.phrase-line .en { font-size: 15px; }
.phrase-line .zh { font-size: 12.5px; color: var(--muted); }

.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.rate-row button {
  border: 1px solid var(--line); background: var(--card); border-radius: 4px;
  padding: 10px 4px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.rate-row .r0 { color: var(--bad); } .rate-row .r1 { color: var(--warn); }
.rate-row .r2 { color: var(--ok); } .rate-row .r3 { color: var(--brand); }
.rate-row button:active { background: var(--selected); }
.rate-hint { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; text-align: center; }

/* ---------- 模拟面试 ---------- */
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 8px; font-size: 16px; line-height: 1.65; }
.bubble.interviewer { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.bubble.me { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; margin-left: auto; }
.chat-line { display: flex; margin-top: 12px; }
.chat-line.me { justify-content: flex-end; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 4px; animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.timer-chip { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- 句型跟读 ---------- */
.voice-entry {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); background: var(--card); font: inherit; cursor: pointer;
}
.voice-entry-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--brand); flex-shrink: 0; }
.voice-entry .grow { flex: 1; min-width: 0; }
.voice-entry b { display: block; font-size: 17px; }
.voice-entry .sub, .voice-report-link .sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 400; }
.voice-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.voice-note { margin-top: 12px; }
.voice-status { font-size: 14px; color: var(--brand); margin: 12px 0; min-height: 22px; }
.voice-error { color: var(--bad); overflow-wrap: anywhere; }
.voice-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.voice-settings-grid .field-wrap + .field-wrap { margin: 0; }
.voice-settings-grid + .voice-note { margin-bottom: 16px; }
.interviewer-voice-settings { display: grid; gap: 16px; }
.interviewer-voice-settings > p { margin: 0; }
.interviewer-voice-settings .field-wrap { min-width: 0; }
.interviewer-voice-settings select { width: 100%; max-width: 100%; }
.voice-advanced { margin: 16px 0; border-block: 1px solid var(--line); }
.voice-advanced > summary { padding: 12px 0; min-height: 44px; cursor: pointer; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details:not(.realtime-archive, .usage-notes, .cat-group, .review-row) > summary::before,
:is(.cat-group, .review-row) > summary::after {
  content: ''; display: inline-block; flex-shrink: 0; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  background: currentColor; opacity: .65; -webkit-mask: var(--chevron-mask) center / contain no-repeat; mask: var(--chevron-mask) center / contain no-repeat;
  transition: transform var(--motion-fast) var(--ease);
}
details[open]:not(.realtime-archive, .usage-notes, .cat-group, .review-row) > summary::before,
:is(.cat-group, .review-row)[open] > summary::after { transform: rotate(90deg); }
.voice-advanced[open] { padding-bottom: 16px; }
.voice-sample { padding: 16px; background: var(--brand-soft); border-radius: var(--radius); line-height: 1.65; }
/* Sample → status → actions: one block with a clear reading order. */
.voice-sample-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.voice-sample-block .field-wrap { margin: 0; max-width: 460px; }
.voice-sample-block .voice-sample { margin-top: 10px; }
.voice-sample-block .voice-actions { margin-top: 12px; }
.voice-check > .field-wrap { margin-top: 14px; max-width: 460px; }
.voice-diagnostic-output { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.voice-transcript { white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-stream-preview { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; padding: 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); }
.voice-confirmations { display: grid; gap: 10px; margin: 18px 0; font-size: 13px; }
.voice-confirmations label { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.voice-confirmations input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.voice-audio { width: 100%; display: block; margin-top: 12px; }
/* Custom recording player: real duration, tabular time, and a seek bar that matches it. */
.audio-player { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.audio-player audio { display: none; }
.audio-player .audio-play { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.audio-player .audio-play:hover { background: var(--hover); }
.audio-player .audio-time { flex: none; min-width: 78px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.audio-player .audio-seek { flex: 1; min-width: 80px; accent-color: var(--brand); }
.audio-player .audio-seek:disabled { opacity: .5; }
.voice-level { width: 90px; }
.voice-report-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.voice-resume .btn { margin-top: 12px; }
.voice-question .en-big { margin-top: 10px; font-weight: 500; }
.voice-explanation { margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: 14px; }
.voice-capture-state { display: flex; gap: 12px; align-items: center; min-height: 28px; margin: 8px 0; }
.voice-level { width: 150px; height: 14px; accent-color: var(--brand); }
.voice-history-turn { padding: 14px 0; border-bottom: 1px solid var(--line); }
.voice-history-turn:last-child { border-bottom: 0; }
.voice-history-turn .voice-transcript { margin-top: 8px; font-size: 14px; color: var(--muted); }
details.card > summary { font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 0; }
@media (max-width: 520px) {
  .voice-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .voice-entry { padding: 16px; gap: 12px; }
  .voice-entry b { font-size: 16px; }
  .voice-entry .sub { font-size: 12px; }
  .voice-actions > .btn { flex: 1 1 auto; }
  .voice-question .voice-actions { gap: 8px; }
  .voice-question .voice-actions .btn { padding-left: 10px; padding-right: 10px; }
}

.score-ring { font-size: 40px; font-weight: 800; }
.score-ring.good { color: var(--ok); } .score-ring.mid { color: var(--warn); } .score-ring.low { color: var(--bad); }
.speech-practice { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.speech-practice p, .speech-practice audio, .speech-practice details { margin: 12px 0; }
.speech-practice h3 { margin-top: 20px; }
.speech-words { display: flex; flex-wrap: wrap; gap: 8px; }
.speech-word-focus { border-color: var(--warn); }
.speech-target { padding: 14px 0; border-bottom: 1px solid var(--line); }
.speech-consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 12px; font-size: 13px; color: var(--muted); }
.speech-consent input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; }
.speech-history { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.diff-hl ins { text-decoration: none; background: var(--ok-soft); color: var(--ok); border-radius: 4px; padding: 0 3px; }
.diff-hl del { background: var(--bad-soft); color: var(--bad); border-radius: 4px; padding: 0 3px; text-decoration: line-through; }

/* ---------- 救场包（1.37）：空手硬答 vs 用救场句 ---------- */
.rescue-banner {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); font: inherit; cursor: pointer;
}
.rescue-banner .chip-glyph { color: var(--brand); display: grid; place-items: center; width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.rescue-banner .grow { flex: 1; min-width: 0; }
.rescue-banner b { display: block; font-size: 15px; }
.rescue-banner .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.rescue-banner > svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
/* Scenarios sit inside the drill card, so they read as inset panels rather than stacked cards. */
.rescue-scenario { margin-top: 16px; background: var(--bg); box-shadow: none; }
.rescue-scenario > h3 { font-size: 15px; }
/* Stacks below 520px on its own; no fixed widths, so the 390px phone layout stays one column. */
.rescue-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.rescue-compare > * { min-width: 0; border-radius: var(--radius-sm); padding: 12px; }
.rescue-compare h4 { font-size: 13px; font-weight: 600; margin: 0; }
.rescue-compare p { margin-top: 8px; }
.rescue-bare { background: var(--bad-soft); }
.rescue-rescue { background: var(--ok-soft); }
.rescue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
@media (max-width: 520px) {
  .rescue-compare { grid-template-columns: minmax(0, 1fr); }
  .rescue-banner { padding: 10px 12px; gap: 10px; }
  .rescue-banner b { font-size: 14px; }
  .rescue-banner .sub { font-size: 12px; }
}

/* ---------- 题库 ---------- */
.search-row { position: relative; }
.cat-group > h3 { margin: 4px 8px 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- 复习 ---------- */
.forecast { display: flex; gap: 6px; align-items: flex-end; height: 74px; margin-top: 8px; }
.forecast .bar { flex: 1; background: var(--brand-soft); border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; }
.forecast .bar i { display: block; background: var(--brand); border-radius: 6px 6px 3px 3px; }
.forecast .bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--muted); }
.forecast-labels { display: flex; gap: 6px; }
.forecast-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); }

/* ---------- 设置 ---------- */
.set-group { padding: 0; }
.set-group > h2 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; scroll-margin-top: 100px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .label { font-size: 15px; }
.set-row .sub { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--bg); border: 1px solid var(--control-border); border-radius: 12px; transition: background var(--motion-fast); }
.switch i::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--muted); transition: transform var(--motion-normal) var(--ease);
}
.switch input:checked + i { background: var(--brand); border-color: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--brand-ink); }
input[type="range"] { width: 100%; accent-color: var(--brand); }

.link {
  color: var(--brand); font-size: 13px; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
}
.link:active { opacity: .7; }
@media (min-width: 700px) { .link:hover { text-decoration: underline; } }

/* ---------- 弹层 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap .mask { position: absolute; inset: 0; background: #10281e66; backdrop-filter: blur(8px); animation: veil var(--motion-normal) var(--ease); }
.sheet {
  position: relative; width: 100%; max-width: 780px; max-height: 86vh; max-height: 86dvh; overflow-y: auto;
  background: radial-gradient(ellipse at 100% 0%, var(--ambient), transparent 55%), var(--overlay); border: 1px solid var(--edge); border-radius: 12px 12px 0 0; padding: 32px 32px calc(32px + env(safe-area-inset-bottom));
  backdrop-filter: blur(32px); box-shadow: 0 32px 96px #07150c40, 0 4px 16px #07150c26, inset 0 1px var(--edge); animation: up 220ms var(--ease);
}
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 12px; max-width: 720px; }
}
@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes veil { from { opacity: 0; } to { opacity: 1; } }
.sheet h2 { margin-bottom: 12px; padding-right: 40px; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.sheet-close { position: absolute; top: 14px; right: 14px; }

.toast-wrap { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg); border-radius: 8px; padding: 10px 18px;
  font-size: 14px; max-width: 86%; box-shadow: var(--shadow); animation: up .2s ease;
}
.toast.err { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.toast.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
/* 云端朗读失败：持续显示，直到用户处理 */
.speech-notice {
  position: fixed; left: 12px; right: 12px; margin: 0 auto; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 55;
  max-width: 560px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 14px; box-shadow: var(--shadow); animation: up .2s ease;
}
.speech-notice.error { border-color: var(--bad); }
.speech-notice > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.speech-notice-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* 桌面布局：避开左侧导航，居中于内容区 */
:where([data-desktop-layout]) .speech-notice { left: calc(64px + 12px); bottom: 24px; }
@media (min-width: 1008px) { :where([data-desktop-layout]) .speech-notice { left: calc(232px + 12px); } }

/* ---------- AI 反馈 ---------- */
.ai-panel { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 20px; }
.ai-panel .score-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ai-panel .score-line b { font-size: 30px; }
.confidence-note { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--radius-sm); background: var(--warn-soft); }
.confidence-note p { margin: 0; font-size: 13px; line-height: 1.65; }
.confidence-note b { color: var(--warn); }
.confidence-note .feedback-dimension { margin-top: 6px; padding-top: 6px; border-top-color: var(--warn); }
.fix-item { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.fix-item:last-child { border-bottom: 0; }
.fix-item .orig { text-decoration: line-through; color: var(--bad); font-size: 14px; }
.fix-item .better { color: var(--ok); font-size: 15px; font-weight: 600; }
.realtime-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.realtime-heading h2 { margin: 0; }
.realtime-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.realtime-consent { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; }
.realtime-consent input { width: 18px; height: 18px; flex: 0 0 auto; }
.realtime-meter { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.realtime-meter meter { width: 200px; max-width: 70%; height: 12px; }
.realtime-console .voice-actions { margin: 16px 0; }
.realtime-transcript { max-height: 420px; min-height: 100px; overflow: auto; }
.realtime-turn { padding: 16px 0; border-bottom: 1px solid var(--line); }
.realtime-turn:last-child { border: 0; }
.realtime-turn strong { font-size: 13px; color: var(--brand); }
.realtime-turn.user strong { color: var(--muted); }
.realtime-turn p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.realtime-flow .realtime-heading h3, .realtime-archives > .realtime-heading h3 { margin: 0; }
.realtime-flow-context { margin: 8px 0 20px; overflow-wrap: anywhere; }
.realtime-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.realtime-step { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.realtime-step > div { flex: 1; min-width: 0; }
.realtime-step-number { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.realtime-step-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.realtime-step-heading > span { white-space: nowrap; }
.realtime-step p { margin: 6px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.realtime-step.current { border-color: var(--brand); background: var(--brand-soft); }
.realtime-step.current .realtime-step-number, .realtime-step.done .realtime-step-number { background: var(--brand); color: var(--brand-ink); }
.realtime-flow-note { margin: 16px 0 0; line-height: 1.6; }
.realtime-archive { border-top: 1px solid var(--line); margin-top: 12px; }
.realtime-archive > summary { display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 16px 0; cursor: pointer; list-style: none; }
.realtime-archive > summary::-webkit-details-marker { display: none; }
.realtime-archive > summary::after { content: ''; flex-shrink: 0; width: 18px; height: 18px; background: var(--brand); -webkit-mask: var(--chevron-mask) center / contain no-repeat; mask: var(--chevron-mask) center / contain no-repeat; transition: transform var(--motion-fast) var(--ease); }
.realtime-archive[open] > summary::after { transform: rotate(90deg); }
.realtime-archive-title { flex: 1; min-width: 0; display: grid; gap: 6px; overflow-wrap: anywhere; }
.realtime-archive-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.realtime-archive-body { padding-bottom: 12px; }
.realtime-archive-body > .realtime-flow { margin: 20px 0; }
@media (max-width: 640px) {
  .realtime-steps { grid-template-columns: 1fr; }
  .realtime-step { padding: 12px; }
  .realtime-archive > summary { gap: 10px; }
}
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 桌面端适配 ---------- */
@media (min-width: 700px) {
  .en-big { font-size: 23px; }
  .zh-big { font-size: 23px; }
  .action-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.sidebar, .nav-toggle { display: none; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; border: 1px solid var(--brand); padding: 12px; background: var(--card); color: var(--ink); font: inherit; border-radius: 4px; }
.skip-link:focus { top: 12px; }
.search-command { display: flex; gap: 10px; align-items: center; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--surface); box-shadow: inset 0 1px var(--edge), 0 1px 3px #142c1905; color: var(--muted); font: inherit; cursor: pointer; }
.search-command svg { width: 18px; height: 18px; }
.search-command kbd { font: inherit; font-size: 12px; margin-left: 24px; color: var(--faint); }
.back-button {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; min-width: 0; max-width: 40%;
  min-height: 36px; padding: 0 10px 0 4px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer;
}
.back-button[hidden] { display: none; }
.back-button svg { width: 20px; height: 20px; flex-shrink: 0; }
.back-button .back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-button:hover { color: var(--ink); background: var(--surface); }
.icon-btn:disabled { color: var(--faint); opacity: .5; cursor: default; }
.training-nav { display: flex; gap: 8px; padding: 0 16px 12px; flex-wrap: wrap; }
.training-nav a { color: var(--muted); text-decoration: none; padding: 8px; border-radius: 4px; }
.training-nav a.active { color: var(--brand); box-shadow: inset 0 -2px var(--brand); }
.home-overview, .home-workspace { display: grid; gap: 24px; }
.home-overview > .card + .card { margin-top: 0; }
.personal-training {
  padding: 28px; display: flex; flex-direction: column; align-items: flex-start;
  position: relative; overflow: hidden; color: #f9fafb; border-color: #1f242e;
  background: #0e1116; border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.personal-role { font-size: 11px; color: #9ca3af; margin-bottom: 14px; letter-spacing: .5px; font-family: monospace; text-transform: uppercase; }
.personal-training h2 { font-size: 24px; line-height: 1.3; margin-bottom: 12px; font-weight: 700; color: #f9fafb; letter-spacing: -.4px; }
.personal-description { color: #9ca3af; max-width: 36em; line-height: 1.7; font-size: 13.5px; }
.personal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.personal-training .btn { background: rgba(255, 255, 255, 0.08); color: #f9fafb; border-color: rgba(255, 255, 255, 0.16); box-shadow: none; }
.personal-training .btn-primary { background: var(--brand); border-color: transparent; color: var(--brand-ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.personal-training .text-button { color: #9ca3af; }
.personal-training .text-button:hover { color: #ffffff; }
.personal-training :is(button, a):focus-visible { outline-color: var(--brand); }
.personal-source { margin-top: auto; padding-top: 14px; border-top: 1px solid #1f242e; width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: #64748b; font-size: 12px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 4px 0; border: 0; border-radius: 4px; background: transparent; color: var(--brand); font: inherit; font-size: 14px; cursor: pointer; }
.text-button svg { width: 16px; height: 16px; }
.daily-overview { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.daily-stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 20px; }
.daily-stats > div { background: var(--hover); border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px; }
.daily-stats b { display: block; font-size: 28px; line-height: 1.2; margin-bottom: 6px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.daily-stats span { font-size: 11px; font-weight: 500; color: var(--muted); }
.daily-overview .btn { margin-top: auto; align-self: stretch; }
.daily-overview p { margin-bottom: 20px; }
.home-workspace { margin-top: 32px; }
.home-workspace h2 { font-size: 18px; font-weight: 600; }
.home-practice > h2, .section-heading { margin-bottom: 16px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading .text-button { min-height: 28px; }
.practice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.practice-row { width: 100%; min-height: 160px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-content: start; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--brand-soft) 25%, var(--surface))); box-shadow: var(--shadow); color: var(--ink); text-align: left; font: inherit; padding: 20px; cursor: pointer; transition: background var(--motion-fast) var(--ease), box-shadow var(--motion-normal) var(--ease), transform var(--motion-normal) var(--ease), border-color var(--motion-fast) var(--ease); }
.practice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #21634d; background: linear-gradient(145deg, #f1f9f1, #cfdfd3); border: 1px solid #b6cdbb; box-shadow: inset 0 1px #fff, 0 3px 5px #2347310d; }
.practice-row:nth-child(2) .practice-icon { color: #39667f; background: linear-gradient(145deg, #f0f8fc, #d3e1ec); border-color: #bbcedd; }
.practice-row:nth-child(3) .practice-icon { color: #7f622e; background: linear-gradient(145deg, #fdf9ed, #eee0bf); border-color: #decca9; }
.practice-row:nth-child(4) .practice-icon { color: #696280; background: linear-gradient(145deg, #f6f3fb, #dfdbe9); border-color: #cbc6db; }
.practice-icon > svg { width: 21px; height: 21px; }
.practice-row > svg:last-child { color: var(--muted); width: 16px; height: 16px; grid-column: 2; grid-row: 1; align-self: center; }
.practice-row > .grow { grid-column: 1 / -1; }
.practice-row .grow { flex: 1; min-width: 0; }
.practice-row b { font-weight: 600; display: block; font-size: 15px; }
.practice-row .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.practice-list.compact .practice-row { min-height: 72px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.practice-list.compact .practice-row > b { flex: 1; min-width: 0; }
.empty-state { padding: 24px; }
.empty-state.card { padding: 28px 24px; }
.empty-state > svg { color: var(--muted); margin-bottom: 16px; width: 32px; height: 32px; }
.empty-state > h2, .empty-state > h3 { margin: 0; font-size: 15px; }
.empty-state > p { margin-top: 8px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card .empty-state:not(.card) { padding: 8px 0 4px; }
.recent-practice { min-width: 0; }
.recent-practice .list-item { padding: 12px 0; }
.library-toolbar { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.search-row > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-row input { padding-left: 40px; }
.library-results > * + * { margin-top: 16px; }
.library-results .tag { flex-shrink: 0; }
.library-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 4px 8px; font-size: 14px; font-weight: 600; }
.cat-group > summary::-webkit-details-marker { display: none; }
.cat-group > summary::after { width: 16px; height: 16px; margin: 0 0 0 auto; color: var(--muted); opacity: 1; }
.cat-group[open] > summary { margin-bottom: 8px; }
.question-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.question-row:last-child { border-bottom: 0; }
.question-row > .list-item { flex: 1; min-width: 0; border-bottom: 0; }
.question-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.star-btn { flex: 0 0 auto; color: var(--muted); }
.star-btn[aria-pressed="true"] { color: var(--accent); }
.star-btn[aria-pressed="true"] svg { fill: currentColor; }
/* Growth page: one series per chart, levels 0-4 over 30 days. */
.week-review .daily-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.week-review h3 { margin: 20px 0 4px; }
.weakness-item { padding: 12px 0; border-top: 1px solid var(--line); }
.weakness-item .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.weakness-item blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.weakness-item .btn { margin-top: 8px; }
.trend-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.trend-row .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.trend-chart { width: 100%; height: auto; display: block; overflow: visible; }
.trend-grid { stroke: var(--line); stroke-width: 1; }
.trend-axis { fill: var(--faint); font-size: 10px; }
.trend-dot { fill: var(--brand); stroke: var(--card); stroke-width: 2; }
.trend-change { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
.data-table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.data-table th, .data-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 600; }
/* Session review (mock, voice, realtime): one row per main question, levels as chips, local summary. */
.session-review h2 { margin: 0; }
.review-list { margin-top: 8px; }
.review-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
details.review-row { display: block; }
.review-row > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; }
.review-row > summary .review-levels { margin-left: auto; }
.review-row > summary::after { margin-right: 0; color: var(--muted); }
.review-row b { min-width: 0; overflow-wrap: anywhere; }
.review-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.review-levels .chip { padding: 2px 8px; font-size: 12px; }
.review-summary { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.review-summary h3 { margin: 16px 0 6px; }
.review-summary p.small { margin: 2px 0; }
/* A finished interview answer (mock and voice reports). */
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; }
.answer-audio { width: 100%; display: block; margin-top: 12px; }
.answer-card .btn { margin-top: 10px; }
.mock-set { width: 100%; }
.mock-question-actions { margin-top: 10px; }
.mock-personal-note { margin: 8px 0 14px; }
.mock-answer-row { margin-top: 12px; flex-wrap: wrap; }
/* Settings: categories on the left, one category per screen on the right; a scrolling strip on narrow screens. */
.settings-layout { display: grid; gap: 20px; align-items: start; }
.settings-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.settings-tab { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; text-align: left; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.settings-tab[aria-current="page"] { color: var(--brand); background: var(--selected); font-weight: 600; }
.settings-pane { min-width: 0; }
.settings-pane > .set-group > h2 { margin-top: 0; }
.settings-pane .card + .card, .settings-pane .card + .interviewer-voice-settings, .interviewer-voice-settings > * + * { margin-top: 16px; }
@media (min-width: 860px) {
  .settings-layout { grid-template-columns: 184px minmax(0, 1fr); gap: 32px; }
  .settings-nav { flex-direction: column; flex-wrap: nowrap; border-bottom: 0; border-right: 1px solid var(--line); padding: 0 12px 0 0; position: sticky; top: 96px; }
  .settings-tab { padding: 10px 12px; }
}
.service-list > .service-row + .service-row { border-top: 1px solid var(--line); }
.service-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.service-row .grow { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.service-row b { display: block; font-weight: 600; }
.service-row .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.service-row .tag { max-width: 100%; overflow-wrap: anywhere; }
.voice-prefs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.voice-prefs .realtime-consent { margin-top: 8px; }
.voice-prefs > .btn { margin-top: 12px; }

/* First-run guide and the merged interview entry. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.onboarding { padding: 24px; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.onboarding h2 { margin: 0; }
.onboarding-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.onboarding-step { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.onboarding-step:last-child { border-bottom: 0; padding-bottom: 0; }
.onboarding-step .grow { flex: 1 1 240px; min-width: 0; }
.onboarding-step b { display: block; font-weight: 600; }
.onboarding-step .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.onboarding-mark { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--control-border); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.onboarding-mark svg { width: 16px; height: 16px; }
.onboarding-step.current .onboarding-mark { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.onboarding-step.done .onboarding-mark { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.onboarding-step.done b { color: var(--muted); }
.onboarding-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-self: center; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.mode-grid > .card { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.mode-heading { display: flex; align-items: center; gap: 12px; }
.mode-heading h2 { margin: 0; }
.mode-card > .btn { margin-top: auto; }
.mode-card.unavailable { background: var(--card); box-shadow: none; }
.mode-card.unavailable :is(h2, .practice-icon) { opacity: .6; }
.list-item > .practice-icon { flex: 0 0 40px; }
.set-row > .label { flex: 0 0 160px; font-size: 14px; }
.set-row > .row { flex: 1; min-width: 0; }
.set-row select { max-width: 420px; }
.set-row input[type="range"] { min-width: 140px; }
.answer-hint { margin-bottom: 12px; }
.answer-card { align-self: start; }
.answer-card textarea { min-height: 220px; }
.view > .action-card { min-height: 68px; }
.view > .action-card > .row-between { width: 100%; }
@media (hover: hover) {
  .btn:not(.btn-primary):not(:disabled):hover, .icon-btn:not(:disabled):hover, .chip:not(.active):not(.static):hover, .action-card:hover, .practice-row:hover, .list-item:hover, .nav-item:hover { background: var(--hover); }
  .btn-primary:not(:disabled):hover, .mic-btn:not(:disabled):hover { background: color-mix(in srgb, var(--brand) 88%, var(--card)); }
  .personal-training .btn:not(.btn-primary):hover { background: #ffffff1c; }
  .personal-training .btn-primary:hover { background: #f3f9e6; box-shadow: 0 3px 12px #0d2e3340, inset 0 1px #fff; }
  .practice-row:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: 0 8px 24px #17332012, inset 0 1px var(--edge); }
  .text-button:hover { text-decoration: underline; }
}
:where([data-desktop-layout]) #app { --sidebar-width: 64px; padding-left: var(--sidebar-width); }
:where([data-desktop-layout]) .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 20px 8px 12px; background: #0e1116; border-right: 1px solid #1f242e; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12); z-index: 40; overflow-y: auto; }
:where([data-desktop-layout]) .app-brand { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0 8px 32px; color: #f9fafb; text-decoration: none; font-size: 18px; letter-spacing: -.4px; font-weight: 600; }
:where([data-desktop-layout]) .app-brand img { border-radius: 6px; flex-shrink: 0; }
:where([data-desktop-layout]) .app-brand span, :where([data-desktop-layout]) .nav-label { display: none; }
:where([data-desktop-layout]) #desktopNav { display: flex; flex-direction: column; gap: 4px; }
:where([data-desktop-layout]) .nav-item { min-height: 42px; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: #9ca3af; position: relative; font-size: 14px; transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease); }
:where([data-desktop-layout]) .nav-item > svg { width: 20px; height: 20px; }
:where([data-desktop-layout]) .nav-item:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
:where([data-desktop-layout]) .nav-item.active { background: rgba(255, 255, 255, 0.12); color: #ffffff; font-weight: 600; }
:where([data-desktop-layout]) .nav-item.active::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; min-height: 16px; border-radius: 2px; background: var(--brand); }
:where([data-desktop-layout]) .nav-item[data-nav="home"] { margin-bottom: 20px; }
:where([data-desktop-layout]) .nav-item[data-nav="answers"] { margin-top: 20px; }
:where([data-desktop-layout]) .nav-badge { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: #9ca3af; }
:where([data-desktop-layout]) .sidebar-footer { margin-top: auto; padding-top: 36px; }
:where([data-desktop-layout]) .sidebar-footer .nav-item { color: #9ca3af; }
:where([data-desktop-layout]) .sidebar-footer .nav-item:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
:where([data-desktop-layout]) .sidebar .nav-badge { display: none; }
:where([data-desktop-layout]) .tabbar, :where([data-desktop-layout]) .training-nav { display: none; }
:where([data-desktop-layout]) .nav-toggle { display: inline-flex; border-color: transparent; background: transparent; }
:where([data-desktop-layout]) .topbar { padding: 24px 28px 20px; gap: 12px; background: color-mix(in srgb, var(--chrome) 72%, transparent); }
:where([data-desktop-layout]) .topbar h1 { font-size: 28px; line-height: 1.3; }
:where([data-desktop-layout]) .view { padding: 20px 32px 36px; width: 100%; max-width: 1440px; margin: 0 auto; }
:where([data-desktop-layout]) .view[data-route="settings"] { max-width: 1120px; }
:where([data-desktop-layout]) .nav-open .sidebar { width: 240px; box-shadow: 8px 0 24px #0002; }
:where([data-desktop-layout]) .nav-open .app-brand span, :where([data-desktop-layout]) .nav-open .nav-label, :where([data-desktop-layout]) .nav-open .sidebar .nav-badge { display: block; }
@media (min-width: 1008px) {
  #app { --sidebar-width: 232px; }
  .sidebar { padding: 24px 12px 16px; }
  .app-brand span, .nav-label, .sidebar .nav-badge { display: block; }
  .nav-toggle { display: none; }
  .nav-open .sidebar { width: var(--sidebar-width); box-shadow: none; }
}
@media (min-width: 1200px) {
  .home-overview, .home-workspace { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); }
  .view[data-route="drill"]:has(.q-card) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 20px; }
  .view[data-route="drill"]:has(.q-card) > * { grid-column: 1 / -1; margin: 0; }
  .view[data-route="drill"]:has(.q-card) > .q-card { grid-column: 1; }
  .view[data-route="drill"]:has(.q-card) > .answer-card { grid-column: 2; }
}
@media (max-width: 739px) {
  .search-command { border: 0; background: transparent; box-shadow: none; padding: 8px; }
  .search-command span, .search-command kbd { display: none; }
  .icon-btn, .btn, .btn-sm, .chip, .text-button { min-height: 44px; }
  .icon-btn { width: 44px; }
  input[type="text"], input[type="password"], input[type="url"], input[type="search"], textarea, select { font-size: 16px; min-height: 44px; }
  .personal-training, .daily-overview { padding: 20px; }
  .personal-training h2 { font-size: 23px; }
  .home-overview, .home-workspace { gap: 20px; }
  .practice-list { grid-template-columns: 1fr; gap: 10px; }
  .practice-row { padding: 16px; gap: 16px; display: flex; min-height: 92px; align-items: center; }
  .practice-list.compact .practice-row { min-height: 60px; padding: 10px 16px; }
  .practice-icon { flex: 0 0 40px; }
  .practice-row:hover { transform: none; }
  .set-row { align-items: flex-start; flex-wrap: wrap; }
  .set-row > .label { flex-basis: auto; }
  .set-row > .row:has(select) { flex-basis: 100%; }
  .sheet { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .rate-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.prep-editor { border: 0; padding: 0; margin: 0; min-width: 0; }
.prep-grid, .prep-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.prep-grid { margin-bottom: 20px; }
.prep-grid > .card { min-width: 0; margin: 0; }
.prep-fields > .field-wrap { margin-top: 0; }
.prep-editor .field-wrap { margin-bottom: 16px; }
.prep-editor textarea, .prep-editor input[type="text"], .prep-editor select { width: 100%; }
.prep-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0; }
.prep-actions .field-wrap { flex: 1; min-width: 180px; margin: 0; }
/* A field has a label above the control: align the button to the control, not to label+control. */
.prep-actions:has(.field-wrap) { align-items: flex-end; }

/* Answer construction follows the existing desktop panels, with a stacked mobile editor. */
.answer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.answer-tile { display: flex; flex-direction: column; gap: 12px; margin: 0; min-width: 0; }
.answer-tile .btn { align-self: flex-start; margin-top: auto; }
.answer-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.answer-workspace > *, .answer-sidebar { min-width: 0; }
.answer-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.answer-steps .chip { min-height: 44px; }
.answer-field { margin: 18px 0; }
.answer-field input, .answer-field select, .answer-field textarea { width: 100%; }
.answer-editor textarea { min-height: 110px; }
.answer-sidebar .card + .card { margin-top: 20px; }
.answer-sidebar .card { overflow-wrap: anywhere; }
.answer-sidebar .btn { margin-top: 12px; }
.answer-sidebar select { text-overflow: ellipsis; }
.answer-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.answer-compare section { min-width: 0; border-left: 2px solid var(--line); padding-left: 12px; }
@media (max-width: 1050px) {
  .answer-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .week-review .daily-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-row { grid-template-columns: 1fr; gap: 8px; }
  .answer-compare { grid-template-columns: minmax(0, 1fr); }
}
.prep-source { white-space: pre-wrap; overflow-wrap: anywhere; }
.prep-question h3, .prep-question blockquote { overflow-wrap: anywhere; }
.prep-question blockquote { border-left: 3px solid var(--line); margin: 12px 0; padding-left: 16px; color: var(--muted); }
.prep-question details, .prep-plans { margin-top: 20px; }
.prep-plan-row { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line); }
.prep-plan-row > div { min-width: 0; overflow-wrap: anywhere; }
.prep-plan-row > button { flex-shrink: 0; }
.prep-notice { color: var(--warn); font-size: 14px; }
.prep-editor:disabled { opacity: .65; }
@media (max-width: 1000px) {
  .prep-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 480px) {
  .prep-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prep-plan-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme] { --surface: var(--card); --chrome: var(--bg); --overlay: var(--card); }
  .topbar, .sidebar, .tabbar, .sheet, .sheet-wrap .mask { backdrop-filter: none; }
  .sheet-wrap .mask { background: #10281ee6; }
}
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; padding-right: 8px; }
  details > summary::before, :is(.cat-group, .review-row, .realtime-archive) > summary::after { forced-color-adjust: none; background: CanvasText; }
  :root, :root[data-theme] { --bg: Canvas; --card: Canvas; --ink: CanvasText; --muted: CanvasText; --faint: CanvasText; --line: ButtonText; --control-border: ButtonText; --brand: LinkText; --brand-ink: Canvas; --brand-soft: Canvas; --hover: Canvas; --selected: Canvas; --ok: CanvasText; --ok-soft: Canvas; --warn: CanvasText; --warn-soft: Canvas; --bad: CanvasText; --bad-soft: Canvas; }
  .nav-item.active, .chip.active, .training-nav a.active { outline: 2px solid Highlight; outline-offset: -2px; }
  .btn-primary, .mic-btn { border: 1px solid ButtonText; }
  .switch input:checked + i { outline: 2px solid Highlight; }
  .switch i::after { background: ButtonText; forced-color-adjust: none; }
  .progress-line i, .forecast .bar i { background: Highlight; forced-color-adjust: none; }
  body, .card, .sheet, .sidebar, .topbar, .tabbar, .practice-row, .empty-state, .practice-icon, .daily-stats > div, .search-command { background: Canvas; color: CanvasText; border-color: ButtonText; box-shadow: none; backdrop-filter: none; }
  .personal-training::before { display: none; }
  .personal-training .btn, .personal-training .btn-primary, .personal-training .text-button { background: ButtonFace; color: ButtonText; border-color: ButtonText; box-shadow: none; }
  .personal-role, .personal-description, .personal-source { color: CanvasText; }
  .personal-source { border-color: ButtonText; }
  .personal-training :is(button, a):focus-visible { outline-color: Highlight; }
  .sheet-wrap .mask { background: #0009; backdrop-filter: none; }
}

/* Explainable answer feedback uses the existing panel and typography. */
.feedback-dimension { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.feedback-dimension blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-dimension summary { cursor: pointer; padding: 8px 0; }
.feedback-dimension li { margin: 6px 0; }
.feedback-next { margin-top: 8px; }
.feedback-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.feedback-comparison section { min-width: 0; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.feedback-comparison h4 { font-size: 11px; font-family: monospace; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; color: var(--muted); }
.feedback-comparison section:last-child h4 { color: var(--brand); }
.ai-panel { overflow-wrap: anywhere; }
.feedback-priorities { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.feedback-priorities ol { margin: 10px 0 0; padding-left: 20px; }
.feedback-priorities li { margin: 10px 0; }
.fix-item .better { display: flex; align-items: baseline; gap: 6px; color: var(--ok); font-size: 15px; font-weight: 600; }
@media (max-width: 600px) { .feedback-comparison { grid-template-columns: 1fr; } }
.answer-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.answer-filters .field { display: flex; align-items: center; gap: 6px; margin: 0; }
.answer-filters select { font-size: 14px; }
.realtime-stats-card { margin-bottom: 16px; }
.realtime-stats-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.realtime-stat { display: flex; flex-direction: column; gap: 2px; }
.realtime-stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }

/* Daily tasks inherit the desktop surface and remain usable as a single column. */
.learning-plan { margin-bottom: 24px; }
.learning-progress { width: 100%; height: 6px; margin: 14px 0 4px; accent-color: var(--brand); }
.learning-tasks { list-style: none; margin: 8px 0 0; padding: 0; }
.learning-task { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.learning-task > .tag { justify-self: center; }
.learning-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.learning-count b { color: var(--ink); font-size: 18px; font-weight: 600; }
.learning-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.learning-footer > p { margin: 0; }
.learning-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.learning-task.done .learning-title { color: var(--muted); font-weight: 500; }
.learning-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.learning-task .tag { white-space: nowrap; }
.learning-task .tag:not(.ok):not(.warn) { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.learning-task > .btn { min-width: 72px; }
.learning-settings > summary { color: var(--muted); cursor: pointer; padding: 8px 0; }
.learning-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.learning-summary .grow { flex: 1 1 260px; min-width: 0; }
.learning-summary b { display: block; font-weight: 600; }
.learning-summary .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.learning-settings { margin-top: 14px; }
.learning-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.learning-fields label, .learning-fields :is(input, select) { width: 100%; min-width: 0; }
.learning-fields input[type="date"] { padding: 10px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); color: var(--ink); background: var(--card); font: inherit; }
.learning-settings > .btn { margin-top: 12px; }
@media (max-width: 600px) {
  .learning-fields { grid-template-columns: 1fr; }
  .learning-task { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .learning-title { grid-column: 1; }
  .learning-meta { grid-column: 1; grid-row: 2; }
  .learning-task > :is(.btn, .tag) { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
}
.realtime-setup { display: grid; gap: 8px; margin: 4px 0 12px; }
.realtime-setup .list-item { width: 100%; text-align: left; }
.realtime-setup .btn { justify-self: start; }
/* Floating pill: showing it must never reflow the top bar. */
.stop-audio {
  position: fixed; z-index: 45; left: 50%; bottom: calc(18px + var(--tabbar-h) + env(safe-area-inset-bottom));
  transform: translateX(-50%); min-height: 40px; padding: 8px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); border-color: transparent; box-shadow: 0 10px 30px #0004;
  animation: stop-audio-in .18s var(--ease);
}
.stop-audio[hidden] { display: none; }
.stop-audio svg { width: 16px; height: 16px; }
@keyframes stop-audio-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
:where([data-desktop-layout]) .stop-audio { bottom: 24px; }
/* Headings that receive focus from deep links are landmarks, not controls. */
.set-group h2[tabindex="-1"]:focus, .set-group h3[tabindex="-1"]:focus { outline: none; }
/* Secondary explanations: an ⓘ button with a floating bubble (ui.js infoTip). */
.info-tip-wrap { display: inline-flex; vertical-align: middle; }
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; flex-shrink: 0; }
.info-tip svg { width: 16px; height: 16px; }
.info-tip:hover, .info-tip[aria-expanded="true"] { color: var(--brand); background: var(--hover); }
.info-bubble { position: fixed; z-index: 300; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.6; box-shadow: 0 8px 28px #0003; pointer-events: none; }
.info-bubble[hidden] { display: none; }
.info-bubble p + p { margin-top: 6px; }
.tip-heading { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tip-heading > :first-child { margin: 0; }
@media (forced-colors: active) { .info-bubble { background: Canvas; color: CanvasText; border: 1px solid CanvasText; } }
/* Drill: answer support beside the question. */
.scaffold { margin-top: 16px; border-top: 1px solid var(--line); }
.scaffold-block { border-bottom: 1px solid var(--line); }
.scaffold-block:last-child { border-bottom: 0; }
.scaffold-block > summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; }
.scaffold-block ol { margin: 0 0 12px; padding-left: 22px; line-height: 1.8; }
.scaffold-block > p { margin-bottom: 12px; }
.scaffold-anchor { display: flex; flex-direction: column; margin-bottom: 10px; }
.scaffold-saved { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; }

/* ---------- 英文 / 中文面试空间（1.29） ---------- */
:root { --space-zh: #a1502f; --space-zh-soft: #f6e7df; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --space-zh: #f0a383; --space-zh-soft: #3d2a22; } }
:root[data-theme="dark"] { --space-zh: #f0a383; --space-zh-soft: #3d2a22; }
.space-switch { display: inline-flex; flex-shrink: 0; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.space-switch button { position: relative; min-height: 30px; padding: 3px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.space-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.space-switch button[data-lang="zh"][aria-pressed="true"] { background: var(--space-zh); color: var(--card); }
.space-switch button:not([aria-pressed="true"]):hover { color: var(--ink); background: var(--card); }
.space-due { margin-left: 4px; padding: 0 5px; border-radius: 8px; font-size: 11px; line-height: 16px; background: var(--warn-soft); color: var(--warn); }
.space-choice .row { flex-wrap: wrap; margin-top: 12px; }
.speech-check { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--space-zh-soft) 60%, transparent); }
.content-reload { margin-top: 12px; border-color: var(--brand); }
.content-results .list-item, #content-updates .list-item { gap: 10px; }
.sheet p.muted { white-space: pre-line; }
.speech-check h4 { margin: 0 0 4px; font-size: 14px; }
.speech-check p { margin: 2px 0; }
/* Narrow desktop windows: the space switch shares the header, so search shrinks to its icon (1.30). */
@media (max-width: 760px) {
  :where([data-desktop-layout]) .search-command span, :where([data-desktop-layout]) .search-command kbd { display: none; }
  :where([data-desktop-layout]) .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 600px) {
  :where([data-desktop-layout]) .search-command { display: none; }
  :where([data-desktop-layout]) .back-button .back-label { display: none; }
  :where([data-desktop-layout]) .topbar { padding-left: 16px; padding-right: 16px; gap: 8px; }
  :where([data-desktop-layout]) .topbar h1 { font-size: 20px; }
  .space-switch button { padding: 3px 9px; }
}
/* 1.32: fewer words — ⓘ tips beside headings, labels and status lines. */
.mode-heading .info-tip-wrap { margin-left: -6px; }
.field-tip { margin-bottom: 6px; }
.field-tip > label.field { margin-bottom: 0; }
.field-tip .info-tip { width: 24px; height: 24px; }
.service-name { display: flex; align-items: center; gap: 2px; min-width: 0; }
.daily-focus { gap: 4px; }
.daily-focus .text-button { margin-left: 8px; }
.row > .btn-block { flex: 1; width: auto; }
.followup-source { display: flex; align-items: center; gap: 2px; margin-top: 10px; }
.result-count .info-tip, .muted.small .info-tip { width: 24px; height: 24px; vertical-align: middle; }
.personal-training > h2 + .personal-actions { margin: auto 0 0; padding-top: 12px; }
/* Touch: the ⓘ stays small but its hit area reaches 44px. */
.info-tip { position: relative; }
@media (pointer: coarse) { .info-tip::after { content: ''; position: absolute; inset: -8px; } }

/* AI 生成标识（1.37）：模型产出与本地规则/题库原文的区分，沿用中性 tag 令牌，亮暗两套主题自动适配。 */
.ai-badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px; font-size: 11px; line-height: 1.5;
  letter-spacing: .02em; white-space: nowrap; vertical-align: middle;
}
