/* Урок Просто — набор стилей v2 «Строка запроса» (up-kit.css).
   Выбран владельцем 03.11 (вариант 1 А2: Lovable, v0, Gamma). Корень страницы — класс .up рядом с .v2-root;
   компоненты — классы up-*: композер (up-composer, up-ring; свечение up-glow — только позади листа документа), капсула форматов (up-fmt, up-fmt-pill), пилюли (up-pill),
   токены комплекта (up-token), чипы-подсказки (up-chip), кнопка-морф (up-go), веер листов (up-fan, up-sheet), липкая полоса (up-dock),
   ящики (up-drawer), галочки (up-check), переключатель (up-sw); с 04.11 — каркас (рабочая область поверх меню, верхняя панель
   up-topbar, меню телефона под областью), «Мои классы» (up-mc-*: список под пилюлей «Класс», лист на телефоне, окно класса).
   Фокус полей — только цвет рамки (--ws-accent), без внешнего кольца. Фокус кнопок и ссылок с клавиатуры — рамка 2 px --ws-accent
   по контуру самой кнопки, внутрь (у залитых — цветом --surface), у текстовых ссылок — подчёркивание 2 px; кольца с отступом
   нет нигде (владелец 05.11, раздел «фокус кнопок и ссылок» ниже). Движение — переменные --ease-out, --ease-apple, --spring, --spring-soft.
   Подключать после ds/urok-prosto/tokens.css и v2.css. Источник истины — дизайн-система «Урок Просто», раздел «Направление v2». */
/* цвета оформления презентации (up-themes): зарегистрированы, чтобы сцена перекрашивалась плавно, в том числе градиенты */
@property --th-h1 { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --th-h2 { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --th-h3 { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --th-bg { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --th-ink { syntax: '<color>'; inherits: true; initial-value: #1f2937; }
@property --th-ac { syntax: '<color>'; inherits: true; initial-value: #1d4ed8; }
@property --th-rule { syntax: '<color>'; inherits: true; initial-value: #1d4ed8; }
@property --th-card { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --th-shade { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --th-imgbg { syntax: '<color>'; inherits: true; initial-value: #f1f3f9; }
@property --th-grid { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --th-b1 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --th-b2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
.up {
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-apple: cubic-bezier(.32, .72, 0, 1);
  /* пружина ζ≈.60, перелёт ≈9 % (капсула, токены, кнопка) */
  --spring: linear(0, 0.0238, 0.0862, 0.1751, 0.2802, 0.3927, 0.5059, 0.6143, 0.7142, 0.8031, 0.8796, 0.9432, 0.9941, 1.033, 1.0611, 1.0797, 1.0902, 1.0941, 1.0927, 1.0875, 1.0796, 1.0699, 1.0594, 1.0487, 1.0384, 1.0288, 1.02, 1.012, 1.005, 1);
  /* пружина ζ≈.78, перелёт ≈2 % (веер, тумблер, морф кнопки) */
  --spring-soft: linear(0, 0.0192, 0.0688, 0.1387, 0.2207, 0.3085, 0.3974, 0.4837, 0.5651, 0.64, 0.7074, 0.7669, 0.8185, 0.8625, 0.8995, 0.9299, 0.9545, 0.974, 0.9891, 1.0005, 1.0087, 1.0143, 1.0179, 1.0198, 1.0205, 1.0202, 1.015, 1.008, 1);
  --up-indigo: 91, 61, 245;
  --up-peach: 255, 160, 112;
  --up-card-line: rgba(31, 27, 58, .10);
  --up-glass: rgba(255, 255, 255, .62);
}
.up[data-theme="dark"] { --up-card-line: rgba(239, 236, 251, .12); --up-glass: rgba(255, 255, 255, .06); --up-indigo: 139, 120, 255; --up-peach: 255, 150, 110; }

/* Фон контентной области: свечение индиго сверху по центру, тёплый персиковый край справа, растворяется вниз */
.up > .f-side + div { background:
  radial-gradient(1100px 640px at 50% -260px, rgba(var(--up-indigo), .30), transparent 68%),
  radial-gradient(760px 560px at 104% 14%, rgba(var(--up-peach), .30), transparent 70%),
  radial-gradient(640px 460px at -6% 44%, rgba(var(--up-indigo), .10), transparent 70%),
  linear-gradient(180deg, #efecfa 0, var(--bg) 720px); }
.up[data-theme="dark"] > .f-side + div { background:
  radial-gradient(1100px 640px at 50% -260px, rgba(var(--up-indigo), .26), transparent 68%),
  radial-gradient(760px 560px at 104% 14%, rgba(var(--up-peach), .12), transparent 70%),
  var(--bg); }
.up-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас (04.11): меню лежит на подложке, рабочая область — приподнятая поверхность поверх него ----------
   Подложка — цвет меню (--sb-bg) у корня. Десктоп: меню прилипает к окну, у рабочей области скругление слева, тонкая
   кромка и мягкая тень, падающая на меню. Ниже 1024 px — как в мобильном Claude: меню под рабочей областью, «☰» сдвигает
   её вправо пружинистой кривой --ease-apple за .44 с, она скругляется и остаётся поверх с тенью; закрывают нажатие по ней,
   Esc и «×» в меню. Прокрутка окна на время открытия переезжает внутрь рабочей области (base() в a2x_common). */
/* 04.11, круг 7: тень на 30 % слабее (владелец) — прозрачность тёмных слоёв ×0,7, форма та же; светлая кромка тёмной темы —
   как была. Замер (tools/round7_lift.py, 48 px меню у края): затемнение −29 % в светлой, −30 % в тёмной теме.
   Было: светлая .07 / .07 / .38, телефон .06 / .26; тёмная .5 / .9, телефон .7 */
.up {
  --up-lift: 0 0 0 1px rgba(31, 27, 58, .05), -2px 0 6px -2px rgba(31, 27, 58, .05), -18px 0 40px -22px rgba(31, 27, 58, .265);
  --up-lift-m: 0 0 0 1px rgba(31, 27, 58, .042), -10px 0 34px -6px rgba(31, 27, 58, .18);
}
.up[data-theme="dark"] {
  --up-lift: 0 0 0 1px rgba(239, 236, 251, .08), -2px 0 8px -2px rgba(0, 0, 0, .35), -20px 0 44px -18px rgba(0, 0, 0, .63);
  --up-lift-m: 0 0 0 1px rgba(239, 236, 251, .08), -12px 0 36px -4px rgba(0, 0, 0, .49);
}
.up > .f-side + div { position: relative; }
@media (min-width: 1024px) {
  .up > .f-side { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .up > .f-side::-webkit-scrollbar { display: none; }
  .up > .f-side nav.v2-root { min-height: 100vh !important; min-height: 100dvh !important; }
  .up > .f-side + div { border-radius: 24px 0 0 24px; box-shadow: var(--up-lift); }
}
/* верхняя панель на планшете и телефоне: «☰» слева (меню выезжает слева), название, «Создать документ» справа; стекло поверх области */
.up .up-topbar { position: sticky; top: 0; z-index: 35; height: 56px; padding: 0 6px; gap: 2px; align-items: center; justify-content: flex-start;
  background: rgba(247, 246, 251, .74); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid rgba(31, 27, 58, .06); }
.up[data-theme="dark"] .up-topbar { background: rgba(21, 18, 42, .74); border-bottom-color: rgba(239, 236, 251, .08); }
.up-topbar-btn { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink) !important; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease-out), transform .12s var(--ease-out); }
.up-topbar-btn:hover { background: var(--sb-hover); }
.up-topbar-btn:active { transform: scale(.94); }
.up-topbar-name { flex: 1 1 auto; min-width: 0; padding: 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 24px; color: var(--ink) !important; text-decoration: none; white-space: nowrap; }
.up-nav-scrim { display: none; }
@media (max-width: 1023px) {
  .up > .f-side { display: block; position: fixed; top: 0; bottom: 0; left: 0; z-index: 0; width: 264px; max-width: 86vw; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
    visibility: hidden; transition: visibility 0s linear .44s; }
  .up > .f-side::-webkit-scrollbar { display: none; }
  .up > .f-side nav.v2-root { min-height: 100% !important; }
  .up > .f-side .sb-collapse { display: none !important; }
  .up > .f-side .sb-close { display: grid !important; }
  .up > .f-side + div { z-index: 1; min-height: 100vh; transition: transform .44s var(--ease-apple), border-radius .44s var(--ease-apple), box-shadow .3s var(--ease-out); }
  .up[data-nav="true"] > .f-side { visibility: visible; transition: none; }
  .up[data-nav="true"] { overflow-x: clip; }  /* сдвинутая область не даёт горизонтальной прокрутки */
  .up[data-nav="true"] > .f-side + div { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; transform: translateX(min(264px, 86vw)); border-radius: 26px; box-shadow: var(--up-lift-m); }
  /* видимая часть области справа от меню: нажатие закрывает меню */
  .up[data-nav="true"] > .up-nav-scrim { display: block; position: fixed; top: 0; bottom: 0; left: min(264px, 86vw); right: 0; z-index: 2; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
}

/* ---------- каркас ---------- */
.up-main { padding: 28px 32px 72px; }
.up-hero { max-width: 880px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.up-top { display: flex; align-items: center; justify-content: space-between; }
.up-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: var(--text-2); text-decoration: none; }
.up-help { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; }
.up-title { display: grid; gap: 10px; text-align: center; padding: 6px 0 2px; }
.up-h1 { margin: 0; font-family: var(--font-display); font-size: 46px; line-height: 52px; letter-spacing: -.025em; color: var(--ink); }
.up-lead { margin: 0 auto; max-width: 640px; font-size: 17px; line-height: 25px; color: var(--text-2); }

/* ---------- капсула форматов: подвижная подложка едет пружиной по индексу --i ---------- */
.up-fmt-wrap { position: relative; }
.up-fmt { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 4px; border-radius: 999px;
  background: var(--up-glass); border: 1px solid var(--up-card-line); box-shadow: 0 1px 2px rgba(31, 27, 58, .04), inset 0 1px 0 rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.up-fmt-pill { position: absolute; top: 4px; left: 4px; width: calc((100% - 8px) / 8); height: calc(100% - 8px); border-radius: 999px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(31, 27, 58, .10), 0 8px 18px -8px rgba(60, 40, 120, .45), inset 0 0 0 1px var(--ws-accent-border);
  transform: translateX(calc(var(--i) * 100%)); transition: transform .46s var(--spring); will-change: transform; }
.up-fmt-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; height: 40px; padding: 0 4px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2); font-family: inherit; font-size: 13.5px; line-height: 20px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap; cursor: pointer; transition: color .18s var(--ease-out); }
.up-fmt-tab:hover { color: var(--ink); }
.up-fmt-tab[aria-selected="true"] { color: var(--ws-accent-ink); font-weight: 600; }
.up-fmt-ic { display: none; color: var(--ws-icon); }
.up-fmt-tab[aria-selected="true"] .up-fmt-ic { color: var(--ws-accent); }
.up-fmt-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--ws-accent); flex: 0 0 auto; }
.up-fmt-tab:active { transform: scale(.97); }

/* ---------- композер ---------- */
.up-composer { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 20px 16px; border-radius: 26px; background: var(--surface);
  border: 1px solid var(--up-card-line); box-shadow: 0 1px 2px rgba(31, 27, 58, .04), 0 28px 64px -30px rgba(60, 40, 120, .50); }
.up[data-theme="dark"] .up-composer { box-shadow: 0 28px 64px -30px rgba(0, 0, 0, .8); }
/* мягкое свечение индиго → персик (up-glow): с 04.11 только позади листа на странице документа (.up-doc-stage).
   В строке создания его нет (владелец, круг 7): внутри строка чистая, при фокусе — только вращающаяся подсветка рамки.
   Свечение лежало на z-index −1 внутри isolation композера и поэтому рисовалось поверх его белого фона — отсюда градиент внутри. */
.up-glow { position: absolute; left: 8%; right: 8%; bottom: -30px; height: 58%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--up-indigo), .40), rgba(var(--up-peach), .26) 62%, transparent); filter: blur(32px); opacity: .42; }
.up-composer > .up-glow { display: none; }
/* вращающаяся конусная подсветка рамки при фокусе: кольцо через маску, внутри крутится квадрат с conic-gradient */
.up-ring { position: absolute; inset: -2px; border-radius: 28px; padding: 2px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease-out);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.up-ring::before { content: ""; position: absolute; left: 50%; top: 50%; width: 200%; aspect-ratio: 1 / 1; margin: -100% 0 0 -100%;
  background: conic-gradient(from 0deg, transparent 0 52%, rgba(var(--up-indigo), .0) 58%, rgba(var(--up-indigo), .95) 78%, rgba(var(--up-peach), .95) 90%, transparent 100%); }
.up-composer:focus-within .up-ring { opacity: 1; }
.up-composer:focus-within .up-ring::before { animation: up-rot 3.6s linear infinite; }
@keyframes up-rot { to { transform: rotate(360deg); } }
/* выбор оформления презентации открыт — без кольца (3.11, отзыв владельца) */
.up-composer:has(.up-themes) .up-ring { display: none; }

.up-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.up-tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.up-token { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 18px; font-weight: 500; cursor: pointer;
  transition: transform .5s var(--spring), opacity .22s var(--ease-out), border-color .15s, background-color .15s, color .15s; }
@starting-style { .up .up-token { opacity: 0; transform: scale(.5) translateY(6px); } }
.up-token.is-main { padding: 0 11px 0 9px; border-color: transparent; background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-weight: 600; cursor: default; }
.up-token-ic { display: inline-grid; color: var(--ws-accent); }
.up-token-x { display: inline-grid; color: var(--text-2); transition: color .15s, transform .15s var(--ease-out); }
button.up-token:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); }
button.up-token:hover .up-token-x { color: var(--error); transform: rotate(90deg); }
button.up-token:active { transform: scale(.95); }
.up-src { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.up-src button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-family: inherit; font-size: 13.5px; line-height: 18px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .18s, color .18s, box-shadow .18s; }
.up-src button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(31, 27, 58, .12), 0 3px 8px -3px rgba(60, 40, 120, .28); }

.up-topic-wrap { display: grid; gap: 8px; }
/* тема растёт вместе с текстом (field-sizing: content), до половины окна — дальше прокрутка внутри поля */
.up-topic { display: block; width: 100%; min-height: 66px; max-height: 50vh; max-height: 50dvh; margin: 0; padding: 2px 2px; border: 0; background: transparent; resize: none; outline: none; color: var(--ink);
  field-sizing: content; overflow-y: auto; overscroll-behavior: contain; font-family: inherit; font-size: 21px; line-height: 30px; font-weight: 500; }
.up-topic:focus-visible { outline: none; }
.up-topic::placeholder { color: var(--text-2); font-weight: 400; }  /* 09.11 UX-разбор, п. 8: без opacity .72 — было 3,4:1, стало 6,5:1 (подсказка объясняет, что писать) */
.up-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.up-dates-l { font-size: 13.5px; line-height: 20px; color: var(--text-2); margin-right: 2px; }
.up-date { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 18px; font-weight: 500; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.up-date:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); }
.up-date[aria-pressed="true"] { border-color: var(--ws-accent); background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-weight: 600; }
.up-docsel { display: grid; gap: 8px; }
.up-selwrap { position: relative; }
.up-selchev { position: absolute; right: 12px; top: 13px; display: inline-grid; color: var(--text-2); pointer-events: none; }

/* подвал композера: пилюли слева, главная кнопка справа */
.up-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 12px; }
.up-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.up-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; max-width: 100%; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-out); }
.up-pill:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); }
.up-pill:active { transform: scale(.97); }
.up-pill-ic { display: inline-grid; color: var(--ws-icon); transition: color .15s; }
.up-pill:hover .up-pill-ic { color: var(--ws-accent); }
.up-pill-txt { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.up-pill.is-lt .up-pill-txt { max-width: 190px; }
.up-pill-chev { display: inline-grid; color: var(--text-2); }
.up-pill select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font: inherit; }
/* фокус пилюли со скрытым select — рамкой по контуру пилюли, только с клавиатуры: раздел «фокус кнопок и ссылок» (было кольцо
   :focus-within с отступом 2 px — оно залипало после клика мышью) */
.up-pill.is-static { cursor: default; border-style: dashed; color: var(--text-2); }
.up-pill.is-static:hover { border-color: var(--line-strong); color: var(--text-2); }
.up-pill.is-seg { padding: 3px; gap: 2px; }
.up-pill.is-seg:hover { border-color: var(--line-strong); }
.up-pill.is-seg { cursor: default; }  /* шаг 0б: сама рамка «Длительность» не нажимается — нажимаются кнопки внутри (у них свой pointer) */
.up-pill.is-seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-family: inherit; font-size: 13.5px; line-height: 18px; font-weight: 500; cursor: pointer; transition: background-color .18s var(--ease-out), color .18s; }
.up-pill.is-seg button:hover { color: var(--ink); }
.up-pill.is-seg button[aria-checked="true"] { background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-weight: 600; }
.up-pill[aria-expanded="true"], .up-pill[aria-pressed="true"] { border-color: var(--ws-accent); background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.up-pill[aria-expanded="true"] .up-pill-ic { color: var(--ws-accent); }
.up-rot { display: inline-grid; color: var(--text-2); transition: transform .24s var(--ease-out); }
.up-pill[aria-expanded="true"] .up-rot-plus { transform: rotate(45deg); }
.up-pill[aria-expanded="true"] .up-rot-chev { transform: rotate(180deg); }
.up-pill-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ws-accent); color: #fff; font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; }
/* пилюля «Оформление»: образец выбранной темы и её название */
.up-pill-theme { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.up-pill-theme::before { content: "·"; }
.up-pill-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--th-h1), var(--th-h3)); box-shadow: inset 0 0 0 1px rgba(31, 27, 58, .14); }
.up-sw { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--line-strong); transition: background-color .18s var(--ease-out); }
.up-sw-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 7px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .3s var(--spring-soft); }
.up-pill[role="switch"][aria-checked="true"] .up-sw { background: var(--ws-accent); }
.up-pill[role="switch"][aria-checked="true"] .up-sw-knob { transform: translateX(12px); }
/* главная кнопка: круг со стрелкой вверх → пилюля «Собрать N документов» (сетка 0fr → 1fr, пружина) */
.up-go { --go-bg: var(--ws-accent); --go-fg: #fff; position: relative; flex: 0 0 auto; display: inline-grid; grid-template-columns: 0fr auto; align-items: center; height: 48px; padding: 0 2px; border: 0; border-radius: 999px;
  background: var(--go-bg); color: var(--go-fg); font-family: inherit; font-size: 16px; line-height: 24px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 27, 58, .2), 0 12px 26px -10px rgba(75, 64, 184, .65);
  transition: grid-template-columns .5s var(--spring-soft), padding .5s var(--spring-soft), background-color .2s var(--ease-out), color .2s, transform .12s var(--ease-out), box-shadow .2s, opacity .2s; }
.up-go[data-ready="true"] { grid-template-columns: 1fr auto; padding: 0 2px 0 20px; }
.up-go-label { min-width: 0; overflow: hidden; }
.up-go-label > span { display: inline-block; padding-right: 10px; opacity: 0; transform: translateX(-8px); transition: opacity .18s var(--ease-out), transform .3s var(--ease-out); }
.up-go[data-ready="true"] .up-go-label > span { opacity: 1; transform: none; transition-delay: .1s; }
.up-go-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; transition: background-color .2s; }
.up-go-ic svg { transform: rotate(-90deg); transition: transform .4s var(--spring-soft); }
.up-go[data-ready="true"] .up-go-ic svg { transform: rotate(0deg); }
.up-go[data-ready="true"] .up-go-ic { background: rgba(255, 255, 255, .14); }
.up-go[data-ready="false"] { background: var(--ws-icon-bg); color: var(--text-2); box-shadow: none; }
.up-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(31, 27, 58, .2), 0 16px 30px -10px rgba(75, 64, 184, .75); }
.up-go:hover:not(:disabled) .up-go-ic svg { transform: translateX(3px); }
.up-go:active:not(:disabled) { transform: scale(.97); box-shadow: 0 1px 2px rgba(31, 27, 58, .2), 0 6px 14px -8px rgba(75, 64, 184, .6); }
.up-go:disabled[data-ready="true"] { opacity: .7; }
/* тёмная тема: акцентная кнопка — на --primary, белый текст читается (на --ws-accent #b3a8ff — нет) */
.up[data-theme="dark"] .up-go.f-btn-accent[data-ready="true"] { background: var(--primary) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 26px -10px rgba(123, 98, 255, .6); }
.up[data-theme="dark"] .up-go.f-btn-accent[data-ready="true"]:hover:not(:disabled) { background: var(--primary-hover) !important; }
.up-cost { margin: -6px 0 0; text-align: center; font-size: 14px; line-height: 20px; color: var(--text-2); }
.up-cost b { font-weight: 600; color: var(--ink); }

/* ящики: «Ещё настройки» и «Учебник» — появление при монтировании */
.up-drawer { display: grid; gap: 18px; padding: 16px 2px 4px; border-top: 1px solid var(--line); transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); }
@starting-style { .up .up-drawer { opacity: 0; transform: translateY(-6px); } }
.up-field { display: grid; gap: 8px; min-width: 0; }
.up-label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.up-label-note { font-weight: 400; color: var(--text-2); }
.up-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; }
.up-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.up-seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color .18s var(--ease-out), color .18s, box-shadow .18s; }
.up-seg button:hover { color: var(--ink); }
.up-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(31, 27, 58, .12), 0 3px 8px -3px rgba(60, 40, 120, .28); }
.up-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.up-check { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; text-align: left; cursor: pointer; transition: border-color .15s, color .15s, transform .15s var(--ease-out), box-shadow .15s; }
.up-check:hover { border-color: var(--ws-accent); transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(60, 40, 120, .3); }
.up-check[aria-checked="true"] { border-color: var(--ws-accent); font-weight: 600; }
.up-box { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; border-radius: 6px; border: 1.5px solid var(--line-strong); color: #fff; transition: background-color .15s, border-color .15s; }
.up-check[aria-checked="true"] .up-box { background: var(--ws-accent); border-color: var(--ws-accent); }
.up-box svg { opacity: 0; }
.up-check[aria-checked="true"] .up-box svg { opacity: 1; }
.up-check[aria-checked="true"] .up-box svg path { stroke-dasharray: 24; animation: up-draw .2s var(--ease-out) both; }
@keyframes up-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.up-input { width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; line-height: 22px; transition: border-color .15s, box-shadow .15s; }
.up-select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; text-overflow: ellipsis; }
.up-input:hover { border-color: var(--ink); }
/* фокус поля (04.11, владелец): обычная рамка — меняется только её цвет на акцент; без внешнего кольца и подсветки, без сдвига */
.up-input:focus, .up-input:focus-visible { border-color: var(--ws-accent); box-shadow: none; outline: none; }
.up .f-input:focus, .up .f-input:focus-visible { border-color: var(--ws-accent) !important; box-shadow: none !important; outline: none; }
.up .f-input { border-radius: 14px !important; }
.up .f-seg { border-radius: 999px !important; }
.up .f-seg button { border-radius: 999px !important; }

/* ---------- фокус кнопок и ссылок: рамка самой кнопки, без кольца с отступом ----------
   Фокус — рамка самой кнопки; владелец 05.11: замечание 3 и ответы 16 «принять везде», 17 А, 18 А. Слова владельца
   (замечание 3): «Таких обводок не должно быть ни на одной кнопке. У нас при выборе обрамляется вся кнопка по контуру (т.е.
   перекрывая его на более яркий), а не через отступ». Перекрывает кольцо v2.css (.v2-root :focus-visible — 2 px с отступом 2 px;
   v2.css подключают и старые варианты, поэтому правило — здесь, в области .up). Только :focus-visible: после клика мышью рамки
   нет; выбранное состояние (вкладка, пункт, лист) показывается своим видом. Поля ввода — своё правило выше (только цвет рамки).
   Специфичность правила 1 — (0,3,0): правила фокуса экранных CSS с одним классом его не перебивают; исключение экрана —
   с префиксом .up и пометкой, почему (как у уголка размера в up-widgets.css). */
/* 0. кольцо с отступом снято у всего, в том числе у полей и скрытого select пилюли */
.up :focus-visible { outline: none; }
/* 1. всё нажимаемое: рамка 2 px --ws-accent по краю самой кнопки, внутрь (outline-offset −2 px: размер, раскладка и тень не
      меняются, скругление — как у кнопки). У кнопки с рамкой 1 px (пилюли, чипы, плитки, номера классов) рамка перекрашивается
      в --ws-accent и становится 2 px — толще, чем при наведении (там 1 px того же цвета), иначе фокус не отличить от наведения.
      У кнопок без рамки (пункты меню, значки, вкладки капсулы, строки списков) рамка появляется по их собственному контуру.
      Пилюля со скрытым select («Предмет», «Тип урока», «Сортировка») — рамка у пилюли, когда фокус в select с клавиатуры.
      Владелец 05.11, шаг 0г п. 13: после мыши рамки нет. Chrome включает :focus-visible у select и от мыши и касания, поэтому
      экран ставит пилюле атрибут data-ptr на pointerdown и снимает его на keydown в select и на уходе фокуса (JS экрана:
      главная и «Новый документ» — upPillPtr/upPillKey, «Мои документы» — свой); у пилюли с data-ptr рамки нет. */
.up :is(a, button, summary, [role="button"], [role="tab"], [role="switch"], [role="checkbox"], [role="radio"], [role="menuitem"], [role="option"]):focus-visible,
.up .up-pill:not([data-ptr]):has(> select:focus-visible) { outline: 2px solid var(--ws-accent); outline-offset: -2px; }
/* 2. залитые кнопки (вариант А, п. 17): акцентная рамка на акцентной заливке не видна — рамка 2 px внутрь цветом поверхности.
      Главная «Собрать…» и «Создать документ» (.up-go), «Готово» режима настройки и «Сравнить тарифы» (.up-btn), «Сохранить» /
      «Добавить класс» окна класса (.up-mc-btn), «Да, удалить» «Готового документа» (.up-doc-del-yes), кнопки набора с заливкой.
      Неготовая главная (серая заливка) — обычная акцентная рамка. */
.up :is(.up-go, .up-btn, .up-mc-btn:not(.is-ghost), .up-doc-del-yes, .f-btn-accent, .ws-btn-primary):focus-visible { outline-color: var(--surface); }
.up .up-go[data-ready="false"]:focus-visible { outline-color: var(--ws-accent); }
/* 3. текстовые ссылки без поля (вариант А, п. 18): рамка внутрь легла бы на буквы — вместо неё подчёркивание 2 px --ws-accent.
      «← Главная», «Подробнее», «Пример целиком», название в верхней панели, логотип «Урок Просто» в меню. У логотипа в разметке
      text-decoration: none (style) и ссылка — flex: подчёркивается сама надпись. Текстовые ссылки плиток главной — в up-widgets.css. */
.up :is(.up-back, .up-link, .up-topbar-name, .ws-link, .f-side a:not([class])):focus-visible { outline: none; text-decoration: underline 2px var(--ws-accent); text-underline-offset: 4px; }
.up .f-side a:not([class]):focus-visible > span:last-child { text-decoration: underline 2px var(--ws-accent); text-underline-offset: 4px; }
/* 4. у кого фокус показан по контуру своего видимого слоя — без второй рамки: карточки тем презентации и листы веера (кольцо 3 px
      по контуру миниатюры — ниже, у .up-theme-thumb и .up-sheet-in), лента веера. Уголок размера виджета — в up-widgets.css,
      строка документа «Моих документов» — в up-docs.css. */
.up :is(.up-sheet, .up-theme, .up-fan):focus-visible { outline: none; }

/* ---------- оформление презентации: сцена-слайд в цветах темы и карточки тем ----------
   Цвета темы — переменные --th-* на элементе с классом up-th-<тема>: у контейнера up-themes — выбранная тема,
   у карточки — своя. Наведение (и фокус с клавиатуры) на карточку через :has() перекрашивает сцену без клика. */
.up-th-classic, .up-themes:has(.up-theme.up-th-classic:hover), .up-themes:has(.up-theme.up-th-classic:focus-visible) {
  --th-h1: #ffffff; --th-h2: #ffffff; --th-h3: #ffffff; --th-bg: #ffffff; --th-ink: #1f2937; --th-ac: #1d4ed8; --th-rule: #1d4ed8;
  --th-card: transparent; --th-shade: transparent; --th-imgbg: #f1f3f9; --th-grid: transparent; --th-b1: transparent; --th-b2: transparent; }
.up-th-azure, .up-themes:has(.up-theme.up-th-azure:hover), .up-themes:has(.up-theme.up-th-azure:focus-visible) {
  --th-h1: #1e3a8a; --th-h2: #1d4ed8; --th-h3: #3b82f6; --th-bg: #e8f0fd; --th-ink: #ffffff; --th-ac: #1d4ed8; --th-rule: rgba(255, 255, 255, .75);
  --th-card: #ffffff; --th-shade: rgba(31, 27, 58, .18); --th-imgbg: #f3f6fc; --th-grid: transparent; --th-b1: transparent; --th-b2: transparent; }
.up-th-grid, .up-themes:has(.up-theme.up-th-grid:hover), .up-themes:has(.up-theme.up-th-grid:focus-visible) {
  --th-h1: #312e81; --th-h2: #4338ca; --th-h3: #7c3aed; --th-bg: #f7f9fc; --th-ink: #ffffff; --th-ac: #4338ca; --th-rule: rgba(255, 255, 255, .75);
  --th-card: #ffffff; --th-shade: rgba(31, 27, 58, .18); --th-imgbg: #f3f4fb; --th-grid: rgba(67, 56, 202, .13); --th-b1: transparent; --th-b2: transparent; }
.up-th-mint, .up-themes:has(.up-theme.up-th-mint:hover), .up-themes:has(.up-theme.up-th-mint:focus-visible) {
  --th-h1: #065f46; --th-h2: #047857; --th-h3: #14b8a6; --th-bg: #d6ece3; --th-ink: #ffffff; --th-ac: #276749; --th-rule: rgba(255, 255, 255, .75);
  --th-card: #ffffff; --th-shade: rgba(20, 60, 45, .2); --th-imgbg: #eef7f3; --th-grid: transparent; --th-b1: transparent; --th-b2: transparent; }
.up-th-paper, .up-themes:has(.up-theme.up-th-paper:hover), .up-themes:has(.up-theme.up-th-paper:focus-visible) {
  --th-h1: #7c2d12; --th-h2: #9a3b2e; --th-h3: #c2583f; --th-bg: #efe7d8; --th-ink: #ffffff; --th-ac: #9a3b2e; --th-rule: rgba(255, 255, 255, .75);
  --th-card: #ffffff; --th-shade: rgba(70, 40, 20, .2); --th-imgbg: #f7f2ea; --th-grid: transparent; --th-b1: transparent; --th-b2: transparent; }
.up-th-rainbow, .up-themes:has(.up-theme.up-th-rainbow:hover), .up-themes:has(.up-theme.up-th-rainbow:focus-visible) {
  --th-h1: #2563eb; --th-h2: #7c3aed; --th-h3: #db2777; --th-bg: #fffbf3; --th-ink: #ffffff; --th-ac: #2563eb; --th-rule: rgba(255, 255, 255, .75);
  --th-card: #ffffff; --th-shade: rgba(31, 27, 58, .18); --th-imgbg: #f6f5fd; --th-grid: transparent; --th-b1: rgba(250, 204, 21, .5); --th-b2: rgba(96, 165, 250, .4); }
.up-themes { container-type: inline-size;
  transition: --th-h1 .4s var(--ease-out), --th-h2 .4s var(--ease-out), --th-h3 .4s var(--ease-out), --th-bg .4s var(--ease-out), --th-ink .4s var(--ease-out), --th-ac .4s var(--ease-out),
    --th-rule .4s var(--ease-out), --th-card .4s var(--ease-out), --th-shade .4s var(--ease-out), --th-imgbg .4s var(--ease-out), --th-grid .4s var(--ease-out), --th-b1 .4s var(--ease-out), --th-b2 .4s var(--ease-out); }
.up-theme-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.up-theme-pick { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: 14px 18px; align-items: start; }
/* общие части слайда: шапка с градиентом, тело с клеткой или пятнами, карточки */
.up-th-head { position: relative; display: grid; align-content: center; overflow: hidden; background: linear-gradient(100deg, var(--th-h1), var(--th-h2) 55%, var(--th-h3)); color: var(--th-ink); }
.up-th-head::before, .up-th-head::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .10); pointer-events: none; }
.up-th-head::before { width: 42%; aspect-ratio: 1; right: -8%; top: -70%; }
.up-th-head::after { width: 22%; aspect-ratio: 1; right: 26%; bottom: -60%; }
.up-th-body { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; background:
  radial-gradient(55% 60% at 0% 100%, var(--th-b1), transparent 70%), radial-gradient(45% 60% at 100% 55%, var(--th-b2), transparent 70%),
  repeating-linear-gradient(0deg, var(--th-grid) 0 1px, transparent 1px 10%), repeating-linear-gradient(90deg, var(--th-grid) 0 1px, transparent 1px 10%); }
.up-th-card { position: relative; background: var(--th-card); box-shadow: 0 2px 8px var(--th-shade); }
.up-th-rule { display: block; height: 3px; border-radius: 2px; background: var(--th-rule); }
/* сцена: один слайд крупно с темой урока */
.up-theme-stage { display: grid; grid-template-rows: auto minmax(0, 1fr); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--th-bg); color: #1f2937;
  font-family: var(--font-sans); box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 14px 30px -16px rgba(31, 27, 58, .5), 0 0 0 1px rgba(31, 27, 58, .08); }
.up-theme-stage .up-th-head { gap: 4px; padding: 5% 6% 4.5%; }
.up-th-kicker { font-size: 9px; line-height: 12px; opacity: .8; }
.up-th-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--font-display); font-weight: 800; font-size: 15px; line-height: 19px; letter-spacing: -.01em; }
.up-theme-stage .up-th-rule { width: 12%; margin-top: 3px; }
.up-theme-stage .up-th-body { gap: 4%; padding: 4.5% 6% 6%; }
.up-theme-stage .up-th-card { border-radius: 8px; }
.up-th-list { display: grid; align-content: start; gap: 7px; padding: 10px 12px; }
.up-th-li { display: block; min-width: 0; font-size: 10.5px; line-height: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-th-li::before { content: ""; display: inline-block; vertical-align: middle; width: 10px; height: 2px; margin: -2px 7px 0 0; border-radius: 1px; background: var(--th-ac); }
.up-theme-thumb .up-th-li::before { content: none; }
.up-th-img { display: grid; place-items: center; padding: 6px; }
.up-th-pic { display: grid; justify-items: center; gap: 4px; width: 100%; height: 100%; border-radius: 6px; background: var(--th-imgbg); place-content: center; color: #5f5b76; font-size: 9px; line-height: 12px; text-align: center; }
/* карточки тем: мини-слайд 16:9 с подписью; выбранная — кольцо акцента, наведение — лёгкий подъём */
.up-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 12px; }
.up-theme { display: grid; gap: 7px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text-2); font-family: inherit; font-size: 13px; line-height: 16px; font-weight: 500; text-align: center; cursor: pointer;
  transition: transform .25s var(--ease-out), color .15s; }
.up-theme:hover { transform: translateY(-3px); color: var(--ink); }
.up-theme[aria-checked="true"] { color: var(--ws-accent-ink); font-weight: 600; }
.up-theme-thumb { display: grid; grid-template-rows: 32% minmax(0, 1fr); aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--th-bg);
  box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 0 0 1px rgba(31, 27, 58, .12); transition: box-shadow .2s var(--ease-out); }
.up-theme:hover .up-theme-thumb { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 12px 24px -12px rgba(60, 40, 120, .5), 0 0 0 1px var(--ws-accent-border); }
.up-theme[aria-checked="true"] .up-theme-thumb { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 10px 20px -12px rgba(60, 40, 120, .45), 0 0 0 2px var(--ws-accent); }
.up-theme:focus-visible .up-theme-thumb { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 0 0 3px var(--ws-accent); }
.up-theme-thumb .up-th-head { gap: 4px; padding: 0 8%; }
.up-th-bar { display: block; width: 58%; height: 5px; border-radius: 3px; background: var(--th-ink); opacity: .92; }
.up-theme-thumb .up-th-rule { width: 14%; height: 2px; }
.up-theme-thumb .up-th-body { gap: 6%; padding: 7% 8%; }
.up-theme-thumb .up-th-card { border-radius: 4px; }
.up-theme-thumb .up-th-list { gap: 4px; padding: 8%; align-content: center; }
.up-theme-thumb .up-th-li { display: block; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--th-ac) 0 16%, transparent 16% 24%, #cfcbe0 24%); }
.up-theme-thumb .up-th-li:nth-child(2) { width: 85%; }
.up-theme-thumb .up-th-li:nth-child(3) { width: 65%; }
.up-theme-thumb .up-th-img { padding: 6%; }
.up-theme-thumb .up-th-img::before { content: ""; width: 100%; height: 100%; border-radius: 3px; background: var(--th-imgbg) radial-gradient(circle at 42% 44%, #a9c6f2 0 22%, transparent 23%) ; }
.up-theme-thumb .up-th-img::after { content: ""; position: absolute; left: 44%; top: 38%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(242, 213, 138, .9), rgba(244, 167, 191, .85) 70%); }
@container (max-width: 700px) {
  .up-theme-pick { grid-template-columns: minmax(0, 1fr); }
  .up-theme-stage { width: 100%; max-width: 440px; justify-self: center; }
}
@container (max-width: 430px) {
  .up-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- «Дополнить урок»: чипы появляются лесенкой с blur-in, по клику сжимаются ---------- */
.up-addon { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 2px 8px 0; }
.up-addon-head { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.up-caps { margin: 0; font-family: inherit; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.up-new { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--warning-tint); color: var(--warning); font-size: 11px; line-height: 16px; font-weight: 600; }
.up-new.is-mini { height: 16px; padding: 0 5px; border-radius: 5px; font-size: 10px; line-height: 16px; letter-spacing: .01em; }
.up-pill .up-new.is-float { position: absolute; top: -8px; right: 8px; z-index: 3; pointer-events: none; }  /* над пилюлей, места в ряду не занимает */
.up-hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); text-align: center; }
.up-hint.is-left { text-align: left; max-width: 460px; }
.up-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 2px; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--up-glass); color: var(--ink);
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: up-chip-in .36s var(--ease-out) both; animation-delay: calc(var(--n, 0) * 50ms);
  transition: border-color .15s, background-color .15s, color .15s, transform .15s var(--ease-out), box-shadow .15s; }
.up-chip svg { color: var(--ws-icon); transition: color .15s; }
.up-chip:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); background: var(--surface); transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(60, 40, 120, .4); }
.up-chip:hover svg { color: var(--ws-accent); }
.up-chip:active { transform: scale(.96); }
.up-chip[data-leaving="true"] { animation: up-chip-out .2s var(--ease-out) forwards; pointer-events: none; }
.up-chip.is-later { border-style: dashed; background: transparent; color: var(--text-2); cursor: default; -webkit-backdrop-filter: none; backdrop-filter: none; }
.up-chip.is-later:hover { border-color: var(--line-strong); color: var(--text-2); transform: none; box-shadow: none; }
.up-chip.is-later:hover svg { color: var(--ws-icon); }
.up-chip-sub { color: var(--text-2); font-weight: 400; }
@keyframes up-chip-in { from { opacity: 0; transform: translateY(10px) scale(.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes up-chip-out { to { opacity: 0; transform: scale(.6); filter: blur(4px); } }

/* ---------- превью: лента листов комплекта (center mode) ----------
   Лист — 280×196 в масштабе --z (зависит от числа документов data-n и ширины контейнера). Нажатие раскрывает лист
   (data-big): он едет в центр и растёт до --big, остальные расходятся по сторонам в масштабе --sm, тускнеют и
   ложатся лесенкой с шагом --step: ровно так, чтобы влезть в 96 % ширины контейнера. Только transform и opacity. */
.up-preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 6px; container-type: inline-size; }
.up-pv-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.up-pv-all { display: inline-flex; align-items: center; gap: 6px; height: 30px; margin-left: 2px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 18px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: border-color .15s, color .15s, opacity .2s var(--ease-out), transform .35s var(--spring-soft); }
@starting-style { .up .up-pv-all { opacity: 0; transform: scale(.85); } }
.up-pv-all svg { color: var(--ws-icon); }
.up-pv-all:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); }
.up-link { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; color: var(--ws-accent); }
.up-link svg { transition: transform .15s var(--ease-out); }
.up-link:hover svg { transform: translateX(3px); }
.up-fan { --z: 1.4; --big: 1; --sm: 1; --ov: 0; --gap: 16px; position: relative; display: flex; align-items: center; justify-content: center; gap: var(--gap); padding: 0;
  height: calc(196px * var(--z) + 38px); transition: height .5s var(--ease-apple); }
/* 4–5 документов: листы крупнее за счёт лёгкого перекрытия (--ov), наведение поднимает лист над соседями */
.up-fan[data-n="2"] { --z: 1.15; --big: 1.3; --sm: .8; }
.up-fan[data-n="3"] { --z: .95; --big: 1.5; --sm: .78; }
.up-fan[data-n="4"] { --z: .9; --big: 1.6; --sm: .78; --gap: 0px; --ov: -.22; }
.up-fan[data-n="5"] { --z: .78; --big: 1.85; --sm: .72; --gap: 0px; --ov: -.25; }
@container (max-width: 879px) {
  .up-fan[data-n="2"] { --z: 1.1; }
  .up-fan[data-n="3"] { --z: .85; --big: 1.6; }
  .up-fan[data-n="4"] { --z: .78; --big: 1.8; }
  .up-fan[data-n="5"] { --z: .67; --big: 2.1; }
}
@container (max-width: 759px) {
  .up-fan[data-n="2"] { --z: .95; --big: 1.35; }
  .up-fan[data-n="3"] { --z: .66; --big: 1.7; --sm: .7; }
  .up-fan[data-n="4"] { --z: .6; --big: 1.9; --sm: .66; }
  .up-fan[data-n="5"] { --z: .5; --big: 2; --sm: .65; }
}
.up-fan[data-big="true"] { height: calc((196px * var(--z) + 26px) * var(--big) + 12px); }
.up-sheet { --sc: var(--sm); position: relative; flex: 0 0 auto; display: block; width: calc(280px * var(--z)); padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; z-index: var(--zi);
  transform-origin: 50% 50%; transform: rotate(calc(var(--p) * 1.2deg)); transition: transform .55s var(--spring), opacity .3s var(--ease-out); }
.up-sheet + .up-sheet { margin-left: calc(var(--ov) * 280px * var(--z)); }
.up-sheet[data-on="true"] { --sc: var(--big); }
.up-sheet:focus-visible .up-sheet-in { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 20px 40px -14px rgba(31, 27, 58, .55), 0 0 0 3px var(--ws-accent); }  /* на прежнем месте: владелец 05.11, шаг 0д п. 5 «можешь оставить как было» */
@media (hover: hover) {
  .up-fan[data-big="false"] .up-sheet:hover { z-index: 20; transform: translateY(-6px) rotate(0deg); }
}
.up-fan[data-big="true"] .up-sheet { --A: calc(var(--big) * 100%); --sw: calc(var(--sm) * 100%); --slot: calc((1 + var(--ov)) * 100% + var(--gap));
  --step: clamp(0px, (48cqw - var(--A) / 2 - 12px - var(--sw)) / max(var(--side) - 1, 1), var(--sw) * .85);
  --shift: calc(var(--sg) * (var(--A) / 2 + 12px + var(--sw) / 2 + (var(--am) - 1) * var(--step)));
  transform: translateX(calc(var(--shift) - var(--p) * var(--slot))) scale(var(--sc)) rotate(calc(var(--sg) * 2.5deg)); }
.up-fan[data-big="true"] .up-sheet[data-on="false"] { opacity: .72; }
.up-fan[data-big="true"] .up-sheet[data-far="true"] { opacity: .55; }
.up-fan[data-big="true"] .up-sheet[data-far="true"] .up-sheet-cap { opacity: 0; }
.up-sheet-in { position: relative; display: block; width: 280px; height: 196px; zoom: var(--z); overflow: hidden; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 16px 36px -14px rgba(31, 27, 58, .5), 0 0 0 1px rgba(31, 27, 58, .06); transition: box-shadow .2s; }
.up-sheet-in::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: linear-gradient(transparent, #fff); pointer-events: none; }
/* выбранный лист: рамка бледная без наведения и яркая при наведении (владелец 05.11, шаг 0д п. 9: «лучше бледной без наведения
   и яркой при»); невыбранный при наведении — бледная, как было */
.up-sheet[data-on="true"] .up-sheet-in { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 20px 40px -14px rgba(31, 27, 58, .55), 0 0 0 2px var(--ws-accent-border); }
.up-sheet:hover .up-sheet-in { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 20px 40px -14px rgba(31, 27, 58, .55), 0 0 0 2px var(--ws-accent-border); }
.up-sheet[data-on="true"]:hover .up-sheet-in { box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 20px 40px -14px rgba(31, 27, 58, .55), 0 0 0 2px var(--ws-accent); }
.up-zoom { display: block; }
.up-zoom.is-tm { width: 400px; zoom: .7; }
.up-zoom.is-pl { width: 340px; zoom: .82; }
.up-zoom.is-sl { width: 400px; zoom: .7; padding: 24px 0 0; }
.up-zoom.is-gn { width: 360px; zoom: .78; }
.up-zoom > div { box-shadow: none !important; border-radius: 0 !important; }
.up-sheet-cap { display: block; margin-top: 8px; text-align: center; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s, opacity .2s var(--ease-out); }
.up-sheet[data-on="true"] .up-sheet-cap { color: var(--ws-accent-ink); }
.up-pvtabs { display: none; justify-self: center; }
.up-pvtabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(31, 27, 58, .12), 0 3px 8px -3px rgba(60, 40, 120, .28); }

/* ---------- окно сборки ---------- */
/* подложка окна — колонка minmax(0,1fr): иначе max-width:100% у окна считается от дорожки шириной 440 px и на телефоне окно вылезает */
.up-main > [style*="position: fixed"] { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.up [role="dialog"] { border-radius: 24px !important; animation: up-dialog-in .32s var(--ease-apple) both !important; }
@keyframes up-dialog-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.up [role="dialog"] [style*="background: var(--ws-bar-active)"] { position: relative; overflow: hidden; background: linear-gradient(90deg, #4b40b8, #7c68ee, #ff9f7a) !important; }
.up [role="dialog"] [style*="background: var(--ws-bar-active)"]::after { content: ""; position: absolute; inset: 0; width: 50%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: up-sheen 1.4s ease-in-out infinite; }
@keyframes up-sheen { from { transform: translateX(-100%); } to { transform: translateX(200%); } }
.up [role="dialog"] a, .up [role="dialog"] .ws-btn-secondary { border-radius: 999px !important; }

/* ---------- «Мои классы» (новая функция, 04.11): пилюля «Класс» → список, «Только номер класса», окно класса ----------
   Список — под пилюлей в координатах композера (на телефоне — лист снизу), появляется за .26 с (--ease-out): сдвиг 6 px + масштаб .97.
   Метка класса — пастельная плашка, как в виджете «Мои классы» на главной. Окно — по центру (на телефоне — снизу). */
.up-composer:has(.up-mc-pop) { z-index: 40; }
.up-composer:has(.up-mc-pop) .up-ring { display: none; }
.up-mc-scrim { position: fixed; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; background: transparent; cursor: default; }
.up-mc-pop { position: absolute; z-index: 2; left: var(--mc-l, 12px); top: var(--mc-t, 100%); width: 320px; max-width: calc(100vw - 24px); display: grid; gap: 4px; padding: 8px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--up-card-line); box-shadow: 0 1px 2px rgba(31, 27, 58, .06), 0 24px 56px -18px rgba(60, 40, 120, .42);
  transform-origin: 30px 0; animation: up-mc-in .26s var(--ease-out) both; }
.up[data-theme="dark"] .up-mc-pop { box-shadow: 0 24px 56px -14px rgba(0, 0, 0, .8); }
@keyframes up-mc-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes up-mc-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes up-mc-fade { from { opacity: 0; } }
.up-mc-head { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 8px 2px; }
.up-mc-list { display: grid; gap: 2px; }
.up-mc-row { position: relative; }
.up-mc-pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 48px 6px 6px; border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  font-family: inherit; text-align: left; cursor: pointer; transition: background-color .15s var(--ease-out); }
.up-mc-pick:hover:not(:disabled) { background: var(--surface-2); }
.up-mc-pick[aria-checked="true"] { background: var(--ws-accent-soft); }
.up-mc-pick:disabled { cursor: not-allowed; opacity: .45; }
.up-mc-tag { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 12px; background: var(--c, var(--pastel-blue)); color: var(--ink);
  font-family: var(--font-display); font-size: 14px; line-height: 1; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.up-mc-pick[aria-checked="true"] .up-mc-tag { box-shadow: inset 0 0 0 1.5px var(--ws-accent); }
.up-mc-t { display: grid; flex: 1 1 auto; min-width: 0; }
.up-mc-t b { font-size: 14px; line-height: 19px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-mc-t span { font-size: 12.5px; line-height: 16px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* у класса несколько предметов — список предметов в две строки */
.up-mc-t[data-multi="true"] b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.up-mc-pick[aria-checked="true"] .up-mc-t b { color: var(--ws-accent-ink); }
.up-mc-ck { display: inline-grid; flex: 0 0 auto; color: var(--ws-accent); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .3s var(--spring-soft); }
.up-mc-pick[aria-checked="true"] .up-mc-ck { opacity: 1; transform: none; }
.up-mc-edit { position: absolute; right: 6px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  cursor: pointer; transition: background-color .15s, color .15s; }
.up-mc-edit:hover { background: var(--surface); color: var(--ws-accent-ink); box-shadow: 0 0 0 1px var(--line-strong); }
.up-mc-add { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px; border: 0; border-radius: 12px; background: transparent; color: var(--ws-accent-ink); font-family: inherit;
  font-size: 14px; line-height: 20px; font-weight: 600; text-align: left; cursor: pointer; transition: background-color .15s; }
.up-mc-add:hover { background: var(--surface-2); }
.up-mc-plus { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; border: 1.5px dashed var(--line-strong); color: var(--ws-accent); transition: border-color .15s; }
.up-mc-add:hover .up-mc-plus { border-color: var(--ws-accent); }
.up-mc-div { height: 1px; margin: 4px 6px; background: var(--line); }
.up-mc-nums { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 2px 6px 6px; }
.up-mc-nums button { height: 36px; min-width: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-family: inherit;
  font-size: 14px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s, transform .12s var(--ease-out); }
.up-mc-nums button:hover:not(:disabled) { border-color: var(--ws-accent); color: var(--ws-accent-ink); }
.up-mc-nums button:active:not(:disabled) { transform: scale(.94); }
.up-mc-nums button[aria-checked="true"] { border-color: var(--ws-accent); background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.up-mc-nums button:disabled { cursor: not-allowed; opacity: .38; }
/* окно класса */
.up-mc-overlay { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.up-mc-scrim.is-dim { position: absolute; z-index: 0; background: rgba(31, 27, 58, .36); animation: up-mc-fade .22s var(--ease-out) both; }
.up[data-theme="dark"] .up-mc-scrim.is-dim { background: rgba(0, 0, 0, .55); }
.up-mc-dlg { position: relative; z-index: 1; width: 540px; max-width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 18px; padding: 22px 24px 20px; background: var(--surface); border: 1px solid var(--up-card-line); box-shadow: var(--shadow-dialog); }
.up-mc-dlg-head { display: flex; align-items: flex-start; gap: 14px; }
.up-mc-tag.is-lg { min-width: 52px; height: 52px; padding: 0 10px; border-radius: 16px; font-size: 19px; transition: background-color .2s; }
.up-mc-dlg-tt { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.up-mc-dlg-t { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; letter-spacing: -.01em; color: var(--ink); }
.up-mc-dlg-sub { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.up-mc-x { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; margin: -6px -8px 0 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s; }
.up-mc-x:hover { background: var(--surface-2); color: var(--ink); }
.up-mc-nums.is-dlg { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; padding: 0; }
.up-mc-nums.is-dlg button { height: 40px; }
.up-mc-p { max-width: 220px; font-weight: 600; text-transform: uppercase; }
.up-mc-p::placeholder { font-weight: 400; text-transform: none; }
.up-mc-p[aria-invalid="true"] { border-color: var(--error); }
.up-mc-hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-2); }
.up-mc-hint[data-err="true"] { color: var(--error); font-weight: 600; }
/* предметы класса: строка — предмет, учебник, «убрать»; ниже — «Добавить предмет»; число предметов не ограничено */
.up-mc-subs-f { gap: 8px; }
.up-mc-subs-h, .up-mc-sub { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.up-mc-subs-h { margin-bottom: -2px; font-size: 12.5px; line-height: 16px; color: var(--text-2); }
.up-mc-subs-h span { padding-left: 2px; }
.up-mc-subs { display: grid; gap: 8px; }
.up-mc-sub { animation: up-mc-in .22s var(--ease-out) both; }
.up-mc-sx { display: grid; place-items: center; width: 40px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color .15s, color .15s; }
.up-mc-sx:hover { background: var(--surface-2); color: var(--ink); }
.up-mc-sadd { display: inline-flex; align-items: center; gap: 10px; justify-self: start; height: 40px; margin-left: -6px; padding: 0 12px 0 6px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ws-accent-ink); font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.up-mc-sadd:hover { background: var(--surface-2); }
.up-mc-sadd .up-mc-plus { width: 28px; height: 28px; border-radius: 9px; }
.up-mc-sadd:hover .up-mc-plus { border-color: var(--ws-accent); }
.up-mc-dlg-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.up-mc-sp { flex: 1 1 auto; }
.up-mc-del { display: inline-flex; align-items: center; gap: 6px; height: 44px; margin-left: -10px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--error);
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.up-mc-del:hover { background: var(--error-tint, rgba(212, 42, 70, .08)); }
.up-mc-btn { --go-bg: var(--ws-accent); --go-fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--go-bg); color: var(--go-fg); font-family: inherit; font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 27, 58, .2), 0 12px 26px -10px rgba(75, 64, 184, .6); transition: transform .12s var(--ease-out), box-shadow .2s, background-color .2s var(--ease-out), opacity .2s; }
.up-mc-btn:hover:not(:disabled) { transform: translateY(-1px); }
.up-mc-btn:active:not(:disabled) { transform: scale(.97); }
.up-mc-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.up-mc-btn.is-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.up-mc-btn.is-ghost:hover { box-shadow: inset 0 0 0 1px var(--ws-accent); color: var(--ws-accent-ink); }
.up[data-theme="dark"] .up-mc-btn.f-btn-accent { background: var(--primary) !important; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 26px -10px rgba(123, 98, 255, .6); }

/* ---------- липкая полоса на телефоне ---------- */
.up-dock { display: none; position: sticky; bottom: 0; z-index: 20; margin: 20px -16px 0; padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px)); grid-template-columns: minmax(0, 1fr); gap: 6px;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid rgba(31, 27, 58, .08); box-shadow: 0 -12px 32px -16px rgba(31, 27, 58, .35); }
.up[data-theme="dark"] .up-dock { background: rgba(28, 24, 52, .78); border-color: rgba(239, 236, 251, .1); }
.up-dock-txt { display: grid; gap: 0; min-width: 0; }
.up-dock-txt b { min-width: 0; font-size: 13.5px; line-height: 18px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-dock-txt span { min-width: 0; font-size: 12.5px; line-height: 16px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-dock .up-go { width: 100%; grid-template-columns: 1fr auto; padding: 0 2px 0 20px; }
.up-dock .up-go .up-go-label > span { opacity: 1; transform: none; }
.up-dock .up-go[data-ready="false"] .up-go-ic svg { transform: rotate(-90deg); }

/* ---------- ширины ---------- */
@media (max-width: 1179px) and (min-width: 640px) {
  .up-fmt { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 4px; border-radius: 24px; }
  .up-fmt-pill { width: calc((100% - 8px) / 4); height: calc((100% - 12px) / 2); transform: translate(calc(var(--c) * 100%), calc(var(--r) * 100% + var(--r) * 4px)); }
  .up-fmt-ic { display: inline-grid; }
}
@media (max-width: 1023px) {
  .up-main { padding: 24px 24px 64px; }
  .up-h1 { font-size: 40px; line-height: 46px; }
}
@media (max-width: 639px) {
  .up-main { padding: 16px 16px 20px; }
  .up-hero { gap: 16px; }
  .up-title { gap: 8px; padding: 2px 0 0; }
  .up-h1 { font-size: 30px; line-height: 36px; letter-spacing: -.02em; }
  .up-lead { font-size: 15px; line-height: 22px; }
  .up-fmt-wrap { margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 36px), transparent); }
  .up-fmt-wrap::-webkit-scrollbar { display: none; }
  .up-fmt { grid-template-columns: repeat(8, 134px); width: max-content; }
  .up-fmt-ic { display: inline-grid; }
  .up-composer { padding: 14px 14px 12px; border-radius: 22px; gap: 10px; }
  .up-ring { border-radius: 24px; }
  .up-topic { font-size: 19px; line-height: 27px; min-height: 58px; }
  .up-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 3px 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 30px), transparent); }
  .up-pills::-webkit-scrollbar { display: none; }
  .up-pill { flex: 0 0 auto; }
  .up-pill .up-new.is-float { display: none; }  /* лента пилюль обрезает по вертикали; «новая функция» — в заголовке списка классов */
  .up-foot > .up-go { display: none; }
  .up-cost { display: none; }
  .up-dock { display: grid; }
  .up-addon { padding: 0; }
  .up-src { display: flex; width: 100%; }
  .up-src button { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  /* лента листов вбок со snap-прокруткой: выбранный по центру в полный размер, соседние чуть меньше и бледнее */
  .up-fan, .up-fan[data-n] { --z: .86; --big: 1; --sm: .92; --gap: 12px; height: auto; margin: 0 -16px; padding: 10px calc(50% - 104px) 4px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none; justify-content: flex-start; }
  .up-fan::-webkit-scrollbar { display: none; }
  .up-fan[data-big] .up-sheet { margin-left: 0; scroll-snap-align: center; transform: scale(var(--sm)); opacity: .8; }
  .up-fan[data-big] .up-sheet[data-on="true"] { transform: none; opacity: 1; }
  .up-fan[data-big] .up-sheet .up-sheet-cap { opacity: 1; }
  .up-pv-all { display: none; }
  .up [role="dialog"] { border-radius: 20px !important; }
  /* «Мои классы»: список — лист снизу над затемнением, окно — тоже снизу; цели 44+ */
  .up-mc-scrim.is-pop { background: rgba(31, 27, 58, .32); animation: up-mc-fade .22s var(--ease-out) both; }
  .up[data-theme="dark"] .up-mc-scrim.is-pop { background: rgba(0, 0, 0, .55); }
  .up-mc-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-width: none; max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto;
    overscroll-behavior: contain; padding: 18px 10px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 24px; transform-origin: 50% 100%; animation: up-mc-up .32s var(--ease-apple) both; }
  .up-mc-pop::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .up-mc-pick { min-height: 56px; padding-right: 56px; }
  .up-mc-edit { width: 44px; height: 44px; margin-top: -22px; right: 4px; }
  .up-mc-add { min-height: 52px; }
  .up-mc-nums button { height: 44px; }
  .up-mc-overlay { place-items: end center; padding: 8px; }
  .up-mc-dlg { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 18px 16px 16px; gap: 16px; }
  .up .up-mc-dlg[role="dialog"] { animation-name: up-mc-up !important; }  /* окно выезжает снизу, как лист списка */
  .up-mc-dlg-head { gap: 12px; }
  .up-mc-tag.is-lg { min-width: 44px; height: 44px; border-radius: 14px; font-size: 17px; }
  .up-mc-dlg-t { font-size: 20px; line-height: 26px; }
  .up-mc-nums.is-dlg { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .up-mc-nums.is-dlg button { height: 44px; }
  .up-mc-p { max-width: none; }
  .up-mc-subs-h { display: none; }
  .up-mc-subs { gap: 14px; }
  .up-mc-sub { grid-template-columns: minmax(0, 1fr) 44px; row-gap: 6px; }
  .up-mc-sub + .up-mc-sub { padding-top: 14px; border-top: 1px solid var(--line); }
  .up-mc-sub > input { grid-column: 1 / -1; grid-row: 2; }
  .up-mc-sx { width: 44px; }
  .up-mc-sadd { height: 44px; }
  .up-mc-dlg-foot { gap: 8px; }
  .up-mc-dlg-foot .up-mc-btn { flex: 1 1 auto; }
  .up-mc-sp { display: none; }
  .up-mc-del { order: 3; flex: 1 1 100%; justify-content: center; margin: 0; }
}
@media (max-width: 359px) {
  .up-h1 { font-size: 28px; line-height: 34px; }
  .up-src button { height: auto; min-height: 28px; padding: 4px 8px; font-size: 13px; line-height: 16px; white-space: normal; }
  .up-fan, .up-fan[data-n] { --z: .78; padding-left: calc(50% - 93px); padding-right: calc(50% - 93px); }
}

/* ---------- шаг 0б (04.11, владелец: «Лучше чинить сразу»): цели нажатия ≥ 44 px на телефоне без изменения вида ----------
   До 767 px — как чипы-ссылки «Моих документов». Два приёма, оба без сдвига вёрстки (снимки до/после на 390 и 320 по всем
   состояниям совпадают попиксельно — tools/step0b_states.py):
   1) прозрачный ::before без скругления — полоса 44 px по центру элемента (top: 50%, height: 44px, margin-top: −22px;
      у элемента выше 44 px полоса внутри него), сам элемент — position: relative;
   2) там, где position: relative у элемента или его предка меняет сглаживание (токены комплекта, ссылка «Пример целиком»,
      галочки «Ещё настройки», переключатель «Откуда учебник» стоят на дробных пикселях — снимок отличался на 150–430 точек
      по краям букв и рамки), — пустой ::after внутри flex-элемента: flex-basis 100 % и левое поле −100 % минус gap
      (места в строке не занимает), align-self: stretch и отрицательные поля сверху и снизу — выходит за элемент без
      position. Gap в поле — gap самого элемента: поменяли gap — поправить и здесь.
   Области соседних целей не перекрываются (tools/step0b_targets.py: точек, которые достаются соседу, — 0): в рядах с
   переносом расширение не больше половины зазора между рядами (пилюли 36 → 44 при зазоре 8, чипы 38 → 44 при 8, галочки
   36 → 44 при 8, вкладки форматов 40 → 44 при 4); токены комплекта (30 px, зазор рядов 6) — 6 px вверх и 8 вниз: нижний
   ряд забирает зазор, но верхний токен не задевает (он рисуется и ловит нажатие поверх расширения соседа).
   Лента пилюль на телефоне — полоса с прокруткой вбок, она обрезает всё, что выше и ниже её полей: поля сверху и снизу
   3 → 7 px с отрицательными полями −4 px (место и вид те же), выбор «Предмет» / «Тип урока» — сам невидимый select выше
   на 5 px сверху и снизу (нажатие на подпись label список не открывает). Подписи полей (label над полем 44 px) — не
   отдельная цель: нажатие на них ставит фокус в поле, а само поле 44 px. */
@media (max-width: 767px) {
  .up-topbar-name, .up-back, .up-help, .up-fmt-tab, .up-composer button.up-pill, .up-composer a.up-pill, .up-pill.is-seg button,
  .up-addon .up-chip:not(.is-later), .up-mc-x, .up-mc-nums button, .up > .f-side nav.v2-root > div:first-child > a { position: relative; }
  .up-topbar-name::before, .up-back::before, .up-fmt-tab::before, .up-composer button.up-pill::before, .up-composer a.up-pill::before,
  .up-pill.is-seg button::before, .up-addon .up-chip:not(.is-later)::before, .up > .f-side nav.v2-root > div:first-child > a::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
  /* квадратные кнопки-значки: «?» (32 на «Новом документе», 40 на главной — вид не выравниваем, это шкала ДС) и «Закрыть» в окне класса.
     «?» стоит последним справа в строке, а на главной на 320 его рамка уже доходит до 319 px — квадрат 44 растёт только влево
     (иначе на 320 появлялась прокрутка вбок на 1 px); слева у «?» зазор 6 px до «Настроить», расширение — 4 px */
  .up-help::before { content: ""; position: absolute; right: 0; top: 50%; width: 44px; height: 44px; margin-top: -22px; }
  .up-mc-x::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  /* номера 1–11 в списке и окне класса: на 320 они 40 px в ширину при зазоре 6 — расширение по 2 px вбок */
  .up-mc-nums button::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; }
  .up-composer .up-pill select { top: -5px; height: calc(100% + 10px); }
  /* приём 2: поля отсчитываются от внутреннего края рамки 1 px (у токена −7 / −9 = −6 / −8 от рамки) */
  .up-tokens > button.up-token::after { content: ""; flex: 0 0 100%; align-self: stretch; margin: -7px 0 -9px calc(-100% - 6px); }
  .up-check::after { content: ""; flex: 0 0 100%; align-self: stretch; margin: -5px 0 -5px calc(-100% - 8px); }
  .up-pv-head .up-link::after { content: ""; flex: 0 0 100%; align-self: stretch; margin: -12px 0 -12px calc(-100% - 4px); }
  .up .f-seg button { display: inline-flex; align-items: center; justify-content: center; }  /* было display: block — текст по центру так же */
  .up .f-seg button::after { content: ""; flex: 0 0 100%; align-self: stretch; margin: -4px 0 -4px -100%; }
}
@media (max-width: 639px) {
  .up-pills { padding-top: 7px; padding-bottom: 7px; margin-top: -4px; margin-bottom: -4px; }
}
/* шаг 0в (05.11, владелец: вариант «А»): от 640 px список «Мои классы» не ниже окна минус 16 px, прокрутка внутри списка
   (полоса прокрутки обычная, как у остальных списков набора); высоту считает mcFit (a2x_common). Ниже 640 — лист снизу.
   Пункты меню телефона — 36 / 34 / 30 через 2 px (владелец 05.11: «оставить как сейчас», не 44). */
@media (min-width: 640px) {
  .up-mc-pop { max-height: var(--mc-mh, none); }
  .up-mc-pop[data-fit="scroll"] { overflow-y: auto; overscroll-behavior: contain; }
}

/* ---------- reduced motion: только мгновенная смена состояния ---------- */
@media (prefers-reduced-motion: reduce) {
  .up [role="dialog"], .up [role="dialog"] *, .up .up-mc-dlg[role="dialog"] { animation: none !important; }  /* окна: правило выше с !important сильнее общего выключателя */
  .up *, .up *::before, .up *::after { animation: none !important; transition: none !important; }
  .up-ring { display: none; }
}

/* ---------- 09.11 UX-разбор ----------
   up-inline-a — ссылка внутри фразы (подсказка, строка стоимости): как up-link, но строчная, без стрелки и прижатия вправо
   («Выбрать тариф» у «бесплатный документ использован» — главная, готовый документ). Кандидат в ДС: «Ссылка в тексте».
   п. 5: «новая функция» — не больше одного значка на экране; в форме остаётся у «Дополнить урок», у пилюли «Класс» — снят */
.up-inline-a { font-weight: 600; color: var(--ws-accent); text-decoration: none; white-space: nowrap; }
.up-inline-a:hover { color: var(--ws-accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.up-form-main .up-pill .up-new.is-float { display: none; }
