/* ===== Сайт учителя: бумага и чернила ===== */
:root {
  --paper: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #1E2430;
  --ink-2: #565D68;
  --ink-3: #9AA0A8;
  --line: rgba(30, 36, 48, .09);
  --accent: #2F4BB3;
  --accent-dark: #22377F;
  --accent-soft: rgba(47, 75, 179, .07);
  --ok: #2E7D4F;
  --ok-soft: rgba(46, 125, 79, .09);
  --err: #B3402E;
  --err-soft: rgba(179, 64, 46, .09);
  --warn: #9A6A14;
  --warn-soft: rgba(154, 106, 20, .09);
  --r-ctl: 10px;
  --r-card: 16px;
  --r-panel: 20px;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --shadow: 0 1px 2px rgba(30, 36, 48, .05), 0 8px 24px rgba(30, 36, 48, .06);
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-display: 'Spectral', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ===== Типографика ===== */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -.01em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); }
h3 { font-size: 20px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 560px; }

/* фирменное рукописное подчёркивание */
.u-mark { position: relative; white-space: nowrap; }
.u-mark svg {
  position: absolute; left: -2%; bottom: -.18em; width: 104%; height: .32em;
  overflow: visible; pointer-events: none;
}
.u-mark svg path {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.u-mark.drawn svg path { animation: draw-line .8s var(--ease) .3s forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* ===== Каркас ===== */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; }
.section-head { margin-bottom: 40px; }
.section-head .kicker { color: var(--accent-dark); font-size: 13px; font-weight: 500; letter-spacing: .02em; margin-bottom: 8px; }
.section-head p { color: var(--ink-2); margin-top: 10px; max-width: 560px; }

/* ===== Шапка ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 243, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo .logo-mark { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-2); font-size: 15px; padding: 8px 12px; border-radius: 8px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(30, 36, 48, .05); text-decoration: none; }
.burger { display: none; background: none; border: 0; padding: 8px; }
.burger svg { width: 22px; height: 22px; stroke: var(--ink); }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  padding: 11px 20px; font-size: 15px; font-weight: 500;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(30, 36, 48, .05); }
.btn-quiet { background: var(--accent-soft); color: var(--accent-dark); }
.btn-quiet:hover { background: rgba(47, 75, 179, .12); }
.btn-danger { background: var(--err-soft); color: var(--err); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===== Hero ===== */
.hero { padding: 72px 0 96px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.hero h1 { margin: 20px 0; }
.hero .role {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 999px; padding: 6px 14px;
}
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-photo { position: relative; }
.hero-photo .photo-card {
  border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); background: var(--surface);
  transform: rotate(1.2deg);
}
.hero-photo .photo-card img { aspect-ratio: 3/3.6; object-fit: cover; width: 100%; }
.hero-photo .photo-note {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-radius: 12px; padding: 12px 16px; border: 1px solid var(--line);
}
.hero-photo .photo-note .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.hero-photo .photo-note .sub { font-size: 13px; color: var(--ink-2); }
.hero-stats { display: flex; gap: 40px; margin-top: 44px; }
.hero-stats .stat .num { font-family: var(--font-display); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stats .stat .lbl { font-size: 13px; color: var(--ink-3); }

/* ===== Появление при скролле ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

/* ===== Чипы категорий ===== */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 7px 16px; font-size: 14px;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--ink-3); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips-cls { align-items: center; margin-top: -16px; }
.chips-label { font-size: 13.5px; color: var(--ink-3); margin-right: 2px; }
.chips-cls .chip { padding: 5px 13px; font-size: 13.5px; }
.card .tag.tag-cls { margin-left: 8px; background: transparent; color: var(--ink-3); border: 1px solid var(--line); }

/* ===== Карточки ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 24px; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .tag {
  display: inline-block; font-size: 12px; font-weight: 500; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 6px; padding: 3px 10px; margin-bottom: 12px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card .desc { font-size: 14px; color: var(--ink-2); margin-bottom: 16px; }
.card .meta { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card .meta svg { width: 15px; height: 15px; vertical-align: -2.5px; margin-right: 4px; stroke: var(--ink-3); }
.card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }

/* ===== Обо мне ===== */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: start; }
.about-photo { border-radius: var(--r-panel); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.about-list { display: flex; flex-direction: column; gap: 0; margin-top: 28px; }
.about-item { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.about-item:first-child { border-top: 0; }
.about-item .ico {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center;
}
.about-item .ico svg { width: 19px; height: 19px; stroke: var(--accent-dark); stroke-width: 1.6; fill: none; }
.about-item .t { font-weight: 500; }
.about-item .d { font-size: 14px; color: var(--ink-2); }

/* ===== Личный кабинет ===== */
.cabinet-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.cabinet-head .who .name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.cabinet-head .who .sub { font-size: 14px; color: var(--ink-2); }
.cabinet-head .spacer { flex: 1; }
.status-pill { font-size: 13px; font-weight: 500; border-radius: 999px; padding: 4px 12px; }
.status-new { background: var(--warn-soft); color: var(--warn); }
.status-done { background: var(--ok-soft); color: var(--ok); }

/* ===== Модальные окна ===== */
.modal-back {
  position: fixed; inset: 0; background: rgba(30, 36, 48, .45);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--r-panel); width: 100%; max-width: 440px;
  padding: 32px; box-shadow: 0 24px 64px rgba(30, 36, 48, .2);
  transform: translateY(12px); transition: transform .22s var(--ease);
  max-height: calc(100vh - 40px); overflow: auto;
}
.modal.modal-lg { max-width: 760px; }
.modal.modal-xl { max-width: 960px; }
.modal-back.open .modal { transform: none; }
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.modal .modal-sub { font-size: 14px; color: var(--ink-2); margin-bottom: 24px; }
.modal-close {
  position: sticky; float: right; top: 0; background: none; border: 0; padding: 6px;
  color: var(--ink-3); border-radius: 8px;
}
.modal-close:hover { background: rgba(30, 36, 48, .06); color: var(--ink); }

/* ===== Формы ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 10px 14px; background: var(--surface); color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 75, 179, .14);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-err {
  display: none; background: var(--err-soft); color: var(--err);
  font-size: 14px; border-radius: var(--r-ctl); padding: 10px 14px; margin-bottom: 16px;
}
.form-err.show { display: block; }
.tabs { display: flex; gap: 4px; background: rgba(30, 36, 48, .05); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tabs button {
  flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(30, 36, 48, .12); }

/* ===== Прохождение теста ===== */
.test-runner { position: fixed; inset: 0; background: var(--paper); z-index: 200; overflow: auto; }
.test-runner .runner-bar {
  position: sticky; top: 0; background: rgba(250, 248, 243, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); z-index: 2;
}
.test-runner .runner-bar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.test-runner .runner-title { font-weight: 600; }
.test-runner .timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-2); }
.test-runner .timer.hot { color: var(--err); }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px; margin-bottom: 20px; }
.q-card .q-num { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.q-card .q-text { font-size: 17px; font-weight: 500; margin-bottom: 18px; }
.q-opt {
  display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 12px 16px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.q-opt:hover { border-color: var(--ink-3); }
.q-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.q-opt input { margin-top: 3px; accent-color: var(--accent); }
.q-text-answer input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 14px; }
.q-text-answer input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 75, 179, .14); }

/* результат теста */
.result-hero { text-align: center; padding: 64px 0; }
.result-hero .big { font-family: var(--font-display); font-size: 72px; font-weight: 600; font-variant-numeric: tabular-nums; }
.result-hero .of { color: var(--ink-3); font-size: 18px; }
.result-ring { width: 160px; height: 160px; margin: 0 auto 24px; }
.result-ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.result-ring .bg { stroke: var(--line); }
.result-ring .fg { stroke: var(--accent); stroke-dasharray: 452; stroke-dashoffset: 452; transition: stroke-dashoffset 1s var(--ease) .2s, stroke .4s; }

/* вердикт результата: зелёный / жёлтый / красный */
.result-hero.t-good .result-ring .fg { stroke: var(--ok); }
.result-hero.t-mid .result-ring .fg { stroke: var(--warn); }
.result-hero.t-bad .result-ring .fg { stroke: var(--err); }
.result-hero.t-good .big { color: var(--ok); }
.result-hero.t-mid .big { color: var(--warn); }
.result-hero.t-bad .big { color: var(--err); }
.result-hero { animation: result-pop .5s var(--ease) both; }
@keyframes result-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.result-verdict {
  display: inline-block; margin: 4px 0 10px; padding: 8px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
}
.result-verdict.v-good { background: rgba(46,125,79,.12); color: var(--ok); }
.result-verdict.v-mid { background: rgba(154,106,20,.12); color: var(--warn); }
.result-verdict.v-bad { background: rgba(179,64,46,.12); color: var(--err); }
.result-pct { font-size: 15px; color: var(--ink-3); margin-top: -6px; margin-bottom: 14px; }

/* картинка к вопросу */
.qimg-row { display: flex; align-items: center; gap: 14px; }
.qimg-preview { max-width: 220px; max-height: 140px; border-radius: 10px; border: 1px solid var(--line); object-fit: contain; background: var(--paper); }
.q-img { margin: 12px 0 4px; }
.q-img img { max-width: 100%; max-height: 320px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: var(--paper); }

/* аналитика ошибок */
.an-row { padding: 12px 0; border-top: 1px solid var(--line); }
.an-row:first-of-type { border-top: 0; }
.an-head { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; font-weight: 500; }
.an-pct { white-space: nowrap; font-weight: 600; }
.an-bar { height: 8px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.an-fill { height: 100%; border-radius: 99px; transition: width .8s var(--ease); }
.an-fill.bad { background: var(--err); }
.an-fill.mid { background: var(--warn); }
.an-fill.good { background: var(--ok); }
.an-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* рейтинг класса */
.leader { margin-top: 40px; }
.leader table { width: 100%; border-collapse: collapse; }
.leader th, .leader td { text-align: left; padding: 10px 12px; font-size: 14px; border-bottom: 1px solid var(--line); }
.leader th { color: var(--ink-3); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.leader tr.me td { background: rgba(47,75,179,.07); font-weight: 600; }
.leader .rank { font-family: var(--font-display); font-size: 18px; width: 44px; }
.leader .rank.r1 { color: #B8860B; }
.leader .rank.r2 { color: #7d7d7d; }
.leader .rank.r3 { color: #A0622D; }

/* ===== Мобильная адаптация рабочих экранов ===== */
@media (max-width: 640px) {
  /* таблицы админки: горизонтальный скролл, компактнее */
  .tbl { min-width: 560px; }
  .tbl th, .tbl td { padding: 10px 12px; font-size: 13px; }
  /* модалки на весь экран */
  .modal-back .modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 22px 18px; border-radius: 16px; }
  .modal-xl, .modal-lg { max-width: calc(100vw - 24px); }
  /* конструктор: строки вопросов и назначений */
  .qedit .qedit-head { flex-wrap: wrap; gap: 8px; }
  .opt-row { flex-wrap: wrap; }
  .opt-row input[type="text"] { flex: 1 1 calc(100% - 60px); }
  .assign-row { flex-wrap: wrap; }
  .assign-row input { flex: 1 1 100%; }
  /* прохождение теста */
  .test-runner .runner-bar .wrap { gap: 10px; }
  .test-runner .runner-bar .runner-title { font-size: 14px; }
  .q-card { padding: 18px 16px; }
  .q-img img { max-height: 220px; }
  .result-hero { padding: 40px 0; }
  .result-hero .big { font-size: 56px; }
  .result-ring { width: 128px; height: 128px; }
  /* рейтинг */
  .leader { margin-top: 28px; overflow-x: auto; }
  .leader th, .leader td { padding: 8px 8px; font-size: 13px; }
  .leader .rank { font-size: 15px; width: 30px; }
  /* аналитика */
  .an-head { flex-direction: column; gap: 4px; }
  /* кабинет: шапка */
  .cabinet-head { flex-wrap: wrap; gap: 12px; }
  /* вход в админку с телефона */
  .admin-login .modal { width: calc(100vw - 24px); }
  /* сайдбар админки в столбец кнопок */
  .admin-side .side-nav button { padding: 8px 12px; font-size: 13px; }
}

/* ===== Пустое состояние ===== */
.empty {
  border: 1px dashed var(--line); border-radius: var(--r-card); padding: 48px 24px;
  text-align: center; color: var(--ink-3); font-size: 15px;
}

/* ===== Подвал ===== */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.site-footer .muted { color: var(--ink-3); font-size: 14px; }

/* ===== Тосты ===== */
.toast-zone { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; border-radius: var(--r-ctl); padding: 12px 18px;
  font-size: 14px; box-shadow: var(--shadow);
  animation: toast-in .3s var(--ease);
}
.toast.err { background: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== АДМИНКА ===== */
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-side {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow: auto;
}
.admin-side .logo { display: block; padding: 0 12px; margin-bottom: 4px; }
.admin-side .side-sub { font-size: 13px; color: var(--ink-3); padding: 0 12px; margin-bottom: 24px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  text-align: left; border-radius: 8px; padding: 9px 12px; font-size: 14.5px; color: var(--ink-2);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.side-nav button svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; flex: 0 0 17px; }
.side-nav button:hover { background: rgba(30, 36, 48, .05); color: var(--ink); }
.side-nav button.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.side-nav .side-label { font-size: 12px; color: var(--ink-3); padding: 20px 12px 6px; }
.admin-main { padding: 40px 48px; max-width: 1100px; }
.admin-main h1 { font-size: 30px; margin-bottom: 6px; }
.admin-main .page-sub { color: var(--ink-2); font-size: 15px; margin-bottom: 32px; }
.admin-page { display: none; }
.admin-page.active { display: block; }

/* таблицы */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(30, 36, 48, .02); }
.tbl td { padding: 13px 16px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; transition: background .14s var(--ease); }
.tbl tr.clickable:hover { background: rgba(30, 36, 48, .025); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl-wrap { border-radius: var(--r-card); overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* конструктор тестов */
.ct-classes { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-classes label { cursor: pointer; }
.ct-classes input { position: absolute; opacity: 0; pointer-events: none; }
.ct-classes span {
  display: inline-grid; place-items: center; min-width: 40px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2); transition: all .16s var(--ease);
}
.ct-classes label:hover span { border-color: var(--accent); color: var(--accent); }
.ct-classes input:checked + span {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(47, 75, 179, .28);
}
.qedit {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 24px; margin-bottom: 16px; position: relative;
}
.qedit .qedit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qedit .qedit-head .q-label { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.qedit .qedit-head select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; background: var(--surface); }
.qedit .qedit-head .spacer { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--ink-2);
  transition: all .16s var(--ease);
}
.icon-btn:hover { background: rgba(30, 36, 48, .05); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.opt-row input[type=text] {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px;
}
.opt-row input[type=radio], .opt-row input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.assign-row { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
.assign-row select, .assign-row input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; background: var(--surface); }
.assign-row input { flex: 1; }
.score-good { color: var(--ok); font-weight: 600; }
.score-mid { color: var(--warn); font-weight: 600; }
.score-bad { color: var(--err); font-weight: 600; }

/* экран входа админки */
.admin-login { min-height: 100vh; display: grid; place-items: center; background: var(--paper); }
.admin-login .modal { position: static; transform: none; }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 28px 20px; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  section { padding: 56px 0; }
}

/* ===== Разделение на страницы: меню и hero с книгой ===== */
.nav a.active { color: var(--ink); background: rgba(30, 36, 48, .06); font-weight: 500; }
.nav .btn-nav { margin-left: 8px; color: #fff; }
.nav .btn-nav:hover { background: var(--accent-dark); text-decoration: none; }

/* литературный курсив в заголовках */
h1 em, h2 em { font-style: italic; font-weight: 500; }

/* hero с 3D-книгой */
.hero-book { min-height: calc(100vh - 64px); display: flex; align-items: center; position: relative; }
#hero3d { position: absolute; inset: 0; z-index: 0; }
#hero3d canvas { display: block; width: 100%; height: 100%; }
.hero-book .wrap { position: relative; z-index: 1; width: 100%; }
.hero-book .hero-grid { grid-template-columns: minmax(0, 560px) 1fr; width: 100%; }
.hero-spacer { min-height: 420px; }

/* таймлайн образования */
.tline { display: flex; flex-direction: column; max-width: 680px; }
.tline-item {
  display: flex; gap: 20px; padding: 24px 0; position: relative; align-items: flex-start;
}
.tline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 19px; top: 64px; bottom: -8px;
  width: 1px; background: var(--line);
}
.tline-dot {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; z-index: 1;
}
.tline-num {
  display: none;
}
.tline-dot::after {
  content: counter(item); counter-increment: item;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--accent-dark);
}
.tline { counter-reset: item; }
.tline-item .t { font-weight: 500; font-size: 17px; }
.tline-item .d { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

@media (max-width: 900px) {
  .hero-book .hero-grid { grid-template-columns: 1fr; }
  .hero-spacer { min-height: 320px; }
  .hero-book { min-height: 0; padding-top: 56px; }
}
@media (max-width: 640px) {
  .nav .btn-nav { margin: 4px 0 0; }
  .hero-spacer { min-height: 260px; }
}

/* ===== Скролл-история: чернильная линия и листы ===== */
#story { position: relative; }
#inkline {
  position: absolute; top: 0; left: 0; z-index: 0;
  pointer-events: none; overflow: visible;
}
#inkline-path { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; opacity: .85; }
#inkline-ticks path { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; opacity: .85; }

.scroll-hint {
  margin-top: 36px; font-size: 13px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 8px;
}
.scroll-hint::after {
  content: ''; width: 40px; height: 1.5px; background: var(--accent);
  transform-origin: left; animation: hint-flow 2.2s var(--ease) infinite;
}
@keyframes hint-flow { 0% { transform: scaleX(0); } 55% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }

/* фото как лист в рамке */
.sheet-frame {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 14px; box-shadow: var(--shadow);
  transform: rotate(1.4deg);
}
.sheet-frame img { border-radius: 12px; aspect-ratio: 3/3.4; object-fit: cover; width: 100%; }
.sheet-frame .photo-note { padding: 14px 6px 4px; }
.sheet-frame .photo-note .name { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.sheet-frame .photo-note .sub { font-size: 13px; color: var(--ink-2); }

/* листы-главы */
.story-sheet { padding: 28px 0; will-change: transform, opacity; }
.sheet-paper {
  max-width: 1000px; margin: 0 auto; padding: 56px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); box-shadow: var(--shadow);
}
.sheet-final .sheet-paper { padding-bottom: 64px; }

#signature { width: 320px; max-width: 80%; margin: 4px auto 0; display: block; }
#signature-path { stroke: var(--accent-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* таймлайн внутри листа */
.tline-dot { background: var(--paper); }

@media (max-width: 900px) {
  .sheet-paper { margin: 0 20px; padding: 32px 24px; }
}

/* страховка от горизонтального скролла на истории */
html, body { overflow-x: clip; }
#story .hero .wrap { position: relative; z-index: 1; }

/* ===== Вау-слой: фон, перо, кляксы, печать, текстура ===== */

/* зерно бумаги на всём фоне */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .14 0 0 0 0 .19 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* дрейфующие слова в фоне */
#bg-words { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-word {
  position: absolute; font-family: var(--font-display); font-style: italic;
  color: var(--ink); white-space: nowrap; user-select: none;
  will-change: transform;
}
#story > section, #story .hero { position: relative; z-index: 1; }

/* перо, пишущее линию */
#quill {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  width: 64px; height: 64px; will-change: transform;
  filter: drop-shadow(0 3px 6px rgba(30,36,48,.25));
}

/* линовка тетради на листах */
.sheet-paper {
  position: relative;
  background-image:
    linear-gradient(90deg, transparent 47px, rgba(179, 64, 46, .22) 47px, rgba(179, 64, 46, .22) 48px, transparent 48px),
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(47, 75, 179, .055) 31px, rgba(47, 75, 179, .055) 32px);
}

/* чернильные кляксы */
.ink-blot {
  position: absolute; width: 88px; height: 88px; pointer-events: none;
  opacity: 0; will-change: transform, opacity;
}
.ink-blot path { fill: var(--accent); opacity: .1; }
.blot-0 { right: 28px; top: 24px; }
.blot-1 { left: 24px; bottom: 28px; }
.blot-2 { right: 40px; bottom: 36px; }
.blot-3 { left: 40px; top: 32px; }

/* сургучная печать */
#seal {
  position: absolute; right: 36px; top: -40px; width: 110px; height: 110px;
  opacity: 0; will-change: transform;
  filter: drop-shadow(0 6px 14px rgba(179, 64, 46, .35));
  transition: transform .3s var(--ease);
}
#seal:hover { transform: rotate(-4deg) scale(1.04) !important; }

/* ротация слова в hero */
#rotor { display: inline-block; transition: filter .3s var(--ease), opacity .3s var(--ease), transform .3s var(--ease); }
#rotor.rotor-out { filter: blur(8px); opacity: 0; transform: translateY(-10px); }
#rotor.rotor-in { animation: rotor-in .4s var(--ease); }
@keyframes rotor-in { from { filter: blur(8px); opacity: 0; transform: translateY(10px); } }

/* интро hero при загрузке */
#hero .role, #hero h1, #hero .lead, #hero .hero-actions, #hero .scroll-hint, #hero .sheet-frame {
  animation: hero-rise .8s var(--ease) both;
}
#hero h1 { animation-delay: .08s; }
#hero .lead { animation-delay: .16s; }
#hero .hero-actions { animation-delay: .24s; }
#hero .scroll-hint { animation-delay: .4s; }
#hero .sheet-frame { animation-delay: .2s; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(22px); }
}
#hero .sheet-frame { animation-name: hero-rise-tilt; }
@keyframes hero-rise-tilt {
  from { opacity: 0; transform: translateY(22px) rotate(3.4deg); }
  to { opacity: 1; transform: translateY(0) rotate(1.4deg); }
}

@media (max-width: 900px) {
  #quill { display: none !important; }
  .sheet-paper {
    background-image:
      linear-gradient(90deg, transparent 27px, rgba(179, 64, 46, .2) 27px, rgba(179, 64, 46, .2) 28px, transparent 28px),
      repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(47, 75, 179, .05) 31px, rgba(47, 75, 179, .05) 32px);
  }
  #seal { width: 84px; height: 84px; right: 20px; top: -28px; }
  .ink-blot { width: 60px; height: 60px; }
}

/* ===== Книжные полки по краям (размытые, с параллаксом) ===== */
#shelves {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  will-change: transform;
}
.shelf-col {
  position: absolute; top: 0; width: 96px;
  filter: blur(2.2px); opacity: .5;
}
.shelf-left { left: 14px; }
.shelf-right { right: 14px; }
.shelf {
  position: absolute; width: 96px;
  border-bottom: 8px solid rgba(146, 124, 96, .55);
}
.shelf-books { display: flex; align-items: flex-end; gap: 3px; height: 150px; overflow: hidden; }
.shelf-book {
  border-radius: 2px 2px 0 0; flex: 0 0 auto;
  box-shadow: inset -2px 0 3px rgba(30,36,48,.18);
}
@media (max-width: 1100px) { #shelves { display: none; } }

/* ===== Премиум-проход ===== */
/* декор не растягивает страницу вниз */
#story { overflow: clip; }

/* фото без скрапбук-наклона: ровная тонкая рамка */
.sheet-frame { transform: none; border-radius: 14px; padding: 10px; }
#hero .sheet-frame { animation-name: hero-rise; }
.sheet-frame img { border-radius: 8px; }

/* перо меньше и аккуратнее */
#quill svg { width: 44px; height: 44px; }

/* линия тоньше — благороднее */
#inkline-path { stroke-width: 2; }
#inkline-ticks path { stroke-width: 2; }

/* листы: спокойная тень, больше воздуха */
.sheet-paper { box-shadow: 0 1px 2px rgba(30,36,48,.04), 0 16px 48px rgba(30,36,48,.05); }
.story-sheet { padding: 36px 0; }

/* ===== Компоненты из библиотек: DotGrid, Aurora, BorderBeam, Spotlight, BlurText ===== */

/* Dot Grid (ReactBits): сетка точек, растворяющаяся к краям */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(30, 36, 48, .13) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 28%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 28%, #000 15%, transparent 72%);
}

/* Aurora (Aceternity): мягкий чернильный свет сверху hero */
.hero { position: relative; }
.hero::before {
  content: ''; position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 940px; height: 520px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(47, 75, 179, .11), transparent 62%);
}

/* Border Beam (Magic UI): луч света бежит по контуру кнопки */
@property --beam-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.btn-beam { position: relative; }
.btn-beam::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--beam-angle),
    transparent 0deg, transparent 250deg, rgba(255, 255, 255, .95) 300deg, transparent 340deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam-spin 3.4s linear infinite; pointer-events: none;
}
@keyframes beam-spin { to { --beam-angle: 360deg; } }

/* Spotlight Card (Aceternity): свет за курсором */
.card { position: relative; overflow: hidden; }
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  opacity: 0; transition: opacity .35s var(--ease); pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 75, 179, .09), transparent 70%);
}
.card.spotlit::after { opacity: 1; }

/* BlurText (ReactBits): слова из размытия */
.blur-text span {
  display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(8px);
  animation: blur-in .6s var(--ease) forwards; animation-delay: var(--d, 0s);
}
@keyframes blur-in { to { opacity: 1; filter: blur(0); transform: none; } }

/* ===== Scroll Progress, Marquee, Ripple, Magnetic ===== */
#scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none;
  width: 100%; height: 2.5px; background: var(--accent);
  transform-origin: left; transform: scaleX(0);
}

.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); position: relative; z-index: 1; }
.marquee-track {
  display: flex; align-items: center; gap: 28px; width: max-content;
  padding: 16px 0; animation: marquee-run 36s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display); font-style: italic; font-size: 19px;
  color: var(--ink-3); white-space: nowrap;
}
.marquee-track span:nth-child(4n+1) { color: var(--accent-dark); opacity: .7; }
@keyframes marquee-run { to { transform: translateX(-50%); } }

.btn { position: relative; overflow: hidden; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .25s var(--ease); }
.btn .ripple {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .45);
  transform: scale(0); animation: ripple .6s var(--ease) forwards; pointer-events: none;
}
.btn-ghost .ripple, .btn-quiet .ripple, .btn-danger .ripple { background: rgba(47, 75, 179, .18); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.sheet-frame { transition: transform .35s var(--ease); }

/* ===== Aurora background (Aceternity/ReactBits): плавающие туманности ===== */
.aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
}
.aurora i {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .8;
  will-change: transform; mix-blend-mode: multiply;
}
.aurora .a1 {
  width: 760px; height: 760px; left: -180px; top: -220px;
  background: radial-gradient(circle, rgba(47, 75, 179, .26), transparent 62%);
  animation: aurora-a 26s ease-in-out infinite alternate;
}
.aurora .a2 {
  width: 660px; height: 660px; right: -200px; top: 16%;
  background: radial-gradient(circle, rgba(179, 64, 46, .15), transparent 62%);
  animation: aurora-b 32s ease-in-out infinite alternate;
}
.aurora .a3 {
  width: 700px; height: 700px; left: 22%; bottom: -300px;
  background: radial-gradient(circle, rgba(154, 106, 20, .18), transparent 62%);
  animation: aurora-c 38s ease-in-out infinite alternate;
}
@keyframes aurora-a {
  to { transform: translate(180px, 140px) scale(1.15); }
}
@keyframes aurora-b {
  to { transform: translate(-160px, 180px) scale(1.2); }
}
@keyframes aurora-c {
  to { transform: translate(140px, -160px) scale(1.1); }
}

/* ===== Meteors (Magic UI): редкие падающие штрихи в hero ===== */
.meteors { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.meteor {
  position: absolute; width: 2px; height: 56px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(47, 75, 179, .5), transparent);
  transform: rotate(35deg); opacity: 0;
  animation: meteor-fall linear infinite;
}
@keyframes meteor-fall {
  0% { transform: translate(0, 0) rotate(35deg); opacity: 0; }
  6% { opacity: .9; }
  22% { transform: translate(-180px, 180px) rotate(35deg); opacity: 0; }
  100% { transform: translate(-180px, 180px) rotate(35deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i, .meteor { animation: none !important; }
  .meteor { display: none; }
}

/* ===== Lamp (Aceternity): конус света над заголовком hero ===== */
.lamp {
  position: absolute; top: 6px; left: -4%; width: 62%; height: 420px;
  pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(47, 75, 179, .18), transparent 68%);
  animation: lamp-glow 2.4s ease-out both;
}
.lamp::before {
  content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, #3d5bff, transparent);
  box-shadow: 0 2px 22px 5px rgba(47, 75, 179, .45);
  animation: lamp-line 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes lamp-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lamp-glow { from { opacity: 0; } to { opacity: 1; } }

/* ===== Orbiting Circles (Magic UI): темы кружат вокруг фото ===== */
.orbit-box { position: relative; display: flex; align-items: center; justify-content: center; padding: 64px; margin: -40px; }
.orbit-line {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(47, 75, 179, .22); border-radius: 50%; pointer-events: none;
}
.orbit-line-1 { width: 112%; aspect-ratio: 1; }
.orbit-line-2 { width: 128%; aspect-ratio: 1; border-color: rgba(179, 64, 46, .16); }
.orb {
  position: absolute; left: 50%; top: 50%; pointer-events: none; z-index: 2;
  animation: orb-spin var(--dur, 26s) linear infinite;
}
.orb-1 { width: 112%; aspect-ratio: 1; translate: -50% -50%; }
.orb-2 { width: 128%; aspect-ratio: 1; translate: -50% -50%; animation-direction: reverse; }
.orb-chip {
  position: absolute; top: -13px; left: 50%; translate: -50% 0;
  padding: 5px 13px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--accent);
  background: var(--paper-2, #fff); border: 1px solid var(--line, #e5e0d6);
  box-shadow: 0 6px 16px -6px rgba(31, 26, 18, .18);
  animation: orb-spin-rev var(--dur, 26s) linear infinite;
}
.orb-2 .orb-chip { color: var(--terra, #b3402e); animation-direction: reverse; }
@keyframes orb-spin {
  from { transform: rotate(var(--a0, 0deg)); }
  to   { transform: rotate(calc(var(--a0, 0deg) + 360deg)); }
}
@keyframes orb-spin-rev {
  from { transform: rotate(calc(var(--a0, 0deg) * -1)); }
  to   { transform: rotate(calc((var(--a0, 0deg) * -1) - 360deg)); }
}

/* ===== Shine Border (Magic UI): бегущий блик по рамке ===== */
@property --sb-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.shine-border { position: relative; }
.shine-border::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  padding: 2px; z-index: 3; pointer-events: none;
  background: conic-gradient(from var(--sb-angle),
    transparent 0%, rgba(47, 75, 179, .55) 12%, transparent 26%,
    transparent 52%, rgba(154, 106, 20, .45) 64%, transparent 78%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: shine-spin 6s linear infinite;
}
@keyframes shine-spin { to { --sb-angle: 360deg; } }

/* ===== Pulsating Button (Magic UI): мягкие кольца вокруг CTA ===== */
.btn-pulse { position: relative; }
.btn-pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: inherit;
  border: 2px solid rgba(47, 75, 179, .55); pointer-events: none;
  animation: pulse-ring 2.2s cubic-bezier(.2, .6, .3, 1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: .8; }
  70%, 100% { transform: scale(1.18); opacity: 0; }
}

/* ===== Конфетти (Magic UI) и фон-частицы (Aceternity Sparkles) ===== */
#confetti-canvas { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
#bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body.flicker-bg::after { opacity: 0; }

@media (max-width: 900px) {
  .orbit-line-1, .orb-1 { width: 112%; }
  .orbit-line-2, .orb-2 { width: 122%; }
  .lamp { width: 100%; left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .orb-chip, .lamp, .lamp::before, .shine-border::before, .btn-pulse::after { animation: none !important; }
  .btn-pulse::after { display: none; }
  .shine-border::before { opacity: .35; }
}

/* ===== Text Pressure (React Bits): буквы h1 реагируют на курсор ===== */
.tp-ch {
  display: inline-block; white-space: pre; will-change: transform;
  transition: color .3s;
}
.tp-grad {
  background: linear-gradient(100deg, var(--accent) 0%, #b3402e 35%, #9a6a14 60%, var(--accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-flow 4.5s linear infinite;
  animation-delay: calc(var(--i, 0) * -0.18s);
}
@keyframes grad-flow { to { background-position: -250% 0; } }

/* ===== Проявка фото + дыхание ===== */
.hero-photo img {
  animation: photo-develop 1.7s cubic-bezier(.2, .7, .2, 1) .1s both;
}
@keyframes photo-develop {
  from { filter: blur(18px) saturate(.3); transform: scale(1.09); opacity: 0; }
  55% { opacity: 1; }
  to { filter: blur(0) saturate(1); transform: none; opacity: 1; }
}
.breathe { animation: breathe 7s ease-in-out 1.8s infinite; will-change: transform; }
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.hero-parallax { will-change: transform; }

/* ===== Буквы заголовков вылетают по очереди ===== */
.ltr { display: inline-block; white-space: pre; }
.ltrs-in .ltr {
  opacity: 0; transform: translateY(.55em) rotate(5deg); filter: blur(3px);
  transition: opacity .45s var(--ease), transform .55s cubic-bezier(.2, .8, .25, 1), filter .45s;
  transition-delay: calc(var(--i, 0) * 22ms);
}
.ltrs-in.ltrs-on .ltr { opacity: 1; transform: none; filter: blur(0); }

/* ===== Text Generate по словам при скролле ===== */
.w-gen {
  opacity: .08; filter: blur(2px); transform: translateY(4px);
  display: inline-block;
  transition: opacity .45s var(--ease), filter .45s var(--ease), transform .45s var(--ease);
}
.w-gen.on { opacity: 1; filter: blur(0); transform: none; }

/* ===== Sliding underline в меню ===== */
.nav { position: relative; }
#nav-ink {
  position: absolute; bottom: -2px; left: 0; height: 2.5px; width: 0;
  border-radius: 3px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), #6f8dff);
  transition: left .35s cubic-bezier(.2, .8, .25, 1), width .35s cubic-bezier(.2, .8, .25, 1), opacity .25s;
  opacity: 0;
}

/* ===== Чернильный круг по клику (Uiverse) ===== */
.ink-spot {
  position: fixed; z-index: 9998; pointer-events: none; border-radius: 50%;
  border: 2px solid rgba(47, 75, 179, .5);
  transform: translate(-50%, -50%) scale(0);
  animation: ink-spot .65s ease-out forwards;
}
@keyframes ink-spot {
  0% { transform: translate(-50%, -50%) scale(0); opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===== Чернильный переход между страницами ===== */
/* эффект вешается на контентные блоки, а не на body: иначе transform/filter на body
   ломает position:fixed у сферы-помощника, меню и всплывающих окон */
html.fx body main,
html.fx body .site-header,
html.fx body .site-footer,
html.fx body .side {
  opacity: 0; filter: blur(10px) saturate(.85); transform: translateY(14px);
}
html.fx body.fx-ready main,
html.fx body.fx-ready .site-header,
html.fx body.fx-ready .site-footer,
html.fx body.fx-ready .side {
  opacity: 1; filter: none; transform: none;
  transition: opacity .5s ease, filter .5s ease, transform .55s cubic-bezier(.2, .8, .25, 1);
}
html.fx body.fx-leave main,
html.fx body.fx-leave .site-header,
html.fx body.fx-leave .site-footer,
html.fx body.fx-leave .side {
  opacity: 0; filter: blur(8px); transform: translateY(-12px);
  transition: opacity .26s ease-in, filter .26s ease-in, transform .26s ease-in;
}

/* ===== Стеклянный блик на карточках поверх spotlight ===== */
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1;
  opacity: 0; transition: opacity .35s var(--ease); pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .55), transparent 60%);
  mix-blend-mode: soft-light;
}
.card.spotlit::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-photo img, .breathe { animation: none !important; }
  .w-gen { opacity: 1; filter: none; transform: none; }
  .ltrs-in .ltr { opacity: 1; transform: none; filter: none; transition: none; }
  .tp-grad { animation: none; }
  html.fx body { opacity: 1; filter: none; transform: none; }
}

/* переносы только между словами, не посреди */
.tp-ch-w, .ltr-w { display: inline-block; white-space: nowrap; }

/* ===== Боковое меню (по просьбе заказчицы) ===== */
.side { display: none; }
@media (min-width: 1025px) {
  .side {
    display: flex; flex-direction: column; position: fixed; z-index: 60;
    left: 0; top: 0; bottom: 0; width: 272px; padding: 22px 22px 16px;
    background: rgba(255, 252, 247, .74); backdrop-filter: blur(14px);
    border-right: 1px solid var(--line);
  }
  body { padding-left: 272px; }
  .site-header { display: none; }
}
.side-logo { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--ink); text-decoration: none; }
.side-logo span { color: var(--accent); }
.side-logo small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: .04em; }
.side-nav { position: relative; display: flex; flex-direction: column; gap: 1px; margin-top: 18px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(47,75,179,.25) transparent; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(47, 75, 179, .22); border-radius: 4px; }
.side-cap { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 10px 14px 4px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 10px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; font-size: 15px;
  transition: color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
  animation: side-in .55s var(--ease) both;
}
.side-nav a:nth-of-type(1) { animation-delay: .06s; }
.side-nav a:nth-of-type(2) { animation-delay: .11s; }
.side-nav a:nth-of-type(3) { animation-delay: .16s; }
.side-nav a:nth-of-type(4) { animation-delay: .21s; }
.side-nav a:nth-of-type(5) { animation-delay: .3s; }
.side-nav a:nth-of-type(6) { animation-delay: .35s; }
.side-nav a:nth-of-type(7) { animation-delay: .4s; }
.side-nav a:nth-of-type(8) { animation-delay: .45s; }
.side-nav a::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: var(--accent); opacity: 0; transform: scale(.4);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.side-nav a:hover { color: var(--accent-dark); background: var(--accent-soft); transform: translateX(5px); }
.side-nav a:hover::before, .side-nav a.active::before { opacity: 1; transform: scale(1); }
.side-nav a.active { color: var(--accent-dark); background: var(--accent-soft); font-weight: 600; }
@keyframes side-in { from { opacity: 0; transform: translateX(-16px); } }
#side-ink {
  position: absolute; left: 0; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #6f8dff);
  transition: top .35s cubic-bezier(.2, .8, .25, 1), height .35s cubic-bezier(.2, .8, .25, 1), opacity .25s;
  opacity: 0; pointer-events: none;
}
.side-cta { margin-top: auto; justify-content: center; }
.side-foot { margin-top: 14px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ===== Фото сливается с сайтом (без рамок и карточки) ===== */
.photo-blend { position: relative; animation: hero-rise .8s var(--ease) .15s both; }
.photo-blend::before {
  content: ''; position: absolute; inset: 10% 2% -6%; z-index: -1;
  background: radial-gradient(ellipse at 50% 62%, rgba(47, 75, 179, .17), transparent 70%);
  filter: blur(28px);
}
.photo-blend { max-width: 470px; margin: 0 auto; }
.photo-blend img {
  display: block; width: 100%; height: auto; object-fit: contain;
  border: none; border-radius: 0; box-shadow: none;
  -webkit-mask-image: radial-gradient(ellipse 76% 76% at 50% 47%, #000 40%, transparent 71%);
  mask-image: radial-gradient(ellipse 76% 76% at 50% 47%, #000 40%, transparent 71%);
}
.hero-photo .photo-note {
  position: static; background: none; border: none; border-radius: 0;
  backdrop-filter: none; padding: 0; margin-top: 2px; text-align: center;
}
.hero-photo .photo-note .name { font-size: 19px; }
.hero-photo .photo-note .sub { margin-top: 4px; }

/* ===== Мобильная полировка ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: clamp(30px, 9.2vw, 40px); }
  .hero-actions { flex-wrap: wrap; }
  .photo-blend img { aspect-ratio: 3 / 3.3; }

}

/* ===== Выдвижное боковое меню на телефоне/планшете ===== */
.side-close {
  display: none; position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; place-items: center; padding: 0;
}
.side-close svg { width: 18px; height: 18px; stroke: var(--ink); }
.side-overlay {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(24, 28, 38, .42); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.side-overlay.show { opacity: 1; pointer-events: auto; }
@media (max-width: 1024px) {
  .side {
    display: flex; flex-direction: column; position: fixed; z-index: 90;
    left: 0; top: 0; bottom: 0; width: min(300px, 86vw); padding: 22px 22px 16px;
    background: rgba(255, 252, 247, .97); backdrop-filter: blur(14px);
    border-right: 1px solid var(--line);
    transform: translateX(-105%); visibility: hidden;
    transition: transform .38s var(--ease), visibility 0s .38s, box-shadow .38s var(--ease);
  }
  .side.open {
    transform: translateX(0); visibility: visible;
    box-shadow: 18px 0 60px rgba(24, 28, 38, .18);
    transition: transform .38s var(--ease), visibility 0s, box-shadow .38s var(--ease);
  }
  .side-close { display: grid; }
  .site-header .nav { display: none !important; } /* вместо выпадашки — выдвижная панель */
  .burger { display: block; margin-left: auto; }
  body.side-locked { overflow: hidden; }
}

/* карточка материала с картинкой */
.mat-img { display: block; margin: 12px 0 4px; border-radius: 12px; overflow: hidden; }
.mat-img img { display: block; width: 100%; height: auto; border-radius: 12px; transition: transform .4s var(--ease); }
.mat-img:hover img { transform: scale(1.02); }

/* ===== Чат «Связь с учителем» — liquid glass / iMessage ===== */
.chat-box {
  border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(255,255,255,.78), rgba(246,248,252,.6));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 24px 60px -22px rgba(30,42,70,.22), inset 0 1px 0 rgba(255,255,255,.9);
}
.chat-list {
  height: 440px; overflow-y: auto; padding: 22px 20px; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 4px;
  background:
    radial-gradient(340px 200px at 12% 8%, rgba(96,140,255,.10), transparent 70%),
    radial-gradient(380px 240px at 88% 92%, rgba(150,110,255,.09), transparent 70%);
}
.chat-empty { margin: auto; color: var(--ink-3); text-align: center; font-size: 14px; padding: 30px; max-width: 340px; }
.msg {
  max-width: 72%; padding: 9px 14px 7px; border-radius: 19px;
  font-size: 14.5px; line-height: 1.42; white-space: pre-wrap; word-break: break-word;
  animation: msg-in .28s var(--ease) both;
}
.msg time { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 10.5px; line-height: 1; margin-top: 3px; }
.msg-student {
  align-self: flex-end; color: #fff; border-bottom-right-radius: 5px;
  background: linear-gradient(180deg, #4a8dff, #2f6bf0);
  box-shadow: 0 6px 16px -6px rgba(47,107,240,.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.msg-student time { color: rgba(255,255,255,.8); }
.msg-teacher {
  align-self: flex-start; color: var(--ink); border-bottom-left-radius: 5px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 3px 10px -2px rgba(30,42,70,.1);
}
.msg-teacher time { color: var(--ink-3); }
.ticks { display: inline-flex; }
.ticks svg { width: 15px; height: 11px; display: block; }
.ticks.tick-wait { opacity: .55; }
.ticks.tick-read { opacity: 1; color: #9fe3ff; }
.msg-teacher .ticks.tick-read { color: #2f9df0; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.chat-form {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.chat-form input {
  flex: 1; border: 1px solid rgba(120,130,150,.22); background: rgba(255,255,255,.9);
  border-radius: 999px; padding: 11px 18px; font: inherit; font-size: 14px;
  box-shadow: inset 0 1px 3px rgba(30,42,70,.06);
  transition: box-shadow .2s, border-color .2s;
}
.chat-form input:focus { outline: 0; border-color: rgba(74,141,255,.6); box-shadow: 0 0 0 3px rgba(74,141,255,.18); }
.chat-send {
  width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #4a8dff, #2f6bf0);
  box-shadow: 0 6px 14px -4px rgba(47,107,240,.55), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.chat-send:hover { transform: scale(1.08); }
.chat-send:active { transform: scale(.94); }
.chat-send svg { width: 18px; height: 18px; }
.cb-badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--err); color: #fff; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: 1px; }
@media (max-width: 640px) {
  .chat-list { height: 52vh; padding: 14px; }
  .msg { max-width: 85%; }
}

/* ===== Админка: чаты ===== */
.chats-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.chats-list { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.chats-list-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .2s; }
.chats-list-item:last-child { border-bottom: 0; }
.chats-list-item:hover { background: rgba(30,36,48,.04); }
.chats-list-item.active { background: var(--accent-soft); }
.ch-ava { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.ch-main { flex: 1; min-width: 0; }
.ch-name { font-weight: 500; font-size: 14px; }
.ch-prev { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats-empty { border: 1px dashed var(--line); border-radius: 14px; padding: 40px; text-align: center; color: var(--ink-3); font-size: 14px; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.chat-head .sub { font-weight: 400; font-size: 13px; color: var(--ink-3); }
@media (max-width: 900px) {
  .chats-layout { grid-template-columns: 1fr; }
}

/* ===== Ассистент-сфера (liquid glass) ===== */
.aorb {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 62px; height: 62px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .18) 26%, transparent 46%),
    radial-gradient(circle at 74% 80%, rgba(255, 255, 255, .32), transparent 52%),
    linear-gradient(140deg, rgba(147, 181, 255, .88) 0%, rgba(178, 141, 255, .78) 38%, rgba(255, 157, 205, .72) 68%, rgba(126, 182, 255, .85) 100%);
  backdrop-filter: blur(10px) saturate(1.6);
  box-shadow:
    0 14px 34px rgba(90, 110, 230, .35),
    inset 0 1.5px 2px rgba(255, 255, 255, .95),
    inset 0 -10px 18px rgba(90, 100, 210, .28);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  animation: aorb-float 4.5s ease-in-out infinite, aorb-hue 12s linear infinite;
}
.aorb::before, .aorb::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(140, 160, 255, .55); animation: aorb-ring 2.6s ease-out infinite;
}
.aorb::after { animation-delay: 1.3s; }
.aorb:hover { transform: scale(1.08); box-shadow: 0 18px 42px rgba(90, 110, 230, .48), inset 0 1.5px 2px rgba(255,255,255,.95), inset 0 -10px 18px rgba(90,100,210,.28); }
.aorb:active { transform: scale(.96); }
.aorb-liquid { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: block; pointer-events: none; }
.aorb-liquid::before {
  content: ''; position: absolute; inset: -45%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255, 255, 255, .8) 12%, transparent 26%, rgba(150, 180, 255, .55) 45%, transparent 60%, rgba(255, 170, 220, .5) 78%, transparent 92%);
  animation: aorb-spin 5.5s linear infinite;
}
.aorb-liquid::after {
  content: ''; position: absolute; left: 15%; top: 9%; width: 40%; height: 25%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, .95), transparent 70%);
  border-radius: 50%; transform: rotate(-18deg);
}
@keyframes aorb-ring { from { transform: scale(.82); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
@keyframes aorb-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes aorb-spin { to { transform: rotate(360deg); } }
@keyframes aorb-hue { to { filter: hue-rotate(360deg); } }

.aorb-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 81;
  width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: rgba(255, 252, 247, .86); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .65); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(24, 28, 38, .22), inset 0 1px 0 rgba(255, 255, 255, .8);
  opacity: 0; transform: translateY(14px) scale(.97); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  overflow: hidden;
}
.aorb-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.aorb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, rgba(147, 181, 255, .3), rgba(255, 157, 205, .18) 60%, transparent); }
.aorb-head-ava { width: 38px; height: 38px; flex: none; border-radius: 50%; position: relative; overflow: hidden;
  background: linear-gradient(140deg, rgba(147, 181, 255, .9), rgba(178, 141, 255, .8) 45%, rgba(255, 157, 205, .75));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.9), inset 0 -5px 10px rgba(90,100,210,.3); }
.aorb-head-ava::before { content: ''; position: absolute; left: 14%; top: 8%; width: 42%; height: 26%; background: radial-gradient(ellipse, rgba(255,255,255,.95), transparent 70%); border-radius: 50%; transform: rotate(-18deg); }
.aorb-head-ava::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #37b26c; border: 2px solid rgba(255,255,255,.9); }
.aorb-head-name { font-weight: 600; font-size: 15px; }
.aorb-head-sub { font-size: 12px; color: var(--ink-3); }
.aorb-close { margin-left: auto; background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--ink-3); padding: 6px; line-height: 1; }
.aorb-close:hover { color: var(--ink); }
.aorb-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.aorb-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; animation: msg-in .3s var(--ease) both; }
.aorb-msg.bot { align-self: flex-start; background: rgba(255, 255, 255, .75); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.aorb-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.aorb-msg.bot a { color: var(--accent-dark); font-weight: 500; }
.aorb-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.aorb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: aorb-dot 1.2s infinite; }
.aorb-typing i:nth-child(2) { animation-delay: .18s; }
.aorb-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes aorb-dot { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.aorb-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.aorb-chip { border: 1px solid var(--line); background: rgba(255, 255, 255, .7); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; transition: all .2s var(--ease); font-family: inherit; position: static; color: inherit; box-shadow: none; animation: none; letter-spacing: normal; font-weight: 400; translate: none; }
.aorb-chip:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.aorb-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.aorb-form input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font: inherit; font-size: 13.5px; background: rgba(255, 255, 255, .75); }
.aorb-form input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.aorb-send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.aorb-send:hover { background: var(--accent-dark); }
.aorb-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 640px) {
  .aorb { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .aorb-panel { right: 12px; bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .aorb, .aorb::before, .aorb::after, .aorb-liquid::before { animation: none !important; }
}

/* ===== Отзывы ===== */
.review-card { position: relative; }
.review-card .stars { color: #d9a520; letter-spacing: 2px; font-size: 14px; margin-bottom: 8px; }
.review-card blockquote { font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1.6; margin: 0 0 14px; }
.review-card .who { font-size: 13.5px; color: var(--ink-3); }
.review-card .who b { color: var(--ink-2); font-weight: 600; }
.review-form-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.status-pill.st-pending { background: rgba(217, 165, 32, .12); color: #9a7514; }
.status-pill.st-approved { background: rgba(55, 178, 108, .12); color: #1e7a45; }
.status-pill.st-rejected { background: rgba(203, 67, 67, .1); color: var(--err); }

/* ===== Полезные ссылки ===== */
.link-group { margin-top: 44px; }
.link-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.link-group-head svg { width: 22px; height: 22px; stroke: var(--accent); flex: none; }
.link-group-head h3 { font-family: var(--font-display); font-size: 22px; margin: 0; }
a.link-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
a.link-card h3 { font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
.link-domain {
  margin-top: auto; font-size: 13px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  transition: color .25s var(--ease);
}
.link-domain::after {
  content: '→'; opacity: 0; transform: translateX(-6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  color: var(--accent);
}
a.link-card:hover .link-domain { color: var(--accent-dark); }
a.link-card:hover .link-domain::after { opacity: 1; transform: none; }

/* ===== О сайте: карточки и шаги ===== */
.feature-card .ico {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.feature-card .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.steps { display: flex; flex-direction: column; gap: 0; max-width: 720px; }
.step { display: flex; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.step-num {
  font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--accent);
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.step .t { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.step .d { font-size: 14px; color: var(--ink-2); }

/* ===== Справка: аккордеон ===== */
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0; margin-bottom: 12px; overflow: hidden;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.faq details[open] { box-shadow: var(--shadow); border-color: rgba(47, 75, 179, .3); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 22px;
  font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent); opacity: .35; transition: opacity .25s, transform .25s var(--ease);
}
.faq details[open] summary::before { opacity: 1; transform: scale(1.25); }
.faq summary::after {
  content: '+'; margin-left: auto; font-size: 22px; font-weight: 400; color: var(--ink-3);
  transition: transform .3s var(--ease), color .3s;
}
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { margin: 0; padding: 0 22px 20px 42px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }

/* ===== Проверка слова в сайдбаре (как у saharina) ===== */
.side-gramota {
  margin-top: auto; padding: 12px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid rgba(47, 75, 179, .14);
}
.sg-title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px; }
.sg-form { display: flex; gap: 6px; }
.sg-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; font-size: 14px; font-family: var(--font-ui);
  background: var(--surface); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.sg-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 75, 179, .12); }
.sg-form button {
  flex: none; width: 36px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 16px;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.sg-form button:hover { background: var(--accent-dark); transform: translateX(2px); }
.sg-note { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.side-cta { margin-top: 14px; }

/* ===== Домашние задания ===== */
.hw-card { margin-bottom: 14px; }
.hw-card.hw-done { border-color: rgba(55,178,108,.4); background: linear-gradient(180deg, rgba(55,178,108,.05), rgba(55,178,108,.02)); }
.hw-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.hw-title { font-weight: 600; font-size: 16px; }
.hw-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.hw-pills { display: flex; gap: 8px; }
.hw-desc { margin-top: 10px; font-size: 14px; white-space: pre-wrap; color: var(--ink-2); }
.hw-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hw-chip { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-3); }
.hw-chip.done { background: rgba(55,178,108,.12); border-color: rgba(55,178,108,.35); color: #1e7a45; }

/* сдача домашки с файлом */
.hw-submit { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hw-file-btn { cursor: pointer; }
.hw-file-btn input[type="file"] { display: none; }
.hw-file-btn span { display: inline-block; padding: 8px 14px; border-radius: 10px; border: 1.5px dashed rgba(47,107,240,.45); color: var(--accent-dark); font-size: 13px; font-weight: 500; background: rgba(74,141,255,.06); transition: background .2s, border-color .2s; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.hw-file-btn:hover span { background: rgba(74,141,255,.12); border-color: var(--accent); }
.hw-note { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.hw-done-row { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hw-done-mark { color: #1e7a45; font-weight: 600; font-size: 14px; }
a.hw-chip { text-decoration: none; cursor: pointer; }
a.hw-chip:hover { filter: brightness(.95); }

/* служебная плашка учителя поверх сайта */
.teach-bar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 9px 16px; background: linear-gradient(90deg, #2f6bf0, #5a8dff); color: #fff; font-size: 13px; position: relative; z-index: 90; }
.teach-bar a { color: #fff; font-weight: 600; }
.teach-bar button { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: 3px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.teach-bar button:hover { background: rgba(255,255,255,.3); }

/* ===== Развёрнутые ответы (сочинения / изложения) ===== */
.q-crit { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.5; }
.q-essay textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; min-height: 180px;
  background: var(--surface); color: var(--ink);
}
.q-essay textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 75, 179, .12); }
.q-essay-meta { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.q-essay-meta .wc-need.ok { color: var(--ok); font-weight: 600; }
.q-essay-file { margin-top: 10px; display: inline-block; }

/* бейджи формата работы и обязательности */
.card .tag.tag-fmt { background: var(--accent); color: #fff; }
.card .tag.tag-req { background: rgba(203, 67, 67, .1); color: var(--err); border: 1px solid rgba(203, 67, 67, .35); }
.status-pill.status-review { background: rgba(47, 107, 240, .12); color: var(--accent-dark); }

/* проверка по критериям в админке */
.essay-review { border-top: 1px solid var(--line); padding: 16px 0; }
.essay-text {
  white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.65;
  max-height: 320px; overflow-y: auto; margin-bottom: 12px;
}
.essay-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.essay-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); transition: transform .18s var(--ease); }
.essay-photos a:hover img { transform: scale(1.04); }
.grade-box { background: rgba(47, 75, 179, .05); border: 1px solid rgba(47, 75, 179, .18); border-radius: 12px; padding: 14px 16px; }
.grade-title { font-size: 13px; font-weight: 600; color: var(--accent-dark); margin-bottom: 10px; }
.grade-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.grade-row + .grade-row { border-top: 1px dashed rgba(30, 36, 48, .08); }
.grade-inp { white-space: nowrap; color: var(--ink-3); font-size: 13px; }
.grade-inp input {
  width: 64px; text-align: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 6px; font: inherit; background: var(--surface); color: var(--ink);
}
.grade-inp input:focus { outline: none; border-color: var(--accent); }

/* аудио к развёрнутому заданию (изложение) */
.q-audio-row { margin-bottom: 14px; }
.q-audio-label { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.q-audio { width: 100%; height: 42px; display: block; }
