/* ---------- Tokens ---------- */
:root {
  --bg: #f6f2ea;
  --bg-2: #efe9dd;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --ink: #1c1a17;
  --ink-2: #3a3631;
  --muted: #6e675c;
  --line: #e4dccd;
  --line-2: #d6ccb9;
  --accent: #c8623f;
  --accent-2: #a94c2c;
  --accent-soft: #f6dfd3;
  --on-accent: #fffaf5;
  --ok: #3f7d58;
  --shadow-sm: 0 1px 2px rgba(40, 30, 15, 0.06), 0 1px 1px rgba(40, 30, 15, 0.04);
  --shadow: 0 10px 30px -12px rgba(60, 40, 20, 0.22), 0 2px 6px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 30px 80px -20px rgba(40, 25, 10, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --maxw: 1240px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412; --bg-2: #1b1917; --surface: #1f1d1a; --surface-2: #252320;
    --ink: #f2ede4; --ink-2: #d9d2c6; --muted: #a39b8e; --line: #2f2c28; --line-2: #3d3934;
    --accent: #e3845d; --accent-2: #f09a76; --accent-soft: #3a2419; --on-accent: #1a0f0a; --ok: #7cc49a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 32px -14px rgba(0,0,0,.7); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151412; --bg-2: #1b1917; --surface: #1f1d1a; --surface-2: #252320;
  --ink: #f2ede4; --ink-2: #d9d2c6; --muted: #a39b8e; --line: #2f2c28; --line-2: #3d3934;
  --accent: #e3845d; --accent-2: #f09a76; --accent-soft: #3a2419; --on-accent: #1a0f0a; --ok: #7cc49a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 32px -14px rgba(0,0,0,.7); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 160px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

.i { display: inline-flex; width: 18px; height: 18px; flex: none; }
.i svg { width: 100%; height: 100%; }
.kbd {
  font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--muted); box-shadow: 0 1px 0 var(--line-2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; letter-spacing: -0.01em; transition: transform .15s var(--ease), background .2s, box-shadow .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--accent); color: var(--on-accent); }
.btn--ghost { border: 1px solid var(--line-2); background: var(--surface); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--accent-2); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px;
  border-radius: 12px; color: var(--ink-2); transition: background .15s;
}
.iconbtn:hover { background: var(--bg-2); color: var(--ink); }
.iconbtn--label { padding: 0 12px; font-weight: 500; font-size: 14px; }
.iconbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-2); }
.count { font: 600 11px/1 var(--sans); background: var(--ink); color: var(--bg); padding: 3px 6px; border-radius: 999px; }
.count:empty, .count[data-zero] { display: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin: 0; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 9px; background: var(--accent); position: relative; flex: none;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.brand__mark::before, .brand__mark::after {
  content: ""; position: absolute; inset: 6px 13px; background: var(--on-accent); border-radius: 2px;
}
.brand__mark::after { transform: rotate(90deg); }
.brand__name { font: 400 24px/1 var(--serif); letter-spacing: -0.01em; }
.brand__tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; }
.searchpill {
  margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  min-width: 0; width: min(380px, 100%); transition: border-color .15s, box-shadow .15s;
}
.searchpill:hover { border-color: var(--ink-2); box-shadow: var(--shadow-sm); }
.searchpill__text { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 720px) {
  .brand__tag, .hide-sm { display: none; }
  .brand__name { font-size: 21px; }
  .searchpill { width: auto; flex: 1; }
  .searchpill .kbd { display: none; }
}
@media (max-width: 420px) { .brand__name { display: none; } }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 40px; padding-top: 48px; padding-bottom: 32px; align-items: center; overflow-x: clip; }
@media (min-width: 980px) { .hero { grid-template-columns: 1.15fr 1fr; padding-top: 72px; gap: 56px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; font-weight: 500;
  color: var(--muted); letter-spacing: .01em;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero__title {
  font: 400 clamp(46px, 8.4vw, 92px)/0.98 var(--serif); letter-spacing: -0.025em; margin: 0 0 22px;
  text-wrap: balance;
}
.hero__title em { font-style: italic; color: var(--accent); }
.hero__num { font-variant-numeric: tabular-nums; display: inline-block; min-width: 1.6ch; }
.hero__lede { font-size: 18px; color: var(--ink-2); max-width: 52ch; margin: 0 0 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.stats div { padding: 16px 12px 0 0; }
.stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.stats dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stats dd { margin: 0; font: 400 34px/1 var(--serif); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* Featured deck */
.deck { position: relative; height: 380px; perspective: 1400px; }
@media (max-width: 979px) { .deck { height: 340px; max-width: 520px; width: calc(100% - 36px); margin: 24px auto 0 0; } }
.deck__card {
  position: absolute; inset: 0; border-radius: 26px; padding: 28px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transition: transform .7s var(--ease), opacity .7s var(--ease); cursor: pointer; overflow: hidden;
  text-align: left; width: 100%;
}
.deck__card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; opacity: .9;
  background: radial-gradient(120% 100% at 0% 0%, var(--c-soft), transparent 70%);
  pointer-events: none;
}
.deck__card[data-pos="0"] { transform: translate3d(0,0,0) rotate(0); z-index: 3; }
.deck__card[data-pos="1"] { transform: translate3d(18px,-16px,-60px) rotate(2.5deg); z-index: 2; opacity: .9; }
.deck__card[data-pos="2"] { transform: translate3d(34px,-30px,-120px) rotate(5deg); z-index: 1; opacity: .7; }
.deck__card[data-pos="out"] { transform: translate3d(-40px,40px,40px) rotate(-6deg); opacity: 0; z-index: 4; pointer-events: none; }
.deck__card:hover[data-pos="0"] { transform: translate3d(0,-4px,0); }
.deck__label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.deck__title { position: relative; font: 400 clamp(28px, 3.6vw, 38px)/1.05 var(--serif); letter-spacing: -0.015em; margin: auto 0 14px; text-wrap: balance; }
.deck__sum { position: relative; color: var(--ink-2); margin: 0 0 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deck__foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.deck__dots { display: flex; gap: 6px; }
.deck__dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background .3s, width .3s; }
.deck__dots span.on { width: 18px; border-radius: 3px; background: var(--ink); }

/* ---------- Sections ---------- */
.section { padding-top: 40px; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 16px; }
.section__title { font: 400 32px/1.1 var(--serif); letter-spacing: -0.01em; margin: 0; }
.section__sub { margin: 0; color: var(--muted); font-size: 14px; }

/* Weekly drops */
.drops { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.drop {
  scroll-snap-align: start; flex: 0 0 auto; min-width: 210px; text-align: left; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s, box-shadow .2s;
  display: grid; gap: 6px;
}
.drop:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.drop[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.drop__week { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; }
.drop__new { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 2px 7px; font-size: 10px; letter-spacing: .06em; }
.drop__count { font: 400 30px/1 var(--serif); }
.drop__count small { font: 500 13px var(--sans); color: var(--muted); margin-left: 4px; }
.drop__bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg-2); }
.drop__bar span { display: block; height: 100%; }

/* Categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
@media (max-width: 560px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat { padding: 12px; gap: 10px; } .cat__icon { width: 34px; height: 34px; } }
.cat {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); text-align: left; overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.cat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.cat[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.cat__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--c-soft); color: var(--c); flex: none; }
.cat__icon .i { width: 20px; height: 20px; }
.cat__name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.cat__count { font-size: 12px; color: var(--muted); }

/* ---------- Toolbar ---------- */
.explore { padding-top: 40px; }
.toolbar {
  position: sticky; top: 64px; z-index: 30; padding: 12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.toolbar__inner { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.toolbar__row { min-width: 0; }
.toolbar__row--controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 1080px) {
  .toolbar__inner {
    grid-template-columns: minmax(280px, 1fr) auto; align-items: center;
    grid-template-areas: "search controls" "chips chips";
  }
  .search { grid-area: search; }
  .toolbar__row--controls { grid-area: controls; }
  .toolbar__row:not(.toolbar__row--controls) { grid-area: chips; }
}
.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 15px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip small { color: inherit; opacity: .6; font-weight: 500; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg--icons button { padding: 0 9px; }
.seg--icons .i { width: 16px; height: 16px; }
.select { position: relative; display: inline-flex; }
.select select {
  appearance: none; height: 38px; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer;
}
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.diffpips { display: inline-flex; gap: 2px; align-items: flex-end; }
.diffpips i { width: 3px; border-radius: 1px; background: currentColor; opacity: .25; }
.diffpips i:nth-child(1) { height: 6px; } .diffpips i:nth-child(2) { height: 9px; } .diffpips i:nth-child(3) { height: 12px; }
.diffpips[data-level="1"] i:nth-child(-n+1), .diffpips[data-level="2"] i:nth-child(-n+2), .diffpips[data-level="3"] i { opacity: 1; }

/* ---------- Results ---------- */
.resultbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 20px 0 14px; }
.resultbar p { margin: 0; font-size: 14px; color: var(--muted); }
.resultbar p strong { color: var(--ink); font-weight: 600; }
.active { display: flex; flex-wrap: wrap; gap: 6px; }
.active button {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 12px; font-weight: 600;
}
.active button .i { width: 14px; height: 14px; }
.active .clear { background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; padding-bottom: 32px; outline: none; }
.card {
  --c: var(--accent); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; min-width: 0;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  animation: rise .5s var(--ease) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card::after {
  content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--c);
  transform: scaleX(.18); transform-origin: left; transition: transform .35s var(--ease);
}
.card:hover::after { transform: scaleX(1); }
.card__top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; min-height: 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 7px; background: var(--accent); color: var(--on-accent); }
.badge--tried { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.card__save { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.card__save:hover { background: var(--bg-2); color: var(--ink); }
.card__save[aria-pressed="true"] { color: var(--accent); }
.card__save[aria-pressed="true"] svg { fill: currentColor; }
.card__title { font: 400 25px/1.12 var(--serif); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.card__sum { margin: 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
button.tag:hover { border-color: var(--line-2); }
.tag--product { background: transparent; border-color: var(--line-2); }
.card__foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who img, .who .avatar { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--bg-2); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .avatar { display: grid; place-items: center; color: var(--accent); }
.who .avatar .i { width: 12px; height: 12px; }
.likes { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.likes .i { width: 14px; height: 14px; }

/* List view */
.grid.is-list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.grid.is-list .card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 18px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 16px 4px; animation: none; }
.grid.is-list .card:hover { transform: none; box-shadow: none; background: var(--surface); }
.grid.is-list .card::after { display: none; }
.grid.is-list .card__top { order: 2; min-width: 170px; }
.grid.is-list .card__title { order: 1; flex: 1 1 320px; font-size: 22px; }
.grid.is-list .card__sum, .grid.is-list .tags { display: none; }
.grid.is-list .card__foot { order: 3; border: 0; padding: 0; margin: 0; min-width: 150px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 64px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h3 { font: 400 32px/1.1 var(--serif); margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 0 18px; }
#sentinel { height: 1px; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 14, 8, .38); z-index: 60; animation: fade .25s both; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .35s var(--ease) both;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 720px) {
  .drawer { top: auto; height: 92dvh; width: 100%; border-radius: 22px 22px 0 0; animation-name: slideup; }
  @keyframes slideup { from { transform: translateY(60px); opacity: 0; } }
}
.drawer__bar { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.drawer__pos { font-size: 12px; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.drawer__bar [data-action="close"] { margin-left: auto; }
.drawer__body { overflow-y: auto; padding: 24px 24px 40px; overscroll-behavior: contain; }
@media (min-width: 720px) { .drawer__body { padding: 32px 40px 48px; } }
.d-hero { --c: var(--accent); position: relative; padding-bottom: 6px; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.d-meta .catlink { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.d-title { font: 400 clamp(34px, 5vw, 46px)/1.02 var(--serif); letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
.d-sum { font-size: 17px; color: var(--ink-2); margin: 0 0 22px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.d-actions .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }
.d-actions .btn[data-action="tried"][aria-pressed="true"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.d-h { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.prompt { position: relative; border-radius: 16px; background: var(--ink); color: var(--bg); padding: 18px 18px 64px; }
.prompt pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13.5px/1.65 var(--mono); }
.prompt__actions { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 8px; justify-content: flex-end; }
.prompt__actions .btn { height: 36px; font-size: 13px; padding: 0 14px; }
.prompt__actions .btn--ghost { background: transparent; border-color: color-mix(in srgb, var(--bg) 30%, transparent); color: var(--bg); }
.prompt__actions .btn--ghost:hover { border-color: var(--bg); }
.post { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface-2); }
.post__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post__head img { width: 40px; height: 40px; border-radius: 50%; }
.post__name { font-weight: 600; line-height: 1.2; }
.post__handle { font-size: 13px; color: var(--muted); }
.post__text { white-space: pre-wrap; word-break: break-word; margin: 0 0 12px; font-size: 15px; }
.post__foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); }
.post__foot a { margin-left: auto; font-weight: 600; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.post__foot a:hover { color: var(--accent); }
.post__foot span { display: inline-flex; gap: 4px; align-items: center; }
.post__foot .i { width: 14px; height: 14px; }
.note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line-2); padding: 4px 0 4px 14px; margin: 0; }
.related { display: grid; gap: 10px; }
.related .card { padding: 16px; animation: none; }
.related .card__title { font-size: 21px; }
.related .card__sum { -webkit-line-clamp: 2; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding: 10vh 16px 16px; background: rgba(20, 14, 8, .42); backdrop-filter: blur(4px); animation: fade .2s both; }
.modal[hidden] { display: none; }
.palette { width: min(640px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); animation: pop .25s var(--ease) both; }
@keyframes pop { from { transform: scale(.97) translateY(-6px); opacity: 0; } }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 58px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette__input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); }
.palette__list { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 520px); overflow-y: auto; }
.palette__group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.palette__item[aria-selected="true"] { background: var(--bg-2); }
.palette__item .dot { width: 10px; height: 10px; }
.palette__item .t { flex: 1; min-width: 0; }
.palette__item .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__item .t small { color: var(--muted); font-size: 12px; }
.palette__item .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.palette__item .ic .i { width: 15px; height: 15px; }
.palette__empty { padding: 28px; text-align: center; color: var(--muted); }

.inspire { width: min(560px, 100%); background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 28px; border: 1px solid var(--line); animation: pop .3s var(--ease) both; text-align: center; }
.slot { height: 120px; overflow: hidden; position: relative; mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.slot__reel { display: flex; flex-direction: column; will-change: transform; }
.slot__reel div { height: 120px; display: grid; place-items: center; font: 400 clamp(26px, 5vw, 34px)/1.05 var(--serif); padding: 0 8px; text-wrap: balance; }
.inspire__card { min-height: 84px; color: var(--ink-2); margin: 8px 0 20px; opacity: 0; transition: opacity .4s; }
.inspire__card.show { opacity: 1; }
.inspire__card .d-meta { justify-content: center; margin: 8px 0; }
.inspire__cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: transform .3s var(--ease), opacity .3s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 40px 0 56px; background: var(--bg-2); }
.footer__inner { display: grid; gap: 28px; }
@media (min-width: 860px) { .footer__inner { grid-template-columns: 1.4fr 1fr auto; align-items: start; } }
.footer__note { color: var(--muted); font-size: 13px; max-width: 54ch; margin: 12px 0 0; }
.footer__keys { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 20px; font-size: 13px; color: var(--muted); justify-content: start; }
.footer__keys p { margin: 0; display: flex; gap: 6px; align-items: center; }
.footer__updated { font-size: 13px; color: var(--muted); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep the difficulty switch inside the viewport on narrow screens. */
#diffSeg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
#diffSeg::-webkit-scrollbar { display: none; }
#diffSeg button { flex: none; }
@media (max-width: 480px) { #diffSeg .diffpips { display: none; } #diffSeg button { padding: 0 10px; } }
