:root {
  --bg: #080b14;
  --bg2: #0d1220;
  --card: rgba(255,255,255,.045);
  --card-brd: rgba(255,255,255,.08);
  --glass: rgba(12,17,29,.72);
  --text: #f3f6fc;
  --muted: #8b9bb7;
  --faint: #5f6f8c;
  --green: #29d67e;
  --green-d: #138a4f;
  --red: #ff5d6c;
  --amber: #ffc24b;
  --accent: #5b8cff;
  --accent2: #7a5cff;
  --r: 18px;
  --safe-t: env(safe-area-inset-top);
  --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,.14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(122,92,255,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45;
  min-height: 100vh; overscroll-behavior-y: none;
}
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--card-brd);
}
.appbar-row { display: flex; align-items: center; gap: 12px; }
.title { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.title-main { font-size: 19px; font-weight: 800; letter-spacing: -.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px;
  width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--card-brd);
  background: var(--card); color: var(--text); font-size: 17px; display: grid; place-items: center;
  transition: transform .12s, background .2s; }
.icon-btn:active { transform: scale(.92); background: rgba(255,255,255,.1); }
.lbl-btn { height: 38px; border-radius: 12px; border: 1px solid var(--card-brd);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 5px; padding: 0 13px; flex: none;
  transition: transform .12s, background .2s; }
.lbl-btn:active { transform: scale(.94); background: rgba(255,255,255,.1); }

/* Action row (Basket / Chat) */
.action-row { display: flex; gap: 8px; margin-top: 11px; }
.act-btn { flex: 1; height: 42px; border-radius: 12px; border: 1px solid var(--card-brd);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, background .2s; }
.act-btn:active { transform: scale(.96); background: rgba(255,255,255,.1); }

/* ---------- Splash / launch ---------- */
.splash { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 70% 15%, rgba(91,140,255,.22), transparent 60%),
    radial-gradient(700px 420px at 20% 80%, rgba(122,92,255,.2), transparent 55%),
    var(--bg);
  transition: opacity .55s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { width: 112px; height: 112px; border-radius: 26px; display: block;
  box-shadow: 0 18px 50px rgba(91,140,255,.4), 0 0 0 1px rgba(255,255,255,.06);
  animation: spPop 1s cubic-bezier(.2,.9,.25,1) both, spFloat 2.6s ease-in-out 1s infinite; }
.splash-name { font-size: 28px; font-weight: 850; letter-spacing: -.02em; margin-top: 14px;
  background: linear-gradient(135deg, #ffffff, #9fc0ff 70%); -webkit-background-clip: text;
  background-clip: text; color: transparent; opacity: 0; animation: spFade .6s ease .35s both; }
.splash-tag { font-size: 13px; color: var(--muted); margin-top: 6px; opacity: 0;
  animation: spFade .6s ease .55s both; }
.splash-dots { display: flex; gap: 7px; margin-top: 26px; opacity: 0; animation: spFade .5s ease .8s both; }
.splash-dots span { width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); animation: spBlink 1.2s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .2s; }
.splash-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes spPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes spFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spBlink { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- Login screen ---------- */
.login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 24px calc(24px + var(--safe-r, 0)) 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(91,140,255,.22), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(122,92,255,.2), transparent 55%),
    var(--bg); }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column;
  background: rgba(255,255,255,.04); border: 1px solid var(--card-brd); border-radius: 24px;
  padding: 30px 24px 26px; text-align: center;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.5); animation: slideup .4s cubic-bezier(.2,.9,.25,1); }
.login-logo { width: 68px; height: 68px; border-radius: 17px; display: block; margin: 0 auto 10px;
  box-shadow: 0 10px 28px rgba(91,140,255,.35); }
.login-card h1 { font-size: 24px; font-weight: 850; letter-spacing: -.02em; margin: 0; }
.login-card p { color: var(--muted); font-size: 13.5px; margin: 6px 0 20px; }
.login-card input { width: 100%; background: rgba(0,0,0,.28); border: 1px solid var(--card-brd);
  border-radius: 13px; padding: 14px 15px; font-size: 16px; color: var(--text); margin-bottom: 11px; }
.login-card input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
.pass-wrap { position: relative; margin-bottom: 11px; }
.pass-wrap input { margin-bottom: 0 !important; padding-right: 50px; }
.eye { position: absolute; right: 4px; top: 0; bottom: 0; width: 46px; border: none;
  background: none; color: var(--muted); font-size: 19px; display: grid; place-items: center; }
.eye:active { color: var(--text); }
.login-err { color: var(--red); font-size: 13px; margin: -2px 0 10px; }
#login-btn { width: 100%; margin-top: 6px; border: none; color: #fff; font-size: 16px; font-weight: 800;
  padding: 15px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 28px rgba(91,140,255,.4); transition: transform .12s, opacity .2s; }
#login-btn:active { transform: scale(.97); }
#login-btn:disabled { opacity: .6; }

/* Segmented sort control */
.seg { display: flex; gap: 4px; margin-top: 12px; background: rgba(0,0,0,.28);
  padding: 4px; border-radius: 12px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 7px 4px; border-radius: 9px;
  transition: all .2s; }
.seg button.active { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* Filter pills */
.filters { display: flex; gap: 7px; margin-top: 9px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1px solid var(--card-brd); background: var(--card);
  color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 999px; transition: all .2s; }
.filters button.active { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); }

/* ---------- List ---------- */
.list { padding: 14px 14px 130px; max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px; }
.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty-emoji { font-size: 46px; margin-bottom: 8px; }
.empty p { margin: 4px 0; }

/* Quarantine banner */
.quar-banner { background: rgba(255,93,108,.08); border: 1px solid rgba(255,93,108,.3);
  border-radius: 14px; padding: 12px 14px; }
.quar-banner .qh { font-size: 13px; font-weight: 800; color: var(--red); margin-bottom: 6px; }
.quar-banner .qr { font-size: 12px; color: var(--muted); padding: 3px 0; line-height: 1.4; }
.quar-banner .qr b { color: var(--text); }

/* Card */
.card { position: relative; background: var(--card); border: 1px solid var(--card-brd);
  border-radius: var(--r); padding: 15px; overflow: hidden;
  transition: transform .14s, border-color .2s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card:active { transform: scale(.985); border-color: rgba(91,140,255,.4); }
.card-top { display: flex; align-items: baseline; gap: 8px; }
.rank { font-size: 12px; font-weight: 800; color: var(--faint);
  background: rgba(255,255,255,.06); border-radius: 7px; padding: 2px 7px; }
.sym { font-size: 20px; font-weight: 850; letter-spacing: -.02em; }
.co { font-size: 11.5px; color: var(--muted); margin-left: auto; max-width: 48%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.row2 { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.price { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.pill { font-size: 13.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.pill.up { color: var(--green); background: rgba(41,214,126,.13); }
.pill.down { color: var(--red); background: rgba(255,93,108,.13); }
.vchip { margin-left: auto; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; }
.v-strong_interest { color: var(--green); background: rgba(41,214,126,.15); }
.v-moderate_interest { color: var(--accent); background: rgba(91,140,255,.16); }
.v-watch { color: var(--amber); background: rgba(255,194,75,.15); }
.v-avoid { color: var(--red); background: rgba(255,93,108,.15); }

.spark-wrap { margin: 11px -2px 2px; }
.spark { width: 100%; height: 50px; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip { font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.05);
  border: 1px solid var(--card-brd); border-radius: 9px; padding: 5px 9px; }
.chip b { color: var(--text); font-weight: 700; }
.chip.tag { color: var(--accent); border-color: rgba(91,140,255,.3); background: rgba(91,140,255,.08); }
.chip.halal-ok { color: var(--green); border-color: rgba(41,214,126,.3); background: rgba(41,214,126,.08); }
.chip.halal-no { color: var(--red); border-color: rgba(255,93,108,.3); background: rgba(255,93,108,.08); }
.chip.halal-rev { color: var(--amber); border-color: rgba(255,194,75,.3); background: rgba(255,194,75,.08); }

/* ---------- FAB (alive) ---------- */
.fab { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 18px); z-index: 25;
  border: none; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .01em;
  padding: 15px 32px; border-radius: 999px; overflow: hidden; isolation: isolate;
  background: linear-gradient(120deg, #5b8cff, #7a5cff, #4cc2ff, #5b8cff);
  background-size: 280% 280%;
  animation: fabGrad 6s ease infinite, fabPulse 2.4s ease-in-out infinite;
  will-change: transform; }
.fab::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-130%); animation: fabShine 3.4s ease-in-out 1.2s infinite; }
@keyframes fabGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes fabPulse {
  0%,100% { transform: translateX(-50%) scale(1);
    box-shadow: 0 8px 24px rgba(91,140,255,.45), inset 0 1px 0 rgba(255,255,255,.3); }
  50% { transform: translateX(-50%) scale(1.05);
    box-shadow: 0 16px 44px rgba(122,92,255,.7), 0 0 0 7px rgba(91,140,255,.12), inset 0 1px 0 rgba(255,255,255,.4); }
}
@keyframes fabShine { 0% { transform: translateX(-130%); } 55%,100% { transform: translateX(130%); } }
.fab:active { animation: none; transform: translateX(-50%) scale(.93);
  box-shadow: 0 6px 18px rgba(91,140,255,.5); }
.fab:disabled { animation: none; opacity: .55; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) {
  .fab { animation: none; transform: translateX(-50%); }
  .fab::after { animation: none; }
}

/* ---------- Progress overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(4,6,12,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.progress-card { width: 80%; max-width: 320px; background: var(--bg2);
  border: 1px solid var(--card-brd); border-radius: 20px; padding: 26px 22px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.spinner { width: 38px; height: 38px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage { font-size: 14px; font-weight: 600; min-height: 20px; }
.track { height: 7px; background: rgba(255,255,255,.08); border-radius: 6px; margin: 14px 0 6px; overflow: hidden; }
.track-fill { height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .35s; }
.pctline { font-size: 11.5px; color: var(--muted); }
.cancel-btn { margin-top: 18px; width: 100%; border: 1px solid rgba(255,93,108,.4);
  background: rgba(255,93,108,.1); color: var(--red); font-size: 14px; font-weight: 700;
  padding: 11px; border-radius: 12px; transition: transform .12s; }
.cancel-btn:active { transform: scale(.96); }
.cancel-btn:disabled { opacity: .6; }

/* ---------- Sheets ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(2,4,10,.55);
  backdrop-filter: blur(2px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--bg2); border-top-left-radius: 26px; border-top-right-radius: 26px;
  border-top: 1px solid var(--card-brd); max-height: 88vh; display: flex; flex-direction: column;
  padding-bottom: calc(var(--safe-b) + 8px);
  box-shadow: 0 -16px 50px rgba(0,0,0,.55);
  animation: slideup .32s cubic-bezier(.2,.9,.25,1); }
.sheet.sheet-tall { height: 74vh; max-height: 74vh; }
.sheet-tall .grabber { margin-top: 14px; }
.sheet-tall .sheet-head { padding-top: 12px; }
/* Monitor needs room for holdings, but stay clear of the iOS Safari address
   bar at the top so the ✕ close button is always visible/tappable. */
.sheet#monitor { height: 80vh; max-height: 80vh; }
@keyframes slideup { from { transform: translateY(100%); } }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2);
  margin: 9px auto 4px; flex: none; }
.sheet-x { position: absolute; top: 12px; right: 14px; z-index: 2; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.16);
  color: var(--text); font-size: 17px; font-weight: 700; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-x:active { background: rgba(255,255,255,.28); transform: scale(.92); }
/* When the ✕ lives inside the header row, sit it on the title line (not pinned
   to the very top edge), right-aligned like a normal header action. */
.sheet-head .sheet-x { position: static; margin-left: auto; }
.sheet-head { display: flex; align-items: center; padding: 6px 18px 10px; flex: none; }
.sheet-head h2 { font-size: 18px; font-weight: 800; margin: 0; }
.done { margin-left: auto; border: none; background: transparent; color: var(--accent);
  font-size: 16px; font-weight: 700; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px 18px; }

/* Settings rows */
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--card-brd); font-size: 15px; }
.row:last-child { border-bottom: none; }
.row > span { color: var(--text); }
.row small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.row select { background: var(--card); color: var(--text); border: 1px solid var(--card-brd);
  border-radius: 11px; padding: 10px 12px; font-size: 15px; min-width: 130px; }
/* iOS switch */
.switch { position: relative; width: 52px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: rgba(255,255,255,.16); border-radius: 999px;
  transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  background: #fff; border-radius: 50%; transition: transform .25s; box-shadow: 0 2px 5px rgba(0,0,0,.3); }
.switch input:checked + i { background: linear-gradient(135deg, var(--green), var(--green-d)); }
.switch input:checked + i::after { transform: translateX(21px); }

/* ---------- Detail sheet content ---------- */
.d-hero { display: flex; align-items: flex-start; gap: 10px; }
.d-sym { font-size: 26px; font-weight: 850; letter-spacing: -.02em; }
.d-co { font-size: 12.5px; color: var(--muted); }
.d-price { margin-left: auto; text-align: right; }
.d-price .p { font-size: 22px; font-weight: 800; }
.d-bigspark { width: 100%; height: 96px; margin: 14px 0 6px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.stat { background: var(--card); border: 1px solid var(--card-brd); border-radius: 13px; padding: 11px 12px; }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .val { font-size: 17px; font-weight: 800; margin-top: 2px; }
.section { margin-top: 20px; }
.section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
  margin: 0 0 9px; }
.verdict-box { background: var(--card); border: 1px solid var(--card-brd); border-radius: 14px; padding: 14px; }
.verdict-box .read { font-size: 14px; line-height: 1.55; color: #dde6f5; margin: 10px 0 0; }
.bul { margin: 8px 0 0; padding: 0; list-style: none; }
.bul li { font-size: 13.5px; line-height: 1.5; padding-left: 18px; position: relative; margin-top: 5px; color: #d2dcee; }
.bul li::before { position: absolute; left: 0; top: -1px; }
.bul.good li::before { content: "✓"; color: var(--green); }
.bul.bad li::before { content: "!"; color: var(--red); font-weight: 800; }
.nextstep { margin-top: 12px; font-size: 13.5px; background: rgba(91,140,255,.1);
  border: 1px solid rgba(91,140,255,.25); border-radius: 11px; padding: 10px 12px; }
.kv { display: flex; justify-content: space-between; font-size: 13.5px; padding: 9px 0;
  border-bottom: 1px solid var(--card-brd); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; }
.dd-list { background: var(--card); border: 1px solid var(--card-brd); border-radius: 13px;
  overflow: hidden; max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dd-row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.04); }
.dd-row:last-child { border-bottom: none; }
.dd-date { color: var(--muted); flex: 1; }
.dd-close { color: var(--text); font-weight: 600; }
.dd-chg { min-width: 64px; text-align: right; font-weight: 800; }
.dd-chg.ddg { color: var(--green); } .dd-chg.ddr { color: var(--red); }

.newsitem { display: block; background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 12px; padding: 11px 12px; margin-top: 9px; color: var(--text); text-decoration: none; }
.newsitem .h { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.newsitem .s { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.note { font-size: 12.5px; color: var(--amber); margin-top: 6px; }

/* ---------- Basket ---------- */
.basket-opts { display: flex; gap: 10px; }
.basket-opts .row { flex: 1; border-bottom: none; padding: 0 0 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
.basket-opts .row select, .basket-opts .row .num-in { width: 100%; }
.num-in { background: var(--card); color: var(--text); border: 1px solid var(--card-brd);
  border-radius: 11px; padding: 10px 12px; font-size: 15px; font-weight: 700;
  -moz-appearance: textfield; }
.num-in::-webkit-outer-spin-button, .num-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.picker { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.mc-add { display: flex; gap: 8px; margin: 0 0 12px; }
.mc-add .num-in { flex: 1; text-transform: uppercase; }
.mc-add-btn { flex: none; border: 1px solid rgba(91,140,255,.4); background: rgba(91,140,255,.12);
  color: var(--accent); font-weight: 700; font-size: 14px; padding: 0 16px; border-radius: 12px; }
.mc-add-btn:disabled { opacity: .6; }
.pick-toggle { display: flex; align-items: center; gap: 11px; background: var(--card);
  border: 1px solid var(--card-brd); border-radius: 12px; padding: 10px 12px; transition: all .15s; }
.pick-toggle.on { border-color: rgba(91,140,255,.5); background: rgba(91,140,255,.08); }
.pick-toggle .box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--faint);
  display: grid; place-items: center; font-size: 13px; color: #fff; }
.pick-toggle.on .box { background: var(--accent); border-color: var(--accent); }
.pick-toggle .pinfo { min-width: 0; flex: 1; }
.pick-toggle .ps { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.pick-toggle .r2 { font-size: 10.5px; font-weight: 700; color: var(--accent);
  background: rgba(91,140,255,.12); border-radius: 6px; padding: 2px 6px; }
.pick-toggle .pc { font-size: 11.5px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.amt-wrap { flex: none; display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,.25);
  border: 1px solid var(--card-brd); border-radius: 10px; padding: 6px 8px; color: var(--muted); font-size: 13px; }
.amt-wrap .amt { width: 64px; background: transparent; border: none; color: var(--text);
  font-size: 14px; font-weight: 700; text-align: right; -moz-appearance: textfield; }
.amt-wrap .amt::-webkit-outer-spin-button, .amt-wrap .amt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.run-inline { width: 100%; border: none; color: #fff; font-size: 15px; font-weight: 800; padding: 14px;
  border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px rgba(91,140,255,.35); }
.run-inline:disabled { opacity: .55; }
.basket-best { border-radius: 14px; padding: 13px 14px; margin-top: 14px; border: 1px solid var(--card-brd); background: var(--card); }
.basket-best.profit { border-color: rgba(41,214,126,.4); background: rgba(41,214,126,.07); }
.basket-best.risk { border-color: rgba(91,140,255,.4); background: rgba(91,140,255,.07); }
.basket-best.low { border-color: rgba(255,194,75,.4); background: rgba(255,194,75,.07); }
.basket-best .bt { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.basket-best .bc { font-size: 16px; font-weight: 850; margin: 4px 0 6px; }
.basket-best .bm { font-size: 13px; color: #dde6f5; }
.basket-tbl { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12.5px; }
.basket-tbl th { color: var(--faint); font-weight: 600; text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--card-brd); }
.basket-tbl th:first-child, .basket-tbl td:first-child { text-align: left; }
.basket-tbl td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.04); text-align: right; }
.basket-tbl td b { font-weight: 700; }

/* ---------- Monitor ---------- */
.action-row { flex-wrap: wrap; }
.act-btn { flex: 1 1 45%; }
.saved { background: var(--card); border: 1px solid var(--card-brd); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; }
.saved .g { color: var(--green); } .saved .r { color: var(--red); }
.saved-head { display: flex; align-items: flex-start; gap: 8px; }
.saved-name { font-size: 16px; font-weight: 800; }
.off-mkt { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  vertical-align: middle; padding: 2px 6px; border-radius: 6px; margin-left: 6px;
  color: #b8860b; background: rgba(255,193,7,.16); }
.off-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer; }
.off-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.off-track { position: relative; width: 32px; height: 18px; border-radius: 9px; background: var(--muted);
  flex: none; transition: background .15s; }
.off-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.off-toggle input:checked + .off-track { background: #c79100; }
.off-toggle input:checked + .off-track::after { transform: translateX(14px); }
.off-lbl { font-size: 10.5px; color: var(--muted); }
.saved-date { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.saved-del { margin-left: auto; background: none; border: none; color: var(--faint); font-size: 17px; flex: none; }
.saved-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 13px 0; }
.saved-totals .lbl { font-size: 10px; color: var(--muted); }
.saved-totals .val { font-size: 14.5px; font-weight: 800; margin-top: 3px; }
.saved-realized { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px;
  color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--card-brd);
  border-radius: 11px; padding: 9px 12px; margin-bottom: 12px; }
.saved-realized b { font-size: 13.5px; }
.saved-holdings { border-top: 1px solid var(--card-brd); padding-top: 6px;
  max-height: 230px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sh { display: flex; flex-direction: column; gap: 2px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.04); }
.sh:last-child { border-bottom: none; }
.sh-row { display: flex; align-items: center; gap: 8px; }
.shs { font-weight: 800; font-size: 14px; min-width: 50px; }
.shi { color: var(--text); font-size: 12.5px; font-weight: 600; }
.shg { margin-left: auto; font-weight: 800; font-size: 12.5px; text-align: right; }
.sh-gain { margin-left: auto; font-weight: 850; font-size: 16px; letter-spacing: -.01em; }
.sh-sub { font-size: 11.5px; color: var(--muted); }
.sh { cursor: pointer; border-radius: 8px; transition: background .12s; }
.sh:active { background: rgba(255,255,255,.04); }
.sh-chev { color: var(--faint); font-size: 18px; font-weight: 700; margin-left: 8px; }
.saved-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.saved-refresh, .saved-upload, .saved-analyze { width: 100%; border: 1px solid var(--card-brd);
  background: rgba(255,255,255,.05); color: var(--text); font-weight: 700; font-size: 14px;
  padding: 11px; border-radius: 11px; }
.saved-upload { border-color: rgba(91,140,255,.4); background: rgba(91,140,255,.1); color: var(--accent); }
.saved-analyze { border-color: rgba(201,145,0,.45); background: rgba(201,145,0,.12); color: #d9a521; }
.saved-refresh:disabled { opacity: .6; }
.saved-upload:disabled { opacity: .4; cursor: not-allowed; }
/* basket analysis panel */
.basket-analysis { margin-top: 12px; padding: 12px; border: 1px solid var(--card-brd);
  border-radius: 12px; background: rgba(255,255,255,.03); }
.ba-cards { display: flex; gap: 8px; }
.ba-card { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--card-brd); }
.ba-card.up { border-color: rgba(41,214,126,.35); background: rgba(41,214,126,.08); }
.ba-card.down { border-color: rgba(255,93,108,.35); background: rgba(255,93,108,.08); }
.ba-lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ba-main { font-size: 14px; font-weight: 700; }
.ba-sym { font-weight: 800; margin-right: 4px; }
.ba-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.ba-rank-title { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 12px 0 6px; }
.ba-row { display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 5px 0; border-top: 1px solid var(--card-brd); }
.ba-rank { width: 18px; color: var(--muted); font-size: 11px; flex: none; text-align: right; }
.basket-analysis .g { color: var(--green); font-weight: 700; }
.basket-analysis .r { color: var(--red); font-weight: 700; }
.pnl-trend { margin-top: 12px; }
.pnl-lbl { font-size: 11px; color: var(--muted); margin-bottom: 2px; }

/* Monitor create picker */
.mc-item { background: var(--card); border: 1px solid var(--card-brd); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; transition: border-color .15s, background .15s; }
.mc-item.on { border-color: rgba(91,140,255,.5); background: rgba(91,140,255,.07); }
.mc-top { display: flex; align-items: center; gap: 11px; }
.mc-box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--faint);
  display: grid; place-items: center; font-size: 13px; color: #fff; }
.mc-item.on .mc-box { background: var(--accent); border-color: var(--accent); }
.mc-fields { display: none; gap: 10px; margin-top: 10px; }
.mc-item.on .mc-fields { display: flex; }
.mc-fields label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.mc-fields input { background: rgba(0,0,0,.25); border: 1px solid var(--card-brd); border-radius: 10px;
  padding: 9px 11px; font-size: 15px; font-weight: 700; color: var(--text); width: 100%; }

/* ---------- Chat ---------- */
.chat-log { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 12px;
  display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; }
.bubble.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--card-brd);
  border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; color: #fff; border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.bubble.typing { color: var(--muted); }
.chat-input { display: flex; gap: 8px; padding: 10px 14px calc(var(--safe-b) + 10px);
  border-top: 1px solid var(--card-brd); flex: none; background: var(--bg2); }
.chat-input input { flex: 1; background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 999px; padding: 12px 16px; color: var(--text); font-size: 15px; }
.chat-input button { width: 44px; height: 44px; flex: none; border: none; border-radius: 50%;
  color: #fff; font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.chat-input button:disabled { opacity: .5; }

.settings-run { margin-top: 18px; }

.saved-account{margin:12px 0 8px;padding:13px 15px;border-radius:14px;background:linear-gradient(135deg,#161a30,#222743);border:1px solid #2c3157}
.saved-account .acct-top{display:flex;justify-content:space-between;align-items:center}
.saved-account .acct-lbl{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:#9aa3c7}
.saved-account .acct-mode{font-size:10px;color:#8089b0;background:#2a2f52;padding:2px 9px;border-radius:999px}
.saved-account .acct-mode.om{color:#d7b15a;background:#3a3017}
.saved-account .acct-val{font-size:25px;font-weight:800;color:#fff;margin-top:3px}
.saved-account .acct-sub{font-size:12px;color:#9aa3c7;margin-top:3px}
