:root {
  --bg: #eeeef0;
  --surface: #ffffff;
  --ink: #0e0e0f;
  --muted: #5e5e66;
  --line: #eeeef0;
  --line-strong: #d9d9de;
  --primary: #0e0e0f;
  --primary-hover: #2a2a2e;
  --primary-ink: #ffffff;
  --focus: #f5d5de;
  --bordo: #5c1a2b;
  --pink: #f5d5de;
  --in: #1f6b4a;
  --in-soft: #dcefe5;
  --out: #5c1a2b;
  --out-soft: #f5d5de;
  --wo: #7a5410;
  --wo-soft: #f3e6c8;
  --inv: #2e2e8a;
  --inv-soft: #e2e2f3;
  --sky-soft: #ffffff;
  --lilac-soft: #ffffff;
  --danger: #b3261e;
  --radius: 20px;
  --shadow: none;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Unbounded", "Arial Black", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ------------ brand */
.wordmark { font-family: var(--display); font-weight: 800; font-style: italic; letter-spacing: .01em; white-space: nowrap; }
.wordmark sup { font-family: var(--sans); font-style: normal; font-weight: 600; font-size: .45em; margin-left: 1px; }
.brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: #b9b9c0; white-space: nowrap; }

/* ------------ top bar (телефон / узкий экран) */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; height: 62px;
  background: var(--ink); color: #fff;
}
.brand { display: flex; flex-direction: column; justify-content: center; gap: 2px; text-decoration: none; flex: none; color: #fff; }
.brand .wordmark { font-size: 17px; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 9px 14px; border-radius: 10px; text-decoration: none; white-space: nowrap;
  color: #fff; font-size: 14px; font-weight: 500; position: relative;
}
.nav a:hover { background: #222226; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 700; }
.badge:not(:empty) {
  display: inline-block; margin-left: 8px; min-width: 20px; padding: 0 6px; border-radius: 9px;
  background: var(--pink); color: var(--bordo); font-family: var(--mono); font-size: 11px; font-weight: 500; text-align: center; line-height: 18px;
}
.user-btn {
  flex: none; border: 0; background: var(--pink); color: var(--bordo); font-weight: 700;
  border-radius: 999px; padding: 9px 16px; cursor: pointer; font-size: 13px; max-width: 170px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-btn:hover { background: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; }
h1 { font-size: 34px; font-weight: 800; font-style: italic; margin: 4px 0 20px; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 800; font-style: italic; margin: 26px 0 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* боковое меню на компьютере */
@media (min-width: 1000px) {
  .top {
    position: fixed; left: 0; top: 0; bottom: 0; width: 248px; height: auto;
    flex-direction: column; align-items: stretch; gap: 30px; padding: 34px 20px 24px; overflow-y: auto;
  }
  .brand { padding: 0 10px; gap: 6px; }
  .brand .wordmark { font-size: 21px; }
  .nav { flex-direction: column; flex: none; overflow: visible; gap: 2px; }
  .nav a { padding: 11px 12px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
  .user-btn { margin-top: auto; max-width: none; text-align: left; padding: 12px 16px; }
  main { margin-left: 248px; max-width: 1240px; padding: 34px 44px 80px; }
  body.auth main { margin-left: 0; }
}

/* трёхъязычная подпись, как на размерной сетке */
.tri { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 18px; row-gap: 1px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; margin-bottom: 10px; }
.tri .m { color: var(--muted); }
.tri .jp { font-family: "Noto Sans JP", var(--sans); letter-spacing: .3em; }
.hello { font-size: 46px; margin-bottom: 26px; }

/* ------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #ecc5c2; }
.btn.danger:hover { border-color: var(--danger); background: #fff3f3; }
.btn.big { min-height: 54px; font-size: 16px; padding: 0 28px; border-radius: 999px; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(14,14,15,.06); }

input[type=text], input[type=number], input[type=search], input[type=date], select, textarea {
  min-height: 44px; padding: 8px 16px; border: 1.5px solid transparent; border-radius: 14px;
  background: var(--surface); width: 100%;
}
main .card input[type=text], main .card input[type=number], main .card select, .modal input[type=text], .modal input[type=number], .modal input[type=password], .modal select, .modal textarea { background: var(--bg); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--bordo); }
textarea { min-height: 64px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.card { background: var(--surface); border: 0; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

/* ------------ home */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile {
  display: block; text-decoration: none; padding: 20px 22px; border-radius: 20px;
  background: var(--surface); min-height: 128px; position: relative;
  transition: transform .15s, background .15s;
}
.tile:hover { transform: translateY(-2px); }
.tile b { display: block; font-size: 20px; font-weight: 800; font-style: italic; letter-spacing: -.01em; text-transform: lowercase; margin-bottom: 4px; }
.tile .muted { font-size: 13px; color: var(--muted); }
.tile .stripe { display: none; }
.tile .ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); margin-bottom: 14px; color: var(--ink); }
.tile .ico svg { width: 20px; height: 20px; }
.tile.t-out { background: var(--bordo); color: #fff; }
.tile.t-out .muted { color: var(--pink); }
.tile.t-out .ico { border-color: #fff; color: #fff; }
.tile.t-in { background: var(--ink); color: #fff; }
.tile.t-in .muted { color: #b9b9c0; }
.tile.t-in .ico { border-color: #fff; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 20px 22px; background: var(--surface); border-radius: 20px; display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-family: var(--display); font-size: 38px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .u { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.stat.accent { background: var(--bordo); color: #fff; }
.stat.accent .k, .stat.accent .u { color: var(--pink); }

/* ------------ scan screen */
.scan-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.scan-head h1 { margin: 0; }
.pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.t-in { --c: var(--in); --cs: var(--in-soft); }
.t-out { --c: var(--out); --cs: var(--out-soft); }
.t-wo { --c: var(--wo); --cs: var(--wo-soft); }
.t-inv { --c: var(--inv); --cs: var(--inv-soft); }
.pill.t { background: var(--cs); color: var(--c); }
.scanbox { position: relative; }
.scanbox input {
  min-height: 68px; font-size: 20px; padding: 12px 16px 12px 58px; border-width: 2px; border-color: var(--surface);
  font-family: var(--mono); border-radius: 999px;
}
.scanbox input::placeholder { font-family: var(--sans); font-size: 17px; color: #8a8a92; }
.scanbox input:focus { outline: 4px solid var(--cs); border-color: var(--ink); }
.scanbox::before {
  content: ""; position: absolute; left: 18px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 7px);
  border-radius: 3px; opacity: .8;
}
.scan-hint { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10; margin-top: 6px;
  background: var(--surface); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(44,48,64,.14); max-height: 320px; overflow: auto;
}
.suggest div { padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest div:last-child { border-bottom: 0; }
.suggest div:hover, .suggest div.on { background: var(--cs, #f1f3ff); }

.last {
  margin: 16px 0; padding: 16px 20px; border-radius: 20px; border: 2px solid transparent;
  background: var(--surface); display: flex; gap: 16px; align-items: center; min-height: 84px;
  transition: background .25s, border-color .25s;
}
.last.flash-ok { background: var(--cs); border-color: var(--c); }
.last.flash-err { background: #ffe4e4; border-color: var(--danger); }
.last .q { font-family: var(--display); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; color: var(--c); }
.last .n { font-weight: 700; font-size: 17px; }
.last.empty { color: var(--muted); justify-content: center; border: 2px dashed var(--line-strong); background: transparent; }

.scan-layout { display: grid; grid-template-columns: 1fr 310px; gap: 18px; align-items: start; }
.side { position: sticky; top: 24px; }
.side .total { font-family: var(--display); font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ------------ tables */
.tbl-wrap { background: var(--surface); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; background: #fafafb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6f6f8; }
tr.hl td { background: var(--cs, #fff8e1); }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
td .sub { font-size: 12px; color: var(--muted); }
.pos { color: var(--in); font-weight: 700; }
.neg { color: var(--bordo); font-weight: 700; }
.zero { color: var(--muted); }
.qty-ctl { display: inline-flex; align-items: center; gap: 4px; }
.qty-ctl button { width: 36px; height: 36px; border: 0; background: var(--bg); color: var(--ink); border-radius: 50%; cursor: pointer; font-size: 18px; font-weight: 700; line-height: 1; }
.qty-ctl button:hover { filter: brightness(.96); }
.qty-ctl input { width: 66px; min-height: 36px; text-align: center; padding: 4px; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 10px; }
.x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; padding: 4px 9px; border-radius: 10px; }
.x:hover { color: var(--danger); background: #f8e3e1; }
.empty-state { padding: 44px 16px; text-align: center; color: var(--muted); }

.matrix td.cell { text-align: center; font-variant-numeric: tabular-nums; min-width: 48px; }
.matrix th.cell { text-align: center; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 360px; }
.toolbar select { width: auto; }

/* ------------ modal / toast */
.overlay { position: fixed; inset: 0; background: rgba(14,14,15,.4); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 24px; width: 100%; max-width: 520px; padding: 28px; box-shadow: 0 24px 60px rgba(14,14,15,.25); }
.modal.wide { max-width: 760px; }
.modal h2 { margin: 0 0 16px; font-size: 24px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: var(--ink); color: #fff; font-weight: 600; padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(14,14,15,.2); max-width: 90vw; }
#toast div.err { background: var(--bordo); color: #fff; }

.code-chip { font-family: var(--mono); font-size: 13px; background: var(--bg); color: var(--ink); padding: 3px 10px; border-radius: 999px; }
.list-users { display: flex; flex-direction: column; gap: 8px; }
.list-users button { text-align: left; }
.bc-preview { display: flex; justify-content: center; padding: 10px; background: #fff; border: 2px dashed var(--line-strong); border-radius: 14px; }

/* ------------ print */
#print-area { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
}
.lbl { overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #000; font-family: Arial, Helvetica, sans-serif; page-break-inside: avoid; break-inside: avoid; }
.lbl .ln { font-weight: 700; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; }
.lbl .la { line-height: 1.2; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl svg { display: block; shape-rendering: crispEdges; }
.lbl .lc { font-family: "IBM Plex Mono", "Courier New", monospace; letter-spacing: 1px; line-height: 1; }
.lbl .lb { font-family: "Unbounded", "Arial Black", Arial, sans-serif; font-weight: 800; font-style: italic; font-size: 9pt; line-height: 1.1; margin-bottom: .8mm; width: 100%; }
.lbl .lb sup { font-family: Arial, sans-serif; font-style: normal; font-size: 4pt; }
.lbl-roll { page-break-after: always; break-after: page; }
.lbl-roll:last-child { page-break-after: auto; break-after: auto; }
.a4-sheet { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; page-break-after: always; break-after: page; }
.a4-sheet:last-child { page-break-after: auto; break-after: auto; }

@media (max-width: 860px) {
  .scan-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .user-btn { max-width: 110px; }
}
@media (max-width: 560px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 8px 10px; }
  .brand-sub { display: none; }
  .hello { font-size: 32px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat .v { font-size: 28px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand { flex: 1; }
  main { padding: 14px 12px 80px; }
  h1 { font-size: 21px; }
  .grid2 { grid-template-columns: 1fr; }
  th, td { padding: 8px; }
  .hide-sm { display: none; }
  .scanbox input { font-size: 18px; }
}

tr.hl .qty-ctl button { background: #fff; }

/* ------------ вход */
body.auth .top { display: none; }
body.auth main { max-width: none; padding: 0; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--ink); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px; padding: 36px 32px; }
.auth-card h1 { margin: 26px 0 18px; font-size: 32px; }
.auth-logo { display: flex; flex-direction: column; gap: 4px; }
.auth-logo .wordmark { font-size: 26px; }
.auth-logo .brand-sub { color: var(--muted); }
.auth-card input { background: var(--bg) !important; }
input[type=password] { min-height: 44px; padding: 8px 16px; border: 1.5px solid transparent; border-radius: 14px; background: var(--surface); width: 100%; }
.nav a[hidden], [hidden] { display: none !important; }

/* ------------ гостевой режим */
#guest-bar { position: sticky; top: 0; z-index: 15; background: var(--pink); color: var(--bordo); text-align: center; font-size: 13px; font-weight: 600; padding: 8px 16px; }
#guest-bar .mono { font-size: 11px; letter-spacing: .14em; margin-right: 8px; }
@media (min-width: 1000px) { #guest-bar { margin-left: 248px; } }
@media (max-width: 999px) { #guest-bar { top: 62px; } }
.secret, body.guest .money { filter: blur(6px); user-select: none; -webkit-user-select: none; pointer-events: none; }
.mp-info { display: grid; gap: 8px; margin-top: 12px; padding: 14px 16px; background: var(--bg); border-radius: 14px; }
.mp-info span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.mp-info b { font-weight: 500; font-size: 13px; word-break: break-all; }

/* ------------ 2.0: операции, разделы, техкарты */
button.tile { border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
button.tile b, button.tile .muted { display: block; }
a.stat { text-decoration: none; color: inherit; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface); padding: 4px; border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); min-height: 36px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600; min-height: 34px; }
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }

.pill.op-out { background: var(--bordo); color: #fff; }
.pill.op-in { background: var(--ink); color: #fff; }
.pill.op-prod { background: #2e2e8a; color: #fff; }
.pill.op-inv { background: #e2e2f3; color: #2e2e8a; }
.pill.op-wo { background: var(--pink); color: var(--bordo); }
.pill.op-ch { background: var(--bg); color: var(--ink); }
.pill.op-done { background: #dcefe5; color: #1f6b4a; }
.pill.op-low { background: #f3e6c8; color: #6b4a0e; }

.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.op-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-radius: 20px; padding: 18px 20px; text-decoration: none; color: inherit; transition: transform .15s; min-height: 150px; }
.op-card:hover { transform: translateY(-2px); }
.op-title { font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: -.01em; line-height: 1.2; }
.op-meta { display: flex; align-items: baseline; gap: 10px; margin-top: auto; color: var(--muted); font-size: 13px; }
.op-meta .big { font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--ink); }

.op-head h1 { margin: 6px 0 16px; }
.op-head h1.editable { cursor: text; }
.op-head h1.editable:hover { text-decoration: underline dotted 2px; text-underline-offset: 6px; }
.box-ctl { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.box-ctl .total { min-width: 70px; text-align: center; }
.box-block { margin-bottom: 10px; }
.box-block.cur { outline: 2px solid var(--ink); }
.box-h { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.box-h .btn, .box-h .pill { margin-left: auto; }
details.dl { margin-top: 10px; }
details.dl summary { list-style: none; }
details.dl summary::-webkit-details-marker { display: none; }
details.dl[open] { display: flex; flex-direction: column; gap: 6px; }
.card.warn { background: #f3e6c8; color: #4a3308; }
.alerts { margin-bottom: 8px; }
.alert-row { display: flex; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.alert-row .pill { flex: none; min-width: 64px; text-align: center; }
.op-screen .scan-layout { margin-top: 4px; }
.mat-only[hidden] { display: none !important; }

/* ------------ 2.2: заказы и оплаты */
.pbar { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 6px; overflow: hidden; max-width: 260px; }
.pbar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.pill.st-draft { background: var(--bg); color: var(--muted); }
.pill.st-placed { background: #e2e2f3; color: #2e2e8a; }
.pill.st-cut { background: #2e2e8a; color: #fff; }
.pill.st-partial { background: #f3e6c8; color: #6b4a0e; }
.pill.st-done { background: #dcefe5; color: #1f6b4a; }
.pill.st-closed { background: var(--ink); color: #fff; }
a.pill { text-decoration: none; }
.stat .v.sm { font-size: 26px; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; align-items: end; }
.size-grid label { display: flex; flex-direction: column; gap: 4px; }
.size-grid label span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.size-grid input { text-align: center; background: var(--bg) !important; }
.size-grid .sum { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.field > .lbl { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.matrix tr.total-row td { background: #fafafb; font-weight: 700; }
.matrix tr.warn-row td { background: #fbf3df; }
.order-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-top: 8px; }
@media (max-width: 860px) { .order-cols { grid-template-columns: 1fr; } }
.money-card { display: flex; flex-direction: column; gap: 10px; }
.money-card > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.money-card span { color: var(--muted); font-size: 13px; }
.modal .money-card { background: var(--bg); margin-bottom: 8px; }
.op-link { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--surface); border-radius: 14px; margin-bottom: 6px; text-decoration: none; color: inherit; }

.howto { margin-bottom: 18px; }
.howto summary { cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: " ↓"; color: var(--muted); }
.howto[open] summary::after { content: " ↑"; }
.howto ol { margin: 12px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.inv-add { background: var(--bg); margin-top: 12px; }
.inv-add textarea { background: var(--surface) !important; }
