/* ARMA Учёт.
   Язык интерфейса взят из логотипа и из самого материала: чёрное и серебро, косая черта между A и M,
   натянутая сатиновая плёнка (мягкий блик на фоне), тонкая янтарная «линия света» для активного.
   Шрифты лежат рядом (fonts/) — программа работает без интернета. */

@font-face { font-family: "Montserrat"; font-weight: 100 900; font-display: swap; src: url("fonts/montserrat-cyrillic-wght-normal.woff2") format("woff2-variations"), url("fonts/montserrat-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: "Montserrat"; font-weight: 100 900; font-display: swap; src: url("fonts/montserrat-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/montserrat-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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations"), url("fonts/inter-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: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/inter-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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Позиция косой черты в блоке «Деньги»: плавно переезжает на своё место. */
@property --x { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

:root {
  --ink: #17191c;
  --graphite: #202328;
  --graphite-2: #2c3036;
  --bg: #e6e7e9;
  --panel: #fbfbfa;
  --panel-2: #f3f3f2;
  --line: #d2d4d8;
  --line-soft: #e5e6e9;
  --text: #17191c;
  --muted: #646a72;

  /* Чёрный — основной цвет действий, как в логотипе. */
  --accent: #17191c;
  --accent-soft: #ecedef;
  --link: #2c5b8d;
  --light: #f0a92b;          /* линия света: активное и фокус */
  --light-deep: #b57508;
  --light-soft: #fcf1d9;
  --focus: #2c5b8d;

  --transfer: #35618f;       /* перевод на карту */
  --cash: #c08a1e;           /* наличные */
  --spend: #b5472f;          /* расходы */
  --danger: #b3261e;
  --danger-soft: #fceceb;
  --ok: #2b7a4f;
  --ok-soft: #e7f3ec;
  --warn-bg: #fdf0d2;
  --warn-text: #7a4e00;
  --series-1: var(--transfer);
  --series-2: var(--cash);

  --radius: 4px;
  --display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.45 var(--sans);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  /* Сатиновый блик, как на натянутой плёнке и на фоне логотипа. */
  background: #e6e7e9 linear-gradient(118deg, #cdcfd2 0%, #e4e5e7 24%, #f0f0f1 46%, #e3e4e6 72%, #d7d9dc 100%) fixed;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.012em; }
h1 { font-size: 24px; font-weight: 650; margin: 0; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 650; margin: 0; }
h3 { font-size: 14px; font-weight: 650; margin: 22px 0 9px; }
p { margin: 6px 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: Consolas, monospace; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.warn-text { color: var(--warn-text); }
.grow { flex: 1 1 200px; min-width: 160px; }
.pad { padding: 12px; }
.w-80 { width: 80px; }
.w-100 { width: 100px; }
.w-260 { width: 260px; }

/* ---------- Значки ---------- */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }

/* ---------- Каркас ---------- */
.layout { display: flex; height: 100vh; }
.side {
  width: 232px;
  flex: none;
  background: var(--ink);
  color: #e9eaec;
  display: flex;
  flex-direction: column;
  padding: 22px 0 14px;
  position: relative;
  overflow-y: auto;
}
/* Знак магазина в шапке: белая версия логотипа. */
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 20px 18px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 104px; height: auto; display: block; filter: invert(1); }
.brand-mark { display: none; width: 44px; height: auto; filter: invert(1); }
.brand-name { display: none; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px; }
.nav a, .side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  color: #b4b8be;
  border-radius: 3px;
  position: relative;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover, .side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
/* Активный пункт: янтарный свет слева мягко затухает вправо, тонкая линия у левого края. */
.nav a.active, .side-link.active {
  background: linear-gradient(90deg, rgba(240, 169, 43, 0.30) 0%, rgba(240, 169, 43, 0.10) 45%, rgba(240, 169, 43, 0) 100%);
  color: #fff; font-weight: 600;
}
.nav a.active::before, .side-link.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 1px;
  background: var(--light); box-shadow: 0 0 10px 0 rgba(240, 169, 43, 0.5);
}
.nav a.active .icon, .side-link.active .icon { color: var(--light); }
.side-bottom { margin-top: auto; padding: 12px 10px 0; display: flex; flex-direction: column; gap: 2px; }
.side-bottom .side-link { margin-bottom: 6px; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #e9eaec, #a9adb3); color: var(--ink);
  font: 700 13px/1 var(--display);
}
.who-name { font-weight: 600; color: #fff; line-height: 1.2; }
.who-role { color: #9a9fa6; font-size: 12px; }
.side-bottom .btn.link { color: #aeb2b9; margin-left: 12px; justify-content: flex-start; height: 26px; }
.side-bottom .btn.link:hover { color: #fff; text-decoration: none; }
.side .menu-btn { display: none; }

.content { flex: 1; overflow: auto; padding: 26px 32px 56px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 38px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Экран открывается одним коротким появлением: без каскада, чтобы не мешать работе. */
.content > * { animation: page-in 0.28s ease-out both; }
@keyframes page-in { from { opacity: 0; } }

/* ---------- Кнопки и поля ---------- */
.btn {
  font: 500 14px/1 var(--sans);
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: #9ea3ab; background: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .clickable:focus-visible, .chip:focus-visible, .stat.link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #000; box-shadow: inset 0 -2px 0 var(--light); }
.btn.danger { color: var(--danger); border-color: #e0b6b2; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.warn { background: var(--warn-bg); border-color: var(--light); color: var(--warn-text); font-weight: 600; }
.btn.link { border: none; background: none; color: var(--link); padding: 0 4px; height: auto; font-weight: 500; }
.btn.link:hover { text-decoration: underline; text-underline-offset: 3px; background: none; }
.btn.link.danger { color: var(--danger); }
.btn.small { height: 28px; padding: 0 11px; font-size: 13px; }
.btn.big { height: auto; padding: 14px 16px; font-size: 16px; font-weight: 600; display: flex; flex-direction: column; align-items: center; width: 100%; font-family: var(--display); }
.btn-sub { font-size: 12px; font-weight: 400; opacity: 0.75; font-family: var(--sans); }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 34px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #aeb2b9; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(240, 169, 43, 0.28); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
textarea { height: auto; padding: 7px 10px; resize: vertical; width: 100%; }
input.num, .tbl input.num { text-align: left; font-variant-numeric: tabular-nums; }
input[type="checkbox"] { height: auto; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
input[type="date"] { padding: 0 8px; }

.form { display: flex; flex-direction: column; gap: 11px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select { width: 100%; }
.hint { font-size: 12px; color: var(--muted); }
.row-fields { display: flex; gap: 10px; }
.row-fields .field { flex: 1; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }

/* ---------- Панели, фильтры, вкладки ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04); }
.panel.flush { padding: 0; overflow: auto; }
.panel.narrow { max-width: 720px; }
.panel h3:first-child { margin-top: 0; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* Вкладки: янтарная линия под активной. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { font: 500 14px var(--sans); background: none; border: none; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--ink); border-bottom-color: var(--light); font-weight: 650; }
.filters .tabs { border-bottom: none; margin-bottom: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; gap: 0; background: #fff; }
.filters .tab { margin: 0; border-bottom: none; padding: 7px 13px; border-right: 1px solid var(--line); }
.filters .tab:last-child { border-right: none; }
.filters .tab:hover { background: var(--panel-2); }
.filters .tab.active { background: var(--ink); color: #fff; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.two-col > * { min-width: 0; }
/* Широкая таблица внутри панели не вылезает за неё: заголовки переносятся, остальное листается. */
.tbl-scroll { overflow-x: auto; }
.tbl-scroll .tbl th { white-space: normal; vertical-align: bottom; }
.tbl-scroll .tbl th, .tbl-scroll .tbl td { padding-left: 8px; padding-right: 8px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; }
.block-head h3 { margin-bottom: 9px; }
.scroll-box { max-height: 260px; overflow: auto; border: 1px solid var(--line-soft); }

.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; border: 1px solid var(--line); border-left: 3px solid var(--ink); }
.notice.ok { background: var(--ok-soft); border-color: #bcdcc9; border-left-color: var(--ok); }
.notice.warn { background: var(--warn-bg); border-color: #efd9a0; border-left-color: var(--light); color: var(--warn-text); }
.notice.error { background: var(--danger-soft); border-color: #efc4bf; border-left-color: var(--danger); color: var(--danger); }
.notice.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Карточки «Доступа» (входы, устройства): сведения слева, кнопки справа; на телефоне кнопки под сведениями. */
.card-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.card-item {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04);
}
.card-info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tag { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 3px; background: var(--line-soft); color: var(--muted); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
td > .tag:first-child { margin-left: 0; }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Показатели ---------- */
/* У карточки срезан правый верхний угол — та же косая черта, что в логотипе. */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  background: var(--panel); padding: 12px 18px 12px 16px; min-width: 190px; flex: 1 1 190px;
  border-left: 3px solid var(--ink);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  position: relative;
  transition: background 0.15s;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font: 650 25px/1.2 var(--display); letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.stat.neg { border-left-color: var(--danger); }
.stat.neg .stat-value { color: var(--danger); }
.stat.pos { border-left-color: var(--ok); }
.stat.pos .stat-value { color: var(--ok); }
.stat.warn { border-left-color: var(--light); }
.stat.warn .stat-value { color: var(--warn-text); }
.stat.link { cursor: pointer; }
.stat.link:hover { background: #fff; border-left-color: var(--light); }

/* ---------- Таблицы ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); }
.tbl th {
  text-align: left;
  font: 600 12px var(--sans);
  color: var(--muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f1f2f4; }
.tbl tr.dim td { color: var(--muted); }
.tbl tr.low td { background: var(--warn-bg); }
.tbl tr.low td.strong { color: var(--warn-text); }
/* Заголовки разделов (категории товаров): тёмная полоса, видно издалека. */
.tbl tr.group td { background: var(--graphite); font-weight: 700; font-size: 13px; color: #fff; padding-top: 9px; padding-bottom: 9px; border-bottom: none; font-family: var(--display); letter-spacing: 0.01em; }
.tbl tr.empty td { color: var(--muted); text-align: center; padding: 22px; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line); background: var(--panel-2); }
.tbl tr.short td { background: var(--danger-soft); }
.tbl tr.short td.num:nth-last-child(-n+2) { color: var(--danger); font-weight: 600; }
.tbl tr.surplus td { background: var(--ok-soft); }
.tbl tr.surplus td.num:nth-last-child(-n+2) { color: var(--ok); font-weight: 600; }
.tbl.profit td { padding: 10px 16px; }
.tbl.profit tr.sub td { font-weight: 600; background: var(--panel-2); }
.tbl.profit tr.total td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--ink); font-family: var(--display); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 4px; }

/* ---------- Вход ---------- */
/* Слева тёмная часть с большим знаком, справа форма. Знак появляется вдоль косой черты. */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 42%) minmax(0, 1fr); }
.login-art {
  background: var(--ink); color: #fff; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.login-art::before {
  content: ""; position: absolute; inset: -20% -30%;
  background: linear-gradient(116deg, transparent 38%, rgba(255, 255, 255, 0.05) 38.2%, rgba(255, 255, 255, 0.05) 52%, transparent 52.2%);
}
.login-logo { width: min(300px, 62%); height: auto; filter: invert(1); position: relative; animation: logo-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes logo-in {
  from { clip-path: polygon(0 0, 0 0, -30% 100%, -30% 100%); opacity: 0.2; }
  to { clip-path: polygon(0 0, 160% 0, 130% 100%, 0 100%); opacity: 1; }
}
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-box { width: 380px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; animation: page-in 0.6s 0.35s ease-out both; }
.login-brand { font: 650 28px/1.1 var(--display); letter-spacing: -0.02em; }
.login-sub { color: var(--muted); margin-top: -6px; margin-bottom: 10px; }
.login-box.wide { width: 440px; }
.login-box .form { display: flex; flex-direction: column; gap: 11px; }
.login-box .form .field { margin: 0; }
.login-box .form .btn.big { margin-top: 6px; }
.login-box .notice { margin: 4px 0 0; font-size: 13px; }
.login-or { text-align: center; color: var(--muted); font-size: 13px; }
.boot { padding: 60px; text-align: center; color: var(--muted); font-family: var(--display); }
.login-server { color: var(--muted); font-size: 13px; text-align: center; margin-top: 4px; word-break: break-all; }
.login-server .btn.link { font-size: 13px; padding: 0; }
/* Нет связи с сервером: окно поверх всего, введённое под ним сохраняется. */
dialog.offline { border: none; border-radius: 6px; width: 420px; max-width: calc(100vw - 32px); padding: 26px 24px; color: var(--text); background: var(--panel); box-shadow: 0 24px 60px rgba(23, 25, 28, 0.35); }
dialog.offline::backdrop { background: rgba(23, 25, 28, 0.96); }
dialog.offline h2 { margin: 0 0 8px; font: 650 20px/1.2 var(--display); }
dialog.offline p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Продажа ---------- */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; }
.search-wrap { position: relative; margin-bottom: 14px; }
.search-big { width: 100%; height: 50px; font-size: 17px; padding: 0 16px; border-color: #9ea3ab; background: #fff; }
.search-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-top: none;
  box-shadow: 0 10px 24px rgba(23, 25, 28, 0.16);
  max-height: 420px; overflow: auto;
}
.search-results.small { max-height: 260px; }
.sr-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name stock price" "meta stock price"; column-gap: 16px; padding: 8px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.search-results.small .sr-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name stock" "meta stock"; }
.sr-item.active, .sr-item:hover { background: var(--light-soft); }
.sr-item.out .sr-stock { color: var(--danger); }
.sr-name { grid-area: name; font-weight: 500; }
.sr-meta { grid-area: meta; font-size: 12px; color: var(--muted); }
.sr-stock { grid-area: stock; align-self: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sr-price { grid-area: price; align-self: center; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-empty { padding: 12px 14px; color: var(--muted); }
.cart-empty { padding: 30px 10px; text-align: center; }
.cart-table td { vertical-align: top; }
.cart-table input.qty { width: 84px; }
.cart-table input.price { width: 96px; }
.cart-table input.variant { width: 100%; max-width: 260px; height: 28px; font-size: 12px; margin-top: 4px; }
.cart-table td.num.strong { padding-top: 14px; }
.line-name { font-weight: 500; }
.line-warn { font-size: 11px; color: var(--danger); }
.line-note { font-size: 11px; color: var(--muted); }
.sale-side { position: sticky; top: 0; }
.sale-side h3 { margin: 4px 0 9px; }
.sale-side h3 + .seg { margin-top: 0; }
.cust-search { position: relative; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cust-search input { width: 100%; }
.cust-picked { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 9px 12px; }
.cust-name { font-weight: 600; }
.cust-picked .btn.link { padding: 0; margin-top: 4px; }
.sum-lines { margin: 16px 0 10px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.sum-row input { width: 120px; }
.sum-row.total { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; padding: 8px 0; font-variant-numeric: tabular-nums; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 9px; background: #fff; }
.seg-btn { flex: 1; font: 500 14px var(--sans); border: none; background: #fff; padding: 9px 4px; cursor: pointer; border-right: 1px solid var(--line); transition: background 0.15s, color 0.15s; color: var(--text); }
.seg-btn:hover { background: var(--panel-2); }
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: var(--ink); color: #fff; font-weight: 600; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.pay-row input { width: 150px; height: 38px; font-size: 16px; }
.post { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sale-side .notice { margin: 9px 0 0; }
.sale-side .field { margin-top: 12px; }
.search-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.search-row .search-wrap { flex: 1; margin-bottom: 0; }
.search-wrap + .cam-btn { height: 50px; }
.cart-table tr.flash td { animation: flash 0.9s ease-out; }
@keyframes flash { from { background: var(--light-soft); } }

/* ---------- Штрих-коды ---------- */
.code { font-family: Consolas, "Courier New", monospace; letter-spacing: 0.03em; }
.cam-video { display: block; width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius); object-fit: cover; }
.codes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.code-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); font-size: 13px; }
.code-chip .btn.link { padding: 0 6px; min-height: 0; height: auto; }
.code-add { display: flex; gap: 6px; flex-wrap: wrap; }
.code-add input:first-child { flex: 2 1 180px; }
.code-add input:nth-child(2) { flex: 1 1 120px; }

/* ---------- Прочее ---------- */
.picker { position: relative; margin-bottom: 8px; }
.picker input { width: 100%; }
.chosen { margin: 4px 0 10px; }
.week-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.path { padding: 7px 10px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--radius); word-break: break-all; }
.sheet { background: #fff; border: 1px solid var(--line); padding: 30px 36px; max-width: 860px; box-shadow: 0 2px 8px rgba(23, 25, 28, 0.08); }
.table-view { margin-top: 8px; }
.table-view summary { cursor: pointer; color: var(--link); font-size: 13px; }
.table-view .tbl { max-width: 360px; margin-top: 6px; }

/* ---------- Графики ---------- */
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-svg .axis { stroke: var(--line); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 13px; font-family: var(--sans); }
.chart-svg .bar { fill: var(--transfer); }
.chart-svg .c-transfer { fill: var(--transfer); }
.chart-svg .c-cash { fill: var(--cash); }
.chart-svg .c-spend { fill: var(--spend); }
.chart-svg .hit { fill: transparent; }
.chart-svg .hit:hover { fill: rgba(23, 25, 28, 0.05); }
/* Столбцы вырастают от оси друг за другом. */
.chart-svg .rise { transform-box: fill-box; transform-origin: 50% 100%; animation: rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { transform: scaleY(0); } }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 5;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.5; padding: 6px 10px; border-radius: 3px; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(23, 25, 28, 0.25);
}
.chart-tip b { font-weight: 650; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.split-bar { display: flex; gap: 2px; height: 26px; border-radius: 3px; overflow: hidden; background: var(--line-soft); margin-bottom: 12px; }
.split-seg { min-width: 2px; transform-origin: left; animation: grow-x 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.split-empty { color: var(--muted); font-size: 12px; padding: 5px 9px; }
.split-seg.s1, .swatch.s1 { background: var(--transfer); }
.split-seg.s2, .swatch.s2 { background: var(--cash); }
.swatch.s3 { background: var(--spend); }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Кольцо расходов по статьям: дуги прорисовываются по кругу. */
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { width: 176px; height: 176px; flex: none; }
.ring-seg { fill: none; stroke-width: 20; animation: ring-in 1s cubic-bezier(0.3, 0.7, 0.2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes ring-in { from { stroke-dasharray: 0 var(--c); } }
.ring-total { font: 650 15px var(--display); fill: var(--text); text-anchor: middle; letter-spacing: -0.02em; }
.ring-cap { font: 500 11px var(--sans); fill: var(--muted); text-anchor: middle; }
.ring-legend { flex: 1 1 200px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ring-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 36px auto; gap: 9px; align-items: center; }
.ring-row .pct { color: var(--muted); font-size: 12px; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.ring-row .sum { font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-fuel { --cat: #b5472f; }
.cat-tools { --cat: #3b4047; }
.cat-shop { --cat: #2c7a7b; }
.cat-transport { --cat: #d28a55; }
.cat-other { --cat: #a4a9b0; }
.ring-seg { stroke: var(--cat); }
.ring-row .swatch { background: var(--cat); }

/* ---------- Деньги ---------- */
.money { display: block; }
/* Блок «карта / наличные»: черта под углом логотипа делит ширину по реальным долям. */
.slash {
  --x: 50%; --lean: 56px;
  position: relative; height: 176px; margin-bottom: 16px; isolation: isolate;
  transition: --x 1.3s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s;
}
.slash-side { position: absolute; inset: 0; padding: 22px 30px; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; }
.slash-side::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(112deg, rgba(255, 255, 255, 0.2), transparent 38%, rgba(255, 255, 255, 0.06) 78%); }
.slash-card { background: linear-gradient(135deg, #2a4c75, var(--transfer)); color: #fff; clip-path: polygon(0 0, calc(var(--x) + var(--lean) / 2 - 3px) 0, calc(var(--x) - var(--lean) / 2 - 3px) 100%, 0 100%); border-radius: 5px 0 0 5px; }
.slash-cash { background: linear-gradient(135deg, #d5a03a, var(--cash)); color: #17191c; clip-path: polygon(calc(var(--x) + var(--lean) / 2 + 3px) 0, 100% 0, 100% 100%, calc(var(--x) - var(--lean) / 2 + 3px) 100%); border-radius: 0 5px 5px 0; align-items: flex-end; text-align: right; }
.slash-label { font: 500 13px var(--sans); opacity: 0.92; }
.slash-sum { font: 650 clamp(24px, 3.4vw, 38px)/1.1 var(--display); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.slash-pct { font: 500 12px var(--sans); opacity: 0.85; }
.slash.empty .slash-card, .slash.empty .slash-cash { background: var(--line); color: var(--muted); }

.money-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.money-stats .stat { min-width: 0; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 2px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); font-weight: 500; }

.money-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.chart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-title h3 { margin: 0; }
.chart + .chart-title { margin-top: 22px; }

/* Итоговый отчёт: ведомость с жирной чертой перед итогом. */
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { font: 600 12px var(--sans); color: var(--muted); text-align: right; padding: 8px 0 8px 12px; border-bottom: 1px solid var(--line); }
.ledger th:first-child { text-align: left; padding-left: 0; }
.ledger td { padding: 9px 0 9px 12px; border-bottom: 1px dashed var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.ledger td:first-child { text-align: left; padding-left: 0; }
.ledger tr.head td { font: 650 13px var(--display); border-bottom: 1px solid var(--ink); padding-top: 18px; padding-left: 0; color: var(--text); }
.ledger tr.sum td { font-weight: 650; border-bottom: 1px solid var(--ink); }
.ledger tr.final td { font: 700 17px var(--display); letter-spacing: -0.015em; border-bottom: none; padding-top: 14px; }
.ledger tr.final td .neg { color: var(--danger); }
.ledger .note { display: block; font: 400 12px var(--sans); color: var(--muted); letter-spacing: 0; }

/* Форма нового расхода. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 13px var(--sans); height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; color: var(--text); transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { border-color: #9ea3ab; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.expense-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.expense-form .wide { grid-column: 1 / -1; }
.expense-form .seg { margin: 0; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); margin-right: 8px; }

/* ---------- Окна и уведомления ---------- */
dialog.modal { border: none; border-radius: 6px; padding: 0; width: 480px; max-width: calc(100vw - 40px); color: var(--text); background: var(--panel); box-shadow: 0 24px 60px rgba(23, 25, 28, 0.35); animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.modal.wide { width: 820px; }
dialog.modal::backdrop { background: rgba(23, 25, 28, 0.5); animation: page-in 0.2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 6px 6px 0 0; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; }
.modal-body > .modal-actions, dialog > .modal-actions { padding: 12px 18px 16px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); max-width: 420px; border-left: 3px solid var(--light); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast.error { background: var(--danger); border-left-color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
/* Новая версия программы: полоса справа внизу, уведомления встают над ней. */
.update-bar { position: fixed; right: 20px; bottom: 20px; z-index: 950; display: flex; align-items: center; gap: 12px; max-width: 520px; background: var(--ink); color: #fff; padding: 10px 8px 10px 16px; border-radius: var(--radius); border-left: 3px solid var(--light); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.update-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.update-sub { color: #aeb2b9; font-size: 12px; }
.update-bar .btn { flex: none; }
.update-bar .btn.link { color: #aeb2b9; padding: 0 8px; }
.update-bar .btn.link:hover { color: #fff; }
body.has-update #toasts { bottom: 96px; }

@media (max-width: 1250px) {
  .sale { grid-template-columns: minmax(0, 1fr) 330px; }
  .two-col, .money-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 760px) {
  .brand-logo { display: none; }
  .brand-mark { display: block; width: 54px; }
  .brand { padding-bottom: 12px; }
}

/* ---------- Телефон ---------- */
/* Одна колонка, меню в кнопке, крупные поля (16px — iPhone не увеличивает страницу при вводе), таблицы листаются вбок. */
@media (max-width: 760px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  .layout { display: block; height: auto; min-height: 100vh; }
  .side {
    position: sticky; top: 0; z-index: 50; width: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top), var(--safe-area-inset-top, 0px));
    max-height: 100vh; overflow-y: auto;
  }
  .brand { flex: 1; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0; }
  .brand-logo { display: none; }
  .brand-mark { display: block; width: 40px; }
  .brand-name { display: block; font: 650 15px var(--display); letter-spacing: 0.01em; color: #fff; }
  .side .menu-btn { display: inline-flex; background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
  .side .menu-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.5); }
  .nav, .side-bottom { display: none; width: 100%; }
  .side.open .nav { display: flex; margin-top: 10px; padding: 0; }
  .side.open .side-bottom { display: flex; margin-top: 8px; padding: 6px 0 8px; }
  .nav a, .side-link { padding: 12px; font-size: 16px; }
  .nav a.active::before, .side-link.active::before { left: 0; }
  .side-bottom .btn.link { margin-left: 10px; padding: 8px 4px; font-size: 15px; height: auto; }

  .content { overflow: visible; padding: 16px 14px calc(36px + max(env(safe-area-inset-bottom), var(--safe-area-inset-bottom, 0px))); }
  .page-head { flex-wrap: wrap; margin-bottom: 12px; }
  h1 { font-size: 21px; }
  .page-actions { justify-content: flex-start; }

  .btn { height: 42px; }
  .btn.small { height: 36px; padding: 0 11px; }
  input, select { height: 42px; font-size: 16px; }
  textarea { font-size: 16px; }
  input[type="checkbox"] { width: 20px; height: 20px; }
  .w-80, .w-100, .w-260, .grow { width: 100%; min-width: 0; flex: 1 1 100%; }
  .row-fields { flex-direction: column; }

  .panel { padding: 13px; }
  .panel.flush, .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { font-size: 14px; }
  .tbl th { position: static; }
  .tbl td, .tbl th { padding: 9px; }
  /* Список накладных: каждая строка — карточка, ничего не уезжает за экран. */
  .tbl.cards, .tbl.cards tbody, .tbl.cards tfoot { display: block; }
  .tbl.cards thead { display: none; }
  .tbl.cards tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px; align-items: center;
    grid-template-areas: "num date status" "cust cust cust" "sum paid debt" "by by by";
    padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  .tbl.cards tbody tr:active { background: #f1f2f4; }
  .tbl.cards td { padding: 0; border: none; min-width: 0; }
  .tbl.cards td:nth-child(1) { grid-area: num; font: 700 15px var(--display); text-align: left; }
  .tbl.cards td:nth-child(1)::before { content: "№ "; font-weight: 500; color: var(--muted); }
  .tbl.cards td:nth-child(2) { grid-area: date; color: var(--muted); font-size: 13px; }
  .tbl.cards td:nth-child(3) { grid-area: cust; font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
  .tbl.cards td:nth-child(4) { grid-area: sum; justify-self: start; }
  .tbl.cards td:nth-child(5) { grid-area: paid; justify-self: center; }
  .tbl.cards td:nth-child(6) { grid-area: debt; justify-self: end; }
  .tbl.cards td:nth-child(7) { grid-area: status; justify-self: end; }
  .tbl.cards td:nth-child(8) { grid-area: by; color: var(--muted); font-size: 12px; }
  .tbl.cards td:nth-child(8)::before { content: "Оформил: "; }
  .tbl.cards td:nth-child(4), .tbl.cards td:nth-child(5), .tbl.cards td:nth-child(6) { display: flex; flex-direction: column; gap: 1px; font-weight: 600; }
  .tbl.cards td:nth-child(4)::before, .tbl.cards td:nth-child(5)::before, .tbl.cards td:nth-child(6)::before {
    content: attr(data-label); font: 500 11px var(--sans); color: var(--muted);
  }
  .tbl.cards td:nth-child(6):empty { visibility: hidden; }
  .tbl.cards td:nth-child(6):empty::before { content: ""; }
  .tbl.cards tr.empty { display: block; padding: 0; }
  .tbl.cards tr.empty td { display: block; padding: 22px; text-align: center; }
  .tbl.cards tr.empty td::before { content: none; }
  .tbl.cards tfoot tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px;
    grid-template-areas: "count count count" "sum paid debt"; padding: 12px 14px; background: var(--panel-2); border-top: 1px solid var(--line);
  }
  .tbl.cards tfoot td { display: flex; flex-direction: column; gap: 1px; padding: 0; border: none; background: none; font-weight: 700; min-width: 0; }
  .tbl.cards tfoot td::before { content: attr(data-label); font: 500 11px var(--sans); color: var(--muted); }
  .tbl.cards tfoot td.foot-count { grid-area: count; font-weight: 600; }
  .tbl.cards tfoot td.foot-count::before { content: none; }
  .tbl.cards tfoot td:nth-child(2) { grid-area: sum; }
  .tbl.cards tfoot td:nth-child(3) { grid-area: paid; align-items: center; }
  .tbl.cards tfoot td:nth-child(4) { grid-area: debt; align-items: flex-end; }
  .tbl.cards tfoot td.foot-rest { display: none; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .filters > * { flex: 1 1 auto; }
  .filters .tabs { width: 100%; overflow-x: auto; }
  .filters .tab { flex: 1; padding: 9px 8px; white-space: nowrap; }
  .card-item { padding: 12px; }
  .card-info { flex-basis: 100%; }
  .card-actions { width: 100%; justify-content: stretch; }
  .card-actions .btn { flex: 1 1 auto; height: 44px; }

  .stats { gap: 8px; }
  .stat { min-width: 140px; flex: 1 1 140px; padding: 10px 14px 10px 13px; }
  .stat-value { font-size: 20px; }
  .two-col, .money-grid { grid-template-columns: minmax(0, 1fr); }

  .slash { height: 150px; --lean: 40px; }
  .slash-side { padding: 16px 16px; }
  .slash-sum { font-size: 21px; }
  .slash-label { font-size: 12px; }
  .money-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .expense-form { grid-template-columns: minmax(0, 1fr); }
  .ring-wrap { justify-content: center; }
  .ledger { font-size: 12px; }
  .ledger th, .ledger td { padding-left: 4px; }
  .ledger td:first-child { width: 30%; }
  .ledger tr.final td { font-size: 12px; }

  .sale { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sale-side { position: static; }
  .search-results { max-height: 50vh; }
  .sr-item { column-gap: 10px; padding: 11px 12px; }
  /* Корзина: каждая строка — карточка (название сверху, количество, цена и сумма под ним). */
  .cart-table, .cart-table tbody { display: block; }
  .cart-table thead { display: none; }
  .cart-table tr {
    display: grid; grid-template-columns: 22px 78px 30px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 6px; align-items: center;
    grid-template-areas: "n name name name rm" "n qty unit price sum";
    padding: 10px 8px; border-bottom: 1px solid var(--line-soft);
  }
  .cart-table td { padding: 0; border: none; }
  .cart-table td:nth-child(1) { grid-area: n; align-self: start; }
  .cart-table td:nth-child(2) { grid-area: name; }
  .cart-table td:nth-child(3) { grid-area: qty; }
  .cart-table td:nth-child(4) { grid-area: unit; }
  .cart-table td:nth-child(5) { grid-area: price; }
  .cart-table td:nth-child(6) { grid-area: sum; padding-top: 0; }
  .cart-table td:nth-child(7) { grid-area: rm; align-self: start; }
  .cart-table td.num.strong { padding-top: 0; }
  .cart-table input.qty, .cart-table input.price { width: 100%; }
  .cart-table input.variant { max-width: none; height: 36px; font-size: 15px; }
  .pay-row input { width: 140px; }
  .sum-row input { width: 120px; }

  dialog.modal, dialog.modal.wide { width: calc(100vw - 16px); max-width: none; margin: auto; }
  .modal-body { max-height: calc(100vh - 120px); padding: 14px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }

  .login { display: block; min-height: 100vh; }
  .login-art { height: 190px; }
  .login-logo { width: auto; height: 150px; }
  .login-main { padding: 22px 16px 32px; align-items: flex-start; }
  .login-box, .login-box.wide { width: 100%; max-width: 440px; }

  .sheet { padding: 12px; overflow-x: auto; }
  #toasts { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .update-bar { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; }
  body.has-update #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Печать в браузере (телефон) ---------- */
/* Документ выводится в #print-area (src/web/bridge.js); при печати видно только его. */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  body { background: #fff; }
}

.share-text { margin: 8px 0 12px; padding: 9px 12px; background: var(--panel-2); border-left: 3px solid var(--light); border-radius: var(--radius); white-space: pre-wrap; font: inherit; }

/* Без движения: для тех, у кого включено «уменьшить анимацию», и при повторной отрисовке после добавления расхода. */
.quiet *, .quiet *::before, .quiet *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
