:root {
  --green: #00704a;
  --deep: #044832;
  --ink: #063526;
  --gold: #8e6d26;
  --gold-btn: #c6a04a;
  --paper: #eef3ef;
  --text: #14241c;
  --muted: #3d4a42;
  --line: #d5ddd8;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--ink);
  color: var(--text);
}
button, input, a { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.stage { min-height: 100dvh; }
.phone {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.stage.green .phone { background: var(--ink); color: white; }
@media (min-width: 760px) {
  .stage { padding: 24px 16px; }
  .phone {
    min-height: calc(100dvh - 48px);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  }
}
.stage.wide .phone { width: min(960px, 100%); }

.pad { padding: 20px 20px 32px; display: flex; flex-direction: column; flex: 1; }
.brand-plate { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.brand-plate img { width: 100%; height: auto; }
.brand-plate .tag { padding: 0 12px 12px; }
.stripes { height: 6px; background: var(--green); }
.stripes + .stripes { height: 8px; background: var(--gold); }
.kicker { margin: 16px 0 0; text-align: center; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: #e7c56a; }

label.field { display: block; margin-top: 20px; font-size: 13px; font-weight: 800; letter-spacing: .16em; color: rgba(255,255,255,.8); }
input.text, input.pin {
  width: 100%;
  margin-top: 8px;
  height: 56px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  background: white;
}
input.pin { letter-spacing: .3em; }
.gold, .green-btn, .deep-btn, .slate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
}
.gold { background: var(--gold-btn); color: #1c1608; }
.green-btn { background: var(--green); color: white; }
.deep-btn { background: var(--deep); color: white; }
.slate-btn { background: #5e6963; color: white; }
.gold:disabled, .green-btn:disabled { opacity: .65; }
.help { display: block; margin-top: 18px; text-align: center; color: white; font-weight: 650; text-decoration: none; }
.fine { margin-top: auto; padding-top: 36px; text-align: center; color: rgba(255,255,255,.72); font-size: 14px; }
.fine .dim { color: rgba(255,255,255,.5); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.fine a { color: #e7c56a; font-weight: 700; }

.alert { margin-top: 14px; background: #fff1f0; color: #8a1c14; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.note { margin-top: 14px; background: #fff8e6; color: #5c4710; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }

header.bar { background: var(--deep); color: white; padding: max(16px, env(safe-area-inset-top)) 16px 20px; }
.word { display: inline-flex; background: white; border-radius: 6px; padding: 4px 8px; }
.word img { height: 32px; width: auto; }
header.bar h1 { margin: 16px 0 0; font-size: 1.7rem; line-height: 1.15; }
.sub { margin: 6px 0 0; color: #e7c56a; font-weight: 700; }
.back { color: white; text-decoration: none; font-size: 18px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.toprow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.list { padding: 12px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card {
  display: block;
  background: white;
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card.hot { border-color: var(--gold-btn); background: #fff8e6; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge, .chip { display: inline-flex; align-items: center; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.badge.pickup { background: var(--deep); color: white; }
.badge.delivery { background: var(--green); color: white; }
.badge.new { background: #b42318; color: white; }
.chip { border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.chip.pending { background: #e4e8e4; color: var(--muted); }
.chip.arrived { background: #f3e2b0; color: #5c4710; }
.chip.picked_up, .chip.delivered, .chip.green { background: var(--green); color: white; }
.chip.muted { background: #e4e8e4; color: var(--muted); }
.chip.gold { background: #f3e2b0; color: #5c4710; }
.card h2 { margin: 8px 0 0; font-size: 20px; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.banner { display: flex; background: white; color: #1c1608; border-radius: 16px; overflow: hidden; }
.banner i { width: 6px; background: var(--gold-btn); }
.banner div { padding: 12px; flex: 1; }
.banner button { border: 0; background: transparent; color: #6b5a32; font-size: 24px; padding: 0 12px; }
.warn { border: 1px solid var(--gold-btn); background: #fff8e6; color: #5c4710; border-radius: 16px; padding: 12px; font-weight: 700; font-size: 14px; }
.ghost { margin: 8px auto 16px; background: none; border: 0; color: var(--muted); font-weight: 700; min-height: 48px; }
.skel { height: 96px; border-radius: 16px; background: white; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.section h3, .k { margin: 0; font-size: 12px; letter-spacing: .14em; color: #66736c; }
.addr { margin: 6px 0 0; font-size: 18px; font-weight: 800; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions a, .actions button { flex: 1; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 4px; }
.grid b { display: block; margin-top: 2px; font-size: 16px; }
.stamp { min-height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: .04em; }
.stamp.wait { background: #d7e0da; color: #2c3b34; }
.stamp.done { background: var(--green); color: white; }
.center { text-align: center; }
.pages { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.page-thumb, .add-page {
  width: 72px; height: 112px; border-radius: 8px; flex: 0 0 auto; position: relative; overflow: hidden;
}
.page-thumb { border: 1px solid var(--line); background: white; }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }
.add-page { border: 2px dashed var(--deep); background: white; color: var(--deep); font-size: 11px; font-weight: 800; }
.page-thumb button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border: 0; border-radius: 99px; background: rgba(255,255,255,.92); }
.checkline { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 800; }
.switch { width: 48px; height: 28px; }

.board { display: grid; gap: 12px; }
@media (min-width: 760px) { .board { grid-template-columns: 1.2fr .8fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: .08em; color: #66736c; }
.podlink { color: var(--green); font-weight: 800; background: none; border: 0; padding: 0; }

/* Collapsed completed stops */
details.done-stop { padding: 10px 14px; opacity: .85; }
details.done-stop[open] { opacity: 1; }
.done-row { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.done-row::-webkit-details-marker { display: none; }
.done-seq { font-weight: 800; min-width: 1.6em; text-align: center; }
.done-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-name small { display: block; font-weight: 400; opacity: .7; }
details.done-stop .card.inner { margin: 10px 0 0; box-shadow: none; border: 0; padding: 8px 0 0; display: block; }
