*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --canvas: #f7f6f1;
  --panel: #fff;
  --ink: #191c18;
  --muted: #525c54;
  --edge: #d9ddd3;
  --deep: #22483d;
  --soft: #eaf1ed;
  --yellow: #ffd84d;
  --notice: #fff4d6;
  --danger: #862d2e;
}
body { margin: 0; color: var(--ink); background: var(--canvas); font: 1rem/1.5 system-ui, sans-serif; }
[hidden] { display: none !important; }
:where(h1, h2, h3, p) { margin: 0; }
a { color: var(--deep); text-underline-offset: .2em; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #345ac7; outline-offset: 3px; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(button, input:not([type=file]), select, textarea) { border: 1px solid #969f92; border-radius: .55rem; background: #fff; min-height: 44px; }
:where(input:not([type=file]), select, textarea) { width: 100%; min-width: 0; padding: .52rem .67rem; }
input[type=file] { width: 100%; font-size: .85rem; }
textarea { resize: vertical; }
button { display: inline-flex; justify-content: center; align-items: center; padding: .49rem .8rem; font-weight: 650; cursor: pointer; line-height: 1.25; text-align: center; }
button:hover { border-color: var(--deep); background: var(--soft); }
button:disabled { cursor: default; opacity: .55; }
button.primary { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
button.primary:hover { background: #ffe17d; }
button.quiet { border-color: transparent; color: var(--deep); }
button.danger { color: var(--danger); }
button.full { display: flex; width: 100%; }
.shell { width: min(1250px, calc(100% - clamp(32px, 8vw, 100px))); margin-inline: auto; }
.hero { padding-block: clamp(24px, 4vw, 55px) 1.45rem; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; color: var(--muted); font-size: .83rem; font-weight: 650; }
h1 { margin: .65rem 0 .35rem; font-size: clamp(2rem, 4.7vw, 3.35rem); line-height: 1.02; letter-spacing: -.05em; max-width: 34ch; }
h2 { font-size: clamp(1.12rem, 3vw, 1.35rem); line-height: 1.25; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.lede { font-size: clamp(1rem, 2.1vw, 1.17rem); color: var(--muted); }
.privacy-note { width: fit-content; margin-top: 1rem; padding: .45rem .65rem; border: 1px solid #c8d6ca; border-radius: .5rem; background: var(--soft); color: var(--deep); font-size: .85rem; }
.privacy-note span { display: inline-block; width: .45rem; height: .45rem; margin-right: .2rem; border-radius: 50%; background: #3b6e53; vertical-align: .09rem; }
.overview { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); min-width: 0; margin-bottom: 1rem; border: 1px solid var(--edge); border-radius: .75rem; background: var(--deep); color: #fff; }
.overview > div { min-width: 0; display: grid; align-content: center; gap: .05rem; padding: .75rem clamp(.65rem, 2vw, 1.35rem); overflow-wrap: anywhere; }
.overview > div + div { border-left: 1px solid #628278; }
.overview small, .stat span { color: #e5eee9; font-size: .8rem; }
.overview strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat strong { font-size: 1.45rem; line-height: 1.15; }
.workbench { display: grid; grid-template-columns: minmax(235px, 280px) minmax(0, 1fr); align-items: start; gap: 1rem; scroll-margin-top: 95px; }
.batch-rail { min-width: 0; display: grid; align-content: start; gap: .7rem; }
.panel { min-width: 0; border: 1px solid var(--edge); border-radius: .8rem; background: var(--panel); box-shadow: 0 2px 3px #191c1808; }
.batch-input { display: grid; gap: .65rem; padding: 1rem; }
.batch-input p, .saved-settings p, .panel-heading p, .empty { color: var(--muted); font-size: .92rem; }
.batch-input a { display: block; padding: .25rem; font-size: .9rem; font-weight: 600; text-align: center; }
.saved-settings summary { padding: .7rem 1rem; min-height: 44px; }
summary { cursor: pointer; font-weight: 700; }
.settings { display: grid; gap: .7rem; margin: 0 1rem 1rem; }
:where(.settings label, .field, .field-grid label) { display: grid; gap: .22rem; min-width: 0; font-size: .86rem; font-weight: 650; }
.settings label small { font-weight: 400; color: var(--muted); }
.rail-status, .work-status { font-size: .9rem; color: var(--deep); overflow-wrap: anywhere; }
.rail-status:not(:empty), .work-status:not(:empty) { padding: .65rem .8rem; background: var(--soft); border-radius: .45rem; }
[data-error=true]:not(:empty) { background: #fff0ee; color: var(--danger); }
.workspace { overflow: clip; }
.steps { display: flex; gap: .3rem; align-items: stretch; border-bottom: 1px solid var(--edge); padding: .4rem; background: #f0f2ed; }
.steps button { flex: 1 1 0; min-width: 0; padding: .5rem .36rem; border: 1px solid transparent; background: transparent; }
.steps button[aria-selected=true] { background: #fff; border-color: #adb9ac; color: var(--deep); box-shadow: 0 1px 2px #191c1810; }
.steps button:hover { border-color: #adb9ac; }
[role=tabpanel] { min-width: 0; padding: clamp(.8rem, 2vw, 1.25rem); }
.workspace > .work-status:not(:empty) { margin: 0 1rem 1rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1.2rem; margin-bottom: .85rem; }
.panel-heading p { margin-top: .2rem; }
.order-search { max-width: 29rem; margin-bottom: .85rem; }
.review-notices, .notice { margin: .75rem 0; padding: .7rem .85rem; background: var(--notice); border: 1px solid #e5ca87; border-radius: .55rem; font-size: .88rem; overflow-wrap: anywhere; }
.review-notices ul { margin: .6rem 0 .15rem; padding-left: 1.25em; }
.review-notices li + li { margin-top: .45rem; }
.review-notices li button { min-height: 38px; margin-left: .35rem; padding-block: .25rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; table-layout: fixed; }
th, td { overflow-wrap: anywhere; border: 1px solid #cbd3cc; padding: .55rem .65rem; text-align: left; vertical-align: middle; }
th { background: #eef3ef; color: var(--deep); }
td small { display: block; color: var(--muted); }
.order-table :is(th, td):first-child { width: 22%; }
.order-table :is(th, td):last-child { width: 14%; }
.order-table [data-label=Items] { width: 12%; }
.order-table td:last-child button { width: 100%; }
.table-number { font-variant-numeric: tabular-nums; }
.state-ready { color: var(--deep); font-weight: 650; }
.state-review { color: var(--danger); font-weight: 650; }
.pager, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.pager { justify-content: center; padding: .75rem 0 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.pager span { padding-inline: .25rem; }
.output-actions { margin-top: 1rem; }
.pick-table tbody tr[data-complete=true] { background: #f1f7f2; }
.pick-table :is(th, td):nth-child(1) { width: 14%; }
.pick-table :is(th, td):nth-child(2) { width: 29%; }
.pick-table :is(th, td):nth-child(3) { width: 9%; }
.pick-table :is(th, td):nth-child(4) { width: 12%; }
.pick-table :is(th, td):nth-child(5) { width: 26%; }
.pick-table :is(th, td):nth-child(6) { width: 10%; }
.pick-cell { display: flex; align-items: center; gap: .3rem; }
.pick-cell input { min-width: 3.3rem; padding: .35rem; }
.pick-cell button { min-width: 42px; padding-inline: .45rem; white-space: nowrap; }
.sort-field { min-width: min(100%, 9rem); }
.pick-progress { display: grid; gap: .3rem; margin-bottom: .8rem; color: var(--deep); font-size: .9rem; font-weight: 650; }
progress { width: 100%; height: .6rem; accent-color: var(--deep); }
.slip-select { max-width: 30rem; }
.slip-proof { margin-top: .85rem; border-radius: .6rem; background: #e9ece7; padding: 0 .65rem .9rem; }
.slip-proof .pager { padding-bottom: .7rem; }
.slip-proof canvas { display: block; width: min(100%, 590px); height: auto; margin: 0 auto; background: #fff; box-shadow: 0 3px 10px #191c182b; }
.help { max-width: 75rem; margin: 2.7rem auto; }
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin: .8rem 0 1.6rem; }
.guide article { border-top: 1px solid #aab6a7; padding-block: .7rem; }
.guide p, .help details p { color: var(--muted); margin-top: .35rem; }
.help details { padding: .65rem 0; border-bottom: 1px solid var(--edge); }
.help .related { margin-top: 1rem; color: var(--muted); }
dialog { max-width: min(790px, calc(100% - 1.3rem)); max-height: calc(100vh - 1.3rem); max-height: calc(100dvh - 1.3rem); overflow: auto; padding: clamp(.75rem, 2vw, 1.2rem); border: 1px solid #68736b; border-radius: .8rem; color: var(--ink); box-shadow: 0 8px 36px #1e352e33; }
dialog::backdrop { background: #18231dc4; }
dialog > :first-child, dialog form { min-width: 0; }
dialog .dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: .65rem; }
dialog p { color: var(--muted); font-size: .9rem; }
dialog .work-status { margin-top: .65rem; }
.dialog-actions { margin-top: .9rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-block: .8rem; }
.field-grid select, .field-grid input { text-overflow: ellipsis; }
.field-grid .wide { grid-column: 1 / -1; }
.field-grid .sample-value { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.editor-line { min-inline-size: 0; margin: .5rem 0 .75rem; border: 1px solid var(--edge); border-radius: .5rem; }
.editor-line legend { padding-inline: .25rem; font-weight: 700; }
#proof-dialog { width: min(700px, calc(100% - 1.3rem)); }
#proof-dialog canvas { width: min(100%, 495px); }
#print-target { display: none; }
@media (max-width: 1100px) and (min-width: 901px) {
  .workbench { grid-template-columns: minmax(205px, 225px) minmax(0, 1fr); }
  .pick-table :is(th, td) { padding-inline: .35rem; }
  .pick-table :is(th, td):nth-child(5) { width: 27%; }
}
@media (max-width: 900px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .batch-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-input, .rail-status { grid-column: 1 / -1; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
}
@media (max-width: 580px) {
  .overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview > .overview-source { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .65rem; border-bottom: 1px solid #628278; }
  .overview > .overview-source + .stat { border-left: 0; }
  .overview-source strong { font-size: .96rem; }
  .stat strong { font-size: 1.25rem; }
  .batch-input { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-input :is(h2, p, a) { grid-column: 1 / -1; }
  .saved-settings summary { padding-inline: .6rem; font-size: .88rem; }
  .settings { margin-inline: .6rem; }
  table, tbody, tr, td { display: block; }
  colgroup { display: none; }
  thead { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
  tbody { display: grid; gap: .55rem; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--edge); border-radius: .5rem; overflow: hidden; }
  tbody td, .order-table td:nth-child(n), .pick-table td:nth-child(n) { width: auto; border: 0; padding: .45rem .55rem; }
  tbody td::before { content: attr(data-label); display: block; font-size: .73rem; color: var(--muted); }
  .order-table td:last-child::before { content: none; }
  tbody td:nth-child(1), tbody td:nth-child(2) { border-bottom: 1px solid var(--edge); }
  .pick-table :is(td:nth-child(5), td:nth-child(6)) { grid-column: 1 / -1; border-top: 1px solid var(--edge); }
  .pick-cell input { max-width: 7rem; }
  .order-table td:last-child { grid-column: 1 / -1; border-top: 1px solid var(--edge); }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  :root, body { background: #fff !important; }
  body > :not(#print-target) { display: none !important; }
  #print-target { display: block; }
  .print-sheet { position: relative; break-after: page; overflow: hidden; white-space: pre; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet > * { position: absolute; display: block; margin: 0; }
}
