/* ============================================================
   Neighdoor.dev design system (mature / professional)
   Research notes (Linear / Stripe / Vercel / Product Hunt /
   Tinder, mature versions):
   - Mature products are quiet: near-neutral foundation + ONE
     disciplined accent (60-30-10), hairline borders carry
     hierarchy, tight tracking on display type, 4px grid.
   - Trust comes from consistency, not decoration: same radius,
     same shadow step, same spacing everywhere; clear pricing,
     a real footer, honest copy, no fake stats, no loud hero.
   - Dark mode is a first-class theme, not an inversion: warm
     dark neutrals (never pure black), elevated surfaces, the
     same accent warmed up, hairlines still visible.
   - Anti-slop rules: no purple/blue gradient, no gradient hero,
     no glassmorphism, no emoji as icons, no pill-everything,
     no centered-everything, no heavy shadows, no fake depth.
   ============================================================ */

:root {
  color-scheme: light;
  /* Neutrals: warm paper, not cold grey, not pure white */
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f4f2ef;
  --surface-3: #ece9e5;
  --elevated: #ffffff;
  --overlay: rgba(28, 25, 23, 0.48);
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #6f6a64;
  --faint: #a8a29e;
  --line: #e8e5e2;
  --line-strong: #d6d3d1;

  /* ONE accent: burnt orange. Warm, friendly, founder energy.
     Solid only. Never a gradient. Used for: primary CTA, active
     nav, featured labels, focus rings. Nothing else. */
  --accent: #c2410c;
  --accent-ink: #9a3412;
  --accent-soft: #fff1e7;
  --accent-strong: #b93a09;

  /* Semantic: used sparingly, always with text, never as decoration */
  --good: #15803d;
  --good-soft: #ecfdf3;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --amber: #92400e;
  --amber-soft: #fffbeb;

  /* Cover tints: flat, desaturated, paper-like. The project
     monogram carries the identity, not a rainbow banner. */
  --tint-1: #f1ebe1; /* sand   */
  --tint-2: #e9efe8; /* sage   */
  --tint-3: #edeae5; /* stone  */
  --tint-4: #f3e9e1; /* clay   */
  --tint-5: #e8edee; /* slate  */
  --tint-6: #f0e9ec; /* rosewood */

  /* Type: system stack only. No webfont fetch, no generic
     "AI font pairing". One family, weight + tracking do the work. */
  --font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing: 4px base */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* Radius: restrained, consistent. 10px controls, 12px cards,
     16px deck. Pills reserved for tiny badges only. */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-deck: 16px;

  /* Shadow: hairlines do the hierarchy; shadows are whispers. */
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-deck: 0 1px 2px rgba(28, 25, 23, 0.06), 0 16px 32px rgba(28, 25, 23, 0.10);
}

/* Explicit dark theme: selected by the toggle, persisted. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110;
  --surface: #1b1a18;
  --surface-2: #252320;
  --surface-3: #322f2c;
  --elevated: #211f1d;
  --overlay: rgba(0, 0, 0, 0.6);
  --ink: #f4f2ef;
  --ink-2: #d6d3d1;
  --muted: #a8a29e;
  --faint: #78716c;
  --line: #2c2a27;
  --line-strong: #44403c;
  --accent: #fb923c;
  --accent-ink: #fdba74;
  --accent-soft: #2e1d12;
  --accent-strong: #f97316;
  --good: #4ade80;
  --good-soft: #122b1c;
  --danger: #f87171;
  --danger-soft: #331616;
  --amber: #fbbf24;
  --amber-soft: #2c230c;
  --tint-1: #2a2521;
  --tint-2: #232a24;
  --tint-3: #282623;
  --tint-4: #2b2320;
  --tint-5: #22282a;
  --tint-6: #2a2326;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-deck: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 32px rgba(0, 0, 0, 0.5);
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s2); letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 var(--s3); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- Top bar: solid, no blur, no glass ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: 0 16px;
  height: 57px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; flex: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; letter-spacing: 0; flex: none;
}
.brand-tld { color: var(--muted); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: var(--s2); position: relative; }

/* ---------- Left hamburger menu (2026-12-03) ----------
   Normal-website pattern: ≡ (left, icon-only) + brand, Sign in
   button (right, in the header). The dropdown anchors to the LEFT
   under the hamburger. No bottom bar exists anymore. */
.nav-menu-btn {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
}
.nav-menu-btn:hover { background: var(--surface-2); }
.nav-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-menu-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--accent-ink); }
.nav-menu-btn svg { width: 20px; height: 20px; }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: 264px; max-width: calc(100vw - 24px);
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
.nav-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-md);
  background: transparent; border: 0; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-align: left;
  cursor: pointer; text-decoration: none;
}
.nav-menu-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-menu-item span { flex: 1; }
/* ---------- Profile menu (#/profile, 2026-12-03, Yoriko) ----------
   Vertical menu list, one full-width row per item, top to bottom.
   It replaces the old wrapping pill buttons. The Credits row shows the
   remaining balance on the right (profile is login-gated, so the
   balance is only ever visible when signed in; the logged-out header
   still shows only the Sign in button). Sign out is a red row in the
   same list. */
.profile-menu { padding: 6px; margin-top: 16px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-align: left;
  cursor: pointer; text-decoration: none;
}
.profile-menu-item:last-child { border-bottom: 0; }
.profile-menu-item:hover { background: var(--surface-2); text-decoration: none; }
.profile-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.profile-menu-item > span:first-child { flex: 1; }
.profile-menu-item svg { flex: none; color: var(--muted); }
/* Support history collapse (2026-12-04, Yoriko: show 5, tap the
   heading to open all): the heading is the toggle when a list has
   more than 5 entries; the chevron points right when collapsed and
   down when expanded. */
.hh-toggle { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.hh-toggle .hh-chevron { display: inline-flex; color: var(--muted); }
.hh-toggle .hh-chevron svg { transition: transform .15s ease; }
.hh-toggle[data-expanded="true"] .hh-chevron svg { transform: rotate(90deg); }
.hh-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.profile-menu-value { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-menu-danger, .profile-menu-danger svg { color: var(--danger); }
/* Header auth: the Sign in button is special. Its own
   burnt-orange button (like the primary buttons) with a
   log-in icon, always visible in the header. When signed in
   the header shows ONLY a compact avatar circle (initial
   letter) linking to #/profile. No handle text, no Sign out
   button here (2026-12-03: handle + Sign out overflowed the
   brand at 390px). Sign out lives on the Profile page. */
.header-auth { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.header-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; line-height: 1; text-decoration: none;
}
.header-avatar:hover { background: var(--accent-strong); text-decoration: none; }
.header-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.header-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.header-auth-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 36px; padding: 9px 14px; border: 0; border-radius: var(--r-md);
  background: var(--accent); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.25;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.header-auth-btn:hover { background: var(--accent-strong); text-decoration: none; }
.header-auth-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.header-auth-btn svg { flex: none; width: 15px; height: 15px; }

/* Narrow phones (390px): the ".dev" suffix is dropped so the
   header: hamburger + brand + Sign in button / avatar. Always
   fits with zero overlap in both auth states. */
@media (max-width: 480px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-left { gap: 10px; }
  .brand-tld { display: none; }
}

/* ---------- Layout ---------- */
.app { max-width: 880px; margin: 0 auto; padding: var(--s5) 16px 48px; }
.page-head { margin: var(--s2) 0 var(--s5); max-width: 560px; }
.page-head h1 { font-size: 26px; margin-bottom: 6px; }
.page-head p { color: var(--muted); margin: 0; font-size: 15px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 8px;
}

/* ---------- Buttons: rectangles, one primary per view ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; vertical-align: middle;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-md); font-weight: 600; font-size: 15px;
  line-height: 1.25; transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; min-height: 32px; }
.btn-block { width: 100%; }
/* Auth sheet divider: "or with email" between OAuth and email form. */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-lg { padding: 13px 20px; font-size: 16px; min-height: 48px; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s4);
  overflow: hidden; position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.grid .card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card h3 { font-size: 18px; }
.card-popular { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }

/* Cover: flat tint + monogram. No gradient, no emoji, no stock art.
   The monogram (project initials) is the identity. */
.cover {
  height: 132px; border-radius: var(--r-md);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 16px; margin: -16px -16px 14px;
  background: var(--tint-1);
}
.cover-mono {
  font-size: 44px; font-weight: 700; letter-spacing: -0.04em;
  line-height: 1; color: var(--ink); opacity: 0.85;
}
/* Uploaded logo: sits on a plain surface tile so white-background
   logos read correctly in light AND dark mode. Same tile everywhere
   the cover appears (deck, list, detail). */
.cover-logo {
  width: 76px; height: 76px; flex: none;
  object-fit: contain; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 10px;
}
.deck-card .cover-logo { width: 96px; height: 96px; }

/* Logo chip next to the project name (2026-12-03, Yoriko: "Kenapa
   logonya pada hilang ya?"). The banner fix removed the logo tile
   from banner covers, so cards with abstract banners showed no
   branding at all. The chip lives in the card body next to the
   name, never on the banner. */
.name-row { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s2); }
.name-row h1, .name-row h2, .name-row h3 { flex: 1; min-width: 0; margin: 0; }
.deck-body .name-row { margin-bottom: 4px; }
.deck-body .name-row h2 { margin-bottom: 0; }
.logo-chip { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.logo-chip-img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-chip-mono { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }

/* Save star (2026-12-03, Yoriko): top-right of the deck card and
   the detail card. Pill with a star + a visible text label.
   "Save" when not saved, "Saved" when saved (2026-12-03: the bare
   star had no label, and Yoriko's screenshot showed it clipped at
   the card's right edge). The pill sits fully INSIDE the card
   (top/right 12px) and never overflows it. Outline star when not
   saved; filled YELLOW star when saved. Solid surface behind it so
   it reads on any banner colour, light or dark. */
.save-star {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: auto; height: 36px; padding: 0 12px; gap: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; box-shadow: var(--shadow-sm);
  color: var(--ink-2); cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform 0.1s ease, color 0.12s ease;
}
.save-star:hover { transform: scale(1.04); }
.save-star:active { transform: scale(0.97); }
.save-star svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; }
.save-star-label { line-height: 1; }
.save-star.is-saved { color: #b45309; }
.save-star.is-saved svg { fill: #facc15; stroke: #eab308; }

.detail-card { position: relative; }

/* Logo upload field: preview tile + file / URL fallback. */
.logo-preview {
  display: none; align-items: center; gap: 12px; margin-top: 10px;
}
.logo-preview.on { display: flex; }
.logo-preview img {
  width: 64px; height: 64px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 8px; flex: none;
}
.logo-preview .logo-preview-meta { font-size: 13px; color: var(--muted); }
.logo-preview button { margin-left: auto; }
.tint-1 { background: var(--tint-1); }
.tint-2 { background: var(--tint-2); }
.tint-3 { background: var(--tint-3); }
.tint-4 { background: var(--tint-4); }
.tint-5 { background: var(--tint-5); }
.tint-6 { background: var(--tint-6); }

.tagline { color: var(--ink-2); font-size: 14px; }
.price { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.price small { color: var(--muted); font-weight: 500; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-featured { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badge-premium { background: var(--surface-2); color: var(--ink-2); }
/* Verified badge (migration 0016, admin accounts only): a blue
   checkmark like Twitter/X and Instagram: solid blue circle with a
   white check, no text. Icon only; it scales with the surrounding
   text and never wraps (flex:none + line-height 0). */
.badge-verified { display: inline-flex; align-items: center; vertical-align: middle; line-height: 0; flex: none; }
.badge-verified svg { display: block; width: 1.05em; height: 1.05em; }
/* Title badges sit inside the heading, right after the name, so
   they need a little breathing room from the text. */
.name-row h1 .badge-premium, .name-row h2 .badge-premium, .name-row h3 .badge-premium { margin-left: 8px; }
.name-row h1 .badge-verified, .name-row h2 .badge-verified, .name-row h3 .badge-verified { margin-left: 6px; }
/* Verified check beside a display name (2026-12-04, Yoriko): the
   dev page header and the own-profile header put the check directly
   after the name in the h1, so it needs the same breathing room. */
.dev-head-main h1 .badge-verified, .profile-head-text h1 .badge-verified { margin-left: 6px; }
/* Main-project menu (migration 0017, Yoriko 2026-12-04): the three
   dot button sits top-right of a My Projects card, over the cover
   corner, with a solid background so it never looks clipped; the
   popover opens below it, right-aligned. The card is position:
   relative, so the absolute wrap anchors to it. */
.card-menu-wrap { position: absolute; top: 10px; right: 10px; z-index: 5; }
.card-menu-btn { min-width: 34px; font-size: 16px; font-weight: 700; line-height: 1; }
.card-menu { position: absolute; top: 40px; right: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 4px; z-index: 6; }
.card-menu-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); border-radius: var(--r-sm); cursor: pointer; }
button.card-menu-item:hover { background: var(--surface-2); }
.card-menu-current { color: var(--muted); cursor: default; }
/* Trust score line on project cards / deck cards (Plus/Premium
   owners only) and the pay-it-forward nudge. */
.trust-line { margin-top: 8px; }
.pf-nudge { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
/* Top products (2026-12-03): rank chip + Hot badge for the top 3. */
.badge-rank { background: var(--ink); color: var(--bg); border-color: transparent; font-variant-numeric: tabular-nums; }
.badge-hot { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
/* Project location line (pin + "City, Country") on cards and deck. */
.card-loc { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.card-loc svg { flex: none; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
/* Refund policy (migration 0012, 2026-12-03): "Non-refundable" badge
   on cards, deck cards and detail when the seller marked purchases
   via Neighdoor as non-refundable. Muted, not alarming. It is the
   seller's stated policy, and Neighdoor never handles refunds. */
.badge-nonrefund { background: var(--surface-2); color: var(--ink-2); }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Button row (My Projects header): same flex alignment as .row but a
   slightly wider gap so two buttons never sit on different baselines. */
.btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Intro (replaces the gradient hero) ---------- */
.intro { padding: 12px 0 var(--s6); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.intro h1 { font-size: 34px; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 12px; max-width: 20ch; }
.intro p { color: var(--muted); max-width: 56ch; font-size: 16px; line-height: 1.6; margin-bottom: var(--s4); }
@media (min-width: 640px) { .intro h1 { font-size: 42px; } }
.section-head { margin: var(--s6) 0 var(--s4); }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- How it works + trust strip (mature-product cues) ---------- */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  margin-top: var(--s4); padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.trust-strip span { display: inline-flex; align-items: center; gap: 7px; }
.trust-strip svg { color: var(--good); flex: none; }
.how { margin-bottom: var(--s6); }
.how-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .how-grid { grid-template-columns: repeat(3, 1fr); } }
.how-step {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
}
.how-step .step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.how-step h3 { font-size: 16px; margin-bottom: 5px; }
.how-step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Site footer: real product, real fine print ---------- */
.site-footer {
  max-width: 880px; margin: 0 auto; padding: var(--s6) 16px 48px;
  border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer h4 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.site-footer p { color: var(--muted); font-size: 14px; max-width: 34ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a { color: var(--ink-2); font-size: 14px; }
.site-footer li a:hover { color: var(--ink); }
.footer-fine {
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  color: var(--faint); font-size: 12px;
}
/* Footer theme slider (2026-12-04, Yoriko: Light/Dark slide at the
   bottom of every page, light is the default). Two-state slide: Light
   left, Dark right; knob slides right in dark mode. Warm paper look in
   both themes; fits at 390px. */
.footer-theme {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.theme-switch {
  width: 52px; height: 28px; flex: none;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); cursor: pointer; padding: 2px;
  display: inline-flex; align-items: center;
  transition: background 0.15s ease;
}
.theme-switch .theme-knob {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.theme-switch.on { background: var(--accent-strong); border-color: var(--accent-strong); }
.theme-switch.on .theme-knob { transform: translateX(24px); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.deck-wrap { max-width: 420px; margin: 0 auto; }
.deck { position: relative; min-height: 480px; margin-bottom: var(--s4); touch-action: pan-y; }
.deck-card {
  position: absolute; inset: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-deck);
  box-shadow: var(--shadow-deck); overflow: hidden;
  display: flex; flex-direction: column;
  will-change: transform; user-select: none; -webkit-user-select: none;
  cursor: pointer;
}
.deck-card .cover { height: 208px; margin: 0; border-radius: 0; padding: 18px 20px; flex: none; }
.deck-card .cover-mono { font-size: 64px; }
.deck-body { padding: 18px 20px 20px; overflow: auto; flex: 1; display: flex; flex-direction: column; }
.deck-body h2 { font-size: 23px; margin-bottom: 4px; }
.deck-body .tagline { font-size: 15px; margin-bottom: 8px; }
.deck-body .desc { color: var(--muted); font-size: 14px; margin-bottom: 0; }
/* Description clamp (Yoriko 2026-12-03): deck + grid cards show at most
   3 lines of the description. The full text lives on the detail page. */
.card-desc, .deck-body .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deck-foot {
  margin-top: 16px; padding-top: 16px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line);
}
.deck-card.dragging { transition: none !important; }
/* Featured corner label (2026-12-04, Yoriko: the "Featured" chip
   left the chips row; a boosted project shows a "Featured" label at
   the top-right corner of its cover, deck cards ONLY, since boost is
   a swipe thing). It sits just below the save-star pill (star spans
   top 12-48px) so it never covers the star or the project name, and
   it is pointer-events none so it never interferes with the deck
   drag or tap-to-detail. Solid dark burnt-orange background + white
   text reads on dark banners and light tints alike, in both themes. */
.deck-featured-label {
  position: absolute; top: 56px; right: 12px; z-index: 5;
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px;
  background: #9a3412; color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.deck-stamp {
  position: absolute; top: 64px; z-index: 3; font-weight: 700; font-size: 19px;
  letter-spacing: 0.08em; padding: 5px 12px; border-radius: var(--r-sm); border: 2px solid;
  opacity: 0; pointer-events: none; background: var(--surface);
}
.stamp-help { left: 16px; color: var(--good); border-color: var(--good); transform: rotate(-8deg); }
.stamp-skip { right: 16px; color: var(--danger); border-color: var(--danger); transform: rotate(8deg); }

/* ---------- Project banner (migration 0007) ----------
   Wide 1200x400 artwork-only image as the cover. The cover keeps a
   strict 3:1 aspect (aspect-ratio) so a 1200x400 banner shows fully
   with no side-cropping, and the image uses object-fit: contain on
   the tint background, so banner text is never cut off even for a
   non-3:1 image. NO logo tile and NO monogram on a banner cover
   (2026-12-03, Yoriko: the tile duplicated the banner's own
   wordmark), the monogram is only a hidden fallback shown if the
   banner image fails to load. Without a banner the flat tint +
   monogram cover is unchanged. The old white category/price meta
   strip on the cover is gone (Yoriko's screenshot, 2026-12-03).
   Category + price already show in the card body. */
.cover-banner { position: relative; padding: 0; overflow: hidden; aspect-ratio: 3 / 1; height: auto; }
.cover.cover-banner, .deck-card .cover.cover-banner { aspect-ratio: 3 / 1; height: auto; padding: 0; }
.cover-banner-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.cover-banner .cover-mono {
  position: relative; z-index: 2;
  margin: 14px 0 0 16px;
}
.cover-banner .cover-mono {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 10px 14px; font-size: 32px;
  display: inline-block; width: auto; align-self: flex-start;
}
.deck-card .cover-banner .cover-mono { font-size: 44px; }

/* Banner upload field: same preview pattern as the logo. */
.banner-preview { display: none; align-items: center; gap: 12px; margin-top: 10px; }
.banner-preview.on { display: flex; }
.banner-preview img {
  width: 160px; height: 54px; object-fit: cover;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); flex: none;
}
.banner-preview .banner-preview-meta { font-size: 13px; color: var(--muted); }
.banner-preview button { margin-left: auto; }

/* ---------- Save for later (migration 0008) ----------
   The star lives top-right on the deck card and the detail card
   (see .save-star above). Saving never advances the deck. */
.btn.is-saved { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* Deck controls: labelled, thumb-friendly, one primary action */
.deck-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.deck-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 56px; border-radius: var(--r-lg); font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.deck-btn:hover { background: var(--surface-2); }
.deck-btn:active { transform: translateY(1px); }
.deck-btn svg { flex: none; }
.deck-btn-help { background: var(--accent); border-color: var(--accent); color: #fff; }
.deck-btn-help:hover { background: var(--accent-strong); }
.deck-progress {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.deck-progress .track { flex: 1; height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.deck-progress .fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.25s ease; }
.deck-empty { text-align: left; padding: 40px 20px; }
.deck-empty h2 { font-size: 22px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--accent); }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps span { flex: 1; height: 3px; border-radius: 99px; background: var(--line); }
.steps span.on { background: var(--accent); }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }
.notice { background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }

/* ---------- Sheet (modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); color: var(--ink); width: 100%; max-width: 560px;
  border-radius: var(--r-deck) var(--r-deck) 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow: auto; border: 1px solid var(--line);
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: 20px; } .sheet { border-radius: var(--r-deck); } }
.sheet h2 { font-size: 21px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg); font-weight: 500; font-size: 14px;
  padding: 11px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-deck);
  max-width: 520px; text-align: center; animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* First-paint loading shell (2026-12-03): paints with the static HTML
   so a cold first load never looks dead while getState is in flight.
   render() replaces #app content once state arrives. */
.loading-shell { padding: 48px 20px; text-align: center; color: var(--muted); }
.loading-shell p { margin: 14px 0 22px; font-size: 15px; }
.loading-spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: loading-spin 0.9s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-skel { height: 74px; max-width: 560px; margin: 0 auto 12px; border-radius: 12px; background: var(--surface-2); animation: loading-pulse 1.4s ease-in-out infinite; }
.loading-skel:nth-child(3) { opacity: 0.7; }
.loading-skel:nth-child(4) { opacity: 0.45; }
@keyframes loading-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
/* Usage bars (#/usage, Step 4x). */
.usage-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 2px 0 14px; }
.usage-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* ---------- Dashboard / ledger ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: var(--s4); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.ledger-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .amt { font-weight: 700; white-space: nowrap; }
.amt.pos { color: var(--good); }
.amt.neg { color: var(--danger); }
.empty { text-align: left; color: var(--muted); padding: 28px 4px; }

/* ---------- Pricing ---------- */
.price-card { text-align: left; }
.price-card b { font-size: 28px; letter-spacing: -0.02em; }
.pack-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .pack-grid { grid-template-columns: repeat(3, 1fr); } }
.pack-grid .card { display: flex; flex-direction: column; }
.pack-grid .btn { margin-top: auto; }
/* Membership tiers (Plus / Premium, 2026-12-03): same 3-across
   grid as the credit packs, buttons pinned to the card bottom. */
.tier-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
.tier-grid .card { display: flex; flex-direction: column; }

/* ---------- Leaderboard (TrustMRR-style) ----------
   Dense rows, not cards: rank, logo, name + one-line tagline,
   founder + category, and the sort metric right-aligned.
   Medals for ranks 1–3 only; everything else is a plain number. */
.leaderboard { margin-bottom: var(--s6); }
.lb-controls {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}

/* Top products carousel (2026-12-03, Yoriko: "digeser aja jadi
   bukan scroll ke bawah"). Horizontal scroll-snap track: one card
   at a time on mobile with a peek of the next card, native touch
   swipe/drag, prev/next arrows + "N of M" counter + dots below.
   The search + industry + sub-industry + country filters that used
   to sit above this list were removed (her screenshot, red X).
   Only supported products (paid_helps >= 1) appear here. */
.top-carousel { margin-bottom: var(--s4); }
.top-track {
  display: flex; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 2px 2px 10px; margin: 0 -2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.top-track::-webkit-scrollbar { display: none; }
.top-track .card {
  flex: 0 0 86%; scroll-snap-align: start;
  margin: 0; /* grid gap does not apply inside the flex track */
}
@media (min-width: 640px) {
  .top-track .card { flex-basis: 420px; }
}
.top-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 4px;
}
.top-arrow {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
}
.top-arrow:hover:not(:disabled) { background: var(--surface-2); }
.top-arrow:disabled { opacity: 0.35; cursor: default; }
.top-counter { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-dots { display: inline-flex; align-items: center; gap: 5px; max-width: 40vw; overflow: hidden; }
.top-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-strong); cursor: pointer; flex: none;
}
.top-dot.on { background: var(--accent); }
.lb-sorts {
  display: flex; gap: 6px; overflow-x: auto; flex: 1;
  min-width: 0; /* never squeeze into a sliver next to the selects */
  scrollbar-width: none; padding-bottom: 2px;
}
.lb-sorts::-webkit-scrollbar { display: none; }
.lb-sort {
  flex: none; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.lb-sort:hover { background: var(--surface-2); color: var(--ink); }
.lb-sort.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lb-period {
  flex: none; padding: 7px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 13px; font-weight: 600;
}
/* Leaderboard pagination (2026-12-03): 10 supporters per page, every
   supporter who supported appears on some page. Pills match .lb-sort;
   the row wraps so it fits at 390px. */
.lb-pagination { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.lb-showing { margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lb-page {
  flex: none; min-width: 36px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.lb-page:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.lb-page.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lb-page:disabled { opacity: 0.4; cursor: default; }
.lb-page-dots { align-self: center; color: var(--faint); font-size: 13px; padding: 0 2px; }
#lbList {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
#lbList .card.empty { border: 0; }
.lb-row {
  display: grid; grid-template-columns: 26px 44px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background 0.12s ease;
}
.lb-row:last-child { border-bottom: 0; }
a.lb-row { cursor: pointer; }
a.lb-row:hover { background: var(--surface-2); text-decoration: none; }
a.lb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
a.lb-row:active { background: var(--surface-2); }
.lb-static { cursor: default; }
.lb-rank {
  font-size: 14px; font-weight: 700; color: var(--muted);
  text-align: center; font-variant-numeric: tabular-nums;
}
.lb-rank-1, .lb-rank-2, .lb-rank-3 {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.lb-rank-1 { background: #fef3c7; color: #92400e; }
.lb-rank-2 { background: #f1f5f9; color: #475569; }
.lb-rank-3 { background: #ffedd5; color: #9a3412; }
:root[data-theme="dark"] .lb-rank-1 { background: #451a03; color: #fcd34d; }
:root[data-theme="dark"] .lb-rank-2 { background: #1e293b; color: #cbd5e1; }
:root[data-theme="dark"] .lb-rank-3 { background: #431407; color: #fdba74; }
.lb-logo { width: 44px; height: 44px; flex: none; }
.lb-logo-img {
  width: 44px; height: 44px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px; display: block;
}
.lb-mono {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.lb-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lb-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-tag { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--faint); min-width: 0; }
.lb-meta svg { flex: none; vertical-align: -2px; }
.lb-meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta .lb-dot { color: var(--faint); }
.lb-avatar, .lb-avatar-mono {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
}
.lb-avatar { object-fit: cover; }
.lb-avatar-mono {
  background: var(--surface-3); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.lb-metric { text-align: right; flex: none; display: flex; flex-direction: column; gap: 1px; }
.lb-metric b { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-metric span { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 480px) {
  .lb-row { grid-template-columns: 22px 38px minmax(0, 1fr) auto; gap: 10px; padding: 12px 12px; }
  .lb-logo, .lb-logo-img, .lb-mono { width: 38px; height: 38px; }
  .lb-metric span { display: none; }
}

/* ---------- Leaderboard filters on narrow screens ----------
   BUG (2026-12-03, Yoriko's phone): the sort strip shared one flex
   line with the three flex:none selects, so on a 390px screen the
   selects ate the whole line and the scrollable sort strip was
   squeezed to a sliver, only a clipped half of the dark "Most $
   supported" pill showed at the left edge, and the "All time" select
   was half cut off. Fix: stack the controls vertically below 640px.
   Sort strip on its own full-width line, then each select full
   width. (The Home industry filters this used to share the rule
   with were removed 2026-12-03. Top products is a carousel now.) */
@media (max-width: 640px) {
  .lb-controls {
    flex-direction: column; align-items: stretch;
  }
  .lb-sorts {
    flex: none; width: 100%; min-width: 0;
  }
  .lb-controls .lb-period {
    width: 100%; flex: 1 1 auto; min-width: 0;
  }
}

/* ---------- Multi-plan pricing + per-product gateway (2026-12-03,
   migration 0010) ----------
   Plans are custom per product (no free plan); the gateway is the
   ONE the product already uses (Stripe / Paddle / PayPal). Cards
   show "from $X" + a small gateway badge; the detail page offers a
   plan picker; the add-project form has a plan editor + a gateway
   connect step. Same quiet design system: hairlines, one accent. */
.badge-gateway { background: var(--surface-2); color: var(--ink-2); }

/* Plan picker on the project detail page: radio cards. The
   selected card gets the accent border; :has() is supported in all
   modern browsers, and .is-selected is toggled in JS as well. */
.plan-picker { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 12px 0 4px; }
@media (min-width: 640px) { .plan-picker { grid-template-columns: repeat(3, 1fr); } }
.plan-option {
  display: block; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: 14px; background: var(--surface); cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.plan-option:hover { border-color: var(--accent); }
.plan-option:has(input:checked), .plan-option.is-selected { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option-main { display: flex; flex-direction: column; gap: 6px; }
.plan-option-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-option-head b { font-size: 15px; }
.plan-option-price { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.plan-option-features { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.plan-option-features span { display: inline-flex; align-items: center; gap: 6px; }
.plan-option-features svg { color: var(--good); flex: none; }

/* Plan editor rows in the add-project form (step 2). */
.plan-row { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.plan-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.plan-row-head b { font-size: 15px; }
.plan-popular-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: auto; cursor: pointer; }
.plan-popular-toggle input { accent-color: var(--accent); }

/* Gateway radios + connect panel in the add-project form (step 3). */
.gw-radios { display: flex; flex-direction: column; gap: 8px; }
.gw-radio {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 11px 12px; cursor: pointer; background: var(--surface);
}
.gw-radio:hover { border-color: var(--accent); }
.gw-radio.is-selected { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.gw-radio input { accent-color: var(--accent); margin-top: 3px; }
.gw-radio > span { display: flex; flex-direction: column; gap: 1px; }
.gw-panel { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }

/* ---------- Dev profile page (#/dev/<handle>) + @handle links ----------
   2026-12-03 (Yoriko): the leaderboard ranks DEVS, so clicking a
   dev opens their page. Stats + ALL their projects. Every @handle
   on the site links there (leaderboard, deck, Top cards, detail,
   Saved) via .dev-link. */
.dev-link { color: var(--accent); font-weight: 600; white-space: nowrap; }
.dev-link:hover { text-decoration: underline; }
.dev-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Leaderboard split links: the project part opens the project,
   the dev identity opens the dev page. Both underline on hover so
   it is obvious they are clickable. */
.lb-row a.lb-name { color: var(--ink); display: block; }
.lb-row a.lb-logo { cursor: pointer; }
a.lb-name:hover, a.lb-dev-link:hover { text-decoration: underline; }
.lb-dev-link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); flex: none; min-width: 0; max-width: 52%; }
.lb-dev-link:hover { color: var(--accent); }
.lb-dev-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.lb-dev-link > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Dev page header: avatar + name on row 1 (full width), badges on
   row 2 (each badge, and the rank unit, wraps as a whole, never word
   by word), Manage button full width on row 3 (owner only). Before
   this the header was one flex row, so at 390px the Manage button
   squeezed the middle column and the badges wrapped mid-word
   ("Pro / seller", "Top / supporter / #10"). */
.dev-head { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.dev-head-top { display: flex; gap: 16px; align-items: flex-start; }
.dev-head-main { flex: 1; min-width: 0; }
.dev-head-main h1 { font-size: 24px; margin: 2px 0 4px; }
.dev-head-main p { margin: 0; }
.dev-head-main svg { vertical-align: -2px; }
.dev-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dev-rank { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dev-avatar, .dev-avatar-mono { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.dev-avatar { object-fit: cover; }
.dev-avatar-mono { background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
@media (max-width: 480px) {
  .dev-avatar, .dev-avatar-mono { width: 52px; height: 52px; }
  .dev-avatar-mono { font-size: 20px; }
}
/* Profile page header + edit profile (Step 4ggg) */
.profile-head { display: flex; gap: 12px; align-items: center; }
.profile-head-text { min-width: 0; }
.profile-head-text h1 { overflow-wrap: anywhere; }
.profile-avatar, .profile-avatar-mono { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.profile-avatar { object-fit: cover; }
.profile-avatar-mono { background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.edit-photo-row { display: flex; gap: 12px; align-items: center; }
.edit-photo-preview { flex: none; line-height: 0; }
.edit-photo-actions { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.edit-photo-actions input[type="file"] { max-width: 100%; }
@media (max-width: 480px) {
  .profile-avatar, .profile-avatar-mono { width: 52px; height: 52px; }
  .profile-avatar-mono { font-size: 20px; }
}
