:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1b1c1a;
  --muted: #6b6f68;
  --line: #e2e5df;
  --accent: #2e7d32;
  --accent-soft: #e6f2e6;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --radius: 14px;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14160f;
    --surface: #1e211a;
    --text: #e9ece4;
    --muted: #9aa094;
    --line: #2e332a;
    --accent: #7cc47f;
    --accent-soft: #24331f;
    --warn: #e0a856;
    --warn-soft: #33290f;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Sticky header ─────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}

.bar-top { display: flex; gap: 8px; align-items: center; }

#shop-select {
  flex: 1;
  min-height: var(--tap);
  padding: 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-btn:active { background: var(--accent-soft); }
.icon-btn.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.progress { font-variant-numeric: tabular-nums; }

.hide-toggle { display: flex; align-items: center; gap: 5px; }
.hide-toggle input { width: 17px; height: 17px; accent-color: var(--accent); }

.status { margin-left: auto; font-weight: 600; }
.status.offline { color: var(--warn); }
.status.pending { color: var(--warn); }
.status.synced  { color: var(--accent); }

/* ── List ──────────────────────────────────────────────────── */

.list { padding: 10px 12px 28px; }

.section-title {
  margin: 18px 2px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title:first-child { margin-top: 4px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  margin-bottom: 8px;
  padding: 10px 14px;
  font-size: 17px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.row:active { transform: scale(0.99); }

.row .box {
  flex: 0 0 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 7px;
}

.row.done {
  color: var(--muted);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.row.done .label { text-decoration: line-through; }

.row.done .box {
  position: relative;
  background: var(--accent);
  border-color: var(--accent);
}

.row.done .box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.label { flex: 1; }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty button { margin-top: 14px; }

.btn {
  min-height: var(--tap);
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ── Toast + footer ────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  font-size: 14px;
  color: #fff;
  background: #2b2f28;
  border-radius: 12px;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--warn); }

.foot {
  padding: 0 14px 24px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
