:root {
  --bg: #f6f5f2; --card: #ffffff; --text: #1b1b1b; --muted: #6d6d6d; --line: #e6e3dc;
  --accent: #1f6feb; --ok: #1a7f37; --warn: #9a6700; --bad: #cf222e; --info: #0969da; --violet: #8250df;
  --ok-bg: #dafbe1; --warn-bg: #fff8c5; --bad-bg: #ffebe9; --info-bg: #ddf4ff; --violet-bg: #fbefff; --gray-bg: #eeece7;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212; --card: #1e1e1e; --text: #ececec; --muted: #9a9a9a; --line: #2e2e2e;
    --accent: #58a6ff; --ok: #3fb950; --warn: #d29922; --bad: #f85149; --info: #58a6ff; --violet: #bc8cff;
    --ok-bg: #12261a; --warn-bg: #2b2111; --bad-bg: #2d1416; --info-bg: #0d2238; --violet-bg: #251a33; --gray-bg: #2a2a2a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 48px 0; }
.small { font-size: 13px; }

header.top { display: flex; align-items: center; gap: 8px; padding: 14px 0 10px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
header.top h1 { font-size: 28px; margin: 0; flex: 1; letter-spacing: -0.02em; }
.icon-btn { border: 0; background: var(--card); border-radius: 999px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 18px; box-shadow: 0 0 0 1px var(--line); }
.icon-btn:active { transform: scale(0.96); }
.back { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 14px 0 6px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chip { border: 0; background: var(--card); box-shadow: 0 0 0 1px var(--line); border-radius: 999px; padding: 7px 14px; font-size: 15px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }

.list { display: grid; gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 0 0 1px var(--line); display: block; width: 100%; text-align: left; border: 0; }
.card:active { transform: scale(0.99); }
.row { display: flex; align-items: center; gap: 8px; }
.row .grow { flex: 1; min-width: 0; }
.store { font-weight: 650; font-size: 17px; }
.items { color: var(--muted); font-size: 14px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.away { color: var(--warn); font-weight: 600; }
.total { font-variant-numeric: tabular-nums; font-weight: 600; }

.badge { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.b-ordered { background: var(--gray-bg); color: var(--muted); }
.b-shipped { background: var(--info-bg); color: var(--info); }
.b-out_for_delivery { background: var(--violet-bg); color: var(--violet); }
.b-delivered { background: var(--ok-bg); color: var(--ok); }
.b-cancelled { background: var(--bad-bg); color: var(--bad); }

.section { background: var(--card); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: 14px; margin-top: 12px; }
.section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item .qty { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.2em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); }
.timeline li.done::before { background: var(--ok); }
.timeline li.cancel .dot { background: var(--bad); border-color: var(--bad); }
.timeline li.todo { color: var(--muted); }
.timeline .when { font-size: 13px; color: var(--muted); }

.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font-size: 17px; font-weight: 600; background: var(--accent); color: #fff; margin-top: 12px; }
.btn.secondary { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); font-weight: 500; }
.btn:disabled { opacity: 0.6; }
.hero { text-align: center; padding: 18vh 8px 0; }
.hero h1 { font-size: 30px; margin: 12px 0 4px; }
.hero .logo { font-size: 56px; }
.note { font-size: 14px; color: var(--muted); margin-top: 10px; }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
