@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&family=Inter:wght@400;600;700&display=swap");
:root {
  --navy: #1f3a5f;
  --teal: #0E7C72;
  --gold: #F2B632;
  --coral: #E0604E;
  --cream: #FBF6EE;
  --sand: #F4EDE1;
  --ink: #23303f;
  --muted: #5f6b7a;
  --white: #ffffff;
  --line: #e6dccd;
  --tile: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(31, 58, 95, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--teal); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
h1 { margin: 0; }
h2 { margin: 0; }
p { margin: 0; }

/* ---------- Top bar (inner pages) ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  font-size: 1.05rem;
}
.back {
  font-size: 0.9rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Logo ---------- */

.logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.logo-mark,
.logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.mini-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  padding: 3px;
  flex: none;
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff;
  text-align: center;
  padding: 44px 20px 64px;
}
.brand-row { display: flex; justify-content: center; margin-bottom: 18px; position: relative; }
.hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
}
.hero p {
  max-width: 460px;
  margin: 0 auto 24px;
  opacity: 0.93;
  font-size: 1.02rem;
  position: relative;
}

/* ---------- Layout ---------- */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 8px;
  display: grid;
  gap: 22px;
}

.section-title {
  font-size: 1.3rem;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ---------- Category tiles ---------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.cat {
  background: var(--tile, var(--white));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 10px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  display: grid;
  gap: 12px;
  justify-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cat:hover,
.cat:focus-visible {
  border-color: var(--teal);
  transform: translateY(-2px);
  outline: none;
}
.cat-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--teal);
  display: grid;
  place-items: center;
}
.cat-icon svg { width: 34px; height: 34px; }
.cat-photo {
  display: block;
  width: 100%;
  height: 96px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
}
.cat-name { font-weight: 700; color: var(--navy); font-size: 1rem; }

/* ---------- Panels ---------- */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel > h2 { font-size: 1.25rem; margin-bottom: 14px; }
.panel h3 { margin: 20px 0 10px; font-size: 1rem; }

.partner {
  background: linear-gradient(135deg, var(--sand), #fff);
  text-align: left;
}
.partner p { color: var(--ink); margin-bottom: 14px; }

/* How it works: three steps */

.steps {
  display: grid;
  gap: 12px;
}
.step {
  display: grid;
  gap: 8px;
  justify-items: start;
  background: var(--cream);
  border-radius: 12px;
  padding: 14px;
}
.step span {
  background: var(--gold);
  color: var(--navy);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.step p { color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 22px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 16px rgba(201, 100, 63, 0.25);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: translateY(1px); }
.btn-alt { background: var(--teal); box-shadow: 0 6px 16px rgba(42, 127, 122, 0.25); }
.btn-big { width: 100%; padding: 15px; }
.link {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 10px;
  font-size: 0.95rem;
  padding: 0;
}

/* ---------- Category and shop pages ---------- */

.store-head { padding: 4px 0 0; display: grid; gap: 8px; }
.store-head h1 { font-size: clamp(1.6rem, 5vw, 2rem); }
.lead { color: var(--muted); }
.chip {
  display: inline-block;
  justify-self: start;
  background: var(--sand);
  color: var(--navy);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.cat-banner { margin: 0; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.cat-banner img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cat-banner span {
  display: block;
  text-align: center;
  padding: 28px 12px;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  color: var(--muted);
}

.store-grid { display: grid; gap: 14px; }
.store-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 10px;
  justify-items: start;
  box-shadow: var(--shadow);
}
.store-card h3 { margin: 0; font-size: 1.1rem; }
.store-card p { color: var(--muted); }
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.rule {
  background: var(--sand);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--navy);
  margin-bottom: 16px;
}

/* ---------- Wheel ---------- */

.wheel-wrap {
  position: relative;
  width: min(280px, 80vw);
  margin: 8px auto 18px;
}
.wheel-wrap svg { width: 100%; height: auto; display: block; }
.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--gold);
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.prize-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}
.prize-list li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  background: var(--cream);
  border-radius: 12px;
  padding: 11px 14px;
}
.prize-list strong { color: var(--navy); }
.prize-list span { color: var(--muted); font-size: 0.9rem; }

.draw-title { font-weight: 800; color: var(--navy); font-size: 1.08rem; margin-bottom: 4px; }
.muted { color: var(--muted); margin: 0 0 16px; }

.empty {
  color: var(--muted);
  background: var(--sand);
  border-radius: 12px;
  padding: 16px;
  margin: 0;
}

.msg {
  font-size: 0.92rem;
  color: var(--muted);
  min-height: 1.2em;
  margin-top: 10px;
}

/* ---------- Sign-in pop-up ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 58, 95, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal-card h2 { margin-bottom: 14px; font-size: 1.3rem; }
.reasons {
  padding-left: 18px;
  margin: 0 0 18px;
  display: grid;
  gap: 8px;
}

/* ---------- Footer ---------- */

footer {
  background: var(--navy);
  color: #dfe7ef;
  padding: 30px 18px 40px;
  margin-top: 30px;
}
.foot-inner {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}
.foot-brand strong { color: #fff; font-size: 1.1rem; }
.foot-brand p { margin-top: 4px; opacity: 0.85; }
.foot-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.foot-cols h4 { margin: 0 0 8px; color: var(--gold); font-size: 0.95rem; }
.foot-cols a {
  display: block;
  color: #dfe7ef;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.fine { font-size: 0.8rem; opacity: 0.8; }

/* ---------- Wider screens ---------- */

@media (min-width: 600px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-cols { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 56px 20px 76px; }
}

/* Shops: cover, logo and address */
.store-cover { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; margin-bottom: 14px; }
.store-cover[hidden], .store-map[hidden], .store-directions[hidden] { display: none; }
.store-directions { display: inline-block; margin-top: 10px; }
.store-address { margin: 6px 0 0; color: var(--muted); }
.store-map { display: inline-block; margin-top: 6px; color: var(--teal); font-weight: 700; }
.avatar-img { background: #fff; padding: 0; overflow: hidden; }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Spins, draws and profile */
.spin-result { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--sand); }
.spin-result p { margin: 6px 0 0; }
.spin-result .code, .coupon-card .code { font-family: ui-monospace, monospace; font-size: 1.15rem; letter-spacing: 0.08em; background: #fff; padding: 2px 8px; border-radius: 8px; }
.won { font-weight: 700; }
.draw-form { display: grid; gap: 10px; margin-top: 12px; }
.coupon-list { display: grid; gap: 10px; }
.coupon-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 4px; }
#spin-btn:disabled, #draw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
[hidden] { display: none !important; }

/* Owner form, broker account */
.prize-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; margin-bottom: 10px; background: #fff; }
.prize-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.prize-nums label { font-size: 0.8rem; }
.code-big { font-family: ui-monospace, monospace; font-size: 1.8rem; font-weight: 800; letter-spacing: 0.12em; color: var(--navy); margin: 4px 0 8px; }
#owner-add summary { cursor: pointer; display: inline-block; }
#owner-form[hidden] { display: none; }
.draw-form, .prize-row, .prize-nums { min-width: 0; }
.draw-form label, .prize-row label, .prize-nums label { min-width: 0; }
.draw-form input, .draw-form select, .draw-form textarea,
.prize-row input, .prize-nums input, .prize-row select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.prize-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#owner-add summary { display: block; text-align: center; }

/* Top menu on every page */
.topnav { display: flex; gap: 4px; align-items: center; padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.topnav a, .topnav-auth { color: var(--navy); text-decoration: none; font-weight: 700; font-size: 0.9rem; padding: 8px 10px; border-radius: 10px; flex: 0 0 auto; }
.topnav a[aria-current="page"] { background: var(--sand); }
.topnav a:hover, .topnav-auth:hover { background: var(--sand); }
.topnav-auth { margin-left: auto; border: 0; background: var(--coral); color: #fff; cursor: pointer; font-family: inherit; }
.topnav-auth:hover { background: var(--coral); opacity: 0.9; }

/* Home page: compact hero (short banner, not a tall block) and warmer category cards */
[data-page="home"] .hero { position: relative; overflow: hidden; isolation: isolate; margin: 14px 14px 0; padding: 26px clamp(20px, 4vw, 40px); min-height: 0; border-radius: 20px; background: linear-gradient(112deg, #1f3a5f 0%, #244c62 55%, #0E7C72 100%); color: #fff; box-shadow: 0 12px 28px rgba(31,58,95,.16); }
[data-page="home"] .hero h1 { margin: 0 0 6px; max-width: 60%; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -.04em; color: #fff; }
[data-page="home"] .hero p { margin: 0 0 16px; max-width: 420px; font-size: .95rem; line-height: 1.5; color: #e9f1ee; }
[data-page="home"] .hero #hero-btn { display: inline-block; padding: 11px 18px; border-radius: 12px; background: #F2B632; color: #1f3a5f; font-weight: 800; text-decoration: none; }
[data-page="home"] .cat-photo { height: 130px; }
[data-page="home"] #categories { margin-top: 22px; }
@media (max-width: 700px) {
  [data-page="home"] .hero { margin: 10px 10px 0; padding: 22px 20px; }
  [data-page="home"] .hero h1 { max-width: 70%; }
  [data-page="home"] .cat-photo { height: 110px; }
}
[data-page="home"] .hero { max-width: 728px; margin: 14px auto 0; text-align: left; align-items: flex-start; justify-content: center; }
[data-page="home"] .hero h1, [data-page="home"] .hero p { text-align: left; }
[data-page="home"] .hero #hero-btn { align-self: flex-start; }
@media (max-width: 700px) {
  [data-page="home"] .hero { margin: 10px 10px 0; max-width: none; }
}
/* Login sits in the top bar on every page, so it stays visible on phones */
.topbar .topnav-auth { margin-left: auto; flex: 0 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; }

/* Signed-in profile: picture, name, phone */
.me-chip { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--sand); color: var(--navy); font-weight: 700; font-size: .9rem; text-decoration: none; flex: 0 0 auto; }
.topbar .me-chip + .topnav-auth { margin-left: 0; }
.me-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; }
.me-initial { background: var(--navy); color: #fff; font-weight: 800; }
.me-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.me-card div { display: grid; min-width: 0; }
.me-card span { overflow-wrap: anywhere; }
.me-avatar-big { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: grid; place-items: center; font-size: 1.5rem; }
.me-avatar-big[hidden] { display: none; }
.auth-note { margin: 10px 14px 0; padding: 10px 14px; border-radius: 12px; background: #fdf1d6; color: #5a4310; font-size: .9rem; font-weight: 700; }
.shop-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Account pages: profile, my shops, shop editor, broker ---------- */
.acct { max-width: 728px; margin: 0 auto; padding: 0 16px 40px; min-width: 0; }
main, .acct, .acct-head, .panel { min-width: 0; max-width: 100%; }
.acct-id { overflow-wrap: anywhere; }
.acct .panel { margin-top: 14px; }
.acct-head { margin-top: 16px; padding: 18px; border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(31,58,95,.08); }
.acct-top { display: flex; align-items: center; gap: 18px; }
.acct-top .me-avatar-big { width: 84px; height: 84px; flex: 0 0 84px; }
.acct-stats { display: flex; gap: 14px; flex: 1; justify-content: space-around; text-align: center; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.2rem; color: #1f3a5f; }
.stat span { font-size: .8rem; color: #5b6b7a; }
.acct-id { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.acct-id strong { font-size: 1.05rem; width: 100%; }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #fff7dc; color: #1f3a5f; font-size: .8rem; font-weight: 700; }
.role-bio { width: 100%; margin: 4px 0 0; color: #c7d0dc; font-size: .92rem; line-height: 1.45; }
.acct-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.acct-actions .btn { flex: 1; }
.acct-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; width: 100%; border-bottom: 0; overflow: visible; }
.acct-tab { flex: 1 0 auto; padding: 12px 10px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 700; color: #5b6b7a; cursor: pointer; }
.acct-tab[aria-selected="true"] { color: #1f3a5f; border-bottom-color: #F2B632; }
.role-options { display: grid; gap: 10px; margin: 12px 0; }
.role-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid #d8e0e8; border-radius: 14px; cursor: pointer; }
.role-option input { margin-top: 4px; }
.role-option small { display: block; color: #5b6b7a; margin-top: 2px; }
.row-wrap { display: grid; gap: 6px; }
.check { display: flex; gap: 8px; align-items: center; }
.shop-preview { display: block; max-width: 220px; max-height: 140px; margin: 8px 0 14px; border-radius: 12px; object-fit: cover; }
.acct textarea { width: 100%; box-sizing: border-box; }
.acct .link.danger { color: #b3261e; }
.acct .empty { color: #5b6b7a; }
@media (max-width: 480px) {
  .acct-top { gap: 12px; }
  .acct-top .me-avatar-big { width: 68px; height: 68px; flex-basis: 68px; }
  .acct-stats { gap: 6px; }
}

/* Owner prize editor: tappable wheel and buttons */
.prize-wheel { max-width: 260px; margin: 8px auto 14px; }
.prize-svg { width: 100%; height: auto; display: block; }
.prize-svg .slice { cursor: pointer; }
.prize-svg .slice path, .prize-svg .slice circle { stroke: #fff; stroke-width: 2; }
.prize-svg .slice.sel path, .prize-svg .slice.sel circle { stroke: #F2B632; stroke-width: 5; }
.prize-svg .slice-label { fill: #fff; font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.prize-card { border: 1px solid #d8e0e8; border-radius: 16px; padding: 14px; background: #fff; display: grid; gap: 8px; }
.step-label { margin: 8px 0 0; font-weight: 700; color: #1f3a5f; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: 44px; padding: 8px 14px; border: 2px solid #d8e0e8; border-radius: 999px; background: #fff; font-weight: 700; color: #1f3a5f; cursor: pointer; }
.pick.on { background: #1f3a5f; border-color: #1f3a5f; color: #fff; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #F2B632; color: #1f3a5f; font-size: 1.4rem; font-weight: 800; cursor: pointer; }
.stepper strong { min-width: 56px; text-align: center; font-size: 1.3rem; color: #1f3a5f; }

/* Gifts page: spin and draw lists */
.gifts { max-width: 728px; margin: 0 auto; padding: 0 16px 40px; }
.gift-tabs { display: flex; gap: 8px; margin: 14px 0; }
.gift-tab { flex: 1; min-height: 46px; border: 2px solid #d8e0e8; border-radius: 12px; background: #fff; font-weight: 800; color: #1f3a5f; cursor: pointer; }
.gift-tab[aria-selected="true"] { background: #1f3a5f; border-color: #1f3a5f; color: #fff; }
.gift-list { display: grid; gap: 12px; }
.gift-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(31,58,95,.08); }
.gift-card strong { color: #1f3a5f; font-size: 1.05rem; }
.gift-card p { margin: 4px 0; color: #3d4a57; }
.gift-card .muted { font-size: .85rem; }

/* ---------- Look: cream header, serif headline, light hero ---------- */
body { font-family: "Inter", system-ui, sans-serif; background-color: #fbf5e8; }
.topbar { background: rgba(255,250,240,.94); border-bottom: 0; padding: 12px 16px; min-height: 64px; position: relative; }
.topbar .brand { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.5rem; color: var(--navy); letter-spacing: -0.01em; }
.topbar .mini-logo { width: 38px; height: 38px; }
.topnav-auth { border-radius: 999px; padding: 10px 18px; box-shadow: 0 6px 16px rgba(233,121,86,.3); }
[data-page="home"] .hero { background: linear-gradient(100deg, #fbf3df 0%, #f6e6c6 100%); color: var(--navy); box-shadow: none; border-radius: 0; margin: 0; }
[data-page="home"] .hero h1 { font-family: "Fraunces", Georgia, serif; color: var(--navy); font-weight: 700; font-size: clamp(2.2rem, 7vw, 3.2rem); max-width: 80%; }
[data-page="home"] .hero p { color: #3d4a57; font-size: 1.05rem; }
[data-page="home"] .hero #hero-btn { background: var(--coral); color: #fff; border-radius: 999px; padding: 16px 26px; font-size: 1rem; box-shadow: 0 10px 22px rgba(233,121,86,.3); }
@media (min-width: 900px) {
  body { position: relative; }
  .topbar { height: 76px; padding: 0 40px; }
  .topnav { position: absolute; top: 0; left: 50%; transform: translateX(-50%); height: 76px; padding: 0; background: transparent; border: 0; z-index: 50; }
  .topnav a { font-size: 1rem; padding: 10px 14px; }
  .topnav a[aria-current="page"] { background: transparent; box-shadow: inset 0 -3px 0 #F2B632; border-radius: 0; }
  [data-page="home"] .hero { max-width: none; margin: 0; min-height: 540px; display: flex; flex-direction: column; justify-content: center; padding: 60px 8vw; }
  [data-page="home"] .hero h1 { font-size: clamp(3rem, 5vw, 4.4rem); max-width: 620px; line-height: 1.02; }
  [data-page="home"] .hero p { max-width: 520px; font-size: 1.2rem; }
  [data-page="home"] .hero #hero-btn { align-self: flex-start; }
}

/* ---------- App feel (Instagram-style): bottom tab bar, story row, post cards ---------- */
.tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(6px); }
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: #7a8594; font-size: .72rem; font-weight: 700; border-radius: 12px; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--navy); }
.tabbar a[aria-current="page"] svg { stroke: var(--navy); stroke-width: 2.4; }
body { padding-bottom: 72px; }
body.edit-mode { padding-bottom: 210px; }
/* Desktop: the same five tabs as a centred, floating bar */
@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; bottom: 18px; width: min(560px, calc(100% - 32px)); transform: translateX(-50%); border: 1px solid var(--line); border-radius: 22px; padding: 6px 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
  .tabbar a { padding: 8px 0; font-size: .8rem; }
  .tabbar svg { width: 24px; height: 24px; }
}
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 12px 2px 6px; max-width: 728px; margin: 0 auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.stories::-webkit-scrollbar { display: none; }
.stories:empty { display: none; }
.story { flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; width: 74px; text-decoration: none; color: var(--navy); font-size: .78rem; font-weight: 700; }
.ring { width: 68px; height: 68px; border-radius: 50%; padding: 3px; background: conic-gradient(#f6cf58, #e97956, #E0604E, #56b7a7, #f6cf58); }
.ring-in { width: 100%; height: 100%; border-radius: 50%; background: #fff; border: 3px solid var(--cream); display: grid; place-items: center; overflow: hidden; font-weight: 800; color: var(--navy); font-size: 1.3rem; }
.ring-in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-name { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-card { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(31,58,95,.06); }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head strong { display: block; color: var(--navy); font-size: 1rem; }
.post-head .muted { margin: 0; font-size: .82rem; }
.post-av { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #f6cf58, #e97956); color: #fff; display: grid; place-items: center; font-weight: 800; }
.post-body p { margin: 0; color: #3d4a57; }
.gift-card .btn { justify-self: stretch; text-align: center; }
@media (max-width: 899px) {
  .topnav { display: none; }
}

/* ---------- Studio layout settings (set from the canvas) ---------- */
main { max-width: var(--page-max, 760px); }
.cat { justify-items: var(--cat-justify, center); text-align: var(--cat-text, center); }
[data-page="home"] .cat-photo { height: var(--cat-photo-h, 130px); }
.cat-grid { gap: 14px; }

/* ---------- Coupon card (picture with the offer on top) ---------- */
.coupon-art { position: relative; width: 100%; max-width: 150px; aspect-ratio: 3 / 4; container-type: inline-size; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 4px 12px rgba(31,58,95,.12); }
.coupon-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.coupon-blank { position: absolute; inset: 0; background: linear-gradient(160deg, #1f3a5f 0%, #0E7C72 100%); }
.coupon-text { position: absolute; transform: translate(-50%, -50%); width: 90%; text-align: center; font-weight: 800; line-height: 1.1; text-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.coupon-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; }
.coupon-row .coupon-art { max-width: none; }
@media (max-width: 380px) { .coupon-row { grid-template-columns: 90px minmax(0, 1fr); } }

/* ---------- Owner prize list ---------- */
.prize-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chance { color: var(--muted); font-size: .85rem; }
.prize-row .chip-row { margin-top: 4px; }

/* ---------- Home: filter bar and shop squares ---------- */
[data-page="home"] .home-browse { display: block; }
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-family: inherit; font-size: .9rem; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.shop-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .shop-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shop-tile { aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 16px rgba(31,58,95,.08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; text-decoration: none; color: var(--ink); min-width: 0; }
.st-init { width: 56px; height: 56px; border-radius: 14px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.st-name { font-weight: 800; font-size: .95rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-cat { font-size: .78rem; color: var(--muted); }

/* ---------- Header: photo clear, flush with the page, fitted to its height ---------- */
[data-page="home"] .hero { margin: 0; border-radius: 0; box-shadow: none; background-color: #fbf3df; min-height: 0; padding: 22px 20px 26px; overflow: hidden; }
@media (max-width: 899px) {
  [data-page="home"] .hero { min-height: 0 !important; height: auto; }
  [data-page="home"] .hero h1 { max-width: 85%; font-size: clamp(2rem, 9vw, 2.6rem); }
  [data-page="home"] .hero p { max-width: 80%; font-size: 1rem; }
  [data-page="home"] .hero #hero-btn { padding: 14px 22px; }
}

/* ---------- Stop the home browse area growing wider than the screen ---------- */
#categories, .home-browse, .filter-bar, .shop-tiles { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* ---------- Shop post: logo and cover photo ---------- */
.post-av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.post-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin: 4px 0 12px; }

/* ---------- Gifts page: colourful plates (spin, draws) ---------- */
.plate { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 22px; padding: 18px; margin-bottom: 14px; text-decoration: none; color: #fff; box-shadow: 0 10px 24px rgba(31,58,95,.18); overflow: hidden; }
.plate-text { display: grid; gap: 6px; }
.plate-text strong { font-family: "Fraunces", Georgia, serif; font-size: 1.5rem; line-height: 1.1; }
.plate-text span { font-size: .95rem; opacity: .95; }
.plate-btn { display: inline-block; margin-top: 6px; background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: .9rem; width: max-content; }
.plate-spin { background: linear-gradient(120deg, #ff3b5c 0%, #8e2de2 50%, #2563eb 100%); }
.plate-spin img { width: 92px; height: 92px; object-fit: contain; flex: 0 0 auto; }

/* ---------- Lucky draw plates: bright colour, gift photo on the right ---------- */
.plate-draw img { width: 92px; height: 92px; object-fit: cover; border-radius: 16px; flex: 0 0 auto; }

/* ---------- Owner: spin counter on My shops ---------- */
.spin-dash { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.spin-dash span { background: #f3f6fa; border-radius: 10px; padding: 6px 10px; font-size: .9rem; color: var(--navy); }
.spin-dash strong { color: var(--teal, #0E7C72); }

/* Compact account type options and leaderboard period buttons */
.role-chip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 6px 4px 0; padding: 8px 14px; border: 1px solid #c9d3e0; border-radius: 999px; cursor: pointer; font-weight: 600; }
.role-chip input { margin: 0; }
.role-chip:has(input:checked) { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.period-row { display: flex; gap: 8px; margin-bottom: 12px; }
.period-row .btn[aria-pressed="true"] { background: #1f3a5f; color: #fff; }

/* Compact footer: one row of links and one line of copyright */
.foot-compact { padding: 14px 16px; text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 8px; }
.foot-links a { font-size: 14px; }
.foot-compact .fine { margin: 0; font-size: 12px; }

/* Footer: light band, navy links, no underlines, so it sits quietly under the page */
footer { background: #F4EDE1; color: #5b6b7f; padding: 18px 16px 22px; margin-top: 30px; border-top: 1px solid #e3d9c6; }
footer a, .foot-links a { color: #1f3a5f; text-decoration: none; font-weight: 600; font-size: 14px; }
footer a:hover { text-decoration: underline; }
.foot-links { gap: 8px 16px; }
.foot-compact .fine { color: #5b6b7f; font-size: 12px; opacity: 1; }

/* Three-line menu in the top bar and its panel */
.menu-btn { margin-left: auto; width: 40px; height: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: transparent; border: 0; cursor: pointer; padding: 0; }
.menu-btn span { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.menu-panel { background: #F4EDE1; border-bottom: 1px solid #e3d9c6; padding: 12px 16px; }
.menu-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.menu-links a { color: #1f3a5f; text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 0; }
.menu-links a:hover { text-decoration: underline; }
footer .foot-compact { padding: 0; }
.menu-email { margin: 12px 0 0; font-size: 14px; color: #5b6b7f; user-select: all; }
.menu-email span { color: #1f3a5f; font-weight: 600; }

/* Button states (see DESIGN-RULES.md):
   - Ready: bright, full colour.
   - Not ready yet: faded, no shadow, not clickable. */
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: grayscale(0.35); transform: none; }

/* Rows: list-style actions used on the profile and menu pages */
.group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #5b6b7f; margin: 18px 4px 6px; }
.row-list { background: #fff; border: 1px solid #e6dccb; border-radius: 16px; overflow: hidden; margin: 10px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid #efe7d6; background: #fff; color: var(--navy); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row strong { display: block; font-size: 1rem; }
.row small { display: block; color: #5b6b7f; font-size: .85rem; margin-top: 2px; }
.row:hover { background: #fbf8f1; }
.chev { font-size: 1.5rem; color: #9aa6b5; line-height: 1; }

/* Browse bar: location search, My location and the category button (Home and Lucky Draw) */
.loc-bar { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 10px; }
.loc-search { position: relative; flex: 1 1 auto; min-width: 0; }
.loc-input { width: 100%; box-sizing: border-box; height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; background: #fff; color: var(--navy); }
.loc-input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.loc-me { flex: 0 0 auto; height: 46px; border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 12px; padding: 0 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.loc-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 24px rgba(31,58,95,.14); overflow: hidden; }
.loc-suggest[hidden] { display: none; }
.loc-opt { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; font: inherit; color: var(--navy); cursor: pointer; }
.loc-opt:last-child { border-bottom: 0; }
.loc-opt:hover, .loc-opt:focus { background: var(--sand); }
.loc-none { margin: 0; padding: 12px 14px; }
.scope-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.scope { margin: 0; color: #5b6b7f; font-size: .95rem; }
.cat-btn { border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.cat-sheet { position: fixed; inset: 0; background: rgba(15,30,50,.45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.cat-sheet[hidden] { display: none; }
.sheet-box { background: #fff; width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; box-sizing: border-box; }
.sheet-title { margin: 0 0 10px; font-weight: 800; color: var(--navy); }
.sheet-box button { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 13px 4px; font: inherit; color: var(--navy); cursor: pointer; }
.sheet-box button[aria-pressed="true"] { background: var(--sand); font-weight: 800; }
.empty-state { grid-column: 1 / -1; background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 18px; }
.empty-state p { margin: 0 0 8px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ============================================================
   Design pass: one system for every page.
   Serif headings for character, sans-serif text for reading,
   soft white cards on warm cream, one accent for actions.
   ============================================================ */
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f7f3ec; }
h1, h2, h3 { font-family: "Fraunces", Georgia, "Times New Roman", serif; color: var(--navy); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 5.5vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--muted); }

.topbar { background: rgba(255,255,255,.94); border-bottom: 0; box-shadow: 0 1px 0 rgba(31,58,95,.06); padding: 12px 16px; }
.topbar .brand { font-family: "Fraunces", Georgia, serif; font-weight: 700; }

main { gap: 18px; padding: 20px 16px 100px; }
.store-head { gap: 6px; padding: 6px 0 4px; }
.store-head .lead { color: var(--muted); }

/* Cards: white, soft edge, calm shadow */
.panel, .coupon-card, .stamp-row, .empty-state, .draw-form-card {
  background: #fff;
  border: 1px solid #ece3d3;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(31,58,95,.04), 0 8px 24px rgba(31,58,95,.06);
  padding: 18px;
}
.panel { display: grid; gap: 12px; }
.panel .rule { color: var(--muted); font-size: .93rem; }

/* Grouped lists (Menu, Profile rows) */
.group-title { font-family: "Inter", system-ui, sans-serif; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin: 24px 4px 8px; }
.row-list { background: #fff; border: 1px solid #ece3d3; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(31,58,95,.04), 0 8px 24px rgba(31,58,95,.06); }
.row { padding: 16px 18px; border-bottom: 1px solid #f2ebe0; }
.row:last-child { border-bottom: 0; }
.row strong { color: var(--navy); font-weight: 700; font-size: .98rem; }
.row small { color: var(--muted); }

/* Buttons: pill shapes, clear hierarchy */
.btn { border-radius: 999px; font-weight: 700; padding: 12px 20px; }
.btn-big { height: 52px; width: 100%; font-size: 1rem; }
.btn-alt { background: #fff; border: 1px solid var(--navy); color: var(--navy); }
.link { font-weight: 700; }
.link.danger { color: #b5483a; }

/* Shop tiles on Home and Lucky Draw: cover photo first, then the facts */
.shop-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shop-tile { display: flex; flex-direction: column; background: #fff; border: 1px solid #ece3d3; border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(31,58,95,.04), 0 8px 22px rgba(31,58,95,.07); transition: transform .15s ease, box-shadow .15s ease; }
.shop-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,58,95,.11); }
.shop-tile:active { transform: scale(.98); }
.st-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #F4EDE1; }
.st-cover-empty { display: grid; place-items: center; background: linear-gradient(135deg, #F4EDE1, #f6dfb8); }
.st-cover-empty .st-init { font-family: "Fraunces", Georgia, serif; font-size: 2.2rem; color: var(--navy); font-weight: 700; }
.st-body { display: grid; gap: 2px; padding: 12px 13px 13px; }
.st-name { font-weight: 700; color: var(--navy); font-size: .98rem; line-height: 1.3; }
.st-cat { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.st-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .8rem; }
.st-like { color: var(--coral); font-weight: 700; }
.st-go { background: var(--navy); color: #fff; border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: .78rem; }

/* Browse bar (Home and Lucky Draw) */
.loc-input { border-radius: 999px; padding: 0 18px; border-color: #e0d6c4; }
.loc-me { border-radius: 999px; }
.cat-btn { border-radius: 999px; }
.scope { font-size: .9rem; }
.empty-state { text-align: center; display: grid; gap: 6px; justify-items: center; }

/* Tab bar */
.tabbar { background: rgba(255,255,255,.97); border-top: 1px solid #ece3d3; box-shadow: 0 -6px 20px rgba(31,58,95,.06); }
.tabbar a { color: #8a94a3; font-weight: 600; font-size: .7rem; }
.tabbar a[aria-current="page"] { color: var(--navy); font-weight: 700; }

/* Shop page: the like button and the stamp card */
.loyal { display: grid; gap: 12px; }
.like-row { display: flex; align-items: center; gap: 12px; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e0d6c4; background: #fff; color: var(--navy); border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.like-btn .heart { width: 20px; height: 20px; fill: none; stroke: var(--coral); stroke-width: 2; }
.like-btn.is-liked { background: #fbe9e2; border-color: #efc2b0; }
.like-btn.is-liked .heart { fill: var(--coral); }
.like-btn:disabled { opacity: .6; cursor: default; }
.like-count { color: var(--muted); font-weight: 600; font-size: .92rem; }
.stamp-card { background: linear-gradient(160deg, #ffffff 0%, #fbf4e4 100%); border: 1px solid #efe3c8; border-radius: 20px; padding: 18px; display: grid; gap: 10px; box-shadow: 0 1px 2px rgba(31,58,95,.04), 0 8px 24px rgba(31,58,95,.06); }
.stamp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stamp-head strong { color: var(--navy); font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; }
.stamp-sub, .stamp-reward { color: var(--muted); font-size: .9rem; }
.stamp-dots { display: flex; gap: 9px; flex-wrap: wrap; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--navy); background: #fff; display: inline-block; }
.dot.on { background: var(--gold); border-color: var(--gold); }
.stamp-code { text-align: center; background: var(--navy); color: #fff; border-radius: 18px; padding: 18px; display: grid; gap: 8px; }
.stamp-code .muted { color: #cfd8e6; }
.code-digits { font-family: "Fraunces", Georgia, serif; font-size: 2.2rem; letter-spacing: .14em; font-weight: 700; }

/* Profile stamp cards */
.stamp-row { display: grid; gap: 8px; text-decoration: none; color: var(--ink); }
.stamp-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stamp-row-top strong { color: var(--navy); font-size: 1rem; }
.likes-line { color: var(--muted); font-size: .92rem; }
.likes-line strong { color: var(--coral); }
.empty { color: var(--muted); text-align: center; padding: 16px; background: #fff; border: 1px dashed #e0d6c4; border-radius: 16px; }

/* Forms: clear fields */
.draw-form input, .draw-form select, .draw-form textarea { border-radius: 12px; border-color: #e0d6c4; }
.shop-tile { text-align: left; }
.st-cover-empty .st-init { background: none; width: auto; height: auto; border-radius: 0; color: var(--navy); display: inline; padding: 0; }

/* ============================================================
   THEME v4: light cream. Cream page, white cards, warm ink,
   gold as the one action colour, shop colours only on spins,
   draws and stamp cards.
   ============================================================ */
:root {
  --cream: #FBF6EE;       /* page */
  --sand: #F4EDE1;        /* soft surface */
  --white: #FFFFFF;       /* cards */
  --tile: #FFFFFF;
  --navy: #1f3a5f;        /* headings and strong text, same as the saved site colour */
  --ink: #3D342A;         /* body text */
  --muted: #7A6F61;       /* secondary text */
  --line: #E6DCCB;        /* borders */
  --teal: #0E7C72;        /* links */
  --gold: #F2B632;        /* the one action colour */
  --coral: #E0604E;
  --accent-ink: #1E1A16;  /* text on gold */
  --panel: #FFFFFF;
  --panel-2: #F4EDE1;
  --field: #FFFFFF;
  --shadow: 0 10px 26px rgba(70, 50, 20, 0.10);
}
html { background: #FBF6EE; }
html { background: #fbf6ee; }
body { background: transparent; color: var(--ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* Fixed backdrop: it stays put while the page scrolls. */
html.has-art body::before { display: none; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--cream);
}
h1, h2, h3 { color: var(--navy); font-family: "Fraunces", Georgia, "Times New Roman", serif; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 5.6vw, 2.25rem); font-weight: 800; line-height: 1.08; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p, li { color: var(--ink); }
.lead { color: var(--muted); font-size: 1rem; }
.muted { color: var(--muted); }
a { color: var(--teal); }

/* Top bar: dark, with a thin gold line */
.topbar { background: rgba(251, 246, 238, 0.96); border-bottom: 1px solid var(--line); box-shadow: none; padding: 12px 16px; }
.topbar .brand { color: var(--navy); font-family: "Bricolage Grotesque", Inter, sans-serif; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.mini-logo { background: #FFFFFF; }
.back { color: var(--gold); font-weight: 700; }
.topnav-auth { background: transparent; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 7px 14px; font-weight: 700; }
.topnav { background: var(--panel); border-bottom: 1px solid var(--line); }
.topnav a { color: var(--ink); }
.topnav a[aria-current="page"], .topnav a:hover { background: var(--panel-2); color: var(--navy); }

main { padding: 20px 16px 110px; gap: 18px; }
.store-head { gap: 8px; padding: 6px 0 2px; }

/* Surfaces: one card style, one list style */
.panel, .coupon-card, .stamp-row, .empty-state, .acct-head, .gift-card, .prize-card, .prize-row, .spin-result, .partner {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: none; color: var(--ink);
}
.panel .rule, .rule { color: var(--muted); }
.row-list { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: none; }
.row { border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; }
.row:hover, .row:focus-visible { background: var(--panel-2); }
.row strong { color: var(--navy); }
.row small { color: var(--muted); }
.chev { color: var(--muted); }
.group-title { color: var(--muted); font-family: "Inter", sans-serif; font-weight: 700; }
.empty { background: var(--panel); border: 1px dashed #e6dccb; color: var(--muted); border-radius: 16px; }

/* Buttons: gold for the main action, outline for the rest */
.btn { background: var(--gold); color: var(--accent-ink); border: 0; border-radius: 999px; font-weight: 800; padding: 13px 20px; box-shadow: 0 8px 20px rgba(255, 194, 51, 0.18); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { background: #e6dccb; color: #8a8072; box-shadow: none; opacity: 1; cursor: default; }
.btn-alt { background: transparent; color: var(--navy); border: 1px solid #e6dccb; box-shadow: none; }
.btn-alt:hover { background: var(--panel-2); }
.btn-alt:disabled { background: transparent; color: #8a8072; border-color: #e6dccb; }
.link { color: var(--gold); font-weight: 700; background: none; border: 0; }
.link.danger { color: #b4432f; }

/* Forms */
label { color: var(--ink); }
input, select, textarea { background: var(--field); color: var(--navy); border: 1px solid #e6dccb; border-radius: 12px; font: inherit; }
input::placeholder, textarea::placeholder { color: #8a8072; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.draw-form input, .draw-form select, .draw-form textarea { border-radius: 12px; }
.msg { color: #0f7a55; }
.msg:empty { display: none; }
.fine { color: var(--muted); }

/* Bottom tab bar */
.tabbar { background: rgba(251, 246, 238, 0.97); border-top: 1px solid var(--line); box-shadow: none; }
.tabbar a { color: #7a6f61; font-weight: 700; }
.tabbar a[aria-current="page"] { color: var(--gold); }
.tabbar a[aria-current="page"] svg { stroke: var(--gold); }

/* Location bar and category button */
.loc-input { background: var(--field); color: var(--navy); border: 1px solid #e6dccb; border-radius: 999px; padding: 0 18px; }
.loc-me { background: transparent; color: var(--navy); border: 1px solid #e6dccb; border-radius: 999px; }
.loc-suggest, .sheet-box { background: var(--panel); border: 1px solid var(--line); color: var(--navy); }
.loc-opt, .sheet-box button { background: var(--panel); color: var(--navy); border-color: var(--line); }
.loc-opt:hover, .sheet-box button:hover { background: var(--panel-2); }
.sheet-box button[aria-pressed="true"] { background: var(--gold); color: var(--accent-ink); font-weight: 800; }
.loc-none { color: var(--muted); }
.cat-btn { background: var(--gold); color: var(--accent-ink); border: 0; border-radius: 999px; font-weight: 800; }
.cat-sheet { background: rgba(60, 44, 24, 0.7); }
.scope { color: var(--muted); }
.scope strong { color: var(--navy); }
.scope-clear, .link { color: var(--gold); }

/* Welcome banner on Home */
.welcome {
  position: relative; overflow: hidden; border-radius: 26px; padding: 26px 22px;
  background: linear-gradient(140deg, #f4ede1 0%, #fbf6ee 55%, #ffffff 100%);
  border: 1px solid #e6dccb; box-shadow: var(--shadow);
}
.welcome::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 51, 0.35), transparent 70%); }
.welcome .eyebrow { color: var(--gold); font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; }
.welcome h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--navy); margin-bottom: 10px; }
.welcome p { color: #5c5244; max-width: 520px; }
.welcome .btn { margin-top: 14px; }

/* Spin tiles: the whole tile is the shop's picture (or the spin, by default) */
.shop-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shop-tile {
  --d-bg: #1B2A44; --d-accent: #FFC233; --d-border: #FFC233; --d-ink: #FFFFFF;
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden;
  border: 4px solid var(--d-border); background: var(--d-bg); text-decoration: none; color: var(--navy);
  box-shadow: 0 10px 24px rgba(70, 50, 20, 0.35); transition: transform .15s ease;
}
.shop-tile:hover { transform: translateY(-2px); }
.shop-tile:active { transform: scale(.98); }
.st-cover, .st-cover-empty { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.st-cover-empty { display: grid; place-items: center; background: var(--d-bg); }
.st-art { width: 78%; height: auto; opacity: .95; }
.st-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(70, 50, 20,0) 30%, rgba(70, 50, 20,.82) 100%); }
.st-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 12px 13px; display: grid; gap: 6px; }
.st-name { font-family: "Bricolage Grotesque", Inter, sans-serif; font-weight: 800; font-size: 1.02rem; line-height: 1.15; color: var(--navy); text-shadow: 0 1px 6px rgba(70, 50, 20,.4); }
.st-cat { color: #3d342a; font-size: .76rem; line-height: 1.3; }
.st-prizes { display: flex; flex-wrap: wrap; gap: 5px; }
.st-prize { font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--d-accent); color: var(--accent-ink); }
.st-foot { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; }
.st-like { color: var(--navy); font-weight: 800; }
.st-go { background: var(--d-accent); color: var(--accent-ink); border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: .76rem; }
.st-init { font-family: "Bricolage Grotesque", sans-serif; font-size: 2.6rem; font-weight: 800; color: var(--navy); }
.empty-state { grid-column: 1 / -1; display: grid; gap: 6px; justify-items: center; text-align: center; }
.empty-state strong { color: var(--navy); }

/* Shop page */
.store-cover { width: calc(100% + 32px); margin: -20px -16px 0; height: 230px; object-fit: cover; display: block; border-radius: 0 0 26px 26px; }
.chip { display: inline-block; background: var(--panel-2); color: var(--gold); border: 1px solid #e6dccb; border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 700; text-decoration: none; }
.store-map { color: var(--teal); font-weight: 700; text-decoration: none; }
.store-address { color: var(--muted); }
.store-directions { background: transparent; }

/* The wheel panel takes the shop's spin design */
#spin-panel, .spin-panel { background: var(--d-bg); border: 4px solid var(--d-border); border-radius: 26px; color: #ffffff; padding: 18px; }
#spin-panel h2, .spin-panel h2, #spin-panel h3 { color: #ffffff; }
#spin-panel .rule { color: #F1F5FB; }
.prize-wheel, .wheel-wrap { max-width: 300px; margin: 6px auto; }
.prize-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.prize-list li { display: grid; gap: 2px; background: var(--panel-2); border-left: 6px solid var(--d-accent, var(--gold)); border-radius: 14px; padding: 10px 12px; }
.prize-list li strong { color: var(--navy); }
.prize-list li span { color: var(--muted); font-size: .9rem; }

/* Like and stamp card */
.loyal { display: grid; gap: 12px; }
.like-row { display: flex; align-items: center; gap: 12px; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e6dccb; background: var(--panel); color: var(--navy); border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.like-btn .heart { width: 20px; height: 20px; fill: none; stroke: var(--coral); stroke-width: 2; }
.like-btn.is-liked { background: #fde7e3; border-color: #e8a99e; }
.like-btn.is-liked .heart { fill: var(--coral); }
.like-btn:disabled { opacity: .6; cursor: default; }
.like-count { color: var(--muted); font-weight: 700; font-size: .92rem; }
.stamp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 10px; }
.stamp-head strong { color: var(--navy); font-family: "Bricolage Grotesque", sans-serif; font-size: 1.1rem; }
.stamp-sub, .stamp-reward { color: var(--muted); font-size: .9rem; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #e6dccb; background: var(--field); display: inline-block; }
.dot.on { background: var(--d-accent, var(--gold)); border-color: var(--d-accent, var(--gold)); }
.stamp-code { text-align: center; background: var(--d-bg, #1B2A44); color: #ffffff; border-radius: 18px; padding: 18px; display: grid; gap: 8px; border: 2px solid var(--d-border, var(--gold)); }
.stamp-code .muted { color: #3d342a; }
.code-digits { font-family: "Bricolage Grotesque", sans-serif; font-size: 2.3rem; letter-spacing: .14em; font-weight: 800; color: #ffffff; }
.stamp-row-top strong { color: var(--navy); }
.likes-line { color: var(--muted); font-size: .92rem; }
.likes-line strong { color: var(--coral); }

/* Profile */
.acct, .acct-head, .acct .panel, .acct-tabs { width: 100%; max-width: 728px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.acct .panel, .acct-head { margin-left: auto; margin-right: auto; }
/* Header account menu: picture + name, opens a small box */
.me-wrap { position: relative; margin-left: auto; flex: 0 0 auto; }
button.me-chip { border: 0; cursor: pointer; font: inherit; }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; z-index: 60; display: grid; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.me-menu[hidden] { display: none; }
.me-menu a, .me-menu .me-logout { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer; }
.me-menu a:hover, .me-menu .me-logout:hover { background: var(--panel-2); color: var(--navy); }
.me-menu .me-logout { color: #b4432f; }
.acct-head { padding: 18px; }
.acct-id strong { color: var(--navy); font-size: 1.1rem; }
.role-badge { background: var(--gold); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: .76rem; }
.acct-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; overflow: visible; }
.acct-tab { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 700; white-space: nowrap; }
.acct-tab[aria-selected="true"], .acct-tab.is-active { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }
.me-avatar-big, .me-initial { background: var(--gold); color: var(--accent-ink); }
.coupon-card strong { color: var(--navy); }
.code, .spin-result .code, .coupon-card .code { background: var(--field); color: var(--gold); border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; }
.stat { background: var(--panel-2); border-radius: 14px; }
.stat strong { color: var(--navy); }

/* Modal */
.modal { background: rgba(60, 44, 24, 0.72); }
.modal-card { background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 22px; }
.modal-card h2 { color: var(--navy); }
.reasons li { color: var(--ink); }

/* Footer */
footer { background: #f1e9db; color: var(--muted); border-top: 1px solid var(--line); }
footer a { color: #5c5244; }
footer .fine { color: var(--muted); }
.menu-btn span { background: #FFFFFF; }
.prize-list li { display: flex; gap: 12px; align-items: center; }
.prize-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--field); }
.prize-text { display: grid; gap: 2px; min-width: 0; }
.st-art { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 70%; height: auto; }
.st-cover-empty { overflow: hidden; }
.st-art { top: 34%; width: 58%; opacity: 1; }
.st-shade { background: linear-gradient(180deg, rgba(70, 50, 20,0) 40%, rgba(70, 50, 20,.86) 78%); }
#spin-panel .rule, #spin-panel .spin-dash, #spin-panel .muted { background: rgba(70, 50, 20, 0.28); color: #ffffff; border-radius: 14px; padding: 10px 12px; }
.rule, .transparency, .loc-box, .spin-dash, .notice { background: var(--panel-2); color: var(--ink); border-radius: 14px; padding: 10px 12px; }
.rule strong, .transparency strong { color: var(--navy); }
.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.step span { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.step p { margin: 0; color: var(--ink); }
.step strong { color: var(--navy); }
.partner .btn { width: auto; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }

/* Home: updates and shop rows */
.feed-section { display: grid; gap: 12px; }
.feed-section > h2 { margin: 4px 0 0; }
.news { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; display: grid; gap: 6px; }
.news h3 { margin: 0; }
.news p { margin: 0; }
.news-tag { justify-self: start; background: var(--gold); color: var(--accent-ink); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.feed-row { display: grid; grid-auto-flow: column; grid-auto-columns: 158px; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; }
.feed-row > * { scroll-snap-align: start; }
.feed-row .empty { grid-column: 1 / -1; }
.st-art { top: 26%; width: 50%; }

/* ---------- Won coupon ticket: spin colours, code only ---------- */
.coupon-ticket {
  position: relative;
  margin: 14px auto;
  max-width: 320px;
  padding: 26px 20px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--d-bg, #131D31), var(--d-border, #e6dccb));
  border: 2px dashed var(--d-accent, #FFC233);
  box-shadow: 0 12px 30px rgba(70, 50, 20, .35);
  text-align: center;
  overflow: hidden;
}
.coupon-ticket::before,
.coupon-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: #fbf6ee;
}
.coupon-ticket::before { left: -13px; }
.coupon-ticket::after { right: -13px; }
.ticket-code {
  display: block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--navy);
  text-shadow: 0 2px 0 rgba(70, 50, 20, .35);
}

/* ---------- Simplified look (matches the approved mockup) ---------- */
/* Background: warm cream, flat, so the photos and the shop colours carry the page. */
body::before { background: var(--cream); }
/* Shop tiles: one clear name, one line, one gold Spin button */
.shop-tile { border-radius: 18px; border-width: 2px; }
.st-body { padding: 12px 12px 14px; gap: 5px; }
.st-foot { margin-top: 2px; }
.st-go { padding: 7px 14px; font-size: .82rem; }
/* Shop page: fewer borders, one main action */
.store-head h1 { font-size: 1.9rem; }
.store-head .lead { margin-bottom: 4px; }
#spin-panel { gap: 14px; }
#spin-panel .rule { font-size: .9rem; }
.panel { border-radius: 18px; }

/* Owner: lucky draw entrants (phone numbers, visible to this owner only) */
.entrants { margin-top: 8px; }
.entrants summary { cursor: pointer; font-weight: 700; color: var(--gold); }
.entrant { margin: 6px 0 0; display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }

/* Spin tag on a shop tile: white with logo navy, so it never clashes with the prize plates */
.st-go { background: var(--navy); color: #FFFFFF; }

/* ---------- One locked ratio: every card is 4:5 ---------- */
/* Home update cards sit in the same row as the shop cards, same size */
.feed-row .news {
  width: 158px; aspect-ratio: 4 / 5; box-sizing: border-box; padding: 14px;
  border-radius: 22px; overflow: hidden; align-content: start; gap: 8px;
}
.feed-row .news h3 { font-size: 1.05rem; }

/* ---------- Stamp card: a punch card in the shop's colours ---------- */
.stamp-card {
  position: relative; overflow: hidden; display: grid; gap: 16px;
  background: var(--d-bg, #1B2A44); color: var(--navy);
  border: 2px solid var(--d-border, #FFC233); border-radius: 22px;
  padding: 18px 16px; box-shadow: 0 10px 24px rgba(70, 50, 20, .35);
}
.stamp-card::before {
  content: ""; position: absolute; inset: 8px; border-radius: 16px;
  border: 1.5px dashed rgba(255, 255, 255, .35); pointer-events: none;
}
.stamp-head, .stamp-dots, .stamp-reward { position: relative; }
.stamp-head { display: flex; justify-content: space-between; align-items: center; }
.stamp-head strong { color: var(--navy); font-size: 1.05rem; }
.stamp-sub { color: var(--navy); font-weight: 800; font-size: 1rem; }
.stamp-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; justify-items: center; }
.dot {
  position: relative; display: block; width: 100%; max-width: 46px; aspect-ratio: 1 / 1;
  box-sizing: border-box; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06);
}
.dot.reward { border: 2px solid var(--d-accent, #FFC233); }
.dot.on { background: var(--d-accent, #FFC233); border: 2px solid #FFFFFF; }
.dot.on::after {
  content: ""; position: absolute; left: 50%; top: 42%; width: 13px; height: 22px;
  border: solid var(--accent-ink, #fbf6ee); border-width: 0 4px 4px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.stamp-reward { margin: 0; text-align: center; font-weight: 700; font-size: .92rem; color: var(--navy); }

/* ---------- Shop posts: stories row, post cards (4:5 photo, same size everywhere) ---------- */
.feed-section .stories { max-width: none; padding: 4px 2px 8px; }
.feed-section .stories .ring { background: conic-gradient(#FFC233, #FF7A6B, #7FD3FF, #2FB8AB, #FFC233); }
.feed-section .stories .ring-in { background: var(--panel); border-color: var(--bg, #fbf6ee); color: var(--navy); }
.feed-section .story { color: var(--ink); }
.feed-section .story-name { color: var(--ink); }
.post-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pst { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pst-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.pst-av { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--gold); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.pst-av img { width: 100%; height: 100%; object-fit: cover; }
.pst-who { display: grid; min-width: 0; }
.pst-who strong { color: var(--navy); font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pst-who small { color: var(--muted); }
.pst-media { display: block; aspect-ratio: 4 / 5; background: var(--field); }
.pst-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pst-body { display: grid; gap: 10px; padding: 12px 14px 14px; }
.pst-cap { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.pst-body .muted { font-size: .82rem; }
.pst-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pst-actions a { padding: 8px 12px; border-radius: 999px; border: 1px solid #e6dccb; color: var(--navy); text-decoration: none; font-weight: 700; font-size: .82rem; }
.pst-actions a.pst-spin { background: var(--gold); border-color: var(--gold); color: var(--accent-ink); }
.shop-posts { margin-top: 18px; }
.shop-posts h2 { margin-bottom: 10px; }
.post-preview { width: 100%; max-width: 260px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat-row .stat { padding: 10px; text-align: center; }
.stat-row .stat strong { display: block; font-size: 1.3rem; }
.stat-row .stat span { color: var(--muted); font-size: .8rem; }

/* ---------- Shop page header: logo over the banner, name, Google Maps-style action row ---------- */
.store-id { display: flex; align-items: flex-end; gap: 14px; position: relative; min-width: 0; }
.store-cover:not([hidden]) ~ .store-head .store-id { margin-top: -46px; }
.store-logo { flex: 0 0 88px; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--panel); border: 4px solid var(--cream); box-shadow: 0 6px 18px rgba(70, 50, 20, 0.35); }
.store-logo[hidden] { display: none; }
.store-title { display: grid; gap: 6px; min-width: 0; padding-bottom: 4px; }
.store-title h1 { margin: 0; overflow-wrap: anywhere; }
.store-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 6px; }
.sa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.sa[hidden] { display: none; }
.sa-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--navy); }
.sa-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sa-primary .sa-ico { background: var(--gold); border-color: var(--gold); color: var(--accent-ink, #fbf6ee); }
.sa:hover .sa-ico { border-color: var(--gold); }

/* ---------- Profile: owner's post grid (Instagram-style, 3 to a row, 4:5 each) ---------- */
.owner-posts { margin: 14px 0 6px; }
.owner-posts[hidden], .owner-posts [hidden] { display: none; }
.owner-posts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.owner-posts-head h2 { margin: 0; font-size: 1.1rem; }
.owner-posts-head .btn { padding: 8px 14px; font-size: .85rem; }
.thumb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.thumb { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--field, #17233A); border-radius: 6px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.thumb:hover img { opacity: .85; }

/* ---------- Post likes ---------- */
.pst-bar { display: flex; align-items: center; gap: 10px; }
.pst-like { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--navy); }
.pst-like svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.pst-like.on { color: #FF5C6C; border-color: transparent; }
.pst-like.on svg { fill: #FF5C6C; }
.pst-like:disabled { opacity: .6; cursor: default; }
.pst-count { color: var(--ink); font-weight: 700; font-size: .9rem; }

/* ---------- Menu button on Profile (top right) and footer policy links ---------- */
.prof-top { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.menu-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2, #1B2944); border: 1px solid var(--line); color: var(--navy); z-index: 2; }
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 6px; }
.foot-links a { color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none; }
.foot-links a:hover { color: var(--gold); }

/* ---------- Layout: page content fills the column on every screen size ---------- */
main { grid-template-columns: minmax(0, 1fr); }
.feed-section { width: 100%; min-width: 0; }
.feed-row { min-width: 0; }
/* Desktop: the card rows become a grid that fills the width, instead of a narrow sideways strip */
@media (min-width: 900px) {
  .feed-row { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); overflow: visible; scroll-snap-type: none; padding: 2px 0 10px; }
  .feed-row .news { width: 100%; }
}
.post-grid .empty, .feed-row .empty { width: 100%; max-width: none; box-sizing: border-box; }

/* Home: Updates nearby filter */
.near-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.near-row .btn { min-height: 44px; }
.near-row .btn[aria-pressed="true"] { background: var(--panel-2, #1B2944); color: var(--gold); border: 1px solid var(--gold); box-shadow: none; }
.near-status { font-size: .85rem; }
.search-row { display: block; margin-top: 12px; }
.search-row input { width: 100%; max-width: 560px; min-height: 44px; }

/* Owner analytics (Manage shop) */
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.an-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.an-card strong { font-size: 1.6rem; line-height: 1.1; color: var(--ink); font-family: "Bricolage Grotesque", Inter, sans-serif; }
.an-card span { font-size: .8rem; color: var(--muted); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.seg .btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
@media (min-width: 900px) { .an-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acct-stats .stat-big { min-width: 150px; padding: 12px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.acct-stats .stat-big strong { font-size: 1.8rem; color: var(--ink); font-family: "Bricolage Grotesque", Inter, sans-serif; }
.acct-stats .stat-big span { color: var(--muted); font-size: .8rem; }

/* Map page */
.map-page { padding-bottom: 96px; }
.map-head h1 { margin-bottom: 6px; }
.map-box { height: 58vh; min-height: 320px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; margin: 12px 0; }
.map-list { display: grid; gap: 8px; }
.map-item { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.map-item span { font-size: .85rem; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; width: fit-content; margin: 12px 0; }
.qr-box img, .qr-box canvas { display: block; }

/* Sub-types: shop form and category sheet */
.sub-picks { margin: 8px 0 4px; display: grid; gap: 6px; }
.sub-group { margin: 8px 0 2px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sub-chips, .sheet-subs { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: .9rem; cursor: pointer; }
.sub-chip input { accent-color: var(--gold); }
.sheet-group { margin: 10px 0 4px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.sheet-subs button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.sheet-subs button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.sheet-done { margin-top: 12px; width: 100%; min-height: 44px; }
.add-shop-row { margin: 12px 0; }
.add-shop-row .btn { width: 100%; }

/* Shop page: post photos, three per row, 4:5 */
.shop-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.shop-thumb { display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-thumbs .empty { grid-column: 1 / -1; }

/* Enlarged post */
.lightbox { position: fixed; inset: 0; z-index: 9000; background: rgba(4,8,16,.86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox-card { position: relative; width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.lightbox-img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 12px; display: block; background: #000; }
.lightbox-cap { margin: 10px 4px 2px; color: var(--ink); }
.lightbox-date { margin: 0 4px 6px; display: block; }
.lightbox-close { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(70, 50, 20,.55); color: var(--navy); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox-bar { display: flex; align-items: center; gap: 10px; margin: 6px 4px 2px; }
.lightbox-like { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.lightbox-like.on { border-color: var(--gold); color: var(--gold); }
.lightbox-count { color: var(--muted); font-size: .9rem; }

/* Open your shop form: one field per row, full width */
.os-form label { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; font-weight: 600; }
.os-form input, .os-form select { width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 14px; font-weight: 400; }
.os-form .sub-group { margin: 14px 0 6px; font-weight: 700; }
.os-form .sub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.os-form .sub-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid #e6dccb; border-radius: 999px; font-weight: 400; }

/* Open your shop: clean, step-by-step layout (look only) */
.os-main { max-width: 560px; margin: 0 auto; padding: 16px; }
.os-main .panel { padding: 22px 20px; border-radius: 22px; }
.os-main h1 { margin: 10px 0 6px; font-size: 1.6rem; line-height: 1.2; }
.os-main .rule { margin: 0 0 14px; }
.os-bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin: 12px 0 4px; }
.os-bar span { display: block; height: 100%; background: var(--gold); border-radius: 6px; transition: width .3s ease; }
.os-form label { font-size: .95rem; }
.os-form input[type="checkbox"] { width: auto; min-height: 0; padding: 0; margin: 0; accent-color: var(--gold); }
.os-form input[type="file"] { padding: 10px 0; min-height: 0; border: 0; background: none; }
.os-form .sub-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.os-form .sub-chip { font-size: .9rem; background: var(--panel-2); }
.os-form .shop-preview { max-width: 100%; width: 100%; height: 160px; object-fit: cover; }
.os-map-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 12px; }
.os-map-tools .muted { font-size: .85rem; flex: 1 1 100%; }
.os-map { height: 280px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.os-nav { display: flex; gap: 10px; margin-top: 20px; }
.os-nav .btn { flex: 1; }
.os-nav .btn[hidden] { display: none; }
.os-summary { display: grid; grid-template-columns: 90px 1fr; gap: 10px 14px; margin: 6px 0 16px; }
.os-summary dt { color: var(--muted); font-size: .9rem; }
.os-summary dd { margin: 0; font-weight: 600; word-break: break-word; }
.os-checklist { display: grid; gap: 10px; }
.os-checklist .btn { text-align: center; }
.os-main .chip { display: inline-block; margin: 0; }
#o-body > .os-form > label:first-of-type { margin-top: 0; }
.os-form label.sub-chip { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-weight: 400; }

/* Menu and profile: spacing and contrast (look only) */
.menu-page .store-head { padding-top: 18px; margin-bottom: 4px; }
.menu-page .store-head h1 { margin-top: 0; }

/* Profile page, Instagram-style layout (look only) */
.acct-head { background: none; box-shadow: none; border-radius: 0; padding: 8px 4px 0; }
.acct-top { gap: 22px; }
.acct-top .me-avatar-big { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--gold); }
.acct-stats { gap: 0; justify-content: space-around; }
.acct-stats .stat { background: none; border-radius: 0; padding: 0; text-align: center; }
.acct-stats .stat strong { font-size: 1.2rem; }
.acct-stats .stat span { font-size: .8rem; color: var(--muted); }
.acct-id { margin-top: 14px; gap: 4px 8px; }
.acct-id strong { font-size: 1.1rem; }
.acct-id .role-bio { margin-top: 2px; }
.acct-actions { margin-top: 14px; }
.acct-actions .btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; padding: 10px 14px; }
.acct-tabs.acct-tabs { gap: 0; justify-content: space-around; border-top: 1px solid var(--line); margin: 18px 0 0; padding: 0; }
.acct-tabs .acct-tab { flex: 1; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--muted); padding: 12px 6px; border-top: 2px solid transparent; margin-top: -1px; }
.acct-tabs .acct-tab[aria-selected="true"], .acct-tabs .acct-tab.is-active { background: none; color: var(--ink); border-color: transparent; border-top-color: var(--ink); }
.thumb-grid { gap: 2px; }
.thumb { aspect-ratio: 1 / 1; border-radius: 0; }
.acct-head { border: 0; }
.acct-stats .stat { border: 0; }
.shop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.shop-actions .btn { font-size: .85rem; padding: 10px 8px; text-align: center; }

/* Shop screens: one job per page, with how-to steps (look and layout) */
.view-off { display: none !important; }
.guide { background: var(--panel-2); border-radius: 14px; padding: 12px 14px; margin: 4px 0 16px; }
.guide-title { margin: 0 0 6px; font-weight: 800; color: var(--gold); }
.guide ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; line-height: 1.45; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.hub-tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px; color: var(--ink); text-decoration: none; min-height: 110px; }
.hub-tile strong { display: block; font-size: 1.02rem; margin-bottom: 6px; }
.hub-tile span { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.hub-tile:hover { border-color: var(--gold); }
.hub-steps { display: grid; gap: 8px; padding-left: 20px; margin: 6px 0 0; }
@media (max-width: 380px) { .hub-grid { grid-template-columns: 1fr; } }

/* ============================================================
   PREMIUM FINISH: paper grain, gold accents, soft depth, motion.
   Subtle on purpose. Reduced-motion users get no animation.
   ============================================================ */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .55; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0 0.2  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Headings: serif display with a short gold rule under section titles */
h1, h2, h3 { font-optical-sizing: auto; text-wrap: balance; }
h1 { letter-spacing: -0.025em; }
.block-head h2, .panel > h2, .shelves-title, .shelf-head {
  position: relative; padding-bottom: 10px;
}
.block-head h2::after, .panel > h2::after, .shelves-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), #E9B949 60%, transparent);
}

/* Cards: layered soft depth with a thin light edge */
.panel, .shop-tile, .coupon-card, .empty-state, .draw-form-card {
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(70,50,20,.06), 0 12px 28px rgba(70,50,20,.08);
}
.shop-tile { transition: transform .2s ease, box-shadow .2s ease; }
.shop-tile:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 34px rgba(70,50,20,.14); }

/* Primary button: a slow gold sheen across the face on hover */
.btn-big, .btn:not(.btn-alt):not(.link) { position: relative; overflow: hidden; isolation: isolate; }
.btn-big::after, .btn:not(.btn-alt):not(.link)::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  transform: translateX(-120%);
}
.btn-big:hover::after, .btn:not(.btn-alt):not(.link):hover::after { transform: translateX(120%); transition: transform .9s ease; }
.btn-big:active, .btn:active { transform: scale(.98); }

/* Hero: a warm gold glow in the corner */
.welcome { isolation: isolate; }
.welcome::before {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 260px; height: 260px; z-index: -1;
  background: radial-gradient(circle, rgba(242,182,50,.28), rgba(242,182,50,0) 66%); pointer-events: none;
}

/* Entrance: content rises in softly on first paint */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main > section, .shop-block, .panel, .shelf-block {
  animation: rise .45s ease both;
}
main > section:nth-child(2), .shop-block:nth-of-type(2) { animation-delay: .05s; }
main > section:nth-child(3), .shop-block:nth-of-type(3) { animation-delay: .1s; }

@media (prefers-reduced-motion: reduce) {
  main > section, .shop-block, .panel, .shelf-block { animation: none; }
  .btn-big:hover::after, .btn:not(.btn-alt):not(.link):hover::after { transition: none; }
  .shop-tile { transition: none; }
}


/* Map pins: balloon-shaped markers (gold, navy outline) */
.loco-pin { cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); line-height: 0; }
.loco-pin svg { display: block; }
.loco-me {
  width: 16px; height: 16px; border-radius: 50%;
  background: #1f3a5f; border: 3px solid #ffffff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.maplibregl-popup-content { border-radius: 12px; padding: 12px 14px; font-family: inherit; color: var(--ink); }
.maplibregl-popup-content a { color: var(--teal); font-weight: 700; }
.map-item-name { display: grid; gap: 2px; text-decoration: none; color: var(--ink); }
.map-item-name span { font-size: .85rem; }
.map-open { justify-self: start; text-decoration: none; }
