/* Склад — стили админки. Сначала телефон, потом широкие экраны. */

@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-weight: 1 1000;
  font-display: swap;
  src: url(fonts/sofia-sans-extra-condensed-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-weight: 1 1000;
  font-display: swap;
  src: url(fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #e9ecef;          /* оцинкованный стеллаж */
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --ink: #182027;          /* графит */
  --ink-2: #56616d;
  --ink-3: #7b8692;
  --line: #d3d8de;
  --kraft: #d6b88e;        /* крафтовая бирка */
  --kraft-ink: #2c2215;
  --action: #182027;
  --action-ink: #ffffff;
  --in: #1f7a4d;
  --in-bg: #e3f3ea;
  --out: #b42318;
  --out-bg: #fbe8e6;
  --low: #8f5200;
  --low-bg: #fdf0d5;
  --focus: #2f6fdb;
  --shadow: 0 8px 28px rgba(24, 32, 39, 0.18);

  --ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --narrow: "Sofia Sans Extra Condensed", "Golos Text", "Arial Narrow", system-ui, sans-serif;
  --r: 10px;
  --gutter: 16px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121518;
    --surface: #1b1f24;
    --surface-2: #23282e;
    --ink: #e8ecef;
    --ink-2: #a3adb8;
    --ink-3: #7d8792;
    --line: #2f353c;
    --kraft: #bf9d6f;
    --kraft-ink: #1c150c;
    --action: #e8ecef;
    --action-ink: #121518;
    --in: #4cc38a;
    --in-bg: #12301f;
    --out: #ff8a7e;
    --out-bg: #3a1714;
    --low: #f0b54a;
    --low-bg: #3a2c10;
    --focus: #7aa7ff;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--ui);
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar) + var(--safe-b) + 24px);
  -webkit-tap-highlight-color: transparent;
}
body.bare { padding-bottom: 0; }

a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- каркас ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
}
.top-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 8px var(--gutter) 4px;
  max-width: 960px; margin: 0 auto;
}
.top h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.015em; flex: 1; min-width: 0; }
.top h1 small { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-left: -10px; border-radius: 50%;
  color: var(--ink); text-decoration: none;
}
.back svg { width: 26px; height: 26px; }
.top-action { flex: none; }

main { max-width: 960px; margin: 0 auto; padding: 4px var(--gutter) 0; }
main.narrow { max-width: 640px; }

/* нижнее меню */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tabbar) + var(--safe-b));
  padding: 0 4px var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); text-decoration: none; font-size: 12px; font-weight: 550;
  max-width: 120px;
}
.tab svg { width: 24px; height: 24px; }
.tab .ico {
  display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px;
  transition: background-color .15s;
}
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .ico { background: var(--kraft); color: var(--kraft-ink); }
.tab-add .ico {
  width: 52px; height: 52px; border-radius: 50%; margin-top: -22px;
  background: var(--action); color: var(--action-ink); box-shadow: var(--shadow);
}
.tab-add[aria-current="page"] .ico { background: var(--action); color: var(--action-ink); }
.tab-add svg { width: 28px; height: 28px; }

/* ---------- текст ---------- */

.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 18px; font-weight: 700; margin: 28px 0 10px;
}
.section-title .count { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.lead { font-size: 15px; color: var(--ink-2); max-width: 60ch; }

/* ---------- бирка с артикулом ---------- */

.tag {
  --hole: var(--surface);
  position: relative; display: inline-block; max-width: 100%;
  padding: 1px 12px 2px 20px;
  background: var(--kraft); color: var(--kraft-ink);
  font: 650 19px/1.25 var(--narrow); letter-spacing: 0.01em;
  border-radius: 3px 7px 7px 3px;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  overflow-wrap: anywhere;
}
.tag::before {
  content: ""; position: absolute; left: 7px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--hole);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.25);
}
.tag-lg {
  font-size: 34px; font-weight: 700; line-height: 1.15;
  padding: 2px 18px 4px 32px; border-radius: 4px 10px 10px 4px;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
}
.tag-lg::before { left: 11px; width: 10px; height: 10px; margin-top: -5px; }
.on-bg .tag, .tag.on-bg { --hole: var(--bg); }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--action); color: var(--action-ink);
  font: 600 16px/1.2 var(--ui); text-decoration: none; text-align: center;
  cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-block { display: flex; width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet { background: var(--surface-2); color: var(--ink); }
.btn-in { background: var(--in); color: #fff; }
.btn-out { background: var(--out); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-in, .btn-out { color: #10140f; }
}
.btn-danger { background: transparent; color: var(--out); border-color: color-mix(in srgb, var(--out) 40%, transparent); }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; }
.link-btn {
  border: 0; background: none; padding: 0; color: inherit; font: inherit;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions > .btn { flex: 1 1 160px; }
@media (max-width: 480px) { .actions > .btn { flex-basis: 100%; } }

/* ---------- формы ---------- */

.field { display: block; margin: 0 0 18px; }
.field-label {
  display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.field-label .muted { font-weight: 400; color: var(--ink-3); }
.mt { margin-top: 8px; }
.mt-lg { margin-top: 20px; }
.inline { display: inline; }
.form-note { margin: -8px 0 18px; font-size: 14px; color: var(--ink-2); }
.input, .select, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: 400 16px/1.3 var(--ui);
  appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus { border-color: var(--ink); outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; }
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237b8692' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-code { font: 650 22px/1.2 var(--narrow); letter-spacing: 0.01em; }
.with-unit { position: relative; }
.with-unit .input { padding-right: 56px; }
.with-unit .unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.field .hint { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.field.has-error .input, .field.has-error .select { border-color: var(--out); }
.error-text { display: block; margin-top: 6px; font-size: 14px; color: var(--out); font-weight: 550; }
.notice {
  margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r);
  background: var(--low-bg); color: var(--low); font-size: 15px;
}
.notice a { font-weight: 650; }
.notice-error { background: var(--out-bg); color: var(--out); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px var(--gutter); margin-bottom: 14px;
}
.panel > h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

/* ---------- поиск и фильтры ---------- */

.toolbar { max-width: 960px; margin: 0 auto; padding: 4px var(--gutter) 10px; }
.search { position: relative; }
.search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--ink-3); pointer-events: none;
}
.search .input { padding-left: 42px; border-color: transparent; background: var(--surface); }
.search .input::-webkit-search-cancel-button { -webkit-appearance: none; }
.filters { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 10px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 12px; border-radius: 18px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.chip b { font-weight: 500; color: var(--ink-3); }
.chip[aria-current="true"] { background: var(--action); color: var(--action-ink); }
.chip[aria-current="true"] b { color: inherit; opacity: .7; }
.chip-warn b { color: var(--low); }
.filters .select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; border-color: transparent; }

/* ---------- список товаров ---------- */

.group { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 8px; }
.group h2 { font-size: 16px; font-weight: 700; }
.group span { font-size: 14px; color: var(--ink-2); }
.group:first-child { margin-top: 6px; }

.rows { background: var(--surface); border-radius: 14px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; min-height: 76px;
  color: inherit; text-decoration: none;
}
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.thumb {
  flex: none; width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb svg { width: 26px; height: 26px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.row-sub { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.row-price { font-size: 14px; font-weight: 600; }
.row-price.none { color: var(--low); font-weight: 500; }

.qty { flex: none; display: grid; justify-items: end; text-align: right; min-width: 56px; }
.qty b { font: 700 30px/1 var(--narrow); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.qty small { font-size: 12px; color: var(--ink-3); font-weight: 550; margin-top: 2px; }
.qty.low b, .qty.low small { color: var(--low); }
.qty.out b, .qty.out small { color: var(--out); }

.empty {
  background: var(--surface); border-radius: 14px; padding: 28px 20px; text-align: center;
}
.empty p { color: var(--ink-2); max-width: 36ch; margin: 0 auto 18px; }
.empty h2 { font-size: 18px; margin-bottom: 6px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------- склад: компактные строки ---------- */

.srow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 12px; min-height: 60px;
}
.srow + .srow { border-top: 1px solid var(--line); }
.srow .row-main { gap: 2px; color: inherit; text-decoration: none; }
a.tag { text-decoration: none; }
.srow .tag { font-size: 18px; }
.srow .qty { min-width: 52px; }
.srow .qty b { font-size: 27px; }
.srow-btns { flex: none; display: flex; gap: 4px; }
.step {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font: 600 26px/1 var(--ui);
  background: var(--surface-2); color: var(--ink);
}
.step svg { width: 22px; height: 22px; }
.step-in { color: var(--in); background: var(--in-bg); }
.step-out { color: var(--out); background: var(--out-bg); }
.flash-row { animation: rowflash 1.2s ease-out; }
@keyframes rowflash { from { background: var(--low-bg); } to { background: transparent; } }

/* ---------- карточка товара ---------- */

.gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: none; width: min(100%, 520px); height: auto; aspect-ratio: 1; object-fit: contain;
  background: #fff; border-radius: 14px; scroll-snap-align: center;
}
.gallery.single img { width: 100%; max-width: 520px; }
.no-photo {
  display: grid; place-items: center; gap: 8px; aspect-ratio: 16 / 9; max-height: 220px; width: 100%;
  border: 2px dashed var(--line); border-radius: 14px; color: var(--ink-3); margin-bottom: 16px;
  text-align: center; padding: 16px;
}
.no-photo svg { width: 34px; height: 34px; }

.facts { display: grid; gap: 4px; margin: 12px 0 0; }
.facts .name { font-size: 18px; font-weight: 600; }
.price-big { font-size: 22px; font-weight: 700; margin-top: 6px; }
.price-big.none { color: var(--low); font-size: 17px; font-weight: 600; }

.stockbox { margin-top: 18px; }
.stock-figure { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stock-figure b { font: 800 68px/0.95 var(--narrow); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stock-figure .unit { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.stock-figure .limit { margin-left: auto; font-size: 14px; color: var(--ink-2); text-align: right; }
.stock-figure.low b { color: var(--low); }
.stock-figure.out b { color: var(--out); }

/* переключатель приход / уход / точно */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; margin: 16px 0 14px; border-radius: 12px; background: var(--surface-2);
}
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: 42px; border-radius: 9px;
  font-weight: 650; font-size: 15px; color: var(--ink-2);
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg input[value="in"]:checked + span { color: var(--in); }
.seg input[value="out"]:checked + span { color: var(--out); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.qty-input { font: 700 34px/1 var(--narrow); text-align: center; min-height: 60px; letter-spacing: 0.02em; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; }
.history li + li { border-top: 1px solid var(--line); }
.history .delta { flex: none; min-width: 52px; font: 700 22px/1 var(--narrow); font-variant-numeric: tabular-nums; }
.history .body { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); }
.history .body strong { color: var(--ink); font-weight: 600; }
.history .after { flex: none; font-size: 14px; color: var(--ink-2); }
.delta.plus { color: var(--in); }
.delta.minus { color: var(--out); }

.photo-list { display: grid; gap: 10px; }
.photo-item { display: flex; align-items: center; gap: 12px; }
.photo-item img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.photo-item .grow { flex: 1; font-size: 14px; color: var(--ink-2); }
.photo-item form { display: inline; }

/* выбор фото в форме */
.picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
}
.picker-add {
  position: relative; display: grid; place-items: center; gap: 4px; aspect-ratio: 1;
  border: 2px dashed var(--line); border-radius: 12px; color: var(--ink-2);
  font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; background: var(--surface);
}
.picker-add svg { width: 28px; height: 28px; }
.picker-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.picker-add:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.picker img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 12px; background: #fff; }

/* ---------- нижняя шторка ---------- */

dialog.sheet {
  width: 100%; max-width: 100%; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 18px 18px 0 0;
  background: var(--surface); color: var(--ink);
  max-height: 92dvh; overflow: auto;
}
dialog.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
dialog.sheet::backdrop { background: rgba(10, 14, 18, 0.45); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-body { padding: 18px var(--gutter) calc(18px + var(--safe-b)); }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; }
.sheet-head .grow { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.sheet-close { margin: -6px -8px 0 0; }

/* ---------- сообщение после действия ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); z-index: 60;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  padding: 12px 16px; border-radius: 12px;
  background: var(--action); color: var(--action-ink);
  font-size: 15px; font-weight: 550; box-shadow: var(--shadow);
}
.toast.error { background: var(--out); color: #fff; }
.toast.show { animation: toast-in .2s ease-out; }
.toast.hide { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- журнал ---------- */

.feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 14px; overflow: hidden; }
.feed li { padding: 12px 14px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .line1 { display: flex; align-items: center; gap: 10px; }
.feed .line1 .tag { font-size: 17px; }
.feed .line1 .delta { margin-left: auto; font: 700 24px/1 var(--narrow); font-variant-numeric: tabular-nums; }
.feed .line2 { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.feed .line2 strong { color: var(--ink); font-weight: 600; }
.feed .comment { margin-top: 4px; font-size: 14px; }
.feed .summary { font-size: 15px; }
.kind { font-weight: 650; }
.kind-in { color: var(--in); }
.kind-out { color: var(--out); }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.tabs a {
  flex: 1; display: grid; place-items: center; min-height: 40px; border-radius: 9px;
  text-decoration: none; font-weight: 650; font-size: 15px; color: var(--ink-2);
}
.tabs a[aria-current="page"] { background: var(--action); color: var(--action-ink); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filter-grid .select, .filter-grid .input { min-height: 44px; font-size: 15px; }

/* ---------- меню «Ещё», списки ---------- */

.menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 14px; overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu a, .menu button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 10px 16px;
  color: var(--ink); text-decoration: none; font: 550 16px/1.3 var(--ui);
  background: none; border: 0; text-align: left; cursor: pointer;
}
.menu svg { width: 22px; height: 22px; color: var(--ink-2); flex: none; }
.menu .sub { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.menu .danger { color: var(--out); }
.menu .danger svg { color: var(--out); }

.people { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 14px; overflow: hidden; }
.people li + li { border-top: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.person .avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 700; color: var(--ink-2);
}
.person .grow { flex: 1; min-width: 0; }
.person .who { font-weight: 650; }
.person .meta { font-size: 13px; color: var(--ink-2); }
.person.off { opacity: .55; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--ink-2);
}
.badge-owner { background: var(--kraft); color: var(--kraft-ink); }

.cat-item { padding: 12px 14px; }
.cat-item + .cat-item { border-top: 1px solid var(--line); }
.cat-head { display: flex; align-items: center; gap: 8px; }
.cat-head .grow { flex: 1; min-width: 0; }
.cat-head .name { font-weight: 650; }
.cat-head .meta { font-size: 13px; color: var(--ink-2); }
details.cat-edit summary { list-style: none; cursor: pointer; }
details.cat-edit summary::-webkit-details-marker { display: none; }
details.cat-edit[open] .cat-form { margin-top: 12px; }

.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 650; color: var(--ink-2); background: var(--surface-2); }

/* ---------- вход ---------- */

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login { width: 100%; max-width: 380px; }
.login .brand { margin-bottom: 28px; }
.login .brand .tag { font-size: 44px; padding: 2px 22px 6px 38px; --hole: var(--bg); }
.login .brand .tag::before { left: 13px; width: 12px; height: 12px; margin-top: -6px; }
.login .brand p { margin-top: 10px; color: var(--ink-2); }

/* ---------- широкие экраны ---------- */

@media (min-width: 900px) {
  body { padding-bottom: 40px; }
  .tabbar {
    position: sticky; top: 0; bottom: auto; height: 56px; padding: 0 calc(50% - 480px);
    border-top: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; gap: 4px;
  }
  .tab { flex: none; flex-direction: row; max-width: none; padding: 0 14px; gap: 8px; font-size: 15px; }
  .tab .ico { width: auto; height: auto; background: none !important; }
  .tab[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--kraft); }
  .tab-add { order: 10; margin-left: auto; }
  .tab-add .ico { width: 36px; height: 36px; margin: 0; box-shadow: none; background: var(--action) !important; }
  .top { top: 56px; }
  .toast { bottom: 24px; }
  dialog.sheet { margin: auto; max-width: 440px; border-radius: 18px; }
  .rows .row:hover, .srow:hover { background: var(--surface-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
