/* CodyChat Marketplace — Design System v1.0 */
/* ─────────────────────────────────────────── */

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--accent-glow); }
img { max-width: 100%; display: block; }
button { cursor: pointer; }
input, textarea, select, button { font-family: inherit; }

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:       #7C3AED;
  --primary-dim:   #6D28D9;
  --primary-glow:  rgba(124, 58, 237, 0.15);
  --accent:        #06B6D4;
  --accent-glow:   #0891B2;

  /* Surfaces */
  --bg:         #0A0A0F;
  --surface-1:  #13131A;
  --surface-2:  #1A1A25;
  --surface-3:  #22223A;
  --border:     #2A2A40;
  --border-glow:rgba(124, 58, 237, 0.4);

  /* Text */
  --text:         #F0F0FF;
  --text-2:       #9090B0;
  --text-muted:   #5A5A7A;
  --text-disabled:#3A3A55;

  /* Status */
  --success:  #10B981;
  --warning:  #F59E0B;
  --error:    #EF4444;
  --info:     #3B82F6;

  /* Glass */
  --glass-bg:    rgba(255, 255, 255, 0.04);
  --glass-border:rgba(255, 255, 255, 0.08);

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10:40px; --sp-12:48px; --sp-16:64px;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 9999px;

  /* Layout */
  --sidebar-w: 240px;
  --header-h:  64px;
  --content-max: 1280px;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem;  font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem;font-weight: 600; }
p  { color: var(--text-2); line-height: 1.75; }
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-muted   { color: var(--text-muted); }
.text-secondary{ color: var(--text-2); }
.text-accent  { color: var(--accent); }
.text-primary { color: var(--primary); }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
code, .mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85em; }

/* ─── Layout Shell ───────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* Header */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  z-index: 90;
  will-change: transform;
  transform: translate3d(0,0,0);
}
.header-logo {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.header-logo .logo-icon { color: var(--primary); display: flex; align-items: center; }
.header-logo .logo-text { color: var(--text); }
.logo-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; display: block; }
.header-nav { display: flex; align-items: center; gap: var(--sp-1); flex: 1; padding: 0 var(--sp-4); }
.header-nav a {
  padding: 6px 12px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: all 150ms;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--surface-2); }
.header-search {
  position: relative; flex: 1; max-width: 360px;
}
.header-search input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 8px 16px 8px 40px;
  color: var(--text); font-size: 0.875rem; outline: none; transition: border-color 200ms;
}
.header-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.header-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex; align-items: center;
}
.header-right { display: flex; align-items: center; gap: var(--sp-3); }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }

/* Avatar Dropdown */
.avatar-btn {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 6px 12px 6px 6px;
  cursor: pointer; transition: border-color 150ms; color: var(--text);
  font-size: 0.875rem; font-weight: 500;
}
.avatar-btn:hover { border-color: var(--primary); }
.avatar-btn .chevron { color: var(--text-muted); display: flex; align-items: center; }
.avatar-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 6px;
  min-width: 180px; z-index: 200;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: all 150ms;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r-md);
  font-size: 0.875rem; color: var(--text-2); width: 100%;
  background: none; border: none; text-align: left; cursor: pointer;
  transition: all 150ms; text-decoration: none; white-space: nowrap;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-menu .logout-btn { color: var(--error); }
.dropdown-menu .logout-btn:hover { background: rgba(239,68,68,.1); color: var(--error); }

/* Hamburger (mobile) */
.hamburger-btn {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; padding: 6px;
}
.hamburger-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 250ms;
}

/* Main Content Area */
.app-main {
  margin-top: var(--header-h);
  flex: 1;
  min-width: 0;
}
.page-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 600; border: none;
  cursor: pointer; transition: all 150ms; text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.btn-sm  { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dim); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,58,237,.3); color: #fff; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-glow); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(6,182,212,.08); color: var(--accent); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.btn-icon-sm { width: 30px; height: 30px; padding: 0; border-radius: var(--r-md); }

/* ─── Inputs & Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-2); margin-bottom: 6px;
}
.form-label .req { color: var(--error); margin-left: 2px; }
.form-control {
  width: 100%; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 14px;
  color: var(--text); font-size: 0.875rem; outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--error); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--error); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.char-counter { font-size: 0.75rem; color: var(--text-muted); text-align: right; margin-top: 4px; }

/* Checkbox & Radio */
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox], .form-check input[type=radio] {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}
.form-check label { font-size: 0.875rem; color: var(--text-2); cursor: pointer; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms;
}
.card:hover { border-color: var(--border-glow); box-shadow: 0 8px 32px rgba(124,58,237,.1); }
.card-body { padding: var(--sp-6); }
.card-header { padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-footer { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); background: var(--surface-2); }

/* Glass Card */
.card-glass {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); border-radius: var(--r-xl);
}

/* Stat Card */
.stat-card { padding: var(--sp-6); }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-card .stat-label { font-size: 0.8125rem; color: var(--text-2); margin-top: 4px; }
.stat-card .stat-delta { font-size: 0.75rem; margin-top: 8px; }
.stat-card .delta-up   { color: var(--success); }
.stat-card .delta-down { color: var(--error); }

/* ─── Product Card ───────────────────────────────────────────────────────── */
.product-card {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 220ms ease, border-color 220ms, box-shadow 220ms;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 16px 48px rgba(124,58,237,.18), 0 4px 16px rgba(0,0,0,.35);
}
/* How-to-pay manual payment box */
.how-to-pay-box {
  background: rgba(6,182,212,.06); border: 1px solid rgba(6,182,212,.2);
  border-radius: var(--r-md); padding: var(--sp-4);
  font-size: 0.875rem; color: var(--text-2);
}
.how-to-pay-box .htp-title {
  font-weight: 700; color: var(--text); margin-bottom: var(--sp-2);
  display: flex; align-items: center; gap: 6px;
}
.how-to-pay-box .htp-email {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 10px;
  font-family: 'JetBrains Mono','Fira Code',monospace; font-size: 0.875rem;
  color: var(--accent); word-break: break-all; margin: var(--sp-2) 0;
}
.how-to-pay-box p { color: var(--text-2); margin-bottom: var(--sp-2); line-height: 1.5; }
.product-card .card-image {
  width: 100%; aspect-ratio: 16/9; overflow: hidden; position: relative;
  background: var(--surface-3); flex-shrink: 0;
}
.product-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.product-card:hover .card-image img { transform: scale(1.07); }
.product-card .card-image .no-image {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.product-card .card-badges {
  position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap;
}
.product-card .card-info { padding: var(--sp-4); flex: 1; display: flex; flex-direction: column; }
.product-card .card-title {
  font-size: 0.9375rem; font-weight: 700; color: var(--text);
  margin-bottom: 3px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .card-author { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
/* Developer link — sits above card's onclick area */
.product-card .card-dev-link { color: var(--accent); text-decoration: none; }
.product-card .card-dev-link:hover { text-decoration: underline; }
.product-card .card-desc {
  font-size: 0.8125rem; color: var(--text-2); line-height: 1.5; margin-bottom: 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--border);
}
.product-card .card-stats { display: flex; align-items: center; gap: var(--sp-3); font-size: 0.75rem; color: var(--text-muted); }

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-5);
}
.product-grid .product-card { max-width: 100%; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-sm);
  font-size: 0.6875rem; font-weight: 600; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-addon    { background: rgba(124,58,237,.2);  color: #A78BFA; border-color: rgba(124,58,237,.3); }
.badge-theme    { background: rgba(6,182,212,.2);   color: #67E8F9; border-color: rgba(6,182,212,.3); }
.badge-login    { background: rgba(16,185,129,.2);  color: #6EE7B7; border-color: rgba(16,185,129,.3); }
.badge-free     { background: rgba(16,185,129,.15); color: #10B981; border-color: rgba(16,185,129,.2); }
.badge-paid     { background: rgba(245,158,11,.15); color: #F59E0B; border-color: rgba(245,158,11,.2); }
.badge-featured { background: rgba(245,158,11,.2);  color: #FCD34D; border-color: rgba(245,158,11,.3); }
.badge-new      { background: rgba(124,58,237,.2);  color: #C4B5FD; border-color: rgba(124,58,237,.3); }
.badge-owner    { background: linear-gradient(135deg,rgba(245,158,11,.3),rgba(251,191,36,.3)); color: #FCD34D; border-color: rgba(245,158,11,.3); }
.badge-developer{ background: rgba(124,58,237,.2);  color: #A78BFA; border-color: rgba(124,58,237,.3); }
.badge-vip      { background: rgba(6,182,212,.2);   color: #67E8F9; border-color: rgba(6,182,212,.3); }
.badge-user     { background: var(--surface-3);     color: var(--text-2); border-color: var(--border); }

/* Status badges */
.badge-live     { background: rgba(16,185,129,.15); color: #10B981; border-color: rgba(16,185,129,.2); }
.badge-draft    { background: var(--surface-3);     color: var(--text-2); border-color: var(--border); }
.badge-review   { background: rgba(245,158,11,.15); color: #F59E0B; border-color: rgba(245,158,11,.2); }
.badge-soon     { background: rgba(59,130,246,.15); color: #93C5FD; border-color: rgba(59,130,246,.2); }
.badge-hidden   { background: rgba(239,68,68,.15);  color: #FCA5A5; border-color: rgba(239,68,68,.2); }

/* Status dot badges */
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8125rem; }
.status-dot::before { content:''; width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.status-dot.live::before     { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.draft::before    { background: var(--text-muted); }
.status-dot.review::before   { background: var(--warning); }
.status-dot.soon::before     { background: var(--info); }
.status-dot.hidden::before   { background: var(--error); }

/* ─── Hero Section ───────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 100%, rgba(6,182,212,.08) 0%, transparent 50%);
  border-bottom: 1px solid var(--border);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: var(--sp-4);
}
.hero-sub { font-size: 1.125rem; color: var(--text-2); max-width: 520px; margin: 0 auto var(--sp-8); }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; }
.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-8);
  margin-top: var(--sp-10); padding-top: var(--sp-8); border-top: 1px solid var(--border);
}
.hero-stat-num { font-size: 1.75rem; font-weight: 700; color: var(--accent); display: block; }
.hero-stat-label { font-size: 0.8125rem; color: var(--text-2); margin-top: 2px; }

/* ─── Category Cards (Home) ──────────────────────────────────────────────── */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4);
}
.category-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-6) var(--sp-4); text-align: center;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer;
  transition: all 200ms; text-decoration: none;
}
.category-card:hover { border-color: var(--primary); background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
.category-card .cat-icon { display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-3); color: var(--primary); }
.category-card .cat-label { font-size: 1rem; font-weight: 600; color: var(--text); }
.category-card .cat-count { font-size: 0.8125rem; color: var(--text-2); margin-top: 4px; }

/* ─── Section Header ─────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.section-title { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-link { font-size: 0.875rem; color: var(--accent); }

/* ─── Browse Filters ─────────────────────────────────────────────────────── */
.browse-layout { display: flex; gap: var(--sp-6); align-items: flex-start; }
.filter-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  position: sticky; top: calc(var(--header-h) + var(--sp-5));
}
.filter-group { margin-bottom: var(--sp-5); }
.filter-group:last-child { margin-bottom: 0; }
.filter-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--sp-3); }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.filter-option input { accent-color: var(--primary); }
.filter-option span { font-size: 0.875rem; color: var(--text-2); }
.filter-option:hover span { color: var(--text); }
.browse-content { flex: 1; min-width: 0; }

/* Sort / filter pills */
.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp-5); }
.pill {
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all 150ms;
}
.pill:hover, .pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-accent.active { background: var(--accent); border-color: var(--accent); }

/* Sort select */
.sort-select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 7px 32px 7px 12px; color: var(--text); font-size: 0.8125rem;
  appearance: none; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%239090B0' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ─── Product Page ───────────────────────────────────────────────────────── */
.product-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-8); align-items: flex-start; }
.product-gallery { border-radius: var(--r-lg); overflow: hidden; background: var(--surface-3); }
.product-gallery .main-img { aspect-ratio: 16/9; overflow: hidden; cursor: zoom-in; }
.product-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbnails { display: flex; gap: 8px; padding: 12px; overflow-x: auto; }
.product-thumbnails .thumb {
  width: 72px; height: 48px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  cursor: pointer; border: 2px solid transparent; transition: border-color 150ms;
}
.product-thumbnails .thumb.active { border-color: var(--primary); }
.product-thumbnails .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Product Tabs */
.product-tabs { margin-top: var(--sp-6); }
.tab-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-6); overflow-x: auto; }
.tab-btn {
  padding: 10px 16px; font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  background: none; border: none; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 150ms;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Product Action Panel */
.product-panel {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-6);
  position: sticky; top: calc(var(--header-h) + var(--sp-5));
}
.product-panel .product-name { font-size: 1.375rem; font-weight: 700; margin-bottom: var(--sp-2); }
.product-panel .product-author { font-size: 0.875rem; color: var(--text-2); margin-bottom: var(--sp-4); }
.product-panel .product-price {
  font-size: 1.75rem; font-weight: 700; color: var(--text);
  margin: var(--sp-4) 0;
}
.product-panel .price-free { color: var(--success); }
.product-panel .panel-divider { height: 1px; background: var(--border); margin: var(--sp-4) 0; }
.meta-row {
  display: flex; justify-content: space-between; font-size: 0.8125rem;
  padding: 6px 0; color: var(--text-2);
}
.meta-row .meta-key { }
.meta-row .meta-val { color: var(--text); font-weight: 500; }
.panel-actions { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-muted); margin-bottom: var(--sp-5); }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.data-table thead tr { background: var(--surface-2); }
.data-table th { padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.data-table td { padding: 14px 16px; font-size: 0.875rem; color: var(--text); border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.data-table .actions-cell { display: flex; gap: 4px; }
.table-empty { padding: var(--sp-10); text-align: center; color: var(--text-2); }

/* ─── Page Loading Bar ───────────────────────────────────────────────────── */
#page-loading-bar {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 9999;
  pointer-events: none; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 300ms ease, opacity 250ms ease;
  width: 0; opacity: 1;
}

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  opacity: 0; pointer-events: none; transition: opacity 150ms;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-8); width: 100%;
  max-width: 480px; max-height: 90vh; overflow-y: auto;
  transform: scale(.96) translateY(-8px); transition: transform 150ms;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 640px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); }
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-2); font-size: 18px; cursor: pointer; padding: 4px; border-radius: var(--r-sm); }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-6); }

/* ─── Toast / Notifications ──────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: var(--sp-6); right: var(--sp-6); z-index: 500; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5);
  min-width: 280px; max-width: 380px; pointer-events: all;
  animation: toastIn 250ms ease; border-left: 4px solid var(--text-muted);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast-text { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 600; }
.toast-msg   { font-size: 0.8125rem; color: var(--text-2); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; font-size: 14px; }
@keyframes toastIn { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:translateX(0); } }

/* ─── Lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 150ms;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--r-md); object-fit: contain; }
.lightbox-close { position: absolute; top: var(--sp-5); right: var(--sp-5); background: rgba(255,255,255,.1); border: none; color: #fff; font-size: 20px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

/* ─── Admin Layout ───────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; margin-top: var(--header-h); }
.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface-1); border-right: 1px solid var(--border);
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: var(--sp-4);
}
.admin-content { flex: 1; padding: var(--sp-8) var(--sp-8); max-width: calc(100% - var(--sidebar-w)); }
.admin-nav-group { margin-bottom: var(--sp-4); }
.admin-nav-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 var(--sp-3) var(--sp-2); }
.admin-nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px var(--sp-3); border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all 150ms;
}
.admin-nav-link:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-link.active { background: var(--primary); color: #fff; }
.admin-nav-link .nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-nav-badge { margin-left: auto; background: var(--error); color: #fff; font-size: 0.6875rem; font-weight: 700; padding: 2px 6px; border-radius: var(--r-full); }
.panel-back-link { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); }

/* Mobile Drawer Nav Links */
.drawer-nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-4); border-radius: var(--r-md);
  font-size: 0.9375rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all 150ms;
}
.drawer-nav-link:hover { background: var(--surface-2); color: var(--text); }
.drawer-search {
  position: relative; margin-bottom: var(--sp-4);
}
.drawer-search input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 10px 16px 10px 40px;
  color: var(--text); font-size: 0.9375rem; outline: none;
}
.drawer-search input:focus { border-color: var(--primary); }
.drawer-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex; align-items: center;
}

/* Page Header (admin) */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-8); }
.page-header h1 { font-size: 1.75rem; }
.page-header p { font-size: 0.875rem; color: var(--text-2); margin-top: 4px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-8); }

/* ─── Request Board ──────────────────────────────────────────────────────── */
.board-item {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-5); display: flex; gap: var(--sp-4);
  transition: border-color 200ms; position: relative;
}
.board-item:hover { border-color: var(--border-glow); }
.vote-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; min-width: 48px; flex-shrink: 0;
}
.vote-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-2); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms;
}
.vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.vote-btn.voted { background: var(--primary); border-color: var(--primary); color: #fff; }
.vote-count { font-size: 1rem; font-weight: 700; color: var(--text); }
.board-content { flex: 1; min-width: 0; }
.board-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.board-meta { font-size: 0.8125rem; color: var(--text-2); margin-bottom: var(--sp-3); }
.board-desc { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; margin-bottom: var(--sp-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-footer { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* Board status badges */
.badge-open       { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-considering{ background: rgba(59,130,246,.15); color: #93C5FD; border-color: rgba(59,130,246,.2); }
.badge-in-progress{ background: rgba(245,158,11,.15); color: #FCD34D; border-color: rgba(245,158,11,.2); }
.badge-fulfilled  { background: rgba(16,185,129,.15); color: #6EE7B7; border-color: rgba(16,185,129,.2); }
.badge-rejected   { background: rgba(239,68,68,.15);  color: #FCA5A5; border-color: rgba(239,68,68,.2); }

/* ─── Developer Profile ──────────────────────────────────────────────────── */
.dev-page { min-height: 60vh; }

/* Hero section */
.dev-hero {
  position: relative; overflow: hidden;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-10) 0 0;
}
.dev-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,58,237,.18), transparent);
}
.dev-hero-inner { position: relative; z-index: 1; }

/* Top row: avatar + identity */
.dev-hero-top {
  display: flex; align-items: flex-start; gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  flex-wrap: wrap;
}

/* Avatar */
.dev-avatar-wrap { flex-shrink: 0; }
.dev-avatar-img {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border);
  display: block;
}
.dev-avatar-letter {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; font-weight: 700; color: #fff;
  border: 3px solid rgba(255,255,255,.08);
}

/* Identity */
.dev-identity { flex: 1; min-width: 0; }
.dev-name {
  font-size: 1.625rem; font-weight: 700; color: var(--text);
  margin: 0 0 2px; line-height: 1.2;
  word-break: break-word;
}
.dev-handle {
  font-size: .875rem; color: var(--text-muted); margin-bottom: var(--sp-3);
}
.dev-badges {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.dev-since { font-size: .75rem; color: var(--text-muted); }
.dev-bio {
  font-size: .9rem; color: var(--text-2); line-height: 1.7;
  max-width: 600px; margin: 0;
}

/* Stats bar */
.dev-stats-bar {
  display: flex; align-items: center;
  border-top: 1px solid var(--border);
  padding: var(--sp-4) 0;
  gap: 0; flex-wrap: wrap;
}
.dev-stat-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 80px;
  padding: var(--sp-2) var(--sp-3);
}
.dev-stat-num  { font-size: 1.375rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.dev-stat-lbl  { font-size: .7rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.dev-stat-divider { width: 1px; background: var(--border); align-self: stretch; margin: var(--sp-2) 0; }

/* ── Mobile overrides ── */
@media (max-width: 600px) {
  .dev-hero { padding-top: var(--sp-6); }
  .dev-hero-top { gap: var(--sp-4); flex-direction: column; align-items: center; text-align: center; }
  .dev-identity { display: flex; flex-direction: column; align-items: center; }
  .dev-bio { text-align: center; }
  .dev-name { font-size: 1.375rem; }
  .dev-stat-divider { display: none; }
  .dev-stats-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
  .dev-stat-item { background: var(--surface-1); }
}

/* ─── Favorite Button ────────────────────────────────────────────────────── */
.fav-btn { transition: all 150ms; }
.fav-btn.favorited { color: #F43F5E; }
.fav-btn:not(.favorited) { color: var(--text-2); }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: var(--sp-8); }
.page-link {
  min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); font-size: 0.875rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all 150ms; text-decoration: none;
}
.page-link:hover { border-color: var(--primary); color: var(--text); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Empty States ───────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: var(--sp-16) var(--sp-6); }
.empty-icon { display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-4); color: var(--text-muted); }
.empty-title { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--sp-2); }
.empty-desc { font-size: 0.875rem; color: var(--text-2); margin-bottom: var(--sp-6); max-width: 380px; margin-left: auto; margin-right: auto; }

/* ─── Account Page ───────────────────────────────────────────────────────── */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-8); align-items: flex-start; }
.account-nav { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
.account-nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px var(--sp-5); font-size: 0.875rem; font-weight: 500;
  color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--border);
  transition: all 150ms;
}
.account-nav a:last-child { border-bottom: none; }
.account-nav a:hover { background: var(--surface-2); color: var(--text); }
.account-nav a.active { background: var(--primary); color: #fff; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
.divider { height: 1px; background: var(--border); margin: var(--sp-5) 0; }
.alert { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); font-size: 0.875rem; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6EE7B7; }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #FCD34D; }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3);  color: #93C5FD; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile Bottom Nav ──────────────────────────────────────────────────── */
/* Site footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-6) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
}
.site-footer > span { font-size: .8125rem; color: var(--text-muted); }
.site-footer > nav  { display: flex; gap: var(--sp-5); font-size: .8125rem; }
.site-footer > nav a { color: var(--text-2); }

.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
  background: var(--surface-1); border-top: 1px solid var(--border);
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Flex container for the 4 nav items */
  flex-direction: row; align-items: stretch;
}
/* Each nav item */
.bnav-link {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 150ms;
  border: none; background: none;
  -webkit-tap-highlight-color: transparent;
}
.bnav-link svg { display: block; flex-shrink: 0; }
.bnav-link span { display: block; line-height: 1; }
.bnav-link.is-active { color: var(--primary); }
.bnav-link:not(.is-active):hover { color: var(--text-2); }
.mobile-drawer {
  position: fixed; top: 0; right: -280px; bottom: 0; width: 280px;
  background: var(--surface-1); border-left: 1px solid var(--border);
  z-index: 300; transition: right 250ms ease; overflow-y: auto; padding: var(--sp-6);
}
.mobile-drawer.open { right: 0; }
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 290; display: none;
}
.drawer-overlay.open { display: block; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); }
.drawer-user { display: flex; align-items: center; gap: var(--sp-3); }
.drawer-close { background: none; border: none; color: var(--text-2); font-size: 20px; cursor: pointer; }

@media (max-width: 1024px) {
  .filter-sidebar { width: 180px; }
  .admin-sidebar { width: 200px; }
  .admin-content { padding: var(--sp-5); }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  /* ── Header ── */
  .app-header { justify-content: space-between; padding: 0 var(--sp-4); }
  .header-nav { display: none; }
  .header-search { display: none; }           /* search moves to mobile drawer */
  .header-logo { flex-shrink: 0; }
  .header-right { flex-shrink: 0; gap: var(--sp-2); margin-left: 0; }
  .hamburger-btn { display: flex; }
  .avatar-name { display: none; }
  .avatar-btn { padding: 5px; border-radius: 50%; gap: 0; }
  .avatar-btn .chevron { display: none; }
  .avatar-circle { width: 32px; height: 32px; font-size: 12px; }

  /* ── Performance: remove expensive blur on mobile (saves 40-60ms/frame) ── */
  .app-header { background: rgba(10,10,15,.98); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mobile-drawer { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .card-glass  { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-2); }

  /* ── Layout ── */
  .product-layout { grid-template-columns: 1fr; }
  .product-panel { position: static; }
  .browse-layout { flex-direction: column; }
  .filter-sidebar { width: 100%; position: static; }
  .account-layout { grid-template-columns: 1fr; }
  .account-nav { position: static; }
  .form-row { grid-template-columns: 1fr; }

  /* ── Home ── */
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
  .hero { padding: var(--sp-10) var(--sp-4) var(--sp-8); }
  .hero-stats { gap: var(--sp-5); }
  .page-container { padding: var(--sp-5) var(--sp-4); }

  /* ── Product grid ── */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }

  /* ── Mobile bottom nav ── */
  .bottom-nav { display: flex; }
  body { padding-bottom: 70px; }
  .site-footer { margin-bottom: 70px; }

  /* ── Toast ── */
  .toast-container { bottom: 84px; right: var(--sp-4); left: var(--sp-4); }
  .toast { min-width: unset; max-width: 100%; }

  /* ── Unified panel sidebar (horizontal scroll) ── */
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%; height: auto;
    position: sticky; top: var(--header-h); z-index: 80;
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: var(--sp-2) var(--sp-3); display: flex; gap: var(--sp-1);
    border-right: none; border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }
  .admin-nav-group { margin-bottom: 0; display: contents; }
  .admin-nav-label { display: none; }
  .admin-nav-link { white-space: nowrap; font-size: 0.8125rem; padding: 6px 10px; border-radius: var(--r-md); }
  .panel-back-link { display: contents; }
  .admin-content { padding: var(--sp-4); max-width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  /* ── Very small phones (≤480px) ── */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .hero-stats { flex-wrap: wrap; gap: var(--sp-4); }
  .hero-title { font-size: 1.75rem; }
  .hero-sub { font-size: 0.875rem; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .product-card .card-info { padding: var(--sp-3); }
  .product-card .card-title { font-size: 0.875rem; }
  .product-card .card-author { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .page-header .btn { align-self: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .board-item { flex-direction: column; }
  .vote-box { flex-direction: row; gap: var(--sp-2); }
  .logo-img { width: 24px; height: 24px; }
}

@media (max-width: 360px) {
  /* ── Tiny phones (≤360px) ── */
  .product-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.5rem; }
}
