/* ══════════════════════════════════════════════════════════════════════════
   NovaPup — styles
   Built on the Nocturne design system (self-hosted, no external calls).
   Fonts are local (see fonts/inter.css); tokens mirror nocturne/styles.css.
   ══════════════════════════════════════════════════════════════════════════ */
@import url('fonts/inter.css');

/* Obsidian theme (2026-10): ~70% obsidian/graphite, ~20% violet/silver, ~10% crimson.
   Violet = identity + interaction. Silver/gray = structure. Crimson = attention only
   (NEW, NSFW, warnings, destructive). */
:root {
  /* surfaces, darkest to lightest */
  --color-bg: #070709;          /* page */
  --bg-2: #0E0D12;              /* header, sidebar, panels */
  --color-surface: #17161C;     /* cards, inputs */
  --surface-hover: #211E29;     /* hover, popovers, tags */
  --border: #37343F;
  --color-divider: #37343F;
  --divider-soft: #24222B;      /* hairlines inside components */

  /* violet (primary) */
  --violet: #7C3AED;
  --violet-hover: #8B5CF6;
  --lavender: #A78BFA;
  --lavender-soft: #C4B5FD;
  --violet-deep: #4C1D95;
  --color-accent: #7C3AED;
  --color-accent-2: #A78BFA;
  --color-accent-100: #EDE9FE; --color-accent-200: #DDD6FE; --color-accent-300: #C4B5FD;
  --color-accent-400: #A78BFA; --color-accent-500: #8B5CF6; --color-accent-600: #7C3AED;
  --color-accent-700: #6D28D9; --color-accent-800: #4C1D95; --color-accent-900: #2E1065;

  /* crimson (attention) */
  --crimson: #B91C3C;
  --crimson-bright: #E23D5C;
  --crimson-text: #FF6B85;

  /* text */
  --color-text: #F1EFF5;
  --text-2: #B7B3BF;
  --text-3: #77727F;

  --color-neutral-100: #F1EFF5; --color-neutral-200: #DAD7E0; --color-neutral-300: #B7B3BF;
  --color-neutral-400: #9A96A3; --color-neutral-500: #77727F; --color-neutral-600: #5A5662;
  --color-neutral-700: #37343F; --color-neutral-800: #211E29; --color-neutral-900: #17161C;

  --font-heading: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-1: 2.8px; --space-2: 5.6px; --space-3: 8.4px; --space-4: 11.2px;
  --space-6: 16.8px; --space-8: 22.4px;

  --radius-sm: 5px; --radius-md: 8px; --radius-card: 10px; --radius-lg: 14px;
  --ease: cubic-bezier(.2,.7,.3,1);
  --dur: .18s;

  --shadow-sm: 0 0 0 1px var(--border);
  --shadow-md: 0 0 14px rgba(124,58,237,.16), 0 10px 28px rgba(0,0,0,.35);
  --shadow-lg: 0 0 0 1px var(--border), 0 24px 60px rgba(0,0,0,.65);

  --panel-bg: #0E0D12;
  --card-bg:  #17161C;
  --sunken:   #0B0A0E;
  --good:     #C4B5FD;   /* boolean "Yes" (lavender, with the word "Yes") */
  --warn:     #B91C3C;   /* warnings + NSFW-shown state */
  --warn-txt: #FF6B85;
  --scrim: rgba(7,7,9,.78);
  --glass: rgba(10,9,14,.82);   /* pills/badges floating over artwork */

  --muted-35: #77727F; --muted-40: #77727F; --muted-45: #8A8592;
  --muted-50: #9A96A3; --muted-55: #B7B3BF; --muted-70: #B7B3BF;
  --m45: var(--muted-45); --m55: var(--muted-55); --m70: var(--muted-70);
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55; font-weight: 400;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 650; line-height: 1.12;
  letter-spacing: -0.015em; margin: 0; }
h4 { font-size: 20px; }
a { color: var(--lavender); text-decoration: none; text-underline-offset: 3px; transition: color var(--dur); }
a:hover { color: var(--lavender-soft); }
img { display: block; max-width: 100%; }
.text-muted { color: var(--muted-55); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
.hidden { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--violet-deep); border-radius: 10px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }
* { scrollbar-color: var(--violet-deep) var(--bg-2); }

@keyframes noct-shimmer { 0%{opacity:.35} 50%{opacity:.7} 100%{opacity:.35} }
@keyframes noct-panel-in { from{transform:translateX(28px);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes noct-fade-in { from{opacity:0} to{opacity:1} }

/* ── Nocturne components (only what this app uses) ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: 500; font-size: 14px; line-height: 1.2;
  color: var(--color-text); background: transparent;
  border: 1px solid transparent; padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--violet); border-color: var(--violet); }
.btn-primary:hover { background: var(--violet-hover); border-color: var(--violet-hover); color: #fff; }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { color: var(--text-2); background: var(--color-surface); border-color: var(--border); }
.btn-secondary:hover { color: var(--color-text); background: var(--surface-hover); }
.btn-secondary:active { background: var(--border); }
.btn-ghost { color: var(--lavender); padding-inline: var(--space-1); }
.btn-ghost:hover { background: rgba(124,58,237,.12); }
/* rare high-emphasis control (violet → crimson); keep to one per view at most */
.btn-emph { color: #fff; border: 0; background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 55%, #B91C3C 100%); }
.btn-emph:hover { filter: brightness(1.08); color: #fff; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; }

.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit; font-size: 14px;
  color: var(--color-text); caret-color: var(--lavender); background: var(--color-surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #4A4654; }
.input:focus, .input:focus-visible { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
select.input option { background: var(--color-surface); color: var(--color-text); }

.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--color-divider); border-radius: var(--radius-md); }
.seg { background: var(--color-surface); }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text-2);
  transition: background var(--dur), color var(--dur); }
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.seg-opt:has(input:checked) { color: var(--lavender-soft); background: rgba(124,58,237,.15); box-shadow: inset 0 0 0 1px var(--violet); }
.seg-opt:not(:has(input:checked)):hover { background: var(--surface-hover); color: var(--color-text); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--lavender); outline-offset: -2px; }

/* ── Layout shell ────────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }

.hdr { flex: none; z-index: 20; border-bottom: 1px solid var(--divider-soft); background: var(--bg-2); }
.hdr-row { display: flex; align-items: center; gap: var(--space-6); padding: 11.2px 16.8px 8.4px; }
.hdr .btn-icon { border-color: var(--color-divider); flex: none; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 34px; height: 34px; flex: none; border: 1px solid var(--violet); border-radius: 9px; overflow: hidden;
  background: #17161C; box-shadow: 0 0 12px rgba(124,58,237,.30); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }   /* NovaPup mascot */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--font-heading); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-stat { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.search { position: relative; flex: 1; max-width: 520px; margin-left: 8.4px; }
.search .s-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted-40); pointer-events: none; }
.search input { padding-left: 30px; padding-right: 30px; height: 36px; }
.search .s-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; }

.hdr-controls { display: flex; align-items: center; gap: 8.4px; margin-left: auto; flex: none; }
.hdr-controls select.input { width: auto; height: 36px; padding-right: 8px; cursor: pointer; }
.seg { height: 36px; }
#nsfwBtn { height: 36px; flex: none; border: 1px solid var(--border); color: var(--text-2); background: var(--color-surface); }
#nsfwBtn:hover { background: var(--surface-hover); color: var(--color-text); }
body.nsfw-shown #nsfwBtn { border-color: var(--crimson); color: var(--crimson-text); background: rgba(185,28,60,.16); }
#nsfwBtn .eye-off { display: block; } #nsfwBtn .eye-on { display: none; }
body.nsfw-shown #nsfwBtn .eye-off { display: none; } body.nsfw-shown #nsfwBtn .eye-on { display: block; }

.body { flex: 1; display: flex; min-height: 0; }
.side-backdrop { display: none; }   /* becomes the drawer scrim on mobile only */

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.side { flex: none; width: 238px; border-right: 1px solid var(--divider-soft);
  overflow-y: auto; padding: 16.8px 14px 40px; background: var(--panel-bg); }
body.side-collapsed .side { display: none; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11.2px; }
.side-head h6 { margin: 0; font-size: 10.5px; color: var(--muted-45); font-weight: 500; letter-spacing: 0; text-transform: none; }
.side-sec { margin-bottom: 19px; }
.side-sec:last-child { margin-bottom: 0; }
.side-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 7px; }
.side-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.tag-hint { font-size: 10.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
#tagFilter { height: 30px; font-size: 12.5px; margin-bottom: 7px; }

.facet { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 7px; margin-bottom: 1px; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-size: 12.5px; text-align: left; border: 1px solid transparent;
  background: transparent; color: var(--text-2); transition: background var(--dur), color var(--dur), border-color var(--dur); }
.facet:hover { background: var(--surface-hover); color: var(--color-text); }
.facet.active { border-color: rgba(124,58,237,.4); background: rgba(124,58,237,.15); color: var(--lavender-soft); }
.facet-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-count { font-size: 11px; font-variant-numeric: tabular-nums; flex: none; color: var(--text-3); }
.facet.active .facet-count { color: var(--color-accent-300); }

/* ── Main / results ──────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.main-inner { padding: 14px 16.8px 40px; }
.result-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 11.2px; margin-bottom: 11.2px; min-height: 20px; }
.result-line { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; border: 0; font: inherit;
  font-size: 11.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(124,58,237,.16); color: var(--lavender-soft); box-shadow: inset 0 0 0 1px rgba(124,58,237,.35); }
.chip:hover { background: rgba(124,58,237,.26); }

/* ── Card grid ───────────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--card-gap, 11.2px);
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 196px), 1fr)); }

.card { position: relative; cursor: pointer; border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid var(--border); background: var(--card-bg);
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur), background var(--dur); }
.card:hover { transform: translateY(-2px); background: #1B1921; border-color: var(--violet); box-shadow: var(--shadow-md); }
.card:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }
.card.sel { border-color: var(--violet); }
.card-frame { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--sunken); }
.card-img { position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: filter .25s; }
.card.nsfw .card-img { filter: blur(16px) saturate(.5); }
body.nsfw-shown .card.nsfw .card-img { filter: none; }
.nsfw-veil { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10,9,14,.28); backdrop-filter: blur(2px); }
body.nsfw-shown .card.nsfw .nsfw-veil { display: none; }
.card:not(.nsfw) .nsfw-veil { display: none; }
.nsfw-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .14em;
  padding: 3px 9px; border: 1px solid var(--crimson); border-radius: 999px; background: rgba(185,28,60,.22); color: var(--crimson-text); }
.nsfw-pill::before { content: "⚠"; font-size: 10px; letter-spacing: 0; }

.card-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(100% - 12px); }
.badge { font-size: 9.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px; backdrop-filter: blur(4px); }
.badge-plat { background: rgba(10,9,14,.82); border: 1px solid color-mix(in srgb, var(--color-text) 18%, transparent);
  color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.badge-ft { background: rgba(124,58,237,.30); border: 1px solid var(--violet); color: var(--color-accent-200); }

.card-views { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 999px;
  background: rgba(10,9,14,.82); color: var(--muted-70); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .18s; }
.card:hover .card-views { opacity: 1; }

.card-meta { padding: 7px 8.4px 8.4px; }
.card-title { font-family: var(--font-heading); font-weight: 600; font-size: 13px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-by { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-top: 1px; }
.grid[data-density="S"] .card-title { font-size: 12px; }
.grid[data-density="S"] .card-by { font-size: 10.5px; }

/* ── Pager ───────────────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: center; gap: 5.6px; margin-top: 28px; flex-wrap: wrap; }
.pager .btn { padding: 5px 9px; font-size: 12.5px; }
.page-num { min-width: 32px; padding: 5px 8px; font-size: 12.5px; cursor: pointer; border-radius: var(--radius-md);
  font-family: var(--font-heading); font-variant-numeric: tabular-nums; border: 1px solid var(--border);
  background: var(--color-surface); color: var(--text-2); transition: background var(--dur), color var(--dur); }
.page-num:hover { background: var(--surface-hover); color: var(--color-text); }
.page-num.cur { border-color: var(--violet); background: rgba(124,58,237,.16); color: var(--lavender-soft); }
.foot-note { text-align: center; font-size: 11.5px; color: var(--text-3);
  margin: 28px auto 0; max-width: 620px; text-wrap: pretty; }

/* ── State screens ───────────────────────────────────────────────────────── */
.state { height: 100%; display: grid; place-items: center; padding: 56px 16.8px; }
.state-inner { max-width: 400px; text-align: center; }
.state-inner h4 { margin: 0 0 6px; }
.state-inner p { font-size: 13.5px; margin: 0; }
.state-icon-box { width: 44px; height: 44px; border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  display: grid; place-items: center; margin: 0 auto 14px; }
.state code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--color-accent-300); }
.skel-card { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--card-bg); }
.skel-img { aspect-ratio: 1; background: linear-gradient(105deg,#17161C,#211E29,#17161C); animation: noct-shimmer 1.6s ease-in-out infinite; }
.skel-lines { padding: 8.4px; }
.skel-line { height: 9px; width: 72%; border-radius: 3px; background: #211E29; animation: noct-shimmer 1.6s ease-in-out infinite; }
.skel-line.short { height: 8px; width: 44%; background: #1B1921; margin-top: 7px; }

/* ── Detail panel ────────────────────────────────────────────────────────── */
.panel { flex: none; width: 432px; border-left: 1px solid var(--color-divider); background: var(--panel-bg);
  display: flex; flex-direction: column; min-height: 0; box-shadow: -18px 0 40px rgba(0,0,0,.45);
  animation: noct-panel-in .18s ease-out; }
.panel-head { flex: none; display: flex; align-items: center; gap: 5.6px; padding: 8.4px 11.2px;
  border-bottom: 1px solid var(--color-divider); }
.panel-idx { font-size: 11.5px; color: var(--muted-40); font-variant-numeric: tabular-nums; margin-left: 2px; }
.panel-head .close { margin-left: auto; }
.panel-body { flex: 1; overflow-y: auto; min-height: 0; }

.hero { position: relative; aspect-ratio: 1; background: var(--sunken); border-bottom: 1px solid var(--color-divider); }
.hero-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero.nsfw .hero-img { filter: blur(22px) saturate(.5); }
body.nsfw-shown .hero.nsfw .hero-img { filter: none; }
.hero-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,9,14,.3); }
body.nsfw-shown .hero.nsfw .hero-veil { display: none; }
.hero:not(.nsfw) .hero-veil { display: none; }
.hero-veil .btn { background: rgba(10,9,14,.7); }

.panel-main { padding: 14px 16.8px 22.4px; }
.panel-main h4 { margin: 0 0 5px; line-height: 1.25; text-wrap: pretty; }
.byline { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; text-wrap: pretty; }
.byline b { color: var(--color-text); font-weight: 400; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5.6px; margin-bottom: 14px; }
.dtag { cursor: pointer; font: inherit; font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-hover); color: var(--text-2); transition: border-color var(--dur), color var(--dur); }
.dtag:hover { border-color: #4A4654; color: var(--color-text); }
.dtag.active, .dtag.primary { border-color: var(--violet); background: rgba(124,58,237,.18); color: var(--lavender-soft); }
.dtag.nsfw { border-color: var(--crimson); background: rgba(185,28,60,.18); color: var(--crimson-text); }

.spec { border: 1px solid var(--border); background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; }
.spec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 10px; }
.spec-row:nth-child(odd) { background: rgba(255,255,255,.02); }
.spec-row + .spec-row { border-top: 1px solid var(--divider-soft); }
.spec-k { color: var(--text-3); font-size: 12.5px; }
.spec-v { font-size: 12.5px; font-family: var(--font-heading); text-align: right; color: var(--color-text); }
.spec-v.yes { color: var(--good); }
.spec-v.no { color: var(--text-3); }

.pkgs-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px; }
.pkgs { margin: 0 0 14px; max-height: 230px; overflow: auto; padding: 10px 11.2px; background: var(--sunken);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; color: var(--text-2); }

.gated-note { display: flex; gap: 7px; align-items: flex-start; padding: 8.4px 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: var(--radius-md);
  font-size: 12px; color: var(--warn-txt); margin-bottom: 11.2px; }
.gated-note svg { flex: none; margin-top: 2px; }
.dl-primary { margin-top: 0; }
.dl-primary.glow { box-shadow: 0 0 16px rgba(124,58,237,.28); }
/* Pro-lock: a "PRO" padlock badge on gated cards + a muted (clearly-not-a-download) button */
.card-lock { position: absolute; bottom: 6px; left: 6px; z-index: 3; display: flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 6px 2px 5px; border-radius: 999px;
  color: #fff; background: rgba(76,29,149,.85); border: 1px solid var(--violet);
  backdrop-filter: blur(4px); cursor: help; }
.card-lock svg { flex: none; }
.dl-primary.locked { color: var(--text-2); background: var(--color-surface); border-color: var(--border); box-shadow: none; }
.dl-primary.locked:hover { background: var(--surface-hover); color: var(--color-text); }
.detail-actions { display: flex; gap: 7px; margin-top: 7px; }
.detail-actions .btn { flex: 1; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablet / narrow: detail panel becomes a full-height overlay from the right */
@media (max-width: 1100px) {
  .panel { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; z-index: 50;
    width: min(432px, 100%); }
}

/* Sidebar becomes a slide-in drawer with a tap-to-close scrim */
@media (max-width: 760px) {
  .side { position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; z-index: 46;
    width: min(280px, 84vw); box-shadow: 2px 0 28px rgba(0,0,0,.55);
    transform: translateX(-100%); }
  body.side-collapsed .side { display: block; }        /* keep in DOM so it can slide, not display:none */
  body:not(.side-collapsed) .side { transform: translateX(0); }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(0,0,0,.5); animation: noct-fade-in .2s ease; }
  body.side-collapsed .side-backdrop { display: none; }
}

/* Phone: stack the header, 2-up grid, touch-sized inputs */
@media (max-width: 640px) {
  .hdr-row { flex-wrap: wrap; gap: 8px; padding: 8px 12px 10px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .search { order: 3; flex: 1 0 100%; max-width: none; margin-left: 0; }
  .hdr-controls { order: 4; flex: 1 0 100%; margin-left: 0; gap: 8px; flex-wrap: wrap; }
  .hdr-controls select.input { flex: 1 1 120px; }
  #nsfwBtn { flex: 1 1 auto; justify-content: center; }
  /* 16px inputs stop iOS from zooming on focus */
  .input { font-size: 16px; }

  .main-inner { padding: 12px 12px 40px; }
  .result-row { gap: 8px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid[data-density="S"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid[data-density="L"] { grid-template-columns: 1fr; }

  /* no hover on touch — keep the views pill visible */
  .card-views { opacity: 1; }

  .foot-note { padding-bottom: 24px; }
}

/* ══ Accounts, favorites, floating modal (v2) ═══════════════════════════════ */

/* header account + favorites buttons */
#favToggle, #accountBtn { height: 36px; border: 1px solid var(--border); background: var(--color-surface); color: var(--text-2); }
#favToggle:hover, #accountBtn:hover { background: var(--surface-hover); color: var(--color-text); }
#favToggle.is-on, #accountBtn.is-on { border-color: var(--violet); color: var(--lavender-soft); background: rgba(124,58,237,.15); }
#favToggle.is-on svg { fill: var(--lavender); stroke: var(--lavender); }

/* favorite heart on cards */
.card-frame { }  /* (already position:relative) */
.fav-btn { position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px; display: grid;
  place-items: center; border: 0; border-radius: 50%; background: rgba(10,9,14,.66); color: var(--text-2); cursor: pointer;
  backdrop-filter: blur(4px); opacity: 0; transition: opacity .15s, transform .1s; }
.card:hover .fav-btn, .fav-btn.is-fav { opacity: 1; }
.fav-btn:active { transform: scale(.86); }
.fav-btn svg { fill: none; stroke: currentColor; }
.fav-btn:hover { color: var(--color-text); }
.fav-btn.is-fav { color: var(--lavender); }
.fav-btn.is-fav svg { fill: var(--lavender); stroke: var(--lavender); filter: drop-shadow(0 0 6px rgba(124,58,237,.45)); }
.card .card-views { top: auto; bottom: 6px; }   /* move views to bottom so it clears the heart */

/* floating detail modal */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: var(--scrim); backdrop-filter: blur(3px); animation: ov-in .16s ease; }
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card { position: relative; width: min(1180px, 92vw); height: min(860px, 90vh); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: card-in .18s cubic-bezier(.2,.8,.3,1); }
@keyframes card-in { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 6; width: 34px; height: 34px; display: grid;
  place-items: center; border: 0; border-radius: 50%; background: rgba(10,9,14,.72); color: #fff; cursor: pointer; backdrop-filter: blur(4px); }
.modal-idx { position: absolute; top: 16px; left: 14px; z-index: 6; font-size: 11.5px; color: #fff;
  background: rgba(10,9,14,.6); padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); font-variant-numeric: tabular-nums; }

.m-imgpane { position: relative; flex: 0 0 61%; background: var(--sunken); display: flex; flex-direction: column; min-width: 0; }
.m-main { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; min-height: 0; }
.m-main-img { width: 100%; height: 100%; object-fit: contain; }
.m-imgpane.nsfw .m-main-img, .m-imgpane.nsfw .m-thumb img { filter: blur(26px) saturate(.5); }
body.nsfw-shown .m-imgpane.nsfw .m-main-img, body.nsfw-shown .m-imgpane.nsfw .m-thumb img { filter: none; }
.m-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,9,14,.32); cursor: default; }
body.nsfw-shown .m-imgpane.nsfw .m-veil, .m-imgpane:not(.nsfw) .m-veil { display: none; }
.modal-nav { position: absolute; top: 44%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px;
  border-radius: 50%; display: grid; place-items: center; border: 0; background: rgba(10,9,14,.66); color: #fff;
  cursor: pointer; backdrop-filter: blur(4px); }
.modal-nav.prev { left: 10px; } .modal-nav.next { right: 10px; }

/* far-outside-the-card arrows — step between AVATARS, not images. Live directly on the overlay
   (outside .modal-card) so they read as "browse the gallery", distinct from the in-image arrows
   above which browse that one avatar's extra photos. */
.modal-outer-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px;
  border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent); color: var(--m70); cursor: pointer;
  backdrop-filter: blur(6px); box-shadow: 0 10px 28px rgba(0,0,0,.4); transition: background .15s, color .15s, transform .15s; }
.modal-outer-nav:hover { background: var(--violet-deep); border-color: var(--violet); color: var(--color-accent-100); transform: translateY(-50%) scale(1.05); }
.modal-outer-nav.prev { left: 16px; }
.modal-outer-nav.next { right: 16px; }
/* .modal-card caps at 1180px/92vw — below ~1320px wide there isn't enough margin outside the card
   for these to sit clear of it, so hide them there and lean on the in-image + keyboard arrows. */
@media (max-width: 1320px) {
  .modal-outer-nav { display: none; }
}
.m-thumbs { flex: none; display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: rgba(0,0,0,.22); scrollbar-width: thin; }
.m-thumbs:only-child { }
.m-thumb { flex: none; width: 58px; height: 58px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--card-bg); }
.m-thumb.sel { border-color: var(--violet); box-shadow: 0 0 10px rgba(124,58,237,.35); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }

.m-info { flex: 1 1 39%; min-width: 0; overflow-y: auto; padding: 20px 22px 26px; }
.m-title-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.m-title { font-size: 22px; font-weight: 700; line-height: 1.25; flex: 1; min-width: 0; text-wrap: pretty; }
.m-fav { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-divider);
  background: transparent; color: var(--m70); cursor: pointer; display: grid; place-items: center; }
.m-fav:hover { border-color: var(--violet); color: var(--lavender); }
.m-fav.is-fav { color: var(--lavender); border-color: var(--violet); background: rgba(124,58,237,.14); }
.m-fav svg { fill: none; stroke: currentColor; }
.m-fav.is-fav svg { fill: var(--lavender); filter: drop-shadow(0 0 6px rgba(124,58,237,.45)); }
.dl-vr-note { font-size: 11.5px; color: var(--m45); margin: 8px 0 0; text-align: center; }
.dl-vr-note a { cursor: pointer; }

/* full-image lightbox */
.lightbox { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 18px;
  background: rgba(0,0,0,.9); cursor: zoom-out; animation: ov-in .14s ease; }
.lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 6px; }

/* account dialog + vrmodels-login prompt */
.dlg-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: var(--scrim); backdrop-filter: blur(3px); animation: ov-in .14s ease; }
.dlg { width: min(400px, 94vw); background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: card-in .16s ease; }
.dlg-x { float: right; background: transparent; border: 0; color: var(--m55); cursor: pointer; font-size: 20px; line-height: 1; margin: -6px -6px 0 0; }
.dlg h3 { font-size: 19px; margin: 0 0 4px; }
.dlg p.sub { color: var(--m55); font-size: 13px; margin: 0 0 16px; text-wrap: pretty; }
.dlg .field { margin-bottom: 11px; }
.dlg .field label { display: block; font-size: 12px; color: var(--m70); margin-bottom: 5px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 16px; }
.dlg-actions .btn { flex: 1; }
.dlg-err { color: var(--warn-txt); font-size: 12.5px; margin-top: 8px; min-height: 1em; }
.dlg-switch { text-align: center; font-size: 12.5px; color: var(--color-text-muted, #9aa0b4); margin: 13px 0 0; }
.dlg-switch a { color: var(--color-accent); cursor: pointer; }
.dlg-switch { text-align: center; font-size: 12.5px; color: var(--m55); margin-top: 14px; }
.dlg-switch a { cursor: pointer; color: var(--color-accent-400); }

/* toast */
.toast-d { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 99;
  background: var(--surface-hover); border: 1px solid var(--border); color: var(--color-text);
  font-size: 13px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: card-in .16s ease; }

/* Phones/tablets: the whole pop-up is ONE scrolling panel (gallery on top, details below),
   sized to the visible viewport (dvh excludes the browser's address bar) and padded clear of the
   home indicator. Previously only .m-info was meant to scroll, but as a column-flex child without
   min-height:0 it never did, so the buttons under "View on …" were cut off. */
@media (max-width: 860px) {
  .overlay { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .modal-card { display: block; width: 100%; height: auto; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .m-imgpane { height: 46vh; height: 46dvh; }
  .m-info { overflow: visible; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  .modal-close { position: sticky; top: 10px; float: right; margin: 10px 10px -44px 0; }
  .modal-idx { position: absolute; }
}

/* ── Section tabs (VRModels | For sale) ───────────────────────────────────── */
.tabs { display: flex; align-items: stretch; gap: 4px; flex: none; align-self: stretch; margin: -11.2px 0 -8.4px; }
.tab { position: relative; display: inline-flex; align-items: center; padding: 0 12px; font-size: 13.5px; font-weight: 500;
  color: var(--text-2); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
  transition: color var(--dur), border-color var(--dur), background var(--dur); }
.tab:hover { color: var(--color-text); background: rgba(255,255,255,.02); }
.tab.active { color: var(--lavender); border-bottom-color: var(--violet); text-shadow: 0 0 10px rgba(124,58,237,.35); }

/* ── For sale page ────────────────────────────────────────────────────────── */
.kind-seg .seg-opt { font-weight: 500; }
.card-price { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 650; font-variant-numeric: tabular-nums; color: #fff; background: var(--glass);
  border: 1px solid rgba(124,58,237,.55); backdrop-filter: blur(4px); }
/* Store badges stay neutral silver: crimson is reserved for attention states. */
.badge-store { background: var(--glass); border: 1px solid #5A5662; color: var(--color-text); }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: -4px 0 14px; }
.price-big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-accent-300); }
.price-usd { font-size: 13px; color: var(--muted-45); }
.buy-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.buy-links .btn { font-size: 12.5px; }
@media (max-width: 1100px) { .tabs .tab { padding: 5px 8px; } }

/* ── Page heading ─────────────────────────────────────────────────────────── */
.page-head { margin: 4px 0 14px; }
.page-head h1 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin: 0; }
.page-head .grad { background: linear-gradient(90deg, #A78BFA, #7C3AED); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.page-head p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }

/* ── Following: nav badge ─────────────────────────────────────────────────── */
.following-nav { position: relative; }
.following-new-badge { position: absolute; top: 3px; right: -8px; z-index: 2;
  background: var(--crimson); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; line-height: 1.2;
  padding: 2px 6px; border-radius: 999px; box-shadow: 0 0 8px rgba(185,28,60,.45); text-shadow: none;
  pointer-events: none; animation: badge-in .22s var(--ease) both; }
@keyframes badge-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .following-new-badge { animation: none; } }

/* ── Following: follow button + creator bar ───────────────────────────────── */
.follow-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; white-space: nowrap;
  background: var(--color-surface); border: 1px solid var(--violet); color: var(--lavender);
  transition: background var(--dur), color var(--dur), border-color var(--dur); }
.follow-btn:hover { background: rgba(124,58,237,.12); color: var(--lavender-soft); }
.follow-btn.following { background: rgba(124,58,237,.16); border-color: var(--violet); color: var(--lavender-soft); }
.follow-btn.following:hover { border-color: var(--crimson); color: var(--crimson-text); background: rgba(185,28,60,.12); }
.follow-btn .fb-hover { display: none; }
.follow-btn.following:hover .fb-label { display: none; }
.follow-btn.following:hover .fb-hover { display: inline; }
.follow-btn svg { flex: none; }
.creator-link { background: none; border: 0; padding: 0; font: inherit; color: var(--color-text); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.creator-link:hover { color: var(--lavender); text-decoration-color: var(--violet); }
.byline-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 14px; }
.byline-row .byline { margin: 0; }

.creator-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 14px; margin: 0 0 14px;
  background: var(--color-surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.creator-bar .cb-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(124,58,237,.16); border: 1px solid var(--violet); color: var(--lavender-soft); font-weight: 750; }
.creator-bar .cb-text { min-width: 0; }
.creator-bar .cb-name { font-size: 16px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-bar .cb-sub { font-size: 12px; color: var(--text-3); }
.creator-bar .cb-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.creator-bar .cb-actions .btn { height: 28px; font-size: 12.5px; }

/* ── Following: NEW on cards ──────────────────────────────────────────────── */
.card-new-badge { background: var(--crimson); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 5px; box-shadow: 0 0 8px rgba(185,28,60,.4); }
.card.is-new { border-color: rgba(185,28,60,.55); }
.card.is-new:hover { border-color: var(--violet); }
.card-src { position: absolute; left: 6px; bottom: 6px; font-size: 9.5px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); color: var(--text-2); }

/* followed-creator list (Following page sidebar) */
.fc-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 7px; border-radius: var(--radius-sm); }
.fc-row:hover { background: var(--surface-hover); }
.fc-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: inherit; }
.fc-name:hover, .fc-row.active .fc-name { color: var(--lavender-soft); }
.fc-new { font-size: 9.5px; font-weight: 800; color: #fff; background: var(--crimson); padding: 1px 5px; border-radius: 4px; }
.fc-x { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 4px; cursor: pointer;
  background: transparent; color: var(--text-3); }
.fc-x:hover { color: var(--crimson-text); background: rgba(185,28,60,.14); }
.signin-card { max-width: 380px; margin: 40px auto; padding: 22px; background: var(--color-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); }
.signin-card h4 { margin: 0 0 6px; }
.signin-card p { margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.signin-card .input { margin-bottom: 9px; }

@media (max-width: 640px) {
  .tabs { order: 2; flex: 1 0 100%; margin: 0; justify-content: space-between; border-top: 1px solid var(--divider-soft); }
  .tab { flex: 1; justify-content: center; padding: 9px 4px; }
  .following-new-badge { right: 2px; top: 2px; }
  .creator-bar .cb-actions { margin-left: 0; width: 100%; }
  .page-head h1 { font-size: 19px; }
}

/* ── Store scan progress (For sale) ───────────────────────────────────────── */
.scan-progress { display: grid; gap: 12px; margin-top: 20px; text-align: left; width: min(440px, 86vw); }
.scan-row { padding: 11px 13px; background: var(--color-surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.scan-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.scan-name { font-weight: 700; font-size: 13.5px; }
.scan-phase { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-pct { font-size: 12px; font-weight: 650; color: var(--lavender-soft); font-variant-numeric: tabular-nums; }
.scan-bar { position: relative; height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-hover); }
.scan-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-deep), var(--violet));
  box-shadow: 0 0 8px rgba(124,58,237,.45); transition: width .6s var(--ease); }
.scan-row.is-done .scan-bar > i { background: #5A5662; box-shadow: none; }
.scan-bar.indeterminate > i { width: 35% !important; animation: scan-slide 1.4s ease-in-out infinite; }
@keyframes scan-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .scan-bar.indeterminate > i { animation: none; width: 100% !important; opacity: .5; } }
.scan-meta { margin-top: 6px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.scan-banner { margin: 0 0 14px; padding: 11px 13px 13px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-card); }
.scan-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.scan-banner-title { font-size: 12.5px; color: var(--text-2); }
.scan-progress.compact { margin: 0; width: auto; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.scan-progress.compact .scan-row { padding: 9px 11px; }
.scan-meme { display: block; width: min(440px, 86vw); height: auto; margin: 18px auto 0; border-radius: var(--radius-card);
  border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.scan-banner-body { display: flex; gap: 12px; align-items: stretch; }
.scan-banner-body .scan-progress.compact { flex: 1; min-width: 0; }
.scan-meme.small { width: 150px; margin: 0; flex: none; align-self: center; box-shadow: none; }
@media (max-width: 640px) { .scan-meme.small { display: none; } }

/* ── Site notice (e.g. VRModels.store outage) — crimson = warning ─────────── */
.site-notice { display: flex; gap: 11px; align-items: flex-start; margin: 14px 16.8px 0; padding: 11px 14px;
  background: rgba(185,28,60,.13); border: 1px solid var(--crimson); border-radius: var(--radius-card); color: var(--color-text); }
.site-notice > svg { flex: none; color: var(--crimson-text); margin-top: 1px; }
.site-notice-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.45; }
.site-notice-text b { color: var(--crimson-text); font-weight: 700; font-size: 13.5px; }
.site-notice-text span { color: var(--text-2); }
.gated-note.down-note { border-color: var(--crimson); background: rgba(185,28,60,.12); color: var(--crimson-text); }
@media (max-width: 640px) { .site-notice { margin: 12px 12px 0; } }

/* ── VRModels access: request checkbox, status line, locked screen ────────── */
.req-box { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 10px; padding: 9px 10px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--color-surface); }
.req-box:has(input:checked) { border-color: var(--violet); background: rgba(124,58,237,.10); }
.req-box input { margin-top: 3px; accent-color: var(--violet); width: 15px; height: 15px; flex: none; }
.req-box span { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.req-box small { color: var(--text-3); font-size: 11.5px; line-height: 1.4; }
.access-line { padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--color-surface); }
.access-line.access-approved { border-color: var(--violet); color: var(--lavender-soft); }
.access-line.access-requested { border-color: #5A5662; }
.access-line.access-denied { border-color: var(--crimson); color: var(--crimson-text); }
.locked-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
#accountBtn[data-account-btn] { height: 36px; border: 1px solid var(--border); background: var(--color-surface); color: var(--text-2); }
#accountBtn[data-account-btn]:hover { background: var(--surface-hover); color: var(--color-text); }
#accountBtn[data-account-btn].is-on { border-color: var(--violet); color: var(--lavender-soft); background: rgba(124,58,237,.15); }

/* ── Store gallery videos ─────────────────────────────────────────────────── */
.m-main-video { background: #000; cursor: default; }
.m-imgpane.nsfw .m-main-video { filter: blur(26px) saturate(.5); }
body.nsfw-shown .m-imgpane.nsfw .m-main-video { filter: none; }
.m-thumb { position: relative; }
.m-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.m-thumb-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,9,14,.35); }
.m-thumb-play svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.m-imgpane.nsfw .m-thumb video { filter: blur(26px) saturate(.5); }
body.nsfw-shown .m-imgpane.nsfw .m-thumb video { filter: none; }

/* ── Admin: fix avatar/asset sorting (For sale) ───────────────────────────── */
.fix-sort-btn { height: 26px; font-size: 12px; margin-left: auto; }
.fix-sort-btn.on { border-color: var(--violet); color: var(--lavender-soft); background: rgba(124,58,237,.15); }
body.shop-editing .card { cursor: pointer; }
body.shop-editing .card:hover { transform: none; }
.card .sel-box { position: absolute; top: 8px; right: 8px; z-index: 5; width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff;
  background: rgba(10,9,14,.75); border: 2px solid var(--text-2); }
.card.is-selected { border-color: var(--violet); box-shadow: 0 0 0 2px var(--violet), 0 0 16px rgba(124,58,237,.35); }
.card.is-selected .sel-box { background: var(--violet); border-color: var(--violet); }
.card.is-selected .card-img { filter: brightness(.8); }
.edit-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center;
  flex-wrap: wrap; gap: 8px; max-width: calc(100vw - 24px); padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--violet); border-radius: 12px; box-shadow: 0 0 18px rgba(124,58,237,.25), 0 16px 40px rgba(0,0,0,.6); }
.edit-bar .input { width: auto; height: 34px; }
.edit-bar .btn { height: 34px; }
.edit-bar .edit-newtype { width: 130px; }
.edit-count { font-weight: 700; color: var(--lavender-soft); font-variant-numeric: tabular-nums; min-width: 86px; }
.edit-label { font-size: 12px; color: var(--text-3); }
.edit-sep { width: 1px; height: 24px; background: var(--border); }
body.shop-editing .main-inner { padding-bottom: 110px; }
.m-main-yt { border: 0; width: 100%; height: 100%; background: #000; cursor: default; }
.m-thumb-play.yt { background: rgba(10,9,14,.25); }
.m-thumb-play.yt svg { background: #E62117; border-radius: 6px; padding: 2px 5px; width: 26px; height: 18px; }
.btn-danger { color: var(--crimson-text); background: rgba(185,28,60,.12); border-color: var(--crimson); }
.btn-danger:hover { background: rgba(185,28,60,.24); color: #fff; }
.btn-danger:disabled { opacity: .45; }

/* ── Report a listing (For sale) ──────────────────────────────────────────── */
.report-row { margin-top: 12px; text-align: center; }
.report-btn { font-size: 12.5px; color: var(--text-3); }
.report-btn:hover { color: var(--crimson-text); background: rgba(185,28,60,.10); }
.report-dlg { width: min(440px, 94vw); }
.report-dlg .seg { display: flex; }
.report-dlg .seg { width: 100%; }
.report-dlg .field label.seg-opt { display: inline-flex; flex: 1; justify-content: center; margin: 0; font-size: 13px; color: var(--text-2); }
.report-dlg .field label.seg-opt:has(input:checked) { color: var(--lavender-soft); }
.report-asset { display: grid; gap: 8px; margin: 2px 0 11px; }
.report-note { resize: vertical; min-height: 64px; font: inherit; }

/* ── Saved: hearts, "Add to list", Saved page ─────────────────────────────── */
.saved-count { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px;
  background: rgba(124,58,237,.18); color: var(--lavender-soft); line-height: 16px; }
.save-row { display: flex; gap: 7px; margin-top: 7px; }
.save-row .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.save-btn svg, .list-btn svg { flex: none; }
.save-btn.is-fav { color: var(--lavender-soft); border-color: var(--violet); background: rgba(124,58,237,.14); }
.save-btn.is-fav svg { fill: var(--lavender); stroke: var(--lavender); }
.list-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.list-btn.in-list { color: var(--lavender-soft); border-color: var(--violet); }
.detail-actions .list-btn { flex: 1; }
.list-dlg { width: min(400px, 94vw); }
.list-dlg p.sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-rows { display: grid; gap: 4px; max-height: min(46vh, 340px); overflow-y: auto; margin: 0 -4px 12px; padding: 0 4px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); cursor: pointer; font-size: 13.5px; transition: background .15s, border-color .15s; }
.list-row:hover { background: var(--surface-hover); }
.list-row:has(input:checked) { border-color: var(--violet); background: rgba(124,58,237,.10); }
.list-row input { accent-color: var(--violet); width: 16px; height: 16px; margin: 0; flex: none; }
.list-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-n { font-size: 11.5px; color: var(--text-3); flex: none; }
.list-new { display: flex; gap: 7px; }
.list-new .input { flex: 1; min-width: 0; }
.list-dlg .dlg-actions { justify-content: space-between; }
.side-new { margin-top: 8px; }
.side-new .input, .side-new .btn { height: 32px; font-size: 12.5px; }
.saved-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.saved-head-acts { display: flex; gap: 7px; }
.btn-danger-ghost:hover { color: var(--crimson-text); border-color: var(--crimson); background: rgba(185,28,60,.10); }
.saved-chips { display: none; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 14px; padding-bottom: 2px; }
.saved-chips .chip { flex: none; font-size: 12.5px; padding: 5px 11px; }
.saved-chips .chip.on { background: var(--violet); color: #fff; box-shadow: none; }
.saved-chips .chip-add { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--color-divider); }
@media (max-width: 760px) { .saved-chips { display: flex; } }
.card-list-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11.5px;
  background: none; border: 0; padding: 2px 0; color: var(--text-3); cursor: pointer; }
.card-list-btn:hover, .card-list-btn.in-list { color: var(--lavender-soft); }
.card-list-btn svg { width: 13px; height: 13px; }
.rm-btn { font-size: 18px; line-height: 1; }
.rm-btn:hover { color: var(--crimson-text); }
.card.is-gone { opacity: .55; cursor: default; }
.saved-hidden { margin-top: 14px; }
@media (hover: none) { .card .fav-btn { opacity: 1; } }

/* ── Floating pager: sticks to the bottom of the scrolling results, always reachable ── */
.pager { position: sticky; bottom: 14px; z-index: 30; width: fit-content; max-width: 100%; margin: 28px auto 0;
  padding: 6px 8px; flex-wrap: nowrap; gap: 4px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(14,13,18,.86); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 0 0 1px rgba(124,58,237,.10), 0 0 22px rgba(124,58,237,.12); }
.pager .btn, .pager .page-num { border-radius: 999px; }
.pager .btn[disabled] { opacity: .35; }
body.shop-editing .pager { bottom: 86px; }   /* clear the admin "Fix sorting" bar */
@media (max-width: 520px) {
  .pager { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 5px 6px; gap: 2px; }
  .pager .btn { padding: 5px 8px; font-size: 12px; }
  .pager .page-num { min-width: 28px; padding: 5px 4px; font-size: 12px; }
}

/* ── Phones: header floats over the results and retracts on scroll (hdr-hide.js) ── */
@media (max-width: 760px) {
  .app.hdr-floating { position: relative; }
  .app.hdr-floating > .hdr { position: absolute; top: 0; left: 0; right: 0; z-index: 40; will-change: transform; }
  .app.hdr-floating .main { padding-top: var(--hdr-h, 0px); scroll-padding-top: var(--hdr-h, 0px); }
  .app.hdr-floating > .hdr.hdr-moved { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
}

/* ── account notifications (nav.js) ─────────────────────────────────────── */
[data-account-btn] { position: relative; }
.acct-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #B91C3C; box-shadow: 0 0 0 2px var(--color-bg, #070709); }
.acct-dot.hidden { display: none; }
.acct-notes { margin: 6px 0 12px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.acct-notes-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.acct-note { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.acct-note.unread { border-color: var(--violet); background: rgba(124,58,237,.08); }
.acct-note-body { color: var(--text-2); margin-top: 3px; white-space: pre-line; line-height: 1.45; }
.acct-note-when { color: var(--text-3); font-size: 11px; margin-top: 4px; }
.acct-note-link { font-size: 13px; color: var(--violet-light, #A78BFA); }

/* quiet page footer link (creator removal requests) */
.foot-links { text-align: center; font-size: 11px; margin: 4px 0 18px; }
.foot-links a { color: var(--text-3); text-decoration: none; }
.foot-links a:hover { color: var(--text-2); text-decoration: underline; }
