/* More CRM в фирменном стиле moreproperty.ru: белая шапка с логотипом MORE, тёмно-синий #204266,
   серая палитра текста, Inter, кнопки со скруглением 10px.
   Телефон — основной экран: шапка с логотипом и нижнее меню с кнопкой «+».
   От 960px меню уходит в боковую колонку, база клиентов показывается таблицей. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.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; }
@font-face { font-family: "Inter Fallback"; src: local("Arial"); ascent-override: 90%; descent-override: 22.43%; line-gap-override: 0%; size-adjust: 107.4%; }

:root {
  /* Цвета сайта moreproperty.ru */
  --bg: #F8F9FB; --surface: #FFFFFF; --surface-2: #F2F4F7;
  --ink: #101828; --text: #344054; --muted: #667085; --faint: #98A2B3;
  --line: #EAECF0; --field: #D0D5DD;
  --accent: #204266; --accent-hover: #1A365D; --accent-ink: #FFFFFF; --accent-soft: #EBF0F6;
  --logo: #204266;
  --brand-red: #FF2C50; --danger: #D4243F; --danger-soft: #FFF0F2;
  --ok: #067647; --ok-soft: #ECFDF3;
  --tg: #1A86BA; --tg-soft: #E8F5FB; --wa: #138A4A; --wa-soft: #E9FAF0;
  --step-empty: #D0D5DD; --scrim: rgba(16, 24, 40, .4);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, .08);
  --shadow-fab: 0 6px 16px rgba(32, 66, 102, .35);
  --focus: rgba(32, 66, 102, .16);
  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 12px; --r-btn: 10px; --r-field: 8px;
  --nav-h: 64px; --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1626; --surface: #111F33; --surface-2: #182A44;
    --ink: #F2F4F7; --text: #D0D5DD; --muted: #98A2B3; --faint: #667085;
    --line: #1F3350; --field: #2B4366;
    --accent: #84A9D9; --accent-hover: #9BBAE2; --accent-ink: #0B1626; --accent-soft: #1A2E4D;
    --logo: #F2F4F7;
    --brand-red: #FF4D6A; --danger: #FF7A8F; --danger-soft: #3A1622;
    --ok: #47CD89; --ok-soft: #0F2E22;
    --tg: #5BBEEA; --tg-soft: #13304A; --wa: #4ADE80; --wa-soft: #10301F;
    --step-empty: #2B4366; --scrim: rgba(0, 0, 0, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-fab: 0 6px 16px rgba(0, 0, 0, .5);
    --focus: rgba(132, 169, 217, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--faint); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- Логотип MORE (одноцветный, красится через --logo) ---------- */
.logo { display: inline-block; flex: none; width: 92px; aspect-ratio: 132 / 64; background: var(--logo); -webkit-mask: url(logo.svg) no-repeat center / contain; mask: url(logo.svg) no-repeat center / contain; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-crm { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; line-height: 20px; }
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash .logo { width: 160px; }

/* ---------- Каркас ---------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 15; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-in { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; min-width: 0; }
.me-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
main {
  max-width: 1120px; margin: 0 auto;
  padding-top: 16px;
  padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 14px; align-content: start;
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.nav-in { max-width: 640px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: 1fr 1fr auto 1fr; align-items: center; }
.nav .brand { display: none; }
.nav-link { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav-link .i { width: 24px; height: 24px; }
.nav-link[aria-current="page"] { color: var(--accent); }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.fab { width: 60px; height: 60px; margin: -26px 10px 0; border-radius: 50%; border: 4px solid var(--bg); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-fab); text-decoration: none; }
.fab .i { width: 28px; height: 28px; }
.fab-label { display: none; }

@media (min-width: 960px) {
  .topbar { display: none; }
  .nav { top: 0; right: auto; width: 240px; border-top: 0; border-right: 1px solid var(--line); padding: 22px 16px; }
  .nav-in { height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .nav .brand { display: flex; padding: 0 8px 24px; }
  .nav .brand .logo { width: 104px; }
  .nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-btn); font-size: 15px; color: var(--text); order: 2; }
  .nav-link:hover { background: var(--surface-2); }
  .nav-link .i { width: 20px; height: 20px; color: var(--muted); }
  .nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .nav-link[aria-current="page"] .i { color: var(--accent); }
  .badge { position: static; margin-left: auto; }
  .fab { order: 1; width: auto; height: 44px; margin: 0 0 16px; border: 0; border-radius: var(--r-btn); display: flex; gap: 8px; font-weight: 600; font-size: 15px; box-shadow: none; }
  .fab:hover { background: var(--accent-hover); }
  .fab .i { width: 20px; height: 20px; }
  .fab-label { display: inline; }
  main { margin-left: 240px; padding-top: 28px; padding-bottom: 48px; padding-left: 36px; padding-right: 36px; }
}

/* ---------- Заголовки экранов ---------- */
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.head h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.head .sub { color: var(--muted); font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 500; text-decoration: none; padding: 6px 4px 6px 0; }
.sec { display: grid; gap: 8px; }
.sec-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-h .linkbtn { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid var(--field); background: var(--surface); font-weight: 500; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: none; border-color: transparent; color: var(--accent); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.tg { background: var(--tg-soft); border-color: transparent; color: var(--tg); box-shadow: none; }
.btn.wa { background: var(--wa-soft); border-color: transparent; color: var(--wa); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .i { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: inherit; text-decoration: none; }
.x { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--r-field); background: none; color: var(--faint); font-size: 20px; line-height: 1; }
.x:hover { background: var(--surface-2); color: var(--ink); }

.f { display: grid; gap: 6px; min-width: 0; }
.f > span { font-size: 14px; color: var(--text); font-weight: 500; }
.f > span b { color: var(--danger); font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border-radius: var(--r-field); border: 1px solid var(--field); background: var(--surface); padding: 0 14px; font-size: 16px; color: var(--ink); box-shadow: var(--shadow); -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; box-shadow: none; accent-color: var(--accent); -webkit-appearance: checkbox; appearance: auto; flex: none; }
textarea { min-height: 88px; padding: 10px 14px; resize: vertical; line-height: 1.5; display: block; }
select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 19px, calc(100% - 14px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--focus); }
input[readonly], textarea[readonly] { opacity: .7; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form { display: grid; gap: 14px; }
.msg { font-size: 14px; border-radius: var(--r-field); padding: 10px 12px; }
.msg.err { color: var(--danger); background: var(--danger-soft); }
.msg.warn { color: var(--text); background: var(--surface-2); }
.msg.ok { color: var(--ok); background: var(--ok-soft); }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0; box-shadow: var(--shadow); }
.cols { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }

/* ---------- Фишки фильтров ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: var(--surface); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text); }
.chip .c { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] .c { color: inherit; opacity: .75; }
.chip.sm { height: 30px; font-size: 13px; padding: 0 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.search { position: relative; flex: 1 1 260px; }
.search .i { position: absolute; left: 14px; top: 12px; color: var(--faint); }
.search input { padding-left: 42px; }

/* ---------- Этап: подпись и четыре шага воронки ---------- */
/* Цвет этапа: --st — основной тон, --st-ink — текст. Фон, рамка и метка смешиваются с поверхностью. */
.st-new { --st: #0EA5E9; --st-ink: #0369A1; }
.st-work { --st: #8B5CF6; --st-ink: #6D28D9; }
.st-showing { --st: #F59E0B; --st-ink: #B45309; }
.st-deal { --st: #22C55E; --st-ink: #15803D; }
.st-won { --st: #204266; --st-ink: #204266; }
.st-lost { --st: #98A2B3; --st-ink: #475467; }
.st-new, .st-work, .st-showing, .st-deal, .st-won, .st-lost {
  --st-bg: color-mix(in srgb, var(--st) var(--st-mix-bg), var(--surface));
  --st-soft: color-mix(in srgb, var(--st) var(--st-mix-soft), var(--surface));
  --st-line: color-mix(in srgb, var(--st) var(--st-mix-line), var(--surface));
}
:root { --st-mix-bg: 6%; --st-mix-soft: 15%; --st-mix-line: 30%; }
.st-won { --st-mix-bg: 11%; --st-mix-line: 40%; }  /* закрытые сделки заметнее серого «Отказа» */
@media (prefers-color-scheme: dark) {
  :root { --st-mix-bg: 12%; --st-mix-soft: 24%; --st-mix-line: 40%; }
  .st-new { --st-ink: #7DD3FC; }
  .st-work { --st-ink: #C4B5FD; }
  .st-showing { --st-ink: #FCD34D; }
  .st-deal { --st-ink: #86EFAC; }
  .st-won { --st: #84A9D9; --st-ink: #A9C3E6; }
  .st-lost { --st: #667085; --st-ink: #98A2B3; }
}
.stage { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--st-soft, var(--accent-soft)); color: var(--st-ink, var(--accent)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.steps { display: inline-flex; gap: 2px; }
.steps i { display: block; width: 4px; height: 10px; border-radius: 1px; background: var(--st-line, var(--step-empty)); }
.steps i.f { background: var(--st-ink, var(--accent)); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--accent)); flex: none; }
.chip.stage-chip[aria-pressed="true"] { background: var(--st-ink); border-color: var(--st-ink); color: var(--surface); }
.chip.stage-chip[aria-pressed="false"] { border-color: var(--st-line); }
.kind { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- Задачи ---------- */
.tgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.tgroup-h { display: flex; align-items: center; gap: 6px; padding: 12px 16px 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.tgroup-h .i { width: 16px; height: 16px; }
.tgroup-h.over { color: var(--danger); }
.tgroup-h.today { color: var(--accent); }
.task { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line); }
.tgroup-h + .task { border-top: 0; }
.task input[type="checkbox"] { width: 22px; height: 22px; }
.task-main { display: grid; gap: 2px; min-width: 0; text-decoration: none; color: var(--text); }
.task-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.task-client { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.task-client b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.task-client b.over { color: var(--danger); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }

/* ---------- Клиенты: карточки на телефоне, таблица на компьютере ---------- */
.cards { display: grid; gap: 10px; }
.card { display: grid; gap: 6px; background: var(--st-bg, var(--surface)); border: 1px solid var(--st-line, var(--line)); border-radius: var(--r); padding: 14px 16px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.card:active { background: var(--surface-2); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-who { display: grid; gap: 2px; min-width: 0; }
.card { cursor: pointer; }
.card:active { background: var(--st-soft, var(--surface-2)); }
.card.st-lost { opacity: .8; }
.card-side { display: flex; align-items: center; gap: 8px; flex: none; }
.card-name { font-weight: 600; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.sum { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.due { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.due .i { width: 16px; height: 16px; }
.due.over { color: var(--danger); }
.due.today { color: var(--accent); }
.table-wrap { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
table.base { width: 100%; border-collapse: collapse; font-size: 14px; }
.base th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.base td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.base tr:last-child td { border-bottom: 0; }
.base tbody tr { cursor: pointer; background: var(--st-bg, transparent); }
.base tbody tr:hover { background: var(--st-soft, var(--bg)); }
.base .nm { font-weight: 600; color: var(--ink); }
.base .ph { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.base .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 960px) {
  .cards { display: none; }
  .table-wrap { display: block; }
}
.empty { display: grid; gap: 10px; justify-items: start; padding: 28px 4px; }
.empty h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.empty p { color: var(--muted); max-width: 56ch; }

/* ---------- Карточка клиента ---------- */
.c-top { display: grid; gap: 6px; }
.c-name { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.c-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 14px; }
.phone { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: .01em; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.dl { display: grid; grid-template-columns: minmax(96px, 32%) minmax(0, 1fr); gap: 10px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.ctask { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.ctask input[type="checkbox"] { margin-top: 2px; }
.ctask button.t { text-align: left; background: none; border: 0; padding: 0; color: var(--ink); display: grid; gap: 1px; min-width: 0; font-weight: 500; }
.ctask .when { font-size: 13px; color: var(--muted); font-weight: 400; }
.ctask .when.over { color: var(--danger); font-weight: 600; }
.ctasks { display: grid; gap: 12px; }
.tedit { display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--surface-2); }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 150px 108px 36px; gap: 8px; align-items: center; }
@media (max-width: 620px) { .trow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; } .trow .t-title { grid-column: 1 / -1; } }
.qd { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin: 8px 0 0 2px; }
.timeline li.n-system::before { background: var(--step-empty); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 20px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.n-system .t-text { color: var(--muted); font-size: 14px; }
.t-text { color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.t-raw { margin-top: 4px; font-size: 13px; color: var(--muted); }
.t-raw summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.t-raw p { margin-top: 4px; white-space: pre-wrap; }
.summary-text { font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }

/* ---------- Голосовая запись ---------- */
.voice { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.mic-row { display: flex; align-items: center; gap: 16px; }
.mic { --lvl: 0; position: relative; width: 80px; height: 80px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-fab); transition: transform .08s linear; }
.mic:hover { background: var(--accent-hover); }
.mic .i { width: 32px; height: 32px; }
.mic.on { background: var(--brand-red); color: #fff; transform: scale(calc(1 + var(--lvl) * .12)); box-shadow: 0 0 0 calc(6px + var(--lvl) * 14px) color-mix(in srgb, var(--brand-red) 20%, transparent); }
.mic:disabled { opacity: .55; }
.mic-text { display: grid; gap: 2px; min-width: 0; }
.mic-text b { font-size: 17px; font-weight: 600; color: var(--ink); }
.mic-text span { color: var(--muted); font-size: 14px; }
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.review { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.review h3 { font-size: 16px; font-weight: 600; }
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.changes li { display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 14px; }
.changes .k { color: var(--muted); }
.changes b { color: var(--ink); font-weight: 600; }
.changes s { color: var(--faint); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); }

/* ---------- Команда и воронка ---------- */
.fun { display: grid; gap: 2px; }
.fun-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 32px; align-items: center; gap: 10px; min-height: 28px; font-size: 14px; }
.fun-row .t { color: var(--muted); }
.fun-track { height: 12px; display: flex; align-items: center; }
.fun-bar { height: 12px; background: var(--st, var(--accent)); border-radius: 0 4px 4px 0; }
.fun-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.fun-sep { height: 1px; background: var(--line); margin: 4px 0; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-dot.ok::before { background: var(--ok); }
.status-dot.bad::before { background: var(--danger); }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.login form { width: 100%; max-width: 380px; display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow-md); }
.login .brand { justify-content: center; padding-bottom: 4px; }
.login .logo { width: 132px; }
.login h1 { font-size: 20px; font-weight: 600; text-align: center; }
.login p { text-align: center; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: #101828; color: #fff; padding: 12px 16px; border-radius: var(--r-btn); font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 14px; }
.toast button { background: none; border: 0; padding: 0; color: #fff; font-weight: 600; text-decoration: underline; }
@media (min-width: 960px) { .toast { bottom: 24px; left: calc(50% + 120px); } }

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

/* ---------- Удобство на телефоне ---------- */
.btn.lg { min-height: 52px; font-size: 16px; font-weight: 600; }
.call { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.call:active { background: var(--accent); color: var(--accent-ink); }
.call .i { width: 20px; height: 20px; }
.savebar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px); z-index: 5; }
.savebar .btn { box-shadow: var(--shadow-md); }
@media (min-width: 960px) { .savebar { bottom: 16px; } }
.filters { display: none; }
.filters.open { display: flex; }
.desk-only { display: none; }
@media (min-width: 960px) {
  .filters { display: flex; }
  .filter-btn { display: none; }
  .desk-only { display: flex; }
}
.center { text-align: center; }
.pad { padding: 16px 4px; }
.gap14 { gap: 14px; }
.ink { color: var(--ink); }
.h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.money { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 12px; }
.phone-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact .btn.primary { grid-column: 1 / -1; }
@media (min-width: 620px) { .contact { grid-template-columns: 1.4fr 1fr 1fr; } .contact .btn.primary { grid-column: auto; } }
.voice-cta { min-height: 56px; font-size: 16px; font-weight: 600; background: var(--accent-soft); border-color: transparent; color: var(--accent); box-shadow: none; }
.voice-cta:hover { background: var(--accent-soft); filter: brightness(.97); }
.voice-cta .i { width: 22px; height: 22px; }
.note-row { display: flex; gap: 8px; align-items: stretch; }
.note-row textarea { flex: 1; min-height: 44px; }
.said { font-size: 14px; color: var(--muted); }
.said summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.said p { margin: 6px 0; color: var(--text); white-space: pre-wrap; }
.result { border-color: var(--accent-soft); }
.check { align-items: flex-start; }
.check input { margin-top: 2px; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text); }
.howto b { color: var(--ink); font-weight: 600; }
.people { display: grid; }
.person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person.off { opacity: .55; }
.person .avatar { width: 36px; height: 36px; }
.person-main { display: grid; gap: 1px; min-width: 0; }
.person-main .muted { font-size: 13px; }
.person-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--text); }
.person-stats .over { color: var(--danger); font-weight: 600; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--st-line, var(--line)); color: var(--text); font-size: 12px; font-weight: 500; }
.src-chips { gap: 6px; }
.src-chips .chip { height: 34px; }
/* Распознавание на телефоне: текст появляется во время речи */
.live-text { min-height: 48px; padding: 12px 14px; border-radius: var(--r-field); background: var(--surface-2); color: var(--ink); font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.mic.on.live { animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-red) 22%, transparent); } 50% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--brand-red) 10%, transparent); } }
.is-recording .savebar { display: none; }
.voice { scroll-margin-top: calc(var(--top-h) + 16px); }
