/* ELCARO BRAIN — futuristic / neon / space design system
   OKLCH tokens derived from a single brand hue. dark / light / auto. */

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

:root {
  --brand-hue: 58;             /* ELCARO orange */
  --accent-hue: 28;            /* ELCARO red */

  /* dark (default — Mastercard black, warm-neutral) */
  --bg:        oklch(14% 0.008 50);
  --bg-2:      oklch(18% 0.013 50);
  --surface:   oklch(21% 0.016 50 / 0.74);
  --surface-2: oklch(25% 0.018 50 / 0.86);
  --line:      oklch(42% 0.02 50 / 0.45);
  --text:      oklch(96% 0.012 65);
  --text-dim:  oklch(72% 0.025 55);
  --brand:     oklch(75% 0.165 var(--brand-hue));
  --brand-2:   oklch(68% 0.195 calc(var(--brand-hue) - 18));
  --accent:    oklch(63% 0.225 var(--accent-hue));
  --good:      oklch(78% 0.17 150);
  --bad:       oklch(63% 0.225 28);
  --glow:      oklch(72% 0.18 var(--brand-hue) / 0.55);
  --star:      oklch(92% 0.02 60 / 0.8);
  --shadow:    0 10px 40px -12px oklch(0% 0 0 / 0.8);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        oklch(97% 0.01 70);
  --bg-2:      oklch(94% 0.018 65);
  --surface:   oklch(99% 0.006 70 / 0.86);
  --surface-2: oklch(96% 0.012 70 / 0.95);
  --line:      oklch(80% 0.03 60 / 0.7);
  --text:      oklch(22% 0.03 45);
  --text-dim:  oklch(48% 0.04 45);
  --brand:     oklch(60% 0.18 var(--brand-hue));
  --brand-2:   oklch(56% 0.205 calc(var(--brand-hue) - 18));
  --accent:    oklch(55% 0.225 var(--accent-hue));
  --good:      oklch(56% 0.16 150);
  --bad:       oklch(55% 0.225 28);
  --glow:      oklch(62% 0.18 var(--brand-hue) / 0.32);
  --star:      oklch(55% 0.06 55 / 0.35);
  --shadow:    0 10px 36px -14px oklch(40% 0.06 50 / 0.35);
  color-scheme: light;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                 /* page never scrolls — .scroller does */
  overscroll-behavior: none;
  transition: background .5s ease, color .5s ease;
}

/* internal scroll container: keeps the webview pinned (no pull-down gap on iOS) */
.scroller {
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: none;
}
.scroller > .app { min-height: calc(100% + 2px); } /* always scrollable → drags stay inside */

/* ── space backdrop: stars + nebula glow + grain ── */
.space-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.space-bg::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 18% 12%, var(--glow), transparent 70%),
    radial-gradient(35% 30% at 85% 80%, oklch(70% 0.18 var(--accent-hue) / 0.30), transparent 70%);
  filter: blur(40px);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(3%, 2%, 0) scale(1.08); } }
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* grain overlay */
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ── app shell ── */
.app { max-width: 460px; margin: 0 auto; min-height: 100%; padding: calc(env(safe-area-inset-top, 0px) + 68px) 18px 110px; position: relative; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 38px; height: 38px; display: block; filter: drop-shadow(0 0 10px var(--glow)); }
.logo-svg { width: 38px; height: 38px; overflow: visible; }
.logo-svg .lo-orbit { fill: none; stroke: var(--brand); stroke-width: 1.4; opacity: .35; stroke-dasharray: 4 6; transform-origin: 22px 22px; animation: spin 14s linear infinite; }
.logo-svg .lo-sat { fill: var(--accent); transform-origin: 22px 22px; animation: spin 4s linear infinite; }
.logo-svg .lo-core { fill: none; stroke: var(--brand); stroke-width: 1.8; }
.logo-svg .lo-net { fill: none; stroke: var(--brand-2); stroke-width: 1.1; opacity: .6; }
.logo-svg .lo-nd { fill: var(--brand); animation: ndpulse 2.4s ease-in-out infinite; }
.logo-svg .lo-nd2 { fill: var(--accent); animation-delay: .8s; }
.logo-svg .lo-nd3 { fill: var(--brand-2); animation-delay: 1.6s; }
@keyframes ndpulse { 0%,100% { opacity: .5; r: 1.5px; } 50% { opacity: 1; r: 2.1px; } }
.brand h1 { font-size: 15px; font-weight: 700; letter-spacing: .14em; }
.brand h1 span { color: var(--brand); }

/* inline custom icons */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: 0 0 auto; }
.btn .ic { width: 20px; height: 20px; }
.theme-toggle { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.theme-toggle button { background: none; border: 0; color: var(--text-dim); width: 32px; height: 28px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; transition: .2s; }
.theme-toggle button .ic { width: 16px; height: 16px; }
.theme-toggle button.on { background: var(--brand); color: oklch(15% 0.03 265); box-shadow: 0 0 12px var(--glow); }
.btn-primary .ic { color: oklch(14% 0.03 265); }
.btn-accent .ic { color: oklch(14% 0.03 320); }

/* ── cards ── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px; margin-bottom: 14px; backdrop-filter: blur(14px); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.card.delay1 { animation-delay: .08s; } .card.delay2 { animation-delay: .16s; } .card.delay3 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* hero status card */
.hero { text-align: center; padding: 26px 18px; }
.hero .orb {
  width: 96px; height: 96px; margin: 4px auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brand-2), oklch(26% 0.05 40) 70%);
  box-shadow: 0 0 40px var(--glow), inset 0 0 30px oklch(0% 0 0 / .45);
  position: relative; animation: pulse 3.5s ease-in-out infinite;
}
.hero .orb::before, .hero .orb::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid var(--brand); opacity: .35; animation: ring 3.5s ease-out infinite;
}
.hero .orb::after { animation-delay: 1.7s; }
@keyframes ring { 0% { transform: scale(.85); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* orbiting nodes around the hero orb */
.orb-wrap { position: relative; width: 160px; height: 140px; margin: 0 auto 10px; display: grid; place-items: center; }
.orb-wrap.sm { width: 150px; height: 120px; }
.orb-wrap .orb { margin: 0; }
.orb-orbit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.oo-ring { fill: none; stroke: var(--brand); stroke-width: 1; opacity: .22; }
.oo-ring2 { stroke: var(--accent); opacity: .18; }
.oo-dot { fill: var(--brand); filter: drop-shadow(0 0 5px var(--glow)); }
.oo-dot2 { fill: var(--accent); }
.orb-green { background: radial-gradient(circle at 35% 30%, oklch(68% .22 35), oklch(26% .06 40) 70%) !important;
  box-shadow: 0 0 40px oklch(63% .225 28 / .55), inset 0 0 30px oklch(0% 0 0 / .45) !important; }
.orb-green::before, .orb-green::after { border-color: var(--accent) !important; }

.hero h2 { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.hero p { color: var(--text-dim); font-size: 13px; margin-top: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); }
.pill.active { color: var(--good); border-color: var(--good); box-shadow: 0 0 14px oklch(78% 0.17 150 / .3); }
.pill.inactive { color: var(--text-dim); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

.section-title { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); margin: 4px 2px 10px; }

/* ── buttons ── */
.btn {
  width: 100%; border: 0; border-radius: 16px; padding: 16px; font-family: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: .03em; cursor: pointer; position: relative; overflow: hidden; transition: transform .12s, box-shadow .25s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:active { transform: scale(.975); }
.btn-primary { color: oklch(14% 0.03 265); background: linear-gradient(120deg, var(--brand), var(--brand-2)); box-shadow: 0 0 26px var(--glow); }
.btn-primary::after { content:""; position:absolute; inset:0; background: linear-gradient(120deg, transparent, oklch(100% 0 0 / .35), transparent); transform: translateX(-120%); }
.btn-primary:hover::after { animation: sheen 1s ease; }
@keyframes sheen { to { transform: translateX(120%); } }
.btn-ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.btn-accent { color: oklch(16% 0.02 50); background: linear-gradient(120deg, var(--accent), var(--brand-2)); box-shadow: 0 0 26px oklch(63% 0.225 28 / .45); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid oklch(0% 0 0 / .25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── inputs ── */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin: 0 2px 6px; letter-spacing: .03em; }
.field input, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px; transition: border .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--glow); }

/* exchange chooser */
.exchanges { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 14px; }
.ex { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); text-align: center; font-weight: 600; font-size: 13px; cursor: pointer; transition: .18s; }
.ex.on { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 16px var(--glow); }

/* ── pricing ── */
.plans { display: grid; gap: 10px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; transition: .2s; position: relative; }
.plan.on { border-color: var(--brand); box-shadow: 0 0 20px var(--glow); }
.plan .badge { position: absolute; top: -9px; right: 14px; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: linear-gradient(120deg,var(--accent),var(--brand)); color: oklch(16% .02 50); }
.plan .price { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.plan .sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ── results / verdict ── */
.verdict { white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.65; color: var(--text); font-variant-numeric: tabular-nums; }
.verdict-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 5px 12px; border-radius: 999px; }
.tag.long { color: var(--good); border: 1px solid var(--good); }
.tag.short { color: var(--bad); border: 1px solid var(--bad); }
.tag.flat { color: var(--text-dim); border: 1px solid var(--line); }

/* loading scan animation */
.scanning { text-align: center; padding: 30px 16px; }
.scanning .beam { width: 70%; height: 3px; margin: 18px auto; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 50% 100%; animation: beam 1.2s linear infinite; }
@keyframes beam { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* ── bottom nav ── */
.nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 460px; margin: 0 auto; display: flex; justify-content: space-around; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface-2); border-top: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 10; }
.nav button { background: none; border: 0; color: var(--text-dim); display: grid; place-items: center; gap: 3px; font-size: 10px; letter-spacing: .04em; cursor: pointer; padding: 4px 14px; border-radius: 12px; transition: .2s; }
.nav button.on { color: var(--brand); }
.nav .navic { display: grid; place-items: center; transition: .25s; }
.nav .navic svg { width: 22px; height: 22px; stroke-width: 1.6; }
.nav button.on .navic { filter: drop-shadow(0 0 8px var(--glow)); animation: navfloat 2.6s ease-in-out infinite; }
@keyframes navfloat { 0%,100% { transform: translateY(-1px); } 50% { transform: translateY(-4px); } }

/* screens */
.screen { display: none; } .screen.on { display: block; }

.muted { color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }
.center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.row .k { color: var(--text-dim); font-size: 12.5px; } .row .v { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── scan result: summary + signal cards + projection charts ── */
.scan-summary { font-size: 14px; font-weight: 600; letter-spacing: .01em; margin: 2px 4px 14px; display: flex; align-items: center; gap: 8px; }
.scan-summary .sum-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--glow); flex: 0 0 auto; animation: pulse 2s infinite; }
.scan-summary .demo { font-size: 10px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }

.sig { padding: 14px 16px; border-left: 3px solid var(--line); }
.sig.long  { border-left-color: var(--good); }
.sig.short { border-left-color: var(--bad); }
.sig.wait  { border-left-color: var(--text-dim); }
.sig-head { display: flex; align-items: center; gap: 9px; }
.sig-asset { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.sig-head .tag { font-size: 11px; padding: 3px 9px; }
.tag.wait { color: var(--text-dim); border: 1px solid var(--line); }
.sig-conf { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.sig-when { margin-left: auto; font-size: 11px; color: var(--text-dim); text-align: right; }
.sig-date { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 12px; border-radius: 999px;
  background: oklch(75% 0.165 var(--brand-hue) / 0.12); border: 1px solid oklch(75% 0.165 var(--brand-hue) / 0.35);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.sig-date .ic { width: 15px; height: 15px; }

.chart { width: 100%; height: auto; display: block; margin: 8px 0 4px; overflow: visible; }
.ch-band { fill: var(--brand); opacity: 0; animation: chFade .6s .1s ease forwards; }
.ch-tp, .ch-en, .ch-sl { transform-origin: left center; transform: scaleX(0); opacity: 0; animation: chLine .55s ease forwards; }
.ch-tp { stroke: var(--good); stroke-width: 1.2; stroke-dasharray: 3 4; animation-delay: .25s; }
.ch-en { stroke: var(--brand); stroke-width: 1.5; animation-delay: .12s; }
.ch-sl { stroke: var(--bad); stroke-width: 1.2; stroke-dasharray: 3 4; animation-delay: .38s; }
@keyframes chLine { to { transform: scaleX(1); opacity: .85; } }
@keyframes chFade { to { opacity: .07; } }
.ch-lab { font: 800 9px 'JetBrains Mono', monospace; fill: var(--text-dim); font-variant-numeric: tabular-nums; opacity: 0; animation: chFade2 .5s .5s ease forwards; }
@keyframes chFade2 { to { opacity: 1; } }
.ch-lab-tp { fill: var(--good); } .ch-lab-en { fill: var(--brand); } .ch-lab-sl { fill: var(--bad); }
.ch-path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: chDraw 1.2s .35s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes chDraw { to { stroke-dashoffset: 0; } }
.ch-path-up { stroke: var(--good); filter: drop-shadow(0 0 5px oklch(78% .17 150 / .5)); }
.ch-path-dn { stroke: var(--bad); filter: drop-shadow(0 0 5px var(--glow)); }
.ch-path-wait { stroke: var(--text-dim); opacity: .55; stroke-dasharray: 5 5; animation: none; stroke-dashoffset: 0; }
.ch-dot-now { fill: var(--text-dim); }
.ch-dot-tgt { fill: var(--good); filter: drop-shadow(0 0 6px oklch(78% .17 150 / .7)); transform-box: fill-box; transform-origin: center; transform: scale(0); animation: chPop .4s 1.35s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes chPop { to { transform: scale(1); } }
/* σ-DCA ladder */
.ch-dca { transform-box: fill-box; transform-origin: left center; opacity: 0; transform: translateX(-6px); animation: chDca .45s ease forwards; }
@keyframes chDca { to { opacity: 1; transform: none; } }
.ch-dca-l { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 2 3; opacity: .8; }
.ch-dca-d { fill: var(--accent); }
.ch-dca-t { font: 800 8px 'JetBrains Mono', monospace; fill: var(--accent); }

.sig-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.lvl { background: var(--bg-2); border-radius: 10px; padding: 8px 6px; text-align: center; border: 1px solid var(--line); }
.lvl span { display: block; font-size: 9px; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 3px; }
.lvl b { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-variant-numeric: tabular-nums; }
.lvl.en b { color: var(--brand); } .lvl.sl b { color: var(--bad); } .lvl.tp b { color: var(--good); }
.sig-note { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

#fullToggle.open { color: var(--brand); border-color: var(--brand); }
.full-analysis { font-size: 13px; line-height: 1.65; color: var(--text-dim); animation: rise .4s ease both; }
.full-analysis h4 { color: var(--text); font-size: 14px; margin: 10px 0 4px; letter-spacing: .01em; }
.full-analysis b { color: var(--text); }
.full-analysis code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--brand); }

/* ── setup checklist (Start here · 3 steps) ── */
.step { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .2s; }
.step:last-child { border-bottom: 0; }
.st-n { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px 'JetBrains Mono', monospace; color: var(--text-dim); border: 1px solid var(--line); transition: .25s; }
.st-t { min-width: 0; }
.st-t b { display: block; font-size: 14px; letter-spacing: .01em; }
.st-t span { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.step .st-go { margin-left: auto; width: 15px; height: 15px; color: var(--text-dim); transform: rotate(180deg); flex: 0 0 auto; }
.step.now .st-n { color: var(--brand); border-color: var(--brand); box-shadow: 0 0 12px var(--glow); animation: pulse 2.4s ease-in-out infinite; }
.step.now .st-go { color: var(--brand); }
.step.done { opacity: .62; }
.step.done .st-n { color: var(--good); border-color: var(--good); font-size: 0; }
.step.done .st-n::before { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg) translateY(-1px); }
.step.done .st-go { display: none; }

/* step chip (Step 1 of 3) on key / pay screens */
.step-chip { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }

/* plain-words action sentence on signal cards */
.sig-plain { margin-top: 10px; font-size: 13.5px; line-height: 1.55; padding: 10px 12px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); }
.sig-plain b { font-variant-numeric: tabular-nums; }
.sig.long .sig-plain { border-left: 3px solid var(--good); }
.sig.short .sig-plain { border-left: 3px solid var(--bad); }
.sig.wait .sig-plain { border-left: 3px solid var(--text-dim); color: var(--text-dim); }

/* advanced disclosure (futures autotrade folded away from beginners) */
.adv-head { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim); cursor: pointer; }
.adv-head .ic:first-child { width: 14px; height: 14px; color: var(--accent); }
.adv-head .adv-chev { margin-left: auto; width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .3s; }
.adv-head.open .adv-chev { transform: rotate(90deg); }
.adv-body { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease; }
.adv-body.open { max-height: 900px; opacity: 1; }

/* animated reveals (alert assets + autotrade body) */
.alert-assets, .at-body { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease; }
.alert-assets.open { max-height: 140px; opacity: 1; }
.at-body.open { max-height: 420px; opacity: 1; }
#autotradeCard .section-title:first-child { color: var(--accent); }

/* keyboard focus (tappable divs get role=button via JS) */
.step:focus-visible, .ex:focus-visible, .plan:focus-visible, .btn:focus-visible, .adv-head:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px;
}

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; transition: .25s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: var(--text-dim); border-radius: 50%; transition: .25s; }
.switch input:checked + .track { background: linear-gradient(120deg, var(--brand), var(--accent)); border-color: transparent; box-shadow: 0 0 14px var(--glow); }
.switch input:checked + .track::before { transform: translateX(20px); background: oklch(98% 0 0); }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-2); border: 1px solid var(--brand); color: var(--text); padding: 11px 18px; border-radius: 999px; font-size: 13px; box-shadow: 0 0 24px var(--glow); opacity: 0; pointer-events: none; transition: .3s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───────── live ULTRA chart: card button + bottom sheet ───────── */
.btn-chart {
  width: 100%; margin-top: 12px; padding: 11px 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13px 'Space Grotesk', sans-serif; letter-spacing: .02em;
  color: var(--text); cursor: pointer;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 13px;
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn-chart:hover { transform: translateY(-1px); border-color: var(--brand); box-shadow: 0 6px 18px -8px var(--glow); }
.btn-chart:active { transform: translateY(0); }
.btn-chart .ic { width: 16px; height: 16px; color: var(--brand); }

.sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end;
  background: oklch(8% 0.01 50 / 0); backdrop-filter: blur(0px);
  pointer-events: none; transition: background .3s ease, backdrop-filter .3s ease;
}
.sheet.open { pointer-events: auto; background: oklch(6% 0.01 50 / 0.62); backdrop-filter: blur(5px); }
.sheet-card {
  width: 100%; max-height: 88vh; transform: translateY(102%);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px -16px oklch(0% 0 0 / 0.7);
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  transition: transform .42s cubic-bezier(.2, .9, .25, 1);
}
.sheet.open .sheet-card { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet-title { display: flex; align-items: center; gap: 9px; font: 700 18px 'Space Grotesk', sans-serif; letter-spacing: -.01em; }
.sheet-title .tag { font-size: 11px; padding: 3px 9px; }
.ch-tfs { display: flex; gap: 4px; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.ch-tfs button {
  font: 700 11px 'JetBrains Mono', monospace; color: var(--text-dim); cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; padding: 5px 10px; transition: all .18s ease;
}
.ch-tfs button.on { color: var(--bg); background: var(--brand); }
.sheet-x {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text-dim); cursor: pointer;
  transition: all .18s ease;
}
.sheet-x:hover { color: var(--text); border-color: var(--brand); }
.sheet-x .ic { width: 17px; height: 17px; transform: rotate(-90deg); }
.ch-wrap { position: relative; width: 100%; height: 56vh; min-height: 300px; }
#chartBox { width: 100%; height: 100%; }
.ch-load {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 12px 'JetBrains Mono', monospace; color: var(--text-dim); pointer-events: none;
}
.ch-legend { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.cl {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font: 600 11px 'JetBrains Mono', monospace; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.cl b { color: var(--text); font-weight: 800; }
.cl i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cl.en i { background: var(--brand); } .cl.tp i { background: var(--good); }
.cl.sl i { background: var(--bad); } .cl.sig i { background: oklch(70% 0.13 265); }
.cl.dt i { display: none; } .cl.dt { color: var(--brand); }

/* ── premium polish 2026-06-23 (close cheap static gaps) ── */
.ex, .plan, .dca-asset, .asset-chip { transition: border-color .22s ease, background .22s ease, transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease; }
.ex:active, .plan:active, .dca-asset:active, .asset-chip:active { transform: scale(.965); }
.ex.on, .plan.on, .dca-asset.on, .asset-chip.on { box-shadow: 0 0 0 1px var(--brand), 0 10px 28px -14px var(--glow); }
.btn:active { transform: translateY(1px) scale(.985); }
.plan .badge { animation: pulse 2.4s ease-in-out infinite; }
.row, .holding, .rh-row { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* ── premium polish v2 2026-06-23 (screen transitions + count-up) ── */
.screen.on { animation: screenIn .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes screenIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:none; } }
.field:focus-within label { color: var(--brand); }
.sig-conf { font-variant-numeric: tabular-nums lining-nums; }
@media (prefers-reduced-motion: reduce){ .screen.on{ animation:none; } }

/* ── premium polish v3 2026-06-23 (Higgsfield ambient video backdrop + verdict focus-reveal + status icons) ── */
/* real Higgsfield neural-core ambient video behind connect-key + paywall (frosted through card backdrop-filter) */
#s-key, #s-pay { position: relative; }
.amb-bg {
  position: absolute; left: 50%; top: -28px; transform: translateX(-50%);
  width: 132%; max-width: 560px; height: auto; z-index: 0; pointer-events: none;
  opacity: .36; mix-blend-mode: screen; filter: saturate(1.06);
  -webkit-mask-image: radial-gradient(ellipse 72% 56% at 50% 30%, #000 34%, transparent 72%);
  mask-image: radial-gradient(ellipse 72% 56% at 50% 30%, #000 34%, transparent 72%);
}

/* status icons inside key/robinhood status lines */
.ic.ok { color: var(--good); } .ic.warn { color: var(--bad); }
.row .k.kill { display: inline-flex; align-items: center; gap: 7px; }
.row .k.kill .ic { width: 16px; height: 16px; }
#autotradeCard .section-title:first-child .ic { width: 14px; height: 14px; color: var(--accent); vertical-align: -2px; }

/* cinematic verdict focus-reveal: core converges, summary flashes into focus */
#scanState { transition: transform .28s cubic-bezier(.5,0,.75,0), opacity .28s ease, filter .28s ease; transform-origin: center; }
#scanCard.converge #scanState { transform: scale(.55); opacity: 0; filter: blur(6px) saturate(1.4); }
#verdictWrap[style*="block"] { animation: verdictIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes verdictIn { from { opacity: 0; transform: translateY(10px) scale(.992); } to { opacity: 1; transform: none; } }
.scan-summary.flash { animation: summaryFlash .95s cubic-bezier(.2,.8,.2,1) both; }
@keyframes summaryFlash {
  0% { opacity: 0; transform: translateY(7px); filter: blur(3px); }
  30% { opacity: 1; filter: blur(0); text-shadow: 0 0 20px var(--glow), 0 0 6px var(--glow); }
  100% { opacity: 1; transform: none; text-shadow: none; }
}
@media (prefers-reduced-motion: reduce){
  #scanCard.converge #scanState { transition: none; }
  #verdictWrap[style*="block"], .scan-summary.flash { animation: none; }
}

/* ── legal acknowledgment gate ── */
.modal-overlay{display:none;position:fixed;inset:0;z-index:600;align-items:center;justify-content:center;background:color-mix(in oklch, var(--bg) 92%, transparent);backdrop-filter:blur(3px);padding:20px}
.modal-overlay.open{display:flex}
.modal-card{background:var(--surface, var(--bg));border:1px solid var(--line, oklch(30% 0.01 50));border-radius:12px;max-width:340px;width:100%;padding:22px 20px}
.modal-title{font-size:17px;margin:0 0 12px}
.modal-ack-title{font-size:13px;margin:0 0 8px}
.modal-ack-list{margin:0 0 16px;padding-left:18px;font-size:13px;line-height:1.55;color:var(--text-dim, inherit)}
.modal-ack-list li{margin-bottom:4px}
.modal-check{margin-bottom:14px}
.modal-check label{display:flex;gap:8px;align-items:center;font-size:13px;cursor:pointer}
.modal-check input{width:18px;height:18px;accent-color:var(--brand)}
#termsAgree{width:100%}
#termsAgree:disabled{opacity:.5;cursor:not-allowed}
.legal-note{font-size:11px;opacity:.6;margin-top:10px}

/* ───────── track record ───────── */
.track-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.tstat { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:12px 14px; }
.tstat b { display:block; font-size:1.5rem; font-variant-numeric:tabular-nums; color:var(--brand); line-height:1.15; }
.tstat span { font-size:.7rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:.05em; }
#trackTeaser { cursor:pointer; transition:border-color .2s, transform .1s; }
#trackTeaser:active { transform:scale(.995); }
#trackTeaser:hover { border-color:oklch(75% 0.165 58 / .5); }
.trk-row { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
.trk-row:last-child { border-bottom:0; }
.trk-a { font-weight:600; }
.trk-r { margin-left:auto; font-variant-numeric:tabular-nums; font-weight:600; }
.trk-b { font-size:.66rem; padding:2px 8px; border-radius:999px; text-transform:uppercase; letter-spacing:.04em; }
.trk-b.win { background:oklch(78% 0.17 150 / .16); color:var(--good); }
.trk-b.loss { background:oklch(63% 0.225 28 / .16); color:var(--bad); }
.trk-b.exp { background:oklch(72% 0.025 55 / .16); color:var(--text-dim); }
.trk-pos { color:var(--good); } .trk-neg { color:var(--bad); }

/* ───────── position sizing ───────── */
.size-bar .size-inputs { display:flex; gap:10px; margin-top:8px; }
.size-bar label { flex:1; display:flex; flex-direction:column; gap:4px; font-size:.7rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:.04em; }
.size-bar input { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:9px 10px; color:var(--text); font-size:1rem; font-variant-numeric:tabular-nums; }
.size-bar input:focus-visible { outline:2px solid var(--brand); outline-offset:1px; }
.sig-size { margin-top:8px; padding:8px 10px; border-radius:10px; background:oklch(75% 0.165 58 / .1); border:1px solid oklch(75% 0.165 58 / .25); font-size:.82rem; line-height:1.4; }
.sig-size.muted { background:transparent; border:1px dashed var(--line); color:var(--text-dim); }
.sig-size b { font-variant-numeric:tabular-nums; }

/* ───────── pay: included list ───────── */
.incl { margin-top:14px; display:flex; flex-direction:column; gap:9px; }
.incl-row { display:flex; align-items:center; gap:10px; font-size:.86rem; color:var(--text); line-height:1.35; }
.incl-row .ic.ok { color:var(--good); flex:none; width:18px; height:18px; }

/* ───────── signal: weekly-cycle context ───────── */
.sig-cycle { margin-top:8px; padding:7px 10px; border-radius:10px; font-size:.78rem; line-height:1.35; background:var(--surface); border:1px solid var(--line); color:var(--text-dim); }
.sig-cycle.ok { background:oklch(78% 0.17 150 / .1); border-color:oklch(78% 0.17 150 / .28); color:var(--text); }
.sig-cycle.warn { background:oklch(75% 0.16 70 / .1); border-color:oklch(75% 0.16 70 / .3); color:var(--text); }

/* ───────── signal: liquidation pressure ───────── */
.sig-liq { margin-top:8px; padding:7px 10px; border-radius:10px; font-size:.78rem; line-height:1.35; background:var(--surface); border:1px solid var(--line); color:var(--text-dim); }
.sig-liq.ok { background:oklch(78% 0.17 150 / .08); border-color:oklch(78% 0.17 150 / .22); color:var(--text); }
.sig-liq.warn { background:oklch(75% 0.16 70 / .08); border-color:oklch(75% 0.16 70 / .26); color:var(--text); }
.sig-liq b { font-variant-numeric:tabular-nums; }

/* ───────── holdings: forecast outlook ───────── */
.hold-outlook { font-size:.72rem; color:var(--text-dim); padding:1px 0 8px 2px; margin-top:-4px; }
.hold-outlook.buy { color:var(--good); }
.hold-outlook.sell { color:var(--brand); }
