/* Цвета — с образца (приложение AGENTRIS клиента «Парус Агент»): светлая и темная схемы.
   Тема: как в системе, либо принудительно <html data-theme="light|dark"> (js/theme.js, выбор в «Ещё»). */
:root {
  color-scheme: light;
  --bg: #f2f5f6; --card: #ffffff; --card-2: #efece5; --card-3: #e6e1d8;
  --text: #14213d; --muted: #5b5852; --faint: #8b877f;
  --line: rgba(22, 22, 22, .08); --line-strong: rgba(22, 22, 22, .18);
  --primary: #0a8287; --primary-2: #0b766f; --on-primary: #ffffff; --brand: #0d8f86;
  --accent-soft: rgba(13, 143, 134, .13); --accent-text: #0b766f; --focus: #0d8f86;
  --red: #b91c1c; --red-soft: rgba(220, 38, 38, .12);
  --green: #15803d; --green-soft: rgba(21, 128, 61, .13);
  --orange: #8f4f00; --orange-soft: rgba(217, 119, 6, .16);
  --blue: #1f5fe0; --blue-soft: rgba(31, 95, 224, .12);
  --ok-solid: #15803d; --err-solid: #b91c1c; --warn-solid: #b76a0c;
  --nav-on: linear-gradient(160deg, #45c9df, #0b8198); --nav-on-shadow: 0 6px 14px -6px #0b8198;
  --shadow-1: 0 1px 2px rgba(6, 16, 48, .06); --shadow-2: 0 10px 24px -14px rgba(0, 0, 0, .35);
  --toast-bg: #14213d; --toast-text: #ffffff; --scrim: rgba(6, 16, 48, .45);
  --tab-h: 64px; --top-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111111; --card: #1c1c1e; --card-2: #26262a; --card-3: #303035;
    --text: #f4f2ed; --muted: #aaa69e; --faint: #7d7a73;
    --line: rgba(244, 242, 237, .08); --line-strong: rgba(244, 242, 237, .2);
    --primary-2: #328c86; --accent-soft: rgba(44, 200, 184, .16); --accent-text: #4fd9ca; --focus: #2cc8b8;
    --red: #ff9c90; --red-soft: rgba(255, 156, 144, .14);
    --green: #7be3a0; --green-soft: rgba(123, 227, 160, .14);
    --orange: #ffc766; --orange-soft: rgba(255, 199, 102, .14);
    --blue: #86b4ff; --blue-soft: rgba(91, 156, 255, .2);
    --shadow-1: none; --shadow-2: 0 10px 24px -12px rgba(0, 0, 0, .7);
    --toast-bg: #f4f2ed; --toast-text: #111111; --scrim: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111; --card: #1c1c1e; --card-2: #26262a; --card-3: #303035;
  --text: #f4f2ed; --muted: #aaa69e; --faint: #7d7a73;
  --line: rgba(244, 242, 237, .08); --line-strong: rgba(244, 242, 237, .2);
  --primary-2: #328c86; --accent-soft: rgba(44, 200, 184, .16); --accent-text: #4fd9ca; --focus: #2cc8b8;
  --red: #ff9c90; --red-soft: rgba(255, 156, 144, .14);
  --green: #7be3a0; --green-soft: rgba(123, 227, 160, .14);
  --orange: #ffc766; --orange-soft: rgba(255, 199, 102, .14);
  --blue: #86b4ff; --blue-soft: rgba(91, 156, 255, .2);
  --shadow-1: none; --shadow-2: 0 10px 24px -12px rgba(0, 0, 0, .7);
  --toast-bg: #f4f2ed; --toast-text: #111111; --scrim: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h3 { margin: 18px 14px 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .red { color: var(--red); } .orange { color: var(--orange); }
.pad { padding: 8px 14px; } .right { margin-left: auto; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; } .gap { gap: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.err { color: var(--red); margin-top: 10px; min-height: 1.2em; }

/* каркас */
#app { min-height: 100vh; padding-top: var(--top-h); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.top { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line); }
.top-logo { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
.top-title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; border: 0; background: var(--card); color: var(--text);
  font-size: 26px; line-height: 1; padding: 0 0 3px; cursor: pointer; }
.sync { display: flex; align-items: center; gap: 6px; background: var(--card); color: var(--text); border: 1px solid transparent;
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-solid); }
.sync.bad { background: var(--orange-soft); color: var(--orange); }
.sync.bad::before { background: var(--warn-solid); }
.sync .ico-sync { display: none; }
.sync.spin::before { display: none; }
.sync.spin .ico-sync { display: inline-block; animation: spin 1s linear infinite; color: var(--accent-text); }
.sync .badge { background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 0 6px; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text); font-size: 12px; }
.tabs a .nlabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs a .nico { width: 48px; height: 30px; border-radius: 15px; background: none; }
.tabs a.on { font-weight: 600; }
.tabs a.on .nico { background: var(--nav-on); color: #ffffff; box-shadow: var(--nav-on-shadow); }
main { max-width: 820px; margin: 0 auto; }

/* значки (CSS, без картинок) */
.ico { display: inline-block; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico-sync { width: 14px; height: 14px; --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4V1L8 5l4 4V6a6 6 0 0 1 5.7 7.9l1.5 1.5A8 8 0 0 0 12 4zm0 14a6 6 0 0 1-5.7-7.9L4.8 8.6A8 8 0 0 0 12 20v3l4-4-4-4z"/></svg>'); }
.ico-clients { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21V8l9-5 9 5v13h-6v-7H9v7z"/></svg>'); }
.ico-catalog { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 2h6v4l-1 2v13a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V8L9 6z"/></svg>'); }
.ico-orders { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 2h14v20l-3-2-2 2-2-2-2 2-2-2-3 2zm3 5v2h8V7zm0 4v2h8v-2zm0 4v2h5v-2z"/></svg>'); }

/* списки и карточки */
.sticky { position: sticky; top: var(--top-h); z-index: 10; background: var(--bg); padding: 8px 10px; }
.filters .row { margin-top: 6px; }
.search, select, input[type=date], textarea, .form input { width: 100%; padding: 11px 14px; border: 1px solid transparent; border-radius: 14px;
  background: var(--card); color: var(--text); }
.search::placeholder, textarea::placeholder, .form input::placeholder { color: var(--faint); }
.list { background: var(--card); margin: 8px 10px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.item-side { flex-shrink: 0; text-align: right; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); margin-top: 4px; }
.tag.red { background: var(--red-soft); color: var(--red); } .tag.green { background: var(--accent-soft); color: var(--accent-text); margin-left: 6px; }
.tag.orange { background: var(--orange-soft); color: var(--orange); } .tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.grey { background: var(--card-2); color: var(--muted); }
.card { background: var(--card); margin: 10px; padding: 14px 16px; border-radius: 18px; box-shadow: var(--shadow-1); }
.card.point { display: flex; flex-direction: column; gap: 4px; }
.card.point .row { margin-top: 8px; }
.kpis { display: flex; gap: 8px; margin-top: 10px; }
.kpis div { flex: 1; background: var(--card-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.kpis b { font-size: 15px; } .kpis span { font-size: 12px; color: var(--muted); }
.kpis .red { background: var(--red-soft); } .kpis .red b { color: var(--red); }
.warnbox { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--orange-soft); color: var(--orange); font-size: 13px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line-strong); }
.line:last-child { border-bottom: 0; }
details.item { display: block; }
details.item summary, details.hist summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details.hist { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 16px;
  border: 1px solid transparent; background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; box-shadow: var(--shadow-1); }
.btn:active { background: var(--card-2); }
.card .btn, .lines .btn, .order-bar .btn { background: var(--card-2); box-shadow: none; }
.card .btn:active, .lines .btn:active, .order-bar .btn:active { background: var(--card-3); }
.btn.primary, .card .btn.primary, .order-bar .btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn.primary:active { background: var(--primary-2); }
.btn.danger-o, .card .btn.danger-o { background: var(--red-soft); color: var(--red); box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.wide { display: flex; width: calc(100% - 20px); margin: 10px; }
.btn:disabled { opacity: .55; }
.link { background: none; border: 0; color: var(--accent-text); margin-top: 16px; cursor: pointer; font-weight: 600; }
.seg { display: flex; gap: 4px; padding: 4px; margin: 10px; background: var(--card-2); border-radius: 14px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); padding: 8px 6px; border-radius: 11px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-1); }

/* заказ */
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 15px; margin: 0; white-space: nowrap; }
.form .row label { margin-bottom: 0; }
.form .card input, .form .card select, .form .card textarea, .card .search { background: var(--card-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.lines { background: var(--card); margin: 10px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.line-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.line-row:last-child { border-bottom: 0; }
.line-row .grow { flex-basis: 100%; }
.line-sum { margin-left: auto; font-weight: 700; }
.stepper { display: flex; align-items: center; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--card-2); }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--accent-soft); color: var(--accent-text); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper input { width: 58px; height: 38px; border: 0; text-align: center; background: transparent; color: var(--text); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.promo { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-strong); }
.promo input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.order-bar { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); box-shadow: var(--shadow-2); }
.total { display: flex; flex-direction: column; } .total b { font-size: 18px; }

/* подбор */
.picker { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.picker .top { position: static; }
.picker-body { flex: 1; overflow-y: auto; }
.picker .sticky { top: 0; }
.picker .order-bar { position: static; }
.prod .thumb { width: 54px; height: 54px; object-fit: contain; border-radius: 10px; background: #ffffff; flex-shrink: 0; }
.prod .thumb.none { background: var(--card-2); }
.prod .stepper button { width: 34px; } .prod .stepper input { width: 46px; }

/* вход и PIN */
.enroll { max-width: 420px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
#app:has(.enroll) { padding: 0; }
.logo img { width: 84px; height: 84px; border-radius: 24px; }
.enroll h1 { margin: 0; font-size: 22px; }
.enroll input { padding: 12px; border: 1px solid transparent; border-radius: 14px; text-align: center; background: var(--card); color: var(--text); }
.code-input { font-size: 26px; letter-spacing: 4px; font-family: ui-monospace, Consolas, monospace; }
#lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; }
#lock[hidden] { display: none; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; }
.pin-logo { width: 56px; height: 56px; border-radius: 16px; }
.pin-title { font-size: 18px; font-weight: 600; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); }
.pin-dots span.on { background: var(--primary); }
.pin-msg { min-height: 20px; color: var(--red); font-size: 14px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.pin-key { height: 64px; border-radius: 50%; border: 0; background: var(--card); color: var(--text); font-size: 26px; box-shadow: var(--shadow-1); cursor: pointer; }
.pin-key:active { background: var(--accent-soft); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 70px); transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 200;
  background: var(--toast-bg); color: var(--toast-text); padding: 10px 16px; border-radius: 14px; max-width: 90vw; font-size: 14px; box-shadow: var(--shadow-2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok-solid); color: #ffffff; } .toast.err { background: var(--err-solid); color: #ffffff; }

/* каталог как в старой программе торговых */
:root { --rose: #c2185b; --rose-soft: rgba(194, 24, 91, .12); --gold: #e0a800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rose: #ff8ab8; --rose-soft: rgba(255, 138, 184, .16); --gold: #ffd25a; } }
:root[data-theme="dark"] { --rose: #ff8ab8; --rose-soft: rgba(255, 138, 184, .16); --gold: #ffd25a; }
.cat { display: flex; align-items: flex-start; }
.cat-main { flex: 1; min-width: 0; }
.cat-bar .row { align-items: center; }
.search-wrap { position: relative; flex: 1; }
.search-wrap .clr { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.x { border: 0; background: var(--card-2); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.ftoggle { flex-shrink: 0; }
.tgs { flex-wrap: wrap; margin-top: 6px; align-items: center; }
.tg { border: 1px solid var(--line-strong); background: var(--card); color: var(--text); padding: 6px 12px; border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 13px; }
.tg.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cat-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-x { border: 0; background: var(--accent-soft); color: var(--accent-text); padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cat-list { background: var(--card); margin: 6px 10px 10px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.gh { padding: 7px 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); background: var(--card-2); }
.prod2 { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.prod2:last-child { border-bottom: 0; }
.prod2.in { background: var(--accent-soft); }
.prod2 .thumb { width: 44px; height: 64px; object-fit: contain; border-radius: 8px; background: #ffffff; flex-shrink: 0; }
.prod2 .thumb.none { background: var(--card-2); }
.pm { flex: 1; min-width: 0; }
.pt { line-height: 1.3; }
.pn { font-size: 16px; font-weight: 700; color: var(--text); }
.prod2.low .pn { color: var(--faint); }
.vol { color: var(--blue); font-weight: 700; margin-left: 6px; white-space: nowrap; }
.pk { color: var(--faint); font-size: 13px; white-space: nowrap; }
.chip { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.chip.c-red { background: var(--red-soft); color: var(--red); }
.chip.c-white { background: var(--blue-soft); color: var(--blue); }
.chip.c-rose { background: var(--rose-soft); color: var(--rose); }
.ps { color: var(--muted); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.ps .chip { margin-left: 4px; }
.star { border: 0; background: none; color: var(--gold); font-size: 17px; line-height: 1; padding: 0 0 0 4px; cursor: pointer; }
.pl { margin-top: 3px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lnk { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; cursor: pointer; font-size: 14px; }
.lnk.price { font-weight: 700; }
.st { color: var(--muted); }
.bought { color: var(--gold); font-weight: 600; }
.sum { color: var(--text); font-weight: 600; }
.pq { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.pq-r { display: flex; gap: 6px; justify-content: flex-end; }
.qb:disabled { opacity: .35; cursor: default; }
.qb { min-width: 44px; height: 38px; border: 1px solid var(--line-strong); background: var(--card); color: var(--accent-text); border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; }
.qb:active { background: var(--accent-soft); }
.qb.minus { color: var(--red); }
.qb.ghost { color: var(--muted); min-width: 34px; }
.qv { height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; }
.facets { display: none; }
.fhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px 10px; }
.fb { margin-bottom: 8px; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.fh { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 9px 12px; color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; text-align: left; }
.fh .fa { margin-left: auto; } .fsel { text-transform: none; letter-spacing: 0; background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }
.fl.many { max-height: 300px; overflow-y: auto; }
.fv { display: flex; justify-content: space-between; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); padding: 9px 12px; font-size: 15px; cursor: pointer; text-align: left; }
.fv.sub { padding-left: 26px; font-size: 14px; }
.fv.on { background: var(--primary); color: var(--on-primary); }
.fv .fn { color: var(--faint); font-size: 12px; } .fv.on .fn { color: var(--on-primary); }
.pricebox { padding: 0 10px 10px; } .pricebox input { width: 50%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text); }
.cat.show-f .facets { display: block; position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); padding: 10px 10px 0; }
.osum { display: flex; flex-direction: column; padding: 6px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.osum-main { color: var(--blue); }
.osum-bar { display: flex; align-items: center; background: var(--card); border-bottom: 1px solid var(--line); }
.osum-bar .osum { flex: 1; border-bottom: 0; }
.pct { min-width: 44px; height: 38px; margin: 0 10px; border: 0; background: none; color: var(--blue); font-size: 24px; font-weight: 700; cursor: pointer; }
.green { color: var(--accent-text); }
.pf { color: var(--muted); font-size: 13px; }
/* окно «Цена и профит» */
.pp-head .line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.pp-tabs { margin: 8px 0 4px; }
.pp-sep { border-top: 1px solid var(--line-strong); margin: 6px 0; }
.pp-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.pp-row .seg { margin: 0; flex: 0 0 auto; }
.pp-val { flex: 1; text-align: center; font-size: 24px; font-weight: 700; min-width: 90px; }
.pp-hint { font-size: 13px; color: var(--muted); padding: 6px 2px; min-height: 2.6em; }
@media (max-height: 860px) { .pp-row ~ .pad-keys .pad-key { height: 44px; font-size: 20px; } .pp-head .line { padding: 1px 0; } }
.sheet-wrap { position: fixed; inset: 0; z-index: 120; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 12px 6px calc(10px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 10px 8px; }
.sheet-body { padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.promo-row { padding: 8px 0; border-bottom: 1px dashed var(--line-strong); }
.pad-disp { font-size: 28px; font-weight: 700; text-align: center; padding: 10px; }
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad-key { height: 54px; border: 0; border-radius: 14px; background: var(--card); color: var(--text); font-size: 22px; box-shadow: var(--shadow-1); cursor: pointer; }
.pad-key:active { background: var(--accent-soft); }
@media (max-width: 420px) {
  .qb.ghost { display: none; } .qb { min-width: 40px; }
  /* товар в заказе: кнопки коробок и штук — одной строкой под текстом, чтобы текст не сжимался */
  .prod2.in { flex-wrap: wrap; }
  .prod2.in .pm { flex-basis: calc(100% - 54px); }
  .prod2.in .pq { flex-direction: row; flex-basis: 100%; justify-content: flex-end; gap: 14px; }
}
.ffoot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }
@media (min-width: 760px) {
  .fshow { display: none; }
  .facets { display: block; width: 250px; flex-shrink: 0; position: sticky; top: var(--top-h); max-height: calc(100vh - var(--top-h) - var(--tab-h)); max-height: calc(100dvh - var(--top-h) - var(--tab-h)); overflow-y: auto; padding: 8px 0 0 10px; }
  .picker .facets { top: 0; max-height: none; }
  .fhead .x, .ftoggle { display: none; }
  .cat.show-f .facets { position: sticky; inset: auto; padding: 8px 0 0 10px; }
  .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; }
}

main:has(.cat) { max-width: 1240px; }

/* ===== каркас 0.0.5: две роли, левое меню на широком экране, ☰ и нижняя панель на телефоне (как «Парус Агент») ===== */
.ico-home { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h8v8H3zm10 0h8v5h-8zm0 7h8v11h-8zM3 13h8v8H3z"/></svg>'); }
.ico-ship { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M1 5h13v11H1zm14 4h4l4 4v3h-8zM6 21a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm12 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/></svg>'); }
.ico-chart { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21V11h5v10zm6.5 0V3h5v18zm6.5 0v-7h5v7z"/></svg>'); }
.ico-offer { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M5 2h10l5 5v15H5zM8 11h9v2H8zm0 4h9v2H8z"/></svg>'); }
.ico-team { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="9" cy="7.5" r="4"/><circle cx="17.5" cy="9" r="3"/><path d="M1 21c0-4.4 3.6-7 8-7s8 2.6 8 7zm17.5 0c0-2.6-.9-4.6-2.5-6 3.6-.5 7 1.5 7 6z"/></svg>'); }
.ico-fix { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.7 6.3 18 10l-4-4 3.7-3.7A6 6 0 0 0 10 9.5L2.6 16.9a2.8 2.8 0 0 0 4 4l7.4-7.4a6 6 0 0 0 7.7-7.2z"/></svg>'); }
.ico-user { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="7.5" r="4.5"/><path d="M3 22c0-5 4-8 9-8s9 3 9 8z"/></svg>'); }
.ico-menu { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 5h18v2.4H3zm0 5.8h18v2.4H3zm0 5.8h18V19H3z"/></svg>'); }
.nico { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--accent-text); }
.nico .ico { width: 21px; height: 21px; }

/* шапка */
.top .menu-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; border: 0; background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.top-date { display: none; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); line-height: 1.25; white-space: nowrap; }
a.sync { color: var(--text); }
.sync.wait::before { background: var(--warn-solid); }
.me { display: flex; align-items: center; gap: 8px; color: var(--text); flex-shrink: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--nav-on); color: #ffffff; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.big { width: 56px; height: 56px; font-size: 20px; }
.me-name { display: none; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 14px; white-space: nowrap; }
.me-name small { color: var(--muted); font-weight: 500; font-size: 11px; }
@media (max-width: 420px) { .sync-text { display: none; } .sync { padding: 7px 10px; } }

/* левое меню (только широкий экран) */
.side { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; color: var(--text); }
.brand img { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; }
.brand .nlabel { display: flex; flex-direction: column; line-height: 1.2; }
.brand .nlabel span { font-size: 12px; color: var(--muted); }
.nghead { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 10px 8px 4px; cursor: pointer; }
.nghead span:last-child { transition: transform .15s; }
.ngroup.closed nav { display: none; }
.ngroup.closed .nghead span:last-child { transform: rotate(-90deg); }
.side nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 1px 0; border-radius: 12px; color: var(--text); font-weight: 500; }
.side nav a .nico { background: var(--card-2); }
.side nav a:hover { background: var(--card-2); }
.side nav a.on { background: var(--accent-soft); font-weight: 700; }
.side nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side nav a.on .nico { background: var(--nav-on); color: #ffffff; }
.side-toggle { margin-top: auto; align-self: flex-end; border: 0; background: var(--card-2); color: var(--muted); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 16px; }
.side.narrow .nlabel { display: none; }
.side.narrow .brand { justify-content: center; }
.side.narrow .nghead { height: 1px; padding: 0; margin: 8px 4px; background: var(--line-strong); pointer-events: none; }
.side.narrow .ngroup.closed nav { display: block; }
.side.narrow nav a { justify-content: center; }
.side.narrow .side-toggle { align-self: center; }
@media (min-width: 1000px) {
  :root { --side-w: 250px; --tab-h: 0px; }
  body.side-narrow { --side-w: 76px; }
  #app { padding-left: var(--side-w); }
  .tabs, .top .menu-btn { display: none; }
  .top { left: var(--side-w); padding: 0 18px; }
  .top-date, .me-name { display: flex; }
  .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 25; background: var(--card);
    border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; }
}

/* лист «Разделы» (☰) */
.sec-head { margin: 12px 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sec-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; color: var(--text); font-weight: 500; }
.sec-item .nico { background: var(--card); }
.sec-item.on { background: var(--accent-soft); font-weight: 700; }

/* список + карточка рядом */
.md { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); align-items: start; }
.md-list { position: sticky; top: var(--top-h); max-height: calc(100vh - var(--top-h)); overflow-y: auto; border-right: 1px solid var(--line); }
.md-list .sticky { top: 0; }
.md-card { min-width: 0; }
main:has(.md) { max-width: 1280px; }
.item.on { background: var(--accent-soft); }
.ctitle { margin: 16px 14px 0; font-size: 21px; }
.empty.hint { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty.hint .ico { width: 44px; height: 44px; color: var(--faint); }

/* чипы-отборы, выбор агента */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ag-chips { margin-bottom: 10px; }
.ag-online { padding: 0 10px; }
.chip-f { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); }
.chip-f span { color: var(--muted); font-weight: 700; }
.chip-f.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-f.on span { color: var(--on-primary); }
.agent-sel { width: auto; max-width: 45%; flex-shrink: 0; }

/* главная и сводка */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow-1); min-width: 0; }
.tile:hover { box-shadow: var(--shadow-2); }
.tile-t { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile b { font-size: 22px; overflow-wrap: anywhere; }
.tile-s { font-size: 12px; color: var(--muted); }
.tile.bad b { color: var(--red); }
@media (max-width: 420px) { .tile b { font-size: 18px; } }
.note { margin: 10px; padding: 9px 12px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.note a { color: inherit; font-weight: 700; text-decoration: underline; }

/* таблица: «Колонки», ширина мышью, группировки */
.card.flush { padding: 0; overflow: hidden; }
.dt-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.dt-bar .seg { margin: 0; }
.dt-wrap { overflow-x: auto; }
.dt table { border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 100%; }
.dt th, .dt td { padding: 9px 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
.dt th { position: relative; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--card-2);
  cursor: pointer; user-select: none; }
.dt .num { text-align: right; }
.dt .rz { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; }
.dt .rz:hover, .dt .rz:active { background: var(--accent-soft); }
.dt tr.click { cursor: pointer; }
.dt tr.click:hover td { background: var(--accent-soft); }
.dt tr.grp td { background: var(--card-2); font-weight: 700; color: var(--accent-text); }
.dt tbody tr:last-child td { border-bottom: 0; }
.col-opt { display: flex; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px dashed var(--line-strong); }

/* профиль и обмен */
.prof { display: flex; align-items: center; gap: 14px; }
.xstate { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.xstate::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ok-solid); }
.xstate.bad::before, .xstate.wait::before { background: var(--warn-solid); }

/* ---------- Главная агента и Сводка команды (0.0.6) ---------- */
.h3row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-right: 10px; }
.h3row .seg { margin: 10px 0 0; flex: 0 0 auto; width: 200px; }
.link0 { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; font-size: 13px; margin-top: 10px; }
.link0:disabled { color: var(--muted); cursor: default; }
.note.warn { background: var(--orange-soft); color: var(--orange); }
.note.warn .link0 { margin: 0 0 0 4px; color: inherit; text-decoration: underline; }
.plan { display: flex; flex-direction: column; gap: 2px; }
.plan-t { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.plan-r { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border: 0; background: none; color: var(--text); font-weight: 600; text-align: left; cursor: pointer; border-top: 1px solid var(--line); width: 100%; }
.plan-r:disabled { color: var(--muted); cursor: default; font-weight: 500; }
.plan-r .chev { margin-left: auto; color: var(--faint); font-size: 20px; line-height: 1; }
.plan .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.plan .dot.ok { background: var(--ok-solid); } .plan .dot.warn { background: var(--warn-solid); } .plan .dot.bad { background: var(--err-solid); }
.home-c { margin: 10px; }
.home-c div { background: var(--card); box-shadow: var(--shadow-1); }
.home-c .warn b { color: var(--orange); }
.tile.kpi { position: relative; padding-bottom: 10px; }
.kpi-v { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.delta { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 100%; height: 28px; margin-top: 6px; overflow: visible; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .now { stroke: var(--brand); }
.spark .prev { stroke: var(--faint); stroke-dasharray: 3 3; stroke-width: 1.5; }
@media (min-width: 760px) { .tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mv-t { font-weight: 700; margin-bottom: 8px; }
.bars { display: flex; gap: 12px; align-items: flex-end; height: 170px; padding-top: 4px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-col { flex: 1; width: 100%; max-width: 64px; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-col i { display: block; width: 100%; }
.bar-col .fact { background: var(--brand); border-radius: 8px 8px 4px 4px; min-height: 2px; }
.bar-col .fc { background: var(--accent-soft); border: 1px dashed var(--brand); border-bottom: 0; border-radius: 8px 8px 0 0; }
.bar-col .fc + .fact { border-radius: 0 0 4px 4px; }
.bar-v { font-size: 12px; font-weight: 700; white-space: nowrap; }
.bar-l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar-f { font-size: 11px; color: var(--accent-text); white-space: nowrap; margin-top: -3px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 1100px) { .two.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two > .card { margin-right: 0; } .two > .card:last-child { margin-right: 10px; } }
.mv-r { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--text); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.green { color: var(--green); }
.hb { padding: 5px 0; }
.hb-t { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.hb-t .ell { flex: 1; min-width: 0; }
.hb-bar { height: 6px; border-radius: 3px; background: var(--card-2); margin-top: 3px; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.item .acts { display: flex; gap: 6px; flex-shrink: 0; }
.item .acts .btn { background: var(--card-2); box-shadow: none; }
.item .acts .btn.primary { background: var(--primary); }
.more { display: block; width: 100%; border: 0; background: none; color: var(--accent-text); font-weight: 600; padding: 11px; cursor: pointer; }
.att { width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.att.red { background: var(--red-soft); color: var(--red); } .att.orange { background: var(--orange-soft); color: var(--orange); }
details.att-d { display: block; }
details.att-d summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details.att-d .line { color: var(--text); padding-left: 40px; }
.sum-bar { display: flex; gap: 8px; align-items: center; margin: 10px; flex-wrap: wrap; }
.sum-bar .seg { margin: 0; flex: 0 0 200px; }
.sum-bar .agent-sel { flex: 1; min-width: 180px; width: auto; background: var(--card); }
.src { line-height: 1.5; }
@media (max-width: 520px) {
  .item:has(.acts) { flex-wrap: wrap; row-gap: 8px; }
  .item:has(.acts) .item-main { flex-basis: 100%; }
  .item .acts { margin-left: auto; }
  .h3row .seg { width: 170px; }
}
main:has(.plan), main:has(.sum-bar) { max-width: 1180px; }

/* ===== этап 3 (0.0.7): клиенты, заказы и отгрузки из 1С, окно набора заказа ===================================== */
.home-c a { flex: 1; background: var(--card); box-shadow: var(--shadow-1); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; color: var(--text); }
.home-c a span { font-size: 12px; color: var(--muted); }
.home-c a.warn b { color: var(--orange); }
.lbox { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; }
.seg.mini { margin: 0; padding: 3px; border-radius: 12px; }
.seg.mini button { flex: 0 1 auto; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.wrapr { flex-wrap: wrap; align-items: center; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--faint); font-size: 22px; line-height: 1; }
.list.flat { margin: 6px 0; box-shadow: none; border: 1px solid var(--line); }
.btnrow { width: 100%; border: 0; background: var(--card); text-align: left; cursor: pointer; font: inherit; }
.btnrow:hover, .btnrow.on { background: var(--accent-soft); }
.chead { display: flex; gap: 12px; align-items: flex-start; }
.ctitle0 { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.cacts { margin-top: 12px; }
.card.flat { margin: 6px 0; box-shadow: none; border: 1px solid var(--line); }
.warnbox.bad { background: var(--red-soft); color: var(--red); }
.warnbox.mx { margin: 10px; }
.mx { margin-left: 10px; margin-right: 10px; }
.tag.ghost { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
.tag + .tag { margin-left: 4px; }
.orange { color: var(--orange); }
.chip-f.warn:not(.on) span { color: var(--orange); }
.chip-x.promo { background: var(--red-soft); color: var(--red); }
.tg b { margin-left: 2px; }

/* журнал: строки заказов и отгрузок, заголовки дней */
main:has(.docs) { max-width: 1180px; }
.docs-head { position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 8px 10px 6px; border-bottom: 1px solid var(--line); }
.docs-bar { position: static; padding: 0; background: none; border: 0; }
.chips-row { align-items: center; justify-content: space-between; }
.chips-row .chips { margin-top: 8px; }
.chips-row .btn { margin-top: 8px; }
.dgh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px 2px; font-size: 13px; }
.dgh b { text-transform: none; }
.dgh span { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.list.dlist { margin-top: 6px; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m s" "t t"; gap: 4px 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); color: var(--text); }
.drow:last-child { border-bottom: 0; }
.drow:hover { background: var(--accent-soft); }
.d-main { grid-area: m; min-width: 0; }
.d-tags { grid-area: t; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.d-tags .tag { margin: 0; }
.d-sum { grid-area: s; text-align: right; display: flex; flex-direction: column; white-space: nowrap; }
.d-sum span { font-size: 12px; color: var(--muted); }
@media (min-width: 760px) {
  .drow { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 130px; grid-template-areas: "m t s"; align-items: center; }
  .d-tags { justify-content: flex-start; }
}

/* карточки заказа и отгрузки */
.ocard .oh-client { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--accent-text); }
.osum2 { margin: 10px 0; } .osum2 b { font-size: 24px; }
.tiles.t3x { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile.good .tb-s { color: var(--green); }
.tile.bad .tb-s { color: var(--red); }
.tile .tb-s { font-size: 17px; }
.tile a { color: var(--text); display: block; }
.tile a .tb-s { color: var(--accent-text); }
.olines .oline { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.olines .oline:last-child { border-bottom: 0; }
.oline .onum { width: 22px; flex-shrink: 0; color: var(--faint); font-size: 12px; text-align: right; }
.oline.cancel .item-title, .oline.cancel .line-sum { text-decoration: line-through; color: var(--faint); }
.oline.total { background: var(--card-2); font-weight: 700; }
.thumb.sm { width: 30px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; flex-shrink: 0; }
.thumb.sm.none { background: var(--card-2); }
.line-sum { white-space: nowrap; }
.ttn .ttn-n { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.ttn .ttn-n b { font-size: 24px; letter-spacing: .02em; overflow-wrap: anywhere; }

/* окно набора заказа: шапка, оформление, подсказка по акции */
.ohead { position: relative; }
.oh-top { display: flex; gap: 12px; align-items: flex-start; }
.oh-client { font-size: 18px; font-weight: 800; color: var(--text); display: block; line-height: 1.25; }
.oh-point { border: 0; background: none; padding: 2px 0 0; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.oh-point .lnk { color: var(--accent-text); font-weight: 600; }
.oh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ochip { border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ochip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.promo-note { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; background: var(--red-soft); color: var(--text); }
.promo-note b { color: var(--red); }
.fl-t { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dd { display: flex; align-items: center; gap: 8px; }
.dd .qb { width: 44px; height: 44px; font-size: 22px; }
.dd-c { position: relative; flex: 1; text-align: center; background: var(--card); border-radius: 12px; padding: 10px; box-shadow: var(--shadow-1); cursor: pointer; }
.dd-in { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.tgl { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); cursor: pointer; }
.tgl input { width: 22px; height: 22px; }
.pdot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; background: var(--card-3); margin-top: 2px; }
.promo-row .promo { display: flex; gap: 10px; align-items: flex-start; }
.order-bar .total b { font-size: 19px; }
@media (min-width: 1000px) { .order-bar { bottom: 0; } }

/* калькулятор количества */
.pad-sub { text-align: center; font-size: 13px; margin: -4px 0 8px; }
.pad-eq { font-size: 16px; color: var(--muted); font-weight: 600; }
.pad-key.acc { background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.pad-key:disabled { opacity: .35; cursor: default; }
.sheet-body > .row { margin-top: 8px; }
.sheet-body > .row .pad-key { height: 48px; font-size: 16px; }
.drow.d-att { box-shadow: inset 3px 0 0 var(--warn-solid); }
@media (min-width: 760px) { .facets .btn.fshow { display: none; } }
.seg.mini { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.mini::-webkit-scrollbar { display: none; }
.chips-row { flex-wrap: wrap; }
.chips-row .chips { flex: 1 1 auto; min-width: 0; }
.chips-row .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 520px) { .oh-chips .ochip { font-size: 12px; padding: 5px 10px; } }

/* ===== 0.0.12: каталог таблицей «Наименование | Цена | Остаток», «Подбор», настройки каталога ⚙ ===== */
.btn.gear { flex-shrink: 0; padding-left: 12px; padding-right: 12px; font-size: 17px; }
.cat-head { padding: 6px 4px 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; }
.cat-head .link0 { margin: 0 0 0 8px; }
.gh .gn { font-weight: 600; color: var(--faint); letter-spacing: 0; text-transform: none; }
/* цена, остаток и сумма строки: в карточке — внутри строки, в таблице — колонками */
.c-card { display: contents; }
.c-pr, .c-st, .ptbl-h { display: none; }
.cat-list { container-type: inline-size; }
.cat.big .pn { font-size: 18px; }
.cat.big .ps, .cat.big .pl, .cat.big .lnk, .cat.big .c-pr, .cat.big .c-st { font-size: 16px; }
@container (min-width: 620px) {
  .cat-list:not(.cards):not(.ord) .prod2, .cat-list:not(.cards):not(.ord) .ptbl-h { display: grid; grid-template-columns: 36px minmax(0, 1fr) 130px 96px; column-gap: 12px; align-items: center; }
  .cat-list:not(.cards):not(.ord) .c-card { display: none; }
  .cat-list:not(.cards):not(.ord) .c-pr, .cat-list:not(.cards):not(.ord) .c-st { display: block; }
  .cat-list:not(.cards):not(.ord) .prod2 .thumb { width: 36px; height: 52px; }
}
@container (min-width: 700px) {
  .cat-list.ord:not(.cards) .prod2, .cat-list.ord:not(.cards) .ptbl-h { display: grid; grid-template-columns: 36px minmax(0, 1fr) 120px 84px 180px; column-gap: 12px; align-items: center; }
  .cat-list.ord:not(.cards) .c-card { display: none; }
  .cat-list.ord:not(.cards) .c-pr, .cat-list.ord:not(.cards) .c-st { display: block; }
  .cat-list.ord:not(.cards) .prod2 .thumb { width: 36px; height: 52px; }
}
.ptbl-h { padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.ptbl-h span:nth-child(n+3) { text-align: right; }
.ptbl-h span:nth-child(5) { text-align: right; }
.c-pr { text-align: right; font-size: 14px; }
.c-pr .small { margin-top: 2px; }
.c-st { text-align: right; font-size: 14px; }
.ptbl-h ~ .prod2 .pq { justify-self: end; }

/* ===== 0.0.13 — этап 6: Профиль, Обмен, «Сообщить о проблеме», «Мои обращения» ===== */
.help-btn { position: relative; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font-weight: 700; font-size: 16px; cursor: pointer; }
.help-btn .dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok-solid); border: 2px solid var(--bg); }
.plist { background: var(--card); margin: 8px 10px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.prow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.prow:last-child { border-bottom: 0; }
.prow:active { background: var(--card-2); }
.prow > span:first-child { flex: 1; min-width: 0; font-weight: 600; }
.prow > .muted { font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.prow .tag { margin-top: 0; }
.prow .chev { color: var(--faint); font-size: 20px; line-height: 1; }
.dot-st { display: inline-flex; align-items: center; gap: 7px; }
.dot-st::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok-solid); }
.dot-st.wait::before, .dot-st.bad::before { background: var(--warn-solid); }
@media (min-width: 900px) { .prof-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: start; } }
.xlog .line { font-size: 13px; }
.xlog .line > span:last-child { text-align: right; }
pre.diag { margin: 0; padding: 10px 12px; background: var(--card); border-radius: 12px; font-size: 12px; white-space: pre-wrap;
  overflow-wrap: anywhere; max-height: 50vh; overflow-y: auto; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.row-btns .btn { flex: 1; }
.problem-text { width: 100%; min-height: 110px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font: inherit; resize: vertical; margin: 6px 0; }
.shot-prev { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 4px 0 8px; }
.shot-prev img { max-width: 160px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line-strong); }
.rep { align-items: flex-start; }
.rep.unseen { background: var(--accent-soft); }
.rep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-head .tag { margin-top: 0; margin-left: 0; }
.rep-text { margin: 6px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rep-answer { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--card-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.rep-answer b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.help-item { background: var(--card); border-radius: 12px; padding: 10px 12px; margin: 3px 0; }
.help-item summary { cursor: pointer; font-weight: 600; }
.help-item > div { margin-top: 6px; color: var(--muted); }

/* ===== 0.0.14 — водитель и машина отгрузки ===== */
.drv-sub { color: var(--muted); }
.drv-sub .drv-ph0 { white-space: nowrap; }
.faint { color: var(--faint); }
.drv .drv-name { font-size: 18px; font-weight: 700; margin: 4px 0 2px; overflow-wrap: anywhere; }
.drv .drv-ph { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 6px 0; }
/* номер крупно и выделяется целиком — чтобы продиктовать или скопировать вручную */
.drv .drv-num { font-size: 22px; letter-spacing: .02em; user-select: all; -webkit-user-select: all; font-variant-numeric: tabular-nums; }
.drv .drv-acts { display: flex; gap: 8px; }
.drv .drv-car { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 8px 0 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.drv .drv-car b { user-select: all; -webkit-user-select: all; }
.drv .row-btns { margin-bottom: 0; }
/* заголовок карточки не сжимается метками в столбик («Отгрузка / № / PU00-…»): метки переносятся под него */
.wrapr > .ctitle0.grow { flex: 1 1 220px; }

/* вход по отпечатку и значок на экране (0.0.15) */
.prow[hidden], .install-banner[hidden] { display: none; }
.pin-key.bio { background: var(--accent-soft); font-size: 28px; }
.install-banner { display: flex; align-items: center; gap: 10px; margin: 10px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.install-banner img { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.install-banner > div { flex: 1; min-width: 0; }
.install-banner .btn { flex-shrink: 0; }
.install-banner .x { flex-shrink: 0; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px; }
