/* ============================================================
   LootLens design system — mobile-first, dark, premium, sharp
   ============================================================ */

:root {
  /* Background scale — deep slate */
  --bg: #09090b;
  --bg-2: #131316;
  --bg-3: #1a1a1f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Text hierarchy */
  --text: #fafafa;
  --text-secondary: #e4e4e7;
  --muted: #a1a1aa;
  --faint: #71717a;

  /* Accent — vibrant teal */
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-2: #0891b2;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-glow: rgba(6, 182, 212, 0.25);

  /* Semantic colors */
  --mint: #10b981;
  --mint-soft: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.12);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #131316 0%, #09090b 100%);
  --grad-accent: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-glow: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.15) 0%, transparent 70%);

  /* Radii */
  --r-xl: 20px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;

  /* Shadows — deeper, more dramatic */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.2);

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);

  --nav-h: 78px;

  /* Typography */
  --font-sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: 48px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before, body::after { display: none; }

img, svg { display: block; }
iframe { max-width: 100vw; display: block; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select, textarea { font: inherit; }

::selection { background: rgba(6, 182, 212, 0.3); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.ic { width: 20px; height: 20px; flex: none; }

/* ---------- header / brand ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 12px;
}
@media (min-width: 900px) {
  .site-head {
    display: flex;
    justify-content: center;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 14px;
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
@media (min-width: 900px) {
  .brand {
    width: 100%;
    max-width: 640px;
    justify-content: flex-start;
  }
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; color: #fff; }
.brand-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand-name b {
  font-weight: 800;
  color: var(--accent);
}

/* ---------- hero ---------- */
.hero {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 8px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: var(--grad-glow);
  pointer-events: none;
  z-index: -1;
}
.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  animation: rise 0.5s var(--ease-out) both;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--text);
  animation: rise 0.55s 0.05s var(--ease-out) both;
}
.hero h1 em {
  font-style: normal;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero > p:not(.kicker) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
  animation: rise 0.6s 0.12s var(--ease-out) both;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  animation: rise 0.6s 0.2s var(--ease-out) both;
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
}
.trust-row .ic { width: 14px; height: 14px; }

/* ---------- main column ---------- */
main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 40px);
}

.view { will-change: transform, opacity; }
.view.entering { animation: viewIn 0.34s var(--ease-out) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

/* ---------- intro card ---------- */
.intro-card { margin: 8px 0 16px; }
.intro-card h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
}
.intro-card h2 .ic { color: var(--accent); }
.intro-card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.intro-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- currency prompt ---------- */
.currency-prompt {
  margin: 6px 0 14px;
  text-align: center;
}
.currency-prompt h2 {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 6px;
  font-size: 17px; font-weight: 750; letter-spacing: -0.01em;
}
.currency-prompt h2 .ic { color: var(--accent); }
.currency-prompt p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* ---------- custom select ---------- */
.custom-select {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
.custom-select-trigger {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.custom-select-trigger:hover,
.custom-select-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}
.custom-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}
.custom-select-chevron {
  width: 18px;
  height: 18px;
  color: var(--faint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.custom-select-trigger[aria-expanded="true"] .custom-select-chevron {
  transform: rotate(180deg);
}
.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 100;
  overflow: hidden;
}
.custom-select-dropdown.open {
  display: flex;
  flex-direction: column;
}
.custom-select-search-wrap {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.custom-select-search {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.custom-select-search::placeholder {
  color: var(--faint);
}
.custom-select-search:focus {
  border-color: var(--accent);
}
.custom-select-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.custom-select-options {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.custom-select-options::-webkit-scrollbar { width: 4px; }
.custom-select-options::-webkit-scrollbar-track { background: transparent; }
.custom-select-options::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.custom-select-option {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.custom-select-option:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.custom-select-option.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.custom-select-option.hidden {
  display: none;
}
.custom-select-option[data-highlight="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- change currency btn ---------- */
#changeCurrencyBtn {
  font-size: 13px;
  min-height: 36px;
  padding: 0 12px;
  opacity: 0.7;
}
#changeCurrencyBtn:hover { opacity: 1; }
#currentCurrencyLabel { font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 15px;
  min-height: 48px;
  padding: 0 24px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease-out), box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.97); }
.btn.sm { min-height: 36px; font-size: 13px; padding: 0 14px; border-radius: var(--r-sm); font-weight: 500; }
.btn.grow { flex: 1; }
.btn.primary {
  background: var(--grad-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}
.btn.primary:hover { box-shadow: 0 0 30px rgba(6, 182, 212, 0.35); }
.btn.ghost {
  background: var(--accent-soft);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent);
}
.btn.ghost:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent);
}
.btn.dashed {
  width: 100%;
  border: 1.5px dashed var(--border-strong);
  color: var(--muted);
  background: transparent;
  min-height: 52px;
}
.btn.dashed:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.add-btn { margin-bottom: 14px; }
.danger-ghost {
  border: 1px solid var(--border-strong);
  color: var(--rose);
  background: transparent;
  width: 48px;
}
.danger-ghost:hover { background: var(--rose-soft); border-color: var(--rose); }
.icon-btn { padding: 0; }
.actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- item cards ---------- */
.items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.item {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 14px 12px;
  animation: rise 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.item.invalid { border-color: rgba(239, 68, 68, 0.4); }
.item.best-glow {
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.3);
}
.item-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.item-num {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px; font-weight: 750; color: var(--muted);
  flex: none;
}
.item-name {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  padding: 6px 0;
}
.item-name::placeholder { color: var(--faint); font-weight: 500; }
.item-del {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  color: var(--faint);
  transition: color 0.2s, background 0.2s, transform 0.16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.item-del:hover { color: var(--rose); background: var(--rose-soft); }
.item-del:active { transform: scale(0.88); }
.item-del .ic { width: 17px; height: 17px; }

.item-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 84px;
  gap: 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.field input, .field select,
.tool-panel input, .tool-panel select, .tool-panel textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.tool-panel textarea { resize: vertical; min-height: 58px; }
.field input:focus, .field select:focus,
.tool-panel input:focus, .tool-panel select:focus, .tool-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface-3);
}
.field select, .tool-panel select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field select option, .tool-panel select option { background: var(--bg-2); color: var(--text); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* live ppu preview inside item */
.item-live {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 18px;
  display: flex; align-items: center; gap: 6px;
}
.item-live b { color: var(--accent); font-weight: 750; }
.item-live .warn { color: var(--amber); }

/* ---------- results ---------- */
.results {
  animation: rise 0.5s var(--ease-out) both;
  margin-bottom: 14px;
}
.winner-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  margin-bottom: 16px;
}
.crown {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--grad-accent);
  color: #fff;
  flex: none;
  animation: pop 0.45s var(--ease-out) 0.15s both;
  box-shadow: var(--shadow-glow);
}
.crown .ic { width: 21px; height: 21px; }
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.winner-banner small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.winner-banner strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.winner-ppu {
  margin-left: auto;
  text-align: right;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rank-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  animation: rise 0.4s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.rank-badge {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}
.rank-row.first .rank-badge { background: var(--accent); color: #fff; }
.rank-main { min-width: 0; }
.rank-name {
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-best {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
}
.rank-sub {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.bar {
  margin-top: 6px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: #78716c;
  transition: width 0.7s var(--ease-out);
}
.rank-row.first .bar i { background: var(--accent); }
.rank-ppu {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 86px;
}
.rank-ppu b { display: block; font-size: 14.5px; font-weight: 750; }
.rank-ppu span { font-size: 11.5px; color: var(--rose); font-weight: 650; }
.rank-row.first .rank-ppu span { visibility: hidden; }
.rank-ppu span.ok { color: var(--faint); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.stat {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 8px;
  text-align: center;
}
.stat-val {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat-val.mint { color: var(--accent); }
.stat-lbl { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: 0.02em; }

/* ---------- verdicts ---------- */
.verdicts { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.verdict {
  display: flex;
  gap: 11px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  border: 1px solid;
  animation: rise 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.verdict .ic { width: 19px; height: 19px; margin-top: 2px; }
.verdict h3 { margin: 0 0 3px; font-size: 13.5px; font-weight: 750; letter-spacing: -0.005em; }
.verdict p { margin: 0; font-size: 12.75px; line-height: 1.5; color: var(--muted); }
.verdict.v-alert { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); }
.verdict.v-alert .ic, .verdict.v-alert h3 { color: var(--rose); }
.verdict.v-warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); }
.verdict.v-warn .ic, .verdict.v-warn h3 { color: var(--amber); }
.verdict.v-info { background: rgba(217, 119, 6, 0.06); border-color: rgba(217, 119, 6, 0.2); }
.verdict.v-info .ic, .verdict.v-info h3 { color: var(--accent); }
.verdict.v-good { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.2); }
.verdict.v-good .ic, .verdict.v-good h3 { color: #22c55e; }

/* ---------- scan view ---------- */
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
}
.seg-btn {
  min-height: 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s, background 0.25s, transform 0.16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.seg-btn:active { transform: scale(0.94); }
.seg-btn.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.tool-panel h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 6px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
}
.tool-panel h2 .ic { color: var(--accent); width: 18px; height: 18px; }
.hint { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.tool-panel label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.grid2 label { margin-bottom: 2px; }
.grid2 label:nth-last-child(-n+2) { grid-column: auto; }

.tool-out {
  display: block;
  margin-top: 6px;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.55;
}
.tool-out:empty { margin: 0; min-height: 0; }
.tool-verdict {
  margin-top: 10px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  animation: rise 0.4s var(--ease-out) both;
}
.tool-verdict.big-num {
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tool-verdict small { display: block; font-size: 12px; font-weight: 600; margin-top: 3px; color: inherit; opacity: 0.85; }
.tv-good { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); color: #22c55e; }
.tv-bad { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: var(--rose); }
.tv-neutral { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

/* ---------- learn view ---------- */
.learn-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 4px; }
.learn-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.faq-title { margin-top: 26px; }

details.acc {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-2);
  margin: 9px 0;
  overflow: hidden;
  transition: border-color 0.25s;
}
details.acc[open] { border-color: rgba(217, 119, 6, 0.3); }
details.acc summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc .chev { color: var(--faint); transition: transform 0.3s var(--ease-out); }
details.acc[open] .chev { transform: rotate(180deg); color: var(--accent); }
.acc-body { padding: 0 16px 14px; }
details.acc > p, details.acc li { font-size: 13.5px; color: var(--muted); }
details.acc ul, details.acc ol { margin: 6px 0; padding-left: 20px; }
details.acc li { margin: 3px 0; }
code {
  background: var(--accent-soft);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.checklist-card { margin-top: 20px; }
.checklist-card h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  font-size: 17px; font-weight: 600;
}
.checklist-card ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.checklist-card li { margin: 7px 0; }
.checklist-card li::marker { color: var(--accent); }

/* ---------- ads ---------- */
.ad-slot {
  margin: 6px 0 14px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.ad-box {
  height: 100px;
  border-radius: var(--r-sm);
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 12px, rgba(255,255,255,0.04) 12px, rgba(255,255,255,0.04) 24px);
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 11px;
}
.ad-box[data-ad-height="250"] { height: 250px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 520px;
  margin: 0 auto;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 10px env(safe-area-inset-bottom, 0px);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s, transform 0.16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0;
}
.nav-btn:active { transform: scale(0.9); }
.nav-btn .ic { width: 22px; height: 22px; transition: transform 0.25s var(--ease-spring); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .ic { transform: translateY(-2px) scale(1.06); color: var(--accent); }
.nav-btn span { position: relative; }
.nav-btn .nav-badge {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: var(--faint);
  line-height: 1.5;
  margin-bottom: 1px;
}
.nav-btn .nav-badge:empty,
.nav-btn .nav-badge.is-hidden { visibility: hidden; }
.nav-btn.active .nav-badge { background: rgba(6,182,212,0.15); color: var(--accent); }
.nav-btn.active span::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
  transform: translate(-50%, 16px);
  background: #1c1917;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  max-width: min(88vw, 420px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */
footer { padding-bottom: calc(var(--nav-h) + 30px); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0;
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}
.footer-links a:hover { text-decoration: underline; }
.footer-copy {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- side banners (PC/tablet) ---------- */
.side-banners {
  display: none;
}
@media (min-width: 900px) {
  .side-banners {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
  }
  .side-banner {
    position: absolute;
    width: 160px;
    height: 600px;
    pointer-events: auto;
    overflow: hidden;
  }
  .side-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
  .side-left-2 {
    left: 200px;
    top: 50%;
    transform: translateY(-50%);
  }
  .side-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
  .side-right-2 {
    right: 200px;
    top: 50%;
    transform: translateY(-50%);
  }
  footer, main {
    position: relative;
    z-index: 11;
  }
}

/* ---------- keyframes shared ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* ---------- desktop niceties ---------- */
@media (min-width: 900px) {
  .hero, main, footer { max-width: 640px; }
  .bottom-nav { max-width: 560px; border-radius: 20px 20px 0 0; }
}

/* ---------- 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;
  }
}

/* ---------- tool guide link ---------- */
.tool-head {
  margin-bottom: 4px;
}
.tool-head h2 { margin-bottom: 0; }
.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(217,119,6,0.1);
  border: 1px dashed rgba(217,119,6,0.4);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  margin: 12px 0 4px;
  transition: background 0.2s, border-color 0.2s;
  text-align: center;
  justify-content: center;
  text-decoration: none;
}
.guide-link svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.guide-link:hover, .guide-link:focus-visible {
  background: rgba(217,119,6,0.18);
  border-color: var(--accent);
}

/* ---------- share scan button ---------- */
.share-scan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(217,119,6,0.1);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  margin: 12px 0 4px;
  transition: background 0.2s, border-color 0.2s;
}
.share-scan:hover {
  background: rgba(217,119,6,0.18);
  border-color: var(--accent);
}
.share-scan svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }

/* ---------- clear field buttons ---------- */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input,
.input-wrap textarea {
  width: 100%;
  padding-right: 32px;
}
.input-wrap-name {
  flex: 1;
}
.input-wrap-name input {
  width: 100%;
  padding-right: 28px;
}
.field-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.field-clear:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text);
}
.field-clear-name {
  right: 4px;
  width: 20px;
  height: 20px;
  font-size: 13px;
}
.input-wrap:focus-within .field-clear,
.field-clear.force-show {
  display: flex;
}
.field-clear.force-show {
  display: flex;
}

/* Clear all scan button */
.tool-actions,
.compare-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.compare-actions {
  margin-bottom: 8px;
}
.clear-scan {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.clear-scan:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

/* Field row for scan tools */
.field-row {
  margin-bottom: 4px;
}
.field-row label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.field-row input,
.field-row textarea {
  width: 100%;
}

/* ---------- guide modal ---------- */
.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  padding: 0;
}
.guide-modal.open {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
.guide-sheet {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.guide-modal.open .guide-sheet { transform: translateY(0); }
@media (min-width: 600px) {
  .guide-modal { align-items: center; padding: 24px; }
  .guide-sheet { border-radius: 16px; max-height: 80vh; }
}

.guide-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.guide-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.guide-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.guide-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.guide-body { font-size: 14px; color: var(--text); line-height: 1.6; }
.guide-intro { margin-bottom: 16px; color: var(--muted); }
.guide-intro strong { color: var(--text); }
.guide-body h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 20px 0 8px;
}
.guide-body ol {
  padding-left: 20px;
  margin: 0 0 8px;
}
.guide-body li {
  margin-bottom: 6px;
}
.guide-body li strong { color: var(--text); }

/* guide simulation boxes */
.guide-sim { margin: 12px 0; }
.guide-sim-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.guide-sim-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guide-sim-strike {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 13px;
}
.guide-sim-big {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.guide-sim-tag {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
}
.guide-sim-muted { font-size: 12px; color: var(--muted); }
.guide-sim-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* guide verdicts */
.guide-verdict {
  display: block;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
}
.guide-good { background: rgba(16,185,129,0.12); color: #10b981; }
.guide-bad { background: rgba(244,63,94,0.12); color: #f43f5e; }
.guide-warn { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* guide table */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}
.guide-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.guide-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.guide-table td:last-child { color: var(--muted); }

/* guide formula */
.guide-formula {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  text-align: center;
}
.guide-formula code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 14px;
  color: var(--accent);
}

/* guide tip */
.guide-tip {
  margin-top: 20px;
  background: rgba(217,119,6,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.guide-tip strong { color: var(--accent); }

/* ---------- adblocker notice banner ---------- */
.adblock-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: #1a0a14;
  border-bottom: 1px solid rgba(255,45,123,0.3);
  padding: 8px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #e0e0e0;
  font-weight: 500;
}
.adblock-notice i { color: #ff2d7b; margin-right: 8px; }
.notice-short { display: none; }
@media (max-width: 600px) {
  .adblock-notice { padding: 6px 12px; font-size: 0.7rem; }
  .notice-full { display: none; }
  .notice-short { display: inline; }
  body { padding-top: 40px; }
}

/* ---------- adblocker popup overlay ---------- */
.adblock-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.adblock-overlay.show {
  display: flex;
  opacity: 1;
}
.adblock-popup {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
}
.adblock-popup h2 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--text);
}
.adblock-popup p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.adblock-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 16px;
}
.adblock-timer-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.adblock-popup .btn-group {
  display: flex;
  gap: 10px;
}
.adblock-popup .btn-group button {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.adblock-popup .btn-dismiss {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 1px solid var(--border) !important;
}
.adblock-popup .btn-dismiss:hover { background: rgba(255,255,255,0.1); }
.adblock-popup .btn-support {
  background: var(--accent);
  color: #000;
}
.adblock-popup .btn-support:hover { background: var(--amber); }
.adblock-popup .btn-dismiss:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- privacy consent bottom sheet ---------- */
.privacy-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0,0,0,0.5);
  align-items: flex-end;
  justify-content: center;
}
.privacy-overlay.show {
  display: flex;
}
.privacy-popup {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  text-align: left;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}
.privacy-popup h2 {
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--text);
}
.privacy-popup p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.5;
}
.privacy-popup a { color: var(--accent); text-decoration: underline; }
.privacy-popup .btn-group { margin-top: 12px; }
.privacy-popup .btn-group-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
}
.privacy-popup .btn-support {
  flex: 1;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #000;
  transition: background 0.2s;
}
.privacy-popup .btn-support:hover { background: var(--amber); }
.privacy-popup .btn-secondary {
  flex: 1;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.privacy-popup .btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

/* ---------- live ad slots ---------- */
.ad-slot {
  margin: 12px 0;
  text-align: center;
  overflow: hidden;
  border-radius: 12px;
}
.ad-slot .ad-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 4px;
}
.ad-slot iframe {
  display: block;
  margin: 0 auto;
  border: none;
}
/* mobile banner 320x50 */
.ad-slot-top { margin: 0 0 8px; }
/* desktop leaderboard 728x90 */
@media (min-width: 900px) {
  .ad-slot-top iframe { max-width: 728px; }
}


