/* exceli — «страница как лист». Сетка столбцов A–L, номера строк, рамка выделения, маркер заполнения.
   Чернила и бумага; синий — выделение и действие; жёлтый — «куда писать»; красный — только оценки учителя. */
:root {
  --paper: #FBFBF8; --cell: #FFFFFF; --sunk: #F1F1EC; --rule: #E4E4DD; --rule-2: #D2D2CA;
  --ink: #141414; --ink-2: #57574F; --ink-3: #8E8E85;
  --blue: #1F3BFF; --blue-soft: rgba(31, 59, 255, .08); --on-blue: #FFFFFF;
  --yellow: #FFE500; --yellow-soft: rgba(255, 229, 0, .38);
  --red: #E2231A; --green: #0B8A4C; --green-soft: rgba(11, 138, 76, .11); --red-soft: rgba(226, 35, 26, .09); --amber-soft: rgba(255, 186, 0, .2);
  --r1: #1F3BFF; --r2: #E2231A; --r3: #0B8A4C; --r4: #A23BD1;
  --f-display: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --col: calc(100% / 12);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #111110; --cell: #181817; --sunk: #1E1E1C; --rule: #2A2A27; --rule-2: #383834;
  --ink: #F2F1EB; --ink-2: #A9A89F; --ink-3: #74736B;
  --blue: #7488FF; --blue-soft: rgba(116, 136, 255, .14); --on-blue: #0D0D0C;
  --yellow: #FFE500; --yellow-soft: rgba(255, 229, 0, .16);
  --red: #FF5B4F; --green: #3CCB82; --green-soft: rgba(60, 203, 130, .14); --red-soft: rgba(255, 91, 79, .13); --amber-soft: rgba(255, 196, 0, .15);
  --r1: #7488FF; --r2: #FF5B4F; --r3: #3CCB82; --r4: #D58BFA; color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #111110; --cell: #181817; --sunk: #1E1E1C; --rule: #2A2A27; --rule-2: #383834;
  --ink: #F2F1EB; --ink-2: #A9A89F; --ink-3: #74736B;
  --blue: #7488FF; --blue-soft: rgba(116, 136, 255, .14); --on-blue: #0D0D0C;
  --yellow: #FFE500; --yellow-soft: rgba(255, 229, 0, .16);
  --red: #FF5B4F; --green: #3CCB82; --green-soft: rgba(60, 203, 130, .14); --red-soft: rgba(255, 91, 79, .13); --amber-soft: rgba(255, 196, 0, .15);
  --r1: #7488FF; --r2: #FF5B4F; --r3: #3CCB82; --r4: #D58BFA; color-scheme: dark }

html, body { height: 100%; }
body { margin: 0; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--cell); }
* { box-sizing: border-box; }
a { color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
code, kbd { font-family: var(--f-mono); font-size: .88em; }
/* без лигатур: >= и <> должны выглядеть так, как их набирают */
:root { --mono-off: "liga" 0, "calt" 0; }
code, kbd, input, .mono, #fx, #cellEd, .try-fx input, .chip, .sig, .fxbar .f, .card-fx, .cert-fx, .fn .syn, .fns, td.mono { font-variant-ligatures: none; font-feature-settings: var(--mono-off); }
code { background: var(--sunk); padding: 1px 5px; white-space: nowrap; }
kbd { display: inline-block; padding: 0 6px; min-width: 1.6em; text-align: center; border: 1px solid var(--rule-2); border-bottom-width: 2px; background: var(--cell); line-height: 1.45; border-radius: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); }

/* ---------- Шапка: лента + вкладки листов ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--cell); border-bottom: 1px solid var(--ink); }
.top > .wrap { display: flex; align-items: flex-end; gap: 28px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; align-self: center; padding-block: 12px; }
.wm { height: 21px; width: auto; display: block; }
.wm-dot { fill: var(--blue); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: center; }
.brand:hover .wm-dot { transform: translate(6%, 6%) scale(1.08); }
.brand .tld { font-family: var(--f-body); font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.tabs { display: flex; align-self: stretch; align-items: flex-end; gap: 0; margin-bottom: -1px; }
.tabs a { position: relative; text-decoration: none; color: var(--ink-2); padding: 7px 16px 8px; font-size: 14px; font-weight: 500; border: 1px solid transparent; border-bottom: 0; }
.tabs a:hover { color: var(--ink); background: var(--sunk); }
.tabs a.on { color: var(--ink); background: var(--paper); border-color: var(--ink); z-index: 2; }
.tabs a.on::after { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--blue); }
.spacer { flex: 1; }
.tools { display: flex; gap: 14px; align-items: center; align-self: center; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; padding-block: 8px; }
.stats { display: flex; gap: 12px; }
.tools b { color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); }
.seg button { border: 0; background: transparent; padding: 3px 9px; font-size: 12.5px; color: var(--ink-2); font-family: var(--f-body); }
.seg button.on { background: var(--ink); color: var(--paper); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--cell); padding: 9px 16px; font-weight: 500; text-decoration: none; color: var(--ink); position: relative; transition: transform .1s, box-shadow .1s; }
.btn:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn:active { box-shadow: none; transform: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn.big { padding: 14px 24px; font-size: 17px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); box-shadow: none; transform: none; }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
/* маркер заполнения на главной кнопке */
.btn.handle::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 9px; height: 9px; background: var(--blue); border: 2px solid var(--paper); }
.btn.primary.handle::after { background: var(--ink); }

/* ---------- Лендинг ---------- */
.fxbar { background: var(--cell); border-top: 1px solid var(--ink); }
.fxbar .wrap { display: flex; align-items: stretch; height: 34px; }
.fxbar .nb { width: 92px; flex: none; display: grid; place-items: center; font-family: var(--f-mono); font-size: 13px; border-right: 1px solid var(--rule-2); border-left: 1px solid var(--rule-2); }
.fxbar .fx { padding: 0 12px; display: grid; place-items: center; color: var(--ink-3); font-style: italic; font-family: Georgia, serif; border-right: 1px solid var(--rule-2); }
.fxbar .f { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 0 12px; font-family: var(--f-mono); font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.fxbar .f .res { margin-left: auto; color: var(--ink-3); }
.fxbar .f .caret { width: 1px; height: 16px; background: var(--ink); animation: blink 1s steps(1) infinite; margin-left: -12px; }
@keyframes blink { 50% { opacity: 0; } }
.colhead { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border-left: 1px solid var(--rule-2); }
.colhead span { text-align: center; font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); border-right: 1px solid var(--rule-2); line-height: 22px; background: var(--sunk); }
.colhead span.hl { color: var(--blue); background: var(--blue-soft); }
.colwrap { background: var(--sunk); border-top: 1px solid var(--rule-2); }
.colwrap .wrap { display: grid; grid-template-columns: 44px minmax(0, 1fr); }
.colwrap .corner { border-left: 1px solid var(--rule-2); }

.sheetpage { position: relative; }
.row { position: relative; border-bottom: 1px solid var(--rule); }
.row .wrap { display: grid; grid-template-columns: 44px minmax(0, 1fr); }
.rn { font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); border-left: 1px solid var(--rule-2); border-right: 1px solid var(--rule-2); background: var(--sunk); text-align: center; padding-top: 14px; }
.row.cur .rn { color: var(--blue); background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--sunk); }
.rc { position: relative; min-width: 0; background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: var(--col) 100%; background-position: -1px 0; }
.rc > .in { position: relative; padding: 56px max(20px, calc(var(--col) * .35)); }

.in.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; padding-top: 64px !important; padding-bottom: 72px !important; }
.hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(40px, 5.8vw, 80px); line-height: .98; letter-spacing: -.045em; margin: 0 0 26px; }
.hero h1 .sel { position: relative; display: inline-block; padding: 0 .08em; outline: 3px solid var(--blue); outline-offset: 2px; background: var(--blue-soft); }
.hero h1 .sel::after { content: ""; position: absolute; right: -.14em; bottom: -.14em; width: .16em; height: .16em; min-width: 10px; min-height: 10px; background: var(--blue); border: 3px solid var(--paper); }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 31em; margin: 0 0 30px; }
.hero .lead b { color: var(--ink); font-weight: 600; }
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.facts { display: flex; gap: 0; margin-top: 44px; border: 1px solid var(--rule-2); width: max-content; max-width: 100%; flex-wrap: wrap; background: var(--cell); }
.facts div { padding: 10px 18px; border-right: 1px solid var(--rule-2); }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; font-size: 26px; line-height: 1.1; }
.facts span { font-size: 12.5px; color: var(--ink-2); }

/* живая мини-задача */
.try { background: var(--cell); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); position: relative; }
.try-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ink); background: var(--yellow); color: #141414; }
.try-h b { font-weight: 600; font-size: 15px; }
.try-h span { font-family: var(--f-mono); font-size: 12px; }
.try-fx { display: flex; border-bottom: 1px solid var(--rule-2); }
.try-fx .nb { width: 52px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12.5px; border-right: 1px solid var(--rule-2); }
.try-fx input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font-family: var(--f-mono); font-size: 15px; background: transparent; color: var(--ink); outline: none; }
.try-fx input:focus { background: var(--blue-soft); }
.try table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.try th { background: var(--sunk); color: var(--ink-3); font-family: var(--f-body); font-weight: 400; font-size: 11.5px; height: 22px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule-2); cursor: pointer; }
.try th:first-child { width: 30px; cursor: default; }
.try th[data-col]:hover { color: var(--blue); background: var(--blue-soft); }
.try td { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0 8px; height: 29px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.try td.rh { background: var(--sunk); color: var(--ink-3); font-family: var(--f-body); font-size: 11.5px; text-align: center; padding: 0; cursor: default; }
.try td.n { text-align: right; }
.try tr.hdr td:not(.rh) { font-weight: 600; }
.try td:not(.rh):hover { background: var(--blue-soft); }
.try td.ref { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.try td.target { background: var(--yellow-soft); position: relative; font-weight: 600; }
.try td.target.ants { background-image: linear-gradient(90deg, var(--ink) 50%, transparent 50%), linear-gradient(90deg, var(--ink) 50%, transparent 50%), linear-gradient(0deg, var(--ink) 50%, transparent 50%), linear-gradient(0deg, var(--ink) 50%, transparent 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 8px 2px, 8px 2px, 2px 8px, 2px 8px; background-position: 0 0, 0 100%, 0 0, 100% 0; background-color: var(--yellow-soft); animation: ants .6s linear infinite; }
@keyframes ants { to { background-position: 8px 0, -8px 100%, 0 -8px, 100% 8px; } }
.try td.target.ghost { color: var(--ink-3); font-weight: 400; }
.try td.target.good { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); animation: none; }
.try-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--rule-2); background: var(--sunk); }
.chip { border: 1px solid var(--rule-2); background: var(--cell); font-family: var(--f-mono); font-size: 13px; padding: 4px 9px; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.try-foot { padding: 12px 14px; border-top: 1px solid var(--rule-2); display: flex; gap: 12px; align-items: center; min-height: 58px; flex-wrap: wrap; }
.try-foot .msg { font-size: 14px; flex: 1; min-width: 12em; }
.try .stampbox { position: absolute; right: -52px; top: 292px; pointer-events: none; }
.nw { white-space: nowrap; }

.grade { font-family: var(--f-display); color: var(--red); font-weight: 800; letter-spacing: -.04em; display: inline-grid; place-items: center; width: 60px; height: 60px; border: 3px solid var(--red); border-radius: 50%; font-size: 32px; line-height: 1; transform: rotate(-9deg); background: transparent; }
.grade.pop { animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes stamp { 0% { transform: scale(2.4) rotate(-24deg); opacity: 0; } 100% { transform: scale(1) rotate(-9deg); opacity: 1; } }

/* секции-диапазоны */
.label { font-family: var(--f-body); font-size: 13px; font-weight: 500; color: var(--ink-3); margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.label i { font-style: normal; color: var(--blue); }
.h2 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; font-size: clamp(30px, 4vw, 52px); line-height: 1.02; margin: 0 0 14px; max-width: 16em; }
.sub { color: var(--ink-2); max-width: 36em; margin: 0 0 30px; font-size: 17px; }

.xtable { border: 1px solid var(--ink); background: var(--cell); overflow-x: auto; }
.xtable table { border-collapse: collapse; width: 100%; min-width: 640px; font-variant-numeric: tabular-nums; }
.xtable th, .xtable td { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 11px 14px; text-align: left; vertical-align: middle; }
.xtable thead th { background: var(--sunk); font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--ink); }
.xtable th.ours { background: var(--ink); color: var(--paper); }
.xtable td.y { background: var(--green-soft); }
.xtable td.n { background: var(--red-soft); color: var(--ink-2); }
.xtable td.p { background: var(--amber-soft); }
.xtable td.ours { font-weight: 600; box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink); }
.xtable tr:last-child td.ours { box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink), inset 0 -2px 0 var(--ink); }
.xtable .rn2 { width: 36px; text-align: center; font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); background: var(--sunk); padding: 0; }
.xtable tfoot td { font-family: var(--f-mono); font-size: 13px; background: var(--sunk); border-top: 1px solid var(--ink); }
.bar { height: 8px; background: var(--rule); position: relative; margin-top: 4px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink-3); }
.bar.ours i { background: var(--blue); }

/* программа: таблица модулей */
.prog tbody tr { cursor: pointer; }
.prog tbody tr:hover td { background: var(--blue-soft); }
.prog tbody tr:hover td.rn2 { background: var(--blue); color: var(--on-blue); }
.prog td.t b { font-weight: 600; display: block; }
.prog td.t span { color: var(--ink-2); font-size: 13.5px; }
.prog td.fns { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.prog .dots { display: flex; gap: 4px; }
.dot { width: 22px; height: 22px; border: 1px dashed var(--ink-3); display: grid; place-items: center; font-family: var(--f-display); font-size: 13px; font-weight: 800; color: var(--red); line-height: 1; }
.dot.done { border: 1px solid var(--rule-2); background: var(--cell); }
.prog .go { font-family: var(--f-body); font-size: 13px; color: var(--blue); white-space: nowrap; }

.who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--cell); }
.who > div { padding: 22px; border-right: 1px solid var(--rule); min-width: 0; }
.who > div:last-child { border-right: 0; }
.who h3 { font-size: 19px; margin: 0 0 6px; font-weight: 600; }
.who p { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.who code { white-space: normal; overflow-wrap: anywhere; display: inline-block; }
.who a { font-size: 14px; text-decoration: none; font-weight: 500; }

.price { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.bigcell { position: relative; border: 3px solid var(--ink); background: var(--cell); padding: 26px 30px; display: inline-block; }
.bigcell .v { font-family: var(--f-display); font-weight: 800; letter-spacing: -.05em; font-size: clamp(70px, 10vw, 128px); line-height: .9; }
.bigcell .cap { font-family: var(--f-body); font-size: 13px; color: var(--ink-3); position: absolute; top: -24px; left: -3px; }
.bigcell .tri { position: absolute; top: 0; right: 0; width: 0; height: 0; border-top: 16px solid var(--red); border-left: 16px solid transparent; }
.note { position: absolute; left: 36px; top: calc(100% + 22px); width: 260px; background: var(--yellow); color: #141414; padding: 12px 14px; font-size: 14px; box-shadow: 4px 4px 0 var(--ink); }
.note::before { content: ""; position: absolute; right: 12px; top: -22px; width: 1px; height: 22px; background: var(--ink); }
.price > div:first-child { padding-bottom: 130px; }
.note b { display: block; font-size: 12px; font-family: var(--f-body); margin-bottom: 4px; }

.foot { padding-block: 34px 44px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; color: var(--ink-2); font-size: 13.5px; }
.foot .wm { height: 18px; color: var(--ink); }
.foot .legal { margin-left: auto; max-width: 30em; }

/* ---------- Тренажёр ---------- */
.lesson { display: grid; grid-template-columns: minmax(290px, 370px) minmax(0, 1fr); gap: 22px; padding-block: 22px 48px; align-items: start; }
.task { background: var(--cell); border: 1px solid var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.crumbs { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--f-body); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.steps { display: flex; gap: 4px; }
.steps a { flex: 1; height: 6px; background: var(--rule); }
.steps a.done { background: var(--green); }
.steps a.cur { background: var(--blue); }
.task h1 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; font-size: 24px; line-height: 1.1; margin: 0; }
.task .text { margin: 0; font-size: 16px; }
.task .text b.addr { background: var(--yellow); color: #141414; padding: 0 4px; font-weight: 600; cursor: pointer; font-family: var(--f-mono); font-size: .92em; }
.task .text b.addr:hover { outline: 2px solid var(--blue); }
.task .text b { font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.checks li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink-2); }
.checks li::before { content: ""; flex: none; width: 15px; height: 15px; margin-top: 3px; border: 1.5px solid var(--ink-3); }
.checks li.ok { color: var(--ink); }
.checks li.ok::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3L12.5 5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='square'/%3E%3C/svg%3E") center/100% no-repeat; }
.checks li.bad::before { border-color: var(--red); }
.howto { font-size: 13.5px; background: var(--sunk); padding: 10px 12px; border-left: 3px solid var(--blue); }
.howto ol { margin: 4px 0 0; padding-left: 18px; }
.hints { display: flex; flex-direction: column; gap: 8px; }
.hint { background: var(--sunk); padding: 10px 12px; font-size: 14px; animation: rise .25s ease-out; border-left: 3px solid var(--ink-3); }
.hint .lbl { font-size: 11.5px; letter-spacing: .06em; color: var(--ink-3); display: block; margin-bottom: 2px; font-family: var(--f-body); }
.hint.answer { background: var(--red-soft); border-left-color: var(--red); }
#fb:empty, #hints:empty, #win:empty { display: none; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-actions .ghost { padding-inline: 10px; }
.fb { font-size: 14px; padding: 9px 12px; background: var(--red-soft); border-left: 3px solid var(--red); animation: rise .2s ease-out; }
.fb.info { background: var(--blue-soft); border-left-color: var(--blue); }
.win { border-top: 1px dashed var(--rule-2); padding-top: 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; animation: rise .3s ease-out; }
.win .grade { grid-row: span 2; animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1); }
.win .praise { font-family: var(--f-display); color: var(--red); font-size: 22px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.win .xp { font-size: 13px; color: var(--ink-2); }
.win .why { grid-column: 1 / -1; font-size: 14.5px; color: var(--ink-2); margin: 4px 0 0; }
.win .btn { grid-column: 1 / -1; justify-self: start; }
@keyframes rise { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet { background: var(--cell); border: 1px solid var(--ink); overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule-2); }
.namebox { width: 76px; flex: none; border-right: 1px solid var(--rule-2); display: grid; place-items: center; font-family: var(--f-mono); font-size: 13px; }
.fx-lbl { padding: 0 10px; display: grid; place-items: center; color: var(--ink-3); font-style: italic; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; border-right: 1px solid var(--rule-2); }
#fx { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-family: var(--f-mono); font-size: 14.5px; color: var(--ink); outline: none; }
#fx:focus { background: var(--blue-soft); }
.sheet-sub { display: flex; gap: 12px; align-items: center; min-height: 34px; padding: 5px 12px; border-bottom: 1px solid var(--rule-2); font-size: 13px; color: var(--ink-2); background: var(--sunk); flex-wrap: wrap; }
.sheet-sub .sig { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); }
.sheet-sub .sig b { color: var(--blue); }
.sheet-sub .prev { margin-left: auto; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.sheet-sub .prev.err { color: var(--red); }
.gridwrap { position: relative; overflow: auto; max-height: min(64vh, 640px); outline: none; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; }
.grid th { position: sticky; top: 0; z-index: 8; background: var(--sunk); color: var(--ink-3); font-weight: 400; font-family: var(--f-body); font-size: 11.5px; height: 24px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule-2); }
.grid th.rh { position: sticky; left: 0; z-index: 8; width: 40px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule); }
.grid thead th.rh { z-index: 9; }
.grid th.hl { color: var(--blue); background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--sunk); }
.grid td { height: 29px; padding: 0 7px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; cursor: cell; background: var(--cell); }
.grid td.n { text-align: right; }
.grid td.b { text-align: center; }
.grid td.e { color: var(--red); text-align: center; font-weight: 500; }
.grid tr:first-child td.hdr { font-weight: 600; background: var(--sunk); }
.grid td.tg { background: var(--yellow-soft); }
.grid td.tg.empty { background-image: linear-gradient(90deg, var(--ink) 50%, transparent 50%), linear-gradient(90deg, var(--ink) 50%, transparent 50%), linear-gradient(0deg, var(--ink) 50%, transparent 50%), linear-gradient(0deg, var(--ink) 50%, transparent 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 8px 1px, 8px 1px, 1px 8px, 1px 8px; background-position: 0 0, 0 100%, 0 0, 100% 0; animation: ants .7s linear infinite; }
.grid td.tg.good { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.grid td.tg.wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.grid td.sel { background-image: linear-gradient(var(--blue-soft), var(--blue-soft)); }
.grid td.fm::after { content: ""; position: absolute; left: 0; top: 0; border-top: 5px solid var(--ink-3); border-right: 5px solid transparent; opacity: .5; }
.selbox, .actbox, .refbox { position: absolute; pointer-events: none; z-index: 5; }
.selbox { border: 1px solid var(--blue); }
.actbox { border: 2px solid var(--blue); }
.refbox { border: 2px dashed currentColor; background: color-mix(in srgb, currentColor 8%, transparent); }
.fill { position: absolute; width: 9px; height: 9px; background: var(--blue); border: 2px solid var(--cell); z-index: 6; cursor: crosshair; touch-action: none; }
#cellEd { position: absolute; z-index: 7; border: 2px solid var(--blue); background: var(--cell); color: var(--ink); font-family: var(--f-mono); font-size: 14px; padding: 0 6px; outline: none; box-shadow: 4px 4px 0 rgba(0, 0, 0, .12); }
.ac { position: absolute; z-index: 10; background: var(--cell); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); min-width: 280px; max-width: 360px; padding: 3px; }
.ac div { padding: 6px 9px; cursor: pointer; font-size: 13px; display: flex; flex-direction: column; }
.ac div b { font-family: var(--f-mono); font-weight: 600; }
.ac div span { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac div.on, .ac div:hover { background: var(--blue-soft); }
.sheet-foot { display: flex; align-items: center; gap: 10px; padding: 0 10px 6px; border-top: 1px solid var(--rule-2); font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; background: var(--sunk); }
.tab { background: var(--cell); border: 1px solid var(--rule-2); border-top: 0; padding: 3px 14px; color: var(--ink); font-weight: 500; position: relative; }
.tab::before { content: ""; position: absolute; left: -1px; right: -1px; bottom: 0; height: 3px; background: var(--blue); }
.sheet-foot .keys { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.edit-btn { display: none; margin: 8px; }
.qk { display: none; gap: 6px; padding: 8px; border-top: 1px solid var(--rule-2); overflow-x: auto; background: var(--sunk); }
.qk button { flex: none; min-width: 42px; height: 40px; border: 1px solid var(--rule-2); background: var(--cell); font-family: var(--f-mono); font-size: 15px; }
.qk button.go { background: var(--blue); color: var(--on-blue); border-color: var(--blue); min-width: 58px; }
.editing .qk { display: flex; }
@media (hover: none), (pointer: coarse) { .sheet:not(.editing) .edit-btn { display: inline-flex; } }
@media (hover: hover) and (pointer: fine) { .editing .qk { display: none; } }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); box-shadow: 4px 4px 0 var(--blue); animation: rise .2s ease-out; }

/* Справочник */
.ref { padding-block: 34px 60px; max-width: 1000px; }
.ref h1 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; font-size: clamp(32px, 5vw, 54px); line-height: 1; margin: 0 0 12px; }
.search { width: 100%; max-width: 540px; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--ink); background: var(--cell); color: var(--ink); margin: 18px 0 24px; font-family: var(--f-mono); }
.search:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }
.fnlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.fn { background: var(--cell); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 16px; min-width: 0; }
.fn .h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fn .h b { font-family: var(--f-mono); font-size: 15.5px; }
.fn .h span { font-family: var(--f-body); font-size: 12.5px; color: var(--ink-3); }
.fn .h a { margin-left: auto; font-size: 13px; text-decoration: none; }
.fn .syn { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); margin: 6px 0 4px; overflow-wrap: anywhere; }
.fn p { margin: 0; font-size: 14.5px; }
.dict { overflow-x: auto; margin-top: 10px; border: 1px solid var(--ink); background: var(--cell); max-height: 480px; }
.dict table { border-collapse: collapse; width: 100%; font-family: var(--f-body); font-size: 13px; }
.dict td, .dict th { padding: 6px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.dict th { position: sticky; top: 0; background: var(--sunk); font-family: var(--f-body); font-weight: 500; color: var(--ink-2); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 46px 0 14px; }
.section-h h2 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; font-size: 26px; margin: 0; }

@media (max-width: 1000px) {
  .in.hero { grid-template-columns: minmax(0, 1fr); }
  .try { max-width: 560px; }
  .price { grid-template-columns: minmax(0, 1fr); }
  .price > div:first-child { padding-bottom: 0; }
  .note { position: static; width: auto; margin-top: 18px; max-width: 360px; }
  .note::before { display: none; }
  .lesson { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .colwrap { display: none; }
  .row .wrap { grid-template-columns: 26px minmax(0, 1fr); }
  .rn { font-size: 10px; }
  .rc { background-size: calc(100% / 4) 100%; }
  .rc > .in { padding: 40px 14px; }
  .top { position: static; }
  .top > .wrap { padding-top: 4px; }
  .brand { order: 1; } .tools { order: 2; margin-left: auto; } .spacer { display: none; } .tabs { order: 3; width: 100%; }
  .facts { width: auto; }
  .tools .seg[title="Клавиатура"], .brand .tld { display: none; }
  .task { padding: 14px; gap: 11px; }
  .task h1 { font-size: 21px; }
  .task-actions .btn { padding: 7px 11px; font-size: 14px; }
  .lesson { padding-block: 12px 32px; gap: 12px; }
  .facts div { flex: 1 1 40%; }
  .hero .lead { font-size: 17px; }
  .in.hero { padding-top: 34px !important; padding-bottom: 48px !important; }
  .who { grid-template-columns: 1fr; }
  .who > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .fnlist { grid-template-columns: 1fr; }
  .tools .lbl { display: none; }
  .top > .wrap { gap: 12px; }
  .tabs a { padding: 6px 10px 7px; }
  .fxbar .nb { width: 56px; }
  .fxbar .f .res { display: none; }
  .sheet-foot .keys { display: none; }
  .try { box-shadow: 5px 5px 0 var(--ink); }
  .try .stampbox { right: 8px; top: -34px; }
  .facts b { font-size: 21px; }
  .foot .legal { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* PHP-страницы справочника */
.fn-cta { margin-top: 28px; }
.fn .h b a { color: inherit; text-decoration: none; }
.fn .h b a:hover { color: var(--blue); }
.ref .crumbs { margin-bottom: 14px; }
.ref h1 .muted { font-weight: 500; }
.foot a { color: var(--ink-2); }
.fn .h strong { font-size: 15px; font-weight: 600; }
/* Повторение на главной */
.review { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -10px 0 18px; font-size: 14px; }
.review .chip { font-family: var(--f-body); text-decoration: none; color: var(--ink); display: inline-flex; gap: 8px; align-items: center; }
.review .chip i { font-style: normal; font-weight: 800; color: var(--red); }

/* ---------- Вход, профиль, сертификат ---------- */
a.stats { color: inherit; text-decoration: none; }
a.stats:hover b { color: var(--blue); }
.acct { width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; position: relative; }
.acct::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; background: var(--blue); border: 2px solid var(--cell); }
.acct-in { font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid var(--ink); padding: 4px 12px; font-size: 14px; }
.acct-in:hover { background: var(--ink); color: var(--paper); }
.narrow { max-width: 620px; padding-block: 48px 72px; }
.card-sheet { background: var(--cell); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.card-fx, .cert-fx { display: flex; border-bottom: 1px solid var(--rule-2); font-family: var(--f-mono); font-size: 13px; }
.card-fx span, .cert-fx span { padding: 8px 12px; }
.card-fx .nb, .cert-fx .nb { width: 56px; text-align: center; border-right: 1px solid var(--rule-2); }
.card-fx .fx, .cert-fx .fx { color: var(--ink-3); font-style: italic; font-family: Georgia, serif; border-right: 1px solid var(--rule-2); }
.card-in { padding: 28px 30px 32px; display: flex; flex-direction: column; gap: 12px; }
.card-in .h2, .card-in .sub { margin: 0; }
.form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; width: 100%; max-width: 420px; }
.field input { font: inherit; font-size: 17px; font-weight: 400; padding: 12px 14px; border: 1px solid var(--ink); background: var(--cell); color: var(--ink); border-radius: 0; }
.field input:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }
.me { padding-block: 34px 64px; display: flex; flex-direction: column; gap: 26px; }
.me-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.me-head .h2 { overflow-wrap: anywhere; }
.me-head .sub { margin: 0; }
.me-facts { margin-top: 0; }
.h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.cert-box { border: 1px solid var(--ink); background: var(--cell); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cert-box p { margin: 0; }
.bar.big { height: 12px; width: 100%; max-width: 520px; }
.bar.big i { background: var(--blue); }

.cert-page { padding-block: 34px 64px; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.cert { width: 100%; max-width: 1000px; aspect-ratio: 297 / 210; background: var(--cell); color: var(--ink); border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); display: flex; flex-direction: column; position: relative; overflow: hidden;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 100% 36px, calc(100% / 12) 100%; }
.cert-fx { background: var(--cell); }
.cert-body { flex: 1; padding: 5% 6% 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 1.4cqw; container-type: inline-size; position: relative; }
.cert-top { display: flex; justify-content: space-between; align-items: center; }
.cert-top .wm { height: clamp(18px, 2.6vw, 28px); }
.cert-kind { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: clamp(12px, 1.5vw, 15px); color: var(--ink-2); }
.cert-lead { margin: 7% 0 0; color: var(--ink-2); font-size: clamp(14px, 1.8vw, 19px); }
.cert-name { margin: 0; font-size: clamp(30px, 6.2vw, 68px); line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.cert-name .sel { position: relative; display: inline-block; padding: 0 .1em .04em; outline: 3px solid var(--blue); outline-offset: 2px; background: var(--blue-soft); }
.cert-name .sel::after { content: ""; position: absolute; right: -.16em; bottom: -.16em; width: .16em; height: .16em; min-width: 10px; min-height: 10px; background: var(--blue); border: 3px solid var(--cell); }
.cert-text { margin: 1.5% 0 0; max-width: 46em; font-size: clamp(13px, 1.55vw, 17px); color: var(--ink-2); line-height: 1.45; }
.cert-grade { position: absolute; right: 6%; bottom: 8%; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.2; }
.cert-grade .grade { width: clamp(56px, 8vw, 84px); height: clamp(56px, 8vw, 84px); font-size: clamp(20px, 2.8vw, 30px); }
.cert-cells { display: grid; grid-template-columns: 1fr 1fr 2fr; border-top: 2px solid var(--ink); background: var(--cell); }
.cert-cells div { padding: 10px 16px; border-right: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-cells div:last-child { border-right: 0; }
.cert-cells span { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.cert-cells b { font-size: clamp(12px, 1.5vw, 15px); overflow-wrap: anywhere; }
.cert-actions { width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 760px) {
  .cert { aspect-ratio: auto; }
  .cert-body { padding: 24px 18px 90px; gap: 10px; }
  .cert-cells { grid-template-columns: 1fr 1fr; }
  .cert-cells div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--rule-2); }
  .narrow { padding-block: 28px 48px; }
  .card-in { padding: 22px 18px 24px; }
  .acct-in { padding: 3px 9px; }
}
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff !important; }
  .top, .foot, .cert-actions { display: none !important; }
  .cert-page { padding: 0; }
  .cert { max-width: none; width: 297mm; height: 209mm; box-shadow: none; border: 0; aspect-ratio: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

a.dot { text-decoration: none; }
a.dot:hover { border-color: var(--blue); }

/* ---------- Экзамен ---------- */
.exam-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.timer { font-family: var(--f-mono); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; padding: 2px 10px; border: 1px solid var(--ink); }
.timer.low { background: var(--red); color: #fff; border-color: var(--red); }
.xtabs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.xtabs button { height: 34px; border: 1px dashed var(--ink-3); background: var(--cell); font-weight: 700; font-variant-numeric: tabular-nums; }
.xtabs button.filled { border: 1px solid var(--ink); background: var(--sunk); }
.xtabs button.cur { outline: 2px solid var(--blue); outline-offset: -2px; color: var(--blue); }
.exam-submit { border-top: 1px dashed var(--rule-2); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.exam-intro { border: 1px solid var(--ink); background: var(--cell); padding: 26px 28px 30px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; box-shadow: 8px 8px 0 var(--ink); }
.exam-intro .h2, .exam-intro .sub, .exam-intro .label { margin: 0; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15.5px; }
.rules li { padding-left: 18px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; background: var(--blue); }
.exam-result { display: flex; flex-direction: column; gap: 18px; }
.er-head { display: flex; gap: 24px; align-items: center; }
.er-head .grade { width: 96px; height: 96px; font-size: 30px; flex: none; }
.exam-result.pass .grade { color: var(--green); border-color: var(--green); }
.er-head .h2, .er-head .sub { margin: 0; }
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  .er-head { flex-direction: column; align-items: flex-start; }
  .exam-intro { padding: 20px 18px 24px; box-shadow: 5px 5px 0 var(--ink); }
}

/* ---------- Админка ---------- */
.admin { padding-block: 30px 64px; display: flex; flex-direction: column; gap: 22px; }
.admin .section-h { margin-top: 10px; }
.seg.big a { padding: 6px 14px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.seg.big a.on { background: var(--ink); color: var(--paper); }
.prog tr.mod-row td { background: var(--sunk); font-size: 14px; }
.prog tr.mod-row { cursor: default; }
.prog tr.mod-row:hover td { background: var(--sunk); }
.prog tr.hot td:not(.rn2) { background: var(--red-soft); }
.admin td .bar { margin-top: 4px; min-width: 70px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-form { width: 100%; }
.admin-form .field { max-width: 640px; }
.admin-form .field.wide { max-width: none; }
.field textarea { font: inherit; font-size: 15px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--ink); background: var(--cell); color: var(--ink); resize: vertical; }
.field textarea.mono, .field input.mono { font-family: var(--f-mono); font-size: 13.5px; }
.field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } }

/* ---------- Страница функции ---------- */
.fnpage { display: flex; flex-direction: column; gap: 22px; }
.fnpage h1 { margin-bottom: 0; }
.fnpage .sub { margin: 0; max-width: 44em; }
.syntax { font-size: 17px; padding: 14px 16px; background: var(--cell); border: 1px solid var(--ink); border-left: 4px solid var(--blue); margin-bottom: 12px; overflow-wrap: anywhere; }
.fnpage .xtable table { min-width: 0; }
.fnpage .xtable td.mono { width: 34%; font-size: 14px; }
.fn-try .try { max-width: 640px; }
.errs { display: grid; gap: 10px; }
.err { display: flex; gap: 14px; background: var(--cell); border: 1px solid var(--rule-2); padding: 14px 16px; }
.err-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); font-weight: 800; }
.err b { display: block; margin-bottom: 2px; }
.err p { margin: 0; color: var(--ink-2); font-size: 15px; }
.faq { border-top: 1px solid var(--rule-2); }
.faq details { border-bottom: 1px solid var(--rule-2); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--blue); font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }
.rel { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; }
.admin-form .form-row { display: flex; gap: 14px; width: 100%; flex-wrap: wrap; }
.admin-form .form-row .field:last-child { flex: 1; max-width: none; min-width: 240px; }

/* ---------- Задача дня ---------- */
.daily-chip { display: inline-flex; align-items: stretch; margin-top: 28px; border: 1px solid var(--ink); background: var(--cell); text-decoration: none; color: var(--ink); font-size: 14.5px; max-width: 100%; }
.daily-chip span { padding: 8px 12px; display: flex; align-items: center; }
.daily-chip .dc-l { background: var(--yellow); color: #141414; font-weight: 700; border-right: 1px solid var(--ink); white-space: nowrap; }
.daily-chip .dc-r { color: var(--blue); font-weight: 600; white-space: nowrap; border-left: 1px solid var(--rule-2); }
.daily-chip:hover { box-shadow: 3px 3px 0 var(--ink); }
.in.hero .facts { margin-top: 14px; }

/* ---------- Группы ---------- */
.invite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; width: 100%; }
.invite .mono { padding: 9px 12px; border: 1px dashed var(--ink-3); background: var(--sunk); overflow-wrap: anywhere; flex: 1; min-width: 0; }
.me-groups p { margin: 0 0 4px; }
.btn.small { padding: 2px 10px; font-size: 18px; }
.admin td form { margin: 0; }
.seats { display: flex; gap: 6px; align-items: center; }
.seats input { width: 80px; font: inherit; padding: 4px 8px; border: 1px solid var(--ink); background: var(--cell); color: var(--ink); }

/* ---------- Тарифы и оплата ---------- */
.promo-banner { display: block; background: var(--yellow); color: #141414; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--ink); }
.promo-banner .wrap { display: block; padding-block: 9px; }
.pro-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; background: var(--ink); color: var(--paper); padding: 1px 6px; vertical-align: 2px; margin-left: 4px; }
.mini-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border: 1px solid var(--ink); background: var(--cell); margin-bottom: 18px; }
.mp { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-right: 1px solid var(--rule-2); text-decoration: none; color: var(--ink); }
.mp:last-child { border-right: 0; }
.mp span { font-size: 13px; color: var(--ink-2); }
.mp b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.mp.hot { background: var(--blue-soft); }
.mp s, .pl-price s { color: var(--ink-3); font-weight: 400; font-size: .7em; }
.mp:hover { background: var(--sunk); }
.pricing { padding-block: 34px 64px; display: flex; flex-direction: column; gap: 22px; }
.pr-head .h2, .pr-head .sub { margin: 0 0 8px; }
.promo-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.promo-row .field { max-width: 240px; }
.promo-row .field input { text-transform: uppercase; font-family: var(--f-mono); }
#couponMsg.good { color: var(--green); font-weight: 600; }
#couponMsg.bad { color: var(--red); }
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--cell); box-shadow: 8px 8px 0 var(--ink); }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 18px; border-right: 1px solid var(--rule-2); margin: 0; min-width: 0; }
.plan:last-child { border-right: 0; }
.plan-hot { background: var(--blue-soft); outline: 2px solid var(--blue); outline-offset: -2px; }
.pl-badge { position: absolute; top: -12px; left: 18px; background: var(--blue); color: var(--on-blue); font-size: 12px; font-weight: 700; padding: 2px 8px; }
.pl-top { display: flex; flex-direction: column; gap: 2px; }
.pl-top b { font-size: 17px; }
.pl-price { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.plan.discounted .pl-price .pl-amount { color: var(--green); }
.pl-note { font-size: 13px; color: var(--ink-2); min-height: 2.6em; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; flex: 1; align-content: start; }
.plan li { padding-left: 16px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--blue); }
.plan-free li::before { background: var(--ink-3); }
.plan .btn { justify-content: center; }
.b2b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 30px; border: 1px solid var(--ink); background: var(--cell); padding: 26px 28px; }
.b2b .h2 { margin: 0 0 12px; }
.b2b-form { display: flex; flex-direction: column; gap: 12px; }
.b2b-form .field { max-width: none; }
.field select { font: inherit; padding: 11px 12px; border: 1px solid var(--ink); background: var(--cell); color: var(--ink); }
.b2b-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--rule-2); padding-top: 12px; }
.b2b-total b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.pay-choice { display: flex; gap: 18px; font-size: 14.5px; flex-wrap: wrap; }
.paywall { min-height: 420px; }
.pw-fx { flex: 1; padding: 10px 12px; font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); }
.pw-in { padding: 40px 34px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; flex: 1; justify-content: center;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 100% 29px, 92px 100%; }
.pw-in .h2, .pw-in .sub { margin: 0; }
.pw-tag { background: var(--ink); color: var(--paper); font-weight: 800; padding: 2px 10px; font-size: 13px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plan { border-bottom: 1px solid var(--rule-2); } }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; box-shadow: 5px 5px 0 var(--ink); } .b2b { grid-template-columns: 1fr; padding: 20px 18px; } .pw-in { padding: 28px 18px; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.plans-edit input { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid var(--rule-2); background: var(--cell); color: var(--ink); width: 100%; min-width: 80px; }
.plans-edit input.num { min-width: 64px; max-width: 90px; }
.plans-edit input[type=checkbox] { width: auto; min-width: 0; }
.xtable tr.off td { opacity: .5; }
.xtable td.p { background: var(--amber-soft); }
.plan-status { border: 1px solid var(--ink); background: var(--cell); padding: 12px 16px; font-size: 15px; }
.plan-status.pro { background: var(--blue-soft); }
