:root {
  color-scheme: light dark;
  --ink: #242424; --paper: #f7f6f3; --surface: #fff; --line: #deded8;
  --muted: #62675f; --accent: #a92c30; --soft: #f9ece9; --ok: #326147;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece9e5; --paper: #181918; --surface: #232422; --line: #41423e;
    --muted: #b1b6ab; --accent: #f3a5a5; --soft: #3a2525; --ok: #b4d8be;
  }
}
* { box-sizing: border-box; }
body { margin: 0; padding: 24px; background: var(--paper); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button, nav a, summary { cursor: pointer; }
button, .button, nav a {
  min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink); display: inline-flex; align-items: center;
  justify-content: center; text-decoration: none; text-align: center;
}
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.primary, nav [aria-current=page] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
input:not([type=checkbox]), select, textarea {
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 10px;
  border-radius: 6px; min-height: 44px; min-width: 0; max-width: 100%;
}
.app { max-width: 1320px; margin: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: clip; }
.top { padding: 20px 24px; background: var(--surface); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); justify-content: space-between; }
.wordmark { font-size: 18px; letter-spacing: 1.6px; font-weight: 650; }
.brandnote { font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.account { position: relative; }
.account summary { min-height: 44px; padding: 11px 8px; }
.account-panel { position: absolute; z-index: 2; right: 0; width: max-content; max-width: 72vw; background: var(--surface); padding: 12px; border: 1px solid var(--line); border-radius: 7px; overflow-wrap: anywhere; }
nav { display: flex; gap: 8px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
nav a { border-color: transparent; }
main { padding: 24px; min-height: 380px; }
h1 { font-size: 28px; letter-spacing: -1px; margin: 0; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 4px 0 14px; }
.preview-note, .muted { color: var(--muted); font-size: 12px; }
.preview-note { margin-bottom: 12px; }
.heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.stat { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.stat strong { display: block; font-size: 26px; font-weight: 550; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }
.notice { padding: 12px 14px; background: var(--soft); color: var(--accent); border-radius: 6px; margin: 16px 0; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); min-width: 0; }
.search { flex: 1; min-width: 150px; }
.more-filters { flex-basis: 100%; }
details:not(.account) summary { min-height: 44px; padding: 10px 0; width: fit-content; max-width: 100%; }
.more-filters .toolbar, .batch-options .toolbar { margin: 0 0 10px; }
.check { display: flex; align-items: center; min-height: 44px; }
.warehouse-options { min-inline-size: 0; margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.warehouse-options legend { color: var(--muted); font-size: 12px; }
.warehouse-options div { display: flex; flex-wrap: wrap; column-gap: 12px; }
.warehouse-options label { cursor: pointer; gap: 4px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.list { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: clip; }
.listhead, .orderrow { display: grid; grid-template-columns: 44px minmax(110px,1.2fr) minmax(100px,1fr) minmax(150px,1.5fr) 86px; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.listhead { font-size: 11px; letter-spacing: 1px; color: var(--muted); background: var(--paper); }
.orderrow:last-child { border-bottom: 0; }
.orderrow small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.order-id, .rowstate, .step { overflow-wrap: anywhere; }
.select-hit { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.status { font-size: 12px; display: inline-block; color: var(--muted); }
.status.attention { color: var(--accent); }.status.good { color: var(--ok); }
.orderrow .mobilemeta, .phone-only, .stockcards { display: none; }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-top: 18px; }
.detailtop { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.detailtop h2 { overflow-wrap: anywhere; }
.steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 20px 0; }
.step { padding: 10px 0; border-bottom: 1px solid var(--line); }
.step span { display: block; font-size: 12px; color: var(--muted); }
.package { border-top: 1px solid var(--line); padding: 14px 0; }
.split, .pagination { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pagination { margin-top: 12px; font-size: 12px; color: var(--muted); }
.numbers { width: 100%; min-height: 100px; margin: 10px 0; font: 16px monospace; }
.stocktable { overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { font-size: 11px; color: var(--muted); font-weight: 500; }
.stockcard { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.stock-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; overflow-wrap: anywhere; }
.stock-identity p { margin-bottom: 4px; }
.stock-photo { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); }
.stock-photo img { display: block; width: 100%; height: 100%; object-fit: contain; background: white; }
.stock-photo-empty { display: grid; place-items: center; width: 100%; height: 100%; padding: 3px; color: var(--muted); font-size: 11px; text-align: center; }
.sizes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.size { padding: 8px; border: 1px solid var(--line); border-radius: 4px; text-align: center; min-width: 44px; }
.size small { display: block; color: var(--muted); }
.login { max-width: 350px; margin: 24px auto 50px; padding: 20px 0; }
.login label { margin: 16px 0; }.login input { font-size: 16px; width: 100%; }.login button { width: 100%; }
footer { padding: 14px 24px; color: var(--muted); font-size: 11px; background: var(--surface); border-top: 1px solid var(--line); }
.empty { padding: 24px; color: var(--muted); }
.skip { position: absolute; top: -100px; left: 12px; z-index: 3; padding: 10px; background: var(--surface); }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }
@media (max-width: 650px) {
  body { padding: 0; }.app { border: 0; border-radius: 0; }
  main { padding: 16px; }.top { padding: 14px 16px; }nav { padding: 10px 16px; }
  .wordmark { font-size: 16px; }h1 { font-size: 25px; }.heading { display: block; }
  .stats { gap: 6px; }.stat { padding: 9px; }.stat strong { font-size: 24px; }
  .listhead, .orderrow .warehouse, .stocktable, .desktop-only, .order-detail.auto-detail { display: none; }
  .orderrow { grid-template-columns: 44px minmax(0,1fr) auto; gap: 6px; padding: 12px 9px; align-items: start; }
  .order-id strong a, .login p a { display: inline-flex; align-items: center; min-height: 44px; }
  .orderrow .rowstate { grid-column: 2/4; }.orderrow .open { grid-column: 3; grid-row: 1; padding-inline: 10px; }
  .orderrow .mobilemeta, .stockcards, .phone-only { display: block; }
  .stock-photo { width: 80px; height: 80px; }
  .steps { grid-template-columns: minmax(0,1fr); }.detail { padding: 14px; }
  .has-detail .orders-results { display: none; }.has-detail .order-detail { margin-top: 0; }
  .toolbar[data-filter-form], .more-filters .toolbar, .batch-options .toolbar {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px;
  }
  .toolbar[data-filter-form] > :is(.search, .warehouse-options, button, details, .loading),
  .more-filters .check, .batch-options .check { grid-column: 1 / -1; }
  .batch-options .toolbar { grid-template-columns: minmax(0,1fr); }
  input:not([type=checkbox]), select { font-size: 16px; width: 100%; }
  footer { padding: 14px 16px; }
}
@media (max-width: 340px) {
  .toolbar[data-filter-form], .more-filters .toolbar { grid-template-columns: minmax(0,1fr); }
}
