/* ===========================================================
   Nickgram — design tokens & base
   Minimal, modern, mobile-first. Light + dark. Purple accent.
   =========================================================== */

:root {
  /* brand hue stays constant; accent injected via JS as --brand-h/--brand-c */
  --brand-h: 300;
  --brand-c: 0.205;

  /* light theme (default) */
  --bg:        oklch(0.985 0.004 var(--brand-h));
  --bg-2:      oklch(0.965 0.006 var(--brand-h));
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.975 0.006 var(--brand-h));
  --border:    oklch(0.915 0.008 var(--brand-h));
  --border-2:  oklch(0.955 0.006 var(--brand-h));
  --text:      oklch(0.23 0.022 var(--brand-h));
  --text-2:    oklch(0.42 0.018 var(--brand-h));
  --muted:     oklch(0.58 0.016 var(--brand-h));

  --brand:     oklch(0.52 var(--brand-c) var(--brand-h));
  --brand-2:   oklch(0.58 var(--brand-c) calc(var(--brand-h) + 30));
  --brand-ink: oklch(0.99 0.01 var(--brand-h));
  --brand-soft:oklch(0.955 0.035 var(--brand-h));
  --brand-line:oklch(0.88 0.05 var(--brand-h));

  --good:      oklch(0.60 0.13 155);
  --good-soft: oklch(0.95 0.05 155);
  --bad:       oklch(0.60 0.18 22);
  --bad-soft:  oklch(0.95 0.05 22);
  --gold:      oklch(0.74 0.14 80);

  --shadow-sm: 0 1px 2px oklch(0.4 0.03 var(--brand-h) / 0.06), 0 1px 3px oklch(0.4 0.03 var(--brand-h) / 0.05);
  --shadow-md: 0 2px 6px oklch(0.4 0.03 var(--brand-h) / 0.07), 0 8px 24px oklch(0.4 0.03 var(--brand-h) / 0.08);
  --shadow-lg: 0 12px 40px oklch(0.4 0.04 var(--brand-h) / 0.16);
  --shadow-brand: 0 8px 24px oklch(0.52 var(--brand-c) var(--brand-h) / 0.30);

  --r-xs: 8px;
  --r-sm: 11px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --fs-display: 'Space Grotesk', system-ui, sans-serif;
  --fs-body: 'Manrope', system-ui, sans-serif;

  --maxw: 1080px;
  --pad: 18px;
  --nav-h: 66px;
}

[data-theme="dark"] {
  --bg:        oklch(0.165 0.014 var(--brand-h));
  --bg-2:      oklch(0.195 0.016 var(--brand-h));
  --surface:   oklch(0.214 0.017 var(--brand-h));
  --surface-2: oklch(0.252 0.020 var(--brand-h));
  --border:    oklch(0.315 0.022 var(--brand-h));
  --border-2:  oklch(0.275 0.018 var(--brand-h));
  --text:      oklch(0.965 0.008 var(--brand-h));
  --text-2:    oklch(0.80 0.015 var(--brand-h));
  --muted:     oklch(0.66 0.018 var(--brand-h));

  --brand:     oklch(0.66 0.19 var(--brand-h));
  --brand-2:   oklch(0.70 0.18 calc(var(--brand-h) + 30));
  --brand-ink: oklch(0.16 0.02 var(--brand-h));
  --brand-soft:oklch(0.30 0.07 var(--brand-h));
  --brand-line:oklch(0.40 0.09 var(--brand-h));

  --good:      oklch(0.74 0.15 155);
  --good-soft: oklch(0.30 0.06 155);
  --bad:       oklch(0.70 0.17 22);
  --bad-soft:  oklch(0.32 0.07 22);
  --gold:      oklch(0.80 0.14 80);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-md: 0 2px 8px oklch(0 0 0 / 0.4), 0 10px 30px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 50px oklch(0 0 0 / 0.55);
  --shadow-brand: 0 8px 26px oklch(0.66 0.19 var(--brand-h) / 0.40);
}

* { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--fs-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  transition: background .35s ease, color .35s ease;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, .display { font-family: var(--fs-display); letter-spacing: -0.02em; margin: 0; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand-soft); color: var(--brand); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- layout shell ---------- */
.app { min-height: 100vh; }
.scroller { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 22px); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- top app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--border-2);
}
.appbar-inner { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--fs-display); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink); font-family: var(--fs-display); font-weight: 700; font-size: 17px;
  box-shadow: var(--shadow-brand);
}
.brand b { color: var(--brand); }
.appbar-spacer { flex: 1; }

.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2);
  transition: transform .12s ease, background .2s, color .2s, border-color .2s;
}
.iconbtn:hover { color: var(--brand); border-color: var(--brand-line); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn svg { width: 19px; height: 19px; }

/* ---------- bottom nav ---------- */
.botnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in oklch, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--border-2);
  display: flex; align-items: stretch;
}
.botnav-inner { width: 100%; max-width: 560px; margin: 0 auto; display: flex; align-items: stretch; justify-content: space-around; }
.navitem {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; position: relative;
  transition: color .2s;
}
.navitem svg { width: 22px; height: 22px; transition: transform .18s ease; }
.navitem.active { color: var(--brand); }
.navitem.active svg { transform: translateY(-1px); }
.navitem.active::before {
  content: ''; position: absolute; top: 7px; width: 30px; height: 30px; border-radius: 10px;
  background: var(--brand-soft); z-index: -1;
}
.navitem:active svg { transform: scale(0.85); }
.navfab {
  flex: 0 0 auto; align-self: center; margin: 0 4px;
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink);
  box-shadow: var(--shadow-brand); transition: transform .14s ease;
}
.navfab svg { width: 24px; height: 24px; }
.navfab:active { transform: scale(0.9) rotate(-6deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-sm); font-weight: 700; font-size: 14.5px;
  border: 1px solid transparent; transition: transform .12s ease, background .2s, box-shadow .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--brand-line); color: var(--brand); }
.btn-line { background: transparent; color: var(--text); border-color: var(--border); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- chips / pills ---------- */
.chiprow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all .18s ease;
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--brand-line); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

/* ---------- search field ---------- */
.searchfield {
  display: flex; align-items: center; gap: 11px; height: 56px; padding: 0 16px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
.searchfield:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.searchfield svg { width: 21px; height: 21px; color: var(--muted); flex: 0 0 auto; }
.searchfield input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font-weight: 500; }
.searchfield input::placeholder { color: var(--muted); }

/* ---------- section headers ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.sec-title { font-family: var(--fs-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.sec-title .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--brand); }
.sec-link { font-size: 13px; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 3px; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }

/* ---------- nick card ---------- */
.nick {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 15px 15px 12px; display: flex; flex-direction: column; gap: 11px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative; overflow: hidden;
}
.nick:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.nick-text {
  font-size: 22px; line-height: 1.25; word-break: break-word; color: var(--text);
  font-weight: 600; letter-spacing: 0.01em; min-height: 30px;
}
.nick-foot { display: flex; align-items: center; gap: 7px; }
.nick-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.nick-meta span { display: inline-flex; align-items: center; gap: 4px; }
.nick-meta svg { width: 14px; height: 14px; }

.copybtn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 11px; font-weight: 700; font-size: 13px; background: var(--brand-soft); color: var(--brand);
  border: 1px solid transparent; transition: all .15s ease;
}
.copybtn svg { width: 16px; height: 16px; }
.copybtn:hover { background: var(--brand); color: var(--brand-ink); }
.copybtn:active { transform: scale(0.95); }
.copybtn.done { background: var(--good-soft); color: var(--good); }

/* vote pills */
.votes { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-pill); overflow: hidden; }
.vote { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); transition: all .15s; }
.vote svg { width: 15px; height: 15px; }
.vote:hover { color: var(--text); background: var(--surface); }
.vote.up.on { color: var(--good); }
.vote.down.on { color: var(--bad); }
.vote-sep { width: 1px; align-self: stretch; background: var(--border-2); }

.savebtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); transition: all .15s; }
.savebtn svg { width: 17px; height: 17px; }
.savebtn:hover { color: var(--brand); border-color: var(--brand-line); }
.savebtn.on { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.savebtn.on svg { fill: currentColor; }

/* tag */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-2); }
.tag.brandy { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- toast ---------- */
.toastwrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill);
  background: oklch(0.22 0.02 var(--brand-h)); color: oklch(0.98 0 0); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2);
  max-width: 92vw;
}
[data-theme="dark"] .toast { background: oklch(0.95 0.01 var(--brand-h)); color: oklch(0.18 0.02 var(--brand-h)); }
.toast .tcheck { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: var(--good); color: white; flex: 0 0 auto; }
.toast .tcheck svg { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(0.9); } to { opacity: 1; transform: none; } }

/* ---------- grids ---------- */
.nick-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .nick-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .nick-grid { grid-template-columns: 1fr 1fr 1fr; } }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 720px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }

.cat {
  position: relative; overflow: hidden; border-radius: var(--r); padding: 16px; min-height: 116px;
  display: flex; flex-direction: column; justify-content: space-between; color: white;
  background: linear-gradient(150deg, var(--c1), var(--c2)); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s; isolation: isolate;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-emoji { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.cat-name { font-family: var(--fs-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.cat-count { font-size: 11.5px; font-weight: 700; opacity: 0.85; }
.cat-glow { position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 99px; background: rgba(255,255,255,.18); z-index: -1; }

/* ---------- hero variants ---------- */
.hero { position: relative; }
.hero-aurora { position: absolute; inset: -40px -20px auto -20px; height: 280px; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-aurora::before, .hero-aurora::after { content: ''; position: absolute; border-radius: 99px; filter: blur(60px); opacity: 0.5; }
.hero-aurora::before { width: 320px; height: 220px; left: -40px; top: -30px; background: var(--brand); }
.hero-aurora::after { width: 260px; height: 200px; right: -50px; top: 10px; background: var(--brand-2); opacity: 0.42; }

.hero-title { font-family: var(--fs-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; font-size: clamp(30px, 8vw, 46px); }
.hero-title .grad { background: linear-gradient(100deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-2); font-size: 15.5px; font-weight: 500; max-width: 40ch; margin-top: 12px; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { font-family: var(--fs-display); font-size: 20px; font-weight: 700; color: var(--text); }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* live preview line for generator-first hero */
.gen-line {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 9px;
  transition: border-color .15s, transform .12s; cursor: pointer;
}
.gen-line:hover { border-color: var(--brand-line); }
.gen-line:active { transform: scale(0.99); }
.gen-line .gv { flex: 1; font-size: 19px; font-weight: 600; word-break: break-word; }
.gen-line .gtag { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.gen-line .gcopy { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: 0 0 auto; transition: all .15s; }
.gen-line .gcopy:hover { background: var(--brand); color: var(--brand-ink); }
.gen-line.done .gcopy { background: var(--good); color: white; }

/* leaderboard */
.lb-item { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); transition: border-color .15s; }
.lb-item:hover { border-color: var(--brand-line); }
.lb-rank { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--fs-display); font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--muted); flex: 0 0 auto; }
.lb-rank.r1 { background: linear-gradient(135deg, var(--gold), oklch(0.82 0.13 70)); color: oklch(0.25 0.05 70); }
.lb-rank.r2 { background: linear-gradient(135deg, oklch(0.82 0.01 270), oklch(0.72 0.01 270)); color: oklch(0.3 0 0); }
.lb-rank.r3 { background: linear-gradient(135deg, oklch(0.70 0.09 50), oklch(0.62 0.10 40)); color: oklch(0.98 0.02 60); }
.lb-name { flex: 1; min-width: 0; }
.lb-name .n { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name .m { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* segmented control (variant switcher) */
.seg { display: inline-flex; padding: 4px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 13px; }
.seg button { height: 32px; padding: 0 13px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); transition: all .15s; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* generator tool */
.gen-input {
  width: 100%; min-height: 64px; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  font-size: 19px; font-weight: 600; resize: none; outline: none; box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s; line-height: 1.4;
}
.gen-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* form fields */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, .textarea, .selectfield {
  width: 100%; padding: 13px 15px; border-radius: var(--r-sm); background: var(--surface);
  border: 1.5px solid var(--border); color: var(--text); outline: none; font-weight: 500;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .selectfield:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* rating block for UGC */
.rate {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r);
  background: var(--brand-soft); border: 1px solid transparent;
}
.rate-btns { display: flex; gap: 10px; }
.rate-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px; border-radius: 13px; background: var(--surface); border: 1.5px solid var(--border); transition: all .15s; font-weight: 700; font-size: 13px; }
.rate-btn svg { width: 22px; height: 22px; }
.rate-btn:active { transform: scale(0.96); }
.rate-btn.helpful.on { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.rate-btn.improve.on { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* author / meta row */
.author { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-family: var(--fs-display); font-weight: 700; font-size: 15px; color: white; flex: 0 0 auto; }
.author .nm { font-weight: 700; font-size: 13.5px; }
.author .sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* helpfulness bar */
.helpbar { height: 8px; border-radius: 99px; background: var(--bad-soft); overflow: hidden; }
.helpbar > i { display: block; height: 100%; background: var(--good); border-radius: 99px; }

/* misc */
.divider { height: 1px; background: var(--border-2); }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.fade-up { animation: fadeUp .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 17px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--brand); }
.empty .ico svg { width: 26px; height: 26px; }

/* skeleton shimmer for live search */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-2) 37%, var(--surface-2) 63%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }

/* detail hero */
.detail-hero { padding: 22px; border-radius: var(--r-lg); background: linear-gradient(150deg, var(--brand-soft), var(--surface)); border: 1px solid var(--border); position: relative; overflow: hidden; }
.detail-big { font-size: clamp(26px, 8vw, 40px); font-weight: 600; line-height: 1.2; word-break: break-word; letter-spacing: 0.01em; }

/* pill counters */
.pillstat { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.pillstat svg { width: 14px; height: 14px; color: var(--muted); }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* search overlay */
.searchov { position: fixed; inset: 0; z-index: 90; background: color-mix(in oklch, var(--bg) 60%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ovin .2s ease; }
@keyframes ovin { from { opacity: 0; } to { opacity: 1; } }
.searchov-panel { position: absolute; left: 0; right: 0; top: 0; max-height: 100%; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: panin .28s cubic-bezier(.2,.8,.3,1); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; max-height: 100vh; }
@keyframes panin { from { transform: translateY(-14px); opacity: .6; } to { transform: none; opacity: 1; } }
.searchov-body { overflow-y: auto; padding-top: 6px; padding-bottom: 28px; flex: 1; -webkit-overflow-scrolling: touch; }
.searchov-lab { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 11px; }

/* variant bar */
.variantbar { position: sticky; top: 58px; z-index: 30; background: color-mix(in oklch, var(--bg-2) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px dashed var(--border); padding: 9px 0; }
