/* ============ tokens ============ */
:root {
  --paper: #fbf6ec;
  --paper-edge: #efe4cf;
  --ink: #2b2420;
  --ink-soft: #6d6158;
  --accent: #d6453d;
  --accent-2: #f2b134;
  --card: #fffdf8;
  --heart: #e8456b;
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px -12px rgba(60,40,20,.35);
}

body[data-theme="atefeh"] {
  --paper: #fff8f6;
  --paper-edge: #fbe3e6;
  --ink: #4a3540;
  --ink-soft: #8a7280;
  --accent: #e86f9a;
  --accent-2: #9b86f0;
  --card: #ffffff;
  --sky-a: #ffe3ef;
  --sky-b: #e7e2ff;
  --sky-c: #dff5ee;
}

body[data-theme="milad"] {
  --paper: #f6f1e4;
  --paper-edge: #e4dac2;
  --ink: #14233f;
  --ink-soft: #55607a;
  --accent: #ff6a2b;
  --accent-2: #1f4e9c;
  --card: #fffdf6;
  --display: "Bowlby One", "Fraunces", sans-serif;
}

/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  min-height: 100dvh;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.loading { padding: 30vh 16px; text-align: center; font-family: var(--display); font-size: 1.4rem; }

/* ============ gate ============ */
body[data-theme="gate"], body[data-theme="picker"] {
  background:
    radial-gradient(circle at 20% 10%, #ffe7c2 0, transparent 40%),
    radial-gradient(circle at 85% 90%, #ffd6e0 0, transparent 45%),
    #fbf3e4;
}
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate__card {
  position: relative; width: min(420px, 100%);
  background: var(--card); border: 2px solid var(--ink); border-radius: 22px;
  padding: 48px 28px 32px; text-align: center;
  box-shadow: 8px 8px 0 var(--ink);
}
.gate__ribbon {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: var(--accent); color: #fff; padding: 4px 18px; border-radius: 4px;
  font: 600 .8rem/1.6 var(--body); letter-spacing: .12em; text-transform: uppercase;
  border: 2px solid var(--ink);
}
.gate__title { font: 800 clamp(2.4rem, 9vw, 3.2rem)/1 var(--display); margin: 0 0 10px; letter-spacing: -.02em; }
.gate__sub { color: var(--ink-soft); margin: 0 0 24px; }
.gate__form { display: flex; gap: 8px; }
.gate__form input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px;
  font: inherit; background: #fff;
}
.gate__form button {
  padding: 12px 18px; border: 2px solid var(--ink); border-radius: 12px;
  background: var(--accent-2); font-weight: 600; box-shadow: 3px 3px 0 var(--ink);
}
.gate__form button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.gate__error { color: var(--accent); margin: 14px 0 0; font-weight: 500; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ============ picker ============ */
.picker { min-height: 100dvh; padding: 56px 16px; text-align: center; }
.picker__eyebrow { font: 700 1.6rem var(--hand); color: var(--accent); margin: 0; }
.picker__title { font: 800 clamp(2.2rem, 8vw, 3.4rem)/1.05 var(--display); margin: 4px 0 36px; }
.picker__grid {
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 640px; margin: 0 auto;
}
.profile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 18px 24px; text-decoration: none;
  border: 2px solid var(--ink); border-radius: 26px; background: #fff;
  box-shadow: 6px 6px 0 var(--ink); transition: transform .2s, box-shadow .2s;
}
.profile:hover, .profile:focus-visible { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 var(--ink); }
.profile--milad { background: linear-gradient(180deg, #e3f0ff, #fff 70%); }
.profile--atefeh { background: linear-gradient(180deg, #ffe6f0, #fff 70%); }
.profile__avatar { width: 150px; height: 150px; }
.profile__avatar svg { width: 100%; height: 100%; }
.profile:hover .profile__avatar { animation: wiggle .6s ease-in-out; }
.profile__name { font: 800 1.9rem var(--display); }
.profile--milad .profile__name { font-family: "Bowlby One", sans-serif; color: #1f4e9c; }
.profile--atefeh .profile__name { color: #d4507f; }
.picker__logout { display: inline-block; margin-top: 36px; color: var(--ink-soft); font-size: .9rem; }
.profile__tag { color: var(--ink-soft); font-size: .95rem; }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* ============ topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 8px 16px 6px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--paper-edge);
}
.topbar__back { text-decoration: none; font-weight: 600; font-size: .9rem; }
.topbar__title { flex: 1; text-align: center; font: 600 1rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="milad"] .topbar__title { font-weight: 400; letter-spacing: .02em; }
.topbar__avatar { width: 34px; height: 34px; }
.topbar__avatar svg { width: 100%; height: 100%; }

.sample-banner {
  background: #fff3c4; color: #5b4a10; text-align: center; font-size: .85rem;
  padding: 8px 16px; border-bottom: 1px dashed #d8c27a;
}

.chips {
  flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 2px 16px 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  text-decoration: none; border: 1px solid var(--paper-edge); background: var(--card); white-space: nowrap;
  transition: background .2s, color .2s;
}
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.topbar__index {
  font-size: .85rem; font-weight: 600; text-decoration: none; padding: 4px 10px;
  border: 1px solid var(--paper-edge); border-radius: 999px; background: var(--card);
}
.topbar__icon { font-size: 1.4rem; }

.index-link {
  display: flex; align-items: center; gap: 14px; max-width: 640px; margin: 28px auto 0; padding: 16px 20px;
  border: 2px solid var(--ink); border-radius: 18px; background: #fff; text-decoration: none; text-align: left;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .2s, box-shadow .2s;
}
.index-link:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.index-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.index-link strong { font: 800 1.2rem var(--display); }
.index-link small { color: var(--ink-soft); }
.index-link__icon { font-size: 1.8rem; }

/* ============ shop index ============ */
body[data-theme="index"] { --accent: #b5452f; --accent-2: #2f5d8a; }
.index { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.index__head { text-align: center; }
.index__title { margin: 0; font: 800 clamp(2rem, 8vw, 3.2rem)/1 var(--display); }
.index__sub { margin: 8px 0 14px; color: var(--ink-soft); }
.index__tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.index__search {
  width: min(460px, 100%); padding: 11px 16px; border: 2px solid var(--ink); border-radius: 999px;
  font: inherit; background: #fff;
}
.index__toggle { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; cursor: pointer; }
.index__toggle input { accent-color: var(--accent); width: 18px; height: 18px; }
.index__cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.index__cats .chip { cursor: pointer; }
.index__cats .chip small { opacity: .6; margin-left: 2px; }
.index__letters {
  position: sticky; top: 49px; z-index: 10; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0; background: var(--paper); border-bottom: 1px solid var(--paper-edge);
}
.index__letters::-webkit-scrollbar { display: none; }
.index__letters a {
  flex: none; min-width: 30px; text-align: center; padding: 3px 6px; border-radius: 6px;
  font: 800 .95rem var(--display); text-decoration: none;
}
.index__letters a:hover { background: var(--ink); color: var(--paper); }
.index__list { columns: 1; }
@media (min-width: 760px) { .index__list { columns: 2; column-gap: 48px; } }
.index__group { break-inside: avoid-column; padding-top: 14px; scroll-margin-top: 110px; }
.index__letter {
  margin: 0 0 4px; font: 800 2rem/1 var(--display); color: var(--accent);
  border-bottom: 2px solid var(--ink); padding-bottom: 2px;
}
.index__group ul { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 6px;
  padding: 6px 0 5px; border-bottom: 1px dotted var(--paper-edge); break-inside: avoid;
}
.entry__name { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.entry__name:hover { text-decoration: underline; }
.entry__dots { border-bottom: 2px dotted var(--ink-soft); opacity: .35; transform: translateY(-3px); min-width: 10px; }
.entry__where { font-size: .82rem; color: var(--ink-soft); text-align: right; }
.entry__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; font-size: .72rem; }
.entry__cat { color: var(--ink-soft); }
.entry__book { text-decoration: none; padding: 0 8px; border-radius: 999px; font-weight: 600; color: #fff; }
.entry__book--atefeh { background: #e86f9a; }
.entry__book--milad { background: #1f4e9c; }
.entry.is-featured .entry__name { color: var(--accent); }
.index__empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }

/* ============ hero (compact cover) ============ */
.hero {
  position: relative; overflow: hidden; z-index: 1;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 16px;
  padding: 18px 16px 16px; min-height: 132px;
}
.hero__art { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.hero__kicker { margin: 0; font: 700 1.15rem/1 var(--hand); color: var(--accent); }
.hero__title { margin: 2px 0 0; font: 800 clamp(2rem, 9vw, 3.4rem)/.95 var(--display); letter-spacing: -.02em; }
.hero__subtitle { display: none; margin: 8px 0 0; color: var(--ink-soft); max-width: 46ch; }
.hero__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hero__budget {
  display: flex; flex-direction: column; align-items: flex-end; padding: 4px 12px; border-radius: 12px;
  background: rgba(255,255,255,.8); border: 1.5px solid var(--ink);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
}
.hero__budget strong { font: 800 1.1rem var(--display); letter-spacing: 0; text-transform: none; }
.hero__note-btn {
  border: 0; background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.note {
  display: none; position: absolute; z-index: 5; right: 12px; top: 100%; margin-top: -6px; width: min(320px, calc(100% - 24px));
  background: #fffef7; padding: 16px 18px 12px; transform: rotate(-2deg);
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.4);
  background-image: repeating-linear-gradient(transparent 0 27px, #dbe7f5 27px 28px);
}
.note.is-open { display: block; animation: fade .2s; }
.hero { overflow: visible; }
.hero__art { overflow: hidden; }
.note::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 24px;
  transform: translateX(-50%) rotate(3deg); background: rgba(255, 214, 120, .75);
}
.note__body { margin: 0; font: 500 1.4rem/28px var(--hand); color: #2e3a6b; }
.note__sign { margin: 6px 0 0; text-align: right; font: 700 1.4rem var(--hand); color: var(--accent); }

/* --- meadow (Atefeh) --- */
.hero--meadow .hero__art { background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 70%, var(--sky-c) 100%); }
.sun { position: absolute; top: 6px; right: 38%; width: 64px; height: 64px; }
.sun svg { width: 100%; height: 100%; overflow: visible; }
.sun__rays { transform-origin: 60px 60px; animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cloud {
  position: absolute; height: 22px; border-radius: 40px; background: #fff; opacity: .9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 30px; height: 30px; top: -15px; left: 12px; }
.cloud::after { width: 22px; height: 22px; top: -10px; left: 36px; }
.cloud--a { width: 72px; top: 40%; left: -100px; animation-duration: 48s; }
.cloud--b { width: 60px; top: 14%; left: -100px; animation-duration: 64s; animation-delay: -30s; opacity: .7; }
@keyframes drift { to { transform: translateX(calc(100vw + 200px)); } }
.petal {
  position: absolute; left: -20px; top: var(--y); color: #ff9fc0; font-size: 14px;
  animation: blow var(--dur) linear var(--delay) infinite; opacity: 0;
}
.petal:nth-child(3n) { color: #b9a3ff; }
.petal:nth-child(4n) { color: #ffcf6e; }
@keyframes blow {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: .9; }
  50% { transform: translate(55vw, 20px) rotate(220deg); }
  100% { transform: translate(110vw, -10px) rotate(480deg); opacity: 0; }
}
.meadow { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; }
.flower {
  position: absolute; bottom: 0; width: 2px; transform-origin: bottom center;
  animation: sway 3.6s ease-in-out var(--d) infinite alternate;
}
.flower__stem { position: absolute; bottom: 0; left: 0; width: 2px; height: var(--h); background: #79c28c; border-radius: 3px; }
.flower__head { position: absolute; left: -9px; bottom: calc(var(--h) - 4px); width: 20px; height: 20px; }
.flower__head i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.flower__head i:nth-child(1) { left: 5px; top: 0; }
.flower__head i:nth-child(2) { left: 10px; top: 4px; }
.flower__head i:nth-child(3) { left: 8px; top: 10px; }
.flower__head i:nth-child(4) { left: 1px; top: 10px; }
.flower__head i:nth-child(5) { left: -1px; top: 4px; }
.flower__head b { position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ffe08a; }
@keyframes sway { from { transform: rotate(-7deg); } to { transform: rotate(9deg); } }
/* Keep the meadow clear of the title: flowers only grow on the right half of the banner. */
.flower:nth-child(-n+4) { display: none; }
body[data-theme="atefeh"] .hero__title { color: #c94b7c; font-style: italic; font-weight: 600; }

/* --- stadium (Milad) --- */
.hero--stadium .hero__art {
  background: repeating-linear-gradient(-12deg, transparent 0 34px, rgba(255,106,43,.1) 34px 68px), #fdf3df;
}
.hero--stadium .mountains { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; opacity: .9; }
.hero--stadium .mountains svg { width: 100%; height: 100%; }
.ball { position: absolute; }
.ball--bb {
  width: 34px; height: 34px; right: 40%; top: 14px; border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 46%, #7a3b0a 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #7a3b0a 46% 54%, transparent 54%),
    #f08a24;
  border: 2px solid #7a3b0a; animation: bounce 1.4s cubic-bezier(.5,0,.5,1) infinite;
}
.ball--sb { display: none; }
@media (max-width: 520px) { .ball--bb { display: none; } }
.badge-star { display: none; }
@keyframes bounce { 0%, 100% { transform: translateY(40px); } 50% { transform: translateY(0) rotate(160deg); } }
body[data-theme="milad"] .hero__title { color: var(--accent-2); text-shadow: 2px 2px 0 var(--accent); font-weight: 400; }
body[data-theme="milad"] .note { transform: rotate(1.8deg); }

/* ============ picks ============ */
.picks { max-width: 1240px; margin: 0 auto; padding: 14px 12px 8px; }
.picks__title { margin: 0 4px 10px; font: 800 1.15rem var(--display); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.picks__title small { font: 500 .8rem var(--body); color: var(--ink-soft); }
body[data-theme="milad"] .picks__title { font-weight: 400; }
.product__shop {
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ chapters & shops ============ */
.chapter { max-width: 980px; margin: 0 auto; padding: 22px 12px 8px; }
.chapter__head { text-align: center; padding: 36px 8px 22px; }
.chapter__num {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}
.chapter__title { margin: 10px 0 4px; font: 800 clamp(1.9rem, 7vw, 2.8rem)/1.05 var(--display); }
body[data-theme="milad"] .chapter__title { font-weight: 400; color: var(--accent-2); }
body[data-theme="atefeh"] .chapter__title { font-style: italic; font-weight: 600; }
.chapter__tagline { margin: 0; font: 600 1.35rem var(--hand); color: var(--ink-soft); }

.shop { margin: 0 0 22px; padding: 18px 16px 14px; }
.shop__head { display: flex; align-items: center; gap: 14px; }
.shop__logo {
  flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--paper-edge);
}
.shop__logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.shop__initials {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--accent-2); color: #fff; font: 800 1.4rem var(--display);
}
.shop__name { margin: 0; font: 800 1.35rem/1.15 var(--display); }
body[data-theme="milad"] .shop__name { font-weight: 400; }
.shop__where { margin: 2px 0 0; color: var(--ink-soft); font-size: .88rem; }
.shop__blurb { margin: 12px 0 14px; font-size: 1rem; }
body[data-theme="atefeh"] .shop__blurb { font-family: var(--display); font-style: italic; }

.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product {
  position: relative; margin: 0; padding: 8px 8px 10px; background: #fff;
  border: 1px solid var(--paper-edge); border-radius: 12px;
  transform: rotate(var(--tilt)); transition: transform .2s;
}
.product:hover { transform: rotate(0) translateY(-2px); }
.product__img {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  text-decoration: none;
  background: color-mix(in srgb, var(--paper) 70%, #fff);
}
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__emoji { font-size: 3.2rem; }
.product figcaption { display: flex; flex-direction: column; gap: 2px; padding: 8px 2px 0; }
.product__title {
  font-size: .9rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product__price { font: 800 1.05rem var(--display); color: var(--accent); }
body[data-theme="milad"] .product__price { font-weight: 400; }

.heart {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .15s;
}
.heart svg { width: 22px; height: 22px; fill: none; stroke: var(--heart); stroke-width: 2; transition: fill .15s; }
.heart.is-on svg { fill: var(--heart); }
.heart.is-on { animation: pop .35s; }
.heart:active { transform: scale(.88); }
@keyframes pop { 50% { transform: scale(1.25); } }
.burst {
  position: fixed; z-index: 60; pointer-events: none; color: var(--heart); font-size: 16px;
  animation: burst .7s ease-out forwards;
}
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(.6); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; }
}

.shop__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.shop__visit {
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ink);
  text-decoration: none; font-weight: 600; font-size: .9rem;
}
.page-no { font: italic .85rem var(--display); color: var(--ink-soft); }
body[data-theme="milad"] .page-no { font-family: var(--body); }

.colophon { max-width: 640px; margin: 30px auto 0; padding: 20px 16px 130px; text-align: center; color: var(--ink-soft); font-size: .9rem; }
.colophon__edition { font: 700 1.3rem var(--hand); color: var(--accent); }

/* ============ tally ============ */
.tally {
  position: fixed; z-index: 30; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(460px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}
.tally.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.04); } }
.tally__hearts { font-weight: 700; white-space: nowrap; }
.tally__icon { color: var(--heart); }
.tally__bar { flex: 1; height: 10px; border-radius: 999px; background: var(--paper-edge); overflow: hidden; }
.tally__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .35s; }
.tally__left { font: 800 .95rem var(--display); white-space: nowrap; }
body[data-theme="milad"] .tally__left { font-weight: 400; }
.tally.is-over .tally__left { color: #c0262d; }
.tally.is-over .tally__bar span { background: #c0262d; }

/* ============ drawer ============ */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(20, 15, 10, .45); animation: fade .2s; }
.drawer__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px 22px 0 0; animation: rise .25s ease-out;
  max-width: 560px; margin: 0 auto;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.drawer__head h2 { margin: 0; font: 800 1.5rem var(--display); }
body[data-theme="milad"] .drawer__head h2 { font-weight: 400; }
.drawer__body { overflow-y: auto; padding: 0 18px max(18px, env(safe-area-inset-bottom)); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--paper-edge); background: var(--card); flex: none; }
.wish { list-style: none; margin: 0; padding: 0; }
.wish__item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--paper-edge); }
.wish__thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--card); font-size: 1.6rem; }
.wish__thumb img { width: 100%; height: 100%; object-fit: cover; }
.wish__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wish__info a { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wish__info small { color: var(--ink-soft); }
.wish__price { font: 800 1rem var(--display); white-space: nowrap; }
body[data-theme="milad"] .wish__price { font-weight: 400; }
.wish__sum { margin: 14px 0 0; display: grid; gap: 6px; }
.wish__sum div { display: flex; justify-content: space-between; }
.wish__sum dt { color: var(--ink-soft); }
.wish__sum dd { margin: 0; font-weight: 700; }
.wish__sum div:last-child { padding-top: 8px; border-top: 2px solid var(--ink); font-size: 1.1rem; }
.wish__sum .is-over dd { color: #c0262d; }
.wish__hint, .wish__empty { color: var(--ink-soft); font-size: .85rem; }
.wish__empty { padding: 20px 0 30px; font-size: 1rem; text-align: center; }

/* ============ desktop: an open book ============ */
@media (min-width: 960px) {
  .topbar { padding: 10px 32px 8px; }
  .chips { flex-basis: auto; order: 2; flex: 1 1 100%; justify-content: center; margin: 0; padding: 4px 0 0; }

  .hero { padding: 26px max(32px, calc((100vw - 1240px) / 2 + 16px)) 22px; min-height: 170px; }
  .hero__title { font-size: 3.6rem; }
  .hero__subtitle { display: block; }
  .hero__kicker { font-size: 1.5rem; }
  .hero__note-btn { display: none; }
  .hero { grid-template-columns: 1fr auto auto; }
  .note {
    display: block; position: relative; top: auto; right: auto; margin: 0 0 -6px; width: 290px;
    padding: 12px 16px 8px; align-self: center; grid-column: 2; grid-row: 1;
  }
  .note__body { font-size: 1.2rem; line-height: 24px; }
  .note { background-image: repeating-linear-gradient(transparent 0 23px, #dbe7f5 23px 24px); }
  .note__sign { font-size: 1.2rem; margin-top: 2px; }
  .hero__side { grid-column: 3; }
  .sun { right: auto; left: 46%; top: 10px; width: 80px; height: 80px; }
  .ball--bb { right: auto; left: 56%; }
  .picks { padding: 18px 32px 8px; }
  .picks__title { font-size: 1.4rem; }
  .products--picks { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .chapter { max-width: 1240px; padding: 40px 32px 16px; }
  .chapter__head { padding: 56px 8px 32px; }
  .chapter__title { font-size: 3.4rem; }
  .chapter__tagline { font-size: 1.7rem; }

  /* Two shops side by side like facing pages, with a soft spine shadow between them. */
  .spread {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border-radius: var(--radius); box-shadow: var(--shadow), 0 30px 60px -40px rgba(60,40,20,.5);
    background: var(--card); border: 1px solid var(--paper-edge); margin-bottom: 40px; overflow: hidden;
  }
  .spread > .shop { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 32px 36px 24px; }
  .spread > .shop:nth-child(odd) { background: linear-gradient(270deg, rgba(0,0,0,.06), transparent 40px), var(--card); }
  .spread > .shop:nth-child(even) { background: linear-gradient(90deg, rgba(0,0,0,.08), transparent 40px), var(--card); }
  .spread > .shop:nth-child(n+3) { border-top: 1px dashed var(--paper-edge); }
  .spread > .shop:last-child:nth-child(odd) { grid-column: 1 / -1; background: var(--card); }
  .spread > .shop:last-child:nth-child(odd) .products { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .spread .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .shop__logo { width: 76px; height: 76px; }
  .shop__name { font-size: 1.6rem; }
  .shop__blurb { font-size: 1.05rem; max-width: 62ch; }

  .tally { left: auto; right: 32px; bottom: 28px; transform: none; width: 380px; }
  @keyframes bump { 50% { transform: scale(1.04); } }

  .drawer__panel {
    top: 0; left: auto; right: 0; bottom: 0; width: 440px; max-height: none; margin: 0;
    border-radius: 22px 0 0 22px; animation-name: slide;
  }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } }

  .picker__grid { max-width: 820px; gap: 36px; }
  .profile { padding: 40px 24px 34px; }
  .profile__avatar { width: 200px; height: 200px; }
  .profile__name { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petal { display: none; }
}
