/* Холодка · сводка по звонку. Приложение (Electron) и та же страница в браузере.
   Образ: «рабочий список + карточка клиента» — серый камень, светлые панели, салатовый для «сейчас»,
   чёрная пилюля для главного действия. */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-cyrillic-wght-normal.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: 200 800; font-display: swap;
  src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --canvas: #e4e5e1; --panel: #fafaf8; --well: #f0f1ed; --raise: #ffffff;
  --ink: #161719; --ink-2: #5d615d; --ink-3: #8b8f8a; --line: #d9dbd5; --line-2: #e7e8e4;
  --lime: #dcf26b; --lime-soft: #eef8bd; --lime-ink: #445600;
  --blush: #f6d8d1; --amber: #f2c15a; --amber-soft: #fbeccb; --amber-ink: #6f4b00;
  --red: #cf3f33; --red-soft: #f8deda; --blue-soft: #dfe8f6;
  --cta: #161719; --cta-ink: #ffffff;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(22,23,25,.05), 0 8px 24px -12px rgba(22,23,25,.12);
  --r-shell: 22px; --r-card: 18px; --r-tile: 14px; --r-ctl: 12px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --top: 60px; --rail: 200px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --canvas: #0f1010; --panel: #1a1b1b; --well: #212323; --raise: #2b2d2d;
  --ink: #eceee9; --ink-2: #a3a7a1; --ink-3: #767a75; --line: #313433; --line-2: #2a2c2c;
  --lime: #d6ef5f; --lime-soft: #2c3313; --lime-ink: #d6ef5f;
  --blush: #3a2622; --amber: #e8b54c; --amber-soft: #3a2f17; --amber-ink: #f0c76d;
  --red: #ff8073; --red-soft: #3c1f1c; --blue-soft: #1d2735;
  --cta: #d6ef5f; --cta-ink: #121313;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--ink); font: 500 13.5px/1.45 var(--font); font-feature-settings: 'tnum' 1, 'cv01' 1; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; }
.i-s { width: 15px; height: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:root[data-theme="dark"] :focus-visible { outline-color: var(--lime); }
::selection { background: var(--lime); color: #161719; }

/* ---------- Каркас ---------- */
.app { display: grid; grid-template-rows: var(--top) minmax(0, 1fr); grid-template-columns: var(--rail) minmax(0, 1fr); height: 100vh; }
.app.rail-min { --rail: 76px; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 20px; -webkit-app-region: drag; user-select: none; }
.top > * { -webkit-app-region: no-drag; }
html[data-platform="darwin"][data-desktop] .top { padding-left: 88px; }
html[data-platform="win32"][data-desktop] .top { padding-right: 150px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; -webkit-app-region: drag; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: var(--lime); display: grid; place-items: center; }
:root[data-theme="dark"] .brand-mark { background: var(--lime); color: #161719; }
.brand-name { font-weight: 750; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search input { width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); padding: 0 16px 0 40px; outline: none; transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--lime) 55%, transparent); }
.search > .i { position: absolute; left: 14px; top: 10px; color: var(--ink-3); pointer-events: none; }
.search kbd { position: absolute; right: 12px; top: 9px; font: 600 11px var(--font); color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--well); }
.suggest { position: absolute; top: 44px; left: 0; right: 0; background: var(--raise); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 20; max-height: 60vh; overflow: auto; }
.suggest button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.suggest button:hover, .suggest button:focus-visible { background: var(--well); }
.suggest .empty { padding: 10px; color: var(--ink-2); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.me:hover { border-color: var(--ink-3); }
.me .av { width: 30px; height: 30px; font-size: 11px; }
.me span { font-weight: 650; font-size: 12.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Кнопки */
.ib { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; flex: none; }
.ib:hover { border-color: var(--ink-3); }
.ib-s { width: 32px; height: 32px; } .ib-s .i { width: 16px; height: 16px; }
.ib.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 650; cursor: pointer; white-space: nowrap; text-decoration: none; transition: border-color .15s, transform .08s, background .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-cta { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.btn-cta:hover { border-color: var(--cta); filter: brightness(1.15); }
:root[data-theme="dark"] .btn-cta:hover { filter: brightness(1.05); }
.btn-lime { background: var(--lime); color: #161719; border-color: var(--lime); }
.btn-s { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-danger { color: var(--red); }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }

/* Меню слева */
.rail { padding: 6px 12px 16px 16px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.rail-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 12px 8px; }
.rail-h b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.rail-g { color: var(--ink-3); font-size: 12px; font-weight: 650; padding: 14px 10px 6px; }
.nav-b { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 999px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-weight: 600; text-align: left; position: relative; }
.nav-b:hover { color: var(--ink); background: color-mix(in oklab, var(--panel) 60%, transparent); }
.nav-b[aria-current="page"] { background: var(--lime); color: #161719; }
.nav-b .count { font-style: normal; margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.nav-b[aria-current="page"] .count { color: #161719; }
.nav-b .live { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: auto; box-shadow: 0 0 0 0 var(--red); animation: pulse 1.6s infinite; }
.rail-foot { margin-top: auto; padding: 12px 8px 0; color: var(--ink-3); font-size: 11.5px; }
.rail-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin-right: 6px; }
.rail-foot .dot.ok { background: #6bbf3a; } .rail-foot .dot.bad { background: var(--red); }
.app.rail-min .nav-b span, .app.rail-min .rail-g, .app.rail-min .rail-h b, .app.rail-min .nav-b .count, .app.rail-min .rail-foot span { display: none; }
.app.rail-min .nav-b { justify-content: center; padding: 0; }
.app.rail-min .rail-h { justify-content: center; padding-left: 4px; }

.main { min-width: 0; min-height: 0; padding: 0 16px 16px 4px; }
.screen { height: 100%; min-height: 0; }

/* ---------- Обзвон: список + карточка ---------- */
.work { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 12px; height: 100%; }
.pane { background: var(--panel); border-radius: var(--r-shell); box-shadow: var(--shadow); min-height: 0; display: flex; flex-direction: column; }
.pane-h { display: flex; align-items: center; gap: 8px; padding: 18px 18px 10px 20px; }
.pane-h h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-b { overflow: auto; min-height: 0; padding: 0 12px 12px; }
.pane > :not(.pane-b) { flex-shrink: 0; } /* шапка, фильтры и полоса прогресса не сжимаются — прокручивается только список */
.list-pick { margin: 0 16px 8px 18px; position: relative; }
.list-pick select { width: 100%; height: 36px; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: var(--well); padding: 0 34px 0 14px; font-weight: 650; cursor: pointer; }
.list-pick .i { position: absolute; right: 12px; top: 9px; pointer-events: none; color: var(--ink-2); }
.chips { display: flex; gap: 6px; padding: 2px 16px 10px 18px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 12px; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip b { font-weight: 700; margin-left: 3px; opacity: .65; }
.progress { margin: 0 18px 10px 20px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.progress .bar { flex: 1; height: 6px; border-radius: 6px; background: var(--well); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--ink); border-radius: 6px; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; font-weight: 650; margin: 10px 8px 8px; }
.sep::before, .sep::after { content: ''; height: 1px; flex: 1; background: var(--line); }

.co { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: var(--well); border-radius: var(--r-card); padding: 12px 12px 10px 14px; margin-bottom: 8px; cursor: pointer; position: relative; transition: background .15s, border-color .15s; }
.co:hover { border-color: var(--line); }
.co.sel { background: var(--lime-soft); border-color: color-mix(in oklab, var(--lime) 70%, var(--ink) 8%); }
:root[data-theme="dark"] .co.sel { border-color: #4d5a1c; }
.co-top { display: flex; gap: 10px; align-items: flex-start; }
.co-name { font-weight: 700; font-size: 14px; line-height: 1.25; letter-spacing: -.005em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.co-sub { color: var(--ink-2); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-n { margin-left: auto; flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11.5px; font-weight: 750; background: var(--panel); border: 1px solid var(--line); }
.co.sel .co-n { background: #161719; color: var(--lime); border-color: #161719; }
.co-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.tg { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--panel); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tg.on { color: var(--ink); border-color: var(--line); }
.tg.st-interested { background: var(--lime); color: #161719; border-color: var(--lime); }
.tg.st-refused { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tg.st-unreachable { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.tg.st-in_progress { background: var(--blue-soft); color: var(--ink); border-color: transparent; }
.co.done { opacity: .62; }
.co.done:hover, .co.done.sel { opacity: 1; }

/* Карточка компании */
.detail { overflow: auto; min-height: 0; border-radius: var(--r-shell); background: var(--panel); box-shadow: var(--shadow); position: relative; }
.hero { position: relative; padding: 18px 22px 18px; border-radius: var(--r-shell) var(--r-shell) 0 0; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 140% at 0% 0%, var(--lime-soft) 0%, transparent 55%), radial-gradient(90% 120% at 100% 0%, var(--blush) 0%, transparent 60%); opacity: .95; }
.hero > * { position: relative; z-index: 1; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .btn { background: color-mix(in oklab, var(--panel) 70%, transparent); backdrop-filter: blur(6px); }
.who { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 20px; letter-spacing: .02em; background: var(--ink); color: var(--lime); flex: none; box-shadow: 0 0 0 4px color-mix(in oklab, var(--panel) 80%, transparent); }
:root[data-theme="dark"] .av { background: var(--lime); color: #161719; }
.who-main { flex: 1; min-width: 240px; }
.who h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; }
.who-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.who-tags .tg { background: color-mix(in oklab, var(--panel) 75%, transparent); }
.tg.warn { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.tg.danger { background: var(--red-soft); color: var(--red); border-color: transparent; font-weight: 750; }
.facts { display: flex; gap: 26px; flex-wrap: wrap; }
.fact small { display: block; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.fact b { font-size: 14px; font-weight: 700; }
.fact .link { font-size: 14px; }

/* Номера компании — шаги */
.steps { display: flex; align-items: stretch; margin-top: 18px; border-radius: 999px; background: color-mix(in oklab, var(--panel) 55%, var(--well)); padding: 4px; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.steps-h { flex: none; display: flex; flex-direction: column; justify-content: center; background: var(--ink); color: var(--panel); border-radius: 999px; padding: 6px 18px 6px 18px; min-width: 170px; }
:root[data-theme="dark"] .steps-h { background: var(--lime); color: #161719; }
.steps-h b { font-size: 13px; } .steps-h small { font-size: 11px; opacity: .7; }
.step { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; border: 0; background: none; border-radius: 999px; padding: 6px 14px 6px 6px; cursor: pointer; text-align: left; min-width: 150px; }
.step:hover { background: color-mix(in oklab, var(--panel) 80%, transparent); }
.step.cur { background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.step-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); flex: none; }
.step-ic .i { width: 15px; height: 15px; }
.step.good .step-ic { background: var(--lime); border-color: var(--lime); color: #161719; }
.step.bad .step-ic { background: var(--red-soft); border-color: transparent; color: var(--red); }
.step.warn .step-ic { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); }
.step.muted .step-ic { background: var(--well); color: var(--ink-3); }
.step b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.step small { display: block; font-size: 11px; color: var(--ink-2); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 6px; padding: 14px 22px 0; flex-wrap: wrap; }
.tab { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; font-weight: 650; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tab .n { margin-left: 4px; opacity: .6; }
.tabbody { padding: 14px 22px 22px; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.box { background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 16px; }
:root[data-theme="dark"] .box { background: var(--well); }
.box-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.box-h h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.box-h .meta { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.stack { display: grid; gap: 14px; }

/* Плитки сводки */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); grid-auto-flow: row dense; gap: 8px; }
.t { position: relative; border-radius: var(--r-tile); padding: 11px 12px 12px; background: var(--well);
}
:where(:root[data-theme="dark"]) .t { background: var(--raise); }
.t { min-height: 92px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.t-l { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.t-l .i { width: 14px; height: 14px; }
.t-v { font-size: 19px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; margin-top: auto; overflow-wrap: anywhere; }
.t-v small { font-size: 12px; font-weight: 650; color: var(--ink-2); letter-spacing: 0; }
.t-s { font-size: 11.5px; color: var(--ink-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.t.yes { background: var(--lime-soft); }
.t.yes .t-v::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime-ink); margin-right: 7px; vertical-align: 3px; }
:root[data-theme="dark"] .t.yes { border-color: #3c4618; }
.t.no .t-v { color: var(--ink-3); }
.t.was { background: var(--amber-soft); } .t.was .t-v { color: var(--amber-ink); }
.t.unknown { background: none; border: 1px dashed var(--line); } .t.unknown .t-v { color: var(--ink-3); font-size: 14px; font-weight: 650; }
.t.pending .t-v { width: 70%; height: 20px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), var(--panel), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.t.wide { grid-column: span 2; }
.t .up { color: #4b8a12; font-size: 12px; } .t .down { color: var(--red); font-size: 12px; }
:root[data-theme="dark"] .t .up { color: var(--lime); }
.t-ph { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.t-ph button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.t-ph button:hover { border-color: var(--ink); }
/* Плитка — кнопка: по клику раскрывается панель подробностей на всю ширину сетки, сразу под ней. */
.t-click { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.t-click:hover { border-color: var(--line); }
.t-click:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.t-click[aria-expanded="true"] { border-color: var(--ink); }
.t-more { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--r-tile); background: var(--panel); padding: 12px 14px; font-size: 13px; }
.t-more .kv { margin: 0; }
.t-more .lst { margin: 0; max-height: 260px; overflow: auto; gap: 6px; }
.t-more .kv + .lst { margin-top: 12px; }
.t-more .t-src { margin: 8px 0 0; color: var(--ink-3); font-size: 11.5px; }
.t-more .muted { margin: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Следующий номер */
.next { background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 16px; }
:root[data-theme="dark"] .next { background: var(--well); }
.next-card { background: var(--lime); color: #161719; border-radius: var(--r-tile); padding: 14px; }
.next-card .row1 { display: flex; align-items: center; gap: 10px; }
.next-card .ic { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.55); display: grid; place-items: center; flex: none; }
.next-card .num { font-size: 21px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.next-card .who2 { font-size: 12px; font-weight: 600; opacity: .75; margin-top: 2px; }
.next-card .acts { display: flex; gap: 6px; margin-top: 12px; }
.next-card .acts .btn { flex: 1; }
.next-card .btn-cta { background: #161719; color: #fff; border-color: #161719; }
.next-card .btn-ghost { background: rgba(255,255,255,.6); border-color: transparent; color: #161719; }
.outs-h { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 14px 2px 8px; }
.outs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ob { height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; font-weight: 650; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
.ob:hover { border-color: var(--ink); }
.ob.good { color: var(--lime-ink); } :root:not([data-theme="dark"]) .ob.good { color: #3b5100; }
.ob.bad { color: var(--red); }
.ob.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.ob kbd { font: 700 10px var(--font); opacity: .5; }
.queue { margin-top: 14px; display: grid; gap: 6px; }
.q { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--well); border: 0; text-align: left; cursor: pointer; width: 100%; }
:root[data-theme="dark"] .q { background: var(--panel); }
.q:hover { outline: 1px solid var(--line); }
.q .step-ic { width: 28px; height: 28px; }
.q b { font-size: 12.5px; display: block; } .q small { font-size: 11px; color: var(--ink-2); display: block; }
.q.good .step-ic { background: var(--lime); border-color: var(--lime); color: #161719; }
.q.bad .step-ic { background: var(--red-soft); color: var(--red); border-color: transparent; }
.q.warn .step-ic { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.q .q-out { white-space: nowrap; margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: right; }

/* Оборот по годам */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars i { display: block; width: 100%; max-width: 42px; border-radius: 8px 8px 4px 4px; background: var(--line); min-height: 4px; }
.bars div.last i { background: var(--ink); } :root[data-theme="dark"] .bars div.last i { background: var(--lime); }
.bars span { font-size: 11px; color: var(--ink-3); font-weight: 650; }
.bars em { font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; }

.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--ink-2); font-weight: 600; } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.lst { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lst li { padding: 10px 12px; border-radius: 12px; background: var(--well); font-size: 13px; }
:root[data-theme="dark"] .lst li { background: var(--panel); }
.lst li small { display: block; color: var(--ink-2); font-size: 11.5px; margin-top: 2px; }
.ok-t { color: #3b7a0c; font-weight: 700; } :root[data-theme="dark"] .ok-t { color: var(--lime); }
.bad-t { color: var(--red); font-weight: 700; }
.muted { color: var(--ink-2); }
.note-form { display: grid; gap: 8px; }
.note-form textarea { width: 100%; min-height: 76px; resize: vertical; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); padding: 10px 12px; outline: none; }
.note-form textarea:focus { border-color: var(--ink); }
.note-form .btn { justify-self: end; }

/* Пустые состояния */
.empty { display: grid; place-items: center; text-align: center; padding: 48px 24px; color: var(--ink-2); gap: 10px; height: 100%; }
.empty h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.empty p { margin: 0; max-width: 380px; }
.empty .big { width: 64px; height: 64px; border-radius: 22px; background: var(--lime); color: #161719; display: grid; place-items: center; }
.empty .big .i { width: 28px; height: 28px; }

/* ---------- UIS внутри приложения ---------- */
.uis { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; height: 100%; }
.uis-host { border-radius: var(--r-shell); background: var(--panel); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.uis-host .empty { position: absolute; inset: 0; }
.uis-side { display: flex; flex-direction: column; min-height: 0; }
.uis-side .pane-b { padding: 0 14px 14px; }
.live-card { display: grid; gap: 10px; }
.calling { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--ink); color: var(--panel); }
:root[data-theme="dark"] .calling { background: var(--lime); color: #161719; }
.calling .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 var(--lime); animation: pulse 1.6s infinite; flex: none; }
:root[data-theme="dark"] .calling .pulse { background: #161719; }
.calling b { font-size: 15px; white-space: nowrap; } .calling small { display: block; opacity: .7; font-size: 11.5px; }
.calling.ended { background: var(--well); color: var(--ink); } .calling.ended .pulse { animation: none; background: var(--ink-3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--lime) 70%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.mini-name { font-size: 18px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.tiles.compact { grid-template-columns: 1fr 1fr; gap: 6px; }
.tiles.compact .t { min-height: 70px; padding: 9px 10px 10px; }
.tiles.compact .t-v { font-size: 15.5px; }
.tiles.compact .t.wide { grid-column: span 2; }

/* ---------- Списки, журнал, источники, настройки ---------- */
.page { height: 100%; overflow: auto; background: var(--panel); border-radius: var(--r-shell); box-shadow: var(--shadow); padding: 22px 24px 28px; }
.page h2 { margin: 0 0 4px; font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.page .lead { margin: 0 0 18px; color: var(--ink-2); max-width: 720px; }
.page h3 { margin: 26px 0 10px; font-size: 16px; font-weight: 700; }
.drop { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--r-card); border: 1.5px dashed var(--line); background: var(--well); margin-bottom: 16px; flex-wrap: wrap; }
.drop.over { border-color: var(--ink); background: var(--lime-soft); }
.drop .big { width: 52px; height: 52px; border-radius: 16px; background: var(--lime); color: #161719; display: grid; place-items: center; flex: none; }
.drop div { flex: 1; min-width: 220px; } .drop b { font-size: 15px; } .drop p { margin: 2px 0 0; color: var(--ink-2); }
.pv { border-radius: var(--r-card); border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 16px; background: var(--raise); }
.pv-cols { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.pv-cols span { font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--well); color: var(--ink-2); }
.pv-cols span.k { background: var(--lime-soft); color: var(--ink); }
.pv-acts { display: flex; gap: 8px; margin-top: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.lcard { border-radius: var(--r-card); background: var(--well); padding: 16px; display: grid; gap: 12px; }
.lcard h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.lcard .muted { font-size: 12px; }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nums div { background: var(--panel); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.nums small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nums b { display: block; font-size: 17px; font-weight: 750; } .nums small { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.lcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; color: var(--ink-3); font-weight: 650; font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--well); }
.tbl td:first-child { border-radius: 10px 0 0 10px; } .tbl td:last-child { border-radius: 0 10px 10px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { border-radius: var(--r-card); background: var(--well); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.stat .av { width: 42px; height: 42px; font-size: 13px; box-shadow: none; }
.stat b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; display: block; line-height: 1.1; }
.stat small { color: var(--ink-2); font-size: 12px; }
.stat.top { background: var(--lime-soft); }
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.src { border-radius: var(--r-card); background: var(--well); padding: 14px 16px; }
.src-h { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.src-h .dot { width: 9px; height: 9px; border-radius: 50%; background: #6bbf3a; flex: none; }
.src-h .dot.busy { background: var(--amber); } .src-h .dot.bad { background: var(--red); } .src-h .dot.off { background: var(--ink-3); }
.src p { margin: 6px 0 0; color: var(--ink-2); font-size: 12.5px; }
.form { display: grid; gap: 14px; max-width: 640px; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.fld input, .fld select { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); padding: 0 12px; outline: none; }
.fld input:focus, .fld select:focus { border-color: var(--ink); }
.fld small { color: var(--ink-3); font-size: 12px; }
.fld-row { display: flex; gap: 8px; } .fld-row input { flex: 1; min-width: 0; }
.seg { display: inline-flex; background: var(--well); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-weight: 650; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sw { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.sw input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.sw input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw input:checked { background: var(--ink); } :root[data-theme="dark"] .sw input:checked { background: var(--lime); }
.sw input:checked::after { transform: translateX(16px); }
.sw b { display: block; font-weight: 650; } .sw small { color: var(--ink-2); font-size: 12px; }
.sect { border-radius: var(--r-card); background: var(--well); padding: 18px; margin-bottom: 12px; max-width: 860px; }
.sect h3 { margin: 0 0 12px; }
.sect .tbl input { width: 100%; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); padding: 0 10px; }
code, pre { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
code { background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); padding: 12px; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0; }
.secret { filter: blur(4px); cursor: pointer; } .secret.show { filter: none; }

/* Уведомление внизу */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px); max-width: min(480px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 999px; background: var(--ink); color: var(--panel); font-weight: 650; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; display: flex; gap: 8px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); color: #fff; border-radius: 16px; }

/* Диалог проверочного звонка */
dialog { border: 0; border-radius: 22px; padding: 22px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(20,21,20,.35); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 4px; font-size: 18px; } dialog p { margin: 0 0 14px; color: var(--ink-2); }
dialog .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Узкое окно */
@media (max-width: 1180px) { .grid { grid-template-columns: 1fr; } .grid > .stack:last-child { order: -1; } .next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; } .next > .box-h, .next > .next-card { grid-column: 1; } .next > .outs-h:first-of-type { grid-column: 2; grid-row: 1; } .next > .outs { grid-column: 2; grid-row: 2 / span 3; align-self: start; } .next > .outs-h ~ .outs-h, .next > .queue { grid-column: 1; } }
@media (max-width: 980px) {
  .app { --rail: 76px; }
  .app .nav-b span, .app .rail-g, .app .rail-h b, .app .nav-b .count, .app .rail-foot span { display: none; }
  .app .nav-b { justify-content: center; padding: 0; }
  .work { grid-template-columns: 280px minmax(0, 1fr); }
  .uis { grid-template-columns: minmax(0, 1fr) 320px; }
  .brand-sub { display: none; }
}
@media (max-width: 720px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: auto; min-height: 100vh; }
  .top { flex-wrap: wrap; padding: 10px 16px; height: auto; }
  .search { order: 3; flex-basis: 100%; }
  .rail { flex-direction: row; overflow-x: auto; padding: 0 16px 8px; }
  .rail-h, .rail-g, .rail-foot { display: none; }
  .main { padding: 0 16px 16px; }
  .work, .uis { grid-template-columns: 1fr; height: auto; }
  .pane, .detail { max-height: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .facts { gap: 14px; }
}

/* ---------- Вход ---------- */
.auth { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); background: var(--canvas); z-index: 30; }
.auth-side { position: relative; margin: 16px 0 16px 16px; border-radius: var(--r-shell); background: var(--ink); color: #f2f3ee; padding: 28px 32px; display: flex; flex-direction: column; overflow: hidden; -webkit-app-region: drag; }
:root[data-theme="dark"] .auth-side { background: #1c1d1d; }
.auth-side::before { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 70% at 0% 100%, rgba(220,242,107,.28), transparent 60%), radial-gradient(70% 60% at 100% 0%, rgba(246,216,209,.18), transparent 60%); pointer-events: none; }
.auth-side > * { position: relative; }
.auth-side .brand-mark { background: var(--lime); color: #161719; }
.auth-side .brand-sub { color: rgba(255,255,255,.55); }
html[data-platform="darwin"][data-desktop] .auth-side { padding-top: 56px; }
.auth-pitch { margin-top: auto; max-width: 520px; }
.auth-pitch h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 12px; font-weight: 750; }
.auth-pitch p { margin: 0; color: rgba(255,255,255,.65); font-size: 15px; }
.auth-tiles { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.auth-tiles .t { min-height: 0; width: 150px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); }
.auth-tiles .t.yes { background: var(--lime); color: #161719; } .auth-tiles .t.yes .t-l { color: #3d4a00; } .auth-tiles .t.yes .t-v::before { background: #161719; }
.auth-tiles .t-l { color: rgba(255,255,255,.6); } .auth-tiles .t-v { font-size: 17px; }
.auth-main { display: grid; place-items: center; padding: 24px; -webkit-app-region: drag; }
.auth-card { width: min(380px, 100%); display: grid; gap: 14px; -webkit-app-region: no-drag; }
.auth-card h2 { margin: 0; font-size: 28px; letter-spacing: -.025em; font-weight: 750; }
.auth-card .muted { margin: -8px 0 4px; }
.auth-card .btn { height: 44px; font-size: 14px; }
.auth-err { margin: 0; min-height: 18px; color: var(--red); font-weight: 650; font-size: 13px; }
.auth-foot { font-size: 12px; margin: 0; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Меню учётки */
.me-wrap { position: relative; }
.me-menu { position: absolute; right: 0; top: 46px; min-width: 220px; background: var(--raise); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 25; }
.me-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.me-who b { display: block; } .me-who small { color: var(--ink-2); }
.me-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-weight: 600; text-align: left; }
.me-menu button:hover { background: var(--well); }

/* Команда */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.member { border-radius: var(--r-card); background: var(--well); padding: 16px; display: grid; gap: 12px; }
.member.off { opacity: .55; }
.member-h { display: flex; gap: 12px; align-items: center; }
.member-h .av { width: 46px; height: 46px; font-size: 15px; box-shadow: none; }
.member-h b { display: block; font-size: 15.5px; } .member-h small { color: var(--ink-2); font-size: 12px; }
.member-h .tg { margin-left: auto; }
.meter { height: 8px; border-radius: 8px; background: var(--panel); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 8px; } :root[data-theme="dark"] .meter i { background: var(--lime); }
.member .nums b { font-size: 16px; }
.member .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.member form { display: grid; gap: 8px; }
.member input:not([type]), .member input[type="text"] { height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); padding: 0 10px; min-width: 0; width: 100%; }
.member input:focus { outline: none; border-color: var(--ink); }
.newbie { border: 1.5px dashed var(--line); background: none; }

/* Раздача */
.dist { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--raise); padding: 16px 18px; margin: 14px 0; }
.dist h4 { margin: 0 0 10px; font-size: 15px; }
.dist-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dist-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--well); }
.dist-row b { min-width: 0; flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dist-row small { color: var(--ink-2); font-weight: 700; }
.dist-row select { flex: 1; min-width: 0; max-width: none; }
.dist-row select, .pick { height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; font-weight: 650; max-width: 180px; }
.dist-row.miss { outline: 1.5px solid var(--amber); }
.who-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.who-chips .tg { font-size: 11.5px; }
.bulk { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin: 0 0 10px; border-radius: 14px; background: var(--ink); color: var(--panel); }
:root[data-theme="dark"] .bulk { background: var(--lime); color: #161719; }
.bulk .pick { background: var(--panel); color: var(--ink); border-color: transparent; }
.bulk .btn { height: 32px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.filters input { height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--raise); padding: 0 14px; min-width: 220px; }
.tbl input[type="checkbox"], .bulk input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); }
.co .tg.mgr { background: var(--ink); color: var(--panel); border-color: var(--ink); }
:root[data-theme="dark"] .co .tg.mgr { background: var(--lime); color: #161719; border-color: var(--lime); }
.taken { margin-top: 8px; }
.note-line { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; }
.warn-t, .fld small.warn-t { color: var(--amber-ink); font-weight: 600; }
/* Список внутри раскрытой плитки — карточками на фоне «колодца», в обеих темах (после общего правила .lst li). */
.t-more .lst li, :root[data-theme="dark"] .t-more .lst li { background: var(--well); padding: 8px 12px; }
