/* ============================================================
   What Should I Buy? — Design system
   Premium, minimal, trustworthy. Mobile-first. Light/dark.
   ============================================================ */
:root {
  --bg: #fafafa; --surface: #ffffff; --surface-2: #f4f4f5; --surface-3: #ececf0;
  --text: #111113; --text-2: #52525b; --text-3: #8b8b93;
  --border: #e6e6ea; --border-2: #d6d6dc;
  --accent: #4f46e5; --accent-2: #6366f1; --accent-soft: #eef2ff; --on-accent: #ffffff;
  --ok: #16a34a; --ok-soft: #f0fdf4; --warn: #d97706; --warn-soft: #fffbeb;
  --bad: #dc2626; --bad-soft: #fef2f2; --sponsored: #7c3aed; --sponsored-soft: #f5f3ff;
  --demo: #64748b; --demo-soft: #f1f5f9;
  --shadow: 0 1px 2px rgba(16,16,20,.05), 0 4px 16px rgba(16,16,20,.06);
  --shadow-lg: 0 4px 12px rgba(16,16,20,.08), 0 16px 40px rgba(16,16,20,.12);
  --radius: 14px; --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
}
[data-theme="dark"] {
  --bg: #0e0e11; --surface: #17171c; --surface-2: #1f1f26; --surface-3: #2a2a33;
  --text: #f2f2f4; --text-2: #a9a9b4; --text-3: #71717e;
  --border: #2a2a33; --border-2: #3a3a46;
  --accent: #818cf8; --accent-2: #a5b4fc; --accent-soft: #1e1b4b; --on-accent: #0e0e11;
  --ok: #4ade80; --ok-soft: #052e16; --warn: #fbbf24; --warn-soft: #451a03;
  --bad: #f87171; --bad-soft: #450a0a; --sponsored: #c4b5fd; --sponsored-soft: #2e1065;
  --demo: #94a3b8; --demo-soft: #1e293b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.5), 0 16px 40px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.55; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; color: var(--text-2); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 200; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { font-weight: 800; font-size: 1.06rem; color: var(--text); display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #a855f7); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 800; flex: none; }
.main-nav { display: none; gap: 2px; }
.main-nav a { color: var(--text-2); font-weight: 550; padding: 8px 11px; border-radius: 8px; font-size: .92rem; }
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: none; border: 1px solid transparent; color: var(--text-2); width: 40px; height: 40px;
  border-radius: 10px; display: grid; place-items: center; cursor: pointer; position: relative; font-size: 1.05rem;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .bubble {
  position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: var(--on-accent); font-size: .64rem; font-weight: 700; display: grid; place-items: center;
}
.header-search { display: none; position: relative; }
.header-search input { width: 230px; padding: 9px 14px 9px 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .9rem; }
.header-search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 1.05rem; }
.suggest-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 150; display: none; max-height: 70vh; overflow: auto;
}
.suggest-panel.open { display: block; }
.suggest-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.suggest-item:hover { background: var(--surface-2); text-decoration: none; }
.suggest-item small { color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: .95rem;
  padding: 11px 20px; border-radius: 11px; cursor: pointer; transition: transform .06s ease, box-shadow .15s ease, background .15s;
  text-decoration: none !important; min-height: 44px; font-family: inherit;
}
.btn:hover { background: var(--accent-2); box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn-lg { padding: 14px 26px; font-size: 1.03rem; border-radius: 13px; }
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: .86rem; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger { background: var(--bad); color: #fff; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.buy-btn { background: var(--ok); color: #fff; }
.buy-btn:hover { background: #15803d; color: #fff; }

/* ---------- Badges / ratings / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .02em; text-transform: uppercase; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-sponsored { background: var(--sponsored-soft); color: var(--sponsored); }
.badge-demo { background: var(--demo-soft); color: var(--demo); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: .88rem; }
.rating .star { color: var(--border-2); }
.rating .star.full, .rating .star.half { color: #f59e0b; }
.rating-num { font-weight: 700; color: var(--text); }
.rating-count { color: var(--text-3); font-size: .8rem; }
.mini-score { font-size: .78rem; color: var(--text-2); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
  padding: 7px 14px; border-radius: 99px; font-size: .86rem; font-weight: 550; cursor: pointer; text-decoration: none !important;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trend { font-size: .74rem; font-weight: 650; padding: 2px 7px; border-radius: 6px; }
.trend.down { color: var(--ok); background: var(--ok-soft); }
.trend.up { color: var(--bad); background: var(--bad-soft); }
.trend.flat { color: var(--text-3); background: var(--surface-2); }
.freshness { font-size: .74rem; color: var(--text-3); }
.discount-badge { background: var(--ok); color: #fff; font-size: .72rem; font-weight: 750; padding: 2px 7px; border-radius: 6px; }
.price-prev { color: var(--text-3); text-decoration: line-through; font-size: .82rem; }

/* ---------- Hero + search ---------- */
.hero { padding: clamp(36px, 7vw, 76px) 0 clamp(26px, 4vw, 44px); text-align: center; }
.hero h1 { max-width: 720px; margin: 0 auto 14px; }
.hero .sub { max-width: 600px; margin: 0 auto 28px; font-size: clamp(1rem, 2.2vw, 1.16rem); color: var(--text-2); }
.big-search { position: relative; max-width: 700px; margin: 0 auto; }
.big-search form { display: flex; gap: 10px; }
.big-search input[type="text"] {
  flex: 1; min-width: 0; font-size: 1.02rem; padding: 15px 18px; border-radius: 14px;
  border: 1.5px solid var(--border-2); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.big-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.hero-examples { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 20px; }
.hero-examples .chip { font-size: .82rem; background: var(--surface); }
.trust-line { margin-top: 26px; font-size: .84rem; color: var(--text-3); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections / cards ---------- */
.section { padding: clamp(26px, 4.5vw, 46px) 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .12s, border-color .18s;
}
.product-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.card-media { display: block; background: var(--surface-2); aspect-ratio: 4/3; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card-title { font-size: 1rem; margin: 0; font-weight: 650; }
.card-title a { color: var(--text); }
.card-meta { font-size: .82rem; color: var(--text-3); margin: 0; }
.card-price { font-size: 1.12rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-scores { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.card-reason { font-size: .86rem; color: var(--text-2); background: var(--surface-2); border-radius: 9px; padding: 9px 11px; margin: 0; }
.why-tag { font-weight: 750; color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }

/* ---------- Rank badge & score ring ---------- */
.rank-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rank-num { background: var(--text); color: var(--bg); font-weight: 800; border-radius: 8px; padding: 3px 9px; font-size: .85rem; }
.rank-label { font-weight: 750; color: var(--accent); font-size: .92rem; }
.score-ring {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
  background: conic-gradient(var(--ring) var(--deg), var(--surface-3) 0); position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.score-ring span { position: relative; }
.score-ring-label { font-size: .72rem; color: var(--text-3); display: block; text-align: center; margin-top: 3px; }
.scores-row { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Recommendation result cards ---------- */
.rec-card { padding: 4px 0 14px; border-bottom: 1px solid var(--border); }
.rec-card:last-child { border-bottom: none; }
.rec-grid { display: grid; grid-template-columns: 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.rec-left { display: flex; flex-direction: column; gap: 12px; }
.rec-media { border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4/3; max-width: 300px; }
.spec-inline { font-size: .82rem; color: var(--text-2); }
.pros-cons { display: grid; gap: 10px; }
.pros-cons ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.pros-cons li { margin-bottom: 3px; }
.pros h4 { color: var(--ok); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.cons h4 { color: var(--bad); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.score-bars { display: grid; gap: 7px; font-size: .8rem; }
.score-bar-row { display: grid; grid-template-columns: 105px 1fr 34px; align-items: center; gap: 9px; color: var(--text-2); }
.score-bar { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.parsed-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 11px; padding: 10px 14px; font-size: .84rem; color: var(--text-2); margin: 14px 0; }
.parsed-box b { color: var(--text); }

/* ---------- AI box ---------- */
.ai-box { position: relative; background: linear-gradient(180deg, var(--accent-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 12px; padding: 14px 16px 12px; }
.ai-box-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); display: block; margin-bottom: 6px; }
.ai-box-body { font-size: .92rem; color: var(--text); }
.ai-box-note { display: block; font-size: .72rem; color: var(--text-3); margin-top: 8px; }

/* ---------- Vote / poll ---------- */
.vote-group { display: inline-flex; gap: 6px; }
.vote-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  padding: 6px 12px; border-radius: 9px; cursor: pointer; font-size: .84rem; font-weight: 600; min-height: 36px;
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-group[data-voted="up"] .vote-up { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.vote-group[data-voted="down"] .vote-down { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.poll-bars { display: grid; gap: 12px; margin: 12px 0; }
.poll-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: .9rem; }
.poll-track { height: 12px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.poll-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .5s ease; }
.poll-pct { font-weight: 800; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 15px; }
.field label { font-size: .88rem; font-weight: 650; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"],
.field input[type="date"], .field input[type="url"], .field select, .field textarea, .input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-size: .95rem; font-family: inherit; min-height: 44px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: .78rem; color: var(--text-3); }
.field .err { font-size: .8rem; color: var(--bad); font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-2); margin-bottom: 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-card { max-width: 440px; margin: 30px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.form-card.wide { max-width: 720px; }

/* ---------- Toast / modal ---------- */
#toast-root { position: fixed; bottom: calc(74px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; width: min(94vw, 420px); }
.toast { background: var(--text); color: var(--bg); border-radius: 12px; padding: 12px 16px; font-size: .9rem; font-weight: 550; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; display: flex; gap: 9px; align-items: flex-start; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,14,.55); z-index: 300; display: none; align-items: flex-end; justify-content: center; padding: 0; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); animation: modalIn .22s ease; }
@keyframes modalIn { from { transform: translateY(30px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; }

/* ---------- Skeletons / empty ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 45%, var(--surface-2) 65%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 290px; border-radius: var(--radius); }
.sk-line { height: 14px; margin-bottom: 9px; }
.empty-state { text-align: center; padding: 46px 20px; background: var(--surface); border: 1.5px dashed var(--border-2); border-radius: var(--radius); }
.empty-icon { font-size: 2.1rem; margin-bottom: 8px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 440px; margin: 0 auto 14px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tables (specs, compare, admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 700; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.win { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.compare-col-head { min-width: 150px; }

/* ---------- Price chart / history ---------- */
.price-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.stat-tile { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat-tile b { display: block; font-size: 1.02rem; }
.stat-tile span { font-size: .74rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.chart-svg { width: 100%; height: auto; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: none; padding: 10px 15px; font-size: .92rem; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Notifications panel ---------- */
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: min(92vw, 360px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 200; display: none; }
.notif-panel.open { display: block; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-list { max-height: 380px; overflow: auto; }
.notif-item { display: block; padding: 12px 15px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: var(--accent-soft); }
.notif-item small { color: var(--text-3); }
.notif-item p { margin: 2px 0 0; font-size: .84rem; color: var(--text-2); }

/* ---------- User menu (profile dropdown) ---------- */
.user-menu { position: relative; }
.user-menu .caret { font-size: .6rem; margin-left: 2px; color: var(--text-3); }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: min(92vw, 250px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 210; display: none; overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dd-head { padding: 13px 15px; border-bottom: 1px solid var(--border); display: grid; gap: 2px; background: var(--surface-2); }
.user-dd-head b { font-size: .92rem; }
.user-dd-head small { color: var(--text-3); font-size: .76rem; word-break: break-all; }
.user-dropdown a, .user-dropdown .dd-logout {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 15px;
  color: var(--text); font-size: .9rem; font-weight: 550; text-decoration: none;
  background: none; border: none; cursor: pointer; font-family: inherit; text-align: left;
}
.user-dropdown a:hover, .user-dropdown .dd-logout:hover { background: var(--surface-2); text-decoration: none; }
.user-dropdown form { margin: 0; }
.user-dropdown .dd-logout { color: var(--bad); border-top: 1px solid var(--border); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 110; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: grid; place-items: center; gap: 2px; font-size: .66rem; color: var(--text-3); padding: 4px 12px; border-radius: 10px; font-weight: 600; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav .bn-icon { font-size: 1.15rem; }
body { padding-bottom: 66px; } /* bottom-nav space */

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 34px 0 90px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 10px; }
.footer-col a { display: block; color: var(--text-2); font-size: .88rem; padding: 3px 0; }
.footer-note { margin-top: 26px; font-size: .78rem; color: var(--text-3); }

/* ---------- Ads ---------- */
.ad-slot { border: 1px dashed color-mix(in srgb, var(--sponsored) 45%, var(--border)); border-radius: var(--radius); padding: 13px 15px; background: var(--sponsored-soft); margin: 20px 0; }
.ad-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sponsored); display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ad-body { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; }
.ad-body img { border-radius: 9px; max-width: 130px; }

/* ---------- Assistant chat ---------- */
.chat-wrap { max-width: 760px; margin: 0 auto; }
.chat-log { display: grid; gap: 12px; margin: 18px 0; }
.chat-msg { max-width: 86%; padding: 12px 15px; border-radius: 16px; font-size: .95rem; }
.chat-msg.ai { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; justify-self: start; }
.chat-msg.user { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; justify-self: end; }
.chat-form { display: flex; gap: 9px; position: sticky; bottom: 76px; background: var(--bg); padding: 10px 0; }
.chat-form input { flex: 1; min-width: 0; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }

/* ---------- Misc ---------- */
.breadcrumb { font-size: .8rem; color: var(--text-3); padding: 14px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 26px 0; }
.page-link { padding: 8px 13px; border: 1px solid var(--border-2); border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: .88rem; }
.page-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-link.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.page-link.disabled { opacity: .4; pointer-events: none; }
.avatar { display: inline-flex; }
.avatar-img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-txt { width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--accent); display: grid; place-items: center; font-weight: 750; font-size: .8rem; }
.contrib-card { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contrib-card:last-child { border-bottom: none; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; color: #fff; }
.meta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--text-3); }
.helpful-note { font-size: .78rem; color: var(--text-3); }
.alert-banner { padding: 12px 16px; border-radius: 11px; margin: 12px 0; font-size: .92rem; font-weight: 550; }
.alert-banner.success { background: var(--ok-soft); color: var(--ok); }
.alert-banner.error { background: var(--bad-soft); color: var(--bad); }
.alert-banner.info { background: var(--accent-soft); color: var(--accent); }
.legal-body { max-width: 740px; margin: 0 auto; font-size: .95rem; }
.legal-body h2 { margin-top: 30px; font-size: 1.2rem; }
.filters-bar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters-bar select { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: .88rem; min-height: 42px; }
.aff-disclosure { font-size: .76rem; color: var(--text-3); background: var(--surface-2); border-radius: 9px; padding: 8px 12px; margin: 10px 0; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; }
.admin-side .logo { padding: 4px 8px 16px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { color: var(--text-2); padding: 9px 12px; border-radius: 9px; font-size: .9rem; font-weight: 550; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.admin-nav .sep { margin-top: 10px; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 8px 12px 2px; font-weight: 800; }
.admin-nav form { margin: 0; }
.admin-nav-logout {
  width: calc(100% - 24px); margin: 4px 12px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border-2);
  background: none; color: var(--bad); font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; text-align: left;
}
.admin-nav-logout:hover { background: var(--bad-soft); border-color: var(--bad); }
.admin-main { padding: 20px 18px 90px; }
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; }
.stat-card b { font-size: 1.5rem; display: block; letter-spacing: -.02em; }
.stat-card span { font-size: .76rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat-card .delta { font-size: .78rem; font-weight: 650; color: var(--ok); }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { font-size: 1.4rem; margin: 0; }
.bar-chart { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 58px; gap: 9px; align-items: center; font-size: .82rem; }

/* ---------- Responsive ---------- */
/* Base .grid: 1 → 2 → 3 → 4 columns as viewport grows.
   .grid-3 / .grid-4 pin the DESKTOP column count (they always win over .grid). */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-cards { grid-template-columns: repeat(4, 1fr); }
  .pros-cons { grid-template-columns: 1fr 1fr; }
  .price-stats-grid { grid-template-columns: repeat(5, 1fr); }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; padding: 24px; }
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .header-search { display: block; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-top: 64px; }
  .rec-grid { grid-template-columns: 300px 1fr; }
  .admin-shell { grid-template-columns: 236px 1fr; }
  .chat-form { bottom: 14px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .stat-cards { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .bottom-nav, .site-footer, .ad-slot { display: none !important; }
}
