* { box-sizing: border-box }
:root {
  color-scheme: light;
  --canvas:#f3f6fb; --surface:#fff; --ink:#142238; --muted:#485970;
  --line:#c9d4e4; --blue:#1d4ed8; --green:#15803d; --indigo:#4338ca;
  --teal:#0f766e; --violet:#6d28d9; --red:#b91c1c; --orange:#9a3412; --gray:#475569;
  --focus:#854d0e;
  font: 16px/1.5 "Segoe UI", Roboto, sans-serif;
}
:root.dark {
  color-scheme: dark;
  --canvas:#101a29; --surface:#192637; --ink:#f2f6ff; --muted:#bccce1; --line:#536782;
  --focus:#fde047;
}
body { margin:0; color:var(--ink); background:var(--canvas) }
.frame { max-width:860px; padding-inline:clamp(12px,4vw,36px); margin-inline:auto }
header { background:var(--surface); border-bottom:1px solid var(--line) }
.masthead { min-height:68px; display:flex; align-items:center; flex-wrap:wrap; gap:12px; font-weight:750 }
.masthead img { object-fit:contain; height:40px }
.theme { margin-inline-start:auto; display:flex; align-items:center; gap:6px; font-weight:550; font-size:.875rem }
.theme input { appearance:none; width:46px; height:26px; border-radius:20px; background:#52637c; padding:3px; flex:none }
.theme input::before { content:""; display:block; height:18px; width:18px; border-radius:50%; background:#fff }
.theme input:checked { background:var(--violet) }
.theme input:checked::before { transform:translateX(19px) }
main { padding-block:16px 36px }
h1,h2,h3,p { margin:0 }
p+p { margin-top:.55rem }
h1 { font-size:1.75rem; line-height:1.1; letter-spacing:-.025em; margin-bottom:.8rem }
h2 { font-size:1.15rem; margin-block:1rem .5rem }
h3 { font-size:1rem }
small { color:var(--muted) }
nav,.actions,.fields { display:flex; flex-wrap:wrap; gap:8px; align-items:end }
nav { margin-bottom:16px; gap:6px }
nav button { background:color-mix(in srgb,var(--tone) 15%,var(--surface)); color:var(--ink); border-color:var(--tone); box-shadow:none }
nav button[aria-current="page"] { color:#fff; background:var(--tone) }
[hidden] { display:none !important }
button,input,select { font:inherit }
button { min-height:44px; padding:8px 13px; border:1px solid transparent; border-radius:8px; background:var(--tone,var(--blue)); color:white; font-weight:650; box-shadow:0 2px 3px #0002; cursor:pointer }
button:hover:not(:disabled) { filter:brightness(1.09) }
button:active:not(:disabled) { transform:translateY(1px) scale(.97); box-shadow:none }
button:disabled { opacity:.55; cursor:wait }
:focus-visible { outline:3px solid var(--focus); outline-offset:3px }
input:not([type=checkbox]),select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:8px; background:var(--surface); padding:7px 10px; color:var(--ink) }
input[type=checkbox] { accent-color:var(--blue) }
.fields>label { flex:1 1 11rem; min-width:0 }
label { font-weight:650; display:block }
label>input:not([type=checkbox]),label>select { margin-top:4px }
.surface { padding:clamp(12px,4vw,23px); background:var(--surface); border:1px solid var(--line); border-radius:14px }
.hero { display:grid; grid-template-columns: minmax(0,1fr) minmax(65px,130px); align-items:center; gap:12px }
.hero img { width:100%; max-height:130px; object-fit:contain }
.stack { display:grid; gap:12px }
.row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding-block:10px; border-bottom:1px solid var(--line) }
.row>* { min-width:0; overflow-wrap:anywhere }
.row:last-child { border-bottom:0 }
#status { background:var(--surface); border:1px solid var(--line); padding:10px 12px; border-radius:8px; margin-bottom:12px }
.warning { padding:9px; border:1px solid #c2410c; border-radius:8px }
dialog { width:min(calc(100% - 24px),560px); max-height:90dvh; padding:18px; border:1px solid var(--line); border-radius:18px; color:var(--ink); background:var(--surface); box-shadow:0 12px 40px #0004 }
.dark dialog { border:2px solid #859cee; box-shadow:0 0 15px #859cee70 }
dialog::backdrop { background:#101a29a0 }
dialog article { display:grid; gap:12px }
.pick { display:flex; align-items:center; gap:8px; flex:1 1 13rem }
.pick input { width:24px; height:24px; flex:none }
.qty { max-width:100px }
details { padding-block:10px; border-bottom:1px solid var(--line) }
summary { cursor:pointer; padding-block:5px }
.amount { font-variant-numeric:tabular-nums }
.code { font-size:1.4rem; letter-spacing:.08em; overflow-wrap:anywhere }
@media (max-width:440px) { .masthead { gap:8px } .masthead img { width:48px } .theme { margin-inline-start:0 } nav button { padding-inline:8px } }
@media (prefers-reduced-motion:no-preference) { button { transition:transform 80ms,filter 100ms } }
.unit { max-width:130px }
.version { text-align:center; padding:16px 0 24px }
