/* ============================================================================
   Giftpebble — "Skipping Stone" design system (v5, mobile-first)

   One idea: a pebble skipping across water. Cream paper, 2px ink borders,
   hard offset shadows, an indigo + sunshine-yellow palette, pebble-shaped
   thumbs. Outfit for headings, Plus Jakarta Sans for everything else.
   Text on yellow is ALWAYS ink, in both themes.

   Class names are load-bearing (index.html, server share page, claim.js,
   share.js). Do not rename: grid, card, thumb, is-fallback, fallback, mark,
   domain, info, price, actions, buy, claim-btn, badge, share-bar.
   ========================================================================== */

/* ── Tokens ────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --font-display: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Arial, sans-serif;

  --gp-bg:           #FFFBF2;
  --gp-surface:      #FFFFFF;
  --gp-surface-2:    #F5EEDC;
  --gp-text:         #1B1B3A;
  --gp-muted:        #62627A;
  --gp-faint:        #6B6B82;
  --gp-line:         #1B1B3A;   /* the 2px ink border */
  --gp-hairline:     #D9D2C0;   /* soft dividers only */
  --gp-shadow:       #1B1B3A;   /* hard offset shadow colour */
  --gp-primary:      #4338CA;
  --gp-primary-deep: #3730A3;
  --gp-primary-soft: #E7E5FB;
  --gp-on-primary:   #FFFFFF;
  --gp-link:         #4338CA;
  --gp-accent:       #FFC53D;
  --gp-accent-soft:  #FFF1CC;
  --gp-on-accent:    #1B1B3A;   /* text on yellow is ALWAYS ink, both themes */
  --gp-mint:         #DDF3E4;
  --gp-ink-fixed:    #1B1B3A;   /* badge/toast ink that does not flip in dark */
  --gp-cream-fixed:  #FFFBF2;
  --gp-danger:       #B3261E;
  --gp-danger-soft:  #FBE9E7;
  --gp-focus:        #4338CA;

  --gp-pebble:     58% 42% 55% 45% / 52% 48% 52% 48%;
  --gp-pebble-alt: 46% 54% 42% 58% / 55% 45% 55% 45%;

  --hard-sm: 2px 2px 0 var(--gp-shadow);
  --hard-md: 3px 3px 0 var(--gp-shadow);
  --hard:    4px 4px 0 var(--gp-shadow);
  --hard-lg: 6px 6px 0 var(--gp-shadow);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* legacy aliases: existing selectors read these, keep them */
  --paper: var(--gp-bg);            --surface: var(--gp-surface);   --surface-2: var(--gp-surface-2);
  --border: var(--gp-line);         --border-2: var(--gp-line);
  --ink: var(--gp-text);            --ink-2: var(--gp-muted);       --ink-3: var(--gp-faint);
  --pine: var(--gp-primary);        --pine-deep: var(--gp-primary-deep);
  --pine-soft: var(--gp-primary-soft); --on-pine: var(--gp-on-primary);
  --clay: var(--gp-link);           --clay-deep: var(--gp-primary-deep); --clay-soft: var(--gp-accent-soft);
  --gold: var(--gp-accent);         --gold-soft: var(--gp-accent-soft);
  --danger: var(--gp-danger);       --danger-soft: var(--gp-danger-soft);

  --shadow-sm: var(--hard-sm); --shadow: var(--hard); --shadow-lg: var(--hard-lg);
  --radius: 14px; --radius-lg: 20px; --radius-pill: 999px;
  --tap: 48px; --maxw: 1120px;
  --hero-glow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --gp-bg:           #12122B;
    --gp-surface:      #1C1C3F;
    --gp-surface-2:    #26264F;
    --gp-text:         #F4F1FF;
    --gp-muted:        #B4B4CC;
    --gp-faint:        #9A9AB8;
    --gp-line:         #E4E1FF;
    --gp-hairline:     #3A3A6B;
    --gp-shadow:       #4F46E5;
    --gp-primary:      #5B50E6;
    --gp-primary-deep: #4338CA;
    --gp-primary-soft: #2A2A5C;
    --gp-on-primary:   #FFFFFF;
    --gp-link:         #A5B4FC;
    --gp-accent:       #FFC53D;
    --gp-accent-soft:  #4A3A10;
    --gp-on-accent:    #1B1B3A;
    --gp-mint:         #1E3D2C;
    --gp-danger:       #FF8A7A;
    --gp-danger-soft:  #3A1A1A;
    --gp-focus:        #FFC53D;
  }
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: clip;
}

a { color: var(--gp-link); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 2px; }
img { max-width: 100%; }
::selection { background: var(--gp-accent); color: var(--gp-on-accent); }

h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.9rem);
  letter-spacing: -.035em;
  line-height: 1;
  margin: 0 0 .5em;
}
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  letter-spacing: -.025em;
  margin: 0 0 .6em;
}
h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin: 0 0 .4em; }

:focus-visible { outline: 3px solid var(--gp-focus); outline-offset: 3px; border-radius: 4px; }

/* ── Type helpers ──────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gp-on-accent);
  background: var(--gp-accent);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  transform: rotate(-2deg);
  margin: 0 0 14px;
}
.sub { color: var(--ink-2); margin: 0; font-size: 1.06rem; max-width: 52ch; }
.accent { font-style: normal; font-weight: inherit; color: var(--gp-link); }
.note { font-size: .85rem; color: var(--ink-3); text-align: center; margin-top: 28px; }
.err, .note.err { color: var(--danger); font-weight: 600; }

/* ── Nav ───────────────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 2px solid var(--gp-line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -.03em;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
}
.brand .logo {
  font-style: normal;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: 0;
  border-radius: 0;
  transform: none;
  box-shadow: none;
}
.brand .logo svg { width: 34px; height: 34px; display: block; }
.bow { stroke: var(--gp-text); }   /* gift-box mark in content icons */
.peb-stone { fill: var(--gp-accent); stroke: var(--gp-line); stroke-width: 2; }
.peb-ripple { fill: none; stroke: var(--gp-link); stroke-width: 2.2; stroke-linecap: round; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: .92rem; color: var(--ink-2); padding-right: 4px; white-space: nowrap; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.screen { min-height: calc(100dvh - 66px); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 56px 28px 88px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.page-header, .list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.page-header h1, .list-header h1 { margin: 0; }
.list-header .titles { min-width: 0; }
.list-header .titles .sub { margin-top: 8px; }
.list-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn, button {
  font-family: var(--font);
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: .01em;
  min-height: var(--tap);
  padding: 0 26px;
  background: var(--pine);
  color: var(--on-pine);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: var(--hard-sm);
  transition: background .16s ease, transform .1s ease, box-shadow .16s ease, opacity .16s ease;
  white-space: nowrap;
}
.btn:hover, button:hover {
  background: var(--pine-deep);
  transform: translate(-1px, -1px);
  box-shadow: var(--hard-md);
}
.btn:active, button:active { transform: translate(2px, 2px); box-shadow: none; }
.btn[disabled], button[disabled] { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn.block { width: 100%; }

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--gp-line);
  box-shadow: var(--hard-sm);
}
.btn.secondary:hover { background: var(--surface-2); border-color: var(--gp-line); }

.btn.ghost { background: transparent; color: var(--gp-link); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--pine-soft); transform: none; box-shadow: none; }

.btn.accent { background: var(--gp-accent); color: var(--gp-on-accent); font-family: var(--font-display); font-weight: 800; }
.btn.accent:hover { background: var(--gp-accent); }

.btn-icon {
  min-height: 40px; min-width: 40px; padding: 0;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  font-size: .9rem;
  box-shadow: none;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-icon svg { width: 16px; height: 16px; display: block; }
.btn-icon:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-2); transform: none; }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-icon.secondary:hover { background: var(--surface-2); }

.btn-sm {
  font-size: .78rem; font-weight: 700;
  padding: 3px 12px; min-height: 30px;
  border-radius: var(--radius-pill);
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  box-shadow: none;
  display: inline-flex; align-items: center;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-sm:hover { opacity: .75; background: transparent; transform: none; box-shadow: none; }
.btn-sm.secondary { color: var(--ink-2); }
.btn-sm.danger { color: var(--danger); }
a.btn-sm { text-decoration: none; }

/* ── Inputs ────────────────────────────────────────────────────────────────── */
.input, input[type="text"], input[type="password"], input[type="email"] {
  flex: 1; min-width: 0; width: 100%; display: block;
  min-height: var(--tap);
  padding: 0 18px;
  border: 2px solid var(--gp-line);
  border-radius: var(--radius);
  font: inherit; font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus, input:focus {
  outline: none;
  border-color: var(--gp-line);
  box-shadow: 0 0 0 3px var(--gp-accent);
}
label {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
}
label input { margin-top: 8px; }
label .note { text-align: left; margin: 0; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
#screenHero { background: var(--hero-glow); background-repeat: no-repeat; }
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 28px 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.08fr .92fr; gap: 48px; padding-top: 96px; }
}
.hero-text h1 { margin-bottom: 22px; }
.hero-text .sub { font-size: clamp(1.05rem, 1rem + .4vw, 1.2rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.trust-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 0;
  margin-top: 26px;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.trust-bar span { white-space: nowrap; }
.trust-bar span + span::before { content: "·"; margin: 0 12px; color: var(--gp-link); }

/* stacked demo gift-tag */
.hero-demo { display: flex; justify-content: center; }
.demo-stack { position: relative; }
.demo-stack::before, .demo-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.demo-stack::before { transform: rotate(-5deg) translate(-10px, 10px); background: var(--gp-accent-soft); opacity: 1; }
.demo-stack::after  { transform: rotate(3.5deg) translate(12px, 4px); background: var(--gp-primary-soft); opacity: 1; }
.demo-card {
  position: relative; z-index: 1;
  width: min(330px, 88vw);
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--hard);
  transform: rotate(-1.2deg);
  transition: transform .35s cubic-bezier(.2, .8, .3, 1);
}
.demo-card:hover { transform: rotate(0deg) translateY(-4px); }
.demo-card .thumb {
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--gp-accent-soft);
  border-bottom: 2px solid var(--gp-line);
}
.demo-emoji { color: var(--ink); filter: none; }
.demo-emoji svg { width: 88px; height: 88px; display: block; }
.demo-ribbon {
  position: absolute; top: 14px; left: 14px;
  background: var(--gp-accent); color: var(--gp-on-accent);
  border: 2px solid var(--gp-line);
  font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  box-shadow: none;
}
.demo-card .info { padding: 18px 20px 22px; }
.demo-card .info h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0 0 4px; }
.demo-card .actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.demo-card .buy, .demo-card .claim-btn { pointer-events: none; }

/* "how it works" strip */
.steps {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 28px 88px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.step {
  background: var(--surface);
  border: 2px solid var(--gp-line);
  box-shadow: var(--hard);
  border-radius: var(--radius-lg);
  padding: 26px 26px 28px;
}
.step-num {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 800;
  font-size: .9rem;
  color: var(--gp-on-accent);
  background: var(--gp-accent);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  padding: 2px 12px;
  display: inline-block;
  margin-bottom: 10px;
}
.step h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ── Auth cards ────────────────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  max-width: 440px;
  margin: 72px auto;
  padding: 44px 36px 36px;
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--hard);
  overflow: hidden;
}
.auth-card::before {           /* the ribbon across the top */
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: var(--gp-accent);
  border-bottom: 2px solid var(--gp-line);
}
.auth-card h2 { margin-bottom: 10px; }
.auth-card .sub { font-size: .95rem; }
.auth-switch { text-align: center; font-size: .92rem; color: var(--ink-2); margin: 26px 0 0; }
.form-err { color: var(--danger); font-size: .88rem; font-weight: 600; margin: 8px 0; }

/* ── Adder (paste-a-link bar) ──────────────────────────────────────────────── */
.adder {
  display: flex; gap: 8px;
  margin: 8px 0 40px;
  background: var(--surface);
  padding: 8px 8px 8px 12px;
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--hard-md);
}
.adder .input { border: 0; box-shadow: none; background: transparent; }
.adder .input:focus { outline: none; box-shadow: none; }
.adder:focus-within { border-color: var(--gp-line); box-shadow: var(--hard-md), 0 0 0 3px var(--gp-accent); }
@media (max-width: 560px) {
  .adder { flex-direction: column; background: transparent; border: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .adder .input { border: 2px solid var(--gp-line); background: var(--surface); border-radius: var(--radius); }
  .adder .input:focus { border-color: var(--gp-line); box-shadow: 0 0 0 3px var(--gp-accent); }
  .adder .btn, .adder button { width: 100%; }
}

/* ── Dashboard list cards ──────────────────────────────────────────────────── */
.list-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 580px) { .list-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.list-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--hard-md);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.list-card:hover { box-shadow: var(--hard-lg); transform: translate(-2px, -2px); border-color: var(--gp-line); }
.list-card-icon {
  color: var(--ink); flex-shrink: 0;
  width: 54px; height: 54px;
  border-radius: var(--gp-pebble);
  display: flex; align-items: center; justify-content: center;
  background: var(--gp-accent-soft);
  border: 2px solid var(--gp-line);
}
.list-card:nth-child(even) .list-card-icon { background: var(--gp-primary-soft); border-radius: var(--gp-pebble-alt); }
.list-card:nth-child(3n) .list-card-icon { background: var(--gp-mint); }
.list-card-icon svg { width: 26px; height: 26px; }
.list-card-body { flex: 1; min-width: 0; }
.list-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  margin: 0 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-card .note { text-align: left; margin: 0; }

/* ── Product cards — the gift tags ─────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 540px) { .grid { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); } }
.card {
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--hard);
  display: flex; flex-direction: column;
  transition: box-shadow .22s, transform .22s, border-color .22s;
}
.card:hover { box-shadow: var(--hard-lg); transform: translate(-2px, -2px); border-color: var(--gp-line); }

/* No overflow:hidden on .thumb: claim.js appends .badge inside it and would be clipped. */
.card .thumb { position: relative; aspect-ratio: 1 / 1; margin: 14px 14px 0; background: var(--gp-accent-soft); border: 2px solid var(--gp-line); border-radius: var(--gp-pebble); }
.card:nth-child(even) .thumb { border-radius: var(--gp-pebble-alt); background: var(--gp-primary-soft); }
.card:nth-child(3n) .thumb { background: var(--gp-mint); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.card .thumb.is-fallback img { display: none; }
.card .thumb .fallback {
  display: none;
  position: absolute; inset: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: transparent;
  border-radius: inherit;
  color: var(--ink);
  text-align: center;
  padding: 20px;
}
.card .thumb.is-fallback .fallback { display: flex; }
.card .thumb .fallback .mark { color: var(--ink); opacity: 1; filter: none; }
.card .thumb .fallback .mark svg { width: 46px; height: 46px; display: block; }
.card .thumb .fallback .domain {
  font-family: var(--font);
  font-style: normal;
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink);
  word-break: break-all;
}

.card .info { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .info h3 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.008em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  margin: 0;
}
.card .actions {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 12px;
  align-items: center;
}
.buy {
  flex: 1; min-width: 0;
  min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px;
  background: var(--pine);
  color: var(--on-pine);
  text-decoration: none;
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-pill);
  font-size: .92rem; font-weight: 700;
  box-shadow: var(--hard-sm);
  transition: background .16s, transform .1s;
}
.buy:hover { background: var(--pine-deep); transform: translate(-1px, -1px); }

/* claim button — the promise ticket */
.claim-btn {
  min-height: var(--tap);
  padding: 0 18px;
  border: 2px solid var(--gp-line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-size: .92rem; font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background .16s, color .16s, border-color .16s;
}
.claim-btn:hover { background: var(--gp-accent-soft); transform: none; box-shadow: none; }
.claim-btn[data-state="mine"] {
  background: var(--gp-accent);
  color: var(--gp-on-accent);
  border-color: var(--gp-line);
  animation: claim-pop .45s cubic-bezier(.3, 1.6, .5, 1), claim-ring .7s ease-out;
}
.claim-btn[data-state="taken"] {
  border-color: var(--gp-hairline);
  border-style: dashed;
  color: var(--ink-3);
  background: transparent;
  cursor: not-allowed;
}
.claim-btn:disabled { opacity: .9; }
@keyframes claim-pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes claim-ring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); }
  100% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--gold) 0%, transparent); }
}

/* claimed badge (givers only; the owner never sees it) */
.badge {
  position: absolute; top: -8px; right: -8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  background: var(--gp-ink-fixed);
  color: var(--gp-cream-fixed);
  border: 2px solid var(--gp-line);
  backdrop-filter: none;
  box-shadow: none;
}
.badge.claimed { background: var(--gp-accent); color: var(--gp-on-accent); }

.aff { font-size: .74rem; color: var(--ink-3); margin: 0; display: flex; align-items: center; gap: 5px; }
.aff svg { width: 13px; height: 13px; flex-shrink: 0; }
.aff.ok { color: var(--gp-link); font-weight: 700; letter-spacing: .04em; }

/* ── Health banners ────────────────────────────────────────────────────────── */
.health-banner {
  padding: 12px 16px;
  font-size: .82rem; font-weight: 600;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border-bottom: 2px solid var(--gp-line);
}
.health-banner.broken { background: var(--danger-soft); color: var(--danger); }
.health-banner.price-drop { background: var(--gp-primary-soft); color: var(--ink); }
.card-broken { border-color: var(--danger); box-shadow: 4px 4px 0 var(--danger); }
.card-deal { border-color: var(--gp-line); box-shadow: 4px 4px 0 var(--gp-primary); }

/* ── Empty states ──────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 72px 28px;
  border: 2px dashed var(--gp-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink-2);
}
.empty .mark {
  color: var(--ink); line-height: 1;
  width: 84px; height: 84px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--gp-accent-soft);
  border: 2px solid var(--gp-line);
  border-radius: var(--gp-pebble);
  box-shadow: var(--hard-sm);
}
.empty .mark svg { width: 38px; height: 38px; }
.empty h2 { margin: 22px 0 8px; font-size: 1.5rem; color: var(--ink); }
.empty p { margin: 0 auto; max-width: 38ch; }

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, #12122B 60%, transparent);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-bg[hidden] { display: none !important; }
.modal {
  background: var(--surface);
  border: 2px solid var(--gp-line);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 460px; min-width: 0;
  max-height: calc(100dvh - 40px); overflow-y: auto;
  box-shadow: var(--hard-lg);
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em;
  margin: 0 0 24px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 26px; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  background: var(--ink); color: var(--paper);
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-size: .93rem; font-weight: 700;
  box-shadow: none;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.15);
  pointer-events: none; white-space: nowrap; z-index: 300;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Groups hub ────────────────────────────────────────────────────────────── */
.group-member { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 2px dashed var(--gp-hairline); }
.group-member:last-child { border-bottom: none; }
.group-member h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 12px; font-size: 1.35rem; }

/* ── Share page masthead ───────────────────────────────────────────────────── */
.masthead { display: block; text-align: center; margin: 20px auto 48px; max-width: 720px; }
.masthead .eyebrow { margin-bottom: 16px; }
.masthead h1 { margin: 0 0 14px; }
.masthead .sub { margin: 0 auto; }
.share-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 28px 0 0;
}
.masthead + .grid, .masthead + .empty { margin-top: 8px; }

.flourish {
  border: 0;
  height: 2px;
  max-width: 300px;
  margin: 52px auto 0;
  background: var(--gp-hairline);
  position: relative;
  overflow: visible;
}
.flourish::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 11px;
  background: var(--gp-accent);
  border: 2px solid var(--gp-line);
  border-radius: var(--gp-pebble);
  box-shadow: 0 0 0 8px var(--paper);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: 720px;
  margin: 64px auto 40px;
  padding: 28px 28px 0;
  font-size: .8rem; line-height: 1.7;
  color: var(--ink-3);
  text-align: center;
}
.site-footer p { margin: 0 0 8px; }
.site-footer .fine {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .66rem;
  font-weight: 650;
}

/* ── Finder (hero + skip head) ─────────────────────────────────────────────── */
.finder { margin-top: 22px; padding: 16px; background: var(--gp-primary); border: 2px solid var(--gp-line); border-radius: 20px; box-shadow: var(--hard); }
.finder label { color: #fff; font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 8px; }
.finder .input { margin: 0; }
.finder .btn { margin-top: 10px; }
.finder :focus-visible { outline-color: var(--gp-accent); }
.hero-alt { margin: 16px 0 0; font-size: .95rem; color: var(--ink-2); }

/* ── Skip stage ────────────────────────────────────────────────────────────── */
.skip-stage { max-width: 460px; margin: 0 auto; }
.skip-head { display: flex; gap: 8px; align-items: stretch; }
.skip-head .btn { min-height: var(--tap); padding: 0 18px; }
.skip-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.skip-track { position: relative; height: 56px; margin: 18px 0 6px; }
.skip-ring { position: absolute; bottom: 8px; width: 34px; height: 10px; margin-left: -17px; border: 2px solid var(--gp-link); border-radius: 50%; opacity: .45; }
.skip-ring:nth-child(1){left:10%} .skip-ring:nth-child(2){left:30%} .skip-ring:nth-child(3){left:50%} .skip-ring:nth-child(4){left:70%} .skip-ring:nth-child(5){left:90%}
.skip-ring.hit { animation: skip-ripple .5s ease-out; }
.skip-stone { position: absolute; bottom: 12px; left: calc(10% + var(--i, 0) * 20%); width: 28px; height: 20px; margin-left: -14px; background: var(--gp-accent); border: 2px solid var(--gp-line); border-radius: var(--gp-pebble); transition: left .35s cubic-bezier(.3,.7,.4,1); }
.skip-stone.hop { animation: skip-hop .35s ease-out; }
@keyframes skip-hop { 0%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-24px) rotate(-14deg)} 100%{transform:translateY(0) rotate(0)} }
@keyframes skip-ripple { 0%{transform:scale(1);opacity:1} 100%{transform:scale(1.9);opacity:.45} }
.skip-count { font: 800 .9rem var(--font-display); text-align: center; margin: 0 0 12px; }
.skip-card { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border: 2px solid var(--gp-line); border-radius: 20px; box-shadow: var(--hard); min-height: 148px; transition: transform .18s, opacity .18s; }
.skip-card.out { transform: translateX(-28px) rotate(-3deg); opacity: 0; }
.skip-card.in  { transform: translateX(28px); opacity: 0; }
.skip-thumb { flex: none; width: 88px; height: 88px; display: grid; place-items: center; color: var(--ink); background: var(--gp-accent-soft); border: 2px solid var(--gp-line); border-radius: var(--gp-pebble); }
.skip-thumb[data-tone="1"] { background: var(--gp-primary-soft); border-radius: var(--gp-pebble-alt); }
.skip-thumb[data-tone="2"] { background: var(--gp-mint); transform: rotate(-6deg); }
.skip-thumb svg { width: 38px; height: 38px; }
.skip-info { flex: 1; min-width: 0; }
.skip-info h3 { font-size: 1.15rem; margin: 0 0 4px; }
.skip-info p { margin: 0 0 8px; color: var(--ink-2); font-size: .92rem; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; font: 700 .72rem var(--font); letter-spacing: .04em; background: var(--gp-accent); color: var(--gp-on-accent); border: 2px solid var(--gp-line); border-radius: var(--radius-pill); }
.chip.soft { background: var(--surface); color: var(--ink); }
button.chip { min-height: 44px; box-shadow: none; cursor: pointer; }
.skip-why { font-size: .78rem; color: var(--ink-3); margin-top: 6px; }
.skip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.skip-actions #skipBtn { grid-column: 1 / -1; min-height: 56px; font-size: 1.1rem; }
.skip-actions #skipBtn { background: var(--gp-accent); color: var(--gp-on-accent); font-family: var(--font-display); font-weight: 800; }
.skip-actions #skipBtn:hover { background: var(--gp-accent); }
.skip-actions #moreBtn { background: var(--surface); color: var(--ink); }
.skip-kept { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.kept-slot { width: 30px; height: 22px; border: 2px dashed var(--gp-line); border-radius: var(--gp-pebble); }
.kept-slot.full { border-style: solid; background: var(--gp-accent); }
.skip-steer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.skip-out { display: inline-block; margin-top: 8px; font-size: .88rem; }
.skip-note { min-height: 1.4em; margin: 12px 0 0; font-size: .9rem; font-weight: 600; text-align: center; color: var(--ink-2); }
.skip-note.err { color: var(--danger); }
.skip-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; font-size: .82rem; color: var(--ink-2); }
.skip-note button.linklike, .skip-meta button.linklike { min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; color: var(--gp-link); font-weight: 600; text-decoration: underline; font-size: inherit; }
.skip-note button.linklike:hover, .skip-meta button.linklike:hover { background: none; transform: none; box-shadow: none; }

/* ── People + keep picker ──────────────────────────────────────────────────── */
.person-card { flex-wrap: wrap; }
.person-card .list-card-body { flex: 1 1 140px; }
.person-card .list-card-icon { font: 800 1.1rem var(--font-display); }
.modal select, .modal textarea { width: 100%; min-height: var(--tap); margin-top: 8px; padding: 10px 14px; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--gp-line); border-radius: var(--radius); }
.modal textarea { min-height: 84px; resize: vertical; }
.modal select, .modal textarea, .modal .input { max-width: 100%; box-sizing: border-box; }
.modal .note-line { font-size: .82rem; color: var(--ink-2); margin: -10px 0 16px; text-align: left; }
.keep-picker-list { display: grid; gap: 10px; margin: 0 0 4px; }
.keep-picker-list .btn { justify-content: flex-start; white-space: normal; text-align: left; }
.share-bar .btn { white-space: nowrap; }
.thumb.is-idea .fallback .domain { font-weight: 800; }

/* ── Small screens ─────────────────────────────────────────────────────────── */
@media (max-width: 460px) {
  .site-nav { padding: 12px 16px; }
  .brand { font-size: 1.25rem; gap: 4px; }
  .brand .logo, .brand .logo svg { width: 28px; height: 28px; }
  .site-nav { gap: 8px; }
  .nav-right { gap: 6px; }
  .site-nav .btn { padding: 0 12px; min-height: 40px; font-size: .86rem; }
  .wrap { padding: 32px 16px 64px; }
  .hero { padding: 28px 16px 28px; }
  .steps { padding: 8px 16px 64px; }
  .auth-card { margin: 28px 14px; padding: 36px 22px 28px; }
  .nav-user { display: none; }
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
