/* ===== DESIGN TOKENS ===== */
:root {
  --font-display: 'Nunito Variable', 'Nunito', system-ui, sans-serif;
  --font-body: 'Inter Variable', 'Inter', system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
  --radius-xl: 1rem; --radius-2xl: 1.5rem; --radius-full: 9999px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
:root, [data-theme="light"] {
  /* «Уютный класс»: тёплый фон + синий акцент */
  --bg: #fdfaf4;
  --surface: #ffffff;
  --surface-2: #fff8ec;
  --surface-offset: #f1ebe0;
  --border: rgba(30, 41, 59, 0.1);
  --divider: rgba(30, 41, 59, 0.08);
  --text: #1e293b;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --text-inv: #ffffff;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --primary-a: #1e40af;
  --primary-bg: #eff6ff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --clock-face: #fffdf5;
  --clock-rim: #334155;
  --clock-border: #cbd5e1;
  --clock-number: #1e293b;
  --hand-hour: #1e293b;
  --hand-min: #2563eb;
  --hand-sec: #ef4444;
  --tick-cardinal: #1e293b;
  --tick-major: #334155;
  --tick-minor: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 41, 59, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 41, 59, 0.1);
  /* Карточки тем / печать */
  --color-topic-online: #3b5bdb;
  --color-topic-online-hover: #2f4ac4;
  --color-print: #e07b39;
  --color-print-hover-bg: #fff5ee;
  --color-soon-bg: #fff3cd;
  --color-soon-text: #856404;
  --color-soon-border: #ffc107;
}
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --surface-offset: #1e293b;
  --border: rgba(148, 163, 184, 0.15);
  --divider: rgba(148, 163, 184, 0.1);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --text-inv: #0f172a;
  --primary: #60a5fa;
  --primary-h: #3b82f6;
  --primary-a: #2563eb;
  --primary-bg: rgba(37, 99, 235, 0.2);
  --success: #4ade80;
  --success-bg: rgba(22, 163, 74, 0.15);
  --error: #f87171;
  --error-bg: rgba(220, 38, 38, 0.15);
  --clock-face: #1e293b;
  --clock-rim: #94a3b8;
  --clock-border: #475569;
  --clock-number: #e2e8f0;
  --hand-hour: #f1f5f9;
  --hand-min: #60a5fa;
  --hand-sec: #f87171;
  --tick-cardinal: #e2e8f0;
  --tick-major: #cbd5e1;
  --tick-minor: rgba(148, 163, 184, 0.45);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --color-topic-online: #7c9cff;
  --color-topic-online-hover: #93adff;
  --color-print: #f0a060;
  --color-print-hover-bg: rgba(224, 123, 57, 0.18);
  --color-soon-bg: rgba(250, 204, 21, 0.2);
  --color-soon-text: #fcd34d;
  --color-soon-border: rgba(250, 204, 21, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f172a; --surface: #1e293b; --surface-2: #334155;
    --surface-offset: #1e293b; --border: rgba(148, 163, 184, 0.15);
    --divider: rgba(148, 163, 184, 0.1); --text: #f1f5f9;
    --text-muted: #94a3b8; --text-faint: #64748b; --text-inv: #0f172a;
    --primary: #60a5fa; --primary-h: #3b82f6; --primary-a: #2563eb;
    --primary-bg: rgba(37, 99, 235, 0.2); --success: #4ade80;
    --success-bg: rgba(22, 163, 74, 0.15); --error: #f87171;
    --error-bg: rgba(220, 38, 38, 0.15); --clock-face: #1e293b;
    --clock-rim: #94a3b8; --clock-border: #475569; --clock-number: #e2e8f0;
    --hand-hour: #f1f5f9; --hand-min: #60a5fa; --hand-sec: #f87171;
    --tick-cardinal: #e2e8f0; --tick-major: #cbd5e1;
    --tick-minor: rgba(148, 163, 184, 0.45);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --color-topic-online: #7c9cff;
    --color-topic-online-hover: #93adff;
    --color-print: #f0a060;
    --color-print-hover-bg: rgba(224, 123, 57, 0.18);
    --color-soon-bg: rgba(250, 204, 21, 0.2);
    --color-soon-text: #fcd34d;
    --color-soon-border: rgba(250, 204, 21, 0.45);
  }
}
/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body {
  min-height: 100dvh;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text); background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}
/* Тренажёр: чуть плотнее начертание текста панелей */
.app {
  font-weight: 500;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; font-weight: 700; }
img, svg { display: block; }
p { max-width: 68ch; }
::selection { background: rgba(37, 99, 235, 0.22); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== LAYOUT ===== */
.app {
  max-width: 900px; margin-inline: auto;
  padding: var(--space-4);
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  width: 100%;
  box-sizing: border-box;
}
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0 var(--space-6);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
/* Страница с внешним H1: без логотипа-часов, только тема — меньше воздуха до вкладок */
.header--chasiki-slim {
  justify-content: flex-end;
  padding: var(--space-2) 0 var(--space-3);
}
.logo { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1; }
.logo > div:last-child { min-width: 0; }
.logo-mark { width: 36px; height: 36px; }
.logo-text { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; color: var(--primary); }
.logo-sub { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.header-actions { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--primary); background: var(--primary-bg); border-color: var(--primary); transform: scale(1.04); }
.icon-btn:active { transform: scale(0.96); }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: var(--space-2); background: var(--surface-offset);
  padding: var(--space-1); border-radius: var(--radius-full);
  margin-bottom: var(--space-6); width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}
.tab {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-full);
  color: var(--text-muted); transition: all var(--transition);
  min-width: 0;
  min-height: 48px;
  align-items: center;
  display: inline-flex;
  justify-content: center;
}
.tab.active {
  background: var(--primary); color: var(--text-inv);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.28);
}
.tab:hover:not(.active) { color: var(--text); background: var(--surface); }

/* ===== MAIN GRID ===== */
.main-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr;
  width: 100%;
  min-width: 0;
}
/* ===== CLOCK WRAPPER ===== */
.clock-wrap {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
/* Часы заполняют колонку; max-width ограничивает крупность на широких экранах */
.clock-container {
  --clock-ring: 32px;
  position: relative;
  width: 100%;
  max-width: min(400px, calc(100% - var(--clock-ring)));
  margin-inline: auto;
  aspect-ratio: 1;
  height: auto;
  background: var(--surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg), 0 0 0 8px var(--clock-border), 0 0 0 14px var(--surface-offset);
  cursor: default; user-select: none; flex-shrink: 0;
}
.clock-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Digital display */
.digital-time {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  color: var(--text); letter-spacing: 0.05em;
  background: var(--surface);
  border: 2px solid var(--border);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  min-width: 130px; text-align: center;
  transition: all 0.2s ease;
}
.digital-time.hidden { opacity: 0; pointer-events: none; }

/* Левая колонка «Учимся»: переключатель цифр под циферблатом */
.toggle-row--under-clock {
  width: 100%;
  max-width: min(400px, 100%);
}
.digital-learn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  max-width: min(400px, 100%);
}
/* Иначе author `display:flex` перебивает стандартное скрытие по атрибуту [hidden] */
.digital-learn-stack[hidden],
.time-steppers[hidden] {
  display: none !important;
}
.under-digital-phrases {
  width: 100%;
}
.under-digital-phrases__title {
  text-align: center;
  margin-bottom: var(--space-2);
}
.under-digital-phrases .time-phrase {
  margin-top: 0;
}

/* ===== CONTROLS PANEL ===== */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-2xl); padding: var(--space-5);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--space-5);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.panel-section { display: flex; flex-direction: column; gap: var(--space-3); }
.panel-label {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
/* Clock style selector */
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.style-btn {
  aspect-ratio: 1;
  min-height: 56px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-1); padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs); font-weight: 700; color: var(--text-muted);
  transition: all var(--transition);
}
.style-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.style-btn.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
/* Превью циферблата: занимает большую часть ячейки, верхний предел ~80px */
.style-btn svg {
  width: min(92%, 5rem);
  height: auto;
  aspect-ratio: 1;
  flex-shrink: 0;
}
/* Степперы времени (touch ≥ 48px) */
.time-steppers {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.time-stepper-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.time-stepper-lbl {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 4.5rem;
}
.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.stepper-btn {
  width: 52px;
  height: 52px;
  min-width: 48px;
  min-height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.12s ease;
}
.stepper-btn:hover {
  background: var(--primary);
  color: var(--text-inv);
  border-color: var(--primary-h);
}
.stepper-btn:active { transform: scale(0.96); }
.stepper-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  transform: none;
}
.stepper-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  color: var(--text);
  min-width: 3.25ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.time-steppers.time-steppers--locked { opacity: 0.65; }
.time-steppers.time-steppers--locked .stepper-btn { cursor: not-allowed; }
/* Подписи «Часы» / «Минуты» и значения — единая типографика (без случайного синего у подписи минут) */
.time-stepper-row .time-stepper-lbl {
  color: var(--text-muted);
}
.time-stepper-row .stepper-value {
  color: var(--text);
}
.time-stepper-row--hour .stepper-btn,
.time-stepper-row--min .stepper-btn {
  background: var(--surface-offset);
  color: var(--text);
}
.time-stepper-row--hour .stepper-btn:hover {
  background: var(--hand-hour);
  color: var(--text-inv);
}
.time-stepper-row--min .stepper-btn:hover {
  background: var(--primary);
  color: var(--text-inv);
}
[data-theme="dark"] .time-stepper-row--hour .stepper-btn,
[data-theme="dark"] .time-stepper-row--min .stepper-btn {
  background: rgba(241, 245, 249, 0.08);
}
/* Toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
}
.toggle-lbl {
  font-size: var(--text-sm); font-weight: 600; color: var(--text);
  flex: 1; min-width: 0;
  line-height: 1.35;
}
.toggle {
  width: 52px; height: 30px;
  min-width: 52px;
  border-radius: var(--radius-full);
  background: var(--surface-offset); border: 2px solid var(--border);
  position: relative; cursor: pointer; transition: all var(--transition);
  flex-shrink: 0;
  align-self: center;
}
.toggle.on { background: var(--primary); border-color: var(--primary); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: var(--radius-full);
  background: white; transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(22px); }

/* ===== QUIZ SECTION ===== */
.quiz-area { grid-column: 1 / -1; }
.quiz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-2xl); padding: var(--space-6);
  box-shadow: var(--shadow-sm); text-align: left;
}
.quiz-question {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--text-lg); color: var(--text);
  margin-bottom: var(--space-4);
  text-align: center;
}
.quiz-task {
  font-size: var(--text-xl); font-family: var(--font-display); font-weight: 900;
  color: var(--primary); margin-bottom: var(--space-5);
}
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }
.btn {
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  transition: all var(--transition); display: flex; align-items: center; gap: var(--space-2);
  min-height: 48px;
  text-decoration: none;
}
.btn:hover,
.btn:focus-visible,
.btn:active {
  text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: var(--text-inv);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { background: var(--primary-h); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25); }
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-offset); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); }
/* Кнопки формата в карточках тем (онлайн / печать) */
.btn--online {
  background: var(--color-topic-online);
  color: #fff;
  border: 2px solid var(--color-topic-online);
  box-shadow: 0 2px 10px rgba(59, 91, 219, 0.25);
}
.btn--online:hover {
  background: var(--color-topic-online-hover);
  border-color: var(--color-topic-online-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 91, 219, 0.32);
}
.btn--online:active {
  transform: translateY(0);
}
.btn--print {
  background: transparent;
  color: var(--color-print);
  border: 2px solid var(--color-print);
  box-shadow: none;
}
.btn--print:hover {
  background: var(--color-print-hover-bg);
  color: var(--color-print);
  border-color: var(--color-print);
}
.btn-download {
  width: fit-content;
  min-width: 200px;
  margin-inline: auto;
  justify-content: center;
}
/* Voice button */
.voice-btn {
  width: 64px; height: 64px; border-radius: var(--radius-full);
  background: var(--primary); color: var(--text-inv); margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  transition: all var(--transition); position: relative;
}
.voice-btn:hover { transform: scale(1.08); }
.voice-btn:active { transform: scale(0.95); }
.voice-btn.listening {
  background: var(--error);
  outline: 3px solid var(--error-bg);
  outline-offset: 2px;
}
/* Фидбек теста — спокойные карточки, без «цирка» */
.feedback-area {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.35;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  margin-top: var(--space-4);
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.feedback-area.success {
  background: var(--success-bg);
  color: #166534;
  border-color: var(--success);
}
[data-theme="dark"] .feedback-area.success { color: #bbf7d0; }
.feedback-area.error {
  background: var(--error-bg);
  color: #991b1b;
  border-color: var(--error);
}
[data-theme="dark"] .feedback-area.error { color: #fecaca; }
.feedback-area.neutral { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.feedback-area.empty { background: transparent; border-color: transparent; min-height: 0; padding: 0; margin-top: 0; }
@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback-area.success,
.feedback-area.error {
  animation: feedbackIn 0.2s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .feedback-area.success,
  .feedback-area.error { animation: none; }
}
/* Voice transcript */
.transcript {
  font-size: var(--text-sm); color: var(--text-muted); min-height: 24px;
  font-style: italic; margin-top: var(--space-2);
}
/* Score */
.score-bar {
  display: flex; gap: var(--space-6); justify-content: center;
  margin-top: var(--space-5);
}
.score-item { text-align: center; }
.score-num {
  font-family: var(--font-display); font-weight: 900;
  font-size: var(--text-xl); line-height: 1;
}
.score-num.correct { color: var(--success); }
.score-num.wrong   { color: var(--error); }
.score-lbl { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* Прогресс в тесте: «N из M» без звёздочек */
.quiz-progress {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--divider);
}
.quiz-progress-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-align: center;
}
.quiz-progress-native {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-offset);
  accent-color: var(--primary);
}
.quiz-progress-native::-webkit-progress-bar {
  background: var(--surface-offset);
  border-radius: var(--radius-full);
}
.quiz-progress-native::-webkit-progress-value {
  background: var(--primary);
  border-radius: var(--radius-full);
}
.quiz-progress-native::-moz-progress-bar {
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* Печатные задания в разделе «Проверяем» */
.print-panel {
  gap: var(--space-3);
}
.print-panel-note {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.print-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
}
.print-select {
  min-width: 92px;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 var(--space-3);
  font: inherit;
  font-weight: 800;
}
.print-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
}
.print-checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.print-panel-status {
  min-height: 1.35em;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.35;
  text-align: center;
}

/* ===== QUIZ ANSWER OPTIONS (for little kids: tap buttons) ===== */
.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0 auto;
}
.opt-btn {
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg);
  padding: var(--space-4) var(--space-3); border-radius: var(--radius-xl);
  border: 2px solid var(--border); background: var(--surface-2);
  color: var(--text); transition: all var(--transition);
  min-height: 64px;
  letter-spacing: 0.02em;
}
.opt-btn:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.opt-btn.correct-ans { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.opt-btn.wrong-ans   { background: var(--error-bg);   border-color: var(--error);   color: var(--error); }

/* Divider */
.divider { height: 1px; background: var(--divider); margin: var(--space-1) 0; }

/* Hand drag mode indicator */
.mode-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
}
.mode-badge.drag { color: var(--primary); background: var(--primary-bg); border-color: var(--primary); }

/* ===== LEARN MODE LAYOUT ===== */
.learn-layout {
  display: grid;
  gap: var(--space-6);
  width: 100%;
  min-width: 0;
  align-content: start;
}
.learn-layout > * {
  min-width: 0;
}
.learn-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  min-width: 0;
}
.learn-tips { display: flex; flex-direction: column; gap: var(--space-4); }
.tip-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.tip-title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm); color: var(--primary); margin-bottom: var(--space-2); }
.tip-body  { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6; }
.time-phrase {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.25rem, 3.5vw + 0.65rem, 2.1rem);
  color: var(--text);
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  background: var(--primary-bg);
  border: 1.5px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
}
.time-phrase-alt {
  font-size: var(--text-sm); font-weight: 700;
  color: var(--text-muted); text-align: center;
  margin: var(--space-2) 0 0;
}
.tip-card .time-phrase,
.tip-card .time-phrase-alt { margin-left: 0; margin-right: 0; }
.tip-card .time-phrase { margin-bottom: 0; }
/* Accessibility helpers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.voice-note {
  max-width: 360px;
  margin: var(--space-2) auto 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
  text-align: center;
}
/* Десктоп: компактная сетка и отступы, чтобы «Учимся» / «Проверяем» умещались в первый экран */
@media (min-width: 640px) {
  .app {
    padding: var(--space-2) max(var(--space-3), env(safe-area-inset-left, 0px)) var(--space-3);
  }
  .header {
    padding: var(--space-2) 0 var(--space-3);
  }
  .tabs {
    margin-bottom: var(--space-3);
  }
  .tab {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
  }
  .main-grid,
  .learn-layout {
    gap: var(--space-3);
    grid-template-columns: clamp(260px, 26vw, 340px) minmax(0, 1fr);
    align-items: start;
  }
  .learn-layout > .clock-wrap,
  .main-grid > .clock-wrap {
    width: 100%;
    justify-self: stretch;
  }
  .clock-wrap {
    gap: var(--space-2);
  }
  .clock-container {
    max-width: min(320px, calc(100% - var(--clock-ring)));
  }
  .digital-time {
    font-size: clamp(1.45rem, 1.1vw + 0.95rem, 2rem);
    padding: var(--space-2) var(--space-4);
  }
  .learn-controls {
    gap: var(--space-3);
  }
  .panel {
    padding: var(--space-4);
    gap: var(--space-3);
  }
  .panel.quiz-card {
    gap: var(--space-3);
  }
  .panel-section {
    gap: var(--space-2);
  }
  .time-steppers {
    gap: var(--space-2);
  }
  .stepper-btn {
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.35rem;
  }
  .stepper-value {
    font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  }
  .style-btn {
    min-height: 52px;
  }
  .tip-card {
    padding: var(--space-3);
  }
  .tip-title {
    margin-bottom: var(--space-1);
  }
  .time-phrase {
    padding: var(--space-3);
    margin-top: var(--space-2);
    font-size: clamp(1.05rem, 1vw + 0.55rem, 1.55rem);
  }
  .under-digital-phrases .time-phrase {
    font-size: clamp(1.05rem, 1vw + 0.55rem, 1.55rem);
  }
  .quiz-question {
    margin-bottom: var(--space-2);
  }
  .feedback-area {
    margin-top: var(--space-2);
    min-height: 2.5rem;
    padding: var(--space-2) var(--space-4);
  }
  .score-bar {
    margin-top: var(--space-2);
    gap: var(--space-4);
  }
  .quiz-progress {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
  }
  .opt-btn {
    min-height: 52px;
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-2);
  }
  .voice-btn {
    width: 56px;
    height: 56px;
  }
  .mode-badge {
    font-size: 0.6875rem;
    padding: 2px var(--space-2);
  }
}
@media (min-width: 640px) and (max-height: 720px) {
  .learn-layout,
  .main-grid {
    grid-template-columns: clamp(240px, 24vw, 300px) minmax(0, 1fr);
  }
  .clock-container {
    max-width: min(280px, calc(100% - var(--clock-ring)));
  }
  .time-phrase {
    font-size: clamp(1rem, 0.9vw + 0.5rem, 1.35rem);
    padding: var(--space-2) var(--space-3);
  }
  .panel,
  .panel.quiz-card {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  .opt-btn {
    min-height: 48px;
  }
}

/* Responsive tweaks */
@media (max-width: 639px) {
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding-inline: var(--space-3); }
  .panel { padding: var(--space-4); }
  .score-bar { gap: var(--space-3); flex-wrap: wrap; }
  .quiz-question { font-size: clamp(1rem, 4vw + 0.5rem, 1.25rem); }
  .feedback-area { font-size: var(--text-base); padding-inline: var(--space-3); }
  .digital-time { min-width: 0; width: 100%; max-width: 280px; padding-inline: var(--space-4); }
}
