/* Оформление «Неоморфизм»: элементы будто выдавлены из фона мягкими тенями,
   бирюзовый акцент, светлая и тёмная тема */
:root {
  --bg: #e6e9ef;
  --card: #e6e9ef;
  --soft: #dde1e8;        /* фон «вдавленных» блоков */
  --ink: #1d2733;
  --text: #2a323d;
  --muted: #56606e;
  --line: #cfd5de;
  --accent: #087488;
  --accent-hover: #06687a;
  --accent-soft: #bfe3eb;
  --on-accent: #ffffff;
  --grad: linear-gradient(135deg, #0b8aa1, #06687a);
  --glow: rgba(8, 116, 136, .3);
  --hi: rgba(255, 255, 255, .9);   /* светлая тень сверху слева */
  --lo: rgba(150, 163, 184, .55);  /* тёмная тень снизу справа */
  --ok: #0f6e56;
  --ok-soft: #d3eee3;
  --warn: #993c1d;
  --warn-soft: #f6ddd3;
  --mark: #f6e3a1;
  --student: #dfe3ea;
  --raised: -6px -6px 14px var(--hi), 7px 7px 16px var(--lo);
  --raised-sm: -3px -3px 8px var(--hi), 4px 4px 10px var(--lo);
  --pressed: inset 3px 3px 8px var(--lo), inset -3px -3px 8px var(--hi);
  color-scheme: light;
}

/* Тёмная тема: по кнопке или по настройке системы, если кнопку не нажимали */
:root[data-theme="dark"] {
  --bg: #2a2d33;
  --card: #2a2d33;
  --soft: #24272c;
  --ink: #f1f4f8;
  --text: #e3e7ec;
  --muted: #a9b0bb;
  --line: #3a3e46;
  --accent: #22c7dc;
  --accent-hover: #4fd6e7;
  --accent-soft: #1d4f5a;
  --on-accent: #06222a;
  --grad: linear-gradient(135deg, #22c7dc, #0f8fb8);
  --glow: rgba(34, 199, 220, .35);
  --hi: rgba(255, 255, 255, .055);
  --lo: rgba(0, 0, 0, .45);
  --ok: #5fd6a4;
  --ok-soft: #1f3d33;
  --warn: #f3a37c;
  --warn-soft: #4a2c20;
  --mark: #5a4a14;
  --student: #30343b;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2a2d33;
    --card: #2a2d33;
    --soft: #24272c;
    --ink: #f1f4f8;
    --text: #e3e7ec;
    --muted: #a9b0bb;
    --line: #3a3e46;
    --accent: #22c7dc;
    --accent-hover: #4fd6e7;
    --accent-soft: #1d4f5a;
    --on-accent: #06222a;
    --grad: linear-gradient(135deg, #22c7dc, #0f8fb8);
    --glow: rgba(34, 199, 220, .35);
    --hi: rgba(255, 255, 255, .055);
    --lo: rgba(0, 0, 0, .45);
    --ok: #5fd6a4;
    --ok-soft: #1f3d33;
    --warn: #f3a37c;
    --warn-soft: #4a2c20;
    --mark: #5a4a14;
    --student: #30343b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 { color: var(--ink); }
h2 { margin-top: 0; font-size: 24px; }
h3 { font-size: 18px; margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Шапка: название, этапы, тема ---------- */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}
header h1 { font-size: 17px; margin: 0; }
.badge { font-size: 13px; color: var(--muted); }

.steps { display: flex; gap: 6px; min-width: 260px; }
.steps span {
  flex: 1; font-size: 12px; color: var(--muted); text-align: center;
  padding-top: 8px; border-top: 5px solid var(--line); border-radius: 3px 3px 0 0;
}
.steps span.active { border-top-color: var(--accent); color: var(--ink); font-weight: 600; }
.steps span.done { border-top-color: var(--accent); }

.theme {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  font-size: 18px; line-height: 1;
}

main { padding: 28px 16px; max-width: 1200px; margin: 0 auto; }

/* ---------- Карточки и элементы ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}
.narrow { max-width: 780px; margin: 0 auto; }

.muted { color: var(--muted); }
.error { color: var(--warn); }
.label { font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 8px; }

label { display: block; margin: 16px 0; font-weight: 600; color: var(--ink); }
select, input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

button {
  font: inherit;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
button:hover { border-color: var(--accent); }
button:active { transform: scale(.98); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .45; cursor: default; transform: none; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Таймер — «таблетка», в последние секунды краснеет */
#read-timer, #timer, #mono-timer {
  background: var(--soft); color: var(--ink);
  padding: 4px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
#read-timer.low, #timer.low, #mono-timer.low { background: var(--warn-soft); color: var(--warn); }

/* ---------- Текст для чтения ---------- */
.text { white-space: pre-wrap; font-size: 19px; line-height: 1.75; margin: 16px 0 24px; }
.text.small { font-size: 16px; line-height: 1.6; margin: 0; }
.text mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.hard-words { font-size: 15px; color: var(--muted); }
.hard-words b { color: var(--ink); }
.q5 { background: var(--soft); border-radius: 14px; padding: 14px 16px; margin: 12px 0; font-size: 16px; }
.read-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* ---------- Пауза перед этапом ---------- */
.stage { text-align: center; padding: 48px 28px; }
.stage-num {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  border: 6px solid var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
}
.stage p { font-size: 19px; max-width: 560px; margin-left: auto; margin-right: auto; }
.stage-buttons { justify-content: center; }
.stage-buttons .primary { padding: 14px 40px; font-size: 19px; }
.stage-talk-preview { text-align: left; margin: 24px 0; }
.stage-talk-preview[hidden] { display: none; }
.stage-talk-preview:not([hidden]) ~ .stage-buttons .primary { padding-inline: 16px; max-width: 100%; }
/* BEGIN session navigation and voice */
.session-exit { font-size: 13px; white-space: nowrap; color: var(--accent); }
body:has(#btn-exit-session:not([hidden])) > .exam-header { position: sticky; top: 0; z-index: 5; }
.stage-instruction-audio audio { width: min(100%, 360px); height: 40px; }
.stage-instruction-audio #stage-audio-status { font-size: 13px; margin: 4px auto 8px; }
@media (max-width: 800px) {
  .exam-header .session-exit { grid-column: 1 / -1; min-height: 32px; padding: 3px 8px; justify-self: start; }
  body:has(#screen-talk:not([hidden])) > .exam-header { display: flex; flex-wrap: wrap; gap: 3px; }
  body:has(#screen-talk:not([hidden])) > .exam-header .session-exit { min-height: 28px; }
}
/* END session navigation and voice */

/* ---------- Беседа ---------- */
.talk { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
.text-side { max-height: calc(100vh - 150px); overflow: auto; }
.chat-side { display: flex; flex-direction: column; min-height: 520px; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; color: var(--ink);
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.chat { flex: 1; overflow: auto; padding: 12px 0; max-height: 55vh; }
.msg { margin: 10px 0; padding: 10px 16px; border-radius: 18px; max-width: 88%; }
.msg.examiner { background: var(--soft); border-bottom-left-radius: 6px; }
.msg.student { background: var(--student); border: 1px solid var(--line); margin-left: auto; border-bottom-right-radius: 6px; }
.msg .who { font-size: 12px; color: var(--accent); display: block; font-weight: 600; }

/* Строка микрофона: статус, уровень звука, кнопки */
.mic-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.read-controls { grid-template-columns: 1fr 120px auto auto; }
.status { font-weight: 600; color: var(--ink); }
.level { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
#level-bar, #read-level-bar, #mono-level-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width .1s;
}

.typed { margin-top: 12px; font-size: 14px; color: var(--muted); }
.typed summary { cursor: pointer; }
.typed form { display: flex; gap: 8px; margin-top: 8px; }
.typed input { margin: 0; }
#mono-typed-form { flex-direction: column; }

/* BEGIN compact talk workspace */
#screen-talk .talk {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "text question" "text history" "text controls";
  grid-template-rows: auto auto auto;
  align-items: stretch; gap: 12px;
}
#screen-talk .text-side { grid-area: text; min-width: 0; max-height: 75vh; overflow-y: auto; overscroll-behavior: contain; }
#screen-talk .text-side .text { font-size: 18px; line-height: 1.65; }
#screen-talk .talk-question { grid-area: question; min-width: 0; padding: 16px; }
#screen-talk .chat-head { padding-bottom: 8px; gap: 8px; }
#screen-talk .talk-current-question { font-weight: 600; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
#screen-talk .talk-history { grid-area: history; min-width: 0; padding: 12px 16px; }
#screen-talk .talk-history summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); }
#screen-talk .chat { max-height: 30vh; overflow-y: auto; overscroll-behavior: contain; }
#screen-talk .talk-controls { grid-area: controls; padding: 12px 16px; min-width: 0; }
#screen-talk .mic-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 0; border: 0; }
#screen-talk .mic-row .status { grid-column: 1 / -1; font-size: 14px; line-height: 1.3; }
#screen-talk .talk-mic-meter { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); }
#screen-talk .talk-mic-meter .level { display: block; flex: 1; min-width: 24px; height: 8px; }
#screen-talk .talk-mic-meter .voice-orb { display: none; }
#screen-talk .mic-row[data-phase="listening"] .talk-mic-meter { color: #16864d; }
#screen-talk .mic-row[data-phase="listening"] #level-bar { background: #16864d; }
#screen-talk .mic-row[data-phase="listening"] .status { color: #16864d; }
#screen-talk .mic-row[data-phase="speaking"] .status { color: var(--accent); }
#screen-talk .mic-row[data-phase="warning"] .status { color: var(--warn); }
#screen-talk .mic-row[data-phase="working"] .status { color: var(--muted); }
#screen-talk .talk-controls button { min-height: 42px; }
#screen-talk .talk-controls .typed { margin-top: 8px; }
#screen-talk .talk-controls .typed input { min-width: 0; }
#screen-talk .talk-privacy-link { font-size: 12px; display: inline-block; color: var(--muted); }
@media (max-width: 800px) {
  body:has(#screen-talk:not([hidden])) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body:has(#screen-talk:not([hidden])) > .exam-header { flex: none; padding: 5px 12px; display: block; }
  body:has(#screen-talk:not([hidden])) > .exam-header :is(.brand, .exam-login, .theme) { display: none; }
  body:has(#screen-talk:not([hidden])) > .exam-header .steps { margin: 0; }
  body:has(#screen-talk:not([hidden])) > main { flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; padding: 6px 10px; }
  body:has(#screen-talk:not([hidden])) > .site-footer { display: none; }
  #screen-talk { flex: 1; min-height: 0; }
  #screen-talk .talk { height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-areas: "question" "text" "history" "controls"; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 7px; }
  #screen-talk .talk > .card { border-radius: 16px; padding: 9px 12px; }
  #screen-talk .talk-question { max-height: 26dvh; overflow-y: auto; overscroll-behavior: contain; }
  #screen-talk .talk-current-question { font-size: 15px; }
  #screen-talk .chat-head { padding-bottom: 5px; font-size: 14px; }
  #screen-talk .timer { font-size: 17px; padding: 4px 10px 4px 4px; gap: 6px; }
  #screen-talk .timer::before { width: 26px; height: 26px; }
  #screen-talk .text-side { min-height: 0; max-height: none; }
  #screen-talk .text-side .text { font-size: 17px; line-height: 1.55; }
  #screen-talk .talk-history { max-height: 24dvh; overflow-y: auto; }
  #screen-talk .chat { max-height: 18dvh; padding: 4px 0; }
  #screen-talk .talk-controls { max-height: 43dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  #screen-talk .talk-controls .typed { margin-top: 5px; }
  #screen-talk .talk-privacy-link { line-height: 1.2; }
}
@media (max-width: 800px) and (max-height: 480px) {
  body:has(#screen-talk:not([hidden])) { height: auto; min-height: 100dvh; overflow: auto; }
  #screen-talk .talk { min-height: 420px; }
  #screen-talk .talk-controls { max-height: none; }
}
/* END compact talk workspace */

/* ---------- Монолог ---------- */
.mono-topics { display: grid; gap: 12px; }
.mono-topic {
  display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start;
  text-align: left; padding: 18px; border-radius: 18px; background: var(--card);
}
.mono-topic:hover { background: var(--soft); border-color: var(--accent); }
.mono-topic .icon {
  width: 48px; height: 48px; border-radius: 14px; background: var(--soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.mono-topic .kind { display: block; font-size: 14px; color: var(--muted); }
.mono-topic img { grid-column: 2; max-width: 240px; border-radius: 12px; margin-top: 8px; }
.mono-photo { display: block; max-width: 100%; border-radius: 16px; margin: 12px 0; }

/* ---------- Разбор ---------- */
.hero { display: flex; align-items: center; gap: 22px; margin-bottom: 8px; }
.ring {
  --p: 0;
  flex: none; width: 112px; height: 112px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0);
  display: flex; align-items: center; justify-content: center;
}
.ring span {
  width: 86px; height: 86px; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--ink);
}
.hero h2 { margin: 0 0 4px; }
.verdict { font-weight: 600; color: var(--ok); margin: 0 0 4px; }
.verdict.bad-verdict { color: var(--warn); }

.pill { font-size: 14px; font-weight: 600; padding: 2px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--warn-soft); color: var(--warn); }

.report-list { padding-left: 22px; }
.report-list li { margin: 8px 0; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--warn); font-weight: 600; }
.criteria { list-style: none; padding: 0; }
.criteria li { margin: 8px 0; padding: 12px 14px; background: var(--soft); border-radius: 14px; }
.criteria .why { display: block; font-size: 15px; color: var(--muted); margin-left: 28px; }
.doubt { font-size: 15px; color: var(--muted); background: var(--soft); border-radius: 14px; padding: 10px 14px; }
details { margin: 10px 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
pre { white-space: pre-wrap; font: 14px/1.5 inherit; background: var(--soft); padding: 14px; border-radius: 14px; }
.phrases li { margin: 2px 0; }
.say { padding: 0 10px; font-size: 13px; line-height: 1.7; margin-left: 2px; }

/* ---------- Телефон ---------- */
@media (max-width: 800px) {
  header { padding: 10px 16px; }
  .steps { order: 3; width: 100%; min-width: 0; }
  main { padding: 16px 12px; }
  .card { padding: 20px 16px; border-radius: 18px; }
  .talk { grid-template-columns: 1fr; }
  .text-side { max-height: 30vh; }
  .mic-row, .read-controls { grid-template-columns: 1fr 1fr; }
  .mic-row .status { grid-column: 1 / -1; }
  .hero { gap: 14px; }
  .ring { width: 88px; height: 88px; }
  .ring span { width: 68px; height: 68px; font-size: 24px; }
  .mono-topic img { max-width: 100%; }
}

/* Результат этапа */
.result-title { font-size: 22px; margin-top: 4px; }

/* Выбор экзаменатора */
.field-title { font-weight: 600; color: var(--ink); margin: 16px 0 6px; }
.examiners { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.examiner {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; background: var(--card);
}
.examiner:hover { border-color: var(--accent); }
.examiner.selected { border: 2px solid var(--accent); background: var(--soft); padding: 9px 11px; }
.ex-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.ex-text { display: flex; flex-direction: column; line-height: 1.3; }
.ex-text .muted { font-size: 13px; }

/* Устный разбор после этапа */
.debrief { background: var(--soft); border-radius: 18px; padding: 14px 16px; margin: 6px 0 16px; }
.debrief-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.debrief-who { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.debrief-who .muted { font-size: 13px; }
.debrief p { margin: 10px 0 0; font-size: 17px; }

/* Прогресс на главной */
.progress-card { margin-bottom: 16px; }
.countdown { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.countdown .days { font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 12px; }
.stats div { background: var(--soft); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.stats .muted { font-size: 13px; }
.stats b { font-size: 22px; color: var(--ink); }
.stats b.ok { color: var(--ok); }
.stats b.bad { color: var(--warn); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding: 4px 0; }
.bar { flex: 1; max-width: 40px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.bar span { width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 4px; }
.bar b { font-size: 12px; color: var(--muted); font-weight: 600; }
.weak { margin: 12px 0 4px; }
.small-note { font-size: 13px; margin: 6px 0 0; }
button.link { border: none; background: none; padding: 0; color: var(--accent); font-size: 13px; text-decoration: underline; cursor: pointer; }
@media (max-width: 800px) { .stats b { font-size: 18px; } .countdown .days { font-size: 32px; } }

/* Школа монолога */
.school-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 18px; }
.school-step { font-size: 14px; padding: 6px 12px; }
.school-step.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.school-step.done { border-color: var(--accent); color: var(--accent); }
.frame li { margin: 3px 0; color: var(--ink); }
.school-photo { max-height: 320px; object-fit: cover; }
.school-hint { margin-top: 14px; }
.school-sample { margin: 10px 0; padding: 10px 14px; background: var(--soft); border-radius: 8px; font-style: italic; }
.school-question { font-size: 20px; font-weight: 600; color: var(--ink); margin: 14px 0 4px; }
.phrase-counter { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.phrase-counter b { font-size: 26px; color: var(--accent); }
.phrase-counter .level { grid-column: 1 / -1; }
.phrase-counter .level div { height: 100%; background: var(--accent); border-radius: 999px; }
.chips .pill { display: inline-block; margin: 2px; }
.school-memo { margin: 18px 0; }
.school-memo summary { font-size: 17px; }
.school-memo > .memo-type { margin-top: 12px; }
.school-fb { border-radius: 14px; padding: 12px 14px; margin: 12px 0 4px; }
.ok-box { background: var(--ok-soft); color: var(--ok); }
.bad-box { background: var(--warn-soft); color: var(--warn); }

/* ---------- Памятки перед началом ---------- */
.memo-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 8px; margin: 4px 0 20px; }
.memo-overview > span { display: flex; flex-direction: column; justify-content: center; gap: 4px; background: var(--soft); border-radius: 12px; padding: 12px 8px; font-size: 14px; color: var(--muted); text-align: center; }
.memo-overview b { color: var(--ink); }
.memo-overview .total { background: transparent; border: 1px solid var(--accent); }
.memo-overview small { font-size: 12px; color: var(--ink); }
@media (max-width: 650px) {
  .memo-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memo-overview .total { grid-column: 1 / -1; }
}
.memo-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.memo-tabs button {
  border: none; border-top: 5px solid var(--line); border-radius: 0; background: none;
  padding: 10px 4px 0; min-height: 54px; font-size: 15px; line-height: 1.3; color: var(--muted);
}
.memo-tabs button b { color: inherit; margin-right: 4px; }
.memo-tabs button.active { border-top-color: var(--accent); color: var(--ink); font-size: 20px; font-weight: 600; }
.memo-tabs button.seen { border-top-color: var(--accent-soft); }
.memo-times { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; margin: 18px 0 0; }
.memo-times span { flex: 0 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 6px clamp(5px, 2vw, 12px); font-size: 14px; line-height: 1.35; color: var(--muted); text-align: center; white-space: normal; overflow-wrap: anywhere; align-content: center; }
.memo-times b { color: var(--ink); display: inline-block; }
.memo h3 { margin-top: 22px; }
.memo-list { margin: 0; padding-left: 20px; }
.memo-list li { margin: 6px 0; }
.memo-example { background: var(--soft); border-radius: 16px; padding: 12px 16px; font-size: 15px; }
.memo-example p { margin: 6px 0; font-size: 17px; color: var(--ink); }
.memo-answer span { display: inline-block; width: 22px; font-weight: 700; }
.memo-answer.ok span { color: var(--ok); }
.memo-answer.bad { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--warn); }
.memo-answer.bad span { color: var(--warn); }
.memo-scheme { display: flex; gap: 8px; margin: 8px 0 2px; }
.memo-scheme span {
  background: transparent; border: 0; border-radius: 0;
  padding: 6px 4px; text-align: center; font-size: 13px; color: var(--muted); min-width: 0;
  display: flex; flex-direction: column; line-height: 1.3; overflow-wrap: anywhere;
}
.memo-scheme span.main { background: transparent; color: var(--muted); }
.memo-scheme b { font-size: 17px; color: var(--ink); }
.memo-monologue-scheme > span { flex: 1; }
.memo-monologue-scheme > .main { flex: 2; }

.history-switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 18px; }
.history-switch input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; }
.history-switch-track { flex: 0 0 48px; height: 28px; border-radius: 16px; background: var(--soft); border: 1px solid var(--muted); transition: background .15s; }
.history-switch-track::before { content: ''; display: block; width: 20px; height: 20px; margin: 3px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.history-switch input:checked + .history-switch-track { background: var(--accent); border-color: var(--accent); }
.history-switch input:checked + .history-switch-track::before { transform: translateX(20px); background: var(--bg); }
.history-switch input:focus-visible + .history-switch-track { outline: 3px solid var(--accent); outline-offset: 3px; }
.history-switch input:disabled + .history-switch-track { opacity: .45; }
@media (prefers-reduced-motion: reduce) {
  .history-switch-track, .history-switch-track::before { transition: none; }
}

.pricing-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.pricing-plan {
  background: var(--bg);
  border: none;
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--raised);
}
.pricing-plan h3 { margin: 0; font-size: 20px; font-weight: 600; }
.pricing-price { margin: 14px 0 24px; color: var(--ink); line-height: 1.15; }
.pricing-price strong { font-size: 40px; font-weight: 300; font-variant-numeric: tabular-nums; }
.pricing-price span { color: var(--muted); font-size: 16px; }
.pricing-plan button.pricing-action {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--on-accent);
  box-shadow: 0 6px 16px var(--glow);
  font-weight: 600;
}
.pricing-plan button.pricing-action:hover:not(:disabled) { filter: brightness(1.07); }
.pricing-plan button.pricing-action:active:not(:disabled) { box-shadow: var(--pressed); }
.pricing-plan button.pricing-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pricing-plan button.pricing-action:disabled { background: var(--soft); color: var(--muted); box-shadow: var(--pressed); opacity: 1; }
.pricing-plan h4 { margin: 28px 0 16px; font-size: 15px; color: var(--muted); font-weight: 500; }
.pricing-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.pricing-features li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.55;
}
.pricing-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  box-shadow: var(--raised-sm);
  font-size: 11px;
  font-weight: 700;
}
#btn-pricing-back { margin-bottom: 12px; }

/* BEGIN pricing onboarding */
.pricing-onboarding { max-width: 560px; margin: 20px auto 24px; padding: clamp(20px, 5vw, 28px); background: var(--bg); border-radius: 24px; box-shadow: var(--raised-sm); }
.pricing-onboarding h3 { font-size: clamp(21px, 5vw, 25px); line-height: 1.25; margin: 0 0 12px; }
.pricing-free-badge { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; background: var(--bg); color: var(--ink); border-radius: 15px; padding: 10px 14px; font-size: 14px; line-height: 1.35; font-weight: 700; box-shadow: var(--raised-sm); }
.pricing-free-badge svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.pricing-onboarding svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pricing-onboarding > p:not(.pricing-login) { margin: 14px 0 20px; color: var(--text); line-height: 1.5; }
.pricing-onboarding-steps { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0 0 24px; list-style: none; text-align: center; }
.pricing-onboarding-steps::before { content: ''; position: absolute; top: 27px; left: 25%; right: 25%; height: 2px; background: var(--line); }
.pricing-onboarding-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; font-size: 14px; line-height: 1.35; color: var(--ink); }
.pricing-step-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: var(--bg); box-shadow: var(--raised-sm); color: var(--accent); }
.pricing-step-icon svg { width: 28px; height: 28px; }
.pricing-register { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 14px; border-radius: 12px; background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 16px var(--glow); font-size: 16px; font-weight: 700; text-align: center; text-decoration: none; }
.pricing-register:hover { filter: brightness(1.07); }
.pricing-login { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.pricing-login a { color: var(--accent); font-weight: 700; padding: 8px 3px; }
/* END pricing onboarding */
#promo-label { max-width: 360px; }
@media (max-width: 1000px) {
  .pricing-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pricing-plans { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pricing-plan { padding: 20px; }
}
.memo-nav { align-items: center; }
.memo-nav .link { margin-left: auto; }
/* Переключатель типа монолога внутри памятки */
.memo-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--soft); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.memo-types button { border: none; border-radius: 10px; background: none; padding: 8px 4px; font-size: 15px; color: var(--muted); }
.memo-types button.active { background: var(--card); color: var(--ink); font-weight: 600; }
.memo-type h4 { margin: 22px 0 8px; font-size: 17px; }
.memo-what { font-size: 17px; margin: 0 0 12px; }
.memo-formula { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin: 12px 0 0; }
/* Шаги ответа: название, сколько предложений, что сказать, начало фразы */
.memo-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 8px; }
.memo-steps li {
  counter-increment: step; position: relative; padding: 10px 14px 10px 46px;
  background: var(--soft); border-radius: 14px;
}
.memo-steps li::before {
  content: counter(step); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 700; text-align: center; line-height: 24px;
}
.memo-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.memo-step-head span { font-size: 14px; color: var(--muted); white-space: nowrap; }
.memo-steps .muted { font-size: 15px; margin: 2px 0 4px; }
.memo-starts { font-style: italic; }
.memo-more { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.memo-more summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.memo-sample { margin: 10px 0 0; padding-left: 26px; }
.memo-sample li { margin: 4px 0; }
.memo-type .memo-example .memo-answer { font-size: 16px; }
.memo-type .memo-answer.ok { margin-bottom: 12px; }.memo-type .memo-example + h4, .memo-type ol + .memo-example { margin-top: 14px; }

/* Выбор режима */
.modes { display: grid; gap: 10px; margin-bottom: 16px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px 16px; border-radius: 16px; background: var(--card);
}
.mode b { font-size: 18px; color: var(--ink); }
.mode .muted { font-size: 14px; line-height: 1.4; }
.mode:hover { background: var(--soft); }
#btn-to-mode { margin-bottom: 12px; }

@media (max-width: 520px) {
  /* All memo schemes are readable lists on phones, including the four-part story. */
  .memo-scheme { flex-direction: column; gap: 0; }
  .memo-scheme > span { flex: none !important; display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; padding: 8px 0; }
  .memo-scheme > span + span { border-top: 1px solid var(--line); }
  .memo-scheme > span b { text-align: right; }
  .memo-tabs button { font-size: 13px; }
  .memo-tabs button.active { font-size: 16px; }
  .memo-scheme span { font-size: 12px; }
  .memo-scheme b { font-size: 14px; }
  .memo-types button { font-size: 13px; }
  .memo-nav .link { margin-left: 0; width: 100%; text-align: left; }
}

/* Анимация «слушаю»: круг с микрофоном дышит в такт голосу (--v от 0 до 1 задаёт recorder.js) */
.voice-orb { display: none; position: relative; width: 56px; height: 56px; justify-self: center; --v: 0; }
.mic-row.listening .voice-orb { display: block; }
.mic-row.listening .level { display: none; }
.voice-orb b {
  position: absolute; inset: 8px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  transform: scale(calc(1 + var(--v) * .25));
}
.voice-orb svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
.voice-orb i {
  position: absolute; inset: 8px; border-radius: 50%; background: var(--accent);
  opacity: calc(.18 + var(--v) * .25); transform: scale(calc(1.15 + var(--v) * .9));
  animation: orb-breathe 1.8s ease-in-out infinite;
}
.voice-orb i + i { opacity: calc(.1 + var(--v) * .15); transform: scale(calc(1.3 + var(--v) * 1.5)); animation-delay: -.9s; }
@keyframes orb-breathe { 50% { translate: 0 0; scale: 1.12; } }
@media (prefers-reduced-motion: reduce) { .voice-orb i { animation: none; } }

/* ================= Неоморфизм: выпуклые и вдавленные элементы =================
   Выпуклое (--raised) — карточки, кнопки, плитки. Вдавленное (--pressed) — поля ввода,
   подсказки, полоски уровня. Главная кнопка — бирюзовый градиент со свечением. */
header { background: var(--bg); border-bottom: none; box-shadow: 0 6px 16px var(--lo); position: relative; z-index: 1; }
.logo { background: var(--grad); color: var(--on-accent); border-radius: 50%; box-shadow: var(--raised-sm); }
.steps { gap: 8px; }
.steps span { border-top: none; padding: 6px 4px; border-radius: 999px; box-shadow: var(--raised-sm); }
.steps span.done { color: var(--accent); }
.steps span.active { background: var(--grad); color: var(--on-accent); box-shadow: 0 4px 12px var(--glow); }

.card { border: none; border-radius: 28px; box-shadow: var(--raised); }
main { padding-top: 32px; }

button { border: none; background: var(--bg); box-shadow: var(--raised-sm); }
button:hover { color: var(--accent); }
button:active { box-shadow: var(--pressed); transform: none; }
button.primary { background: var(--grad); color: var(--on-accent); border: none; box-shadow: 0 6px 16px var(--glow); }
button.primary:hover { background: var(--grad); color: var(--on-accent); filter: brightness(1.07); }
button.primary:active { box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .3); }
button:disabled { box-shadow: none; }
button.link, .memo-tabs button, .memo-types button { box-shadow: none; }
.theme { color: var(--muted); }

select, input, textarea { background: var(--soft); border: none; box-shadow: var(--pressed); }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); }

/* Вдавленные блоки */
.q5, .criteria li, .doubt, pre, .debrief, .stats div, .memo-steps li, .memo-example,
.phrase-counter, .school-sample, .level, .memo-types, .memo-more {
  background: var(--soft); border: none; box-shadow: var(--pressed);
}
#level-bar, #read-level-bar, #mono-level-bar, .phrase-counter .level div, .bar span { background: var(--grad); }
.memo-steps li::before { background: var(--grad); }
.memo-types button.active { background: var(--bg); box-shadow: var(--raised-sm); }
.memo-scheme span { background: transparent; border-radius: 0; box-shadow: none; }
.memo-scheme span.main { background: transparent; color: var(--muted); }
.memo-scheme span.main b { color: var(--ink); }
.memo-times span { border: none; box-shadow: var(--raised-sm); }
.memo-formula { box-shadow: var(--raised-sm); }

/* Таймер-кольцо: бирюзовая дуга показывает, сколько времени осталось (или прошло).
   Долю --p от 0 до 1 задаёт setTimer() в app.js */
.timer {
  --p: 1;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg); color: var(--ink); font-size: 18px; font-weight: 600;
  padding: 6px 16px 6px 6px; border-radius: 999px; box-shadow: var(--raised-sm);
}
.timer::before {
  content: ""; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle, var(--bg) 50%, transparent 52%),
    conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--soft) 0);
  box-shadow: var(--pressed);
}
#read-timer.low, #timer.low, #mono-timer.low { background: var(--bg); color: var(--warn); }
.timer.low::before {
  background:
    radial-gradient(circle, var(--bg) 50%, transparent 52%),
    conic-gradient(var(--warn) calc(var(--p) * 360deg), var(--soft) 0);
}

/* Беседа */
.chat-head, .mic-row { border-color: transparent; }
.msg.examiner { background: var(--soft); box-shadow: var(--pressed); }
.msg.student { background: var(--bg); border: none; box-shadow: var(--raised-sm); }
.voice-orb b, .voice-orb i { background: var(--grad); }

/* Плитки: режимы, темы монолога, экзаменаторы */
.modes { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode, .mono-topic, .examiner { background: var(--bg); border: none; border-radius: 22px; box-shadow: var(--raised); }
.mode { padding: 18px 16px; gap: 6px; }
.mode:hover, .mono-topic:hover { background: var(--bg); color: inherit; }
.mode:hover b, .mono-topic:hover b { color: var(--accent); }
.mode-icon { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.mono-topic .icon { background: var(--soft); box-shadow: var(--pressed); }
.examiner.selected { border: none; padding: 10px 12px; background: var(--soft); box-shadow: var(--pressed), inset 0 0 0 2px var(--accent); }
.ex-avatar { background: var(--grad); color: var(--on-accent); }
#examiner-voice-status:empty { display: none; }
#examiner-audio { display: block; width: 100%; max-width: 420px; margin: 12px 0 20px; }

/* Главная: обратный отсчёт, номер этапа, кольцо итога */
.countdown .days { font-size: 48px; font-weight: 300; color: var(--ink); }
.stage-num { border: none; background: var(--bg); box-shadow: var(--raised); color: var(--accent); }
.ring { background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0); box-shadow: var(--raised); }
.ring span { background: var(--bg); font-weight: 300; box-shadow: var(--pressed); }
.school-step.active { background: var(--grad); color: var(--on-accent); }
.mono-photo { box-shadow: var(--raised-sm); }

@media (max-width: 800px) {
  .modes { grid-template-columns: 1fr; }
  .card { border-radius: 24px; }
}

/* Документы, настройки на устройстве и формы аккаунта */
a { color: var(--ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .15em; }
a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
header a.brand { text-decoration: none; font-weight: 700; }

.exam-header {
  background: var(--bg);
  box-shadow: 0 4px 12px var(--lo);
  gap: 12px;
}

.exam-header .brand { min-width: 0; }
.exam-header .exam-logo { flex: none; color: var(--accent); }
.exam-header h1 { color: var(--ink); line-height: 1.15; }
.exam-header .badge { color: var(--muted); }

.exam-header .exam-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 14px;
}

.exam-header .exam-login {
  background: var(--grad);
  color: var(--on-accent);
  box-shadow: 0 4px 10px var(--glow);
  font-weight: 700;
  text-decoration: none;
}

.exam-header .exam-login:hover { filter: brightness(1.07); }
.exam-header :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.exam-header .theme {
  background: var(--bg);
  color: var(--muted);
  box-shadow: var(--raised-sm);
}

.exam-header .theme:hover { color: var(--accent); }

@media (max-width: 600px) {
  .exam-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 14px 12px;
  }

  .exam-header .brand { grid-column: 1; grid-row: 1; gap: 8px; margin: 0; }
  .exam-header .exam-logo { width: 32px; height: 32px; }
  .exam-header h1 { font-size: 16px; overflow-wrap: break-word; }
  .exam-header .badge { font-size: 12px; }
  .exam-header .exam-login { grid-column: 2; grid-row: 1; }
  .exam-header .theme { grid-column: 3; grid-row: 1; width: 36px; height: 36px; }
  .exam-header .steps { grid-column: 1 / -1; min-width: 0; margin-top: 4px; }
}

.account-form[action="/login"] .buttons { flex-direction: column; align-items: stretch; gap: 20px; }
.account-form[action="/login"] .buttons > button { width: 100%; }
.account-form[action="/login"] .buttons > a[href="/register"] {
  display: block;
  text-align: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
/* End exam header and login appearance */
.site-footer { max-width: 1000px; margin: 1rem auto; padding: 1rem; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem 1.3rem; font-size: .92rem; }
.site-footer a { padding-block: .25rem; }
.document-main { max-width: 800px; overflow-wrap: anywhere; }
.document-main h1 { font-size: clamp(1.55rem, 5vw, 2.2rem); line-height: 1.16; margin: 0 0 1rem; }
.document-main h2 { margin: 1.8rem 0 .5rem; font-size: 1.24rem; }
.document-main .buttons { align-items: center; }
.account-form { max-width: 34rem; }
/* BEGIN account dashboard */
.account-dashboard { max-width: 540px; margin: 0 auto; display: grid; gap: 20px; }
.account-dashboard svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; width: 24px; height: 24px; flex: none; }
.account-dashboard-profile { display: flex; align-items: center; gap: 16px; min-width: 0; }
.account-dashboard-profile > div { min-width: 0; }
.account-dashboard-profile h1 { font-size: clamp(25px, 6vw, 32px); margin: 0 0 5px; overflow-wrap: anywhere; line-height: 1.2; }
.account-dashboard-avatar { width: 68px; height: 68px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--accent); box-shadow: var(--raised-sm); background: var(--bg); }
.account-dashboard-avatar svg { width: 35px; height: 35px; }
.account-dashboard-role { display: inline-block; background: var(--accent-soft); color: var(--ink); padding: 4px 12px; border-radius: 9px; font-size: 13px; font-weight: 650; }
.account-dashboard-tiles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.account-dashboard-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; background: var(--bg); box-shadow: var(--raised-sm); border-radius: 15px; padding: clamp(12px,4vw,18px); min-width: 0; }
.account-dashboard-tile svg { color: var(--accent); width: 28px; height: 28px; margin-bottom: 3px; }
.account-dashboard-tile b { color: var(--ink); font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.account-dashboard-tile span { color: var(--muted); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.account-dashboard-actions { display: grid; gap: 12px; }
.account-dashboard-actions a, .account-dashboard-logout button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px; border-radius: 12px; font-weight: 700; text-decoration: none; text-align: center; }
.account-dashboard-primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 16px var(--glow); }
.account-dashboard-secondary { background: var(--bg); color: var(--ink); box-shadow: var(--raised-sm); }
.account-dashboard-actions a:hover { filter: brightness(1.07); }
.account-dashboard-details { padding: 14px 16px; border-radius: 15px; background: var(--bg); box-shadow: var(--raised-sm); }
.account-dashboard-details summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.account-dashboard-details summary::-webkit-details-marker { display: none; }
.account-dashboard-details summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: auto; flex: none; }
.account-dashboard-details[open] summary::after { transform: rotate(225deg); }
.account-dashboard-details p { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; margin: 12px 0 0; }
.account-dashboard-logout { margin: 0; justify-self: start; }
.account-dashboard-logout button { min-width: 110px; font-size: 15px; }
/* END account dashboard */
.account-form > label { margin-bottom: .2rem; }
.account-form p.muted, .data-note, .account-form span.muted { font-size: .92rem; }
.account-form p.muted { margin: .35rem 0 .8rem; }
/* BEGIN password visibility */
.password-field { position: relative; }
.password-field > input { padding-inline-end: 52px; }
.password-field > .password-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.password-field > .password-toggle:hover, .password-field > .password-toggle[aria-pressed="true"] { color: var(--accent); }
.password-field > .password-toggle:active { transform: translateY(-50%); }
.password-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle[aria-pressed="false"] .password-eye-off, .password-toggle[aria-pressed="true"] .password-eye { display: none; }
/* END password visibility */
.check { display: flex; align-items: flex-start; gap: .7rem; }
.check input { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; margin: .2rem 0 0; padding: 0; accent-color: var(--accent); }
fieldset { min-width: 0; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; padding: .6rem 1rem 1rem; }
legend { font-weight: 700; }
.field-error { color: var(--ink); font-weight: 650; border-left: 3px solid var(--warn); padding-left: .6rem; }
.data-note { max-width: 780px; margin: .85rem auto; }
@media (max-width: 480px) {
  .document-main { padding: 1rem .75rem; }
  .document-main .card { padding: 1.15rem; }
}

/* BEGIN sticky memo navigation */
#screen-memo { isolation: isolate; }
#screen-memo[hidden] .memo-tabs { position: static; }
.screen[hidden] { display: none !important; }
#screen-memo .memo-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  padding: 10px 12px 12px;
  margin-inline: -12px;
  box-shadow: 0 8px 12px -9px var(--lo);
}
#screen-memo .memo-tabs button { min-width: 0; }
#screen-memo .memo-tabs button.active { border-top-color: var(--accent); }
/* END sticky memo navigation */

/* BEGIN sticky monologue memo types */
#screen-memo .memo-type-nav {
  position: sticky; top: var(--memo-tabs-height, 76px); z-index: 1;
  background: var(--card); padding: 8px 12px 10px; margin-inline: -12px;
  margin-top: 22px; box-shadow: 0 8px 12px -9px var(--lo);
}
#screen-memo .memo-type-nav h3 { margin: 0 0 8px; }
#screen-memo .memo-type-nav .memo-types { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#screen-memo .memo-type-nav .memo-types button { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
#screen-memo .memo-type-nav .memo-types button.active { background: var(--grad); color: var(--on-accent); font-size: 17px; font-weight: 600; box-shadow: none; }
@media (max-width: 520px) {
  #screen-memo .memo-type-nav .memo-types button { padding-inline: 3px; font-size: 12px; }
  #screen-memo .memo-type-nav .memo-types button.active { font-size: 14px; }
}
/* END sticky monologue memo types */

/* BEGIN legal navigation and cookie notice */
.site-footer .legal-practice-navigation { display: none; }
body:has(#screen-stage:not([hidden]), #screen-read:not([hidden]), #screen-talk:not([hidden]), #screen-mono-pick:not([hidden]), #screen-mono:not([hidden]), #screen-school:not([hidden])) .legal-navigation { display: none; }
body:has(#screen-stage:not([hidden]), #screen-read:not([hidden]), #screen-talk:not([hidden]), #screen-mono-pick:not([hidden]), #screen-mono:not([hidden]), #screen-school:not([hidden])) .legal-practice-navigation { display: flex; font-size: .8rem; }
.legal-documents { list-style: none; padding: 0; margin: 1.25rem 0; }
.legal-documents li + li { margin-top: .65rem; }
.legal-documents a { display: block; padding: .8rem 1rem; border-radius: 12px; background: var(--soft); }
.cookie-notice { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 24px)); z-index: 50; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 24px var(--lo); font-size: 14px; }
.cookie-notice strong { color: var(--ink); font-size: 16px; }
.cookie-notice p { margin: 5px 0 12px; }
.cookie-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.cookie-actions button { min-height: 44px; }
body:has(.cookie-notice:not([hidden])) { padding-bottom: 260px; }
.cookie-actions #cookie-essential, .cookie-actions #cookie-history { flex: 1 1 145px; font-weight: 600; }
.cookie-actions a { flex-basis: 100%; text-align: center; }
.cookie-notice { max-height: calc(100dvh - 24px); overflow-y: auto; }
.checkout-terms { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 12px 0; }
/* END legal navigation and cookie notice */

/* BEGIN examiner selection */
.examiner-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.examiner-preview-row p { margin: 0; flex: 1 1 140px; font-size: 14px; }
.examiner-preview-row .say { min-height: 40px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
#examiner-voice-status:empty { display: none; }
#examiner-audio { max-width: 100%; margin-bottom: 12px; }
/* END examiner selection */

/* BEGIN monologue photo selection */
.monologue-type-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 18px; }
.monologue-type-tabs button { min-width: 0; min-height: 52px; font-size: 14px; padding: 8px 4px; border-radius: 12px; overflow-wrap: anywhere; }
.monologue-type-tabs button[aria-pressed="true"] { background: var(--grad); color: var(--on-accent); font-weight: 700; box-shadow: 0 4px 12px var(--glow); }
@media (max-width: 360px) { .monologue-type-tabs { gap: 5px; } .monologue-type-tabs button { font-size: 12px; } }
.topic-photo-preview { margin: 10px 0 16px; }
.topic-photo-preview img { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; background: var(--soft); }
.topic-photo-preview figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.topic-photo-picker { margin: 12px 0 18px; }
.topic-photo-picker summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 8px 0; }
.topic-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.topic-photo-choice { display: grid; gap: 6px; text-align: left; min-width: 0; padding: 8px; border-radius: 12px; font-size: 12px; }
.topic-photo-choice img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
@media (min-width: 640px) { .topic-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* END monologue photo selection */

/* BEGIN stage navigation design */
.ui-icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.training-stage-list { display: grid; gap: 16px; margin: 22px 0 8px; }
.training-stage { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 20px 16px; min-height: 92px; border-radius: 16px; text-align: left; }
.training-stage .ui-icon { width: 34px; height: 34px; color: var(--accent); }
.training-stage b { display: block; color: var(--ink); font-size: 17px; }
.training-stage small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.training-stage > span:last-child { font-size: 28px; color: var(--accent); line-height: 1; }
.training-stage:hover b { color: var(--accent); }
.monologue-type-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 78px; }
.monologue-type-tabs button .ui-icon { color: var(--accent); }
.monologue-type-tabs button[aria-pressed="true"] .ui-icon { color: var(--on-accent); }
button:not(.theme):not(.say):not(.link):not(.memo-tabs button):not(.memo-types button):not(.topic-photo-choice) { border-radius: 12px; }
button.primary { min-height: 46px; font-weight: 700; }
.mode, .mono-topic { border-radius: 16px; }
.memo-types button { min-height: 44px; }
/* Unified line icons on action buttons, including dynamically updated labels. */
:is(#btn-start,#btn-memo-next,#btn-stage-ready,#btn-result-next,#btn-read-start,#btn-mono-start,#btn-again,#btn-show-pricing,#btn-parent,#btn-download,#btn-download-wav,#btn-download-mono)::before {
  content: ''; display: inline-block; width: 18px; height: 18px; vertical-align: -.2em; margin-right: 8px; background: currentColor;
  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='M5 12h14m-6-6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
}
:is(#btn-read-start,#btn-mono-start)::before { mask-image: 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'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 10v1a7 7 0 0 0 14 0v-1M12 18v3m-4 0h8'/%3E%3C/svg%3E"); }
:is(#btn-download,#btn-download-wav,#btn-download-mono)::before { mask-image: 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='M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5'/%3E%3C/svg%3E"); }
#btn-show-pricing::before { mask-image: 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-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='M3 10h18M6 15h4'/%3E%3C/svg%3E"); }
#btn-parent::before { mask-image: 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-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6zM14 3v5h4M9 12h6M9 16h6'/%3E%3C/svg%3E"); }
/* END stage navigation design */
