
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap; src: url("fonts/onest-fe2bd26a.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 800; font-display: swap; src: url("fonts/onest-3db826ed.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --cream: #FDFBF7; --cream-2: #F6EFE6; --desk: #EDE4D8; --desk-2: #E4D9CA;
  --ink: #1D1517; --ink-2: #5A4D50; --line: #E2D6C7;
  --red: #C8202A; --red-deep: #8F1219; --pink: #F6DEDB; --white: #fff;
  --mint: #E4F2EA; --mint-ink: #1F7A57; --lav: #ECEAFB; --lav-ink: #4B3FB0;
  --sky: #E2EFFA; --sky-ink: #1F5E9E; --peach: #FBE6D6; --peach-ink: #A2521A;
  --sun: #FFF3C9; --sun-ink: #8A6A00; --rose: #FBE3E9; --rose-ink: #A0244A;
  --font: "Onest", "Segoe UI", system-ui, sans-serif;
  --doc: "Times New Roman", "Liberation Serif", Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --rail: 86px; --thumbs: 212px; --bar: 52px; --status: 30px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--desk); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--sky-ink); outline-offset: 2px; border-radius: 6px; }
.app { display: grid; height: 100dvh; grid-template-rows: var(--bar) auto 1fr var(--status); grid-template-columns: var(--rail) minmax(0, 1fr) var(--thumbs); grid-template-areas: "bar bar bar" "rail tb thumbs" "rail work thumbs" "status status status"; }

/* ---------- шапка: вкладки документов ---------- */
.bar { min-width: 0; grid-area: bar; background: var(--red); color: var(--white); display: flex; align-items: flex-end; gap: 14px; padding: 0 12px 0 10px; }
.brand { display: flex; align-items: center; gap: 9px; height: 100%; color: var(--white); text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap; padding-right: 6px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--cream); display: grid; place-items: center; }
.brand .logo img { width: 26px; height: 26px; }
.brand .tag { font: 700 11px/1 var(--font); background: var(--white); color: var(--red-deep); padding: 4px 7px 3px; border-radius: 999px; letter-spacing: .02em; }
.tabs { display: flex; align-items: flex-end; gap: 3px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; height: 100%; }
.tab { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 14px; border: 0; border-radius: 11px 11px 0 0; background: rgba(255,255,255,.13); color: rgba(255,255,255,.88); white-space: nowrap; max-width: 230px; position: relative; transition: background-color .15s; }
.tab:hover { background: rgba(255,255,255,.22); }
.tab[aria-selected="true"] { background: var(--cream); color: var(--ink); font-weight: 600; }
.tab[aria-selected="true"]::before, .tab[aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; width: 11px; height: 11px; background: radial-gradient(circle at var(--cx) 0, transparent 10.5px, var(--cream) 11px); }
.tab[aria-selected="true"]::before { left: -11px; --cx: 0; }
.tab[aria-selected="true"]::after { right: -11px; --cx: 11px; }
.tab .fn { overflow: hidden; text-overflow: ellipsis; }
.tab .x { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; opacity: .6; }
.tab .x:hover { background: rgba(0,0,0,.08); opacity: 1; }
.tab-new { width: 34px; height: 34px; margin-bottom: 3px; border: 0; border-radius: 9px; background: transparent; color: var(--white); display: grid; place-items: center; flex: none; }
.tab-new:hover { background: rgba(255,255,255,.18); }
.bar-act { display: flex; align-items: center; gap: 6px; height: 100%; flex: none; }
.bbtn { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,.15); color: var(--white); font-weight: 600; white-space: nowrap; }
.bbtn:hover { background: rgba(255,255,255,.26); }
.bbtn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); text-decoration: none; }
.bbtn.ghost:hover { background: rgba(255,255,255,.15); }
.bbtn.main { background: var(--white); color: var(--red-deep); }
.bbtn.main:hover { background: var(--pink); }
.bbtn svg { width: 18px; height: 18px; flex: none; }
.bar :focus-visible { outline-color: #FFF8EA; }

/* ---------- меню «Сохранить» ---------- */
.menu { position: absolute; top: calc(var(--bar) - 4px); right: 12px; z-index: 40; width: 280px; background: var(--white); color: var(--ink); border-radius: 14px; padding: 6px; box-shadow: 0 18px 44px rgba(42,20,20,.22); display: none; }
.menu.open { display: block; }
.menu button { width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 2px 10px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; }
.menu button:hover { background: var(--cream-2); }
.menu i { grid-row: span 2; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--c); color: var(--ci); font-style: normal; }
.menu b { font-weight: 600; }
.menu small { color: var(--ink-2); font-size: 12.5px; }

/* ---------- инструменты слева ---------- */
.rail { grid-area: rail; background: var(--cream); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; overflow-y: auto; scrollbar-width: none; }
.tool { width: 76px; min-height: 58px; padding: 5px 2px 6px; border: 0; border-radius: 12px; background: transparent; display: grid; justify-items: center; align-content: start; gap: 4px; position: relative; color: var(--ci); }
.tool span { width: 34px; height: 34px; border-radius: 10px; background: var(--c); display: grid; place-items: center; transition: transform .15s var(--ease); }
.tool svg { width: 19px; height: 19px; }
.tool:hover span { transform: scale(1.06); }
.tool[aria-pressed="true"] { background: var(--c); box-shadow: inset 0 0 0 2px var(--ci); }
.tool .tip { font: 600 11px/1.15 var(--font); font-style: normal; color: var(--ink-2); text-align: center; }
.tool[aria-pressed="true"] .tip { color: var(--ci); }
.rail hr { width: 44px; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- панель над страницами ---------- */
.tb { grid-area: tb; display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--cream); border-bottom: 1px solid var(--line); min-width: 0; }
.tb .grp { display: flex; align-items: center; gap: 2px; background: var(--cream-2); border-radius: 10px; padding: 3px; }
.ib { height: 32px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink); }
.ib:hover { background: var(--white); }
.ib[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 3px rgba(42,20,20,.12); font-weight: 600; }
.ib svg { width: 18px; height: 18px; }
.zoomv { width: 64px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; border: 0; background: transparent; }
.tb .sp { flex: 1; }
.ctx b { font-weight: 700; }
.ctx { font-weight: 500 !important; display: none; align-items: center; gap: 8px; padding: 0 12px; min-height: 38px; white-space: normal !important; line-height: 1.3; min-width: 0; flex: 1; border-radius: 10px; background: var(--c); color: var(--ci); font-weight: 600; white-space: nowrap; }
.ctx.on { display: flex; font-size: 13.5px; }
.ctx.on + .sp { display: none; }
.cards { align-items: stretch !important; }
.ctx .sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.search { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--cream-2); color: var(--ink-2); width: 200px; }
.search input { border: 0; background: none; font: inherit; width: 100%; outline: none; color: var(--ink); }

/* ---------- рабочий стол со страницами ---------- */
.work { grid-area: work; overflow: auto; position: relative; background: var(--desk) radial-gradient(rgba(120,90,60,.07) 1px, transparent 1.2px) 0 0 / 14px 14px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 28px 24px 60px; min-width: min-content; }
.pages.two { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; }
.page { background: #FFFDF9; box-shadow: 0 1px 2px rgba(60,40,30,.12), 0 10px 28px rgba(60,40,30,.12); position: relative; flex: none; overflow: hidden; }
.page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.page .ld { position: absolute; inset: 0; display: grid; place-items: center; color: #B8A996; font-size: 13px; }
.page.cur { box-shadow: 0 0 0 2px rgba(200,32,42,.35), 0 10px 28px rgba(60,40,30,.14); }

/* пустой экран */
.empty { position: absolute; inset: 0; display: none; overflow-y: auto; }
.empty.on { display: block; }
.emp-in { max-width: 980px; margin: 0 auto; padding: 32px 24px 0; }
.drop { width: min(640px, 100%); margin: 0 auto; text-align: center; padding: 40px 30px 30px; border-radius: 22px; background: var(--cream); border: 2px dashed #D5C3AE; }
.drop h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; margin: 16px 0 10px; letter-spacing: -.015em; }
.drop .lead { color: var(--ink-2); margin: 0 auto 22px; max-width: 52ch; font-size: 16px; }
.drop .hint { color: var(--ink-2); font-size: 13.5px; margin: 12px 0 0; }
.drop .btn { display: inline-flex; align-items: center; gap: 9px; border: 0; padding: 15px 28px; border-radius: 999px; background: var(--red); color: var(--white); font-weight: 700; font-size: 16px; text-decoration: none; }
.drop .btn:hover { background: var(--red-deep); }
.drop small { display: block; margin-top: 14px; color: var(--mint-ink); font-weight: 600; }
.drop .pic { width: 92px; height: 92px; margin: 0 auto; border-radius: 24px; background: var(--pink); color: var(--red); display: grid; place-items: center; }

/* ---------- миниатюры справа ---------- */
.thumbs { grid-area: thumbs; background: var(--cream); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.th-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.th-head b { flex: 1; font-size: 14px; }
.th-list { overflow-y: auto; padding: 14px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 1; }
.th { border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: 6px; position: relative; }
.th .mini { width: 104px; background: #FFFDF9; box-shadow: 0 1px 2px rgba(60,40,30,.14), 0 4px 10px rgba(60,40,30,.08); border-radius: 2px; position: relative; overflow: hidden; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.th .mini i { position: absolute; left: 14px; right: 14px; height: 3px; background: #CFC6BC; border-radius: 2px; }
.th .num { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.th[aria-current="true"] .mini { outline-color: var(--red); }
.th[aria-current="true"] .num { color: var(--red); font-weight: 700; }
.th .ops { position: absolute; top: 4px; right: 50%; translate: 50% 0; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.th:hover .ops, .th:focus-within .ops { opacity: 1; }
.th .ops span { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--white); display: grid; place-items: center; }
.th .ops svg { width: 14px; height: 14px; }
.th-add { margin: 0 14px 14px; height: 40px; white-space: nowrap; font-size: 14px; border: 1.5px dashed #D5C3AE; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.th-add:hover { border-color: var(--red); color: var(--red); }

/* ---------- строка состояния ---------- */
.status { grid-area: status; display: flex; align-items: center; gap: 18px; padding: 0 14px; background: var(--cream-2); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.status .safe { display: flex; align-items: center; gap: 6px; color: var(--mint-ink); font-weight: 600; }
.status .sp { flex: 1; }
.status a { color: var(--red-deep); font-weight: 600; text-decoration: none; }
.status a:hover { text-decoration: underline; }

/* ---------- каталог «Все инструменты» ---------- */
.cat { position: fixed; inset: var(--bar) 0 0; z-index: 35; background: var(--cream); overflow-y: auto; display: none; }
.cat.open { display: block; animation: catIn .28s var(--ease); }
@keyframes catIn { from { opacity: 0; transform: translateY(-8px); } }
.cat-in { max-width: 1180px; margin: 0 auto; padding: 30px 28px 60px; }
.cat-top { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.cat-top h1 { font-size: 30px; letter-spacing: -.015em; margin: 0; flex: 1; line-height: 1.15; }
.cat-top .search { width: 300px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); }
.cat-lead { color: var(--ink-2); margin: 0 0 26px; max-width: 62ch; }
.cat h2 { font-size: 15px; margin: 26px 0 12px; color: var(--ink-2); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 10px; align-items: start; }
.card { text-align: left; border: 0; background: var(--white); border-radius: 14px; padding: 14px 14px 13px; display: grid; grid-template-columns: 36px 1fr; gap: 3px 12px; align-items: start; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s var(--ease); }
.card:hover { box-shadow: inset 0 0 0 2px var(--ci); transform: translateY(-1px); }
.card i { grid-row: 1 / span 3; width: 36px; height: 36px; border-radius: 10px; background: var(--c); color: var(--ci); display: grid; place-items: center; font-style: normal; }
.card i svg { width: 19px; height: 19px; }
.card b, .card span, .card em {  }
.card b { font-size: 15px; line-height: 1.25; font-weight: 600; }
.card span { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.card em {  justify-self: start; margin-top: 4px; font: 700 11px/1 var(--font); color: var(--red-deep); background: var(--pink); padding: 4px 8px; border-radius: 999px; }

/* ---------- узкие экраны ---------- */
.only-narrow { display: none; }
@media (max-width: 1100px) { .search.in-tb { display: none; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--bar) auto 1fr 66px; grid-template-areas: "bar" "tb" "work" "rail"; }
  .thumbs { position: fixed; right: 0; top: var(--bar); bottom: 58px; width: 200px; z-index: 32; transform: translateX(100%); transition: transform .25s var(--ease); box-shadow: -10px 0 30px rgba(42,20,20,.15); }
  .thumbs.open { transform: none; }
  .rail { flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 0 8px; overflow-x: auto; justify-content: flex-start; }
  .rail hr { width: 1px; height: 28px; border: 0; border-left: 1px solid var(--line); margin: 0 4px; }
  .tool { width: 64px; min-height: 52px; }
  .status { display: none; }
  .only-narrow { display: inline-flex; }
  .bbtn .lbl { display: none; }
  .bbtn { padding: 0 10px; }
  .brand .name { display: none; }
  .tab { max-width: 130px; }
  .grp .ib#two, .tb .grp:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- этап 1: живая сборка ---------- */
.th { cursor: pointer; }
.th .mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.th.sel .mini { outline-color: var(--red); background: #FFF6F4; }
.th.sel .mini::after { content: ""; position: absolute; inset: 0; background: rgba(200,32,42,.08); }
.th .ops span { cursor: pointer; }
.th .ops span:hover { background: var(--red); }
.th.drag { opacity: .35; }
.th.drop-before::before { content: ""; position: absolute; top: -9px; left: 8px; right: 8px; height: 3px; border-radius: 2px; background: var(--red); }
.th-sel { display: none; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--pink); color: var(--red-deep); font-size: 13px; font-weight: 600; }
.th-sel.on { display: flex; }
.th-sel span { flex: 1; }
.th-sel .ib { height: 28px; min-width: 28px; }
.th-sel .ib:hover { background: rgba(255,255,255,.7); }

.dropzone { position: fixed; inset: 0; z-index: 60; background: rgba(200,32,42,.12); border: 4px dashed var(--red); display: none; place-items: center; pointer-events: none; }
.dropzone.on { display: grid; }
.dropzone b { background: var(--red); color: var(--white); padding: 16px 26px; border-radius: 999px; font-size: 18px; box-shadow: 0 12px 30px rgba(143,18,25,.3); }

.toasts { position: fixed; left: 50%; bottom: 46px; translate: -50% 0; z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--white); padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(29,21,23,.3); max-width: min(560px, 92vw); animation: tIn .25s var(--ease); }
.toast.err { background: var(--red-deep); }
@keyframes tIn { from { opacity: 0; transform: translateY(8px); } }

.busy { position: fixed; inset: 0; z-index: 65; background: rgba(253,251,247,.6); display: none; place-items: center; }
.busy.on { display: grid; }
.busy div { background: var(--white); padding: 18px 24px; border-radius: 14px; box-shadow: 0 14px 40px rgba(42,20,20,.18); display: flex; align-items: center; gap: 12px; font-weight: 600; }
.busy i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--pink); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog.dlg { border: 0; border-radius: 18px; padding: 24px; width: min(420px, 92vw); box-shadow: 0 24px 60px rgba(42,20,20,.28); color: var(--ink); background: var(--cream); }
dialog.dlg::backdrop { background: rgba(29,21,23,.35); }
.dlg h3 { margin: 0 0 6px; font-size: 19px; }
.dlg p { margin: 0 0 14px; color: var(--ink-2); }
.dlg input { width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); }
.dlg input:focus { outline: none; border-color: var(--sky-ink); }
.dlg .err { color: var(--red-deep); font-size: 13.5px; min-height: 20px; margin: 6px 0 4px; }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg button { border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; background: var(--cream-2); }
.dlg button.pri { background: var(--red); color: var(--white); }
.dlg button.pri:hover { background: var(--red-deep); }
.card.soon { opacity: .62; }
.card.soon em { background: var(--cream-2); color: var(--ink-2); }
.search { position: relative; }
.search .cnt { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tab.unsaved .fn::after { content: " •"; color: var(--red); }
.tab[aria-selected="true"].unsaved .fn::after { color: var(--red); }

@media (max-width: 600px) { .pages { padding: 14px 10px 40px; gap: 14px; } }

/* ---------- этап 2: слой правки ---------- */
.page .ov { position: absolute; inset: 0; z-index: 2; }
.osvg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.osvg .o { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: move; }
.osvg .o.sel { filter: drop-shadow(0 0 2px rgba(31,94,158,.9)); }
.ov .o { position: absolute; cursor: move; }
.ov .o.hl { mix-blend-mode: multiply; opacity: .45; }
.ov .o.redact { background: #111; outline: 2px dashed rgba(255,255,255,.5); outline-offset: -4px; }
.ov .o.rot .in { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }
.ov .o .txt { font-family: "CPDF Sans", "PT Sans", sans-serif; line-height: 1.25; white-space: pre; padding: 2px 3px; outline: none; }
.ov .o.editing { cursor: text; }
.ov .o.editing .txt { background: rgba(255,255,255,.85); box-shadow: 0 0 0 1.5px var(--sky-ink); border-radius: 2px; min-height: 1.25em; }
.ov .o .stamp { border: 2px solid; border-radius: 6px; display: grid; place-content: center; text-align: center; font-family: "CPDF Sans", "PT Sans", sans-serif; line-height: 1.15; opacity: .9; }
.ov .o .stamp b { font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.ov .o img { user-select: none; pointer-events: none; }
.ov .o.sel { outline: 1.5px dashed var(--sky-ink); outline-offset: 2px; }
.ov .hdl { position: absolute; width: 14px; height: 14px; border-radius: 4px; background: var(--white); border: 2px solid var(--sky-ink); cursor: nwse-resize; z-index: 3; }
.ov .fld { position: absolute; border: 0; background: rgba(226,239,250,.55); box-shadow: inset 0 -1.5px 0 var(--sky-ink); font-family: "CPDF Sans", "PT Sans", sans-serif; color: #10243F; padding: 0 3px; border-radius: 2px; resize: none; }
.ov .fld:focus { outline: 2px solid var(--sky-ink); background: rgba(255,255,255,.95); }
.ov .fld.chk { display: grid; place-items: center; box-shadow: none; background: rgba(226,239,250,.55); }
.ov.tool-form .fld { background: rgba(255,226,120,.45); }
.work.drawing .ov { cursor: crosshair; touch-action: none; }
.work.drawing .ov.tool-text { cursor: text; }
.ctx.rich { gap: 6px; flex-wrap: wrap; }
.ctx .cx-t { margin-right: 4px; }
.ctx .cx-h { opacity: .75; font-weight: 500; font-size: 13px; }
.ctx .swb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--white); background: var(--sw); box-shadow: 0 0 0 1px rgba(0,0,0,.18); padding: 0; }
.ctx .swb.on { box-shadow: 0 0 0 2px var(--ci); }
.ctx .cx-b { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.65); font-size: 13px; font-weight: 600; color: var(--ink); }
.ctx .cx-b.on { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ci); }
.ctx .cx-b.pri { background: var(--ci); color: var(--white); }
.ctx .cx-b.del { background: var(--red); color: var(--white); margin-left: 4px; }
.ctx .cx-sel, .ctx .cx-in { height: 28px; border: 0; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--white); }
.ctx .cx-in { width: 150px; }
.ctx .cx-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.ctx .cx-sig { height: 32px; width: 70px; border: 0; border-radius: 8px; background: var(--white); padding: 2px; }
.ctx .cx-sig img { max-width: 100%; max-height: 100%; }
.ctx .cx-sig.on { box-shadow: inset 0 0 0 2px var(--ci); }
.sigdlg { width: min(720px, 94vw) !important; }
.sigdlg canvas { width: 100%; aspect-ratio: 640 / 240; background: var(--white); border-radius: 12px; border: 1.5px dashed #D5C3AE; touch-action: none; cursor: crosshair; display: block; }
.sigdlg .sig-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.sigdlg .sig-row .sp { flex: 1; }
.sigdlg .sig-up { border-radius: 999px; padding: 11px 18px; font-weight: 600; background: var(--cream-2); cursor: pointer; }
.sigdlg small { color: var(--ink-2); }

/* ---------- SEO-блок под пустым экраном ---------- */
.seo { padding: 34px 0 10px; color: var(--ink); }
.seo section { margin: 0 0 34px; }
.seo h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 14px; }
.seo .steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.seo .steps li { counter-increment: s; background: var(--cream); border-radius: 16px; padding: 16px 16px 16px 58px; position: relative; line-height: 1.45; }
.seo .steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: var(--white); font-weight: 700; display: grid; place-items: center; }
.seo .why { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.seo .why li { background: var(--cream); border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; }
.seo .why b { font-size: 16px; }
.seo .why span { color: var(--ink-2); line-height: 1.45; }
.toolnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.toolnav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--cream); color: var(--ink); text-decoration: none; font-weight: 600; }
.toolnav a svg { width: 20px; height: 20px; color: var(--red); flex: none; }
.toolnav a:hover { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--red); }
.toolnav a[aria-current="page"] { background: var(--pink); color: var(--red-deep); }
.faq details { background: var(--cream); border-radius: 14px; margin-bottom: 8px; }
.faq summary { padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 10px; font-size: 22px; color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); line-height: 1.5; }
.support { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(120deg, #C2306B, #A44D6E 55%, #8E4664); color: var(--white); border-radius: 22px; padding: 26px 28px; }
.support h2 { color: var(--white); margin: 0 0 6px; }
.support p { margin: 0; opacity: .92; max-width: 56ch; }
.support > div:first-child { flex: 1 1 320px; }
.sup-b { display: flex; gap: 10px; flex-wrap: wrap; }
.support .btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; background: var(--white); color: var(--red-deep); font-weight: 700; text-decoration: none; }
.support .btn svg { color: var(--red); }
.support .btn.ghost2 { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }
.sfoot { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0 40px; font-size: 13px; color: var(--ink-2); }
.sfoot a { color: var(--red-deep); text-decoration: none; }
.sfoot a:hover { text-decoration: underline; }
.langsw { color: var(--white); text-decoration: none; font-weight: 700; font-size: 13px; padding: 6px 9px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.45); }
.langsw:hover { background: rgba(255,255,255,.15); }
.cat-h { font-size: 30px; letter-spacing: -.015em; margin: 0; flex: 1; line-height: 1.15; }
.thanks { position: fixed; right: 18px; bottom: 44px; z-index: 72; max-width: 420px; background: var(--white); color: var(--ink); border-radius: 16px; padding: 14px 40px 14px 16px; box-shadow: 0 16px 44px rgba(42,20,20,.22); line-height: 1.45; font-size: 14px; animation: tIn .3s var(--ease); }
.thanks a { display: inline-block; margin: 8px 8px 0 0; padding: 7px 14px; border-radius: 999px; background: var(--red); color: var(--white); font-weight: 700; text-decoration: none; }
.thanks a + a { background: var(--cream-2); color: var(--ink); }
.thanks button { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; color: var(--ink-2); }
.tdlg .lv { display: grid; gap: 8px; margin: 6px 0 12px; }
.tdlg .opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }
.tdlg .opt span { flex: 1; font-weight: 600; }
.tdlg .opt.off { opacity: .55; cursor: default; }
.tdlg .opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--red); }
.tdlg .lim { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 6px 0; }
.tdlg .lim input { width: 110px; }
.tdlg .fset { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; }
.tdlg .fset b { width: 100%; font-size: 14px; }
.tdlg select { font: inherit; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); }
.tdlg .note { color: var(--ink-2); font-size: 13.5px; }
@media (max-width: 760px) { .seo .steps, .seo .why { grid-template-columns: 1fr; } .emp-in { padding: 16px 12px 0; } .drop { padding: 28px 18px 22px; } .langsw { display: none; } }

.drop .prog { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--red-deep); font-weight: 600; text-decoration: none; }
.drop .prog:hover { text-decoration: underline; }
.tdlg input[type=radio], .tdlg input[type=checkbox] { width: auto; padding: 0; }
.cat h3 { font-size: 15px; margin: 26px 0 12px; color: var(--ink-2); font-weight: 600; }

.cc { position: fixed; left: 16px; bottom: 44px; z-index: 74; max-width: 420px; background: var(--ink); color: var(--white); border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 44px rgba(29,21,23,.3); font-size: 14px; line-height: 1.45; }
.cc p { margin: 0 0 10px; }
.cc a { color: #FFB4A8; }
.cc div { display: flex; gap: 8px; }
.cc button { border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 700; background: var(--white); color: var(--red-deep); }
.cc button[data-n] { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
@media (max-width: 600px) { .cc { left: 8px; right: 8px; bottom: 74px; max-width: none; } }
