/* office.docs — дизайн-система.
   Идея бренда — точка: «Документы. И точка.» Палитра — бумага и графит, единственный цветной акцент —
   сигнальная оранжевая точка. Типы документов различаются только цветом точки. Шрифт — Golos Text
   (сделан для русского интерфейса). Минимум декора, максимум воздуха, ни одного лишнего цвета. */
@font-face { font-family: "Golos Text"; src: url("fonts/golos-cyr.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("fonts/golos-lat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #141416;
  --ink-2: #3a3a40;
  --muted: #6e6e76;
  --faint: #a1a1aa;
  --line: #e6e6ea;
  --line-2: #f0f0f3;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --hover: #f2f2f5;
  --press: #e9e9ee;
  --dot: #ff4f12;
  --doc: #2f6bff;
  --sheet: #16a05c;
  --slides: #f0a10a;
  --ok: #16a05c;
  --danger: #e5484d;
  --r-s: 8px;
  --r: 12px;
  --r-l: 20px;
  --sh-1: 0 1px 2px rgba(20, 20, 22, .06);
  --sh-pop: 0 0 0 1px rgba(20, 20, 22, .06), 0 12px 32px -8px rgba(20, 20, 22, .18), 0 2px 6px rgba(20, 20, 22, .05);
  --sh-modal: 0 0 0 1px rgba(20, 20, 22, .05), 0 40px 80px -20px rgba(20, 20, 22, .35);
  --bar: 52px;
  --font: "Golos Text", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
/* Страница не прокручивается никогда: на телефоне клавиатура иначе «утаскивает» её вниз вслед за курсором
   в iframe. Высоту и сдвиг берём из visualViewport (office.js → --vv-h, --vv-top). */
/* Только оболочка редактора (index.html → html.app); оферта, /brand, 404 прокручиваются как обычные страницы. */
html.app { overflow: hidden; overscroll-behavior: none; }
body.app { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); overflow: hidden; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }

/* ── знак и словесный знак ── */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand svg.mark { width: 26px; height: 26px; flex: none; }
.brand .word { font-weight: 600; font-size: 16px; letter-spacing: -.35px; }
.word i { font-style: normal; color: var(--dot); }
.mark .dot { fill: var(--dot); }
.mark.live .dot { animation: dot 1.6s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(.5); } }

/* ── глифы типов документов: лист + цветная точка ── */
.glyph { width: 28px; height: 28px; flex: none; color: var(--doc); }
.glyph.sheet { color: var(--sheet); }
.glyph.slides { color: var(--slides); }
.glyph.pdf { color: var(--danger); }

/* ── кнопки ── */
.btn { height: 34px; padding: 0 12px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s, transform .1s; text-decoration: none; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn:active { transform: scale(.98); background: var(--press); }
.btn.solid { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn.solid:hover { background: #2a2a2e; }
.btn.line { box-shadow: inset 0 0 0 1px var(--line); background: var(--panel); }
.btn.line:hover { box-shadow: inset 0 0 0 1px #d6d6dc; background: #fafafb; }
.btn.lg { height: 46px; border-radius: 12px; font-size: 15px; font-weight: 600; padding: 0 22px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* ── верхняя панель ── */
.bar { position: relative; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 4px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 10px 0 12px; flex: none; }
.doc { display: flex; align-items: center; gap: 6px; min-width: 0; }
.doc .glyph { width: 22px; height: 22px; }
.doc input { border: 0; background: transparent; border-radius: 7px; padding: 5px 7px; font-size: 14.5px; font-weight: 500; min-width: 40px; max-width: 38vw; text-overflow: ellipsis; letter-spacing: -.1px; transition: background .15s, box-shadow .15s; }
.doc input:hover { background: var(--hover); }
.doc input:focus { outline: none; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--ink); }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12.5px; white-space: nowrap; margin-left: 4px; }
.status svg { width: 14px; height: 14px; }
.status.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grow { flex: 1; }
.pro-pill { height: 30px; padding: 0 12px 0 11px; border-radius: 99px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); margin: 0 6px; transition: box-shadow .15s, transform .1s; }
.pro-pill:hover { box-shadow: inset 0 0 0 1px #cfcfd6, var(--sh-1); }
.pro-pill:active { transform: scale(.98); }
.pro-pill .d { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.pro-pill span { color: var(--muted); font-weight: 500; }
.btn.icon-only { width: 34px; padding: 0; }
.show-m { display: none !important; }
.edit-pill { height: 34px; padding: 0 14px 0 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; margin: 0 4px; box-shadow: 0 6px 16px -6px rgba(20, 20, 22, .5); animation: pop .25s var(--ease); }
.edit-pill svg { width: 16px; height: 16px; stroke-width: 2; }
.edit-pill:active { transform: scale(.97); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; flex: none; margin-left: 2px; transition: box-shadow .15s; }
.avatar:hover { box-shadow: 0 0 0 3px var(--press); }
.avatar.guest { background: var(--hover); color: var(--muted); }
.avatar.guest svg { width: 17px; height: 17px; }
.avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.avatar.lg:hover { box-shadow: none; }

/* ── редактор ── */
.stage { position: absolute; inset: var(--bar) 0 0 0; background: var(--panel); }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.loader { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--bg); transition: opacity .35s var(--ease), visibility .35s; }
.loader.gone { opacity: 0; visibility: hidden; }
.loader .box { display: grid; justify-items: center; gap: 16px; color: var(--muted); font-size: 13.5px; text-align: center; padding: 24px; }
.loader .box p { margin: 0; max-width: 340px; }
.loader .mark { width: 48px; height: 48px; }
.loader.err .box p { color: var(--ink); }

/* ── всплывающие панели ── */
.pop { position: fixed; z-index: 60; background: var(--panel); border-radius: 14px; box-shadow: var(--sh-pop); animation: pop .18s var(--ease); transform-origin: top right; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.menu { padding: 5px; min-width: 232px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); }
.menu button:hover { background: var(--hover); color: var(--ink); }
.menu button small { margin-left: auto; color: var(--faint); font-size: 12px; }
.menu .glyph { width: 22px; height: 22px; }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--line-2); margin: 5px 6px; }

/* аккаунт */
.account { width: 340px; overflow: auto; max-height: calc(100dvh - var(--bar) - 16px); }
.acc-head { display: flex; gap: 12px; align-items: center; padding: 18px 18px 14px; }
.acc-head .who { min-width: 0; }
.acc-head b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-head span { color: var(--muted); font-size: 12.5px; }
.plan { margin: 0 12px 6px; padding: 14px; border-radius: 12px; background: var(--bg); }
.plan .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.plan .top b { font-weight: 600; }
.plan .top span { color: var(--muted); }
.plan p { margin: 8px 0 12px; color: var(--muted); font-size: 12.5px; }
.meter { height: 6px; border-radius: 99px; background: var(--press); margin: 10px 0 12px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width .5s var(--ease); }
.meter.full i { background: var(--dot); }
.plan .btn { width: 100%; height: 38px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; background: var(--ink); color: #fff; }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.rows { padding: 6px; }
.rows > * { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; text-align: left; text-decoration: none; }
.rows > *:hover { background: var(--hover); color: var(--ink); }
.rows svg.i { color: var(--muted); }
.rows small { margin-left: auto; color: var(--faint); font-size: 12px; }
.switch { margin-left: auto; width: 32px; height: 19px; border-radius: 99px; background: #d4d4da; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(13px); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 18px 16px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--faint); }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--ink); }

/* ── шторка «Документы» ── */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 22, .3); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; z-index: 55; top: 8px; bottom: 8px; left: 8px; width: 392px; max-width: calc(100vw - 16px); background: var(--panel); border-radius: 18px; box-shadow: var(--sh-modal); display: flex; flex-direction: column; overflow: hidden; animation: slide .26s var(--ease); }
@keyframes slide { from { transform: translateX(-16px); opacity: 0; } }
.drawer header { display: flex; align-items: center; gap: 8px; padding: 14px 10px 4px 20px; }
.drawer h2 { margin: 0; flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.new { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 14px 4px; }
.new button { display: grid; justify-items: center; gap: 8px; padding: 14px 4px 11px; border-radius: 12px; background: var(--bg); font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background .15s, transform .15s var(--ease), box-shadow .15s; }
.new button:hover { background: var(--panel); box-shadow: var(--sh-pop); transform: translateY(-1px); color: var(--ink); }
.new .glyph { width: 30px; height: 30px; }
.new .plus { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink); }
.search { position: relative; display: block; margin: 12px 14px 4px; }
.search input { width: 100%; height: 38px; border: 0; border-radius: 10px; padding: 0 12px 0 36px; background: var(--bg); font-size: 13.5px; transition: box-shadow .15s, background .15s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--ink); }
.search svg { position: absolute; left: 11px; top: 10.5px; width: 17px; height: 17px; color: var(--faint); }
.group { padding: 14px 20px 6px; font-size: 12px; color: var(--faint); font-weight: 500; }
.files { flex: 1; overflow: auto; padding: 0 8px 10px; overscroll-behavior: contain; }
.file { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.file:hover { background: var(--hover); }
.file.cur { background: var(--bg); }
.file .meta { flex: 1; min-width: 0; }
.file b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file span { color: var(--faint); font-size: 12px; }
.file .icon-btn { opacity: 0; width: 30px; height: 30px; }
.file:hover .icon-btn, .file .icon-btn:focus-visible { opacity: 1; }
.skel { height: 46px; margin: 4px 10px; border-radius: 11px; background: linear-gradient(90deg, var(--bg) 25%, var(--hover) 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted); padding: 40px 30px; font-size: 13.5px; }
.drawer footer { display: flex; align-items: center; gap: 8px; padding: 12px 20px 14px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line-2); }
.drawer footer svg { width: 15px; height: 15px; }

/* ── модальные окна ── */
/* Окно занимает ровно видимую область (visualViewport → --vv-h/--vv-top): на телефоне клавиатура его не перекрывает,
   а если окно выше экрана — прокручивается само окно, страница под ним стоит на месте. */
.modal { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 80; display: flex; flex-direction: column; align-items: center; padding: 20px; background: rgba(20, 20, 22, .4); animation: fade .2s; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal > * { flex: none; margin: auto; }
.dialog { position: relative; width: 100%; max-width: 380px; background: var(--panel); border-radius: var(--r-l); box-shadow: var(--sh-modal); padding: 30px; animation: rise .28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog > .icon-btn { position: absolute; top: 14px; right: 14px; }
.dialog .mark { width: 40px; height: 40px; margin-bottom: 18px; }
.dialog h3 { margin: 0 0 6px; font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
.dialog p.sub { margin: 0 0 20px; color: var(--muted); }
.field { width: 100%; height: 46px; border: 0; border-radius: 12px; padding: 0 14px; font-size: 15px; background: var(--bg); margin-bottom: 10px; transition: box-shadow .15s, background .15s; }
.field:focus { outline: none; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--ink); }
.field.code { text-align: center; font-size: 24px; letter-spacing: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 0 0 6px; }
.oauth { display: grid; gap: 8px; margin-bottom: 12px; }
.oauth .btn { justify-content: center; gap: 10px; font-weight: 600; color: var(--ink); }
.oauth .pi { width: 20px; height: 20px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 8px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fine { color: var(--faint); font-size: 12px; margin: 14px 0 0; }
.fine a { color: var(--muted); }

/* ── Pro: витрина подписки ── */
.pro { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 820px; background: var(--panel); border-radius: 24px; box-shadow: var(--sh-modal); overflow: hidden; animation: rise .32s var(--ease); }
.pro > .icon-btn { position: absolute; top: 14px; right: 14px; z-index: 2; }
.pro .hero { position: relative; background: var(--ink); color: #fff; padding: 36px 36px 32px; display: flex; flex-direction: column; overflow: hidden; min-height: 520px; }
.pro .hero::after { content: ""; position: absolute; right: -64px; bottom: -64px; width: 168px; height: 168px; border-radius: 50%; background: var(--dot); }
.pro .hero .mark { width: 36px; height: 36px; }
.pro .kicker { margin-top: 26px; font-size: 12.5px; letter-spacing: .3px; color: rgba(255, 255, 255, .6); font-weight: 500; }
.pro h2 { margin: 8px 0 12px; font-size: 40px; line-height: 1.04; letter-spacing: -1.4px; font-weight: 600; }
.pro h2 i { font-style: normal; color: var(--dot); }
.pro .hero p { margin: 0; color: rgba(255, 255, 255, .72); font-size: 14.5px; max-width: 300px; position: relative; z-index: 1; }
.pro .hero ul { list-style: none; padding: 26px 0 0; margin: auto 0 0; display: grid; gap: 11px; position: relative; z-index: 1; font-size: 14px; max-width: 250px; }
.pro .hero li { display: flex; gap: 10px; align-items: flex-start; }
.pro .hero li svg { width: 17px; height: 17px; color: var(--dot); stroke-width: 2.2; margin-top: 1px; }
.pro .buy { padding: 36px 34px 30px; display: flex; flex-direction: column; }
.pro .buy .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.pro .price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.pro .price b { font-size: 56px; font-weight: 600; letter-spacing: -2.4px; line-height: 1; }
.pro .price span { color: var(--muted); font-size: 15px; }
.pro .per-day { color: var(--muted); font-size: 13px; margin: 8px 0 22px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 8px; }
.plan-opt { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s; }
.plan-opt:hover { box-shadow: inset 0 0 0 1px #cfcfd6; }
.plan-opt.on { box-shadow: inset 0 0 0 2px var(--ink); background: #fafafb; }
.plan-opt .pn { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.plan-opt .pn svg { width: 15px; height: 15px; color: var(--dot); stroke-width: 2; }
.plan-opt .pp { display: flex; align-items: baseline; gap: 4px; }
.plan-opt .pp b { font-size: 28px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; }
.plan-opt .pp small { color: var(--muted); font-size: 12.5px; }
.plan-opt em { font-style: normal; color: var(--muted); font-size: 12px; line-height: 1.35; }
.plans.p4 { grid-template-columns: 1fr 1fr; }
.plans.p3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plans.p3 .plan-opt { padding: 11px 12px; }
.plans.p3 .pp b { font-size: 25px; }
.plans.p3 .pn { flex-wrap: wrap; white-space: nowrap; gap: 2px 6px; }
/* Переключатель «ИИ-документы» под сроками: включён по умолчанию, выключение делает тариф дешевле. */
.ai-toggle { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); margin: 0 0 10px; }
.ai-toggle > svg { width: 18px; height: 18px; color: var(--faint); stroke-width: 2; flex: none; }
.ai-toggle.on { box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff8f4; }
.ai-toggle.on > svg { color: var(--dot); }
.ai-toggle span:not(.switch) { display: grid; gap: 1px; min-width: 0; }
.ai-toggle b { font-size: 13.5px; font-weight: 600; }
.ai-toggle small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.plan-opt .save { font-style: normal; font-size: 11px; font-weight: 700; color: #0f7a45; background: #e8f6ee; border-radius: 99px; padding: 1px 6px; }
.credit { font-size: 12.5px; color: #0f7a45; background: #e8f6ee; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.compare.c3 { grid-template-columns: 1fr auto auto auto; }
.compare.c4 { grid-template-columns: 1fr auto auto auto auto; font-size: 12.5px; padding: 4px 10px; }
.compare.c4 .c { min-width: 50px; white-space: nowrap; padding-left: 3px; padding-right: 3px; }
.compare.c4 { column-gap: 8px; }
.compare.c4 .c.h { font-size: 11px; }
.includes { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 2px 0 12px; font-size: 13px; }
.includes b { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.includes ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; }
.includes li { display: flex; gap: 7px; align-items: flex-start; color: var(--ink-2); line-height: 1.35; }
.includes li svg { width: 15px; height: 15px; color: #0f7a45; stroke-width: 2.4; flex: none; margin-top: 1px; }
.compare.c3 .c { min-width: 58px; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
.compare { display: grid; grid-template-columns: 1fr auto auto; font-size: 13px; border-radius: 12px; background: var(--bg); padding: 4px 14px; margin-bottom: 20px; }
.compare > * { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.compare > :nth-last-child(-n+3) { border-bottom: 0; }
.compare .h { color: var(--faint); font-size: 12px; font-weight: 500; }
.compare .c { justify-content: center; min-width: 70px; color: var(--muted); }
.compare .c.p { color: var(--ink); font-weight: 600; }
.compare .c svg { width: 16px; height: 16px; stroke-width: 2.2; }
.pro .check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 12px 0 0; cursor: pointer; }
.pro .check input { margin: 1px 0 0; accent-color: var(--ink); width: 15px; height: 15px; flex: none; }
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin-top: auto; padding-top: 22px; font-size: 12px; color: var(--muted); }
.trust div { display: flex; gap: 7px; align-items: center; }
.trust svg { width: 15px; height: 15px; color: var(--ink-2); }

/* ── тост ── */
/* width: max-content — иначе тост с left: 50% сжимается до половины экрана и на телефоне идёт столбиком по слову. */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); line-height: 1.4; padding: 11px 14px 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--sh-modal); transform: translate(-50%, 12px); opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .d { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: none; }
.toast > span:not(.d) { min-width: 0; }
.toast button { flex: none; color: #fff; font-weight: 600; margin-left: 4px; padding: 4px 9px; border-radius: 7px; background: rgba(255, 255, 255, .14); }

/* ── кнопка ИИ в панели ── */
.ai-pill { height: 32px; padding: 0 12px 0 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); margin: 0 6px 0 2px; white-space: nowrap; transition: box-shadow .15s, transform .1s; }
.ai-pill:hover { box-shadow: inset 0 0 0 1px #cfcfd6, var(--sh-1); }
.ai-pill:active { transform: scale(.98); }
.ai-pill svg { width: 16px; height: 16px; color: var(--dot); stroke-width: 1.9; }
.ai-badge { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .1px; }
.ai-badge svg { width: 14px; height: 14px; color: var(--dot); stroke-width: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; background: var(--bg); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.chip:hover { background: var(--press); color: var(--ink); }

/* ── стартовый экран ── */
body.home .doc, body.home #dlBtn, body.home #printBtn, body.home .bar .sep { display: none !important; }
.home { position: absolute; inset: 0; z-index: 3; overflow: auto; background: var(--bg); overscroll-behavior: contain; }
.home-in { max-width: 780px; margin: 0 auto; padding: 64px 24px 48px; animation: rise .35s var(--ease); }
.home h1 { margin: 0 0 8px; font-size: 44px; line-height: 1.05; letter-spacing: -1.6px; font-weight: 600; }
.home h1 i { font-style: normal; color: var(--dot); }
.home .lead { margin: 0 0 30px; color: var(--muted); font-size: 15.5px; }
.ai-box { background: var(--panel); border-radius: 20px; box-shadow: var(--sh-pop); padding: 14px 14px 12px 16px; margin-bottom: 14px; transition: box-shadow .2s; }
.ai-box:focus-within { box-shadow: 0 0 0 1.5px var(--ink), 0 16px 36px -14px rgba(20, 20, 22, .28); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--faint); margin-bottom: 8px; }
.ai-box textarea { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.45; min-height: 50px; color: var(--ink); padding: 2px 0; }
.ai-box textarea::placeholder { color: var(--faint); }
.ai-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.ai-foot .btn { flex: none; height: 38px; padding: 0 16px; border-radius: 11px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
/* Разделитель между плитками и ИИ: «или сгенерируйте документ автоматически» по центру, линии по бокам. */
.home-or { display: flex; align-items: center; gap: 14px; margin: 26px 0 16px; color: var(--muted); font-size: 13.5px; }
.home-or::before, .home-or::after { content: ""; flex: 1; height: 1px; background: rgba(20, 20, 22, .14); }
.home-or span { text-align: center; }
.home-or[hidden] { display: none; }
/* ?for=pdf: крупная кнопка «Открыть PDF» и что можно сделать — над плитками. */
.home-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: -8px 0 26px; }
.home-cta[hidden] { display: none; }
.home-cta .btn { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; gap: 9px; }
.home-cta ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13.5px; }
.home-cta li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--dot); margin: 0 7px 2px 0; }
#homeAi { margin-bottom: 0; }
.tile { display: grid; gap: 12px; justify-items: start; text-align: left; padding: 18px 16px 16px; border-radius: 16px; background: var(--panel); box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .18s, transform .18s var(--ease); }
.tile:hover { box-shadow: var(--sh-pop); transform: translateY(-2px); }
.tile:active { transform: translateY(0) scale(.99); }
.tile .glyph { width: 36px; height: 36px; }
/* Метка на плитке «Открыть файл»: PDF тоже правим. */
.tile { position: relative; }
.tile-chip { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 11px; font-weight: 600; line-height: 1; padding: 5px 8px; border-radius: 99px; color: #c4320a; background: #fff1ea; letter-spacing: .1px; }
.tile .plus { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); color: var(--ink); }
.tile b { display: block; font-weight: 600; font-size: 14.5px; letter-spacing: -.1px; }
.tile small { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; }
.recent { margin-top: 30px; }
.recent .group { padding: 0 2px 8px; }
.recent .files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; overflow: visible; }
.recent .file { min-width: 0; }
.recent .file { background: var(--panel); box-shadow: 0 0 0 1px var(--line-2); text-decoration: none; color: inherit; }
.recent .file:hover { background: var(--panel); box-shadow: var(--sh-pop); }
.recent .glyph { width: 26px; height: 26px; flex: none; }
.home-trust { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 34px 0 0; color: var(--faint); font-size: 12.5px; }
.home-trust svg { width: 15px; height: 15px; }

/* ── окно «Сгенерировать документ» ── */
.ai-dialog { max-width: 520px; }
.ai-dialog .ai-badge { margin-bottom: 14px; }
.field.area { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.45; resize: vertical; font: inherit; font-size: 15px; display: block; }
.ai-dialog .chips { margin: 2px 0 12px; }
.ai-dialog [data-go] svg { width: 17px; height: 17px; color: var(--dot); stroke-width: 2; }
.ai-actions { margin-bottom: 10px; }
.lib-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; margin: 0 0 8px; border-radius: 12px; background: var(--bg); font-size: 13.5px; color: var(--ink-2); text-align: left; transition: background .15s; }
.lib-toggle:hover { background: var(--press); color: var(--ink); }
.lib-toggle span { flex: 1; }
.lib-toggle b { font-weight: 600; }
.lib-toggle .chev { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.lib-toggle.open .chev { transform: rotate(180deg); }
.lib { max-height: 300px; overflow: auto; margin: 0 -6px 10px; padding: 0 6px; overscroll-behavior: contain; }
.lib-cat { font-size: 12px; color: var(--faint); font-weight: 500; margin: 10px 2px 6px; }
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lib-grid button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; line-height: 1.3; color: var(--ink-2); transition: box-shadow .15s, background .15s; }
.lib-grid button:hover { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); background: var(--panel); }
.lib-grid .glyph { width: 22px; height: 22px; flex: none; }
@media (max-width: 760px) { .lib-grid { grid-template-columns: 1fr; } .lib { max-height: 38dvh; } }
.ai-progress { display: grid; justify-items: center; gap: 10px; padding: 34px 10px 26px; text-align: center; }
.ai-progress .mark { width: 52px; height: 52px; margin-bottom: 6px; }
.ai-progress b { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.ai-progress span { color: var(--muted); font-size: 13.5px; min-height: 20px; }

.drop { pointer-events: auto !important; }
.drop { position: fixed; inset: 10px; z-index: 90; display: grid; place-items: center; border-radius: 20px; border: 2px dashed var(--ink); background: rgba(245, 245, 247, .92); color: var(--ink); font-weight: 600; font-size: 18px; pointer-events: none; animation: fade .15s; }

/* ── простые страницы (оферта, 404, бренд) ── */
.page { min-height: 100%; display: flex; flex-direction: column; }
.page-top { height: var(--bar); display: flex; align-items: center; padding: 0 20px; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.legal { width: 100%; max-width: 720px; margin: 40px auto 60px; padding: 0 20px; }
.legal article { background: var(--panel); border-radius: var(--r-l); padding: 40px 44px; box-shadow: var(--sh-1), 0 0 0 1px var(--line-2); }
.legal h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.8px; font-weight: 600; }
.legal h2 { margin: 30px 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.legal p, .legal li { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.legal .meta { color: var(--faint); font-size: 13px; }
.legal nav { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 22px; font-size: 13px; }
.legal nav a { color: var(--muted); text-decoration: none; }
.legal nav a:hover { color: var(--ink); }

/* ── средние экраны: у второстепенных кнопок — только значки ── */
.pro-pill { white-space: nowrap; }
@media (max-width: 1180px) {
  #openBtn span, #dlBtn span { display: none; }
  #openBtn, #dlBtn { width: 34px; padding: 0; }
}
@media (max-width: 960px) {
  #docsBtn span, #newBtn span, .pro-pill span { display: none; }
  #docsBtn, #newBtn { width: 34px; padding: 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) { body:not(.home) .ai-pill span { display: none; } body:not(.home) .ai-pill { width: 32px; padding: 0; justify-content: center; } }

/* ── телефон ── */
@media (max-width: 760px) {
  :root { --bar: 54px; }
  .bar { padding: 0 6px 0 12px; gap: 0; }
  .brand .word, .bar .sep, .status, .hide-m, .pro-pill, #dtype { display: none !important; }
  .doc { margin-left: 8px; flex: 1; }
  .doc input { max-width: none; width: 100%; font-size: 15px; }
  .bar .btn { width: 40px; height: 40px; padding: 0; }
  .show-m { display: inline-flex !important; }
  #docsBtn, #newBtn { display: none !important; }
  body.ro .doc { display: none; }
  body.ro .edit-pill { margin-left: 10px; }
  .edit-pill { height: 36px; padding: 0 13px 0 11px; font-size: 13.5px; margin: 0 2px 0 6px; }
  .account { left: 8px !important; right: 8px !important; width: auto; }
  .drawer { left: 0; right: 0; bottom: auto; width: 100%; max-width: none; height: min(88dvh, var(--vv-h, 100dvh)); top: calc(var(--vv-top, 0px) + var(--vv-h, 100dvh) - min(88dvh, var(--vv-h, 100dvh))); border-radius: 22px 22px 0 0; animation: up .3s var(--ease); }
  .drawer::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 99px; background: var(--line); margin: 8px auto 0; flex: none; }
  .file .icon-btn { opacity: 1; }
  .modal { padding: 0; align-items: stretch; }
  .modal > * { margin: auto 0 0; }
  .dialog { border-radius: 24px 24px 0 0; padding: 28px 22px calc(26px + env(safe-area-inset-bottom)); max-width: none; animation: up .3s var(--ease); }
  .pro { grid-template-columns: 1fr; border-radius: 24px 24px 0 0; max-width: none; max-height: calc(var(--vv-h, 100dvh) - 24px); overflow: auto; animation: up .32s var(--ease); }
  .pro .hero { padding: 26px 24px 24px; min-height: 0; }
  .pro .hero::after { width: 120px; height: 120px; right: -44px; bottom: -48px; }
  .pro h2 { font-size: 32px; }
  .pro .hero ul { padding-top: 18px; }
  .pro .buy { padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); }
  .pro .price b { font-size: 46px; }
  .pro [data-pay] { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 3; box-shadow: 0 0 0 6px var(--panel), 0 14px 30px -8px rgba(20, 20, 22, .45); }
  .bar .btn { width: 38px; }
  .ai-pill { display: none; }
  .home-in { padding: 30px 16px calc(32px + env(safe-area-inset-bottom)); }
  .home h1 { font-size: 32px; letter-spacing: -1px; }
  .home .lead { font-size: 14.5px; margin-bottom: 20px; }
  .ai-box textarea { min-height: 76px; }
  .ai-head { font-size: 12px; text-align: right; }
  .ai-foot { flex-direction: column; align-items: stretch; }
  .ai-foot .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 0 -16px; padding: 0 14px 2px 16px; scrollbar-width: none; }
  .ai-foot .chips::-webkit-scrollbar { display: none; }
  .ai-foot .btn { height: 44px; }
  .tile { padding: 14px; gap: 10px; }
  .recent .files { grid-template-columns: minmax(0, 1fr); }
  .ai-dialog .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .legal { margin: 0; padding: 0; }
  .legal article { border-radius: 0; padding: 28px 20px; box-shadow: none; }
}
/* iPhone увеличивает страницу при фокусе на поле со шрифтом меньше 16px — окно «уезжает», часть не видно.
   На телефоне все поля ввода — не меньше 16px (код из письма остаётся крупным). */
@media (max-width: 760px), (pointer: coarse) {
  input, textarea, select, .field, .field.area, .doc input, .search input { font-size: 16px; }
  .field.code { font-size: 24px; }
}
/* Телефон: цели для пальца, безопасные зоны, крестик окна тарифов не уезжает при прокрутке. */
@media (max-width: 760px) {
  .bar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .drawer footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .chip { height: 34px; }
  .file .icon-btn { width: 40px; height: 40px; }
  .toast button { padding: 8px 12px; }
  .pro > .icon-btn { position: sticky; top: 10px; justify-self: end; margin: 10px 10px -44px 0; color: #fff; background: rgba(255, 255, 255, .14); z-index: 4; }
}
@media (hover: none) { .file .icon-btn { opacity: 1; } }
/* 761–960px (планшеты, телефон боком): кнопки панели не сжимаются, сжимается название. */
.bar > button, .bar > .avatar { flex: none; }
.bar .doc { flex: 0 1 auto; overflow: hidden; }
/* Меню не уходят за низ экрана (высоту ограничивает place()). */
.pop.menu { overscroll-behavior: contain; }
/* Голосовой ввод в поле ИИ: круглая кнопка в правом нижнем углу поля, во время записи — оранжевая и «дышит». */
.dictate { position: relative; }
.dictate textarea { padding-right: 46px !important; }
.mic { position: absolute; right: 6px; bottom: 6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--bg); transition: color .15s, background .15s; }
.mic[hidden] { display: none; }
.mic:hover { color: var(--ink); }
.mic svg { width: 18px; height: 18px; stroke-width: 1.9; }
.mic.on { color: #fff; background: var(--dot); animation: micpulse 1.3s ease-out infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 18, .45); } 100% { box-shadow: 0 0 0 12px rgba(255, 79, 18, 0); } }
.ai-box .mic { right: 0; bottom: 0; }
.field.area + .mic { background: var(--panel); box-shadow: 0 1px 3px rgba(20, 20, 22, .12); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* подсказка «пишите сразу с данными» */
.ai-tip { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; background: #fff5f0; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.ai-tip svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--dot); stroke-width: 2; }
.ai-box .ai-tip { margin: 8px 0 2px; }

/* окно тарифов — помещается в экран: шире, плотнее, правая часть прокручивается, кнопка оплаты всегда видна */
.pro { max-width: 940px; grid-template-columns: 330px 1fr; max-height: calc(var(--vv-h, 100dvh) - 40px); }
.pro .hero { min-height: 0; padding: 30px 30px 26px; }
.pro h2 { font-size: 34px; }
.pro .buy { padding: 24px 28px 18px; overflow-y: auto; max-height: calc(var(--vv-h, 100dvh) - 40px); overscroll-behavior: contain; }
.pro .plans { margin: 8px 0 8px; }
.pro .plan-opt { padding: 10px 12px; gap: 2px; }
.pro .plan-opt .pp b { font-size: 24px; }
.pro .includes { padding: 8px 11px; margin: 0 0 10px; }
.pro .includes ul { gap: 3px; margin-top: 4px; }
.pro .compare { margin-bottom: 12px; }
.pro .compare > * { padding: 5px 0; }
@media (min-width: 761px) { .pro [data-pay] { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 0 0 8px var(--panel); } }
.pro .check { margin-top: 10px; }
.pro .trust { padding-top: 12px; gap: 6px 12px; }
.pro .fine { margin-top: 10px; }
@media (max-width: 760px) { .pro { grid-template-columns: 1fr; max-height: calc(var(--vv-h, 100dvh) - 24px); } .pro .buy { max-height: none; overflow: visible; } }

/* ── Блог (/blog, lib/blog.js) ── */
body.blog { min-height: 100vh; }
.page-top .blog-link { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
.page-top .blog-link:hover { color: var(--ink); }
.post { width: 100%; max-width: 760px; margin: 24px auto 60px; padding: 0 20px; }
.post.wide { max-width: 1040px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--faint); margin: 0 0 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.post article { background: var(--panel); border-radius: var(--r-l); padding: 40px 48px 44px; box-shadow: var(--sh-1), 0 0 0 1px var(--line-2); }
.post h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.15; letter-spacing: -1px; font-weight: 600; }
.post .meta { color: var(--faint); font-size: 13px; margin: 0 0 22px; }
.post .hero { margin: 0 -48px 26px; }
.post .hero img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; }
.post .hero figcaption { padding: 6px 48px 0; font-size: 11.5px; color: var(--faint); }
.post .hero figcaption a { color: var(--faint); }
.toc { background: var(--bg); border-radius: 14px; padding: 12px 18px; margin: 0 0 24px; font-size: 14px; }
.toc summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.toc ol { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 4px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.post-body { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.post-body h2 { margin: 36px 0 10px; font-size: 24px; line-height: 1.25; letter-spacing: -.5px; color: var(--ink); scroll-margin-top: 16px; }
.post-body h3 { margin: 24px 0 6px; font-size: 18.5px; letter-spacing: -.2px; color: var(--ink); }
.post-body p { margin: 0 0 14px; }
.post-body ul, .post-body ol { margin: 0 0 16px; padding-left: 24px; }
.post-body li { margin: 4px 0; }
.post-body a { color: var(--ink); text-decoration-color: var(--dot); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body .tbl { overflow-x: auto; margin: 0 0 18px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.post-body th, .post-body td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.post-body th { background: var(--bg); font-weight: 600; color: var(--ink); }
.post-body .note { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; background: #fff5f0; border-left: 3px solid var(--dot); font-size: 15px; }
.post-cta { margin: 32px 0 0; padding: 22px 24px; border-radius: 18px; background: var(--ink); color: #fff; display: grid; gap: 8px; justify-items: start; }
.post-cta b { font-size: 19px; letter-spacing: -.3px; }
.post-cta p { margin: 0 0 6px; color: rgba(255, 255, 255, .78); font-size: 14.5px; line-height: 1.5; }
.post-cta .btn.solid { background: #fff; color: var(--ink); }
.related { margin-top: 34px; }
.related h2 { font-size: 22px; letter-spacing: -.4px; margin: 0 0 14px; }
.blog-h1 { font-size: 34px; letter-spacing: -1px; margin: 0 0 6px; }
.blog-lead { margin: 0 0 24px; color: var(--muted); font-size: 16px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.post-card { display: grid; grid-template-rows: auto 1fr; background: var(--panel); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .18s, transform .18s var(--ease); }
.post-card:hover { box-shadow: var(--sh-pop); transform: translateY(-2px); }
.post-card img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; background: var(--bg); }
.post-card span { display: grid; gap: 6px; padding: 14px 16px 16px; align-content: start; }
.post-card b { font-size: 16px; line-height: 1.3; letter-spacing: -.2px; }
.post-card small { color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card em { font-style: normal; color: var(--faint); font-size: 12px; }
.blog-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 34px; font-size: 13px; }
.blog-foot a { color: var(--muted); text-decoration: none; }
.blog-foot a:hover { color: var(--ink); }
/* подвал главной: мелко, не отвлекает */
.home-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 10px 0 0; font-size: 12px; }
.home-foot a { color: var(--faint); text-decoration: none; }
.home-foot a:hover { color: var(--ink); }
@media (max-width: 760px) {
  .post { margin: 0 0 40px; padding: 0; }
  .post .crumbs { padding: 14px 18px 0; }
  .post article { border-radius: 0; padding: 22px 18px 28px; box-shadow: none; }
  .post h1, .blog-h1 { font-size: 27px; }
  .post .hero { margin: 0 -18px 20px; }
  .post .hero figcaption { padding: 6px 18px 0; }
  .post-body { font-size: 16px; }
  .post-body h2 { font-size: 21px; }
  .post.wide { padding: 0 16px; }
  .post .related, .post .blog-foot { padding: 0 16px; }
  .page-top .blog-link { margin-left: 12px; }
}

/* ── Бланки (/blanki, lib/blanks.js) ── */
.blank-page .bl-head { margin: 0 0 22px; }
.blank-page .bl-head h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.15; letter-spacing: -1px; font-weight: 600; }
.bl-lead { margin: 0 0 18px; max-width: 760px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.bl-lead b { color: var(--ink); }
.bl-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.bl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.bl-doc { min-width: 0; }
.bl-sheet { position: relative; background: #fff; border-radius: 6px; box-shadow: var(--sh-1), 0 0 0 1px var(--line-2); padding: 44px 52px; font-family: "Times New Roman", Times, serif; font-size: 14.5px; line-height: 1.45; color: #1a1a1a; max-height: 760px; overflow: hidden; }
.bl-sheet::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 85%); pointer-events: none; }
.bl-sheet.open { max-height: none; }
.bl-sheet.open::after { display: none; }
.bl-sheet.land { font-size: 12.5px; padding: 30px 28px; }
.bl-sheet p { margin: 0 0 8px; text-align: justify; }
.bl-sheet .s-title { text-align: center; font-weight: 700; text-transform: uppercase; font-size: 1.08em; margin: 0 0 14px; }
.bl-sheet .s-h { font-weight: 700; margin: 14px 0 6px; text-align: left; }
.bl-sheet .s-left { text-align: left; } .bl-sheet .s-right { text-align: right; } .bl-sheet .s-center { text-align: center; }
.bl-sheet .s-sp { height: 8px; margin: 0; }
.bl-sheet ul { margin: 0 0 8px; padding-left: 22px; }
.bl-sheet .s-tbl { overflow-x: auto; margin: 4px 0 10px; }
.bl-sheet table { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.3; }
.bl-sheet th, .bl-sheet td { border: 1px solid #9a9aa2; padding: 4px 6px; vertical-align: top; text-align: left; }
.bl-sheet th { background: #f2f2f2; font-weight: 700; }
.bl-sheet .s-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.bl-sheet .s-sign > div { display: grid; gap: 8px; align-content: start; }
.bl-sheet .s-date { color: #555; }
.bl-sheet .fld { color: #7a6200; background: #fff6c2; border-bottom: 1px solid #c9a800; border-radius: 2px; padding: 0 2px; font-family: var(--font, system-ui), sans-serif; font-size: .82em; }
.bl-sheet-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bl-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.bl-box { background: var(--panel); border-radius: 16px; padding: 18px; box-shadow: 0 0 0 1px var(--line-2); display: grid; gap: 8px; justify-items: start; }
.bl-box b { font-size: 16px; letter-spacing: -.2px; }
.bl-box p { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.bl-facts { margin: 0; padding: 4px 4px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.bl-text { background: var(--panel); border-radius: var(--r-l); padding: 34px 44px; box-shadow: var(--sh-1), 0 0 0 1px var(--line-2); margin: 28px 0 0; max-width: 820px; }
.bl-text .post-body h2:first-child { margin-top: 0; }
.blank-page .post-cta { max-width: 820px; }
.blank-page .post-cta .btn.line { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.blank-page .post-cta .btn.line:hover { background: rgba(255, 255, 255, .1); }
.bl-blog { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }
.bl-blog a { color: var(--ink); }
.bl-q { width: 100%; max-width: 520px; height: 46px; margin: 0 0 8px; font-size: 16px; }
.bl-group h2 { font-size: 20px; letter-spacing: -.3px; margin: 26px 0 12px; }
.bl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bl-card { display: grid; gap: 5px; align-content: start; padding: 14px 16px; background: var(--panel); border-radius: 14px; text-decoration: none; color: inherit; box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .18s, transform .18s var(--ease); }
.bl-card:hover { box-shadow: var(--sh-pop); transform: translateY(-2px); }
.bl-card[hidden], .bl-group[hidden] { display: none; }
.bl-card b { font-size: 15px; line-height: 1.3; letter-spacing: -.2px; }
.bl-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
@media (max-width: 900px) {
  .bl-grid { grid-template-columns: 1fr; }
  .bl-side { position: static; }
}
@media (max-width: 760px) {
  .blank-page .bl-head { padding: 0 2px; }
  .blank-page .bl-head h1 { font-size: 26px; }
  .bl-acts .btn { flex: 1 1 100%; }
  .bl-sheet { padding: 22px 16px; font-size: 13.5px; max-height: 560px; }
  .bl-sheet .s-sign { grid-template-columns: 1fr; }
  .bl-text { padding: 22px 18px; border-radius: 16px; }
}
@media print {
  .blank-page .page-top, .blank-page .crumbs, .blank-page .bl-head, .blank-page .bl-side, .blank-page .bl-sheet-bar, .blank-page .bl-text,
  .blank-page .post-cta, .blank-page .related, .blank-page .blog-foot, .blank-page .bl-blog { display: none !important; }
  .blank-page, .blank-page main { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .blank-page .bl-grid { display: block; }
  .bl-sheet { box-shadow: none; padding: 0; max-height: none; border-radius: 0; font-size: 12pt; }
  .bl-sheet::after { display: none; }
  .bl-sheet .fld { background: none; color: #888; font-size: 8pt; border-bottom: 1px solid #000; }
}

/* ── Окно при уходе (openExit) ── */
.exit { position: relative; width: 100%; max-width: 480px; background: var(--panel); border-radius: 24px; box-shadow: var(--sh-modal); padding: 30px 30px 18px; animation: rise .32s var(--ease); }
.exit > .icon-btn { position: absolute; top: 12px; right: 12px; }
.exit-doc { display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 40px); padding: 7px 12px 7px 9px; border-radius: 12px; background: var(--bg); font-size: 13.5px; font-weight: 500; margin: 0 0 16px; }
.exit-doc .glyph { width: 20px; height: 20px; flex: none; }
.exit-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exit-doc em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; color: #1a8a4a; font-size: 12px; flex: none; }
.exit-doc em svg { width: 13px; height: 13px; stroke-width: 2.6; }
.exit h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.08; letter-spacing: -1px; font-weight: 600; }
.exit h2 i { font-style: normal; color: var(--dot); }
.exit-sub { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.exit-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.exit-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.exit-list li > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--dot); stroke-width: 2.4; }
.exit-list b { color: var(--ink); font-weight: 600; }
.exit-offers { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.exit-offer { position: relative; display: grid; gap: 2px; justify-items: start; text-align: left; padding: 14px 14px 12px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .1s, background .15s; }
.exit-offer:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.exit-offer:active { transform: scale(.98); }
.exit-offer b { font-size: 14px; font-weight: 600; }
.exit-offer .pr { font-size: 26px; font-weight: 600; letter-spacing: -.8px; line-height: 1.15; }
.exit-offer small { color: var(--muted); font-size: 12.5px; }
.exit-offer.best { background: var(--ink); color: #fff; box-shadow: none; }
.exit-offer.best small { color: rgba(255, 255, 255, .7); }
.exit-offer.best:hover { background: #2a2a2e; box-shadow: none; }
.exit-offer .tag { position: absolute; top: -9px; right: 10px; padding: 2px 8px; border-radius: 99px; background: var(--dot); color: #fff; font-size: 11px; font-weight: 600; }
.exit-trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 2px; color: var(--muted); font-size: 12.5px; }
.exit-trust svg { width: 15px; height: 15px; }
.exit-later { display: block; width: 100%; padding: 10px; margin-top: 2px; color: var(--muted); font-size: 13.5px; border-radius: 10px; }
.exit-later:hover { color: var(--ink); background: var(--hover); }
@media (max-width: 520px) {
  .exit { padding: 24px 18px 12px; border-radius: 20px; }
  .exit h2 { font-size: 25px; }
  .exit-offers { grid-template-columns: 1fr; }
}
