:root {
  --ink: #1f1a17;
  --muted: #6b625c;
  --line: #e4ddd6;
  --bg: #f7f4f1;
  --card: #ffffff;
  --accent: #9b2c22;
  --accent-ink: #ffffff;
  --ok: #2f6b3a;
  --warn: #9a6a00;
  --chip: #f1ebe5;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2ede8; --muted: #b4aaa2; --line: #3a332e; --bg: #171311;
    --card: #221c19; --accent: #d0554a; --chip: #2d2622;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 16px calc(10px); padding-top: max(14px, env(safe-area-inset-top));
  background: var(--ink); color: var(--bg);
}
@media (prefers-color-scheme: dark) { .top { background: #000; color: var(--ink); } }
.brand { font-weight: 700; letter-spacing: .05em; }
.shop { font-size: 15px; opacity: .85; text-align: right; }
.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1; padding: 12px; border: 0; background: none; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0;
}
.error { border-color: var(--accent); color: var(--accent); font-weight: 600; }
h2 { font-size: 17px; margin: 0 0 6px; }
h3.section {
  font-size: 14px; color: var(--muted); margin: 18px 4px 6px; letter-spacing: .08em;
}
.hint { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.date {
  flex: 0 0 auto; min-width: 84px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--chip); font-weight: 600; text-align: center;
}
.date small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.date[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date[aria-checked="true"] small { color: var(--accent-ink); opacity: .85; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px 10px 16px; border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item.has-qty { background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.name { font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--chip); font-size: 22px; line-height: 1; touch-action: manipulation;
}
.stepper input {
  width: 58px; height: 44px; text-align: center; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 18px; font-weight: 700;
}
.unit { width: 3em; font-size: 14px; color: var(--muted); }
.extra { display: grid; grid-template-columns: 1fr 70px 64px 40px; gap: 6px; margin-bottom: 8px; }
.extra input, .field input, .field textarea {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.extra .x { border: 0; background: none; font-size: 22px; color: var(--muted); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.ghost {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  font-size: 15px;
}
.primary {
  padding: 12px 22px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 17px;
}
.primary:disabled { opacity: .4; }
.spacer { height: 90px; }
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
}
.summary { font-weight: 600; }
dialog { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.sheet { padding: 18px; max-height: 85vh; overflow: auto; }
.sheet table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 15px; }
.sheet td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.sheet td.q { text-align: right; white-space: nowrap; font-weight: 700; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.big { font-size: 24px; font-weight: 700; letter-spacing: .04em; margin: 6px 0; }
.order-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.badge { font-size: 13px; padding: 2px 10px; border-radius: 99px; background: var(--chip); font-weight: 700; white-space: nowrap; }
.badge.received { color: var(--warn); }
.badge.preparing { color: var(--accent); }
.badge.shipped { color: var(--ok); }
.badge.cancelled { color: var(--muted); text-decoration: line-through; }
.order-card ul { margin: 8px 0; padding-left: 1.2em; font-size: 15px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
