:root {
  --navy: #1a2456; --navy2: #0f1738; --blue: #2a3a7c; --blue-mid: #3b5cb8;
  --gold: #f5c518; --gold-h: #e8b30e; --gold-s: rgba(245,197,24,0.1);
  --w: #ffffff; --g50: #f8f9fc; --g100: #eef1f7; --g200: #dce1ed;
  --g400: #9ba5c0; --g500: #7b8ab5; --g700: #3d4a6e;
  --green: #22c55e; --green-s: rgba(34,197,94,0.12);
  --red: #ef4444; --red-s: rgba(239,68,68,0.12);
  --orange: #f59e0b; --orange-s: rgba(245,158,11,0.12);
  --r: 14px; --rs: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body, #root { width: 100%; min-height: 100vh; min-height: 100dvh; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-size: 14px; color: var(--navy); background: var(--g50);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}

/* Splash / Login */
.login-screen {
  min-height: 100vh; min-height: 100dvh;
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 50%, var(--navy2) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--w); border-radius: 20px; padding: 32px 24px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h2 { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-card p { font-size: 13px; color: var(--g500); text-align: center; margin-bottom: 20px; }
.login-btn {
  width: 100%; padding: 13px; border-radius: var(--rs); font-size: 14px; font-weight: 700;
  cursor: pointer; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.login-btn:active { transform: scale(0.98); }
.login-btn-google { background: var(--w); border: 1.5px solid var(--g200); color: var(--navy); }
.login-btn-email { background: var(--navy); border: none; color: var(--w); }
.login-btn-gold { background: var(--gold); border: none; color: var(--navy); box-shadow: 0 4px 12px rgba(245,197,24,0.3); }
.login-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--g200); border-radius: var(--rs);
  font-size: 14px; color: var(--navy); outline: none; margin-bottom: 8px;
}
.login-input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(59,92,184,0.1); }
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--g400); font-size: 12px;
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--g200); }
.login-link { color: var(--blue-mid); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; }

/* App shell */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 430px; margin: 0 auto; position: relative; }

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  padding: calc(12px + var(--safe-top)) 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.app-header-brand { display: flex; align-items: center; gap: 8px; }
.app-header-brand span { font-size: 16px; font-weight: 800; color: var(--w); letter-spacing: -0.3px; }
.pro-badge {
  padding: 3px 10px; border-radius: 12px; background: var(--gold); color: var(--navy);
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
}

/* Content area */
.tab-content { flex: 1; overflow-y: auto; padding-bottom: calc(76px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.tab-pad { padding: 0 16px; }

/* Tab bar */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; background: var(--w);
  border-top: 1px solid var(--g100);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 calc(8px + var(--safe-bottom));
  box-shadow: 0 -2px 10px rgba(26,36,86,0.06); z-index: 100;
}
.tab-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px; min-width: 44px; transition: opacity 0.15s;
}
.tab-btn span:first-child { font-size: 20px; line-height: 1; }
.tab-btn-label { font-size: 9px; font-weight: 700; letter-spacing: 0.2px; }
.tab-btn-dot { width: 20px; height: 2.5px; border-radius: 2px; background: var(--gold); margin-top: 1px; }

/* Cards */
.card {
  background: var(--w); border-radius: var(--r); padding: 16px;
  box-shadow: 0 2px 8px rgba(26,36,86,0.06); border: 1px solid var(--g100);
  margin-bottom: 12px; animation: fadeUp 0.25s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.card-title { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-navy {
  background: linear-gradient(135deg, var(--navy2), var(--blue)); color: var(--w);
  border: none;
}

/* Score badge */
.score-badge {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0; border: 2.5px solid;
}

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px; border-radius: var(--rs); font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; transition: transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 4px 12px rgba(245,197,24,0.3); }
.btn-navy { background: var(--navy); color: var(--w); }
.btn-outline { background: transparent; border: 2px solid var(--g200); color: var(--navy); }
.btn-sm { padding: 8px 14px; font-size: 12px; width: auto; }

/* Inputs */
.input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--g200); border-radius: var(--rs);
  font-size: 13px; color: var(--navy); outline: none; background: var(--w);
}
.input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(59,92,184,0.1); }
.textarea { min-height: 130px; resize: vertical; font-family: 'SF Mono', Consolas, monospace; font-size: 12px; line-height: 1.5; }

/* Pills / Tags */
.pill {
  padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--g200); background: var(--w); color: var(--navy);
  cursor: pointer; white-space: nowrap;
}
.pill-active { background: var(--navy); border-color: var(--navy); color: var(--w); }
.status-tag {
  padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; display: inline-block;
}

/* Auction item row */
.auction-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--g100);
}
.auction-row:first-child { border-top: none; }

/* Deal card */
.deal-card {
  background: var(--w); border-radius: 12px; padding: 12px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(26,36,86,0.05); border: 1px solid var(--g100);
  display: flex; gap: 12px; align-items: center;
}

/* Alert card */
.alert-card {
  background: var(--w); border-radius: 12px; padding: 14px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(26,36,86,0.05);
}

/* Browser bar */
.browser-bar {
  background: var(--navy); padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
}
.browser-url {
  flex: 1; background: rgba(255,255,255,0.1); border-radius: 8px; padding: 7px 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,0.7);
}
.profit-bar {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  padding: 8px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Settings */
.settings-group { margin-bottom: 16px; }
.settings-group-title {
  font-size: 11px; font-weight: 700; color: var(--g400); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px; padding-left: 4px;
}
.settings-list { background: var(--w); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(26,36,86,0.04); border: 1px solid var(--g100); }
.settings-item {
  padding: 13px 16px; display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--g100); font-size: 13px; font-weight: 500;
}
.settings-item:first-child { border-top: none; }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 10px 24px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--w); background: var(--navy); box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 200; transition: transform 0.3s; white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid var(--g200); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-gold { color: var(--gold); }
.text-g500 { color: var(--g500); } .text-g400 { color: var(--g400); }
.fw-800 { font-weight: 800; } .fw-700 { font-weight: 700; } .fw-600 { font-weight: 600; }
.fs-10 { font-size: 10px; } .fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.fs-16 { font-size: 16px; } .fs-20 { font-size: 20px; } .fs-22 { font-size: 22px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: 4px; } .mb-6 { margin-bottom: 6px; } .mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.text-center { text-align: center; } .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; } .shrink-0 { flex-shrink: 0; }

::-webkit-scrollbar { width: 0; } /* Hide scrollbar on mobile */
