/* ===============================================================
   GALA 2026 SHARED BASE + DONATION PAGE
   Loaded by gala-2026-support-us.html and gala-2026-playlist.html
   (the playlist adds assets/css/playlist.css). Mobile-first. No site nav.
   Zero hex literals: every colour reads a --gl-* token that the page
   sets from Tailwind theme values on <body>.
   =============================================================== */

/* ---------- Bilingual switch: [data-l] spans, <html data-gl-lang> ---------- */
html:not([data-gl-lang="zh"]) [data-l="zh"],
html[data-gl-lang="zh"] [data-l="en"] { display: none; }

.gl-body { font-family: 'Noto Sans', 'Noto Sans TC', sans-serif; }
html[data-gl-lang="zh"] .gl-body { line-height: 1.75; }

/* ---------- Shared type ---------- */
.gl-wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }
.gl-wrap--narrow { max-width: 34rem; }
.gl-section { padding: 4rem 0; }
.gl-h2 {
  font-family: 'Futura', 'Jost', 'Noto Sans TC', sans-serif; font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em;
  text-wrap: balance; color: var(--gl-ink); margin-bottom: 0.75rem;
}
.gl-h2--dark { color: white; }
.gl-lede { color: var(--gl-ink-alt); font-size: 1.05rem; line-height: 1.65; text-wrap: pretty; margin-bottom: 2rem; max-width: 38rem; }

/* ---------- Buttons (pill) ---------- */
.gl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.85rem 1.75rem; border-radius: 9999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.gl-btn--primary { background: var(--gl-blue); color: white; }
.gl-btn--primary:hover { background: var(--gl-blue-deep); }
.gl-btn--outline { background: white; color: var(--gl-ink); border-color: var(--gl-ink); }
.gl-btn--outline:hover { background: var(--gl-teal-light); }
.gl-btn--ghost { background: transparent; color: white; border-color: color-mix(in srgb, white 70%, transparent); }
.gl-btn--ghost:hover { background: color-mix(in srgb, white 12%, transparent); }
.gl-btn--block { width: 100%; }
.gl-btn--small { min-height: 2.75rem; padding: 0.5rem 1.25rem; font-size: 0.95rem; }
.gl-body :focus-visible { outline: 3px solid var(--gl-teal-deep); outline-offset: 3px; }
.gl-hero :focus-visible, .gl-bar :focus-visible, .gl-footer :focus-visible { outline-color: var(--gl-teal-bright); }

/* ---------- Prototype banner ---------- */
.gl-prototype {
  background: var(--gl-teal-light); color: var(--gl-ink);
  font-size: 0.85rem; line-height: 1.4; text-align: center; padding: 0.6rem 1rem;
}

/* ---------- Hero ---------- */
.gl-hero { position: relative; overflow: hidden; background: var(--gl-dark); color: white; padding: 0 1.25rem 7rem; }
.gl-hero__media, .gl-hero__scrim { position: absolute; inset: 0; }
.gl-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; opacity: 0.7; }
.gl-hero__scrim { background: linear-gradient(to bottom, color-mix(in srgb, var(--gl-dark) 70%, transparent), color-mix(in srgb, var(--gl-dark) 35%, transparent) 40%, color-mix(in srgb, var(--gl-dark) 92%, transparent)); }
.gl-hero__bar, .gl-hero__content { position: relative; z-index: 1; max-width: 64rem; margin: 0 auto; }
.gl-hero__bar { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; }
.gl-hero__logo { height: 2.75rem; width: auto; filter: brightness(0) invert(1); } /* reversed logo until HKVC supplies a white SVG */
.gl-hero__content { padding-top: 3.5rem; }
.gl-hero__kicker { color: var(--gl-teal-bright); margin-bottom: 0.75rem; }
.gl-hero__h1 {
  font-family: 'Futura', 'Jost', 'Noto Sans TC', sans-serif; font-weight: 600;
  font-size: clamp(2.4rem, 9vw, 5rem); line-height: 1.02; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 15ch; margin-bottom: 1rem;
}
html[data-gl-lang="zh"] .gl-hero__h1 { letter-spacing: 0; line-height: 1.2; max-width: 12em; }
.gl-hero__lede { color: color-mix(in srgb, white 85%, transparent); font-size: 1.05rem; line-height: 1.7; max-width: 32rem; margin-bottom: 1.75rem; }
.gl-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Compact hero (donation page): gifts sit close to the fold */
.gl-hero--compact { padding-bottom: 3rem; }
.gl-hero--compact .gl-hero__content { padding-top: 1.5rem; }

/* Language switch */
.gl-lang { display: inline-flex; padding: 0.25rem; border-radius: 9999px; background: color-mix(in srgb, white 12%, transparent); border: 1px solid color-mix(in srgb, white 30%, transparent); }
.gl-lang__btn { min-width: 3.25rem; min-height: 2.5rem; padding: 0 0.9rem; border-radius: 9999px; color: white; font-weight: 600; font-size: 0.9rem; background: transparent; border: 0; cursor: pointer; }
.gl-lang__btn[aria-pressed="true"] { background: white; color: var(--gl-ink); }

/* ---------- Notices ---------- */
.gl-notice { margin: 0 0 1.5rem; }
.gl-notice > span { display: block; padding: 1rem 1.25rem; border-radius: 1rem; background: var(--gl-teal-light); border: 1px solid var(--gl-teal-deep); }

/* ---------- Step list (1 Gifts, 2 Details, 3 Thank you) ---------- */
.gl-steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 1.5rem 0 0; font-size: 0.9rem; font-weight: 600; color: var(--gl-ink-alt); }
.gl-steps li { display: inline-flex; align-items: center; gap: 0.5rem; }
.gl-steps__n { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 9999px; border: 2px solid currentColor; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.gl-steps li[aria-current="step"] { color: var(--gl-ink); }
.gl-steps li[aria-current="step"] .gl-steps__n { background: var(--gl-teal-deep); border-color: var(--gl-teal-deep); color: white; }
.gl-steps li.is-done .gl-steps__n { border-color: var(--gl-teal-deep); color: var(--gl-teal-deep); }

/* Views sit right under the step list */
[data-gl-view].gl-section { padding-top: 2rem; }
[data-gl-view] .gl-h2:focus:not(:focus-visible) { outline: none; }
.gl-back { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem; margin-bottom: 0.5rem; font-weight: 600; color: var(--gl-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Gift cards: tap to add one, minus removes one ---------- */
/* Open cards (layout D): nothing is outlined or filled at rest — the photo is
   the rounded shape and the text sits on the page ground under it, price first. */
.gl-gifts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
.gl-gift { position: relative; display: flex; flex-direction: column; }
.gl-gift__add {
  display: flex; flex-direction: column; flex: 1; width: 100%;
  padding: 0; border: 0; background: transparent; color: var(--gl-ink);
  text-align: left; font: inherit; cursor: pointer;
}
.gl-body .gl-gift__add:focus-visible { outline-offset: 4px; border-radius: 2rem; }
.gl-gift__add[aria-disabled="true"] { cursor: not-allowed; }
.gl-gift__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2rem; background: var(--gl-card); transition: box-shadow .25s ease; }
.gl-gift__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.gl-gift__media--product img { object-fit: contain; background: white; }
.gl-gift__media--placeholder { display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--gl-teal-light); color: var(--gl-teal-deep); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
/* The price leads the text block, on a hairline that runs to the card edge. */
.gl-gift__price {
  display: flex; align-items: center; gap: 1rem; padding-top: 1.25rem; margin-bottom: 0.9rem;
  font-family: 'Futura', 'Jost', sans-serif; font-weight: 600; font-size: 1.35rem;
  font-variant-numeric: tabular-nums; color: var(--gl-teal-deep);
}
.gl-gift__price::after { content: ""; flex: 1; height: 2px; background: color-mix(in srgb, var(--gl-ink) 14%, transparent); transform-origin: left; }
.gl-gift.is-selected .gl-gift__media { box-shadow: 0 0 0 4px var(--gl-ground), 0 0 0 7px var(--gl-teal-deep); }
.gl-gift.is-selected .gl-gift__price::after { background: var(--gl-teal-deep); }
.gl-gift__name { font-weight: 600; font-size: 1.5rem; line-height: 1.25; margin-bottom: 0.75rem; }
.gl-gift__desc { display: block; font-size: 1rem; line-height: 1.55; color: var(--gl-ink-alt); margin-bottom: 0.75rem; }

/* Count badge and minus button sit on the photo */
.gl-gift__badge, .gl-gift__minus {
  position: absolute; top: 0.75rem; display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; height: 2.75rem; border-radius: 9999px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.gl-gift__badge { right: 0.75rem; padding: 0 0.6rem; background: var(--gl-teal-deep); color: white; pointer-events: none; }
.gl-gift__minus { left: 0.75rem; border: 2px solid var(--gl-ink); background: white; color: var(--gl-ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.gl-gift__minus:hover { background: var(--gl-teal-light); }
.gl-gift__badge[hidden], .gl-gift__minus[hidden] { display: none; }

/* Gift of your choice: the same card as the rest, with the amount field under
   the button (the amount is the gift, so it cannot live inside the button). */
.gl-gift__amount { padding: 0 0 1.25rem; margin-top: 1rem; }
.gl-amount__row { display: flex; align-items: center; border-radius: 1rem; background: var(--gl-ground); border: 1px solid color-mix(in srgb, var(--gl-ink) 35%, transparent); }
.gl-amount__row:focus-within { outline: 3px solid var(--gl-teal-deep); outline-offset: 3px; }
.gl-amount__prefix { padding-left: 1rem; font-weight: 600; color: var(--gl-ink-alt); }
.gl-field .gl-amount__row input { border: 0; background: transparent; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 0.5rem; }
.gl-field .gl-amount__row input:focus-visible { outline: none; }
.gl-amount__row:has(input[aria-invalid="true"]) { border: 2px solid color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-gift--custom.is-selected .gl-amount__row { background: white; }

/* ---------- Motion: Support Us cards (all of it off under reduced motion) ---------- */
/* gala.js adds .gl-gifts--reveal only when motion is allowed and
   IntersectionObserver exists, so a browser without either shows every card. */
@media (prefers-reduced-motion: no-preference) {
  .gl-gifts--reveal .gl-gift {
    opacity: 0; transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
  }
  .gl-gifts--reveal .gl-gift:nth-child(1) { transition-delay: 0ms; }
  .gl-gifts--reveal .gl-gift:nth-child(2) { transition-delay: 70ms; }
  .gl-gifts--reveal .gl-gift:nth-child(3) { transition-delay: 140ms; }
  .gl-gifts--reveal .gl-gift:nth-child(4) { transition-delay: 210ms; }
  .gl-gifts--reveal .gl-gift:nth-child(5) { transition-delay: 280ms; }
  .gl-gifts--reveal .gl-gift:nth-child(6) { transition-delay: 350ms; }
  .gl-gifts--reveal .gl-gift.is-in { opacity: 1; transform: none; }
  /* The hairline draws in from the left once the card has settled. */
  .gl-gifts--reveal .gl-gift__price::after { transform: scaleX(0); transition: transform .9s cubic-bezier(.16, 1, .3, 1) .25s; }
  .gl-gifts--reveal .gl-gift.is-in .gl-gift__price::after { transform: scaleX(1); }
  .gl-gift.is-press .gl-gift__media { animation: gl-press .35s cubic-bezier(.16, 1, .3, 1); }
  .gl-gift__badge.is-pop { animation: gl-pop .4s cubic-bezier(.34, 1.56, .64, 1); }
  [data-gl-bar-total].is-tick { display: inline-block; animation: gl-tick .35s cubic-bezier(.16, 1, .3, 1); }
}
@keyframes gl-press { 40% { transform: scale(.97); } }
@keyframes gl-pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes gl-tick { 0% { transform: translateY(40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gl-gift__add { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
  .gl-gift__add:hover { transform: translateY(-4px); }
  .gl-gift__add:hover .gl-gift__media img { transform: scale(1.04); }
}

.gl-error { margin-top: 1rem; padding: 0.9rem 1.25rem; border-radius: 1rem; font-weight: 600; color: color-mix(in srgb, var(--gl-error) 70%, black); background: color-mix(in srgb, var(--gl-error) 8%, white); border: 1px solid color-mix(in srgb, var(--gl-error) 60%, white); }

/* ---------- Step 2: summary + donor form + Payment Element ---------- */
.gl-checkout__grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.gl-form { background: white; border-radius: 2rem; padding: 1.5rem; display: grid; gap: 1.1rem; }
.gl-form__h { font-family: 'Futura', 'Jost', 'Noto Sans TC', sans-serif; font-weight: 500; font-size: 1.35rem; }
.gl-field { display: grid; gap: 0.35rem; }
.gl-field label { font-weight: 600; font-size: 0.95rem; }
.gl-field input { width: 100%; min-height: 3rem; padding: 0.7rem 1rem; border-radius: 1rem; font-size: 1rem; color: var(--gl-ink); background: var(--gl-ground); border: 1px solid color-mix(in srgb, var(--gl-ink) 35%, transparent); }
.gl-field input[aria-invalid="true"] { border: 2px solid color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-field__hint { font-size: 0.85rem; font-weight: 400; color: var(--gl-ink-alt); }
/* Receipt caveat: between the hint (0.85rem) and the section heading (1.35rem), in full ink so it reads as a rule, not a tip. */
.gl-field__note { font-size: 0.95rem; font-weight: 600; color: var(--gl-ink); }
.gl-field__err { font-size: 0.875rem; font-weight: 600; color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-field__err:empty { display: none; }
.gl-pay { display: grid; gap: 0.75rem; margin: 0.5rem 0 0; padding: 1.25rem 0 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--gl-ink) 12%, transparent); }
.gl-pay legend { float: left; width: 100%; margin-bottom: 0.25rem; }
.gl-pay__element { min-height: 3rem; }
.gl-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.gl-form__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, var(--gl-ink) 12%, transparent); font-size: 1.05rem; }
.gl-form__total strong { font-family: 'Futura', 'Jost', sans-serif; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.gl-form__fine { font-size: 0.85rem; color: var(--gl-ink-alt); text-align: center; }

/* ---------- Summary list (step 2 + thank-you) ---------- */
.gl-summary { display: grid; gap: 0.5rem; margin: 1rem 0; }
.gl-summary li { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }

/* ---------- Thank-you ---------- */
.gl-thanks__card { max-width: 38rem; }
.gl-thanks__card > .gl-btn { margin-top: 2rem; }
.gl-finale__kicker { color: var(--gl-ink-alt); margin-bottom: 0.75rem; }
.gl-receipt { background: white; border-radius: 2rem; padding: 1.25rem 1.5rem 1.5rem; }
.gl-receipt .gl-summary { margin-top: 0; }
.gl-checkout__summary .gl-summary { margin-top: 1rem; }
.gl-receipt__line { margin-top: 1rem; font-size: 0.9rem; line-height: 1.6; color: var(--gl-ink-alt); overflow-wrap: anywhere; }
.gl-thanks__h3 { font-family: 'Futura', 'Jost', 'Noto Sans TC', sans-serif; font-weight: 500; font-size: 1.35rem; margin: 2.5rem 0 1rem; }
.gl-links { display: grid; gap: 0.75rem; }
.gl-link { display: flex; flex-direction: column; justify-content: center; min-height: 3.5rem; padding: 0.75rem 1.25rem; border-radius: 1.25rem; background: white; border: 1px solid color-mix(in srgb, var(--gl-ink) 12%, transparent); font-weight: 600; color: var(--gl-ink); text-decoration: none; transition: border-color .2s ease, background-color .2s ease; }
.gl-link:hover { border-color: var(--gl-teal-deep); background: color-mix(in srgb, var(--gl-teal-light) 55%, white); }
.gl-link__url { font-weight: 400; font-size: 0.85rem; color: var(--gl-ink-alt); }

/* ---------- Inline cart summary: the bar's twin, in the flow under the grid ---------- */
.gl-cart {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: 2rem;
  background: white; border: 2px solid var(--gl-teal-deep);
}
.gl-cart[hidden] { display: none; }
.gl-cart__sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; color: var(--gl-ink); font-size: 0.9rem; }
.gl-cart__sum strong { font-family: 'Futura', 'Jost', sans-serif; font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* ---------- Fixed cart bar (step 1) ---------- */
.gl-bar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--gl-blue-deep); color: white; box-shadow: 0 -8px 30px color-mix(in srgb, black 18%, transparent); transition: transform .2s ease; }
.gl-bar[hidden] { display: none; }
/* The inline summary is on screen: the bar slides away rather than repeat it. */
.gl-bar.is-docked { transform: translateY(100%); visibility: hidden; pointer-events: none; }
.gl-bar__inner { max-width: 64rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gl-bar__sum { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.85rem; color: color-mix(in srgb, white 90%, transparent); }
.gl-bar__sum strong { font-family: 'Futura', 'Jost', sans-serif; font-size: 1.4rem; color: white; font-variant-numeric: tabular-nums; }
/* White, not blue: a primary button on the blue bar would read as part of it. */
.gl-bar .gl-btn--primary { background: white; color: var(--gl-blue-deep); }
.gl-bar .gl-btn--primary:hover { background: var(--gl-teal-light); }
.gl-body.gl-has-bar { padding-bottom: 5.5rem; }

/* ---------- Footer ---------- */
.gl-footer { background: var(--gl-dark); color: color-mix(in srgb, white 78%, transparent); font-size: 0.85rem; line-height: 1.6; padding: 2.5rem 0 3rem; }
.gl-footer p + p { margin-top: 0.75rem; }
.gl-footer a { color: white; text-decoration: underline; text-underline-offset: 3px; }
.gl-footer__logo { height: 2.75rem; width: auto; filter: brightness(0) invert(1); margin-bottom: 1.5rem; }
.gl-socials { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.gl-footer .gl-social { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.25rem; border-radius: 9999px; border: 1px solid color-mix(in srgb, white 35%, transparent); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.gl-footer .gl-social:hover { background: color-mix(in srgb, white 12%, transparent); }
.gl-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.gl-footer__links a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 768px) {
  .gl-section { padding: 6rem 0; }
  .gl-gifts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem 2rem; }
  .gl-checkout__grid { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .gl-checkout__summary { order: 2; position: sticky; top: 1.5rem; }
  .gl-form { padding: 2rem; }
  .gl-hero { padding-bottom: 9rem; }
  .gl-hero__content { padding-top: 5rem; }
  .gl-hero--compact { padding-bottom: 4.5rem; }
  .gl-hero--compact .gl-hero__content { padding-top: 3rem; }
  .gl-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  /* Six cards, three columns: two even rows. */
  .gl-gifts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-body *, .gl-body *::before, .gl-body *::after { transition: none !important; }
  html:has(.gl-body) { scroll-behavior: auto; }
}

/* ===============================================================
   ALBUM NUMBERS: the album card's stock line and held state, plus
   the three-step number picker dialog. Zero hex literals — every
   colour reads a --gl-* token set on <body>.
   =============================================================== */

/* ---------- Album card: stock line, held summary, hold timer ---------- */
.gl-album__stock { margin-top: 0.25rem; font-size: 0.9rem; font-weight: 600; color: var(--gl-ink-alt); font-variant-numeric: tabular-nums; }
.gl-album__stock:empty { display: none; }
.gl-gift.is-unavailable .gl-album__stock { color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-gift.is-unavailable .gl-gift__media { opacity: 0.55; }
.gl-album__held {
  display: grid; gap: 0.5rem; justify-items: start;
  margin-top: 1rem; padding: 1rem 1.25rem; border-radius: 1.5rem;
  background: white; border: 2px solid var(--gl-teal-deep);
}
.gl-album__held[hidden] { display: none; }
.gl-album__held-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; font-size: 0.9rem; color: var(--gl-ink); }
.gl-album__held-sum strong { font-family: 'Futura', 'Jost', sans-serif; font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.gl-album__timer { font-size: 0.85rem; font-weight: 600; color: var(--gl-teal-deep); font-variant-numeric: tabular-nums; }
.gl-album__timer:empty { display: none; }
.gl-album__notice { font-size: 0.85rem; font-weight: 600; line-height: 1.5; color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-album__notice[hidden] { display: none; }
.gl-album__held .gl-btn[hidden] { display: none; }

/* ---------- Picker dialog: full-height sheet on phones ---------- */
.gl-dlg {
  width: 100%; max-width: 100%; max-height: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--gl-ink);
}
.gl-dlg::backdrop { background: color-mix(in srgb, var(--gl-dark) 72%, transparent); }
.gl-dlg__card {
  display: flex; flex-direction: column; height: 100%; max-height: 100%;
  padding: 0; background: var(--gl-ground);
}

/* The top bar stays put while the accordion scrolls under it: Back on the left,
   "Albums" plus the − / count / + stepper on the right, the hold clock below. */
.gl-dlg__bar {
  position: sticky; top: 0; z-index: 2; flex: none;
  padding: 0.85rem 1rem; background: white;
  border-bottom: 1px solid color-mix(in srgb, var(--gl-ink) 12%, transparent);
}
.gl-dlg__bar-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.gl-dlg__back {
  display: inline-flex; align-items: center; gap: 0.35rem; flex: none; white-space: nowrap;
  min-height: 2.75rem; padding: 0 0.7rem;
  border: 2px solid var(--gl-teal-deep); border-radius: 9999px;
  background: white; color: var(--gl-ink);
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
@media (min-width: 640px) { .gl-dlg__back { padding: 0 1rem; font-size: 1rem; } }
.gl-dlg__back:hover { color: var(--gl-ink); background: var(--gl-teal-light); }
.gl-dlg__qty { display: flex; align-items: center; gap: 0.6rem; }
.gl-dlg__h {
  font-family: 'Futura', 'Jost', 'Noto Sans TC', sans-serif; font-weight: 600;
  font-size: 1.05rem; line-height: 1.2; color: var(--gl-ink);
}
.gl-dlg__h:focus:not(:focus-visible) { outline: none; }
.gl-dlg__timer { margin-top: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--gl-teal-deep); font-variant-numeric: tabular-nums; }
.gl-dlg__timer:empty { display: none; }
/* The one rule the stepper obeys. It sits under the stepper rather than in the
   scrolling body, so it is on screen the moment the count reaches the cap. */
.gl-dlg__max { margin-top: 0.4rem; font-size: 0.85rem; font-weight: 600; line-height: 1.5; color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-dlg__max[hidden] { display: none; }

.gl-dlg__body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 1rem; }
.gl-dlg__err { margin: 0 0 0.6rem; font-size: 0.9rem; font-weight: 600; line-height: 1.5; color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-dlg__err:empty { display: none; }

/* Pinned footer: the body scrolls under it, so Done is always in reach. */
.gl-dlg__foot {
  flex: none; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: white; border-top: 1px solid color-mix(in srgb, var(--gl-ink) 12%, transparent);
}

/* The stepper: in the bar it is compact, elsewhere it keeps its own size. */
.gl-stepper { display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 9999px; background: white; border: 2px solid var(--gl-teal-deep); }
.gl-stepper--bar { gap: 0.25rem; padding: 0.2rem; }
.gl-stepper__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 9999px;
  border: 0; background: var(--gl-teal-light); color: var(--gl-teal-deep);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.gl-stepper--bar .gl-stepper__btn { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
.gl-stepper__btn:hover { background: color-mix(in srgb, var(--gl-teal-deep) 18%, white); }
.gl-stepper__btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.gl-stepper__n { min-width: 2.5rem; text-align: center; font-family: 'Futura', 'Jost', sans-serif; font-weight: 600; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.gl-stepper--bar .gl-stepper__n { min-width: 1.6rem; font-size: 1.25rem; }

/* ---------- The album accordion: one row per album, one open at a time ---------- */
.gl-albums { display: grid; gap: 0.6rem; }
.gl-album {
  border-radius: 1.25rem; background: white;
  border: 2px solid color-mix(in srgb, var(--gl-ink) 12%, transparent);
  overflow: hidden;
}
.gl-album.is-open { border-color: var(--gl-teal-deep); }
/* An album Done refused to leave unfinished is outlined in the error colour
   until it has a number, whether or not it is the open row. */
.gl-album.is-unset { border-color: color-mix(in srgb, var(--gl-error) 70%, black); }
.gl-album__head { display: flex; align-items: center; gap: 0.25rem; padding-right: 0.75rem; }
.gl-album__title { flex: 1; min-width: 0; margin: 0; font: inherit; }
.gl-album__toggle {
  display: flex; align-items: center; gap: 0.2rem 0.6rem; width: 100%;
  min-height: 3.5rem; padding: 0.7rem 0.5rem 0.7rem 1rem;
  border: 0; background: transparent; color: var(--gl-ink);
  font: inherit; text-align: left; cursor: pointer;
}
.gl-album__head:hover { background: color-mix(in srgb, var(--gl-teal-light) 40%, white); }
.gl-album__toggle:hover { background: transparent; }
/* The name and the summary share a column on a phone, so a long summary gets
   the whole width instead of wrapping around the album's name. */
.gl-album__lines { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.1rem; }
.gl-album__name { font-weight: 600; font-size: 1rem; }
.gl-album__sum { font-size: 0.85rem; line-height: 1.4; color: var(--gl-ink-alt); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gl-album__chev { flex: none; width: 0.6rem; height: 0.6rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.gl-album.is-open .gl-album__chev { transform: rotate(-135deg); }
.gl-album__panel { display: grid; gap: 0.9rem; padding: 0 1rem 1rem; }
.gl-album__panel[hidden] { display: none; }
.gl-album__remove {
  flex: none; min-height: 2.75rem; padding: 0 0.25rem;
  border: 0; background: transparent; color: var(--gl-ink-alt);
  font: inherit; font-size: 0.8rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.gl-album__remove[disabled] { opacity: 0.4; cursor: not-allowed; }
.gl-album__remove:hover { color: color-mix(in srgb, var(--gl-error) 70%, black); }

/* ---------- Three option tiles (radio-like, 64 px minimum) ---------- */
.gl-tiles { display: grid; gap: 0.5rem; }
.gl-tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 0.15rem 0.75rem; min-height: 4rem; padding: 0.75rem 1rem;
  border-radius: 1rem; background: white;
  border: 2px solid color-mix(in srgb, var(--gl-ink) 14%, transparent);
  color: var(--gl-ink); font: inherit; text-align: left; cursor: pointer;
}
.gl-tile:hover:not([disabled]) { border-color: var(--gl-teal-deep); }
.gl-tile.is-on { border-color: var(--gl-teal-deep); background: color-mix(in srgb, var(--gl-teal-light) 55%, white); }
.gl-tile[disabled] { opacity: 0.5; cursor: not-allowed; }
.gl-tile__title { font-weight: 600; font-size: 1rem; }
.gl-tile__price { grid-row: 1; grid-column: 2; font-family: 'Futura', 'Jost', sans-serif; font-weight: 600; color: var(--gl-teal-deep); font-variant-numeric: tabular-nums; }
.gl-tile__hint { grid-column: 1 / -1; font-size: 0.8rem; line-height: 1.45; color: var(--gl-ink-alt); font-variant-numeric: tabular-nums; }

/* ---------- The number grid: 5 fat pills per row on a phone, 10 from 640px ---------- */
.gl-grid { display: grid; gap: 0.6rem; }
.gl-grid__h { font-weight: 600; font-size: 0.9rem; color: var(--gl-ink); }
/* The fade tells the donor there is more below without a scrollbar of its own. */
.gl-grid__scroll {
  max-height: 17rem; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.25rem 1.25rem;
  -webkit-mask-image: linear-gradient(to bottom, white 0, white calc(100% - 2rem), transparent 100%);
  mask-image: linear-gradient(to bottom, white 0, white calc(100% - 2rem), transparent 100%);
}
.gl-ranges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.gl-range {
  min-height: 2.75rem; padding: 0.25rem; border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--gl-ink) 20%, transparent);
  background: white; color: var(--gl-ink); font: inherit; font-size: 0.9rem; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.gl-range:hover { border-color: var(--gl-teal-deep); }
.gl-range.is-on { background: var(--gl-teal-deep); border-color: var(--gl-teal-deep); color: white; }
.gl-grid__pills { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.gl-grid--lucky .gl-grid__pills { gap: 0.6rem; }

.gl-pill {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 3.5rem; min-width: 3.5rem; padding: 0.25rem; border-radius: 0.9rem;
  border: 2px solid color-mix(in srgb, var(--gl-ink) 20%, transparent);
  background: white; color: var(--gl-ink);
  font: inherit; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.gl-grid--lucky .gl-pill { min-height: 4.5rem; border-radius: 1.1rem; font-size: 1.5rem; }
.gl-pill:hover:not([disabled]) { border-color: var(--gl-teal-deep); background: var(--gl-teal-light); }
.gl-pill.is-mine, .gl-pill.is-pending { background: var(--gl-teal-deep); border-color: var(--gl-teal-deep); color: white; }
/* The tick is drawn, not a glyph: the page loads no icon font. */
.gl-pill.is-mine::after {
  content: ""; position: absolute; top: 0.3rem; right: 0.45rem;
  width: 0.35rem; height: 0.6rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
}
.gl-pill.is-other-album { background: white; border-color: var(--gl-teal-deep); color: var(--gl-teal-deep); cursor: not-allowed; }
.gl-pill.is-held { background: color-mix(in srgb, var(--gl-ink) 8%, white); border-color: transparent; color: color-mix(in srgb, var(--gl-ink) 45%, white); cursor: not-allowed; }
.gl-pill.is-sold { background: transparent; border-color: transparent; color: color-mix(in srgb, var(--gl-ink) 35%, white); text-decoration: line-through; cursor: not-allowed; }
.gl-pill__lock { position: absolute; top: 0.2rem; right: 0.25rem; width: 0.8rem; height: 0.8rem; }
.gl-pill__mini { position: absolute; bottom: 0.2rem; left: 0; right: 0; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; text-align: center; }
.gl-pill__spin {
  position: absolute; top: 0.25rem; left: 0.25rem; width: 0.7rem; height: 0.7rem;
  border-radius: 9999px; border: 2px solid color-mix(in srgb, white 45%, transparent);
  border-top-color: white;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-pill__spin { animation: gl-spin .7s linear infinite; }
  .gl-pill.is-shake { animation: gl-shake .4s ease; }
  /* A pill that changed hands because of a live push flashes once. */
  .gl-pill.is-flash { animation: gl-flash .9s ease-out; }
}
@keyframes gl-spin { to { transform: rotate(360deg); } }
@keyframes gl-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes gl-flash {
  0% { box-shadow: 0 0 0 3px var(--gl-teal-deep); background: var(--gl-teal-light); }
  100% { box-shadow: none; }
}

/* The details step's "Edit albums" is a button, styled like the back links. */
.gl-back--btn { display: inline-flex; padding: 0; border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.gl-back--btn[hidden] { display: none; }

/* Past the narrowest phones the grid doubles to ten per row. */
@media (min-width: 640px) {
  .gl-grid__pills { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  /* 21 special numbers: three even rows of seven. */
  .gl-grid--lucky .gl-grid__pills { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .gl-pill { min-height: 3.25rem; min-width: 0; font-size: 1.15rem; }
}

@media (min-width: 768px) {
  /* Past phone widths the sheet becomes a centred card. */
  .gl-dlg { width: min(42rem, calc(100% - 3rem)); max-width: 42rem; height: auto; max-height: min(88vh, 48rem); margin: auto; }
  .gl-dlg__card { border-radius: 2rem; overflow: hidden; }
  .gl-dlg__bar { padding: 1.1rem 1.75rem; }
  .gl-dlg__h { font-size: 1.25rem; }
  .gl-dlg__body { padding: 1.5rem 1.75rem 1.75rem; }
  .gl-dlg__foot { padding: 1rem 1.75rem 1.25rem; }
  /* Past phone widths the row fits on one line. */
  .gl-album__lines { flex-direction: row; align-items: baseline; gap: 0.6rem; }
  .gl-album__name { flex: none; }
  .gl-album__sum { flex: 1; min-width: 0; }
  .gl-grid__scroll { max-height: 18rem; }
  .gl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gl-tile { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; }
  .gl-tile__price { grid-row: auto; grid-column: 1; }
}
