/* Допечатка — простой и спокойный интерфейс для людей без опыта работы с макетами. */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #15171c;
  --ink-2: #464b55;
  --muted: #868b94;
  --line: #e8e5de;
  --line-2: #f0eee9;
  --accent: #ff5a2d;
  --accent-2: #f04716;
  --accent-soft: #fff0ea;
  --ok: #17915a;
  --ok-soft: #e4f6ec;
  --warn: #b97800;
  --warn-soft: #fff5dc;
  --danger: #d7372a;
  --danger-soft: #fdebe9;
  --code: #2d63ff;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 10px 30px -14px rgba(21, 23, 28, .16);
  --font: 'Onest Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.i { flex: none; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid rgba(255, 90, 45, .45); outline-offset: 2px; border-radius: 8px; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 680; }
h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.8rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 660; }

/* ---------- кнопки и поля ---------- */
.btn { --bg: var(--surface); --fg: var(--ink); --bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 13px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg); font-weight: 600; font-size: .98rem; text-decoration: none; white-space: nowrap; transition: transform .15s, background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(21, 23, 28, .35); }
.btn:active { transform: none; box-shadow: none; }
.btn--accent { --bg: var(--accent); --fg: #fff; --bd: var(--accent); }
.btn--accent:hover { --bg: var(--accent-2); box-shadow: 0 10px 24px -10px rgba(240, 71, 22, .7); }
.btn--dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn--ghost:hover { --bd: var(--ink); box-shadow: none; }
.btn--text { --bg: transparent; --bd: transparent; --fg: var(--ink-2); padding: 0 12px; }
.btn--text:hover { --fg: var(--ink); transform: none; box-shadow: none; }
.btn--lg { height: 54px; padding: 0 26px; font-size: 1.04rem; border-radius: 15px; }
.btn--sm { height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 11px; gap: 6px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); list-style: none; transition: .15s; }
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }
.iconbtn::-webkit-details-marker { display: none; }
.input { width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font-size: .96rem; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 13px; line-height: 1.45; resize: vertical; }
select.input { padding-right: 32px; }
.input:hover { border-color: #cfcbc1; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 45, .14); }
.input--sm { height: 36px; padding: 0 10px; font-size: .9rem; border-radius: 9px; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.fld > span small { font-weight: 450; color: var(--muted); margin-left: 4px; }
.fld > em, .fld-error { font-style: normal; font-size: .84rem; color: var(--danger); font-weight: 520; }
.fld > small { font-size: .82rem; color: var(--muted); }
.has-error .input { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check.has-error { color: var(--danger); }
.stack { display: grid; gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 12px; background: #d8d5cd; position: relative; transition: .15s; cursor: pointer; flex: none; }
.switch input::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(21, 23, 28, .12); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }
.spin--lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { display: flex; gap: 9px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: #8f2219; font-weight: 520; font-size: .94rem; }
.notice { display: flex; gap: 10px; align-items: center; width: min(100% - 40px, 1100px); margin: 0 auto 18px; padding: 14px 18px; border-radius: 14px; background: var(--ok-soft); color: #0e6a3f; font-weight: 560; }
.tag { display: inline-flex; padding: 3px 10px; border-radius: 8px; font-size: .78rem; font-weight: 620; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--wait { background: var(--warn-soft); color: var(--warn); }
.tag--off { background: var(--line-2); color: var(--muted); }

/* ---------- шапка (всегда сверху) и подвал ---------- */
.top { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 58px; padding: 0 20px; background: rgba(247, 246, 242, .92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.logo { justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 720; font-size: 1.18rem; letter-spacing: -.03em; }
.top__nav { justify-self: center; display: flex; align-items: center; gap: 4px; }
.top__nav > a, .top__right > a { padding: 8px 13px; border-radius: 11px; text-decoration: none; font-weight: 540; color: var(--ink-2); transition: .15s; }
.top__nav > a:hover, .top__nav > a[aria-current] { background: var(--surface); color: var(--ink); }
.top__right { justify-self: end; display: flex; align-items: center; gap: 6px; }
.top__login { border: 1px solid var(--line); background: var(--surface); }
.top__login:hover, .top__reg:hover { color: var(--ink); border-color: var(--ink); }
.top__reg { border: 1px solid var(--ink); background: var(--ink); color: #fff !important; }
.top__account { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); }
.top__account b { font-weight: 700; color: var(--ink); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; width: min(100% - 40px, 1240px); margin: 32px auto 0; padding: 16px 0 20px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.foot a { color: var(--ink-2); }
.foot__links { display: flex; gap: 18px; }

/* ---------- первый экран ---------- */
.intro { width: min(100% - 40px, 980px); margin: 0 auto; }
.hero { text-align: center; padding: clamp(18px, 3.5vw, 36px) 0 22px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: .84rem; font-weight: 620; margin-bottom: 12px; }
.hero .lead { max-width: 640px; margin: 14px auto 0; }
/* знак «Честный ЗНАК» по брендбуку: основная вариация, не мельче 35 px по высоте, с охранным полем */
.czline { display: inline-flex; align-items: center; gap: 16px; max-width: 560px; margin: 18px auto 0; padding: 12px 18px 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-size: .86rem; line-height: 1.4; text-align: left; }
.czline img { flex: none; width: auto; height: 38px; }
.lead { font-size: clamp(1.02rem, .97rem + .3vw, 1.18rem); color: var(--ink-2); line-height: 1.55; }
.drop { position: relative; display: grid; justify-items: center; gap: 8px; padding: clamp(22px, 3.5vw, 36px) 24px; text-align: center; background: var(--surface); border: 2px dashed #ddd8cd; border-radius: 28px; box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .15s; }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop__icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 19px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.drop__title { font-size: 1.24rem; font-weight: 650; letter-spacing: -.015em; }
.drop__sub { color: var(--muted); }
.drop__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.drop__busy { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; background: rgba(255, 255, 255, .94); border-radius: 26px; font-weight: 560; }
.bar { width: min(320px, 70vw); height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .2s; }
.drop__error { margin-top: 10px; padding: 11px 16px; border-radius: 12px; background: var(--danger-soft); color: #8f2219; font-weight: 540; }
.privacy { display: flex; gap: 10px; align-items: flex-start; justify-content: center; max-width: 720px; margin: 14px auto 0; color: var(--ink-2); font-size: .9rem; }
.privacy .i { color: var(--ok); margin-top: 2px; }
.how { margin-top: clamp(32px, 5vw, 56px); text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; text-align: left; }
.steps li { display: grid; gap: 6px; align-content: start; padding: 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); counter-increment: step; }
.steps b { font-size: 1.08rem; letter-spacing: -.01em; }
.steps b::before { content: counter(step) '. '; color: var(--accent); }
.steps span { color: var(--ink-2); font-size: .93rem; }
.steps__pic { display: grid; place-items: center; height: 100px; margin-bottom: 8px; border-radius: 16px; background: var(--bg); }
.mini { position: relative; width: 126px; height: 86px; border-radius: 6px; background: #fff; box-shadow: 0 6px 16px -6px rgba(21, 23, 28, .3); }
.mini__code { position: absolute; left: 10px; top: 10px; width: 46px; height: 46px; background: repeating-conic-gradient(#15171c 0 25%, #fff 0 50%) 0 0 / 8px 8px; border-left: 3px solid #15171c; border-bottom: 3px solid #15171c; }
.mini__box { position: absolute; border: 1.5px dashed var(--accent); border-radius: 3px; background: rgba(255, 90, 45, .08); }
.mini__box--a { left: 64px; top: 14px; width: 52px; height: 13px; }
.mini__box--b { left: 10px; top: 64px; width: 106px; height: 13px; }
.mini__txt { position: absolute; left: 64px; top: 16px; font: 700 9px/1 var(--font); font-style: normal; }
.mini__txt--r { left: auto; right: 10px; top: auto; bottom: 10px; }
.teaser { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 32px; padding: clamp(20px, 3vw, 30px); border-radius: 24px; background: var(--ink); color: #fff; }
.teaser p { margin-top: 8px; color: rgba(255, 255, 255, .75); max-width: 560px; }
.teaser b { color: #fff; }
.teaser .btn--dark { --bg: #fff; --fg: var(--ink); --bd: #fff; }
.faq { margin-top: 32px; }
.faq h2 { margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 14px 2px; cursor: pointer; font-weight: 620; font-size: 1.04rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 2px 14px; color: var(--ink-2); max-width: 760px; }

/* ---------- рабочая область: шаблон | этикетка | скачать ---------- */
.ws { --tpl-w: clamp(330px, 27vw, 440px); --out-w: clamp(300px, 23vw, 380px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(100% - 24px, 1760px); margin: 12px auto 0; }
.ws__col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ws__edit, .ws__out { gap: 12px; padding: 14px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.ws__resize { display: none; }
.blk { display: grid; gap: 9px; align-content: start; }
.blk__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.blk__head h2 { font-size: 1.08rem; letter-spacing: -.015em; }
.blk__hint { font-size: .8rem; color: var(--muted); text-align: right; }
.blk__hint.is-ok { color: var(--ok); }
.hint { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.gone { max-width: 620px; margin: 40px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.gone p { color: var(--ink-2); }

/* поле с подписью внутри: пустое — подпись серая на месте значения, заполненное — подпись в левом верхнем углу */
.ff { position: relative; display: block; min-width: 0; }
.ff > .input { height: 46px; padding: 18px 11px 4px; font-size: .92rem; color: var(--ink); }
.ff > select.input { padding-right: 28px; }
.ff > textarea.input { height: auto; min-height: 62px; padding-top: 21px; resize: vertical; }
.ff__label { position: absolute; left: 12px; top: 50%; max-width: calc(100% - 24px); transform: translateY(-50%); overflow: hidden; color: var(--muted); font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; transition: top .15s, font-size .15s, transform .15s, color .15s; }
.ff > textarea ~ .ff__label { top: 22px; }
.ff > .input:focus ~ .ff__label, .ff > .input:not(:placeholder-shown) ~ .ff__label, .ff--fixed > .ff__label { top: 6px; transform: none; font-size: .7rem; font-weight: 600; }
.ff > .input:focus ~ .ff__label { color: var(--accent-2); }
.ff--suffix > .input { padding-right: 34px; }
.ff__suffix { position: absolute; right: 11px; bottom: 7px; color: var(--muted); font-size: .8rem; pointer-events: none; }
.ff__error { display: block; margin-top: 4px; font-style: normal; font-size: .82rem; font-weight: 540; color: var(--danger); }

/* этикетка */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
/* узкая колонка этикетки: у «Отменить» и «Повторить» остаются только значки — панель не переносится */
.ws__stage { container-type: inline-size; }
@container (max-width: 860px) {
  .toolbar [data-undo] span, .toolbar [data-redo] span { display: none; }
  .toolbar [data-undo], .toolbar [data-redo] { width: 38px; padding: 0; justify-content: center; }
}
@container (max-width: 520px) {
  .toolbar [data-preview-open] span { display: none; }
  .toolbar [data-preview-open] { width: 38px; padding: 0; justify-content: center; }
}
.toolbar__group { display: flex; gap: 6px; }
.toolbar .btn--sm { height: 38px; padding: 0 12px; }
.toolbar .btn[disabled] { opacity: .4; }
.iconbtn[disabled] { opacity: .38; pointer-events: none; }
.iconbtn--sm { width: 34px; height: 34px; border-radius: 10px; }
.pager { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-2); }
.pager label { display: inline-flex; align-items: center; gap: 7px; }
.pager__input { width: 72px; height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: center; font-weight: 620; }
.desk { position: relative; display: grid; place-items: center; height: clamp(240px, 44vh, 420px); padding: 24px; border-radius: 22px; background-color: #ecebe5; background-image: radial-gradient(rgba(21, 23, 28, .09) 1px, transparent 1.3px); background-size: 16px 16px; overflow: hidden; }
.paper { position: relative; background: #fff; box-shadow: 0 2px 4px rgba(21, 23, 28, .08), 0 20px 40px -18px rgba(21, 23, 28, .35); user-select: none; touch-action: none; }
.paper__img { display: block; width: 100%; height: 100%; pointer-events: none; }
/* слои полей: каждое поле — прозрачная картинка размером с этикетку, двигается вместе с рамкой */
.layers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* картинка поля стоит ровно в его рамке (место и размер задаются из редактора) */
.layer { position: absolute; display: block; max-width: none; pointer-events: none; user-select: none; }
.overlay { position: absolute; inset: 0; }
/* то, что уже напечатано в файле: при наведении — рамка и подсказка */
.orig { position: absolute; border: 1.5px dashed transparent; border-radius: 3px; cursor: help; transition: border-color .12s, background .12s; }
.orig:hover { border-color: rgba(21, 23, 28, .45); background: rgba(21, 23, 28, .04); }
.overlay.is-plain .orig:hover { border-color: transparent; background: none; }
.tip { position: absolute; z-index: 10; max-width: min(320px, calc(100% - 12px)); padding: 8px 11px; border-radius: 10px; background: var(--ink); color: #fff; font-size: .8rem; line-height: 1.35; box-shadow: 0 10px 24px -10px rgba(21, 23, 28, .5); pointer-events: none; }
.desk__busy { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.desk__error { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 10px 14px; border-radius: 12px; background: var(--danger-soft); color: #8f2219; font-size: .88rem; font-weight: 540; }
.desk__file { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 24px); padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .88); color: var(--ink-2); font-size: .8rem; overflow-wrap: anywhere; }
.notes { display: grid; gap: 4px; }
.note { display: flex; gap: 8px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.note .i { margin-top: 1px; }
.note--code { color: var(--ink-2); }
.note--code::before { content: ''; flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 4px; border: 1.5px solid var(--code); background: repeating-linear-gradient(45deg, rgba(45, 99, 255, .25) 0 2px, transparent 2px 5px); }

.box { position: absolute; border: 1.5px dashed rgba(255, 90, 45, .75); border-radius: 3px; cursor: move; transition: background .12s; }
.box:hover { background: rgba(255, 90, 45, .05); }
.box.is-selected { border-style: solid; border-color: var(--accent); background: rgba(255, 90, 45, .05); box-shadow: 0 0 0 3px rgba(255, 90, 45, .16); z-index: 3; }
.box.is-warn { border-color: var(--danger); background: rgba(215, 55, 42, .1); }
/* подпись поля — только под курсором и почти прозрачная: не закрывает то, что напечатано */
.box__tag { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 3px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 90, 45, .3); color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.box:hover .box__tag { opacity: 1; }
.box.is-warn .box__tag { background: rgba(215, 55, 42, .45); }
.overlay.is-dragging .box__tag, .box.is-editing .box__tag { opacity: 0; }
/* правка текста прямо на этикетке */
.box.is-editing { z-index: 6; cursor: text; }
.inedit { position: absolute; left: 50%; top: 50%; z-index: 5; margin: 0; padding: 0 2px; border: 0; border-radius: 2px; outline: 2px solid var(--accent); outline-offset: 1px; line-height: 1.16; resize: none; overflow: hidden; box-shadow: 0 6px 18px -8px rgba(21, 23, 28, .45); }
.box__handle { position: absolute; right: -7px; bottom: -7px; z-index: 2; width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2px solid var(--accent); cursor: nwse-resize; opacity: 0; }
.box.is-selected .box__handle { opacity: 1; }
.overlay.is-plain .box:not(.is-selected) { border-color: transparent; }
.overlay.is-plain .box:not(.is-selected) { background: none; }
.overlay.is-plain .box:not(.is-selected) .box__tag { opacity: 0; }
.zone { position: absolute; border: 1.5px solid rgba(45, 99, 255, .7); border-radius: 3px; background: repeating-linear-gradient(45deg, rgba(45, 99, 255, .14) 0 3px, transparent 3px 8px); }
/* подпись «Код маркировки» — только когда зона в работе: под курсором, при перетаскивании поля или если поле на ней */
.zone span { position: absolute; left: -1.5px; top: 100%; margin-top: 3px; padding: 1px 6px; border-radius: 5px; background: rgba(45, 99, 255, .8); color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.zone:hover span, .zone.is-hot span, .overlay.is-dragging .zone span { opacity: 1; }
.zone.is-hot { border-color: var(--danger); }
.overlay.is-plain .zone { opacity: 0; }

/* шаблон */
.tpl__row { display: flex; gap: 6px; align-items: center; }
.tpl__row select, .tpl__name { flex: 1; min-width: 0; }
.tpl__name { display: flex; align-items: center; height: 36px; padding: 0 11px; border-radius: 9px; background: var(--bg); font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl__row .btn { flex: none; }
.tpl__warn { padding: 8px 11px; border-radius: 10px; background: var(--warn-soft); color: #7a5000; font-size: .83rem; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(21, 23, 28, .3); }
.menu__list--left { left: 0; right: auto; }
.menu__list button { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: .92rem; }
.menu__list button:hover, .menu__list button.is-on { background: var(--bg); }
.menu__list button[disabled] { opacity: .45; cursor: not-allowed; background: none; }
.menu__icon { display: grid; place-items: center; flex: none; width: 18px; height: 18px; color: var(--muted); }
.menu__list .danger .menu__icon { color: inherit; }
.menu__list small { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: .76rem; font-family: var(--font, inherit); }
/* выбор шрифта: шрифт по умолчанию помечен бледным «по умолчанию» */
.fsel { flex: 1; min-width: 0; }
.fsel > summary.fsel__btn { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; padding: 17px 10px 3px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); list-style: none; cursor: pointer; }
.fsel > summary::-webkit-details-marker { display: none; }
.fsel > summary.fsel__btn:hover { border-color: #cfcbc1; }
.fsel[open] > summary.fsel__btn { border-color: var(--accent); }
.fsel__label { position: absolute; left: 12px; top: 6px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.fsel__value { flex: 1; min-width: 0; overflow: hidden; color: var(--ink); font-size: .92rem; white-space: nowrap; text-overflow: ellipsis; }
.fsel__value small { margin-left: 7px; color: var(--muted); opacity: .8; font-size: .78rem; }
.fsel .isel__chev { margin-top: -12px; }
.fsel__list { min-width: 100%; max-height: 320px; overflow-y: auto; }
/* цвет шрифта: «А» с полоской выбранного цвета, как в Word */
.cpick > summary { list-style: none; }
.cpick > summary::-webkit-details-marker { display: none; }
.cpick__btn { position: relative; display: grid; place-items: center; cursor: pointer; }
.cpick__a { font: 700 15px/1 Georgia, 'Times New Roman', serif; margin-top: -4px; }
.cpick__bar { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 4px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .15); }
.cpick[open] > .cpick__btn { background: var(--surface); }
.cpick__list { min-width: 230px; gap: 8px; padding: 10px 12px 12px; }
.cpick__title { font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cpick__grid { display: grid; grid-template-columns: repeat(5, 30px); gap: 7px; }
.menu__list .cpick__sw { width: 30px; height: 30px; padding: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .15); }
.menu__list .cpick__sw:hover { box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .15), 0 0 0 2px var(--line); }
.menu__list .cpick__sw.is-on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--ink); }
.cpick__custom { display: flex; align-items: center; gap: 9px; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.cpick__custom input { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.cpick__note { max-width: 210px; font-size: .74rem; line-height: 1.35; color: var(--muted); }
.menu__list hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 6px; }
.menu__list .danger { color: var(--danger); }
.fields { display: grid; gap: 8px; align-content: start; }
.fields__empty { padding: 16px; text-align: center; color: var(--muted); font-size: .9rem; border: 1px dashed var(--line); border-radius: 14px; }
.fitem { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.fitem.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 45, .1); }
.fitem.is-warn { border-color: var(--danger); }
.fitem__head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 9px; border-radius: 13px; cursor: pointer; }
.fitem__head:hover { background: #fcfbf9; }
.fitem__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.fitem__main { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
/* название поля меняется прямо здесь */
.fitem__title { font-weight: 640; font-size: .93rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem__head .menu > summary { width: 30px; height: 30px; border-color: transparent; background: none; }
.fitem__head .menu > summary:hover { border-color: var(--line); background: var(--surface); }
.fitem__sum { color: var(--muted); font-size: .79rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem__chev { display: grid; color: var(--muted); transition: transform .2s; }
.fitem.is-open .fitem__chev { transform: rotate(90deg); }
.tool { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.tool:hover { background: var(--bg); color: var(--ink); }
.tool--del:hover { background: var(--danger-soft); color: var(--danger); }
.tool[disabled] { opacity: .3; cursor: not-allowed; background: none; }
.fitem__body { display: grid; gap: 9px; padding: 2px 11px 11px; }
.row2, .row3, .row4 { display: grid; gap: 8px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.row4 .ff > .input { padding-left: 9px; padding-right: 26px; }
.row4 .ff__label { left: 9px; }
.row4 .ff__suffix { right: 8px; }
.seg { display: flex; padding: 3px; border-radius: 11px; background: var(--bg); gap: 2px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; flex: 1; min-width: 0; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: none; font-size: .83rem; font-weight: 580; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 23, 28, .14); }
.seg--icons { flex: none; }
.seg--icons button { flex: none; width: 36px; padding: 0; }
.seg--tabs { margin: 14px 0 4px; }
.seg--tabs button { height: 36px; font-size: .92rem; }
.fitem__grid { display: grid; gap: 10px; padding-top: 9px; border-top: 1px solid var(--line-2); }
.grp { display: grid; gap: 6px; }
.grp__title { font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stylebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stylebar__font { flex: 1; }
.stylebar__size { flex: 0 0 104px; }
.tgroup { display: flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--bg); }
.tbtn { display: grid; place-items: center; flex: none; width: 32px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 1rem/1 Georgia, 'Times New Roman', serif; }
.tbtn--bold { font-weight: 800; }
.tbtn--italic { font-style: italic; }
.tbtn--under { text-decoration: underline; text-underline-offset: 3px; }
.tbtn:hover { background: var(--surface); color: var(--ink); }
.tbtn.is-on { background: var(--ink); color: #fff; box-shadow: 0 1px 3px rgba(21, 23, 28, .2); }
/* «белый текст на фоне»: буква в тёмном квадрате; включено — квадрат белый, как у Ж, К, Ч */
.tinv { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 4px; background: var(--ink-2); color: #fff; font: 700 13px/1 Georgia, 'Times New Roman', serif; }
.tbtn:hover .tinv { background: var(--ink); }
.tbtn.is-on .tinv { background: #fff; color: var(--ink); }
/* размер шрифта: число и «пт» в одном поле, без подписи */
.sizebox { position: relative; flex: 0 0 86px; }
.sizebox .input { height: 46px; padding: 0 30px 0 11px; font-size: .95rem; font-weight: 600; }
.sizebox span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; pointer-events: none; }
/* выпадающий список с иконками углов */
.isel > summary.isel__btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .9rem; }
.isel > summary.isel__btn:hover { border-color: #cfcbc1; }
.isel[open] > summary.isel__btn { border-color: var(--accent); }
.isel__icon { display: grid; color: var(--accent); }
.isel__text { flex: 1; }
.isel__chev { display: grid; color: var(--muted); }
.isel .menu__list { right: 0; }
.fitem__warn { display: flex; gap: 7px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); color: #8f2219; font-size: .83rem; font-weight: 540; }
.marks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.marks__item { display: grid; justify-items: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-size: .74rem; color: var(--ink-2); text-align: center; }
.marks__item img { width: 100%; height: 40px; object-fit: contain; }
.marks__item:hover { border-color: #cfcbc1; }
.marks__item.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 45, .14); color: var(--ink); }
.add > span { display: block; font-size: .74rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.add__row { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px dashed #cfcac0; background: var(--bg); font-weight: 600; font-size: .86rem; white-space: nowrap; transition: .15s; }
.chipbtn:hover { border-style: solid; border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }

/* скачать */
.flist { display: grid; gap: 5px; }
.flist__item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px 6px 7px; border: 1.5px solid transparent; border-radius: 11px; background: var(--bg); cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.flist__item:hover { background: #efede6; }
/* файл, чьи этикетки сейчас на экране, — лёгкая рамка */
.flist__item.is-current { border-color: rgba(255, 90, 45, .45); background: #fff; box-shadow: 0 1px 4px rgba(21, 23, 28, .06); }
.flist__item.is-dragging { position: relative; z-index: 2; border-color: var(--accent); background: #fff; box-shadow: 0 12px 26px -12px rgba(21, 23, 28, .45); cursor: grabbing; }
.flist.is-sorting { user-select: none; }
.flist.is-sorting .flist__item:not(.is-dragging) { transition: none; }
.flist__grip { display: grid; place-items: center; flex: none; align-self: stretch; width: 16px; margin: -2px 0 -2px -3px; border-radius: 6px; color: #b9b4a8; cursor: grab; touch-action: none; }
.flist__grip:hover { background: rgba(21, 23, 28, .05); color: var(--ink-2); }
.flist__grip.is-off { opacity: .35; cursor: not-allowed; }
.flist__tools .menu > summary { width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; }
.flist__tools .menu > summary:hover { background: rgba(21, 23, 28, .06); }
.flist__no { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; background: var(--ink); color: #fff; font-size: .74rem; font-weight: 700; }
.flist__name { flex: 1; min-width: 0; display: grid; font-weight: 600; font-size: .88rem; line-height: 1.35; overflow-wrap: anywhere; }
.flist__name small { font-weight: 450; color: var(--muted); font-size: .8rem; }
.flist__tools { display: flex; flex: none; }
.flist__tools .tool { width: 26px; height: 26px; }
.flist__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: -4px 0 -6px -10px; }
.flist__actions .btn--sm { height: 34px; padding: 0 10px; font-size: .86rem; }
.flist__ttl { font-size: .78rem; color: var(--muted); }
.flist__busy { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); }
.flist__busy .spin { width: 18px; height: 18px; }
.flist__error { padding: 9px 12px; border-radius: 10px; background: var(--danger-soft); color: #8f2219; font-size: .84rem; font-weight: 540; }
.numbering { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.numbering__label { font-size: .74rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.inline-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inline-row .seg { flex: 0 1 215px; }
.pay { display: grid; gap: 9px; }
.blk--files { padding-top: 12px; border-top: 1px solid var(--line-2); }
.blk__head h3 { font-size: .98rem; letter-spacing: -.01em; }
/* окно «Предпросмотр» */
.pv { display: grid; gap: 10px; margin-top: 14px; }
.pv__stage { position: relative; display: grid; place-items: center; min-height: 260px; max-height: min(58vh, 520px); padding: 22px; border-radius: 18px; background-color: #ecebe5; background-image: radial-gradient(rgba(21, 23, 28, .09) 1px, transparent 1.3px); background-size: 16px 16px; overflow: hidden; }
.pv__img { display: block; max-width: 100%; max-height: calc(min(58vh, 520px) - 44px); box-shadow: 0 2px 4px rgba(21, 23, 28, .08), 0 20px 40px -18px rgba(21, 23, 28, .35); background: #fff; }
.pv__spin { position: absolute; right: 14px; top: 14px; }
.pv__error { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 9px 12px; border-radius: 10px; background: var(--danger-soft); color: #8f2219; font-size: .86rem; }
.pv__where { font-size: .82rem; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.pv__where:empty { display: none; }
.pv__pager { justify-content: center; }
.pv__actions { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sum > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.sum dt { color: var(--ink-2); }
.sum dd { display: grid; text-align: right; font-weight: 650; }
.sum dd small { font-weight: 450; color: var(--muted); font-size: .74rem; }
.sum dd.ok { color: var(--ok); }
.payblock { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 11px; background: var(--danger-soft); color: #8f2219; font-size: .84rem; font-weight: 540; line-height: 1.4; }
.payblock span { display: grid; flex: none; margin-top: 1px; }
.pay__note { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.btn--text.is-danger { --fg: var(--danger); }
.btn--danger { --bg: var(--danger); --fg: #fff; --bd: var(--danger); }
.btn .i, .btn svg { flex: none; }

/* вход и регистрация: сам диалог — в /static/css/auth.css; здесь запасная страница и профиль в кабинете */
.auth__row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth__legal { display: none; gap: 12px; }
.check:has(input[name="is_legal"]:checked) + .auth__legal { display: grid; }
.phone-row { display: flex; gap: 8px; }
.phone-row .input { flex: 1; min-width: 0; }
.phone-row .btn { flex: none; }
.phone-row .input[readonly] { background: var(--line-2); color: var(--ink); }
.fld > span .tag { margin-left: 6px; vertical-align: 1px; }
@media (max-width: 520px) {
  .auth__row2 { grid-template-columns: 1fr; }
  .phone-row { flex-wrap: wrap; }
  .phone-row .btn { width: 100%; }
}

/* ---------- диалоги и уведомления ---------- */
.modal { width: min(100% - 32px, 460px); max-height: calc(100vh - 32px); padding: 26px; border: 0; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(21, 23, 28, .5); overflow: auto; }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.modal--wide { width: min(100% - 32px, 560px); }
.modal--xl { width: min(100% - 32px, 900px); }
.modal::backdrop { background: rgba(21, 23, 28, .45); backdrop-filter: blur(2px); }
.modal__close { position: absolute; right: 14px; top: 14px; }
.modal h2 { font-size: 1.32rem; margin-right: 40px; }
.modal p { margin-top: 8px; color: var(--ink-2); }
.modal .actions { display: grid; gap: 10px; margin-top: 20px; }
.modal .sumline { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--bg); font-weight: 560; }
.modal .fld { margin-top: 16px; }
.modal .btn--text { justify-self: center; }
.progress { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(247, 246, 242, .82); backdrop-filter: blur(3px); }
.progress__card { display: grid; justify-items: center; gap: 14px; padding: 30px 36px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.progress__title { font-weight: 650; font-size: 1.1rem; }
.progress__text { color: var(--muted); font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; max-width: min(92vw, 560px); transform: translate(-50%, 30px); padding: 14px 20px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 520; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { margin-left: 12px; border: 0; background: none; color: #ffb59f; font-weight: 650; }

/* ---------- тарифы, кабинет, вход ---------- */
.pagehead { width: min(100% - 40px, 1100px); margin: 0 auto; padding: clamp(16px, 3vw, 30px) 0 18px; }
.pagehead .lead { margin-top: 10px; max-width: 720px; }
.pagehead h1 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem); }
.pagehead--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.pagehead--row h1 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.4rem); }
.plans { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; width: min(100% - 40px, 1100px); margin: 0 auto; }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(var(--cols-md, 2), minmax(0, 1fr)); } }
.plan { position: relative; display: flex; flex-direction: column; gap: 11px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.plan h2 { font-size: 1.2rem; }
.plan--best { border: 2px solid var(--accent); }
.plan__badge { position: absolute; top: -12px; right: 20px; padding: 4px 11px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 650; }
.plan__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.plan--free .plan__icon { background: var(--ok-soft); color: var(--ok); }
.plan__price b { display: block; font-size: 2rem; font-weight: 720; letter-spacing: -.03em; }
.plan__price span { color: var(--muted); font-size: .9rem; }
.ticks { display: grid; gap: 6px; flex: 1; }
.ticks li { display: flex; gap: 9px; font-size: .93rem; color: var(--ink-2); }
.ticks .i { color: var(--ok); margin-top: 2px; }
.plan form, .plan > .btn { margin-top: 4px; }
.exact, .paynote { width: min(100% - 40px, 1100px); margin: 14px auto 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.exact p { margin-top: 10px; color: var(--ink-2); max-width: 760px; }
.exact .muted { color: var(--muted); }
.paynote { background: transparent; border-style: dashed; }
.paysteps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; counter-reset: pay; }
.paysteps li { display: grid; align-content: start; gap: 6px; counter-increment: pay; }
.paysteps b::before { content: counter(pay) '. '; color: var(--accent); }
.paysteps span { color: var(--ink-2); font-size: .93rem; }
.cab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(100% - 40px, 1100px); margin: 0 auto; }
.balance { grid-row: span 2; display: grid; align-content: start; gap: 8px; padding: 22px; border-radius: var(--r-lg); background: var(--ink); color: #fff; }
.balance__label { color: rgba(255, 255, 255, .65); font-weight: 560; }
.balance__value { font-size: clamp(2.4rem, 2rem + 2vw, 3.6rem); font-weight: 720; letter-spacing: -.04em; line-height: 1.05; }
.balance__value span { font-size: 1.1rem; font-weight: 520; letter-spacing: 0; color: rgba(255, 255, 255, .7); }
.balance .muted { color: rgba(255, 255, 255, .6); }
.balance__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.balance .btn--ghost { --bg: transparent; --fg: #fff; --bd: rgba(255, 255, 255, .3); }
.card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card h2 { font-size: 1.12rem; margin-bottom: 8px; }
.card--fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fold__btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--bg); color: var(--ink-2); transition: transform .2s; }
.card--fold[open] .fold__btn { transform: rotate(180deg); }
.card--fold summary::-webkit-details-marker { display: none; }
.card--fold summary h2 { margin: 0; }
.card--fold[open] summary { margin-bottom: 14px; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.rows li:last-child { border-bottom: 0; }
.rows a, .rows span { display: grid; min-width: 0; text-decoration: none; }
.rows a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.rows b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows small { color: var(--muted); font-size: .82rem; }
.delta { font-weight: 700; white-space: nowrap; }
.delta--plus { color: var(--ok); }
.delta--minus { color: var(--ink-2); }
.auth { display: grid; place-items: center; padding: clamp(16px, 3vw, 32px) 20px; }
.auth__card { width: min(100%, 440px); display: grid; gap: 14px; padding: 26px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); }
.auth__card h1 { font-size: 1.7rem; }
.auth__lead { color: var(--ink-2); margin-top: -6px; }
.auth__tabs { display: flex; padding: 4px; border-radius: 13px; background: var(--bg); }
.auth__tabs a { flex: 1; padding: 9px; border-radius: 10px; text-align: center; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.auth__tabs a.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 23, 28, .14); }
.auth__note { font-size: .88rem; color: var(--muted); }
.orderbox { width: min(100% - 40px, 640px); margin: clamp(16px, 3vw, 32px) auto 0; display: grid; justify-items: center; gap: 12px; text-align: center; padding: clamp(22px, 4vw, 34px); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow); }
.orderbox h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem); }
.orderbox .kicker { margin: 0; }
.orderbox__icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: var(--line-2); color: var(--ink-2); }
.orderbox__icon--ok { background: var(--ok-soft); color: var(--ok); }
.orderbox__icon--wait { background: var(--warn-soft); color: var(--warn); }
.orderbox__sum { width: 100%; margin-top: 6px; border-top: 1px solid var(--line-2); }
.orderbox__sum div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-2); text-align: left; }
.orderbox__sum dt { color: var(--muted); }
.orderbox__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* ---------- адаптив ---------- */
/* компьютер: шаблон | этикетка | скачать на всю высоту окна, страница не прокручивается */
@media (min-width: 1200px) and (min-height: 600px) {
  body.page-work { height: 100vh; overflow: hidden; }
  body.page-work .foot { display: none; }
  body.page-work main { display: flex; min-height: 0; }
  .ws { min-height: 0; gap: 0; grid-template-columns: var(--tpl-w) 14px minmax(0, 1fr) 14px var(--out-w); margin: 12px auto; }
  .ws > .ws__stage { grid-column: 3; }
  .ws > .ws__out { grid-column: 5; }
  .ws__col { min-height: 0; }
  .ws__stage .desk { flex: 1; height: auto; min-height: 0; }
  .ws__edit .fields { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 2px 6px 6px; }
  .ws__out { overflow-y: auto; }
  /* много файлов: итог и кнопки скачивания всегда на виду, прокручивается только список */
  .ws__out .blk--pay { flex: none; }
  .ws__out .blk--files { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 220px; }
  .ws__out .flist { flex: 0 1 auto; min-height: 64px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
  /* ширину блоков «Шаблон» и «Скачать» меняют, потянув за полосу между блоками */
  .ws__resize { display: block; position: relative; cursor: col-resize; touch-action: none; }
  .ws__resize::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 44px; border-radius: 3px; background: #d5d1c7; transform: translate(-50%, -50%); transition: background .15s, height .15s; }
  .ws__resize:hover::after, .ws__resize:focus-visible::after, .ws.is-resizing .ws__resize::after { height: 80px; background: var(--accent); }
  .ws.is-resizing { cursor: col-resize; user-select: none; }
}
/* планшет: этикетка сверху, шаблон и скачивание — рядом */
@media (min-width: 760px) and (max-width: 1199.98px) {
  .ws { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .ws__stage { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 759.98px) {
  .ws__stage { order: -1; }
}
@media (max-width: 1199.98px) {
  body.page-work .foot { margin-top: 24px; }
}
@media (max-width: 900px) {
  .top { grid-template-columns: auto 1fr auto; padding: 0 14px; gap: 8px; }
  .top__nav { justify-self: center; }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .top__nav > a, .top__right > a { padding: 8px 9px; }
  .logo span { display: none; }
  .steps, .paysteps, .cab { grid-template-columns: 1fr; }
  .balance { grid-row: auto; }
  .teaser { flex-direction: column; align-items: flex-start; }
  .intro, .pagehead, .plans, .exact, .paynote, .cab { width: min(100% - 28px, 1100px); }
  .ws { width: min(100% - 20px, 1680px); }
  .desk { padding: 16px; height: clamp(200px, 38vh, 320px); border-radius: 18px; }
  .toolbar .btn--sm span { display: none; }
  .row4 { grid-template-columns: 1fr 1fr; }
  .drop__actions .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
}
@media (max-width: 560px) {
  .plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- корзина ---------- */
.cartbox { width: min(100% - 40px, 860px); margin: 0 auto; display: grid; gap: 14px; }
.cartbox__note { display: flex; gap: 9px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: #7a5000; font-size: .9rem; }
.cartbox__note .i { flex: none; margin-top: 2px; }
.cartlist { display: grid; gap: 8px; }
.cartlist__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.cartlist__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.cartlist__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cartlist__main b { font-weight: 650; overflow-wrap: anywhere; }
.cartlist__main small { color: var(--muted); font-size: .84rem; }
.cartlist__qty { display: inline-flex; align-items: center; gap: 6px; }
.cartlist__qty b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.cartlist__qty .iconbtn { font-size: 1.1rem; font-weight: 600; }
.cartlist__sum { min-width: 96px; text-align: right; font-size: 1.02rem; white-space: nowrap; }
.cartsum { display: grid; gap: 4px; margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.cartsum div { display: flex; justify-content: space-between; gap: 12px; }
.cartsum dt { color: var(--ink-2); }
.cartsum dd { margin: 0; font-weight: 600; }
.cartsum__total { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line-2); font-size: 1.15rem; }
.cartsum__total dd { font-weight: 750; }
.cartbox__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (max-width: 600px) {
  .cartlist__item { flex-wrap: wrap; }
  .cartlist__main { flex-basis: calc(100% - 52px); }
  .cartlist__sum { margin-left: auto; }
}
