/* PropLens — liquid-glass dark theme.
   Data palette validated (dataviz): #3987e5 #199e70 #c98500 #e66767 on dark surfaces. */
:root {
  --page: #0a0b10;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.10);
  --ink: #ffffff;
  --ink-2: #c6c6cf;
  --muted: #9a9aa8;  /* lifted from #8b8b96 for WCAG AA contrast on glass surfaces */
  --grid: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.14);
  --blue: #3987e5;
  --violet: #9085e9;
  --aqua: #199e70;
  --amber: #c98500;
  --red: #e66767;
  --good: #0ca30c;
  --brand-grad: linear-gradient(135deg, #3987e5, #9085e9);
  --radius: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink-2);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1 { color: var(--ink); font: 700 24px/1.2 var(--display); margin: 0 0 6px; letter-spacing: -0.015em; }
p { margin: 0; }
b { color: var(--ink); }

/* ---------- aurora backdrop (gives the glass something to refract) ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(90px); opacity: 0.4;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora .a1 { width: 640px; height: 640px; left: -160px; top: -220px;
  background: radial-gradient(circle, rgba(57, 135, 229, 0.55), transparent 65%); }
.aurora .a2 { width: 560px; height: 560px; right: -140px; top: 12%;
  background: radial-gradient(circle, rgba(144, 133, 233, 0.42), transparent 65%);
  animation-delay: -9s; }
.aurora .a3 { width: 700px; height: 700px; left: 28%; bottom: -320px;
  background: radial-gradient(circle, rgba(25, 158, 112, 0.30), transparent 65%);
  animation-delay: -17s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
  * { animation-duration: 0.001s !important; transition: none !important; }
}

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---------- the glass material ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

/* ---------- sidebar ---------- */
.side {
  width: 224px; flex: 0 0 224px;
  border-right: 1px solid var(--glass-border);
  border-top: none; border-left: none; border-bottom: none;
  border-radius: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 20px 12px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-mark { filter: drop-shadow(0 2px 10px rgba(57, 135, 229, 0.45)); flex: 0 0 auto; }
.brand-name { color: var(--ink); font: 700 18px var(--display); letter-spacing: -0.02em; }
.brand-name span {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--muted); font-size: 10.5px; letter-spacing: 0.02em; }
#nav { display: flex; flex-direction: column; gap: 3px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; color: var(--ink-2);
  font: 500 13.5px var(--sans); text-align: left;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-btn span { color: var(--muted); width: 16px; text-align: center; transition: color 0.15s; }
.nav-btn:hover { background: var(--glass-2); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(57, 135, 229, 0.22), rgba(144, 133, 233, 0.16));
  border-color: rgba(57, 135, 229, 0.35);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.nav-btn.active span { color: var(--blue); }
.nav-btn .tag {
  margin-left: auto; font: 600 9px var(--sans); font-style: normal; letter-spacing: 0.06em;
  background: var(--brand-grad); color: #fff; border-radius: 99px; padding: 2px 6px;
}
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--glass-border); }
.side-meta { color: var(--muted); font-size: 11px; margin-top: 6px; }
.side-meta .ok { color: var(--good); }
.side-meta .warn { color: var(--amber); }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 28px 32px 44px; max-width: 1220px; }
.page-head { margin-bottom: 20px; max-width: 780px; }
.page-head p { color: var(--muted); }
.tab { display: none; }
.tab.active { display: block; animation: fadeUp 0.35s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.banner {
  background: rgba(230, 103, 103, 0.12); border: 1px solid rgba(230, 103, 103, 0.5);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  color: #f2cccc; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px;
  animation: fadeUp 0.25s ease;
}
.banner.good { background: rgba(12, 163, 12, 0.12); border-color: rgba(12, 163, 12, 0.5); color: #c4e8c4; }

/* ---------- cards & forms ---------- */
.card { border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.card:hover { border-color: rgba(255, 255, 255, 0.14); }
.card-title { color: var(--ink); font: 600 13.5px var(--display); margin-bottom: 12px; letter-spacing: 0.01em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 980px) {
  .grid2 { grid-template-columns: 1fr; }
  .side { width: 64px; flex-basis: 64px; }
  .brand div:last-child, .nav-btn { font-size: 0; }
  .nav-btn span { font-size: 15px; }
  .nav-btn .tag { display: none; }
  .side-foot { display: none; }
}

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 10px; flex: 1; min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; flex: 0 0 auto; }
input, select, textarea {
  background: rgba(0, 0, 0, 0.28); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font: 13.5px var(--sans);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(57, 135, 229, 0.22);
}
/* WCAG 2.4.7 Focus Visible — a clear keyboard-focus ring on every interactive
   element (mouse clicks stay clean via :focus-visible). */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
.nav-btn:focus-visible, .acct-chip:focus-visible, [tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid #7cb0f5;
  outline-offset: 2px;
  border-radius: 6px;
}
/* Skip-to-content link: hidden until keyboard-focused. */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 999;
  background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }
textarea { resize: vertical; line-height: 1.5; }
.row { display: flex; align-items: flex-end; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.controls label { margin-bottom: 0; max-width: 190px; }
.controls { align-items: flex-end; }
.dow label { margin-bottom: 6px; }

.btn {
  position: relative;
  background: var(--glass-2); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 17px; font: 600 13.5px var(--sans);
  cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.15s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px rgba(57, 135, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(57, 135, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.big { padding: 12px 28px; font-size: 15px; border-radius: 13px; }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.btn.loading { padding-left: 38px; }
.btn.loading::before {
  content: ""; position: absolute; left: 14px; top: 50%;
  width: 14px; height: 14px; margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--muted); font-size: 12px; }
.sticky-actions { margin-top: 4px; align-items: center; }

.ai-card { border-color: rgba(57, 135, 229, 0.35); }
.ai-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(57, 135, 229, 0.12); border: 1px solid rgba(57, 135, 229, 0.35);
  color: #bcd6f5; font-size: 13px;
  animation: fadeUp 0.3s ease;
}
.ai-chip {
  font: 600 11px var(--sans); font-style: normal; vertical-align: middle;
  background: var(--brand-grad); color: #fff; border-radius: 99px; padding: 3px 9px;
  margin-left: 8px; letter-spacing: 0.04em;
}
.placeholder { color: var(--muted); padding: 46px 0; text-align: center; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: 13px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  padding: 13px 15px;
  animation: fadeUp 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  transition: transform 0.18s, border-color 0.18s;
}
.tile:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.16); }
.tile:nth-child(1) { animation-delay: 0.02s; } .tile:nth-child(2) { animation-delay: 0.06s; }
.tile:nth-child(3) { animation-delay: 0.10s; } .tile:nth-child(4) { animation-delay: 0.14s; }
.tile:nth-child(5) { animation-delay: 0.18s; } .tile:nth-child(6) { animation-delay: 0.22s; }
.tile .t-label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; }
.tile .t-value { color: var(--ink); font: 650 22px var(--display); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .t-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tile.pos .t-value { color: #74c778; }
.tile.neg .t-value { color: var(--red); }

/* ---------- charts ---------- */
.chart-host { position: relative; }
.chart-card { animation: fadeUp 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; animation-delay: 0.1s; }
.chart-card h3 { color: var(--ink); font: 600 13.5px var(--display); margin: 0 0 4px; }
.chart-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.ct-lab { fill: var(--muted); font: 10.5px var(--sans); font-variant-numeric: tabular-nums; }
.ct-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; z-index: 5;
  background: rgba(24, 25, 34, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px; font-size: 12px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.ct-tip b { color: var(--ink); }
.ct-empty { color: var(--muted); text-align: center; padding: 30px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); text-align: right; font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { color: var(--ink-2); text-align: right; padding: 5.5px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td.pos { color: #74c778; }
td.neg { color: var(--red); }

/* ---------- prop firm browser ---------- */
.firm-search {
  display: flex; align-items: center; gap: 10px;
  border-radius: 13px; padding: 4px 14px; margin-bottom: 14px;
}
.firm-search .fs-icon { color: var(--muted); font-size: 17px; }
.firm-search input {
  background: none; border: none; box-shadow: none; padding: 10px 0;
  font-size: 14px;
}
.firm-search input:focus { box-shadow: none; }
.firm-groups { margin-bottom: 14px; }
.firm-group {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  padding: 12px 14px; margin-bottom: 10px;
  animation: fadeUp 0.3s ease backwards;
}
.firm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.firm-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font: 700 12.5px var(--display); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.firm-head .fh-name { color: var(--ink); font: 600 14px var(--display); }
.firm-head .fh-n { color: var(--muted); font-size: 11.5px; }
.acct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-chip {
  background: rgba(0, 0, 0, 0.25); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 13px; font: 500 12.5px var(--sans); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.acct-chip:hover { border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px); }
.acct-chip.sel {
  background: linear-gradient(135deg, rgba(57, 135, 229, 0.3), rgba(144, 133, 233, 0.22));
  border-color: var(--blue); color: var(--ink);
}
.acct-chip small { color: var(--muted); margin-left: 5px; }
.acct-chip.sel small { color: #bcd6f5; }

/* ---------- research ---------- */
.rs-status { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink-2); font-size: 13px; }
.orbit { position: relative; width: 26px; height: 26px; flex: 0 0 auto; display: inline-block; }
.orbit i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px;
  border-radius: 50%; background: var(--brand-grad);
  animation: orbit 1.3s linear infinite;
}
.orbit i:nth-child(2) { animation-delay: -0.43s; opacity: 0.75; }
.orbit i:nth-child(3) { animation-delay: -0.86s; opacity: 0.5; }
@keyframes orbit {
  from { transform: rotate(0deg) translateX(11px); }
  to   { transform: rotate(360deg) translateX(11px); }
}
#rsStatusText { animation: pulseText 1.6s ease-in-out infinite; }
@keyframes pulseText { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.report { line-height: 1.65; max-width: 860px; animation: fadeUp 0.4s ease; }
.report h2 { color: var(--ink); font: 600 16px var(--display); margin: 20px 0 8px; }
.report h3 { color: var(--ink); font: 600 14px var(--display); margin: 16px 0 6px; }
.report p { margin: 0 0 10px; }
.report ul, .report ol { margin: 0 0 10px; padding-left: 22px; }
.report li { margin-bottom: 3px; }
.report a { color: #7ab3f0; text-decoration: none; }
.report a:hover { text-decoration: underline; }
.report table { margin: 10px 0 14px; }
.report code { background: rgba(255, 255, 255, 0.07); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
.rs-meta { margin-top: 10px; max-width: 860px; }
.rs-meta a { color: #7ab3f0; text-decoration: none; }

/* ---------- code ---------- */
.code {
  border-radius: var(--radius);
  padding: 18px; overflow-x: auto; font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink-2); white-space: pre;
}
.kv div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--grid); }
.kv div span:first-child { color: var(--muted); }
.kv div span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }

.foot {
  margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--glass-border);
  color: var(--muted); font-size: 11.5px; max-width: 880px;
}

/* ---------- fix: [hidden] must always win (orbit loader was spinning while hidden) ---------- */
[hidden] { display: none !important; }

/* ---------- beginner tooltips ---------- */
.lt { display: inline-flex; align-items: center; gap: 5px; }
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  font: 600 9.5px var(--sans); font-style: normal;
  cursor: help; position: relative; flex: 0 0 auto;
}
.info:hover { color: var(--ink); border-color: var(--muted); }
.info::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(3px);
  width: 240px; padding: 9px 11px; border-radius: 10px;
  background: rgba(24, 25, 34, 0.97);
  border: 1px solid var(--line);
  color: var(--ink-2); font: 400 11.5px/1.5 var(--sans); white-space: normal;
  text-align: left; letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
  z-index: 30;
}
.info:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- research adjustments & variants ---------- */
.adj-item {
  display: flex; gap: 11px; align-items: flex-start;
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s;
}
.adj-item:hover { border-color: rgba(255, 255, 255, 0.3); }
.adj-item input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--blue); flex: 0 0 auto; }
.adj-body { display: flex; flex-direction: column; gap: 3px; }
.adj-title { color: var(--ink); font: 600 13.5px var(--display); }
.adj-why { color: var(--ink-2); font-size: 12.5px; }
.adj-patch { color: var(--muted); font: 11.5px ui-monospace, Menlo, monospace; }
.best-row td { background: rgba(57, 135, 229, 0.10); }
.btn.mini { padding: 4px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- help center ---------- */
.help-card { max-width: 760px; }
.help-chat {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 420px; min-height: 160px; overflow-y: auto; padding: 4px 2px;
}
.help-msg {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
  animation: fadeUp 0.25s ease;
}
.help-msg.bot {
  align-self: flex-start; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border); color: var(--ink-2);
  border-bottom-left-radius: 5px;
}
.help-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, rgba(57,135,229,0.4), rgba(144,133,233,0.3));
  border: 1px solid rgba(57, 135, 229, 0.4); color: var(--ink);
  border-bottom-right-radius: 5px;
}
.help-card a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- account chip ---------- */
.plan-chip {
  display: inline-block; background: var(--brand-grad); color: #fff;
  font: 600 9.5px var(--sans); border-radius: 99px; padding: 2px 8px;
  letter-spacing: 0.04em; margin-right: 4px;
}
#acctBox a { color: var(--muted); }
#acctBox b { font-weight: 500; color: var(--ink-2); word-break: break-all; }

/* ---------- app top bar ---------- */
.topbar-app {
  position: fixed; top: 18px; right: 22px; z-index: 40;
  display: flex; gap: 9px;
}
.tb-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; font: 500 14px var(--sans);
  border-radius: 50%;
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.tb-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.3); color: var(--ink); }

/* ---------- info popover ---------- */
.info-pop {
  position: fixed; top: 64px; right: 22px; z-index: 45;
  width: 340px; border-radius: 16px; padding: 18px;
  animation: fadeUp 0.22s ease;
}
.info-pop h4 { font: 600 15px var(--display); color: var(--ink); margin: 0 0 8px; }
.info-pop p { color: var(--ink-2); font-size: 12.5px; margin-bottom: 8px; }

/* ---------- account drawer ---------- */
.drawer-back {
  position: fixed; inset: 0; z-index: 44;
  background: rgba(5, 6, 10, 0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 46;
  width: 470px; max-width: calc(100vw - 24px);
  border-radius: 20px; padding: 20px;
  display: flex; flex-direction: column;
  animation: slideIn 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 19px var(--display);
  box-shadow: 0 4px 14px rgba(57,135,229,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.d-email { color: var(--ink); font: 600 14px var(--display); word-break: break-all; }
.d-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.drawer-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.d-tab {
  background: rgba(0,0,0,0.25); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 99px; padding: 6px 13px; font: 600 12px var(--sans); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.d-tab:hover { border-color: rgba(255,255,255,0.3); }
.d-tab.on {
  background: linear-gradient(135deg, rgba(57,135,229,0.3), rgba(144,133,233,0.22));
  border-color: var(--blue); color: var(--ink);
}
.drawer-body { overflow-y: auto; flex: 1; padding-right: 2px; }
.tiles.two { grid-template-columns: 1fr 1fr; }
.glass2 {
  background: rgba(0,0,0,0.22); border: 1px solid var(--line); border-radius: 12px;
}
.plan-row, .strat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.plan-row.cur { border-color: rgba(57,135,229,0.55); background: rgba(57,135,229,0.08); }
.quota { margin: 14px 2px 6px; }
.q-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.q-bar { height: 8px; border-radius: 99px; background: rgba(0,0,0,0.35); border: 1px solid var(--line); overflow: hidden; margin-bottom: 4px; }
.q-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; }
.act-list { display: flex; flex-direction: column; }
.act-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--grid); font-size: 12.5px;
}
.act-ico { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(57,135,229,0.15); border: 1px solid rgba(57,135,229,0.3); font-size: 12px; }
.act-lab { flex: 1; color: var(--ink-2); min-width: 0; }
.act-lab .hint { margin-left: 4px; }
.act-ts { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- automation tab ---------- */
.steps-mini { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps-mini li { margin-bottom: 7px; font-size: 13px; }
.auto-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.a-step { border-radius: 14px; padding: 16px; position: relative; }
.a-step .a-num {
  position: absolute; top: -10px; left: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 12.5px var(--display);
  box-shadow: 0 3px 10px rgba(57,135,229,0.5);
}
.a-step h3 { font: 600 14px var(--display); color: var(--ink); margin: 6px 0 6px; }
.a-step p { color: var(--ink-2); font-size: 12.5px; }
.warn-list { margin: 0; padding-left: 20px; color: var(--ink-2); }
.warn-list li { margin-bottom: 8px; font-size: 13px; }

/* ---------- eval copilot ---------- */
.light-card {
  display: flex; align-items: center; gap: 16px;
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
  animation: fadeUp 0.35s ease;
}
.light-card .l-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.light-card .l-title { color: var(--ink); font: 700 17px var(--display); margin-bottom: 3px; }
.light-card .l-advice { color: var(--ink-2); font-size: 13px; max-width: 640px; }
/* Multi-account dashboard */
.pro-pill { font: 700 11px var(--sans); background: var(--brand-grad); color: #fff;
  border-radius: 99px; padding: 2px 8px; vertical-align: middle; letter-spacing: .3px; }
.acct-agg { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.acct-agg .agg-tile { flex: 1; min-width: 120px; background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 14px 16px; }
.agg-val { font: 700 24px var(--display); color: var(--ink); }
.agg-lab { font-size: 12px; color: var(--muted); margin-top: 2px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.acct-card { padding: 16px 18px; }
.acct-card.failed { border-color: rgba(230,103,103,0.5); }
.acct-card.passed { border-color: rgba(12,163,12,0.45); }
.acct-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.acct-badge { font: 700 11px var(--sans); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.acct-badge.st-active { background: rgba(57,135,229,0.16); color: #9cc4f7; }
.acct-badge.st-pass { background: rgba(12,163,12,0.16); color: #7ede7e; }
.acct-badge.st-fail { background: rgba(230,103,103,0.16); color: #f2a3a3; }
.acct-bar-lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.acct-bar-lab b { color: var(--ink); }
.acct-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 5px; }
.acct-bar i { display: block; height: 100%; border-radius: 99px; }
.acct-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.acct-flag { font-size: 11px; color: var(--ink-2); background: rgba(255,255,255,0.06);
  border-radius: 99px; padding: 3px 9px; }
.acct-flag.warn { background: rgba(250,178,25,0.14); color: #f4cd78; }
.acct-log { margin-top: 14px; align-items: center; flex-wrap: wrap; }
.acct-log input[type=date] { max-width: 128px; }
.acct-log input[type=number] { max-width: 96px; min-width: 80px; }
.lock-panel { text-align: center; padding: 40px 24px; }
.lock-panel .lock-ico { font-size: 34px; }
.lock-panel h3 { color: var(--ink); font: 700 18px var(--display); margin: 8px 0 0; }
/* Edge-retention widget (backtest→live gap) */
.gap-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.gap-ring { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0); }
.gap-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: rgba(20,21,30,0.92); }
.gap-ring span { position: relative; font: 700 22px var(--display); color: var(--ink); }
.gap-ring span small { font-size: 12px; color: var(--muted); }
.gap-empty-ring { background: rgba(255,255,255,0.08); color: var(--muted); }
.gap-verdict { margin: 0; font-size: 13px; color: var(--ink-2); }
.gap-leak { margin-top: 12px; font-size: 12.5px; color: var(--ink-2);
  background: rgba(230,103,103,0.1); border: 1px solid rgba(230,103,103,0.3);
  border-radius: 9px; padding: 8px 11px; }
.gap-leak b { color: var(--ink); }
.gap-comps { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.gap-comp-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.gap-comp-top b { color: var(--ink); }
.gap-empty { text-align: center; }
.gap-empty .gap-ring { margin: 0 auto; }
/* Payout-gate rows (consistency rule + min days) */
.gate-row { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--ink-2); }
.gate-bar { position: relative; height: 8px; margin-top: 8px; border-radius: 99px;
  background: rgba(255,255,255,0.08); overflow: visible; }
.gate-bar i { display: block; height: 100%; border-radius: 99px; }
.gate-bar .gate-cap { position: absolute; top: -3px; width: 2px; height: 14px;
  background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.light-green { border-color: rgba(12,163,12,0.5); }
.light-green .l-dot { background: #0ca30c; box-shadow: 0 0 18px rgba(12,163,12,0.7); }
.light-yellow { border-color: rgba(250,178,25,0.5); }
.light-yellow .l-dot { background: #fab219; box-shadow: 0 0 18px rgba(250,178,25,0.7); }
.light-red { border-color: rgba(208,59,59,0.6); }
.light-red .l-dot { background: #d03b3b; box-shadow: 0 0 18px rgba(208,59,59,0.7); }
.firm-logo.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; display: inline-flex; vertical-align: middle; margin-right: 4px; }

/* ---------- replay trainer ---------- */
.rp-controls {
  display: flex; align-items: center; gap: 9px;
  border-radius: 14px; padding: 10px 12px; margin-top: 12px;
  flex-wrap: wrap;
}
.rp-spacer { flex: 1; }
.rp-controls .btn { padding: 8px 14px; }
.rp-bracket {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: 14px; padding: 9px 13px; margin-top: 10px;
}
.rp-bracket-lab { font: 600 12.5px var(--display); color: var(--ink); }
.rp-bracket label { display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 12px; color: var(--ink-2); }
.rp-bracket input[type=number] { width: 74px; padding: 5px 8px; }
.rp-bracket .hint { flex: 1 1 240px; min-width: 200px; }
.btn.rp-buy { border-color: rgba(25,158,112,0.6); color: #7fd6b4; }
.btn.rp-buy:hover { background: rgba(25,158,112,0.15); }
.btn.rp-sell { border-color: rgba(230,103,103,0.6); color: #f0a2a2; }
.btn.rp-sell:hover { background: rgba(230,103,103,0.15); }
.rp-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-badge {
  background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 13px; font: 600 12px var(--sans); color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rp-badge.pos-b { border-color: rgba(25,158,112,0.6); color: #7fd6b4; }
.rp-badge.neg-b { border-color: rgba(230,103,103,0.6); color: #f0a2a2; }

/* ---------- shimmer for standout results ---------- */
@keyframes shimmerSweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  position: relative; overflow: hidden;
}
.shimmer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.09) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmerSweep 2.6s ease-in-out 2;
}
tr.best-row td:first-child { position: relative; }

/* ---------- edge milestones ---------- */
.edge-ring {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; border-radius: 12px;
  padding: 8px 10px; margin: 10px 2px 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  transition: background 0.15s;
}
.edge-ring:hover { background: var(--glass-2); }
.edge-ring svg { flex: 0 0 auto; }
#ringArc { transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.7, 0.3, 1); }
.er-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
.er-val { display: block; color: var(--ink); font: 650 14px var(--display); }
.ms-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--grid); font-size: 13px;
}
.ms-row .ms-ico {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--muted);
}
.ms-row.done .ms-ico { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; }
.ms-row .ms-body { flex: 1; color: var(--ink-2); }
.ms-row.done .ms-body b { color: var(--ink); }

/* ---------- command palette ---------- */
.palette-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5,6,10,0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh;
}
.palette { width: 540px; max-width: calc(100vw - 32px); border-radius: 18px; padding: 12px; }
.palette input {
  background: rgba(0,0,0,0.3); font-size: 15px; padding: 12px 14px; margin-bottom: 8px;
}
#palList { max-height: 320px; overflow-y: auto; }
.pal-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px;
}
.pal-item:hover { background: rgba(255,255,255,0.05); }
.pal-item.on {
  background: linear-gradient(135deg, rgba(57,135,229,0.28), rgba(144,133,233,0.2));
  color: var(--ink);
}
.pal-ico { width: 20px; text-align: center; color: var(--muted); }
.pal-item.on .pal-ico { color: var(--blue); }
.pal-foot { padding: 8px 12px 2px; border-top: 1px solid var(--grid); margin-top: 6px; }

/* ---------- first-run tour ---------- */
#tourBack { position: fixed; inset: 0; z-index: 55; background: rgba(5,6,10,0.55); }
.tour-bubble {
  position: fixed; width: 340px; border-radius: 16px; padding: 18px;
  animation: fadeUp 0.3s ease;
}
.tour-bubble h4 { font: 600 15px var(--display); color: var(--ink); margin: 4px 0 6px; }
.tour-bubble p { color: var(--ink-2); font-size: 13px; }
.tour-hi {
  position: relative; z-index: 56 !important;
  box-shadow: 0 0 0 3px var(--blue), 0 0 30px rgba(57,135,229,0.6) !important;
  border-radius: 12px;
}

/* ---------- morning briefing card ---------- */
.brief-card { border-color: rgba(201,133,0,0.4); animation: fadeUp 0.4s ease; margin-top: 36px; }
.brief-card .report h2 { font-size: 13.5px; margin: 12px 0 4px; }

/* ---------- replay toolbar & speed slider ---------- */
.rp-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-group .acct-chip { padding: 5px 11px; font-size: 12px; }
.rp-speed { display: inline-flex; align-items: center; gap: 8px; }
.rp-speed input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 5px; border-radius: 99px; padding: 0;
  background: linear-gradient(90deg, #3987e5, #9085e9);
  border: none; box-shadow: none; cursor: pointer;
}
.rp-speed input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid #3987e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#rpSpeedLab { color: var(--ink); font: 650 12.5px var(--display); min-width: 30px; }

/* ---------- home dashboard ---------- */
.home-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "eval eval eval brief brief brief"
    "actions actions note note stats stats"
    "market market note note stats stats"
    "gap gap gap gap gap gap";
}
.wg { margin-bottom: 0; animation: fadeUp 0.4s cubic-bezier(0.2,0.7,0.3,1) backwards; }
.wg-eval { grid-area: eval; animation-delay: 0.03s; }
.wg-brief { grid-area: brief; animation-delay: 0.08s; max-height: 460px; overflow-y: auto; }
.wg-actions { grid-area: actions; animation-delay: 0.13s; }
.wg-note { grid-area: note; animation-delay: 0.18s; }
.wg-stats { grid-area: stats; animation-delay: 0.23s; }
.wg-market { grid-area: market; animation-delay: 0.28s; }
.wg-gap { grid-area: gap; animation-delay: 0.33s; }
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr 1fr;
    grid-template-areas: "eval eval" "brief brief" "actions note" "stats market" "gap gap"; }
}
@media (max-width: 720px) {
  .home-grid { grid-template-columns: 1fr;
    grid-template-areas: "eval" "brief" "actions" "note" "stats" "market" "gap"; }
}
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink-2); font: 600 12px var(--sans); padding: 14px 6px; cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.qa span { font-size: 19px; color: var(--blue); }
.qa:hover { transform: translateY(-2px); border-color: rgba(57,135,229,0.5);
  background: rgba(57,135,229,0.08); }
.wg .tiles.two .tile { padding: 9px 11px; }
.wg .tiles.two .t-value { font-size: 17px; }
.wg-brief .report h2 { font-size: 12.5px; margin: 10px 0 4px; }
.wg-brief .report p { font-size: 12.5px; }

/* ---------- global download progress bar ---------- */
/* "Your datasets" — instant-switch cards on the Data page */
.ds-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-chip {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 14px 10px 10px; border-radius: 14px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.ds-chip:hover { background: var(--glass-2); border-color: var(--glass-highlight); }
.ds-chip:active { transform: scale(0.98); }
.ds-chip.sel { border-color: var(--blue); background: rgba(57,135,229,0.12); cursor: default; }
.ds-badge { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font: 700 15px var(--display);
  background: var(--brand-grad); }
.ds-info { display: flex; flex-direction: column; line-height: 1.25; }
.ds-info b { color: var(--ink); font-size: 13.5px; }
.ds-info small { color: var(--muted); font-size: 11px; }
.ds-chip.sel .ds-info small { color: #7ede7e; }

/* Sleek glass download toast — floats bottom-center, shows live progress. */
.dl-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 80; width: min(440px, calc(100vw - 32px)); padding: 14px 18px 16px;
  border-radius: 18px;
  background: rgba(22, 24, 34, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-highlight);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: dlRise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes dlRise { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dl-toast-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.dl-orb { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-grad);
  box-shadow: 0 0 0 0 rgba(57,135,229,0.5); animation: dlPulse 1.6s ease-out infinite; }
@keyframes dlPulse {
  0% { box-shadow: 0 0 0 0 rgba(57,135,229,0.45); }
  70% { box-shadow: 0 0 0 9px rgba(57,135,229,0); }
  100% { box-shadow: 0 0 0 0 rgba(57,135,229,0); }
}
.dl-text { flex: 1; min-width: 0; color: var(--ink); font: 600 13px var(--display);
  letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-pct { flex: 0 0 auto; color: var(--ink-2); font: 700 13px var(--display); font-variant-numeric: tabular-nums; }
.dl-track { height: 7px; border-radius: 99px; background: rgba(255,255,255,0.09); overflow: hidden; }
.dl-track-fill {
  height: 100%; width: 3%; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, var(--blue), var(--purple, #9085e9));
  transition: width 0.8s cubic-bezier(0.3, 0.8, 0.4, 1);
}
.dl-track-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: dlShimmer 1.5s linear infinite;
}
@keyframes dlShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .dl-orb, .dl-track-fill::after, .dl-toast { animation: none; }
}

/* ---------- replay system trade log ---------- */
.rp-syslog {
  margin-top: 10px; padding: 10px 13px; border-radius: 12px;
  background: rgba(201,133,0,0.07); border: 1px solid rgba(201,133,0,0.3);
  font-size: 12.5px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
}
.rp-syslog .sys-trade { white-space: nowrap; }
.rp-syslog em { color: var(--muted); font-style: normal; }
