[hidden] { display: none !important; }
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #5f6672;
  --line: #dfe2e7;
  --band: #23305e;
  --accent: #2f4bd8;
  --accent-ink: #ffffff;
  --accent-soft: #e4e9ff;
  --good: #2f7a52;
  --good-soft: #e1f0e7;
  --note: #fff6d9;
  --note-line: #edd98f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30,42,47,.06), 0 8px 24px rgba(30,42,47,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; }

.owner-bar {
  background: #111; color: #fff; font-size: .9rem;
  display: flex; gap: 16px; justify-content: center; align-items: center;
  padding: 10px 16px; flex-wrap: wrap; text-align: center;
}
.owner-bar a { color: #ffd9a8; }

.hero { padding: 56px 0 44px; background: var(--band); color: #fff; margin-bottom: 26px; }
.hero .intro { color: #cfd6f3; }
.eyebrow {
  font-size: .9rem;
  font-weight: 600; color: #9fb0ff; margin: 0 0 8px;
}
h1, h2, h3 { font-family: "Archivo", Inter, system-ui, sans-serif; font-weight: 800; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.05; text-wrap: balance; }
.intro { max-width: 620px; font-size: 1.08rem; color: var(--muted); margin: 14px 0 0; }

.controls {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 14px 0 22px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 80%, rgba(243,244,246,0));
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .92rem;
  font-weight: 500; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { opacity: .6; margin-left: 4px; font-weight: 400; }
.chip:disabled { opacity: .4; cursor: default; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.sort select {
  font: inherit; color: var(--ink); padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
}

.grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  border: 1px solid rgba(0,0,0,.03);
}
.card.claimed { opacity: .72; }
.card .img {
  aspect-ratio: 1 / 1; background: #fff; display: grid; place-items: center;
  padding: 22px; border-bottom: 1px solid #f1ece3;
}
.card .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .img .ph { font-size: 3rem; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.store { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); font-weight: 500; }
.store img { width: 18px; height: 18px; border-radius: 4px; }
.card h3 { font-size: 1.12rem; line-height: 1.25; }
.desc { margin: 0; font-size: .93rem; color: var(--muted); }
.note {
  background: var(--note); border: 1px solid var(--note-line); border-radius: 10px;
  padding: 10px 12px; font-size: .88rem; margin: 0;
}
.note b { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; color: #8a6d12; }
.price { font-family: "Archivo", Inter, sans-serif; font-size: 1.45rem; font-weight: 800; margin-top: auto; white-space: nowrap; }
.price small { font-family: Inter, sans-serif; font-size: .78rem; font-weight: 400; color: var(--muted); }

.btn {
  font: inherit; font-weight: 600; font-size: .93rem; border-radius: 10px;
  padding: 11px 14px; cursor: pointer; text-align: center; text-decoration: none;
  border: 1px solid transparent; transition: .15s; display: inline-block; min-height: 44px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.good { background: var(--good-soft); color: var(--good); border-color: #bfdcca; }
.btn:disabled { opacity: .6; cursor: wait; }

.badge {
  position: absolute; top: 12px; left: 12px; font-size: .75rem; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good);
  border: 1px solid #bfdcca;
}
.badge.bought { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty { text-align: center; padding: 50px 0; color: var(--muted); }

.mine { margin: 56px 0 0; padding: 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.mine h2 { font-size: 1.3rem; }
.mine-list { display: grid; gap: 10px; margin-top: 12px; }
.mine-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.mine-row img { width: 48px; height: 48px; object-fit: contain; }
.mine-row .t { flex: 1; font-weight: 500; }

.footer { padding: 48px 20px 60px; text-align: center; font-size: .9rem; }
.footer a { color: var(--accent); }

.dialog {
  border: none; border-radius: var(--radius); padding: 26px; width: min(420px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink);
}
.dialog::backdrop { background: rgba(30,42,47,.45); }
.dialog h3 { font-size: 1.5rem; }
.dialog label { display: block; font-weight: 600; font-size: .9rem; margin: 16px 0 6px; }
.dialog input {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
}
.dialog input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.error { color: var(--accent); font-size: .9rem; margin: 8px 0 0; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: .92rem; box-shadow: var(--shadow); z-index: 50; max-width: 92vw;
}

@media (max-width: 640px) {
  .hero { padding: 36px 0 18px; }
  .controls { position: static; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card .img { aspect-ratio: 16 / 10; padding: 16px; }
  .chip { padding: 8px 12px; }
}


/* Store button: wears the store's own brand color */
.store-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.store-btn svg { width: 15px; height: 15px; transition: transform .15s; }
.store-btn:hover { filter: brightness(1.06); }
.store-btn:hover svg { transform: translate(2px, -2px); }

/* Shopping tools: one quiet segmented bar */
.deals-wrap { display: grid; gap: 5px; }
.deals-label { font-size: .72rem; font-weight: 500; color: var(--muted); text-align: center; }
.deals { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7f8fa; }
.pill {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; padding: 4px 6px; font-size: .78rem; font-weight: 500; white-space: nowrap;
  color: var(--muted); text-decoration: none; transition: .15s;
}
.pill + .pill { border-left: 1px solid var(--line); }
.pill svg { width: 14px; height: 14px; flex: none; }
.pill:hover { color: var(--ink); background: #fff; }

/* "I bought this": its own strip at the bottom of the card */
.foot { border-top: 1px dashed var(--line); padding: 10px 12px 12px; background: #fafbfc; }
.foot-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  color: var(--accent); background: var(--accent-soft); border: 1px solid #c9d3ff; border-radius: 10px;
  transition: .15s;
}
.foot-btn svg { width: 17px; height: 17px; }
.foot-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.foot-btn[data-reset] { color: var(--ink); background: #fff; border-color: var(--line); }
