/* Fledge Scout — оформление. Бренд Fledge V2: Sex #D21F73, Sky #62AAC3, Skin #FFEEE6, Dark #34231C. Только светлая тема. */

:root {
  --skin: #FFEEE6;
  --skin-2: #FFF6F1;
  --skin-3: #FFDFD0;
  --paper: #FFFFFF;
  --dark: #34231C;
  --ink-2: #6A5248;
  --ink-3: #7D655B;
  --line: rgba(52, 35, 28, .10);
  --line-2: rgba(52, 35, 28, .18);
  --fill: rgba(52, 35, 28, .06);
  --sex: #D21F73;
  --sex-press: #B81A64;
  --sex-ink: #B4175F;
  --sex-soft: #FCE6EF;
  --sky: #62AAC3;
  --sky-ink: #2B6F87;
  --sky-soft: #E3F1F6;
  --ok: #1A6F4D;
  --ok-soft: #E2F4EB;
  --warn: #8A5400;
  --warn-soft: #FFF0D2;
  --bad: #B3261E;
  --bad-soft: #FCE8E6;
  --mark: #FFE3D6;
  --r-xl: 20px;
  --r-l: 16px;
  --r-m: 12px;
  --r-s: 10px;
  --ctl: 36px;
  --ctl-sm: 30px;
  --ctl-lg: 44px;
  --shadow-float: 0 18px 48px -12px rgba(52, 35, 28, .30), 0 2px 8px rgba(52, 35, 28, .08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--skin);
  color: var(--dark);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sex-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
small { font-size: 12px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sex); outline-offset: 2px; border-radius: 6px; }
::selection { background: #F9C9DD; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: 10px;
  background: var(--dark); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }
.ic { flex: none; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--skin); padding: 24px; text-align: center; z-index: 300; }

/* тонкая прокрутка внутри рабочих областей */
.main, .list, .p-scroll, .col-list, .pop, .table-wrap { scrollbar-width: thin; scrollbar-color: rgba(52, 35, 28, .22) transparent; }

/* ------------------------------------------------------------------ оболочка */

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; height: 100vh; height: 100dvh; padding: 12px; }
.side { background: var(--paper); border-radius: var(--r-xl); display: flex; flex-direction: column; padding: 16px 12px 12px; min-height: 0; overflow-y: auto; }
.work { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; min-height: var(--ctl); flex: none; }
.main { flex: 1; min-height: 0; overflow-y: auto; border-radius: var(--r-xl); }
.main:focus-visible { outline: none; }
.tabbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-logo { height: 28px; width: auto; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; padding-left: 10px; border-left: 1px solid var(--line-2); line-height: 22px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-i {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-m);
  color: var(--dark); text-decoration: none; font-weight: 500;
}
.nav-i .ic { color: var(--ink-2); }
.nav-i:hover { background: var(--skin-2); }
.nav-i[aria-current="page"] { background: var(--skin); font-weight: 600; }
.nav-i[aria-current="page"] .ic { color: var(--dark); }
.nav-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-n {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--fill); color: var(--dark);
  font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.nav-n.is-accent { background: var(--sex); color: #fff; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 12px; }

.side-foot { margin-top: auto; padding-top: 16px; }
.buds { display: grid; gap: 12px; padding: 12px; border-radius: 14px; background: var(--skin-2); }
.bud { display: block; text-decoration: none; color: inherit; border-radius: 6px; }
.bud-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.bud-v { color: var(--dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bud.is-over .bar i { background: var(--bad); }
.me { display: flex; gap: 10px; align-items: center; padding: 12px 8px 4px; min-width: 0; }
.me-t { min-width: 0; }
.me-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-r { font-size: 12px; color: var(--ink-2); }

.top-brand { display: none; }
.top-counters { display: flex; gap: 8px; min-width: 0; flex-wrap: wrap; }
.cnt {
  display: inline-flex; align-items: baseline; gap: 8px; height: var(--ctl); padding: 0 14px; line-height: var(--ctl);
  background: var(--paper); border-radius: 999px; text-decoration: none; color: var(--dark); white-space: nowrap;
}
.cnt:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.cnt-n { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.cnt-l { font-size: 13px; color: var(--ink-2); }
.cnt.is-zero .cnt-n { color: var(--ink-3); }
.top-job { margin-left: auto; min-width: 0; }
.jobpill {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; height: var(--ctl);
  padding: 0 16px 0 12px; max-width: min(460px, 100%); background: var(--paper); border-radius: 999px;
  text-decoration: none; color: var(--dark);
}
.jobpill-t { display: flex; gap: 8px; min-width: 0; white-space: nowrap; font-size: 13px; }
.jobpill-s { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.jobpill-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; background: transparent; }
.jobpill-bar i { background: var(--sex); border-radius: 0; }

/* вход и сбой */
.app[data-state="auth"], .app[data-state="fatal"] { display: block; height: auto; min-height: 100dvh; padding: 0; }
.app[data-state="auth"] .side, .app[data-state="auth"] .top, .app[data-state="auth"] .tabbar,
.app[data-state="fatal"] .side, .app[data-state="fatal"] .top, .app[data-state="fatal"] .tabbar { display: none; }
.app[data-state="auth"] .main, .app[data-state="fatal"] .main { min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: visible; }
.gate { background: var(--paper); border-radius: 24px; padding: 36px 32px; width: min(460px, 100%); display: grid; gap: 14px; justify-items: start; }
.gate-logo { height: 40px; width: auto; margin-bottom: 8px; }
.gate-title { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
.gate-text { font-size: 15px; line-height: 1.5; }
.gate-text.is-mute { color: var(--ink-2); font-size: 14px; }
.gate .btn { margin-top: 6px; }
.gate-link { width: 100%; }
.gate-google { display: grid; gap: 10px; justify-items: start; width: 100%; min-height: 44px; }
.gate-google[hidden] { display: none; }
.gate-google .note { margin: 0; }
.gate .gate-link .btn { margin-top: 0; flex: none; }

/* ------------------------------------------------------------------ кнопки и поля */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-s); background: transparent; color: var(--dark);
  font-weight: 500; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none; position: relative;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
/* свой интерлиньяж: при line-height 1 обрезка текста срезает кратку у «Й» и точки у «Ё» */
.btn-t { overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.btn.is-primary { background: var(--sex); color: #fff; font-weight: 600; }
.btn.is-primary:hover { background: var(--sex-press); }
.btn.is-ok { background: var(--dark); color: #fff; font-weight: 600; }
.btn.is-ok:hover { background: #22150F; }
.btn.is-ghost { background: var(--paper); border-color: var(--line-2); }
.btn.is-ghost:hover { background: var(--skin-2); border-color: rgba(52, 35, 28, .3); }
.btn.is-quiet { color: var(--ink-2); }
.btn.is-quiet:hover { background: var(--fill); color: var(--dark); }
.btn.is-danger { color: var(--bad); }
.btn.is-sm { height: var(--ctl-sm); padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.is-lg { height: var(--ctl-lg); padding: 0 18px; font-size: 15px; border-radius: var(--r-m); }
.btn.is-icon { padding: 0; width: var(--ctl); }
.btn.is-icon.is-sm { width: var(--ctl-sm); }
.btn.is-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.is-busy { color: transparent !important; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(52, 35, 28, .25); border-top-color: var(--dark); animation: spin .7s linear infinite;
}
.btn.is-primary.is-busy::after, .btn.is-ok.is-busy::after { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.btn-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--sex-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.kbd {
  font: 500 11px/16px var(--font); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper); text-align: center; display: inline-block;
}
.btn.is-primary .kbd, .btn.is-ok .kbd { border-color: rgba(255, 255, 255, .45); color: #fff; background: transparent; }

.inp {
  width: 100%; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--paper); color: var(--dark); font-size: 14px; min-width: 0;
}
textarea.inp { height: auto; padding: 9px 12px; line-height: 1.5; resize: none; display: block; }
.inp::placeholder { color: var(--ink-3); opacity: 1; }
.inp:hover { border-color: rgba(52, 35, 28, .32); }
.inp:focus-visible, .inp:focus { outline: none; border-color: var(--sex); box-shadow: 0 0 0 3px var(--sex-soft); }
.inp:disabled { background: var(--skin-2); color: var(--ink-2); }
.inp-row { display: flex; gap: 8px; align-items: center; }
.inp-row > .inp { flex: 1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-h { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; min-height: var(--ctl); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--sex); cursor: pointer; flex: none; }
.radios { display: flex; flex-wrap: wrap; gap: 0 26px; }
.set-sub + .radios { margin-top: -6px; }

.sel, .fchip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--ctl); padding: 0 10px 0 12px; position: relative;
  border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--paper); font-size: 13.5px; white-space: nowrap;
  max-width: 100%;
}
.sel select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0 22px 0 0; margin-right: -20px;
  height: 100%; cursor: pointer; max-width: 260px; text-overflow: ellipsis; min-width: 0; box-sizing: border-box;
}
.sel .ic-down { pointer-events: none; color: var(--ink-3); }
.sel:hover, .fchip:hover { border-color: rgba(52, 35, 28, .34); }
.sel:focus-within { outline: 2px solid var(--sex); outline-offset: 2px; }
.sel select:focus-visible { outline: none; }
.sel.is-on, .fchip[aria-pressed="true"] { border-color: var(--dark); background: var(--skin); font-weight: 500; }
.fchip { padding: 0 12px; cursor: pointer; color: var(--dark); }

.switch {
  width: 40px; height: 24px; border-radius: 12px; border: 0; background: rgba(52, 35, 28, .22); position: relative; flex: none; padding: 0;
  transition: background .15s;
}
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(52, 35, 28, .3); }
.switch[aria-checked="true"] { background: var(--sex); }
.switch[aria-checked="true"] i { transform: translateX(16px); }
.switch:disabled { opacity: .5; }

/* ------------------------------------------------------------------ мелкие элементы */

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; max-width: 100%;
  font-size: 12px; font-weight: 500; line-height: 1; background: var(--fill); color: var(--ink-2); white-space: nowrap; vertical-align: middle;
}
.chip-t { overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.chip.is-tag { background: var(--skin); color: var(--dark); }
.chip.is-plain { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.chip.is-sky { background: var(--sky-soft); color: var(--sky-ink); }
.chip.is-sky-soft { background: transparent; box-shadow: inset 0 0 0 1px rgba(43, 111, 135, .4); color: var(--sky-ink); }
.chip.is-ok { background: var(--ok-soft); color: var(--ok); }
.chip.is-warn { background: var(--warn-soft); color: var(--warn); }
.chip.is-bad { background: var(--bad-soft); color: var(--bad); }
.chip.is-accent { background: var(--sex-soft); color: var(--sex-ink); }
.chip.is-mute { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.chip-a { text-decoration: none; display: inline-flex; max-width: 100%; border-radius: 999px; }
.chip-a:hover .chip { box-shadow: inset 0 0 0 1px currentColor; }

.stage { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; background: var(--fill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.st-found .stage-dot, .dot-found { background: var(--sky); }
.st-fit .stage-dot, .dot-fit { background: #877CA8; }
.st-written .stage-dot, .dot-written { background: #AC4D8E; }
.st-replied .stage-dot, .dot-replied { background: var(--sex); }
.st-agreed .stage-dot, .dot-agreed { background: #8E1B4F; }
.st-published .stage-dot, .dot-published { background: var(--dark); }
.st-later .stage-dot { background: #C9B8AF; }
.st-rejected .stage-dot, .st-archived .stage-dot, .st-filtered .stage-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); }
.st-dnc .stage-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--dark); }

.av {
  display: inline-grid; place-items: center; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  font-weight: 600; letter-spacing: .01em; line-height: 1; user-select: none;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.av.has-img img { opacity: 1; }
.av-0 { background: #FFDCCB; color: #7A3B1E; }
.av-1 { background: #D6EAF1; color: #1F5A70; }
.av-2 { background: #F9D3E3; color: #8F1450; }
.av-3 { background: #EADFD9; color: #4A342B; }
.av-4 { background: #E6DDF0; color: #56407A; }
.av-5 { background: #F3E7C9; color: #6B4E0D; }

.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-track { stroke: rgba(52, 35, 28, .12); }
.ring-arc { stroke: var(--dark); }
.ring.is-high .ring-arc { stroke: var(--sex); }
.ring.is-low .ring-arc, .ring.is-wait .ring-arc { stroke: #B4A198; }
.ring-n { position: relative; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.ring.is-wait .ring-n, .ring.is-none .ring-n, .ring.is-low .ring-n { color: var(--ink-2); }

.quote { background: var(--mark); color: inherit; border-radius: 4px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.bar { height: 6px; border-radius: 3px; background: rgba(52, 35, 28, .10); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--dark); border-radius: 3px; transition: width .4s ease; }

.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(210, 31, 115, .22); border-top-color: var(--sex); animation: spin .8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-m); background: var(--fill); max-width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 500; font-size: 13.5px; color: var(--ink-2); white-space: nowrap;
}
.tab:hover { color: var(--dark); }
.tab[aria-selected="true"] { background: var(--paper); color: var(--dark); font-weight: 600; box-shadow: 0 1px 2px rgba(52, 35, 28, .14); }
.tab-n { font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .tab-n { color: var(--sex-ink); }

.note {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--r-s); background: var(--skin-2);
  font-size: 13px; line-height: 1.45; color: var(--dark);
}
.note > .ic { margin-top: 2px; color: var(--ink-2); }
.note > span { flex: 1; min-width: 0; }
.note > .btn { margin: -3px -4px -3px 0; flex: none; }
.note.is-warn { background: var(--warn-soft); }
.note.is-warn > .ic { color: var(--warn); }
.note.is-bad { background: var(--bad-soft); }
.note.is-bad > .ic { color: var(--bad); }
.note.is-plain { background: transparent; padding: 0; color: var(--ink-2); }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 44px 20px; }
.empty-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--skin); display: grid; place-items: center; color: var(--dark); }
.empty.is-error .empty-ic { background: var(--bad-soft); color: var(--bad); }
.empty-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.empty-text { color: var(--ink-2); max-width: 46ch; line-height: 1.5; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.sk { background: linear-gradient(90deg, rgba(52, 35, 28, .06) 25%, rgba(52, 35, 28, .11) 37%, rgba(52, 35, 28, .06) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.boot { display: grid; gap: 12px; padding: 4px; }
.sk-title { height: 30px; width: 200px; }
.sk-row { height: 36px; width: min(620px, 100%); }
.sk-card { height: 104px; border-radius: var(--r-l); }
.sk-list { display: grid; gap: 8px; }
.sk-item { display: flex; gap: 12px; padding: 14px; background: var(--paper); border-radius: var(--r-l); }
.sk-av { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-av.is-sm { width: 28px; height: 28px; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-l1 { height: 14px; width: 45%; }
.sk-l2 { height: 12px; width: 90%; }
.sk-l3 { height: 12px; width: 70%; }
.sk-rowline { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sk-rowline .sk-l1 { width: 24%; }
.sk-rowline .sk-l2 { width: 40%; }
.sk-block { height: 72px; border-radius: var(--r-m); }

/* ------------------------------------------------------------------ всплывающие строки, меню, окна */

.toasts { position: fixed; left: 50%; bottom: calc(20px + var(--tabbar)); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 14px; border-radius: 14px;
  background: var(--dark); color: #fff; font-size: 13.5px; line-height: 1.4; box-shadow: var(--shadow-float);
  max-width: min(600px, calc(100vw - 24px)); animation: toast-in .18s ease;
}
.toast.is-error { background: #8C1D17; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .16s, transform .16s; }
.toast-t { flex: 1; min-width: 0; }
.toast-a { background: rgba(255, 255, 255, .16); border: 0; color: #fff; font-weight: 600; font-size: 13px; padding: 0 12px; height: 30px; border-radius: 8px; white-space: nowrap; flex: none; }
.toast-a:hover { background: rgba(255, 255, 255, .26); }
.toast-x { background: none; border: 0; color: rgba(255, 255, 255, .8); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.toast-x:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.toast :focus-visible { outline-color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
/* на десктопе строка встаёт слева внизу, над списком: кнопки решения в панели справа остаются свободными */
@media (min-width: 861px) {
  .toasts {
    left: var(--content-x, 260px); bottom: 20px; transform: none; justify-items: start;
    max-width: min(540px, calc((100vw - var(--content-x, 260px) - 30px) * 5 / 11));
  }
  .toast { max-width: 100%; }
}
@media (max-width: 1180px) and (min-width: 861px) { :root { --content-x: 92px; } }

.pop-wrap { position: fixed; inset: 0; z-index: 90; }
.pop-back { position: absolute; inset: 0; }
.pop { position: fixed; min-width: 232px; max-width: min(340px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; background: var(--paper); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-float); }
.pop-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 10px 6px; }
.pop-group { font-size: 12px; color: var(--ink-3); padding: 8px 10px 4px; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 14px; }
.pop-item:hover, .pop-item:focus-visible { background: var(--skin); outline: none; }
.pop-item .ic { color: var(--ink-2); }
.pop-label { flex: 1; min-width: 0; display: grid; }
.pop-hint { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.pop-item.is-checked { font-weight: 600; }
.pop-item.is-checked .ic-check { color: var(--sex); }
.pop-item.is-danger { color: var(--bad); }
.pop-wrap.is-sheet .pop-back { background: rgba(52, 35, 28, .38); }
.pop-wrap.is-sheet .pop { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); top: auto; max-width: none; border-radius: 20px; padding: 8px; max-height: 80vh; animation: sheet-in .2s ease; }
.pop-wrap.is-sheet .pop-item { min-height: 50px; font-size: 16px; padding: 8px 12px; }
.pop-wrap.is-sheet .pop-title { font-size: 13px; padding: 10px 12px 6px; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

.dlg-back { position: fixed; inset: 0; z-index: 100; background: rgba(52, 35, 28, .40); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--paper); border-radius: var(--r-xl); padding: 22px; width: min(460px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow-float); max-height: calc(100dvh - 32px); overflow-y: auto; }
.dlg-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.dlg-text { color: var(--ink-2); line-height: 1.5; }
.dlg-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ------------------------------------------------------------------ общие части экранов */

.screen { display: grid; gap: 12px; align-content: start; }
.card { background: var(--paper); border-radius: var(--r-l); padding: 16px 20px; min-width: 0; }
.page-card { background: var(--paper); border-radius: var(--r-xl); padding: 16px 20px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.page-title { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.page-lead { color: var(--ink-2); font-size: 14px; flex: 1 1 260px; min-width: 0; }
.page-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-title { flex: 1 0 auto; max-width: 100%; }
.card-head .card-sub { flex: 0 1 auto; min-width: 0; text-align: right; }
.base-scope { margin: 0 0 12px; }
.card-sub { color: var(--ink-2); font-size: 13px; }
.muted { color: var(--ink-2); }

.filters { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.sel.is-sort { margin-left: auto; }
.filters-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.search {
  display: flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px; flex: 0 1 200px; min-width: 160px;
  border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--paper); color: var(--ink-2);
}
.search:focus-within { border-color: var(--sex); box-shadow: 0 0 0 3px var(--sex-soft); }
.search .inp, .search-inp { border: 0; box-shadow: none !important; padding: 0; height: 100%; background: transparent; }
.search-inp::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ------------------------------------------------------------------ очередь */

.screen.queue { height: 100%; grid-template-rows: auto minmax(0, 1fr); }
.split { display: grid; grid-template-columns: minmax(340px, 5fr) minmax(400px, 6fr); gap: 12px; min-height: 0; }
.queue.is-empty .split { grid-template-columns: 1fr; }
.list-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.list-bar { display: flex; align-items: center; gap: 10px; padding: 0 6px 8px 0; color: var(--ink-2); font-size: 13px; flex: none; min-height: 30px; }
.list-all { display: grid; place-items: center; width: 34px; height: 30px; cursor: pointer; flex: none; }
.list-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-selmode { display: none; }
.keys { margin-left: auto; display: flex; gap: 10px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.keys-i { display: inline-flex; gap: 4px; align-items: center; }
.list-wait:empty { display: none; }
.list-wait { padding: 0 6px 8px 0; flex: none; }
.list-wait .note { background: var(--paper); }
.list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 6px 6px 2px; margin: -2px 0 0 -2px; overscroll-behavior: contain; }
.list-state { background: var(--paper); border-radius: var(--r-l); }
.list-state .sk-list { padding: 4px; }
.list-state .sk-item { padding: 12px; }
.list-more { display: grid; justify-items: center; padding: 6px 0 10px; flex: none; }
.list-more:empty { display: none; }
.list-loading { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 13px; padding: 8px; }

.qc { display: grid; grid-template-columns: 34px minmax(0, 1fr); background: var(--paper); border-radius: var(--r-l); flex: none; overflow: hidden; box-shadow: inset 0 0 0 1px transparent; transition: max-height .18s ease, opacity .16s ease, margin .18s ease; }
.qc:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.qc.is-sel { box-shadow: inset 0 0 0 2px var(--sex); }
.qc.is-checked { background: var(--skin-2); }
.qc.is-leaving { opacity: 0; margin-bottom: -8px; pointer-events: none; }
.qc-check { display: grid; place-items: start center; padding-top: 24px; cursor: pointer; }
.qc-open { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px 12px 0; border-radius: var(--r-l); min-width: 0; }
.qc-open:focus-visible { outline-offset: -3px; border-radius: var(--r-l); }
.qc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qc-id { flex: 1; min-width: 0; display: grid; gap: 2px; }
.qc-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 1px 10px; color: var(--ink-2); font-size: 12.5px; min-width: 0; }
.qc-handle { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; }
.qc-num { display: inline-flex; align-items: center; gap: 4px; flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qc-price { color: var(--dark); font-weight: 500; }
.qc-why { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 9px; font-size: 13.5px; line-height: 1.45; }
.qc-why.is-wait { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.qc-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.qc-tags, .qc-flags { display: contents; }

.bulk { position: absolute; left: 0; right: 10px; bottom: 8px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--dark); color: #fff; border-radius: 16px; box-shadow: var(--shadow-float); }
.bulk-n { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; gap: 6px; margin-left: auto; justify-content: flex-end; min-width: 0; }
.bulk .btn.is-ghost > .ic { display: none; }
.bulk-actions .btn { padding: 0 12px; }
.bulk .btn.is-ghost { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.bulk .btn.is-ghost:hover { background: rgba(255, 255, 255, .24); }
.bulk .btn.is-quiet { color: rgba(255, 255, 255, .85); }
.bulk .btn.is-quiet:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.bulk :focus-visible { outline-color: #fff; }
.has-bulk .list { padding-bottom: 72px; }

/* ------------------------------------------------------------------ панель карточки */

.panel-host { min-width: 0; min-height: 0; }
.panel-host.is-hidden { display: none; }
.panel { display: none; flex-direction: column; background: var(--paper); border-radius: var(--r-xl); height: 100%; min-height: 0; overflow: hidden; }
.panel.is-open { display: flex; }
.panel:focus-visible { outline: none; }
.p-bar { display: none; align-items: center; gap: 8px; padding: 8px 8px 0 12px; flex: none; }
.p-back { display: none; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 6px; border: 0; background: none; font-weight: 500; border-radius: 10px; }
.p-pos { flex: 1; text-align: center; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.p-barnav { display: flex; gap: 2px; margin-left: auto; }
.p-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 24px; overscroll-behavior: contain; }
.p-foot { flex: none; display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.p-foot .btn { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
.p-foot .d-yes { flex: 1.5 1 auto; }
.foot-seed { display: flex; align-items: center; gap: 12px; cursor: pointer; flex: 1; }
.foot-seed span { display: grid; line-height: 1.3; }
.foot-seed small { color: var(--ink-2); }

.panel.is-overlay { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(580px, calc(100vw - 24px)); height: auto; z-index: 60; box-shadow: var(--shadow-float); }
.panel.is-overlay .p-bar { display: flex; }
.panel.is-overlay .p-pos { text-align: left; }

.p-head { display: flex; gap: 14px; align-items: flex-start; }
.p-id { flex: 1; min-width: 0; }
.p-name { display: flex; align-items: flex-start; gap: 6px; font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
.p-name-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-width: 0; }
.p-ver { color: var(--sky-ink); flex: none; margin-top: 3px; }
.p-sub { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-top: 4px; min-width: 0; font-size: 13.5px; }
.handle { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 500; flex: 0 1 auto; }
a.handle:hover { color: var(--dark); text-decoration: underline; }
.p-cat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1000 auto; min-width: 0; padding-left: 8px; border-left: 1px solid var(--line-2); margin-left: 2px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.p-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.p-tabs { margin: 16px 0 4px; }
.p-body { padding-top: 10px; }
.p-sec { margin-top: 22px; }
.p-sec:first-child { margin-top: 0; }
.p-sec-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px; }
.p-sec-x { font-weight: 400; color: var(--ink-3); text-align: right; }

.why { background: var(--skin); border-radius: var(--r-l); padding: 4px 16px; --mark: #FFD2BD; }
.why-row { padding: 12px 0; display: grid; gap: 5px; }
.why-row + .why-row { border-top: 1px solid rgba(52, 35, 28, .09); }
.why-row .btn { justify-self: start; margin-top: 4px; }
.why-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.why-t { font-size: 14.5px; line-height: 1.52; }
.why-row.is-risk .why-k { color: var(--warn); }
.why-row.is-line { grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 10px 0; }
.why-row.is-line .why-t { font-size: 13.5px; }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; }
.kv dt { color: var(--ink-2); font-size: 13px; padding-top: 1px; }
.kv dd { line-height: 1.5; }
.kv dd.is-caution { color: var(--warn); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--skin-2); border-radius: var(--r-m); padding: 10px 12px; min-width: 0; }
.tile-v { font-size: 18px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-l { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.3; }
.tile-s { font-size: 12px; color: var(--ink-3); line-height: 1.3; }

.parts { display: grid; gap: 9px; }
.part { display: grid; grid-template-columns: 112px minmax(0, 1fr) 68px; align-items: center; gap: 12px; font-size: 13px; }
.part-l { color: var(--dark); }
.part-bar i { background: var(--sex); }
.part.is-wait .part-bar { background: repeating-linear-gradient(90deg, rgba(52, 35, 28, .14) 0 4px, transparent 4px 8px); }
.part-v { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.part-v b { color: var(--dark); }
.part-notes { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.part-note.is-minus b { color: var(--bad); }

.price { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 12px; }
.price-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-b { color: var(--ink-2); font-size: 13px; }
.price-o { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.45; }
.price-o b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-n { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.contact { display: grid; gap: 8px; }
.contact-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border-radius: var(--r-m); background: var(--skin-2); min-width: 0; }
.contact-e { font-weight: 600; flex: 1 1 180px; min-width: 0; }
.contact-row:not(.is-main) .contact-e { font-weight: 400; }
.contact-m { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.contact-s { color: var(--ink-2); font-size: 12.5px; }
.contact-none { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-m); background: var(--skin-2); }
.contact-none .ic { color: var(--ink-2); margin-top: 2px; }
.contact-none p { color: var(--ink-2); font-size: 13px; margin-top: 2px; line-height: 1.45; }
.contact-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.posts { display: grid; }
.post { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.post:first-child { border-top: 0; padding-top: 0; }
.post-m { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); grid-column: 1; }
.post-p { display: inline-flex; align-items: center; gap: 4px; color: var(--dark); font-weight: 600; font-variant-numeric: tabular-nums; }
.post-c { grid-column: 1; font-size: 13.5px; line-height: 1.45; }
.post-a { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; text-decoration: none; padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.post-a:hover { background: var(--sex-soft); }

.prof { display: grid; gap: 10px; }
.bio { white-space: pre-line; line-height: 1.5; padding-left: 12px; border-left: 2px solid var(--skin-3); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 13px; }
.links { display: grid; gap: 2px; justify-items: start; }
.lnk { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 0; text-decoration: none; }
.lnk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lnk:hover span { text-decoration: underline; }
.lnk .ic { color: var(--ink-2); }

.marks { display: grid; gap: 8px; }
.mark-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.mark-k { color: var(--ink-2); font-size: 13px; }
.mark-v { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

.hist { display: grid; position: relative; padding-left: 18px; }
.hist::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.hist-i { position: relative; padding: 8px 0; }
.hist-i::before { content: ''; position: absolute; left: -18px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-3); }
.hist-i:first-child::before { box-shadow: none; background: var(--sex); }
.hist-t { line-height: 1.45; }
.hist-m { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* ------------------------------------------------------------------ сообщение */

.msg { display: grid; gap: 12px; min-width: 0; }
.msg-to { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.msg-k { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.msg-addr { font-weight: 600; min-width: 0; }
.msg-body { min-height: 120px; }
.msg-under { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); min-height: 18px; }
.msg-meter.is-over { color: var(--warn); }
.msg-state.is-saved { color: var(--ok); }
.msg-state.is-error { color: var(--bad); }
textarea.msg-subj { padding: 7px 12px; line-height: 20px; min-height: var(--ctl); }   /* одна строка — той же высоты, что обычное поле */
.msg-name { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.msg-name:empty { display: none; }
.msg-name b { color: var(--dark); font-weight: 600; }
.msg-warns { display: grid; gap: 8px; }
.msg-warns:empty { display: none; }
.msg-send { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-finish { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.msg-donehint { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.msg.is-opened .msg-donehint { color: var(--dark); font-weight: 500; }
.msg-done { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.msg-bar { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.msg-barline { display: grid; gap: 10px; }
@media (min-width: 861px) {
  /* строка действий остаётся на виду, пока письмо прокручивается */
  .msg.is-queue .msg-bar {
    position: sticky; bottom: 0; z-index: 3; background: var(--paper);
    margin: 0 -20px -20px; padding: 12px 20px 16px; border-radius: 0 0 var(--r-l) var(--r-l);
    box-shadow: 0 -10px 16px -14px rgba(52, 35, 28, .28);
  }
  /* строка про имя — над письмом: под длинным текстом её не видно без прокрутки (на телефоне она под письмом, рядом с кнопками) */
  .msg .field > .field-l { order: -2; }
  .msg .field > .msg-name { order: -1; }
  .msg-barline { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 16px; }
  .msg-barline .msg-done { flex: none; }
  .msg-barline .msg-donehint { flex: 1 1 0; min-width: 0; font-size: 12.5px; }
}
.msg.is-regen .msg-body, .msg.is-regen .msg-subj, .msg.is-regen input.inp { background: linear-gradient(90deg, var(--skin-2) 25%, var(--skin) 37%, var(--skin-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; color: var(--ink-3); }
.msg-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-sentline { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; font-size: 13.5px; }
.msg-read { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; font-size: 13.5px; }
.msg-read dt { color: var(--ink-2); }
.msg-text { white-space: pre-wrap; line-height: 1.55; padding: 12px 14px; border-radius: var(--r-m); background: var(--skin-2); font-size: 14px; }
.msg-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ узкий ноутбук: меню сворачивается в значки */

@media (max-width: 1180px) and (min-width: 861px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .side { padding: 12px 8px; align-items: center; }
  .brand { padding: 4px 0 14px; }
  .brand-logo { width: 34px; height: 34px; object-fit: cover; object-position: left center; }
  .brand-name, .nav-l, .buds, .me-t { display: none; }
  .nav { width: 100%; }
  .nav-i { justify-content: center; padding: 0; position: relative; height: 44px; }
  .nav-n { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10.5px; }
  .nav-sep { margin: 8px 10px; }
  .me { padding: 8px 0 0; justify-content: center; }
  .keys { display: none; }
}

/* ------------------------------------------------------------------ телефон */

@media (max-width: 860px) {
  :root { --ctl: 44px; --ctl-sm: 44px; --ctl-lg: 52px; --tabbar: calc(62px + env(safe-area-inset-bottom)); }
  html, body { height: auto; }
  body { font-size: 15px; }
  .app { display: block; height: auto; min-height: 100dvh; padding: 0 0 calc(var(--tabbar) + 12px); }
  .side { display: none; }
  .work { display: block; }
  .top { position: sticky; top: 0; z-index: 30; background: var(--skin); height: 52px; padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .top-brand img { height: 26px; width: auto; }
  .top-title { font-size: 18px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-counters { display: none; }
  .top-job { max-width: 60%; }
  .jobpill { padding: 0 12px 0 10px; }
  .jobpill-t b { display: none; }
  .main { overflow: visible; border-radius: 0; padding: 0 12px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: var(--tabbar); padding: 4px 4px env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line);
  }
  .tb-i { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; background: none; border: 0; color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 12px; padding: 0; -webkit-tap-highlight-color: transparent; }
  .tb-ic { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
  .tb-i[aria-current="page"] { color: var(--dark); font-weight: 600; }
  .tb-i[aria-current="page"] .tb-ic { background: var(--skin); }
  .tb-n { position: absolute; top: -3px; left: 30px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--dark); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .tb-n.is-accent { background: var(--sex); }
  .tb-l { white-space: nowrap; }

  .inp, .sel, .fchip, .search { font-size: 16px; }
  .sel select { font-size: 16px; max-width: 60vw; }
  .btn { font-size: 15px; }
  .btn.is-sm { font-size: 14px; padding: 0 12px; border-radius: var(--r-s); }
  .btn.is-icon.is-sm { width: 44px; padding: 0; }
  .tab { height: 44px; font-size: 14.5px; padding: 0 14px; }
  .tabs { padding: 4px; border-radius: 14px; }
  .tab { border-radius: 10px; }
  /* переключатель: дорожка 52×30 внутри зоны нажатия 52×44 */
  .switch { width: 52px; height: 44px; background: transparent; border-radius: 16px; }
  .switch::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 30px; border-radius: 15px; background: rgba(52, 35, 28, .22); transition: background .15s; }
  .switch[aria-checked="true"] { background: transparent; }
  .switch[aria-checked="true"]::before { background: var(--sex); }
  .switch i { top: 10px; left: 3px; width: 24px; height: 24px; }
  .switch[aria-checked="true"] i { transform: translateX(22px); }
  /* ссылки в строке: высота зоны 44 без сдвига вёрстки */
  a.handle, .lnk, .path-a { padding-top: 13px; padding-bottom: 13px; margin-top: -13px; margin-bottom: -13px; }
  .chip-a { padding-top: 10px; padding-bottom: 10px; margin-top: -10px; margin-bottom: -10px; }
  .post-a { min-height: 44px; min-width: 44px; padding: 0 10px; }
  .kbd, .keys { display: none; }
  .check { min-height: 44px; }
  input[type="checkbox"] { width: 22px; height: 22px; }

  .page-card, .card { border-radius: var(--r-l); padding: 14px; }
  .page-title { display: none; }
  .page-head .tabs { width: 100%; }
  .page-head .tabs .tab { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: 13.5px; justify-content: center; }
  .base-scope .tabs { width: 100%; }
  .base-scope .tabs .tab { flex: 1 1 auto; min-width: 0; padding: 0 6px; font-size: 13px; gap: 4px; justify-content: center; }
  .filters { display: grid; gap: 8px; margin-top: 10px; }
  .search { flex: none; width: 100%; }
  .filters-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filters-row::-webkit-scrollbar { display: none; }
  .filters-row > * { flex: none; }
  .sel.is-sort { margin-left: 0; }

  .screen.queue { height: auto; display: grid; grid-template-rows: none; }
  .split { display: block; }
  .list-col { display: block; }
  .list { overflow: visible; padding: 0; margin: 0; }
  .list-bar { padding: 2px 2px 8px; min-height: 44px; }
  .list-all { display: none; }
  .is-selecting .list-all { display: grid; width: 44px; height: 44px; margin-left: -8px; }
  .list-selmode { display: inline-flex; margin-left: auto; }
  .qc { grid-template-columns: minmax(0, 1fr); }
  .qc-check { display: none; }
  .is-selecting .qc { grid-template-columns: 44px minmax(0, 1fr); }
  .is-selecting .qc-check { display: grid; padding-top: 20px; }
  .qc-open { padding: 12px 14px; }
  .is-selecting .qc-open { padding-left: 0; }
  .qc-name { font-size: 15.5px; }
  .qc-sub { font-size: 13px; }
  .qc-why { font-size: 14.5px; }
  .chip { height: 24px; font-size: 12.5px; }
  .bulk { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar) + 8px); z-index: 45; flex-wrap: wrap; padding: 10px; }
  .bulk-actions { margin-left: 0; width: 100%; order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .bulk-n { flex: 1; padding-left: 6px; }
  .has-bulk .list { padding-bottom: 130px; }

  .panel, .panel.is-overlay { position: fixed; inset: 0; width: auto; height: auto; z-index: 60; border-radius: 0; box-shadow: none; }
  .p-bar, .panel.is-overlay .p-bar { display: flex; padding: 4px 4px 0; padding-top: calc(4px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
  .p-back { display: inline-flex; }
  .p-close { display: none; }
  .p-pos, .panel.is-overlay .p-pos { text-align: center; }
  .p-scroll { padding: 16px 16px 24px; }
  .p-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .p-foot .btn { padding: 0 8px; font-size: 15px; }
  .p-foot .d-no .ic, .p-foot .d-later .ic { display: none; }
  .p-name { font-size: 19px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part { grid-template-columns: 104px minmax(0, 1fr) 62px; gap: 10px; }
  .why-t { font-size: 15.5px; }
  .kv, .mark-row, .why-row.is-line { grid-template-columns: 84px minmax(0, 1fr); }
  /* контакт: адрес и «скопировать» — одной строкой, вид адреса и источник — под ними */
  .contact-e { flex: 1 1 0; }
  .contact-row > .btn.is-icon { order: 1; }
  .contact-m { order: 2; flex: 1 1 100%; }
  .contact-row > .btn:not(.is-icon) { order: 3; }
  .p-tabs { display: flex; }
  .p-tabs .tab { flex: 1; }
  html.panel-open { overflow: hidden; }
  html.panel-open .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .toast { font-size: 14.5px; }
  .toast-a, .toast-x { height: 44px; min-width: 44px; }
  .msg-send .btn, .msg-done .btn { flex: 1 1 auto; }
  .gate { padding: 28px 22px; }
  .gate-title { font-size: 24px; }
}

@media (hover: none) { .kbd, .keys { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .sk { animation: none; }
}

/* ================================================================== экраны: воронка, письма, база, поиск, настройки, справка */

.btn.is-off { opacity: .5; pointer-events: none; }
.inp.is-bad { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.inp-unit { display: flex; align-items: center; gap: 8px; }
.inp-unit .inp { flex: 1; }
.inp-unit > span { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.card-text { color: var(--ink-2); line-height: 1.5; max-width: 74ch; margin-bottom: 14px; }
.card-head + .card-text { margin-top: -6px; }
.card > .card-text:last-child, .card > div > .card-text:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ воронка */

.screen.board { height: 100%; grid-template-rows: auto minmax(0, 1fr); }
.board-crumb { font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.board-tip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.board-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 14px -8px -4px; }
.board-tab { display: grid; gap: 1px; justify-items: start; text-align: left; padding: 6px 8px; border: 0; border-left: 1px solid var(--line); background: none; border-radius: 0; min-width: 0; }
.board-tab:first-child { border-left: 0; }
.board-tab:hover b { color: var(--sex-ink); }
.board-tab b { font-size: 22px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.board-tab span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.board-scroll { min-height: 0; overflow-x: auto; overflow-y: hidden; border-radius: 18px; }
.board-grid { display: grid; grid-template-columns: repeat(6, minmax(178px, 1fr)); gap: 8px; height: 100%; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: rgba(255, 255, 255, .5); border-radius: 18px; padding: 6px; transition: background .12s, box-shadow .12s; }
.col.is-drop { background: var(--sex-soft); box-shadow: inset 0 0 0 2px var(--sex); }
.col.is-flash { box-shadow: inset 0 0 0 2px var(--dark); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 8px 6px 10px 8px; flex: none; }
.col-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-n { font-size: 12.5px; font-weight: 600; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--paper); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.col-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.bc-wrap { flex: none; border-radius: 14px; }
.bc-wrap.is-dragging { opacity: .45; }
.bc { display: grid; gap: 2px; width: 100%; text-align: left; background: var(--paper); border: 0; border-radius: 14px; padding: 9px 12px 10px; box-shadow: inset 0 0 0 1px transparent; min-width: 0; }
.bc:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.bc:focus-visible { outline-offset: -3px; border-radius: 14px; }
.bc-wrap.is-sel .bc { box-shadow: inset 0 0 0 2px var(--sex); }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.bc-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-name { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-handle { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.bc-next { display: flex; align-items: flex-start; gap: 6px; margin-top: 7px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.bc-next .ic { margin-top: 1px; }
.bc-next.is-mine { color: var(--dark); font-weight: 500; }
.bc-next.is-mine .ic { color: var(--sex); }
.bc-sk { height: 108px; border-radius: 14px; flex: none; }
.col-empty { display: grid; justify-items: start; gap: 4px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .6); color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.col-empty b { color: var(--dark); font-size: 13.5px; }
.col-empty .ic { color: var(--ink-3); }
.col-empty .btn { margin-top: 6px; }
.col-more { display: grid; justify-items: center; padding: 4px 0 8px; flex: none; }
.col-state { display: grid; gap: 8px; justify-items: start; }

/* ------------------------------------------------------------------ письма */

.letters-view { display: grid; gap: 12px; align-content: start; }
.letters-sub { margin-top: 12px; }
.lt-card { padding: 6px 12px 8px; }
.lt-head, .lt-open { display: grid; grid-template-columns: minmax(170px, 1.3fr) 104px minmax(130px, 1.2fr) minmax(150px, 2fr) minmax(140px, 1fr); gap: 12px; align-items: center; }
.lt-head { padding: 10px 50px 10px 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); }
.lt-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.lt-row:last-child { border-bottom: 0; }
.lt-open { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 10px 8px; border-radius: 10px; }
.lt-open:hover { background: var(--skin-2); }
.lt-open:focus-visible { outline-offset: -2px; }
.lt-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lt-id { display: grid; min-width: 0; }
.lt-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-handle { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-ch { min-width: 0; }
.lt-to { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-to.is-none { color: var(--warn); }
.lt-subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-kind { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.lt-state { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.lt-when { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.lt-act { flex: none; }

.sq-title { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.sq-back { margin-left: -8px; }
.sq-nav { display: flex; gap: 6px; margin-left: auto; }
.sq-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.sq-bar { flex: 1; max-width: 380px; }
.sq-bar i { background: var(--sex); }
.sq-done { font-size: 13px; color: var(--ink-2); }
.sq-top .note { margin-top: 10px; }
.sq-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.sq-main { min-width: 0; }
.sq-card { padding: 20px; }
.sq-to { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sq-kind { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.msg.is-queue .msg-addr { font-size: 17px; letter-spacing: -.01em; }
.msg.is-queue .msg-body { font-size: 15px; line-height: 1.55; }
.msg.is-queue .msg-text { font-size: 15px; }
.sq-side { display: grid; gap: 14px; position: sticky; top: 0; }
.sq-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sq-id { flex: 1; min-width: 0; }
.sq-name { font-weight: 600; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-handle { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 13px; min-width: 0; margin-top: 2px; }
.sq-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.sq-facts dt { color: var(--ink-2); }
.sq-facts dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.sq-why p { font-size: 13.5px; line-height: 1.5; margin-top: 4px; }
.sq-why.is-risk .why-k { color: var(--warn); }
.empty.is-done .empty-ic { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------------ база и проверка ников */

.nc { display: grid; gap: 10px; }
.nc-text { min-height: 78px; }
.nc-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nc-hint { color: var(--ink-2); font-size: 12.5px; margin-left: 4px; }
.nc-out { display: grid; gap: 10px; }
.nc-out:empty { display: none; }
.nc-sum { display: flex; gap: 4px 20px; flex-wrap: wrap; color: var(--ink-2); padding-top: 4px; }
.nc-sum-i b { color: var(--dark); font-size: 17px; font-variant-numeric: tabular-nums; }
.nc-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.nc-row { display: grid; grid-template-columns: minmax(150px, 1fr) 152px minmax(0, 2fr) auto; gap: 12px; align-items: center; padding: 7px 8px 7px 12px; border-top: 1px solid var(--line); min-height: 46px; }
.nc-row:first-child { border-top: 0; }
.nc-row.is-new { background: #F5FBF8; }
.nc-acc { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.nc-status { min-width: 0; }
.nc-where { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 13px; min-width: 0; }
.nc-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.nc-cost { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

.tb-card { padding-bottom: 8px; }
.tb-card .filters { margin: 0 0 8px; }
.tb-head, .tb-open { display: grid; grid-template-columns: minmax(190px, 1.6fr) 92px 48px 136px minmax(130px, 1.4fr) minmax(110px, 1.2fr); gap: 12px; align-items: center; }
.tb-head { padding: 10px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.tb-row { border-bottom: 1px solid var(--line); }
.tb-row:last-child { border-bottom: 0; }
.tb-open { width: 100%; background: none; border: 0; text-align: left; padding: 8px; border-radius: 10px; min-width: 0; }
.tb-open:hover { background: var(--skin-2); }
.tb-open:focus-visible { outline-offset: -2px; }
.tb-row.is-sel .tb-open { background: var(--skin); }
.tb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-id { display: grid; min-width: 0; }
.tb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-handle { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12.5px; min-width: 0; }
.tb-handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-marks { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tb-contact { min-width: 0; font-size: 13px; }
.tb-mail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-more { display: grid; justify-items: center; padding: 10px 0 4px; }
.tb-more:empty { display: none; }

/* ------------------------------------------------------------------ поиск */

.search-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr); gap: 12px; align-items: start; }
.search-side { display: grid; gap: 12px; min-width: 0; }
.find-search { flex: none; margin-bottom: 10px; }
.find-out { margin-bottom: 12px; }
.find-out:empty { display: none; }
.find { display: grid; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.find-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); min-width: 0; flex-wrap: wrap; }
.find-row:first-child { border-top: 0; }
.find-row .seed-id { flex: 1 1 140px; }
.seeds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.seed { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 0; }
.seed.is-off .seed-open { opacity: .55; }
.seed-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 6px; border-radius: 10px; }
.seed-open:hover { background: var(--skin-2); }
.seed-id { display: grid; min-width: 0; flex: 1; }
.seed-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seed-sub { display: flex; gap: 8px; color: var(--ink-2); font-size: 12.5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.seed-sub span { flex: none; }
.seed-sub span:first-child { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.seeds-toggle { margin-top: 6px; }
.params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.launch-note { margin: 12px 0; }
.launch-info { display: grid; gap: 4px; color: var(--ink-2); font-size: 13px; line-height: 1.45; padding-left: 16px; list-style: disc; }
.job-card { box-shadow: inset 0 0 0 2px var(--sex-soft); }
.job-bar { margin-bottom: 12px; }
.job-bar i { background: var(--sex); }
.job-steps { display: grid; gap: 8px; }
.job-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.job-step .ic { color: var(--ok); margin-top: 2px; }
.job-step .spin { margin-top: 2px; }
.job-step-t { display: grid; min-width: 0; }
.job-step-t span { color: var(--ink-2); }
.job-step.is-done .job-step-t b { font-weight: 500; }
.job-cost { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.hr-head, .hr-row { display: grid; grid-template-columns: minmax(170px, 1.7fr) repeat(4, minmax(60px, .6fr)) minmax(76px, .7fr) 118px; gap: 12px; align-items: center; }
.hr-head { padding: 10px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.hr-row { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.hr-row:last-child { border-bottom: 0; }
.hr-when { display: grid; min-width: 0; }
.hr-when span { color: var(--ink-2); font-size: 12.5px; }
.hr-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-note { grid-column: 1 / -1; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }

/* ------------------------------------------------------------------ настройки */

.set-layout { display: grid; grid-template-columns: 216px minmax(0, 780px); gap: 12px; align-items: start; }
.set-nav { display: grid; gap: 2px; background: var(--paper); border-radius: var(--r-l); padding: 8px; position: sticky; top: 0; }
.set-nav-i { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--dark); text-decoration: none; font-weight: 500; white-space: nowrap; }
.set-nav-i .ic { color: var(--ink-2); }
.set-nav-i:hover { background: var(--skin-2); }
.set-nav-i[aria-current] { background: var(--skin); font-weight: 600; }
.set-nav-i[aria-current] .ic { color: var(--dark); }
.set-body { display: grid; gap: 12px; min-width: 0; }
.set-card { padding: 20px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; align-items: start; }
.set-grid.is-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: calc((100% - 32px) * 2 / 3 + 16px); }
.pair-note { align-self: end; min-height: var(--ctl); display: flex; align-items: center; color: var(--ink-2); font-size: 13.5px; }
.set-grid + .set-stack, .set-stack + .set-grid { margin-top: 14px; }
.set-card > .note + .set-stack, .set-card > .note + .set-grid, .set-card > .note + .set-sub { margin-top: 14px; }
.set-card > .set-stack + .note, .set-card > .set-grid + .note { margin-top: 14px; }
/* выбор внутри поля формы — во всю ширину, стрелка у правого края */
.field > .sel { display: flex; width: 100%; }
.field > .sel select { flex: 1 1 auto; width: 100% !important; max-width: none; }
.set-stack { display: grid; gap: 14px; }
.set-sub { font-size: 13.5px; font-weight: 600; margin: 20px 0 10px; }
.card-text + .set-sub { margin-top: 4px; }
.save-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.save-state { font-size: 13px; color: var(--ink-2); }
.save-state:empty { display: none; }
.save-state.is-bad { color: var(--bad); }
.save-state.is-ok { color: var(--ok); }
.set-details { border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 0 14px; }
.set-details summary { cursor: pointer; padding: 12px 0; font-weight: 500; min-height: 44px; }
.set-details[open] { padding-bottom: 14px; }
.set-details-body > .field-h { margin-top: 10px; }
.set-switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin-bottom: 16px; }
.set-switch > span { display: grid; gap: 2px; }
.set-switch small { color: var(--ink-2); line-height: 1.4; font-size: 13px; }
.sched-line { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--skin-2); line-height: 1.45; }
.set-list { display: grid; gap: 8px; padding-left: 18px; list-style: disc; line-height: 1.5; }
.chans { display: grid; }
.chan { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.chan:last-child { padding-bottom: 2px; }
.chan-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--skin); display: grid; place-items: center; }
.chan-t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.chan p { line-height: 1.5; max-width: 68ch; }
.chan p + p { margin-top: 6px; color: var(--ink-2); }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.meter { background: var(--skin-2); border-radius: var(--r-m); padding: 14px; display: grid; gap: 6px; min-width: 0; }
.meter-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.meter-v b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.meter-v span { color: var(--ink-2); }
.meter .bar i { background: var(--sex); }
.meter.is-over .bar i { background: var(--bad); }
.meter-s { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.meter.is-over .meter-s { color: var(--bad); }
.sp-head, .sp-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px 84px; gap: 12px; align-items: center; }
.sp-head { padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.sp-row { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.sp-row:last-child { border-bottom: 0; }
.sp-what { display: grid; min-width: 0; }
.sp-what span { color: var(--ink-2); font-size: 12.5px; }
.sp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp + .card-text { margin: 10px 0 0; }
.set-hint { margin-top: 4px; max-width: 78ch; }
/* «Что получится»: описание аккаунта, вилка и сумма для письма — тремя ровными столбцами */
.price-ex {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--r-m); background: var(--skin-2);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 22px; align-items: baseline; font-size: 13.5px; line-height: 1.4;
}
.price-ex:empty { display: none; }
.price-ex-t { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.price-ex-row { display: contents; }
.price-ex-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-ex-row > b { text-align: right; }
.price-ex-o { color: var(--ink-2); white-space: nowrap; }
.price-ex-o b { color: var(--dark); }
.users { display: grid; }
.user { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.user:first-child { border-top: 0; padding-top: 0; }
.user.is-off .user-id, .user.is-off .av { opacity: .55; }
.user-id { flex: 1 1 200px; min-width: 0; }
.user-n { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.user-s { display: flex; gap: 2px 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 12.5px; }
.users-box { scroll-margin-top: 84px; }
.link-box { background: var(--sex-soft); border-radius: var(--r-m); padding: 14px; display: grid; gap: 10px; margin-bottom: 16px; justify-items: start; }
.link-box .inp-row { width: 100%; }
.link-t { font-weight: 600; }
.link-h { font-size: 13.5px; line-height: 1.45; }

/* ------------------------------------------------------------------ как это работает */

.how-lead { font-size: 16px; line-height: 1.5; max-width: 70ch; margin-top: 8px; }
.how-card { padding: 20px; }
.path { display: grid; }
.path-step { display: grid; grid-template-columns: 208px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 28px; padding: 18px 0; border-top: 1px solid var(--line); }
.path-step:first-child { border-top: 0; padding-top: 4px; }
.path-step:last-child { padding-bottom: 4px; }
.path-head { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; align-content: start; }
.path-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--dark); font-weight: 600; font-size: 14px; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; }
.pn-found { box-shadow: inset 0 0 0 3px var(--sky); }
.pn-fit { box-shadow: inset 0 0 0 3px #877CA8; }
.pn-written { box-shadow: inset 0 0 0 3px #AC4D8E; }
.pn-replied { box-shadow: inset 0 0 0 3px var(--sex); }
.pn-agreed { box-shadow: inset 0 0 0 3px #8E1B4F; }
.path-t { font-size: 16px; font-weight: 600; line-height: 1.3; align-self: end; }
.path-a { grid-column: 2; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; text-decoration: none; justify-self: start; min-height: 22px; }
.path-a:hover { text-decoration: underline; }
.path-col p { line-height: 1.55; font-size: 14.5px; max-width: 52ch; }
.path-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.path-col.is-you .path-k { color: var(--sex-ink); }
.faq { display: grid; }
.faq-i { border-top: 1px solid var(--line); }
.faq-i:first-child { border-top: 0; }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; cursor: pointer; font-size: 16px; font-weight: 600; list-style: none; min-height: 48px; border-radius: 8px; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q .ic { color: var(--ink-2); transition: transform .15s; }
.faq-q:hover .ic { color: var(--dark); }
.faq-i[open] .faq-q .ic { transform: rotate(180deg); }
.faq-a { display: grid; gap: 10px; padding: 0 0 18px; max-width: 74ch; font-size: 14.5px; line-height: 1.6; justify-items: start; }
.faq-parts, .faq-stages { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 8px 16px; width: 100%; padding: 4px 0; }
.faq-parts dt { font-weight: 600; display: grid; align-content: start; }
.faq-parts dt b { font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.faq-stages { align-items: baseline; }
.faq-live { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--skin-2); border-radius: var(--r-s); font-size: 13.5px; line-height: 1.5; }
.faq-live .ic { margin-top: 3px; color: var(--ink-2); }
.keymap { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 16px; align-items: center; }
.keymap dt { display: flex; gap: 4px; }

/* ------------------------------------------------------------------ новые экраны на телефоне */

@media (max-width: 1180px) and (min-width: 861px) {
  .search-grid { grid-template-columns: 1fr; }
  .set-layout { grid-template-columns: 196px minmax(0, 1fr); }
  .sq-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 1240px) { .set-grid.is-pairs { max-width: none; } }

@media (max-width: 860px) {
  .set-grid.is-pairs { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .pair-note { min-height: 0; font-weight: 600; font-size: 12.5px; margin-bottom: -8px; }
  .screen.board { height: auto; grid-template-rows: none; }
  .board-tip { display: none; }
  .board-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px -14px -2px; padding: 2px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .board-tabs::-webkit-scrollbar { display: none; }
  .board-tab { flex: none; min-width: 108px; min-height: 58px; padding: 8px 12px; border: 0; border-radius: 14px; background: var(--skin-2); }
  .board-tab b { font-size: 19px; }
  .board-tab[aria-current="true"] { background: var(--skin); box-shadow: inset 0 0 0 2px var(--dark); }
  .board-scroll { overflow: visible; border-radius: 0; }
  .board-grid { display: block; height: auto; }
  .col { display: none; background: none; padding: 0; border-radius: 0; }
  .board[data-col="found"] .col[data-stage="found"], .board[data-col="fit"] .col[data-stage="fit"],
  .board[data-col="written"] .col[data-stage="written"], .board[data-col="replied"] .col[data-stage="replied"],
  .board[data-col="agreed"] .col[data-stage="agreed"], .board[data-col="published"] .col[data-stage="published"] { display: block; }
  .col-head { display: none; }
  .col-list { overflow: visible; gap: 8px; }
  .bc { padding: 12px 14px; border-radius: var(--r-l); }
  .bc-name { font-size: 15.5px; }
  .bc-handle, .bc-meta, .bc-next { font-size: 13.5px; }
  .col-empty { background: var(--paper); padding: 16px; font-size: 14px; border-radius: var(--r-l); }
  .col-empty b { font-size: 15.5px; }

  .lt-card { padding: 2px 10px 4px; }
  .lt-head { display: none; }
  .lt-open { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who state" "to ch" "subj subj"; gap: 6px 10px; padding: 12px 2px; }
  .lt-who { grid-area: who; }
  .lt-state { grid-area: state; justify-content: flex-end; }
  .lt-state .lt-when { display: none; }
  .lt-to { grid-area: to; white-space: normal; }
  .lt-ch { grid-area: ch; justify-self: end; }
  .lt-subj { grid-area: subj; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink-2); font-size: 14px; }
  .lt-name { font-size: 15.5px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .sq-title { font-size: 20px; }
  .sq-back .btn-t { display: none; }
  .sq-back { width: 44px; padding: 0; margin-left: -10px; }
  .sq-grid { grid-template-columns: minmax(0, 1fr); }
  .sq-side { position: static; order: -1; gap: 10px; }
  .sq-facts, .sq-why { display: none; }
  .sq-card { padding: 14px; }
  .msg.is-queue .msg-body { font-size: 16px; }
  textarea.msg-subj { padding: 10px 12px; line-height: 22px; }
  .msg-name { font-size: 13px; }
  .msg-regen { flex-wrap: wrap; }
  .msg-regen .inp, .msg-regen .btn { flex: 1 1 100%; }

  .nc-hint { flex: 1 1 100%; margin-left: 0; }
  .nc-tools .btn { flex: 1 1 auto; }
  .nc-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "acc status" "where open"; gap: 6px 10px; padding: 10px 8px 10px 12px; }
  .nc-acc { grid-area: acc; }
  .nc-status { grid-area: status; justify-self: end; }
  .nc-where { grid-area: where; }
  .nc-open { grid-area: open; }
  .nc-acts .btn { flex: 1 1 auto; }
  .tb-head { display: none; }
  .tb-open { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px 2px; align-items: center; }
  .tb-who { flex: 1 1 100%; }
  .tb-name { font-size: 15.5px; }
  .tb-num { text-align: left; font-size: 13.5px; }
  .tb-num::before { content: attr(data-l) ' '; color: var(--ink-2); }
  .tb-marks { flex: 1 1 100%; }
  .tb-marks:empty { display: none; }
  .tb-contact { flex: 1 1 100%; font-size: 13.5px; }

  .search-grid { grid-template-columns: minmax(0, 1fr); }
  .seeds { grid-template-columns: minmax(0, 1fr); }
  .seed-open { min-height: 48px; }
  .hr-head { display: none; }
  .hr-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 2px; }
  .hr-when, .hr-note { grid-column: 1 / -1; }
  .hr-num { text-align: left; }
  .hr-num::before { content: attr(data-l); display: block; color: var(--ink-2); font-size: 12px; }
  .hr-st { align-self: end; }

  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { display: flex; gap: 6px; overflow-x: auto; position: static; background: none; border-radius: 0; margin: 0 -12px; padding: 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav-i { flex: none; height: 44px; padding: 0 14px; background: var(--paper); border-radius: 12px; }
  .set-nav-i[aria-current] { background: var(--dark); color: #fff; }
  .set-nav-i[aria-current] .ic { color: #fff; }
  .set-card, .how-card { padding: 16px 14px; }
  .meters { grid-template-columns: minmax(0, 1fr); }
  .sp-head, .sp-row { grid-template-columns: minmax(0, 1fr) 62px 62px 66px; gap: 8px; }
  .sp-head { padding: 8px 2px; }
  .sp-row { padding: 9px 2px; font-size: 13.5px; }
  .save-bar .btn.is-primary { flex: 1 1 auto; }
  .user .btn { flex: 1 1 auto; }
  .link-box .inp-row { flex-wrap: wrap; }
  .link-box .inp-row .btn { flex: 1 1 100%; }
  .radios { display: grid; gap: 0; }
  .set-sub + .radios { margin-top: -4px; }
  .price-ex { grid-template-columns: auto minmax(0, 1fr); gap: 0 14px; font-size: 14.5px; }
  .price-ex-row > span:first-child { grid-column: 1 / -1; margin-top: 8px; }
  .price-ex-row > b { text-align: left; }

  .how-lead { font-size: 15.5px; margin-top: 0; }
  .path-step { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .path-col p { font-size: 15px; }
  .faq-q { font-size: 16px; padding: 12px 0; }
  .faq-a { font-size: 15px; }
  .faq-parts, .faq-stages { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .faq-parts dd, .faq-stages dd { margin-bottom: 10px; }
  .faq-parts dt { display: flex; gap: 8px; align-items: baseline; }
  .how-keys { display: none; }
}

@media (hover: none) { .how-keys { display: none; } }
