/* ===================================================================
   AYA-School — общие стили (бренд AYA, Приложение А ТЗ).
   Палитра: петроль, бирюза, шалфей, золото, фон-крем.
   Тон: тёплый, округлый, НЕ «малышовый» (ребёнку почти 10).
   Адаптив: мобайл + десктоп.
   =================================================================== */

/* Фирменные шрифты AYA (локальные woff2, отдаются сервером из /fonts). */
@font-face { font-family:'Geist';           src:url('/fonts/Geist.woff2') format('woff2');           font-weight:100 900; font-display:swap; }
@font-face { font-family:'Instrument Sans';  src:url('/fonts/InstrumentSans.woff2') format('woff2');  font-weight:100 900; font-display:swap; }
@font-face { font-family:'Inter';            src:url('/fonts/Inter.woff2') format('woff2');           font-weight:100 900; font-display:swap; }

:root {
  --accent: #003841;      /* петроль — основной тёмный */
  --accent-2: #005f6d;    /* бирюза — заголовки/акценты */
  --teal: #1aaab4;        /* протозвезда — верхний тон (свечение) */
  --sage: #b7c9b1;        /* шалфей — мягкие границы/фоны */
  --gold: #d6932f;        /* золото — старт градиента */
  --gold-2: #e7ab53;      /* золото — конец градиента */
  --bg: #f1f7f7;          /* фон — холодный, бело-бирюзовый (НЕ жёлтый) */
  --ink: #2a3b3d;         /* основной текст */
  --muted: #6b7d80;       /* приглушённый текст */
  --card: #ffffff;
  --danger: #c4452f;      /* тревога 'alarm' (только родительская панель) */
  --gold-grad: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  --petrol-grad: linear-gradient(135deg, var(--teal) 0%, var(--accent-2) 60%, var(--accent) 100%);
  /* глубокий петрольный радиал — для геройских/детских секций (как hero AYA) */
  --hero-bg: radial-gradient(circle at 38% 32%, #2bd0c9 0%, #0a9aa0 32%, #066b72 62%, #013e45 100%);
  --radius: 16px;
  /* мягкая многослойная тень-градиент + тонкий inset-блик сверху (как карточки AYA) */
  --shadow: 0 14px 40px rgba(0, 56, 65, .09), 0 4px 10px rgba(0, 56, 65, .05), inset 0 1px 0 rgba(255, 255, 255, .65);
  --shadow-hover: 0 26px 60px rgba(0, 56, 65, .16), 0 8px 18px rgba(0, 56, 65, .07);
  --glow: 0 0 60px 14px rgba(26, 170, 180, .32);   /* фирменное бирюзовое свечение протозвезды */
  /* шрифтовые стеки */
  --head: 'Geist','Instrument Sans',system-ui,-apple-system,sans-serif;
  --body: 'Instrument Sans','Inter',system-ui,-apple-system,sans-serif;
}

/* Заголовки — Geist. */
h1, h2, h3, .title { font-family: var(--head); }

/* ===================================================================
   ЛОГО-ШАР AYA — настоящая 3D-сфера-протозвезда (по образцу .sphere AYA).
   Тело: радиальный градиент бирюза→петроль; inset-блики дают объём;
   внешнее свечение + мягкая пульсация. Используется и как лого (шапки),
   и как «лицо» Звёздочки (герои). Заменяет плоский круг с ореолом.
   =================================================================== */
.aya-orb {
  position: relative; flex: 0 0 auto;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #2bd0c9 0%, #0a9aa0 34%, #066b72 60%, #013e45 100%);
  box-shadow:
    0 0 60px 12px rgba(43, 208, 201, .35),         /* внешнее свечение */
    inset -10px -12px 30px rgba(0, 20, 22, .6),    /* теневая сторона */
    inset 8px 8px 26px rgba(180, 255, 250, .25);   /* световая сторона */
  animation: aya-pulse 4.5s ease-in-out infinite;
}
/* Блик-искра — придаёт объём (3D-шар, а не плоский круг). */
.aya-orb::before {
  content: ""; position: absolute; top: 22%; left: 28%;
  width: 26%; height: 26%; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(1px); pointer-events: none;
}
/* Мягкий внешний ореол-свечение, дышит в такт пульсации. */
.aya-orb::after {
  content: ""; position: absolute; inset: -18%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(43, 208, 201, .22) 0%, rgba(43, 208, 201, 0) 70%);
  animation: aya-halo 4.5s ease-in-out infinite;
}
/* Размеры: маленький — шапки; средний — компактный герой; крупные — герои. */
.aya-orb--sm { width: 40px; height: 40px;
  box-shadow: 0 0 22px 5px rgba(43, 208, 201, .4), inset -4px -5px 11px rgba(0, 20, 22, .6), inset 3px 3px 9px rgba(180, 255, 250, .28); }
.aya-orb--md { width: 72px; height: 72px;
  box-shadow: 0 0 34px 8px rgba(43, 208, 201, .38), inset -6px -8px 18px rgba(0, 20, 22, .6), inset 5px 5px 15px rgba(180, 255, 250, .26); }
.aya-orb--lg { width: 140px; height: 140px; }
.aya-orb--xl { width: 160px; height: 160px; }

@keyframes aya-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes aya-halo  { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .95; transform: scale(1.12); } }

/* ===================================================================
   ПЕРЕЛИВАЮЩИЙСЯ (шиммер) ТЕКСТ — только для акцентных заголовков.
   Градиент-текст через background-clip:text + анимация смещения.
   =================================================================== */
.shimmer {
  background: linear-gradient(100deg, #bfe3e0, #fff, var(--gold-2), var(--gold), #fff, #bfe3e0);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: aya-shimmer 6s linear infinite;
}
@keyframes aya-shimmer { to { background-position: -200% center; } }

/* Бережём пользователей, чувствительных к движению. */
@media (prefers-reduced-motion: reduce) {
  .aya-orb, .aya-orb::after { animation: none; }
  .shimmer { animation: none; background-position: 50% 50%; }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Instrument Sans', Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Шапка ---------- */
.app-header {
  background: var(--accent);
  color: var(--bg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.app-header .logo { width: 40px; height: 40px; flex: 0 0 auto; }
.app-header .title { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.app-header .title .sub { font-weight: 400; opacity: .8; font-size: 15px; }
.app-header .badge {
  margin-left: auto;
  font-size: 12px;
  background: rgba(183, 201, 177, 0.18);
  border: 1px solid rgba(183, 201, 177, 0.35);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-header .child-pick {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; opacity: .9;
}
.app-header .child-pick input {
  font: inherit; font-size: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(183,201,177,0.4);
  color: var(--bg);
  border-radius: 8px; padding: 5px 8px; width: 150px;
}
.app-header .child-pick input::placeholder { color: rgba(251,248,243,0.5); }

/* ---------- Сетка карточек ---------- */
main.panel {
  max-width: 1600px;          /* во всю ширину страницы (не узкий лэндинг) */
  margin: 0 auto;
  padding: 24px clamp(24px, 4vw, 56px);
  display: grid;
  gap: 18px;
  /* адаптивная сетка: столько колонок, сколько влезает (мин. 360px) */
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--sage);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card.span-2 { grid-column: 1 / -1; }
.card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent-2);
}
.card .big { font-size: 30px; font-weight: 700; color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Прогресс-бар времени ---------- */
.progress {
  height: 12px; border-radius: 999px;
  background: var(--sage);
  overflow: hidden; margin: 10px 0 6px;
}
.progress > span {
  display: block; height: 100%;
  background: var(--gold-grad);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress.over > span { background: linear-gradient(135deg, var(--danger), #e06a52); }

/* ---------- Mastery ---------- */
.skill { padding: 12px 0; border-top: 1px solid #eef2ee; }
.skill:first-child { border-top: none; padding-top: 0; }
.skill .name { font-weight: 600; color: var(--accent); }
.skill .meta { font-size: 12px; color: var(--muted); }
.skill .bar { height: 8px; border-radius: 999px; background: var(--sage); margin-top: 6px; overflow: hidden; }
.skill .bar > span { display: block; height: 100%; background: var(--gold-grad); border-radius: 999px; }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 14px; }
.stars .off { color: var(--sage); }

/* ---------- Тревоги ---------- */
.card.flags.has-alarm { border-color: var(--danger); }
.flag {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; margin-top: 10px;
  border: 1px solid var(--sage); border-radius: 12px;
  background: #fafdf9;
}
.flag.alarm { border-color: var(--danger); background: #fdf4f2; }
.flag .sev {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--sage); color: var(--accent);
  white-space: nowrap;
}
.flag.alarm .sev { background: var(--danger); color: #fff; }
.flag .body { flex: 1; }
.flag .body .type { font-weight: 600; }
.flag .body .ts { font-size: 12px; color: var(--muted); }
.flag.surfaced { opacity: .55; }

/* ---------- Эмоции ---------- */
.emotions { display: flex; flex-direction: column; gap: 8px; }
.emotion {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
}
.emotion .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-grad); flex: 0 0 auto; }
.emotion .ts { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ---------- Управление (формы) ---------- */
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.toggle { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent-2); }
/* Все поля .box (text/email/password/number/date) + textarea — ранее правило ловило
   только type="text", из-за чего email/пароль у родителя оставались голыми. */
textarea, input.box {
  width: 100%; font: inherit; padding: 11px 13px;
  border: 1px solid var(--sage); border-radius: 12px;
  background: #fff; color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 56, 65, .05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.box { resize: vertical; }
textarea:focus, input.box:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 170, 180, .18);
}
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: none; border-radius: 999px; padding: 10px 18px;
  background: var(--gold-grad); color: #3a2606;
  /* градиентная заливка + тень + лёгкий inset-блик сверху */
  box-shadow: 0 10px 26px rgba(214, 147, 47, .35), 0 3px 8px rgba(120, 70, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s ease, filter .15s ease, box-shadow .2s ease;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(214, 147, 47, .45), 0 5px 12px rgba(120, 70, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn:active { transform: translateY(1px); box-shadow: 0 6px 16px rgba(214, 147, 47, .3), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.ghost { background: transparent; border: 1px solid var(--sage); color: var(--accent-2); box-shadow: none; }
.btn.ghost:hover { box-shadow: 0 8px 20px rgba(0, 56, 65, .08); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Состояния (загрузка/ошибка/пусто) ---------- */
.state { font-size: 13px; color: var(--muted); padding: 6px 0; }
.state.error { color: var(--danger); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--accent); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; }

footer.app-footer {
  text-align: center; padding: 28px 24px; color: var(--muted); font-size: 12px;
}
footer.app-footer a { color: var(--accent-2); }

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
  main.panel { grid-template-columns: 1fr; padding: 16px; }
  .app-header { padding: 14px 16px; }
  .app-header .badge { order: 3; margin-left: 0; width: 100%; justify-content: center; }
}

/* ===================================================================
   ДЕТСКАЯ ЧАТ-ДЕМО (kid.html) — тёплая, дружелюбная.
   =================================================================== */
body.kid {
  /* холодный светлый фон страницы (НЕ жёлтый) */
  background: radial-gradient(120% 120% at 50% 0%, #e9f5f3 0%, var(--bg) 55%);
  display: flex; flex-direction: column; min-height: 100vh;
}
.kid-wrap { flex: 1; display: flex; flex-direction: column; max-width: 920px; width: 100%; margin: 0 auto; padding: 16px; }
/* Герой — глубокая петрольная секция (как hero AYA): орб-сфера + светлый текст. */
.kid-hero {
  text-align: center; padding: 28px 20px 26px; margin: 4px 0 14px;
  border-radius: 24px; color: #eaf5f3;
  background: var(--hero-bg);
  box-shadow: 0 22px 52px rgba(0, 40, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.kid-hero .aya-orb { margin: 0 auto; }
.kid-hero h1 { margin: 14px 0 4px; font-size: 26px; }
.kid-hero p { margin: 0; color: #bfe3e0; font-size: 15px; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }

.chat {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 18px 4px; overflow-y: auto;
}
.msg { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: 16px; line-height: 1.45; }
.msg.kid-msg { align-self: flex-end; background: var(--accent-2); color: #fff; border-bottom-right-radius: 6px; }
.msg.star-msg { align-self: flex-start; background: #fff; border: 1px solid var(--sage); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.care { background: #fff8ec; border: 1px solid var(--gold-2); color: #5a4012; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.system { align-self: center; background: var(--sage); color: var(--accent); font-size: 14px; border-radius: 999px; padding: 8px 16px; }
.msg.typing { align-self: flex-start; color: var(--muted); font-style: italic; }

.kid-input {
  display: flex; gap: 10px; padding: 12px 4px 4px;
}
.kid-input input {
  flex: 1; font: inherit; font-size: 16px;
  padding: 14px 18px; border: 2px solid var(--sage); border-radius: 999px;
  background: #fff; color: var(--ink); outline: none;
}
.kid-input input:focus { border-color: var(--gold-2); }
.kid-input button {
  font-size: 18px; border: none; cursor: pointer;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold-grad); color: #3a2606;
  box-shadow: 0 8px 20px rgba(214, 147, 47, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s ease, box-shadow .2s ease;
}
.kid-input button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(214, 147, 47, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.kid-input button:disabled { opacity: .5; cursor: default; }
.kid-link { text-align: center; padding: 8px; font-size: 12px; }
.kid-link a { color: var(--accent-2); }

/* ===================================================================
   ГОЛОС (ТЗ §9): кнопка-микрофон + переключатель озвучки Звёздочки.
   Крупные, дружелюбные, бренд-токены (--teal/--gold/--glow). Лого = шар,
   поэтому в брендовых местах без эмодзи-звёзд.
   =================================================================== */

/* Кнопка-микрофон в полях ввода (и чат, и занятия). */
.mic-btn {
  flex: 0 0 auto; cursor: pointer; border: none;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold-grad); color: #3a2606;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(214, 147, 47, 0.35), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .1s ease, filter .15s ease, box-shadow .2s ease;
}
.mic-btn .mic-ico { font-size: 24px; line-height: 1; pointer-events: none; }
.mic-btn:hover { filter: brightness(1.04); }
.mic-btn:active { transform: translateY(1px); }

/* В режиме занятий поле повыше — выровняем микрофон по тому же размеру. */
.learn-input .mic-btn { width: 52px; height: 52px; }

/* Идёт запись — тёплая пульсация (бирюзовое свечение протозвезды). */
.mic-btn.is-rec {
  background: var(--teal); color: #02363a;
  animation: micPulse 1.1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 170, 180, .45); }
  50%      { box-shadow: 0 0 0 12px rgba(26, 170, 180, 0); }
}

/* Распознаю… — мягкое мерцание. */
.mic-btn.is-busy { opacity: .8; animation: micBusy 1s ease-in-out infinite; }
@keyframes micBusy { 0%,100% { opacity: .55; } 50% { opacity: .95; } }

/* Ошибка — мягкая, без тревожного красного. */
.mic-btn.is-err { background: var(--sage); color: var(--accent); }
/* Голос недоступен (нет https) — приглушаем, но кнопка кликабельна (покажет подсказку). */
.mic-btn.is-off { background: var(--sage); color: var(--accent-2); box-shadow: none; }

/* Мягкая подсказка под полем (например, нужен https). */
.mic-note {
  margin: 8px 4px 0; padding: 10px 14px;
  background: #fff8ec; border: 1px solid var(--gold-2); border-radius: 12px;
  color: #5a4012; font-size: 14px; line-height: 1.4;
}

/* Переключатель озвучки ответов Звёздочки. */
.kid-sound { text-align: center; margin: 2px auto 0; }
.kid-sound-btn {
  font: inherit; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--sage); background: var(--card); color: var(--accent-2);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.kid-sound-btn .kid-sound-ico { font-size: 16px; line-height: 1; }
.kid-sound-btn.is-on { border-color: var(--teal); color: var(--accent); }
.kid-sound-btn:not(.is-on) { opacity: .7; }

/* ===================================================================
   ВКЛАДКИ детской страницы: «Поболтать» / «Заниматься».
   =================================================================== */
.kid-tabs {
  display: flex; gap: 8px; justify-content: center;
  margin: 6px auto 4px; padding: 4px;
  background: rgba(183,201,177,0.25); border-radius: 999px; width: fit-content;
}
.kid-tab {
  font: inherit; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--accent-2);
  padding: 8px 20px; border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.kid-tab.is-active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

/* ===================================================================
   РЕЖИМ «ЗАНИМАТЬСЯ» — карточка задания.
   =================================================================== */
.learn-state {
  text-align: center; color: var(--accent-2); font-size: 16px;
  padding: 28px 12px;
}
.learn-card {
  background: var(--card); border: 1px solid var(--sage); border-radius: var(--radius);
  padding: 22px; margin: 8px 0; box-shadow: var(--shadow);
}
.learn-skill {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--accent-2); font-weight: 700; margin-bottom: 6px;
}
.learn-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.learn-stars { color: var(--gold); letter-spacing: 2px; font-size: 15px; }
.learn-stars .off { color: var(--sage); }
.learn-prompt { font-size: 20px; color: var(--ink); line-height: 1.4; margin: 8px 0 16px; }

.learn-choices { display: flex; flex-direction: column; gap: 10px; }
.learn-choice {
  font: inherit; font-size: 17px; cursor: pointer; text-align: left;
  padding: 14px 18px; border: 2px solid var(--sage); border-radius: 14px;
  background: #fff; color: var(--ink); transition: border-color .12s ease, background .12s ease;
}
.learn-choice:hover { border-color: var(--gold-2); }
.learn-choice.on { border-color: var(--accent-2); background: #f1f7f6; }
.learn-choice:disabled { opacity: .6; cursor: default; }

.learn-input { display: flex; gap: 10px; }
.learn-input input {
  flex: 1; font: inherit; font-size: 18px;
  padding: 13px 18px; border: 2px solid var(--sage); border-radius: 14px;
  background: #fff; color: var(--ink); outline: none;
}
.learn-input input:focus { border-color: var(--gold-2); }
.learn-input .btn { white-space: nowrap; }

/* Подсказка — тёплая, без красного «неверно». */
.learn-hint {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px 16px;
  background: #fff8ec; border: 1px solid var(--gold-2); border-radius: 14px;
  color: #5a4012; font-size: 16px; line-height: 1.4;
}
.learn-hint .hint-star { width: 44px; height: 44px; flex: 0 0 auto; }

/* Похвала — радость шара. */
.learn-praise { text-align: center; padding: 8px 0 4px; }
.learn-praise .praise-star { width: 84px; height: 84px; margin: 0 auto; display: block; }
.learn-praise .praise-glow { transform-origin: center; }
.learn-praise.pop .praise-star { animation: praisePop .7s ease; }
.learn-praise.pop .praise-glow { animation: praiseGlow 1.4s ease-in-out infinite; }
.learn-praise-text { font-size: 18px; color: var(--accent); font-weight: 600; margin: 10px 0 16px; }
@keyframes praisePop {
  0% { transform: scale(.6) rotate(-8deg); opacity: 0; }
  55% { transform: scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@keyframes praiseGlow { 0%,100% { opacity: .35; } 50% { opacity: .8; } }

/* ===================================================================
   ОНБОРДИНГ (onboarding.html).
   =================================================================== */
main.ob-panel { grid-template-columns: 1fr; max-width: 760px; }
.ob-steps {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ob-steps li {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 120px;
  padding: 10px 12px; border: 1px solid var(--sage); border-radius: 12px;
  background: var(--card); color: var(--muted); font-size: 13px;
}
.ob-steps li .dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sage); color: var(--accent); font-weight: 700; font-size: 13px;
}
.ob-steps li.current { border-color: var(--accent-2); color: var(--accent); }
.ob-steps li.current .dot { background: var(--gold-grad); color: #3a2606; }
.ob-steps li.done { color: var(--accent); }
.ob-steps li.done .dot { background: var(--accent-2); color: #fff; }

.ob-card { padding: 24px; }
.ob-pane h2 {
  font-size: 20px; text-transform: none; letter-spacing: 0;
  color: var(--accent); margin: 0 0 10px;
}
.ob-pane p { color: var(--ink); margin: 0 0 14px; }
.ob-pane p.muted { color: var(--muted); }
.ob-actions { margin-top: 18px; }
.ob-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; }
.ob-consent input { margin-top: 3px; }

.ob-interests { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-tag {
  font: inherit; font-size: 14px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--sage); background: #fff; color: var(--accent-2);
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.ob-tag:hover { border-color: var(--gold-2); }
.ob-tag.on { background: var(--gold-grad); color: #3a2606; border-color: transparent; }

/* ===================================================================
   ПЛАН ЗАНЯТИЙ (карточка панели).
   =================================================================== */
.plan-row { align-items: flex-end; gap: 14px; }
.plan-row .field { margin: 8px 0; flex: 1; min-width: 130px; }
.plan-add-field { flex: 0 0 auto; }
select.box {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--sage); border-radius: 10px;
  background: #fff; color: var(--ink);
}
.plan-filter { margin: 12px 0; font-size: 13px; color: var(--accent); font-weight: 600; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--sage); border-radius: 12px;
  background: #fafdf9;
}
.plan-item .body { flex: 1; }
.plan-item .name { font-weight: 600; color: var(--accent); }
.plan-item .meta { font-size: 12px; color: var(--muted); }
.plan-item.done { opacity: .6; }
.plan-item-actions { flex: 0 0 auto; gap: 8px; }

/* ===================================================================
   ПАМЯТЬ И РАЗВИТИЕ (карточка панели) — вывод движка insights.
   Тёплые бренд-токены, без тревожного красного.
   =================================================================== */
#card-memory .mem-count {
  font-size: 15px; color: var(--ink);
  padding: 4px 0 8px;
}
#card-memory .mem-count strong { color: var(--accent); }

#card-memory .mem-block { margin-top: 16px; }
#card-memory .mem-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--accent-2); font-weight: 700; margin-bottom: 8px;
}

/* Лента настроения — точки-эмодзи во времени. */
.mood-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 0;
}
.mood-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  border: 1px solid var(--sage);
  box-shadow: var(--shadow);
  cursor: default;
}
.mood-dot.m-joy  { background: #fff3d6; border-color: var(--gold-2); }
.mood-dot.m-calm { background: #eef6f0; border-color: var(--sage); }
.mood-dot.m-sad  { background: #f3f6f2; border-color: var(--sage); }
.mood-dot.m-soft { background: #fdf6ec; border-color: var(--gold); }

/* Две колонки: взлёты / над чем работаем; остановились / любит. */
.mem-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 16px;
}
.mem-col { min-width: 0; }

.mem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mem-list li {
  font-size: 14px; color: var(--ink);
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--sage); background: #fafdf9;
}
.mem-list.ups li   { background: #f3f9f4; border-color: var(--sage); }
.mem-list.downs li { background: #fdf8ee; border-color: var(--gold-2); }
.mem-list.tips li  { background: #f1f7f6; border-color: var(--sage); }
.mem-list li.mem-empty { background: transparent; border: none; padding: 4px 0; }

/* «Остановились» и «любит» — мягкие чипы. */
.mem-focus, .mem-prefs { display: flex; flex-wrap: wrap; gap: 8px; }
.mem-chip {
  display: inline-flex; align-items: center;
  font-size: 13px; color: var(--accent);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(183, 201, 177, 0.22);
  border: 1px solid var(--sage);
}

/* Заметка о развитии — тёплая «бумажка». */
.mem-note {
  font-size: 14px; line-height: 1.5; color: var(--ink);
  padding: 12px 14px; border-radius: 12px;
  background: #fff8ec; border: 1px solid var(--gold-2);
}

@media (max-width: 720px) {
  .mem-cols { grid-template-columns: 1fr; gap: 14px; }
}

/* ===================================================================
   ЛЕНДИНГ / ВХОД (landing.html) — две крупные картинки-перехода.
   Тёплый, добрый, не «малышовый». Адаптив: на мобайле — в столбик.
   =================================================================== */
body.landing {
  background: radial-gradient(120% 120% at 50% 0%, #e9f5f3 0%, var(--bg) 55%);
  display: flex; flex-direction: column; min-height: 100vh;
}
.app-header-home { display: inline-flex; flex: 0 0 auto; line-height: 0; }

.landing-main {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 28px 20px; display: flex; flex-direction: column; align-items: center;
}
/* Приветственная секция — петрольный герой со светлым/шиммер-текстом. */
.landing-intro {
  text-align: center; margin: 12px 0 28px; width: 100%;
  padding: 34px 24px; border-radius: 24px; color: #eaf5f3;
  background: var(--hero-bg);
  box-shadow: 0 22px 52px rgba(0, 40, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.landing-intro h1 { margin: 0 0 8px; font-size: 30px; }
.landing-intro p { margin: 0 auto; max-width: 520px; color: #bfe3e0; font-size: 17px; }

.landing-cards {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}
.land-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--sage);
  border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .2s ease, border-color .14s ease;
}
.land-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,56,65,.14); border-color: var(--gold-2); }
.land-card-img {
  width: 168px; height: 168px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--glow); margin-bottom: 16px; background: var(--bg);
}
.land-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.land-card-title { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--accent); }
.land-card-sub { font-size: 15px; color: var(--muted); margin-top: 4px; }
.land-card--parent .land-card-img { box-shadow: 0 0 50px 10px rgba(214,147,47,.22); }
/* Орб-герой внутри карточки перехода: отступ под заголовком, halo не клипится. */
.land-card .aya-orb { margin-bottom: 18px; }

.landing-secondary { margin: 28px 0 4px; font-size: 15px; color: var(--muted); text-align: center; }
.landing-secondary a { color: var(--accent-2); font-weight: 600; }

@media (max-width: 720px) {
  .landing-cards { grid-template-columns: 1fr; gap: 16px; }
  .landing-intro h1 { font-size: 25px; }
  .land-card-img { width: 140px; height: 140px; }
}

/* ===================================================================
   ВХОД / РЕГИСТРАЦИЯ родителя (login.html) — бренд-стиль, лого-шар.
   =================================================================== */
body.auth {
  background: radial-gradient(120% 120% at 50% 0%, #e9f5f3 0%, var(--bg) 55%);
  display: flex; flex-direction: column; min-height: 100vh;
}
.auth-main {
  flex: 1; width: 100%; max-width: 440px; margin: 0 auto;
  padding: 28px 18px; display: flex; flex-direction: column; align-items: center;
}
.auth-card { width: 100%; padding: 26px 24px; overflow: hidden; }
/* Шапка карточки входа — петрольный мини-герой с орбом и шиммер-заголовком. */
.auth-hero {
  text-align: center; margin: -26px -24px 18px; padding: 26px 24px 22px;
  border-radius: var(--radius) var(--radius) 0 0; color: #eaf5f3;
  background: var(--hero-bg);
}
.auth-hero .aya-orb { margin: 0 auto 10px; }
.auth-hero h1 { margin: 0 0 6px; font-size: 23px; }
.auth-hero .muted { font-size: 14px; color: #bfe3e0; }

.auth-tabs {
  display: flex; gap: 8px; justify-content: center;
  margin: 4px auto 18px; padding: 4px;
  background: rgba(183,201,177,0.25); border-radius: 999px; width: fit-content;
}
.auth-tab {
  font: inherit; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--accent-2);
  padding: 8px 22px; border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.auth-tab.is-active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

.auth-form .field { margin: 14px 0; }
.auth-hint-pw { margin-top: 6px; }
.auth-submit { width: 100%; margin-top: 6px; padding: 13px 18px; font-size: 16px; }
.auth-switch { text-align: center; margin: 16px 0 0; font-size: 14px; }
.auth-switch a { color: var(--accent-2); font-weight: 600; }
.auth-back { text-align: center; margin: 18px 0 0; font-size: 14px; }
.auth-back a { color: var(--accent-2); }
#auth-error { margin: 4px 0 2px; }

/* ===================================================================
   ЗНАКОМСТВО (meet.html) — переиспользует body.kid (герой/звезда/фон).
   Крупные дружелюбные элементы, тёплые цвета.
   =================================================================== */
.meet-wrap { max-width: 560px; }
.meet-progress { margin: 6px auto 4px; width: 100%; }
.meet-progress .progress { margin: 6px 0; }
.meet-step { text-align: center; font-size: 13px; }

.meet-card {
  background: var(--card); border: 1px solid var(--sage); border-radius: var(--radius);
  padding: 22px; margin: 12px 0; box-shadow: var(--shadow);
}
.meet-question { font-size: 21px; line-height: 1.4; color: var(--accent); margin: 0 0 18px; }

.meet-form { display: flex; flex-direction: column; gap: 12px; }
.meet-form input {
  width: 100%; font: inherit; font-size: 18px;
  padding: 14px 18px; border: 2px solid var(--sage); border-radius: 14px;
  background: #fff; color: var(--ink); outline: none;
}
.meet-form input:focus { border-color: var(--gold-2); }
.meet-send { align-self: flex-end; padding: 12px 26px; font-size: 16px; }

.meet-state { text-align: center; color: var(--accent-2); font-size: 16px; padding: 22px 12px; }

.meet-done { text-align: center; padding: 18px 12px 8px; }
.meet-done-star { margin: 0 auto 6px; }
.meet-done h2 { margin: 8px 0 6px; font-size: 24px; color: var(--accent); }
.meet-done p { margin: 0 auto 20px; max-width: 380px; color: var(--accent-2); font-size: 16px; }
.meet-go { display: inline-block; padding: 15px 32px; font-size: 17px; text-decoration: none; }

@media (max-width: 720px) {
  .meet-question { font-size: 19px; }
  .meet-send { align-self: stretch; }
}

/* ===================================================================
   ДОПОЛНЕНИЯ (не менять существующее выше).
   Лицо AYA-Звёздочки, детский вход, вкладка «Помощь с ДЗ»,
   режим «вместе с родителем», карточка «Дети», бейдж «учим, не списываем».
   =================================================================== */

/* ── ЛИЦО на крупном орбе: глаза + улыбка поверх сферы (только --face). ──
   Мягкие тёмно-петролевые черты, полупрозрачные. Пульс/блик не трогаем —
   лицо это дочерний SVG, который масштабируется вместе с орбом. */
.aya-orb--face .aya-face {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .15));
}

/* ── Тёплая плашка «занимаемся вместе с родителем» (kid.html?together=1). ── */
.kid-together {
  margin: 8px auto 0; max-width: 520px; width: 100%;
  background: #fff8ec; border: 1px solid var(--gold-2); border-radius: 14px;
  color: #5a4012; font-size: 14px; line-height: 1.4;
  padding: 10px 16px; text-align: center;
}

/* ── Мягкая плашка «помогаю понять, а не списать» в режиме ДЗ. ── */
.hw-note {
  margin: 6px 0 10px; padding: 10px 16px;
  background: var(--sage); border-radius: 14px;
  color: var(--accent); font-size: 14px; line-height: 1.4; text-align: center;
}

/* ── Детский вход (child-login.html): переиспользует body.auth. ── */
.child-auth .auth-form input {
  width: 100%; font: inherit; font-size: 17px;
  padding: 13px 16px; border: 2px solid var(--sage); border-radius: 14px;
  background: #fff; color: var(--ink); outline: none;
}
.child-auth .auth-form input:focus { border-color: var(--gold-2); }
.child-auth .auth-hint { text-align: center; margin: 14px 0 0; font-size: 14px; color: var(--muted); }

/* ── Бейдж «учим понимать, а не списывать» — отстройка по research. ── */
.aya-pledge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  background: rgba(183, 201, 177, 0.22); border: 1px solid var(--gold-2);
  color: var(--accent-2); padding: 6px 14px; border-radius: 999px;
}
.landing-pledge { margin: 16px auto 0; text-align: center; }

/* ── Третий мягкий пункт лендинга «вместе с родителем». ── */
.landing-together { margin: 18px auto 0; text-align: center; }
.landing-together a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  color: var(--accent-2);
  background: var(--card); border: 1px solid var(--sage);
  border-radius: 999px; padding: 11px 22px; box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.landing-together a:hover { transform: translateY(-2px); border-color: var(--gold-2); }

/* ── Карточка «Дети» в родительской панели. ── */
.children-create { margin-bottom: 16px; }
.children-create .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.children-create .field { margin: 8px 0; flex: 1 1 140px; }
.children-create .field.age { flex: 0 0 90px; }
.children-list { display: flex; flex-direction: column; gap: 8px; }
.child-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: #fff; border: 1px solid var(--sage); border-radius: 12px;
  padding: 10px 14px; transition: border-color .14s ease, box-shadow .14s ease;
}
.child-row:hover { border-color: var(--gold-2); box-shadow: var(--shadow); }
.child-row.is-current { border-color: var(--teal); background: #f1faf8; }
.child-row .child-name { font-weight: 600; color: var(--accent); }
.child-row .child-login { font-size: 13px; color: var(--muted); }
.child-row .child-age { margin-left: auto; font-size: 13px; color: var(--accent-2); }

/* ===================================================================
   КАБИНЕТ УЧИТЕЛЯ (teacher.html) — B2G. Только дополнения; бренд-токены.
   =================================================================== */

/* Вторичные вкладки (классы: активные/архив; чат-каналы) — компактнее. */
.t-tabs { margin: 4px 0 14px; }
.t-create { margin: 0 0 6px; }

/* Кнопка «Выйти» в шапке. */
.app-header #logout-btn { margin-left: 8px; }

/* Подзаголовки секций дашборда. */
.t-sub {
  font-family: var(--head); font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--accent-2);
  margin: 24px 0 10px; padding-top: 16px; border-top: 1px solid #eef2ee;
}
.t-sub .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Шапка дашборда: имя класса + действия. */
.t-dash-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.t-dash-head h2 { margin: 0; flex: 1; min-width: 160px; }
.t-dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Сводка статистики — плитки. */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 8px 0 6px;
}
.stat-tile {
  background: #fafdf9; border: 1px solid var(--sage); border-radius: 14px;
  padding: 14px 12px; text-align: center;
}
.stat-val { font-family: var(--head); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* План класса — раскрывающаяся плашка. */
.t-plan {
  margin-top: 12px; padding: 14px 16px;
  background: #f1f7f6; border: 1px solid var(--sage); border-radius: 14px;
}
.t-plan .t-sub { margin-top: 0; padding-top: 0; border-top: none; }

/* Карточка ученика: основная колонка + бар прогресса. */
.t-student { align-items: center; }
.t-student.is-archived { opacity: .55; }
.t-student-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.t-bar { height: 8px; border-radius: 999px; background: var(--sage); overflow: hidden; max-width: 240px; }
.t-bar > span { display: block; height: 100%; background: var(--gold-grad); border-radius: 999px; transition: width .4s ease; }

/* Заметки — тёплые «бумажки». */
.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-item {
  background: #fff8ec; border: 1px solid var(--gold-2); border-radius: 12px;
  padding: 10px 14px;
}
.note-text { color: #5a4012; font-size: 14px; line-height: 1.4; }
.note-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Табель — таблица. */
.t-table-wrap { overflow-x: auto; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table th, .t-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid #eef2ee;
}
.t-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--accent-2); }
.t-table td.t-grade-val { font-weight: 700; color: var(--accent); }

/* Сообщения — плейсхолдер (перенос из AYAconnect). */
.chat-placeholder {
  padding: 18px 16px; border-radius: 14px;
  background: #f1f7f6; border: 1px dashed var(--sage); text-align: center;
}
.chat-ph-title { font-family: var(--head); font-weight: 700; color: var(--accent); font-size: 15px; }
.chat-ph-sub { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.chat-ph-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chat-ph-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--accent-2);
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--sage);
}
.chat-ph-chip em { font-style: normal; font-size: 11px; color: var(--gold); }

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .t-dash-actions { width: 100%; }
}

/* ===================================================================
   Карточка «Школа» (#card-school) — единая экосистема: код ребёнка,
   присоединение к классу, классы/учителя, табель, чат с учителем.
   Бренд-токены переиспользованы (--teal/--gold/--sage/--radius).
   =================================================================== */
#card-school .school-block { margin-top: 18px; }
#card-school .school-block:first-of-type { margin-top: 14px; }

/* Энролл: две колонки — код ребёнка и присоединение к классу */
.school-enroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}
.school-enroll .school-block { margin-top: 0; }

/* Крупный код ребёнка + кнопка «Скопировать» */
.school-code-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px;
}
.school-code {
  display: inline-block;
  font-family: 'Geist', ui-monospace, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: 3px;
  color: var(--accent);
  padding: 8px 16px; border-radius: 12px;
  background: #fff; border: 1px dashed var(--teal);
  user-select: all;
}

/* Присоединение к классу по коду */
.school-join {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.school-join input.box { flex: 1 1 200px; max-width: 280px; }
.school-join .btn { white-space: nowrap; }

/* Классы ребёнка */
.school-classes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.school-class {
  background: #fff; border: 1px solid var(--sage); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.school-class-name { font-weight: 600; color: var(--ink); }

/* Табель оценок */
.grades-scroll { overflow-x: auto; margin-top: 10px; }
.grades-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.grades-table th, .grades-table td {
  text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--sage);
}
.grades-table th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600;
}
.grades-table tbody tr:last-child td { border-bottom: none; }
.grades-table .grade-val {
  font-weight: 700; color: var(--accent); font-size: 16px;
}
.grades-table .grade-ts { white-space: nowrap; }

/* Чат с учителем — контейнер виджета AyaChat */
.school-chat { margin-top: 10px; }

@media (max-width: 720px) {
  .school-enroll { grid-template-columns: 1fr; }
  .school-code { font-size: 22px; letter-spacing: 2px; }
}

/* ── Графа предмета при регистрации учителя ─────────────────────────── */
.subj-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.subj-grid .toggle { margin-right: 0; }

/* ── «Мои заметки» / «Дневник» — контейнер виджета self-чата ────────── */
.self-notes-mount,
.diary-chat { margin-top: 14px; min-height: 160px; }

/* ===================================================================
   АДМИНИСТРАЦИЯ ШКОЛЫ (admin.html) — кабинет директора/завуча.
   Только дополнения; бренд-токены переиспользованы (--teal/--gold/--sage).
   «Школа = Сообщество» — тёплая, но деловая подача.
   =================================================================== */

/* Карточка входа — петрольный мини-герой с орбом и шиммер-заголовком. */
.admin-auth { overflow: hidden; }
.admin-hero {
  text-align: center; margin: -20px -20px 18px; padding: 28px 24px 22px;
  border-radius: var(--radius) var(--radius) 0 0; color: #eaf5f3;
  background: var(--hero-bg);
}
.admin-hero .aya-orb { margin: 0 auto 12px; }
.admin-hero h1 { margin: 0 0 6px; font-size: 24px; }
.admin-hero .muted { font-size: 14px; color: #bfe3e0; }

/* Подсказка «доступ выдаёт администрация» — тёплая «бумажка». */
.admin-access-note {
  margin-top: 18px; padding: 12px 16px;
  background: #fff8ec; border: 1px solid var(--gold-2); border-radius: 12px;
  color: #5a4012; font-size: 13px; line-height: 1.5; text-align: center;
}

/* Название учреждения в обзоре. */
.admin-school-name {
  font-family: var(--head); font-size: 24px; font-weight: 700;
  color: var(--accent); margin: 2px 0 4px;
}

/* Форма добавления учителя по email. */
.admin-add { margin: 14px 0 6px; }

/* Список (учителя / классы / ученики) — карточки-строки. */
.admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.admin-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--sage); border-radius: 12px;
  padding: 12px 14px; transition: border-color .14s ease, box-shadow .14s ease;
}
.admin-item:hover { border-color: var(--gold-2); box-shadow: var(--shadow); }
.admin-item.is-archived { opacity: .55; }
.admin-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-item-name { font-weight: 600; color: var(--accent); }
.admin-item-sub { font-size: 13px; color: var(--muted); }
.admin-item-tags { font-size: 12px; color: var(--accent-2); }
.admin-remove { flex: 0 0 auto; white-space: nowrap; }
.admin-bar { max-width: 240px; margin-top: 4px; }

/* Задача отдельному ученику: раскрывающийся мини-блок под строкой ученика. */
.t-task-panel {
  margin: -4px 0 10px; padding: 12px 14px;
  background: #f1f7f6; border: 1px solid var(--sage); border-radius: 12px;
}
.t-task-panel .plan-row { margin-top: 0; }
.t-task-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.t-task-item {
  background: #fff; border: 1px solid var(--sage); border-radius: 10px;
  padding: 6px 10px; color: var(--accent-2);
}
.t-task-skillname { font-weight: 600; color: var(--accent); }
.t-task-toggle { margin-top: 8px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Постановка ЗАДАНИЯ: переключатель источника (программа / материал / своя задача).
   Используется в плане класса и в панели задачи отдельному ученику (teacher.*).
   ───────────────────────────────────────────────────────────────────────────── */
.src-switch {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px;
}
.src-btn {
  appearance: none; cursor: pointer; font: inherit;
  background: #fff; color: var(--accent-2);
  border: 1px solid var(--sage); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.src-btn:hover { border-color: var(--gold-2); }
.src-btn.is-active {
  background: var(--petrol-grad); color: #fff; border-color: transparent;
}
.src-hint {
  margin: 4px 0 8px; font-size: 13px; color: var(--muted);
  background: #fff7e6; border: 1px solid #f0dcae; border-radius: 10px;
  padding: 8px 12px;
}
.t-task-panel textarea.box, .t-plan textarea.box { resize: vertical; min-height: 42px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Детская страница: «Задания от учителя» (kid.*). Тёплый тон, без тревожных цветов.
   ───────────────────────────────────────────────────────────────────────────── */
.school-tasks { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  background: #ffffff; border: 1px solid #d6e8e9; border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 2px 8px rgba(0, 56, 65, 0.05);
}
.task-card.is-done { opacity: .6; background: #f4f9f4; }
.task-main { flex: 1 1 240px; min-width: 0; }
.task-kind {
  display: inline-block; font-size: 12px; font-weight: 600; color: #1aaab4;
  background: #e8f6f6; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px;
}
.task-title { font-size: 18px; font-weight: 600; color: #003841; }
.task-card.is-done .task-title { text-decoration: line-through; }
.task-body {
  font-size: 15px; color: #4a5b5d; margin-top: 6px;
  background: #f6fbfb; border-radius: 10px; padding: 8px 12px; white-space: pre-wrap;
}
.task-meta { font-size: 13px; color: #6b7d80; margin-top: 6px; }
.task-file {
  display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600;
  color: #005f6d; text-decoration: none;
}
.task-file:hover { text-decoration: underline; }
.task-actions {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.task-go, .task-done-btn { white-space: nowrap; }
.task-done-badge {
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #1aaab4, #005f6d);
  border-radius: 999px; padding: 6px 14px; white-space: nowrap;
}

/* ===================================================================
   ВКЛАДКА «ЗАНИМАТЬСЯ» — живой разговорный тьютор (AYA-Звёздочка).
   Орб-наставник + плашка задачи + прогресс + лента диалога пузырями.
   Бренд-токены, крупные тёплые элементы, для ребёнка ~10 лет.
   =================================================================== */
.tutor-head {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--sage);
  border-radius: 20px; padding: 16px 18px; margin: 6px 0 4px;
  box-shadow: var(--shadow);
}
.tutor-head .aya-orb { margin: 0; }
.tutor-head-body { flex: 1 1 auto; min-width: 0; }

/* Текущая задача — что учим прямо сейчас. */
.tutor-task-skill {
  font-family: var(--head); font-weight: 700;
  font-size: 18px; color: var(--accent); line-height: 1.25;
}
.tutor-task-prompt {
  font-size: 15px; color: var(--ink); line-height: 1.4; margin-top: 4px;
}

/* Компактный прогресс: звёзды mastery + % и серия. */
.tutor-progress {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.tutor-stars { color: var(--gold); letter-spacing: 2px; font-size: 16px; }
.tutor-stars .off { color: var(--sage); }
.tutor-streak { font-size: 14px; }

/* Лента диалога — пузыри как в чате «Поболтать», но повыше под занятие. */
.tutor-chat { min-height: 200px; }

/* Маленькая радость орба на верный ответ — тёплый подскок + золотое свечение. */
.aya-orb.is-joy { animation: tutorJoy 1.3s ease; }
@keyframes tutorJoy {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.14) rotate(-4deg);
         box-shadow: 0 0 50px 14px rgba(231, 171, 83, .6), inset -6px -8px 18px rgba(0, 20, 22, .6), inset 5px 5px 15px rgba(180, 255, 250, .26); }
  60%  { transform: scale(1.06) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aya-orb.is-joy { animation: none; }
}
