/* ════════════════════════════════════════════════════════════════════════════
   HPGroup · панель соглашений
   MOBILE FIRST: базовые правила для телефона, min-width расширяет.
   Принципы:
     • один фирменный акцент (медь), статусы имеют свои спокойные цвета;
     • разделение фоном, тенью и воздухом, а не рамками;
     • текст не мельче 15px, кликабельные зоны от 44px;
     • шрифт Manrope локально, цифры табличные.
   ════════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap; src: url(../../assets/fonts/manrope-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap; src: url(../../assets/fonts/manrope-latin-400.woff2) format('woff2'); 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+2122, U+2212; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url(../../assets/fonts/manrope-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url(../../assets/fonts/manrope-latin-500.woff2) format('woff2'); 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+2122, U+2212; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap; src: url(../../assets/fonts/manrope-cyrillic-600.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap; src: url(../../assets/fonts/manrope-latin-600.woff2) format('woff2'); 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+2122, U+2212; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url(../../assets/fonts/manrope-cyrillic-700.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url(../../assets/fonts/manrope-latin-700.woff2) format('woff2'); 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+2122, U+2212; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap; src: url(../../assets/fonts/manrope-cyrillic-800.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap; src: url(../../assets/fonts/manrope-latin-800.woff2) format('woff2'); 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+2122, U+2212; }

:root {
  --ink: #0F1011;
  --cream: #F5F2EC;
  --paper: #FBF9F5;
  --white: #FFFFFF;
  --copper: #B8763C;
  --copper-dark: #9C6230;
  --copper-soft: #F2E3D5;
  --copper-ink: #6E421B;
  --g900: #1A1A1A;
  --g700: #3B3835;
  --g500: #6E6962;
  --g300: #A8A199;
  --g200: #D9D3C9;
  --g100: #EAE6DD;
  --g050: #F1EDE5;
  --brick: #8E3222;
  --brick-soft: #F4E2DD;

  /* статусы */
  --sent: #5A7286;   --sent-bg: #E3E9EE;   --sent-ink: #2F4455;
  --opened: #B8763C; --opened-bg: #F2E3D5; --opened-ink: #6E421B;
  --signed: #3D8452; --signed-bg: #DDEBDF; --signed-ink: #22502F;
  --expired: #A8A199;--expired-bg: #EAE6DD;--expired-ink: #5E5953;
  --revoked: #8E3222;--revoked-bg: #F4E2DD;--revoked-ink: #7A2A1C;

  --font: 'Manrope', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 12px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(15,16,17,.05), 0 6px 20px rgba(15,16,17,.06);
  --shadow-lg: 0 2px 6px rgba(15,16,17,.06), 0 18px 48px rgba(15,16,17,.14);
  --focus: 0 0 0 3px rgba(184,118,60,.28);
  --tabbar-h: 68px;
  --side-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 1.5;
  color: var(--g700); background: var(--cream);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.ic { flex: 0 0 auto; display: block; }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; color: var(--ink); }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; color: var(--ink); }
h3 { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--ink); }
p { line-height: 1.6; }
.muted { color: var(--g500); }
.small { font-size: 15px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.hash { font-variant-numeric: tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; word-break: break-all; }

/* ───────────────────────────── КНОПКИ ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  background: var(--copper); color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2;
  border: none; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; text-align: center;
  transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--copper-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .5; cursor: default; transform: none; pointer-events: none; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #26282A; }
.btn-ghost { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(15,16,17,.06), inset 0 0 0 1px var(--g100); }
.btn-ghost:hover { background: var(--g050); }
.btn-soft { background: var(--copper-soft); color: var(--copper-ink); }
.btn-soft:hover { background: #EBD5C1; }
.btn-danger { background: var(--brick-soft); color: var(--brick); }
.btn-danger:hover { background: #EDCFC7; }
.btn-green { background: var(--signed); }
.btn-green:hover { background: #336F45; }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 17px; border-radius: var(--r); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .ic { margin-left: -2px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--g500); cursor: pointer; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--g100); color: var(--ink); }
.linkish { background: none; border: none; color: var(--copper-dark); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 2px; }

/* ───────────────────────────── ПОЛЯ ───────────────────────────── */
.fld { display: block; min-width: 0; position: relative; }
.fld-l { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.fld-l .req { color: var(--copper); }
.fld-l em { font-style: normal; font-weight: 500; color: var(--g500); }
.inp {
  width: 100%; min-height: 50px; padding: 11px 14px;
  background: var(--white); color: var(--ink);
  border: 1px solid transparent; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--g200);
  font-size: 16px; font-weight: 500;
  transition: box-shadow .18s var(--ease), background .18s var(--ease);
}
.inp::placeholder { color: var(--g300); }
.inp:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--copper), var(--focus); }
textarea.inp { min-height: 110px; line-height: 1.55; resize: vertical; }
select.inp {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%236E6962' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.inp.is-err { box-shadow: inset 0 0 0 1.5px var(--brick); background: #FFFBFA; }
.hint { font-size: 15px; color: var(--g500); margin-top: 6px; line-height: 1.45; }
.err { font-size: 15px; color: var(--brick); font-weight: 700; margin-top: 6px; }
.frow { display: grid; gap: 16px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--ink); padding: 10px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--copper); flex: 0 0 auto; margin-top: 1px; }
.counter { font-size: 15px; color: var(--g500); font-weight: 600; }
.counter b { color: var(--ink); }
.counter.over b { color: var(--brick); }

/* пароль «показать» */
.pw-fld .inp { padding-right: 132px; }
.pw-eye {
  position: absolute; right: 4px; bottom: 3px; height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; color: var(--g500); cursor: pointer;
}
.pw-eye:hover { color: var(--copper-dark); background: var(--g050); }

/* выбор карточками (способ отправки, срок) */
.choice { display: grid; gap: 10px; }
.choice label { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .c-body {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; min-height: 64px;
  background: var(--white); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--g100);
  transition: box-shadow .18s var(--ease), background .18s var(--ease);
}
.choice .c-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--g050); color: var(--g500); flex: 0 0 auto; }
.choice .c-t { display: block; font-weight: 700; color: var(--ink); }
.choice .c-d { display: block; font-size: 15px; color: var(--g500); margin-top: 2px; line-height: 1.4; }
.choice input:checked + .c-body { background: #FFFDFB; box-shadow: inset 0 0 0 2px var(--copper); }
.choice input:checked + .c-body .c-ic { background: var(--copper-soft); color: var(--copper-dark); }
.choice input:focus-visible + .c-body { outline: 2px solid var(--copper); outline-offset: 2px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills label { position: relative; cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); font-weight: 700; color: var(--g700); }
.pills input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.pills input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ───────────────────────────── КАРКАС ───────────────────────────── */
.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 16px;
  background: rgba(245,242,236,.92); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 rgba(15,16,17,.05);
}
.top-logo img { width: 104px; }
.top-cap { font-size: 15px; font-weight: 700; color: var(--g500); padding-left: 10px; box-shadow: inset 1px 0 0 var(--g200); }
.main { padding: 18px 16px calc(var(--tabbar-h) + 36px + env(safe-area-inset-bottom)); min-width: 0; max-width: 1320px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--ink);
  box-shadow: 0 -8px 24px rgba(15,16,17,.12);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; color: rgba(245,242,236,.58); text-decoration: none; cursor: pointer;
  font-size: 13px; font-weight: 700; -webkit-tap-highlight-color: transparent; min-width: 0;
}
.tab-ic { position: relative; display: grid; place-items: center; width: 52px; height: 32px; border-radius: 999px; transition: background .18s var(--ease); }
.tab-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.on { color: #fff; }
.tab.on .tab-ic { background: rgba(184,118,60,.9); }
.tab .badge { position: absolute; top: -4px; right: 2px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--signed); color: #fff; font-size: 13px; font-weight: 800; line-height: 1;
}

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--g500); text-decoration: none; margin: -8px 0 4px; }
.back:hover { color: var(--copper-dark); }

.page-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.page-head .sub { color: var(--g500); margin-top: 4px; font-size: 16px; }
.head-act { display: flex; gap: 10px; flex-wrap: wrap; }
.head-act .btn { flex: 1 1 auto; }

/* шторка снизу («Ещё», подтверждения) */
.sheet-wrap { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(15,16,17,.46); animation: fade .2s var(--ease); }
.sheet-card {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--cream); border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: up .26s var(--ease);
}
.sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: var(--g200); margin: 0 auto 12px; }
.sheet-card h2 { margin: 4px 0 8px; }
.sheet-foot { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 18px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.more-user { display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; }
.more-user b { display: block; color: var(--ink); }
.more-user span { font-size: 15px; color: var(--g500); }
.more-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; border-radius: var(--r); text-decoration: none; font-weight: 700; color: var(--ink); background: var(--paper); margin-bottom: 8px; }
.more-item.on { background: var(--copper-soft); color: var(--copper-ink); }
.more-item span { flex: 1 1 auto; }
.more-chev { color: var(--g300); }
.side-ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--copper); color: #fff; font-weight: 800; font-size: 17px; flex: 0 0 auto; }

/* ───────────────────────────── ТОСТ И ЗАМЕТКИ ───────────────────────────── */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 200;
  background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--r);
  font-size: 16px; font-weight: 700; text-align: center; box-shadow: var(--shadow-lg);
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.toast.on { transform: none; opacity: 1; }
.toast.err { background: var(--brick); }
.toast.ok { background: var(--signed-ink); }

.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--g050); color: var(--g700); margin-bottom: 16px; line-height: 1.5; }
.note .ic { margin-top: 1px; }
.note b { color: var(--ink); }
.note-ok { background: var(--signed-bg); color: var(--signed-ink); }
.note-err { background: var(--brick-soft); color: var(--brick); }
.note-warn { background: var(--copper-soft); color: var(--copper-ink); }
.note-info { background: var(--sent-bg); color: var(--sent-ink); }
.note ul { margin: 6px 0 0 18px; }

/* ───────────────────────────── КАРТОЧКИ-ПАНЕЛИ ───────────────────────────── */
.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 16px; min-width: 0; }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.card-h h2 .ic { color: var(--copper); }
.card-lead { color: var(--g500); margin: -6px 0 14px; }
.sec-title { font-size: 15px; font-weight: 800; color: var(--g500); margin: 26px 0 10px; letter-spacing: .01em; }

/* ───────────────────────────── ПЛИТКИ СТАТУСОВ ───────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  --c: var(--g500); --bg: var(--paper); --ink-c: var(--ink);
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 104px;
  padding: 14px 14px 12px; border-radius: var(--r); background: var(--bg);
  text-decoration: none; color: var(--ink-c); box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  overflow: hidden;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile-top { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.tile-top .ic { color: var(--c); }
.tile-v { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: auto; }
.tile-p { font-size: 15px; font-weight: 600; opacity: .72; }
.tile.on { box-shadow: inset 0 0 0 2px var(--c), var(--shadow); }
.tile.on::after { content: ''; position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.tile-all { --c: var(--copper); --bg: var(--ink); --ink-c: #fff; }
.tile-all .tile-top { color: rgba(245,242,236,.7); }
.tile-all .tile-p { color: rgba(245,242,236,.7); opacity: 1; }
.tile-sent    { --c: var(--sent);    --bg: var(--sent-bg);    --ink-c: var(--sent-ink); }
.tile-opened  { --c: var(--opened);  --bg: var(--opened-bg);  --ink-c: var(--opened-ink); }
.tile-signed  { --c: var(--signed);  --bg: var(--signed-bg);  --ink-c: var(--signed-ink); }
.tile-expired { --c: var(--expired); --bg: var(--expired-bg); --ink-c: var(--expired-ink); }
.tile-revoked { --c: var(--revoked); --bg: var(--revoked-bg); --ink-c: var(--revoked-ink); }

/* ───────────────────────────── КОНВЕРСИЯ ───────────────────────────── */
.funnel { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.funnel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.funnel-h h3 { font-size: 16px; }
.funnel-h .muted { font-size: 15px; }
.fsteps { display: grid; gap: 12px; }
.fstep { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.fstep-l { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 15px; }
.fstep-l i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.fstep-v { font-weight: 800; color: var(--ink); font-size: 16px; }
.fstep-v small { font-size: 15px; font-weight: 600; color: var(--g500); margin-left: 6px; }
.fbar { grid-column: 1 / -1; height: 12px; border-radius: 99px; background: var(--g100); overflow: hidden; }
.fbar b { display: block; height: 100%; border-radius: 99px; background: var(--c); min-width: 4px; transition: width .5s var(--ease); }
.fstep.f-sent { --c: var(--sent); } .fstep.f-opened { --c: var(--opened); } .fstep.f-signed { --c: var(--signed); }
.fstep.zero .fbar b { min-width: 0; }

/* ───────────────────────────── БЕЙДЖИ СТАТУСОВ ───────────────────────────── */
.st {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px 0 10px;
  border-radius: 999px; font-size: 15px; font-weight: 700; white-space: nowrap; line-height: 1;
}
.st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.st-sent    { background: var(--sent-bg);    color: var(--sent-ink); }   .st-sent i    { background: var(--sent); }
.st-opened  { background: var(--opened-bg);  color: var(--opened-ink); } .st-opened i  { background: var(--opened); }
.st-signed  { background: var(--signed-bg);  color: var(--signed-ink); } .st-signed i  { background: var(--signed); }
.st-expired { background: var(--expired-bg); color: var(--expired-ink); }.st-expired i { background: var(--expired); }
.st-revoked { background: var(--revoked-bg); color: var(--revoked-ink); }.st-revoked i { background: var(--revoked); }
.st-lg { min-height: 38px; padding: 0 16px 0 13px; font-size: 16px; }
.st-lg i { width: 10px; height: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 8px; background: var(--g050); font-size: 15px; font-weight: 600; color: var(--g700); }
.tag-new { background: var(--signed); color: #fff; }
.tag-copper { background: var(--copper-soft); color: var(--copper-ink); }

/* ───────────────────────────── ФИЛЬТРЫ ───────────────────────────── */
.filters { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--g300); pointer-events: none; }
.search .inp { padding-left: 46px; }
.f-top { display: grid; gap: 10px; }
.f-top .btn { width: 100%; }
.f-more { margin-top: 10px; }
.f-more > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px;
  font-weight: 700; color: var(--g700); cursor: pointer; border-radius: var(--r-sm);
}
.f-more > summary::-webkit-details-marker { display: none; }
.f-more > summary .ic { transition: transform .18s var(--ease); }
.f-more[open] > summary .chev { transform: rotate(180deg); }
.f-more > summary .tag { margin-left: 2px; }
.f-grid { display: grid; gap: 12px; padding: 8px 0 4px; }
.f-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.f-act { display: flex; gap: 10px; }
.f-act .btn { flex: 1 1 auto; }
.chips-on { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip-on { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chip-on .ic { color: var(--g500); }
.chip-on:hover .ic { color: var(--brick); }

.new-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--signed-bg); color: var(--signed-ink); margin-bottom: 14px; font-weight: 700; }
.new-bar .ic { color: var(--signed); }
.new-bar .grow { min-width: 160px; }
.new-bar .btn { min-height: 44px; }

/* ───────────────────────────── СПИСОК ДОКУМЕНТОВ ───────────────────────────── */
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 2px 10px; color: var(--g500); font-size: 15px; }
.doc-cards { display: flex; flex-direction: column; gap: 10px; }
.doc-card {
  display: block; position: relative; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px 16px; text-decoration: none; color: inherit;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.doc-card:hover { box-shadow: var(--shadow-lg); }
.doc-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--g200)); }
.doc-card.s-sent { --c: var(--sent); } .doc-card.s-opened { --c: var(--opened); } .doc-card.s-signed { --c: var(--signed); }
.doc-card.s-expired { --c: var(--expired); } .doc-card.s-revoked { --c: var(--revoked); }
.dc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dc-name { font-size: 17px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; }
.dc-phone { color: var(--g700); font-weight: 600; margin-top: 2px; }
.dc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--g500); font-size: 15px; }
.dc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dc-meta .ic { color: var(--g300); }
.doc-table-box { display: none; }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
table.tbl th { text-align: left; font-size: 15px; font-weight: 700; color: var(--g500); padding: 12px 14px; background: var(--g050); white-space: nowrap; }
table.tbl th:first-child { border-radius: var(--r) 0 0 0; }
table.tbl th:last-child { border-radius: 0 var(--r) 0 0; }
table.tbl td { padding: 13px 14px; vertical-align: middle; font-size: 15px; box-shadow: inset 0 -1px 0 var(--g100); }
table.tbl tbody tr:last-child td { box-shadow: none; }
table.tbl tbody tr { cursor: pointer; transition: background .12s; }
table.tbl tbody tr:hover td { background: var(--white); }
table.tbl tbody tr.is-new td { background: rgba(61,132,82,.06); }
.t-name { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 16px; }
.t-name:hover { color: var(--copper-dark); }
.t-sub { color: var(--g500); font-size: 15px; margin-top: 2px; }
.t-num { font-weight: 700; color: var(--g700); white-space: nowrap; }
.t-right { text-align: right; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; color: var(--g700); }
.pager a { background: var(--paper); box-shadow: var(--shadow); }
.pager a:hover { background: var(--white); color: var(--ink); }
.pager .on { background: var(--ink); color: #fff; }
.pager .gap { box-shadow: none; background: none; color: var(--g300); min-width: 20px; padding: 0; }
.pager .pg-num { display: none; }
.pager .pg-pos { color: var(--ink); }

/* ───────────────────────────── ПУСТЫЕ СОСТОЯНИЯ ───────────────────────────── */
.empty { text-align: center; padding: 38px 20px; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); }
.empty-ic { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--copper-soft); color: var(--copper-dark); }
.empty h3 { font-size: 19px; margin-bottom: 6px; }
.empty p { color: var(--g500); max-width: 460px; margin: 0 auto; }
.empty-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ───────────────────────────── КАРТОЧКА ДОКУМЕНТА ───────────────────────────── */
.doc-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.doc-head .eyebrow { font-size: 15px; font-weight: 700; color: var(--g500); }
.doc-head h1 { overflow-wrap: anywhere; }
.doc-head .dh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-grid { display: grid; gap: 14px; }
.doc-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.doc-col > .card + .card { margin-top: 0; }

.progress-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 2px 0 4px; }
.ps { position: relative; padding-top: 16px; min-width: 0; }
.ps::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 99px; background: var(--g100); }
.ps.done::before { background: var(--c); }
.ps-l { font-weight: 800; color: var(--ink); font-size: 15px; }
.ps-d { font-size: 15px; color: var(--g500); line-height: 1.35; }
.ps.todo .ps-l { color: var(--g300); }
.ps.p-sent { --c: var(--sent); } .ps.p-opened { --c: var(--opened); } .ps.p-signed { --c: var(--signed); }
.state-note { margin-top: 12px; }

.kv { display: grid; gap: 0; }
.kv > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; box-shadow: inset 0 -1px 0 var(--g100); }
.kv > div:last-child { box-shadow: none; }
.kv dt { font-size: 15px; color: var(--g500); font-weight: 600; }
.kv dd { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.kv dd.soft { font-weight: 500; color: var(--g700); }
.kv .builtin dt::after { content: ' · заполняется само'; font-weight: 500; color: var(--g300); }

.linkbox { display: flex; flex-direction: column; gap: 10px; }
.link-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); min-width: 0; }
.link-field .ic { color: var(--copper); }
.link-field input { border: none; background: none; width: 100%; min-width: 0; font-weight: 600; color: var(--ink); font-size: 16px; text-overflow: ellipsis; }
.link-field input:focus { outline: none; }
.link-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.link-btns > * { min-width: 0; }
.link-exp { display: flex; align-items: flex-start; gap: 8px; color: var(--g500); font-size: 15px; }
.link-exp .ic { margin-top: 2px; }
.link-exp b { color: var(--ink); }
.actions-list { display: grid; gap: 10px; }
.actions-list .btn { justify-content: flex-start; }

.timeline { list-style: none; position: relative; }
.tl { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.tl::before { content: ''; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--g100); }
.tl:last-child { padding-bottom: 0; }
.tl:last-child::before { display: none; }
.tl-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--g050); color: var(--g500); }
.tl-t { font-weight: 700; color: var(--ink); line-height: 1.35; padding-top: 2px; }
.tl-d { font-size: 15px; color: var(--g500); line-height: 1.45; overflow-wrap: anywhere; }
.tl.t-good .tl-ic { background: var(--signed-bg); color: var(--signed); }
.tl.t-warm .tl-ic { background: var(--opened-bg); color: var(--opened); }
.tl.t-cool .tl-ic { background: var(--sent-bg); color: var(--sent); }
.tl.t-bad .tl-ic { background: var(--brick-soft); color: var(--brick); }

.proto { display: grid; }
.proto > div { display: grid; gap: 2px; padding: 10px 0; box-shadow: inset 0 -1px 0 var(--g100); }
.proto > div:last-child { box-shadow: none; }
.proto dt { font-size: 15px; color: var(--g500); font-weight: 600; }
.proto dd { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.proto dd small { display: block; font-size: 15px; color: var(--g500); font-weight: 500; }
.signed-hero { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r); background: var(--signed-bg); color: var(--signed-ink); margin-bottom: 14px; }
.signed-hero .big-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--signed); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.signed-hero b { display: block; font-size: 18px; color: var(--signed-ink); }

.checks { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.checks li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--white); }
.checks .ck { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.checks li.ok .ck { background: var(--signed-bg); color: var(--signed); }
.checks li.bad .ck { background: var(--brick-soft); color: var(--brick); }
.checks b { color: var(--ink); display: block; }
.checks span { font-size: 15px; color: var(--g500); overflow-wrap: anywhere; }
.verdict { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); font-weight: 800; margin-top: 12px; }
.verdict.ok { background: var(--signed); color: #fff; }
.verdict.bad { background: var(--brick); color: #fff; }

/* лист документа */
.paper-wrap { background: var(--g100); border-radius: var(--r); padding: 12px; }
.paper {
  background: var(--white); border-radius: 6px; box-shadow: 0 1px 3px rgba(15,16,17,.08), 0 10px 30px rgba(15,16,17,.07);
  padding: 22px 18px; color: var(--g900); font-size: 16px; line-height: 1.65; max-width: 820px; margin: 0 auto;
  overflow-wrap: break-word;
}
.paper .paper-title { font-size: 21px; font-weight: 800; color: var(--ink); margin-bottom: 16px; line-height: 1.3; text-align: center; }
.paper h2 { font-size: 19px; margin: 20px 0 8px; }
.paper h3 { font-size: 17px; margin: 16px 0 6px; }
.paper h4 { font-size: 16px; margin: 14px 0 6px; color: var(--ink); }
.paper p { margin: 0 0 10px; }
.paper ul, .paper ol { margin: 0 0 12px 24px; }
.paper li { margin-bottom: 4px; }
.paper blockquote { margin: 0 0 12px; padding: 8px 14px; background: var(--g050); border-radius: 6px; }
.paper table { border-collapse: collapse; margin: 0 0 12px; width: 100%; }
.paper td, .paper th { padding: 6px 8px; box-shadow: inset 0 0 0 1px var(--g200); vertical-align: top; }
.paper hr { border: none; height: 1px; background: var(--g200); margin: 16px 0; }
.paper .pv-val { background: var(--copper-soft); color: var(--copper-ink); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.paper .pv-empty { background: var(--g100); color: var(--g500); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.paper-meta { text-align: center; color: var(--g500); font-size: 15px; margin-top: 10px; overflow-wrap: anywhere; }

/* ───────────────────────────── ОТПРАВКА ───────────────────────────── */
.steps-bar { display: flex; gap: 6px; margin-bottom: 16px; }
.steps-bar span { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; color: var(--g300); min-width: 0; }
.steps-bar span::before { content: ''; height: 5px; border-radius: 99px; background: var(--g200); }
.steps-bar span.on { color: var(--ink); }
.steps-bar span.on::before, .steps-bar span.done::before { background: var(--copper); }
.steps-bar span.done { color: var(--g500); }

.tpl-pick { display: grid; gap: 10px; }
.tpl-opt { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: inherit; min-height: 72px; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.tpl-opt:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tpl-opt .t-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--copper-soft); color: var(--copper-dark); flex: 0 0 auto; }
.tpl-opt b { display: block; color: var(--ink); font-size: 17px; }
.tpl-opt span { color: var(--g500); font-size: 15px; }
.tpl-opt .chev { margin-left: auto; color: var(--g300); }

.send-grid { display: grid; gap: 14px; }
.send-form .frow { gap: 18px; }
.tpl-current { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--copper-soft); color: var(--copper-ink); margin-bottom: 16px; }
.tpl-current b { color: var(--ink); display: block; }
.tpl-current a { margin-left: auto; font-weight: 700; color: var(--copper-dark); min-height: 44px; display: inline-flex; align-items: center; }
.submit-bar { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 30; margin: 18px -16px 0; padding: 12px 16px; background: rgba(245,242,236,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 -8px 20px rgba(245,242,236,.9); }
.preview-toggle { margin-top: 4px; }
.preview-box[data-state="loading"] .paper { opacity: .55; }

.result { text-align: center; padding: 26px 18px 22px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); }
.result .big-ic { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--signed); color: #fff; box-shadow: 0 0 0 10px var(--signed-bg); }
.result h1 { font-size: 25px; }
.result .sub { color: var(--g500); margin-top: 6px; }
.result .link-field { margin: 18px 0 12px; text-align: left; }
.result-actions { display: grid; gap: 10px; }
.msg-box { margin-top: 16px; text-align: left; background: var(--white); border-radius: var(--r); padding: 14px; box-shadow: inset 0 0 0 1px var(--g100); }
.msg-box .msg-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-weight: 700; color: var(--ink); }
.msg-text { white-space: pre-wrap; color: var(--g700); line-height: 1.55; overflow-wrap: anywhere; }
.result-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

/* ───────────────────────────── МАССОВАЯ ОТПРАВКА ───────────────────────────── */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 190px; padding: 24px 16px; text-align: center; cursor: pointer;
  border-radius: var(--r); background: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23C9BFB2' stroke-width='2' stroke-dasharray='8 8' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: background-color .18s var(--ease);
}
.drop:hover, .drop.over { background-color: var(--copper-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .d-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--copper-soft); color: var(--copper-dark); display: grid; place-items: center; }
.drop b { color: var(--ink); font-size: 17px; }
.drop span { color: var(--g500); font-size: 15px; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); }
.file-chip .ic { color: var(--signed); }
.file-chip b { color: var(--ink); display: block; overflow-wrap: anywhere; }
.file-chip span { color: var(--g500); font-size: 15px; }
.file-chip .btn { white-space: nowrap; flex: 0 0 auto; }
.steps-bar span { white-space: nowrap; }

.map-list { display: grid; gap: 10px; }
.map-row { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); }
.map-row.auto { box-shadow: inset 0 0 0 1px rgba(61,132,82,.35); }
.map-row.missing { box-shadow: inset 0 0 0 1.5px var(--brick); }
.map-f { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
.map-f .tag { margin-left: auto; }
.map-ex { font-size: 15px; color: var(--g500); overflow-wrap: anywhere; }
.map-ex b { color: var(--g700); font-weight: 600; }

.summary-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.sum { padding: 12px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.sum b { display: block; font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.sum span { font-size: 15px; color: var(--g500); font-weight: 600; }
.sum.good { background: var(--signed-bg); } .sum.good b { color: var(--signed-ink); }
.sum.bad { background: var(--brick-soft); } .sum.bad b { color: var(--brick); }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.pv-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.pv-table th { position: sticky; top: 0; background: var(--g050); text-align: left; padding: 10px 12px; font-size: 15px; color: var(--g500); font-weight: 700; white-space: nowrap; }
.pv-table td { padding: 10px 12px; font-size: 15px; box-shadow: inset 0 -1px 0 var(--g100); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.pv-table tr.bad td { background: #FBF0EC; }
.pv-table td.cell-bad { color: var(--brick); font-weight: 700; }
.pv-table td.n { color: var(--g500); font-weight: 700; }
.pv-table .row-err { white-space: normal; min-width: 220px; color: var(--brick); font-weight: 600; }
.pv-table .row-ok { color: var(--signed); }

.prog { margin: 12px 0; }
.prog-bar { height: 16px; border-radius: 99px; background: var(--g100); overflow: hidden; }
.prog-bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--copper), #CF9056); border-radius: 99px; transition: width .35s var(--ease); }
.prog-l { display: flex; justify-content: space-between; margin-top: 8px; font-weight: 700; color: var(--ink); }
.fail-list { list-style: none; display: grid; gap: 6px; margin-top: 12px; }
.fail-list li { padding: 10px 12px; border-radius: var(--r-sm); background: var(--brick-soft); color: var(--brick); font-size: 15px; font-weight: 600; }

/* ───────────────────────────── ШАБЛОНЫ ───────────────────────────── */
.tpl-list { display: grid; gap: 12px; }
.tpl-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.tpl-card.off { opacity: .72; }
.tpl-card-h { display: flex; gap: 12px; align-items: flex-start; }
.tpl-card-h .t-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--copper-soft); color: var(--copper-dark); flex: 0 0 auto; }
.tpl-card.off .t-ic { background: var(--g100); color: var(--g500); }
.tpl-card h3 { font-size: 18px; overflow-wrap: anywhere; }
.tpl-card h3 a { text-decoration: none; }
.tpl-card h3 a:hover { color: var(--copper-dark); }
.tpl-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-act { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-act .btn { flex: 1 1 auto; }

/* редактор */
.ed-grid { display: grid; gap: 14px; }
.ed-main { min-width: 0; }
.ed-side { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ed-meta { display: grid; gap: 14px; }
.ed-tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--g100); border-radius: 12px; margin: 16px 0 10px; max-width: 100%; }
.ed-tabs button { min-height: 42px; padding: 0 16px; border: none; background: none; border-radius: 9px; font-weight: 700; color: var(--g500); cursor: pointer; white-space: nowrap; }
.ed-tabs button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15,16,17,.1); }
.toolbar {
  position: sticky; top: 58px; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px; border-radius: 12px 12px 0 0; background: var(--ink);
}
.toolbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 10px; border: none; border-radius: 8px;
  background: transparent; color: rgba(245,242,236,.82); font-weight: 700; font-size: 15px; cursor: pointer;
}
.toolbar button:hover { background: rgba(245,242,236,.1); color: #fff; }
.toolbar button.on { background: rgba(245,242,236,.18); color: #fff; }
.toolbar .tb-sep { width: 1px; height: 26px; background: rgba(245,242,236,.16); margin: 0 3px; }
.toolbar .tb-field { background: var(--copper); color: #fff; margin-left: auto; padding: 0 14px; }
.toolbar .tb-field:hover { background: var(--copper-dark); }
.toolbar .tb-b { font-weight: 800; font-family: Georgia, serif; font-size: 18px; }
.toolbar .tb-i { font-style: italic; font-family: Georgia, serif; font-size: 18px; }
.toolbar .tb-u { text-decoration: underline; font-family: Georgia, serif; font-size: 18px; }
.editor-wrap { background: var(--g100); border-radius: 0 0 12px 12px; padding: 12px; }
.editor {
  min-height: 420px; background: var(--white); border-radius: 6px; padding: 22px 18px;
  box-shadow: 0 1px 3px rgba(15,16,17,.08), 0 10px 30px rgba(15,16,17,.06);
  color: var(--g900); font-size: 16px; line-height: 1.65; outline: none; max-width: 820px; margin: 0 auto;
  overflow-wrap: break-word;
}
.editor:focus { box-shadow: 0 0 0 3px rgba(184,118,60,.24), 0 10px 30px rgba(15,16,17,.06); }
.editor:empty::before { content: attr(data-placeholder); color: var(--g300); }
.editor h2 { font-size: 20px; margin: 18px 0 8px; color: var(--ink); }
.editor h3 { font-size: 17px; margin: 14px 0 6px; color: var(--ink); }
.editor h4 { font-size: 16px; margin: 12px 0 6px; color: var(--ink); }
.editor p { margin: 0 0 10px; }
.editor ul, .editor ol { margin: 0 0 12px 24px; }
.editor blockquote { margin: 0 0 12px; padding: 8px 14px; background: var(--g050); border-radius: 6px; }
.editor table { border-collapse: collapse; width: 100%; margin-bottom: 12px; }
.editor td, .editor th { padding: 6px 8px; box-shadow: inset 0 0 0 1px var(--g200); vertical-align: top; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; margin: 0 1px;
  border-radius: 6px; background: var(--copper-soft); color: var(--copper-ink);
  font-weight: 700; font-size: .94em; line-height: 1.45; white-space: nowrap; cursor: default;
  user-select: all; -webkit-user-select: all; vertical-align: baseline;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); flex: 0 0 auto; }
.chip.builtin { background: var(--sent-bg); color: var(--sent-ink); }
.chip.builtin::before { background: var(--sent); }
.chip.unknown { background: var(--brick-soft); color: var(--brick); }
.chip.unknown::before { background: var(--brick); }
.chip.flash { animation: chipflash 1s var(--ease); }
@keyframes chipflash { 0% { box-shadow: 0 0 0 0 rgba(184,118,60,.6); } 100% { box-shadow: 0 0 0 10px rgba(184,118,60,0); } }

.fields-card .card-h { margin-bottom: 8px; }
.limit { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.limit-bar { flex: 1 1 auto; height: 8px; border-radius: 99px; background: var(--g100); overflow: hidden; }
.limit-bar b { display: block; height: 100%; background: var(--copper); border-radius: 99px; transition: width .3s var(--ease); }
.limit.full .limit-bar b { background: var(--brick); }
.limit span { font-weight: 800; color: var(--ink); white-space: nowrap; }
.f-list { display: grid; gap: 10px; }
.f-item { border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); }
.f-item.open { box-shadow: inset 0 0 0 1.5px var(--copper); }
.f-item-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; min-height: 56px; }
.f-item-h .f-name { flex: 1 1 auto; min-width: 0; }
.f-item-h .f-name b { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-item-h .f-name span { font-size: 15px; color: var(--g500); }
.f-item-h .f-name > span { display: block; }
.f-item-h .f-name .f-use { font-size: 15px; font-weight: 700; white-space: nowrap; }
.f-item-h .f-name .f-use.zero { color: var(--copper-dark); }
.f-item-h .f-name .f-use.some { color: var(--signed); }
.f-body { display: grid; gap: 12px; padding: 4px 12px 14px; }
.f-body .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.f-key { font-size: 15px; color: var(--g500); }
.f-key code { font-family: inherit; font-weight: 700; color: var(--g700); background: var(--g050); padding: 2px 6px; border-radius: 5px; }
.f-body .row .btn { flex: 1 1 auto; }
.builtins { display: grid; gap: 8px; margin-top: 14px; }
.builtins .sec-title { margin: 6px 0 2px; }
.bi { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--r-sm); background: var(--sent-bg); color: var(--sent-ink); min-height: 52px; }
.bi b { color: var(--sent-ink); }
.bi span { font-size: 15px; opacity: .85; }
.bi .grow { min-width: 0; }
.add-field { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--g050); }

.pop { position: absolute; z-index: 60; min-width: 260px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; }
.pop button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: none; background: none; border-radius: 8px; text-align: left; cursor: pointer; color: var(--ink); font-weight: 700; }
.pop button:hover, .pop button:focus-visible { background: var(--copper-soft); outline: none; }
.pop button span { margin-left: auto; font-size: 15px; font-weight: 500; color: var(--g500); }
.pop .pop-h { font-size: 15px; font-weight: 800; color: var(--g500); padding: 8px 12px 4px; }
.pop .pop-empty { padding: 10px 12px; color: var(--g500); }

.save-bar { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 30; margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--ink); color: rgba(245,242,236,.8); box-shadow: var(--shadow-lg); }
.save-bar .grow { min-width: 150px; font-weight: 600; }
.save-bar .grow b { color: #fff; }
.save-bar .btn { flex: 1 1 auto; }
.save-bar .dirty-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--copper); margin-right: 6px; }
.warn-list { list-style: none; display: grid; gap: 6px; margin-top: 6px; }

.ver-list { list-style: none; display: grid; gap: 8px; }
.ver { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--white); min-height: 56px; }
.ver.cur { background: var(--copper-soft); }
.ver .v-n { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--g050); font-weight: 800; color: var(--ink); flex: 0 0 auto; }
.ver.cur .v-n { background: var(--copper); color: #fff; }
.ver .grow b { display: block; color: var(--ink); }
.ver .grow span { font-size: 15px; color: var(--g500); }
.ver a { font-weight: 700; color: var(--copper-dark); min-height: 44px; display: inline-flex; align-items: center; }

/* ───────────────────────────── НАСТРОЙКИ ───────────────────────────── */
.set-nav { position: sticky; top: 58px; z-index: 25; display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; margin: -6px -16px 14px; background: rgba(245,242,236,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; font-weight: 700; color: var(--g700); white-space: nowrap; }
.set-nav a:hover { color: var(--copper-dark); }
.set-nav a .ic { color: var(--copper); }
.set-sec { scroll-margin-top: 130px; }
.set-sec .card-h h2 .ic { width: 22px; height: 22px; }
.form-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.form-foot .btn { flex: 1 1 auto; }
.test-row { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border-radius: var(--r); background: var(--g050); }
.test-row .row { flex-wrap: nowrap; }
.test-out { font-weight: 700; }
.test-out.ok { color: var(--signed); }
.test-out.bad { color: var(--brick); }
.secret-wrap { position: relative; }
.secret-wrap .inp { padding-right: 120px; }
.secret-wrap .pw-eye { bottom: 3px; }
.sms-meter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.logo-prev { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); }
.logo-prev img { max-height: 48px; width: auto; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { width: 54px; height: 50px; border: none; border-radius: var(--r-sm); background: var(--white); box-shadow: inset 0 0 0 1px var(--g200); padding: 5px; cursor: pointer; }
.api-key { display: flex; gap: 8px; align-items: center; }
.api-key .inp { font-weight: 700; letter-spacing: .02em; }
.users-list { display: grid; gap: 10px; }
.user-row { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px var(--g100); }
.user-row.off { opacity: .65; }
.user-row-h { display: flex; gap: 12px; align-items: center; }
.user-row-h b { display: block; color: var(--ink); }
.user-row-h span { font-size: 15px; color: var(--g500); }
.user-row details summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--copper-dark); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.user-row details summary::-webkit-details-marker { display: none; }
.user-row details[open] summary .ic { transform: rotate(180deg); }
.user-edit { display: grid; gap: 12px; padding-top: 8px; }
.drv-fields { display: grid; gap: 14px; }

.mini-editor .toolbar { top: 58px; }
.mini-editor .editor { min-height: 260px; }

/* ───────────────────────────── ИНСТРУКЦИЯ ───────────────────────────── */
.help-hero { background: var(--ink); color: var(--cream); border-radius: 18px; padding: 24px 18px; margin-bottom: 16px; position: relative; overflow: hidden; }
.help-hero h1 { color: #fff; font-size: 27px; }
.help-hero p { color: rgba(245,242,236,.75); margin-top: 8px; max-width: 640px; }
.help-hero .hero-flow { margin-top: 18px; }
.toc { display: grid; gap: 8px; margin-bottom: 18px; }
.toc a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; font-weight: 700; color: var(--ink); }
.toc a .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--copper-soft); color: var(--copper-dark); font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.toc a:hover { color: var(--copper-dark); }
.help-sec { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 16px; margin-bottom: 16px; scroll-margin-top: 76px; }
.help-sec > h2 { display: flex; align-items: center; gap: 12px; font-size: 22px; margin-bottom: 10px; }
.help-sec > h2 .n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--copper); color: #fff; font-size: 18px; flex: 0 0 auto; }
.help-sec > p, .help-sec .lead { color: var(--g700); max-width: 760px; }
.help-sec h3 { margin: 20px 0 8px; }
.help-sec p + p { margin-top: 10px; }
.help-sec ul.dots { margin: 8px 0 0 20px; display: grid; gap: 6px; max-width: 760px; }
.hsteps { list-style: none; counter-reset: hs; display: grid; gap: 12px; margin-top: 14px; }
.hsteps > li { counter-increment: hs; position: relative; padding: 14px 14px 14px 62px; border-radius: var(--r); background: var(--white); min-height: 64px; }
.hsteps > li::before { content: counter(hs); position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.hsteps > li > b { color: var(--ink); display: block; margin-bottom: 2px; }
.hsteps > li p b { color: var(--ink); }
.hsteps > li p { color: var(--g700); }
.flow { display: grid; gap: 10px; margin-top: 16px; }
.flow-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--white); position: relative; }
.flow-step .f-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--copper-soft); color: var(--copper-dark); flex: 0 0 auto; }
.flow-step b { display: block; color: var(--ink); }
.flow-step span { font-size: 15px; color: var(--g500); }
.flow-step .f-n { position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.help-hero .flow-step { background: rgba(245,242,236,.07); }
.help-hero .flow-step b { color: #fff; }
.help-hero .flow-step span { color: rgba(245,242,236,.62); }
.help-hero .flow-step .f-ic { background: rgba(184,118,60,.25); color: #E3B083; }
.help-hero .flow-step .f-n { background: var(--copper); }
.status-legend { display: grid; gap: 10px; margin-top: 14px; }
.sl { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 8px; align-items: start; padding: 12px 14px; border-radius: var(--r); background: var(--white); }
.sl p { color: var(--g700); }
.diagram { margin-top: 16px; padding: 16px; border-radius: var(--r); background: var(--white); overflow-x: auto; }
.diagram svg { display: block; min-width: 560px; width: 100%; height: auto; }
.mock { margin-top: 14px; border-radius: var(--r); background: var(--g100); padding: 12px; }
.mock-card { background: var(--white); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.mock-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mock-line { height: 10px; border-radius: 99px; background: var(--g100); }
.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details { border-radius: var(--r); background: var(--white); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; font-weight: 700; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { margin-left: auto; color: var(--g300); transition: transform .18s var(--ease); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq .faq-a { padding: 0 14px 14px; color: var(--g700); display: grid; gap: 8px; }
.kbd { display: inline-flex; align-items: center; min-height: 28px; padding: 0 8px; border-radius: 6px; background: var(--g050); box-shadow: inset 0 -2px 0 var(--g200); font-weight: 700; color: var(--ink); font-size: 15px; white-space: nowrap; }
.sms-demo { display: grid; gap: 10px; margin-top: 14px; }
.bubble { max-width: 420px; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: var(--white); box-shadow: var(--shadow); }
.bubble small { display: block; font-size: 13px; font-weight: 800; color: var(--g500); margin-bottom: 4px; letter-spacing: .02em; }
.two-col { display: grid; gap: 12px; margin-top: 14px; }
.tip-box { padding: 14px; border-radius: var(--r); background: var(--copper-soft); color: var(--copper-ink); }
.tip-box b { color: var(--ink); }

/* ───────────────────────────── ВХОД ───────────────────────────── */
.login-body { background: var(--ink); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--cream); border-radius: 20px; padding: 28px 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-logo { width: 132px; margin-bottom: 22px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-hint { color: var(--g500); margin-bottom: 20px; }
.login-card .fld { margin-bottom: 14px; }
.login-card .btn { margin-top: 4px; }
.login-foot { margin-top: 18px; color: var(--g500); font-size: 15px; text-align: center; }

/* ═══════════════════════ ≥ 560: чуть просторнее ═══════════════════════ */
@media (min-width: 560px) {
  .main { padding-left: 22px; padding-right: 22px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .link-btns { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  .result-actions .btn-lg:first-child { grid-column: 1 / -1; }
  .f-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-grid .f-dates { grid-column: 1 / -1; }
  .kv > div, .proto > div { grid-template-columns: 200px minmax(0, 1fr); gap: 14px; }
  .sheet-foot { flex-direction: row; justify-content: flex-end; }
  .sheet-foot .btn { min-width: 150px; }
  .paper { padding: 34px 38px; }
  .editor { padding: 34px 38px; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .sl { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .toc { grid-template-columns: 1fr 1fr; }
  .submit-bar { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .set-nav { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .map-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
  .map-row .map-ex { grid-column: 1 / -1; }
  .login-card { padding: 34px 32px 26px; }
  .page-head .head-act .btn { flex: 0 0 auto; }
}

/* ═══════════════════════ ≥ 900: таблица вместо карточек ═══════════════════════ */
@media (min-width: 900px) {
  h1 { font-size: 30px; }
  .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .doc-cards { display: none; }
  .doc-table-box { display: block; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
  .pager .pg-num { display: inline-flex; }
  .pager .pg-pos { display: none; }
  .filters { padding: 14px; }
  .f-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .f-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .f-grid .f-dates { grid-column: auto / span 2; }
  .funnel .fsteps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .doc-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .send-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .send-grid .preview-col { position: sticky; top: 20px; }
  .preview-toggle { display: none; }
  .send-grid .preview-box[hidden] { display: block !important; }
  .ed-meta { grid-template-columns: 1fr 1fr; }
  .tpl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result { padding: 36px 40px 30px; max-width: 720px; margin: 0 auto; }
  .help-sec { padding: 30px 32px; }
  .help-hero { padding: 34px 36px; }
  .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .flow-step { flex-direction: column; text-align: center; align-items: center; padding: 18px 12px; }
  .status-legend { grid-template-columns: 1fr 1fr; }
  .toc { grid-template-columns: repeat(3, 1fr); }
  .summary-tiles { max-width: 620px; }
  .test-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}

/* ═══════════════════════ ≥ 1024: боковое меню ═══════════════════════ */
@media (min-width: 1024px) {
  body { font-size: 16px; }
  .top, .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 40;
    background: var(--ink); color: var(--cream); padding: 24px 16px 16px;
  }
  .side-logo img { width: 140px; margin: 0 8px; }
  .side-cap { margin: 10px 8px 26px; font-size: 15px; font-weight: 700; color: rgba(245,242,236,.5); }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-item {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 10px;
    color: rgba(245,242,236,.66); text-decoration: none; font-weight: 700; font-size: 16px;
    transition: background .18s var(--ease), color .18s var(--ease);
  }
  .side-item:hover { background: rgba(245,242,236,.07); color: #fff; }
  .side-item.on { background: var(--cream); color: var(--ink); }
  .side-item.on .ic { color: var(--copper); }
  .side-item .badge { margin-left: auto; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; box-shadow: inset 0 1px 0 rgba(245,242,236,.08); }
  .side-who { min-width: 0; flex: 1 1 auto; }
  .side-who b { display: block; color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-who span { font-size: 14px; color: rgba(245,242,236,.5); }
  .side-out { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: rgba(245,242,236,.6); }
  .side-out:hover { background: rgba(245,242,236,.08); color: #fff; }
  .main { margin-left: var(--side-w); padding: 30px 36px 60px; }
  .toast { left: auto; right: 28px; bottom: 28px; max-width: 460px; }
  .toolbar, .mini-editor .toolbar, .set-nav { top: 0; }
  .submit-bar, .save-bar { bottom: 16px; }
  .submit-bar { margin-left: 0; margin-right: 0; border-radius: var(--r); padding: 12px 14px; }
  .set-nav { margin-left: -36px; margin-right: -36px; padding-left: 36px; padding-right: 36px; }
  .sheet-wrap { align-items: center; }
  .sheet-card { border-radius: 18px; padding: 22px 24px; }
  .sheet-grip { display: none; }
  .ed-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .ed-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 2px; }
  .card { padding: 22px 22px; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .settings-wrap { max-width: 860px; }
  .user-edit { grid-template-columns: 1fr 1fr; }
  .user-edit .full { grid-column: 1 / -1; }
}

@media (min-width: 1280px) {
  .main { padding: 34px 48px 64px; }
  .set-nav { margin-left: -48px; margin-right: -48px; padding-left: 48px; padding-right: 48px; }
  .tpl-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (hover: none) {
  .tile:hover, .tpl-opt:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .side, .top, .tabbar, .toast, .btn, .toolbar { display: none !important; }
  .main { margin: 0; padding: 0; }
}
