/* =========================================================
   KKMT Mini App — стили.

   Палитра задаётся ТОЛЬКО переменными. Их подставляет
   Telegram.WebApp.themeParams (светлая/тёмная тема клиента);
   без темы работают встроенные значения + prefers-color-scheme.
   Жёстких цветов в правилах нет — только в дефолтах ниже.
   ========================================================= */

:root {
  color-scheme: light dark;

  --bg: #f2f5fa;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-accent: #eef4ff;

  --text: #0f172a;
  --muted: #64748b;

  --accent: #2563eb;
  --accent-text: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);

  --btn-bg: #2563eb;
  --btn-text: #ffffff;
  --btn-ghost: rgba(15, 23, 42, 0.06);

  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, 0.14);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.14);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);

  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
  --shadow-sheet: 0 -12px 40px rgba(15, 23, 42, 0.18);

  --skel: rgba(148, 163, 184, 0.28);
  --skel-hi: rgba(148, 163, 184, 0.5);

  --radius: 16px;
  --radius-sm: 12px;
  --tap: 48px;
}

/* Без themeParams — системная тёмная тема. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1424;
    --bg-elev: #131c30;
    --card: #16203a;
    --card-accent: #17243f;

    --text: #e7eefb;
    --muted: #94a3b8;

    --accent: #5b8cff;
    --accent-text: #8fb3ff;
    --accent-soft: rgba(91, 140, 255, 0.18);

    --btn-bg: #3b73f0;
    --btn-text: #ffffff;
    --btn-ghost: rgba(255, 255, 255, 0.08);

    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.55);

    --skel: rgba(148, 163, 184, 0.2);
    --skel-hi: rgba(148, 163, 184, 0.38);
  }
}

/* Класс ставит app.js из Telegram themeParams. Специфичность
   выше :root, поэтому перекрывает и дефолты, и медиазапрос. */
html.dark {
  --bg: #0d1424;
  --bg-elev: #131c30;
  --card: #16203a;
  --card-accent: #17243f;

  --text: #e7eefb;
  --muted: #94a3b8;

  --accent: #5b8cff;
  --accent-text: #8fb3ff;
  --accent-soft: rgba(91, 140, 255, 0.18);

  --btn-bg: #3b73f0;
  --btn-text: #ffffff;
  --btn-ghost: rgba(255, 255, 255, 0.08);

  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.55);

  --skel: rgba(148, 163, 184, 0.2);
  --skel-hi: rgba(148, 163, 184, 0.38);
}

/* =========================================================
   БАЗА
   ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   ЭКРАНЫ
   ========================================================= */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: screen-in 0.24s ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.screen__body {
  flex: 1;
  padding: 12px 16px calc(88px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tabpane { animation: screen-in 0.2s ease both; }

/* =========================================================
   HERO / ССЫЛКА
   ========================================================= */

.hero {
  padding: calc(28px + env(safe-area-inset-top)) 24px 8px;
  text-align: center;
}

.hero__logo {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.hero__title {
  font-size: 24px;
  line-height: 1.25;
  margin: 18px 0 10px;
}

.hero__text {
  color: var(--muted);
  margin: 0 auto 14px;
  max-width: 34ch;
}

.hero__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 300px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.hero__list li {
  position: relative;
  padding: 12px 14px 12px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hero__list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--ok);
  font-weight: 700;
}

/* =========================================================
   КНОПКИ
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--btn-ghost);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease,
    background-color 0.16s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn--primary { background: var(--btn-bg); color: var(--btn-text); }
.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
  margin-top: 12px;
}
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 4px;
}

/* =========================================================
   ШАПКА
   ========================================================= */

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

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

.topbar__hello {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.topbar__name {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

.banner {
  padding: 10px 16px;
  font-size: 14px;
  text-align: center;
}

.banner--offline {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 600;
}

/* =========================================================
   АЛЕРТЫ
   ========================================================= */

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  font-size: 14px;
}

.alert--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.alert--error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.alert .btn { width: auto; background: rgba(255, 255, 255, 0.55); }

/* =========================================================
   КАРТОЧКИ
   ========================================================= */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card--accent {
  background: var(--card-accent);
  border-color: transparent;
}

.card--profile { text-align: center; padding-top: 22px; }

.card__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.card--row { display: flex; align-items: center; justify-content: space-between; }

.row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 10px;
}

/* =========================================================
   КАРТОЧКА «СЕЙЧАС»
   ========================================================= */

.now__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.now__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.now__label--idle::before { animation: none; opacity: 0.5; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.now__subject {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.now__time {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-text);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.now__meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.now__meta b { color: var(--text); }

.now__left {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.now__left--next { background: var(--accent-soft); color: var(--accent-text); }

.now__next {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 15px;
}

.now__next .muted { display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 4px; }

.now__empty { color: var(--muted); margin-top: 8px; }

/* =========================================================
   ПАРЫ
   ========================================================= */

.lessons { display: grid; gap: 10px; }

.lesson {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.14s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.lesson:active { transform: scale(0.99); }

.lesson.is-past { opacity: 0.55; }
.lesson.is-now {
  border-left-color: var(--accent);
  background: var(--card-accent);
  box-shadow: var(--shadow);
}
.lesson.is-changed { border-left-color: var(--warn); }

.lesson__time {
  flex: 0 0 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lesson__start { font-size: 17px; font-weight: 700; }
.lesson__end { font-size: 13px; color: var(--muted); }

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

.lesson__subject {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.lesson__sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag--changed { background: var(--warn-soft); color: var(--warn); }
.tag--state { background: var(--btn-ghost); color: var(--muted); }

/* =========================================================
   ВЫБОР ДАТЫ
   ========================================================= */

.daypicker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

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

.day {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  scroll-snap-align: start;
  transition: background-color 0.16s ease, color 0.16s ease,
    transform 0.12s ease;
}

.day b { font-size: 17px; color: var(--text); font-weight: 700; }
.day:active { transform: scale(0.96); }

.day.is-active {
  background: var(--btn-bg);
  border-color: transparent;
  color: var(--btn-text);
}
.day.is-active b { color: var(--btn-text); }

.day.is-today::after {
  content: "сегодня";
  font-size: 10px;
  text-transform: lowercase;
  opacity: 0.8;
}

/* =========================================================
   ПУСТЫЕ / ОШИБОЧНЫЕ СОСТОЯНИЯ
   ========================================================= */

.state {
  text-align: center;
  padding: 26px 18px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.state--fullscreen {
  margin: auto;
  border: 0;
  background: transparent;
  padding-top: 40vh;
}

.state__icon { font-size: 34px; margin-bottom: 10px; }
.state__title { font-size: 16px; font-weight: 600; color: var(--text); }
.state__text { font-size: 14px; margin-top: 8px; }

.state .btn { width: auto; margin-top: 16px; }

/* =========================================================
   SKELETON
   ========================================================= */

.skel {
  background: linear-gradient(90deg, var(--skel) 25%, var(--skel-hi) 37%,
    var(--skel) 63%);
  background-size: 400% 100%;
  border-radius: 8px;
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skel--label { width: 90px; height: 12px; margin-bottom: 12px; }
.skel--title { width: 70%; height: 22px; margin-bottom: 10px; }
.skel--line { width: 100%; height: 14px; margin-bottom: 10px; }
.skel--huge { width: 120px; height: 54px; }
.skel--time { width: 54px; height: 40px; flex: 0 0 54px; }
.skel--body { height: 44px; }

.skel-row {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* =========================================================
   УЧЁБА: ОЦЕНКИ
   ========================================================= */

.avg__value {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.avg__sub { color: var(--muted); font-size: 14px; margin-top: 8px; }

.dist { display: grid; gap: 10px; }

.dist__row {
  display: grid;
  grid-template-columns: 34px 1fr 56px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.dist__mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.dist__mark--low { background: var(--danger-soft); color: var(--danger); }

.dist__track, .att__track {
  height: 10px;
  border-radius: 999px;
  background: var(--btn-ghost);
  overflow: hidden;
}

.dist__track i, .att__track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dist__track i.is-low { background: var(--danger); }

.dist__val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}

/* =========================================================
   УЧЁБА: ПОСЕЩАЕМОСТЬ
   ========================================================= */

.att {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.att__percent {
  font-size: 34px;
  font-weight: 800;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
  min-width: 84px;
}

.att__track { flex: 1; height: 12px; }
.att__track i { background: var(--ok); }

.att__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--btn-ghost);
  font-size: 13px;
  font-weight: 600;
}

.att__recent { margin-top: 14px; display: grid; gap: 6px; }

.att__recent .visit {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  background: var(--btn-ghost);
  border-radius: 10px;
}

.att__recent .visit b { color: var(--text); font-weight: 600; }

/* =========================================================
   ПРОФИЛЬ
   ========================================================= */

.profile__avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--btn-text);
  font-size: 28px;
  font-weight: 700;
}

.profile__fio {
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile__group { color: var(--muted); margin-top: 4px; }
.profile__role {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.profile__status { font-weight: 600; }

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 14px;
}

.dot--ok { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }

/* =========================================================
   НИЖНЯЯ НАВИГАЦИЯ
   ========================================================= */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}

.tabbar__btn {
  flex: 1;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  position: relative;
  transition: color 0.16s ease;
}

.tabbar__icon { font-size: 19px; line-height: 1; }

.tabbar__btn.is-active { color: var(--accent-text); font-weight: 700; }

.tabbar__btn.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}

/* =========================================================
   МОДАЛЬНЫЕ ОКНА
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal__sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg-elev);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheet-up 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal__title {
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.modal .btn + .btn { margin-top: 10px; }

/* =========================================================
   QR
   ========================================================= */

.qr { text-align: center; }

.qr__image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 232px;
  padding: 12px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.qr__image img {
  width: 208px;
  height: 208px;
  display: block;
}

.qr__placeholder { color: #64748b; font-size: 14px; }

.qr__timer { margin-top: 14px; }

.qr__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--btn-ghost);
  overflow: hidden;
}

.qr__bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.qr__timer span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.qr__text {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin: 16px 0 10px;
}

.qr__state {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 14px;
}

.qr__state.is-error { background: var(--danger-soft); color: var(--danger); }
.qr__state.is-ok { background: var(--ok-soft); color: var(--ok); }
.qr__state.is-wait { background: var(--warn-soft); color: var(--warn); }

.qr__actions { display: grid; gap: 10px; }

/* =========================================================
   ТОСТ
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  z-index: 60;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* =========================================================
   ПОДКЛЮЧЕНИЕ ПОРТАЛА: ВЫБОР СПОСОБА
   ========================================================= */

.connect { display: grid; gap: 10px; }

.btn--block { width: 100%; min-height: 56px; font-size: 17px; }

.btn--outline {
  background: transparent;
  border-color: var(--border);
}

.btn--outline:active { background: var(--btn-ghost); }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tag--rec {
  background: var(--ok-soft);
  color: var(--ok);
  margin-left: 6px;
}

/* =========================================================
   ВХОД ПО ПОЧТЕ / CAPTCHA / OTP
   ========================================================= */

.login-step { display: grid; gap: 12px; }

.field { display: grid; gap: 6px; }

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field__row .input { flex: 1; min-width: 0; }

.field__toggle { width: auto; white-space: nowrap; }

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
}

.input::placeholder { color: var(--muted); opacity: 0.7; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.captcha {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.captcha__img {
  display: block;
  height: 56px;
  max-width: 100%;
  object-fit: contain;
}

.otp__email {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.otp__code {
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

.modal__actions { margin-top: 14px; display: grid; gap: 10px; }

/* =========================================================
   АДАПТИВНОСТЬ
   ========================================================= */

@media (max-width: 360px) {
  .now__subject { font-size: 19px; }
  .avg__value { font-size: 44px; }
  .lesson__time { flex-basis: 54px; }
  .tabbar__btn { font-size: 10px; }
}

@media (min-width: 480px) {
  .screen__body { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
