/* ============================================================
   BrandWall — local SVG brand library
   Stylesheet
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #08080b;
  --bg-elev: #0e0e12;
  --bg-card: #131318;
  --bg-card-hover: #1a1a21;
  --border: #232329;
  --border-strong: #303039;
  --text: #f4f4f6;
  --text-dim: #9b9ba6;
  --text-faint: #6c6c78;
  --accent: #7c7cff;
  --accent-2: #b079ff;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
  --accent-soft: rgba(124, 124, 255, 0.14);
  --ok: #34d399;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 4px 16px -6px rgba(0, 0, 0, 0.5);
  --maxw: 1240px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, Menlo, monospace;
}

:root[data-theme="light"] {
  --bg: #f7f7fa;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f3f7;
  --border: #e6e6ec;
  --border-strong: #d6d6df;
  --text: #16161c;
  --text-dim: #5a5a67;
  --text-faint: #8a8a98;
  --accent: #6d28d9;
  --accent-2: #db2777;
  --accent-soft: rgba(109, 40, 217, 0.1);
  --shadow: 0 10px 40px -16px rgba(20, 20, 40, 0.25);
  --shadow-sm: 0 4px 16px -8px rgba(20, 20, 40, 0.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
svg { display: block; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); }

/* ---------- Themed scrollbars ---------- */
:root { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Shared stroke-icon styling */
.search-ico, .icon-btn svg, .nav-link svg, .star-ico, .grid-empty svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1;
  transition: all .16s ease; white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 20px -8px rgba(124, 92, 255, .7); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-dim); border: 1px solid transparent;
  transition: all .16s ease;
}
.icon-btn:hover { color: var(--text); background: var(--bg-card); border-color: var(--border); }
.link-btn { color: var(--accent); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--header-h);
  padding: 0 22px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { border-radius: 7px; }
.brand-name strong { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.header-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link { padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--text-dim); border-radius: 9px; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.star-btn { padding: 8px 14px; }
.star-ico { fill: none; }
.menu-toggle { display: none; margin-left: auto; }
.ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 20px 22px 64px; }
.hero-glow {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 560px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(124, 92, 255, .26), transparent 70%),
              radial-gradient(closest-side, rgba(236, 72, 153, .18), transparent 70%);
  background-position: 30% 30%, 70% 60%; filter: blur(20px);
}
.hero-inner { position: relative; max-width: 820px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; color: var(--text-dim); background: var(--bg-card); margin-bottom: 26px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.hero-title { font-size: clamp(40px, 7vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
.hero-title .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { margin: 22px auto 0; max-width: 560px; font-size: 18px; color: var(--text-dim); }
.hero-sub strong { color: var(--text); }
.hero-searchwrap {
  margin: 36px auto 0; max-width: 580px; position: relative;
  display: flex; align-items: center; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 14px; padding: 7px 7px 7px 44px;
  box-shadow: var(--shadow); transition: border-color .16s, box-shadow .16s;
}
.hero-searchwrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.hero-searchwrap .search-ico { position: absolute; left: 15px; color: var(--text-faint); width: 20px; height: 20px; }
.hero-searchwrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; padding: 8px 6px; }
.hero-search-btn { padding: 11px 22px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 44px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 40px 22px; }
.section-head { margin-bottom: 22px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.section-desc { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

/* Popular ticker (auto-scrolling carousel) */
.popular-ticker {
  position: relative; overflow: hidden; padding: 6px 0 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker-track {
  display: flex; width: max-content; will-change: transform;
  animation: ticker-scroll 60s linear infinite;
}
.popular-ticker:hover .ticker-track,
.ticker-track:focus-within { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.popular-card {
  flex: 0 0 132px; width: 132px; margin-right: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.popular-card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.popular-card img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 12px; padding: 9px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.popular-card .pc-name { max-width: 100%; font-size: 13px; font-weight: 600; color: var(--text-dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chip cloud */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.chip .chip-count { font-size: 12px; color: var(--text-faint); font-weight: 600; }

/* ---------- Browse layout ---------- */
.section-browse { padding-top: 20px; }
.browse-layout { display: grid; grid-template-columns: 232px 1fr; gap: 28px; align-items: start; }
.browse-sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; overflow: hidden;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sidebar-head h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.cat-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; scrollbar-width: thin; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; border-radius: 9px; font-size: 14px; color: var(--text-dim);
  text-align: left; width: 100%; transition: all .13s ease;
}
.cat-item:hover { background: var(--bg-card-hover); color: var(--text); }
.cat-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat-item .cat-count {
  font-size: 12px; color: var(--text-faint); background: var(--bg-elev);
  border-radius: 999px; padding: 1px 8px; min-width: 26px; text-align: center;
}
.cat-item.active .cat-count { color: var(--accent); background: transparent; }

.browse-main { min-width: 0; }
.browse-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-search { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.toolbar-search .search-ico { position: absolute; left: 13px; color: var(--text-faint); }
.toolbar-search input {
  width: 100%; padding: 10px 14px 10px 40px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 11px; color: var(--text);
  font-size: 14px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.toolbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.result-count strong { color: var(--text); }
.select {
  padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-dim); font-size: 13px; outline: none; cursor: pointer;
}
.select:focus { border-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--text-dim); border-radius: 8px; transition: all .14s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.active-filters:empty { display: none; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 13px; font-weight: 600;
}
.filter-tag button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: inherit; }
.filter-tag button:hover { background: rgba(124,124,255,.25); }

/* ---------- Icon grid ---------- */
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px;
}
.icon-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 12px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all .15s ease; cursor: pointer;
  content-visibility: auto; contain-intrinsic-size: 132px;
}
.icon-card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.icon-thumb { width: 58px; height: 58px; display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.icon-thumb img { width: 100%; height: 100%; object-fit: contain; }
.icon-name { font-size: 12.5px; font-weight: 500; color: var(--text-dim); text-align: center; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-card:hover .icon-name { color: var(--text); }
/* Variant count (top-left) + favorite (top-right): both always visible. */
.icon-card > .mini-btn.fav { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; padding: 2px; border-radius: 6px; }
.mini-btn {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px;
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  border: 1px solid var(--border); color: var(--text-faint);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: all .14s ease;
}
.mini-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.mini-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-card > .mini-btn.fav svg { width: 12px; height: 12px; }
.mini-btn.fav:hover { color: #f43f5e; border-color: #f43f5e; background: rgba(244,63,94,.12); }
.mini-btn.fav.active { color: #f43f5e; border-color: #f43f5e; }
.mini-btn.fav.active svg { fill: #f43f5e; }
.icon-card .badge-variants {
  position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700;
  color: var(--text-faint); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px;
}

/* Empty / loading */
.grid-empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.grid-empty svg { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--text-faint); }
.grid-empty p { margin-bottom: 16px; }
.grid-sentinel { height: 1px; }
.skeleton {
  background: linear-gradient(100deg, var(--bg-card) 30%, var(--bg-card-hover) 50%, var(--bg-card) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Favorites sidebar tab ---------- */
.cat-item .cat-label { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cat-fav .cat-heart { color: #f43f5e; flex: none; }
.cat-fav.active .cat-heart { color: inherit; }

/* ---------- Install button ---------- */
.install-btn { padding: 8px 13px; }
.install-ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Account (header) ---------- */
.auth-slot { display: flex; align-items: center; }
.sign-in-btn { display: inline-flex; align-items: center; gap: 8px; }
.sign-in-btn svg { flex: none; }
.account { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; transition: box-shadow .15s, border-color .15s;
  max-width: 200px;
}
.account-btn:hover { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--border-strong); }
.account-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-grad); color: #fff; font-size: 13px; font-weight: 700; line-height: 1;
}
.account-name {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-caret { color: var(--text-faint); flex: none; }
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 230px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
}
.account-menu[hidden] { display: none; }
.account-id {
  padding: 8px 10px 11px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.account-uname { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; word-break: break-word; }
.account-email {
  font-size: 12px; font-weight: 500; color: var(--text-dim); word-break: break-all; margin-top: 3px;
}
.account-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  font-size: 14px; color: var(--text-dim); text-align: left; width: 100%;
  background: none; border: 0; cursor: pointer; transition: background .13s, color .13s;
}
.account-item:hover { background: var(--bg-card-hover); color: var(--text); }
.account-item svg { flex: none; }
.account-count {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-faint);
  background: var(--bg-elev); border-radius: 999px; padding: 1px 9px;
}

/* ---------- Detail page favorite button ---------- */
.id-fav.active { color: #f43f5e; border-color: #f43f5e; }
.id-actions .id-fav svg { transition: fill .15s; }
.id-actions .id-fav.active svg { fill: #f43f5e; stroke: #f43f5e; }

/* ---------- Auth modal ---------- */
.auth-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-backdrop {
  position: absolute; inset: 0; background: rgba(4, 4, 9, .66);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s ease;
}
.auth-modal.open .auth-backdrop { opacity: 1; }
.auth-dialog {
  position: relative; width: 100%; max-width: 404px; max-height: 92vh; overflow: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 26px 28px; box-shadow: var(--shadow);
  transform: translateY(12px) scale(.985); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
.auth-modal.open .auth-dialog { transform: none; opacity: 1; }
.auth-x {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; color: var(--text-faint); transition: all .14s;
}
.auth-x:hover { color: var(--text); background: var(--bg-card-hover); }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head img { border-radius: 9px; margin-bottom: 12px; }
.auth-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { margin-top: 6px; font-size: 13.5px; color: var(--text-dim); }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 18px;
}
.auth-tab { padding: 9px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-dim); transition: all .14s; }
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.auth-field input {
  width: 100%; padding: 11px 13px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-remember { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; margin-bottom: 16px; }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.auth-error {
  font-size: 13px; color: #fb7185; background: rgba(244, 63, 94, .1);
  border: 1px solid rgba(244, 63, 94, .3); border-radius: 9px; padding: 9px 12px; margin-bottom: 14px;
}
.auth-submit { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.auth-submit.loading { opacity: .65; pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-elev); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 22px 30px; display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-tag { font-size: 14px; color: var(--text); font-weight: 500; max-width: 340px; }
.footer-note { font-size: 13px; color: var(--text-faint); max-width: 340px; margin-top: 8px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: var(--text-dim); padding: 5px 0; transition: color .14s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
}
.footer-bottom a { color: var(--text-dim); } .footer-bottom a:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad); color: #fff;
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  box-shadow: 0 10px 26px -10px rgba(124, 92, 255, .8), var(--shadow);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.92);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, filter .15s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { filter: brightness(1.08); transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) {
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .browse-layout { grid-template-columns: 1fr; }
  .browse-sidebar { position: static; max-height: none; flex-direction: column; }
  .cat-list { flex-direction: row; flex-wrap: wrap; max-height: 160px; }
  .cat-item { width: auto; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  /* Mobile nav is an animated dropdown: kept in flow-free absolute position so
     it can transition height/opacity (display:none can't be animated). */
  .header-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; margin-left: 0;
    flex-direction: column; align-items: center; gap: 4px;
    padding: 0 22px; background: var(--bg-elev);
    max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-8px);
    border-bottom: 1px solid transparent; pointer-events: none;
    transition: max-height .3s ease, opacity .25s ease, transform .25s ease, padding .25s ease, border-color .25s ease;
  }
  .header-nav.open {
    max-height: 80vh; opacity: 1; transform: none; padding: 14px 22px;
    border-bottom-color: var(--border); pointer-events: auto;
  }
  .header-nav .nav-link { padding: 12px; width: 100%; text-align: center; }
  /* Sign in / account sits to the right, with the burger immediately after it. */
  .auth-slot { margin-left: auto; }
  .menu-toggle { display: inline-grid; margin-left: 10px; }
  /* "Browse by category" chips are redundant on mobile (Categories list is right below). */
  .section-chips { display: none; }
  /* Center the result count + sort + view controls. */
  .toolbar-controls { justify-content: center; width: 100%; }
  .hero { padding: 20px 20px 44px; }
  .hero-stats { gap: 28px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; }
}
@media (max-width: 480px) {
  .hero-search-btn { padding: 11px 16px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ticker-track { animation: none !important; }
  .popular-ticker { overflow-x: auto; }
  .popular-ticker .popular-card[aria-hidden="true"] { display: none; }
}
