:root {
  color-scheme: light;
  --bg: #F2F2F2;
  --surface: #FFFFFF;
  --fill: #F4F4F5;
  --fill-2: #EBEBEC;
  --ink: #111111;
  --muted: #6E6E73;
  --faint: #A1A1A6;
  --line: #ECECEE;
  --accent: #FF5F1F;
  --ok: #1F9D55;
  /* приоритеты: высокий — акцент, средний — чернила, низкий — серый */
  --hi: var(--accent);
  --mid: #111111;
  --low: #C7C7CC;
  --own-1: #111111;
  --own-2: #B5B5BA;
  --r-lg: 22px;
  --r-md: 16px;
  --shadow: 0 1px 2px rgb(0 0 0 / .03), 0 6px 20px rgb(0 0 0 / .04);
  --display: 'Inter', system-ui, -apple-system, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Inter', system-ui, -apple-system, sans-serif;
  --tabbar-h: 76px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); font-feature-settings: 'tnum' 1, 'cv11' 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mono { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ── шапка ── */
.top { max-width: 1200px; margin: 0 auto; padding: 18px 16px 8px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; }
.top h1 { font: 600 26px/1.15 var(--display); letter-spacing: -0.02em; margin: 2px 0 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.icon-btn.small { width: 40px; height: 40px; box-shadow: none; background: var(--fill-2); }
.icon-btn.small[aria-expanded="true"] { background: var(--ink); color: #fff; }
.search-wrap { flex: 1 1 100%; position: relative; }
.search-wrap[hidden] { display: none; }
.search-x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--fill); cursor: pointer; font-size: 17px; color: var(--muted); }
.search { width: 100%; padding-right: 46px !important; height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); outline-offset: 0; }
.search::placeholder { color: var(--faint); }
.seg { display: inline-flex; background: var(--fill-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.pill-chk { display: inline-flex; cursor: pointer; }
.pill-chk input { position: absolute; opacity: 0; pointer-events: none; }
.pill-chk span { padding: 8px 14px; border-radius: 999px; background: var(--fill-2); color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.pill-chk input:checked + span { background: var(--ink); color: #fff; }
.pill-chk input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── нижняя панель вкладок ── */
.tabbar { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; display: flex; gap: 2px; padding: 6px; background: rgb(255 255 255 / .92); backdrop-filter: blur(16px); border-radius: 999px; box-shadow: 0 8px 30px rgb(0 0 0 / .10); width: min(420px, calc(100vw - 24px)); }
.tabbar button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--faint); cursor: pointer; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-pressed="true"] { background: var(--fill-2); color: var(--ink); }

main { max-width: 1200px; margin: 0 auto; padding: 10px 16px calc(var(--tabbar-h) + 40px); }
.group-hint { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.link { color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 14px; margin-bottom: 14px; }
.chip button { border: 0; background: #fff; color: var(--ink); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pr { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pr::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag { border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--fill); font-size: 12px; }
.tag.warn { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ── список людей (телефон) ── */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.list-tools select { border: 0; background: var(--fill-2); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 500; }
.rows { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 14px 16px; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--fill); }
.row.is-sent { opacity: .45; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { text-align: right; flex: none; }
.row-side span { display: block; font-size: 14px; font-weight: 500; }
.row-side small { display: block; color: var(--faint); font-size: 12px; }
.row-side .late { color: var(--accent); }

/* ── таблица (компьютер) ── */
.tbl-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 500; font-size: 12px; color: var(--faint); white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); }
th[aria-sort="ascending"]::after { content: ' ↑'; }
th[aria-sort="descending"]::after { content: ' ↓'; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--fill); }
tbody tr.is-sent { opacity: .45; }
.ctx { display: block; min-width: 240px; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* ── кнопки ── */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 0; background: var(--fill); border-radius: 999px; padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); min-height: 40px; }
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.on { background: var(--ok); color: #fff; }

/* ── шторка с человеком ── */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .25); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 10; background: var(--surface); overflow-y: auto; left: 0; right: 0; bottom: 0; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.drawer::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 14px; }
.drawer.open { transform: none; }
.drawer .x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--fill); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 18px; }
.drawer .strip { display: none; }
.drawer h2 { font: 600 24px/1.2 var(--display); letter-spacing: -0.02em; margin: 0 44px 4px 0; overflow-wrap: anywhere; }
.drawer .sec { margin-top: 22px; }
.drawer .sec h4 { font-weight: 500; font-size: 13px; color: var(--faint); margin: 0 0 8px; }
.drawer .sec p { margin: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; margin-top: 16px; background: var(--fill); border-radius: var(--r-md); padding: 14px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.draft { background: var(--fill); border-radius: var(--r-md); padding: 14px 16px; white-space: pre-wrap; }
.draft-edit { width: 100%; min-height: 140px; background: var(--fill); border: 0; border-radius: var(--r-md); padding: 14px 16px; resize: vertical; font: 15px/1.5 var(--body); }
.note { border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; margin-top: 10px; background: var(--fill); }
.note.flag { background: color-mix(in srgb, var(--accent) 9%, transparent); }

/* ── календарь ── */
.cal-wrap { display: grid; gap: 16px; }
.cal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 14px 14px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-h b { font-weight: 600; font-size: 16px; }
.cal-h b::first-letter { text-transform: uppercase; }
.cal-h button { border: 0; background: var(--fill); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.cal-grid .wd { font-size: 12px; color: var(--faint); text-align: center; padding-bottom: 6px; }
.cal-grid .d { height: 44px; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 4px 0 0; font-size: 15px; font-weight: 500; }
.cal-grid .d .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.cal-grid .d.out { visibility: hidden; }
.cal-grid .d.past { color: var(--faint); }
.cal-grid .d.today .n { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-grid .d.sel .n { background: var(--accent); color: #fff; box-shadow: none; }
.cal-grid .d i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); margin-top: -2px; }
.cal-grid .d i.late { background: var(--accent); }
.cal-grid .d i.fu { background: var(--low); }
.cal-note { font-size: 12px; color: var(--muted); margin: 10px 2px 0; line-height: 1.6; }
.cal-note span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 4px 1px 0; }
.queue { min-width: 0; }
.queue .day { margin-top: 16px; }
.queue .day:first-child { margin-top: 0; }
.queue h2 { position: sticky; top: 0; z-index: 2; margin: 0; padding: 8px 4px 6px; background: var(--bg); display: flex; align-items: baseline; gap: 6px; font: 500 13px var(--display); color: var(--muted); }
.queue h2 em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--faint); }
.queue h2 small { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--faint); }
.queue h2.late { color: var(--accent); }
.due-list { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.due-list .empty { padding: 24px 16px; }
.due { border-bottom: 1px solid var(--line); scroll-margin-top: 56px; }
.due:last-child { border-bottom: 0; }
.due-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; min-height: 0; }
.due-row:hover { background: var(--fill); }
.due .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.due-main { flex: 1; min-width: 0; }
.due-main b { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.due-main small { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-side { flex: none; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.due-when { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.due-when b { font-weight: 500; }
.due-when small { font-size: 12px; color: var(--faint); }
.due-when .late { color: var(--accent); }
.chev { width: 7px; height: 7px; border: solid var(--faint); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.due.open .chev { transform: translateY(2px) rotate(-135deg); }
.due.open { background: var(--surface); }
.due-body { padding: 0 12px 8px 30px; }
.due-body .todo { margin: 10px 0 0; }
/* check-строка: кнопки есть всегда */
.due-body .actions { margin-top: 4px; }
.tools { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.due .dr-edit { padding: 8px 10px; min-height: 0; font-size: 14px; line-height: 1.4; border-radius: 12px; }
.ibtn { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.ibtn:hover { background: var(--fill); color: var(--ink); }
.ibtn[disabled] { opacity: .5; cursor: progress; }
.ibtn.liked { color: var(--accent); }
.ibtn.liked .ic path { fill: currentColor; }
.ibtn.push { margin-left: auto; }
.pill-sel.desk-only { display: none; }
@media (max-width: 899px) { .due-body { padding-left: 12px; } }
.due .dr { margin: 0; background: var(--fill); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; white-space: pre-wrap; }
.due .todo { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ── знакомства ── */
.pairs { display: grid; gap: 10px; }
.pair { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pair.done { opacity: .45; }
.pair .who { border: 0; border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; background: var(--fill); text-align: left; }
.pair .who b { font-weight: 600; display: block; }
.pair .who small { color: var(--muted); font-size: 13px; display: block; }
.pair .link-mark { display: none; }
.pair .body { font-size: 14px; padding: 4px 2px 0; }
.pair .body p { margin: 0 0 8px; }
.pair .meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.strength { border-radius: 999px; padding: 3px 10px; font-size: 12px; background: var(--fill); }
.strength.s1 { background: var(--ink); color: #fff; }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ── аналитика ── */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; cursor: pointer; text-align: left; }
.tile b { display: block; font: 600 30px/1 var(--display); letter-spacing: -0.03em; }
.tile span { display: block; color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.3; }
.charts { display: grid; gap: 10px; }
.chart { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 16px 14px; }
.chart h3 { font-weight: 600; font-size: 16px; margin: 0; }
.chart .cap { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.hrow { display: grid; grid-template-columns: minmax(100px, 42%) 1fr 26px; gap: 10px; align-items: center; padding: 4px 0; }
.hrow .hl { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .track { display: flex; gap: 2px; height: 10px; }
.hrow .seg { height: 100%; background: var(--c); border: 0; padding: 0; cursor: pointer; min-width: 4px; border-radius: 0; }
.hrow .seg:first-child { border-radius: 5px 0 0 5px; }
.hrow .seg:last-child { border-radius: 0 5px 5px 0; }
.hrow .seg:only-child { border-radius: 5px; }
.hrow .hv { font-size: 12px; color: var(--muted); text-align: right; }
.tip-pop { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; font-size: 13px; max-width: 280px; line-height: 1.35; opacity: 0; transition: opacity .08s; }
.tip-pop b { display: block; margin-bottom: 2px; }

/* ── как писать ── */
.guide { display: grid; gap: 10px; }
.tip { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.tip h3 { font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.tip p { margin: 0; color: var(--muted); }
.about { margin-top: 16px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.about h3, .intros h3 { font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.about .sub { color: var(--muted); font-size: 14px; }
.about label { display: block; font-size: 13px; color: var(--muted); margin-top: 12px; }
.about input { width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); margin-top: 4px; }
.intros { margin-top: 16px; }
.intros li { margin-bottom: 6px; }

/* ── компьютер ── */
@media (min-width: 900px) {
  .queue { max-width: 720px; }
  .due-body { max-width: 640px; }
  .top { display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: 8px; }
  .top-row { display: contents; }
  .top-row > div { order: 1; }
  .filters { order: 2; margin: 0; flex-wrap: nowrap; align-items: center; gap: 4px; }
  .top-row > .icon-btn { order: 3; margin-left: 8px; }
  #owners { display: none; }
  .pill-sel.desk-only { display: inline-flex; }
  .filters .pill-sel select { background: none; color: var(--ink); padding: 8px 28px 8px 10px; border-radius: 10px; font-weight: 500; }
  .filters .pill-sel select:hover { background: var(--fill-2); }
  .filters .pill-sel.on select { background: none; color: var(--accent); }
  .filters .pill-sel.on::after { color: var(--accent); }
  .filters .pill-sel select { field-sizing: content; }
  .filters .pill-sel::after { right: 11px; }
  .filters .icon-btn.small { background: none; border-radius: 10px; width: 38px; height: 38px; }
  .filters .icon-btn.small:hover { background: var(--fill-2); }
  .filters .icon-btn.small[aria-expanded="true"] { background: var(--fill-2); color: var(--ink); }
  .search-wrap { order: -1; flex: 0 0 280px; }
  .top { padding: 28px 32px 8px; }
  main { padding: 12px 32px 60px; }
  .top h1 { font-size: 30px; }
  .tabbar { position: static; transform: none; width: auto; display: inline-flex; margin: 0 32px; background: var(--fill-2); box-shadow: none; padding: 3px; backdrop-filter: none; }
  .tabbar-wrap { max-width: 1200px; margin: 16px auto 0; }
  .tabbar button { flex: none; flex-direction: row; gap: 8px; padding: 8px 16px; font-size: 14px; color: var(--muted); }
  .tabbar button svg { width: 18px; height: 18px; }
  .tabbar button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
  .cal-wrap { grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
  .cal { position: sticky; top: 16px; }
  .drawer { left: auto; top: 0; width: 480px; max-height: none; border-radius: 0; padding: 24px 28px 40px; transform: translateX(100%); }
  .drawer::before { display: none; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .charts { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
  .guide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .pair { grid-template-columns: 1fr auto 1fr; padding: 16px; }
  .pair .link-mark { display: block; align-self: center; color: var(--faint); }
  .pair .body { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── сайт: вход, тосты, проекты, карточка ── */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.late { color: var(--accent); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: min(380px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 22px; }
.auth h1 { font: 600 26px/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 4px; }
.auth-form { display: grid; gap: 12px; margin: 20px 0 14px; }
.auth-form label, .proj-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form input, .proj-form input:not([type=checkbox]), .proj-form textarea { height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); font-size: 16px; color: var(--ink); }
.proj-form textarea { height: auto; padding: 12px 14px; resize: vertical; font: 15px/1.45 var(--body); }
.auth-form .btn { justify-content: center; height: 48px; font-size: 16px; }
.auth-err { color: var(--accent); margin: 0; min-height: 1em; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.proj { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.proj.is-off { opacity: .6; }
.proj-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.proj h3 { font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.proj p { margin: 0 0 6px; }
.proj h4 { font-weight: 500; font-size: 13px; color: var(--faint); margin: 14px 0 8px; }
.proj .rows { box-shadow: none; background: var(--fill); }
.proj-form { display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-t { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--fill); color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip-t.on { background: var(--ink); color: #fff; }
.inline-select { border: 0; background: var(--surface); border-radius: 8px; padding: 4px 8px; font-size: 14px; }
.date-in { height: 40px; border: 0; border-radius: 999px; background: var(--fill); padding: 0 14px; font-size: 14px; color: var(--ink); }
.drawer .mono { font-size: 14px; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; padding: 2px; }
.chat-day { align-self: center; font-size: 12px; color: var(--faint); margin: 8px 0 2px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 16px; background: var(--fill); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }
.msg.in { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.out { align-self: flex-end; border-bottom-right-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.msg small { display: block; margin-top: 2px; font-size: 11px; color: var(--faint); text-align: right; }
.msg i { color: var(--muted); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist li small { color: var(--faint); white-space: nowrap; }
.tr { margin-top: 12px; font-size: 14px; }
.tr summary { cursor: pointer; color: var(--muted); }
.tr p { white-space: pre-wrap; background: var(--fill); border-radius: var(--r-md); padding: 12px 14px; }

/* проекты: пояснение */
.explain { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.explain h3 { font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.explain p { margin: 0 0 10px; color: var(--muted); }
.explain ol { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.explain li { margin-bottom: 4px; }
.explain .ex { background: var(--fill); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.explain .ex b { display: block; margin-bottom: 2px; }

/* фильтр по статусу */
.pill-sel { position: relative; display: inline-flex; }
.pill-sel select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--fill-2); color: var(--muted); font-size: 14px; font-weight: 500; padding: 9px 34px 9px 14px; cursor: pointer; }
.pill-sel::after { content: ''; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); color: var(--muted); pointer-events: none; }
.pill-sel.on select { background: var(--ink); color: #fff; }
.pill-sel.on::after { color: #fff; }
/* подбор и ключ */
.proj-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.btn[disabled] { opacity: .55; cursor: progress; }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.key-row input { flex: 1 1 220px; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); font-size: 15px; }
.about ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }

/* ── иконки, текст сообщения, блоки карточки ── */
.ic { width: 18px; height: 18px; flex: none; }
.btn .ic { width: 17px; height: 17px; margin-left: -2px; }
.btn.ghost { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--fill); }
.draft-box { margin: 2px 0 0; }
.dr-edit { width: 100%; min-height: 64px; border: 0; border-radius: var(--r-md); background: var(--fill); padding: 12px 14px; font: 15px/1.5 var(--body); color: var(--ink); resize: none; overflow: hidden; transition: box-shadow .15s; }
.dr-edit:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.dr-edit:disabled { opacity: .5; }
.dr-edit::placeholder { color: var(--faint); }
.wish-row { display: flex; gap: 8px; margin-top: 8px; }
.wish { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 999px; background: var(--fill); padding: 0 14px; font-size: 14px; }
.todo { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.todo .ic, .hint .ic, .note .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
.hint { display: flex; gap: 6px; font-size: 13px; color: var(--faint); margin: 10px 0 0; line-height: 1.4; }
.hint .ic { color: var(--faint); }
.note { display: flex; gap: 8px; }

.head-chips { margin: 8px 0 4px; }
.chip-s { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--muted); }
.chip-s .ic { width: 14px; height: 14px; }
.chip-s.warn { color: var(--accent); }
.chip-s .pdot { width: 7px; height: 7px; }

.blk { margin-top: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.blk-h, .blk > summary { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }
.blk > summary { margin: 0; cursor: pointer; list-style: none; }
.blk > summary::-webkit-details-marker { display: none; }
.blk > summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint); transform: rotate(45deg); transition: transform .15s; }
.blk[open] > summary { margin-bottom: 10px; }
.blk[open] > summary::after { transform: rotate(225deg); }
.blk-h .ic, .blk > summary .ic { color: var(--muted); }
.blk-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.blk > summary .blk-meta { margin-left: 4px; }
.blk-meta .ic { width: 14px; height: 14px; margin-left: 6px; }
.blk .kv { margin-top: 0; }
.para { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.para.pre { white-space: pre-wrap; }
.about-add { margin-top: 10px; }
.about-in { width: 100%; border: 0; border-radius: var(--r-md); background: var(--fill); padding: 12px 14px; resize: none; font: 15px/1.5 var(--body); }
.about-add .actions { margin-top: 8px; }
.actions.small { margin-top: 10px; }
.actions.small .btn, .actions.small .date-in { min-height: 36px; height: 36px; padding: 0 12px; font-size: 13px; }

.steps { display: flex; background: var(--fill); border-radius: 999px; padding: 3px; gap: 2px; }
.step { flex: 1; border: 0; background: none; border-radius: 999px; padding: 9px 6px; font-size: 13px; font-weight: 500; color: var(--faint); display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.step .ic { width: 14px; height: 14px; }
.step.done { color: var(--ink); }
.step.cur { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.step:disabled { cursor: default; }
.step:not(:disabled):hover { color: var(--ink); }
.drawer h2 { margin-bottom: 0; }
.drawer .sec { display: none; }
.due .actions .btn, .blk .actions .btn { min-height: 38px; padding: 8px 13px; font-size: 14px; gap: 5px; }
.hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.hint.open { -webkit-line-clamp: unset; }
.hint .ic { float: left; margin-right: 6px; }

/* ── нижняя панель: 6 вкладок, на телефоне листается вбок ── */
.tabbar { width: min(520px, calc(100vw - 24px)); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { flex: 1 0 72px; scroll-snap-align: center; }
@media (max-width: 420px) { .tabbar button { flex: 0 0 76px; } }

/* ── последнее сообщение в списке людей ── */
.row-main small.head { display: flex; align-items: center; gap: 4px; color: var(--faint); margin-top: 2px; }
.row-main small.head.in { color: var(--ink); }
.row-main small.head .ic { width: 13px; height: 13px; flex: none; }

/* ── компании ── */
.cos { display: grid; gap: 10px; }
@media (min-width: 900px) { .cos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.co { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.blk .co { box-shadow: none; padding: 0; }
.co-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.co-h b { font-weight: 600; font-size: 16px; }
.co-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; text-decoration: none; }
.co-link:hover { color: var(--accent); }
.co-link .ic { width: 14px; height: 14px; }
.co-sum { margin: 0; font-size: 14px; line-height: 1.5; }
.co p.muted { margin: 0; font-size: 14px; }
.co-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.co-f small { color: var(--faint); }
.co-act { margin-left: auto; display: inline-flex; gap: 4px; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.empty-box { text-align: center; color: var(--muted); padding: 48px 24px; max-width: 420px; margin: 0 auto; }
.empty-box .ic { width: 32px; height: 32px; color: var(--faint); }

/* ── ждут запуска ── */
.launch { margin: 12px 0 4px; padding: 12px 14px; border-radius: var(--r-md); background: var(--fill); }
.launch-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.launch-h .ic { color: var(--accent); }
.launch-h .date-in { padding: 6px 10px; min-height: 32px; }
.launch-h .muted { font-size: 13px; }
.launch-h .btn { margin-left: auto; }
.launch-note { margin: 8px 0 0; font-size: 13px; }
.launch-list { display: grid; gap: 10px; margin-top: 10px; }
.launch-item { background: var(--surface); border-radius: var(--r-md); padding: 12px; }
.launch-item.sent { opacity: .6; padding: 8px 12px; }
.launch-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.launch-who small { color: var(--faint); font-size: 12px; }
.launch-who .tag { display: inline-flex; align-items: center; gap: 4px; }
.launch-who .tag .ic { width: 13px; height: 13px; }
.launch-msg { min-height: 72px; background: var(--fill); }
.launch-tg { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.launch-tg .ic { color: var(--accent); width: 16px; height: 16px; }
.launch-h .date-in { background: var(--surface); }

/* ── правка ника в карточке ── */
button.chip-s { border: 0; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
button.chip-s .ic { width: 13px; height: 13px; color: var(--faint); }
.nick-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nick-form input { height: 34px; border: 0; border-radius: 999px; background: var(--fill); padding: 0 12px; font-size: 14px; width: 170px; }

/* ── «О нас» и образцы ── */
.about .fld { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.about .fld small { color: var(--faint); margin-left: 6px; }
.about .fld textarea { display: block; width: 100%; margin-top: 4px; border: 0; border-radius: var(--r-md); background: var(--fill); padding: 10px 12px; font: 14px/1.5 var(--body); color: var(--ink); resize: vertical; }
.about .wc { font-size: 13px; color: var(--faint); align-self: center; }
.about .wc.over { color: var(--accent); }
.about h4 { margin: 18px 0 4px; font-size: 14px; }
.pf-prev { margin-top: 12px; font-size: 14px; }
.pf-prev summary { cursor: pointer; color: var(--muted); }
.pf-prev pre { white-space: pre-wrap; font: 13px/1.5 var(--body); background: var(--fill); border-radius: var(--r-md); padding: 10px 12px; margin: 8px 0 0; }
.ex-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ex-list li { position: relative; background: var(--fill); border-radius: var(--r-md); padding: 10px 36px 10px 12px; font-size: 14px; line-height: 1.45; }
.ex-list li small { display: block; color: var(--faint); font-size: 12px; margin-top: 4px; }
.x-sm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; color: var(--muted); }
.btn.icon-only { padding: 10px; }
.btn.liked { color: var(--accent); }
.btn.mic { flex: none; }
.btn.mic.rec { background: var(--accent); color: #fff; padding: 10px 14px; animation: mic-pulse 1.4s ease-in-out infinite; }
.btn.mic:disabled { opacity: .5; }
.mic-t { font-variant-numeric: tabular-nums; font-size: 13px; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .btn.mic.rec { animation: none; } }
.btn.liked .ic path { fill: currentColor; }

/* ── приоритет ── */
.deal-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.deal-tools .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.deal-g { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 17px; margin: 18px 0 10px; }
.deal-g small { font-weight: 400; font-size: 13px; color: var(--faint); }
.deals { display: grid; gap: 10px; }
@media (min-width: 900px) { .deals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.deal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; }
.deal:active { background: var(--fill); }
.deal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deal-h b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.deal-client { background: var(--ink); color: #fff; }
.deal-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-note { margin: 2px 0 0; }
.deal-next { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-weight: 500; }
.deal-next .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.deal-f { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 2px; }
.deal-f small.head { display: flex; align-items: center; gap: 4px; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.deal-f small.head.in { color: var(--ink); }
.deal-f small.head .ic { width: 13px; height: 13px; flex: none; }
.deal-empty { margin: 0 0 6px; }
.deal-add { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; margin: 8px 0 4px; display: grid; gap: 10px; }
.deal-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.deal-add .search { background: var(--fill); box-shadow: none; padding-right: 16px !important; }
.deal-add .rows { box-shadow: none; background: var(--fill); }
.deal-add .actions { margin-top: 0; }
.deal-pick-hint { margin: 0; font-size: 14px; }
.chip-t small { font-weight: 400; opacity: .7; }
.deal-stage { margin-top: 8px; }
.deal-fld { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.deal-fld textarea { width: 100%; border: 0; border-radius: var(--r-md); background: var(--fill); padding: 10px 14px; resize: none; font: 15px/1.45 var(--body); color: var(--ink); }
