/* Layout: one calm column on phones, a twilight sky behind rounded cards; gold is reserved for the action buttons. */
:root {
  --night: #232B5C;
  --dusk: #4A4592;
  --plum: #6A58A6;
  --card: #2E3670;
  --card-2: #38407E;
  --line: #525AA0;
  --ink: #F6F3EC;
  --muted: #C9CCE8;
  --gold: #F5C451;
  --gold-hi: #FFE08A;
  --gold-ink: #232B5C;
  --pink: #FF8A9A;
  --aqua: #7FD8E8;
  --tile: #ECE8F8;
  --berry: #D93A4E;
  --holly: #2FA36B;
  --holly-hi: #8FE3B0;
  --wire: #1A2148;
  --t30: #2FA36B;
  --t45: #2F7FD8;
  --t60: #8E5BD6;
  --tile-ink: #232B5C;
  --font-script: "Lilita One", "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night) linear-gradient(180deg, var(--night) 0%, var(--dusk) 60%, var(--plum) 100%) fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100%;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--night); }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 8vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; border-radius: 8px; }
.script { font-family: var(--font-script); font-weight: 400; color: var(--gold); }
.muted { color: var(--muted); }
.eyebrow { color: var(--aqua); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--night); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { font-family: var(--font-script); font-size: 1.45rem; line-height: 1.2; letter-spacing: .01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.brand b { font-weight: 400; color: var(--gold); }
.brand:hover { color: var(--ink); }
.bagbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card-2); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 600; border: 1px solid var(--line); }
.bagbtn:hover { color: var(--ink); border-color: var(--gold); }
.count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.nav { border-bottom: 1px solid var(--line); background: var(--night); }
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; padding-block: 6px; scrollbar-width: none; }
.nav a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a[aria-current="page"] { background: var(--card-2); color: var(--ink); }

main { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 40px; }
section { display: flex; flex-direction: column; gap: 18px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.btn-gold { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--gold-ink); box-shadow: 0 4px 0 #C99A2B, 0 10px 24px rgba(0,0,0,.25); }
.btn-gold:hover { color: var(--gold-ink); filter: brightness(1.05); }
.btn-gold:active { transform: translateY(2px); box-shadow: 0 2px 0 #C99A2B; }
.btn-gold::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: skewX(-20deg); animation: shimmer 3.2s ease-in-out infinite; }
@keyframes shimmer { 0%, 60% { left: -40%; } 100% { left: 130%; } }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); }
.btn-added { background: var(--card-2); color: var(--aqua); border: 2px solid var(--aqua); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn svg { flex: none; }
@media (prefers-reduced-motion: reduce) { .btn-gold::after { animation: none; display: none; } html { scroll-behavior: auto; } }

/* hero */
.hero { position: relative; padding-block: 12px 4px; gap: 16px; }
.hero h1 .script { display: block; font-size: .92em; line-height: 1.15; margin-top: 6px; letter-spacing: .01em; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stars svg { position: absolute; }

.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.panel p { color: var(--muted); font-size: .97rem; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--pink); color: var(--night); font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.art { position: relative; background: var(--tile); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.art svg, .art img { height: 88%; width: auto; max-width: 90%; object-fit: contain; }
.tier { position: absolute; top: 10px; left: 10px; background: var(--night); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 999px; transform: rotate(-3deg); }
.colortag { position: absolute; bottom: 10px; right: 10px; background: #fff; color: var(--tile-ink); font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kicker { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.why { color: var(--muted); font-size: .95rem; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; color: var(--ink); }
.also { font-size: .85rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--gold); }
.card .btn { width: 100%; }

/* filters */
.filters { display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: .95rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

/* quiz */
.quizbox { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: clamp(18px, 4vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.bar { height: 8px; border-radius: 999px; background: var(--night); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .3s; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.opt { text-align: left; min-height: 76px; padding: 14px 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--card-2); color: var(--ink); cursor: pointer; font-family: var(--font-body); display: flex; flex-direction: column; gap: 2px; }
.opt b { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.opt span { color: var(--muted); font-size: .9rem; }
.opt:hover { border-color: var(--gold); }
.persona { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: clamp(18px, 4vw, 32px); display: flex; flex-direction: column; gap: 10px; }
.persona .script { font-size: clamp(1.9rem, 8vw, 3.2rem); line-height: 1.12; }
.group h3 { color: var(--aqua); }
.group { display: flex; flex-direction: column; gap: 12px; }

/* bag */
.bagitem { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 12px; align-items: center; }
.bagitem .art { aspect-ratio: 1; border-radius: 14px; }
.bagitem .info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bagitem .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; min-height: 44px; padding: 0 6px; }
.note { background: var(--card-2); border: 1px dashed var(--line); border-radius: 16px; padding: 14px 16px; color: var(--muted); font-size: .95rem; }
.empty { text-align: center; padding: 36px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: 22px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* guides */
.article { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: clamp(18px, 4vw, 30px); display: flex; flex-direction: column; gap: 12px; }
.article p, .article li { color: var(--muted); max-width: 65ch; }
.article ul, .article ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.article b { color: var(--ink); }

/* owner table */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--card); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.ok { color: var(--aqua); font-weight: 700; }
.todo { color: var(--pink); font-weight: 700; }
code { background: var(--night); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

footer { border-top: 1px solid var(--line); background: var(--night); }
footer .wrap { padding-block: 26px 34px; display: flex; flex-direction: column; gap: 10px; font-size: .85rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--night); font-weight: 700; padding: 12px 20px; border-radius: 999px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-width: calc(100% - 32px); text-align: center; }

/* ---------- Holiday season (turn off in products.js: season: "") ---------- */
.lights { display: none; }
.holiday .lights { display: block; height: 22px; background: var(--night); }
.holiday .lights::before, .holiday .quizbox::before, .holiday .persona::before, .holiday .empty::before, .holiday footer::before {
  content: ""; display: block; height: 22px; flex: none; align-self: stretch;
  background:
    radial-gradient(circle at 14px 13px, var(--berry) 5.5px, transparent 6.5px) 0 0 / 104px 22px repeat-x,
    radial-gradient(circle at 40px 15px, var(--holly) 5.5px, transparent 6.5px) 0 0 / 104px 22px repeat-x,
    radial-gradient(circle at 66px 13px, var(--gold) 5.5px, transparent 6.5px) 0 0 / 104px 22px repeat-x,
    radial-gradient(circle at 92px 15px, var(--aqua) 5.5px, transparent 6.5px) 0 0 / 104px 22px repeat-x,
    linear-gradient(var(--wire), var(--wire)) 0 5px / 100% 2px no-repeat;
  filter: drop-shadow(0 0 5px rgba(255, 224, 138, .75));
  animation: twinkle 1.8s ease-in-out infinite alternate;
}
.holiday .quizbox::before, .holiday .persona::before, .holiday .empty::before { margin: -8px -6px -6px; }
@keyframes twinkle { from { opacity: 1; } to { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .holiday .lights::before, .holiday .quizbox::before, .holiday .persona::before, .holiday .empty::before, .holiday footer::before { animation: none; } }
.holiday .eyebrow, .holiday .group h3 { color: var(--holly-hi); }
.holiday .nav a[aria-current="page"] { background: var(--holly); color: #fff; }
.holiday .steps li:nth-child(odd)::before { background: var(--berry); color: #fff; }
.holiday .steps li:nth-child(even)::before { background: var(--holly); color: #fff; }
.holiday .bar i { background: linear-gradient(90deg, var(--berry), var(--gold), var(--holly)); }
.holiday .panel:nth-child(odd) { border-top: 4px solid var(--berry); }
.holiday .panel:nth-child(even) { border-top: 4px solid var(--holly); }
.holiday .count { background: var(--berry); color: #fff; }

/* Budget colors: one per tier */
.tier.tier-30, .dot.tier-30 { background: var(--t30); color: #fff; }
.tier.tier-45, .dot.tier-45 { background: var(--t45); color: #fff; }
.tier.tier-60, .dot.tier-60 { background: var(--t60); color: #fff; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; border: 2px solid rgba(255,255,255,.7); }
.seg button { display: inline-flex; align-items: center; }
