:root {
  --ink: #32342d; --muted: #77796f; --bg: #f8f5ef; --card: #fff; --line: #deded2;
  --orange: #ed522e; --green: #59694c; --soft: #eeeee3;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
#app { max-width: 860px; margin: auto; padding: 0 16px 60px; }
header { display: flex; align-items: center; gap: 8px; padding: 18px 0 12px; border-bottom: 1px solid var(--line); }
.brand { margin-right: auto; color: var(--orange); font: italic 34px Georgia, serif; line-height: 1; }
.brand small { display: block; font: 600 11px system-ui, sans-serif; letter-spacing: 2px; color: var(--muted); margin-top: 6px; }
button, input { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
button { cursor: pointer; min-height: 44px; }
button:disabled { opacity: .5; cursor: wait; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
button.big { width: 100%; min-height: 56px; font-size: 17px; margin-top: 16px; }
.demo { background: #fff3d6; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 12px 0 0; }
nav { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0 4px; }
nav button { flex-shrink: 0; border: 0; background: transparent; color: var(--muted); font-weight: 650; }
nav button.active { background: #e7e4d8; color: var(--ink); }
.msg { padding: 12px 14px; border-radius: 10px; background: #e8eedc; margin: 12px 0; }
.msg.error { background: #ffe8e2; color: #982e1b; }
.intro { line-height: 1.6; color: #55574d; }
.muted, small { color: var(--muted); }
small.block, .item-name small { display: block; font-size: 12px; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chips button { border-radius: 30px; padding: 9px 18px; color: var(--green); background: transparent; }
.chips button.active { background: var(--green); color: #fff; border-color: var(--green); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 14px; font-size: 14px; }
.notice { background: #fff3d6; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 16px 0; }
.panel h2 { font-size: 17px; margin: 0 0 10px; }
.narrow { max-width: 380px; margin: 40px auto; display: grid; gap: 14px; }
label { display: grid; gap: 6px; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: 20px; height: 20px; }
.staff { max-width: 320px; margin-bottom: 12px; }
.items { display: grid; gap: 8px; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.item-name { font-weight: 600; }
.qty { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qty input { width: 96px; font-size: 20px; text-align: right; }
.qty em { font-style: normal; color: var(--muted); min-width: 30px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.num { text-align: right; }
td input { width: 90px; text-align: right; }
.table-scroll { overflow-x: auto; }
.label { margin: 18px 0 6px; font-weight: 600; }
.days { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
td { word-break: keep-all; }
.actions button, .badge { white-space: nowrap; }
.badge { display: inline-block; border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: #ffe8e2; color: #982e1b; }
.badge.Sent { background: #fff3d6; color: #7a5600; }
.badge.Delivered { background: #e8eedc; color: var(--green); }
.actions { white-space: nowrap; }
.actions button { min-height: 38px; padding: 6px 10px; margin: 2px; }
.deliver { display: inline-flex; gap: 4px; align-items: center; }
.deliver input { width: 70px; padding: 6px; }
.in { color: var(--green); }
.out { color: #8a4b2e; }
.warn { color: #b33427; font-weight: 700; }
.empty { padding: 24px; background: var(--soft); border-radius: 12px; }
a { color: var(--orange); }
@media (max-width: 560px) {
  .brand { font-size: 28px; }
  .qty input { width: 80px; }
  td, th { padding: 8px 5px; }
  .actions { white-space: normal; }
  .actions, .deliver { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
}

/* ---- Store colours, boxes, big numbers ---- */
.store-chip { border-color: var(--c0) !important; color: var(--ink) !important; background: var(--c2) !important; font-weight: 600; }
.store-chip.active { background: var(--c0) !important; border-color: var(--c0) !important; box-shadow: 0 2px 0 #0002; }
.store-card { background: var(--c2); border: 2px solid var(--c0); border-radius: 16px; margin: 14px 0; overflow: hidden; }
.store-card-head { background: var(--c0); padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.store-card-head h2 { margin: 0; font-size: 20px; }
.store-card-head span { font-size: 14px; }
.store-card .hint, .store-card .notice { margin: 12px 16px; }
.hint { color: #55574d; font-size: 14px; line-height: 1.6; }
.store-card form { padding: 0 16px 0; }
.store-card .items { gap: 0; border: 1px solid var(--c1); border-radius: 12px; overflow: hidden; background: #fff; }
.store-card .item-row { border: 0; border-bottom: 1px solid var(--c1); border-radius: 0; }
.store-card .item-row:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.stepper input { width: 76px; font-size: 22px; text-align: center; font-weight: 700; padding: 8px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.step { width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 24px; font-weight: 700; border-radius: 50%; background: var(--c1); border-color: var(--c0); }
.stepper em { font-style: normal; color: var(--muted); min-width: 28px; font-size: 14px; }
.sticky-save { position: sticky; bottom: 0; padding: 10px 0 14px; background: linear-gradient(transparent, var(--c2) 30%); }
.ship-list { background: #fff; margin: 12px 16px; border: 1px solid var(--c1, var(--line)); border-radius: 12px; overflow: hidden; }
.ship-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--c1, var(--line)); }
.ship-row:last-child { border-bottom: 0; }
.ship-row .ship-action { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.ship-row.Sent { background: #fffbea; }
.ship-row.Delivered { background: #f1f6ec; }
.ship-row.Delivered .qty-big { color: var(--muted); text-decoration: line-through; }
.qty-big { font-size: 22px; font-weight: 800; text-align: right; white-space: nowrap; }
.qty-big small { font-size: 13px; font-weight: 500; }
.ship-btn { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; min-width: 110px; font-size: 16px; }
.all-btn { display: block; width: calc(100% - 32px); margin: 0 16px 16px; min-height: 52px; font-size: 16px; }
.total-card { background: #3e4b33; color: #fff; border-radius: 16px; margin: 14px 0; overflow: hidden; }
.total-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; padding: 14px 16px 0; }
.total-head h2 { margin: 0; font-size: 20px; }
.total-card .ship-list { color: var(--ink); }
.day-chips button { color: var(--ink); }
.day-chips button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.date-pick { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.progress { background: #fff9; border-radius: 20px; padding: 3px 10px; font-weight: 600; }
@media (min-width: 760px) { .store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 14px; align-items: start; } }
.store-card .item-row { flex-wrap: wrap; }
.order-line { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #f4f4ee; }
.order-line.has-order { background: var(--c2); outline: 2px solid var(--c0); }
.order-line.manual { outline: 2px dashed var(--orange); }
.order-label { font-weight: 700; font-size: 14px; }
.order-step { display: inline-flex; align-items: center; gap: 8px; }
.order-step b { font-size: 20px; min-width: 70px; text-align: center; }
.order-step small { color: var(--muted); }
.order-step button { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; font-size: 20px; font-weight: 700; }
.order-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.adj { color: var(--orange); font-weight: 700; }
/* iPhone zooms into inputs smaller than 16px; keep every field at 16px+ so the screen never jumps while typing. */
input, select, textarea { font-size: max(16px, 1em); }
.date-pick input { font-size: 16px; }
