/* Тёмная тема для телефона. Цвета отличаются и яркостью, а не только оттенком: статус читается и без цвета. */
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-latin.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; }

:root {
  --bg: #0E1014; --surface: #171A20; --surface2: #1F232B; --nav: #12151A; --line: #2A2F39; --line2: #3A4150;
  --text: #ECEEF2; --muted: #9BA3B1; --soft: #C9CED8;
  --accent: #C6F36B; --accent-ink: #0E1014; --accent-bg: #243311;
  --blue: #86B8FF; --blue-bg: #1C2B44; --coral: #FF9C7A; --coral-bg: #3B2219; --gray-bg: #2A2F39;
  --bar: #66728A;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.shell { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); position: relative; }
.shell--bare { padding-bottom: 24px; }
.content { padding: calc(20px + env(safe-area-inset-top)) 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.muted { color: var(--muted); } .soft { color: var(--soft); } .sm { font-size: 12px; } .md { font-size: 13px; }
.h1 { font-size: 24px; font-weight: 700; } .h2 { font-size: 18px; font-weight: 600; } .h3 { font-size: 15px; font-weight: 600; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.mid { font-size: 20px; font-weight: 600; }
.up { color: var(--accent); } .down { color: var(--coral); } .blue { color: var(--blue); }

/* Нижнее меню и кнопка «+ Заказ» */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--nav); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.nav__in { max-width: 480px; margin: 0 auto; height: 72px; display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--muted); min-width: 0; }
.nav a.is-on { color: var(--accent); font-weight: 600; }
.fab { position: fixed; z-index: 21; bottom: calc(88px + env(safe-area-inset-bottom)); right: max(16px, calc(50% - 224px));
  height: 52px; padding: 0 22px; border-radius: 26px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }

/* Карточки */
.card { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card--hero { border-radius: 20px; padding: 20px; gap: 14px; }
.card--tight { padding: 14px; gap: 4px; }
.card--row { flex-direction: row; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2 > .span2 { grid-column: span 2; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row--top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.pad-top { padding-top: 12px; border-top: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv b { font-weight: 600; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill--up { background: var(--accent-bg); color: var(--accent); } .pill--down { background: var(--coral-bg); color: var(--coral); }
.st-transit { background: var(--blue-bg); color: var(--blue); } .st-sold { background: var(--accent-bg); color: var(--accent); }
.st-return { background: var(--coral-bg); color: var(--coral); } .st-cancel { background: var(--gray-bg); color: var(--soft); }

.progress { height: 8px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.progress--blue > i { background: var(--blue); }

/* Верх страницы: месяц со стрелками */
.monthbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.monthbar__t { text-align: center; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.iconbtn.is-off { opacity: 0.3; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

/* Кнопки и чипы */
.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; border: 1px solid transparent; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--pill { border-radius: 22px; }
.btn--ghost { border-color: var(--line2); }
.btn--coral { border-color: var(--coral); color: var(--coral); }
.btn--wide { width: 100%; min-height: 52px; font-size: 16px; font-weight: 700; border-radius: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip.is-on { background: var(--accent); color: var(--accent-ink); }
.chip small { font-size: 12px; font-weight: 500; opacity: 0.75; }

/* Заказ */
.ocard { padding: 14px; gap: 12px; }
.ocard__main { display: flex; align-items: center; gap: 12px; }
.size { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 16px; font-weight: 700; }
.ocard__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ocard__actions { display: flex; gap: 8px; }
.ocard__actions form { flex: 1; display: flex; }
.ocard__actions .btn { flex: 1; }

/* Остаток по размерам */
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 8px; }
.sz { background: var(--surface2); border-radius: 12px; padding: 10px 0; text-align: center; border: 1px solid transparent; }
.sz span { display: block; font-size: 12px; color: var(--muted); } .sz b { display: block; font-size: 20px; font-weight: 600; }
.sz.is-low { border-color: var(--coral); } .sz.is-low b { color: var(--coral); }

/* Столбики прибыли */
.bars { display: flex; align-items: flex-end; justify-content: space-around; min-height: 150px; }
.bar { width: 72px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar__v { font-size: 12px; color: var(--muted); } .bar__l { font-size: 12px; font-weight: 600; }
.bar__fill { display: block; width: 44px; border-radius: 8px; background: var(--bar); }
.bar.is-sel .bar__fill { background: var(--accent); } .bar.is-neg .bar__fill { background: var(--coral); }

/* Расходы */
.stackbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stackbar i { display: block; min-width: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.c1 { background: #C6F36B; } .c2 { background: #86B8FF; } .c3 { background: #FF9C7A; } .c4 { background: #C9CED8; }
.c5 { background: #E3A7FF; } .c6 { background: #7B8494; }
.tag { flex: none; width: 8px; align-self: stretch; border-radius: 4px; min-height: 40px; }

/* Формы */
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lab { font-size: 13px; color: var(--muted); }
.input { width: 100%; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); padding: 0 14px;
  font-size: 16px; outline: none; }
.input:focus-visible, .pick input:focus-visible + span, .btn:focus-visible, .chip:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { height: auto; min-height: 76px; padding: 12px 14px; resize: vertical; }
.picks { display: flex; gap: 8px; flex-wrap: wrap; }
.picks--sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); }
.pick { position: relative; flex: 1; display: block; }
.pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pick span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 12px;
  background: var(--surface); font-weight: 600; font-size: 15px; padding: 6px 4px; }
.pick span b { font-size: 16px; font-weight: 700; } .pick span small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pick input:checked + span { background: var(--accent); color: var(--accent-ink); }
.pick input:checked + span small { color: var(--accent-ink); opacity: 0.8; }
.pick span.is-low small { color: var(--coral); }
.hint { font-size: 12px; color: var(--muted); } .hint--warn { color: var(--coral); }
.error { background: var(--coral-bg); color: var(--coral); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.notice { background: var(--accent-bg); color: var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.savebar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Блок товара в форме поставки */
.pblock { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.qty { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; }
.qty label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.qty .input { height: 44px; padding: 0 4px; text-align: center; font-size: 16px; }

/* Вход */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; max-width: 420px; margin: 0 auto; gap: 24px; }
.auth__logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 24px; }
.empty { padding: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }
.toast { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 448px; margin: 0 auto;
  background: var(--coral-bg); color: var(--coral); padding: 12px 14px; border-radius: 12px; font-weight: 500; }
details.fold > summary { list-style: none; min-height: 52px; background: var(--surface); border-radius: 16px; padding: 0 16px; display: flex;
  align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary svg { transform: rotate(180deg); }
details.fold > .stack { margin-top: 12px; gap: 12px; }
