/* ═══════════════════════════════════════════════════════════════════════
   Droidify — style.css
   Modern CSS 2025: custom properties, scroll animations, CSS hamburger,
   micro-interactions, prefers-reduced-motion, no JavaScript required
   for any layout or animation.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0b0f14;
  --surface:     #111820;
  --card:        #141c26;
  --card2:       #1a2535;
  --border:      #1e2d42;
  --text:        #e8eef5;
  --muted:       #4a6080;
  --accent:      #3dd68c;
  --accent-dim:  rgba(61,214,140,.12);
  --accent-glow: rgba(61,214,140,.25);
  --info:        #60a5fa;
  --warn:        #fbbf24;
  --danger:      #f87171;
  --radius:      12px;
  --spring:      cubic-bezier(.22,1,.36,1);
  --ease-out:    cubic-bezier(0,.55,.45,1);
  --mono:        'SF Mono','Fira Code','Cascadia Code',monospace;
  --nav-h:       54px;

  /* Bulma custom property overrides */
  --bulma-body-background-color: var(--bg);
  --bulma-body-color:            var(--text);
  --bulma-link-color:            var(--accent);
  --bulma-primary:               var(--accent);
  --bulma-primary-h:             152deg;
  --bulma-primary-s:             66%;
  --bulma-primary-l:             54%;
}

/* Light theme override */
[data-theme="light"],
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg:         #f4f6f9;
  --surface:    #ffffff;
  --card:       #ffffff;
  --card2:      #f0f2f5;
  --border:     #dce3ed;
  --text:       #0f1923;
  --muted:      #5a6e85;
  --accent-dim: rgba(61,214,140,.1);
  --accent-glow:rgba(61,214,140,.2);
}}

[data-theme="light"] {
  --bg:         #f4f6f9;
  --surface:    #ffffff;
  --card:       #ffffff;
  --card2:      #f0f2f5;
  --border:     #dce3ed;
  --text:       #0f1923;
  --muted:      #5a6e85;
  --accent-dim: rgba(61,214,140,.1);
  --accent-glow:rgba(61,214,140,.2);
}

/* Navbar adapts to theme */
[data-theme="light"] .navbar,
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .navbar {
    background: rgba(255,255,255,.92) !important;
    border-bottom-color: var(--border);
  }
}
[data-theme="light"] .navbar { background: rgba(255,255,255,.92) !important; }

/* Table rows in light */
[data-theme="light"] .table tbody tr:hover td { background: rgba(240,242,245,.8) !important; }

/* Cards in light */
[data-theme="light"] .card { box-shadow: 0 1px 4px rgba(0,0,0,.06) !important; }

/* Mobile nav background in light */
[data-theme="light"] .nav-links { background: var(--surface); }

/* Compat banners readable in light */
[data-theme="light"] .compat-managed { background: #e8edf5; border-color: #c0ccd8; color: #3a4a5c; }

/* ── Global reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* Native scroll-driven animation support for progress bar */
  scroll-timeline: --page-scroll block;
}
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  /* Smooth page-load fade */
  animation: pageFadeIn 300ms ease both;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; transition: color 150ms ease; }
img { max-width: 100%; display: block; }
.container { max-width: 1100px !important; }

/* ── Scroll progress bar (top of page) ─────────────────────────────────── */
@supports (animation-timeline: scroll()) {
  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--info));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    animation: scrollProgress linear both;
    animation-timeline: scroll();
  }
}
@keyframes scrollProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
#nav-toggle-cb { display: none; }

.navbar {
  background: rgba(17,24,32,.85) !important;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  transition: background 200ms ease, border-color 200ms ease;
}
.navbar > .container {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  gap: .25rem;
}

/* Logo */
.droidify-logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.04em;
  white-space: nowrap;
  color: var(--text);
  padding: 0 .75rem 0 0;
  flex-shrink: 0;
  transition: opacity 150ms ease;
}
.droidify-logo:hover { opacity: .8; }
.accent-text { color: var(--accent); }

/* Nav links row */
.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0;
}
.navbar-item {
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .5rem;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
  position: relative;
}
.navbar-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.navbar-item.is-active { color: var(--accent); }
.navbar-item.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 20%; width: 60%; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Nav end (auth, theme, github) */
.nav-end {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Hamburger button — hidden on desktop */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 2rem;
  height: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  padding: .1rem;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--spring), opacity .2s ease, background .15s ease;
}
.nav-burger:hover span { background: var(--accent); }

/* ── Mobile nav ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar { height: var(--nav-h); }
  .navbar > .container { flex-wrap: wrap; align-content: flex-start; height: auto; padding: 0 1rem; }

  /* Brand row */
  .navbar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--nav-h);
  }

  .nav-burger { display: flex; }

  /* Collapsed nav links */
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s var(--ease-out), padding .35s ease;
    background: var(--surface);
    border-top: 0 solid var(--border);
  }
  .nav-links .navbar-item {
    width: 100%;
    padding: .65rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
  }
  .nav-end {
    flex-wrap: wrap;
    width: 100%;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
  }

  /* Checkbox open state */
  #nav-toggle-cb:checked ~ nav .nav-links {
    max-height: 600px;
    border-top-width: 1px;
  }

  /* Burger → X animation */
  #nav-toggle-cb:checked ~ nav .nav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  #nav-toggle-cb:checked ~ nav .nav-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  #nav-toggle-cb:checked ~ nav .nav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (min-width: 901px) {
  .navbar-brand-row { display: contents; }
  .nav-burger { display: none !important; }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.button {
  border-radius: 9px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: transform 150ms var(--spring), box-shadow 150ms ease, border-color 150ms ease, color 150ms ease;
  cursor: pointer;
}
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.button:active { transform: translateY(0) scale(.97); }
.button.is-primary {
  background: var(--accent) !important;
  color: #0b0f14 !important;
  border-color: transparent !important;
  font-weight: 700;
}
.button.is-primary:hover {
  color: #0b0f14 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.button.is-ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.button.is-ghost:hover { border-color: var(--accent); color: var(--accent); }
.button.is-small { font-size: .78rem; padding: .3rem .65rem; }

#pwa-install-wrap .button {
  background: var(--accent);
  color: #0b0f14;
  border: none;
  font-weight: 700;
  font-size: .8rem;
  padding: .4rem .9rem;
}
#pwa-install-wrap .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px var(--accent-glow);
  color: #0b0f14;
}

/* ── Forms ─────────────────────────────────────────────────────────────── */
.input, .select select, .textarea {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 9px !important;
  transition: border-color 180ms ease, box-shadow 180ms ease !important;
}
.input:focus, .select select:focus, .textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-dim) !important;
  outline: none;
}
.input::placeholder { color: var(--muted); }
.select::after { border-color: var(--muted) !important; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none !important;
  transition: border-color 200ms ease, transform 200ms var(--spring), box-shadow 200ms ease;
  will-change: transform;
}
.card:hover {
  border-color: rgba(61,214,140,.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.card-content { padding: 1rem 1.1rem; }
.card .title { color: var(--text) !important; }
.card-mfr {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8ba3be;
  margin-bottom: .2rem;
}
.card-codename {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
  margin-bottom: .4rem;
}
.card-sub { font-size: .82rem; color: #8ba3be; line-height: 1.5; }
.card-link { font-size: .78rem; color: var(--accent); font-weight: 600; }
.card-link:hover { text-decoration: underline; }

/* ── Tags ──────────────────────────────────────────────────────────────── */
.tag { border-radius: 5px !important; font-weight: 600 !important; font-size: .65rem !important; }
.tag.is-success { background: rgba(61,214,140,.15)  !important; color: var(--accent)  !important; }
.tag.is-info    { background: rgba(96,165,250,.15)  !important; color: var(--info)    !important; }
.tag.is-warning { background: rgba(251,191,36,.15)  !important; color: var(--warn)    !important; }
.tag.is-dark    { background: var(--card2)           !important; color: var(--muted)   !important; }
.tag.is-danger  { background: rgba(248,113,113,.15) !important; color: var(--danger)  !important; }
.tag.is-light   { background: var(--card2) !important; color: var(--text) !important; }
.tag.is-primary { background: var(--accent-dim) !important; color: var(--accent) !important; }

/* ── Page header ───────────────────────────────────────────────────────── */
.page-header { padding: 2.5rem 0 1.5rem; }
.page-header .title { color: var(--text) !important; letter-spacing: -.04em; }
.page-header .subtitle { color: var(--muted) !important; }

/* ── Section headers ───────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header .title { font-size: 1rem !important; font-weight: 700 !important; margin-bottom: 0 !important; }
.section-header .title::after { content: ''; }
.section-link { font-size: .8rem; color: var(--accent); }
.section-link:hover { text-decoration: underline; }

/* ── Results meta ──────────────────────────────────────────────────────── */
.results-meta {
  font-size: .82rem; color: var(--muted);
  margin-bottom: 1rem; padding: .35rem .7rem;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px; display: inline-block; font-weight: 500;
}

/* ── Stats grid ────────────────────────────────────────────────────────── */
.stats-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.stat-item {
  padding: 1.4rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 200ms ease;
}
.stat-item:hover { background: var(--card2); }
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.04em;
  line-height: 1;
  display: block;
  margin-bottom: .25rem;
}
.stat-value.popped { animation: statPop 400ms var(--spring); }
.stat-label { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero-section {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
  max-width: 660px;
  margin: 0 auto;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: 1.05;
  margin-bottom: .75rem;
  color: var(--text);
  animation: heroFadeUp 600ms var(--spring) both;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto .75rem;
  animation: heroFadeUp 600ms var(--spring) 80ms both;
}
.hero-search {
  display: flex;
  gap: .6rem;
  max-width: 500px;
  margin: 0 auto;
  animation: heroFadeUp 600ms var(--spring) 160ms both;
}

/* ── Source badges ─────────────────────────────────────────────────────── */
.sources-banner { padding: .75rem 0 0; text-align: center; }
.sources-note { font-size: .72rem; color: var(--muted); margin-top: .4rem; }
.tag.is-light.source-badge {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  border-radius: 20px !important;
  font-size: .72rem !important;
  transition: border-color 150ms ease, color 150ms ease;
}
.tag.is-light.source-badge:hover { border-color: var(--accent) !important; color: var(--accent) !important; }

/* ── Android pills ─────────────────────────────────────────────────────── */
.android-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .85rem;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms var(--spring);
}
.android-pill:hover { border-color: var(--accent); transform: translateY(-2px); }
.android-pill .v-num { font-size: .75rem; font-weight: 700; color: var(--text); }
.android-pill .v-name { font-size: .65rem; color: var(--muted); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table { background: transparent !important; color: var(--text) !important; width: 100%; }
.table th {
  color: var(--muted) !important;
  border-color: var(--border) !important;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: transparent !important;
}
.table td { border-color: rgba(30,45,66,.5) !important; color: var(--text) !important; background: transparent !important; }
.table tbody tr { transition: background 150ms ease; }
.table tbody tr:hover td { background: rgba(20,28,38,.6) !important; }

/* ── Pagination ────────────────────────────────────────────────────────── */
.pagination-link, .pagination-previous, .pagination-next {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.pagination-link:hover, .pagination-previous:hover, .pagination-next:hover {
  border-color: var(--accent) !important;
  color: var(--text) !important;
  transform: translateY(-1px);
}
.pagination-link.is-current {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  font-weight: 700;
}

/* ── Skeleton shimmer ──────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius);
}

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  margin: 0 auto 1rem;
}

/* ── States ────────────────────────────────────────────────────────────── */
.empty-state, .error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Alert badge on Watchlist nav ──────────────────────────────────────── */
.alert-badge {
  background: var(--accent);
  color: #0b0f14;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  padding: .1rem .38rem;
  margin-left: .3rem;
  vertical-align: middle;
  display: none;
  animation: badgePop 300ms var(--spring) both;
}

/* ── Offline / Connection overlays ─────────────────────────────────────── */
#offline-banner {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  z-index: 200;
  background: #1a1000;
  border-bottom: 2px solid var(--warn);
  color: var(--warn);
  text-align: center;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-weight: 500;
}
#offline-banner.show { display: block; animation: slideDown 300ms var(--spring); }

#connection-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
#connection-overlay.show { display: flex; animation: fadeIn 300ms ease; }
#connection-overlay .conn-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
#connection-overlay p { color: var(--muted); font-size: .9rem; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface) !important;
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
  margin-top: 3rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; transition: color 150ms ease; }
.site-footer a:hover { color: var(--accent); }

/* ── Theme switcher ────────────────────────────────────────────────────── */
.theme-switcher { display: flex; align-items: center; gap: .2rem; }
.theme-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  padding: .25rem .35rem;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  line-height: 1;
}
.theme-btn:hover { background: var(--card); border-color: var(--border); color: var(--text); }
.theme-btn.active { background: var(--card); border-color: var(--accent); color: var(--accent); }

/* ── Auth navbar ───────────────────────────────────────────────────────── */
#auth-wrap { display: flex; align-items: center; }
.auth-signin {
  display: flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 600; color: var(--text);
  text-decoration: none;
  transition: color 150ms ease;
}
.auth-signin:hover { color: var(--accent); }
.auth-signin img { border-radius: 50%; width: 1.6rem; height: 1.6rem; }

/* ── Guide styles ──────────────────────────────────────────────────────── */
.guide-steps summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .85rem; }
.guide-ol { padding-left: 1.25rem; margin-top: .5rem; }
.guide-ol li { margin-bottom: .4rem; font-size: .85rem; color: var(--muted); line-height: 1.55; }
.guide-notes { font-size: .78rem; color: var(--muted); margin-top: .4rem; font-style: italic; }
.guide-steps[open] summary { margin-bottom: .4rem; }

/* ── Perk / Prose card styles ──────────────────────────────────────────── */
.perk-row {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .65rem 0; border-bottom: 1px solid var(--border);
  font-size: .88rem; line-height: 1.4;
}
.perk-row:last-child { border-bottom: none; }
.perk-row > .pi { font-size: 1.1rem; flex-shrink: 0; width: 1.5rem; text-align: center; margin-top: .05rem; }
.perk-row small { display: block; color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.perk-no { opacity: .4; }

.honest-box {
  margin: 2rem 0; padding: 1.25rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .85rem; color: var(--muted);
  display: flex; flex-direction: column; gap: .4rem;
}
.honest-box strong { color: var(--text); }

.page-prose { display: flex; flex-direction: column; gap: 1rem; }
.prose-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.prose-card .pc-title { font-weight: 700; font-size: .9rem; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.prose-card p, .prose-card li { font-size: .88rem; color: var(--muted); line-height: 1.55; }
.prose-card ul { padding-left: 1.1rem; margin-top: .35rem; }
.prose-card li { margin-bottom: .25rem; }
.warn-card { border-left: 3px solid var(--danger); }
.accent-card { border: 1px solid var(--accent); }

.section-slug { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .6rem 0 .2rem; }

.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; cursor: pointer; transition: border-color 150ms ease; }
.faq-item:hover { border-color: rgba(61,214,140,.3); }
.faq-item summary { font-weight: 600; font-size: .9rem; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '\25BC'; font-size: .6rem; color: var(--muted); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { font-size: .87rem; color: var(--muted); margin-top: .6rem; line-height: 1.55; }
.faq-item a { color: var(--accent); }

/* ── Watchlist ─────────────────────────────────────────────────────────── */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.watchlist-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; padding: .25rem;
  border-radius: 4px; transition: color 150ms ease, background 150ms ease;
  line-height: 1;
}
.watchlist-remove:hover { color: var(--danger); background: rgba(248,113,113,.1); }

/* ── Scroll-driven reveal (native CSS, fallback to AOS) ─────────────────── */
@supports (animation-timeline: view()) {
  .card {
    animation: cardReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 20%;
  }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* AOS overrides */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: auto; }

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes statPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { letter-spacing: -.04em; }
  .hero-search { flex-direction: column; }
  .stats-box { grid-template-columns: repeat(3, 1fr); }
  .page-header { padding: 1.75rem 0 1rem; }
  .device-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-box { grid-template-columns: repeat(2, 1fr); }
}

/* ── prefers-reduced-motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-aos] { opacity: 1 !important; transform: none !important; }
  body::before { display: none; }
}

/* ── Terms progress bar ─────────────────────────────────────────────────── */
#terms-progress-bar { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 9999; background: var(--border); pointer-events: none; }
#terms-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .1s linear; }

/* ── Install Banner ─────────────────────────────────────────────────────────── */
#install-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9998;
  width: min(520px, calc(100vw - 2rem));
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s ease;
  opacity: 0;
}
#install-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.install-banner-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  position: relative;
}
.install-banner-close {
  position: absolute;
  top: .65rem; right: .75rem;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.15rem; line-height: 1;
  padding: .2rem .4rem; border-radius: 6px;
  transition: color .15s, background .15s;
}
.install-banner-close:hover { color: var(--text); background: var(--card2); }
.install-banner-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem;
}
.install-banner-body {
  display: flex; gap: .75rem;
}
/* Tabs — left column */
.install-tabs {
  display: flex; flex-direction: column; gap: .25rem;
  min-width: 110px; flex-shrink: 0;
}
.install-tab {
  background: none; border: none; cursor: pointer;
  text-align: left; padding: .5rem .65rem;
  border-radius: 8px; font-size: .8rem; font-weight: 600;
  color: var(--muted); transition: background .15s, color .15s;
  white-space: nowrap;
}
.install-tab:hover { background: var(--card2); color: var(--text); }
.install-tab.active { background: var(--card2); color: var(--text); }
/* Panels — right column */
.install-panels { flex: 1; min-width: 0; }
.install-panel { display: none; }
.install-panel.active { display: block; }
.install-panel-title {
  font-size: .9rem; font-weight: 700; color: var(--text);
  margin: 0 0 .3rem;
}
.install-panel-sub {
  font-size: .78rem; color: var(--muted); line-height: 1.5;
  margin: 0 0 .75rem;
}
.install-panel-note {
  font-size: .72rem; color: var(--muted); margin: .5rem 0 0;
}
.install-btn {
  display: inline-block; border: none; border-radius: 8px;
  font-weight: 700; font-size: .8rem; padding: .45rem 1rem;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.install-btn:hover { transform: translateY(-1px); }
.install-btn-primary { background: var(--accent); color: #0b0f14; }
.install-btn-primary:hover { box-shadow: 0 4px 14px var(--accent-glow); }
.install-btn-ghost {
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border);
}
.install-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 480px) {
  .install-banner-body { flex-direction: column; }
  .install-tabs { flex-direction: row; min-width: unset; }
  .install-tab { flex: 1; text-align: center; font-size: .72rem; padding: .4rem .3rem; }
  #install-banner { bottom: .75rem; }
}

/* ── Browser compatibility banners ─────────────────────────────────────────── */
.compat-banner {
  position: relative;
  z-index: 99999;
  font-size: .82rem;
  padding: .6rem 3rem .6rem 1rem;
  display: flex;
  align-items: center;
  line-height: 1.5;
}
.compat-banner strong { color: #fff; }
.compat-banner button {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  opacity: .8;
}
.compat-banner button:hover { opacity: 1; background: rgba(255,255,255,.15); }
/* Hard error — orange */
.compat-error {
  background: #7c3a00;
  border-bottom: 1px solid #c45a00;
  color: #ffe8cc;
}
.compat-error button { color: #ffe8cc; }
/* Soft warning — yellow */
.compat-warn {
  background: #4a3d00;
  border-bottom: 1px solid #7a6500;
  color: #fff3c0;
}
.compat-warn button { color: #fff3c0; }
/* Info — subtle */
.compat-info {
  background: #0d2a3a;
  border-bottom: 1px solid #1e4a66;
  color: #b8d8ee;
}
.compat-info button { color: #b8d8ee; }

/* In-app browser — red, non-dismissible */
.compat-inapp {
  background: #5c0a0a;
  border-bottom: 2px solid #a01010;
  color: #ffd0d0;
  font-weight: 500;
}
.compat-inapp strong { color: #fff; }
.compat-open-btn {
  display: inline-block;
  margin-left: .75rem;
  background: #fff;
  color: #5c0a0a;
  font-weight: 700;
  font-size: .78rem;
  padding: .25rem .75rem;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.compat-open-btn:hover { background: #ffd0d0; }
/* Managed browser — grey, dismissible */
.compat-managed {
  background: #1a1f2e;
  border-bottom: 1px solid #2d3550;
  color: #a0aabf;
}
.compat-managed strong { color: #c8d0e0; }

/* ── PWA Install Modal ───────────────────────────────────────────────────── */
#pwa-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
#pwa-modal-overlay[style*="none"] { display: none !important; }
#pwa-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.25rem;
  width: min(500px, 100%);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  position: relative;
  animation: modalSlideUp .25s cubic-bezier(.22,1,.36,1);
}
#pwa-modal-close {
  position: absolute; top: .9rem; right: 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.25rem; line-height: 1;
  padding: .2rem .4rem; border-radius: 6px;
  transition: color .15s, background .15s;
}
#pwa-modal-close:hover { color: var(--text); background: var(--card2); }
.pwa-modal-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}
.pwa-modal-body { display: flex; gap: .75rem; }
#pwa-install-btn-nav {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; padding: .25rem .3rem;
  border-radius: 6px; line-height: 1;
  transition: color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
#pwa-install-btn-nav:hover { color: var(--accent); background: var(--card); }
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 480px) {
  .pwa-modal-body { flex-direction: column; }
  .install-tabs { flex-direction: row; min-width: unset; }
  .install-tab { flex: 1; text-align: center; font-size: .72rem; padding: .4rem .3rem; }
}

/* ── Delete account modal ────────────────────────────────────────────────── */
#delete-account-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
#delete-account-modal[style*="none"] { display: none !important; }
.delete-modal-inner {
  background: var(--card);
  border: 1px solid #b60205;
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  width: min(420px, 100%);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.delete-modal-title {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .75rem;
}
.delete-modal-body {
  font-size: .84rem; color: var(--muted); line-height: 1.55;
}
.delete-modal-body strong { color: var(--text); }
.auth-delete-btn {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--muted);
  padding: .2rem .4rem; border-radius: 4px;
  transition: color .15s, background .15s;
  text-decoration: underline;
}
.auth-delete-btn:hover { color: var(--danger); background: rgba(248,113,113,.08); }
