/* Квиз-студия IJA. Общая дизайн-система: токены, базовые стили, компоненты, оболочка студии. */

/* Шрифты подключены локально (пакеты @fontsource), без внешних CDN */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter/inter-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/unbounded/unbounded-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/unbounded/unbounded-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/unbounded/unbounded-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/unbounded/unbounded-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/unbounded/unbounded-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/unbounded/unbounded-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

/* ---------- Токены ---------- */
:root {
  color-scheme: light;

  /* Палитра Академии */
  --ink: #000a17;
  --navy: #06112a;
  --navy-2: #1e273b;
  --brand: #007fff;
  --violet: #7b5cff;
  --magenta: #c735bc;

  /* Поверхности студии */
  --paper: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --hairline: rgba(0, 10, 23, 0.08);
  --hairline-strong: rgba(0, 10, 23, 0.14);
  --fill: rgba(0, 10, 23, 0.045);
  --fill-2: rgba(0, 10, 23, 0.08);

  /* Текст */
  --text: #000a17;
  --text-2: #5b6475;
  --text-3: #8a93a3;

  /* Действия */
  --action: #006ee6;
  --action-press: #005bbf;
  --action-tint: #e5f0ff;
  --on-action-tint: #0058b8;
  --focus: 0 0 0 3px rgba(0, 127, 255, 0.32);

  /* Статусы */
  --success: #1a7f4b;
  --success-text: #146c3f;
  --success-tint: #e3f5ea;
  --danger: #d93a3f;
  --danger-text: #b8262b;
  --danger-tint: #fdecec;
  --warning-text: #8a5300;
  --warning-tint: #fff4e0;

  /* Цвета вариантов ответа (проверены на различимость при дальтонизме; всегда вместе с буквой) */
  --opt-1: #2a78d6;
  --opt-2: #eb6834;
  --opt-3: #1baf7a;
  --opt-4: #eda100;
  --opt-5: #e87ba4;
  --opt-6: #6250d6;

  /* Шрифты */
  --font-text: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Unbounded', var(--font-text);

  /* Шкала текста (iOS) */
  --fs-caption: 12px;
  --fs-footnote: 13px;
  --fs-subhead: 15px;
  --fs-body: 16px;
  --fs-headline: 17px;
  --fs-title-3: 20px;
  --fs-title-2: 24px;

  /* Скругления: чем крупнее объект, тем больше радиус */
  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --r-xl: 34px;
  --pill: 999px;

  /* Тени только у «приподнятых» элементов */
  --shadow-float: 0 1px 2px rgba(0, 10, 23, 0.06), 0 18px 48px -12px rgba(0, 10, 23, 0.22);
  --shadow-raise: 0 1px 2px rgba(0, 10, 23, 0.05), 0 8px 24px -10px rgba(0, 10, 23, 0.16);

  --blur: saturate(180%) blur(22px);

  /* Движение */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);

  --sidebar-w: 256px;
  --tabbar-h: 64px;
}

/* ---------- База ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 127, 255, 0.12);
}

:root:has(body.live:not(.theme-light)) {
  color-scheme: dark;
}

a,
button,
input,
select,
textarea,
label {
  touch-action: manipulation;
}

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

dialog {
  overscroll-behavior: contain;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--action);
  text-decoration: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(0, 127, 255, 0.2);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Типографика ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1.04;
}

.large-title {
  font-size: clamp(26px, 3.2vw, 36px);
}

.title-2 {
  font-size: var(--fs-title-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.title-3 {
  font-size: var(--fs-title-3);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.headline {
  font-size: var(--fs-headline);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.subhead {
  font-size: var(--fs-subhead);
}

.footnote {
  font-size: var(--fs-footnote);
}

.caption {
  font-size: var(--fs-caption);
}

.muted {
  color: var(--text-2);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Кнопки ---------- */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border-radius: var(--pill);
  font-size: var(--fs-subhead);
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  user-select: none;
  transition:
    transform 160ms var(--ease-out),
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--action);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--action-press);
  }
  .btn-secondary:hover {
    background: #d6e7ff;
  }
  .btn-plain:hover {
    background: var(--fill);
  }
  .btn-ghost:hover {
    background: var(--fill-2);
  }
  .btn-danger:hover {
    background: #bf2f34;
  }
  .btn-danger-plain:hover {
    background: #fbdcdc;
  }
  .chip:not([aria-pressed='true']):hover {
    background: var(--surface-2);
  }
}

.btn-secondary {
  background: var(--action-tint);
  color: var(--on-action-tint);
}

.btn-ghost {
  background: var(--fill);
  color: var(--text);
}

.btn-plain {
  background: transparent;
  color: var(--action);
  padding: 0 12px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger-plain {
  background: var(--danger-tint);
  color: var(--danger-text);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-sm {
  --btn-h: 34px;
  padding: 0 14px;
  font-size: var(--fs-footnote);
}

.btn-lg {
  --btn-h: 54px;
  padding: 0 28px;
  font-size: var(--fs-headline);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: var(--btn-h);
  padding: 0;
}

.btn[aria-busy='true'] {
  pointer-events: none;
  opacity: 0.75;
}

.btn[aria-busy='true']::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 600ms linear infinite;
}

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

/* ---------- Поля ---------- */
.field {
  display: grid;
  gap: 6px;
}

.field > label,
.label {
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text-2);
}

.hint {
  font-size: var(--fs-footnote);
  color: var(--text-2);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-size: var(--fs-body);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.textarea {
  resize: vertical;
  line-height: 1.45;
}

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6475' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search .icon {
  position: absolute;
  left: 12px;
  color: var(--text-2);
  pointer-events: none;
}

.search .input {
  padding-left: 40px;
  background: var(--fill);
  border-color: transparent;
}

.search .input:focus {
  background: var(--surface);
}

/* ---------- Сегментированный переключатель (iOS) ---------- */
.seg {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--fill-2);
}

.seg button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
}

.seg button[aria-pressed='true'] {
  background: var(--surface);
  box-shadow:
    0 1px 1px rgba(0, 10, 23, 0.06),
    0 3px 8px rgba(0, 10, 23, 0.12);
}

.seg-block {
  display: grid;
  width: 100%;
}

/* ---------- Переключатель (switch) ---------- */
.switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border-radius: var(--pill);
  background: var(--fill-2);
  cursor: pointer;
  transition: background-color 220ms ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(0, 0, 0, 0.12);
  transition: transform 260ms var(--spring);
}

.switch:checked {
  background: var(--action);
}

.switch:checked::after {
  transform: translateX(20px);
}

/* ---------- Чипы, теги, бейджи ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: var(--fs-footnote);
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms var(--ease-out);
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--c, var(--brand));
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--fill);
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.tag-blue {
  background: var(--action-tint);
  color: var(--on-action-tint);
}

.tag-violet {
  background: #efeaff;
  color: #5236c9;
}

.tag-green {
  background: var(--success-tint);
  color: var(--success-text);
}

.tag-amber {
  background: var(--warning-tint);
  color: var(--warning-text);
}

.tag-red {
  background: var(--danger-tint);
  color: var(--danger-text);
}

.letter {
  --c: var(--opt-1);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar {
  --h: 215;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 70% 46%));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

/* ---------- Поверхности ---------- */
.panel {
  background: var(--surface);
  border-radius: var(--r-l);
  border: 1px solid var(--hairline);
}

.panel-pad {
  padding: 24px;
}

/* Сгруппированный список в стиле настроек iOS */
.group {
  background: var(--surface);
  border-radius: var(--r-m);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.group-title {
  padding: 0 4px 8px;
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text-2);
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 18px;
  position: relative;
}

.row + .row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 0;
  height: 1px;
  background: var(--hairline);
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-weight: 600;
}

.row-sub {
  font-size: var(--fs-footnote);
  color: var(--text-2);
}

a.row {
  color: inherit;
  transition: background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  a.row:hover {
    background: var(--fill);
  }
}

.chev {
  color: var(--text-3);
}

/* ---------- Таблица ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-subhead);
}

.table th {
  text-align: left;
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

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

.table .r {
  text-align: right;
}

.table tbody tr {
  transition: background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .table tbody tr[data-href]:hover {
    background: var(--fill);
    cursor: pointer;
  }
}

/* ---------- Мини-бар (% верных) ---------- */
.meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meter-track {
  flex: 1;
  min-width: 60px;
  height: 8px;
  border-radius: var(--pill);
  background: var(--fill-2);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: var(--v);
  border-radius: var(--pill);
  background: var(--action);
}

/* ---------- Окна и листы ---------- */
dialog.sheet {
  border: 0;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-float);
  overflow: auto;
  opacity: 1;
  transform: none;
  transition:
    opacity 260ms var(--ease-out),
    transform 320ms var(--ease-drawer),
    overlay 320ms allow-discrete,
    display 320ms allow-discrete;
}

dialog.sheet::backdrop {
  background: rgba(0, 10, 23, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  transition:
    opacity 260ms ease,
    overlay 260ms allow-discrete,
    display 260ms allow-discrete;
}

dialog.sheet:not([open]) {
  opacity: 0;
  transform: scale(0.96);
}

dialog.sheet:not([open])::backdrop {
  opacity: 0;
}

@starting-style {
  dialog.sheet[open] {
    opacity: 0;
    transform: scale(0.96);
  }
  dialog.sheet[open]::backdrop {
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 8px;
}

.sheet-body {
  padding: 8px 24px 24px;
  display: grid;
  gap: 16px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 24px;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  color: var(--text-2);
  flex: none;
}

@media (max-width: 640px) {
  dialog.sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  dialog.sheet:not([open]) {
    transform: translateY(100%);
    opacity: 1;
  }
  @starting-style {
    dialog.sheet[open] {
      transform: translateY(100%);
      opacity: 1;
    }
  }
  .sheet-actions {
    flex-direction: column-reverse;
  }
  .sheet-actions .btn {
    width: 100%;
  }
}

/* ---------- Тост ---------- */
.toast-host {
  position: fixed;
  inset: 16px auto auto 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  pointer-events: none;
  /* сброс стилей popover по умолчанию */
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: var(--pill);
  background: rgba(0, 10, 23, 0.86);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: #fff;
  font-size: var(--fs-subhead);
  font-weight: 600;
  box-shadow: var(--shadow-float);
  transition:
    transform 400ms var(--ease-drawer),
    opacity 300ms ease;
}

.toast .icon {
  color: #6fe3a3;
}

@starting-style {
  .toast {
    transform: translateY(-140%);
    opacity: 0;
  }
}

.toast.leaving {
  transform: translateY(-140%);
  opacity: 0;
  transition-duration: 220ms;
}

/* ---------- Пустое состояние ---------- */
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--text-2);
}

.empty .icon {
  width: 40px;
  height: 40px;
  stroke-width: 1.4;
  color: var(--text-3);
}

.empty .title-3 {
  color: var(--text);
}

/* ---------- Оболочка студии ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--hairline);
  background: rgba(238, 241, 245, 0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  color: var(--text);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-name {
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.15;
  padding-left: 10px;
  border-left: 1px solid var(--hairline-strong);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-s);
  color: var(--text);
  font-size: var(--fs-subhead);
  font-weight: 500;
  transition: background-color 160ms ease;
}

.nav-item .icon {
  color: var(--text-2);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover {
    background: var(--fill);
  }
}

.nav-item[aria-current='page'] {
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 10, 23, 0.06);
}

.nav-item[aria-current='page'] .icon {
  color: var(--action);
}

.nav-sep {
  height: 1px;
  margin: 12px 12px;
  background: var(--hairline);
}

.nav-label {
  padding: 6px 12px 4px;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
}

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-s);
}

.me-name {
  font-size: var(--fs-subhead);
  font-weight: 600;
  line-height: 1.2;
}

.me-role {
  font-size: var(--fs-caption);
  color: var(--text-2);
}

.main {
  margin-left: var(--sidebar-w);
  padding: 40px clamp(20px, 4vw, 56px) 80px;
}

.main-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-head p {
  margin-top: 10px;
  max-width: 60ch;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toolbar .search {
  flex: 1 1 260px;
  max-width: 360px;
}

* + .section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 14px;
}

/* Мобильная верхняя панель и таб-бар */
.topbar,
.tabbar {
  display: none;
}

@media (max-width: 1023px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 12px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: rgba(244, 246, 249, 0.78);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--hairline);
  }

  .topbar .brand {
    padding: 0;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-top: 1px solid var(--hairline);
  }

  .tab {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    min-width: 0;
  }

  .tab .icon {
    width: 24px;
    height: 24px;
  }

  .tab[aria-current='page'] {
    color: var(--action);
  }

  .page-head {
    margin: 16px 0 20px;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .show-mobile {
    display: none !important;
  }
}

/* ---------- Сетка квизов ---------- */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-l);
  overflow: hidden;
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .quiz-card:hover {
    box-shadow: var(--shadow-raise);
    transform: translateY(-2px);
  }
}

.quiz-card-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.quiz-card-title {
  font-size: var(--fs-headline);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quiz-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

/* Миниатюра экрана для показа в стиле продукта */
.mini {
  --acc: var(--brand);
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 7% 7.5%;
  display: flex;
  flex-direction: column;
  gap: 6%;
  overflow: hidden;
  background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--acc) 42%, transparent), transparent 60%),
    radial-gradient(80% 80% at 0% 100%, rgba(123, 92, 255, 0.28), transparent 60%), var(--ink);
  color: #fff;
  container-type: inline-size;
}

.mini.light {
  background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 60%), #f7f9fc;
  color: var(--ink);
}

.mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 4.2cqw;
  font-weight: 600;
  opacity: 0.75;
}

.mini-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 5cqw;
  letter-spacing: 0.04em;
  opacity: 1;
}

.mini-q {
  font-size: 6.6cqw;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
  margin-top: auto;
}

.mini-opts span {
  height: 7.5cqw;
  border-radius: 2cqw;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding-left: 1.6cqw;
}

.mini.light .mini-opts span {
  background: rgba(0, 10, 23, 0.06);
}

.mini-opts span::before {
  content: '';
  width: 4.4cqw;
  height: 4.4cqw;
  border-radius: 1.2cqw;
  background: var(--c);
}

/* Бриллиант — фирменный мотив Академии */
.gem {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Цвета обводки и заливки задаются градиентами внутри самого SVG */

.gem-spin {
  animation: gem-spin 90s linear infinite;
  transform-origin: 50% 50%;
}

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

.gem-breathe {
  animation: gem-breathe 3.2s ease-in-out infinite;
}

@keyframes gem-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* ---------- Утилиты ---------- */
.stack {
  display: grid;
  gap: var(--gap, 16px);
}

.flex {
  display: flex;
  align-items: center;
  gap: var(--gap, 12px);
}

.wrap {
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.grow {
  flex: 1;
  min-width: 0;
}

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

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

.proto-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--pill);
  background: var(--warning-tint);
  color: var(--warning-text);
  font-size: var(--fs-caption);
  font-weight: 600;
}

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