/* BornomalaAI Trader: extras on top of Tailwind (brand tokens live in base.html tailwind.config). */
:root {
  --ink: #16133A; --ink-950: #0B0A22; --teal: #119AA8; --teal-soft: #5ED3DE; --sun: #FFC233;
  --up: #34D399; --down: #F87171; --line: rgba(255,255,255,.07);
}
html { color-scheme: dark; }
body { background: var(--ink-950); }

/* soft brand glow behind the page */
.bg-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(17,154,168,.16), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(255,194,51,.07), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(94,211,222,.06), transparent 60%); }

/* ---------- tables (all pages) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 100%; border-collapse: collapse; }
.table-wrap th { text-align: left; font-weight: 500; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: #8F8AB6; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: .875rem; }
.table-wrap tr:hover td { background: rgba(94,211,222,.04); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
.pos { color: var(--up); }
.neg { color: var(--down); }

/* existing pages use bg-slate-900 + border-slate-800 cards: give them the glass look */
main .bg-slate-900 { background: linear-gradient(180deg, rgba(37,34,74,.55), rgba(24,21,61,.55)); backdrop-filter: blur(8px); }
main .border-slate-800 { border-color: var(--line); }

/* ---------- header ---------- */
.nav-link { padding: .375rem .75rem; border-radius: .5rem; color: #8F8AB6; transition: color .15s, background .15s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-link.is-active { color: #fff; background: rgba(17,154,168,.16); box-shadow: inset 0 0 0 1px rgba(94,211,222,.22); }
.badge-live { font-size: .62rem; font-weight: 800; letter-spacing: .12em; padding: .2rem .5rem; border-radius: .35rem;
  color: #fff; background: #DC2626; animation: live-ring 2.4s infinite; }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.icon-btn { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .5rem; color: #8F8AB6;
  border: 1px solid var(--line); }
.icon-btn:hover { color: #fff; }
.icon-btn .snd-on { display: none; }
.icon-btn[aria-pressed="true"] { color: var(--sun); border-color: rgba(255,194,51,.35); }
.icon-btn[aria-pressed="true"] .snd-on { display: inline; }
.icon-btn[aria-pressed="true"] .snd-off { display: none; }

.bm-logo { filter: drop-shadow(0 4px 12px rgba(8,108,120,.45)); }
.bm-logo .bm-spark, .bm-logo .bm-eyes { transform-box: fill-box; transform-origin: center; }
.bm-logo .bm-spark { animation: bm-antenna 3.2s ease-in-out infinite; }
.bm-logo .bm-eyes { animation: bm-blink 6s ease-in-out infinite; }
body.is-thinking .bm-logo .bm-spark { animation-duration: .9s; }
@keyframes bm-antenna { 0%, 82%, 100% { opacity: 1; } 88% { opacity: .35; } 94% { opacity: 1; } }
@keyframes bm-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* Mission Control strip */
.mc-sep { width: 1px; height: 14px; background: var(--line); flex: none; }
.ring-track { stroke: #25224A; }
.ring-arc { stroke: var(--teal-soft); transition: stroke-dashoffset 1s linear; }
.ring-arc.is-scanning { stroke: var(--sun); }

.pulse-dot { position: relative; width: .55rem; height: .55rem; border-radius: 999px; flex: none; }
.pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
.pulse-dot.is-on { background: var(--up); }
.pulse-dot.is-warn { background: var(--sun); }
.pulse-dot.is-bad { background: var(--down); }
.pulse-dot.is-idle { background: #6B6694; }
.pulse-dot.is-idle::after { animation: none; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- dashboard ---------- */
.glass { position: relative; border-radius: 1rem; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(37,34,74,.6), rgba(24,21,61,.45)); backdrop-filter: blur(10px); }
.glass-hero { background:
  radial-gradient(600px 220px at 0% 0%, rgba(17,154,168,.22), transparent 70%),
  linear-gradient(180deg, rgba(37,34,74,.7), rgba(24,21,61,.5)); }
.glow-border::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(94,211,222,.8) 80%, rgba(255,194,51,.7) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-border 6s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-border { to { --ang: 360deg; } }

.kicker { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: #8F8AB6; }
.tnum { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.flash-up { animation: flash-up .9s ease-out; }
.flash-down { animation: flash-down .9s ease-out; }
@keyframes flash-up { 0% { color: var(--up); text-shadow: 0 0 14px rgba(52,211,153,.7); } 100% { text-shadow: none; } }
@keyframes flash-down { 0% { color: var(--down); text-shadow: 0 0 14px rgba(248,113,113,.7); } 100% { text-shadow: none; } }

.meter { height: .5rem; border-radius: 999px; background: #25224A; overflow: hidden; position: relative; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(90deg, #0B7480, #5ED3DE); }
.meter.is-sun > i { background: linear-gradient(90deg, #C98A00, #FFC233); }
.meter.is-shimmer > i::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* position card: price track from entry to target */
.track { position: relative; height: 6px; border-radius: 999px; background: #25224A; }
.track .zero { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #6B6694; border-radius: 2px; }
.track .fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; transition: all .8s cubic-bezier(.2,.8,.2,1); }
.track .knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 999px;
  background: #fff; box-shadow: 0 0 0 3px rgba(94,211,222,.35), 0 0 16px rgba(94,211,222,.6); transition: left .8s cubic-bezier(.2,.8,.2,1); }

/* decision funnel */
.funnel-row { display: grid; grid-template-columns: 8.5rem 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .8rem; }
.funnel-bar { height: 1.35rem; border-radius: .4rem; background: #1E1B45; overflow: hidden; position: relative; }
.funnel-bar > i { position: absolute; inset: 0 auto 0 0; transition: width 1s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(90deg, rgba(11,116,128,.9), rgba(94,211,222,.75)); }
.funnel-row:last-child .funnel-bar > i { background: linear-gradient(90deg, #C98A00, #FFC233); }

/* radar sweep on the resting-buy card */
.radar { position: relative; width: 5.5rem; height: 5.5rem; border-radius: 999px; flex: none;
  background: radial-gradient(circle, rgba(94,211,222,.08) 0 30%, transparent 31%),
              repeating-radial-gradient(circle, transparent 0 13px, rgba(94,211,222,.14) 13px 14px);
  border: 1px solid rgba(94,211,222,.25); overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: conic-gradient(from 0deg, rgba(94,211,222,.55), transparent 25%); animation: sweep 3s linear infinite; }
.radar .blip { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 999px; background: var(--sun);
  box-shadow: 0 0 12px var(--sun); transition: all .8s ease; }
@keyframes sweep { to { transform: rotate(360deg); } }

/* terminal activity feed */
.term { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .76rem; line-height: 1.55; }
.term-line { display: grid; grid-template-columns: 4.6rem 4.8rem 1fr; gap: .6rem; padding: .22rem .9rem; }
.term-line.is-new { animation: line-in .6s ease-out; background: rgba(94,211,222,.07); }
.term-line .src { color: #6B6694; }
.term-line.lv-WARN .msg { color: #FFD466; }
.term-line.lv-ERROR .msg { color: #FCA5A5; }
@keyframes line-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.caret::after { content: "▍"; color: var(--teal-soft); animation: caret 1s steps(1) infinite; margin-left: 2px; }
@keyframes caret { 50% { opacity: 0; } }

/* toasts */
.toast { pointer-events: auto; min-width: 16rem; max-width: 22rem; padding: .75rem 1rem; border-radius: .75rem;
  background: rgba(24,21,61,.92); border: 1px solid rgba(94,211,222,.3); backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.45); font-size: .85rem; animation: toast-in .35s ease-out; }
.toast.is-win { border-color: rgba(52,211,153,.5); box-shadow: 0 10px 40px rgba(52,211,153,.18); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* brain orb (dashboard hero) */
.brain-orb { width: 5.5rem; height: 5.5rem; border-radius: 1.4rem; display: grid; place-items: center;
  background: linear-gradient(180deg, #119AA8, #086C78); box-shadow: 0 10px 40px rgba(17,154,168,.45), inset 0 0 0 1px rgba(255,255,255,.15); }
.brain-orb::before, .brain-orb::after { content: ""; position: absolute; inset: -8px; border-radius: 1.9rem;
  border: 1px solid rgba(94,211,222,.35); animation: orb 2.8s ease-out infinite; }
.brain-orb::after { animation-delay: 1.4s; }
.brain-orb.is-idle::before, .brain-orb.is-idle::after { animation: none; opacity: 0; }
.brain-orb .orb-spark { transform-box: fill-box; transform-origin: center; animation: bm-antenna 1.6s ease-in-out infinite; }
@keyframes orb { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.live-chip { font-size: .56rem; letter-spacing: .1em; padding: .05rem .35rem; border-radius: 999px; color: #5ED3DE;
  border: 1px solid rgba(94,211,222,.35); text-transform: uppercase; }
.live-chip.is-off { color: #6B6694; border-color: #36325F; }
.coin-badge { width: 2.25rem; height: 2.25rem; border-radius: .7rem; display: grid; place-items: center; flex: none;
  font: 700 .7rem/1 Outfit, Inter, sans-serif; color: #fff; background: linear-gradient(160deg, #25224A, #18153D);
  border: 1px solid rgba(94,211,222,.25); }
.chip { padding: .25rem .55rem; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }

/* ================= step 2: shared page kit (Strategy, Signals, Account) ================= */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title { font-family: Outfit, Inter, sans-serif; font-weight: 700; font-size: 1.85rem; line-height: 1.1;
  letter-spacing: -.01em; color: #fff; margin-top: .25rem; }
@media (max-width: 640px) { .page-title { font-size: 1.5rem; } }
.sec-title { font-family: Outfit, Inter, sans-serif; font-weight: 600; font-size: 1.1rem; color: #fff; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: 1rem 1.25rem .75rem; }
.sec-head .sub { font-size: .75rem; color: #6B6694; }
.sec-head .end { margin-left: auto; }
.glass > .table-wrap { border-top: 1px solid var(--line); }
.glass > .table-wrap tr:last-child td { border-bottom: 0; }

.stat { padding: 1.1rem 1.25rem; }
.stat .v { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums;
  font-size: 1.55rem; font-weight: 600; color: #fff; margin-top: .45rem; line-height: 1.1; }
.stat .s { font-size: .72rem; color: #6B6694; margin-top: .45rem; }

.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .66rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line); color: #B3AFD3;
  background: rgba(255,255,255,.04); white-space: nowrap; }
.pill.on { color: #6EE7B7; border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.08); }
.pill.warn { color: var(--sun); border-color: rgba(255,194,51,.3); background: rgba(255,194,51,.07); }
.pill.bad { color: #FCA5A5; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.pill.violet { color: #C4B5FD; border-color: rgba(167,139,250,.3); background: rgba(167,139,250,.08); }
.pill .pulse-dot { width: .45rem; height: .45rem; }
.tag { display: inline-block; font-size: .6rem; font-weight: 700; letter-spacing: .08em; padding: .08rem .38rem; border-radius: .3rem; vertical-align: middle; }
.tag-stock { color: #C4B5FD; background: rgba(167,139,250,.15); }
.tag-manual { color: var(--sun); background: rgba(255,194,51,.12); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: .6rem; font-weight: 600;
  font-size: .875rem; padding: .55rem 1.1rem; border: 1px solid transparent; transition: all .15s; white-space: nowrap; }
.btn-primary { color: #16133A; background: linear-gradient(180deg, #FFD466, #FFC233); box-shadow: 0 6px 22px rgba(255,194,51,.25); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-danger { color: #FCA5A5; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.06); }
.btn-danger:hover { color: #fff; background: rgba(220,38,38,.3); }
.btn-xs { font-size: .72rem; font-weight: 500; padding: .2rem .55rem; border-radius: .45rem; border: 1px solid #36325F; color: #B3AFD3; }
.btn-xs:hover { color: #fff; border-color: var(--teal-soft); }
.btn-xs.is-danger { border-color: rgba(248,113,113,.4); color: #FCA5A5; }
.btn-xs.is-danger:hover { border-color: #F87171; color: #fff; }
.btn-xs.is-go { border-color: rgba(52,211,153,.4); color: #6EE7B7; }
.btn-xs.is-go:hover { border-color: #34D399; color: #fff; background: rgba(52,211,153,.1); }
.actions { display: flex; gap: .35rem; justify-content: flex-end; }
.actions form { display: inline; }

.field { display: block; margin-top: .3rem; border-radius: .55rem; background: rgba(11,10,34,.7); border: 1px solid #36325F;
  padding: .5rem .75rem; color: #fff; }
.field:focus { outline: none; border-color: var(--teal-soft); box-shadow: 0 0 0 3px rgba(94,211,222,.15); }

.note-box { border-radius: .75rem; border: 1px solid var(--line); background: rgba(255,255,255,.025); padding: .75rem 1rem; font-size: .85rem; }
.note-box.is-bad { border-color: rgba(248,113,113,.35); background: rgba(127,29,29,.25); color: #FECACA; }

/* rows with a live price get a soft flash */
td[data-live] .lv { transition: color .3s; }
tr.is-resting td { background: rgba(255,194,51,.05); }
tr.is-resting td:first-child { box-shadow: inset 3px 0 0 var(--sun); }
tr.is-off td { opacity: .42; }

/* ---------- mobile: tables marked .cards turn into one card per row ---------- */
@media (max-width: 767px) {
  .table-wrap.cards { overflow: visible; }
  .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; width: 100%; }
  .table-wrap.cards thead { display: none; }
  .table-wrap.cards tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); display: grid;
    grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .table-wrap.cards tr:hover td { background: none; }
  .table-wrap.cards td { border: 0; padding: .2rem 0; white-space: normal; text-align: left; font-size: .82rem; }
  .table-wrap.cards td[data-label]::before { content: attr(data-label); display: block; font-size: .62rem; text-transform: uppercase;
    letter-spacing: .08em; color: #6B6694; margin-bottom: .05rem; }
  .table-wrap.cards td.c-head { grid-column: 1 / -1; font-size: .95rem; padding-bottom: .35rem; }
  .table-wrap.cards td.c-wide { grid-column: 1 / -1; }
  .table-wrap.cards td.c-hide { display: none; }
  .table-wrap.cards td:empty { display: none; }
  .table-wrap.cards .actions { justify-content: flex-start; padding-top: .35rem; }
  .table-wrap.cards td.empty-row { grid-column: 1 / -1; }
  .table-wrap.cards tr.is-resting td:first-child { box-shadow: none; }
  .table-wrap.cards tr.is-resting { box-shadow: inset 3px 0 0 var(--sun); }
}
@media (max-width: 767px) {
  .table-wrap.cards tr.is-resting { background: rgba(255,194,51,.05); }
  .table-wrap.cards tr.is-resting td { background: none; }
}
/* swipe rows in the header (mobile nav, Mission Control strip): no visible scrollbar */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* in-app confirmation dialog (static/ui.js) */
.confirm-dlg { width: min(28rem, calc(100vw - 2rem)); padding: 1.35rem 1.4rem; border-radius: 1rem; color: #E8E6F4;
  border: 1px solid rgba(94,211,222,.25); background: linear-gradient(180deg, #25224A, #18153D);
  box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.confirm-dlg[open] { animation: toast-in .2s ease-out; }
.confirm-dlg::backdrop { background: rgba(11,10,34,.7); backdrop-filter: blur(4px); }
.confirm-dlg[data-tone="danger"] { border-color: rgba(248,113,113,.35); }
.confirm-icon { flex: none; width: 2.1rem; height: 2.1rem; border-radius: .7rem; display: grid; place-items: center;
  font: 800 1rem/1 Outfit, sans-serif; color: #16133A; background: var(--sun); }
.confirm-dlg[data-tone="danger"] .confirm-icon { background: #F87171; color: #fff; }
.confirm-dlg[data-tone="go"] .confirm-icon { background: #34D399; }
.btn-ghost { color: #B3AFD3; border-color: #36325F; }
.btn-ghost:hover { color: #fff; border-color: #6B6694; }
.btn-danger-solid { color: #fff; background: #DC2626; }
.btn-danger-solid:hover { background: #EF4444; }
.btn-go { color: #052e22; background: linear-gradient(180deg, #6EE7B7, #34D399); }
.btn-go:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: wait; }
