/* Дизайн-система WOMAN 7: бордо и сливки (по макету «WOMAN 7 — дизайн приложения»).
   Антиква Playfair Display — заголовки и крупные числа; Great Vibes — только акценты; Golos Text — интерфейс и таблицы. */
:root {
  color-scheme: light;
  --bordo-deep: #4a0f18;
  --bordo: #7a1f2b;
  --bordo-band: #4f1119;
  --gold: #c4a46a;
  --gold-soft: #dcbb78;
  --gold-text: #e6cc95;
  --cream: #f4ede1;
  --paper: #fbf7ef;
  --paper-2: #f3eadb;
  --ink: #2b1a1c;
  --ink-2: #4a3a3b;
  --ink-3: #5c4a4b;
  --muted: #6f5d5c;
  --line: #e2d4bb;
  --line-2: #eadfcc;
  --line-strong: #d4c3a6;
  --track: #ece2d1;
  --seg-bg: #ebe0cd;
  --band-text: #dccbbd;

  --g-full: #6e1a26;
  --g-inst: #c9a24f;
  --g-book: #a85a45;

  --ok: #245a30;   --ok-bg: #dcebd9;  --ok-tile: #e4efe1;  --ok-line: #b5d0b0;
  --warn: #6e4708; --warn-bg: #f4e4bf; --warn-tile: #f7eccf; --warn-line: #e4cc94;
  --bad: #8a1c14;  --bad-bg: #f5dcd7;  --bad-tile: #f8e6e2;  --bad-line: #e8b9b0; --bad-flag: #b3261e;
  --info: #24507a; --info-bg: #dce5ef; --info-tile: #e6edf4; --info-line: #b9cbe0;
  --neu-bg: #ece2d1;
  --fresh-ok: #2f7a3e;
  --bar-soft: #d3b2b0;
  --chart-grid: #ece2d1;
  --chart-axis: #d9cab0;
  --chart-even: #9a8a7a;

  --font-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-disp: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-script: "Great Vibes", "Snell Roundhand", cursive;
  --tabbar: 70px;
}
/* Тёмная тема (как в макете Telegram): токены переопределяются целиком */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bordo-deep: #2a0b10; --bordo: #e08a98; --bordo-band: #2a1418;
    --gold: #c4a46a; --gold-soft: #dcb868; --gold-text: #dcb868;
    --cream: #1b1214; --paper: #251a1d; --paper-2: #2e2124;
    --ink: #f1e6d8; --ink-2: #dccdbd; --ink-3: #c9b8a8; --muted: #a8968a;
    --line: #3a2a2e; --line-2: #33252a; --line-strong: #4a383c; --track: #3a2a2e; --seg-bg: #33252a; --band-text: #c9b8a8;
    --g-full: #c4485a; --g-inst: #dcb868; --g-book: #e08a6a;
    --ok: #9fd3a8; --ok-bg: #1f3424; --ok-tile: #1d2c21; --ok-line: #2f5236;
    --warn: #f0cf86; --warn-bg: #3a2f14; --warn-tile: #33291a; --warn-line: #5a4721;
    --bad: #f2a69a; --bad-bg: #44201c; --bad-tile: #3a1d1c; --bad-line: #6a2e28; --bad-flag: #e0584a;
    --info: #a9c6e6; --info-bg: #1d2a3a; --info-tile: #1c2633; --info-line: #2e4560;
    --neu-bg: #33252a; --fresh-ok: #7fd39b; --bar-soft: #5a3238; --chart-grid: #33252a; --chart-axis: #4a383c; --chart-even: #8a7a6e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bordo-deep: #2a0b10; --bordo: #e08a98; --bordo-band: #2a1418;
  --gold: #c4a46a; --gold-soft: #dcb868; --gold-text: #dcb868;
  --cream: #1b1214; --paper: #251a1d; --paper-2: #2e2124;
  --ink: #f1e6d8; --ink-2: #dccdbd; --ink-3: #c9b8a8; --muted: #a8968a;
  --line: #3a2a2e; --line-2: #33252a; --line-strong: #4a383c; --track: #3a2a2e; --seg-bg: #33252a; --band-text: #c9b8a8;
  --g-full: #c4485a; --g-inst: #dcb868; --g-book: #e08a6a;
  --ok: #9fd3a8; --ok-bg: #1f3424; --ok-tile: #1d2c21; --ok-line: #2f5236;
  --warn: #f0cf86; --warn-bg: #3a2f14; --warn-tile: #33291a; --warn-line: #5a4721;
  --bad: #f2a69a; --bad-bg: #44201c; --bad-tile: #3a1d1c; --bad-line: #6a2e28; --bad-flag: #e0584a;
  --info: #a9c6e6; --info-bg: #1d2a3a; --info-tile: #1c2633; --info-line: #2e4560;
  --neu-bg: #33252a; --fresh-ok: #7fd39b; --bar-soft: #5a3238; --chart-grid: #33252a; --chart-axis: #4a383c; --chart-even: #8a7a6e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 14px/1.4 var(--font-ui); font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bordo); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.disp { font-family: var(--font-disp); font-weight: 400; }
.scr { font-family: var(--font-script); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--bordo); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: none; }

/* ---------- вход ---------- */
.login { min-height: 100vh; background: var(--bordo-deep); display: grid; place-items: center; padding: 24px 16px; }
.login-frame { width: 100%; max-width: 380px; padding: 44px 24px 36px; box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 6px var(--bordo-deep), inset 0 0 0 7px var(--gold); color: #f4ede1; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-frame .ornament { color: var(--gold); font-size: 12px; letter-spacing: .3em; }
.login-frame .scr { font-size: 44px; line-height: .9; color: var(--gold-soft); }
.login-frame h1 { margin: 0; font-family: var(--font-disp); font-weight: 400; font-size: 40px; letter-spacing: .06em; }
.login-frame p { margin: 0; font-size: 13px; color: #dccbbd; }
.login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 18px; }
.login-form label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--gold-text); }
.login-form input { height: 48px; border-radius: 12px; border: 1px solid var(--gold); background: #fbf7ef; color: #2b1a1c; padding: 0 14px; font-size: 15px; }
.btn-gold { height: 48px; border: 0; border-radius: 12px; background: #d8bd84; color: #2b1a1c; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn-gold:hover { background: #e2c991; }
.login-error { color: #ffb4a8; font-size: 13px; margin: 0; }

/* ---------- шапка ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--cream); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; max-width: 1240px; margin: 0 auto; }
.brand { font-family: var(--font-disp); font-size: 22px; letter-spacing: .06em; line-height: 1.1; }
.fresh { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font-size: 12px; color: var(--ink-3); cursor: pointer; min-height: 24px; text-align: left; }
.fresh.stale { color: var(--bad); font-weight: 600; }
.fresh-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ib { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--bordo-deep); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: none; }
.ib:disabled { opacity: .55; cursor: wait; }
.ib svg.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav-desk { display: none; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.btn-out { display: none; }

.banner { max-width: 1240px; margin: 10px auto 0; padding: 8px 16px; font-size: 12.5px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; }

/* таб-бар (телефон) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px)); background: #4a0f18; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: #dccbbd; background: none; border: 0; min-height: 48px; cursor: pointer; }
.tab.on { color: #f0d79a; }

main { max-width: 1240px; margin: 0 auto; padding: 0 0 calc(var(--tabbar) + 40px); }
.page { display: flex; flex-direction: column; }

/* ---------- общие блоки ---------- */
.hero { padding: 28px 16px 20px; text-align: center; }
.hero .scr { display: block; font-size: 48px; line-height: .9; color: var(--bordo); }
.hero h1 { margin: -2px 0 0; font-family: var(--font-disp); font-weight: 400; font-size: 38px; line-height: 1.05; text-transform: uppercase; text-wrap: balance; }
.hero-row { margin-top: 16px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hero p { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.sh { text-align: center; margin-bottom: 18px; }
.sh .scr { font-size: 42px; line-height: .9; color: var(--bordo); display: block; }
.sh h2 { margin: 0; font-family: var(--font-disp); font-weight: 400; font-size: 26px; text-transform: uppercase; line-height: 1.05; letter-spacing: .01em; }
.section { padding: 40px 16px 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section > .sh { margin-bottom: 6px; }

.card { background: var(--paper); border-radius: 18px; padding: 18px 16px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.card.frame { box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--gold); }
.card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; white-space: nowrap; }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-neu { background: var(--neu-bg); color: var(--ink-2); }
.b-grp { background: var(--paper-2); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); background: transparent; }
button.chip { cursor: pointer; min-height: 32px; }

/* план */
.plans { padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plan { padding: 22px 20px; display: flex; flex-direction: column; gap: 18px; }
.plan-head { display: flex; align-items: center; gap: 12px; }
.plan-head .scr { font-size: 34px; color: var(--bordo); line-height: 1; }
.plan-head h2 { margin: 0; font-family: var(--font-disp); font-weight: 400; font-size: 21px; line-height: 1.15; }
.bar { display: flex; flex-direction: column; gap: 7px; }
.bl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.bl b { font-weight: 600; color: var(--ink); white-space: nowrap; font-size: 13px; }
.tr { position: relative; height: 14px; border-radius: 7px; background: var(--track); display: flex; gap: 2px; }
.tr span { height: 100%; flex: none; }
.tr span:first-child { border-radius: 7px 0 0 7px; }
.tr em { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.mk { font-size: 11px; color: var(--ink-3); position: relative; height: 15px; }
.mk span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.legend-list { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-list li { display: flex; gap: 8px; align-items: baseline; }
.plans-note { margin: 0; font-size: 11.5px; color: var(--muted); text-align: center; }

/* темп — бордовая лента */
.band { margin-top: 36px; padding: 40px 16px 36px; background: var(--bordo-band); color: #f4ede1; }
.band .sh .scr { color: var(--gold-soft); }
.band .sh h2 { color: #f4ede1; }
.tempo-group { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tempo-group > .label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--gold-text); }
.tempo-card { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 16px; }
.tempo-card .top-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tempo-card .k { font-size: 13px; font-weight: 600; }
.tempo-card .big { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.tempo-card .big .disp { font-size: 30px; line-height: 1.1; }
.met { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.met div { display: flex; flex-direction: column; gap: 1px; }
.met small { font-size: 11.5px; color: var(--muted); }
.met b { font-weight: 600; font-size: 14px; }
.band-note { margin: 18px 0 0; font-size: 12px; color: var(--band-text); }
.tempo-table { display: none; }

/* группы */
.groups { padding: 4px 16px; }
.group-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.group-row:last-child { border-bottom: 0; }
.group-row .scr { font-size: 28px; color: var(--bordo); line-height: 1.1; }
.group-row .name { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.group-row .sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; margin: 8px 0 0; font-size: 12.5px; }
.kv dt { color: var(--muted); min-width: 0; }
.kv dd { margin: 0; text-align: right; font-weight: 500; white-space: nowrap; }

/* плитки */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border-radius: 16px; padding: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.tile.t-bad { background: var(--bad-tile); box-shadow: inset 0 0 0 1px var(--bad-line); }
.tile.t-warn { background: var(--warn-tile); box-shadow: inset 0 0 0 1px var(--warn-line); }
.tile.t-ok { background: var(--ok-tile); box-shadow: inset 0 0 0 1px var(--ok-line); }
.tile.t-info { background: var(--info-tile); box-shadow: inset 0 0 0 1px var(--info-line); }
.tile.t-hero { background: var(--bordo-band); box-shadow: none; color: #f4ede1; padding: 18px; }
.tile.t-hero .tl { color: var(--gold-text); }
.tile.t-hero .tv { font-size: 34px; color: #f4ede1; }
.tile.t-hero .tn { color: #dccbbd; }
.tl { font-size: 12px; color: var(--ink-3); line-height: 1.25; }
.tv { font-family: var(--font-disp); font-size: 23px; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.tn { font-size: 11.5px; color: var(--muted); }
.tile .badge { align-self: flex-start; margin-top: 4px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.trio > div { display: flex; flex-direction: column; }
.trio .tv { font-size: 21px; }

/* переключатель */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--seg-bg); gap: 2px; }
.seg button { border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 6px 14px; border-radius: 999px; min-height: 36px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--bordo-deep); box-shadow: 0 1px 2px rgba(74, 15, 24, .18); }

/* графики */
.chart { width: 100%; margin-top: 14px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-ui); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.day-panel { margin-top: 12px; border-radius: 12px; background: var(--paper-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.day-panel .kv { margin: 0; }
.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--cream); border-radius: 10px; padding: 7px 10px; font-size: 12px; max-width: 240px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.tip b { display: block; margin-bottom: 2px; }

/* таблицы */
.tw { overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: var(--paper); }
.tw table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 600px; width: 100%; }
.tw th, .tw td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tw th { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: pointer; user-select: none; }
.tw th:first-child, .tw td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); box-shadow: 1px 0 0 var(--line-2); }
.tw tr.tot td { font-weight: 600; border-bottom: 0; background: var(--paper-2); }
.tw tr.grp td { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--bordo); background: var(--paper-2); }
.tw td.l { text-align: left; white-space: normal; }
.tw small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.tw .neg { color: var(--bad); }
.table-note { margin: 0; font-size: 11.5px; color: var(--muted); }

/* дебиторка */
.bk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; width: 100%; border: 0; background: none; padding: 10px 0; text-align: left; color: inherit; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.bk:last-of-type { border-bottom: 0; }
.bk.on span:first-child { font-weight: 700; color: var(--bordo); }
.bk .tr { grid-column: 1 / -1; height: 10px; border-radius: 5px; }
.bk .tr i { display: block; height: 100%; border-radius: 5px; }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-nav .ib { width: 36px; height: 36px; border: 0; background: transparent; }
.cal-nav .disp { font-size: 18px; min-width: 110px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .h { font-size: 10.5px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cd { min-height: 50px; border-radius: 10px; border: 0; padding: 5px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); background: var(--paper-2); cursor: default; }
.cd.has { cursor: pointer; }
.cd b { font-size: 13px; font-weight: 600; }
.cd small { font-size: 10px; font-weight: 500; }
.cd.blank { background: transparent; }
.cd.red { background: var(--bad-line); }
.cd.future { background: var(--info-tile); }
.cd.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cd.sel { box-shadow: inset 0 0 0 2px var(--bordo); }
.cal.week .cd { min-height: 72px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 11.5px; color: var(--ink-2); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }

.searchrow { display: flex; gap: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); min-width: 0; }
.search input { border: 0; background: transparent; font-size: 14px; color: var(--ink); width: 100%; min-width: 0; outline-offset: 4px; }
.btn-line { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--bordo-deep); background: var(--paper); color: var(--bordo-deep); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.lnk { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--bordo-deep); text-decoration: none; font-size: 13px; font-weight: 500; background: var(--paper); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 13px; }

.filters-sheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 14px; }
.filters-sheet label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.filters-sheet select { height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 0 10px; font-size: 14px; }

.debtors { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.dc { position: relative; padding: 14px 14px 14px 18px; }
.dc .flag { position: absolute; left: 6px; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; background: var(--bad-flag); }
.dc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dc-name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.dc-mail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.dc-left { text-align: right; flex: none; }
.dc-left .disp { font-size: 20px; line-height: 1.1; }
.dc-left small { font-size: 11px; color: var(--muted); }
.dc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.dc-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dc-more { margin-top: 8px; border: 0; background: none; padding: 6px 0; font-size: 12.5px; font-weight: 600; color: var(--bordo); min-height: 32px; cursor: pointer; }
.dc-open { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.dc-open .eyebrow { letter-spacing: .08em; }
.quote { margin: 0; font-size: 12.5px; color: var(--ink-2); background: var(--paper-2); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.more-btn { height: 46px; border-radius: 12px; border: 1px dashed var(--gold); background: transparent; font-size: 13.5px; font-weight: 500; color: var(--bordo-deep); cursor: pointer; }
.paid { color: var(--ok); }
.late { color: var(--bad); }

.state { border-radius: 14px; background: var(--paper); padding: 20px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.state .scr { font-size: 34px; color: var(--bordo); line-height: 1; }
.state b { font-size: 13.5px; }
.state span { font-size: 12px; color: var(--muted); }

details.card > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary svg { transform: rotate(180deg); }
.q-body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.q-body h4 { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bordo); }

/* настройки */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.settings input, .settings select, .settings textarea { min-height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 8px 12px; font-size: 14px; }
.settings .actions { display: flex; align-items: center; gap: 12px; }
.btn-primary { height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--bordo-deep); color: #f4ede1; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] .btn-primary { background: var(--bordo); color: #1b1214; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--bordo); color: #1b1214; } }

.top-actions .ib .lbl { display: none; }

/* ---------- ноутбук ---------- */
@media (min-width: 900px) {
  .tabbar { display: none; }
  main { padding-bottom: 64px; }
  .top { background: #4a0f18; border-bottom: 0; color: #f4ede1; }
  .top-in { padding: 10px 24px; }
  .brand { letter-spacing: .08em; }
  .fresh { color: #dccbbd; }
  .fresh.stale { color: #ffb4a8; }
  .fresh-detail { color: #c9b8a8; }
  .nav-desk { display: flex; gap: 2px; flex-wrap: wrap; }
  .nav-desk button { border: 0; background: none; color: #dccbbd; font-size: 14px; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
  .nav-desk button.on { background: rgba(244, 237, 225, .12); color: #f4ede1; }
  .top-left { display: flex; align-items: center; gap: 28px; }
  .top-actions .ib { width: auto; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: #f4ede1; gap: 6px; font-size: 13px; }
  .top-actions .ib .lbl { display: inline; }
  .btn-out { display: inline-flex; border: 0; background: none; color: #dccbbd; font-size: 13px; padding: 8px; cursor: pointer; }

  .hero { display: flex; justify-content: space-between; align-items: flex-end; text-align: left; padding: 36px 24px 8px; gap: 16px; flex-wrap: wrap; }
  .hero .scr { font-size: 52px; }
  .hero h1 { font-size: 48px; }
  .hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
  .hero-row { margin-top: 0; justify-content: flex-end; }
  .hero p { margin: 0; }
  .plans { padding: 24px 24px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .plan { padding: 30px 32px; }
  .plan-head h2 { font-size: 24px; }
  .section { padding: 44px 24px 0; }
  .sh { text-align: left; display: flex; align-items: baseline; gap: 14px; }
  .sh .scr { display: inline; font-size: 38px; }
  .band { margin: 44px 24px 0; border-radius: 22px; padding: 36px 32px; }
  .tempo-cards { display: none; }
  .tempo-table { display: block; }
  .tempo-table .tw { box-shadow: none; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .groups-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .groups-wrap .group-row { border: 0; padding: 0; }
  .groups-wrap .card { padding: 18px; }
  .charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .debtors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings .wide { grid-column: 1 / -1; }
  .debt-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; }
.band .tw { color: var(--ink); }
