/* LootFriend — LF Identity Theme
   Dark night-purple + gold accent, mobile-first */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700;800&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
  --bg:          #0d0d1a;
  --bg2:         #13132b;
  --bg3:         #1a1a38;
  --accent:      #f0c040;
  --accent-dim:  #c8960d;
  --accent-glow: rgba(240,192,64,0.18);
  --text:        #f0f0ff;
  --muted:       #9090c0;
  --dim:         #5050a0;
  --card:        rgba(19,19,43,0.92);
  --border:      rgba(240,192,64,0.14);
  --border-hi:   rgba(240,192,64,0.35);
  --radius:      14px;
  --radius-sm:   8px;
  --green:       #4ade80;
  --green-bg:    rgba(74,222,128,0.12);
  --yellow:      #fbbf24;
  --yellow-bg:   rgba(251,191,36,0.12);
  --red:         #f87171;
  --red-bg:      rgba(248,113,113,0.12);
  --font:        'Space Grotesk', sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }

/* ── Utility ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mobile-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 48px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0d0d1a;
}
.btn-primary:hover { background: #f5d060; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); }
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
}
.btn-danger:hover { background: rgba(248,113,113,0.22); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Inputs ────────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  min-height: 48px;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--dim); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
}

/* ── Logo / Brand ──────────────────────────────────────────────────────────── */
.lf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.lf-badge {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #0d0d1a;
  flex-shrink: 0;
}
.lf-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}
.lf-name span { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════════════════════════════════════════ */

.landing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13,13,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.lang-toggle {
  display: flex;
  gap: 4px;
}
.lang-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}
.lang-btn.active {
  background: var(--accent-glow);
  border-color: var(--border-hi);
  color: var(--accent);
}

/* Main content: pitch + auth side by side on wide, stacked on mobile */
.landing-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px 60px;
}

/* Pitch side */
.pitch {
  padding: 16px 0 36px;
}
.pitch-tagline {
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}
.pitch-tagline .gold { color: var(--accent); }
.pitch-sub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 36px;
}
.features {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}
.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.feature-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.feature-text p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.pitch-trust {
  font-size: 13px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pitch-trust::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Scan counter */
.scan-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  padding: 18px 24px;
  background: rgba(240, 192, 64, 0.06);
  border: 1px solid rgba(240, 192, 64, 0.18);
  border-radius: 14px;
}
.scan-counter-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.scan-counter-label {
  font-size: 12px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Auth card */
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  backdrop-filter: blur(12px);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg3);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 40px;
}
.auth-tab.active {
  background: var(--bg2);
  color: var(--accent);
  border: 1px solid var(--border-hi);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-error {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  min-height: 18px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.auth-switch button {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════════════════
   APP PAGE
══════════════════════════════════════════════════════════════════════════════ */

.app-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px; /* space for bottom-nav */
}

/* App top-bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  cursor: pointer;
  transition: background 0.15s;
}
.credits-badge:hover { background: rgba(240,192,64,0.28); }
.credits-badge.low { color: var(--red); border-color: rgba(248,113,113,0.35); background: var(--red-bg); }
.credits-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.credits-badge.low .credits-dot { background: var(--red); }

/* Bottom navigation (mobile) */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  min-height: 52px;
}
.nav-btn .nav-icon { font-size: 22px; line-height: 1; }
.nav-btn span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { filter: drop-shadow(0 0 6px rgba(240,192,64,0.5)); }

/* App main content */
.app-main {
  flex: 1;
  padding: 20px 16px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ── SCANNER TAB ─────────────────────────────────────────────────────────────── */

.scan-drop-zone {
  position: relative;
  border: 2px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg2);
  overflow: hidden;
}
.scan-drop-zone:hover,
.scan-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.scan-drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-icon { font-size: 48px; margin-bottom: 12px; }
.drop-text { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.drop-sub  { font-size: 13px; color: var(--muted); }

/* Image preview */
.scan-preview-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.scan-preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Scanning states */
.scan-status {
  text-align: center;
  padding: 40px 20px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-status-text { font-size: 16px; color: var(--muted); }
.scan-status-sub   { font-size: 13px; color: var(--dim); margin-top: 6px; }

/* Verdict cards */
.scan-results { display: flex; flex-direction: column; gap: 10px; }
.scan-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.summary-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.summary-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.verdict-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.verdict-badge {
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.verdict-badge.BUY   { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(74,222,128,0.3);  }
.verdict-badge.MAYBE { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3);  }
.verdict-badge.SKIP  { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(248,113,113,0.3); }
.verdict-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.verdict-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.verdict-tag {
  font-size: 12px;
  padding: 3px 8px;
  background: var(--bg3);
  border-radius: 4px;
  color: var(--muted);
}
.verdict-price {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.verdict-confidence {
  font-size: 12px;
  color: var(--dim);
}
.verdict-notes {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.4;
}

/* Warning / error boxes */
.alert-box {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid;
}
.alert-box.warn {
  background: rgba(251,191,36,0.08);
  border-color: rgba(251,191,36,0.3);
}
.alert-box.error {
  background: var(--red-bg);
  border-color: rgba(248,113,113,0.3);
}
.alert-box.info {
  background: var(--accent-glow);
  border-color: var(--border-hi);
}
.alert-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.alert-text  { font-size: 14px; color: var(--muted); line-height: 1.5; }
.alert-box.warn  .alert-title { color: var(--yellow); }
.alert-box.error .alert-title { color: var(--red); }
.alert-box.info  .alert-title { color: var(--accent); }

/* ── Verdict card — price grid ───────────────────────────────────────────────── */
.verdict-card {
  position: relative;
}
.verdict-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.verdict-name-wrap { flex: 1; min-width: 0; }
.dismiss-btn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.dismiss-btn:hover { color: var(--red); }

.price-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.price-cell { text-align: center; }
.price-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.price-cell.buy-cell  .price-label { color: var(--green); }
.price-cell.sell-cell .price-label { color: var(--accent); }
.price-amount {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.price-arrow {
  font-size: 18px;
  color: var(--dim);
}
.profit-line {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.profit-line strong { color: var(--green); }

/* ── History — search + filter bar ──────────────────────────────────────────── */
.history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.history-search {
  position: relative;
}
.history-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
}
.history-search input {
  padding-left: 38px;
}
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}
.filter-pill:hover { border-color: var(--border-hi); color: var(--text); }
.filter-pill.active { background: var(--accent-glow); border-color: var(--border-hi); color: var(--accent); }
.filter-pill.buy    { }
.filter-pill.buy.active   { background: var(--green-bg);  border-color: rgba(74,222,128,0.3);  color: var(--green);  }
.filter-pill.maybe.active { background: var(--yellow-bg); border-color: rgba(251,191,36,0.3);  color: var(--yellow); }
.filter-pill.skip.active  { background: var(--red-bg);    border-color: rgba(248,113,113,0.3); color: var(--red);    }

/* Date group headers */
.date-group-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 0 8px;
}
.date-group-header:first-child { padding-top: 0; }

/* ── HISTORY TAB ─────────────────────────────────────────────────────────────── */

.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.history-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.history-header:hover { background: rgba(240,192,64,0.05); }
.history-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.history-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.history-info { flex: 1; min-width: 0; }
.history-date { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.history-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.history-count { font-size: 12px; color: var(--dim); }
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-expand-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: transform 0.2s;
}
.history-expand-btn.open { transform: rotate(180deg); }

.history-objects {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-obj-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.history-obj-name {
  flex: 1;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  cursor: pointer;
}
.history-obj-name:hover { color: var(--accent); }
.history-obj-prices {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.price-max-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.price-sell-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── Confirm modal ───────────────────────────────────────────────────────────── */
.confirm-box {
  background: var(--bg2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  width: calc(100% - 40px);
  max-width: 320px;
  text-align: center;
  animation: slideUp 0.18s ease;
}
.confirm-icon { font-size: 30px; margin-bottom: 12px; }
.confirm-msg  {
  font-size: 15px; color: var(--text); line-height: 1.55;
  margin-bottom: 22px;
}
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns .btn { flex: 1; }

/* ── Detail modal ────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.15s ease;
}
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; padding: 24px; }
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 20px;
  animation: slideUp 0.2s ease;
}
@media (min-width: 700px) {
  .modal-box { border-radius: var(--radius); max-height: 80vh; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity:0 } to { transform: none; opacity:1 } }

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }
.modal-section {
  margin-bottom: 16px;
}
.modal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--dim);
  margin-bottom: 6px;
}
.modal-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-sub  { font-size: 14px; }

/* ── CREDITS TAB ─────────────────────────────────────────────────────────────── */

.credits-section { max-width: 480px; margin: 0 auto; }
.credits-current {
  text-align: center;
  padding: 32px 20px 16px;
}
.credits-number {
  font-family: var(--mono);
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.credits-label { font-size: 15px; color: var(--muted); }

/* ── Credits pitch block ─────────────────────────────────────────────────────── */
.cred-pitch {
  text-align: center;
  padding: 8px 20px 24px;
}
.cred-pitch-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.cred-pitch-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.cred-pitch-micro {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── Pack cards ──────────────────────────────────────────────────────────────── */
.credits-packs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.pack-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  transition: border-color 0.15s;
}
.pack-card.popular {
  border-color: var(--border-hi);
  background: var(--accent-glow);
}
.pack-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  background: var(--accent);
  color: #0d0d1a;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pack-save-badge {
  position: absolute;
  top: -1px;
  left: 16px;
  background: var(--green);
  color: #0d0d1a;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.3px;
}
.pack-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.pack-info { flex: 1; min-width: 0; }
.pack-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.pack-sublabel {
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pack-counts {
  font-size: 12px; color: var(--accent); font-weight: 600;
  margin-top: 3px;
}
.pack-desc {
  font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4;
}
.pack-persona-lbl {
  font-weight: 600; color: var(--dim);
}
.pack-price {
  font-family: var(--mono);
  font-size: 15px; font-weight: 700;
  color: var(--text);
  margin-top: 6px;
}
.pack-per-item {
  font-size: 11px; color: var(--dim); font-weight: 400; margin-left: 4px;
}
.pack-ladder {
  font-size: 11px; font-weight: 600; margin-top: 5px;
  letter-spacing: 0.2px;
}
.pack-ladder.save { color: var(--green); }
.pack-ladder.ref  { color: var(--dim); }
.pack-buy-btn {
  flex-basis: 100%;
  padding: 13px 16px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}

/* ── Daily claim box ─────────────────────────────────────────────────────────── */
.daily-claim-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 4px 0 16px;
}
.daily-claim-box.claimed {
  background: var(--bg2);
  border-color: var(--border);
  opacity: 0.75;
}
.daily-claim-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.daily-claim-text {
  flex: 1;
}
.daily-claim-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.daily-claim-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Credits footer ──────────────────────────────────────────────────────────── */
.cred-topup {
  text-align: center;
  font-size: 12px;
  color: var(--dim);
  margin: 16px 0;
}
.cred-custom {
  margin-top: 8px;
  margin-bottom: 28px;
}
.cred-custom-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.cred-custom-desc {
  font-size: 13px; color: var(--muted); line-height: 1.5;
}

/* ── SETTINGS TAB ────────────────────────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  flex-wrap: wrap;
}
.settings-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.settings-input {
  width: 90px;
  text-align: right;
  font-family: var(--mono);
  font-size: 14px;
}
.settings-unit {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  min-width: 18px;
}
.settings-select {
  width: auto;
  min-width: 120px;
  flex-shrink: 0;
}

/* ── Category thresholds ─────────────────────────────────────────────────────── */
.cat-thresh-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.cat-thresh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-thresh-name {
  flex: 1 1 120px;
  font-size: 13px;
  color: var(--text);
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-thresh-recommended {
  font-size: 10px;
  color: var(--dim);
  font-weight: 500;
}
.cat-thresh-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cat-thresh-lbl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.cat-thresh-input {
  width: 58px;
  padding: 5px 8px;
  font-size: 13px;
  text-align: right;
}
.cat-thresh-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-right: 6px;
}

/* ── Loading overlay ─────────────────────────────────────────────────────────── */
.page-loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop
══════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 700px) {
  /* Landing: side-by-side */
  .landing-main {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    padding-top: 60px;
  }
  .pitch-tagline { font-size: 42px; }

  /* App: hide bottom nav, show top tabs */
  .app-nav { display: none; }
  .app-wrap { padding-bottom: 0; }
  .app-topbar { padding: 14px 24px; }

  .desktop-tabs {
    display: flex;
    gap: 6px;
  }
  .desktop-tab {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 40px;
  }
  .desktop-tab.active {
    background: var(--accent-glow);
    border-color: var(--border-hi);
    color: var(--accent);
  }

  .app-main { padding: 32px 24px; }

  /* Wider scan result grid */
  .scan-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 699px) {
  .desktop-tabs { display: none; }
  .lf-name { display: none; }
  .topbar-right .lang-toggle { display: none; }
  #logoutBtn { display: none; }
  .mobile-only { display: block !important; }
}

/* ── Compact scan-result rows ───────────────────────────────────────────────── */
.scan-list { display: flex; flex-direction: column; gap: 3px; }

.scan-row { background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }

.scan-row-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; user-select: none;
  transition: background 0.12s;
}
.scan-row-header:hover { background: rgba(240,192,64,0.06); }

.scan-row-name {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--text);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scan-row-maxbuy {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.scan-row-maxbuy-lbl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.scan-row-maxbuy-val {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
.scan-row-price {
  font-size: 12px; color: var(--accent); font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.scan-row-arrow {
  font-size: 10px; color: var(--dim); transition: transform 0.18s; flex-shrink: 0;
}
.scan-row-arrow.open { transform: rotate(180deg); }

.scan-row-detail {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  display: none;
}
.scan-row-detail.open { display: block; }

.scan-row-prices {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.scan-row-price-cell { font-size: 12px; }
.scan-row-price-cell .price-label { color: var(--muted); font-size: 11px; }
.scan-row-price-cell .price-val   { font-weight: 700; color: var(--text); }
.scan-row-arrow-sep { color: var(--dim); font-size: 12px; }

.scan-row-profit { font-size: 12px; color: var(--green); font-weight: 600; margin-bottom: 6px; }

.scan-row-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }

.scan-row-notes { font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.5; }
.scan-row-conf  { font-size: 11px; color: var(--dim); margin-top: 4px; }

.scan-row-dismiss {
  float: right; background: none; border: none; color: var(--dim);
  font-size: 16px; cursor: pointer; padding: 0 0 0 8px; line-height: 1;
}
.scan-row-dismiss:hover { color: var(--red); }

/* ── ToS checkbox ───────────────────────────────────────────────────────────── */
.tos-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0 2px; font-size: 13px; color: var(--muted); line-height: 1.5;
}
.tos-row input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--accent); cursor: pointer;
}
.tos-row label { cursor: pointer; }
.tos-row a { color: var(--accent); text-decoration: none; }
.tos-row a:hover { text-decoration: underline; }

/* ── Landing footer ─────────────────────────────────────────────────────────── */
.landing-footer {
  display: flex; gap: 20px; justify-content: center; align-items: center;
  padding: 20px 20px 44px;
  font-size: 13px; color: #5050a0;
}
.landing-footer a { color: var(--accent); text-decoration: none; }
.landing-footer a:hover { text-decoration: underline; }

/* ── Policy page ─────────────────────────────────────────────────────────────── */
.policy-wrap { max-width: 660px; margin: 0 auto; padding: 0 20px 60px; }
.policy-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 36px;
}
.policy-main h1 { font-size: 22px; color: var(--accent); margin: 0 0 24px; font-weight: 700; }
.policy-main h2 { font-size: 14px; color: var(--txt-bright); font-weight: 600; margin: 24px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.policy-main p  { color: #9090c0; line-height: 1.75; font-size: 14px; margin: 0 0 4px; }
.policy-main a  { color: var(--accent); text-decoration: none; }
.policy-main a:hover { text-decoration: underline; }
.policy-footer {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #5050a0;
}
.policy-footer a { color: var(--accent); text-decoration: none; }
.policy-footer a:hover { text-decoration: underline; }
.settings-policy-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.settings-policy-link:hover { text-decoration: underline; color: var(--accent); }

/* ── Coverage grid ──────────────────────────────────────────────────────────── */
.coverage-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.coverage-row  { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.4; }
.coverage-icon { flex-shrink: 0; width: 18px; text-align: center; font-size: 14px; margin-top: 1px; }
.coverage-text { color: var(--muted); }
.coverage-text strong { color: var(--text); }
