/* =========================================================================
   Алмазы — учёт продаж
   Plum-graphite surfaces, jade for money, amethyst for diamonds,
   blue and amber mark the two marketplaces — on the lanes of «Сегодня» and on
   the corner of every avatar. One loud element: today's sum. Everything else is
   a quiet work surface where a card can be finished without opening anything.
   ========================================================================= */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/unbounded-v1.woff2) format("woff2"); }

/* --------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f6f3f8;
  --surface: #ffffff;
  --surface-2: #fbf9fc;
  --surface-3: #f1edf4;
  --line: #e8e2ed;
  --line-2: #d8cfe0;
  --text: #1d1823;
  --text-2: #554d5e;
  --text-3: #80778b;
  --accent: #6447e0;
  --accent-soft: #eeeafd;
  --money: #0d8657;
  --money-soft: #e2f4eb;
  --gem: #6a4fe6;
  --gem-hi: #a897ff;
  --avito: #1d6fd2;
  --avito-soft: #e6effb;
  --ggsel: #bd650c;
  --ggsel-soft: #fbeedd;
  --avito-mark: #1d6fd2;
  --ggsel-mark: #bd650c;
  --chart-muted: #d8cfe0;
  --rose: #cf3560;
  --rose-soft: #fde7ed;
  --warn: #9a5f06;
  --warn-soft: #fcf1d7;
  --bad: #c62f2f;
  --bad-soft: #fce7e7;
  --primary: #1d1823;
  --primary-ink: #ffffff;
  --accent-ink: #ffffff;
  --shadow-1: 0 1px 2px rgba(29, 24, 35, 0.05), 0 1px 1px rgba(29, 24, 35, 0.03);
  --shadow-pop: 0 22px 60px -18px rgba(29, 24, 35, 0.35), 0 0 0 1px var(--line);
  --scrim: rgba(24, 18, 30, 0.42);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;
  --r-sheet: 20px;
  --r-panel: 16px;
  --r-ctl: 11px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --topbar-h: 60px;
  --dock-h: 64px;
  --gutter: 24px;
  --wrap: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131016;
    --surface: #1b171f;
    --surface-2: #17141b;
    --surface-3: #251f2a;
    --line: #2d2733;
    --line-2: #3c3444;
    --text: #f2edf5;
    --text-2: #b7aec1;
    --text-3: #8a8195;
    --accent: #a896ff;
    --accent-soft: #2a2443;
    --money: #55d7a1;
    --money-soft: #16302a;
    --gem: #a896ff;
    --gem-hi: #d6ceff;
    --avito: #5ca4f6;
    --avito-soft: #172539;
    --ggsel: #f3a85a;
    --ggsel-soft: #33261a;
    --avito-mark: #4d97ec;
    --ggsel-mark: #cc7c2c;
    --chart-muted: #3c3444;
    --rose: #ff7f9d;
    --rose-soft: #3b1d27;
    --warn: #f1c45e;
    --warn-soft: #332a12;
    --bad: #ff7676;
    --bad-soft: #3b1d1d;
    --primary: #f2edf5;
    --primary-ink: #18131c;
    --accent-ink: #18131c;
    --shadow-1: none;
    --shadow-pop: 0 26px 70px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--line-2);
    --scrim: rgba(6, 4, 8, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131016;
  --surface: #1b171f;
  --surface-2: #17141b;
  --surface-3: #251f2a;
  --line: #2d2733;
  --line-2: #3c3444;
  --text: #f2edf5;
  --text-2: #b7aec1;
  --text-3: #8a8195;
  --accent: #a896ff;
  --accent-soft: #2a2443;
  --money: #55d7a1;
  --money-soft: #16302a;
  --gem: #a896ff;
  --gem-hi: #d6ceff;
  --avito: #5ca4f6;
  --avito-soft: #172539;
  --ggsel: #f3a85a;
  --ggsel-soft: #33261a;
  --avito-mark: #4d97ec;
  --ggsel-mark: #cc7c2c;
  --chart-muted: #3c3444;
  --rose: #ff7f9d;
  --rose-soft: #3b1d27;
  --warn: #f1c45e;
  --warn-soft: #332a12;
  --bad: #ff7676;
  --bad-soft: #3b1d1d;
  --primary: #f2edf5;
  --primary-ink: #18131c;
  --accent-ink: #18131c;
  --shadow-1: none;
  --shadow-pop: 0 26px 70px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--line-2);
  --scrim: rgba(6, 4, 8, 0.6);
}

/* ----------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img, svg { display: block; }
p, h1, h2, h3, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font: 500 0.92em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 2px 5px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
@supports not selector(:popover-open) {
  [popover]:not(.is-open) { display: none; }
  [popover].is-open { position: fixed; z-index: 80; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); }
.skip:focus { top: 10px; }
.tnum { font-variant-numeric: tabular-nums; }
.ico { flex: none; }
.gem { flex: none; color: var(--gem); }
.dia { display: inline-flex; align-items: center; gap: 4px; color: var(--gem); white-space: nowrap; }
.hint { color: var(--text-3); font-size: 13px; }
.spacer { flex: 1; }
.is-bad { color: var(--bad); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in { max-width: var(--wrap); margin: 0 auto; height: var(--topbar-h); padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand-name { font: 600 17px/1 var(--font-display); letter-spacing: -0.01em; }
.tabs { display: flex; gap: 2px; margin-left: 8px; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
  border-radius: 9px; color: var(--text-2); font-weight: 550; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.tab[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--rose); color: #fff; font: 650 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.count-quiet { background: var(--surface-3); color: var(--text-2); }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.find { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 9px 0 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-3); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.find:hover { border-color: var(--line-2); color: var(--text); }
.find kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-3); }
.status-slot { display: flex; }
.status { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 550; cursor: pointer; }
.status:hover { border-color: var(--line-2); color: var(--text); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--money); flex: none; }
.status-ok .status-dot, .status-dot.status-ok { background: var(--money); box-shadow: 0 0 0 3px var(--money-soft); }
.status-warn .status-dot, .status-dot.status-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.status-bad .status-dot, .status-dot.status-bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.status-idle .status-dot, .status-dot.status-idle { background: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.status-ok .status-dot { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: var(--r-ctl); border: 1px solid transparent; background: var(--surface-3); color: var(--text);
  font-weight: 600; font-size: 14.5px; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease); }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); background: color-mix(in srgb, var(--primary) 86%, var(--accent)); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-3); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-quiet-danger { background: transparent; color: var(--bad); }
.btn-quiet-danger:hover { background: var(--bad-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-wide { width: 100%; }
.btn-add { padding: 0 14px 0 11px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.is-current { color: var(--text); background: var(--surface-3); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
#notify-btn .when-on { display: none; }
#notify-btn[aria-pressed="true"] .when-on { display: block; color: var(--accent); }
#notify-btn[aria-pressed="true"] .when-off { display: none; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--accent); }
.hint .linklike, .facts .linklike, .receipts-note .linklike, .gg-note .linklike, .empty-text .linklike { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- inputs */
.input { width: 100%; height: 42px; padding: 0 13px; border-radius: var(--r-ctl); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 15px; outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.input-sm { height: 34px; font-size: 14px; border-radius: 9px; padding: 0 10px; }
.textarea { height: auto; padding: 10px 13px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"].input { min-width: 0; }
.fld { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld-date { max-width: 190px; }
.input-with-btn { display: flex; gap: 6px; align-items: center; }
.amount-field { position: relative; }
.amount-field .input-amount { height: 60px; padding-right: 44px; font: 600 30px/1 var(--font-display); letter-spacing: -0.02em; }
.amount-field .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 600 20px/1 var(--font); color: var(--text-3); pointer-events: none; }
.amount-field-sm .input-amount { height: 52px; font-size: 24px; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* segmented controls, chips */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > button, .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 550; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.seg > button:hover, .seg-btn:hover { color: var(--text); }
.seg > button[aria-pressed="true"], .seg-btn:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-sm > button { height: 28px; padding: 0 10px; font-size: 13px; }
.seg-wide { display: flex; }
.seg-wide .seg-btn { flex: 1; height: 38px; }
.lbl-short { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip:hover { border-color: var(--text-3); }
.chip.is-on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip-toggle { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip-toggle[aria-pressed="true"] { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.chip-toggle .count { background: var(--bad); }
.switch-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.switch { appearance: none; flex: none; width: 42px; height: 26px; margin: 0; border-radius: 13px; background: var(--line-2); position: relative; cursor: pointer; transition: background 0.2s var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 0.2s var(--ease); }
.switch:checked { background: var(--money); }
.switch:checked::after { transform: translateX(16px); }
.switch-text { display: grid; gap: 2px; }
.switch-text b { font-weight: 600; }

/* tags, channel marks, codes, avatars */
.ch-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); flex: none; background: var(--text-3); }
.ch-dot.ch-avito { background: var(--avito-mark); }
.ch-dot.ch-ggsel { background: var(--ggsel-mark); }
.ch-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font: 650 11.5px/1 var(--font); letter-spacing: 0.01em; flex: none; }
.ch-tag.ch-avito { color: var(--avito); background: var(--avito-soft); }
.ch-tag.ch-ggsel { color: var(--ggsel); background: var(--ggsel-soft); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-new { color: var(--accent); background: var(--accent-soft); }
.tag-regular { color: var(--money); background: var(--money-soft); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 600; }
.pill-ok { color: var(--money); background: var(--money-soft); }
.pill-bad { color: var(--bad); background: var(--bad-soft); }
.pill-wait { color: var(--ggsel); background: var(--ggsel-soft); }
.pill-info { color: var(--accent); background: var(--accent-soft); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 650; vertical-align: 2px; margin-left: 8px; }
.badge-ok { color: var(--money); background: var(--money-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.code-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; border: 0;
  background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.code-chip:hover { color: var(--text); background: var(--line); }
.code-chip.is-copied { color: var(--money); background: var(--money-soft); }
.code-chip-lg { height: auto; min-height: 44px; padding: 6px 10px; display: inline-grid; grid-template-columns: 1fr auto; text-align: left; gap: 1px 10px; }
.code-chip-lg .code-label { grid-column: 1; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.code-chip-lg .code-value { grid-column: 1; font-size: 14px; font-weight: 650; color: var(--text); word-break: break-all; white-space: normal; }
.code-chip-lg .ico { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.code-chip-lg.is-accent { background: var(--accent-soft); }
.avatar { --h: 260; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 45% 32%); font-weight: 700; font-size: 15px; }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 82%); } }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 46px; height: 46px; font-size: 19px; }
.avatar { position: relative; }
.av-ch { position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px;
  font: 700 10px/1 var(--font); font-style: normal; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.av-ch.ch-avito, .ch-mark.ch-avito { background: var(--avito-mark); }
.av-ch.ch-ggsel, .ch-mark.ch-ggsel { background: var(--ggsel-mark); }
.avatar-sm .av-ch { width: 14px; height: 14px; border-radius: 5px; font-size: 9px; right: -3px; }
.avatar-lg .av-ch { width: 20px; height: 20px; border-radius: 7px; font-size: 11px; }
.ch-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; flex: none;
  font: 700 12px/1 var(--font); font-style: normal; color: #fff; }
.st { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.st b { font-weight: 700; }
.st-more { font-weight: 550; opacity: 0.86; }
.st-regular { color: var(--money); background: var(--money-soft); }
.st-new { color: var(--accent-ink); background: var(--accent); }
.st-maybe { color: var(--warn); background: var(--warn-soft); }
.st-once { color: var(--text-2); background: var(--surface-3); }
.st-sm { height: 20px; padding: 0 7px; gap: 4px; border-radius: 6px; font-size: 11.5px; }
.tag-nopid { background: none; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-3); font-weight: 550; }
.chip-label { font-size: 11px; font-weight: 700; color: var(--text-3); }
.gifts { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 650; color: var(--text); }
.gifts .ico { color: var(--text-3); }
.dupe { font-size: 11px; font-weight: 700; color: var(--text-3); margin-left: 1px; }
.delta { font-weight: 700; }
.delta-up { color: var(--money); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--text-3); }
.notice { padding: 11px 13px; border-radius: 11px; font-size: 14px; line-height: 1.45; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-bad { background: var(--bad-soft); color: var(--bad); }

/* ----------------------------------------------------------- page frame */
.view { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 64px; outline: none; }
.view.is-loading { opacity: 0.55; transition: opacity 0.2s 0.15s; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--text-2); margin-top: 3px; }
.page-sub b { color: var(--text); font-weight: 650; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.panel-title { font-size: 16px; font-weight: 650; }
.panel-link { font-size: 14px; font-weight: 600; }
.panel-lead { color: var(--text-2); margin: 6px 0 12px; max-width: 70ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 200px; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 38px; height: 38px; border-radius: 12px; }
.empty { padding: 34px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty-title { font-weight: 650; font-size: 16px; }
.empty-text { color: var(--text-2); max-width: 46ch; }

/* ------------------------------------------------------- «Сегодня»: board */
.board { position: relative; margin: 2px 0 20px; }
.board-top { display: grid; grid-template-columns: minmax(250px, auto) minmax(0, 1fr) minmax(260px, 340px) auto; gap: 14px 36px; align-items: end; }
.board-day { color: var(--text-2); font-weight: 550; }
.board-sum { font: 600 clamp(40px, 5.2vw, 64px)/1.02 var(--font-display); letter-spacing: -0.035em; color: var(--money); margin: 4px 0 8px; white-space: nowrap; }
.board-pace { font-size: 14px; color: var(--text-2); }
.board-quiet { display: block; margin-top: 1px; font-size: 13px; color: var(--text-3); }
.board-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 10px 30px; align-self: center; }
.board-facts dt { font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.board-facts dd { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 650; white-space: nowrap; }
.board-facts dd .ico { color: var(--text-3); }
.hours { min-width: 0; }
.hours-bars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; height: 78px; border-bottom: 1px solid var(--line-2); }
/* every hour: a pale wide bar — a usual day, a narrow jade one in front — today */
.hr { position: relative; height: 100%; }
.hr::before, .hr::after { content: ""; position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.hr::before { left: 0; right: 0; height: var(--u); min-height: 2px; background: var(--surface-3); }
.hr::after { left: 20%; right: 20%; height: var(--v); background: var(--money); }
.hr.has-sales::after { min-height: 3px; }
.hr.is-future::before { opacity: 0.55; }
.hr.is-now::before { background: var(--line-2); }
.hours-axis { display: flex; justify-content: space-between; margin-top: 3px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hours-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.hours-last { margin-left: auto; }
.page-tools { display: flex; align-items: center; gap: 8px; }
.page-tools .select { width: auto; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
.key-now, .key-usual { display: inline-block; width: 9px; height: 9px; margin: 0 5px 0 0; border-radius: 2px; vertical-align: -1px; background: var(--money); }
.key-usual { margin-left: 10px; background: var(--line-2); }
.board-toggle { align-self: start; margin: -4px -8px 0 -18px; color: var(--text-3); }
.board-toggle .ico { transition: transform 0.2s var(--ease); }
.board.is-compact .board-toggle .ico { transform: rotate(180deg); }
.board.is-compact .tiles, .board.is-compact .hours { display: none; }
.board.is-compact .board-top { grid-template-columns: minmax(250px, auto) minmax(0, 1fr) auto; }
.board.is-compact .board-sum { font-size: clamp(34px, 4vw, 46px); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tile { position: relative; display: grid; align-content: start; gap: 2px; min-width: 0; padding: 12px 14px 14px; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; }
a.tile:hover { text-decoration: none; border-color: var(--line-2); }
.tile-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); min-height: 22px; }
.tile-value { font: 600 20px/1.25 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; }
.tile-value small { font: 550 13px/1 var(--font); letter-spacing: 0; color: var(--text-3); }
.tile-sub { font-size: 12.5px; line-height: 1.35; color: var(--text-2); }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.tile-bar i { display: block; height: 100%; background: var(--line-2); transition: width 0.4s var(--ease); }
.tile-avito .tile-bar i { background: var(--avito-mark); }
.tile-ggsel .tile-bar i { background: var(--ggsel-mark); }
.tile-new .tile-bar i { background: var(--accent); }
.tile-back .tile-bar i { background: var(--money); }

/* ------------------------------------------------------ «Сегодня»: lanes */
.inbox-bar { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.inbox-title { font-size: 17px; font-weight: 650; }
.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 20px; }
.lanes.is-single { grid-template-columns: minmax(0, 1fr); }
.lane { min-width: 0; overflow: hidden; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.lane-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 15px 16px 12px; border-bottom: 1px solid var(--line); }
.lane-ggsel .lane-head { box-shadow: inset 0 3px 0 var(--ggsel-mark); }
.lane-avito .lane-head { box-shadow: inset 0 3px 0 var(--avito-mark); }
.lane-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 650; }
.lane-what { color: var(--text-3); font-weight: 500; }
.lane-sub { font-size: 13px; color: var(--text-3); }
.lane-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 18px 32px; text-align: center; }
.cards { display: grid; }
.card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 14px 16px 15px; border-top: 1px solid var(--line); }
.cards > .card:first-child { border-top: 0; }
/* the stripe says what the order waits for: jade — send the gifts, rose — answer, pale — the buyer's move */
.card-order::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-2); }
.stage-ready::before { background: var(--money); }
.stage-reply::before { background: var(--rose); }
.stage-waiting::before { background: var(--warn); }
.stage-refund::before { background: var(--bad); }
.card.is-new, .quiet-row.is-new, .drow.is-new { animation: item-in 1.6s var(--ease); }
@keyframes item-in { from { background: var(--accent-soft); } }
.card.is-leaving, .quiet-row.is-leaving { opacity: 0.35; pointer-events: none; transition: opacity 0.3s; }
.card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-name { max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font-weight: 650; font-size: 15.5px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.card-name { cursor: pointer; }
button.card-name:hover { color: var(--accent); }
.card-time { align-self: flex-start; padding-top: 3px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.card-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.card-amount { font: 600 19px/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--money); }
.card-no { margin-left: auto; padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.card-no:hover { color: var(--accent); }
.card-stage { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.stage-ready .card-stage { color: var(--money); }
.stage-reply .card-stage { color: var(--rose); }
.stage-wait_friend .card-stage { color: var(--text-3); }
.stage-waiting .card-stage { color: var(--warn); }
.stage-refund .card-stage { color: var(--bad); }
.bubble { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; max-width: 64ch; padding: 8px 12px;
  border-radius: 4px 12px 12px 12px; background: var(--surface-3); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; justify-self: start; }
.lane-ggsel .bubble-in { background: var(--ggsel-soft); }
.lane-avito .bubble-in { background: var(--avito-soft); }
.bubble-in.is-unread { box-shadow: inset 0 0 0 1.5px var(--rose); }
.bubble-out { border-radius: 12px 4px 12px 12px; color: var(--text-2); }
.bubble.is-hidden { background: var(--surface-3); color: var(--text-3); font-style: italic; }
.msg-you { color: var(--text-3); font-weight: 600; }
.card-warn { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; line-height: 1.4; }
.card-warn > span { flex: 1; min-width: 0; }
.card-warn .ico { margin-top: 2px; }
.card-warn .btn { flex: none; color: var(--text); }
.maybe { display: grid; gap: 6px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); font-size: 13.5px; line-height: 1.4; }
.maybe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.maybe-text { flex: 1 1 200px; min-width: 0; }
.maybe-text .linklike { font-weight: 650; }
.maybe-text .ch-dot { margin-right: 5px; }
.card-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-meta { font-size: 13px; color: var(--text-3); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-wait_friend .btn-deliver { background: var(--surface-3); color: var(--text); }
.btn-say > span { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }
.card-preview { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.card-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sell { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sell-label { font-size: 13px; font-weight: 650; color: var(--text-2); }

/* farm gifts on the dashboard: the mass button above the lanes, per-card buttons and row states */
.gift-mass { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.card-gift { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.card-gift.is-done { color: var(--money); }
.dg-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.dg-state.is-done { color: var(--money); }
.dg-state.is-nopid { color: var(--warn); }

/* the PID: a tap copies it; an empty one is a slot that saves what is pasted */
.pidbox { display: inline-flex; align-items: stretch; max-width: 100%; height: 32px; overflow: hidden; border-radius: 9px; background: var(--surface-3); }
.pid-label { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.pid-copy { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.pid-copy:hover { background: var(--line); }
.pid-copy.is-copied { color: var(--money); background: var(--money-soft); }
.pid-copy.is-copied .pid-label { color: inherit; }
.pid-edit { display: inline-grid; place-items: center; width: 28px; padding: 0; border: 0; border-left: 1px solid var(--surface); background: none; color: var(--text-3); cursor: pointer; }
.pid-edit:hover { color: var(--text); background: var(--line); }
.pid-form { height: 34px; border: 1.5px dashed var(--line-2); background: var(--surface); }
.pid-form > .pid-label { padding: 0 2px 0 10px; }
.pid-form:focus-within { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stage-ready .pid-form { border-color: var(--accent); background: var(--accent-soft); }
.pid-input { width: 146px; min-width: 0; padding: 0 6px; border: 0; outline: none; background: none; font-size: 13.5px; font-weight: 600; }
.pid-input::placeholder { color: var(--text-3); font-weight: 500; }
.pid-input[aria-invalid="true"] { color: var(--bad); }
.pid-paste { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border: 0; border-left: 1px solid var(--line); background: var(--surface-3);
  color: var(--text-2); font-size: 12.5px; font-weight: 650; cursor: pointer; }
.pid-paste:hover { color: var(--text); background: var(--line); }
.pidbox.is-big { height: 46px; border-radius: 11px; }
.is-big .pid-copy { padding: 0 14px; font-size: 15px; }
.is-big .pid-input { width: 236px; font-size: 15px; }
.is-big .pid-edit { width: 36px; }

/* a sale in one tap: the sum is the button */
.sellbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.amt { display: grid; justify-items: center; align-content: center; gap: 1px; min-width: 64px; height: 44px; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease); }
.amt b { font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.amt small { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.amt small .gem { color: inherit; }
.amt:hover { border-color: var(--money); background: var(--money-soft); }
.amt:active { transform: translateY(1px); }
.amt[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.amt.is-own { border-color: var(--money); background: var(--money-soft); }
.amt.is-own b { color: var(--money); }
.amt-other { display: flex; align-items: center; gap: 4px; }
.amt-other .input { width: 88px; height: 44px; }
.amt-other .btn { width: 40px; height: 44px; padding: 0; }

/* chats opened by a message right after a purchase: kept aside, close by themselves */
.quiet { padding: 10px 8px 8px; border-top: 1px solid var(--line); background: var(--surface-2); }
.quiet-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; padding: 2px 8px 6px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.quiet-title .hint { font-weight: 500; }
.quiet-row { padding: 6px 8px; border-radius: 10px; }
.quiet-row:hover { background: var(--surface-3); }
.quiet-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quiet-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.quiet-name { flex: none; max-width: 45%; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet-text { min-width: 0; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet-text.is-hidden { color: var(--text-3); font-style: italic; }
.quiet-more { margin: 2px 0 2px 40px; }
.quiet-more summary { width: fit-content; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.quiet-more summary:hover, .quiet-more[open] summary { color: var(--text); }
.quiet-more[open] summary { margin-bottom: 8px; }

/* today's deals */
.daydeals { overflow: hidden; }
.receipts-inline { padding: 12px 12px 0; }
.receipts-inline .receipts { margin: 0; }
.panel-count { margin-left: 8px; font-size: 14px; font-weight: 600; color: var(--text-3); }
.panel-tools { display: flex; align-items: center; gap: 14px; }
.drow { position: relative; display: grid; grid-template-columns: 42px auto minmax(0, 1.1fr) minmax(0, 1fr) auto 130px; gap: 12px; align-items: center;
  padding: 9px 18px; border-top: 1px solid var(--line); }
.drow > :not(.deal-open) { position: relative; pointer-events: none; }
.drow button, .drow a { pointer-events: auto; }
.drow-time { font-size: 13px; color: var(--text-3); }
.drow-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.drow-who > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-3); }
.drow-num { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.drow-num b { min-width: 66px; text-align: right; font-size: 15px; font-weight: 650; }
.drow-num .dia { min-width: 58px; font-size: 13px; }
.drow-num .gifts { min-width: 40px; font-size: 13px; font-weight: 550; color: var(--text-2); }

.buyer-hint { font-size: 13px; color: var(--text-2); min-height: 0; }
.buyer-hint:empty { display: none; }
.buyer-hint b { color: var(--text); }
.mini-rows { padding: 0 8px 10px; }
.mini-row-static { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.mini-main { flex: 1; min-width: 0; display: grid; }
.mini-name { display: flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 12.5px; color: var(--text-3); }

/* receipts card */
.receipts { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; margin: 4px 0 12px;
  border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.receipts-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--money-soft); color: var(--money); }
.receipts-missing .receipts-icon, .receipts-connect .receipts-icon, .receipts-expired .receipts-icon { background: var(--bad-soft); color: var(--bad); }
.receipts-run .receipts-icon, .receipts-paused .receipts-icon { background: var(--accent-soft); color: var(--accent); }
.receipts-title { font-weight: 650; }
.receipts-sub, .receipts-note { font-size: 13.5px; color: var(--text-2); }
.receipts-sub.is-bad { color: var(--bad); }
.receipts-note { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.receipts-note.is-warn { color: var(--warn); }
.receipts-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.deadline-late, .deadline-soon { color: var(--bad); font-weight: 650; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 7px 0 5px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s var(--ease); }

/* ----------------------------------------------------------- deals list */
.ledger { overflow: hidden; }
.receipts-slot .receipts { margin: 0 0 14px; }
.day { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 8px; background: var(--surface-2); border-top: 1px solid var(--line); }
.ledger-rows > .day:first-child { border-top: 0; }
.day-title b { font-weight: 650; }
.day-full { margin-left: 8px; color: var(--text-3); font-size: 13.5px; }
.day-sum { display: flex; gap: 12px; align-items: baseline; font-size: 13.5px; color: var(--text-3); }
.day-sum b { color: var(--text); font-weight: 650; font-size: 14.5px; }
.day-missing { color: var(--bad); font-weight: 600; }
.deal, .buyer-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 150px; gap: 14px; align-items: center;
  padding: 11px 18px; border-top: 1px solid var(--line); }
.deal-open { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; border-radius: 0; }
.deal-open:hover { background: var(--surface-2); background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.deal > :not(.deal-open), .buyer-row > :not(.deal-open) { position: relative; pointer-events: none; }
.deal button, .deal a, .buyer-row button, .buyer-row a { pointer-events: auto; }
.deal.no-receipt { background: linear-gradient(90deg, var(--bad-soft), transparent 55%); }
.deal.no-receipt::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bad); }
.deal-main { min-width: 0; display: grid; gap: 4px; }
.deal-who { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.deal-who > button, .deal-who > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); }
.deal-note { color: var(--text-2); }
.deal-comment { display: inline-flex; gap: 4px; align-items: center; color: var(--text-2); }
.deal-num { display: grid; justify-items: end; gap: 1px; white-space: nowrap; }
.deal-num b { font-weight: 650; font-size: 15.5px; }
.deal-num span { font-size: 13px; color: var(--text-3); }
.deal-num .dia { color: var(--gem); }
.deal-receipt { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.rc { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 0; font-size: 13px; font-weight: 650; white-space: nowrap; cursor: pointer; text-decoration: none; }
.rc:hover { text-decoration: none; }
.rc-ok { color: var(--money); background: var(--money-soft); }
.rc-none { color: var(--bad); background: var(--surface); box-shadow: inset 0 0 0 1px var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.rc-none:hover { background: var(--bad-soft); }
.rc-wait { color: var(--text-2); background: var(--surface-3); cursor: default; }
.rc-off { color: var(--warn); background: var(--warn-soft); }
.buyer-last.is-lapsed { color: var(--warn); }
.more { margin: 0; border-radius: 0; border-width: 1px 0 0; height: 48px; }

/* -------------------------------------------------------------- analytics */
.metrics { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.metric { display: grid; align-content: start; gap: 4px; padding: 15px 16px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: 0; }
.metric-label { font-size: 13px; color: var(--text-3); font-weight: 600; }
.metric-value { font: 600 22px/1.2 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; }
.metric-main .metric-value { font-size: 30px; color: var(--money); }
.metric-note { font-size: 13px; color: var(--text-2); }
.channels { padding: 16px; margin-bottom: 14px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.channels-bar { display: flex; gap: 3px; height: 10px; margin-bottom: 12px; }
.channels-bar i { display: block; height: 100%; border-radius: 3px; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.channels-bar i:first-child { clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.channels-bar .ch-avito { background: var(--avito-mark); }
.channels-bar .ch-ggsel { background: var(--ggsel-mark); }
.channels-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.channel { display: grid; align-content: start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: inherit; cursor: pointer; }
.channel:hover, .channel.is-on { border-color: var(--line-2); }
.channel-name { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.channel-share { margin-left: auto; color: var(--text-3); font-size: 13px; }
.channel b { font: 600 19px/1.25 var(--font-display); letter-spacing: -0.02em; }
.channel-sub { font-size: 13px; color: var(--text-2); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { min-width: 0; }
.chart-wide, .chart-span { grid-column: 1 / -1; }
.chart-note { font-size: 13px; color: var(--text-3); }
.chart { min-height: 260px; padding: 0 8px 8px; }
.chart-tall { min-height: 320px; }
.charts-empty { display: none; grid-column: 1 / -1; color: var(--text-2); }
.charts.is-empty .chart-card { display: none; }
.charts.is-empty .charts-empty { display: block; }
.apexcharts-tooltip { box-shadow: var(--shadow-pop) !important; border: 0 !important; }
.apexcharts-tooltip.apexcharts-theme-light, .apexcharts-tooltip.apexcharts-theme-dark { background: var(--surface) !important; color: var(--text) !important; }
.tip { padding: 8px 10px; font: 13px/1.4 var(--font); }
.tip b { display: block; font-size: 14px; }
.apexcharts-text, .apexcharts-legend-text { fill: var(--text-3) !important; color: var(--text-2) !important; font-family: var(--font) !important; }
.apexcharts-gridline { stroke: var(--line) !important; }

/* --------------------------------------------------------------- settings */
.page-settings { max-width: 820px; margin: 0 auto; }
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.settings-nav a { padding: 6px 11px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.settings-nav a:hover { color: var(--text); text-decoration: none; }
.set { padding: 18px 20px; margin-bottom: 14px; scroll-margin-top: calc(var(--topbar-h) + 14px); }
.set .panel-title { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; }
.set-label { font-weight: 600; }
.set-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0; }
form[data-work-form] .set-inline { align-items: start; }
.set-inline .fld { flex: 1 1 220px; }
.set-stack { display: grid; gap: 12px; max-width: 420px; margin-top: 10px; }
.set-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.facts { display: grid; gap: 0; margin: 10px 0; }
.facts div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--text-3); font-size: 14px; }
.facts dd { font-weight: 550; }
.hidden-orders { margin-top: 10px; }
.hidden-orders summary { cursor: pointer; font-weight: 600; color: var(--text-2); padding: 6px 0; }
.npd-form { margin-top: 12px; }
.npd-report { margin-top: 10px; font-size: 14px; color: var(--text-2); }

/* ---------------------------------------------------------- sheets, pops */
.sheet { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: var(--r-sheet);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in 0.22s var(--ease); }
.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.sheet-wide { width: min(720px, calc(100vw - 32px)); }
.sheet-tall { height: min(88vh, 900px); }
.sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.sheet-heading { flex: 1; min-width: 0; }
.sheet-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.sheet-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; padding: 18px 22px; overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.sheet-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.dia-preview { font-size: 14px; color: var(--gem); font-weight: 600; min-height: 0; }
.dia-preview:empty { display: none; }
.gg-note { font-size: 14px; color: var(--text-2); background: var(--ggsel-soft); padding: 10px 12px; border-radius: 10px; }
.receipt-box { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; }
.receipt-box .rb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.facts-row div { display: grid; gap: 1px; }
.facts-row dt { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.facts-row dd { display: flex; align-items: center; gap: 4px; min-height: 26px; font-size: 17px; font-weight: 650; }
.sub-title { font-size: 15px; font-weight: 650; margin-top: 6px; }
.history li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history .h-main { flex: 1; min-width: 0; }
.history .h-date { font-weight: 600; }
.history .h-note { font-size: 13px; color: var(--text-3); }
.history .h-num { font-weight: 650; white-space: nowrap; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; }
.choice-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-item span { display: grid; gap: 2px; }
.pop { margin: 0; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); max-width: min(360px, calc(100vw - 24px)); }
.pop-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }
.status-pop { position: fixed; inset: auto; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px); right: max(12px, calc((100vw - var(--wrap)) / 2 + 12px)); font-size: 14px; color: var(--text-2); }
.status-pop p + p { margin-top: 8px; }
.pop-meta { font-size: 13px; color: var(--text-3); }
.pop-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 14px; }
.range-pop { position: fixed; inset: auto; top: calc(var(--topbar-h) + 70px); left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 24px)); }
.range-form { display: grid; gap: 12px; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* toasts */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
dialog > .toasts { top: 12px; bottom: auto; }
dialog.sheet-search > .toasts { top: auto; bottom: 20px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--primary); color: var(--primary-ink);
  box-shadow: var(--shadow-pop); pointer-events: auto; animation: toast-in 0.25s var(--ease); font-size: 14.5px; }
.toast.is-error { background: var(--bad); color: #fff; }
.toast.is-error .toast-text span { white-space: normal; }
.toast.is-event { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); cursor: pointer; }
.toast-text { flex: 1; min-width: 0; }
.toast-text b { display: block; font-weight: 650; }
.toast-text span { display: block; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .ch-dot { margin: 0 2px; }
.toast-action { flex: none; border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------- GGSel order */
.order-body { gap: 16px; }
.order-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.order-buyer { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.order-buyer-line { display: flex; align-items: center; gap: 10px; }
.order-buyer-main { display: grid; min-width: 0; }
.order-buyer-name { font-weight: 650; font-size: 16px; }
.codes { display: flex; flex-wrap: wrap; gap: 8px; }
.order-decide { padding: 12px; border-radius: 12px; background: var(--warn-soft); display: grid; gap: 10px; }
.order-decide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thread { display: grid; gap: 8px; }
.msgs { display: grid; gap: 10px; }
.msg { display: grid; gap: 3px; max-width: 82%; justify-self: start; }
.msg .bubble { padding: 9px 13px; border-radius: 4px 16px 16px 16px; background: var(--surface-3); line-height: 1.45; overflow-wrap: anywhere; }
.msg .bubble p { white-space: pre-wrap; }
.msg .bubble a { display: inline-flex; gap: 5px; align-items: center; }
.msg-buyer .bubble { background: var(--rose-soft); }
.msg-seller { justify-self: end; justify-items: end; }
.msg-seller .bubble { border-radius: 16px 4px 16px 16px; background: var(--accent-soft); }
.msg-unknown .bubble { background: var(--warn-soft); }
.msg.is-pending { opacity: 0.6; }
.msg-meta { font-size: 12px; color: var(--text-3); padding: 0 4px; }
.reply-foot { display: grid; gap: 10px; }
.reply { display: grid; gap: 8px; }
.templates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip-tpl { flex: none; height: 30px; font-weight: 550; font-size: 13px; color: var(--text-2); }
.reply-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-input { min-height: 44px; max-height: 160px; padding: 11px 13px; resize: none; line-height: 1.4; }
.reply-send { width: 46px; height: 44px; padding: 0; flex: none; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ login */
.page-login { display: grid; min-height: 100dvh; place-items: center; padding: 20px; }
.login { width: 100%; display: grid; place-items: center; }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: var(--r-sheet); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand .brand-name { font-size: 24px; }
.error-text { font-size: 18px; font-weight: 650; }

/* ------------------------------------------------------------------- dock */
.dock { display: none; }

/* ------------------------------------------------------- live touches */
html:has(dialog[open]) { overflow: hidden; }
.is-refreshing { opacity: 0.6; transition: opacity 0.2s var(--ease); }
.deal.is-new, .buyer-row.is-new { animation: item-in 1.6s var(--ease); }
.filter-empty { padding: 26px 18px; text-align: center; }
.sheet-confirm { width: min(440px, calc(100vw - 32px)); }
.confirm-text { color: var(--text-2); }
.rb-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rb-text .ico { color: var(--text-3); }
/* «Отправить алмазы» в карточке сделки (панель фермы) */
.gift-box .gift-send .gift-amount { width: 140px; text-align: right; }
.gift-texts { display: grid; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.gift-text { display: grid; gap: 4px; }
.gift-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gift-text-what { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.gift-text-body { font-size: 14px; color: var(--text); }
.history li { display: block; padding: 0; }
.h-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 2px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.h-row:hover .h-date { color: var(--accent); }
.h-row .h-main { flex: 1; min-width: 0; display: grid; }
.h-rc { font-size: 12px; font-weight: 650; white-space: nowrap; }
.h-rc.is-ok { color: var(--money); }
.h-rc.is-bad { color: var(--bad); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 18px 2px; font-size: 13px; color: var(--text-2); }
.chart-legend .key { margin-left: 0; }
#ch-month .apexcharts-bar-area, #ch-buyers .apexcharts-bar-area { cursor: pointer; }
.tip span { display: block; color: var(--text-2); }

/* ------------------------------------------------- buyers: marketplaces */
.chan-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.chan-tab { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text-2); font-size: 15px; font-weight: 650; cursor: pointer; }
.chan-tab:hover { border-color: var(--line-2); color: var(--text); }
.chan-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.chan-tab b { font: 600 18px/1 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.chan-tab[aria-pressed="true"] { color: var(--text); border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.chan-avito[aria-pressed="true"] { border-color: var(--avito-mark); box-shadow: inset 0 0 0 1px var(--avito-mark); background: var(--avito-soft); }
.chan-ggsel[aria-pressed="true"] { border-color: var(--ggsel-mark); box-shadow: inset 0 0 0 1px var(--ggsel-mark); background: var(--ggsel-soft); }
.deal-num > span { display: inline-flex; align-items: baseline; gap: 10px; }
.deal-num .gifts { font-size: 13px; font-weight: 550; color: var(--text-2); }

/* ------------------------------------------------------------- search */
.sheet-search { width: min(640px, calc(100vw - 32px)); max-height: min(76vh, 720px); margin-top: 9vh; }
.gs-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.gs-head .search { flex: 1; }
.gs-head .search .input { height: 44px; font-size: 16px; }
.gs-results { flex: 1; min-height: 132px; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.gs-row { display: flex; align-items: center; gap: 8px; padding-right: 10px; border-radius: 12px; }
.gs-row:hover, .gs-row:focus-within { background: var(--surface-3); }
.gs-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px 10px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; cursor: pointer; }
.gs-main { display: grid; min-width: 0; }
.gs-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-sub { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 26px 16px; text-align: center; }
.gs-hint { padding: 8px 16px 12px; border-top: 1px solid var(--line); }

/* ------------------------------------------- order and buyer sheets: extras */
.sheet-head .avatar { margin-top: 1px; }
.sheet-title .st { vertical-align: 2px; }
.order-ids, .sb-ids { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.code-chip-lg.is-uid { background: var(--warn-soft); }
.code-chip-lg.is-uid .code-label { color: var(--warn); }
.tpl { flex: none; display: inline-flex; align-items: stretch; height: 32px; overflow: hidden; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); }
.tpl-text { padding: 0 6px 0 12px; border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.tpl-text:only-child { padding-right: 12px; }
.tpl-text:hover { color: var(--text); }
.tpl-send { display: inline-grid; place-items: center; width: 34px; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface-3); color: var(--accent); cursor: pointer; }
.tpl-send:hover { background: var(--accent); color: var(--accent-ink); }
.tpl.is-accent { border-color: var(--warn); }
.tpl.is-accent .tpl-text { color: var(--warn); font-weight: 650; }
.sb-sell { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.sb-links { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; }
.sb-links .maybe-text .ico { display: inline-block; vertical-align: -2px; color: var(--text-3); }
.label .hint { font-weight: 500; }
.set-stack-wide { max-width: none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .find-text, .find kbd { display: none; }
  .find { width: 38px; height: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--text-2); }
  .find:hover { background: var(--surface-3); }
  .board-top, .board.is-compact .board-top { grid-template-columns: minmax(0, 1fr) auto; }
  .board-main { grid-column: 1; }
  .board-toggle { grid-column: 2; grid-row: 1; margin: 0; }
  .board-facts, .hours { grid-column: 1 / -1; }
  .board-facts { grid-template-columns: repeat(6, auto); }
  .drow { grid-template-columns: 42px auto minmax(0, 1fr) auto 124px; }
  .drow-codes { display: none; }
}
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric-main { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .inbox-bar { display: flex; }
  .lanes { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lanes[data-show="ggsel"] .lane-avito, .lanes[data-show="avito"] .lane-ggsel { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-facts { grid-template-columns: repeat(3, auto); }
  .tab { padding: 0 10px; }
  .status-text { display: none; }
  .status { width: 34px; padding: 0; justify-content: center; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --topbar-h: 54px; }
  body { font-size: 15px; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  .input, .select, .textarea { font-size: 16px; }
  .tabs, .btn-add { display: none; }
  .topbar-in { gap: 10px; }
  .brand-name { font-size: 16px; }
  .view { padding-top: 16px; padding-bottom: 32px; }
  .page-title { font-size: 22px; }
  .page-head { align-items: center; }
  .btn { height: 44px; }
  .btn-sm { height: 38px; }
  .icon-btn { width: 42px; height: 42px; }
  .dock { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--line); }
  .dock a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--text-3); font-size: 11px; font-weight: 600; text-decoration: none; }
  .dock a[aria-current="page"] { color: var(--text); }
  .dock a[aria-current="page"] .ico { color: var(--accent); }
  .dock .count { position: absolute; top: 0; left: calc(50% + 6px); height: 18px; min-width: 18px; font-size: 11px; }
  .dock-add { justify-self: center; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; border: 0; background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 22px -8px rgba(0,0,0,.45); cursor: pointer; }
  .toasts { bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 12px); }

  .board { margin-bottom: 16px; }
  .board-sum, .board.is-compact .board-sum { font-size: clamp(40px, 12.5vw, 54px); margin-bottom: 6px; }
  .board-facts { gap: 8px 22px; }
  .board-facts dd { font-size: 16px; }
  .board.is-compact .board-quiet { display: none; }
  .tiles { gap: 8px; margin-top: 14px; }
  .tile { padding: 11px 12px 13px; }
  .tile-value { font-size: 18px; }
  .panel-head { padding: 14px 14px 8px; }
  .lane-head { padding: 13px 14px 10px; }
  .card { padding: 13px 14px 14px; }
  .card-actions .btn { flex: 1 1 auto; }
  .card-actions .btn-deliver { flex: 1 1 100%; height: 46px; font-size: 15px; }
  .card-sell { gap: 6px; }
  .sellbar { flex: 1 1 100%; }
  .sellbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .amt { min-width: 0; height: 48px; padding: 0 2px; }
  .amt b { font-size: 13.5px; }
  .amt-other { grid-column: 1 / -1; }
  .amt-other { flex: 1 1 100%; }
  .amt-other .input { flex: 1; width: auto; height: 46px; }
  .amt-other .btn { width: 52px; height: 46px; }
  .pidbox { height: 38px; }
  .pid-form { height: 40px; flex: 1 1 100%; }
  .pid-input, .is-big .pid-input { flex: 1 1 0; width: 0; min-width: 72px; font-size: 16px; }
  .pid-paste { padding: 0 14px; font-size: 13.5px; }
  .quiet-more { margin-left: 40px; }
  .quiet-line { align-items: flex-start; }
  .quiet-main { flex-direction: column; align-items: stretch; gap: 1px; }
  .quiet-name { max-width: 100%; }
  .quiet-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .quiet-line > .card-time { display: none; }
  .maybe-text { flex: 1 1 100%; }
  .maybe-row .btn { flex: 1 1 0; height: 34px; }
  .daydeals .panel-head [data-add-deal] { display: none; }           /* the «+» of the dock does it */
  .drow { grid-template-columns: 40px auto minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px; }
  .drow .deal-receipt { display: none; }
  .drow-num { flex-direction: column; align-items: flex-end; gap: 0; }
  .drow-num .dia { min-width: 0; }
  .drow-num .gifts { display: none; }
  .chan-tabs { gap: 8px; }
  .chan-tab { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; font-size: 14px; }
  .sheet-search { margin: 0 0 auto; max-height: 86dvh; border-radius: 0 0 var(--r-sheet) var(--r-sheet); }
  .sheet-search[open] { animation: sheet-in 0.2s var(--ease); }
  .sheet-search .sheet-head::before { display: none; }

  .toolbar { gap: 8px; }
  .search { flex-basis: 100%; }
  .toolbar .seg { flex: 1 1 auto; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .deal, .buyer-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 14px; }
  .deal-receipt { grid-column: 2 / -1; justify-content: flex-start; }
  .deal-receipt:empty { display: none; }
  .buyer-row .deal-receipt { grid-column: 4; grid-row: 1; justify-content: flex-end; }
  .buyer-row .deal-who { flex-wrap: wrap; row-gap: 3px; }
  .buyer-row .deal-who > span:first-child { max-width: 100%; }
  .buyer-row .st-regular b, .buyer-row .st-once { display: none; }   /* the number of purchases is on the right */
  .buyer-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .day { padding: 12px 14px 6px; }
  .day-full { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 12px 13px; }
  .metric-value { font-size: 18px; }
  .metric-main .metric-value { font-size: 26px; }
  .channels-list { grid-template-columns: 1fr; }
  .chart { min-height: 220px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }

  .receipts { grid-template-columns: auto minmax(0, 1fr); }
  .receipts-actions { grid-column: 1 / -1; justify-content: stretch; }
  .receipts-actions > * { flex: 1 1 auto; }
  .chart-card .panel-head { flex-wrap: wrap; row-gap: 2px; }
  .chart-card .chart-note { flex-basis: 100%; }
  .sheet, .sheet-wide { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  .sheet[open] { animation: sheet-up 0.26s var(--ease); }
  .sheet-tall { height: 94dvh; }
  .sheet-head { padding: 16px 14px 10px 18px; }
  .sheet-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); transform: translateX(-50%); }
  .sheet-body { padding: 16px 18px; }
  .sheet-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)) 18px; }
  .sheet-foot .only-wide { display: none; }
  .sheet-foot .btn-primary:last-child { flex: 1 1 auto; }
  .fld-row { grid-template-columns: 1fr; }
  .fld-date { max-width: none; }
  .msg { max-width: 90%; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr; }
  .board-facts { grid-template-columns: repeat(2, auto); }
}
@media (hover: none) { .deal-open:hover { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
