:root {
  /* Apple-style dark theme (iOS / macOS dark mode palette) */
  --bg: #000000;
  --bg-elevated: #0c0c0e;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #98989d;
  --primary: #0a84ff;
  --primary-hover: #3b9bff;
  --danger: #ff453a;
  --ok: #30d158;
  --warn: #ff9f0a;
  --good: #30d158;
  --bad: #ff453a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 34px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4);
  --accent-2: #5e5ce6;
  --accent-3: #32d4ff;
  --grad: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 55%, #32d4ff 120%);
  --grad-text: linear-gradient(120deg, #ffffff 0%, #cfe3ff 45%, #7fb4ff 100%);
}

* {
  box-sizing: border-box;
}

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

/* ---- Custom scrollbars (subtle, Apple-like) ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui,
    "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

h1, h2, h3 { letter-spacing: -0.022em; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* ---- Navbar ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.brand-logo {
  display: block;
  height: 60px;
  width: auto;
  margin-right: -18px;
}

.brand:hover {
  text-decoration: none;
  opacity: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* ---- Layout ---- */
.container {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 3rem;
}

.footer {
  text-align: center;
  padding: 1.6rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}
.footer-legal {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin: 0.6rem 0 0.4rem;
  flex-wrap: wrap;
}
.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s;
}
.footer-legal a:hover { color: var(--text); }
.footer-copy { font-size: 0.82rem; }
.footer-independence {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.3rem 0 0.2rem;
  opacity: 0.7;
}
.footer-referral {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  opacity: 0.6;
}

/* ===== Legal pages ===== */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}
.legal-page h1.page-head-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.3rem;
}
.legal-updated {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 1.8rem;
}
.legal-alert {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid var(--bad);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.legal-alert-age {
  background: rgba(255, 159, 10, 0.1);
  border-color: var(--warn);
}
.legal-page h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}
.legal-page p, .legal-page li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}
.legal-page p { margin: 0 0 0.7rem; }
.legal-page strong { color: var(--text); }
.legal-page ul, .legal-page ol {
  padding-left: 1.4rem;
  margin: 0.4rem 0 0.8rem;
}
.legal-page li { margin-bottom: 0.4rem; }
.legal-page a { color: var(--primary); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }

.cookies-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0 1.2rem;
  font-size: 0.88rem;
}
.cookies-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.cookies-table td {
  padding: 0.65rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.55;
}
.cookies-table tr:last-child td { border-bottom: none; }
.cookies-table code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  color: var(--accent-3);
}

/* ===== Cookie consent banner ===== */
.cc-banner {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.4rem);
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
}
.cc-banner.cc-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}
.cc-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}
.cc-text {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.cc-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1.3; }
.cc-title { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.cc-body { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.cc-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}
.cc-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  white-space: nowrap;
}
.cc-link:hover { color: var(--text); }
.cc-btn { font-size: 0.88rem; padding: 0.5rem 1.2rem; white-space: nowrap; }
@media (max-width: 560px) {
  .cc-inner { flex-direction: column; align-items: stretch; }
  .cc-actions { justify-content: flex-end; }
}

/* ---- Custom confirmation modal ---- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.2s ease;
}
.confirm-modal.confirm-modal-hidden {
  opacity: 0;
  pointer-events: none;
}
.confirm-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
  transform: translateY(0) scale(1);
  transition: transform 0.2s ease;
}
.confirm-modal-hidden .confirm-box {
  transform: translateY(12px) scale(0.97);
}
.confirm-title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.confirm-message {
  margin: 0 0 1.4rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ---- Hero (landing) ---- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.hero h1 {
  font-size: 3rem;
  letter-spacing: -0.03em;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}

.auth-card {
  max-width: 420px;
  margin: 2rem auto;
}

.center {
  text-align: center;
}

/* ---- Forms ---- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}

.form label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 122, 255, 0.25);
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--grad);
  background-size: 150% 150%;
  color: #fff;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(10, 132, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
  transform: translateY(-1px);
}

.btn-arrow {
  transition: transform 0.15s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  opacity: 1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Alerts ---- */
.alert {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.alert ul {
  margin: 0;
  padding-left: 1.2rem;
}

.alert-error {
  background: rgba(255, 69, 58, 0.14);
  border: 1px solid rgba(255, 69, 58, 0.32);
  color: #ff6961;
}

.alert-success {
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.32);
  color: #30d158;
}

.alert-ok {
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.32);
  color: #4cd964;
}

/* ---- OTP code inputs ---- */
.otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 20px;
}
.otp-digit {
  width: 52px;
  height: 64px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-2);
  border: 2px solid var(--surface-3);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--primary);
  -moz-appearance: textfield;
}
.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}
.otp-sep {
  color: var(--muted);
  font-size: 1.2rem;
  margin: 0 2px;
  user-select: none;
}
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { opacity: 0.8; }

.muted {
  color: var(--muted);
}

/* ---- Dashboard info ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.info-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1.1rem;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.badge-admin {
  background: rgba(10, 132, 255, 0.18);
  color: #5ab0ff;
}

.badge-user {
  background: rgba(152, 152, 157, 0.18);
  color: var(--muted);
}

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  margin-top: 1.2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ===== CryptoCopilot additions ===== */

.brand .brand-name > span { color: var(--primary); }

.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.spacer { height: 0.8rem; }
.sep { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.h2 { font-size: 1.1rem; margin: 0.2rem 0 0.8rem; }

/* Landing hero */
.hero-lg {
  flex-direction: column;
  text-align: center;
  gap: 1.1rem;
  min-height: auto;
  padding: 4rem 1rem 2.5rem;
}
.hero-lg h1 { font-size: 3.2rem; max-width: 820px; line-height: 1.05; letter-spacing: -0.035em; margin: 0.4rem 0; }
.lead { color: var(--muted); max-width: 640px; font-size: 1.2rem; line-height: 1.5; }
.pill {
  background: rgba(10, 132, 255, 0.16);
  color: #5ab0ff;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.08rem; font-weight: 600; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 2.5rem 0;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.feature h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.97rem; line-height: 1.5; }
.cta { text-align: center; padding: 2rem 1.5rem; }

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Stat cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stat { text-align: left; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin: 0.3rem 0; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.score { font-size: 2.4rem; font-weight: 800; margin: 0.2rem 0; }
.score span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.score-good { color: var(--good); }
.score-warn { color: var(--warn); }
.score-bad { color: var(--bad); }

.badge-good { background: rgba(48, 209, 88, 0.18); color: #4cd964; }
.badge-warn { background: rgba(255, 159, 10, 0.2); color: #ffb340; }
.badge-bad { background: rgba(255, 69, 58, 0.16); color: #ff6961; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Exposure bars */
.bar-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0; }
.bar-label { width: 90px; font-size: 0.9rem; color: var(--muted); }
.bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-btc { background: #f7931a; }
.bar-eth { background: #6f7cff; }
.bar-alt { background: #e2a03f; }
.bar-stable { background: #30a46c; }
.bar-val { width: 44px; text-align: right; font-size: 0.9rem; }

.findings { margin: 0.5rem 0; padding-left: 1.2rem; color: var(--text); }
.findings li { margin: 0.3rem 0; font-size: 0.92rem; }
.crypto-verdict {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
}
.callout-inline {
  margin-top: 1rem; padding: 0.7rem 0.9rem;
  background: var(--surface-2); border-radius: 8px;
  font-size: 0.9rem; color: var(--muted);
}

/* Forms extras */
.select, .textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
}
.form .select { margin-bottom: 0.2rem; }
.row-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.wide { max-width: 560px; }

.callout {
  margin-top: 1.2rem; padding: 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem;
}
.callout ol { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.callout li { margin: 0.3rem 0; }

/* Chat */
.chat-grid { align-items: start; }
.chat-grid-single { max-width: 760px; margin: 0 auto; }
.chat-card { display: flex; flex-direction: column; }
.chat-window {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 320px;
  max-height: 460px;
  overflow-y: auto;
  margin: 1rem 0;
}
.chat-empty { color: var(--muted); font-size: 0.92rem; }
.chat-empty ul { padding-left: 1.2rem; }
.msg { display: flex; margin: 0.5rem 0; }
.msg-user { justify-content: flex-end; }
.bubble {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.4;
}
.msg-user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.msg-assistant .bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.bubble strong { font-weight: 700; }
.bubble.typing { display: inline-flex; gap: 4px; align-items: center; padding: 0.7rem 0.9rem; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: chat-typing 1.2s infinite ease-in-out both;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-typing {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.chat-form input:disabled { opacity: 0.6; }
.chat-form { display: flex; gap: 0.5rem; }
.chat-form input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem; color: var(--text); font-size: 1rem; }

.score-result {
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
  text-align: center;
}
.score-result .findings { text-align: left; }

.disclaimer { max-width: 700px; margin: 0 auto 0.5rem; font-size: 0.8rem; color: var(--muted); }

/* ===== Live Market ===== */
.market-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-areas:
    "list signal"
    "chart chart";
  gap: 1rem;
  align-items: start;
}
.market-layout > .market-list { grid-area: list; }
.market-layout > .market-chart { grid-area: chart; }
.market-layout > .market-signal { grid-area: signal; }
/* Allow grid items to shrink below their content's min-content width so the
   coin table (nowrap cells) never forces the card wider than the screen. */
.market-layout > .market-list,
.market-layout > .market-chart,
.market-layout > .market-signal { min-width: 0; }
@media (max-width: 800px) {
  .market-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "list"
      "chart"
      "signal";
  }
}

.market-list { padding: 0.6rem; }
.market-list-head,
.coin-table td { font-size: 0.85rem; }
.market-list-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr 0.8fr;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.market-list-scroll { max-height: 620px; overflow-y: auto; }
.coin-table { width: 100%; border-collapse: collapse; }
.coin-row { cursor: pointer; transition: background 0.12s; }
.coin-row td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.coin-row:hover { background: var(--surface-2); }
.coin-row.active { background: rgba(10, 132, 255, 0.18); }
.coin-row td:first-child { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.8fr; }
.coin-table tr { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.8fr; }
.coin-name { font-weight: 600; }
.coin-pair { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.coin-price, .coin-vol { text-align: right; font-variant-numeric: tabular-nums; }
.coin-chg { text-align: right; font-variant-numeric: tabular-nums; }
.coin-vol { color: var(--muted); }

.market-chart { display: flex; flex-direction: column; min-height: 520px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.chart-symbol { margin: 0; font-size: 1.3rem; }
.tf-group { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tf-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chart-canvas { flex: 1; min-height: 460px; width: 100%; }

.market-signal { max-height: none; }
.signal-panel.loading { opacity: 0.6; }
.signal-head { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.8rem; }
.signal-gauge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid var(--border); flex-shrink: 0;
}
.signal-gauge .signal-label { font-size: 0.72rem; letter-spacing: 0.05em; }
.signal-gauge .signal-score { font-size: 1.5rem; font-weight: 800; }
.signal-good { border-color: var(--good); color: var(--good); }
.signal-bad { border-color: var(--bad); color: var(--bad); }
.signal-warn { border-color: var(--warn); color: var(--warn); }
.signal-meta { flex: 1; }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 0.2rem 0; }
.meter-fill { height: 100%; border-radius: 999px; }
.meter-good { background: var(--good); }
.meter-bad { background: var(--bad); }
.meter-warn { background: var(--warn); }
.signal-summary { font-size: 0.92rem; margin: 0.6rem 0; }

.h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; }
.setup-box { background: var(--surface-2); border-radius: 8px; padding: 0.8rem; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
.setup-grid div { display: flex; flex-direction: column; }
.setup-grid b { font-variant-numeric: tabular-nums; }

.factors { display: flex; flex-direction: column; gap: 0.4rem; }
.factor-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
}
.factor-label { font-size: 0.85rem; }
.factor-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.factor-fill { height: 100%; border-radius: 999px; }
.factor-good { background: var(--good); }
.factor-bad { background: var(--bad); }
.factor-warn { background: var(--warn); }
.factor-detail { font-size: 0.78rem; }

/* ===== Plain-language signal verdict (beginner-friendly) ===== */
.verdict {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.verdict-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.verdict-title { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.verdict-dir { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.verdict-go-strong { border-color: var(--good); background: rgba(48, 209, 88, 0.1); }
.verdict-go-strong .verdict-icon { background: var(--good); }
.verdict-go { border-color: var(--good); background: rgba(48, 209, 88, 0.06); }
.verdict-go .verdict-icon { background: var(--good); }
.verdict-wait { border-color: var(--warn); background: rgba(255, 159, 10, 0.08); }
.verdict-wait .verdict-icon { background: var(--warn); }
.verdict-avoid { border-color: var(--bad); background: rgba(255, 69, 58, 0.08); }
.verdict-avoid .verdict-icon { background: var(--bad); }

.verdict-explain { font-size: 0.95rem; margin: 0.8rem 0 0.6rem; line-height: 1.5; }
.verdict-crypto {
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.85rem;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  color: var(--text);
}
.verdict-event {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.85rem;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  color: var(--text);
}
.verdict-action {
  font-size: 0.92rem;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.plan-box {
  margin-top: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.plan-title { font-size: 0.98rem; font-weight: 700; margin: 0 0 0.7rem; }
.plan-steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.plan-step { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.plan-step:first-child { padding-top: 0; }
.plan-step:last-child { border-bottom: none; padding-bottom: 0; }
.plan-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.plan-step-name { font-weight: 700; font-size: 0.92rem; }
.plan-step-price { font-variant-numeric: tabular-nums; font-size: 1rem; white-space: nowrap; }
.plan-loss { color: var(--bad); }
.plan-win { color: var(--good); }
/* Distance-from-entry badge: the part a beginner reads to see, at a glance,
   that stop and target are clearly separated from the entry. */
.plan-gap {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 980px;
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.plan-gap-entry { background: var(--surface-3); color: var(--muted); }
.plan-gap-loss { background: rgba(255, 69, 58, 0.15); color: var(--bad); }
.plan-gap-win { background: rgba(48, 209, 88, 0.15); color: var(--good); }
.plan-step-desc { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.plan-summary {
  margin: 0.8rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tech-details {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}
.tech-details > summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
.tech-details > summary::-webkit-details-marker { display: none; }
.tech-details > summary::before { content: '▸ '; }
.tech-details[open] > summary::before { content: '▾ '; }
.tech-details > summary:hover { color: var(--text); }
.tech-body { margin-top: 0.7rem; }
.tech-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.tech-row .meter { flex: 1; }
.disclaimer { margin-top: 0.9rem; color: var(--muted); }

/* ===== Opportunity Scanner ===== */
.scanner-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.scanner-intro { margin-bottom: 1rem; }
.scanner-intro p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.scanner-filters { display: flex; gap: 0.3rem; align-items: center; }
.filter-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.scanner-table th { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.scanner-table td { font-size: 0.88rem; vertical-align: middle; }
#scan-body.loading { opacity: 0.55; }
.scan-row { cursor: pointer; transition: background 0.12s; }
.scan-row:hover { background: var(--surface-2); }

.scan-score-cell { display: flex; align-items: center; gap: 0.45rem; min-width: 110px; }
.scan-bar { flex: 1; height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.scan-bar-fill { height: 100%; border-radius: 999px; }
.scan-good { background: var(--good); }
.scan-bad { background: var(--bad); }
.scan-warn { background: var(--warn); }

/* ===== Signal quality (research-backed) ===== */
.quality-banner {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.quality-top { display: flex; align-items: center; gap: 0.6rem; }
.quality-tier {
  font-weight: 800;
  font-size: 1.1rem;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
}
.quality-label { font-weight: 700; }
.quality-reason { margin: 0.4rem 0 0; color: var(--muted); }
.quality-banner.tier-a { border-color: var(--ok); background: rgba(34, 197, 94, 0.08); }
.quality-banner.tier-a .quality-tier { background: var(--ok); }
.quality-banner.tier-b { border-color: var(--good); background: rgba(132, 204, 22, 0.07); }
.quality-banner.tier-b .quality-tier { background: var(--good); }
.quality-banner.tier-c { border-color: var(--warn); background: rgba(234, 179, 8, 0.06); }
.quality-banner.tier-c .quality-tier { background: var(--warn); }
.quality-banner.tier-avoid { border-color: var(--border); }
.quality-banner.tier-avoid .quality-tier { background: var(--muted); }

/* Scanner quality tier badge */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
}
.tier-badge.tier-a { background: var(--ok); }
.tier-badge.tier-b { background: var(--good); }
.tier-badge.tier-c { background: var(--warn); color: #1a1a1a; }
.tier-badge.tier-wait,
.tier-badge.tier-avoid { background: var(--surface-2); color: var(--muted); }

/* ===== Landing: 3 steps (beginner-friendly) ===== */
.section-title {
  text-align: center;
  font-size: 1.9rem;
  margin: 0 0 1.8rem;
  letter-spacing: -0.03em;
}
.steps { margin: 1rem 0 2.5rem; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.step-num {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { margin: 0 0 0.5rem; font-size: 1.18rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.5; }

/* ===== Language selector (Apple segmented control) ===== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 980px;
  padding: 2px;
  margin-left: 0.4rem;
}
.lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.28rem 0.55rem;
  border-radius: 980px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-opt:hover { color: var(--text); opacity: 1; }
.lang-opt.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== Profile menu (collapses secondary nav for simplicity) ===== */
.profile-menu {
  position: relative;
  margin-left: 0.4rem;
}
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem 0.25rem 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 980px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.profile-btn:hover { background: var(--surface-3); }
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}
.profile-caret {
  color: var(--muted);
  transition: transform 0.2s ease;
}
.profile-menu.open .profile-caret { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 60;
}
.profile-menu.open .profile-dropdown { display: flex; }
.profile-name {
  padding: 0.5rem 0.7rem 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s ease;
}
.profile-item:hover {
  background: var(--surface-2);
  text-decoration: none;
  opacity: 1;
}
.profile-logout { color: var(--bad); }
.profile-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 4px;
}
.profile-lang {
  display: flex;
  gap: 4px;
  padding: 0.3rem 0.5rem;
}
.profile-lang .lang-opt { flex: 1; }

/* ===== Mobile nav toggle ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .navbar { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-top: 0.6rem;
    margin-top: 0.6rem;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { width: 100%; justify-content: flex-start; }
  .nav-links .inline-form { display: block; }
  .nav-links .inline-form .btn { width: 100%; }
  .lang-switch { margin: 0.4rem 0 0; align-self: flex-start; }

  /* On mobile the profile menu expands inline (no floating dropdown). */
  .profile-menu { width: 100%; margin: 0.4rem 0 0; }
  .profile-btn { display: none; }
  .profile-dropdown {
    position: static;
    display: flex;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 0.4rem 0;
    margin-top: 0.4rem;
  }
  .profile-name { display: none; }
}

/* ============================================================
   MODERN LANDING PAGE (crypto-grade)
   ============================================================ */
.lp {
  position: relative;
  overflow: hidden;
}
.lp .btn-lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; }

/* ---- Hero ---- */
.lp-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 3rem;
  padding: 4.5rem 0 4rem;
}
.lp-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}
.lp-glow-1 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.55), transparent 70%);
  top: -120px; left: -140px;
}
.lp-glow-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.5), transparent 70%);
  bottom: -160px; right: -120px;
}
.lp-hero-copy { position: relative; z-index: 2; }

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lp-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6);
  animation: lp-pulse 2s infinite;
}
@keyframes lp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.lp-title {
  font-size: clamp(2.6rem, 5.5vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 1.2rem 0 1.1rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-lead {
  font-size: 1.22rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 33ch;
  margin: 0 0 2rem;
}
.lp-lead strong { color: var(--text); font-weight: 600; }

.lp-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.lp-trust {
  display: flex; gap: 1.3rem; flex-wrap: wrap;
  margin-top: 1.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.lp-trust-item { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.lp-ico-check { width: 15px; height: 15px; color: var(--good); flex-shrink: 0; }

/* ---- Product preview mockup ---- */
.lp-hero-visual { position: relative; z-index: 2; }
.lp-preview {
  position: relative;
  z-index: 2;
  background: linear-gradient(165deg, rgba(40, 40, 44, 0.9), rgba(20, 20, 23, 0.92));
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  transition: transform 0.4s ease;
}
.lp-preview:hover { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg); }
.lp-preview-shadow {
  position: absolute;
  inset: 12% 6% -8% 6%;
  background: var(--grad);
  filter: blur(60px);
  opacity: 0.3;
  z-index: 1;
  border-radius: 30px;
}
.lp-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.lp-preview-coin { display: flex; align-items: center; gap: 0.7rem; }
.lp-coin-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f7931a, #ffb347);
  color: #1a1300; font-size: 1.3rem; font-weight: 800;
}
.lp-coin-icon svg { width: 26px; height: 26px; }
.lp-preview-coin strong { font-size: 1.05rem; display: block; }
.lp-preview-sub { font-size: 0.78rem; color: var(--muted); }
.lp-quality-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: 999px;
  background: rgba(48, 209, 88, 0.14);
  border: 1px solid rgba(48, 209, 88, 0.35);
  color: #4cd964; font-size: 0.82rem; font-weight: 700;
}
.lp-tier {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--good); color: #06310f; font-weight: 800; font-size: 0.82rem;
}

.lp-preview-chart {
  display: flex; align-items: flex-end; gap: 5px;
  height: 110px; padding: 0.5rem 0;
  margin-bottom: 1.1rem;
}
.lp-bar {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(to top, rgba(10, 132, 255, 0.25), var(--primary));
  animation: lp-grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.lp-bar:nth-child(odd) { background: linear-gradient(to top, rgba(94, 92, 230, 0.25), var(--accent-2)); }
.lp-bar:last-child { background: linear-gradient(to top, rgba(48, 209, 88, 0.3), var(--good)); }
@keyframes lp-grow { from { height: 0 !important; opacity: 0; } }

.lp-preview-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem; margin-bottom: 1rem;
}
.lp-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.lp-stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lp-stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-preview-reason {
  margin: 0; font-size: 0.9rem; color: var(--muted);
  font-style: italic; line-height: 1.45;
  border-left: 2px solid var(--border-strong); padding-left: 0.8rem;
}

/* ---- Stats strip ---- */
.lp-stats-strip {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0 4rem;
}
.lp-statbox { text-align: center; }
.lp-statbox-num {
  display: block;
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-statbox-label { font-size: 0.9rem; color: var(--muted); }

/* ---- Sections ---- */
.lp-section { position: relative; z-index: 2; padding: 1rem 0 4rem; text-align: center; }
.lp-eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 0.7rem;
}
.lp-section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  letter-spacing: -0.03em;
  margin: 0 0 2.4rem;
}

/* ---- Steps ---- */
.lp-steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem; text-align: left;
}
.lp-step {
  position: relative;
  background: linear-gradient(165deg, var(--surface), rgba(28, 28, 30, 0.6));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.lp-step:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.lp-step-num {
  width: 2.8rem; height: 2.8rem; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(10, 132, 255, 0.35);
  margin-bottom: 1.1rem;
}
.lp-step h3 { margin: 0 0 0.5rem; font-size: 1.2rem; letter-spacing: -0.02em; }
.lp-step p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 0.98rem; }
.lp-independence {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0.65;
  margin: 1.2rem auto 0;
  max-width: 680px;
  line-height: 1.5;
}
.lp-referral-disclosure {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
  margin: 0.5rem auto 0;
  max-width: 680px;
  line-height: 1.5;
}
.bitget-independence {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* ---- Bento features ---- */
.lp-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  text-align: left;
}
.lp-card {
  position: relative;
  background: linear-gradient(165deg, var(--surface), rgba(28, 28, 30, 0.55));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.lp-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at top right, rgba(10, 132, 255, 0.1), transparent 60%);
  opacity: 0; transition: opacity 0.3s ease;
}
.lp-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.lp-card:hover::before { opacity: 1; }
.lp-card-wide { grid-column: span 2; }
.lp-card-icon {
  width: 3rem; height: 3rem; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  margin-bottom: 1.1rem;
  color: var(--accent-3);
}
.lp-card-icon svg { width: 26px; height: 26px; }
.lp-card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; letter-spacing: -0.02em; position: relative; }
.lp-card p { margin: 0; color: var(--muted); line-height: 1.55; position: relative; }

/* ---- Final CTA ---- */
.lp-cta {
  position: relative;
  text-align: center;
  padding: 4rem 2rem;
  margin: 1rem 0 4rem;
  border-radius: 28px;
  background: linear-gradient(165deg, rgba(40, 40, 46, 0.7), rgba(18, 18, 22, 0.85));
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.lp-cta-glow {
  position: absolute; top: -60%; left: 50%; transform: translateX(-50%);
  width: 620px; height: 420px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.35), transparent 65%);
  filter: blur(70px); z-index: 0; pointer-events: none;
}
.lp-cta h2 {
  position: relative; z-index: 2;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -0.03em; margin: 0 0 1rem;
}
.lp-cta p {
  position: relative; z-index: 2;
  color: var(--muted); max-width: 620px; margin: 0 auto 1.8rem; line-height: 1.6; font-size: 1.05rem;
}
.lp-cta p strong { color: var(--text); }
.lp-cta .btn { position: relative; z-index: 2; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 0; text-align: center; }
  .lp-lead { max-width: 100%; }
  .lp-actions, .lp-trust { justify-content: center; }
  .lp-preview { transform: none; max-width: 440px; margin: 0 auto; }
  .lp-preview:hover { transform: none; }
  .lp-steps, .lp-bento { grid-template-columns: 1fr; }
  .lp-card-wide { grid-column: span 1; }
}
@media (max-width: 560px) {
  .lp-stats-strip { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
  .lp-trust { gap: 0.8rem 1.1rem; font-size: 0.84rem; }
}

/* ============================================================
   APP INTERIOR — modern polish (matches the landing aesthetic)
   Enhances the shared components used across every signed-in page
   (dashboard, market, scanner, chat, backtest, auth, admin, etc.)
   ============================================================ */

/* ---- Page header: eyebrow-style gradient title ---- */
.page-head {
  align-items: flex-end;
  margin: 0.4rem 0 1.7rem;
  gap: 1rem;
  position: relative;
}
.page-head h1 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.page-head .muted { line-height: 1.4; }

/* ---- Cards: soft gradient surface + hover lift ---- */
.card {
  background: linear-gradient(165deg, rgba(44, 44, 50, 0.5), rgba(20, 20, 24, 0.72));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}
/* Only lift cards that are interactive containers (not auth/form shells) */
.grid-2 > .card:hover,
.market-list:hover,
.market-signal:hover {
  border-color: var(--border-strong);
}

/* ---- Section headings inside cards ---- */
.h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.1rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.h2::before {
  content: "";
  width: 3px;
  height: 1rem;
  border-radius: 999px;
  background: var(--grad);
  flex-shrink: 0;
}

/* ---- Stat cards: gradient accent bar + big numbers ---- */
.stat {
  overflow: hidden;
  padding-top: 1.5rem;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.95;
}
.stat .info-label {
  font-size: 0.72rem;
  font-weight: 600;
}
.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.score { font-variant-numeric: tabular-nums; }

/* ---- Auth pages: centered card with a glow halo ---- */
.auth-card {
  position: relative;
  margin: 3.5rem auto;
  padding: 2.2rem;
  z-index: 1;
}
.auth-card::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 320px;
  background: radial-gradient(
    circle at 50% 0,
    rgba(10, 132, 255, 0.28),
    transparent 65%
  );
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}
.auth-card h1 {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.3rem;
}

/* Legal checkbox in register form */
.legal-check-group {
  margin: 0.9rem 0 0.2rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.legal-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}
.legal-check-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--primary);
  cursor: pointer;
}
.legal-check-label a { color: var(--primary); text-decoration: underline; }
.legal-check-label strong { color: var(--text); }

/* Password security note */
.auth-security-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 0.8rem 0 0;
  opacity: 0.75;
}
.verify-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  text-align: center;
}
.verify-small {
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

/* ---- Forms: rounder, clearer focus ---- */
.form input,
.select,
.textarea {
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.22);
}

/* ---- Tables: refined header + smooth row hover ---- */
.table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table td { font-variant-numeric: tabular-nums; }

/* ---- Badges: a touch more presence ---- */
.badge {
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.2rem 0.6rem;
  letter-spacing: 0.01em;
}

/* ---- Callouts ---- */
.callout,
.callout-inline {
  background: linear-gradient(165deg, rgba(44, 44, 50, 0.45), rgba(20, 20, 24, 0.6));
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ---- Exposure bars: gradient fills (width set via JS, CSP-safe) ---- */
.bar { height: 12px; }
.bar-fill {
  background-size: 100% 100%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Timeframe / filter pills: active uses brand gradient ---- */
.tf-btn,
.filter-btn {
  border-radius: 9px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.tf-btn.active,
.filter-btn.active {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}

/* ---- Small static-style helpers (replaces CSP-blocked inline styles) ---- */
.chart-canvas-sm { min-height: 300px; }
.scanner-tf-label { align-self: center; margin-right: 0.4rem; }

/* ---- Refresh / ghost action button in headers ---- */
.page-head .btn-small {
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.page-head .btn-small:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

/* ---- Scroll reveal: elements fade/slide in as they enter the viewport ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger children when several reveal at once */
.reveal[data-reveal-delay="1"] { transition-delay: 0.06s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.12s; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.18s; }
.reveal[data-reveal-delay="4"] { transition-delay: 0.24s; }
.reveal[data-reveal-delay="5"] { transition-delay: 0.30s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Skeleton loading shimmer ---- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 8px;
  color: transparent !important;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: cc-shimmer 1.3s infinite;
}
.skeleton-row {
  height: 14px;
  margin: 0.55rem 0;
}
.skeleton-row.w-60 { width: 60%; }
.skeleton-row.w-40 { width: 40%; }
.skeleton-row.w-80 { width: 80%; }
@keyframes cc-shimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ============================================================
   Dashboard — redesign
   ============================================================ */

/* Header */
.db-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.db-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.2rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.db-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }
.db-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* KPI strip */
.db-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.db-kpi {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.2rem 1.2rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.db-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(10,132,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.db-kpi:hover { border-color: rgba(10,132,255,0.35); }
.db-kpi-bad { border-color: rgba(255,69,58,0.3); }
.db-kpi-bad::before { background: linear-gradient(135deg, rgba(255,69,58,0.08) 0%, transparent 60%); }
.db-kpi-warn { border-color: rgba(255,159,10,0.3); }
.db-kpi-warn::before { background: linear-gradient(135deg, rgba(255,159,10,0.08) 0%, transparent 60%); }

.db-kpi-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(10,132,255,0.12);
  color: var(--primary);
  margin-top: 0.1rem;
}
.db-kpi-bad .db-kpi-icon  { background: rgba(255,69,58,0.12);  color: var(--bad); }
.db-kpi-warn .db-kpi-icon { background: rgba(255,159,10,0.12); color: var(--warn); }

.db-kpi-body { display: flex; flex-direction: column; gap: 0.25rem; }
.db-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.db-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}
.db-kpi-unit { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.db-kpi-meta { font-size: 0.78rem; color: var(--muted); }

/* Fear & Greed dynamic color — applied via JS */
.db-fg-value { /* color set by app.js via el.style */ }
.db-fg-label { font-size: 0.78rem; font-weight: 600; /* color set by app.js */ }

/* Fear & Greed gauge card — wider, centred */
.db-kpi-fg {
  justify-content: center;
}
.db-kpi-body-full {
  width: 100%;
  align-items: center;
}
.fg-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.3rem;
}
.fg-gauge-svg {
  width: 110px;
  height: auto;
  overflow: visible;
}
.fg-needle {
  transform-origin: 60px 60px;
  /* rotation set by JS */
}
.fg-gauge-num {
  font-family: ui-monospace, monospace;
}
.fg-gauge-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Cryptonidas verdict */
.db-verdict {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
}
.db-verdict-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Middle row */
.db-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 760px) { .db-mid { grid-template-columns: 1fr; } }

/* Section title (used inside cards) */
.db-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}
.db-section-title svg { opacity: 0.7; flex-shrink: 0; }

/* Exposure bars */
.db-bar-row { margin-bottom: 0.9rem; }
.db-bar-row:last-of-type { margin-bottom: 0; }
.db-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.db-bar-label { font-size: 0.85rem; color: var(--text); font-weight: 500; }
.db-bar-pct   { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.db-bar-track {
  height: 7px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.db-lev-info {
  display: flex;
  gap: 1.2rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.db-lev-info strong { color: var(--text); }

/* Risk findings */
.db-findings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.db-finding-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.db-finding-dot { flex-shrink: 0; color: var(--bad); margin-top: 0.45em; }
.db-no-findings { font-size: 0.9rem; color: var(--muted); margin: 0; font-style: italic; }
.db-fg-note {
  margin: 1rem 0 0;
  padding: 0.65rem 0.8rem;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--muted);
}

/* Actions row */
.db-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  align-items: center;
}

/* Mono numbers in table */
.mono { font-variant-numeric: tabular-nums; font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.88rem; }

/* ============================================================
   Trading Journal
   ============================================================ */
.journal-intro { margin-bottom: 1.4rem; }
.journal-intro p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.journal-section { margin: 2rem 0; }
.journal-section .section-title {
  text-align: left;
  font-size: 1.3rem;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.subsection-title {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.25rem;
  letter-spacing: -0.01em;
}
.journal-hint { margin: 0 0 0.9rem; }

/* ---- Stat cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-value.pos { color: var(--good); }
.stat-value.neg { color: var(--bad); }

/* ---- Add-trade form ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.field-wide { grid-column: 1 / -1; }
.field-label {
  color: var(--muted);
  font-size: 0.82rem;
}
.journal-form input,
.journal-form select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  width: 100%;
}
.journal-form input:focus,
.journal-form select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

/* ---- Side & result badges ---- */
.side-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}
.side-badge.side-long { background: rgba(48, 209, 88, 0.16); color: var(--good); }
.side-badge.side-short { background: rgba(255, 69, 58, 0.16); color: var(--bad); }

.result-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}
.result-badge.res-win { background: rgba(48, 209, 88, 0.16); color: var(--good); }
.result-badge.res-loss { background: rgba(255, 69, 58, 0.16); color: var(--bad); }

/* ---- Source badge (system vs manual) ---- */
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.source-badge.source-system { background: rgba(10, 132, 255, 0.18); color: var(--primary-hover); }
.source-badge.source-manual { background: var(--surface-2); color: var(--muted); }

.coin-cell { font-weight: 700; }

/* ---- Row actions (close + delete) ---- */
.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.close-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.close-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  width: 110px;
}
.close-input:focus {
  outline: none;
  border-color: var(--primary);
}

.journal-disclaimer { margin-top: 1.5rem; }

/* ---- One-click "log this signal" CTA (market signal panel) ---- */
.journal-cta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.btn-journal { width: 100%; }
.btn-journal-done {
  background: rgba(48, 209, 88, 0.16) !important;
  color: var(--good) !important;
  box-shadow: none !important;
  cursor: default;
}
.journal-cta-hint { margin: 0.55rem 0 0; line-height: 1.45; }
.journal-cta-msg { margin: 0.5rem 0 0; font-size: 0.88rem; }
.journal-cta-msg.ok { color: var(--good); }
.journal-cta-msg.ok a { color: var(--good); font-weight: 700; }
.journal-cta-msg.err { color: var(--bad); }

/* ---- System Lab (paper-trading bot, admin-only) ---- */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.lab-intro p { margin: 0 0 0.5rem; }
.lab-intro p:last-child { margin-bottom: 0; }

/* CSS-only mode tabs (Safe / Scalper) — no JS, CSP compliant */
.lab-mode-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.lab-mode-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}
.lab-mode-btn {
  padding: 0.6rem 1.3rem;
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  user-select: none;
}
.lab-mode-btn:hover { color: var(--text); }
.lab-panel { display: none; }
#lab-mode-safe:checked ~ .lab-panel-safe { display: block; }
#lab-mode-scalp:checked ~ .lab-panel-scalp { display: block; }
#lab-mode-safe:checked ~ .lab-mode-nav .lab-mode-btn-safe,
#lab-mode-scalp:checked ~ .lab-mode-nav .lab-mode-btn-scalp {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.lab-mode-radio:focus-visible ~ .lab-mode-nav .lab-mode-btn {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.lab-panel-scalp .lab-scalp { margin-top: 0; }

/* Live "demo-account" view: LIVE badge, pulsing dot, price/PnL flash */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ok);
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.3);
}
.live-badge.live-off {
  color: var(--muted);
  background: rgba(152, 152, 157, 0.12);
  border-color: rgba(152, 152, 157, 0.3);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6);
  animation: live-pulse 1.6s ease-out infinite;
}
.live-badge.live-off .live-dot {
  background: var(--muted);
  animation: none;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}
.live-price-cell { font-variant-numeric: tabular-nums; }
.live-pnl-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.live-flash-up { animation: live-flash-up 0.8s ease-out; }
.live-flash-down { animation: live-flash-down 0.8s ease-out; }
@keyframes live-flash-up {
  0% { background: rgba(48, 209, 88, 0.28); }
  100% { background: transparent; }
}
@keyframes live-flash-down {
  0% { background: rgba(255, 69, 58, 0.28); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .live-flash-up, .live-flash-down { animation: none; }
}
.tf-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 0.78rem;
}
.reason-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.76rem;
  background: var(--surface-2);
  color: var(--muted);
}
.reason-badge.reason-target { background: rgba(48, 209, 88, 0.16); color: var(--good); }
.reason-badge.reason-stop { background: rgba(255, 69, 58, 0.16); color: var(--bad); }
.reason-badge.reason-timeout { background: rgba(255, 159, 10, 0.16); color: var(--warn, #ff9f0a); }

