
/* Public visibility guard: hidden editor-only objects never flash before JS. */
[data-lav-user-visible="false"],
.lav-editor-public-hidden,
[hidden]{display:none!important}
:root{
  --bg:#fffaf1;
  --bg-2:#f7efff;
  --card:#ffffff;
  --text:#261235;
  --muted:#71627d;
  --accent:#7a2dbb;
  --accent-2:#f2a900;
  --border:rgba(122,45,187,.22);
  --soft-purple:rgba(122,45,187,.10);
  --soft-orange:rgba(242,169,0,.14);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(circle at 0 0, var(--soft-orange), transparent 34%),
    radial-gradient(circle at 100% 0, var(--soft-purple), transparent 34%),
    linear-gradient(180deg,var(--bg),#fff);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1050px;margin:0 auto;padding:0 16px}

.header{
  position:sticky;top:0;z-index:10;
  background:rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.header__row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0}
.logo{font-weight:800;letter-spacing:.5px;color:var(--accent)}

.nav{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* Чтобы hover верхнего меню не влиял на пункты в выпадашке */
.nav > a{
  padding:8px 10px;
  border-radius:10px;
}
.nav > a:hover{
  background:var(--soft-purple);
  text-decoration:none;
}



.page-title{margin:22px 0 12px}



/* =========================
   Главный экран (главная)
   ========================= */
.hero{padding:28px 0 22px}
.hero--home .hero__panel{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,250,241,.82));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: 0 18px 55px rgba(122,45,187,.12);
}
.hero__grid{
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: center;
}
.hero__content h1{
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 10px;
}
.lead{
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 54ch;
}
.hero__buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 22px; /* немного ниже, как просили */
}
.hero__art{
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
.hero__img{
  width: min(380px, 44vw);
  height: auto;
  filter: drop-shadow(0 18px 35px rgba(122,45,187,.18));
  opacity: .95;
  pointer-events:none;
  user-select:none;
}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:16px 0 28px}
.grid--2{grid-template-columns:repeat(2,minmax(260px,1fr));max-width:760px}
.card{
  background:linear-gradient(180deg,var(--card),#fffaf1);
  border:2px solid rgba(122,45,187,.46);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 12px 32px rgba(122,45,187,.12);
}
.card:hover{
  box-shadow: 0 14px 36px rgba(122,45,187,.16);
}
.card h2{margin:0 0 10px;font-size:20px}
.card--home{
  border-width: 2px;
  border-color: rgba(122,45,187,.48);
  box-shadow: 0 12px 32px rgba(122,45,187,.12);
}
.card--home:nth-child(even){ border-color: rgba(242,169,0,.78); }
.card--home:hover{
  box-shadow: 0 14px 36px rgba(122,45,187,.16);
}
.muted{color:var(--muted)}
.list{margin:10px 0 0;padding-left:18px;color:var(--muted)}
code{background:var(--soft-purple);padding:2px 6px;border-radius:8px}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--accent);color:#fff;
  padding:10px 14px;border-radius:12px;
  border:0;cursor:pointer;font-weight:700;
}
.btn:hover{filter:brightness(1.06)}
.btn--ghost{background:#fff;border:1px solid var(--border);color:var(--accent)}
.btn--small{padding:8px 10px;border-radius:10px;font-weight:650}

.footer{padding:18px 0;color:var(--muted);border-top:1px solid var(--border)}
.footer__row{display:flex;justify-content:space-between;gap:12px;align-items:center}

.toolbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;margin-top:14px
}
.toolbar__label{display:flex;gap:10px;align-items:center;color:var(--muted)}
select{
  background:var(--soft-purple);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:10px;
  padding:8px 10px;
}

.task__meta{color:var(--muted);font-size:13px;margin-top:8px}
.task__answer{display:none;margin-top:10px;padding-top:10px;border-top:1px solid var(--border);color:var(--muted)}
.task__actions{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}

/* =========================
   Dropdown "Материалы"
   ========================= */
.dropdown{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown__toggle{
  padding: 8px 10px;
  border-radius: 10px;
}
.dropdown__toggle:hover{
  background: var(--soft-purple);
  text-decoration: none;
}

.dropdown__menu{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;

  background: rgba(255,255,255,.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;

  box-shadow: 0 18px 45px rgba(122,45,187,.14);
  display: none;
  z-index: 999;
}

/* Невидимый "мостик" между кнопкой и меню */
.dropdown__menu::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-12px;
  height:12px;
}

.dropdown:hover .dropdown__menu,
.dropdown:focus-within .dropdown__menu{
  display: block;
}

.dropdown__item{
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  white-space: nowrap;
}

.dropdown__item:hover{
  background: rgba(242,169,0,.18);
  text-decoration: none;
}

/* Подменю (Средняя школа -> 5 класс) */
.dropdown__group{ position: relative; }

.dropdown__submenu{
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  min-width: 170px;

  background: rgba(255,255,255,.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;

  box-shadow: 0 18px 45px rgba(122,45,187,.14);
  display: none;
}

/* Невидимый "мостик" между пунктом и подменю справа */
.dropdown__submenu::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:-10px;
  width:10px;
}

.dropdown__group:hover .dropdown__submenu,
.dropdown__group:focus-within .dropdown__submenu{
  display: block;
}

@media (max-width: 900px){
  .hero__grid{grid-template-columns:1fr}
  .hero__art{justify-content:center}
  .hero__img{width:min(420px, 80vw)}
  .grid{grid-template-columns:1fr}
  .hero__content h1{font-size:32px}
}
/* =========================
   Конструктор заданий
   ========================= */
.builder__head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}

.builder__title{
  margin:0;
  font-size:20px;
}

.builder__hint{
  margin:10px 0 12px;
}

.builder__controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.builder__input{
  flex: 1 1 360px;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--soft-purple);
  color: var(--text);
  outline: none;
}

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

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

.builder__toggle{
  display:flex;
  gap:10px;
  align-items:center;
}

.builder__missing{
  margin-top:10px;
  color: var(--muted);
}

.builder__listWrap{
  margin: 14px 0 28px;
}

.builder__list{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.builderTask__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.builderTask__id{
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.builderTask__answer{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--border);
  color: var(--muted);
}

.builderTask__remove{
  white-space:nowrap;
}

/* Печать: показываем только конструктор и его список */


/* =========================
   Интерактивные зоны Text-страниц
   ========================= */
.theoryInteractiveZone{
  margin:28px 0 18px;
  padding:22px;
  border:3px solid rgba(122,45,187,.85);
  background:linear-gradient(135deg, #fff, #fbf7ff 55%, #fff8e6);
  box-shadow:0 16px 34px rgba(36,26,47,.13);
  color:#241a2f;
  box-sizing:border-box;
}
.theoryInteractiveZone__head{
  display:grid;
  gap:6px;
  margin-bottom:16px;
  border-bottom:2px solid rgba(122,45,187,.16);
  padding-bottom:13px;
}
.theoryInteractiveZone__tag{
  display:inline-flex;
  width:max-content;
  padding:5px 12px;
  border-radius:999px;
  background:rgba(242,169,0,.17);
  color:#d35a23;
  font-size:13px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.theoryInteractiveZone h2{
  margin:0;
  color:#7a2dbb;
  font-size:26px;
  border:0;
  padding:0;
}
.theoryInteractiveZone p{ margin:.3em 0; }
.factorizerWidget{ display:grid; gap:16px; }
.factorizerControls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:flex-start;
  padding:12px;
  border:1px solid rgba(122,45,187,.18);
  background:rgba(255,255,255,.82);
}
.factorizerControls label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  color:#7a2dbb;
}
.factorizerControls input{
  width:92px;
  padding:9px 10px;
  border:2px solid rgba(122,45,187,.25);
  border-radius:12px;
  font:inherit;
  font-weight:800;
  color:#241a2f;
  background:#fff;
}
.factorizerAuthorControl{ display:none !important; }
.factorizerControls button{
  border:2px solid rgba(122,45,187,.30);
  border-radius:12px;
  background:#fff;
  color:#241a2f;
  font:inherit;
  font-weight:900;
  padding:9px 14px;
  cursor:pointer;
  transition:transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.factorizerControls button:hover{ transform:translateY(-1px); border-color:#f2a900; color:#d35a23; }
.factorizerControls button[data-factor-auto]{ background:#7a2dbb; color:#fff; border-color:#7a2dbb; }
.factorizerStage{
  display:grid;
  grid-template-columns:minmax(210px, .85fr) minmax(260px, 1.15fr);
  gap:18px;
  align-items:stretch;
}
.factorizerBoard{
  min-height:250px;
  display:grid;
  align-content:center;
  justify-items:center;
  gap:12px;
  padding:18px;
  border:2px solid rgba(242,169,0,.85);
  background:#fff;
}
.factorizerColumns{
  position:relative;
  display:grid;
  grid-template-columns:72px 42px;
  min-height:180px;
  align-content:start;
  column-gap:0;
  font-size:22px;
  line-height:1;
}
.factorizerColumns::after{
  content:'';
  position:absolute;
  left:72px;
  top:0;
  bottom:0;
  width:3px;
  border-radius:999px;
  background:#7a2dbb;
}
.factorizerCell{
  min-height:34px;
  padding:3px 10px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  opacity:0;
  transform:translateY(-8px);
  animation:factorCellIn .32s ease forwards;
  will-change:opacity, transform;
}
.factorizerCell--factor{
  justify-content:flex-start;
  color:#7a2dbb;
  font-weight:900;
}
.factorizerCell--active{ color:#d35a23; font-weight:900; }
.factorizerResult{
  min-height:62px;
  padding:8px 12px;
  border:2px solid rgba(122,45,187,.25);
  background:#fbf7ff;
  color:#241a2f;
  font-size:20px;
  font-weight:900;
  text-align:center;
  display:grid;
  align-content:center;
  gap:4px;
}
.factorizerResultLine{ line-height:1.2; }
.factorizerResultLine--compact{ font-size:18px; color:#7a2dbb; }
.factorizerExplain{
  padding:16px 18px;
  border:2px solid rgba(122,45,187,.22);
  background:#fff;
  box-shadow:0 8px 18px rgba(36,26,47,.07);
}
.factorizerExplain h3{ margin:0 0 8px; color:#7a2dbb; }
.factorizerExplain p{ margin:0 0 10px; font-weight:750; }
.factorizerExplain ol{ margin:0; padding-left:24px; display:grid; gap:7px; }
.factorizerExplain li{ padding-left:3px; }
.factorizerExplain li.is-current{ color:#d35a23; font-weight:900; }
@keyframes factorCellIn{ to{ opacity:1; transform:translateY(0); } }
@media (max-width:760px){
  .factorizerStage{ grid-template-columns:1fr; }
  .factorizerControls{ align-items:stretch; }
  .factorizerControls button{ flex:1 1 120px; }
}
@media print{
  .factorizerControls{ display:none !important; }
  .theoryInteractiveZone{ break-inside:avoid; }
}

@media print{
  .header, .footer, .no-print{ display:none !important; }
  body{ background:#fff !important; color:#000 !important; }
  .container{ max-width:none; }
  .card{
    background:#fff !important;
    color:#000 !important;
    box-shadow:none !important;
    border:1px solid #ccc !important;
  }
  .muted{ color:#333 !important; }
  .btn, button, input, select{ display:none !important; } /* кнопки/инпуты убираем при печати */
  .builder__missing{ display:none !important; }
}
.eq { margin: 10px 0; }

.taskHead{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:baseline;
}

.taskTitle{ margin:0; font-size:18px; }
.taskNo{ font-size:13px; }

.taskBlock{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--border);
}

/* ===== Доп. стили для конструктора по клику ===== */
.taskHead{ align-items:flex-start; }
.taskHead__left{ display:flex; flex-direction:column; gap:4px; }

.btn[disabled]{
  opacity: .55;
  cursor: not-allowed;
  filter: none;
}

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

/* =========================
   Список заданий: по одному на строку + пагинация
   ========================= */
.taskGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
  margin:16px 0 10px;
}

.pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin: 0 0 28px;
}

.pagination__btn{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--soft-purple);
  color:var(--text);
  cursor:pointer;
  font-weight:650;
}

.pagination__btn:hover{ filter:brightness(1.06); }

.pagination__btn[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

.pagination__btn--active{
  background:var(--accent);
  color:#fff;
  border-color:transparent;
}

.pagination__dots{
  color:var(--muted);
  padding:0 4px;
}



/* =========================
   Аккордеон тем (Задания)
   ========================= */
.accordion{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:16px 0 28px;
}

.topicAcc{
  border-radius:18px;
  border:1px solid var(--border);
  overflow:hidden;
  background: radial-gradient(1200px 400px at 20% 0%, var(--soft-orange), rgba(255,255,255,0)) ,
              linear-gradient(180deg,#fff,#fbf7ff);
}

.topicAcc__summary{
  list-style:none;
  padding:18px 18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:26px;
  font-weight:800;
}

.topicAcc__summary::-webkit-details-marker{ display:none; }

.topicAcc__right{
  display:flex;
  align-items:center;
  gap:12px;
}

.topicAcc__link{
  font-size:14px;
  font-weight:650;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,250,241,.85);
  color: var(--text);
  text-decoration:none;
  opacity:.95;
}

.topicAcc__link:hover{ filter:brightness(1.08); }

.topicAcc__chev{
  width:14px;
  height:14px;
  border-right:2px solid var(--accent);
  border-bottom:2px solid var(--accent);
  transform:rotate(45deg);
  transition:transform .18s ease;
}

.topicAcc[open] .topicAcc__chev{ transform:rotate(-135deg); }

.topicAcc__body{
  padding:14px 16px 16px;
  border-top:1px solid var(--border);
}

.accTask{
  padding:12px 0;
  border-bottom:1px solid rgba(122,45,187,.12);
}

.accTask:last-child{ border-bottom:0; }

.accTask__top{
  display:grid;
  grid-template-columns: 70px 1fr 120px;
  gap:12px;
  align-items:center;
}

.accTask__no{
  color: var(--muted);
  font-weight:650;
}

.accTask__eq{
  display:flex;
  justify-content:center;
}

.accTask__add{
  justify-self:end;
}

.accTask__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}


/* Подразделы (внутри темы) */
.subAcc{
  margin-top:12px;
  border-radius:16px;
  border:1px solid rgba(122,45,187,.16);
  background: rgba(255,250,241,.55);
}

.subAcc__summary{
  font-size:20px;
  padding:14px 14px;
}

.subAcc__body{
  padding:12px 14px 14px;
}

.pageHead{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  margin:18px 0 12px;
}

.backLink{
  display:inline-block;
  margin-bottom:6px;
  color: var(--muted);
  text-decoration:none;
}

.backLink:hover{ color: var(--text); }

@media (max-width: 720px){
  .topicAcc__summary{ font-size:22px; }
  .accTask__top{ grid-template-columns: 54px 1fr 100px; }
}


/* ===== Конструктор: группировка выбранных заданий по темам ===== */
.builderGroup{ margin-top: 18px; }
.builderGroup:first-child{ margin-top: 0; }
.builderGroup__title{
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 18px;
}
.builderGroup__list{ display: grid; gap: 12px; }


/* ===== Материалы: список тем теории ===== */
.topicList{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width: 520px;
}

.topicBtn{
  display:block;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(122,45,187,.50);
  background: rgba(255,255,255,.76);
  color: var(--text);
  text-decoration:none;
  font-weight: 650;
  text-align:center;
}

.topicBtn:hover{
  background: rgba(242,169,0,.18);
  border-color: rgba(242,169,0,.95);
}


/* ===== Материалы: файлы темы ===== */
.filesList{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.fileItem{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(122,45,187,.16);
  background: rgba(255,255,255,.78);
}

.fileItem__name{
  font-weight: 650;
}

.fileItem__meta{
  color: var(--muted);
  font-size: 13px;
}



/* =========================
   Материалы: карточки классов
   ========================= */
.materialLead{
  max-width: 760px;
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.55;
}

.classGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 42px;
  margin: 24px 0 34px;
}

.classCard{
  --class-accent: var(--accent);
  --class-accent-2: var(--accent-2);
  display:flex;
  flex-direction:column;
  gap: 20px;
  min-height: 430px;
  padding: 24px 20px 22px;
  border: 4px solid var(--class-accent);
  border-radius: 36px;
  background: rgba(255,255,255,.88);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(122,45,187,.10);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.classCard:hover{
  transform: translateY(-5px);
  text-decoration: none;
  box-shadow: 0 24px 54px rgba(122,45,187,.16);
}

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

.classCard:nth-child(even){
  --class-accent: var(--accent-2);
  --class-accent-2: var(--accent);
}

.classCard__preview{
  height: 196px;
  border: 4px solid var(--class-accent-2);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(122,45,187,.08), rgba(242,169,0,.12));
  padding: 10px;
  overflow: hidden;
}

.classCard__preview img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  border-radius: 22px;
}

.classCard__body{
  display:grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items:start;
}

.classCard__title{
  margin: 0;
  min-width: 118px;
  font-size: 27px;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -.02em;
}

.classCard__topics{
  margin: 0;
  padding-left: 22px;
  font-size: 19px;
  line-height: 1.28;
}

.classCard__topics li{ margin-bottom: 4px; }
.classCard__topics li::marker{ color: var(--class-accent); }

.materialQuick{
  display:flex;
  gap: 12px;
  flex-wrap:wrap;
  margin: 10px 0 28px;
}

.materialQuick .btn--ghost{
  background: rgba(255,255,255,.84);
}

.section-title{
  margin: 30px 0 10px;
  font-size: 28px;
  line-height: 1.15;
}

.classDetail{
  display:grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
  gap: 18px;
  align-items:stretch;
  margin: 18px 0 28px;
}

.classDetail__hero{
  border: 4px solid rgba(122,45,187,.52);
  border-radius: 32px;
  background: rgba(255,255,255,.88);
  padding: 18px;
  box-shadow: 0 18px 42px rgba(122,45,187,.10);
}

.classDetail__hero img{
  width:100%;
  min-height:260px;
  object-fit:cover;
  border-radius: 24px;
  display:block;
  border: 4px solid rgba(242,169,0,.74);
}

.classDetail__panel{
  border: 2px solid rgba(242,169,0,.78);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,250,241,.86));
  padding: 22px;
  box-shadow: 0 18px 42px rgba(122,45,187,.10);
}

.classDetail__panel h2{
  margin-top:0;
  font-size: 26px;
}

@media (max-width: 980px){
  .classGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .classCard{ min-height: 410px; }
}

@media (max-width: 720px){
  .classGrid{ grid-template-columns: 1fr; }
  .classCard{ min-height: auto; padding: 18px; border-radius: 28px; }
  .classCard__preview{ height: 180px; border-radius: 24px; }
  .classCard__body{ grid-template-columns: 1fr; gap: 10px; }
  .classCard__title{ min-width: 0; font-size: 25px; }
  .classCard__topics{ font-size: 17px; }
  .classDetail{ grid-template-columns: 1fr; }
}

/* Цветовые акценты палитры проекта */
input, select, button{ accent-color: var(--accent); }
select, .builder__input{ background:#fff; }
.btn:hover, .pagination__btn:hover, .topicAcc__link:hover{ filter:brightness(1.04); }
.btn:focus-visible, .dropdown__toggle:focus-visible, .dropdown__item:focus-visible, .topicBtn:focus-visible, .pagination__btn:focus-visible, select:focus-visible, .builder__input:focus-visible{
  outline:2px solid var(--accent-2);
  outline-offset:2px;
}
.card:nth-child(even){ border-color: rgba(242,169,0,.78); }
.card--home:nth-child(even){ border-color: rgba(242,169,0,.78); }
.hero__panel{ border-color: rgba(122,45,187,.20); }
.dropdown__item{ color: var(--text); }
.dropdown__toggle:hover, .nav > a:hover{ color: var(--accent); }

/* =========================
   Элементы, добавленные визуальным редактором
   ========================= */
.lav-builder-card{
  margin: 12px 0;
}

.lav-builder-text{
  display:inline-block;
  margin:8px 0;
  padding:8px 12px;
  border-radius:12px;
  background:rgba(122,45,187,.08);
  font-weight:750;
}

.lav-builder-button{
  margin:8px 0;
}

.lav-builder-image{
  display:block;
  max-width:280px;
  height:auto;
  margin:10px 0;
  border-radius:18px;
}

.lav-shape{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:120px;
  min-height:70px;
  margin:8px;
  border:3px solid var(--accent);
  background:rgba(242,169,0,.16);
  color:var(--text);
  font-weight:800;
  border-radius:18px;
}

.lav-shape--circle{
  width:110px;
  height:110px;
  min-width:110px;
  min-height:110px;
  border-radius:999px;
}

.lav-shape--line{
  width:220px;
  min-width:0;
  min-height:0;
  height:4px;
  padding:0;
  border:0;
  background:var(--accent);
  border-radius:999px;
  overflow:visible;
  flex:0 0 auto;
}

.lav-shape--badge{
  min-height:42px;
  padding:8px 18px;
  border-color:var(--accent-2);
  background:#fffaf1;
}

.lav-formula{
  display:inline-flex;
  padding:8px 12px;
  margin:4px;
  border-radius:12px;
  border:1px solid rgba(122,45,187,.25);
  background:#fff;
  font-family:Georgia, 'Times New Roman', serif;
  font-size:20px;
}


.lav-document-body .lav-formula,
.lav-rich-text .lav-formula{
  display:inline-block;
  padding:0 2px;
  margin:0 1px;
  border:0;
  background:transparent;
  border-radius:4px;
  line-height:1;
  vertical-align:baseline;
  font-size:1em;
}
.lav-document-body .lav-formula .katex,
.lav-rich-text .lav-formula .katex{
  font-size:1em;
  line-height:1;
}
.lav-formula-after{
  display:inline;
  font-size:1px;
  line-height:1;
}

/* =========================
   Text-страницы для теоретических материалов
   ========================= */
.lav-doc-shell{
  min-height:calc(100vh - 84px);
  padding:42px 18px 70px;
  background:#eef0f5;
}
.lav-document-page{
  position:relative;
  width:min(100%, 900px);
  min-height:1180px;
  margin:0 auto;
  padding:74px 76px;
  background:#fff;
  border:1px solid rgba(122,45,187,.18);
  box-shadow:0 18px 48px rgba(21, 18, 35, .16);
  color:var(--text);
}
.lav-document-page::before{
  content:'';
  position:absolute;
  inset:18px;
  border:2px solid rgba(242,169,0,.28);
  border-radius:18px;
  pointer-events:none;
}
.lav-document-body{
  position:relative;
  z-index:1;
  min-height:930px;
  outline:none;
  font-size:18px;
  line-height:1.65;
}
.lav-document-body:empty::before{
  content:'Начните писать теоретический материал...';
  color:#9aa0ad;
}
.lav-document-body h1,
.lav-document-body h2,
.lav-document-body h3{
  color:var(--text);
  line-height:1.15;
  margin:1.1em 0 .5em;
}
.lav-document-body h1{font-size:42px}
.lav-document-body h2{font-size:30px}
.lav-document-body h3{font-size:23px}
.lav-document-body p{margin:.65em 0}
.lav-document-body blockquote{
  margin:18px 0;
  padding:14px 18px;
  border-left:5px solid var(--accent-2);
  background:#fff8e6;
  border-radius:0 16px 16px 0;
}
.lav-document-body img,
.lav-document-page img{
  max-width:100%;
  height:auto;
}
.lav-document-layer{
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
}
.lav-document-layer > *{
  pointer-events:auto;
}
.lav-document-float{
  position:absolute !important;
  margin:0 !important;
  cursor:move;
  touch-action:none;
}
@media (max-width:760px){
  .lav-doc-shell{padding:18px 10px 40px}
  .lav-document-page{padding:48px 30px;min-height:900px}
  .lav-document-page::before{inset:10px;border-radius:14px}
  .lav-document-body{font-size:16px;min-height:720px}
}


/* =========================
   5 класс: Text-страница НОД/НОК и карточка материала
   ========================= */
.section-head--compact{ margin-top:18px; }
.gradeTheoryShowcase{ margin: 30px 0 46px; }
.gradeTheoryGrid{ display:grid; grid-template-columns: minmax(280px, 520px); gap:22px; }
.gradeTheoryCard{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap:20px;
  padding:18px;
  border:3px solid rgba(242,169,0,.86);
  border-radius:28px;
  background:linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,250,241,.90));
  color:var(--text);
  text-decoration:none;
  box-shadow:0 18px 42px rgba(122,45,187,.12);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height:186px;
  align-items:center;
}
.gradeTheoryCard__body{ min-width:0; }
.gradeTheoryCard__body p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.gradeTheoryCard:hover{ transform:translateY(-4px); border-color:rgba(122,45,187,.85); box-shadow:0 26px 54px rgba(122,45,187,.18); text-decoration:none; }
.gradeTheoryCard__preview{
  min-height:150px;
  border:3px solid rgba(122,45,187,.78);
  border-radius:22px;
  background:linear-gradient(160deg, rgba(122,45,187,.11), rgba(242,169,0,.15));
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:14px;
}
.gradeTheoryCard__logo{
  position:absolute;
  top:18px;
  left:18px;
  width:48px;
  height:48px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:30px;
  color:#fff;
  background:var(--accent);
}
.gradeTheoryCard__lines{ position:absolute; inset:28px 20px auto 82px; display:grid; gap:9px; }
.gradeTheoryCard__lines i{ display:block; height:8px; border-radius:10px; background:rgba(242,169,0,.75); }
.gradeTheoryCard__preview strong{ font-size:23px; color:var(--accent); letter-spacing:.02em; }
.gradeTheoryCard__tag{ display:inline-flex; width:max-content; padding:6px 12px; border-radius:999px; background:rgba(122,45,187,.10); color:var(--accent); font-weight:850; font-size:13px; }
.gradeTheoryCard h3{ margin:12px 0 8px; font-size:25px; line-height:1.1; }
.gradeTheoryCard p{ margin:0 0 12px; color:var(--muted); line-height:1.45; }
.gradeTheoryCard__action{ font-weight:900; color:var(--accent); }

.lav-doc-shell--theory{
  background:linear-gradient(135deg, rgba(255,250,241,.96), rgba(248,242,255,.92));
  padding-top:32px;
}
.lav-theory-nodnok-page{
  width:min(100%, 1040px);
  min-height:1400px;
  padding:54px 58px 70px;
  border-color:rgba(122,45,187,.28);
}
.lav-theory-nodnok-page::before{ border-color:rgba(242,169,0,.48); }
.lav-theory-doc{ font-family:Inter, Arial, sans-serif; font-size:17px; line-height:1.52; color:#241a2f; }
.lav-theory-doc h1,.lav-theory-doc h2,.lav-theory-doc h3{ font-family:Inter, Arial, sans-serif; }
.theoryTitleBlock{
  position:relative;
  display:grid;
  grid-template-columns:90px 1fr auto;
  gap:20px;
  align-items:start;
  padding-bottom:18px;
  margin-bottom:22px;
  border-bottom:4px solid #7a2dbb;
}
.theoryTitleBlock__logo{ width:78px; height:78px; object-fit:contain; }
.theoryKicker{ margin:0 0 6px; text-align:left; color:#7a2dbb; font-weight:800; letter-spacing:.04em; }
.theoryTitleBlock h1{ margin:0; font-size:50px; line-height:.96; color:#7a2dbb; letter-spacing:.04em; text-transform:uppercase; }
.theoryTitleBlock h1 span{ color:#f2a900; font-size:52px; letter-spacing:.01em; }
.theoryLead{ max-width:760px; margin:14px 0 0; color:#6e6578; font-size:18px; }
.theoryTitleBlock__badge{ min-width:58px; height:58px; border-radius:0 0 0 18px; display:grid; place-items:center; color:#fff; background:#f2a900; font-size:22px; font-weight:900; box-shadow:0 8px 18px rgba(122,45,187,.18); }
.theorySection{ margin:22px 0 28px; }
.theorySection h2{ margin:0 0 12px; color:#7a2dbb; font-size:28px; border-bottom:2px solid rgba(122,45,187,.18); padding-bottom:7px; }
.theorySection h3{ margin:16px 0 8px; color:#7a2dbb; font-size:20px; }
.theoryDefinitionGrid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:14px 0; }
.theoryDefinitionCard{ padding:16px 18px; border:2px solid #7a2dbb; border-radius:0; background:#f4ecff; box-shadow:0 8px 16px rgba(36,26,47,.08); }
.theoryDefinitionCard--orange{ border-color:#f2a900; background:#fff8e6; }
.theoryDefinitionCard h3{ margin-top:0; }
.theoryExampleLine span{ color:#ed2c91; font-weight:900; }
.theoryNote{ display:flex; gap:16px; align-items:flex-start; padding:14px 18px; margin:16px 0; border:2px solid #ed2c91; background:#fff; box-shadow:0 8px 18px rgba(237,44,145,.08); }
.theoryNote span{ flex:0 0 24px; width:24px; height:24px; margin-top:4px; border-radius:50%; background:#f2a900; box-shadow:0 5px 10px rgba(242,169,0,.28); }
.theoryNote p{ margin:0; }
.theoryNote--purple{ border-color:#7a2dbb; background:#f8f2ff; }
.theoryTable{ width:100%; border-collapse:separate; border-spacing:0; margin:12px 0 20px; box-shadow:0 7px 18px rgba(36,26,47,.12); font-size:16px; }
.theoryTable th{ background:#dfcff1; color:#7a2dbb; font-weight:900; text-align:left; }
.theoryTable th,.theoryTable td{ border:1px solid rgba(36,26,47,.13); padding:11px 14px; vertical-align:top; }
.theoryTable tbody tr:nth-child(even) td{ background:#f7f3fb; }
.theoryTable tbody tr:nth-child(odd) td{ background:#fff; }
.theoryTable td:first-child{ color:#7a2dbb; font-weight:900; width:110px; }
.theorySteps{ display:grid; gap:9px; padding:12px 16px; border:2px solid #7a2dbb; background:#f4ecff; margin:12px 0 16px; }
.theorySteps div{ display:flex; gap:10px; align-items:flex-start; }
.theorySteps span{ color:#0e92d0; font-weight:900; font-size:20px; line-height:1; }
.theorySteps--compact{ grid-template-columns:1fr; }
.factorExamples{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin:16px 0; }
.factorBlock{ padding:14px; border:1px solid rgba(122,45,187,.18); background:#fff; box-shadow:0 8px 18px rgba(36,26,47,.08); }
.factorBlock h3{ margin:0 0 8px; color:#7a2dbb; }
.factorColumn{ position:relative; display:grid; grid-template-columns:62px 34px; width:max-content; margin:0 auto 8px; border-right:0; }
.factorDivider{ position:absolute; left:62px; top:0; bottom:0; width:3px; background:#7a2dbb; display:block; border-radius:999px; z-index:2; }
.factorColumn span,.factorColumn b{ min-height:28px; padding:1px 8px; }
.factorColumn b{ color:#7a2dbb; font-weight:900; }
.factorBlock p{ margin:8px 0 0; text-align:center; font-weight:800; }
.theoryFormulaCard{ max-width:560px; padding:18px 24px; margin:12px 0 16px; background:#fff; border-left:5px solid #7a2dbb; box-shadow:0 7px 16px rgba(36,26,47,.20); }
.theoryFormulaCard--orange{ border-left-color:#f2a900; }
.theoryFormulaCard p{ margin:7px 0; }
.theoryAnswer{ color:#ed2c91; font-weight:900; }
.euclidBox{ padding:14px 20px; border:2px solid #0e92d0; background:#eef7ff; margin:12px 0 16px; }
.euclidBox p{ margin:7px 0; font-weight:800; color:#0872a7; }
.euclidBox em{ color:#6e6578; font-weight:500; }
.bigFormula{ padding:18px 20px; margin:12px 0; text-align:center; font-size:26px; font-weight:900; border:3px solid #f2a900; background:#fff8e6; color:#7a2dbb; }
.useGrid,.memoGrid{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin:12px 0; }
.useGrid > div,.memoCard{ padding:16px 18px; border:2px solid rgba(122,45,187,.55); background:#fff; box-shadow:0 8px 18px rgba(36,26,47,.08); }
.useGrid h3,.memoCard h3{ margin-top:0; }
.memoCard--orange{ border-color:#f2a900; background:#fff8e6; }
.mistakesTable td:first-child{ color:#ed2c91; }
.mistakesTable td:nth-child(2){ color:#0b9b55; font-weight:800; }
.theoryFinalNote{ margin-top:18px; padding:16px 18px; border:3px solid #ed2c91; background:#fff; font-size:18px; }

/* ═══════════════════════════════════════════════
   Fraction pie-circle component
   Usage: <span class="frac-pie" style="--fn:3;--fd:8" data-label="3/8"><i></i></span>
   ═══════════════════════════════════════════════ */
.frac-pie{
  width:72px; height:72px;
  border-radius:50%;
  border:2px solid #7a2dbb;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  margin:0 4px;
  position:relative;
  background:#f4ecff;
  flex-shrink:0;
}
.frac-pie::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:conic-gradient(
    #7a2dbb calc(360deg * var(--fn) / var(--fd)),
    transparent 0
  );
}
.frac-pie i{
  position:absolute;
  inset:0;
  border-radius:50%;
  background:repeating-conic-gradient(
    transparent 0% calc(100% / var(--fd) - 2.2%),
    rgba(36,26,47,.32) calc(100% / var(--fd) - 2.2%) calc(100% / var(--fd))
  );
  z-index:1;
  pointer-events:none;
}
.frac-pie::after{
  content:attr(data-label);
  position:relative;
  z-index:2;
  font-weight:900;
  font-size:15px;
  color:#5f1f96;
  text-align:center;
  line-height:1.1;
}
.frac-pie[data-label=""]::after{ content:none; }

/* Compact variant for inline use */
.frac-pie--sm{ width:48px; height:48px; }
.frac-pie--sm::after{ font-size:12px; }

/* Row of pies for demonstrations */
.frac-pie-row{
  display:flex;
  align-items:center;
  gap:6px;
  margin:8px 0;
  flex-wrap:wrap;
}
.frac-pie-row .frac-pie__label{
  font-weight:700;
  color:#7a2dbb;
  margin:0 6px 0 2px;
}
.frac-pie::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:conic-gradient(
    #7a2dbb calc(360deg * var(--fn) / var(--fd)),
    transparent 0
  );
}
.frac-pie::after{
  content:attr(data-label);
  position:relative;
  z-index:1;
  font-weight:900;
  font-size:15px;
  color:#5f1f96;
  text-align:center;
  line-height:1.1;
}
.frac-pie[data-label=""]::after{ content:none; }

/* Segment lines via repeating stripes */
.frac-pie__lines{
  position:absolute;
  inset:0;
  border-radius:50%;
  background:repeating-conic-gradient(
    transparent 0% calc(100% / var(--fd)),
    rgba(122,45,187,.25) calc(100% / var(--fd))
  );
  mask:radial-gradient(circle,transparent 58%,#000 61%);
  -webkit-mask:radial-gradient(circle,transparent 58%,#000 61%);
  pointer-events:none;
}

/* Compact variant for inline use */
.frac-pie--sm{ width:48px; height:48px; }
.frac-pie--sm::after{ font-size:12px; }

/* Row of pies for demonstrations */
.frac-pie-row{
  display:flex;
  align-items:center;
  gap:6px;
  margin:8px 0;
  flex-wrap:wrap;
}
.frac-pie-row .frac-pie__label{
  font-weight:700;
  color:#7a2dbb;
  margin:0 6px 0 2px;
}

/* ═══════════════════════════════════════════════
   Custom PDF‑page classes (visual‑editor built)
   ═══════════════════════════════════════════════ */
.lav-nod-rebuilt-doc{ max-width:860px; margin:0 auto; padding:20px 0; color:#241a2f; font-size:17px; line-height:1.6; }
.lav-nod-rebuilt-doc h1{ font-size:42px; color:#7a2dbb; margin:0; }
.lav-nod-rebuilt-doc h2{ font-size:24px; color:#7a2dbb; margin:18px 0 8px; }
.lav-nod-rebuilt-doc h3{ font-size:18px; color:#5f1f96; margin:12px 0 4px; }
.nodPdfSheet{ background:#fff; border:2px solid rgba(122,45,187,.14); border-radius:20px; padding:38px 36px 32px; margin:0 0 24px; box-shadow:0 14px 36px rgba(36,26,47,.08); }
.nodPdfHeader{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding-bottom:16px; margin-bottom:18px; border-bottom:4px solid #7a2dbb; flex-wrap:wrap; }
.nodPdfKicker{ font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:#7a2dbb; margin-bottom:4px; }
.nodPdfTitle h1{ margin:0; font-size:48px; line-height:.94; color:#7a2dbb; text-transform:uppercase; }
.nodPdfTitle p{ margin:4px 0 0; font-size:28px; font-weight:700; color:#f2a900; }
.nodPdfPageNumber{ min-width:52px; height:52px; border-radius:10px 10px 0 10px; display:grid; place-items:center; background:#f2a900; color:#fff; font-size:24px; font-weight:900; }
.nodPdfLine{ width:100%; height:3px; background:linear-gradient(90deg,#7a2dbb 0%,#f2a900 100%); border-radius:999px; margin-top:4px; }
.nodPdfContent{ margin-top:8px; }
.nodLead{ font-size:18px; color:#6e6578; max-width:760px; margin-bottom:16px; }
.nodSectionTitle{ font-size:22px; font-weight:900; margin:22px 0 10px; padding-bottom:6px; border-bottom:2px solid; display:flex; align-items:center; gap:8px; }
.nodSectionTitle--violet{ color:#7a2dbb; border-color:rgba(122,45,187,.24); }
.nodSectionTitle--pink{ color:#ed2c91; border-color:rgba(237,44,145,.24); }
.nodDot{ width:12px; height:12px; min-width:12px; border-radius:50%; background:#7a2dbb; display:inline-block; }
.nodCutBox{ padding:18px 22px; border:2px solid; border-radius:16px; margin:14px 0; background:#fff; box-shadow:0 8px 20px rgba(36,26,47,.06); }
.nodCutBox--blue{ border-color:#0e92d0; background:#eef7ff; }
.nodCutBox--yellow{ border-color:#f2a900; background:#fff8e6; }
.nodExampleBlock{ display:flex; gap:14px; align-items:flex-start; padding:14px 18px; border:2px solid #7a2dbb; border-radius:14px; background:#f4ecff; margin:12px 0; }
.nodExampleBlock--blue{ border-color:#0e92d0; background:#eef7ff; }
.nodExampleBlock--yellow{ border-color:#f2a900; background:#fff8e6; }
.nodExampleBlock--pink{ border-color:#ed2c91; background:#fff5fa; }
.nodExampleNumber{ flex:0 0 36px; width:36px; height:36px; border-radius:50%; background:#7a2dbb; color:#fff; font-weight:900; font-size:16px; display:grid; place-items:center; }
.nodFormulaRow{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin:14px 0; }
.nodFormulaRow--four{ grid-template-columns:repeat(4,1fr); }
.nodEditableFormula{ display:inline-flex; }
.nodSteps{ display:grid; gap:8px; padding:12px 16px; border:2px solid #7a2dbb; border-radius:12px; background:#f4ecff; margin:12px 0; }
.nodSteps--pink{ border-color:#ed2c91; background:#fff5fa; }
.nodSteps>*{ display:flex; gap:10px; align-items:flex-start; }
.nodSteps>*::before{ counter-increment:step-nod; content:counter(step-nod); flex:0 0 28px; width:28px; height:28px; border-radius:50%; background:#7a2dbb; color:#fff; font-weight:900; font-size:14px; display:grid; place-items:center; }
.nodSteps--pink>*::before{ background:#ed2c91; }
.nodTable{ width:100%; border-collapse:separate; border-spacing:0; margin:12px 0 18px; box-shadow:0 7px 18px rgba(36,26,47,.10); font-size:16px; }
.nodTable th{ background:#dfcff1; color:#7a2dbb; font-weight:900; text-align:left; }
.nodTable th,.nodTable td{ border:1px solid rgba(36,26,47,.13); padding:11px 14px; }
.nodTable tbody tr:nth-child(even) td{ background:#f7f3fb; }
.nodTable tbody tr:nth-child(odd) td{ background:#fff; }
.nodMistakeGrid{ display:grid; gap:10px; margin:12px 0; }
.nodMistake{ padding:14px 18px; border:2px solid #ed2c91; border-radius:13px; background:#fff; font-size:16px; }
.nodMistake strong{ color:#ed2c91; }
.nodAnswer{ color:#ed2c91; font-weight:900; font-size:17px; }
.nodRuleMini{ padding:12px 18px; border:2px solid #7a2dbb; border-radius:12px; background:#f8f2ff; margin:10px 0; font-weight:800; color:#5f1f96; }
.nodMemo{ padding:18px 22px; border:3px solid #ed2c91; border-radius:16px; background:#fff; font-weight:800; margin:14px 0; }
.nodCompare{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:16px 0; }
.nodCompareCard{ padding:18px; border:2px solid #7a2dbb; border-radius:14px; background:#f4ecff; }
.nodCompareCard:last-child{ border-color:#f2a900; background:#fff8e6; }
.nodFactorGrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin:16px 0; }
.nodFactorBlock{ padding:14px; border:1px solid rgba(122,45,187,.24); border-radius:14px; background:#fff; text-align:center; }
.nodFactorColumn{ display:grid; grid-template-columns:56px 30px; width:max-content; margin:0 auto 6px; gap:1px 2px; justify-items:center; }
.nodFactorDivider{ grid-column:1/-1; height:2px; background:#7a2dbb; border-radius:999px; margin:3px 0; }
.nodTwoCols{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:12px 0; }
.nodThreeCols{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; margin:12px 0; }
@media(max-width:680px){
  .nodPdfSheet{ padding:20px 16px; margin:0 -8px 16px; border-radius:0; border-left:none; border-right:none; }
  .nodFormulaRow--four{ grid-template-columns:1fr 1fr; }
  .nodCompare,.nodTwoCols,.nodThreeCols,.nodFactorGrid{ grid-template-columns:1fr; }
}

@media (max-width: 820px){
  .gradeTheoryCard{ grid-template-columns:1fr; }
  .lav-theory-nodnok-page{ padding:42px 26px 52px; }
  .theoryTitleBlock{ grid-template-columns:64px 1fr; }
  .theoryTitleBlock__badge{ grid-column:1 / -1; width:max-content; height:auto; padding:8px 14px; border-radius:999px; }
  .theoryTitleBlock h1{ font-size:36px; }
  .theoryTitleBlock h1 span{ font-size:38px; }
  .theoryDefinitionGrid,.factorExamples,.useGrid,.memoGrid{ grid-template-columns:1fr; }
}


/* Text-page local editable objects inside the document */
.lav-document-body [data-lav-document-object="true"]{
  touch-action:none;
  transform-origin:center center;
}
.lav-document-body [data-lav-document-object="true"] p,
.lav-document-body [data-lav-document-object="true"] h1,
.lav-document-body [data-lav-document-object="true"] h2,
.lav-document-body [data-lav-document-object="true"] h3,
.lav-document-body [data-lav-document-object="true"] li,
.lav-document-body [data-lav-document-object="true"] td,
.lav-document-body [data-lav-document-object="true"] th,
.lav-document-body [data-lav-document-object="true"] span,
.lav-document-body [data-lav-document-object="true"] strong,
.lav-document-body [data-lav-document-object="true"] em{
  user-select:text;
  cursor:text;
}
.lav-document-body .factorDivider{
  cursor:move;
  user-select:none;
}
.lav-document-body [data-lav-document-object="true"][data-lav-hover-highlight="true"]:hover{
  box-shadow:0 0 0 3px rgba(242,169,0,.18), 0 8px 18px rgba(36,26,47,.10);
}
.lav-document-tail{
  min-height:56px;
  margin:18px 0 0 !important;
  padding:4px 0;
  outline:1px dashed transparent;
}
.lav-document-tail:focus{
  outline-color:rgba(122,45,187,.28);
}
.theoryClientActions{
  width:min(100%, 1040px);
  margin:24px auto 0;
  display:flex;
  justify-content:flex-end;
  padding:0 16px;
}
.theoryPrintButton{
  border:2px solid rgba(122,45,187,.25);
  border-radius:999px;
  background:#fff;
  color:#7a2dbb;
  font-weight:850;
  padding:10px 18px;
  box-shadow:0 10px 24px rgba(122,45,187,.10);
  cursor:pointer;
}
.theoryPrintButton:hover{ border-color:#f2a900; color:#d35a23; }

@page{
  size:A4;
  margin:12mm;
}
@media print{
  html, body{
    background:#fff !important;
  }
  .header,
  .theoryClientActions,
  .no-print{
    display:none !important;
  }
  .lav-doc-shell,
  .lav-doc-shell--theory{
    padding:0 !important;
    background:#fff !important;
  }
  .lav-document-page,
  .lav-theory-nodnok-page{
    width:auto !important;
    max-width:none !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    box-shadow:none !important;
    background:#fff !important;
  }
  .lav-document-page::before,
  .lav-theory-nodnok-page::before{
    display:none !important;
  }
  .lav-document-body,
  .lav-theory-doc{
    min-height:0 !important;
    font-size:11pt !important;
    line-height:1.42 !important;
    color:#1f1430 !important;
  }
  .theoryTitleBlock,
  .theorySection,
  .theoryDefinitionCard,
  .theoryNote,
  .theorySteps,
  .factorBlock,
  .theoryFormulaCard,
  .euclidBox,
  .bigFormula,
  .useGrid > div,
  .memoCard,
  .theoryFinalNote,
  table{
    break-inside:avoid-page;
    page-break-inside:avoid;
  }
  .theorySection{
    margin:12pt 0 16pt !important;
  }
  .theoryTitleBlock h1{
    font-size:30pt !important;
  }
  .theoryTitleBlock h1 span{
    font-size:31pt !important;
  }
  .theoryTable{
    box-shadow:none !important;
    font-size:9.5pt !important;
  }
  .lav-document-layer{
    pointer-events:none !important;
  }
  .lav-formula-after,
  .lav-document-tail[data-lav-document-tail="true"]{
    display:none !important;
  }
}

/* Extra editable components available from the Text-document toolbar */
.lav-document-body .lav-document-movable{
  position:relative;
  transform-origin:center center;
  touch-action:none;
}
.lav-document-body .lav-document-movable:focus{
  outline:2px solid rgba(122,45,187,.45);
  outline-offset:3px;
}
.lav-doc-symbol{
  display:inline-block;
  min-width:1.1em;
  text-align:center;
  font-weight:900;
  color:#7a2dbb;
}

/* New Text-document constructor objects are compact and movable by default. */
.lav-document-layer .lav-builder-text{
  width:220px;
  min-height:72px;
  max-width:none;
  box-sizing:border-box;
  white-space:normal;
}
.lav-document-layer .lav-document-block-float{
  max-width:none !important;
  margin:0 !important;
  box-sizing:border-box;
}
.lav-document-layer table.lav-document-block-float{
  width:460px;
}
.lav-document-layer .factorBlock.lav-document-block-float{
  width:260px;
}
.lav-document-layer .theoryDefinitionGrid.lav-document-block-float{
  width:520px;
}
.lav-document-layer .bigFormula.lav-document-block-float,
.lav-document-layer .theoryFormulaCard.lav-document-block-float{
  width:380px;
}

.theorySection.theoryInteractiveZone h2,
.lav-document-layer .theoryInteractiveZone h2{
  margin:0;
  color:#7a2dbb;
  font-size:26px;
  border:0;
  padding:0;
}
.lav-document-layer .theoryInteractiveZone{
  width:720px;
  max-width:none !important;
}

/* Responsive interactive factorization block. The inner animation scales with the resized document object. */
.theoryInteractiveZone[data-lav-interactive="factorization"]{
  --factorizer-scale:1;
  overflow:auto;
  resize:none;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .theoryInteractiveZone__head{
  gap:calc(8px * var(--factorizer-scale));
  margin-bottom:calc(18px * var(--factorizer-scale));
  padding-bottom:calc(14px * var(--factorizer-scale));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .theoryInteractiveZone__tag{
  padding:calc(5px * var(--factorizer-scale)) calc(13px * var(--factorizer-scale));
  font-size:calc(13px * var(--factorizer-scale));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] h2{
  font-size:calc(30px * var(--factorizer-scale));
  line-height:1.12;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] p{
  font-size:calc(17px * var(--factorizer-scale));
  line-height:1.35;
}
.factorizerWidget{
  gap:calc(18px * var(--factorizer-scale, 1));
}
.factorizerControls{
  gap:calc(12px * var(--factorizer-scale, 1));
  padding:calc(14px * var(--factorizer-scale, 1));
  border-radius:calc(14px * var(--factorizer-scale, 1));
}
.factorizerControls label{
  font-size:calc(16px * var(--factorizer-scale, 1));
}
.factorizerControls input{
  width:calc(100px * var(--factorizer-scale, 1));
  padding:calc(10px * var(--factorizer-scale, 1)) calc(12px * var(--factorizer-scale, 1));
  border-radius:calc(12px * var(--factorizer-scale, 1));
}
.factorizerControls button{
  min-width:calc(118px * var(--factorizer-scale, 1));
  padding:calc(11px * var(--factorizer-scale, 1)) calc(18px * var(--factorizer-scale, 1));
  border-radius:calc(14px * var(--factorizer-scale, 1));
  font-size:calc(17px * var(--factorizer-scale, 1));
}
.factorizerStage{
  grid-template-columns:minmax(calc(260px * var(--factorizer-scale, 1)), .9fr) minmax(calc(280px * var(--factorizer-scale, 1)), 1.1fr);
  gap:calc(20px * var(--factorizer-scale, 1));
}
.factorizerBoard{
  min-height:calc(280px * var(--factorizer-scale, 1));
  gap:calc(16px * var(--factorizer-scale, 1));
  padding:calc(22px * var(--factorizer-scale, 1));
  border-width:calc(2px * var(--factorizer-scale, 1));
}
.factorizerColumns{
  grid-template-columns:calc(96px * var(--factorizer-scale, 1)) calc(58px * var(--factorizer-scale, 1));
  min-height:calc(215px * var(--factorizer-scale, 1));
  font-size:calc(27px * var(--factorizer-scale, 1));
}
.factorizerColumns::after{
  left:calc(96px * var(--factorizer-scale, 1));
  width:calc(4px * var(--factorizer-scale, 1));
}
.factorizerCell{
  min-height:calc(41px * var(--factorizer-scale, 1));
  padding:calc(4px * var(--factorizer-scale, 1)) calc(13px * var(--factorizer-scale, 1));
  animation:factorCellIn .42s cubic-bezier(.2,.85,.25,1) forwards;
}
.factorizerResult{
  min-height:calc(76px * var(--factorizer-scale, 1));
  padding:calc(11px * var(--factorizer-scale, 1)) calc(15px * var(--factorizer-scale, 1));
  border-radius:calc(12px * var(--factorizer-scale, 1));
  font-size:calc(23px * var(--factorizer-scale, 1));
  gap:calc(5px * var(--factorizer-scale, 1));
}
.factorizerResultLabel{
  color:#7a2dbb;
  font-size:calc(14px * var(--factorizer-scale, 1));
  text-transform:uppercase;
  letter-spacing:.06em;
}
.factorizerResultLine--compact{
  font-size:calc(21px * var(--factorizer-scale, 1));
}
.factorizerExplain{
  padding:calc(20px * var(--factorizer-scale, 1)) calc(22px * var(--factorizer-scale, 1));
  border-radius:calc(14px * var(--factorizer-scale, 1));
}
.factorizerExplain h3{
  font-size:calc(22px * var(--factorizer-scale, 1));
  margin-bottom:calc(10px * var(--factorizer-scale, 1));
}
.factorizerExplain p,
.factorizerExplain li{
  font-size:calc(17px * var(--factorizer-scale, 1));
  line-height:1.42;
}
.factorizerExplain ol{
  padding-left:calc(28px * var(--factorizer-scale, 1));
  gap:calc(8px * var(--factorizer-scale, 1));
}
.factorizerExplain li{
  animation:factorTextIn .32s ease both;
}
@keyframes factorTextIn{
  from{opacity:0; transform:translateX(8px)}
  to{opacity:1; transform:translateX(0)}
}
@media (max-width:760px){
  .factorizerStage{ grid-template-columns:1fr; }
}


/* =========================
   Интерактивная анимация: широкая карточка Text-документа
   ========================= */
.lav-document-body > .theoryInteractiveZone[data-lav-interactive="factorization"],
.lav-theory-doc > .theoryInteractiveZone[data-lav-interactive="factorization"],
.theoryInteractiveZone[data-lav-interactive="factorization"].lav-factorizer-wide{
  width:100% !important;
  max-width:none !important;
  margin:34px 0 28px !important;
  padding:calc(28px * var(--factorizer-scale, 1));
  border-radius:32px;
  overflow:visible;
  background:linear-gradient(135deg, #fffaf0 0%, #fff 50%, #f8f1ff 100%);
  box-shadow:0 22px 54px rgba(36,26,47,.14);
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .theoryInteractiveZone__head{
  max-width:none;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerWidget{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(calc(148px * var(--factorizer-scale, 1)), calc(190px * var(--factorizer-scale, 1)));
  grid-template-areas:"stage controls";
  align-items:stretch;
  gap:calc(26px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls{
  grid-area:controls;
  flex-direction:column;
  flex-wrap:nowrap;
  align-items:stretch;
  justify-content:center;
  align-self:stretch;
  gap:calc(20px * var(--factorizer-scale, 1));
  padding:0;
  border:0;
  background:transparent;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerAuthorControl{
  display:none !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls button{
  width:100%;
  min-height:calc(74px * var(--factorizer-scale, 1));
  padding:calc(16px * var(--factorizer-scale, 1)) calc(18px * var(--factorizer-scale, 1));
  border-radius:calc(20px * var(--factorizer-scale, 1));
  font-size:calc(24px * var(--factorizer-scale, 1));
  line-height:1.05;
  box-shadow:0 12px 26px rgba(122,45,187,.16);
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls button[data-factor-next]{
  background:#fff;
  color:#241a2f;
  border-color:rgba(122,45,187,.24);
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls button[data-factor-auto]{
  background:#7a2dbb;
  color:#fff;
  border-color:#7a2dbb;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerStage{
  grid-area:stage;
  grid-template-columns:minmax(calc(250px * var(--factorizer-scale, 1)), .78fr) minmax(calc(330px * var(--factorizer-scale, 1)), 1.22fr);
  gap:calc(22px * var(--factorizer-scale, 1));
  min-width:0;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  min-height:calc(330px * var(--factorizer-scale, 1));
  border-radius:calc(18px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard{
  border-width:calc(3px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns{
  grid-template-columns:calc(106px * var(--factorizer-scale, 1)) calc(64px * var(--factorizer-scale, 1));
  min-height:calc(238px * var(--factorizer-scale, 1));
  font-size:calc(31px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns::after{
  left:calc(106px * var(--factorizer-scale, 1));
  width:calc(5px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerCell{
  min-height:calc(44px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResult{
  width:min(100%, calc(300px * var(--factorizer-scale, 1)));
  min-height:calc(88px * var(--factorizer-scale, 1));
  font-size:calc(27px * var(--factorizer-scale, 1));
  box-shadow:0 10px 22px rgba(122,45,187,.10);
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResultLine--compact{
  font-size:calc(24px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain h3{
  font-size:calc(25px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain p,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain li{
  font-size:calc(19px * var(--factorizer-scale, 1));
  line-height:1.5;
}
.lav-document-layer .theoryInteractiveZone[data-lav-interactive="factorization"]{
  width:840px;
  max-width:none !important;
}
@media (max-width:920px){
  .theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerWidget{
    grid-template-columns:1fr;
    grid-template-areas:"stage" "controls";
  }
  .theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls{
    flex-direction:row;
    align-items:center;
  }
  .theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls button{
    flex:1 1 160px;
  }
  .theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerStage{
    grid-template-columns:1fr;
  }
}

/* =========================
   Fix: adaptive wide factorization card inside Text-pages
   ========================= */
.theoryInteractiveZone[data-lav-interactive="factorization"]{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  overflow:hidden;
  container-type:inline-size;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] *,
.theoryInteractiveZone[data-lav-interactive="factorization"] *::before,
.theoryInteractiveZone[data-lav-interactive="factorization"] *::after{
  box-sizing:border-box;
}
.lav-document-layer .theoryInteractiveZone[data-lav-interactive="factorization"]{
  width:min(100%, 840px);
  max-width:calc(100% - 24px) !important;
}
.lav-document-body > .theoryInteractiveZone[data-lav-interactive="factorization"],
.lav-theory-doc > .theoryInteractiveZone[data-lav-interactive="factorization"],
.theoryInteractiveZone[data-lav-interactive="factorization"].lav-factorizer-wide{
  width:100% !important;
  max-width:100% !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerWidget{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(calc(132px * var(--factorizer-scale, 1)), calc(180px * var(--factorizer-scale, 1)));
  grid-template-areas:"stage controls";
  min-width:0;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerStage{
  display:grid;
  grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr);
  min-width:0;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResult{
  min-width:0;
  max-width:100%;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerWidget,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerWidget{
  grid-template-columns:1fr;
  grid-template-areas:"stage" "controls";
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerControls,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerControls{
  flex-direction:row;
  align-items:center;
  justify-content:center;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerControls button,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerControls button{
  width:auto;
  flex:1 1 calc(145px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerStage{
  grid-template-columns:1fr;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerExplain{
  min-height:auto;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerColumns{
  margin-inline:auto;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls input,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerAuthorControl{
  display:none !important;
}


/* =========================
   Final fix: editable responsive factorization animation
   ========================= */
.theoryInteractiveZone[data-lav-interactive="factorization"]{
  box-sizing:border-box;
  max-width:100%;
  overflow:hidden;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerWidget{
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) minmax(calc(104px * var(--factorizer-scale, 1)), calc(146px * var(--factorizer-scale, 1))) !important;
  grid-template-areas:"stage controls" !important;
  gap:calc(16px * var(--factorizer-scale, 1)) !important;
  align-items:stretch;
  min-width:0;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerStage{
  display:grid !important;
  grid-area:stage;
  grid-template-columns:minmax(0, 0.92fr) minmax(0, 1.08fr) !important;
  gap:calc(14px * var(--factorizer-scale, 1)) !important;
  min-width:0;
  align-items:stretch;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls{
  grid-area:controls;
  display:flex !important;
  flex-direction:column;
  justify-content:center;
  align-items:stretch;
  gap:calc(12px * var(--factorizer-scale, 1)) !important;
  min-width:0;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerControls button{
  width:100%;
  min-width:0 !important;
  min-height:calc(48px * var(--factorizer-scale, 1)) !important;
  padding:calc(9px * var(--factorizer-scale, 1)) calc(12px * var(--factorizer-scale, 1)) !important;
  border-radius:calc(14px * var(--factorizer-scale, 1)) !important;
  font-size:calc(18px * var(--factorizer-scale, 1)) !important;
  line-height:1.05;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  box-sizing:border-box;
  width:100%;
  min-width:0 !important;
  max-width:100%;
  min-height:calc(245px * var(--factorizer-scale, 1)) !important;
  overflow:auto;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard{
  padding:calc(16px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  padding:calc(16px * var(--factorizer-scale, 1)) calc(18px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns{
  grid-template-columns:calc(86px * var(--factorizer-scale, 1)) calc(52px * var(--factorizer-scale, 1)) !important;
  min-height:calc(198px * var(--factorizer-scale, 1)) !important;
  font-size:calc(25px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns::after{
  left:calc(86px * var(--factorizer-scale, 1)) !important;
  width:calc(4px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerCell{
  min-height:calc(34px * var(--factorizer-scale, 1)) !important;
  padding:calc(3px * var(--factorizer-scale, 1)) calc(10px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResult{
  width:min(100%, calc(260px * var(--factorizer-scale, 1))) !important;
  min-height:calc(68px * var(--factorizer-scale, 1)) !important;
  font-size:calc(21px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResultLine--compact{
  font-size:calc(19px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain h3{
  font-size:calc(21px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain p,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain li{
  font-size:calc(16px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerWidget,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerWidget{
  grid-template-columns:1fr !important;
  grid-template-areas:"stage" "controls" !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerControls,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerControls{
  flex-direction:row;
  justify-content:center;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerControls button,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerControls button{
  width:auto;
  flex:0 1 calc(132px * var(--factorizer-scale, 1));
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerStage{
  grid-template-columns:1fr !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerExplain{
  min-height:calc(200px * var(--factorizer-scale, 1)) !important;
}
.lav-document-body .lav-interactive-factorizer .factorizerBoard[data-lav-document-object="true"],
.lav-document-body .lav-interactive-factorizer .factorizerExplain[data-lav-document-object="true"]{
  cursor:move;
  outline-offset:2px;
}
.lav-document-body .lav-interactive-factorizer .factorizerBoard[data-lav-document-object="true"][data-lav-hover-highlight="true"]:hover,
.lav-document-body .lav-interactive-factorizer .factorizerExplain[data-lav-document-object="true"][data-lav-hover-highlight="true"]:hover{
  outline:2px dashed rgba(122,45,187,.35);
}


/* Added: visual labels for dividend / divisor / quotient in factorization animation */
.factorizerBoard{ position:relative; }
.factorizerCell[data-factor-role]{ position:relative; z-index:2; }
.factorizerCell--hinted{
  outline:calc(2px * var(--factorizer-scale, 1)) solid rgba(242,169,0,.95);
  outline-offset:calc(1px * var(--factorizer-scale, 1));
  border-radius:999px;
  background:rgba(255,255,255,.92);
}
.factorizerCell--preview{ opacity:.95; }
.factorizerHints{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:4;
}
.factorizerHint{
  position:absolute;
  display:none;
  align-items:center;
  gap:calc(8px * var(--factorizer-scale, 1));
  transform:translate(-50%, -50%);
}
.factorizerHint__dot{
  width:calc(12px * var(--factorizer-scale, 1));
  height:calc(12px * var(--factorizer-scale, 1));
  border-radius:999px;
  background:#f2a900;
  box-shadow:0 0 0 calc(4px * var(--factorizer-scale, 1)) rgba(242,169,0,.23);
  flex:0 0 auto;
}
.factorizerHint__label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:calc(5px * var(--factorizer-scale, 1)) calc(11px * var(--factorizer-scale, 1));
  border-radius:999px;
  border:calc(2px * var(--factorizer-scale, 1)) solid rgba(122,45,187,.22);
  background:#fff;
  color:#5e2bb4;
  font-size:calc(14px * var(--factorizer-scale, 1));
  font-weight:800;
  line-height:1.1;
  white-space:nowrap;
  box-shadow:0 calc(6px * var(--factorizer-scale, 1)) calc(18px * var(--factorizer-scale, 1)) rgba(122,45,187,.10);
}
.factorizerHint--top-left{ transform:translate(-108%, -112%); }
.factorizerHint--top-right{ transform:translate(6%, -112%); }
.factorizerHint--bottom-left{ transform:translate(-108%, 28%); }
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerHint__label{
  font-size:calc(12px * var(--factorizer-scale, 1));
}


/* Fix factorization labels positioning and visibility */
.factorizerCell--hinted{
  outline:calc(3px * var(--factorizer-scale, 1)) solid #f2a900;
  outline-offset:calc(1px * var(--factorizer-scale, 1));
  border-radius:999px;
  background:rgba(255,255,255,.96);
}
.factorizerHints{ overflow:visible; }
.factorizerHint{
  position:absolute;
  display:none;
  transform:none;
}
.factorizerHint__dot{ display:none !important; }
.factorizerHint__label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:calc(4px * var(--factorizer-scale, 1)) calc(12px * var(--factorizer-scale, 1));
  border-radius:999px;
  border:calc(2px * var(--factorizer-scale, 1)) solid rgba(122,45,187,.22);
  background:#fff;
  color:#6f2ec7;
  font-size:calc(13px * var(--factorizer-scale, 1));
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  box-shadow:0 calc(5px * var(--factorizer-scale, 1)) calc(14px * var(--factorizer-scale, 1)) rgba(122,45,187,.10);
}
.factorizerHint--top-left{ margin-left:calc(-86px * var(--factorizer-scale, 1)); margin-top:calc(-34px * var(--factorizer-scale, 1)); }
.factorizerHint--top-right{ margin-left:calc(12px * var(--factorizer-scale, 1)); margin-top:calc(-34px * var(--factorizer-scale, 1)); }
.factorizerHint--bottom-left{ margin-left:calc(-96px * var(--factorizer-scale, 1)); margin-top:calc(-2px * var(--factorizer-scale, 1)); }
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerHint--top-left{ margin-left:calc(-72px * var(--factorizer-scale, 1)); }
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerHint--bottom-left{ margin-left:calc(-84px * var(--factorizer-scale, 1)); }

.factorizerHint--top-left,.factorizerHint--top-right,.factorizerHint--bottom-left{ transform:none !important; }


/* Fix: proper circular highlights only during annotation step */
.factorizerCell__value{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.75em;
  min-height:1.75em;
  line-height:1;
}
.factorizerCell--hinted{
  outline:none !important;
  background:transparent !important;
}
.factorizerCell--hinted .factorizerCell__value{
  padding:calc(6px * var(--factorizer-scale, 1)) calc(9px * var(--factorizer-scale, 1));
  min-width:calc(2.2em + 6px * var(--factorizer-scale, 1));
  min-height:calc(2.2em + 6px * var(--factorizer-scale, 1));
  border:calc(3px * var(--factorizer-scale, 1)) solid #f2a900;
  border-radius:999px;
  background:#fff;
  box-shadow:0 6px 16px rgba(242,169,0,.18);
}
.factorizerCell[data-factor-role="divisor"] .factorizerCell__value{
  color:#7a2dbb;
}
.factorizerCell[data-factor-role="dividend"] .factorizerCell__value,
.factorizerCell[data-factor-role="quotient"] .factorizerCell__value{
  color:#241a2f;
}
.factorizerHint__label{
  background:#fff7ea;
  border-color:rgba(122,45,187,.25);
}


/* Smooth annotation hints and circles without resizing numbers */
.factorizerCell__value{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:calc(2.2em + 6px * var(--factorizer-scale, 1));
  min-height:calc(2.2em + 6px * var(--factorizer-scale, 1));
  padding:calc(6px * var(--factorizer-scale, 1)) calc(9px * var(--factorizer-scale, 1));
  line-height:1;
  border:calc(3px * var(--factorizer-scale, 1)) solid transparent;
  border-radius:999px;
  background:transparent;
  box-shadow:none;
  transition:border-color .28s ease, background-color .28s ease, box-shadow .28s ease, opacity .28s ease;
}
.factorizerCell--hinted{
  outline:none !important;
  background:transparent !important;
}
.factorizerCell--hinted .factorizerCell__value{
  border-color:#f2a900;
  background:#fff;
  box-shadow:0 6px 16px rgba(242,169,0,.18);
}
.factorizerHint{
  position:absolute;
  display:flex !important;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(6px) scale(.96);
  transition:opacity .28s ease, transform .28s ease, visibility .28s ease;
}
.factorizerHint.is-visible{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}
.factorizerHint__label{
  background:#fff7ea;
  border-color:rgba(122,45,187,.25);
}
.factorizerHint--top-left{ margin-left:calc(-86px * var(--factorizer-scale, 1)); margin-top:calc(-34px * var(--factorizer-scale, 1)); }
.factorizerHint--top-right{ margin-left:calc(12px * var(--factorizer-scale, 1)); margin-top:calc(-34px * var(--factorizer-scale, 1)); }
.factorizerHint--bottom-left{ margin-left:calc(-96px * var(--factorizer-scale, 1)); margin-top:calc(-2px * var(--factorizer-scale, 1)); }
.factorizerHint--top-left.is-visible,.factorizerHint--top-right.is-visible,.factorizerHint--bottom-left.is-visible{ transform:translateY(0) scale(1) !important; }


/* Fix: factorization divider should keep a stable base length and explanation panel should fit more items */
.factorizerColumns{
  --factorizer-row-height: calc(36px * var(--factorizer-scale, 1));
  --factorizer-divider-rows: 5;
  grid-auto-rows: minmax(var(--factorizer-row-height), auto);
  min-height: calc(var(--factorizer-row-height) * 5);
}
.factorizerColumns::after{
  top: 0;
  bottom: auto !important;
  height: calc(var(--factorizer-row-height) * var(--factorizer-divider-rows));
}
.factorizerCell{
  min-height: var(--factorizer-row-height);
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  min-height: calc(360px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerExplain{
  min-height: calc(300px * var(--factorizer-scale, 1)) !important;
}


/* Final fix: divider and explanation keep a stable base height for several steps */
.factorizerColumns{
  --factorizer-row-visual-height: calc(2.9em + 14px * var(--factorizer-scale, 1));
  min-height: calc(var(--factorizer-row-visual-height) * 5) !important;
  align-content:start !important;
}
.factorizerColumns::after{
  top:0 !important;
  bottom:0 !important;
  height:auto !important;
  min-height:calc(var(--factorizer-row-visual-height) * 5) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard,
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  min-height: calc(var(--factorizer-row-visual-height, 100px) * 5 + 120px * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain ol{
  min-height: calc(6 * 1.65em) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  overflow:auto !important;
}


/* Robust final layout fix for factorization interactive block */
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard{
  display:grid !important;
  grid-template-rows:auto auto !important;
  align-content:start !important;
  justify-items:center !important;
  gap:calc(14px * var(--factorizer-scale, 1)) !important;
  overflow:hidden !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns{
  --factorizer-row-height: calc(54px * var(--factorizer-scale, 1));
  --factorizer-divider-rows: 5;
  position:relative !important;
  display:grid !important;
  grid-template-columns:calc(86px * var(--factorizer-scale, 1)) calc(52px * var(--factorizer-scale, 1)) !important;
  grid-auto-rows:var(--factorizer-row-height) !important;
  height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  min-height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  max-height:none !important;
  align-content:start !important;
  justify-content:center !important;
  overflow:visible !important;
  row-gap:0 !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns::after{
  top:0 !important;
  bottom:auto !important;
  left:calc(86px * var(--factorizer-scale, 1)) !important;
  width:calc(4px * var(--factorizer-scale, 1)) !important;
  height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerCell{
  min-height:var(--factorizer-row-height) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResult{
  width:min(100%, calc(290px * var(--factorizer-scale, 1))) !important;
  margin-top:calc(4px * var(--factorizer-scale, 1)) !important;
  align-self:start !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  display:grid !important;
  grid-template-rows:auto auto 1fr !important;
  align-content:start !important;
  min-height:calc(440px * var(--factorizer-scale, 1)) !important;
  overflow:auto !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain ol{
  min-height:calc(8.8em * var(--factorizer-scale, 1)) !important;
}
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="medium"] .factorizerColumns,
.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerColumns{
  justify-self:center !important;
}


/* ===== Stable factorizer board layout fix: keep divider inside the column area ===== */
.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerBoard{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:flex-start !important;
  align-content:flex-start !important;
  gap:calc(18px * var(--factorizer-scale, 1)) !important;
  overflow:hidden !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns{
  --factorizer-row-height: calc(50px * var(--factorizer-scale, 1));
  --factorizer-divider-rows: 5;
  position:relative !important;
  display:grid !important;
  grid-template-columns:calc(86px * var(--factorizer-scale, 1)) calc(52px * var(--factorizer-scale, 1)) !important;
  grid-auto-rows:var(--factorizer-row-height) !important;
  width:calc(138px * var(--factorizer-scale, 1)) !important;
  height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  min-height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  max-height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  align-content:start !important;
  justify-content:center !important;
  row-gap:0 !important;
  column-gap:0 !important;
  overflow:hidden !important;
  flex:0 0 auto !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerColumns::after{
  content:'' !important;
  position:absolute !important;
  top:0 !important;
  bottom:auto !important;
  left:calc(86px * var(--factorizer-scale, 1)) !important;
  width:calc(4px * var(--factorizer-scale, 1)) !important;
  height:calc(var(--factorizer-divider-rows) * var(--factorizer-row-height)) !important;
  min-height:0 !important;
  max-height:none !important;
  border-radius:999px !important;
  background:#7a2dbb !important;
  z-index:0 !important;
  pointer-events:none !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerCell{
  min-height:var(--factorizer-row-height) !important;
  height:var(--factorizer-row-height) !important;
  position:relative !important;
  z-index:1 !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerResult{
  position:relative !important;
  z-index:2 !important;
  width:min(100%, calc(300px * var(--factorizer-scale, 1))) !important;
  margin:0 auto !important;
  flex:0 0 auto !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain{
  display:block !important;
  min-height:calc(420px * var(--factorizer-scale, 1)) !important;
  overflow:auto !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain h3{
  margin:0 0 calc(16px * var(--factorizer-scale, 1)) !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain p{
  margin:0 0 calc(16px * var(--factorizer-scale, 1)) !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain ol{
  display:block !important;
  min-height:auto !important;
  margin:0 !important;
  padding-left:calc(34px * var(--factorizer-scale, 1)) !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"] .factorizerExplain li{
  display:list-item !important;
  margin:0 0 calc(12px * var(--factorizer-scale, 1)) !important;
  padding-left:calc(4px * var(--factorizer-scale, 1)) !important;
}

.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerColumns{
  --factorizer-row-height: calc(44px * var(--factorizer-scale, 1));
}

.theoryInteractiveZone[data-lav-interactive="factorization"][data-factorizer-layout="narrow"] .factorizerExplain{
  min-height:calc(320px * var(--factorizer-scale, 1)) !important;
}


/* Elegant step-animation block */
.theoryInteractiveZone[data-lav-interactive="step-animation"]{
  overflow:hidden;
  background:linear-gradient(180deg,#ffffff 0%,#fbf8ff 100%);
  border:2px solid rgba(122,45,187,.18);
  border-radius:24px;
  padding:26px;
  box-shadow:0 18px 42px rgba(36,26,47,.10);
}
.theoryInteractiveZone[data-lav-interactive="step-animation"].lav-step-animation-wide{
  width:100%;
  max-width:100%;
}
.theoryInteractiveZone[data-lav-interactive="step-animation"]{
  box-sizing:border-box;
}
.theoryInteractiveZone[data-lav-interactive="step-animation"] .factorizerWidget{
  display:grid;
  gap:16px;
}
.theoryInteractiveZone[data-lav-interactive="step-animation"] .factorizerControls{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:18px;
  background:#fff7ea;
  border:1px solid rgba(242,169,0,.28);
}
.theoryInteractiveZone[data-lav-interactive="step-animation"] .factorizerControls button{
  min-width:104px;
}
.theoryInteractiveZone[data-lav-interactive="step-animation"] .factorizerStepNum{
  margin-left:auto;
  color:#7a2dbb;
  font-weight:900;
}
.animationStage{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(220px,.65fr);
  gap:16px;
  align-items:stretch;
}
.animationDisplayBox,
.animationExplain{
  border-radius:20px;
  border:1px solid rgba(122,45,187,.16);
  background:#fff;
  box-shadow:0 12px 30px rgba(36,26,47,.08);
}
.animationDisplayBox{
  min-height:250px;
  padding:20px;
  overflow:auto;
}
.animationDisplay{
  display:grid;
  gap:14px;
  align-content:start;
}
.animationExplain{
  padding:18px 20px;
  color:#2f2538;
  line-height:1.5;
}
.animationExplain strong{
  display:block;
  color:#7a2dbb;
  font-size:18px;
  margin-bottom:8px;
}
.animationExplain p{ margin:0; }
.lav-animation-piece{
  border-radius:18px;
  transform-origin:center;
  box-sizing:border-box;
  overflow:hidden;
  animation-duration:.46s;
  animation-timing-function:cubic-bezier(.22,1,.36,1);
  animation-fill-mode:both;
}
.lav-animation-piece--text{
  padding:4px 2px;
  color:#241a2f;
}
.lav-animation-piece--frame,
.lav-animation-frame{
  padding:18px 20px;
  border:2px solid rgba(122,45,187,.24);
  border-radius:18px;
  background:linear-gradient(135deg,#ffffff 0%,#fbf3ff 100%);
  box-shadow:0 10px 24px rgba(122,45,187,.09);
}
.lav-animation-piece--formula,
.lav-animation-formula{
  display:grid;
  place-items:center;
  min-height:80px;
  padding:16px;
  border-radius:18px;
  background:#fff7ea;
  border:2px solid rgba(242,169,0,.35);
  color:#5f1f96;
  font-size:22px;
  font-weight:900;
}
.lav-animation-piece--note,
.lav-animation-note{
  padding:15px 18px;
  border-radius:18px;
  background:#f8f1ff;
  border:1px dashed rgba(122,45,187,.45);
  color:#5f1f96;
  font-weight:850;
}
.lav-animation-piece--button{
  display:inline-grid;
  place-items:center;
  min-height:38px;
  border:1px solid #5f1f96;
  border-radius:14px;
  background:#7a2dbb;
  color:#fff;
  font-weight:900;
  text-decoration:none;
  user-select:none;
}
.lav-animation-piece--badge{
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  background:#fff4d6;
  border:1px solid rgba(242,169,0,.55);
  color:#5f1f96;
  font-weight:900;
}
.lav-animation-piece--line{
  min-height:3px;
  background:#7a2dbb;
  border-radius:999px;
  padding:0;
  color:transparent;
}
.lav-animation-effect--fade{ animation-name:lavAnimFade; }
.lav-animation-effect--slide-up{ animation-name:lavAnimSlideUp; }
.lav-animation-effect--slide-left{ animation-name:lavAnimSlideLeft; }
.lav-animation-effect--zoom{ animation-name:lavAnimZoom; }
.lav-animation-effect--highlight{ animation-name:lavAnimHighlight; }
.lav-animation-effect--wipe{ animation-name:lavAnimWipe; overflow:hidden; }
.lav-animation-effect--none{ animation:none; }
@keyframes lavAnimFade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes lavAnimSlideUp{ from{ opacity:0; transform:translateY(18px); } to{ opacity:1; transform:translateY(0); } }
@keyframes lavAnimSlideLeft{ from{ opacity:0; transform:translateX(24px); } to{ opacity:1; transform:translateX(0); } }
@keyframes lavAnimZoom{ from{ opacity:0; transform:scale(.94); } to{ opacity:1; transform:scale(1); } }
@keyframes lavAnimHighlight{ 0%{ opacity:0; transform:scale(.98); box-shadow:0 0 0 rgba(242,169,0,0); } 55%{ opacity:1; transform:scale(1.015); box-shadow:0 0 0 8px rgba(242,169,0,.16); } 100%{ opacity:1; transform:scale(1); box-shadow:0 10px 24px rgba(122,45,187,.09); } }
@keyframes lavAnimWipe{ from{ opacity:0; clip-path:inset(0 100% 0 0); } to{ opacity:1; clip-path:inset(0 0 0 0); } }
@media (max-width:760px){
  .animationStage{ grid-template-columns:1fr; }
  .theoryInteractiveZone[data-lav-interactive="step-animation"] .factorizerStepNum{ margin-left:0; width:100%; }
}

/* Free placement mode for custom step-animation elements */
.animationDisplay.animationDisplay--free{
  position:relative;
  display:block;
  min-height:260px;
}
.animationDisplay.animationDisplay--free .lav-animation-piece--placed{
  position:absolute;
  margin:0;
  box-sizing:border-box;
}
.animationDisplay.animationDisplay--free .lav-animation-piece--placed.lav-animation-piece--text{
  padding:6px 8px;
}


/* Specific layout for the rounding-to-hundredths interactive animation */
.roundingHundredthsAnimation .animationStage{
  grid-template-columns:minmax(0,1.55fr) minmax(250px,.55fr);
}
.roundingHundredthsAnimation .animationDisplayBox{
  min-height:480px;
  background:#f2f2f4;
}
.roundingHundredthsAnimation .animationDisplay{
  min-height:430px;
}
.roundingHundredthsAnimation .animationExplain{
  background:linear-gradient(180deg,#ffffff 0%,#faf4ff 100%);
}
.roundingHundredthsAnimation .animationExplain p{
  margin-top:6px;
}
.roundingHundredthsAnimation .lav-animation-piece{
  overflow:visible;
}
.roundingHundredthsAnimation .lav-animation-piece--text{
  background:transparent;
  padding:0;
}
.roundingHundredthsAnimation .factorizerControls button{
  min-width:118px;
}
@media (max-width: 980px){
  .roundingHundredthsAnimation .animationStage{
    grid-template-columns:1fr;
  }
  .roundingHundredthsAnimation .animationDisplayBox{
    min-height:420px;
  }
}
@media (max-width: 760px){
  .roundingHundredthsAnimation .animationDisplayBox{
    min-height:360px;
    padding:14px;
  }
  .roundingHundredthsAnimation .animationDisplay{
    min-height:320px;
  }
}


/* Cumulative explanations and scalable inner windows in step animations */
.animationExplainStep{
  padding:0 0 12px;
  margin:0 0 12px;
  border-bottom:1px solid rgba(122,45,187,.12);
}
.animationExplainStep:last-child{
  margin-bottom:0;
  padding-bottom:0;
  border-bottom:0;
}
.animationExplainStep--active{
  color:#241a2f;
}
.animationExplain[data-lav-part-scale],
.animationExplain[data-animation-part="explain"]{
  font-size:calc(16px * var(--lav-part-scale, 1));
}
.animationExplain[data-lav-part-scale] strong,
.animationExplain[data-animation-part="explain"] strong{
  font-size:calc(18px * var(--lav-part-scale, 1));
}
.animationDisplayBox[data-lav-part-scale] .animationDisplay,
.animationDisplayBox[data-animation-part="display"] .animationDisplay{
  transform:scale(var(--lav-part-scale, 1));
  transform-origin:top left;
  width:calc(100% / var(--lav-part-scale, 1));
  min-height:calc(260px / var(--lav-part-scale, 1));
}
.animationDisplayBox[data-lav-document-object="true"],
.animationExplain[data-lav-document-object="true"]{
  resize:both;
}

/* Editable structural windows inside step animations */
.animationStage{
  position:relative;
}
.lav-animation-editing-mode [data-animation-part],
.lav-animation-editing-mode .animationDisplayBox,
.lav-animation-editing-mode .animationExplain[data-animation-explain]{
  cursor:move !important;
  outline:2px dashed rgba(122,45,187,.38);
  outline-offset:4px;
}
.lav-animation-editing-mode [data-animation-part]::after,
.lav-animation-editing-mode .animationDisplayBox::after,
.lav-animation-editing-mode .animationExplain[data-animation-explain]::after{
  content:"↘";
  position:absolute;
  right:-10px;
  bottom:-10px;
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:#f2a900;
  color:#241a2f;
  font-weight:900;
  font-size:13px;
  line-height:1;
  box-shadow:0 4px 10px rgba(36,26,47,.18);
  border:2px solid #fff;
  pointer-events:none;
}
.lav-animation-editing-mode [data-animation-part].lav-editor-selected,
.lav-animation-editing-mode .animationDisplayBox.lav-editor-selected,
.lav-animation-editing-mode .animationExplain.lav-editor-selected{
  outline:3px solid #f2a900 !important;
  box-shadow:0 0 0 6px rgba(122,45,187,.12), 0 12px 30px rgba(36,26,47,.08);
}
.lav-animation-part--dragging,
.lav-animation-part--resizing{
  cursor:grabbing !important;
  z-index:30;
  user-select:none;
}
.animationDisplayBox[data-lav-document-object="true"],
.animationExplain[data-lav-document-object="true"]{
  resize:none !important;
  overflow:auto;
}


/* Keep free-positioned animation content inside the scene window */
.animationDisplayBox{
  overflow:hidden;
}
.animationDisplay.animationDisplay--free{
  transform-origin:top left;
  will-change:transform;
}
.animationDisplay.animationDisplay--free .lav-animation-piece,
.animationDisplay.animationDisplay--free .lav-animation-piece *{
  max-width:none;
}
.animationDisplay.animationDisplay--free .lav-animation-piece{
  overflow:visible;
}
.animationDisplay.animationDisplay--free .lav-animation-piece--text{
  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;
}
.animationExplain,
.animationExplain *{
  max-width:100%;
  overflow-wrap:break-word;
}
.lav-animation-editing-mode .animationDisplayBox{
  overflow:hidden;
}

/* Smooth step animation rendering: pieces are kept in the DOM and only visibility/effect changes per step. */
.lav-animation-piece--hidden{
  display:none!important;
}
.animationDisplay[data-animation-effect] .lav-animation-piece{
  will-change:opacity, transform, clip-path;
  backface-visibility:hidden;
}
@media (prefers-reduced-motion: reduce){
  .lav-animation-piece{animation:none!important;transition:none!important;}
}


/* =========================
   Smooth PowerPoint-style factorization animation for NOD/NOK text page
   ========================= */
.factorizationSmoothAnimation .animationStage{
  grid-template-columns:minmax(0,1.34fr) minmax(250px,.66fr);
}
.factorizationSmoothAnimation .animationDisplayBox{
  min-height:520px;
  background:linear-gradient(180deg,#f6f5f8 0%,#f1eef7 100%);
  overflow:hidden;
}
.factorizationSmoothAnimation .animationDisplay{
  min-height:460px;
}
.factorizationSmoothAnimation .animationExplain{
  background:linear-gradient(180deg,#ffffff 0%,#fbf4ff 100%);
}
.factorizationSmoothAnimation .animationExplain p{
  margin-top:6px;
}
.factorizationSmoothAnimation .lav-animation-piece{
  overflow:visible;
}
.factorizationSmoothAnimation .lav-animation-piece--text{
  background:transparent;
  padding:0;
}
.smoothFactorSceneTitle{
  font-size:40px;
  line-height:1.08;
  font-weight:950;
  letter-spacing:-.025em;
  color:#7a2dbb;
}
.smoothFactorDivider{
  width:6px;
  height:300px;
  border-radius:999px;
  background:linear-gradient(180deg,#7a2dbb 0%,#a465da 100%);
  box-shadow:0 10px 22px rgba(122,45,187,.18);
}
.smoothFactorCell{
  width:72px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:#fff;
  border:2px solid rgba(122,45,187,.20);
  color:#241a2f;
  font-size:34px;
  line-height:1;
  font-weight:950;
  box-shadow:0 10px 24px rgba(36,26,47,.09);
}
.smoothFactorCell--factor{
  color:#7a2dbb;
  background:#fff7ea;
  border-color:rgba(242,169,0,.48);
}
.smoothFactorCell--finish{
  color:#fff;
  background:#7a2dbb;
  border-color:#7a2dbb;
}
.smoothFactorHint{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 13px;
  border-radius:999px;
  border:2px solid rgba(122,45,187,.20);
  background:#fff7ea;
  color:#6f2ec7;
  font-size:16px;
  font-weight:950;
  line-height:1;
  box-shadow:0 8px 18px rgba(122,45,187,.11);
  white-space:nowrap;
}
.smoothFactorHint::after{
  content:'';
  position:absolute;
  width:42px;
  height:2px;
  top:50%;
  background:rgba(242,169,0,.95);
  transform:translateY(-50%);
}
.smoothFactorHint--left::after{
  right:-42px;
}
.smoothFactorHint--right::after{
  left:-42px;
}
.smoothFactorMini,
.smoothFactorFinal{
  border-radius:22px;
  background:#fff;
  border:2px solid rgba(122,45,187,.18);
  box-shadow:0 14px 30px rgba(36,26,47,.10);
  color:#241a2f;
}
.smoothFactorMini{
  display:inline-flex;
  align-items:center;
  min-height:58px;
  padding:0 24px;
  font-size:30px;
  font-weight:950;
  color:#7a2dbb;
}
.smoothFactorFinal{
  display:grid;
  gap:8px;
  padding:15px 20px;
}
.smoothFactorFinal span{
  color:#7a2dbb;
  font-size:14px;
  font-weight:950;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.smoothFactorFinal strong{
  color:#241a2f;
  font-size:30px;
  line-height:1.12;
}
.smoothFactorFinal--power{
  background:#fff7ea;
  border-color:rgba(242,169,0,.40);
}
@media (max-width:980px){
  .factorizationSmoothAnimation .animationStage{
    grid-template-columns:1fr;
  }
  .factorizationSmoothAnimation .animationDisplayBox{
    min-height:480px;
  }
}
@media (max-width:760px){
  .factorizationSmoothAnimation .animationDisplayBox{
    min-height:390px;
    padding:14px;
  }
  .factorizationSmoothAnimation .animationDisplay{
    min-height:350px;
  }
}


/* ===== LavMath equations draft text page ===== */
.draftBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:2px solid rgba(122,45,187,.32);
  background:#f4ecff;
  color:#7a2dbb;
  border-radius:0;
  padding:9px 14px;
  font-weight:900;
  font-size:13px;
  box-shadow:0 6px 14px rgba(36,26,47,.08);
}
.lav-theory-equations-page{
  width:min(100%, 1040px);
  min-height:1500px;
  padding:54px 58px 70px;
  border-color:rgba(122,45,187,.28);
  background:#fff;
}
.lav-theory-equations-page::before{
  border-color:rgba(242,169,0,.48);
}
.lav-equations-doc .theorySection{
  overflow:hidden;
}
.theoryTitleBlock--equations{
  grid-template-columns:90px 1fr auto;
}
.theoryTitleBlock--equations h1{
  font-size:50px;
  line-height:.96;
  letter-spacing:.02em;
}
.theoryTitleBlock--equations h1 span{
  color:#f2a900;
  font-size:44px;
  letter-spacing:.01em;
}
.equationsHero{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(250px,.65fr);
  gap:20px;
  align-items:stretch;
  padding:24px 26px;
  color:#241a2f;
  background:#fff;
  border:3px solid #7a2dbb;
  box-shadow:0 8px 18px rgba(36,26,47,.10);
  margin-bottom:24px;
}
.equationsHero h1{
  margin:8px 0 14px;
  font-size:44px;
  line-height:1;
  color:#7a2dbb;
  letter-spacing:.02em;
  text-transform:uppercase;
}
.equationsHero__chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:18px;
}
.equationsHero__chips span{
  display:inline-flex;
  padding:7px 11px;
  background:#fff8e6;
  color:#7a2dbb;
  font-weight:900;
  font-size:13px;
  border:2px solid rgba(242,169,0,.58);
}
.equationsHero__card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height:210px;
  padding:20px;
  background:#f4ecff;
  border:2px solid rgba(122,45,187,.42);
  text-align:center;
  font-weight:800;
  color:#6e6578;
}
.balanceIcon{
  display:grid;
  grid-template-columns:72px 1fr 72px;
  gap:12px;
  align-items:end;
  width:100%;
  max-width:260px;
  margin-bottom:18px;
}
.balanceIcon span{
  display:grid;
  place-items:center;
  height:62px;
  background:#fff;
  color:#7a2dbb;
  font-size:28px;
  font-weight:950;
  border:2px solid #7a2dbb;
}
.balanceIcon i{
  display:block;
  height:7px;
  background:#f2a900;
  margin-bottom:28px;
  box-shadow:0 10px 0 rgba(242,169,0,.24);
}
.equationPickBox,
.equationExampleCard,
.equationMemoryCard{
  background:#fff;
  border:2px solid rgba(122,45,187,.55);
  border-radius:0;
  padding:18px 20px;
  box-shadow:0 8px 18px rgba(36,26,47,.08);
}
.equationPickBox h3,
.equationExampleCard h3{
  margin-top:0;
}
.equationMethodGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin:18px 0 24px;
}
.equationMethodCard{
  position:relative;
  background:#f4ecff;
  border:2px solid rgba(122,45,187,.55);
  border-radius:0;
  padding:18px 18px 18px 68px;
  min-height:166px;
  box-shadow:0 8px 18px rgba(36,26,47,.08);
}
.equationMethodCard--green{
  background:#eef7ff;
  border-color:rgba(14,146,208,.55);
}
.equationMethodCard--orange{
  background:#fff8e6;
  border-color:rgba(242,169,0,.72);
}
.equationMethodCard--purple{
  background:#fff;
  border-color:rgba(237,44,145,.55);
}
.equationMethodCard h3{
  margin:0 0 8px;
  font-size:20px;
  color:#7a2dbb;
}
.equationMethodCard p{
  margin:0 0 10px;
}
.methodNumber{
  position:absolute;
  left:18px;
  top:18px;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  background:#7a2dbb;
  color:#fff;
  font-weight:950;
  box-shadow:0 6px 12px rgba(122,45,187,.18);
}
.equationMethodCard--green .methodNumber{background:#0e92d0;}
.equationMethodCard--orange .methodNumber{background:#f2a900;color:#241a2f;}
.equationMethodCard--purple .methodNumber{background:#ed2c91;}
.miniFormula{
  display:inline-flex;
  padding:7px 11px;
  background:#fff;
  border:2px solid rgba(122,45,187,.24);
  font-weight:900;
  color:#7a2dbb;
}
.equationRulesTable td:first-child,
.equationRulesTable td:nth-child(2){
  white-space:nowrap;
  font-weight:900;
}
.equationAlgorithm div{
  align-items:flex-start;
}
.eqSteps{
  display:grid;
  gap:9px;
  margin:14px 0 0;
  padding:0;
  list-style:none;
  counter-reset:eq-step;
}
.eqSteps li{
  counter-increment:eq-step;
  position:relative;
  padding:12px 14px 12px 52px;
  border-radius:0;
  background:#fff;
  border:1px solid rgba(36,26,47,.14);
  line-height:1.55;
}
.eqSteps li:nth-child(odd){
  background:#f7f3fb;
}
.eqSteps li::before{
  content:counter(eq-step);
  position:absolute;
  left:14px;
  top:13px;
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  background:#7a2dbb;
  color:#fff;
  font-weight:900;
  font-size:13px;
}
.equationLevelsSection > p{
  max-width:900px;
}
.equationLevelCard{
  background:#fff;
  border:2px solid rgba(122,45,187,.28);
  border-left:7px solid #7a2dbb;
  border-radius:0;
  padding:18px 20px;
  margin:18px 0;
  box-shadow:0 8px 18px rgba(36,26,47,.08);
}
.equationLevelCard .theoryAnswer{
  margin:14px 0 0;
}
.levelHeader{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}
.levelHeader span{
  flex:0 0 auto;
  display:inline-flex;
  padding:7px 11px;
  background:#f4ecff;
  color:#7a2dbb;
  border:2px solid rgba(122,45,187,.30);
  font-weight:950;
  font-size:13px;
}
.levelHeader h3{
  margin:4px 0 0;
  font-size:22px;
}
.level2{border-left-color:#0e92d0}.level2 .eqSteps li::before{background:#0e92d0}.level2 .levelHeader span{background:#eef7ff;color:#0872a7;border-color:rgba(14,146,208,.35)}
.level3{border-left-color:#f2a900}.level3 .eqSteps li::before{background:#f2a900;color:#241a2f}.level3 .levelHeader span{background:#fff8e6;color:#7a2dbb;border-color:rgba(242,169,0,.58)}
.level4{border-left-color:#ed2c91}.level4 .eqSteps li::before{background:#ed2c91}.level4 .levelHeader span{background:#fff0f8;color:#b9146c;border-color:rgba(237,44,145,.35)}
.level5{border-left-color:#7a2dbb}.level5 .eqSteps li::before{background:#7a2dbb}.level5 .levelHeader span{background:#f4ecff;color:#7a2dbb;border-color:rgba(122,45,187,.35)}
.level6{border-left-color:#0e92d0}.level6 .eqSteps li::before{background:#0e92d0}.level6 .levelHeader span{background:#eef7ff;color:#0872a7;border-color:rgba(14,146,208,.35)}
.level7{border-left-color:#f2a900}.level7 .eqSteps li::before{background:#f2a900;color:#241a2f}.level7 .levelHeader span{background:#fff8e6;color:#7a2dbb;border-color:rgba(242,169,0,.58)}
.level8{border-left-color:#ed2c91}.level8 .eqSteps li::before{background:#ed2c91}.level8 .levelHeader span{background:#fff0f8;color:#b9146c;border-color:rgba(237,44,145,.35)}
.level9{border-left-color:#7a2dbb}.level9 .eqSteps li::before{background:#7a2dbb}.level9 .levelHeader span{background:#f4ecff;color:#7a2dbb;border-color:rgba(122,45,187,.35)}
.level10{border-left-color:#f2a900}.level10 .eqSteps li::before{background:#f2a900;color:#241a2f}.level10 .levelHeader span{background:#fff8e6;color:#7a2dbb;border-color:rgba(242,169,0,.58)}
.equationMistakesGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.equationMistakesGrid > div{
  background:#fff8e6;
  border:2px solid rgba(242,169,0,.62);
  border-radius:0;
  padding:16px 18px;
  box-shadow:0 8px 18px rgba(36,26,47,.06);
}
.equationMistakesGrid > div:nth-child(even){
  background:#f4ecff;
  border-color:rgba(122,45,187,.42);
}
.equationMistakesGrid h3{
  margin:0 0 8px;
  font-size:18px;
  color:#7a2dbb;
}
.equationMistakesGrid p{margin:0}
.equationMemoryCard{
  background:#fff8e6;
  border:3px solid #f2a900;
  font-size:18px;
}
.equationMemoryCard p:last-child{margin-bottom:0}
@media (max-width: 820px){
  .theoryTitleBlock--equations{
    grid-template-columns:64px 1fr;
  }
  .theoryTitleBlock--equations h1{
    font-size:36px;
  }
  .theoryTitleBlock--equations h1 span{
    font-size:32px;
  }
  .equationsHero,
  .equationMethodGrid,
  .equationMistakesGrid{
    grid-template-columns:1fr;
  }
  .equationsHero{padding:18px}
  .equationMethodCard{padding-left:18px;padding-top:64px}
  .levelHeader{flex-direction:column;gap:8px}
}

/* =========================
   Публичный фокус на 5 классе
   ========================= */
.materialsPage--focus .page-title{
  margin-bottom: 12px;
}

.classGrid--focus{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}

.classCard--featured{
  min-height: 430px;
}

.classCard__preview--soft{
  background: linear-gradient(145deg, rgba(122,45,187,.08), rgba(242,169,0,.18));
}

.classCard__illustration{
  object-fit: contain;
  background: rgba(255,255,255,.72);
}

.classCard__body--stacked{
  grid-template-columns: auto 1fr;
  gap: 18px;
}

.materialStatus{
  margin: 8px 0 42px;
  display:flex;
  justify-content:center;
}

.materialStatus__card{
  max-width: 760px;
  width: 100%;
  padding: 24px 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,250,241,.92));
  border: 2px solid rgba(122,45,187,.18);
  box-shadow: 0 18px 42px rgba(122,45,187,.08);
}

.materialStatus__eyebrow{
  display:inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(122,45,187,.10);
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.materialStatus__card h2{
  margin: 0 0 10px;
  font-size: 30px;
}

.materialStatus__card p{
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.classDetail--focused{
  align-items: center;
}

.classDetail__hero--art{
  background: linear-gradient(145deg, rgba(122,45,187,.10), rgba(242,169,0,.14));
}

.classDetail__heroArt{
  object-fit: contain;
  background: rgba(255,255,255,.78);
  padding: 14px;
}

.classDetail__note{
  margin: 6px 0 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(122,45,187,.06);
  color: var(--muted);
  line-height: 1.5;
}

.gradeTheoryGrid--single{
  grid-template-columns: minmax(280px, 820px);
}

@media (max-width: 980px){
  .classGrid--focus{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 720px){
  .classGrid--focus{ grid-template-columns: 1fr; }
  .materialStatus__card{ padding: 20px; }
  .materialStatus__card h2{ font-size: 24px; }
}


/* =========================
   Правка карточки 5 класса: компактно и без дополнительной карточки-объявления
   ========================= */
.classGrid--focus{
  grid-template-columns: repeat(3, 286px);
  justify-content: start;
  align-items: start;
}

.classGrid--focus .classCard{
  width: 286px;
  height: 392px;
  min-height: 0;
  padding: 14px 14px 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.classGrid--focus .classCard__preview{
  height: 174px;
  border-radius: 24px;
  padding: 8px;
}

.classGrid--focus .classCard__preview img,
.classGrid--focus .classCard__illustration{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.classGrid--focus .classCard__body,
.classGrid--focus .classCard__body--stacked{
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 6px;
}

.classGrid--focus .classCard__title{
  min-width: 0;
  font-size: 24px;
  line-height: 1.06;
  white-space: nowrap;
}

.classGrid--focus .classCard__topics{
  max-height: 148px;
  margin: 0;
  padding-left: 18px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.18;
}

.classGrid--focus .classCard__topics li{
  margin-bottom: 2px;
}

.materialStatus{
  display: none !important;
}

@media (max-width: 980px){
  .classGrid--focus{
    grid-template-columns: repeat(2, 286px);
  }
}

@media (max-width: 720px){
  .classGrid--focus{
    grid-template-columns: 1fr;
  }

  .classGrid--focus .classCard{
    width: min(100%, 286px);
    height: 392px;
  }
}


/* =========================
   Страницы классов: поиск тем и вид карточек
   ========================= */
.gradeTopicsToolbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin: 18px 0 22px;
  padding: 16px;
  border: 2px solid rgba(122,45,187,.16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,250,241,.82));
  box-shadow: 0 14px 34px rgba(122,45,187,.08);
}

.gradeTopicsSearch{
  flex: 1 1 420px;
  display:grid;
  gap:8px;
  font-weight:850;
  color:var(--text);
}

.gradeTopicsSearch span,
.gradeTopicsView span{
  font-size: 14px;
  color: var(--muted);
  font-weight:850;
}

.gradeTopicsSearch input{
  width:100%;
  min-height:44px;
  padding: 10px 14px;
  border: 2px solid rgba(122,45,187,.22);
  border-radius: 16px;
  background:#fff;
  color:var(--text);
  font: inherit;
  outline: none;
}

.gradeTopicsSearch input:focus{
  border-color: rgba(122,45,187,.72);
  box-shadow: 0 0 0 4px rgba(122,45,187,.10);
}

.gradeTopicsView{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.gradeTopicsView button{
  min-height:40px;
  padding: 9px 13px;
  border: 2px solid rgba(122,45,187,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: var(--accent);
  font-weight: 900;
  cursor:pointer;
}

.gradeTopicsView button.is-active{
  color:#fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(122,45,187,.18);
}

.gradeTopicsEmpty{
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(242,169,0,.10);
  border: 1px solid rgba(242,169,0,.36);
  color: var(--muted);
  font-weight: 750;
}

.gradeTheoryGrid[data-grade-topic-grid]{
  width:100%;
  display:grid;
  gap:24px;
  align-items:stretch;
}

.gradeTheoryGrid--two[data-grade-topic-grid]{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gradeTheoryGrid--one[data-grade-topic-grid]{
  grid-template-columns: minmax(0, 760px);
}

.gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
  width:100%;
  height: 208px;
  min-height: 208px;
  box-sizing:border-box;
  overflow:hidden;
  align-items:center;
}

.gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
  height: 154px;
  min-height: 154px;
  box-sizing:border-box;
}

.gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard h3{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

.gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

.gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard[hidden]{
  display:none !important;
}

@media (max-width: 900px){
  .gradeTheoryGrid--two[data-grade-topic-grid]{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px){
  .gradeTopicsToolbar{
    align-items:stretch;
    flex-direction:column;
  }

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

  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    height:auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
    height: 150px;
  }
}


/* =========================
   Страница 5 класса: верхние карточки одного размера
   ========================= */
.classDetail--focused{
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.classDetail--focused .classDetail__hero,
.classDetail--focused .classDetail__panel{
  height: 310px;
  min-height: 310px;
  box-sizing: border-box;
  overflow: hidden;
}

.classDetail--focused .classDetail__hero{
  display:flex;
  align-items:center;
  justify-content:center;
}

.classDetail--focused .classDetail__heroArt{
  width:100%;
  height:100%;
  object-fit:contain;
}

.classDetail--focused .classDetail__panel{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  padding: 22px 24px;
}

.classDetail--focused .classDetail__panel h2{
  margin-bottom: 12px;
}

.classDetail--focused .classDetail__panel .list{
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.34;
}

.classDetail--focused .classDetail__panel .materialQuick{
  display:none !important;
}

.classDetail--focused .classDetail__note{
  margin-top:auto;
  font-size: 14px;
}

@media (max-width: 860px){
  .classDetail--focused{
    grid-template-columns: 1fr;
  }

  .classDetail--focused .classDetail__hero,
  .classDetail--focused .classDetail__panel{
    height:auto;
    min-height:0;
  }
}


/* =========================
   Главная: вся карточка является кнопкой
   ========================= */
.card--homeLink,
a.card--home{
  display:block;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  min-height: 190px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.card--homeLink:hover,
a.card--home:hover{
  transform: translateY(-4px);
  text-decoration:none;
  border-color: rgba(122,45,187,.88);
  box-shadow: 0 24px 54px rgba(122,45,187,.20);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,250,241,.94));
}

.card--homeLink:focus-visible,
a.card--home:focus-visible{
  outline: 4px solid rgba(122,45,187,.22);
  outline-offset: 4px;
}

.card--homeLink .btn,
a.card--home .btn{
  display:none !important;
}

/* Карточки тем уже кликабельны целиком, поэтому отдельная строка действия не нужна. */
.gradeTheoryCard__action{
  display:none !important;
}


/* =========================
   Главная: кнопка внутри кликабельной карточки видима
   ========================= */
.card--homeLink .cardHomeButton,
a.card--home .cardHomeButton{
  display:inline-flex !important;
  width:max-content;
  margin-top: 18px;
  pointer-events:none;
}

.card--homeLink:hover .cardHomeButton,
a.card--home:hover .cardHomeButton{
  filter: brightness(1.06);
}


/* =========================
   Единый логотип LavMath / Стиль 1
   ========================= */
.hero__img{
  object-fit: contain;
  max-height: 380px;
}

.theoryTitleBlock__logo{
  object-fit: contain;
  border-radius: 18px;
}

.lav-style1-logo,
img[src$="lavmath-style1-logo.png"]{
  object-fit: contain;
}


/* =========================
   Прозрачный логотип LavMath / Стиль 1
   ========================= */
.hero__img{
  object-fit: contain;
  max-height: 420px;
  width: min(360px, 36vw);
  background: transparent !important;
}

.theoryTitleBlock__logo{
  object-fit: contain;
  background: transparent !important;
  box-shadow: none !important;
}


/* =========================
   Главная: компактный прозрачный логотип
   ========================= */
.hero__art{
  justify-content:center;
  overflow:hidden;
}

.hero__img[src$="lavmath-style1-logo-transparent.png"]{
  width:auto;
  height:min(300px, 34vw);
  max-width:min(260px, 28vw);
  max-height:300px;
  object-fit:contain;
  object-position:center;
}


/* =========================
   Адаптация под телефон / планшет
   ========================= */
html{
  -webkit-text-size-adjust:100%;
  scroll-padding-top:76px;
}

body{
  overflow-x:hidden;
}

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

.mobileNavToggle{
  display:none;
  align-items:center;
  justify-content:center;
  min-width:42px;
  min-height:42px;
  padding:8px 10px;
  border:2px solid rgba(122,45,187,.22);
  border-radius:14px;
  background:rgba(255,255,255,.88);
  color:var(--accent);
  font-weight:950;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.mobileNavToggle:focus-visible{
  outline:4px solid rgba(122,45,187,.18);
  outline-offset:3px;
}

@media (hover:none){
  .card:hover,
  .classCard:hover,
  .gradeTheoryCard:hover,
  .card--homeLink:hover,
  a.card--home:hover{
    transform:none;
  }
}

@media (max-width: 980px){
  .container{
    max-width:100%;
    padding-left:18px;
    padding-right:18px;
  }

  .header{
    z-index:200;
  }

  .header__row{
    position:relative;
    padding:10px 0;
  }

  .mobileNavToggle{
    display:inline-flex;
  }

  .nav{
    position:absolute;
    top:calc(100% + 10px);
    left:0;
    right:0;
    display:none;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    padding:12px;
    border:1px solid rgba(122,45,187,.16);
    border-radius:18px;
    background:rgba(255,255,255,.97);
    box-shadow:0 22px 48px rgba(21,18,35,.16);
  }

  .header.is-mobile-open .nav{
    display:flex;
  }

  .nav > a,
  .nav .dropdown__toggle,
  .dropdown__item{
    width:100%;
    min-height:42px;
    display:flex;
    align-items:center;
    padding:10px 12px;
    border-radius:12px;
  }

  .dropdown{
    width:100%;
  }

  .dropdown__menu,
  .dropdown__submenu{
    position:static;
    display:none;
    width:100%;
    min-width:0;
    margin:6px 0 0;
    padding:8px;
    border-radius:14px;
    box-shadow:none;
  }

  .dropdown:hover > .dropdown__menu,
  .dropdown:focus-within > .dropdown__menu{
    display:block;
  }

  .dropdown__group:hover .dropdown__submenu,
  .dropdown__group:focus-within .dropdown__submenu{
    display:block;
  }

  .hero--home .hero__panel{
    padding:24px 20px;
    border-radius:24px;
  }

  .hero__grid{
    grid-template-columns:1fr;
    gap:22px;
  }

  .hero__content h1{
    font-size:clamp(32px, 7vw, 44px);
  }

  .hero__buttons{
    gap:10px;
  }

  .hero__buttons .btn{
    flex:1 1 190px;
    justify-content:center;
  }

  .hero__art{
    justify-content:center;
  }

  .hero__art[style]{
    width:auto !important;
    height:auto !important;
    transform:none !important;
  }

  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    width:auto;
    height:min(240px, 44vw);
    max-height:240px;
    max-width:min(260px, 70vw);
  }

  .grid,
  .grid--2,
  .classGrid,
  .cards-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .classDetail,
  .classDetail--focused{
    grid-template-columns:1fr;
  }

  .classDetail--focused .classDetail__hero,
  .classDetail--focused .classDetail__panel{
    height:auto;
    min-height:0;
  }

  .classDetail__hero img,
  .classDetail__heroArt{
    min-height:0;
    max-height:300px;
    object-fit:contain;
  }

  .gradeTopicsToolbar{
    align-items:stretch;
    flex-direction:column;
  }

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

  .gradeTheoryGrid--two[data-grade-topic-grid]{
    grid-template-columns:1fr;
  }

  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:1fr;
  }

  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    height:auto;
    min-height:188px;
  }
}

@media (max-width: 720px){
  .container{
    padding-left:14px;
    padding-right:14px;
  }

  .page-title{
    font-size:clamp(28px, 8vw, 36px);
    line-height:1.12;
  }

  .section-title,
  .section-head h2{
    font-size:clamp(24px, 7vw, 32px);
    line-height:1.15;
  }

  .hero{
    padding:18px 0 16px;
  }

  .hero--home .hero__panel{
    padding:20px 16px;
    border-radius:22px;
  }

  .lead{
    font-size:15px;
  }

  .btn{
    min-height:42px;
    padding:10px 14px;
  }

  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus{
    grid-template-columns:1fr !important;
  }

  .card,
  .classCard{
    width:100%;
    min-width:0;
  }

  .classGrid--focus .classCard{
    width:100%;
    height:auto;
    min-height:0;
  }

  .classGrid--focus .classCard__preview{
    height:auto;
    min-height:170px;
  }

  .classGrid--focus .classCard__body,
  .classGrid--focus .classCard__body--stacked{
    grid-template-columns:1fr;
  }

  .classCard__body,
  .classCard__body--stacked{
    grid-template-columns:1fr;
  }

  .classCard__topics{
    font-size:15px;
  }

  .classDetail{
    margin:14px 0 24px;
  }

  .classDetail__hero,
  .classDetail__panel{
    border-radius:22px;
    padding:14px;
  }

  .classDetail__panel h2{
    font-size:24px;
  }

  .gradeTopicsToolbar{
    padding:12px;
    border-radius:18px;
  }

  .gradeTopicsView{
    display:grid;
    grid-template-columns:1fr;
  }

  .gradeTopicsView span{
    grid-column:1;
  }

  .gradeTopicsView button{
    width:100%;
  }

  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:1fr !important;
    gap:16px;
  }

  .gradeTheoryCard,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    grid-template-columns:1fr;
    height:auto;
    min-height:0;
    padding:14px;
    border-radius:22px;
  }

  .gradeTheoryCard__preview,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
    width:100%;
    height:150px;
    min-height:150px;
  }

  .gradeTheoryCard h3{
    font-size:22px;
  }

  .footer__row{
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }
}

@media (max-width: 560px){
  .header__row{
    gap:8px;
  }

  .logo{
    font-size:17px;
  }

  .hero__content h1{
    font-size:clamp(29px, 9vw, 36px);
  }

  .hero__buttons{
    flex-direction:column;
  }

  .hero__buttons .btn{
    width:100%;
  }

  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    height:min(205px, 52vw);
    max-height:205px;
    max-width:min(230px, 76vw);
  }

  .card{
    padding:15px;
  }

  .card h2{
    font-size:22px;
  }

  .materialLead{
    font-size:14px;
  }
}

/* Text-страницы и Стиль 1 на телефоне */
@media (max-width: 760px){
  .lav-document-page,
  .lav-doc-shell,
  .lav-doc-shell--nod-long{
    width:100% !important;
    max-width:100% !important;
    min-height:0;
    padding:28px 18px !important;
    margin:0 auto;
    border-radius:18px;
    overflow:hidden;
  }

  .lav-document-page::before,
  .lav-doc-shell::before,
  .lav-doc-shell--nod-long::before{
    inset:10px;
    border-radius:14px;
  }

  .lav-document-body,
  .lav-rich-text,
  .lav-theory-doc,
  .lav-nod-long-doc{
    min-height:0;
    font-size:16px;
    line-height:1.55;
  }

  .theoryTitleBlock{
    display:grid;
    grid-template-columns:82px 1fr;
    gap:12px;
    align-items:center;
  }

  .theoryTitleBlock__logo{
    width:78px !important;
    max-width:78px !important;
    height:auto !important;
    align-self:center;
  }

  .theoryTitleBlock h1{
    font-size:clamp(30px, 9vw, 44px) !important;
    line-height:1.02;
  }

  .theoryKicker,
  .theorySubtitle{
    font-size:14px;
  }

  .lav-document-body h1,
  .lav-document-body h2,
  .lav-document-body h3,
  .lav-rich-text h1,
  .lav-rich-text h2,
  .lav-rich-text h3,
  .nodLongContent h1,
  .nodLongContent h2,
  .nodLongContent h3{
    overflow-wrap:anywhere;
  }

  .theoryDefinitionGrid,
  .useGrid,
  .memoGrid,
  .nodFormulaRow,
  .nodFormulaRow--four,
  .nodUseGrid,
  .nodCompareGrid,
  .nodCardsGrid{
    grid-template-columns:1fr !important;
    gap:12px;
  }

  .theoryDefinitionCard,
  .theoryNote,
  .theorySteps,
  .theoryFormulaCard,
  .memoCard,
  .theoryFinalNote,
  .nodCutBox,
  .nodExampleBlock,
  .nodRuleCard,
  .nodTaskCard{
    max-width:100%;
    overflow:hidden;
  }

  .lav-document-body table,
  .lav-rich-text table,
  .nodLongContent table{
    width:100%;
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    white-space:nowrap;
  }

  .lav-document-body video,
  .lav-rich-text video,
  .lav-document-body img,
  .lav-rich-text img{
    max-width:100%;
    height:auto;
  }

  .bigFormula,
  .lav-formula,
  .nodMath,
  .nodFormulaRow{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .factorBlock,
  .euclidBox,
  .factorizerBoard,
  .animationDisplayBox,
  .animationExplain,
  .lav-interactive-factorizer{
    max-width:100%;
    overflow-x:auto;
  }
}

@media (max-width: 430px){
  .lav-document-page,
  .lav-doc-shell,
  .lav-doc-shell--nod-long{
    padding:22px 12px !important;
  }

  .lav-document-body,
  .lav-rich-text,
  .lav-theory-doc,
  .lav-nod-long-doc{
    font-size:15px;
  }

  .theoryTitleBlock{
    grid-template-columns:64px 1fr;
  }

  .theoryTitleBlock__logo{
    width:60px !important;
    max-width:60px !important;
  }

  .theoryTitleBlock h1{
    font-size:clamp(26px, 10vw, 36px) !important;
  }

  .nodFormulaRow{
    font-size:18px;
  }

  .nodLead:first-letter{
    font-size:34px;
  }
}

/* Редактор на телефоне: панели складываются, чтобы не вызывать горизонтальный скролл */
@media (max-width: 900px){
  .editorBody .editorShell{
    grid-template-columns:1fr;
  }

  .editorBody .editorSidebar,
  .editorBody .editorInspector{
    max-height:none;
  }

  .editorBody .editorTopbar,
  .editorBody .ribbon{
    flex-wrap:wrap;
  }
}

/* =========================
   Мобильная адаптация v2: сохраняем сетку и формат Text-страниц
   =========================
   Цель: не упрощать дизайн до одной карточки в ряд.
   Карточки остаются сеткой 2–3, если ширина экрана это позволяет.
   Text-страницы сохраняют исходный формат листа и прокручиваются по горизонтали внутри области просмотра.
*/

@media (max-width: 1180px){
  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus{
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap:14px;
    align-items:stretch;
  }

  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap:18px;
    align-items:stretch;
  }
}

@media (max-width: 900px){
  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap:12px;
  }

  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap:12px;
  }

  .card,
  .classCard,
  .classGrid--focus .classCard,
  .gradeTheoryCard,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    width:auto !important;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
  }

  .classCard,
  .classGrid--focus .classCard{
    height:auto !important;
    min-height:0 !important;
  }

  .gradeTheoryCard,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    grid-template-columns: 1fr;
    height:auto !important;
    min-height:0 !important;
    gap:10px;
    padding:12px;
  }

  .gradeTheoryCard__preview,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
    width:100%;
    height:clamp(120px, 26vw, 158px) !important;
    min-height:120px !important;
  }

  .gradeTheoryCard h3{
    font-size:clamp(17px, 3.2vw, 22px);
    line-height:1.12;
  }

  .gradeTheoryCard p{
    font-size:clamp(12px, 2.6vw, 14px);
    line-height:1.35;
  }
}

@media (max-width: 720px){
  .container{
    padding-left:12px;
    padding-right:12px;
  }

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

  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap:10px;
  }

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

  .card h2{
    font-size:clamp(18px, 5vw, 22px);
    line-height:1.15;
  }

  .classCard{
    padding:12px !important;
    border-radius:22px;
  }

  .classCard__preview,
  .classGrid--focus .classCard__preview{
    height:clamp(126px, 32vw, 165px) !important;
    min-height:126px !important;
    border-radius:18px;
  }

  .classCard__body,
  .classCard__body--stacked,
  .classGrid--focus .classCard__body,
  .classGrid--focus .classCard__body--stacked{
    grid-template-columns: 1fr !important;
    gap:7px;
  }

  .classCard__title,
  .classGrid--focus .classCard__title{
    font-size:clamp(19px, 5vw, 23px);
    white-space:normal;
  }

  .classCard__topics,
  .classGrid--focus .classCard__topics{
    font-size:clamp(12px, 3.3vw, 14px);
    line-height:1.22;
    max-height:none;
    padding-left:16px;
  }

  .gradeTheoryCard{
    border-radius:20px;
    padding:11px;
  }

  .gradeTheoryCard__preview,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
    height:clamp(108px, 28vw, 145px) !important;
    min-height:108px !important;
  }

  .gradeTheoryCard__tag{
    font-size:10.5px;
  }

  .gradeTheoryCard h3{
    font-size:clamp(16px, 4.3vw, 20px);
  }

  .gradeTheoryCard p{
    font-size:clamp(11.5px, 3.2vw, 13.5px);
    -webkit-line-clamp:3;
  }
}

@media (max-width: 430px){
  .container{
    padding-left:8px;
    padding-right:8px;
  }

  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus,
  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .card,
  .classCard,
  .gradeTheoryCard{
    padding:10px !important;
  }
}

@media (max-width: 340px){
  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus,
  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:1fr !important;
  }
}

/* Text-страницы: сохраняем исходный формат листа, не сжимаем дизайн в узкую мобильную колонку. */
@media (max-width: 760px){
  main:has(.lav-document-page),
  main:has(.lav-doc-shell),
  main:has(.lav-doc-shell--nod-long){
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-left:10px;
    padding-right:10px;
  }

  .lav-document-page,
  .lav-doc-shell,
  .lav-doc-shell--nod-long{
    width:900px !important;
    max-width:none !important;
    min-width:900px !important;
    min-height:1180px;
    padding:74px 76px !important;
    margin:0;
    overflow:visible;
    border-radius:0;
  }

  .lav-document-body,
  .lav-rich-text,
  .lav-theory-doc,
  .lav-nod-long-doc{
    font-size:18px !important;
    line-height:1.65 !important;
  }

  .theoryTitleBlock{
    display:flex !important;
    grid-template-columns:unset !important;
    gap:22px !important;
    align-items:flex-start !important;
  }

  .theoryTitleBlock__logo{
    width:auto !important;
    max-width:none !important;
    height:auto !important;
  }

  .theoryTitleBlock h1{
    font-size:inherit;
  }

  .theoryDefinitionGrid,
  .useGrid,
  .memoGrid,
  .nodFormulaRow,
  .nodFormulaRow--four,
  .nodUseGrid,
  .nodCompareGrid,
  .nodCardsGrid{
    grid-template-columns:revert !important;
  }
}


/* =========================
   Мобильная адаптация v3: масштабирование без ломки макета
   ========================= */
:root{
  --lav-phone-side-gap: 10px;
}

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

@media (max-width: 980px){
  .container{
    max-width:100%;
    padding-left:14px;
    padding-right:14px;
  }

  /* Главная ближе к компьютерной: текст слева, логотип справа, а не всё одним столбиком. */
  .hero--home .hero__panel{
    padding:20px 18px;
    border-radius:24px;
  }
  .hero__grid{
    grid-template-columns:minmax(0, 1.35fr) minmax(150px, .65fr) !important;
    gap:16px;
    align-items:center;
  }
  .hero__content h1{
    font-size:clamp(30px, 5.4vw, 42px);
    line-height:1.08;
  }
  .hero__buttons{
    flex-direction:row !important;
    align-items:center;
    gap:10px;
  }
  .hero__buttons .btn{
    flex:0 1 auto !important;
    width:auto !important;
    min-height:42px;
    white-space:nowrap;
  }
  .hero__art{
    justify-content:center !important;
    overflow:visible;
  }
  .hero__art[style]{
    width:auto !important;
    height:auto !important;
    transform:none !important;
  }
  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    width:auto !important;
    height:min(245px, 34vw) !important;
    max-width:min(245px, 38vw) !important;
    max-height:245px !important;
    object-fit:contain;
    object-position:center;
  }

  /* Верхний блок страницы класса тоже держим ближе к десктопному, но без гигантской картинки. */
  .classDetail,
  .classDetail--focused{
    grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) !important;
    gap:14px;
    align-items:stretch;
  }
  .classDetail__hero,
  .classDetail__panel,
  .classDetail--focused .classDetail__hero,
  .classDetail--focused .classDetail__panel{
    min-height:0 !important;
    height:auto !important;
    padding:14px;
    border-radius:24px;
  }
  .classDetail__hero img,
  .classDetail__heroArt{
    width:100%;
    min-height:0 !important;
    height:clamp(190px, 34vw, 300px) !important;
    max-height:300px !important;
    object-fit:contain !important;
    object-position:center;
    border-radius:18px;
  }
  .classDetail__panel h2{
    font-size:clamp(24px, 4.6vw, 38px);
    line-height:1.05;
    overflow-wrap:normal;
    word-break:normal;
  }
  .classDetail__panel p,
  .classDetail__panel li{
    font-size:clamp(14px, 2.2vw, 16px);
    line-height:1.45;
  }

  /* Карточки классов и обычные карточки: 2-3 в ряд, насколько позволяет экран. */
  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus{
    grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)) !important;
    gap:14px;
  }

  /* Карточки тем: не одна в строку на обычном телефоне/планшете. */
  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap:16px;
  }
  .gradeTheoryCard,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    height:auto;
    min-height:178px;
  }
}

@media (max-width: 720px){
  .container{
    padding-left:10px;
    padding-right:10px;
  }
  .hero--home .hero__panel{
    padding:18px 14px;
  }
  .hero__grid{
    grid-template-columns:minmax(0, 1.3fr) minmax(118px, .7fr) !important;
    gap:10px;
  }
  .hero__content h1{
    font-size:clamp(25px, 6.4vw, 36px);
  }
  .lead{
    font-size:clamp(13px, 3.2vw, 15px);
  }
  .hero__buttons .btn{
    padding:9px 12px;
    font-size:clamp(13px, 3.1vw, 15px);
  }
  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    height:min(205px, 38vw) !important;
    max-width:min(205px, 36vw) !important;
    max-height:205px !important;
  }

  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:12px;
  }
  .card,
  .classCard,
  .classGrid--focus .classCard{
    min-width:0;
    width:auto;
    height:auto;
    padding:13px;
  }
  .card h2,
  .classCard__title{
    font-size:clamp(18px, 5vw, 23px);
    line-height:1.12;
  }
  .classCard__preview,
  .classGrid--focus .classCard__preview{
    height:clamp(118px, 31vw, 168px) !important;
    min-height:118px !important;
  }
  .classCard__body,
  .classCard__body--stacked,
  .classGrid--focus .classCard__body,
  .classGrid--focus .classCard__body--stacked{
    grid-template-columns:1fr;
    gap:8px;
  }
  .classCard__topics{
    font-size:clamp(12px, 3.4vw, 15px);
    line-height:1.22;
  }

  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:12px;
  }
  .gradeTheoryCard,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard{
    grid-template-columns:1fr !important;
    gap:10px;
    min-height:0;
    padding:12px;
    border-radius:20px;
  }
  .gradeTheoryCard__preview,
  .gradeTheoryGrid[data-grade-topic-grid] .gradeTheoryCard__preview{
    width:100%;
    min-height:108px !important;
    height:clamp(108px, 27vw, 145px) !important;
  }
  .gradeTheoryCard h3{
    font-size:clamp(17px, 4.5vw, 22px);
    line-height:1.12;
  }
  .gradeTheoryCard p{
    font-size:clamp(12px, 3.3vw, 14px);
    line-height:1.35;
  }
}

@media (max-width: 520px){
  .classDetail,
  .classDetail--focused{
    grid-template-columns:1fr !important;
  }
  .classDetail__hero img,
  .classDetail__heroArt{
    height:clamp(170px, 45vw, 250px) !important;
  }
}

@media (max-width: 390px){
  .hero__grid{
    grid-template-columns:minmax(0, 1fr) minmax(96px, .48fr) !important;
  }
  .hero__content h1{
    font-size:clamp(22px, 6.9vw, 30px);
  }
  .hero__buttons{
    gap:7px;
  }
  .hero__buttons .btn{
    padding:8px 9px;
    font-size:12px;
  }
  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    height:150px !important;
    max-width:115px !important;
    max-height:150px !important;
  }
}

@media (max-width: 340px){
  .grid,
  .grid--2,
  .classGrid,
  .cards-grid,
  .classGrid--focus,
  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:1fr !important;
  }
}

/* Text-страницы: единое масштабирование всего листа вместо перестройки элементов по отдельности. */
body.lav-document-scaled{
  overflow-x:hidden;
}
.lavMobileDocScaleWrap{
  width:100%;
  max-width:100%;
  margin:0 auto;
  overflow:visible;
  position:relative;
}
.lavMobileDocScaleWrap > .lav-document-page{
  transform-origin:top left;
  will-change:transform;
}

@media (max-width: 900px){
  body.theoryClientPage .lav-doc-shell,
  body.nodTheoryBody .lav-doc-shell{
    padding:16px var(--lav-phone-side-gap) 42px !important;
    overflow:hidden;
  }
  .theoryClientActions,
  .nodTheoryActions{
    width:100%;
    padding:0 10px;
  }
  .theoryClientActions .theoryPrintButton,
  .nodTheoryActions .nodPrintButton{
    max-width:100%;
    white-space:normal;
  }

  /* Отменяем прежние мобильные перестройки теории: масштабирует JS весь лист целиком. */
  .lav-document-page,
  .lav-document-page.lav-theory-nodnok-page{
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    border-radius:18px;
  }
  .lav-document-page:not(.lav-theory-nodnok-page){
    width:900px !important;
    padding:74px 76px !important;
  }
  .lav-document-page.lav-theory-nodnok-page{
    width:1040px !important;
    padding:54px 58px 72px !important;
  }
  .lav-document-body,
  .lav-rich-text,
  .lav-theory-doc,
  .lav-nod-long-doc{
    font-size:18px !important;
    line-height:1.65 !important;
  }
  .lav-theory-nodnok-page .lav-nod-long-doc{
    line-height:1.46 !important;
  }
  .theoryTitleBlock{
    display:grid !important;
    grid-template-columns:90px 1fr auto !important;
    gap:20px !important;
    align-items:start !important;
  }
  .theoryTitleBlock__logo{
    width:78px !important;
    max-width:78px !important;
    height:auto !important;
  }
  .theoryTitleBlock__badge{
    grid-column:auto !important;
    width:auto !important;
    height:58px !important;
    padding:0 !important;
    border-radius:0 0 0 18px !important;
  }
  .theoryTitleBlock h1{
    font-size:50px !important;
    line-height:.96 !important;
  }
  .theoryTitleBlock h1 span{
    font-size:52px !important;
  }
  .theoryDefinitionGrid,
  .useGrid,
  .memoGrid{
    grid-template-columns:repeat(2, 1fr) !important;
  }
  .nodTwoCols,
  .nodCompare,
  .nodMistakeGrid{
    grid-template-columns:1fr 1fr !important;
  }
  .nodThreeCols,
  .nodFactorGrid,
  .nodFormulaRow{
    grid-template-columns:repeat(3, 1fr) !important;
  }
  .nodFormulaRow--four{
    grid-template-columns:repeat(4, 1fr) !important;
  }
}

@media (orientation: landscape) and (max-height: 520px){
  .header{
    position:sticky;
  }
  .hero--home .hero__panel{
    padding-top:14px;
    padding-bottom:14px;
  }
  .hero__content h1{
    font-size:clamp(26px, 4.8vw, 36px);
  }
  .hero__img[src$="lavmath-style1-logo-transparent.png"],
  .hero__img{
    height:min(180px, 42vh) !important;
    max-height:180px !important;
  }
  .classDetail__hero img,
  .classDetail__heroArt{
    height:min(220px, 48vh) !important;
  }
}


/* =========================
   Мобильная адаптация v4: правки меню, главной, поиска и Text-страниц
   ========================= */

/* Общая стабилизация ширины: элементы не должны растягивать body. */
html, body{
  max-width:100%;
  overflow-x:hidden;
}
*{
  box-sizing:border-box;
}

/* 1) Главная: кнопки держим одной аккуратной строкой, пока это реально помещается. */
@media (max-width: 980px){
  .hero--home .hero__panel{
    overflow:hidden;
  }
  .hero__grid{
    grid-template-columns:minmax(0, 1.28fr) minmax(132px, .72fr) !important;
  }
  .hero__content{
    min-width:0;
  }
  .hero__buttons{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:10px !important;
    max-width:100%;
  }
  .hero__buttons .btn{
    flex:0 1 auto !important;
    width:auto !important;
    min-width:0 !important;
    white-space:nowrap !important;
    padding:9px 13px !important;
    font-size:clamp(12px, 2.15vw, 16px) !important;
  }
  .hero__buttons .btn--ghost{
    padding-left:12px !important;
    padding-right:12px !important;
  }
}

@media (max-width: 430px){
  .hero__grid{
    grid-template-columns:minmax(0, 1.22fr) minmax(86px, .48fr) !important;
    gap:8px !important;
  }
  .hero__buttons{
    gap:6px !important;
  }
  .hero__buttons .btn{
    padding:8px 8px !important;
    font-size:11.5px !important;
    border-radius:11px !important;
  }
}

/* На совсем узких телефонах кнопки можно переносить, но без наложения. */
@media (max-width: 350px){
  .hero__buttons{
    flex-wrap:wrap !important;
  }
  .hero__buttons .btn{
    flex:1 1 140px !important;
    justify-content:center;
  }
}

/* 2) Мобильное меню: компактный выпадающий блок, без пустых полей и бокового улёта подменю. */
@media (max-width: 980px){
  .header{
    width:100%;
    z-index:500 !important;
  }
  .header__row{
    position:relative !important;
    width:100%;
  }
  .mobileNavToggle{
    display:inline-flex !important;
    margin-left:auto;
    flex:0 0 auto;
    z-index:2;
  }
  .header .nav{
    position:absolute !important;
    top:calc(100% + 8px) !important;
    right:0 !important;
    left:auto !important;
    width:min(360px, calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100vh - 86px) !important;
    overflow:auto !important;
    display:none !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:6px !important;
    padding:12px !important;
    margin:0 !important;
    border:1px solid rgba(122,45,187,.18) !important;
    border-radius:18px !important;
    background:rgba(255,255,255,.98) !important;
    backdrop-filter:blur(12px);
    box-shadow:0 22px 52px rgba(21,18,35,.18) !important;
  }
  .header.is-mobile-open .nav{
    display:flex !important;
  }
  .header .nav > a,
  .header .nav .dropdown__toggle,
  .header .nav .dropdown__item{
    width:100% !important;
    min-height:40px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    padding:9px 10px !important;
    border-radius:12px !important;
    font-size:17px !important;
    line-height:1.2 !important;
    white-space:normal !important;
  }
  .header .nav .dropdown{
    width:100% !important;
    display:block !important;
    position:relative !important;
  }
  .header .nav .dropdown__menu,
  .header .nav .dropdown__submenu{
    position:static !important;
    inset:auto !important;
    transform:none !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    display:none !important;
    margin:4px 0 0 !important;
    padding:7px !important;
    border-radius:14px !important;
    border:1px solid rgba(122,45,187,.12) !important;
    background:rgba(248,242,255,.64) !important;
    box-shadow:none !important;
  }
  .header .nav .dropdown.is-open > .dropdown__menu,
  .header .nav .dropdown:focus-within > .dropdown__menu{
    display:block !important;
  }
  .header .nav .dropdown__group{
    position:relative !important;
    display:block !important;
  }
  .header .nav .dropdown__group.is-open > .dropdown__submenu,
  .header .nav .dropdown__group:focus-within > .dropdown__submenu{
    display:block !important;
  }
  .header .nav .dropdown__submenu{
    margin-left:8px !important;
    width:calc(100% - 8px) !important;
  }
}

/* 3) Поиск на странице класса: убираем гигантскую пустую область. */
@media (max-width: 980px){
  .gradeTopicsToolbar{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) auto !important;
    align-items:end !important;
    gap:12px !important;
    min-height:0 !important;
    height:auto !important;
    padding:14px !important;
    margin:16px 0 18px !important;
  }
  .gradeTopicsSearch{
    display:grid !important;
    gap:7px !important;
    flex:initial !important;
    min-width:0 !important;
    height:auto !important;
  }
  .gradeTopicsSearch input{
    height:42px !important;
    min-height:42px !important;
    padding:8px 12px !important;
  }
  .gradeTopicsView{
    align-self:end !important;
    display:flex !important;
    flex-wrap:wrap !important;
    justify-content:flex-end !important;
    gap:7px !important;
  }
  .gradeTopicsView button{
    width:auto !important;
    min-height:38px !important;
    padding:8px 11px !important;
    white-space:nowrap !important;
  }
}
@media (max-width: 620px){
  .gradeTopicsToolbar{
    grid-template-columns:1fr !important;
  }
  .gradeTopicsView{
    justify-content:flex-start !important;
  }
}

/* 4) Text-страницы: масштабируем именно лист, а шапку/кнопки сайта не трогаем. */
body.theoryClientPage,
body.nodTheoryBody{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
}
body.theoryClientPage .header,
body.nodTheoryBody .header{
  width:100% !important;
  max-width:100% !important;
}
body.theoryClientPage .header__row,
body.nodTheoryBody .header__row{
  width:100% !important;
}
@media (max-width: 900px){
  body.theoryClientPage .lav-doc-shell,
  body.nodTheoryBody .lav-doc-shell,
  body.nodTheoryBody .lav-doc-shell--nod-long{
    width:100% !important;
    max-width:100% !important;
    overflow:hidden !important;
    padding:14px 10px 40px !important;
  }
  .lavMobileDocScaleWrap{
    width:100% !important;
    max-width:100% !important;
    overflow:hidden !important;
    margin:0 auto !important;
    transform:none !important;
  }
  .lavMobileDocScaleWrap > .lav-document-page{
    transform-origin:top left !important;
    will-change:transform;
  }
  .theoryClientActions,
  .nodTheoryActions{
    width:100% !important;
    max-width:100% !important;
    justify-content:center !important;
    padding:0 10px !important;
    margin:12px auto 0 !important;
  }
  .theoryClientActions .theoryPrintButton,
  .nodTheoryActions .nodPrintButton{
    max-width:100% !important;
  }
}

/* В горизонтальной ориентации телефон получает больше ширины, поэтому можно чуть раскрыть сетки и не ломать hero. */
@media (orientation: landscape) and (max-height: 560px){
  .header .nav{
    max-height:calc(100vh - 70px) !important;
  }
  .hero__grid{
    grid-template-columns:minmax(0, 1.35fr) minmax(150px, .65fr) !important;
  }
  .hero__buttons{
    flex-wrap:nowrap !important;
  }
  .gradeTheoryGrid,
  .gradeTheoryGrid--two[data-grade-topic-grid],
  .gradeTheoryGrid--one[data-grade-topic-grid]{
    grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)) !important;
  }
}


/* =========================
   Мобильная адаптация v5: меню без сдвига, таблицы Text-страниц
   ========================= */
@media (max-width: 980px){
  .header{
    z-index:900 !important;
  }
  .header__row{
    position:relative !important;
  }
  .mobileNavToggle{
    display:inline-flex !important;
    position:relative !important;
    z-index:902 !important;
    margin-left:auto !important;
  }

  /* Меню открывается как фиксированная панель в пределах экрана, а не как блок, сдвигающий страницу. */
  .header .nav{
    position:fixed !important;
    top:72px !important;
    left:16px !important;
    right:16px !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    max-height:calc(100dvh - 88px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    display:none !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:6px !important;
    padding:14px !important;
    margin:0 !important;
    border:1px solid rgba(122,45,187,.18) !important;
    border-radius:20px !important;
    background:rgba(255,255,255,.985) !important;
    backdrop-filter:blur(14px) !important;
    box-shadow:0 24px 58px rgba(21,18,35,.18) !important;
    transform:none !important;
  }
  .header.is-mobile-open .nav{
    display:flex !important;
  }
  .header .nav > a,
  .header .nav .dropdown__toggle,
  .header .nav .dropdown__item{
    width:100% !important;
    min-height:42px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    padding:10px 12px !important;
    border-radius:14px !important;
    font-size:18px !important;
    line-height:1.2 !important;
    white-space:normal !important;
    text-decoration:none !important;
  }
  .header .nav > a:hover,
  .header .nav .dropdown__toggle:hover,
  .header .nav .dropdown__item:hover,
  .header .nav .dropdown.is-open > .dropdown__toggle,
  .header .nav .dropdown__group.is-open > .dropdown__item--has-sub{
    background:rgba(122,45,187,.08) !important;
  }
  .header .nav .dropdown,
  .header .nav .dropdown__group{
    position:static !important;
    width:100% !important;
    display:block !important;
  }

  /* ВАЖНО: подменю только внутри панели, строго под пунктом. Никакого absolute/right. */
  .header .nav .dropdown__menu,
  .header .nav .dropdown__submenu{
    position:static !important;
    inset:auto !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    transform:none !important;
    translate:none !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    display:none !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    margin:6px 0 0 !important;
    padding:6px !important;
    border:1px solid rgba(122,45,187,.12) !important;
    border-radius:16px !important;
    background:rgba(248,242,255,.70) !important;
    box-shadow:none !important;
  }
  .header .nav .dropdown__submenu::before,
  .header .nav .dropdown__menu::before{
    display:none !important;
    content:none !important;
  }
  .header .nav .dropdown.is-open > .dropdown__menu{
    display:block !important;
  }
  .header .nav .dropdown__group.is-open > .dropdown__submenu{
    display:block !important;
  }
  .header .nav .dropdown__submenu{
    margin-left:0 !important;
    width:100% !important;
    max-height:none !important;
  }
  .header .nav .dropdown__submenu .dropdown__item{
    padding-left:18px !important;
    font-size:17px !important;
  }
}

@media (max-width: 430px){
  .header .nav{
    top:70px !important;
    left:10px !important;
    right:10px !important;
    max-height:calc(100dvh - 82px) !important;
    padding:12px !important;
  }
  .header .nav > a,
  .header .nav .dropdown__toggle,
  .header .nav .dropdown__item{
    font-size:17px !important;
  }
}

/* Text-страницы: таблицы должны масштабироваться вместе с листом, а не становиться отдельными мобильными блоками. */
@media (max-width: 900px){
  body.lav-document-scaled .lav-document-page table,
  body.lav-document-scaled .lav-document-page .lav-document-body table,
  body.lav-document-scaled .lav-document-page .lav-rich-text table,
  body.lav-document-scaled .lav-document-page .nodLongContent table{
    display:table !important;
    width:100% !important;
    max-width:100% !important;
    table-layout:fixed !important;
    overflow:visible !important;
    white-space:normal !important;
    border-collapse:collapse;
  }
  body.lav-document-scaled .lav-document-page thead{
    display:table-header-group !important;
  }
  body.lav-document-scaled .lav-document-page tbody{
    display:table-row-group !important;
  }
  body.lav-document-scaled .lav-document-page tr{
    display:table-row !important;
  }
  body.lav-document-scaled .lav-document-page th,
  body.lav-document-scaled .lav-document-page td{
    display:table-cell !important;
    white-space:normal !important;
    overflow:visible !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
    vertical-align:top;
  }

  /* Широкие карточки/примеры внутри листа не должны принудительно получать мобильную ширину: их уменьшает общий scale. */
  body.lav-document-scaled .lav-document-page .nodMethodCard,
  body.lav-document-scaled .lav-document-page .nodRuleCard,
  body.lav-document-scaled .lav-document-page .nodCutBox,
  body.lav-document-scaled .lav-document-page .theoryDefinitionCard,
  body.lav-document-scaled .lav-document-page .theoryNote,
  body.lav-document-scaled .lav-document-page .theorySteps,
  body.lav-document-scaled .lav-document-page .theoryFormulaCard{
    max-width:100% !important;
  }
}

@media (orientation: landscape) and (max-height: 560px){
  .header .nav{
    top:58px !important;
    max-height:calc(100dvh - 66px) !important;
  }
}


/* =========================
   Мобильное меню v6: accordion без сдвига и пустых областей
   ========================= */
@media (max-width: 980px){
  .header{
    z-index:1000 !important;
  }

  .header__row{
    position:relative !important;
  }

  .mobileNavToggle{
    display:inline-flex !important;
    flex:0 0 auto;
    position:relative;
    z-index:1002;
  }

  .header .nav{
    position:absolute !important;
    top:calc(100% + 10px) !important;
    left:10px !important;
    right:10px !important;
    width:auto !important;
    max-width:none !important;
    display:none !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:8px !important;
    padding:14px !important;
    border:1px solid rgba(122,45,187,.18) !important;
    border-radius:20px !important;
    background:#fff !important;
    box-shadow:0 24px 60px rgba(36,26,47,.20) !important;
    max-height:calc(100dvh - 92px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch;
    z-index:1001 !important;
  }

  .header.is-mobile-open .nav{
    display:flex !important;
  }

  .header .nav > a,
  .header .nav .dropdown__toggle,
  .header .nav .dropdown__item{
    width:100% !important;
    min-height:42px !important;
    box-sizing:border-box !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    padding:10px 12px !important;
    border-radius:14px !important;
    white-space:normal !important;
    text-decoration:none !important;
    color:var(--text) !important;
  }

  .header .nav .dropdown,
  .header .nav .dropdown__group{
    width:100% !important;
    position:static !important;
    display:block !important;
  }

  .header .nav .dropdown__menu,
  .header .nav .dropdown__submenu{
    position:static !important;
    inset:auto !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    min-width:0 !important;
    width:100% !important;
    max-width:100% !important;
    display:none !important;
    margin:6px 0 0 !important;
    padding:8px !important;
    box-sizing:border-box !important;
    border:1px solid rgba(122,45,187,.14) !important;
    border-radius:16px !important;
    background:rgba(248,242,255,.70) !important;
    box-shadow:none !important;
    transform:none !important;
    opacity:1 !important;
    visibility:visible !important;
    overflow:visible !important;
  }

  .header .nav .dropdown__submenu{
    margin-left:0 !important;
    padding-left:10px !important;
    background:rgba(255,255,255,.78) !important;
  }

  .header .nav .dropdown__menu::before,
  .header .nav .dropdown__submenu::before{
    display:none !important;
    content:none !important;
  }

  /* На мобильном запрещаем hover/focus-within открытие: только JS-класс .is-open. */
  .header .nav .dropdown:hover > .dropdown__menu,
  .header .nav .dropdown:focus-within > .dropdown__menu,
  .header .nav .dropdown__group:hover > .dropdown__submenu,
  .header .nav .dropdown__group:focus-within > .dropdown__submenu{
    display:none !important;
  }

  .header .nav .dropdown.is-open > .dropdown__menu,
  .header .nav .dropdown__group.is-open > .dropdown__submenu{
    display:block !important;
  }

  .header .nav .dropdown__toggle,
  .header .nav .dropdown__item--has-sub{
    justify-content:space-between !important;
    cursor:pointer !important;
  }

  .header .nav .dropdown.is-open > .dropdown__toggle,
  .header .nav .dropdown__group.is-open > .dropdown__item--has-sub{
    background:rgba(122,45,187,.10) !important;
    color:var(--accent) !important;
  }

  .header .nav .dropdown__submenu .dropdown__item{
    padding-left:18px !important;
  }
}

/* Text-страницы v6: таблицы остаются таблицами внутри масштабируемого листа. */
@media (max-width: 900px){
  body.lav-document-scaled .lav-document-page table,
  body.lav-document-scaled .lav-doc-shell table{
    display:table !important;
    width:100% !important;
    max-width:100% !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    overflow:visible !important;
    white-space:normal !important;
  }

  body.lav-document-scaled .lav-document-page thead,
  body.lav-document-scaled .lav-doc-shell thead{
    display:table-header-group !important;
  }

  body.lav-document-scaled .lav-document-page tbody,
  body.lav-document-scaled .lav-doc-shell tbody{
    display:table-row-group !important;
  }

  body.lav-document-scaled .lav-document-page tr,
  body.lav-document-scaled .lav-doc-shell tr{
    display:table-row !important;
  }

  body.lav-document-scaled .lav-document-page th,
  body.lav-document-scaled .lav-document-page td,
  body.lav-document-scaled .lav-doc-shell th,
  body.lav-document-scaled .lav-doc-shell td{
    display:table-cell !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
    min-width:0 !important;
  }
}


/* =========================
   Мобильное меню v7: отдельная панель без сдвига desktop dropdown
   ========================= */
.lavMobileMenuPanel{
  display:none;
}

@media (max-width: 980px){
  .header{
    z-index:1200 !important;
  }

  .header__row{
    position:relative !important;
  }

  .mobileNavToggle{
    display:inline-flex !important;
    position:relative;
    z-index:1202 !important;
  }

  /* На телефоне полностью отключаем старое desktop-меню, чтобы оно не уезжало вправо. */
  .header .nav{
    display:none !important;
  }

  .lavMobileMenuPanel{
    position:absolute !important;
    top:calc(100% + 10px) !important;
    left:10px !important;
    right:10px !important;
    width:auto !important;
    max-width:none !important;
    box-sizing:border-box !important;
    display:none;
    padding:14px !important;
    border:1px solid rgba(122,45,187,.18) !important;
    border-radius:20px !important;
    background:rgba(255,255,255,.98) !important;
    box-shadow:0 24px 60px rgba(36,26,47,.20) !important;
    max-height:calc(100dvh - 92px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch;
    z-index:1201 !important;
  }

  .header.is-mobile-open .lavMobileMenuPanel{
    display:block !important;
  }

  .lavMobileMenuLink,
  .lavMobileMenuToggle{
    width:100% !important;
    min-height:44px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    box-sizing:border-box !important;
    padding:10px 12px !important;
    border:0 !important;
    border-radius:14px !important;
    background:transparent !important;
    color:var(--text) !important;
    font:inherit !important;
    font-size:18px !important;
    text-align:left !important;
    text-decoration:none !important;
    cursor:pointer !important;
  }

  .lavMobileMenuLink:hover,
  .lavMobileMenuToggle:hover,
  .lavMobileMenuToggle.is-open{
    background:rgba(122,45,187,.10) !important;
    color:var(--accent) !important;
    text-decoration:none !important;
  }

  .lavMobileMenuSection{
    display:none !important;
    margin:6px 0 8px !important;
    padding:8px !important;
    border:1px solid rgba(122,45,187,.14) !important;
    border-radius:16px !important;
    background:rgba(248,242,255,.72) !important;
    box-sizing:border-box !important;
  }

  .lavMobileMenuSection.is-open{
    display:block !important;
  }

  .lavMobileMenuSection--sub{
    margin:4px 0 8px !important;
    padding:6px 6px 6px 14px !important;
    background:rgba(255,255,255,.78) !important;
  }

  .lavMobileMenuToggle--sub{
    font-size:17px !important;
  }

  .lavMobileMenuSection--sub .lavMobileMenuLink{
    font-size:17px !important;
    padding-left:16px !important;
  }
}

@media (min-width: 981px){
  .lavMobileMenuPanel,
  .mobileNavToggle{
    display:none !important;
  }
}


/* ═══════════════════════════════════════════════
   Fraction pie-circle component — SVG upgraded
   ═══════════════════════════════════════════════ */
.frac-pie.frac-pie--svg{
  width:92px;
  height:92px;
  min-width:92px;
  min-height:92px;
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}

.frac-pie.frac-pie--svg::before,
.frac-pie.frac-pie--svg::after{
  display:none !important;
  content:none !important;
}

.frac-pie.frac-pie--svg > i{
  display:none !important;
}

.frac-pie__svg{
  display:block;
  width:100%;
  height:100%;
}

.frac-pie-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0;
  flex-wrap:wrap;
}

.frac-pie-row .frac-pie__label{
  font-weight:800;
  color:#7a2dbb;
  margin:0 8px 0 2px;
}

@media (max-width: 760px){
  .frac-pie.frac-pie--svg{
    width:82px;
    height:82px;
    min-width:82px;
    min-height:82px;
  }
}


/* Editable fraction diagrams */
.frac-pie.lav-fraction-diagram{
  cursor: default;
  user-select: none;
  box-sizing: border-box;
}

.editorBody .frac-pie.lav-fraction-diagram,
.frac-pie.lav-fraction-diagram.lav-editor-selected{
  outline-offset: 4px;
}

.frac-pie.frac-pie--svg[style]{
  max-width: none;
}

.frac-pie.frac-pie--svg .frac-pie__svg{
  pointer-events: none;
}

.frac-pie__text{ pointer-events:none; font-family:inherit; }


/* LaTeX editor: visible spaces and left-aligned multiline formulas */
.formulaInput{
  min-height:92px;
  white-space:pre-wrap;
  tab-size:2;
}

.formulaInput--compact{
  min-height:72px;
}

.formulaPreview{
  text-align:left;
  align-items:flex-start;
  justify-content:flex-start;
}

.formulaPreview .katex-display{
  text-align:left;
  margin:0;
}

.lav-formula .katex,
.lav-formula .katex-display{
  text-align:left;
}


/* Movable formulas inserted by the visual editor */
.lav-formula.lav-document-formula{
  display:inline-block;
  vertical-align:baseline;
}


/* Fully editable/resizable example cards in Text pages */
.theoryFormulaCard{
  max-width:none;
  box-sizing:border-box;
  overflow:visible;
}

.theoryFormulaCard[data-lav-resizable-card="true"],
.theoryFormulaCard.lav-document-movable{
  max-width:none !important;
  min-width:180px;
  min-height:80px;
  box-sizing:border-box;
  overflow:visible;
}

.editorBody .theoryFormulaCard[data-lav-resizable-card="true"],
.editorBody .theoryFormulaCard.lav-document-movable{
  resize:both;
  cursor:text;
  outline-offset:4px;
}

.editorBody .theoryFormulaCard[data-lav-resizable-card="true"].lav-editor-selected,
.editorBody .theoryFormulaCard.lav-document-movable.lav-editor-selected{
  max-width:none !important;
  outline:2px solid rgba(122,45,187,.44);
}


/* =========================
   Маскот на карточках и главном экране
   ========================= */
.hero__buttons{
  align-items:flex-end;
  width: fit-content;
  max-width: 100%;
  position: relative;
  padding-right: 138px;
}
.hero__mascot{
  position: absolute;
  left: 246px;
  bottom: -12px;
  width: 118px;
  height: auto;
  margin-left: 0;
  transform: none;
  filter: drop-shadow(0 10px 18px rgba(38,18,53,.12));
  pointer-events:none;
  user-select:none;
  z-index: 3;
}

.classGrid--focus .classCard--featured{
  position: relative;
  padding-bottom: 112px;
  overflow: hidden;
}
.classGrid--focus .classCard--featured .classCard__body,
.classGrid--focus .classCard--featured .classCard__body--stacked{
  position: relative;
  z-index: 2;
}
.classCard__mascot{
  position: absolute;
  left: -2px;
  bottom: -12px;
  width: 156px;
  height: auto;
  pointer-events:none;
  user-select:none;
  filter: drop-shadow(0 10px 18px rgba(38,18,53,.12));
  z-index: 1;
}

@media (max-width: 980px){
  .classGrid--focus .classCard--featured{ padding-bottom: 104px; }
  .classCard__mascot{ width: 146px; bottom:-10px; }
}
@media (max-width: 720px){
  .hero__buttons{
    padding-right: 112px;
  }
  .hero__mascot{
    left: 190px;
    bottom: -10px;
    width: 96px;
    margin-left: 0;
    transform: none;
  }
  .classGrid--focus .classCard--featured{ padding-bottom: 94px; }
  .classCard__mascot{ width: 138px; bottom:-8px; }
}


/* =========================
   PDF materials viewer
   ========================= */
.pdfMaterialBody{ background:linear-gradient(180deg,#fffaf2 0,#f7f0ff 100%); }
.pdfMaterialPage{ padding-bottom:44px; }
.pdfMaterialHero{ display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin:18px 0 20px; padding:26px 30px; border:1px solid rgba(122,45,187,.18); border-radius:26px; background:rgba(255,255,255,.9); box-shadow:0 18px 46px rgba(53,30,77,.08); }
.pdfMaterialHero h1{ margin:4px 0 6px; font-size:clamp(32px,5vw,54px); line-height:1.02; color:var(--text); }
.pdfMaterialSubtitle{ margin:0 0 8px; font-size:clamp(18px,2.3vw,25px); color:var(--accent); font-weight:800; }
.pdfMaterialHero__actions{ display:flex; flex-wrap:wrap; gap:10px; flex:0 0 auto; }
.pdfViewerStage{ position:relative; border:1px solid rgba(122,45,187,.18); border-radius:24px; background:rgba(245,239,250,.9); overflow:hidden; box-shadow:0 20px 60px rgba(53,30,77,.10); }
.pdfViewerToolbar{ position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; border-bottom:1px solid rgba(122,45,187,.16); background:rgba(255,255,255,.94); backdrop-filter:blur(12px); }
.pdfToolbarGroup{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pdfViewerToolbar button{ min-height:38px; padding:7px 12px; border:1px solid rgba(122,45,187,.22); border-radius:12px; background:#fff; color:var(--text); font:inherit; font-weight:750; cursor:pointer; }
.pdfViewerToolbar button:hover{ border-color:var(--accent); color:var(--accent); background:#fbf7ff; }
.pdfViewerStatus{ margin:0; padding:9px 16px; color:#6b5a78; font-size:14px; background:rgba(255,255,255,.72); border-bottom:1px solid rgba(122,45,187,.10); }
.pdfViewerStatus.is-error{ color:#a52144; background:#fff0f3; }
.pdfDocument{ --pdf-zoom:1; display:flex; flex-direction:column; align-items:center; gap:24px; padding:24px; overflow-x:auto; scroll-behavior:smooth; }
.pdfPageShell{ position:relative; width:calc(min(900px, 100%) * var(--pdf-zoom)); max-width:none; scroll-margin-top:78px; transition:width .18s ease; }
.pdfPagePaper{ position:relative; width:100%; background:#fff; border-radius:6px; overflow:hidden; box-shadow:0 14px 40px rgba(27,18,36,.18); }
.pdfPageImage{ display:block; width:100%; height:auto; background:#fff; }
.pdfPageNumber{ display:block; margin-top:8px; text-align:center; font-size:13px; color:#6b5a78; }
.pdfOverlayLayer{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.pdfOverlayItem{ position:absolute; display:block; object-fit:contain; pointer-events:auto; }
.pdfOverlayItem.has-shadow{ filter:drop-shadow(0 8px 16px rgba(35,20,48,.22)); }
.pdfOverlayCard{ display:flex; align-items:center; justify-content:center; padding:10px; border:2px solid var(--accent); background:rgba(255,255,255,.95); color:var(--text); font-weight:800; }
.pdfOverlayInfo{ margin:24px 0 0; padding:22px 26px; border-left:6px solid var(--accent); border-radius:18px; background:#fff; box-shadow:0 12px 34px rgba(53,30,77,.07); }
.pdfOverlayInfo h2{ margin:0 0 8px; }
.pdfOverlayVideoCard{ display:grid; grid-template-columns:minmax(0,1fr) 148px; align-items:center; gap:14px; padding:10px 12px; background:#fff; border:3px solid #6f2ca8; border-radius:24px; pointer-events:auto; box-sizing:border-box; overflow:hidden; }
.pdfOverlayVideoWrap{ display:flex; align-items:center; justify-content:center; justify-self:center; width:auto; max-width:100%; height:100%; aspect-ratio:1472 / 772; min-width:0; min-height:0; overflow:hidden; background:#fff; }
.pdfOverlayVideo{ display:block; width:100%; height:100%; object-fit:contain; object-position:center center; background:#fff; border:0; border-radius:0; }
.pdfOverlayVideoControls{ display:flex; flex-direction:column; justify-content:center; align-items:stretch; gap:12px; min-width:0; height:100%; }
.pdfOverlayControl{ width:100%; min-width:0; height:40px; padding:0 10px; border:2px solid #6f2ca8; border-radius:10px; background:#fff; color:#171019; font:800 15px/1 var(--font-main, inherit); cursor:pointer; box-shadow:none; white-space:nowrap; }
.pdfOverlayControl:hover{ background:#faf5ff; transform:none; }
.pdfOverlayControl:focus-visible{ outline:3px solid rgba(111,44,168,.22); outline-offset:2px; }
.pdfOverlaySpeedControl{ position:relative; width:100%; min-width:0; }
.pdfOverlaySpeedMenu{ position:absolute; right:calc(100% + 8px); top:50%; z-index:5; display:flex; align-items:center; gap:4px; padding:5px; border:2px solid #6f2ca8; border-radius:10px; background:#fff; box-shadow:0 8px 22px rgba(55,25,77,.16); transform:translateY(-50%); white-space:nowrap; }
.pdfOverlaySpeedMenu[hidden]{ display:none!important; }
.pdfOverlaySpeedOption{ min-width:38px; height:28px; padding:0 7px; border:0; border-radius:7px; background:transparent; color:#31153e; font:800 11px/1 var(--font-main, inherit); cursor:pointer; }
.pdfOverlaySpeedOption:hover,.pdfOverlaySpeedOption.is-active{ background:#f0e4f8; color:#6f2ca8; }
.pdfOverlaySpeedOption.is-active{ box-shadow:inset 0 0 0 1px rgba(111,44,168,.2); }
.pdfOverlayItem--videoSlot{ overflow:hidden; box-shadow:none!important; }
@media (max-width: 860px){ .pdfOverlayVideoCard{ grid-template-columns:minmax(0,1fr) 90px; gap:6px; padding:5px 6px; border-width:2px; border-radius:14px; } .pdfOverlayVideoControls{ gap:5px; } .pdfOverlayControl{ height:26px; padding:0 4px; border-width:1.5px; border-radius:7px; font-size:10px; } .pdfOverlaySpeedMenu{ right:calc(100% + 4px); gap:2px; padding:3px; border-width:1.5px; border-radius:7px; } .pdfOverlaySpeedOption{ min-width:28px; height:22px; padding:0 4px; border-radius:5px; font-size:8px; } }
.gradeTheoryCard--pdf{ grid-template-columns:180px 1fr; min-height:230px; border-width:3px; }
.gradeTheoryCard--pdf .gradeTheoryCard__preview{ background:linear-gradient(145deg,#fff7df,#f4eaff); }

@media (max-width:760px){
  .pdfMaterialHero{ align-items:flex-start; flex-direction:column; padding:20px; }
  .pdfMaterialHero__actions{ width:100%; }
  .pdfMaterialHero__actions .btn{ flex:1 1 170px; text-align:center; }
  .pdfViewerToolbar{ align-items:flex-start; flex-direction:column; }
  .pdfDocument{ padding:12px 8px 20px; gap:16px; }
  .pdfPageShell{ width:calc(100% * var(--pdf-zoom)); }
  .gradeTheoryCard--pdf{ grid-template-columns:1fr; }
}

@media print{
  .pdfMaterialHero,.pdfViewerToolbar,.pdfViewerStatus,.pdfOverlayInfo,.header,.footer,.backLink{ display:none!important; }
  .pdfViewerStage{ border:0; box-shadow:none; overflow:visible; }
  .pdfDocument{ display:block; padding:0; }
  .pdfPageShell{ width:100%!important; page-break-after:always; }
  .pdfPagePaper{ box-shadow:none; border-radius:0; }
}


/* =========================
   Continuous PDF document: one long sheet without visual page breaks
   ========================= */
.pdfDocument.pdfDocument--continuous{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0 !important;
  padding:0 !important;
  background:#fff;
  overflow-x:auto;
  scroll-behavior:smooth;
}
.pdfDocument--continuous .pdfPageShell{
  margin:0 !important;
  padding:0 !important;
  line-height:0;
}
.pdfDocument--continuous .pdfPagePaper{
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:hidden;
}
.pdfDocument--continuous .pdfPageImage{
  margin:0 !important;
  padding:0 !important;
  vertical-align:top;
}
.pdfDocument--continuous .pdfPageNumber{
  display:none !important;
}
.pdfViewerStage:has(.pdfDocument--continuous){
  background:#fff;
}
@media (max-width:760px){
  .pdfDocument.pdfDocument--continuous{
    padding:0 !important;
    gap:0 !important;
  }
}


/* =========================
   Public materials page v26
   ========================= */
.visually-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0, 0, 0, 0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

.classDetail--focused .classDetail__panel--titleOnly{
  display:grid;
  place-items:center;
  padding:22px 24px;
}

.classDetail--focused .classDetail__panel--titleOnly h2{
  margin:0;
  font-size:clamp(32px, 4vw, 48px);
  text-align:center;
}

.gradeTheoryShowcase--public{
  margin-top:36px;
}

.materialsSearch{
  position:relative;
  z-index:4;
  width:100%;
  margin:0 0 38px;
}

.materialsSearch__field{
  display:flex;
  align-items:center;
  width:100%;
  min-height:54px;
  border:2px solid rgba(122,45,187,.24);
  border-radius:17px;
  background:#fff;
  box-shadow:0 10px 26px rgba(55,31,72,.08);
  transition:border-color .18s ease, box-shadow .18s ease;
}

.materialsSearch__field:hover{
  border-color:rgba(242,169,0,.72);
}

.materialsSearch__field:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(122,45,187,.10), 0 12px 30px rgba(55,31,72,.10);
}

.materialsSearch__icon{
  flex:0 0 auto;
  width:22px;
  height:22px;
  margin-left:17px;
  color:#786d82;
  pointer-events:none;
}

.materialsSearch input[type="search"]{
  position:relative;
  z-index:2;
  flex:1 1 auto;
  width:100%;
  min-width:0;
  height:50px;
  padding:0 12px;
  border:0;
  border-radius:15px;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-size:17px;
  font-weight:600;
  text-align:left;
  outline:none;
  box-shadow:none;
  cursor:text;
  pointer-events:auto !important;
  appearance:none;
}

.materialsSearch input[type="search"]::placeholder{
  color:#82778b;
  opacity:.92;
}

.materialsSearch input[type="search"]::-webkit-search-cancel-button{
  display:none;
}

.materialsSearch__clear{
  flex:0 0 auto;
  width:36px;
  height:36px;
  margin-right:8px;
  padding:0;
  border:0;
  border-radius:10px;
  background:rgba(122,45,187,.09);
  color:var(--accent);
  font-family:inherit;
  font-size:25px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
}

.materialsSearch__clear:hover,
.materialsSearch__clear:focus-visible{
  background:rgba(122,45,187,.16);
  outline:none;
}

.pdfMaterialHero--clean{
  align-items:center;
  margin-top:22px;
}

.pdfMaterialHero--clean h1{
  margin-top:0;
}

@media (max-width:620px){
  .materialsSearch{
    margin-bottom:26px;
  }

  .materialsSearch__field{
    min-height:48px;
    border-radius:15px;
  }

  .materialsSearch input[type="search"]{
    height:44px;
    font-size:16px;
  }

  .materialsSearch__icon{
    width:20px;
    height:20px;
    margin-left:14px;
  }
}


/* =========================
   Tasks route chooser v27
   ========================= */
body.taskRouteBody{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:#f7f1ec;
}

.taskRouteBody .header{
  background:rgba(255,255,255,.94);
}

.taskRouteMain{
  flex:1 0 auto;
  width:min(calc(100% - 56px), 1100px);
  min-height:560px;
  margin:0 auto;
  padding:58px 24px;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 12% 12%, rgba(242,169,0,.08), transparent 32%),
    radial-gradient(circle at 88% 86%, rgba(122,45,187,.08), transparent 34%),
    #f4eee9;
}

.taskRouteChooser{
  width:min(100%, 590px);
  display:grid;
  gap:22px;
}

.taskRouteCard{
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 170px;
  align-items:center;
  min-height:210px;
  padding:26px 20px 26px 34px;
  overflow:hidden;
  border:4px solid var(--accent);
  border-radius:34px;
  background:rgba(255,255,255,.96);
  color:#180d20;
  text-decoration:none;
  box-shadow:0 16px 38px rgba(58,34,70,.08);
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.taskRouteCard--exams{
  border-color:var(--accent-2);
}

.taskRouteCard:hover{
  transform:translateY(-4px);
  background:#fff;
  box-shadow:0 24px 48px rgba(58,34,70,.14);
  text-decoration:none;
}

.taskRouteCard:focus-visible{
  outline:4px solid rgba(242,169,0,.34);
  outline-offset:5px;
}

.taskRouteCard__content{
  position:relative;
  z-index:2;
  display:grid;
  align-content:center;
  gap:22px;
  min-width:0;
}

.taskRouteCard__content strong{
  max-width:330px;
  font-size:30px;
  line-height:1.12;
  letter-spacing:-.02em;
}

.taskRouteCard__lines{
  display:grid;
  gap:14px;
  width:min(100%, 250px);
}

.taskRouteCard__lines i{
  display:block;
  height:6px;
  border-radius:999px;
  background:#e442dc;
}

.taskRouteCard__lines i:nth-child(2),
.taskRouteCard__lines i:nth-child(3){
  width:60%;
  margin-left:auto;
}

.taskRouteCard img{
  position:relative;
  z-index:2;
  justify-self:center;
  align-self:end;
  width:auto;
  max-width:156px;
  height:174px;
  object-fit:contain;
  object-position:center bottom;
  filter:drop-shadow(0 10px 12px rgba(46,27,55,.10));
}

.taskRouteBody .footer{
  flex:0 0 auto;
  background:rgba(255,255,255,.76);
}

.taskExamLanding{
  flex:1 0 auto;
  width:100%;
  padding-top:28px;
  padding-bottom:54px;
}

.taskExamLanding__hero{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 240px;
  align-items:center;
  gap:28px;
  min-height:400px;
  margin-top:18px;
  padding:44px 54px;
  border:3px solid var(--accent-2);
  border-radius:34px;
  background:rgba(255,255,255,.94);
  box-shadow:0 20px 48px rgba(58,34,70,.10);
}

.taskExamLanding__hero h1{
  margin:8px 0 14px;
  font-size:clamp(38px, 6vw, 64px);
  line-height:1.02;
}

.taskExamLanding__hero p:last-child{
  max-width:600px;
  color:var(--muted);
  font-size:18px;
  line-height:1.55;
}

.taskExamLanding__hero img{
  justify-self:center;
  width:auto;
  max-width:220px;
  max-height:300px;
  object-fit:contain;
}

@media (max-width:720px){
  .taskRouteMain{
    width:100%;
    min-height:0;
    padding:34px 14px;
  }

  .taskRouteChooser{
    gap:16px;
  }

  .taskRouteCard{
    grid-template-columns:minmax(0, 1fr) 112px;
    min-height:170px;
    padding:20px 12px 20px 22px;
    border-width:3px;
    border-radius:26px;
  }

  .taskRouteCard__content{
    gap:18px;
  }

  .taskRouteCard__content strong{
    font-size:clamp(21px, 6vw, 27px);
  }

  .taskRouteCard__lines{
    gap:10px;
  }

  .taskRouteCard__lines i{
    height:5px;
  }

  .taskRouteCard img{
    max-width:105px;
    height:142px;
  }

  .taskExamLanding__hero{
    grid-template-columns:minmax(0, 1fr) 120px;
    min-height:300px;
    padding:28px 24px;
  }

  .taskExamLanding__hero img{
    max-width:120px;
    max-height:210px;
  }
}

@media (max-width:420px){
  .taskRouteCard{
    grid-template-columns:minmax(0, 1fr) 92px;
    min-height:152px;
    padding-left:18px;
  }

  .taskRouteCard img{
    max-width:88px;
    height:124px;
  }

  .taskExamLanding__hero{
    grid-template-columns:1fr;
    text-align:center;
  }
}

/* Tasks route chooser v28 — softer LavMath styling */
body.taskRouteBody{background:linear-gradient(180deg,#fffaf5 0%,#fbf5ef 100%)}
.taskRouteMain{width:min(calc(100% - 40px),1180px);min-height:580px;padding:64px 24px;background:transparent}
.taskRouteChooser{width:min(100%,940px);grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.taskRouteCard{grid-template-columns:minmax(0,1fr) 145px;min-height:245px;padding:32px 20px 28px 32px;border:1px solid rgba(122,45,187,.16);border-radius:30px;background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(255,250,241,.96));box-shadow:0 14px 38px rgba(67,37,78,.07)}
.taskRouteCard--school{border-color:rgba(122,45,187,.19)}
.taskRouteCard--exams{border-color:rgba(235,169,35,.24);background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(255,247,226,.96))}
.taskRouteCard:before{content:"";position:absolute;inset:auto -55px -80px auto;width:190px;height:190px;border-radius:50%;background:rgba(122,45,187,.055);z-index:0}.taskRouteCard--exams:before{background:rgba(242,169,0,.07)}
.taskRouteCard:hover{transform:translateY(-3px);box-shadow:0 20px 46px rgba(67,37,78,.1);border-color:rgba(122,45,187,.3)}
.taskRouteCard--exams:hover{border-color:rgba(235,169,35,.42)}
.taskRouteCard__content{gap:24px}.taskRouteCard__content strong{max-width:280px;color:#3c2147;font-size:27px;line-height:1.16}
.taskRouteCard__lines{gap:10px;width:min(100%,220px)}.taskRouteCard__lines i{height:5px;background:#eee4f2}.taskRouteCard__lines i:first-child{width:92%}.taskRouteCard__lines i:nth-child(2){width:72%;margin-left:0}.taskRouteCard__lines i:nth-child(3){width:52%;margin-left:0}
.taskRouteCard--exams .taskRouteCard__lines i{background:#f5ead0}
.taskRouteCard img{max-width:138px;height:178px;filter:drop-shadow(0 9px 11px rgba(46,27,55,.08))}
@media(max-width:760px){.taskRouteChooser{grid-template-columns:1fr;max-width:560px}.taskRouteCard{min-height:190px;grid-template-columns:minmax(0,1fr) 120px}.taskRouteMain{padding:34px 14px}.taskRouteCard img{max-width:112px;height:150px}}

/* Tasks route chooser v29 — smoother gradients and more volume */
body.taskRouteBody{
  background:
    radial-gradient(circle at top left, rgba(242,169,0,.08), transparent 26%),
    radial-gradient(circle at 85% 24%, rgba(122,45,187,.08), transparent 30%),
    linear-gradient(180deg,#fffaf6 0%,#f7efe8 100%);
}

.taskRouteMain{
  width:min(calc(100% - 40px), 1180px);
  min-height:620px;
  padding:58px 24px 72px;
  align-content:start;
  gap:28px;
}

.taskRouteIntro{
  width:min(100%, 760px);
  margin:0 auto;
  text-align:center;
}

.taskRouteIntro__eyebrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid rgba(122,45,187,.14);
  background:rgba(255,255,255,.72);
  box-shadow:0 10px 24px rgba(67,37,78,.05);
  color:#765082;
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.taskRouteIntro h1{
  margin:16px 0 12px;
  color:#3c2147;
  font-size:clamp(30px, 4vw, 44px);
  line-height:1.08;
}

.taskRouteIntro p{
  margin:0 auto;
  max-width:680px;
  color:#7b6f78;
  font-size:17px;
  line-height:1.6;
}

.taskRouteChooser{
  width:min(100%, 980px);
  gap:28px;
}

.taskRouteCard{
  position:relative;
  grid-template-columns:minmax(0,1fr) 152px;
  min-height:278px;
  padding:30px 24px 30px 30px;
  border:1px solid rgba(122,45,187,.13);
  border-radius:32px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.98) 0%, rgba(252,245,255,.96) 55%, rgba(248,239,246,.98) 100%);
  box-shadow:
    0 18px 42px rgba(67,37,78,.08),
    0 2px 0 rgba(255,255,255,.85) inset,
    0 -12px 24px rgba(255,255,255,.3) inset;
}

.taskRouteCard::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,0) 28%);
  pointer-events:none;
}

.taskRouteCard::after{
  content:"";
  position:absolute;
  right:-42px;
  bottom:-50px;
  width:180px;
  height:180px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(122,45,187,.12) 0%, rgba(122,45,187,.03) 52%, rgba(122,45,187,0) 72%);
  pointer-events:none;
}

.taskRouteCard--school{
  border-color:rgba(122,45,187,.15);
  background:
    linear-gradient(160deg, rgba(255,255,255,.98) 0%, rgba(251,245,255,.97) 52%, rgba(246,238,244,.98) 100%);
}

.taskRouteCard--exams{
  border-color:rgba(242,169,0,.22);
  background:
    linear-gradient(160deg, rgba(255,255,255,.98) 0%, rgba(255,250,238,.97) 54%, rgba(250,241,227,.98) 100%);
}

.taskRouteCard--exams::after{
  background:radial-gradient(circle, rgba(242,169,0,.16) 0%, rgba(242,169,0,.04) 50%, rgba(242,169,0,0) 72%);
}

.taskRouteCard:hover{
  transform:translateY(-5px);
  border-color:rgba(122,45,187,.22);
  box-shadow:
    0 24px 54px rgba(67,37,78,.12),
    0 2px 0 rgba(255,255,255,.88) inset,
    0 -12px 24px rgba(255,255,255,.32) inset;
}

.taskRouteCard--exams:hover{
  border-color:rgba(242,169,0,.34);
}

.taskRouteCard__content{
  gap:16px;
  align-content:start;
}

.taskRouteCard__badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:100%;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(122,45,187,.12);
  color:#7b5488;
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
}

.taskRouteCard--exams .taskRouteCard__badge{
  border-color:rgba(242,169,0,.18);
  color:#9b6b00;
}

.taskRouteCard__content strong{
  max-width:320px;
  color:#3b2346;
  font-size:29px;
  line-height:1.14;
}

.taskRouteCard__desc{
  max-width:360px;
  color:#766d75;
  font-size:15px;
  line-height:1.56;
}

.taskRouteCard__lines{
  gap:10px;
  width:min(100%, 230px);
  margin-top:2px;
}

.taskRouteCard__lines i{
  height:7px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(231,217,239,.98), rgba(239,231,246,.6));
}

.taskRouteCard__lines i:first-child{width:88%}
.taskRouteCard__lines i:nth-child(2){width:68%;margin-left:0}
.taskRouteCard__lines i:nth-child(3){width:48%;margin-left:0}

.taskRouteCard--exams .taskRouteCard__lines i{
  background:linear-gradient(90deg, rgba(244,226,182,.95), rgba(249,237,206,.55));
}

.taskRouteCard__cta{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  margin-top:auto;
  padding:10px 14px;
  border-radius:14px;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(122,45,187,.11);
  box-shadow:0 8px 18px rgba(67,37,78,.05);
  color:#4a2d59;
  font-size:14px;
  font-weight:700;
}

.taskRouteCard--exams .taskRouteCard__cta{
  border-color:rgba(242,169,0,.18);
  color:#8b6200;
}

.taskRouteCard img{
  position:relative;
  z-index:2;
  align-self:end;
  max-width:144px;
  height:186px;
  transform:translateY(6px);
  filter:drop-shadow(0 14px 16px rgba(46,27,55,.11));
}

@media (max-width:760px){
  .taskRouteMain{
    width:min(calc(100% - 20px), 1180px);
    min-height:0;
    padding:34px 10px 48px;
    gap:22px;
  }

  .taskRouteIntro h1{
    margin-top:14px;
  }

  .taskRouteIntro p{
    font-size:15px;
  }

  .taskRouteChooser{
    max-width:580px;
    gap:18px;
  }

  .taskRouteCard{
    grid-template-columns:minmax(0,1fr) 120px;
    min-height:216px;
    padding:22px 16px 22px 22px;
    border-radius:26px;
  }

  .taskRouteCard__content strong{
    font-size:24px;
    max-width:280px;
  }

  .taskRouteCard__desc{
    font-size:14px;
  }

  .taskRouteCard img{
    max-width:112px;
    height:150px;
    transform:none;
  }
}

@media (max-width:480px){
  .taskRouteIntro__eyebrow{
    font-size:12px;
    padding:7px 12px;
  }

  .taskRouteCard{
    grid-template-columns:minmax(0,1fr) 98px;
    min-height:198px;
    padding:20px 14px 20px 18px;
  }

  .taskRouteCard__content{
    gap:13px;
  }

  .taskRouteCard__content strong{
    font-size:21px;
  }

  .taskRouteCard__desc{
    font-size:13px;
    line-height:1.5;
  }

  .taskRouteCard__lines i{
    height:6px;
  }

  .taskRouteCard__cta{
    padding:9px 12px;
    font-size:13px;
  }

  .taskRouteCard img{
    max-width:92px;
    height:128px;
  }
}

/* Tasks route chooser v30 — tablet polish after visual QA */
@media (max-width: 900px) and (min-width: 761px){
  .taskRouteChooser{
    grid-template-columns:1fr;
    max-width:620px;
  }
}


/* Tasks route chooser v31 — cards only */
.taskRouteMain{display:grid;place-items:center;align-content:center;gap:0;padding-top:48px;padding-bottom:48px;}
.taskRouteChooser{margin:0 auto;}
@media (max-width:760px){.taskRouteMain{padding-top:28px;padding-bottom:38px;}}

/* =========================
   Инструменты
   ========================= */
.tools-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,390px));
  gap:22px;
  margin:8px 0 34px;
  align-items:start;
}
.tool-card{
  position:relative;
  display:flex;
  flex-direction:column;
  min-height:100%;
  overflow:hidden;
  border:2px solid rgba(122,45,187,.34);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,250,241,.94));
  box-shadow:0 14px 36px rgba(122,45,187,.11);
  text-decoration:none!important;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.tool-card::after{
  content:"";
  position:absolute;
  inset:auto 18px 0;
  height:3px;
  border-radius:999px 999px 0 0;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  opacity:.72;
}
.tool-card:hover{
  transform:translateY(-3px);
  border-color:rgba(122,45,187,.56);
  box-shadow:0 18px 42px rgba(122,45,187,.16);
}
.tool-card:focus-visible{
  outline:3px solid rgba(122,45,187,.22);
  outline-offset:4px;
}
.tool-card__media{
  margin:14px 14px 0;
  overflow:hidden;
  aspect-ratio:4/3;
  border:1px solid rgba(122,45,187,.18);
  border-radius:18px;
  background:#fff8ef;
}
.tool-card__media img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .25s ease;
}
.tool-card:hover .tool-card__media img{transform:scale(1.018)}
.tool-card__body{
  display:flex;
  flex:1;
  flex-direction:column;
  padding:18px 20px 20px;
}
.tool-card__meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:9px;
}
.tool-card__meta span{
  padding:4px 8px;
  border-radius:999px;
  background:rgba(122,45,187,.08);
  color:var(--accent);
  font-size:11px;
  line-height:1.2;
  font-weight:750;
}
.tool-card__meta span:nth-child(2){
  background:rgba(242,169,0,.12);
  color:#976900;
}
.tool-card h2{
  margin:0 0 8px;
  color:var(--text);
  font-size:23px;
  line-height:1.18;
}
.tool-card p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}
.tool-card__action{
  display:inline-flex;
  align-items:center;
  align-self:flex-start;
  gap:8px;
  margin-top:18px;
  padding:10px 15px;
  border-radius:12px;
  background:var(--accent);
  color:#fff;
  font-size:14px;
  font-weight:800;
  box-shadow:0 7px 18px rgba(122,45,187,.17);
}
.tool-card:hover .tool-card__action{filter:brightness(1.05)}



@media (max-width:760px){
  .tools-grid{grid-template-columns:1fr;gap:16px;margin-bottom:24px}
  .tool-card{border-radius:20px}
  .tool-card__media{margin:10px 10px 0;border-radius:15px}
  .tool-card__body{padding:15px 16px 18px}
  .tool-card h2{font-size:21px}
}


/* v97 — requested public-site polish */
.dropdown__item[aria-disabled="true"]{
  cursor:default;
  opacity:.48;
  pointer-events:none;
  text-decoration:none;
}
.classCard[aria-disabled="true"]{
  cursor:default;
  opacity:.5;
  pointer-events:none;
  filter:saturate(.55);
}
.contact-stack{display:grid;gap:18px;max-width:900px;margin-bottom:30px}
.contact-card h2{margin-top:0}
.contact-card p{line-height:1.65}
.contact-list a{overflow-wrap:anywhere}
.taskRouteCard__logo{
  position:absolute!important;
  z-index:5!important;
  top:20px!important;
  right:20px!important;
  width:48px!important;
  height:48px!important;
  max-width:none!important;
  object-fit:contain!important;
  align-self:auto!important;
  transform:none!important;
  filter:none!important;
  pointer-events:none;
}
@media(max-width:760px){
  .taskRouteCard__logo{top:15px!important;right:15px!important;width:40px!important;height:40px!important}
}
@media(max-width:480px){
  .taskRouteCard__logo{top:12px!important;right:12px!important;width:34px!important;height:34px!important}
}

.topicAcc__previewNote{margin-top:10px}
