/* de-hunt. Концепция «лицевая панель»: всё тихое и деловое, кроме калькулятора —
   он сделан как панель усилителя: индикаторы, фейдер со шкалой. Сетка 8px. */

/* IBM Plex Sans (SIL OFL 1.1), переменный: вес 400–700, ширина 85–100 % */
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-sans-var-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 85% 100%;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-sans-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 85% 100%;
  font-display: swap;
  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;
}

/* ── токены ── */
:root {
  --page: #e8eaed;      /* алюминий: шасси */
  --panel: #ffffff;     /* экраны, строки, шторки */
  --panel-2: #f2f3f5;   /* поля ввода, нажатие */
  --ink: #1a1d21;       /* графит */
  --ink-2: #5b626c;     /* «шелкография»: подписи */
  --line: #dfe2e6;
  --line-2: #c9cdd3;
  --link: #1a1d21;
  --amber: #f2a93b;     /* лампа: только действие */
  --amber-press: #e0962a;
  --amber-ink: #1a1d21;
  --gain: #177a42;
  --loss: #c0362c;
  --gain-bg: #e3f1e8;
  --loss-bg: #fbe8e6;
  --chart-gain: #08704d; /* пара проверена validate_palette.js (светлая) */
  --chart-loss: #eb6b3d;
  /* лицевая панель калькулятора — своя в любой теме */
  --fp: #1e2125;
  --fp-2: #2b2f35;
  --fp-win: #141619;
  --fp-line: #3a3f46;
  --fp-ink: #f2f3f5;
  --fp-ink-2: #a3abb5;
  --fp-gain: #5ad394;
  --fp-loss: #ff8a7e;
  --z-loss: rgba(255, 122, 110, 0.55);
  --z-mid: rgba(255, 255, 255, 0.16);
  --z-good: rgba(90, 211, 148, 0.62);
  --overlay: rgba(20, 22, 26, 0.45);
  --lift: 0 -8px 24px rgba(20, 22, 26, 0.08);
  --lift-sheet: 0 -12px 40px rgba(20, 22, 26, 0.22);
  --lift-pop: 0 8px 28px rgba(20, 22, 26, 0.16);
  --r-obj: 16px;
  --r-key: 10px;
  --r-thumb: 6px;
  --r-sheet: 20px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Plex", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #131518;
  --panel: #1a1d21;
  --panel-2: #24272c;
  --ink: #e6e8eb;
  --ink-2: #9aa2ac;
  --line: #2b2f35;
  --line-2: #3b4047;
  --link: #e6e8eb;
  --gain: #5ad394;
  --loss: #ff8a7e;
  --gain-bg: rgba(90, 211, 148, 0.13);
  --loss-bg: rgba(255, 138, 126, 0.13);
  --chart-gain: #35aa76; /* пара проверена validate_palette.js (тёмная) */
  --chart-loss: #bb3f00;
  --fp: #24272c;
  --fp-2: #30343a;
  --fp-win: #16181b;
  --fp-line: #3e434a;
  --overlay: rgba(0, 0, 0, 0.6);
  --lift: 0 -8px 24px rgba(0, 0, 0, 0.35);
  --lift-sheet: 0 -12px 40px rgba(0, 0, 0, 0.5);
  --lift-pop: 0 8px 28px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --page: #131518; --panel: #1a1d21; --ink: #e6e8eb; --ink-2: #9aa2ac; color-scheme: dark; }
}

/* ── база ── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--panel);
  color: var(--ink);
  font: 400 15px/1.47 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
html.sheet-open, html.sheet-open body { overflow: hidden; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.ico { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.visually-hidden:focus-visible + .file-btn { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── раскладка: телефон ── */
#app { min-height: 100dvh; }
#app.booting #pane-main::before {
  content: ""; display: block; width: 24px; height: 24px; margin: 40vh auto 0;
  border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
#pane-main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); max-width: 720px; margin: 0 auto; }
#pane-detail {
  position: fixed;
  inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0;
  z-index: 20;
  background: var(--panel);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
}
body.route-lot #pane-detail { display: block; animation: push-in 0.18s ease-out; }
.detail-empty { display: none; }

/* ── вкладки ── */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 4px var(--safe-b);
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#tabbar .brand { display: none; }
.tab {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 48px;
  color: var(--ink-2); text-decoration: none;
  font-size: 11.5px; font-weight: 500;
}
.tab-led { position: absolute; top: 0; width: 20px; height: 3px; border-radius: 0 0 2px 2px; background: transparent; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-current="page"] .tab-led { background: var(--amber); }
.tab-badge {
  position: absolute; top: 6px; left: calc(50% + 7px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amber); color: var(--amber-ink);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}

/* ── шапки экранов ── */
.view-head {
  position: sticky; top: 0; z-index: 6;
  padding: 12px 16px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.page-head { padding: 24px 16px 4px; }
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }

/* сегменты: ряд клавиш, нажатая — графитовая */
.seg { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-key); background: var(--panel-2); }
.seg-btn {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.seg-btn[aria-selected="true"] { background: var(--ink); color: var(--panel); font-weight: 600; }
.seg-count { font-size: 13px; font-stretch: 85%; font-variant-numeric: tabular-nums; opacity: 0.75; }
.seg-count:empty { display: none; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.list-count { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }

/* клавиши */
.key {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-key);
  background: var(--panel); color: var(--ink);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.key::after { content: ""; position: absolute; inset: -2px; }
.key:active { background: var(--panel-2); }
.key[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.sort-key select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none; border: 0; }
.sort-key:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.fbadge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amber); color: var(--amber-ink); font-size: 11px; font-weight: 700;
}
.key[aria-expanded="true"] .fbadge { box-shadow: 0 0 0 1px var(--ink); }

/* фильтры */
.filters { padding: 12px 0 2px; }
.search-wrap { position: relative; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search-wrap .input { padding-left: 40px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin-top: 8px; }
.ffield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flabel { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px;
  border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
.link-btn.on-dark { color: var(--fp-ink); text-decoration-color: var(--fp-line); }
.filters .reset { margin-top: 2px; }

/* поля */
.input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-key);
  background: var(--panel-2); color: var(--ink);
  font-size: 16px; /* меньше 16 — iOS увеличивает экран при фокусе */
  appearance: none; -webkit-appearance: none;
}
select.input {
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input::placeholder { color: var(--ink-2); opacity: 0.85; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-key);
  background: var(--panel); color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { background: var(--panel-2); }
.btn:disabled, .btn.disabled { opacity: 0.55; pointer-events: none; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.primary:active:not(:disabled) { background: var(--amber-press); border-color: var(--amber-press); }
.btn.big { min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.done { border-color: var(--gain); color: var(--gain); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
}
.icon-btn:active { background: var(--panel-2); }

/* ── строки лотов ── */
.rows { display: flex; flex-direction: column; }
.row {
  position: relative;
  display: flex; gap: 12px;
  padding: 12px 16px;
  color: inherit; text-decoration: none;
  -webkit-user-select: none; user-select: none;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 124px; right: 0; border-top: 1px solid var(--line); }
.row:active { background: var(--panel-2); }
@media (hover: hover) { .row:hover { background: var(--panel-2); } }
.row[aria-current="true"] { background: var(--panel-2); }
.row[aria-current="true"]::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: var(--amber); }
.thumb {
  position: relative; flex: none; align-self: flex-start;
  width: 96px; aspect-ratio: 4 / 3;
  border-radius: var(--r-thumb); overflow: hidden; background: var(--panel-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; color: var(--ink-2); background: var(--panel-2); }
.ph .ico { opacity: 0.6; }
.ph-txt { font-size: 13px; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-price { font-size: 20px; font-weight: 600; font-stretch: 85%; line-height: 1.2; white-space: nowrap; }
.row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-deal { font-size: 13px; color: var(--ink); }
.row-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); }
.row-where { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-when { flex: none; white-space: nowrap; }
.row-tags { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; }

/* цифра прибыли: знак + вес; цвет — вторым признаком */
.pf { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.pf-val { font-size: 16px; font-weight: 700; font-stretch: 85%; }
.pf-pct { font-size: 13px; color: var(--ink-2); font-stretch: 85%; }
.pf.good .pf-val { color: var(--gain); }
.pf.bad .pf-val { color: var(--loss); }
.pf.none { font-size: 13px; color: var(--ink-2); }

/* метки: иконка + текст, без плашек */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); max-width: 100%; }
.tag .ico { width: 14px; height: 14px; }
.tag.stop { color: var(--loss); }
.tag.warn { color: var(--ink); }
.tag.stage { color: var(--ink); }

.list-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; }
.foot-note { font-size: 13px; color: var(--ink-2); }
.sentinel { height: 1px; }

/* скелетоны: спокойные плашки без мигания */
.skel { background: var(--panel-2); border-radius: 4px; }
.skel-row { pointer-events: none; }
.skel.line { height: 12px; margin: 6px 0; }
.skel.line.tall { height: 18px; }
.skel.line.xl { height: 30px; }
.w30 { width: 30%; } .w40 { width: 40%; } .w55 { width: 55%; } .w70 { width: 70%; }
.skel.block { height: 120px; margin: 16px 0; border-radius: 8px; }
.skel.block.tall { height: 260px; }

/* пустые состояния */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.empty-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; background: var(--panel-2); color: var(--ink-2); }
.empty-title { font-size: 17px; font-weight: 600; }
.empty-text { max-width: 34ch; color: var(--ink-2); font-size: 14.5px; text-wrap: balance; }
.empty .btn { margin-top: 8px; }
.boot-err { padding-top: 20vh; }

/* ── секции ── */
.sec { padding: 24px 16px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.sec-title .ico { color: var(--ink-2); }
.sec-head .sec-title { margin-bottom: 8px; }
.sec-text { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; max-width: 60ch; }
.card-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* ── лот ── */
.lot-view { position: relative; max-width: 760px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.gallery { position: relative; background: #1a1d21; aspect-ratio: 4 / 3; max-height: 60vh; width: 100%; }
.gallery.skel { background: var(--panel-2); border-radius: 0; }
.gallery.empty { background: var(--panel-2); aspect-ratio: 16 / 9; }
.g-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide { flex: 0 0 100%; height: 100%; padding: 0; border: 0; background: transparent; scroll-snap-align: center; scroll-snap-stop: always; cursor: zoom-in; }
.g-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-count { position: absolute; right: 12px; top: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(26, 29, 33, 0.72); color: #fff; font-size: 13px; font-weight: 500; pointer-events: none; }
.g-nav { position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 50%; background: rgba(26, 29, 33, 0.72); color: #fff; display: none; place-items: center; }
.g-nav.prev { left: 12px; } .g-nav.next { right: 12px; }
@media (hover: hover) and (pointer: fine) { .gallery:hover .g-nav { display: grid; } }
.fab {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(26, 29, 33, 0.72); color: #fff;
}
.fab::after { content: ""; position: absolute; inset: -4px; }
.fab.solid { position: static; margin: 12px 0 0 12px; background: var(--panel-2); color: var(--ink); }

.lot-body { padding: 16px 0 8px; flex: 1; }
.lot-head { padding: 0 16px; }
.lh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lh-price { font-size: 30px; font-weight: 600; font-stretch: 85%; line-height: 1.1; }
.stage-key { flex: none; }
.lh-name { margin-top: 6px; font-size: 20px; font-weight: 600; line-height: 1.25; }
.lh-title { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.lh-meta { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.lh-ago { margin-left: 12px; }

.lot-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 16px 0; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 8px 4px;
  border: 1px solid var(--line-2); border-radius: var(--r-key); background: var(--panel);
  color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.2; text-align: center;
}
.act:active { background: var(--panel-2); }
.act.danger { color: var(--loss); }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 16px 0; padding: 12px 4px 12px 12px;
  border-radius: var(--r-key); background: var(--gain-bg);
}
.notice > .ico { color: var(--gain); margin-top: 1px; }
.notice-body { flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.notice-text { font-size: 14.5px; }
.notice-x { width: 32px; height: 32px; margin-top: -6px; }

/* ── калькулятор: лицевая панель ── */
.fp {
  margin: 20px 16px 0;
  padding: 14px 16px 16px;
  border-radius: var(--r-obj);
  background: var(--fp);
  color: var(--fp-ink);
}
:root[data-theme="dark"] .fp { box-shadow: inset 0 0 0 1px var(--fp-line); }
.fp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fp-title { font-size: 14px; font-weight: 600; color: var(--fp-ink-2); }
.fp-goal { font-size: 12.5px; color: var(--fp-ink-2); }
.fp-readouts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 10px 0 14px; border-bottom: 1px solid var(--fp-line); }
.ro { display: flex; flex-direction: column; min-width: 0; }
.ro-label { font-size: 13px; color: var(--fp-ink-2); }
.ro-line { display: flex; align-items: baseline; gap: 8px; }
.ro-val { font-size: 44px; line-height: 1.05; font-weight: 600; font-stretch: 85%; letter-spacing: -0.01em; white-space: nowrap; transition: opacity 0.12s; }
.ro-pct { font-size: 18px; font-weight: 500; font-stretch: 85%; color: var(--fp-ink-2); }
.ro-val2 { font-size: 28px; line-height: 1.15; font-weight: 600; font-stretch: 85%; margin-top: 8px; white-space: nowrap; }
.ro-state { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--fp-ink-2); }
.ro-err { margin-top: 4px; font-size: 13px; color: var(--fp-loss); }
.ro.good .ro-val, .ro.good .ro-state { color: var(--fp-gain); }
.ro.bad .ro-val, .ro.bad .ro-state { color: var(--fp-loss); }
.ro.pending .ro-val { opacity: 0.45; }
.ro-side { padding-left: 16px; border-left: 1px solid var(--fp-line); min-width: 104px; }
.ro-state.ok { color: var(--fp-gain); }
.ro-state.low { color: var(--amber); }

.fp-sale { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.fp-label { display: flex; flex-direction: column; font-size: 15px; font-weight: 500; }
.fp-sub { font-size: 12.5px; font-weight: 400; color: var(--fp-ink-2); }
.stepper { display: flex; align-items: center; gap: 6px; }
.fp-key {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--fp-line); border-radius: var(--r-key); background: var(--fp-2); color: var(--fp-ink);
}
.fp-key:active { background: var(--fp-line); }
.sale-val {
  min-width: 108px; height: 44px; padding: 0 12px;
  border: 1px solid var(--fp-line); border-radius: 8px; background: var(--fp-win); color: var(--fp-ink);
  font-size: 24px; font-weight: 600; font-stretch: 85%; text-align: center;
}
.fp-key:focus-visible, .sale-val:focus-visible, .fp-input:focus-visible { outline-color: var(--amber); }

.fader { margin-top: 10px; }
.zmarks, .scale { position: relative; }
.zmarks { height: 18px; }
.scale { height: 50px; }
.scale-in { position: absolute; inset: 0 13px; }
.zm { position: absolute; bottom: 0; font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--fp-ink-2); padding-bottom: 7px; }
.zm::after { content: ""; position: absolute; bottom: 0; width: 1px; height: 6px; background: currentColor; }
.zm.be { transform: translateX(calc(-100% + 0.5px)); padding-right: 5px; }
.zm.be::after { right: 0; }
.zm.tg { transform: translateX(-0.5px); padding-left: 5px; }
.zm.tg::after { left: 0; }
.zm.tg { color: var(--fp-gain); }
.zm.be { color: var(--fp-loss); }
.tk { position: absolute; top: 0; width: 1px; height: 4px; margin-left: -0.5px; background: var(--fp-ink-2); opacity: 0.45; }
.tk.major { height: 8px; opacity: 0.85; }
.tl { position: absolute; top: 10px; transform: translateX(-50%); font-size: 11px; color: var(--fp-ink-2); }
.mkt { position: absolute; top: 30px; height: 5px; border: 1.5px solid var(--fp-ink-2); border-top: 0; border-radius: 0 0 3px 3px; }
.mkt::after { content: "рынок"; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--fp-ink-2); }
.mkt-med { position: absolute; top: -4px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--fp-ink); }

/* фейдер: прорезь с зонами, колпачок с рисской */
.fader-input {
  --th: 13px; --be: 0; --tg: 0;
  display: block; width: 100%; height: 44px; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none;
  cursor: pointer; touch-action: pan-y;
}
.fader-input::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px; background: var(--z-mid);
}
.fader-input.zoned::-webkit-slider-runnable-track {
  background: linear-gradient(to right,
    var(--z-loss) 0 calc(var(--th) + (100% - 2 * var(--th)) * var(--be)),
    var(--z-mid) calc(var(--th) + (100% - 2 * var(--th)) * var(--be)) calc(var(--th) + (100% - 2 * var(--th)) * var(--tg)),
    var(--z-good) calc(var(--th) + (100% - 2 * var(--th)) * var(--tg)) 100%);
}
.fader-input::-moz-range-track { height: 8px; border-radius: 4px; background: var(--z-mid); }
.fader-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 38px; margin-top: -15px; border: 0; border-radius: 5px;
  background: linear-gradient(to right, #e6e8eb 0 11px, var(--amber) 11px 15px, #e6e8eb 15px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.fader-input::-moz-range-thumb {
  width: 26px; height: 38px; border: 0; border-radius: 5px;
  background: linear-gradient(to right, #e6e8eb 0 11px, var(--amber) 11px 15px, #e6e8eb 15px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.fader-input:focus-visible { outline: none; }
.fader-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--amber), 0 2px 6px rgba(0, 0, 0, 0.45); }
.fp-hint { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--fp-ink-2); }

.fp-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fp-line); }
.fp-field { position: relative; width: 132px; flex: none; }
.fp-input {
  width: 100%; height: 44px; padding: 0 30px 0 12px;
  border: 1px solid var(--fp-line); border-radius: 8px; background: var(--fp-win); color: var(--fp-ink);
  font-size: 20px; font-weight: 600; font-stretch: 85%; text-align: right;
}
.fp-input:focus { border-color: var(--amber); outline: none; }
.fp-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--fp-ink-2); pointer-events: none; font-size: 16px; line-height: 1; }

/* расчёт под панелью */
.ledger { padding: 24px 16px 0; }
.ledger:empty { display: none; }
.bd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 15px; }
.bd-k { min-width: 0; }
.bd-v { white-space: nowrap; }
.bd-row.top, .bd-row.group { font-weight: 600; }
.bd-row.group { margin-top: 8px; }
.bd-row.sub { padding: 2px 0 2px 16px; font-size: 14px; color: var(--ink-2); }
.bd-row.total { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 700; }
.bd-row.total .bd-v { font-stretch: 85%; font-size: 20px; }
.bd-row.total.good .bd-v { color: var(--gain); }
.bd-row.total.bad .bd-v { color: var(--loss); }
.ship { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ship > .ico { color: var(--ink-2); margin-top: 1px; }
.ship-txt { flex: 1; min-width: 0; }
.ship-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 500; }
.ship-sub { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.ship.warn { color: var(--ink); font-weight: 500; font-size: 14.5px; }
.ship.warn > .ico { color: var(--loss); }
.compare { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; font-size: 14px; color: var(--ink-2); }
.cmp-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin-top: 6px; }
.cmp {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-height: 52px; padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-key); background: var(--panel); color: var(--ink);
}
.cmp-rate { font-size: 12.5px; color: var(--ink-2); }
.cmp-val { font-size: 16px; font-weight: 600; font-stretch: 85%; white-space: nowrap; }
.cmp-val.neg { color: var(--loss); }
.cmp.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.cmp.on .cmp-rate, .cmp.on .cmp-val.neg { color: inherit; opacity: 0.85; }

.facts { margin: 24px 16px 0; border-top: 1px solid var(--line); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; }
.fcell { padding: 10px 0; min-width: 0; border-bottom: 1px solid var(--line); }
.fcell:nth-child(odd) { padding-right: 12px; }
.fcell dt { font-size: 12.5px; color: var(--ink-2); }
.fcell dd { margin-top: 1px; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.fflags { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0 0; }
.fflags .tag { font-size: 14px; }
.ai-verdict { font-size: 15px; max-width: 62ch; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin-top: 12px; font-size: 14.5px; }
.kv-row { display: contents; }
.kv dt { color: var(--ink-2); }
.kv dd { font-weight: 500; }
.ai-fake { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14.5px; font-weight: 500; }
.ai-fake.good .ico { color: var(--gain); }
.ai-fake.bad { color: var(--loss); }
.desc { white-space: pre-wrap; font-size: 15px; overflow-wrap: anywhere; max-width: 62ch; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

.action-bar {
  position: sticky; bottom: 0; z-index: 4; margin-top: auto;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: var(--lift);
}
.action-bar .btn { width: 100%; }
.bottom-space { height: 32px; }

/* просмотр фото */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; }
.v-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.v-track::-webkit-scrollbar { display: none; }
.v-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.v-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.v-close, .v-nav { position: absolute; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; }
.v-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.v-nav { top: 50%; margin-top: -22px; }
.v-nav.prev { left: 12px; } .v-nav.next { right: 12px; }
@media (pointer: coarse) { .v-nav { display: none; } }
.v-count { position: absolute; top: calc(22px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }

/* ── шторки ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade 0.18s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(16px + var(--safe-b));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--panel);
  box-shadow: var(--lift-sheet);
  animation: sheet-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet:focus { outline: none; }
.sheet-wrap.closing .sheet { animation: sheet-down 0.16s ease-in forwards; }
.sheet-wrap.closing .sheet-backdrop { animation: fade-out 0.16s ease-in forwards; }
.sheet-grab { width: 36px; height: 4px; margin: 0 auto 8px; border-radius: 2px; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sheet-title { font-size: 18px; font-weight: 600; }
.sheet-hint { color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.sheet-foot { display: flex; gap: 8px; margin-top: 16px; }
.sheet-foot .btn { flex: 1; }
.num-field { position: relative; display: block; }
.num-input {
  width: 100%; height: 60px; padding: 0 44px 0 16px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel-2);
  font-size: 30px; font-weight: 600; font-stretch: 85%;
}
.num-input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); outline: none; }
.num-unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--ink-2); }
.field-err { min-height: 20px; margin-top: 6px; font-size: 13.5px; color: var(--loss); }
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip::after { content: ""; position: absolute; inset: -3px -3px; }
.chip:active { background: var(--panel-2); }
.chip[aria-checked="true"], .chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 600; }
.msgs { display: flex; flex-direction: column; }
.msg { padding: 12px 0; border-top: 1px solid var(--line); }
.msg:first-child { border-top: 0; padding-top: 4px; }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.msg-title { font-weight: 600; font-size: 15px; }
.msg-text { white-space: pre-wrap; font-size: 15px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); user-select: text; -webkit-user-select: text; }
.menu { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 8px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 16px;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item > .ico:first-child { color: var(--ink-2); }
.menu-item.on { font-weight: 600; }
.menu-item.on > .ico { color: var(--ink); }
.mi-txt { flex: 1; }

/* тосты */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 70; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { max-width: 440px; padding: 10px 16px; border-radius: var(--r-key); background: #1a1d21; color: #f2f3f5; font-size: 14.5px; font-weight: 500; box-shadow: var(--lift-pop); animation: toast-in 0.18s ease-out; }
:root[data-theme="dark"] .toast { background: #e6e8eb; color: #1a1d21; }
.toast.error { background: #b3261e; color: #fff; }
.toast.out { animation: toast-out 0.25s ease-in forwards; }
.spinner { display: inline-block; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0.8; animation: spin 0.7s linear infinite; }

/* ── сделки ── */
.deals-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.deals-sum:empty { display: none; }
.deals-sum b { color: var(--ink); font-weight: 600; }

/* ── деньги ── */
.hero { padding: 8px 16px 8px; }
.hero-label { font-size: 14px; color: var(--ink-2); }
.hero-val { font-size: 48px; line-height: 1.1; font-weight: 600; font-stretch: 85%; letter-spacing: -0.01em; color: var(--gain); }
.hero-val.neg { color: var(--loss); }
.hero-sub { margin-top: 4px; font-size: 14px; color: var(--ink-2); max-width: 44ch; }
.money-ledger { padding-top: 16px; }
.lg-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.lg-row:last-child { border-bottom: 1px solid var(--line); }
.lg-k { flex: 1; font-size: 15px; }
.lg-note { font-size: 13px; color: var(--ink-2); }
.lg-v { font-size: 18px; font-weight: 600; font-stretch: 85%; }
.link-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.link-row:last-child { border-bottom: 1px solid var(--line); }
.link-row > .ico:first-child { color: var(--ink-2); }
.link-row > .ico:last-child { color: var(--ink-2); }
.lr-label { flex: 1; font-size: 15px; }
.lr-note { font-size: 13px; color: var(--ink-2); }
.lr-val { font-size: 18px; font-weight: 600; font-stretch: 85%; }
.link-row:active { background: var(--panel-2); }
.chart { position: relative; width: 100%; min-height: 200px; }
.bars { display: block; overflow: visible; }
.bars .axis { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.bars .bar.pos { fill: var(--chart-gain); }
.bars .bar.neg { fill: var(--chart-loss); }
.bars:hover .bar-g:not(.on) .bar, .bars:focus-within .bar-g:not(.on) .bar { opacity: 0.45; }
.bars .val { fill: var(--ink); font: 600 12.5px var(--font); font-stretch: 85%; font-variant-numeric: tabular-nums; }
.bars .mon { fill: var(--ink-2); font: 500 12.5px var(--font); }
.bars .bar-g.on .mon { fill: var(--ink); }
.bars .hit { fill: transparent; cursor: pointer; }
.bars .hit:focus { outline: none; }
.chart-tip {
  position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel);
  box-shadow: var(--lift-pop); font-size: 13px; white-space: nowrap; pointer-events: none;
}
.tip-v { font-weight: 600; font-stretch: 85%; font-size: 15px; }
.tip-v.pos { color: var(--gain); } .tip-v.neg { color: var(--loss); }
.table-view { margin-top: 8px; font-size: 14px; }
.table-view summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--link); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 500; padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.brands { list-style: none; margin: 0; padding: 0; }
.brand-row { padding: 10px 0; border-top: 1px solid var(--line); }
.br-top { display: flex; align-items: baseline; gap: 8px; }
.br-name { font-weight: 600; }
.br-deals { flex: 1; font-size: 13px; color: var(--ink-2); }
.br-profit { font-weight: 600; font-stretch: 85%; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--gain); }
.br-profit.neg { color: var(--loss); }
.br-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.br-bar span { display: block; height: 100%; border-radius: 2px; background: var(--chart-gain); }
.br-bar span.neg { background: var(--chart-loss); }
.file-btn { cursor: pointer; }
.stmt-out:not(:empty) { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.stmt-busy { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.stmt-summary { padding: 12px 14px; border-left: 3px solid var(--line-2); background: var(--panel-2); border-radius: 0 8px 8px 0; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.stmt-summary i { color: var(--ink-2); }

/* ── ещё ── */
.view-more .view-head { border-bottom: 0; }
.more-pane { padding-bottom: 8px; }
.account { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0; }
.acc-ava { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--ink-2); }
.acc-name { font-weight: 600; font-size: 16px; }
.acc-sub { font-size: 13.5px; color: var(--ink-2); }
.set-sec .sec-title { margin-bottom: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.set-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.set-label { font-size: 15px; font-weight: 500; }
.set-help { margin-top: 2px; font-size: 13px; color: var(--ink-2); max-width: 60ch; }
.set-item .chips { margin-top: 10px; }
.set-val { color: var(--ink-2); font-size: 14px; }
.set-empty { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.text-field { position: relative; margin-top: 10px; max-width: 320px; }
.text-field .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.switch { position: relative; flex: none; width: 51px; height: 31px; padding: 0; border: 0; border-radius: 16px; background: var(--line-2); transition: background 0.15s; }
.switch::after { content: ""; position: absolute; inset: -7px -2px; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s cubic-bezier(0.3, 0.7, 0.4, 1); }
.switch.on { background: var(--ink); }
.switch.on .knob { transform: translateX(20px); background: var(--panel); }
.ch-list { margin-top: 6px; max-width: 560px; }
.ch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.ch-row:last-child { border-bottom: 0; }
.ch-name { font-size: 15px; }
.words { gap: 6px; }
.word { display: inline-flex; align-items: center; gap: 2px; min-height: 34px; padding: 0 2px 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 14px; font-weight: 500; }
.word-x { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); }
.word-x:hover { color: var(--loss); }
.add-row { display: flex; gap: 8px; margin-top: 10px; max-width: 480px; }
.add-row .input { flex: 1; min-width: 0; }
.rates-text { white-space: pre-line; font-size: 14.5px; }
.rates .set-help { margin: 8px 0 12px; }
.rates-out:not(:empty) { margin-top: 12px; }
.rates-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.rates-msg .ico { color: var(--gain); margin-top: 2px; }
.market .search-wrap { margin-bottom: 4px; }
.tbl-wrap { overflow-x: auto; }
.tbl.mk td { vertical-align: middle; }
.th-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); font-weight: 600; }
.tbl .r .th-btn { justify-content: flex-end; }
.sort-ico:empty { display: none; }
.mk-brand { font-size: 12.5px; color: var(--ink-2); }
.mk-model { font-weight: 500; }
.mk-med { font-weight: 600; font-stretch: 85%; font-size: 16px; }
.mk-rng { color: var(--ink-2); white-space: nowrap; }
.mk-range { font-size: 12.5px; color: var(--ink-2); }
.show-xs { display: none; }
.empty-cell { text-align: center; color: var(--ink-2); padding: 20px !important; }
.gone { list-style: none; margin: 0; padding: 0; }
.gone-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.gone-main { flex: 1; min-width: 0; }
.gone-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gone-meta { font-size: 13px; color: var(--ink-2); }
.gone-price { font-weight: 600; font-stretch: 85%; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── вход ── */
#auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--panel); }
.auth-box { width: 100%; max-width: 380px; }
.auth-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 20px; border-radius: 50%; background: var(--panel-2); color: var(--ink); }
.auth-title { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.auth-text { color: var(--ink-2); font-size: 15px; margin-bottom: 8px; }
.auth-text b { color: var(--ink); font-weight: 600; }
.auth-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }

/* ── узкие экраны ── */
@media (max-width: 370px) {
  .thumb { width: 84px; }
  .row + .row::before { left: 112px; }
  .ro-val { font-size: 38px; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-row .kind { grid-column: span 2; }
  .toolbar .key-label { display: none; }
}
@media (max-width: 480px) {
  .hide-xs { display: none; }
  .show-xs { display: block; }
}

/* ── широкий экран: шасси слева, список и лот рядом ── */
@media (min-width: 1000px) {
  :root { --tabbar-h: 0px; }
  body { overflow: hidden; background: var(--page); }
  #app { display: grid; grid-template-columns: 216px minmax(400px, 440px) minmax(0, 1fr); height: 100dvh; }
  #tabbar { position: static; height: auto; flex-direction: column; gap: 2px; padding: 16px 12px; border: 0; background: var(--page); }
  #tabbar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 600; font-size: 17px; }
  .brand-mark { position: relative; width: 22px; height: 22px; border-radius: 6px; background: var(--fp); }
  .brand-mark::after { content: ""; position: absolute; left: 12px; top: 4px; width: 5px; height: 14px; border-radius: 2px; background: var(--amber); }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-key); font-size: 15px; color: var(--ink-2); }
  .tab:hover { color: var(--ink); }
  .tab[aria-current="page"] { background: var(--panel); color: var(--ink); }
  .tab-led { top: 12px; bottom: 12px; left: 0; width: 3px; height: auto; border-radius: 0 2px 2px 0; }
  .tab-badge { position: static; margin-left: auto; }
  #pane-main { max-width: none; margin: 0; height: 100dvh; overflow-y: auto; padding-bottom: 32px; background: var(--panel); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  #pane-detail { position: static; display: block; height: 100dvh; inset: auto; z-index: auto; overflow-y: auto; animation: none !important; background: var(--panel); }
  .detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; padding: 32px; text-align: center; color: var(--ink-2); }
  .de-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2); margin-bottom: 8px; }
  .de-title { font-size: 17px; font-weight: 600; color: var(--ink); }
  .de-text { max-width: 32ch; font-size: 14.5px; }
  .lot-view { padding: 24px 24px 0; }
  .gallery { border-radius: 12px; overflow: hidden; max-height: 440px; }
  .fab { top: 36px; left: 36px; }
  .lot-head, .lot-actions, .ledger, .sec { padding-left: 0; padding-right: 0; }
  .fp, .facts, .notice { margin-left: 0; margin-right: 0; }
  .lot-actions { grid-template-columns: repeat(3, minmax(0, 180px)); }
  .action-bar { margin: 0 -24px; padding: 12px 24px; }
  body.wide #app { grid-template-columns: 216px minmax(0, 1fr); }
  body.wide #pane-main { border-right: 0; }
  body.wide #pane-detail { display: none; }
  body.wide .view { max-width: 760px; margin: 0 auto; }
  body.wide .view .sec, body.wide .view .hero, body.wide .view .page-head, body.wide .view .account { padding-left: 0; padding-right: 0; }
  .view-more .view-head { padding-left: 0; padding-right: 0; }
  #toast-root { bottom: 24px; }
  .sheet {
    left: 50%; top: 50%; right: auto; bottom: auto; width: min(460px, calc(100vw - 48px));
    max-height: 80vh; border-radius: var(--r-sheet); padding: 16px 20px 20px;
    transform: translate(-50%, -50%); box-shadow: var(--lift-pop); animation: pop-in 0.16s ease-out;
  }
  .sheet-wrap.closing .sheet { animation: pop-out 0.14s ease-in forwards; }
  .sheet-grab { display: none; }
}

/* ── движение только в ответ на действие ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes push-in { from { transform: translateX(16px); opacity: 0.7; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes pop-out { to { opacity: 0; transform: translate(-50%, -48%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; } }
@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; }
}
