:root {
  color-scheme: light;
  font-family: "Montserrat", Arial, sans-serif;

  --ink: #1f1b17;
  --cream: #f3eadb;
  --paper: #faf4e9;
  --sand: #e7d9c0;
  --espresso: #2a2320;
  --marigold: #f5a623;
  --ember: #e07a1f;
  --terracotta: #d9472b;
  --honey: #fbd38a;
  --slate-blue: #3c6e8f;
  --coffee: #5c5047;
  /* Вторичный текст: прежний тон давал 3,6:1 на бумаге, нужно не меньше 4,5:1. */
  --taupe: #6f6458;
  --muted: var(--taupe);
  --surface: var(--paper);

  --success: #3e8e5a;
  --success-bg: #e4f0e7;
  --warning: #9d6c08;
  --warning-bg: #fbefd2;
  --error: #c0392b;
  --error-bg: #f7e0dc;
  --info-bg: #e1eaf0;

  /* Текст статусов на светлых подложках. --success/--warning/--error остаются
     для заливок и иконок: как цвет текста они не дотягивали до 4,5:1. */
  --success-ink: #1f5b38;
  --warning-ink: #835a06;
  --error-ink: #8f2b20;
  --info-ink: #335f7c;
  --ember-ink: #a3530e;

  /* Малые ступени шкалы текста. Мельче --text-2xs в кабинете текста нет. */
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;

  --border: #e3d6bf;
  --border-strong: #c9bca8;
  --grad-sunrise: linear-gradient(135deg, #f5a623, #e07a1f);
  --grad-ink: linear-gradient(160deg, #2a2320, #1f1b17);
  --grad-paper: linear-gradient(180deg, #faf4e9, #f3eadb);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 3px rgb(31 27 23 / 6%);
  --shadow-sm: 0 2px 6px rgb(31 27 23 / 8%);
  --shadow-md: 0 6px 16px rgb(31 27 23 / 10%);
  --shadow-lg: 0 12px 32px rgb(31 27 23 / 14%);
  --shadow: var(--shadow-md);
  --focus-ring: 0 0 0 3px rgb(245 166 35 / 45%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Student learning profile questionnaire and teacher-side editor. */
.menu-tile--profile {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  min-height: 92px;
  border-color: color-mix(in srgb, var(--ember) 28%, var(--border));
  background: linear-gradient(135deg, #fffaf0, var(--warning-bg));
}

.menu-tile--profile:hover .menu-tile__arrow { transform: translateX(4px); }

.profile-privacy-note {
  margin: -4px 0 14px;
  color: var(--coffee);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.learning-profile-form {
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.profile-language-setting {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background: #fffaf1;
}

.profile-language-setting label {
  display: grid;
  gap: 7px;
  color: var(--coffee);
  font-size: var(--text-xs);
  font-weight: 700;
}

.profile-language-setting select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper);
}


.learning-profile-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.learning-profile-progress::before {
  position: absolute;
  top: 16px;
  right: 10%;
  left: 10%;
  height: 2px;
  background: var(--sand);
  content: "";
}

.learning-profile-progress i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  justify-self: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--taupe);
  background: var(--paper);
  font-size: var(--text-2xs);
  font-style: normal;
  font-weight: 800;
}

.learning-profile-progress i.is-current {
  border-color: var(--marigold);
  color: var(--ink);
  background: var(--honey);
  box-shadow: var(--focus-ring);
}

.learning-profile-progress i.is-done { border-color: var(--success); color: var(--success-ink); background: var(--success-bg); }
.learning-profile-step { display: grid; gap: 14px; }
.learning-profile-step[hidden], .profile-other-field[hidden] { display: none !important; }
.learning-profile-step__heading h3 { margin: 5px 0 0; font-size: 22px; letter-spacing: -0.035em; }
.profile-question-help { margin: -5px 0 0; color: var(--taupe); font-size: var(--text-2xs); line-height: 1.55; }
.profile-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-choice { display: block; min-width: 0; cursor: pointer; }
.profile-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.profile-choice span {
  display: flex;
  min-height: 46px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  color: var(--coffee);
  background: #fffaf1;
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.35;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.profile-choice:hover span { border-color: var(--border-strong); transform: translateY(-1px); }
.profile-choice input:focus-visible + span { box-shadow: var(--focus-ring); }
.profile-choice input:checked + span { border-color: var(--marigold); color: var(--ink); background: var(--warning-bg); box-shadow: inset 0 0 0 1px var(--marigold); }
.profile-choice--other { width: min(100%, calc(50% - 4px)); }
.profile-other-field textarea, .profile-text-fields textarea { min-height: 84px; }
.profile-text-fields { display: grid; gap: 12px; padding-top: 4px; }
.profile-fieldset { display: grid; gap: 10px; margin: 0; border: 0; padding: 0; }
.profile-fieldset + .profile-fieldset { margin-top: 9px; border-top: 1px solid var(--border); padding-top: 18px; }
.profile-fieldset legend { margin-bottom: 10px; padding: 0; color: var(--ink); font-size: var(--text-xs); font-weight: 800; }
.learning-profile-actions { display: flex; gap: 9px; border-top: 1px solid var(--border); padding-top: 16px; }
.learning-profile-actions .button { flex: 1; }

.teacher-profile-card, .teacher-profile-block, .teacher-profile-editor-shell, .teacher-profile-editor { display: grid; gap: 14px; }
.teacher-profile-block { gap: 8px; }
.teacher-profile-block > strong, .teacher-profile-detail > span { color: var(--taupe); font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.teacher-profile-block p, .teacher-profile-detail p { margin: 0; color: var(--coffee); white-space: pre-wrap; font-size: var(--text-2xs); line-height: 1.55; }
.teacher-profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.teacher-profile-tags span { border-radius: var(--radius-pill); padding: 6px 9px; color: var(--ink); background: var(--warning-bg); font-size: var(--text-2xs); font-weight: 600; }
.teacher-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.teacher-profile-detail { display: grid; gap: 5px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px; background: var(--cream); }
.teacher-profile-card > small { color: var(--taupe); font-size: var(--text-2xs); }
.teacher-profile-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.teacher-profile-toolbar p { margin: 0; color: var(--coffee); font-size: var(--text-2xs); line-height: 1.5; }
.teacher-profile-editor[hidden], [data-teacher-profile-summary][hidden], [data-edit-learning-profile][hidden] { display: none !important; }
.teacher-profile-editor-note { border-left: 3px solid var(--marigold); border-radius: var(--radius-sm); padding: 9px 11px; color: var(--coffee); background: var(--warning-bg); font-size: var(--text-2xs); line-height: 1.5; }
.teacher-learning-profile-form { border-radius: var(--radius-lg); padding: 16px; box-shadow: none; }
.teacher-learning-profile-form .learning-profile-step__heading h3 { font-size: 18px; }
.teacher-learning-profile-form .learning-profile-actions { flex-wrap: wrap; }
.teacher-learning-profile-form .learning-profile-actions .button { min-width: 130px; }

@media (max-width: 640px) {
  .profile-choice-grid, .teacher-profile-grid { grid-template-columns: 1fr; }
  .profile-choice--other { width: 100%; }
  .learning-profile-form { padding: 16px 13px; }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgb(251 211 138 / 32%), transparent 34%),
    linear-gradient(180deg, #fcf7ee 0, var(--cream) 46%, #eee2cb 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

.shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 26px;
}

.brand-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(224 122 31 / 22%);
  border-radius: 16px;
  color: var(--ember);
  background: var(--paper);
  box-shadow:
    0 0 0 3px rgb(224 122 31 / 8%),
    0 7px 18px rgb(31 27 23 / 11%);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark svg {
  width: 31px;
  height: 31px;
  fill: none;
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.auth-logout {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--coffee);
  background: rgb(250 244 233 / 82%);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
}

.auth-shell {
  display: grid;
  max-width: 520px;
  gap: 16px;
  margin: 4vh auto 0;
}

.auth-intro {
  padding: 8px 4px 2px;
}

.auth-intro h2 {
  margin: 10px 0 8px;
  font-size: clamp(24px, 6vw, 34px);
}

.auth-intro p,
.auth-help,
.password-hint {
  color: var(--coffee);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.auth-form {
  padding: 22px;
}

.auth-form input {
  min-height: 48px;
  font-size: 16px;
}

.auth-help {
  padding: 0 8px;
  text-align: center;
}

.student-preview-button--access {
  border-color: rgb(245 166 35 / 48%);
  color: var(--ink);
  background: var(--warning-bg);
}

.student-preview-button--telegram {
  border-color: rgb(60 110 143 / 48%);
  color: var(--ink);
  background: var(--info-bg);
}

.web-access-card {
  display: grid;
  gap: 14px;
  margin: 12px 0 18px;
  padding: 20px;
  border: 1px solid rgb(62 142 90 / 24%);
  border-radius: var(--radius-xl);
  background: var(--success-bg);
  box-shadow: var(--shadow-sm);
}

.web-access-card h3 {
  margin-top: 7px;
}

.web-access-card label {
  display: grid;
  gap: 7px;
  color: var(--coffee);
  font-size: var(--text-xs);
  font-weight: 700;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgb(62 142 90 / 25%);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--paper);
}

.copy-row button {
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-md);
  color: white;
  background: var(--success);
  cursor: pointer;
  font-size: var(--text-2xs);
  font-weight: 700;
}

.web-access-card p {
  margin: 0;
  color: var(--coffee);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.student-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.student-create-form .button {
  min-height: 45px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coffee);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eyebrow::before {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--marigold);
  content: "";
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1 {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: clamp(25px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin-bottom: 13px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.018em;
}

.stack {
  display: grid;
  gap: 12px;
}

.section {
  margin-top: 26px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.card--accent {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  color: var(--ink);
  background: var(--grad-sunrise);
  box-shadow: var(--shadow-lg);
}

.card--accent::after {
  position: absolute;
  top: -42px;
  right: -26px;
  width: 112px;
  height: 112px;
  border: 22px solid rgb(250 244 233 / 18%);
  border-radius: 50%;
  content: "";
}

.card--accent .meta {
  color: rgb(31 27 23 / 66%);
}

.card--accent .pill {
  color: var(--ink);
  background: rgb(250 244 233 / 54%);
}

.meta,
.muted {
  color: var(--taupe);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
}

.body-copy {
  margin: 11px 0 0;
  color: var(--coffee);
  white-space: pre-wrap;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.58;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: var(--honey);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pill--submitted {
  color: var(--warning-ink);
  background: var(--warning-bg);
}

.pill--accepted {
  color: var(--success-ink);
  background: var(--success-bg);
}

.pill--revision {
  color: var(--error-ink);
  background: var(--error-bg);
}

/* Урок: запланирован — синий, проведён — зелёный, отменён — нейтральный. */
.pill--scheduled {
  color: var(--info-ink);
  background: var(--info-bg);
}

.pill--completed {
  color: var(--success-ink);
  background: var(--success-bg);
}

.pill--cancelled,
.pill--archived,
.pill--superseded {
  color: var(--coffee);
  background: var(--sand);
}

.empty {
  padding: 26px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  color: var(--coffee);
  background: rgb(250 244 233 / 46%);
  text-align: center;
  font-size: var(--text-md);
  line-height: 1.5;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.practice-feature {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 106px;
  border: 1px solid rgb(250 244 233 / 14%);
  border-radius: var(--radius-2xl);
  padding: 18px;
  color: var(--paper);
  background: var(--grad-ink);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  text-align: left;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.practice-feature:hover {
  box-shadow: 0 18px 40px rgb(31 27 23 / 19%);
  transform: translateY(-3px);
}

.practice-feature .menu-icon {
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: var(--grad-sunrise);
}

.practice-feature__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.practice-feature__copy strong {
  color: var(--marigold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.practice-feature__copy small {
  color: #d9c9ae;
  font-size: var(--text-2xs);
  font-weight: 600;
}

.practice-feature__arrow {
  color: var(--marigold);
  font-size: 23px;
  transition: transform 0.3s var(--ease);
}

.practice-feature:hover .practice-feature__arrow {
  transform: translateX(4px);
}

.menu-tile {
  position: relative;
  display: grid;
  min-height: 152px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 17px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.25s;
}

.menu-tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.menu-tile:active {
  transform: scale(0.98);
}

.menu-tile--attention {
  border-color: color-mix(in srgb, var(--error) 34%, var(--border));
  background: linear-gradient(145deg, var(--paper), color-mix(in srgb, var(--error) 9%, var(--paper)));
}

.menu-tile--new {
  border-color: rgb(245 166 35 / 72%);
  box-shadow:
    0 0 0 4px rgb(245 166 35 / 22%),
    0 0 24px rgb(245 166 35 / 42%),
    0 18px 38px rgb(224 122 31 / 30%);
}

.menu-tile--new:hover {
  border-color: var(--marigold);
  box-shadow:
    0 0 0 5px rgb(245 166 35 / 27%),
    0 0 30px rgb(245 166 35 / 50%),
    0 22px 44px rgb(224 122 31 / 36%);
}

.practice-feature--new {
  border-color: rgb(245 166 35 / 74%);
  box-shadow:
    0 0 0 4px rgb(245 166 35 / 24%),
    0 0 26px rgb(245 166 35 / 44%),
    0 20px 42px rgb(224 122 31 / 32%);
}

.practice-feature--new:hover {
  box-shadow:
    0 0 0 5px rgb(245 166 35 / 29%),
    0 0 32px rgb(245 166 35 / 52%),
    0 24px 48px rgb(224 122 31 / 38%);
}

.menu-badge,
.feature-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  color: var(--ink);
  background: var(--marigold);
  box-shadow: 0 5px 12px rgb(245 166 35 / 24%);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cabinet-update-note {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgb(245 166 35 / 38%);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  color: var(--ink);
  background: rgb(245 166 35 / 11%);
  box-shadow: var(--shadow-xs);
}

.cabinet-update-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: var(--grad-sunrise);
  box-shadow:
    0 0 0 3px rgb(245 166 35 / 18%),
    0 6px 16px rgb(224 122 31 / 28%);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.cabinet-update-note__copy {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.cabinet-update-note strong {
  font-weight: 800;
}

.menu-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(224 122 31 / 12%);
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(145deg, #ffdda0, var(--honey));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 3px 8px rgb(224 122 31 / 10%);
}

.menu-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

/* Пиктограммы из static/icons.js. Размер 1em — иконка берёт font-size места,
   но не мельче 12px: в самых мелких подписях она иначе теряет форму. */
.icon {
  display: inline-block;
  flex: none;
  width: max(1em, 12px);
  height: max(1em, 12px);
  vertical-align: -0.15em;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon--solid {
  fill: currentcolor;
  stroke: none;
}

/* Один шеврон раскрытия для всех <details> — у ученика и у преподавателя. */
.disclosure {
  color: var(--ember);
  font-size: 18px;
  transition: transform 0.25s var(--ease);
}

details[open] > summary .disclosure {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .disclosure { transition: none; }
}

.menu-tile--results {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  min-height: 98px;
}

.menu-tile--results > .menu-icon {
  align-self: center;
}

.menu-tile__copy {
  display: grid;
  align-self: center;
  gap: 5px;
  min-width: 0;
}

.menu-tile__arrow {
  align-self: center;
  color: var(--ember);
  font-size: 22px;
  transition: transform 0.3s var(--ease);
}

.menu-tile--results:hover .menu-tile__arrow {
  transform: translateX(4px);
}

.menu-tile strong {
  align-self: end;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.menu-value {
  color: var(--coffee);
  font-size: var(--text-2xs);
  font-weight: 600;
}

/* В сетке 2×2 подпись занимает до двух строк; место под вторую держится всегда,
   иначе заголовок плитки с длинной подписью стоит выше соседнего. */
@media (min-width: 361px) {
  .menu-tile > .menu-value {
    min-height: 2.5em;
  }
}

/* Квадратная плитка: иконка сверху, название и подпись прижаты к низу. Длинное
   название («Домашняя работа») растёт вверх, а подписи соседних плиток и
   последние строки их названий остаются на одной линии. */
.menu-tile:has(> .menu-value) {
  grid-template-rows: auto 1fr auto;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 2px;
  font-size: 23px;
}

.back-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  transition: background-color 0.2s, transform 0.3s var(--ease);
}

.back-button:hover {
  background: var(--marigold);
  transform: translateX(-2px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.stat-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  text-align: center;
}

.stat-card strong {
  overflow-wrap: anywhere;
  color: var(--ember-ink);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.stat-card span {
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.balance-card {
  position: relative;
  display: grid;
  overflow: hidden;
  gap: 9px;
  padding: 22px;
  border: 1px solid rgb(250 244 233 / 14%);
  border-radius: var(--radius-2xl);
  color: var(--paper);
  background: var(--grad-ink);
  box-shadow: var(--shadow-lg);
}

.balance-card::after {
  position: absolute;
  right: -54px;
  bottom: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(245 166 35 / 26%), transparent 68%);
  content: "";
}

.balance-card--warning {
  border-color: rgb(217 71 43 / 58%);
}

.balance-card > span {
  color: #d9c9ae;
  font-size: var(--text-xs);
  font-weight: 600;
}

.balance-card > strong {
  position: relative;
  z-index: 1;
  color: var(--marigold);
  font-size: clamp(30px, 9vw, 42px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.balance-details {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 5px;
  color: #d9c9ae;
  font-size: var(--text-2xs);
  font-weight: 600;
}

.notice {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--border));
  border-radius: var(--radius-lg);
  color: var(--warning-ink);
  background: var(--warning-bg);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.payment-row strong {
  font-variant-numeric: tabular-nums;
}

.payment-lessons {
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  color: var(--success-ink);
  background: var(--success-bg);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.payment-note {
  grid-column: 1 / -1;
}

.practice-card > .body-copy {
  margin-bottom: 4px;
}

.practice-form,
.practice-readonly {
  display: grid;
  gap: 14px;
  margin-top: 17px;
}

.practice-question {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 11px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.practice-question__number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--marigold);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.practice-question__content {
  min-width: 0;
}

.practice-question__content > p {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
}

.practice-form > .button {
  margin-top: 3px;
}

.practice-submit-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-2xs);
  line-height: 1.45;
}

.draft-save-status {
  min-height: 18px;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.draft-save-status[data-state="saving"] {
  color: var(--warning-ink);
}

.draft-save-status[data-state="saved"] {
  color: var(--success-ink);
}

.draft-save-status[data-state="error"] {
  color: var(--error-ink);
}

.draft-save-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-retry,
.draft-recovery-notice button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.draft-retry[hidden] { display: none; }

.draft-recovery-notice {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--warning);
  border-radius: 12px;
  background: var(--paper);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.draft-recovery-notice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.draft-recovery-notice button:hover,
.draft-retry:hover { border-color: var(--ink); }
.draft-recovery-notice button:focus-visible,
.draft-retry:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pill--test {
  margin-left: 6px;
  color: #fff;
  background: var(--ink);
}

.practice-test-toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
  box-shadow: none;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  color: var(--coffee);
  background: #fffaf1;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
}

.choice-option:has(input:checked) {
  border-color: var(--marigold);
  color: var(--ink);
  background: var(--warning-bg);
  box-shadow: var(--focus-ring);
}

.choice-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  accent-color: var(--marigold);
  box-shadow: none;
}

.answer-review {
  padding: 11px 12px;
  border-left: 3px solid var(--marigold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--coffee);
  background: var(--cream);
  white-space: pre-wrap;
  font-size: var(--text-xs);
  line-height: 1.55;
}

.practice-sent {
  margin-top: 15px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  color: var(--success-ink);
  background: var(--success-bg);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.practice-sent--done {
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-sent--done .icon {
  font-size: 16px;
}

.practice-feedback {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #ecd99d;
  border-radius: var(--radius-md);
  color: var(--coffee);
  background: var(--warning-bg);
}

.practice-feedback strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: var(--text-2xs);
}

.practice-feedback p {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--text-xs);
  line-height: 1.55;
}

.practice-editors {
  display: grid;
  gap: 12px;
}

.practice-editor {
  display: grid;
  gap: 11px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--cream);
}

.practice-editor legend {
  padding: 0;
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 700;
}

.practice-editor .row {
  margin-bottom: 0;
}

.editor-remove {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--error-ink);
  background: var(--error-bg);
  cursor: pointer;
  font-size: 15px;
}

.editor-remove:disabled {
  opacity: 0.25;
  cursor: default;
}

.is-hidden {
  display: none !important;
}

.teacher-practice-answers {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.teacher-practice-answer {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--cream);
}

.teacher-practice-answer span {
  color: var(--taupe);
  font-size: var(--text-2xs);
  line-height: 1.45;
}

.teacher-practice-answer strong {
  color: var(--ink);
  white-space: pre-wrap;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
}

.stats-grid--results .stat-card strong {
  color: var(--ink);
}

.result-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
}

.result-score {
  --score-fill: 0%;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  place-content: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--ember) 0 var(--score-fill),
    var(--sand) var(--score-fill) 100%
  );
  box-shadow: 0 5px 16px rgb(224 122 31 / 16%);
  text-align: center;
}

.result-score::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.result-score strong,
.result-score span {
  position: relative;
  z-index: 1;
}

.result-score strong {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.result-score span {
  margin-top: 1px;
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.result-card__content {
  min-width: 0;
}

.result-breakdown {
  grid-column: 1 / -1;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--cream);
}

.result-breakdown > summary {
  display: grid;
  min-height: 49px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: var(--text-xs);
  font-weight: 700;
}

.result-breakdown > summary::-webkit-details-marker {
  display: none;
}

.result-breakdown > summary small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.result-breakdown[open] > summary {
  border-bottom: 1px solid var(--border);
}

.result-breakdown__body {
  min-width: 0;
  padding: 12px;
  animation: breakdown-open 0.32s var(--ease);
}

@keyframes breakdown-open {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
}

.result-component {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.result-component:last-child {
  border-bottom: 0;
}

.result-component__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-component__head strong {
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.result-component__head span {
  color: var(--slate-blue);
  white-space: nowrap;
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result-component__bar {
  height: 5px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: var(--radius-pill);
  background: var(--sand);
}

.result-component__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--slate-blue);
}

.result-component p {
  margin: 8px 0 0;
  color: var(--coffee);
  white-space: pre-wrap;
  font-size: var(--text-2xs);
  line-height: 1.55;
}

.result-breakdown--empty {
  padding: 12px 14px;
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.result-breakdown--teacher {
  margin-top: 10px;
}

.result-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper);
  scrollbar-width: thin;
}

.result-breakdown .result-table-wrap {
  border: 0;
  border-radius: var(--radius-md);
}

.result-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: var(--coffee);
  font-size: var(--text-2xs);
  line-height: 1.5;
}

.result-table th,
.result-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: var(--taupe);
  background: var(--cream);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-table tbody tr:last-child td {
  border-bottom: 0;
}

.result-table tbody tr:hover td {
  background: rgb(245 166 35 / 4%);
}

.result-table td strong {
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.result-table__score {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result-table__percent,
.result-table__award {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  color: var(--ink);
  background: var(--sand);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result-table__award {
  color: var(--ember-ink);
  background: rgb(245 166 35 / 14%);
}

.result-table__feedback {
  min-width: 230px;
  white-space: pre-wrap;
}

.result-table--history {
  min-width: 660px;
}

/* На телефоне строка журнала — карточка: дата и итог сверху, название ниже,
   под ним баллы и награда. Горизонтальная прокрутка прятала «Итог» и «Награду». */
@media (max-width: 560px) {
  .result-table--history {
    min-width: 0;
  }

  .result-table--history,
  .result-table--history tbody {
    display: block;
  }

  .result-table--history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .result-table--history tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    padding: 12px 13px;
    border-bottom: 1px solid var(--border);
  }

  .result-table--history tbody tr:last-child {
    border-bottom: 0;
  }

  /* Двойной класс перебивает мобильный отступ ячеек .result-table ниже по файлу. */
  .result-table.result-table--history td {
    padding: 0;
    border: 0;
  }

  .result-table--history .result-table__date {
    grid-area: 1 / 1;
    color: var(--taupe);
  }

  .result-table--history .result-table__total {
    grid-area: 1 / 2;
    justify-self: end;
  }

  .result-table--history .result-table__title {
    grid-area: 2 / 1 / 3 / -1;
  }

  .result-table--history .result-table__score {
    grid-area: 3 / 1;
  }

  .result-table--history .result-table__prize {
    grid-area: 3 / 2;
    justify-self: end;
  }
}

.result-card__content h3 {
  margin: 3px 0 9px;
}

.result-progress {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--sand);
}

.result-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-sunrise);
}

.certificate-list {
  display: grid;
  gap: 18px;
}

.certificate-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.certificate-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 297 / 210;
  place-items: center;
  overflow: hidden;
  color: var(--taupe);
  background:
    linear-gradient(rgb(31 27 23 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(31 27 23 / 3%) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  font-size: var(--text-2xs);
  font-weight: 600;
}

.certificate-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.certificate-preview--error {
  padding: 28px;
  color: var(--error-ink);
  background: var(--error-bg);
  text-align: center;
}

.certificate-card__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 17px 17px;
  border-top: 1px solid var(--border);
}

.certificate-card__footer > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.certificate-card__footer strong {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-card__footer small {
  overflow: hidden;
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-overline {
  color: var(--ember-ink);
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.certificate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.certificate-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  color: var(--ink);
  background: var(--grad-sunrise);
  box-shadow: 0 5px 14px rgb(224 122 31 / 18%);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-decoration: none;
}

.certificate-link:focus-visible,
.certificate-external-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.certificate-link:disabled {
  cursor: wait;
  opacity: 0.65;
}

.certificate-external-link {
  border-radius: var(--radius-pill);
  padding: 8px 10px;
  color: var(--coffee);
  font-size: var(--text-2xs);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 640px) {
  .certificate-card {
    border-radius: var(--radius-lg);
  }

  .certificate-card__footer {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 13px;
  }

  .certificate-actions {
    justify-content: stretch;
  }

  .certificate-link {
    flex: 1 1 140px;
  }

  .certificate-external-link {
    flex: 1 1 100%;
    padding-left: 0;
  }
}

.form {
  display: grid;
  gap: 13px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--coffee);
  font-size: var(--text-2xs);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffaf1;
  font-size: var(--text-md);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--marigold);
}

.button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  color: var(--ink);
  background: var(--marigold);
  box-shadow: 0 2px 0 rgb(31 27 23 / 12%), var(--shadow-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 700;
  transition: background-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.button:hover {
  background: var(--ember);
  box-shadow: 0 3px 0 rgb(31 27 23 / 14%), var(--shadow-md);
  transform: translateY(-2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button--quiet {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.button--secondary {
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs);
}

.button--danger {
  color: var(--error-ink);
  background: var(--error-bg);
  box-shadow: inset 0 0 0 1px rgb(192 57 43 / 24%);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.actions .button {
  flex: 1 1 120px;
}

.submission-form {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.submission-preview {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--cream);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 17px;
  border: 1px solid rgb(250 244 233 / 14%);
  border-radius: var(--radius-pill);
  color: var(--paper);
  background: var(--ink);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms var(--ease);
  font-size: var(--text-xs);
  font-weight: 600;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.error {
  padding: 22px;
  border: 1px solid rgb(192 57 43 / 18%);
  border-radius: var(--radius-xl);
  color: var(--error-ink);
  background: var(--error-bg);
  line-height: 1.55;
}

.placement-feature {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgb(31 27 23 / 10%);
  border-radius: var(--radius-2xl);
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 0, rgb(250 244 233 / 38%), transparent 38%),
    var(--grad-sunrise);
  box-shadow: 0 14px 30px rgb(224 122 31 / 24%);
  cursor: pointer;
  text-align: left;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

/* The DET practice card is a link to its own page, not an in-app section. */
a.placement-feature,
a.placement-feature:visited {
  box-sizing: border-box;
  color: var(--ink);
  text-decoration: none;
}

.placement-feature:hover {
  box-shadow: 0 19px 38px rgb(224 122 31 / 31%);
  transform: translateY(-3px);
}

.placement-feature .menu-icon {
  width: 50px;
  height: 50px;
}

.placement-feature__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.placement-feature__copy > span {
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: 0.11em;
}

.placement-feature__copy strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.placement-feature__copy small {
  color: rgb(31 27 23 / 72%);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.placement-feature__action {
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  color: var(--paper);
  background: var(--espresso);
  font-size: var(--text-2xs);
  font-weight: 700;
  white-space: nowrap;
}

.placement-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 14px;
}

.placement-step {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--taupe);
}

.placement-step i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--paper);
  font-size: var(--text-2xs);
  font-style: normal;
  font-weight: 800;
}

.placement-step i .icon {
  font-size: 15px;
}

.placement-step b {
  font-size: var(--text-2xs);
  letter-spacing: 0.05em;
}

.placement-step--current {
  color: var(--ink);
}

.placement-step--current i {
  border-color: var(--marigold);
  background: var(--honey);
  box-shadow: var(--focus-ring);
}

.placement-step--done {
  color: var(--success-ink);
}

.placement-step--done i {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.placement-step--failed {
  color: var(--error-ink);
}

.placement-step--failed i {
  border-color: var(--error);
  color: var(--error-ink);
  background: var(--error-bg);
}

.placement-intro {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--espresso);
  box-shadow: var(--shadow-lg);
}

.placement-intro::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, transparent, rgb(31 27 23 / 92%));
  content: "";
}

.placement-intro img {
  display: block;
  width: 100%;
  min-height: 270px;
  object-fit: cover;
}

.placement-intro__copy {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px;
  color: var(--paper);
}

.placement-intro__copy .eyebrow {
  color: var(--marigold);
}

.placement-intro__copy h3 {
  margin: 5px 0 6px;
  font-size: clamp(22px, 6vw, 30px);
  letter-spacing: -0.04em;
}

.placement-intro__copy p {
  margin: 0;
  color: #e8dac3;
  font-size: var(--text-2xs);
  line-height: 1.5;
}

.placement-reading {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.placement-reading summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.placement-reading summary::-webkit-details-marker {
  display: none;
}

.placement-reading summary span {
  font-size: var(--text-sm);
  font-weight: 800;
}

.placement-reading summary small {
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.placement-reading__body {
  padding: 0 18px 18px;
  color: var(--coffee);
  font-size: var(--text-sm);
  line-height: 1.75;
}

.placement-reading__body p {
  margin: 0;
}

.placement-reading__body p + p {
  margin-top: 12px;
}

.placement-preview-notice {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px dashed var(--terracotta);
  border-radius: var(--radius-lg);
  color: var(--coffee);
  background: var(--error-bg);
}

.placement-preview-notice strong {
  color: var(--terracotta);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
}

.placement-preview-notice span {
  font-size: var(--text-2xs);
  line-height: 1.5;
}

.placement-preview-skip {
  width: 100%;
  margin-top: 12px;
  border-style: dashed;
}

.placement-preview-notice--catalog {
  margin-bottom: 18px;
}

.placement-qa-catalog {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.placement-qa-group {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
}

.placement-qa-group > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.placement-qa-group small {
  color: var(--taupe);
}

.placement-qa-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.placement-qa-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.placement-qa-item:hover,
.placement-qa-item.is-active {
  border-color: var(--marigold);
  background: var(--honey);
}

.placement-qa-item small {
  padding-left: 7px;
  border-left: 1px solid var(--border);
  font-size: 0.72rem;
}

.placement-qa-back {
  margin-bottom: 12px;
}

.placement-qa-module,
.placement-qa-empty {
  min-width: 0;
}

.placement-qa-empty {
  padding: 34px 20px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  text-align: center;
  color: var(--taupe);
}

.placement-qa-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.placement-qa-score {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--warning-bg);
}

.placement-qa-score[hidden] {
  display: none;
}

.placement-qa-score span {
  color: var(--coffee);
}

@media (min-width: 760px) {
  .placement-qa-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.placement-form {
  display: grid;
  gap: 16px;
}

.placement-question {
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.placement-question__prompt {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 14px 15px 13px;
  border-bottom: 1px solid var(--border);
  background: #fffaf1;
}

.placement-question__prompt > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--honey);
  font-size: var(--text-2xs);
  font-weight: 800;
}

.placement-question__prompt > strong {
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.45;
}

.placement-options {
  display: grid;
  gap: 8px;
  padding: 11px 12px 12px;
}

.placement-option {
  display: block;
  cursor: pointer;
}

.placement-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.placement-option > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--coffee);
  background: #fffdf8;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.placement-option > span > i {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  color: var(--coffee);
  background: var(--sand);
  font-size: var(--text-2xs);
  font-style: normal;
  font-weight: 800;
}

.placement-option:hover > span {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.placement-option:has(input:checked) > span {
  border-color: var(--marigold);
  color: var(--ink);
  background: var(--warning-bg);
}

.placement-option:has(input:checked) > span > i {
  color: var(--paper);
  background: var(--espresso);
}

.placement-option input:focus-visible + span {
  box-shadow: var(--focus-ring);
}

.placement-question[aria-disabled="true"] {
  opacity: 0.72;
}

.placement-question[aria-disabled="true"] .placement-option {
  cursor: default;
}

.placement-completion-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  background: #fffdf8;
}

.placement-submit {
  min-height: 50px;
  margin-top: 4px;
}

.placement-result {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid rgb(217 71 43 / 22%);
  border-radius: var(--radius-2xl);
  background: var(--error-bg);
  box-shadow: var(--shadow-md);
}

.placement-result--waiting {
  border-color: rgb(62 142 90 / 24%);
  background: var(--success-bg);
}

.placement-result h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.placement-result p {
  margin: 0;
  color: var(--coffee);
  font-size: var(--text-xs);
  line-height: 1.65;
}

.placement-result__summary {
  display: grid;
  gap: 7px;
  margin: 8px 0;
}

.placement-result__summary > div {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid rgb(62 142 90 / 18%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 62%);
}

.placement-result__summary strong {
  font-size: var(--text-2xs);
}

.placement-result__summary span {
  color: var(--coffee);
  font-size: var(--text-2xs);
  line-height: 1.5;
}

.placement-attempts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.placement-attempt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.placement-attempt > div:first-child {
  display: grid;
  gap: 3px;
}

.placement-attempt > div:first-child span,
.placement-attempt__status small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.placement-attempt > div:first-child strong {
  font-size: var(--text-2xs);
}

.placement-attempt__status {
  display: grid;
  gap: 2px;
  text-align: right;
}

.placement-attempt__status strong {
  color: var(--success-ink);
  font-size: var(--text-md);
}

.teacher-placement-card {
  display: grid;
  gap: 10px;
}

.teacher-placement-card > strong {
  color: var(--coffee);
  font-size: var(--text-xs);
}

.student-preview-button--placement {
  border-color: var(--marigold);
  color: var(--ink);
  background: var(--marigold);
}

.student-preview-button--notify {
  border-color: #68a67d;
  background: #356747;
}

.student-preview-button--notify:hover {
  background: #477f5a;
}

.student-preview-button:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.pill--stopped {
  color: var(--error-ink);
  background: var(--error-bg);
}

.pill--awaiting_listening {
  color: var(--success-ink);
  background: var(--success-bg);
}

.placement-steps--stages {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.placement-routing-card,
.placement-speaking,
.placement-writing {
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.placement-routing-card > h3,
.placement-speaking > h3,
.placement-writing > h3 {
  margin: 7px 0 8px;
  font-size: clamp(21px, 5vw, 29px);
  letter-spacing: -0.04em;
  line-height: 1.16;
}

.placement-routing-card > p {
  margin: 0 0 18px;
  color: var(--coffee);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.placement-start-notice {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #ead8bd;
  border-radius: var(--radius-lg);
  background: #fff7e8;
}

.placement-start-notice > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 10px;
}

.placement-start-notice i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #f7d68f;
  color: var(--espresso);
  font-size: 17px;
  font-style: normal;
}

.placement-start-notice > div:nth-child(2) i {
  background: #f8ddd6;
  color: var(--terracotta);
}

.placement-start-notice span {
  display: grid;
  gap: 2px;
}

.placement-start-notice strong {
  color: var(--ink);
  font-size: var(--text-2xs);
}

.placement-start-notice small {
  color: var(--coffee);
  font-size: var(--text-2xs);
  line-height: 1.45;
}

.placement-route-options {
  display: grid;
  gap: 9px;
}

.placement-route-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: #fffaf1;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.placement-route-option:hover {
  border-color: var(--marigold);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.placement-route-option:disabled {
  cursor: wait;
  opacity: 0.55;
}

.placement-route-option > i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--paper);
  font-size: var(--text-2xs);
  font-style: normal;
  font-weight: 800;
}

.placement-route-option > span {
  display: grid;
  gap: 3px;
}

.placement-route-option strong {
  font-size: var(--text-xs);
}

.placement-route-option small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  line-height: 1.4;
}

.placement-route-option > b {
  color: var(--success-ink);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

.placement-route-option--unknown > b {
  color: var(--warning-ink);
}

.placement-route-followup {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.placement-route-followup h3 {
  margin: 6px 0 14px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.placement-intro--text {
  display: grid;
  min-height: 0;
  overflow: visible;
  padding: 18px;
  background: var(--espresso);
}

.placement-intro--text::after {
  display: none;
}

.placement-intro--text .placement-intro__copy {
  position: static;
  padding: 18px 4px 2px;
}

.placement-media-placeholder {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 128px;
  padding: 20px;
  border: 1px dashed rgb(250 244 233 / 38%);
  border-radius: var(--radius-xl);
  color: var(--paper);
  background:
    repeating-linear-gradient(135deg, rgb(250 244 233 / 5%) 0 10px, transparent 10px 20px),
    rgb(250 244 233 / 6%);
}

.placement-media-placeholder > i {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: var(--espresso);
  background: var(--marigold);
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
}

.placement-media-placeholder > div {
  display: grid;
  gap: 5px;
}

.placement-media-placeholder strong {
  font-size: var(--text-sm);
}

.placement-media-placeholder span {
  color: #d8c9b3;
  font-size: var(--text-2xs);
}

.placement-media-asset {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgb(250 244 233 / 25%);
  border-radius: var(--radius-xl);
  color: var(--paper);
  background: rgb(250 244 233 / 8%);
}

.placement-media-asset [hidden] {
  display: none !important;
}

.placement-media-asset + .placement-media-asset,
.placement-media-placeholder + .placement-media-asset,
.placement-media-asset + .placement-media-placeholder {
  margin-top: 12px;
}

.placement-media-asset--image {
  position: relative;
  width: min(100%, 760px);
  justify-self: center;
}

.placement-intro--text .placement-media-asset--image img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
}

.placement-media-asset--image figcaption {
  display: grid;
  min-height: 72px;
  place-items: center;
  color: #d8c9b3;
  font-size: var(--text-2xs);
}

.placement-media-asset--audio {
  display: grid;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.placement-audio-player {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-lg);
  color: var(--espresso);
  background: var(--paper);
}

.placement-audio-player > button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--espresso);
  background: var(--marigold);
  box-shadow: 0 3px 0 rgb(0 0 0 / 14%);
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: 800;
  cursor: pointer;
}

.placement-audio-player > button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.placement-audio-player > button.is-playing {
  color: var(--paper);
  background: var(--terracotta);
}

.placement-audio-player > button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.placement-audio-player > button.is-playing:disabled {
  cursor: default;
  opacity: 1;
}

.placement-audio-player > button b {
  min-width: 15px;
  font-size: var(--text-sm);
}

.placement-audio-player > div {
  display: grid;
  min-width: 112px;
  gap: 3px;
  text-align: right;
}

.placement-audio-player > div strong {
  color: var(--coffee);
  font-size: var(--text-2xs);
}

.placement-audio-player > div span {
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.placement-listening-disclaimer {
  display: block;
  margin: 10px 0 5px;
  color: var(--paper);
  font-size: var(--text-2xs);
  font-weight: 800;
  line-height: 1.45;
}

.placement-task-group {
  display: grid;
  gap: 12px;
}

.placement-task-group + .placement-task-group {
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.placement-task-head {
  padding: 4px 2px 0;
}

.placement-task-head p {
  margin: 4px 0 0;
  color: var(--coffee);
  font-size: var(--text-2xs);
}

.placement-placeholder-note {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid #a9bfce;
  border-radius: var(--radius-lg);
  color: var(--slate-blue);
  background: var(--info-bg);
}

.placement-placeholder-note strong {
  font-size: var(--text-2xs);
}

.placement-placeholder-note p {
  margin: 5px 0 0;
  font-size: var(--text-2xs);
  line-height: 1.55;
}

.placement-disabled-questions {
  display: grid;
  gap: 12px;
  max-height: 410px;
  overflow: hidden;
  mask-image: linear-gradient(#000 65%, transparent);
  opacity: 0.68;
  pointer-events: none;
}

.placement-speaking__progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.placement-speaking__progress b {
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  color: var(--paper);
  background: var(--espresso);
}

.placement-support {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--warning-bg);
}

.placement-support strong {
  font-size: var(--text-2xs);
}

.placement-support ul {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--coffee);
  font-size: var(--text-2xs);
  line-height: 1.45;
}

.placement-timing {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.placement-timing > span {
  flex: 1 1 140px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.placement-timing strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: var(--text-2xs);
}

.placement-recorder {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fffaf1;
}

.placement-recorder__status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--coffee);
  background: var(--cream);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.placement-recorder__status > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--taupe);
}

.placement-recorder__status.is-recording > i {
  background: var(--terracotta);
  box-shadow: 0 0 0 5px rgb(217 71 43 / 14%);
  animation: recorder-pulse 1.2s infinite;
}

.placement-recorder__status.is-ready > i {
  background: var(--success);
}

.placement-recorder__status.is-error > i {
  background: var(--error);
}

.placement-record-button {
  min-height: 58px;
  color: #fff;
  background: var(--terracotta);
}

.placement-record-button:hover {
  background: #bd3925;
}

.placement-record-button--stop {
  background: var(--espresso);
}

.placement-file-fallback {
  display: grid;
  gap: 6px;
  margin-top: 3px;
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.placement-file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  padding: 8px 14px;
  overflow: hidden;
  border: 1px solid var(--terracotta);
  border-radius: 12px;
  background: var(--terracotta);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  box-shadow: 0 5px 12px rgb(155 62 40 / 18%);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.placement-file-picker:hover {
  background: #a93422;
  transform: translateY(-1px);
}

.placement-file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.placement-file-fallback > small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  overflow-wrap: anywhere;
}

.teacher-placement-timing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff7e8;
  color: var(--coffee);
  font-size: var(--text-2xs);
}

.teacher-placement-timing > .icon {
  color: var(--terracotta);
  font-size: 15px;
}

.placement-recorder > small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  line-height: 1.5;
}

@keyframes recorder-pulse {
  50% { opacity: 0.45; }
}

.placement-writing__field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  font-size: var(--text-2xs);
  font-weight: 700;
}

.placement-writing__field textarea {
  min-height: 260px;
  line-height: 1.65;
}

.placement-writing__count,
.placement-writing__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.placement-writing__count span {
  font-size: var(--text-2xs);
  font-weight: 800;
}

.placement-writing__count small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  text-align: right;
}

.placement-writing__actions .button {
  flex: 1 1 180px;
}

.teacher-placement-subsection {
  display: grid;
  gap: 9px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.teacher-placement-subsection h4 {
  margin: 0;
  font-size: var(--text-2xs);
}

.placement-audio-review-list {
  display: grid;
  gap: 10px;
}

.placement-audio-review {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fffaf1;
}

.placement-audio-review audio {
  width: 100%;
  height: 42px;
}

.placement-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.placement-audio-actions > * {
  flex: 1 1 190px;
  text-align: center;
}

.placement-audio-retention {
  color: var(--taupe);
  font-size: var(--text-2xs);
  line-height: 1.5;
}

.privacy-footer {
  padding: 2px 20px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
}

.privacy-footer a {
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.privacy-shell {
  width: min(720px, calc(100% - 28px));
  margin: 32px auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.privacy-shell h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 7vw, 52px);
}

.privacy-shell section {
  margin-top: 24px;
}

.privacy-shell h2 {
  margin: 0 0 7px;
  font-size: 16px;
}

.privacy-shell p {
  margin: 0;
  color: var(--coffee);
  font-size: var(--text-xs);
  line-height: 1.7;
}

.privacy-lead {
  font-size: 14px !important;
}

.privacy-back {
  display: inline-flex;
  margin-top: 28px;
  text-decoration: none;
}

.placement-writing-review {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fffaf1;
}

.placement-writing-review p {
  margin: 10px 0 0;
  color: var(--coffee);
  font-size: var(--text-2xs);
  line-height: 1.65;
  white-space: pre-wrap;
}

.pill--reading,
.pill--listening,
.pill--speaking,
.pill--writing,
.pill--awaiting_review,
.pill--reviewed {
  color: var(--success-ink);
  background: var(--success-bg);
}

.pill--followup_needed {
  color: var(--warning-ink);
  background: var(--warning-bg);
}

.section-note {
  margin: -4px 0 14px;
  color: var(--coffee);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.calendar-setup {
  display: grid;
  gap: 8px;
}

.calendar-setup h3,
.calendar-setup p,
.calendar-event h3,
.calendar-event p {
  margin: 0;
}

.calendar-setup p,
.calendar-event p {
  color: var(--coffee);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.calendar-week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgb(250 244 233 / 72%);
}

.calendar-week-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.calendar-week-toolbar__actions {
  display: flex;
  gap: 6px;
}

.calendar-week-toolbar__actions button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--espresso);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--paper);
  cursor: pointer;
}

.calendar-event-list {
  display: grid;
  gap: 10px;
}

.calendar-event {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

.calendar-event--lesson {
  border-color: rgb(62 142 90 / 34%);
  background: linear-gradient(135deg, var(--paper), var(--success-bg));
}

.calendar-event--muted {
  opacity: 0.78;
}

.calendar-event__main {
  display: grid;
  gap: 8px;
}

.calendar-event__link {
  justify-self: start;
  color: var(--slate-blue);
  font-size: var(--text-xs);
  font-weight: 800;
  text-decoration: none;
}

.calendar-event__mark {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.calendar-event__mark label {
  display: grid;
  gap: 6px;
  color: var(--coffee);
  font-size: var(--text-xs);
  font-weight: 700;
}

.calendar-event__mark select,
.calendar-event__mark input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fffdf8;
}

.calendar-event__mark [data-calendar-new-student] {
  grid-column: 1 / -1;
}

.skeleton {
  display: grid;
  gap: 12px;
}

.skeleton div {
  height: 110px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--paper), var(--sand), var(--paper));
  background-size: 200% 100%;
  animation: shimmer 1.1s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 520px) {
  .teacher-section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-inline: -2px;
    border-radius: var(--radius-xl);
  }

  .teacher-section-nav button {
    min-width: 0;
    padding-inline: 8px;
  }

  .teacher-access-picker {
    grid-template-columns: 1fr;
  }

  .teacher-access-picker__actions {
    grid-column: auto;
    flex-direction: column;
  }

  .teacher-access-picker__actions .button {
    flex-basis: auto;
    width: 100%;
  }

  .teacher-revenue__heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .teacher-revenue__heading p {
    max-width: none;
    text-align: left;
  }

  .revenue-grid {
    grid-template-columns: 1fr;
  }

  .revenue-primary {
    min-height: 164px;
  }

  .revenue-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    padding-inline: 12px;
  }

  .card,
  .menu-tile {
    border-radius: 20px;
  }

  .result-table th,
  .result-table td {
    padding: 10px 11px;
  }

  .result-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-record-picker {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .student-record-head__actions {
    width: 100%;
    align-items: stretch;
  }

  .student-record-head__id {
    align-self: flex-start;
  }

  .student-preview-button {
    width: 100%;
  }

  .student-settings-panel {
    padding: 16px;
  }

  .student-settings-grid {
    grid-template-columns: 1fr;
  }

  .student-lifecycle-zone,
  .archived-student-row {
    align-items: stretch;
    flex-direction: column;
  }

  .student-lifecycle-button,
  .archived-student-row__actions,
  .archived-student-row__actions button {
    width: 100%;
  }

  .archived-student-row__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .student-preview-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .student-preview-banner button {
    width: 100%;
  }

  .student-record-stats {
    grid-template-columns: 1fr 1fr;
  }

  .teacher-balance-card {
    grid-template-columns: 1fr;
  }

  .teacher-balance-card__action {
    justify-items: stretch;
  }

  .teacher-balance-card__tariff {
    justify-self: start;
  }

  .advance-payment-fields {
    grid-template-columns: 1fr;
  }

  .billing-settings-fields {
    grid-template-columns: 1fr;
  }

  .billing-settings-note {
    flex-direction: column;
    gap: 3px;
  }

  .student-create-form,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .calendar-week-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-week-toolbar__actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
  }

  .calendar-event__mark {
    grid-template-columns: 1fr;
  }

  .calendar-event__mark .button {
    width: 100%;
  }

  .copy-row button {
    min-height: 40px;
  }

  .placement-feature {
    grid-template-columns: auto 1fr;
  }

  .placement-feature__action {
    grid-column: 1 / -1;
    text-align: center;
  }

  .placement-intro,
  .placement-intro img {
    min-height: 250px;
  }

  .placement-intro__copy {
    padding: 18px;
  }

  .placement-intro--text {
    min-height: 0;
    padding: 12px;
  }

  .placement-intro--text .placement-intro__copy {
    padding: 16px 6px 4px;
  }

  .placement-media-placeholder {
    min-height: 112px;
    padding: 16px;
  }

  .placement-steps--stages {
    gap: 2px;
  }

  .placement-steps--stages .placement-step b {
    font-size: var(--text-2xs);
    letter-spacing: 0;
  }

  .placement-steps--stages .placement-step i {
    width: 27px;
    height: 27px;
  }

  .placement-routing-card,
  .placement-speaking,
  .placement-writing {
    padding: 18px 14px;
  }

  .placement-route-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .placement-route-option > b {
    grid-column: 2;
  }

  .placement-writing__actions,
  .placement-writing__count {
    align-items: stretch;
    flex-direction: column;
  }

  .placement-writing__count small {
    text-align: left;
  }

  .placement-writing__actions .button {
    flex-basis: auto;
    width: 100%;
  }

  .placement-question__prompt {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .placement-question__prompt > span {
    width: 30px;
    height: 30px;
  }

  .placement-options {
    padding: 9px 10px 10px;
  }

  .placement-reading summary small {
    display: none;
  }
}

@media (max-width: 360px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .menu-tile {
    min-height: 126px;
  }

  .menu-tile--results {
    grid-column: auto;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Задание из taskdesign внутри персонализированной практики */
.practice-inline-task {
  display: block;
  font-size: 16px;
  line-height: 2.4;
}

.practice-inline {
  width: auto;
  display: inline-block;
  min-width: 128px;
  max-width: 100%;
  margin: 0 2px;
  padding: 6px 10px;
  vertical-align: baseline;
  border: 1px solid var(--line, #e3d6bf);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
}

.practice-inline:focus { border-color: var(--orange, #f5a623); outline: 0; }
input.practice-inline, select.practice-inline { width: auto; }
.practice-inline--select { min-width: 116px; }
.practice-inline::placeholder { color: var(--muted, var(--taupe)); font-style: italic; }

.practice-inline-task--review { line-height: 1.9; }
.practice-inline-answer {
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--line, #f3eadb);
  font-weight: 700;
}

.practice-inline-answer.is-correct {
  color: var(--success-ink);
  background: var(--success-bg, #e4f0e7);
  box-shadow: inset 0 0 0 1px rgb(62 142 90 / 45%);
}

.practice-inline-answer.is-wrong {
  color: var(--error-ink);
  background: var(--error-bg, #f7e0dc);
  box-shadow: inset 0 0 0 1px rgb(192 57 43 / 45%);
  text-decoration: line-through;
}


.practice-inline-answer.is-empty { color: var(--muted, var(--taupe)); }

.practice-inline-score {
  margin-top: 10px;
  color: var(--coffee, #5c5047);
  font-size: var(--text-xs);
  font-weight: 700;
}

.practice-inline-score.is-full { color: var(--success-ink); }

.practice-inline-answer.is-expected {
  margin-left: 4px;
  color: var(--success-ink);
  background: var(--success-bg, #e4f0e7);
  box-shadow: inset 0 0 0 1px rgb(62 142 90 / 45%);
}

/* Импорт заданий из файла LLM в форму практики */
.practice-import { display: grid; gap: 10px; margin-bottom: 14px; }

.practice-import__zone {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 20px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #fffaf1;
  text-align: center;
}

.practice-import__zone.is-over { border-color: var(--orange, #f5a623); background: #fff3dd; }
.practice-import__zone strong { font-size: var(--text-md); }
.practice-import__zone span { color: var(--muted, var(--taupe)); font-size: var(--text-xs); line-height: 1.5; }
.practice-import__zone .button { margin-top: 4px; }

.practice-import textarea { min-height: 88px; font-family: Consolas, monospace; font-size: var(--text-xs); }

.practice-import__state { font-size: var(--text-xs); font-weight: 600; }
.practice-import__state.is-valid { color: var(--success-ink); }
.practice-import__state.is-invalid { color: var(--error-ink); }

.practice-import__preview { display: grid; gap: 6px; }

.practice-import__task {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-sm, 10px);
  background: #fffaf1;
  border: 1px solid var(--line, #e3d6bf);
}

.practice-import__task strong { font-size: var(--text-sm); }
.practice-import__task span { color: var(--muted, var(--taupe)); font-size: var(--text-2xs); }
.practice-import__task.is-skipped { opacity: 0.62; border-style: dashed; }

.practice-task-instruction {
  margin-bottom: 8px;
  color: var(--muted, var(--taupe));
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
}

/* Рендер всех форматов practice */
.pr { display: grid; gap: 14px; }
.pr-copy { font-size: 16px; line-height: 2.4; }
.pr-row { display: grid; gap: 9px; }
.pr-note { margin: 0; color: var(--muted, var(--taupe)); font-size: var(--text-xs); line-height: 1.5; }
.pr-key { color: var(--muted, var(--taupe)); font-size: var(--text-xs); font-weight: 600; }
.pr-title { margin: 0; font-size: 17px; }
.pr-reading { margin: 0; font-size: 17px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.pr-broken { color: var(--error-ink); font-size: var(--text-sm); }

.pr-input {
  width: auto;
  display: inline-block;
  min-width: 122px;
  max-width: 100%;
  margin: 0 2px;
  padding: 6px 10px;
  vertical-align: baseline;
  border: 1px solid var(--line, #e3d6bf);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
}

input.pr-input, select.pr-input { width: auto; }
.pr-input:focus { border-color: var(--orange, #f5a623); outline: 0; }
.pr-input::placeholder { color: var(--muted, var(--taupe)); font-style: italic; }
.pr-textarea { width: 100%; min-height: 120px; resize: vertical; }

.pr-bank, .pr-options { display: flex; flex-wrap: wrap; gap: 7px; }

.pr-chip, .pr-option, .pr-placed {
  padding: 8px 12px;
  border: 1px solid var(--border-strong, #c9bca8);
  border-radius: 11px;
  color: var(--ink, #1f1b17);
  background: #fff;
  font-size: var(--text-md);
  text-align: left;
}

.pr-chip:hover, .pr-option:hover, .pr-placed:hover { border-color: var(--orange, #f5a623); }
.pr-chip.is-used { color: var(--muted, var(--taupe)); text-decoration: line-through; pointer-events: none; }
.pr-chip.is-static { pointer-events: none; }
.pr-chip.is-letter { min-width: 36px; font-family: Consolas, monospace; text-align: center; }
.pr-option.is-picked { border-color: var(--orange, #f5a623); background: #fbefd2; }
.pr-option.is-key, .pr-placed.is-correct, .pr-option.is-correct { border-color: #3e8e5a; background: #e4f0e7; }
.pr-option.is-wrong, .pr-placed.is-wrong { border-color: #c0392b; background: #f7e0dc; }

.pr-stack { display: grid; gap: 7px; }
.pr-slot {
  min-height: 46px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  border: 1px dashed var(--border-strong, #c9bca8);
  border-radius: 13px;
  background: #fffaf1;
}

.pr-line { font-size: 15px; line-height: 1.6; }
.pr-match { display: grid; gap: 8px; }
.pr-match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.pr-match-left { padding: 9px 12px; border: 1px solid var(--border-strong, #c9bca8); border-radius: 11px; background: #fff; font-size: var(--text-md); text-align: left; }
.pr-match-row.is-correct .pr-match-left { border-color: #3e8e5a; background: #e4f0e7; }
.pr-match-row.is-wrong .pr-match-left { border-color: #c0392b; background: #f7e0dc; }
.pr-match-done { font-size: var(--text-md); font-weight: 600; }
.pr-match-empty { color: var(--muted, var(--taupe)); font-size: var(--text-sm); }
.pr-match-slot { display: block; min-height: 38px; border-bottom: 2px solid var(--line, #e3d6bf); }
.pr-match-assigned { position: relative; min-width: 0; }
.pr-match-assigned .pr-match-done { width: 100%; padding-right: 52px; }
.pr-match-unlink {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fffaf1;
  background: var(--espresso, #4a281b);
  box-shadow: 0 4px 10px rgb(74 40 27 / 20%);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}
.pr-match-unlink:hover, .pr-match-unlink:focus-visible { background: var(--coffee, #6b3b27); }
.pr-match-unlink:focus-visible { outline: 2px solid var(--marigold, #f5a623); outline-offset: 2px; }

.pr-listening-media {
  overflow: hidden;
  border: 1px solid var(--border, #e5d4b7);
  border-radius: var(--radius-lg, 18px);
  background: var(--paper, #fffdf8);
}

.pr-order-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.pr-order-slots .pr-chip { width: 100%; min-height: 44px; text-align: center; }
.pr-order-hole {
  display: block;
  min-height: 44px;
  border: 1px dashed var(--border-strong, #c9bca8);
  border-radius: 11px;
  background: #fffaf1;
}
.pr-order-hole.is-drop-target,
.pr-order-slots .pr-chip.is-drop-target {
  border-color: var(--orange, #f5a623);
  background: #fff1d2;
  box-shadow: inset 0 0 0 1px rgb(245 166 35 / 20%);
}

.pr-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pr-column { display: grid; gap: 7px; align-content: start; min-height: 96px; padding: 10px; border: 1px solid var(--line, #e3d6bf); border-radius: 14px; background: #fffaf1; }
.pr-column h4 { margin: 0; font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; }

.pr-question { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line, #e3d6bf); }
.pr-question:first-child { border-top: 0; }
.pr-question p { margin: 0; font-size: 15px; line-height: 1.55; }

.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pr-card { display: grid; min-width: 0; max-width: 100%; gap: 7px; padding: 10px; border: 1px solid var(--line, #e3d6bf); border-radius: 14px; background: #fffaf1; }
.pr-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--border-strong, #c9bca8); border-radius: 10px; color: var(--muted, var(--taupe)); background: #fff; font-size: var(--text-2xs); text-align: center; }
.pr-image { display: block; width: 100%; max-width: 100%; height: 100%; border-radius: 9px; object-fit: cover; }
.pr-composite { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pr-composite > * { min-width: 0; max-width: 100%; }
.pr-prompt-media {
  display: grid;
  place-items: center;
  min-width: 0;
  max-width: 100%;
  max-height: min(60vh, 440px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line, #e3d6bf);
  border-radius: 12px;
  background: #fff;
}
.pr-prompt-media .pr-image { width: auto; max-width: 100%; height: auto; max-height: min(60vh, 440px); border-radius: 0; object-fit: contain; }

/* Read and Select: одно слово за раз, ✓/✗ сразу переводит к следующему. */
.pr-flash { display: grid; gap: 14px; justify-items: center; padding: 18px 14px; border: 1px solid var(--line, #e3d6bf); border-radius: 18px; background: #fffdf8; text-align: center; }
.pr-flash__meta { display: grid; gap: 6px; width: 100%; color: var(--muted, var(--taupe)); font-size: var(--text-xs); font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-flash__meta progress { width: 100%; height: 4px; overflow: hidden; border: 0; border-radius: 99px; background: #efe4d1; accent-color: var(--orange, #f5a623); appearance: none; }
.pr-flash__meta progress::-webkit-progress-bar { background: #efe4d1; }
.pr-flash__meta progress::-webkit-progress-value { background: var(--orange, #f5a623); }
.pr-flash__meta progress::-moz-progress-bar { background: var(--orange, #f5a623); }
.pr-flash__word { max-width: 100%; padding: 10px 0 4px; color: var(--ink, #1f1b17); font-size: clamp(26px, 8vw, 36px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.pr-flash__timer { width: min(220px, 100%); height: 5px; overflow: hidden; border-radius: 99px; background: #efe4d1; }
.pr-flash__timer i { display: block; height: 100%; background: var(--orange, #f5a623); transform-origin: left; animation: pr-flash-drain linear forwards; }
.pr-flash__buttons { display: flex; justify-content: center; gap: 14px; }
.pr-flash__button { display: grid; justify-items: center; gap: 2px; min-width: 88px; padding: 10px 16px; border: 1.5px solid var(--line, #e3d6bf); border-radius: 16px; background: #fff; color: var(--ink, #1f1b17); cursor: pointer; }
.pr-flash__button span { font-size: 28px; font-weight: 800; line-height: 1; }
.pr-flash__button small { color: var(--muted, var(--taupe)); font-size: var(--text-2xs); font-weight: 800; }
.pr-flash__button.is-true span { color: #2f7a4b; }
.pr-flash__button.is-false span { color: #b23a2c; }
.pr-flash__button.is-true:hover, .pr-flash__button.is-true:focus-visible { border-color: #3e8e5a; background: #edf7ef; }
.pr-flash__button.is-false:hover, .pr-flash__button.is-false:focus-visible { border-color: #c0392b; background: #fbecea; }
.pr-flash__button:disabled { opacity: 0.5; cursor: default; }
.pr-flash.is-done { gap: 4px; }
.pr-flash.is-done strong { font-size: 18px; }
.pr-flash.is-done span { color: var(--muted, var(--taupe)); font-size: var(--text-sm); }
.pr-flash-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.pr-flash-review__row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 9px; border: 1px solid var(--line, #e3d6bf); border-radius: 10px; background: #fffdf8; font-size: var(--text-md); }
.pr-flash-review__row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pr-flash-review__mark { font-size: var(--text-xs); }
.pr-flash-review__key { color: var(--success-ink); font-style: normal; font-weight: 800; }
.pr-flash-review__row.is-correct { border-color: rgb(62 142 90 / 45%); background: #edf7ef; }
.pr-flash-review__row.is-wrong { border-color: rgb(192 57 43 / 40%); background: #fbecea; }
.pr-flash-review__row.is-missed { border-style: dashed; color: var(--muted, var(--taupe)); }
/* Правило раскрытия заданий в форме практики/домашки. */
.practice-reveal { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--line, #e3d6bf); border-radius: 14px; }
.practice-reveal legend { padding: 0 6px; font-weight: 800; }
.practice-reveal__modes { display: flex; flex-wrap: wrap; gap: 6px; }
.practice-reveal__modes [aria-pressed="true"] { border-color: var(--orange, #f5a623); background: #fff2dd; color: #8a3b0d; }
.practice-reveal__options { display: flex; flex-wrap: wrap; gap: 10px; }
.practice-reveal__options label[hidden], .practice-reveal-item[hidden], .practice-reveal-item__manual[hidden] { display: none; }
.practice-reveal-item { display: grid; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #fbf4e6; font-size: var(--text-sm); }
.practice-reveal-item__badge { font-weight: 700; }
.practice-reveal-item__manual { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.practice-reveal-item__manual label { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
@keyframes pr-flash-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .pr-flash__timer i { animation-timing-function: steps(5, end); } }
.pr-audio, .pr-video { display: block; width: 100%; max-height: 360px; border-radius: 12px; background: #1f1b17; }
.pr-gallery--carousel { display: flex; grid-template-columns: none; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.pr-gallery--carousel .pr-card { flex: 0 0 min(78vw, 320px); scroll-snap-align: start; }
.pr-gallery--gif .pr-card { max-width: 360px; margin-inline: auto; }

.pr-pairs { display: grid; gap: 6px; }
.pr-pair { display: grid; grid-template-columns: minmax(90px, 0.5fr) 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #e3d6bf); font-size: 15px; }
.pr-pair:first-child { border-top: 0; }

.pr-media { display: grid; place-items: center; padding: 22px; border: 1px dashed var(--border-strong, #c9bca8); border-radius: 14px; background: #fffaf1; color: var(--muted, var(--taupe)); font-size: var(--text-sm); }
.pr-note-block { display: grid; gap: 5px; padding: 12px 14px; border-left: 3px solid var(--orange, #f5a623); border-radius: 0 12px 12px 0; background: #fbefd2; font-size: 15px; }
.pr-link { color: var(--ember, #e07a1f); font-weight: 700; }
.pr-divider { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--muted, var(--taupe)); font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.pr-divider::before, .pr-divider::after { content: ""; flex: 1; height: 1px; background: var(--line, #e3d6bf); }
.pr-script { padding: 10px 12px; border: 1px solid var(--line, #e3d6bf); border-radius: 12px; background: #fffaf1; font-size: var(--text-md); }
.pr-script summary { cursor: pointer; font-weight: 700; }
.pr-answer-block { padding: 10px 12px; border-left: 3px solid var(--line, #e3d6bf); background: #fffaf1; font-size: 15px; }

.pr-recorder { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line, #e3d6bf); border-radius: 15px; background: #fffaf1; }
.pr-recorder.is-ready { border-color: #3e8e5a; background: #edf7ef; }
.pr-recorder__status { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.pr-recorder__status i { width: 9px; height: 9px; border-radius: 50%; background: #c9bca8; }
.pr-recorder.is-ready .pr-recorder__status i { background: #3e8e5a; }
.pr-recorder.is-recording .pr-recorder__status i {
  background: #ff8d2a;
  box-shadow: 0 0 0 5px rgb(255 141 42 / 18%);
  animation: pr-recorder-pulse 1.1s ease-in-out infinite;
}
.pr-recorder__status span { font-size: var(--text-sm); font-weight: 700; }
.pr-recorder__status b { font-variant-numeric: tabular-nums; }
.pr-voice-visualizer {
  position: relative;
  height: 76px;
  padding: 9px 12px;
  overflow: hidden;
  border: 1px solid rgb(255 188 105 / 55%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgb(255 211 139 / 42%), transparent 38%),
    linear-gradient(135deg, #582008 0%, #ad410e 48%, #f58f28 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 9px 24px rgb(126 48 8 / 14%);
}
.pr-voice-visualizer::after {
  content: "";
  position: absolute;
  inset: -70% -25%;
  background: linear-gradient(105deg, transparent 34%, rgb(255 255 255 / 14%) 48%, transparent 62%);
  transform: translateX(-35%);
  opacity: 0.45;
}
.pr-voice-visualizer canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.56;
  transition: opacity 180ms ease;
}
.pr-recorder.is-recording .pr-voice-visualizer {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 12px 30px rgb(196 76 12 / 28%);
}
.pr-recorder.is-recording .pr-voice-visualizer::after { animation: pr-recorder-sheen 2.4s linear infinite; }
.pr-recorder.is-recording .pr-voice-visualizer canvas { opacity: 1; }
.pr-recorder.is-ready .pr-voice-visualizer canvas { opacity: 0.94; }
.pr-recorder.is-ready .pr-voice-visualizer {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 10px 26px rgb(126 48 8 / 20%);
}
.pr-recorder__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-recorder__actions .pr-timer-start { margin: 0; padding: 9px 13px; }
.pr-recorder__actions .is-stop { background: #8f2b20; }
.pr-recorder__actions .is-rerecord {
  border-color: #a93428;
  background: linear-gradient(135deg, #c94a3d, #9f2f25);
  color: #fff;
  box-shadow: 0 7px 16px rgb(159 47 37 / 22%);
}
.pr-recorder__actions .is-play {
  border: 1px solid rgb(215 119 35 / 45%);
  background: #fff2dd;
  color: #8a3b0d;
}
.pr-recorder__actions button:disabled { opacity: 0.48; cursor: default; }
.pr-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted, var(--taupe)); font-size: var(--text-xs); }
.pr-file input { max-width: 100%; }
.pr-recorder small { color: var(--muted, var(--taupe)); line-height: 1.5; }

.pr-anagram-hint {
  color: var(--ink, #1f1b17);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.pr-placed.is-empty {
  min-height: 38px;
  border-style: dashed;
  background: #fffaf1;
}

@keyframes pr-recorder-pulse {
  0%, 100% { transform: scale(0.86); opacity: 0.72; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes pr-recorder-sheen {
  from { transform: translateX(-42%); }
  to { transform: translateX(42%); }
}

.pr-answer { padding: 2px 7px; border-radius: 8px; background: var(--line, #f3eadb); font-weight: 700; }
.pr-answer.is-correct { color: var(--success-ink); background: #e4f0e7; box-shadow: inset 0 0 0 1px rgb(62 142 90 / 45%); }
.pr-answer.is-wrong { color: var(--error-ink); background: #f7e0dc; box-shadow: inset 0 0 0 1px rgb(192 57 43 / 45%); text-decoration: line-through; }
.pr-answer.is-expected { margin-left: 4px; color: var(--success-ink); background: #e4f0e7; box-shadow: inset 0 0 0 1px rgb(62 142 90 / 45%); }
.pr-answer.is-empty { color: var(--muted, var(--taupe)); }
.pr-match-review, .pr-sequence-key { display: grid; gap: 7px; }
.pr-match-done.is-wrong { color: var(--error-ink); background: #f7e0dc; border-color: #c0392b; text-decoration: line-through; }
.pr-match-expected, .pr-placed.is-key { color: var(--success-ink); background: #e4f0e7; border-color: #3e8e5a; }

/* Тест на время */
.practice-overall-gate {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 14px 0 0;
  padding: 30px 22px;
  text-align: center;
  border-color: rgb(224 122 31 / 35%);
  background: linear-gradient(145deg, #fffaf1, #fbefd2);
}

.practice-overall-gate__eyebrow {
  color: var(--ember, #e07a1f);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practice-overall-gate strong {
  color: var(--coffee, #5c5047);
  font-size: clamp(38px, 9vw, 58px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.practice-overall-gate p {
  max-width: 520px;
  margin: 0;
  color: var(--muted, var(--taupe));
  line-height: 1.5;
}

.practice-overall-timer {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  padding: 13px 18px;
  border: 1px solid rgb(224 122 31 / 36%);
  border-radius: 16px;
  background: rgb(255 250 241 / 94%);
  box-shadow: 0 8px 24px rgb(92 80 71 / 12%);
  backdrop-filter: blur(12px);
  color: var(--coffee, #5c5047);
  font-weight: 800;
}

.practice-overall-timer strong {
  color: var(--ember, #e07a1f);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.practice-overall-timer.is-over {
  color: var(--error-ink);
  border-color: rgb(192 57 43 / 40%);
  background: #f7e0dc;
}

.practice-form.is-time-over {
  opacity: 0.82;
  pointer-events: none;
}

.pr-timer-gate {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 22px 18px;
  border: 1px dashed var(--border-strong, #c9bca8);
  border-radius: 16px;
  background: #fffaf1;
  text-align: center;
}

.pr-timer-gate strong { font-size: 15px; }
.pr-timer-clock { font-size: 30px; font-weight: 800; letter-spacing: 0.04em; }
.pr-timer-gate .pr-note { margin: 0; }

.pr-timer-start {
  margin-top: 4px;
  padding: 11px 26px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #f5a623, #e07a1f);
  font-size: var(--text-md);
  font-weight: 800;
}

.pr-timer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 12px;
  background: #fbefd2;
  font-size: var(--text-sm);
  font-weight: 700;
}

.pr-timer span { font-size: 19px; font-variant-numeric: tabular-nums; }
.pr-timer.is-over { justify-content: center; background: var(--warning-bg, #fbefd2); color: var(--ember, #e07a1f); }

/* Перетаскивание заданий */
.pr-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  padding: 8px 12px;
  border: 1px solid var(--orange, #f5a623);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(31 27 23 / 22%);
  color: var(--ink, #1f1b17);
  font-size: var(--text-md);
  font-weight: 600;
  pointer-events: none;
}

[data-pr-drag] { touch-action: none; cursor: grab; }
[data-pr-drag].is-dragging { opacity: 0.42; }

.pr-slot.is-drop-target,
.pr-column.is-drop-target,
.pr-card.is-drop-target,
.pr-stack.is-drop-target {
  border-color: var(--orange, #f5a623);
  background: #fff6e3;
}

.pr-match-row.is-drop-target .pr-match-left,
.pr-placed.is-drop-target,
.pr-chip.is-drop-target,
.pr-order-hole.is-drop-target,
.pr-input.is-drop-target {
  border-color: var(--orange, #f5a623);
  background: #fff6e3;
  box-shadow: var(--focus-ring, 0 0 0 3px rgb(245 166 35 / 18%));
}

/*
 * Student practice studio
 *
 * Это production-композиция того же визуального языка, который используется
 * в taskdesign preview: отдельная paper-card на задание, крупная инструкция в
 * шапке, номер в янтарной плашке и просторная интерактивная область. Правила
 * ограничены data-practice-renderer="studio", поэтому legacy renderer остаётся
 * доступен через ?practice_renderer=legacy и не меняет свой вид.
 */
.shell:has(.practice-set[data-practice-renderer="studio"]) {
  width: min(100%, 720px);
}

.practice-sets[data-practice-renderer="studio"] {
  gap: 30px;
}

.practice-set {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.practice-set + .practice-set {
  padding-top: 8px;
}

.practice-set__head {
  padding: 20px 24px;
  border-color: rgb(95 73 38 / 13%);
  background: rgb(250 244 233 / 86%);
  box-shadow: var(--shadow-lg);
}

.practice-set__head .row {
  margin-bottom: 10px;
}

.practice-set__head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.practice-set__head .body-copy {
  margin-top: 7px;
}

.practice-form--studio,
.practice-readonly--studio {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.practice-task-list {
  display: grid;
  gap: 16px;
}

.practice-question--studio {
  display: block;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: 23px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.practice-question--studio .practice-question__head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.practice-question--studio .practice-question__head--number-only {
  padding-bottom: 0;
  border-bottom: 0;
}

.practice-question--studio .practice-question__number {
  flex: 0 0 auto;
  width: auto;
  min-width: 48px;
  height: auto;
  min-height: 42px;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--marigold);
  font-size: var(--text-sm);
  font-weight: 800;
}

.practice-question--studio .practice-task-instruction {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: clamp(18px, 2.7vw, 24px);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.018em;
}

.practice-question--studio .practice-question__content {
  padding-top: 20px;
}

.practice-question--studio .practice-question__head--number-only + .practice-question__content {
  padding-top: 16px;
}

.practice-question--studio .pr {
  gap: 18px;
}

.practice-question--studio .pr-copy {
  white-space: pre-line;
  font-size: clamp(17px, 2.3vw, 20px);
  font-weight: 600;
  line-height: 1.85;
}

.practice-question--studio .pr-row {
  gap: 12px;
}

.practice-question--studio .pr-input {
  min-width: 120px;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 11px;
  color: var(--ink);
  background: rgb(255 255 255 / 92%);
  font-size: 15px;
  font-weight: 600;
}

.practice-question--studio .pr-input:focus {
  border-color: var(--marigold);
  box-shadow: var(--focus-ring);
}

.practice-question--studio .pr-input::placeholder {
  color: var(--coffee);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 500;
  opacity: 1;
}

.practice-question--studio .pr-textarea {
  width: 100%;
  min-height: 170px;
  padding: 15px 16px;
  line-height: 1.6;
}

.practice-question--studio .pr-bank,
.practice-question--studio .pr-options {
  gap: 10px;
}

.practice-question--studio .pr-chip,
.practice-question--studio .pr-option,
.practice-question--studio .pr-placed {
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fffdf8;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.35;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.practice-question--studio .pr-chip:hover,
.practice-question--studio .pr-option:hover,
.practice-question--studio .pr-placed:hover {
  border-color: var(--marigold);
}

/* Студенческая карточка объявлена ниже базовых стилей renderer-а, поэтому
 * состояния выбора/проверки нужно закрепить с той же studio-специфичностью. */
.practice-question--studio .pr-option.is-picked {
  border-color: #a85e18;
  color: #4c2b14;
  background: linear-gradient(135deg, #ffe2a6, #ffc667);
  box-shadow: inset 0 0 0 1px rgb(168 94 24 / 24%), 0 5px 12px rgb(168 94 24 / 16%);
  transform: translateY(-1px);
}

.practice-question--studio .pr-option.is-picked:not(.is-key):not(.is-correct):not(.is-wrong)::before {
  /* Та же галочка, что check в static/icons.js: символ ✓ рисовал системный шрифт. */
  content: "";
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-right: 7px;
  border-radius: 50%;
  background: #8b4b14 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6.5 9.5 17 4 11.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  vertical-align: -4px;
}

.practice-question--studio .pr-option.is-key,
.practice-question--studio .pr-option.is-correct,
.practice-question--studio .pr-placed.is-key,
.practice-question--studio .pr-placed.is-correct {
  border-color: #3e8e5a;
  color: var(--success-ink);
  background: #e4f0e7;
}

.practice-question--studio .pr-option.is-wrong,
.practice-question--studio .pr-placed.is-wrong {
  border-color: #c0392b;
  color: var(--error-ink);
  background: #f7e0dc;
}

.practice-question--studio .pr-chip.is-used {
  opacity: 0.56;
}

.practice-question--studio .pr-match {
  gap: 10px;
}

.practice-question--studio .pr-match-row {
  gap: 12px;
}

.practice-question--studio .pr-match-left,
.practice-question--studio .pr-match-done,
.practice-question--studio .pr-match-slot {
  min-height: 58px;
  padding: 12px 15px;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  background: #fffdf8;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.practice-question--studio .pr-match-done {
  display: flex;
  align-items: center;
}

.practice-question--studio .pr-match-slot {
  display: block;
  border-style: dashed;
}

.practice-question--studio .pr-order-slots {
  gap: 10px;
}

.practice-question--studio .pr-order-hole,
.practice-question--studio .pr-order-slots .pr-chip {
  min-height: 48px;
}

.practice-question--studio .pr-columns {
  gap: 12px;
}

.practice-question--studio .pr-column {
  min-height: 132px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: #fffdf8;
}

.practice-question--studio .pr-column h4 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--coffee);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
}

.practice-question--studio .pr-question {
  gap: 11px;
  padding: 17px 0;
}

.practice-question--studio .pr-question p {
  font-size: 17px;
  font-weight: 600;
}

.practice-question--studio .pr-grid {
  gap: 14px;
}

.practice-question--studio .pr-card {
  gap: 10px;
  padding: 13px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: #fffdf8;
}

.practice-question--studio .pr-thumb {
  border-radius: 13px;
  background: #fff;
}

.practice-question--studio .pr-reading {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.65;
}

.practice-question--studio .pr-anagram-hint {
  font-size: 19px;
}

.practice-question--studio .pr-pair {
  padding: 12px 0;
  font-size: 16px;
  line-height: 1.55;
}

.practice-question--studio .pr-note-block,
.practice-question--studio .pr-answer-block {
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
}

.practice-question--studio .pr-media {
  min-height: 160px;
  padding: 28px;
}

.practice-question--studio .pr-recorder {
  padding: 16px;
  border-radius: 17px;
}

.practice-submit-bar {
  padding: 18px;
  border: 1px solid rgb(95 73 38 / 13%);
  border-radius: 23px;
  background: rgb(250 244 233 / 86%);
  box-shadow: var(--shadow-lg);
}

.practice-submit-bar .button {
  width: 100%;
  min-height: 52px;
  border-radius: 15px;
  font-size: var(--text-md);
}

.practice-set > .practice-sent,
.practice-set > .practice-feedback {
  margin-top: 0;
}

@media (max-width: 560px) {
  .shell:has(.practice-set[data-practice-renderer="studio"]) {
    padding-inline: 16px;
  }

  .practice-sets[data-practice-renderer="studio"] {
    gap: 22px;
  }

  .practice-set__head {
    padding: 17px;
    border-radius: 20px;
  }

  .practice-set__head .row {
    align-items: flex-start;
  }

  .practice-set__head .meta {
    max-width: 58%;
    text-align: right;
  }

  .practice-task-list {
    gap: 12px;
  }

  .practice-question--studio {
    padding: 20px 16px;
    border-radius: 17px;
  }

  .practice-question--studio .practice-question__head {
    gap: 10px;
    padding-bottom: 16px;
  }

  .practice-question--studio .practice-question__head--number-only {
    padding-bottom: 0;
  }

  .practice-question--studio .practice-question__number {
    min-width: 40px;
    min-height: 36px;
    padding: 8px 5px;
  }

  .practice-question--studio .practice-task-instruction {
    font-size: 18px;
  }

  .practice-question--studio .practice-question__content {
    padding-top: 18px;
  }

  .practice-question--studio .pr-copy {
    font-size: 16px;
    line-height: 1.85;
  }

  .practice-question--studio .pr-input {
    min-width: min(42vw, 160px);
    min-height: 43px;
    font-size: var(--text-sm);
  }

  .practice-question--studio .pr-match-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .practice-question--studio .pr-match-left,
  .practice-question--studio .pr-match-done,
  .practice-question--studio .pr-match-slot {
    min-height: 50px;
  }

  .practice-question--studio .placement-audio-player {
    grid-template-columns: 1fr;
  }

  .practice-question--studio .placement-audio-player > div {
    grid-template-columns: 1fr auto;
    min-width: 0;
    text-align: left;
  }

  .practice-question--studio .pr-columns {
    grid-template-columns: 1fr;
  }

  .practice-submit-bar {
    padding: 12px;
    border-radius: 18px;
  }
}

/* Keep the profile tile composition after the generic menu rules above. */
.menu-grid .menu-tile--profile {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  min-height: 92px;
  border-color: color-mix(in srgb, var(--ember) 28%, var(--border));
  background: linear-gradient(135deg, #fffaf0, var(--warning-bg));
}

/* External media stays at its source; the cabinet only renders a safe player. */
.practice-media-linker {
  border: 1px solid color-mix(in srgb, var(--ember) 28%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 88%, #fff3df);
  overflow: hidden;
}

.practice-media-linker summary {
  padding: 13px 15px;
  color: var(--ember-ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.practice-media-linker summary::-webkit-details-marker { display: none; }

.practice-media-linker__body {
  display: grid;
  gap: 12px;
  padding: 0 15px 15px;
}

.practice-media-linker__body .row {
  align-items: center;
  gap: 12px;
}

.practice-media-linker__body small {
  color: var(--muted);
  line-height: 1.35;
}

.practice-media-linker__preview {
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--ember) 25%, var(--border));
  border-radius: 12px;
  background: var(--paper);
}

.practice-media-linker__preview[hidden] { display: none; }

.pr-linked-media {
  display: grid;
  gap: 10px;
  width: 100%;
}

.pr-embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #17130f;
  box-shadow: 0 12px 30px rgba(48, 33, 18, 0.14);
}

.pr-linked-media.is-compact .pr-embed-frame {
  aspect-ratio: auto;
  min-height: 176px;
}

.pr-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pr-media-open {
  justify-self: start;
  color: var(--ember-ink);
  font-size: var(--text-sm);
  font-weight: 800;
  text-decoration: none;
}

.pr-media-open:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .practice-media-linker__body .row {
    align-items: stretch;
    flex-direction: column;
  }

  .pr-embed-frame { border-radius: 12px; }
}

/* A quiet expandable home for recommendations, demos and future extras. */
.menu-grid .menu-tile--additional {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  min-height: 92px;
  border-color: color-mix(in srgb, var(--slate-blue) 28%, var(--border));
  background: linear-gradient(135deg, #f7f0e5 0%, var(--info-bg) 100%);
}

.menu-tile--additional:hover .menu-tile__arrow { transform: translateX(4px); }

.additional-resource-section {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.additional-resource-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.additional-resource-section__heading h2 { margin: 0; }
/* Счётчик — как у «Истории» в домашке и практике. */
.additional-resource-section__heading b {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--ink);
  background: var(--honey);
  font-size: var(--text-sm);
}
.recommendation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.recommendation-card {
  overflow: hidden;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fffaf1;
  box-shadow: var(--shadow-xs);
}

.recommendation-card__player { border-bottom: 1px solid var(--border); background: var(--espresso); }
.recommendation-card__player .pr-linked-media { gap: 0; }
.recommendation-card__player .pr-media-open { display: none; }
.recommendation-card__player .pr-video, .recommendation-card__player .pr-embed-frame { border-radius: 0; }
.recommendation-card__body { display: grid; gap: 9px; flex: 1; padding: 14px; }
.recommendation-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recommendation-card__meta span { display: inline-flex; align-items: center; gap: 5px; color: var(--ember-ink); font-size: var(--text-2xs); font-weight: 800; text-transform: uppercase; }
.recommendation-card__meta span .icon { font-size: var(--text-sm); }
.recommendation-card__meta small { overflow: hidden; color: var(--taupe); font-size: var(--text-2xs); text-overflow: ellipsis; white-space: nowrap; }
.recommendation-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.recommendation-card p { margin: 0; color: var(--coffee); font-size: var(--text-2xs); line-height: 1.55; }
.recommendation-card__actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.recommendation-card__actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: 800;
  text-decoration: none;
}
.recommendation-card__actions a .icon { color: var(--ember); font-size: 16px; }
.recommendation-card__actions button {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--ember) 24%, var(--border));
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--warning-bg);
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: 800;
  cursor: pointer;
}
.recommendation-card__actions button:disabled { opacity: 0.55; cursor: default; }
.recommendation-card.is-archived { background: color-mix(in srgb, var(--cream) 78%, var(--paper)); }
.recommendation-card.is-archived .recommendation-card__player { filter: saturate(0.72); }
.recommendation-archive {
  overflow: hidden;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.recommendation-archive > summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px 2px 0;
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}
.recommendation-archive > summary::-webkit-details-marker { display: none; }
.recommendation-archive > summary small { color: var(--taupe); font-size: var(--text-2xs); font-weight: 700; }
.recommendation-archive__body { padding-top: 14px; }

.teacher-recommendations { display: grid; gap: 14px; }
.teacher-recommendations__intro { display: grid; gap: 4px; }
.teacher-recommendations__intro p { margin: 0; color: var(--coffee); font-size: var(--text-2xs); line-height: 1.55; }
.teacher-recommendation-form { display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px; background: var(--cream); }
.teacher-recommendation-form__grid { display: grid; grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr); gap: 10px; }
.teacher-recommendation-form textarea { min-height: 68px; }
.teacher-recommendation-form .button { justify-self: start; }
.teacher-recommendation-list { display: grid; gap: 8px; }
.teacher-recommendation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--paper);
}
.teacher-recommendation-item > div:first-child { display: grid; gap: 4px; min-width: 0; }
.teacher-recommendation-item span { color: var(--ember-ink); font-size: var(--text-2xs); font-weight: 800; text-transform: uppercase; }
.teacher-recommendation-item strong { overflow-wrap: anywhere; font-size: var(--text-2xs); }
.teacher-recommendation-item p { margin: 0; color: var(--coffee); font-size: var(--text-2xs); line-height: 1.45; }
.teacher-recommendation-item__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.teacher-recommendation-item__actions a, .teacher-recommendation-item__actions button {
  border: 0;
  padding: 0;
  color: var(--slate-blue);
  background: transparent;
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.teacher-recommendation-item__actions button { color: var(--terracotta); }

@media (max-width: 640px) {
  .recommendation-grid { grid-template-columns: 1fr; }
  .additional-resource-section { padding: 16px; }
  .teacher-recommendation-form__grid { grid-template-columns: 1fr; }
  .teacher-recommendation-item { align-items: flex-start; flex-direction: column; }
}

/* One active homework/practice set at a time, with compact completed history. */
.work-set-picker {
  overflow: hidden;
  margin: 14px 0 18px;
  border: 1px solid color-mix(in srgb, var(--marigold) 38%, var(--border));
  border-radius: 18px;
  background: linear-gradient(145deg, #fffaf0, var(--paper));
  box-shadow: var(--shadow-sm);
}

.work-set-picker > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 14px 17px;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}

.work-set-picker > summary::-webkit-details-marker,
.work-history__item > summary::-webkit-details-marker {
  display: none;
}

.work-set-picker > summary > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-set-picker > summary b {
  font-size: var(--text-sm);
  font-weight: 800;
}

.work-set-picker > summary small {
  overflow: hidden;
  color: var(--taupe);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-set-picker__list {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.work-set-picker__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.work-set-picker__item.is-current {
  border-color: var(--marigold);
  background: var(--warning-bg);
  box-shadow: inset 3px 0 0 var(--marigold);
}

.work-set-picker__item > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.work-set-picker__item strong {
  overflow: hidden;
  font-size: var(--text-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-set-picker__item > small {
  color: var(--taupe);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

.work-current {
  min-width: 0;
}

.work-submit-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.work-submit-actions > .button {
  flex: 1 1 auto;
  width: auto;
}

.work-archive-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 10px 13px;
  color: var(--coffee);
  background: var(--paper);
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: 800;
  cursor: pointer;
}

.work-archive-button:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.work-archive-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.work-archive-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.work-saved-answer {
  display: grid;
  gap: 6px;
  margin-top: 15px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.work-saved-answer strong {
  font-size: var(--text-2xs);
}

.work-saved-answer p {
  margin: 0;
  color: var(--coffee);
  white-space: pre-wrap;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.work-history {
  display: grid;
  gap: 12px;
}

.work-history__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.work-history__heading h2 {
  margin: 3px 0 0;
}

.work-history__heading > b {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--honey);
  font-size: var(--text-2xs);
}

.work-history__list {
  display: grid;
  gap: 8px;
}

.work-history__item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--cream) 72%, var(--paper));
}

.work-history__item > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
}

.work-history__item > summary > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px 9px;
  min-width: 0;
}

.work-history__item > summary strong {
  overflow: hidden;
  font-size: var(--text-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-history__item > summary small {
  grid-column: 2;
  color: var(--taupe);
  font-size: var(--text-2xs);
}

.work-history__body {
  border-top: 1px solid var(--border);
  padding: 12px;
  background: var(--paper);
}

@media (max-width: 560px) {
  .work-set-picker__item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .work-set-picker__item > small {
    padding-left: 1px;
  }

  .work-submit-actions {
    flex-direction: column;
  }

  .work-archive-button {
    width: 100%;
  }
}

/* ——— @exam: экзаменационный лист (IELTS и подобные) в палитре кабинета ——— */
.ex { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.ex-sheet { display: grid; gap: 10px; min-width: 0; color: var(--ink); font-size: 15px; line-height: 1.6; }
.ex-sheet > * { min-width: 0; }
.ex-title { margin: 6px 0 2px; font-size: 19px; font-weight: 800; line-height: 1.3; text-align: center; }
.ex-part {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--paper);
  background: var(--espresso);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.ex-part em { font-weight: 700; letter-spacing: 0; }
.ex-group {
  margin: 14px 0 2px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-left: 3px solid var(--marigold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--cream) 54%, transparent);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}
.ex-sheet > .ex-group:first-child, .ex-sheet > .ex-part:first-child { margin-top: 0; }
.ex-sub { margin: 6px 0 0; font-size: var(--text-md); font-weight: 800; }
.ex-p { margin: 0; overflow-wrap: anywhere; }
.ex-p--section { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; }
.ex-section { color: var(--ember-ink); font-size: 16px; font-weight: 800; line-height: 1.5; }
.ex-standfirst { margin: 0 0 4px; color: var(--coffee); font-style: italic; font-weight: 700; text-align: center; }
.ex-footnote { margin: 0; color: var(--ink); font-size: var(--text-xs); font-weight: 500; line-height: 1.5; }
.ex-p + .ex-footnote, .ex-p--section + .ex-footnote { padding-top: 10px; border-top: 1px solid var(--border); }
.ex-bullets { display: grid; gap: 2px; margin: 0; padding-left: 20px; }
.ex-bullets li::marker { color: var(--ember); }
.ex-bullets > .ex-line--plain { padding-block: 0; }
.ex-bullets > .ex-line--fillable { padding-block: 4px; }
.ex-p.ex-line--fillable { padding-block: 4px; }
.ex-row.ex-line--fillable { padding-block: 3px; }
.ex-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ex-row__text { overflow-wrap: anywhere; }
.ex-qnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, var(--marigold) 40%, var(--border));
  border-radius: 7px;
  color: var(--coffee);
  background: color-mix(in srgb, var(--honey) 34%, #fff);
  font-size: var(--text-2xs);
  font-weight: 800;
  line-height: 1;
  vertical-align: baseline;
}
.ex-qnum i { font-style: normal; font-weight: 600; opacity: 0.7; }
.ex-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 4px);
  margin: 0 4px;
  vertical-align: middle;
}
.ex-field--input,
.ex-field--select,
.ex-field--review {
  padding: 2px 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, #fff 82%, var(--paper));
  box-shadow: 0 1px 2px rgb(31 27 23 / 5%);
}
.ex-field--review {
  min-height: 30px;
  padding: 2px 3px;
}
.ex-field--review.is-correct {
  border-color: rgb(62 142 90 / 48%);
  background: color-mix(in srgb, #e4f0e7 72%, #fff);
}
.ex-field--review.is-wrong {
  border-color: rgb(192 57 43 / 42%);
  background: color-mix(in srgb, #f7e0dc 58%, #fff);
}
.ex-field--review.is-missed {
  border-color: color-mix(in srgb, var(--marigold) 58%, var(--border));
  background: color-mix(in srgb, var(--honey) 34%, #fff);
}
.ex-field--review.is-correct .ex-qnum {
  border-color: rgb(62 142 90 / 38%);
  color: var(--success-ink);
  background: #fff;
}
.ex-field--review.is-wrong .ex-qnum {
  border-color: rgb(192 57 43 / 34%);
  color: var(--error-ink);
  background: #fff;
}
.ex-review-values {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 120px;
  min-height: 24px;
  padding: 2px 6px;
  font-size: var(--text-md);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ex-review-answer { color: var(--success-ink); font: inherit; font-weight: 700; }
.ex-review-answer--given { color: var(--error-ink); text-decoration-thickness: 1.5px; }
.ex-review-answer--expected { color: var(--success-ink); }
.ex-review-answer.is-empty { color: var(--taupe); }
.ex-review-arrow { color: var(--taupe); font-size: var(--text-xs); font-weight: 800; }
.ex-field--input,
.ex-field--select { cursor: text; }
.ex-field--select { cursor: pointer; }
.ex-field--input:focus-within,
.ex-field--select:focus-within {
  border-color: color-mix(in srgb, var(--marigold) 72%, var(--border));
  background: #fff;
  box-shadow: 0 0 0 3px rgb(245 166 35 / 20%);
}
.ex-input.pr-input {
  min-width: 120px;
  width: 150px;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  font-size: var(--text-md);
  line-height: 1.25;
}
.ex-input.pr-input:focus { border: 0; outline: 0; box-shadow: none; }
.ex-select.pr-input {
  min-width: 120px;
  width: 150px;
  height: 24px;
  min-height: 0;
  max-width: min(100%, 320px);
  margin: 0;
  padding: 2px 6px;
  border: 0;
  background-color: transparent;
  box-shadow: none;
  font-size: var(--text-md);
}
.ex-select.pr-input:focus { border: 0; outline: 0; box-shadow: none; }
.ex-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ex-pill {
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
}
.ex-pill:hover { border-color: var(--marigold); }
.ex-pill.is-picked { border-color: var(--ember); background: var(--honey); }
.ex-question { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ex-question__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ex-question__head p { margin: 0; font-weight: 600; }
.ex-choices { display: grid; gap: 6px; }
.ex-choice {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff;
  font-size: var(--text-md);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.ex-choice b { color: var(--ember-ink); font-weight: 800; }
.ex-choice:hover { border-color: var(--marigold); }
.ex-choice.is-picked { border-color: var(--marigold); background: var(--warning-bg); box-shadow: inset 3px 0 0 var(--marigold); }
.ex-choice.is-key { border-color: var(--success); background: var(--success-bg); }
.ex-choice.is-wrong { border-color: var(--error); background: var(--error-bg); }
.ex-choice:disabled { cursor: default; }
.ex-picks { margin: 0; color: var(--taupe); font-size: var(--text-xs); }
.ex-box {
  justify-self: center;
  width: min(100%, 540px);
  padding: 12px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.ex-box.is-grid { width: 100%; }
.ex-box h6 { margin: 0 0 6px; font-size: var(--text-md); font-weight: 800; text-align: center; }
.ex-box dl, .ex-legend { display: grid; gap: 4px; margin: 0; }
.ex-box dl > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; }
.ex-box.is-grid dl { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); column-gap: 16px; }
.ex-box dt { color: var(--ember-ink); font-weight: 800; }
.ex-box dd, .ex-legend dd { margin: 0; }
.ex-legend { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--cream); font-size: var(--text-md); }
.ex-legend > div { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr); gap: 12px; }
.ex-legend dt { font-style: italic; font-weight: 800; }
.ex-legend dd { font-style: italic; }
.ex-frame {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, #fff 74%, var(--paper));
  box-shadow: var(--shadow-xs);
}
.ex-frame > .ex-title:first-child { margin-top: 0; }
/* inline-size containment: a wide table scrolls inside its box instead of widening the card on a phone. */
.ex-table-wrap { max-width: 100%; overflow-x: auto; border-radius: var(--radius-md); contain: inline-size; }
.ex-table { width: 100%; min-width: 560px; border-collapse: collapse; background: #fff; font-size: var(--text-md); line-height: 1.5; }
.ex-table th, .ex-table td { padding: 8px 10px; border: 1px solid var(--border-strong); vertical-align: top; text-align: left; white-space: pre-line; }
.ex-table th { background: var(--sand); font-weight: 800; text-align: center; vertical-align: middle; }
.ex-table .ex-input.pr-input { width: 110px; min-width: 90px; }
.ex-split { container-type: inline-size; display: grid; gap: 12px; min-width: 0; }
/* На широком экране пассаж и вопросы выходят за колонку кабинета, как экран CD-IELTS. */
@media (min-width: 1180px) {
  .ex-split {
    position: relative;
    left: 50%;
    width: min(1320px, calc(100vw - 64px));
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: #fffaf1;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
  }
}
.ex-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--cream) 78%, #fff);
  box-shadow: var(--shadow-xs);
}
.ex-tab {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--coffee);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}
.ex-tab:hover { color: var(--ink); background: color-mix(in srgb, #fff 60%, transparent); }
.ex-tab.is-active {
  border-color: var(--border-strong);
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -3px 0 var(--marigold), 0 2px 5px rgb(31 27 23 / 7%);
}
.ex-split__grid { display: grid; gap: 16px; min-width: 0; }
.ex-split[data-ex-pane="passage"] .ex-pane--questions,
.ex-split[data-ex-pane="questions"] .ex-pane--passage { display: none; }
.ex-pane { min-width: 0; }
.ex-sheet--passage { font-size: 15.5px; line-height: 1.75; }
@container (min-width: 880px) {
  .ex-tabs { display: none; }
  .ex-split__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ex-split[data-ex-pane] .ex-pane {
    display: block;
    max-height: 78vh;
    padding: 4px 10px 12px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ex-split[data-ex-pane] .ex-pane--passage { padding-right: 18px; border-right: 1px solid var(--border); }
}
.ex-prompt { display: grid; gap: 10px; }
.ex-prompt .pr-reading { font-size: 15px; font-weight: 500; }
.ex-taskbox {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border: 1.5px solid var(--border-strong);
  border-left: 4px solid var(--marigold);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.ex-taskbox p { margin: 0; font-weight: 700; line-height: 1.55; }
.ex-taskbox p.is-indent { padding-left: 24px; }
@media (max-width: 560px) {
  .ex-tabs { top: 4px; }
  .ex-tab { padding-inline: 7px; font-size: var(--text-xs); }
  .ex-frame { padding: 12px; border-radius: var(--radius-md); }
  .ex-bullets { padding-left: 18px; }
  .ex-legend > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ex-input.pr-input { width: 120px; }
}

/* Teacher: DET practice attempts with AI levels and transcripts. */
.teacher-det-review {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.teacher-det-review[hidden] {
  display: none;
}

.teacher-det-review h4 {
  margin: 0;
}

.teacher-det-review details summary {
  cursor: pointer;
}
