/* 0) БАЗА + ПЕРЕМЕННЫЕ */
:root{
  /* JS-проверка возврата из истории: 1 означает, что главный CSS применён. */
  --showege-style-ready: 1;
  --bg:#0b1020;
  --bg2:#0e1530;

  --card: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.14);

  --text:#eaf0ff;
  --muted: rgba(234,240,255,.68);

  --brand: var(--c-acc-1);
  --brand2: var(--c-acc-2);
  --good: var(--c-acc-3);

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --r: 22px;
  --r2: 16px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}

*{ box-sizing:border-box; }

/* ── PERF KILL-SWITCH ──────────────────────────────────────────────────────
   Глобальное отключение тяжёлых эффектов когда <html class="perf-lite">.
   Этот класс ставится JS-ом в base.html для Safari / macOS, мобилок,
   prefers-reduced-motion, и устройств с >2 cores. Убирает backdrop-filter,
   filter:blur и тяжёлые animation:infinite — это даёт +30–60 FPS
   и устраняет ощущение «страница лагает». */
html.perf-lite *,
html.perf-lite *::before,
html.perf-lite *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.perf-lite .panel::before { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Важно: фон и анти-белые зоны при "перетягивании" */
html, body{
  height:100%;
  margin:0;
  background:#070b17;          /* fallback, чтобы не вылезал белый фон */
  overscroll-behavior:none;     /* убирает bounce в Chromium/Firefox */
}

body{
  min-height:100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(var(--c-acc-1-rgb),.35), transparent 55%),
    radial-gradient(1100px 900px at 85% 15%, rgba(var(--c-acc-2-rgb),.22), transparent 55%),
    radial-gradient(900px 700px at 60% 90%, rgba(var(--c-acc-3-rgb),.18), transparent 55%),
    linear-gradient(180deg, var(--bg), #070b17 65%);
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; border:0; background:transparent; cursor:pointer; }

/* Обёртка страницы — держит высоту, чтобы снизу не появлялась "пустота" */
.page{
  min-height: calc(100vh - 0px);
  padding-bottom: 24px;
}

/* Общий контейнер (совпадает с HTML: class="container") */
/* Сайт шире + меньше отступы от краёв */
.container{
  width: min(1400px, calc(100vw - 32px)); /* по 16px с каждой стороны */
  margin: 0 auto;
}

/* 1) СТЕКЛЯННАЯ ПАНЕЛЬ (class="panel") */
/* Убраны backdrop-filter:blur и ::before filter:blur — оба ОЧЕНЬ дорого
   стоят браузеру (особенно Safari/macOS), а на странице 5-10 .panel,
   и каждая запускает re-paint всего слоя при скролле/анимации. */
.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border:1px solid var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}

.panel > *{ position:relative; }

/* 2) ВЕРХНЯЯ ПОЛОСА (header.topbar) */
.topbar{
  padding: 12px 0 8px; /* меньше воздуха */
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

/* Лого: <a class="logo"> ... */
.logo{
  display:flex;
  align-items:center;
  gap:28px;
}

.logo__mark{
  width:245px;
  height:245px;
  flex: 0 0 245px;
  border-radius:42px;
  background:
    radial-gradient(18px 18px at 28% 35%, rgba(255,255,255,.6), transparent 55%),
    conic-gradient(from 210deg, var(--brand), var(--brand2), var(--good), var(--brand));
  box-shadow: 0 14px 40px rgba(var(--c-acc-1-rgb),.30);
  border:1px solid rgba(255,255,255,.18);
  position:relative;
}

.logo__text{
  margin-left: 8px;
}

.logo__mark::after{
  content:"</>";
  position:absolute; inset:0;
  display:grid; place-items:center;
  font-family: var(--mono);
  font-weight:900;
  font-size:13px;
  color: rgba(9,12,25,.92);
}

.logo__text b{
  display:block;
  font-size:15px;
  letter-spacing:.2px;
}

.logo__text small{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
}

/* Поиск: <div class="search"> ... */
.search{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  background: var(--card);
  border:1px solid var(--stroke);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  min-width: 420px;
}

.search__icon{ opacity:.75; }

.search__input{
  flex:1;
  background:transparent;
  border:0;
  outline:0;
  color: var(--text);
  font-size:13px;
}

.search__kbd{
  font-family: var(--mono);
  font-size:11px;
  padding:4px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(234,240,255,.78);
}

/* Блок кнопок справа: <div class="topbar__actions"> */
.topbar__actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* 3) КНОПКИ (class="btn") */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  transition: transform .12s ease, border-color .12s ease;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.24);
}

/* В твоём HTML: class="btn btn--primary" */
.btn--primary{
  border-color: rgba(var(--c-acc-1-rgb),.55);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(255,255,255,.22), transparent 58%),
    linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.70), rgba(var(--c-acc-2-rgb),.28));
}

/* Точка внутри primary-кнопки: <span class="btn__dot"> */
.btn__dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(var(--c-acc-3-rgb),.14);
}

/* В твоём HTML: class="btn btn--ghost" */
.btn--ghost{
  border-color: rgba(var(--c-acc-1-rgb),.45);
  background: linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.28), rgba(var(--c-acc-2-rgb),.10));
}

/* семантическая danger-кнопка (delete и т.п.) — мягкий красный с
   адаптацией под светлую тему */
.btn--danger{
  color: #ff7a8a;
  border-color: rgba(255,80,100,.45);
}
.btn--danger:hover{
  border-color: rgba(255,80,100,.75);
  background: rgba(255,80,100,.08);
}
body.light .btn--danger{
  color: #c41a3a;
  border-color: rgba(196,26,58,.45);
}
body.light .btn--danger:hover{
  background: rgba(196,26,58,.08);
  border-color: rgba(196,26,58,.70);
}

/* 4) ОСНОВНАЯ СЕТКА: <div class="container layout"> */
.layout{
  margin: 6px auto 24px; /* меньше отступы => ближе к краям */
  display:grid;
  grid-template-columns: 300px 1fr;
  gap:12px; /* меньше расстояние между колонками */
}

/* 5) ЛЕВАЯ ПАНЕЛЬ: <aside class="sidebar panel"> */
.sidebar{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height: 660px;
}

.sidebar__nav{
  padding:12px;
  border-radius: var(--r2);
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sidebar__link{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.86);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.sidebar__link:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}

/* Активный пункт: class="sidebar__link is-active" */
.sidebar__link.is-active{
  border-color: rgba(var(--c-acc-1-rgb),.55);
  background: linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.35), rgba(var(--c-acc-2-rgb),.12));
}

.sidebar__card{
  padding:12px;
  border-radius: var(--r2);
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.12);
}

.sidebar__cardTitle{
  font-weight:900;
  font-size:13px;
  margin-bottom:10px;
}

/* ===== Виджет стрика в сайдбаре ===== */
.streak-card{
  display:block;
  margin-top: 10px;
  text-decoration:none;
  color: inherit;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  border-radius: var(--r2);
  padding: 12px;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.streak-card:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
}
.streak-card__top{
  display:flex;
  align-items:center;
  gap: 10px;
}
.streak-card__emoji{
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(255, 120, 40, .35));
}
.streak-card__counter{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
}
.streak-card__num{
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .3px;
}
.streak-card__label{
  font-size: 11px;
  opacity: .72;
  letter-spacing: .2px;
}
.streak-card__rec{
  margin-top: 8px;
  font-size: 11px;
  opacity: .68;
}
/* Активный стрик (сегодня уже есть активность) — светится */
.streak-card--active{
  border-color: rgba(255, 150, 60, .50);
  background:
    radial-gradient(220px 120px at 20% 0%, rgba(255,140,50,.18), transparent 70%),
    rgba(0,0,0,.22);
  box-shadow: 0 10px 26px rgba(255, 120, 40, .18);
}
/* Холодный стрик (current = 0) — огонёк тусклый */
.streak-card--cold .streak-card__emoji{
  opacity: .35;
  filter: none;
}
body.light .streak-card{
  background: rgba(16,32,63,.04);
  border-color: rgba(16,32,63,.14);
}
body.light .streak-card--active{
  background:
    radial-gradient(220px 120px at 20% 0%, rgba(255,140,50,.22), transparent 70%),
    rgba(16,32,63,.04);
}

/* Прогресс: .progress__row .progress__bar .progress__fill */
.progress__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  color: rgba(234,240,255,.78);
  font-size:12px;
}

.progress__row b{
  font-family: var(--mono);
  font-weight:900;
  color: rgba(234,240,255,.92);
}

.progress__bar{
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  margin-top:10px;
}

.progress__fill{
  height:100%;
  border-radius:999px;
  width:0%;
  background: linear-gradient(90deg, var(--brand), var(--brand2), var(--good));
  box-shadow: 0 10px 30px rgba(var(--c-acc-1-rgb),.25);
}

.progress__hint{
  margin-top:10px;
  color: var(--muted);
  font-size:12px;
  line-height:1.35;
}

/* Нижний совет: .sidebar__tip */
.sidebar__tip{
  margin-top:auto;
  padding:12px;
  border-radius: var(--r2);
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.12);
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.sidebar__tipBadge{
  width:34px;height:34px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  display:grid; place-items:center;
  font-family: var(--mono);
  font-weight:900;
}

.sidebar__tip p{
  margin:0;
  color: var(--muted);
  font-size:12px;
  line-height:1.35;
}

.sidebar__tip b{ color: rgba(234,240,255,.92); }

/* 6) ПРАВЫЙ КОНТЕНТ: <main class="content panel"> */
.content{
  padding:14px;
  min-height: 660px;
}

/* Hero: <section class="hero"> */
.hero{
  padding:16px;
  border-radius: var(--r);
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(var(--c-acc-1-rgb),.25), transparent 58%),
    radial-gradient(90% 140% at 100% 0%, rgba(var(--c-acc-2-rgb),.18), transparent 58%),
    rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.12);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap: wrap;
  gap:14px;
}

.hero__title{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
}

.hero__desc{
  margin:8px 0 0;
  color: var(--muted);
  font-size:12px;
  line-height:1.45;
  max-width: 70ch;
}

.hero__right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Общий CTA видеоразборов для обоих предметов.
   Вынесен из home.html, чтобы математика и информатика никогда не расходились
   по каскаду стилей и всегда использовали активную палитру пользователя. */
.home-video-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 16px;
  border-radius:16px;
  color:var(--text) !important;
  text-decoration:none;
  font-weight:900;
  white-space:nowrap;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(var(--c-acc-2-rgb),.32), transparent 58%),
    linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.26), rgba(var(--c-acc-2-rgb),.14)) !important;
  border:1px solid rgba(var(--c-acc-1-rgb),.44) !important;
  box-shadow:0 10px 28px rgba(var(--c-acc-1-rgb),.18), inset 0 1px 0 rgba(255,255,255,.10) !important;
  transition:transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.home-video-cta:hover,
.home-video-cta:focus-visible{
  transform:translateY(-2px);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(var(--c-acc-2-rgb),.42), transparent 58%),
    linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.34), rgba(var(--c-acc-2-rgb),.18)) !important;
  border-color:rgba(var(--c-acc-1-rgb),.58) !important;
  box-shadow:0 16px 34px rgba(var(--c-acc-1-rgb),.24), 0 0 0 4px rgba(var(--c-acc-2-rgb),.12) !important;
}
.home-video-cta:focus-visible{ outline:none; }
.home-video-cta__dot{
  width:9px;
  height:9px;
  flex:0 0 9px;
  border-radius:50%;
  background:var(--c-acc-1);
  box-shadow:0 0 0 5px rgba(var(--c-acc-1-rgb),.18);
}
body.light .home-video-cta{
  color:rgba(14,18,30,.92) !important;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(var(--c-acc-2-rgb),.22), transparent 58%),
    linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.16), rgba(var(--c-acc-2-rgb),.12)) !important;
  border-color:rgba(var(--c-acc-1-rgb),.28) !important;
  box-shadow:0 10px 24px rgba(var(--c-acc-1-rgb),.10), inset 0 1px 0 rgba(255,255,255,.80) !important;
}
body.light .home-video-cta:hover,
body.light .home-video-cta:focus-visible{
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(var(--c-acc-2-rgb),.28), transparent 58%),
    linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.22), rgba(var(--c-acc-2-rgb),.16)) !important;
  border-color:rgba(var(--c-acc-1-rgb),.36) !important;
  box-shadow:0 14px 30px rgba(var(--c-acc-1-rgb),.14), 0 0 0 4px rgba(var(--c-acc-2-rgb),.10) !important;
}
.home-video-cta--resume{
  color:inherit !important;
  background:rgba(255,255,255,.08) !important;
  box-shadow:none !important;
}
body.light .home-video-cta--resume{
  background:rgba(255,255,255,.86) !important;
  color:rgba(14,18,30,.92) !important;
}

/* Badge: <span class="badge"> <span class="badge__lamp"> */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;
  color: rgba(234,240,255,.86);
}

.badge__lamp{
  width:9px;height:9px;
  border-radius:999px;
  background: var(--c-acc-3, #ffcc66);
  box-shadow: 0 0 0 4px rgba(var(--c-acc-3-rgb, 255,204,102), .14);
}

/* 7) КАРТОЧКИ: <section class="cards"> <article class="card"> */
.cards{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}

.card{
  padding:14px;
  border-radius: var(--r);
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.22);
  background: rgba(0,0,0,.26);
}

.card__top{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}

.chip{
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.82);
}

.chip--soft{
  border-color: rgba(var(--c-acc-1-rgb),.35);
  background: rgba(var(--c-acc-1-rgb),.10);
}

a.chip,
.chip--link{
  text-decoration: none;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .12s ease, color .14s ease;
}
a.chip:hover,
.chip--link:hover{
  background: rgba(var(--c-acc-1-rgb),.18);
  border-color: rgba(var(--c-acc-1-rgb),.42);
  color: var(--c-acc-1);
  transform: translateY(-1px);
}
a.chip:active,
.chip--link:active{ transform: translateY(0); }

.card__title{
  margin:10px 0 6px;
  font-size:14px;
}
.card__title-link{
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .18s ease, color .15s ease, opacity .15s ease;
}

/* Заголовок задачи/варианта получает тематический акцент ТОЛЬКО
   если у пользователя выбрана не-original тёмная палитра
   (атрибут data-palette-dark на <html> ставит inline-скрипт base.html
   только при не-original значении). На базовой original тёмной —
   остаётся inherit (белый --text), как просил пользователь.
   На светлых темах тоже inherit. */
html[data-palette-dark] body:not(.light) .card__title-link{
  color: var(--c-acc-1);
}
html[data-palette-dark] body:not(.light) .card__title-link:hover{
  color: var(--c-acc-2);
}
.card__title-link:hover{
  background-size: 100% 1px;
  opacity: .92;
}
.card__title-link:focus-visible{
  outline: 2px solid rgba(var(--c-acc-1-rgb),.55);
  outline-offset: 3px;
  border-radius: 3px;
}

.card__text{
  margin:0;
  color: var(--muted);
  font-size:12px;
  line-height:1.45;
}

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

.meta{
  color: rgba(234,240,255,.72);
  font-size:12px;
}

/* 8) АДАПТИВ */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ min-height:auto; }
  .search{ min-width: 0; width: 100%; }
  .topbar__inner{ flex-wrap:wrap; }
  .cards{ grid-template-columns: 1fr; }
}

@media (max-width: 760px){
  .container{
    width: min(1400px, calc(100vw - 24px));
  }

  .layout{
    margin: 4px auto 18px;
    gap: 10px;
  }

  .content{
    order: 1;
    min-height: auto;
    padding: 12px;
  }

  .sidebar{
    order: 2;
    min-height: auto;
    padding: 12px;
    gap: 10px;
  }

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

  .sidebar__link{
    min-height: 48px;
    padding: 10px 8px;
    justify-content: center;
    text-align: center;
  }

  .sidebar__card,
  .sidebar__tip{
    padding: 10px;
  }

  .hero{
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .hero__desc{
    max-width: none;
  }

  .hero__right{
    width: 100%;
    justify-content: flex-start;
  }

  .card{
    padding: 12px;
  }

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

  .result-head{
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .result-chip{
    position: static;
    align-self: flex-start;
  }

  .result-grid{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .result-grid--head{
    display: none;
  }

  .status-col{
    justify-content: flex-start;
  }
}

@media (max-width: 560px){
  .container{
    width: min(1400px, calc(100vw - 20px));
  }

  .topbar{
    padding: 10px 0 6px;
  }

  .topbar__inner{
    gap: 10px;
    align-items: flex-start;
  }

  .logo{
    gap: 18px;
    align-items: flex-start;
  }

  .logo__mark{
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
    border-radius: 28px;
  }

  .logo__text b{
    font-size: 14px;
  }

  .logo__text small{
    font-size: 11px;
  }

  .hero__title{
    font-size: 17px;
  }

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

  .sidebar__cardTitle,
  .result-title{
    font-size: 24px;
  }

  .result-subtitle{
    font-size: 16px;
  }
}

.result-card{
  margin-top: 16px;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.result-head{
  position: relative;
  padding-right: 160px;
}

.result-title{
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
}

.result-subtitle{
  margin-top: 6px;
  font-size: 18px;
  opacity: .85;
}

.result-chip{
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 700;
}

.result-chip .dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-acc-2, #f4c84f);
  box-shadow: 0 0 0 4px rgba(var(--c-acc-2-rgb, 244,200,79), .15);
}

.result-grid{
  display: grid;
  grid-template-columns: 90px 1fr 1fr 160px;
  gap: 14px;
  align-items: center;
}

.result-grid--head{
  margin-top: 18px;
  padding: 10px 12px;
  font-size: 26px;
  font-weight: 800;
}

.result-row{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.status-col{
  display: flex;
  justify-content: flex-end;
}

.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  font-weight: 800;
}

.pill--ok{
  border-color: rgba(45,200,130,0.32);
}

.pill--bad{
  border-color: rgba(255,80,100,0.32);
}

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

/* Общая плашка */
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: background .2s ease, border-color .2s ease;
}

/* Верно — зелёная (мягче, без жёсткого неона; читается на любой палитре) */
.pill--ok {
  color: #5cd699;
  border: 1px solid rgba(45, 200, 130, 0.55);
  background: rgba(45, 200, 130, 0.08);
  box-shadow:
    0 0 8px  rgba(45, 200, 130, 0.32),
    0 0 18px rgba(45, 200, 130, 0.18),
    inset 0 0 8px rgba(45, 200, 130, 0.12);
}

/* Ошибка — красная (мягче) */
.pill--bad {
  color: #ff7a8a;
  border: 1px solid rgba(255, 80, 100, 0.60);
  background: rgba(255, 80, 100, 0.08);
  box-shadow:
    0 0 8px  rgba(255, 80, 100, 0.32),
    0 0 18px rgba(255, 80, 100, 0.18),
    inset 0 0 8px rgba(255, 80, 100, 0.12);
}

/* ==========================================================
   Универсальный safety-net для белого текста на акцентном фоне
   (variant-chip, vl-tab--active, cm__btn--yes.cm-active и т.п.)
   На ярких темах (Forest, Aurora, Ocean) белый сам по себе
   даёт <2:1 на светло-зелёном/циановом акценте — text-shadow
   создаёт тёмный halo и поднимает читаемость.
   ========================================================== */
.variant-chip,
.vl-tab--active,
.cm__btn--yes.cm-active{
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}

/* ========================================================
   КОНФЕТТИ при правильном ответе
   ======================================================== */
.confetti-canvas{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.mobile-dock{
  display: none;
}

/* ==========================================================
   MOBILE COMFORT LAYER
   Главное для учеников с телефона: без горизонтального скролла,
   крупные зоны нажатия, удобные формы ответов, читаемые карточки
   и видео, которое не ломает ширину страницы.
   ========================================================== */
@media (max-width: 860px){
  html{
    overflow-x: clip;
    scroll-padding-top: 76px;
  }

  body{
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
  }

  .page{
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .container{
    width: min(100% - 20px, 720px) !important;
  }

  .topbar{
    position: sticky !important;
    top: 0;
    z-index: 800 !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 0 7px;
    background:
      linear-gradient(180deg, rgba(11,16,32,.94), rgba(11,16,32,.76));
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  body.light .topbar{
    background:
      linear-gradient(180deg, rgba(248,251,255,.94), rgba(248,251,255,.78));
    border-bottom-color: rgba(20,30,60,.10);
  }

  .topbar__inner{
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px;
  }

  .logo{
    min-width: 0;
    gap: 9px !important;
  }

  .logo__mark{
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
    border-radius: 11px !important;
  }

  .logo__text{
    min-width: 0;
    margin-left: 0 !important;
  }

  .logo__text b{
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .logo__text small{
    display: none;
  }

  .topbar__actions{
    width: auto !important;
    margin-left: auto;
    justify-content: flex-end !important;
    gap: 7px !important;
    flex: 0 0 auto;
  }

  .theme-toggle{
    min-height: 42px;
    padding: 6px 8px !important;
    gap: 7px !important;
  }

  .theme-icon{
    width: 17px !important;
    font-size: 15px !important;
  }

  .profile-btn,
  .burger-btn{
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px;
  }

  .burger-wrap{
    position: relative;
  }

  .burger-panel{
    position: fixed !important;
    top: calc(58px + env(safe-area-inset-top, 0px)) !important;
    right: 10px !important;
    left: 10px !important;
    z-index: 1200 !important;
    width: auto !important;
    min-width: 0 !important;
    max-height: min(74vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px !important;
    padding: 8px !important;
  }

  .burger-item{
    min-height: 48px;
    padding: 12px 13px !important;
    white-space: normal !important;
    line-height: 1.2;
  }

  .layout{
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    margin-top: 8px !important;
  }

  .content,
  .sidebar,
  .panel{
    min-width: 0;
  }

  .content{
    padding: 11px !important;
    border-radius: 18px !important;
  }

  .sidebar{
    padding: 10px !important;
    border-radius: 18px !important;
  }

  .sidebar__nav{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 8px !important;
    gap: 7px !important;
  }

  .sidebar__link{
    min-height: 46px !important;
    padding: 9px 8px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    line-height: 1.15;
    text-align: center;
    justify-content: center;
    overflow-wrap: anywhere;
  }

  .sidebar__link:hover,
  body.light .sidebar__link:hover,
  body:not(.light) .sidebar__link:hover{
    transform: none;
  }

  .hero{
    padding: 14px !important;
    border-radius: 18px !important;
    gap: 12px !important;
  }

  .hero__title{
    font-size: 20px !important;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .hero__desc,
  .small-note,
  .meta{
    font-size: 13px !important;
    line-height: 1.45;
  }

  .hero__right{
    width: 100%;
    justify-content: stretch !important;
    gap: 8px !important;
  }

  .hero__right .btn,
  .hero__right button,
  .hero__right form{
    min-width: 0;
  }

  .cards{
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .card{
    padding: 13px !important;
    border-radius: 18px !important;
  }

  body.light .card{
    border-radius: 18px !important;
  }

  .card:hover,
  body.light .card:hover{
    transform: none;
  }

  .card__top,
  .card__bottom,
  .card__title-row,
  .task-meta-bar,
  .task-answer-actions,
  .answer-actions,
  .filters-actions,
  .filter-chips-row,
  .pagination{
    gap: 8px !important;
  }

  .card__title{
    font-size: 16px !important;
    line-height: 1.25;
  }

  .card__text,
  .task-text,
  .task__full,
  .card__full,
  .card__snippet{
    font-size: 14px !important;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .card__bottom{
    align-items: stretch !important;
  }

  .btn,
  button,
  .chip,
  .variant-chip,
  .filter-chip__track,
  .vl-tab,
  .pill{
    min-height: 40px;
    align-items: center;
  }

  .btn,
  .chip,
  .variant-chip,
  .vl-tab,
  .pill{
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .btn{
    justify-content: center;
    gap: 6px;
    padding: 8px 11px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
    font-size: 13.5px;
  }

  .btn__dot{
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px rgba(var(--c-acc-3-rgb),.12);
  }

  input,
  select,
  textarea,
  .inputlike,
  .selectlike,
  .answer-cell,
  .variant-answer,
  .vl-weak-diff,
  .vl-weak-topic,
  .vh-input{
    min-height: 46px;
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  textarea{
    line-height: 1.45;
  }

  img,
  iframe,
  video,
  canvas,
  table{
    max-width: 100%;
  }

  .task-text table,
  .task__full table,
  .card__text table,
  .task-share-card__statement table{
    display: block !important;
    width: max-content !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .task-text :where(table),
  .task__full :where(table),
  .card__full :where(table),
  .card__text :where(table),
  .math-content :where(table){
    border-collapse: collapse;
    border-spacing: 0;
    margin: 12px auto;
    color: #15131a !important;
    background: #fff !important;
    border: 1px solid rgba(21, 19, 26, .78);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .08);
  }

  .task-text :where(th, td),
  .task__full :where(th, td),
  .card__full :where(th, td),
  .card__text :where(th, td),
  .math-content :where(th, td){
    border-color: rgba(21, 19, 26, .78) !important;
    color: #15131a !important;
    background: #fff !important;
    padding: 6px 8px;
    vertical-align: middle;
  }

  .task-text :where(img),
  .task__full :where(img),
  .card__full :where(img),
  .card__text :where(img),
  .math-content :where(img){
    max-width: 100% !important;
    height: auto;
    object-fit: contain;
  }

  .task-text :where(img[src*="/media/oge_imported_assets/math-oge_sdamgia_ru/"], img[src*="/media/oge_imported_assets/inf-oge_sdamgia_ru/"]),
  .task__full :where(img[src*="/media/oge_imported_assets/math-oge_sdamgia_ru/"], img[src*="/media/oge_imported_assets/inf-oge_sdamgia_ru/"]),
  .card__full :where(img[src*="/media/oge_imported_assets/math-oge_sdamgia_ru/"], img[src*="/media/oge_imported_assets/inf-oge_sdamgia_ru/"]),
  .card__text :where(img[src*="/media/oge_imported_assets/math-oge_sdamgia_ru/"], img[src*="/media/oge_imported_assets/inf-oge_sdamgia_ru/"]),
  .math-content :where(img[src*="/media/oge_imported_assets/math-oge_sdamgia_ru/"], img[src*="/media/oge_imported_assets/inf-oge_sdamgia_ru/"]){
    background: #fff;
    border: 1px solid rgba(21, 19, 26, .16);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
  }

  .task-text :where(img[src*="/media/oge_imported_assets/oge_sdamgia_ru/"]),
  .task__full :where(img[src*="/media/oge_imported_assets/oge_sdamgia_ru/"]),
  .card__full :where(img[src*="/media/oge_imported_assets/oge_sdamgia_ru/"]),
  .card__text :where(img[src*="/media/oge_imported_assets/oge_sdamgia_ru/"]),
  .math-content :where(img[src*="/media/oge_imported_assets/oge_sdamgia_ru/"]){
    width: auto !important;
    max-height: 3.4em;
    vertical-align: middle;
  }

  .task-text :where(center),
  .task__full :where(center),
  .card__full :where(center),
  .card__text :where(center),
  .math-content :where(center){
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .task__media,
  .card__media,
  .task-image,
  .video-solution__frame-wrap{
    max-width: 100%;
  }

  .video-solution{
    width: 100%;
  }

  .video-solution__topbar,
  .video-solution__actions,
  .video-timecode-tools,
  .video-resume,
  .vtl__legend{
    gap: 8px !important;
  }

  .video-solution__topbar{
    align-items: stretch !important;
  }

  .video-solution__top-actions,
  .video-solution__actions{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .video-solution__top-actions button,
  .video-solution__actions .btn,
  .video-solution__actions button,
  .vbtn-wrap{
    width: 100%;
    min-width: 0;
  }

  .vchapters,
  .vh-video-list,
  .vh-player-panel,
  .vh-video-card,
  .vh-sidebar{
    min-width: 0;
  }

  .vl-tabs,
  .nav-jumps{
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -2px;
    margin-right: -2px;
    padding: 6px !important;
  }

  .vl-tabs::-webkit-scrollbar,
  .nav-jumps::-webkit-scrollbar{
    display: none;
  }

  .vl-tab,
  .nav-jumps .btn{
    flex: 0 0 auto;
  }

  .vl-gen-wrap{
    padding: 12px 0 !important;
  }

  .vl-gen-card,
  .vl-weak-card{
    max-width: none !important;
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }

  .vl-diff-group{
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px !important;
  }

  .vl-diff-btn span{
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
  }

  .vl-weak-header{
    display: none !important;
  }

  .vl-weak-row{
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 10px !important;
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
  }

  body.light .vl-weak-row{
    border-color: rgba(20,30,60,.10);
    background: rgba(255,255,255,.58);
  }

  .vl-weak-num{
    grid-row: span 3;
    width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(var(--c-acc-1-rgb), .14);
  }

  .vl-weak-diff,
  .vl-weak-topic{
    width: 100%;
  }

  .profile-header,
  .attempt-top,
  .attempt-left,
  .grid2,
  .achievements__stats,
  .badge-grid,
  .filters-grid,
  .filters-grid--secondary{
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profile-header,
  .attempt-top,
  .attempt-left{
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
  }

  .profile-title{
    font-size: 24px !important;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .attempt-card,
  .ach-stat,
  .badge-tile{
    border-radius: 16px !important;
  }

  .attempt-card .pill,
  .attempt-left .pill{
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 560px){
  .container{
    width: min(100% - 14px, 540px) !important;
  }

  .content{
    padding: 9px !important;
  }

  .hero{
    padding: 12px !important;
  }

  .hero__title{
    font-size: 18px !important;
  }

  .hero__right .btn,
  .hero__right button,
  .task-answer-actions .btn,
  .task-answer-actions button,
  .answer-actions .btn,
  .answer-actions button,
  .filters-actions .btn,
  .filters-actions a,
  .pagination .btn,
  .card__bottom .btn{
    width: 100%;
    min-height: 38px;
    padding: 8px 10px !important;
    font-size: 13px;
  }

  .sidebar__nav{
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar__fixed{
    gap: 8px !important;
  }

  .card__top{
    justify-content: flex-start;
  }

  .chip,
  .variant-chip{
    font-size: 12px !important;
    min-height: 34px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .variant-chip__text{
    max-width: 100% !important;
  }

  .task-meta-bar .chip,
  .task-meta-bar .chip--soft,
  .task-meta-bar .variant-chip,
  .task-meta-bar .ai-btn{
    width: 100%;
  }

  .answer-grid,
  .answer-actions,
  .task-answer-actions,
  .video-solution__top-actions,
  .video-solution__actions,
  .vl-diff-group{
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .video-solution-title{
    font-size: 18px;
    line-height: 1.2;
  }

  .video-solution__headline{
    width: 100%;
  }

  .vl-tabs{
    margin-top: 12px !important;
  }

  .vl-tab{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .result-card,
  .panel{
    border-radius: 16px !important;
  }

  .result-title,
  .section-title,
  .vl-gen-title{
    font-size: 22px !important;
    line-height: 1.15;
  }
}

@media (max-width: 380px){
  .logo__text b{
    max-width: 104px;
  }

  .theme-toggle{
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .switch{
    width: 46px !important;
  }

  .switch input:checked + .slider:before{
    transform: translate(16px, -50%);
  }
}

/* ==========================================================
   MOBILE POLISH LAYER
   Вторая проходка по телефону: маленькие экраны, safe-area,
   длинные формулы/таблицы, модалки, видео, профиль и настройки.
   ========================================================== */
@media (max-width: 860px){
  html,
  body{
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  :where(a, button, input, select, textarea, label, .btn, .chip, .variant-chip){
    -webkit-tap-highlight-color: rgba(var(--c-acc-1-rgb), .18);
  }

  :where(input, select, textarea, button){
    font: inherit;
  }

  .topbar{
    box-shadow: 0 10px 26px rgba(0,0,0,.18);
  }

  body.light .topbar{
    box-shadow: 0 10px 24px rgba(90,120,180,.12);
  }

  .burger-panel.open{
    transform: translateY(0) scale(1) !important;
  }

  .burger-item{
    touch-action: manipulation;
  }

  .filters-grid,
  .filters-grid--secondary,
  .st-grid-2,
  .st-palette-grid,
  .st-font-grid,
  .st-pb-grid{
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .filters-grid > *,
  .filters-grid--secondary > *,
  .st-grid-2 > *,
  .st-palette-grid > *,
  .st-font-grid > *,
  .st-pb-grid > *{
    min-width: 0;
  }

  .fieldlabel,
  .st-label,
  .auth__label{
    font-size: 13px !important;
    line-height: 1.25;
  }

  .toggle-row,
  .toggle,
  .st-avatar-row,
  .st-sound-row,
  .st-row-actions,
  .st-actions{
    align-items: stretch !important;
  }

  .toggle,
  .st-avatar-row,
  .st-sound-row{
    width: 100%;
  }

  .show-separately,
  .st-sound-info,
  .st-avatar-ctrl{
    min-width: 0;
    line-height: 1.35;
  }

  .switch,
  .st-sound-toggle{
    min-width: 48px;
  }

  .card__top,
  .task-meta-bar{
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .card__top::-webkit-scrollbar,
  .task-meta-bar::-webkit-scrollbar{
    display: none;
  }

  .card__top .chip,
  .task-meta-bar .chip,
  .task-meta-bar .variant-chip{
    flex: 0 0 auto;
  }

  .chip--soft{
    min-width: 0;
  }

  .task-file-link{
    width: 100%;
    min-height: 52px;
    padding: 10px 12px !important;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.035);
  }

  body.light .task-file-link{
    border-color: rgba(20,30,60,.10);
    background: rgba(255,255,255,.62);
  }

  .task-file-link__text{
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  .card__files,
  .task-files,
  .task__files{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
  }

  .task-text,
  .task__full,
  .card__full,
  .card__text,
  .card__snippet,
  .task-share-card__statement{
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .task-text :where(pre, code),
  .task__full :where(pre, code),
  .card__full :where(pre, code),
  .card__text :where(pre, code){
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .task-text :where(.MathJax_Display, .katex-display),
  .task__full :where(.MathJax_Display, .katex-display),
  .card__text :where(.MathJax_Display, .katex-display),
  .card__full :where(.MathJax_Display, .katex-display){
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .task-text :where(table),
  .task__full :where(table),
  .card__text :where(table),
  .card__full :where(table){
    overscroll-behavior-x: contain;
  }

  .task-image,
  .card__media img,
  .task__media img{
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .task__media,
  .card__media{
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .answer-grid{
    gap: 8px !important;
  }

  .answer-gridwrap{
    flex: 1 1 100%;
  }

  #taskAnswerForm,
  #taskAnswerForm > *{
    max-width: 100%;
    min-width: 0;
  }

  #taskAnswerForm input[name="answer"],
  #taskAnswerForm textarea,
  #taskAnswerForm .answer-cell{
    width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .task-answer-actions{
    position: static !important;
    bottom: auto !important;
    z-index: auto;
    width: 100%;
    margin: 10px 0 0;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(11,16,32,.72);
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
  }

  body.light .task-answer-actions{
    background: rgba(250,252,255,.78);
    border-color: rgba(20,30,60,.10);
    box-shadow: 0 8px 18px rgba(80,110,160,.08);
  }

  .answer-actions{
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-actions .btn,
  .answer-actions button,
  .actions-row .btn,
  .actions-row button,
  .task-answer-actions .btn,
  .task-answer-actions button{
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    justify-content: center;
  }

  .actions-row{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    align-items: stretch !important;
  }

  .variant-cards{
    gap: 10px !important;
  }

  .variant-cards .card,
  .section-title,
  .task-card-anchor{
    scroll-margin-top: 84px !important;
  }

  .variant-side-nav{
    position: sticky !important;
    top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    z-index: 120;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: -2px -2px 8px;
    padding: 8px !important;
    border-radius: 16px;
  }

  .variant-side-nav::-webkit-scrollbar{
    display: none;
  }

  .variant-side-nav__col{
    display: flex !important;
    flex-direction: row !important;
    gap: 6px;
    width: max-content;
  }

  .variant-side-nav__chip{
    flex: 0 0 auto;
    min-width: 44px;
    justify-content: center;
  }

  .vl-tabs,
  .nav-jumps{
    scroll-snap-type: x proximity;
  }

  .vl-tab,
  .nav-jumps .btn{
    scroll-snap-align: start;
  }

  .vl-weak-row{
    align-items: stretch !important;
  }

  .vl-weak-num{
    align-self: stretch;
  }

  .auth{
    min-height: auto !important;
    align-items: stretch !important;
    padding: 10px 0 calc(26px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .auth__card{
    width: 100% !important;
    padding: 18px 14px !important;
    border-radius: 20px !important;
  }

  .auth__title{
    font-size: 24px !important;
    line-height: 1.1;
  }

  .auth__subtitle,
  .auth__foot{
    line-height: 1.45;
  }

  .auth__password{
    gap: 8px !important;
  }

  .auth__eye,
  .aichat__close,
  .vnotes__clear{
    min-width: 44px;
    min-height: 44px;
  }

  .st-wrap{
    padding: 0 0 calc(34px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .st-hero{
    padding: 18px 4px 10px !important;
    text-align: left !important;
  }

  .st-title{
    font-size: 34px !important;
    line-height: 1.05;
  }

  .st-sub{
    font-size: 14px !important;
    line-height: 1.45;
  }

  .st-card{
    padding: 16px 14px !important;
    border-radius: 20px !important;
  }

  .st-card__title{
    font-size: 20px !important;
    line-height: 1.15;
  }

  .st-avatar-row{
    flex-direction: column;
  }

  .st-avatar-preview{
    width: 88px !important;
    height: 88px !important;
  }

  .st-file,
  .st-palette,
  .st-font{
    min-height: 52px;
  }

  .st-row-actions,
  .st-actions{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
  }

  .st-row-actions .btn,
  .st-actions .btn{
    width: 100%;
  }

  .st-toast{
    width: calc(100vw - 24px);
    max-width: 420px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .aichat-overlay{
    align-items: stretch !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .aichat{
    width: 100% !important;
    max-width: none !important;
    height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    max-height: none !important;
    border-radius: 20px !important;
  }

  .aichat__body{
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .aichat__foot{
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .aichat__input{
    max-height: 132px;
  }

  .video-solution{
    max-width: 100% !important;
  }

  .video-solution__frame-wrap.is-sticky-mini{
    width: min(260px, calc(100vw - 20px)) !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    right: 10px !important;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .video-timecode-tools{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .video-timecode-tools input{
    width: 100% !important;
  }

  .video-resume .btn-sm,
  .video-solution-closed .btn-sm{
    width: 100%;
    justify-content: center;
  }

  .vspeed-popover,
  .vquality-popover{
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    min-width: 0 !important;
    z-index: 9500 !important;
  }

  .vspeed-opt,
  .vquality-opt{
    min-height: 44px;
  }

  .rc-overlay{
    align-items: stretch !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .share-card-wrap,
  .task-share-card-wrap{
    width: 100% !important;
    max-width: 100% !important;
  }

  .mobile-dock{
    position: fixed;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 760;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-height: 62px;
    padding: 7px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    background:
      radial-gradient(160px 80px at 15% 0%, rgba(var(--c-acc-1-rgb),.22), transparent 65%),
      radial-gradient(160px 90px at 85% 100%, rgba(var(--c-acc-2-rgb),.18), transparent 64%),
      rgba(12,16,32,.94);
    box-shadow: 0 18px 46px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08);
    transform: translateY(0);
    opacity: 1;
    transition: transform .18s ease, opacity .18s ease;
  }

  body.light .mobile-dock{
    background:
      radial-gradient(180px 90px at 12% 0%, rgba(var(--c-acc-2-rgb),.26), transparent 64%),
      radial-gradient(160px 90px at 88% 100%, rgba(255,190,225,.30), transparent 64%),
      rgba(255,255,255,.92);
    border-color: rgba(80,100,160,.16);
    box-shadow: 0 18px 42px rgba(80,110,170,.18), inset 0 1px 0 rgba(255,255,255,.80);
  }

  .mobile-dock__item{
    min-width: 0;
    min-height: 48px;
    padding: 6px 4px 5px;
    border: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: rgba(234,240,255,.72);
    background: transparent;
    text-decoration: none;
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  body.light .mobile-dock__item{
    color: rgba(30,42,78,.66);
  }

  .mobile-dock__item svg{
    width: 22px;
    height: 22px;
    display: block;
  }

  .mobile-dock__item span{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dock__item.is-active,
  .mobile-dock__item[aria-expanded="true"]{
    color: #fff;
    background: linear-gradient(135deg, rgba(var(--c-acc-1-rgb),.88), rgba(var(--c-acc-2-rgb),.78));
    box-shadow: 0 10px 20px rgba(var(--c-acc-1-rgb),.22);
  }

  body.light .mobile-dock__item.is-active,
  body.light .mobile-dock__item[aria-expanded="true"]{
    color: #fff;
  }

  .mobile-dock__item:focus-visible{
    outline: 2px solid rgba(var(--c-acc-2-rgb),.75);
    outline-offset: 2px;
  }

  body.mobile-input-active .mobile-dock{
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(115% + env(safe-area-inset-bottom, 0px)));
  }

  body.mobile-input-active .task-answer-actions{
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

@media (hover: none) and (pointer: coarse){
  .btn:hover,
  .card:hover,
  .chip:hover,
  .variant-chip:hover,
  .sidebar__link:hover,
  .task-file-link:hover,
  .st-palette:hover,
  .st-font:hover,
  .compact-card-btn:hover,
  .video-size-btn:hover,
  .video-hide-btn:hover{
    transform: none !important;
    filter: none !important;
  }

  .btn:active,
  .chip:active,
  .variant-chip:active,
  .burger-item:active,
  .sidebar__link:active,
  .task-file-link:active,
  .mobile-dock__item:active{
    transform: scale(.985) !important;
  }
}

@media (max-width: 560px){
  .hero__right > div,
  .filters-actions,
  .card__bottom,
  .task-answer-actions{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .hero__right > div > *,
  .filters-actions > *,
  .task-answer-actions > *{
    width: 100%;
    min-width: 0;
  }

  .answer-actions{
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .actions-row{
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .card__top,
  .task-meta-bar{
    margin-left: -3px;
    margin-right: -3px;
    padding-left: 3px;
    padding-right: 3px;
  }

  .video-native-hint,
  .video-progress-badge{
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .vchap,
  .vnote,
  .vtl__chip{
    min-height: 44px;
  }

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

  .result-row{
    overflow: hidden;
  }

  .profile-header > div,
  .profile-header .btn{
    width: 100%;
  }

  .mobile-dock{
    left: 7px;
    right: 7px;
    padding: 5px;
    border-radius: 18px;
  }

  .mobile-dock__item{
    min-height: 42px;
    border-radius: 13px;
    font-size: 10.5px;
  }
}

@media (max-width: 360px){
  .logo__text{
    display: none;
  }

  .topbar__inner{
    gap: 6px !important;
  }

  .topbar__actions{
    gap: 6px !important;
  }

  .theme-toggle{
    min-width: 0;
  }

  .profile-btn,
  .burger-btn{
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px;
  }

  .mobile-dock{
    left: 6px;
    right: 6px;
    gap: 3px;
    min-height: 58px;
    padding: 5px;
  }

  .mobile-dock__item{
    min-height: 44px;
    padding-left: 2px;
    padding-right: 2px;
    font-size: 10px;
  }

  .mobile-dock__item svg{
    width: 20px;
    height: 20px;
  }

  .content,
  .sidebar,
  .card,
  .panel,
  .hero,
  .auth__card,
  .st-card{
    border-radius: 16px !important;
  }
}
