/* Simple CRM. Палитра Simple: чёрный + лайм, мягкий серый фон, круглые белые карточки. */

@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/onest-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2212, U+FEFF; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  --bg: #eef0ea;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #2a2c26;
  --muted: #80847b;
  --line: #e4e6df;
  --soft: #f5f6f2;
  --lime: #d8ff32;
  --lime-2: #c6ef14;
  --lilac: #c9b8ff;
  --red: #e5484d;
  --red-bg: #ffe9e8;
  --amber-bg: #fff4cc;
  --green: #2f8f4e;
  --r-xl: 28px;
  --r-l: 20px;
  --r-m: 14px;
  --pill: 999px;
  --rail: 92px;
  --shadow: 0 1px 2px rgba(20, 22, 15, .04), 0 8px 24px rgba(20, 22, 15, .05);
}

html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 10px; }

/* ── Боковая панель (компьютер) / нижнее меню (телефон) ── */
.rail {
  position: fixed; inset: 12px auto 12px 12px; width: calc(var(--rail) - 12px);
  background: var(--ink); border-radius: var(--r-xl);
  display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0;
  z-index: 20;
}
.rail .logo i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--lime); color: var(--ink); }
.rail .logo svg { width: 72%; height: 72%; display: block; }
.nav { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: 1; }
.nav a, .nav .rec-open {
  width: 62px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 0; border-radius: 18px; text-decoration: none; color: #9a9e94;
  font-size: 11px; font-weight: 500; border: 0; background: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: #1c1d19; }
.nav a.on { color: var(--ink); background: var(--lime); }
.nav .rec-open { color: var(--ink); background: var(--lime); width: 62px; height: 62px; border-radius: 50%; padding: 0; justify-content: center; margin: 8px 0; box-shadow: 0 0 0 6px #1c1d19; }
.nav .rec-open span { display: none; }
.nav .rec-open svg { width: 26px; height: 26px; }
.nav .rec-open:hover { background: var(--lime-2); }
.me { width: 40px; height: 40px; border-radius: 50%; background: #23251f; color: #d6d9cf; display: grid; place-items: center; font-size: 13px; font-weight: 600; }

.page { margin-left: var(--rail); padding: 28px 28px 60px; min-width: 0; }
.page.narrow { margin: 0 auto; max-width: 420px; padding-top: 12vh; }

@media (max-width: 760px) {
  .rail {
    inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; width: auto; height: 68px;
    flex-direction: row; padding: 0 8px; border-radius: var(--pill); gap: 0;
  }
  .rail .logo, .me { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .nav a { width: auto; flex: 1; padding: 8px 0; background: none !important; color: #9a9e94; }
  .nav a.on { color: var(--lime); }
  .nav .rec-open { width: 56px; height: 56px; margin: 0 4px; flex: none; box-shadow: none; }
  .page { margin-left: 0; padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; }
}

/* ── Кнопки и поля ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(.98); }
.btn.lime { background: var(--lime); border-color: var(--lime); }
.btn.lime:hover { background: var(--lime-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #26281f; }
.btn.big { height: 52px; width: 100%; font-size: 16px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }

.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.fld > span { font-size: 13px; color: var(--muted); }
:where(input:not([type=radio]):not([type=checkbox]), select, textarea) {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--soft);
  outline: none; transition: border-color .15s, background .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: #fff; }
input[type=date] { -webkit-appearance: none; appearance: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

.card { background: var(--card); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); }
.err { color: var(--red); font-size: 14px; margin: 4px 0 12px; }
.ok { color: var(--green); font-size: 14px; margin: 4px 0 12px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; list-style: none; }
.hint { color: var(--muted); margin: -6px 0 14px; }

/* Аватар-кружок с буквами */
.av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.av.lg { width: 64px; height: 64px; font-size: 22px; }

/* ── Вход ── */
.login { display: flex; flex-direction: column; padding: 30px; }
.logo.big { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 600; margin-bottom: 26px; text-decoration: none; }
.logo.big img { border-radius: 12px; }

/* ── Воронка ── */
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.bar h1 { flex: 1; }
.search { flex: 1; max-width: 460px; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search input { height: 46px; padding-left: 44px; border-radius: var(--pill); background: var(--card); border-color: transparent; box-shadow: var(--shadow); }
@media (max-width: 760px) { .bar .btn span { display: none; } .bar .btn { width: 46px; height: 46px; padding: 0; } }

.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: 272px; gap: 14px;
  overflow-x: auto; padding-bottom: 12px; align-items: start;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
@media (max-width: 760px) { .board { grid-auto-columns: 84vw; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; scroll-snap-type: x mandatory; } }
.col { background: rgba(255,255,255,.5); border-radius: var(--r-xl); padding: 14px 10px 10px; min-height: 160px; scroll-snap-align: start; }
.col.drop { background: rgba(216,255,50,.35); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.col-n { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-k { min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--pill); background: var(--card); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.col.won .col-k { background: var(--lime); }
.col.lost .col-k { background: #e2e3dd; }
.col-s { font-size: 13px; color: var(--muted); padding: 2px 6px 10px; min-height: 18px; }
.col-b { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.deal {
  display: block; background: var(--card); border-radius: var(--r-l); padding: 14px;
  text-decoration: none; box-shadow: var(--shadow); cursor: grab;
  transition: transform .12s, box-shadow .12s; border: 1px solid transparent;
}
.deal:hover { border-color: var(--line); transform: translateY(-1px); }
.deal.dragging { opacity: .4; }
.deal-top { display: flex; gap: 10px; align-items: center; }
.deal-tc { display: flex; flex-direction: column; min-width: 0; }
.deal-t { font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.deal-c { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-m { margin-top: 10px; font-weight: 600; font-size: 14px; }
.step { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--soft); color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.step b { font-weight: 600; margin-right: 6px; }
.step.late { background: var(--red-bg); }
.step.late b { color: var(--red); }
.step.today { background: var(--amber-bg); }
.step.none { color: var(--muted); background: none; padding: 0; }
.col:not(.open) .deal { opacity: .85; }

/* ── Карточка сделки ── */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.deal-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.deal-head h1 { overflow-wrap: anywhere; }
.contacts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--ink-2); }
.contacts a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contacts b { font-weight: 600; }

.stages { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.st { flex: none; height: 38px; padding: 0 16px; border-radius: var(--pill); border: 0; background: var(--card); cursor: pointer; font-size: 14px; color: var(--ink-2); }
.st:hover { background: #fafbf7; }
.st.past { background: #e3f7a0; }
.st.on { background: var(--ink); color: #fff; }
.st.won.on { background: var(--lime); color: var(--ink); }
.st.lost.on { background: #8a8d85; color: #fff; }
@media (max-width: 760px) { .stages { margin: 0 -16px 18px; padding: 0 16px 6px; } }

.deal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .deal-grid { grid-template-columns: 1fr; } }
.side .card { padding: 20px; }
.side .card + .meta { margin-top: 12px; }
.meta { color: var(--muted); font-size: 13px; padding: 0 8px; }
.link-danger { background: none; border: 0; color: var(--red); font-size: 13px; padding: 8px; cursor: pointer; }
.next { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 18px; }
.next.late input { border-color: #f3b6b4; background: var(--red-bg); }
.next.today input { background: var(--amber-bg); }

/* Блок записи */
.say-card { margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.say-card .btn { align-self: flex-end; min-width: 140px; }
.kinds { display: inline-flex; background: var(--soft); border-radius: var(--pill); padding: 4px; gap: 4px; align-self: flex-start; }
.kinds label { cursor: pointer; }
.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kinds span { display: block; padding: 7px 16px; border-radius: var(--pill); font-size: 14px; color: var(--muted); }
.kinds input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.kinds input:focus-visible + span { outline: 2px solid var(--ink); }
.say { position: relative; }
.say textarea { min-height: 130px; padding-bottom: 60px; font-size: 16px; }
.mic {
  position: absolute; right: 10px; bottom: 10px; height: 44px; padding: 0 18px 0 14px;
  display: inline-flex; align-items: center; gap: 8px; border-radius: var(--pill);
  border: 0; background: var(--ink); color: #fff; cursor: pointer; font-weight: 500;
}
.mic:hover { background: #26281f; }
.mic.on { background: var(--red); animation: pulse 1.4s infinite; }
.mic.on span::after { content: " — стоп"; }
.mic[hidden] { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.45); } 70% { box-shadow: 0 0 0 12px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }

/* Лента записей */
.feed { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--card); border-radius: var(--r-l); padding: 16px 18px; box-shadow: var(--shadow); }
.note.meeting { border-left: 4px solid var(--lime); }
.note-h { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.note-h .who { margin-left: auto; }
.note-h form { display: inline; }
.tag { padding: 3px 10px; border-radius: var(--pill); background: var(--soft); color: var(--ink-2); font-weight: 500; }
.tag.meeting { background: var(--lime); color: var(--ink); }
.del { width: 26px; height: 26px; border-radius: 50%; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.del:hover { background: var(--red-bg); color: var(--red); }
.note-t { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.ev { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 4px 18px; font-size: 13px; color: var(--muted); }
.ev span { color: var(--ink-2); }
.ev time::before { content: "· "; }

/* ── Новая сделка ── */
.form { max-width: 720px; margin-top: 18px; }

/* ── Дела ── */
.seg { display: inline-flex; background: var(--card); border-radius: var(--pill); padding: 4px; box-shadow: var(--shadow); }
.seg a { padding: 7px 18px; border-radius: var(--pill); text-decoration: none; color: var(--muted); font-size: 14px; }
.seg a.on { background: var(--ink); color: #fff; }
.tgroup { margin-bottom: 22px; max-width: 900px; }
.tgroup h2 { font-size: 15px; margin: 0 0 10px 6px; display: flex; align-items: center; gap: 8px; }
.tgroup h2 span { min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--pill); background: var(--card); display: grid; place-items: center; font-size: 12px; }
.tgroup.late h2 span { background: var(--red); color: #fff; }
.tgroup.today h2 span { background: var(--lime); }
.tlist { list-style: none; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; }
.tlist li + li { border-top: 1px solid var(--line); }
.tlist a { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; text-decoration: none; }
.tlist a:hover { background: var(--soft); }
.tl-d { font-weight: 600; font-size: 14px; }
.tgroup.late .tl-d { color: var(--red); }
.tl-m { display: flex; flex-direction: column; min-width: 0; }
.tl-m b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-m span { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.tl-s { font-size: 13px; color: var(--muted); text-align: right; }
@media (max-width: 560px) {
  .tlist a { grid-template-columns: 1fr; gap: 2px; }
  .tl-s { text-align: left; }
  .tgroup.none .tl-d, .tl-d:empty { display: none; }
}

/* ── Настройки ── */
.page > .card { margin: 18px 0; max-width: 820px; }
.page > .card h2 { margin-bottom: 14px; }
.stg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.stg { display: grid; grid-template-columns: 32px minmax(0, 1fr) 128px 32px; gap: 8px; align-items: center; }
.stg .cnt { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 12px; color: var(--muted); justify-self: center; }
.rm, .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.rm input, .chk input { width: 18px; height: 18px; accent-color: var(--ink); }
@media (max-width: 560px) { .stg { grid-template-columns: 28px minmax(0, 1fr) 104px 28px; gap: 6px; } .page > .card { padding: 18px 14px; } .stg select { padding: 0 8px; font-size: 14px; } }
.stg .mv { display: flex; flex-direction: column; align-items: center; }
.stg .mv button { width: 28px; height: 20px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 6px; }
.stg .mv button:hover { background: var(--soft); color: var(--ink); }
.stg:first-child .mv [data-up], .stg:last-child .mv [data-down] { visibility: hidden; }
.stg .mv.plus { color: var(--muted); }
.stg .kind.won { background: #f1ffc2; }
.stg .kind.lost { background: #ececea; color: var(--muted); }
.stg.removed input:not([type=hidden]), .stg.removed select { text-decoration: line-through; opacity: .45; }
.stg.removed [data-drop-stage] { background: var(--red-bg); color: var(--red); }
.stg.add { margin: 0 0 16px; }
.ulist { list-style: none; margin-bottom: 16px; }
.ulist li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ulist li.off { opacity: .55; }
.ubtn { display: inline-flex; gap: 6px; }
.uadd { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .uadd { grid-template-columns: 1fr; } }
.pass-once { display: flex; flex-direction: column; gap: 6px; background: var(--lime) !important; }
.pass-once code { font-size: 18px; font-family: ui-monospace, Menlo, monospace; }
.pass-once span { font-size: 13px; }

/* ── Окно «Записать» ── */
.sheet { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; margin: auto; }
.sheet::backdrop { background: rgba(11, 11, 11, .45); backdrop-filter: blur(3px); }
.sheet-in { width: min(600px, calc(100vw - 24px)); background: var(--card); border-radius: var(--r-xl); padding: 22px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-in .fld { margin-bottom: 0; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); font-size: 22px; cursor: pointer; }
@media (max-width: 760px) {
  .sheet { margin: auto 0 0; width: 100vw; }
  .sheet-in { width: 100vw; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; }
}
.note-h .tag, .note-h time, .note-h .who { white-space: nowrap; }
.note-h .who { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sheet-in .row2 { gap: 12px; }

/* ── Сводка над воронкой ── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; max-width: 1100px; }
.tile { background: var(--card); border-radius: var(--r-l); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.tile span { font-size: 13px; color: var(--muted); grid-column: 1 / 3; }
.tile b { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile i { font-style: normal; font-size: 13px; color: var(--muted); align-self: end; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.dark { background: var(--ink); color: #fff; }
.tile.dark span, .tile.dark i { color: #a3a79c; }
.tile.lime { background: var(--lime); }
.tile.lime span, .tile.lime i { color: #4b5a10; }
.tile.red b { color: var(--red); }
a.tile:hover { transform: translateY(-1px); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile b { font-size: 26px; }
}

/* Этапы-фишки (на телефоне вместо заголовков колонок) */
.chips { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 38px; padding: 0 8px 0 14px; border-radius: var(--pill); background: var(--card); text-decoration: none; font-size: 14px; color: var(--ink-2); border: 0; cursor: pointer; }
.chip b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--soft); display: grid; place-items: center; font-size: 12px; }
.chip.on { background: var(--ink); color: #fff; }
.chip.on b { background: var(--lime); color: var(--ink); }
@media (max-width: 760px) {
  .chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .bar { flex-wrap: wrap; }
  .search { flex-basis: 100%; max-width: none; order: 1; }
  .bar .seg { order: 2; flex: 1; }
  .bar .seg a { flex: 1; text-align: center; }
  .bar .add { order: 3; }
  .bar .seg { display: flex; }
}

/* ── Вход ── */
.page.bare { margin: 0; padding: 0; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
.login-art { position: relative; overflow: hidden; background: #ebebe6; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); background: var(--card); }
.login h1 { font-size: 34px; margin-bottom: 28px; }
.login .btn { margin-top: 8px; }
.logo.big { margin-bottom: 40px; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: 42vh auto; }
  .login-art img { object-position: 50% 40%; }
  .login { border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: -28px; position: relative; padding: 28px 20px 40px; justify-content: flex-start; }
  .login h1 { font-size: 26px; margin-bottom: 20px; }
  .logo.big { margin-bottom: 18px; font-size: 18px; }
  .logo.big img { width: 36px; height: 36px; }
}

/* ── Карточка: доработки ── */
.say-foot { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; }
.say-card .say-foot .btn { align-self: stretch; }
@media (max-width: 560px) { .say-foot { grid-template-columns: 1fr 1fr; } .say-foot input:first-child { grid-column: 1 / 3; } }
.next-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.next.focus input { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(216,255,50,.6); }
.btn.done { height: 44px; background: var(--lime); border-color: var(--lime); }
.contacts .tel { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--lime); padding: 2px 12px 2px 8px; border-radius: var(--pill); font-weight: 500; }
.ic { width: 28px; height: 28px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; font-size: 18px; line-height: 1; }
.ic:hover { background: var(--soft); color: var(--ink); }
.ic.del:hover { background: var(--red-bg); color: var(--red); }
.note-h .who { margin-left: auto; }
.note-edit { display: flex; flex-direction: column; gap: 8px; }
.note-edit-b { display: flex; justify-content: flex-end; gap: 8px; }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.reasons .chip { background: var(--soft); padding: 0 16px; }
.reasons .chip:hover { background: var(--lime); }

/* Пустые экраны с картинкой */
.empty-art { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 20px; color: var(--muted); text-align: center; font-size: 14px; }
.empty-art img { border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%); mask-image: radial-gradient(circle, #000 55%, transparent 71%); }
.empty-art.big { padding-top: 6vh; }
.empty-art.big b { color: var(--ink); font-size: 18px; font-weight: 600; }

/* Дела: галочка «Сделано» */
.tlist li { display: flex; align-items: center; }
.tlist li > a { flex: 1; min-width: 0; padding-left: 6px; }
.tlist li > form { padding-left: 14px; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: transparent; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.tick:hover { border-color: var(--ink); background: var(--lime); color: var(--ink); }
.tick-ph { width: 48px; flex: none; }

/* Эмблема Simple: нож в квадрате + «simple», как на simplemind.ru */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.brand i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: var(--lime); font-style: normal; flex: none; }
.brand i svg { width: 72%; height: 72%; display: block; }
.brand em { font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .04em; background: var(--lime); padding: 3px 8px; border-radius: var(--pill); align-self: center; }
.brand.big { margin-bottom: 40px; }
@media (max-width: 760px) { .brand.big { margin-bottom: 18px; font-size: 20px; } .brand.big i { width: 36px; height: 36px; } }
.mtop { display: none; text-decoration: none; }
@media (max-width: 760px) { .mtop { display: flex; margin-bottom: 14px; } .mtop .brand { font-size: 19px; } .mtop .brand i { width: 34px; height: 34px; border-radius: 11px; } }

/* ── Красная цифра на «Дела» ── */
.nav a { position: relative; }
.badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; font-weight: 600; display: grid; place-items: center; }
@media (max-width: 760px) { .badge { top: 2px; right: calc(50% - 22px); } .nav a span { font-size: 10px; } }
.row2.keep { grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Время у следующего шага ── */
.say-foot { grid-template-columns: minmax(0, 1fr) 150px 110px auto; }
@media (max-width: 560px) { .say-foot { grid-template-columns: 1fr 1fr; } .say-foot input:first-child, .say-foot .btn { grid-column: 1 / 3; } }
.next-row { grid-template-columns: minmax(0, 1fr) 96px auto; }

/* ── Календарь ── */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { padding: 18px; }
.cal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-h h2 { min-width: 150px; text-align: center; }
.ic.big { width: 40px; height: 40px; background: var(--soft); text-decoration: none; }
.ic.fwd svg { transform: scaleX(-1); }
.cal-h .btn { margin-left: auto; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-w span { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cd { min-height: 96px; border-radius: 14px; background: var(--soft); padding: 6px 7px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; min-width: 0; }
.cd:hover { border-color: var(--line); }
.cd.out { opacity: .4; }
.cd-n { font-size: 13px; font-weight: 600; }
.cd.today .cd-n { background: var(--ink); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; margin: -2px; }
.cd.sel { border-color: var(--ink); background: #fff; }
.cd-dots { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cd-dots .ch { font-style: normal; font-size: 11px; line-height: 1.25; background: var(--lime); border-radius: 6px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd.late .ch { background: var(--red-bg); }
.cd-dots .ch b { font-weight: 600; }
.cd-dots .more { font-style: normal; font-size: 11px; color: var(--muted); }
.cd-dots em { display: none; }
@media (max-width: 760px) {
  .cal { padding: 14px 10px; margin: 0 -4px; }
  .cal-w, .cal-g { gap: 3px; }
  .cd { min-height: 48px; align-items: center; padding: 5px 2px; border-radius: 12px; }
  .cd-dots .ch, .cd-dots .more { display: none; }
  .cd-dots em { display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 600; min-width: 20px; height: 18px; border-radius: 9px; background: var(--lime); padding: 0 5px; }
  .cd.late .cd-dots em { background: var(--red); color: #fff; }
  .cal-h h2 { font-size: 17px; min-width: 0; flex: 1; }
}
.day h2 { margin-bottom: 10px; }
.day h3.late { color: var(--red); }
.day-empty { font-size: 14px; }
.ag { list-style: none; margin-bottom: 8px; }
.ag li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.ag li:last-child { border-bottom: 0; }
.ag li > a:first-child { flex: 1; min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 2px; text-decoration: none; }
.ag-t { font-weight: 600; font-size: 14px; }
.ag-t.late { color: var(--red); font-size: 12px; }
.ag-m { display: flex; flex-direction: column; min-width: 0; }
.ag-m b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-m span { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.ag-m i { font-style: normal; font-size: 12px; color: var(--muted); }
.ag-call { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; }

/* ── Окно «Дела на сегодня» и напоминание ── */
.agenda { list-style: none; }
.agenda li a { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.agenda .t { font-weight: 600; font-size: 14px; }
.agenda .t.late { color: var(--red); }
.agenda b { font-weight: 600; display: block; }
.agenda span span { font-size: 14px; color: var(--ink-2); }
.remind { position: fixed; right: 16px; top: 16px; z-index: 90; width: min(360px, calc(100vw - 32px)); background: var(--ink); color: #fff; border-radius: 20px; padding: 14px 16px; box-shadow: 0 12px 32px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; }
.remind a { color: #fff; text-decoration: none; flex: 1; min-width: 0; }
.remind a b { color: var(--lime); display: block; font-size: 13px; font-weight: 600; }
.remind button { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #2a2c26; color: #fff; font-size: 18px; cursor: pointer; }
/* Поля даты и времени не распирают строку на телефоне */
input[type=date], input[type=time] { min-width: 0; max-width: 100%; display: block; }
.row2.keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.next-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.next-row .done { grid-column: 1 / 3; }
@media (max-width: 560px) { .say-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.deal-grid { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1000px) { .deal-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .nav a { flex: 1 1 0; min-width: 0; }
  .nav a span { font-size: 10px; white-space: nowrap; overflow: hidden; max-width: 100%; }
  .rail { padding: 0 6px; }
}

/* ── Вкладки воронок (директора / менеджеры) ── */
.ptabs { display: inline-flex; gap: 4px; background: var(--card); border-radius: var(--pill); padding: 4px; margin-bottom: 14px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ptabs a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--pill); text-decoration: none; font-weight: 500; color: var(--muted); white-space: nowrap; }
.ptabs a.on { background: var(--ink); color: #fff; }
.ptabs a i { display: inline-grid; font-style: normal; opacity: .7; }
.ptabs a.on i { color: var(--lime); opacity: 1; }
@media (max-width: 760px) { .ptabs { display: flex; } .ptabs a { flex: 1; justify-content: center; } }

/* Передать в другую воронку */
.card.move { margin-top: 14px; }
.card.move .btn { width: 100%; }

/* Настройки: воронки */
.pipe-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pipe-name { max-width: 260px; font-size: 18px !important; font-weight: 600; height: 46px; }
.pipe-h .muted { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.stg { grid-template-columns: 32px minmax(0, 1fr) 128px 36px 32px; }
@media (max-width: 560px) { .stg { grid-template-columns: 26px minmax(0, 1fr) 96px 30px 26px; gap: 5px; } }
.askd { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--muted); position: relative; }
.askd input { position: absolute; opacity: 0; pointer-events: none; }
.askd:has(input:checked) { background: var(--lime); color: var(--ink); }
.askd svg { width: 18px; height: 18px; }
.hint.small { font-size: 12px; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.hint.small svg { width: 14px; height: 14px; }
.ulist form { display: inline; }
.ulist .btn.sm svg { width: 13px; height: 13px; }

/* ══ Чаты ══ */
.chats { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; height: calc(100vh - 56px); min-height: 480px; }
.rooms { background: var(--card); border-radius: var(--r-xl); padding: 16px 10px; overflow-y: auto; box-shadow: var(--shadow); }
.rooms-h { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
.rooms-h h1 { font-size: 24px; }
.rlist { list-style: none; }
.rlist a, .rlist button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; text-decoration: none; border: 0; background: none; cursor: pointer; text-align: left; }
.rlist a:hover, .rlist button:hover { background: var(--soft); }
.rlist a.on { background: var(--ink); color: #fff; }
.rlist a.on .rl-m span { color: #b9bdb2; }
.rl-m { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rl-m b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-m span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-h { padding: 14px 10px 4px; }
.unread { font-style: normal; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.av.sm { width: 40px; height: 40px; font-size: 14px; }
.room-ic { background: var(--lime) !important; }
.room-ic.grp { background: var(--lilac) !important; }
.room-ic svg { width: 20px; height: 20px; }

.room { background: var(--card); border-radius: var(--r-xl); display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow); overflow: hidden; }
.room.none { justify-content: center; }
.room-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.room-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.room-t b { font-weight: 600; }
.room-t span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-r { display: none; }
.msgs { list-style: none; flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--soft); }
.day-sep { text-align: center; margin: 10px 0 4px; }
.day-sep span { font-size: 12px; color: var(--muted); background: var(--card); padding: 3px 10px; border-radius: var(--pill); }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .av.sm { width: 32px; height: 32px; font-size: 12px; }
.bub { background: var(--card); border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; min-width: 0; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.msg.mine .bub { background: var(--ink); color: #fff; border-radius: 18px 18px 6px 18px; }
.bub .who { font-size: 12px; font-weight: 600; color: #5d6a1a; display: block; margin-bottom: 2px; }
.txt { white-space: pre-wrap; overflow-wrap: break-word; line-height: 1.4; }
.bub .meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.msg.mine .meta { color: #9a9e94; }
.mact { display: none; align-items: center; gap: 3px; border: 0; background: none; color: inherit; font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.mact svg { width: 12px; height: 12px; }
.mact:hover { background: rgba(127,127,127,.15); }
.msg:hover .mact, .msg.act .mact { display: inline-flex; }
.msg.ev { align-self: center; max-width: 90%; font-size: 12px; color: var(--muted); gap: 6px; }
.msg.ev span { background: var(--card); padding: 4px 12px; border-radius: var(--pill); }
.msgs .empty { margin: auto; }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.cmp-in { flex: 1; position: relative; min-width: 0; }
.cmp-in textarea { min-height: 44px; max-height: 160px; padding: 11px 44px 11px 14px; border-radius: 22px; resize: none; line-height: 1.4; display: block; }
.mic-s { position: absolute; right: 4px; bottom: 4px; width: 36px; height: 36px; }
.mic-s.on { background: var(--red); color: #fff; animation: pulse 1.4s infinite; }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--lime); display: grid; place-items: center; cursor: pointer; }
.send:hover { background: var(--lime-2); }
.composer .ic.big { flex: none; width: 44px; height: 44px; }

/* карточка задачи — в чате, в карточке клиента */
.task { display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 12px; margin: 4px 0; border: 1px solid var(--line); min-width: 220px; }
.task-i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; }
.task-i svg { width: 16px; height: 16px; }
.task-b { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-b b { font-weight: 600; overflow-wrap: break-word; }
.task-b span { font-size: 12px; color: var(--muted); }
.task-b a { color: var(--ink); }
.task.late { border-color: #f3b6b4; background: var(--red-bg); }
.task.done { opacity: .6; }
.task.done b { text-decoration: line-through; }
.task.done .task-i { background: var(--soft); }
.task-s { font-size: 12px; color: var(--green); font-weight: 600; }
.dtasks { margin-top: 14px; }
.dt-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dt-h h3 { margin: 0; }
.dtasks .task { min-width: 0; }
.muted.small { font-size: 13px; }
.ttag { font-style: normal; background: var(--lilac); color: var(--ink); padding: 1px 8px; border-radius: var(--pill); font-size: 11px; font-weight: 500; }
.mem { display: flex; flex-direction: column; gap: 8px; }
.bar .add[data-task-new] { margin-left: auto; }

/* мобильная шапка с настройками */
.mtop { justify-content: space-between; align-items: center; }
.mtop > a:first-child { text-decoration: none; }

@media (max-width: 760px) {
  .chats { display: block; height: auto; }
  .chats .room { display: none; }
  .chats.open .rooms { display: none; }
  .chats.open .room { display: flex; position: fixed; inset: 0 0 calc(92px + env(safe-area-inset-bottom)) 0; border-radius: 0; z-index: 15; }
  .back-r { display: grid; }
  .msg { max-width: 88%; }
  .rooms { padding: 12px 6px; }
  .nav a[href="/settings"] { display: none; }
  .task { min-width: 0; }
}
.badge[hidden], [hidden] { display: none !important; }

/* Списки выбора одинаковые во всех браузерах (в Safari были серые) */
select { -webkit-appearance: none; appearance: none; padding-right: 38px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2380847b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }

/* Safari: дата и время по центру поля, как остальной текст */
input[type=date], input[type=time] { padding-top: 10px !important; padding-bottom: 10px !important; line-height: 22px; font-variant-numeric: tabular-nums; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; line-height: 22px; min-height: 22px; }
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit { padding: 0; line-height: 22px; }
input[type=date]::-webkit-datetime-edit-fields-wrapper, input[type=time]::-webkit-datetime-edit-fields-wrapper { padding: 0; }

/* ── Карточка клиента: запись → «Что дальше?» ── */
.then { background: var(--soft); border-radius: var(--r-m); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.then-h { font-size: 13px; font-weight: 600; color: var(--muted); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row .chip { background: var(--card); height: 36px; padding: 0 14px; }
.chips-row .chip.on { background: var(--ink); color: #fff; }
.then-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px; gap: 8px; }
.then-row input { background: var(--card); }
@media (max-width: 560px) { .then-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .then-row input:first-child { grid-column: 1 / 3; } }
.say-card .btn.big { align-self: stretch; width: 100%; }

.nextcard { border-left: 4px solid var(--line); }
.nextcard.today { border-left-color: var(--lime); }
.nextcard.late { border-left-color: var(--red); }
.next-now { display: flex; flex-direction: column; gap: 6px; }
.next-now b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.next-when { font-size: 14px; color: var(--ink-2); }
.nextcard.late .next-when { color: var(--red); font-weight: 600; }
.next-now .done { align-self: flex-start; margin-top: 4px; }
details.more { margin-top: 10px; }
details.more summary, .more-card summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details.more summary::before, .more-card summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 4px; transition: transform .15s; }
details[open].more summary::before, .more-card[open] summary::before { transform: rotate(45deg); }
details.more summary::-webkit-details-marker, .more-card summary::-webkit-details-marker { display: none; }
details.more input, details.more .row2 { margin-top: 8px; }
details.more .btn { margin-top: 10px; }

.who .kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.who .kv:last-of-type { border-bottom: 0; }
.who .kv span { color: var(--muted); }
.who .kv b { font-weight: 500; overflow-wrap: anywhere; }
.who .kv a { text-decoration: none; border-bottom: 1px solid var(--line); }
#who-edit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.more-card summary { font-weight: 600; color: var(--ink); font-size: 15px; }
.more-card[open] summary { margin-bottom: 12px; }
.more-card .move h3 { margin-top: 4px; }
.more-card .meta { padding: 10px 0 0; }
.note.call { border-left: 4px solid var(--lilac); }
.tag.call { background: var(--lilac); color: var(--ink); }

/* Safari: цифры даты и времени без лишних отступов */
input[type=date]::-webkit-datetime-edit-text { padding: 0 1px; color: var(--muted); }
input[type=date]::-webkit-datetime-edit-day-field, input[type=date]::-webkit-datetime-edit-month-field, input[type=date]::-webkit-datetime-edit-year-field,
input[type=time]::-webkit-datetime-edit-hour-field, input[type=time]::-webkit-datetime-edit-minute-field, input[type=time]::-webkit-datetime-edit-ampm-field { padding: 0; margin: 0; letter-spacing: 0; }
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit { display: inline-flex; align-items: center; letter-spacing: 0; font-feature-settings: "tnum"; }
input[type=date], input[type=time] { font-family: Onest, system-ui, sans-serif; font-size: 15px; }
/* Правая колонка: карточки с ровным зазором, а не впритык */
.side { display: flex; flex-direction: column; gap: 14px; }
.side .card, .side .card.move, .side .dtasks, .side .more-card { margin: 0; }
.side > .meta { margin: 0; }

/* Дубль клиента */
.dupe { background: var(--amber-bg); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.dupe ul { list-style: none; margin: 6px 0 8px; }
.dupe li { padding: 3px 0; }
.dupe li a { font-weight: 600; }
.dupe li span { color: var(--muted); }
/* Подсказка этапа в настройках */
.stg-hint { grid-column: 2 / 6; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: -2px 0 4px; flex-wrap: wrap; }
.stg-hint input { height: 32px; font-size: 13px; flex: 1; min-width: 140px; padding: 0 10px; }
.stg-hint input.days { flex: none; width: 54px; text-align: center; }

.deal-head { flex-wrap: wrap; }
.deal-act { margin-left: auto; }
@media (max-width: 760px) { .deal-act { margin-left: 0; width: 100%; } }

/* ── Файлы ── */
.fimg { display: block; margin: 4px 0; }
.fimg img { max-width: min(280px, 100%); max-height: 240px; border-radius: 12px; display: block; }
.fcard { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 12px; padding: 8px 10px; margin: 4px 0; text-decoration: none; color: var(--ink); max-width: 320px; }
.msg.mine .fcard { background: #26281f; color: #fff; }
.fext { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.fname { display: flex; flex-direction: column; min-width: 0; }
.fname b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fname span { font-size: 12px; color: var(--muted); }
.msg.mine .fname span { color: #9a9e94; }
.note-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.note-files .fcard, .note-files .fimg { margin: 0; }
.note-files .fimg img { max-width: 160px; max-height: 120px; }
.composer .clip { cursor: pointer; }
.composer .clip.busy { opacity: .5; pointer-events: none; }
.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clip-btn { cursor: pointer; }
.attach-list { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* ── Материалы ── */
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 14px 0 22px; max-width: 1100px; }
.mat { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.mat .fcard { max-width: none; }
.mat-b { display: flex; flex-direction: column; gap: 2px; }
.mat-b b { font-weight: 600; }
.mat-b span { font-size: 13px; color: var(--muted); }
.mat-a { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.mat-a form { display: inline; }
.mat-add { max-width: 720px; }
.mat-add h2 { margin-bottom: 14px; }
.mat-add .chk { margin-bottom: 14px; }
input[type=file] { height: auto; padding: 10px 14px; }
.mtop-r { display: flex; gap: 8px; }
@media (max-width: 760px) { .nav a[href="/materials"] { display: none; } }

/* ── Деньги ── */
.monthnav { display: flex; align-items: center; gap: 8px; }
.monthnav b { min-width: 150px; text-align: center; font-weight: 600; }
.money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1100px; margin-bottom: 18px; }
@media (max-width: 860px) { .money-grid { grid-template-columns: 1fr; } }
.money-grid section { display: flex; flex-direction: column; gap: 12px; }
.payform { display: flex; flex-direction: column; gap: 8px; }
.payform h3 { margin: 0 0 4px; }
.payform .btn { align-self: flex-start; }
.payform .kinds { align-self: flex-start; }
.plist { list-style: none; }
.plist.card { padding: 6px 18px; }
.pay { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay:last-child { border-bottom: 0; }
.pay-d { flex: none; width: 70px; font-size: 13px; color: var(--muted); }
.pay-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-m b { font-weight: 600; }
.pay.in .pay-m b { color: var(--green); }
.pay-m span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pay-m a { color: var(--ink); text-decoration: none; }
.plist .empty { padding: 14px 0; }
.subs { max-width: 1100px; }
.subs h3 { margin-bottom: 6px; }
.moneyb .mtot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.moneyb .mtot span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 8px 10px; }
.moneyb .mtot b { font-size: 15px; color: var(--ink); }
.neg { color: var(--red) !important; }
.moneyb .plist { margin: 4px 0 8px; }
.moneyb .pay { padding: 7px 0; }
.moneyb details.more .payform { margin-top: 8px; }
.tile b.neg { color: var(--red); }
.tile.dark b.neg { color: #ff8a8a; }
@media (max-width: 760px) { .money-stats .tile b { font-size: 21px; } .money-stats .tile i { white-space: normal; text-align: left; } .money-stats .tile { grid-template-columns: 1fr; } }

/* Кнопки «Написать в мессенджер» */
.msgr { display: inline-flex; gap: 6px; align-items: center; }
.msgr a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); border: 0 !important; transition: transform .12s; }
.msgr a:hover { transform: translateY(-1px); }
.msgr svg { width: 24px; height: 24px; }
.msgr .dim { opacity: .35; cursor: pointer; }
.msgr .dim:hover { opacity: .7; }

.mats.in-settings { margin: 10px 0 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mats.in-settings .mat { background: var(--soft); box-shadow: none; padding: 14px; }
.mat-add-s { border-top: 1px solid var(--line); padding-top: 14px; }
.mat-add-s .chk { align-self: center; margin-top: 18px; }
.uadd { grid-template-columns: 1fr 1fr 1fr auto auto; }
@media (max-width: 700px) { .uadd { grid-template-columns: 1fr; } }
/* Телефон: строка этапа в две строки — название целиком, под ним тип и кнопки */
@media (max-width: 560px) {
  .stg { grid-template-columns: 26px minmax(0, 1fr) 36px 30px; grid-template-areas: "mv name name name" "mv kind ask del" "hint hint hint hint"; gap: 6px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .stg .mv { grid-area: mv; }
  .stg > input[name^="name_"] { grid-area: name; }
  .stg select.kind { grid-area: kind; }
  .stg .askd { grid-area: ask; }
  .stg .cnt, .stg [data-drop-stage] { grid-area: del; justify-self: center; }
  .stg > span:empty { display: none; }
  .stg-hint { grid-area: hint; grid-column: 1 / -1; margin: 0; }
  .stg-hint input { min-width: 0; flex: 1 1 120px; }
  .stg.add { border-bottom: 0; }
}
@media (max-width: 560px) { .stg-hint { gap: 4px; } .stg-hint input { flex: 1 1 80px; } .stg-hint input.days { width: 46px; flex: none; } .stg-hint span { white-space: nowrap; } }

/* Поле даты/времени: системное поле прозрачное, сверху наша надпись */
.dt { position: relative; display: block; min-width: 0; }
.dt-v { display: flex; align-items: center; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-v.ph { color: var(--muted); }
.dt.focus .dt-v { border-color: var(--ink); background: #fff; }
.dt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; padding: 0; min-height: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.then-row .dt-v, .next-row .dt-v, .say-foot .dt-v { background: var(--card); }

/* Поиск по всем воронкам */
.found { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-width: 1100px; }
.deal-where { font-size: 13px; color: var(--muted); margin-top: 6px; }
/* Отчёты */
.reports { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; max-width: 1100px; }
.rep h2 { margin-bottom: 12px; }
.rows { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rows li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.rl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.rb .bar { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.rb .bar.red { background: var(--red); }
.rb .bar.lime { background: var(--lime); }
.rn { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Настройки: вкладки */
.stabs { margin-bottom: 16px; }
.page > .card.stab, .stab > .card { margin-top: 0; }
.stab[hidden] { display: none !important; }
.stab > .card + .card { margin-top: 18px; }
.page > form.card.stab { margin-top: 0; }
.page > form[action="/logout"] { margin-top: 18px; }

/* Пустая воронка */
.empty-board { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0 18px; color: var(--muted); }
.empty-board img { width: 220px; height: 220px; border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%); mask-image: radial-gradient(circle, #000 55%, transparent 71%); }
.empty-board b { color: var(--ink); font-size: 18px; font-weight: 600; }
.board.faded .col { opacity: .6; }
.me { text-decoration: none; transition: background .15s; }
.me:hover { background: var(--lime); color: var(--ink); }
.me[data-on] { background: var(--lime); color: var(--ink); }
.me-top { display: grid !important; width: 40px; height: 40px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
@media (max-width: 760px) { .nav a[href="/settings"] { display: none; } }

@media (max-width: 760px) {
  .money-stats .tile { grid-template-columns: 1fr !important; }
  .money-stats .tile b { font-size: 20px !important; white-space: nowrap; }
  .money-stats .tile i { white-space: normal !important; text-align: left; overflow: visible; }
  .stabs { scroll-snap-type: x proximity; }
}
@media (max-width: 760px) { .nav a[href="/money"] span { font-size: 10px; } }

/* ══ Меню вокруг воронки (07.11.2026) ══ */
.nav .hub {
  width: 62px; height: 62px; border-radius: 50%; padding: 0; margin: 8px 0; justify-content: center;
  background: var(--lime); color: var(--ink); box-shadow: 0 0 0 6px #1c1d19; display: flex; flex-direction: column; align-items: center; text-decoration: none;
}
.nav .hub span { display: none; }
.nav .hub svg { width: 26px; height: 26px; }
.nav .hub:hover { background: var(--lime-2); color: var(--ink); }
.nav .hub.on { box-shadow: 0 0 0 6px #1c1d19, 0 0 0 9px var(--lime); }
.nav a:not(.hub).on { color: var(--ink); background: var(--lime); }
@media (max-width: 760px) {
  .nav { display: grid !important; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; }
  .nav .hub { width: 58px; height: 58px; margin: 0 6px; box-shadow: none; }
  .nav .hub.on { box-shadow: 0 0 0 3px #0b0b0b, 0 0 0 5px var(--lime); }
  .nav a[href="/settings#materials"], .nav a[href="/money"] { display: flex !important; }
  .nav a:not(.hub).on { background: none; color: var(--lime); }
}
/* Кнопка «Записать» на воронке */
.rec-btn { background: var(--lime); border-color: var(--lime); }
.rec-btn:hover { background: var(--lime-2); }
@media (max-width: 760px) { .bar .rec-btn span { display: none; } .bar .rec-btn { width: 46px; height: 46px; padding: 0; order: 3; } }

/* Отклик на нажатие */
.loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--lime); z-index: 200; box-shadow: 0 0 8px rgba(216,255,50,.8); transition: none; pointer-events: none; }
html.loading .loadbar { width: 85%; transition: width 2.5s cubic-bezier(.1,.7,.2,1); }
a.pressed, .nav a.pressed { opacity: .65; }
.nav a:active, .btn:active, .deal:active, .chip:active { transform: scale(.97); }
html.loading { cursor: progress; }
/* Центральная «Воронка» всегда лаймовая — и на телефоне тоже */
.nav a.hub, .nav a.hub.on, .nav a.hub:hover { background: var(--lime) !important; color: var(--ink) !important; }
@media (max-width: 760px) { .nav a.hub { flex: none; width: 58px; padding: 0; } }

/* ══ Лёгкость (07.11.2026): строки длинных списков рисуются, только когда видны на экране ══ */
.tlist > li, .ag > li { content-visibility: auto; contain-intrinsic-size: auto 64px; }
