:root{
  --bg:#f6f7fb; --card:#fff; --ink:#161b2d; --muted:#71798c; --line:#e8ebf3;
  --brand:#cb2ee6; --brand2:#6757ff; --cyan:#17b7c8; --green:#2563eb; --red:#f97316; --amber:#d97706;
  --shadow:0 18px 55px rgba(22,27,45,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:radial-gradient(circle at top left,rgba(203,46,230,.11),transparent 30%),radial-gradient(circle at bottom right,rgba(103,87,255,.12),transparent 28%),var(--bg);color:var(--ink)}
button,input,select{font:inherit} button{cursor:pointer;border:0}
.app{display:grid;grid-template-columns:285px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:rgba(255,255,255,.86);border-right:1px solid var(--line);padding:24px;backdrop-filter:blur(18px)}
.brand{display:flex;gap:14px;align-items:center;margin-bottom:30px}.brand-logo{width:48px;height:48px;border-radius:18px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;display:grid;place-items:center;font-weight:900;font-size:24px;box-shadow:var(--shadow)}.brand-name{font-weight:900;font-size:22px}.brand-subtitle{font-size:12px;color:var(--muted)}
.nav{display:flex;flex-direction:column;gap:8px}.nav-btn{background:transparent;color:var(--muted);text-align:left;padding:14px 16px;border-radius:16px;transition:.18s}.nav-btn:hover{background:#f2efff;color:var(--brand2)}.nav-btn.active{background:linear-gradient(135deg,rgba(203,46,230,.14),rgba(103,87,255,.12));color:var(--brand);font-weight:850}
.side-card{margin-top:28px;background:#101828;color:#fff;border-radius:24px;padding:18px;box-shadow:var(--shadow)}.side-card p{color:#d7dbea;line-height:1.5}.side-label{display:inline-block;background:rgba(255,255,255,.12);padding:6px 10px;border-radius:99px;font-size:12px;margin-bottom:10px}
.main{padding:28px;max-width:1600px;width:100%}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:16px}.topbar h1{margin:0;font-size:34px}.eyebrow{text-transform:uppercase;letter-spacing:.08em;color:var(--brand2);font-weight:850;font-size:12px;margin-bottom:8px}.eyebrow.light{color:rgba(255,255,255,.75)}
.top-actions{display:flex;gap:10px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:8px;box-shadow:var(--shadow)}.top-actions input{min-width:300px;border:0;outline:0;padding:10px}
.primary,.secondary,.text-btn{border-radius:14px;padding:12px 18px;font-weight:850}.primary{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff}.secondary{background:#f0edff;color:var(--brand2)}.text-btn{background:transparent;color:var(--brand2)}.primary:disabled,.secondary:disabled,.text-btn:disabled,button:disabled{cursor:not-allowed;opacity:.48;filter:grayscale(.75);box-shadow:none}.small{padding:9px 13px}.full{width:100%;margin-top:16px}
.page{display:none;animation:fade .2s ease}.page.active{display:block}@keyframes fade{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
.panel,.hero-panel,.theme-card,.event-card{background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow)}.panel{padding:24px;margin-bottom:18px}.wide{max-width:1100px}.hero-grid{display:grid;grid-template-columns:2fr 1fr;gap:20px;margin-bottom:22px}.hero-panel{padding:34px;color:#fff;background:linear-gradient(135deg,rgba(203,46,230,.94),rgba(103,87,255,.86)),radial-gradient(circle at top right,rgba(255,255,255,.28),transparent 40%)}.hero-panel h2{font-size:44px;margin:0 0 10px}.hero-panel p{color:rgba(255,255,255,.84);line-height:1.6}.pulse-row{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:22px}.pulse-row div{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.24);border-radius:18px;padding:15px}.pulse-row span{display:block;opacity:.75;font-size:13px}.pulse-row b{font-size:24px;display:block;margin-top:6px}
.section-head{display:flex;justify-content:space-between;align-items:end;margin:22px 0 14px;gap:14px}.section-head h2,.panel h2,.panel h3{margin:0 0 8px}.muted{color:var(--muted);line-height:1.55}.theme-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.theme-card{padding:20px;transition:.18s}.theme-card:hover{transform:translateY(-3px);border-color:rgba(103,87,255,.35)}.theme-top{display:flex;justify-content:space-between;gap:12px}.theme-icon{font-size:30px}.theme-card h3{margin:8px 0 4px}.theme-score{width:58px;height:58px;border-radius:20px;background:#f1eeff;color:var(--brand2);display:grid;place-items:center;font-weight:900;font-size:22px}.mini-chart{min-height:122px;border-radius:18px;background:linear-gradient(180deg,#f1efff,#fff);position:relative;overflow:hidden;margin:16px 0;padding:10px}
.section-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.home-theme-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}.home-theme-title{display:flex;align-items:center;gap:10px;min-width:0}.home-theme-title h3{margin:0}.ticker-pill-btn{padding:7px 10px;border:1px solid var(--line);background:#f8f9fc;border-radius:99px;color:var(--muted);font-size:13px}.ticker-pill-btn:hover,.ticker-pill-btn.active{border-color:rgba(103,87,255,.45);color:var(--brand2);background:#f2efff}.ticker-pill-btn.active{font-weight:900;box-shadow:0 0 0 3px rgba(103,87,255,.08)}
.tag-list,.ticker-pills{display:flex;flex-wrap:wrap;gap:8px}.tag-list span,.ticker-pills span{padding:7px 10px;border:1px solid var(--line);background:#f8f9fc;border-radius:99px;color:var(--muted);font-size:13px}
.brand-life-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.brand-life-grid div{border:1px solid var(--line);border-radius:14px;background:#fbfcff;padding:11px}.brand-life-grid span{display:block;color:var(--muted);font-size:12px;font-weight:850}.brand-life-grid b{display:block;font-size:24px;margin-top:4px}
.choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:22px}.picker-head{display:flex;justify-content:space-between;align-items:center;margin-top:22px}.choice{padding:16px;min-height:90px;border-radius:20px;border:1px solid var(--line);background:#fff;text-align:left;transition:.18s}.choice:hover{transform:translateY(-2px)}.choice.selected{border-color:var(--brand);background:linear-gradient(135deg,rgba(203,46,230,.12),rgba(103,87,255,.1));color:var(--brand);font-weight:850}.choice strong{display:block;margin-top:9px}
.choice.locked{cursor:not-allowed;border-color:rgba(103,87,255,.35);box-shadow:0 0 0 3px rgba(103,87,255,.08)}.choice small{display:block;color:var(--muted);font-size:11px;font-weight:800;margin-top:5px}
.two-col,.scenario-layout,.portfolio-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.map-canvas{height:320px;border-radius:24px;background:radial-gradient(circle at 50% 50%,rgba(103,87,255,.14),transparent 24%),linear-gradient(135deg,#f9faff,#fff);position:relative;overflow:hidden}.map-node{position:absolute;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:99px;padding:10px 14px;font-weight:850}
.theme-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}.theme-tab{background:#fff;color:var(--muted);border:1px solid var(--line);border-radius:99px;padding:10px 14px;font-weight:850}.theme-tab.active{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-color:transparent}.workspace{display:grid;grid-template-columns:1fr 365px;gap:18px}.workspace-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.big-score{text-align:center;background:#f4f1ff;color:var(--brand2);border-radius:20px;padding:14px;min-width:150px}.big-score span{display:block;font-size:12px;color:var(--muted)}.big-score b{font-size:28px}.ticker-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ticker-card{border:1px solid var(--line);border-radius:22px;background:#fff;padding:16px}.ticker-card.active{border-color:var(--brand2);box-shadow:0 0 0 3px rgba(103,87,255,.11)}.ticker-head{display:flex;justify-content:space-between}.ticker-head h3{margin:0}.score-chip{background:#f0edff;color:var(--brand2);font-weight:900;border-radius:99px;padding:7px 9px}.metric-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:14px}.metric{background:#f8f9fc;border:1px solid var(--line);border-radius:14px;padding:10px}.metric span{display:block;color:var(--muted);font-size:12px}.metric b{font-size:18px}.sticky{position:sticky;top:18px}.right-list-title{font-weight:900;margin:18px 0 8px}.ticker-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px;border:1px solid var(--line);background:#fbfcff;border-radius:14px;margin-bottom:8px}.ticker-row input{width:18px;height:18px;accent-color:var(--brand)}.ticker-row .mini{font-size:12px;color:var(--muted)}.remove-btn{background:#fff7ed;color:var(--red);border-radius:99px;padding:7px 9px;font-weight:800}.add-chip{display:flex;gap:10px;align-items:center}.table-wrap{overflow:auto}.table-panel{min-width:0}table{width:100%;border-collapse:collapse}th,td{text-align:left;border-bottom:1px solid var(--line);padding:11px 10px;white-space:nowrap}th{font-size:13px;color:var(--muted);font-weight:900}.positive{color:var(--green)}.negative{color:var(--red)}.neutral{color:var(--amber)}
.metric-toggles{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.metric-toggle{background:#f6f7fb;border:1px solid var(--line);border-radius:99px;padding:8px 10px;font-size:13px}.metric-toggle.active{background:#101828;color:#fff;border-color:#101828}.trend-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.trend-controls select,select{border:1px solid var(--line);background:#fff;color:#111827;border-radius:12px;padding:10px}.button-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.commentary{font-size:17px;line-height:1.6;color:#30384d}
.brand-title-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.brand-search{width:100%;border:1px solid var(--line);border-radius:14px;background:#fff;padding:11px 12px;margin:12px 0 14px;outline:0}.brand-search:focus{border-color:rgba(103,87,255,.55);box-shadow:0 0 0 3px rgba(103,87,255,.1)}.brand-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.brand-card{border:1px solid var(--line);border-radius:14px;background:#fff;padding:11px;display:flex;flex-direction:column;gap:8px;min-height:112px}.brand-main{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start}.brand-card h3{margin:0;font-size:15px;line-height:1.25}.brand-sentiment{margin:0;color:var(--muted);font-size:12px;font-weight:850;grid-column:1/3}.brand-sentiment.like{color:var(--green)}.brand-sentiment.dislike{color:var(--red)}.brand-use{display:flex;gap:7px;align-items:center;color:var(--muted);font-weight:800;font-size:13px;margin-top:auto}.brand-use input{width:16px;height:16px;accent-color:var(--brand)}.brand-actions{display:flex;gap:6px}.brand-btn{border:1px solid var(--line);background:#f8f9fc;color:var(--muted);border-radius:999px;font-weight:900}.brand-btn.icon{width:30px;height:30px;padding:0;display:grid;place-items:center;font-size:18px;line-height:1}.brand-btn.active{background:var(--green);color:#fff;border-color:var(--green);box-shadow:0 0 0 3px rgba(37,99,235,.18)}.brand-btn.dislike{background:var(--red);color:#fff;border-color:var(--red);box-shadow:0 0 0 3px rgba(249,115,22,.18)}
.event-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.event-card{padding:18px}.event-meta{display:flex;justify-content:space-between;margin-top:14px}
.slider-line{margin:20px 0}.slider-line label{display:flex;justify-content:space-between;font-weight:850;margin-bottom:8px}.slider-line input{width:100%;accent-color:var(--brand)}.impact-list{display:flex;flex-direction:column;gap:10px}.impact-row{display:flex;justify-content:space-between;align-items:center;background:#fbfcff;border:1px solid var(--line);border-radius:16px;padding:13px}.bar{width:150px;height:9px;background:#e9ecf5;border-radius:99px;overflow:hidden}.fill{height:100%;background:linear-gradient(90deg,var(--brand),var(--cyan))}
canvas{display:block;width:100%;max-width:100%;background:linear-gradient(180deg,#fbfbff,#fff);border:1px solid var(--line);border-radius:22px}.toast{position:fixed;right:22px;bottom:22px;background:#101828;color:#fff;padding:14px 18px;border-radius:16px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transform:translateY(10px);transition:.2s}.toast.show{opacity:1;transform:translateY(0)}
#portfolioTrendChart{height:300px!important}
#portfolioPriceChart{height:260px!important}
.data-status{margin-top:10px;background:rgba(11,14,22,.96);color:#fff;border:1px solid rgba(255,255,255,.14);border-radius:14px;padding:10px 12px;box-shadow:0 14px 36px rgba(0,0,0,.18);opacity:0;pointer-events:none;transform:translateY(-4px);transition:.18s;font-weight:850;font-size:12px;line-height:1.4}.data-status.show{opacity:1;transform:translateY(0)}
@media(max-width:1150px){.app{grid-template-columns:1fr}.sidebar{height:auto;position:relative}.nav{flex-direction:row;flex-wrap:wrap}.workspace,.hero-grid,.two-col,.scenario-layout,.portfolio-grid,.portfolio-analysis-grid{grid-template-columns:1fr}.portfolio-analysis-grid > .panel{height:auto;min-height:0}.allocation-panel canvas{height:300px}.sticky{position:relative;top:0}.theme-grid,.event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.main{padding:18px}.topbar{flex-direction:column;align-items:stretch}.top-actions input{min-width:0;width:100%}.top-actions{flex-direction:column}.theme-grid,.event-grid,.choice-grid,.ticker-card-grid,.brand-grid{grid-template-columns:1fr}.pulse-row{grid-template-columns:1fr}.hero-panel h2{font-size:32px}}

/* Dark first-page experience inspired by the Naviquity launch concept */
.sidebar {
  background: #050507;
  border-right: 1px solid rgba(255,255,255,.1);
  color: #fff;
}

.brand-logo {
  background: linear-gradient(135deg,#9f35ff,#2f73ff);
  box-shadow: 0 0 30px rgba(103,87,255,.32);
}

.brand-name {
  color: #fff;
}

.brand-subtitle {
  color: rgba(255,255,255,.58);
}

.nav-btn {
  color: rgba(255,255,255,.68);
}

.nav-btn:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-btn.active {
  background: linear-gradient(135deg,rgba(203,46,230,.28),rgba(47,115,255,.22));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.nav-btn.locked {
  opacity: .42;
}

body[data-page="welcome"] {
  background: #020204;
}

body[data-page="welcome"] .main {
  max-width: none;
  padding: 0;
}

body[data-page="welcome"] .topbar {
  display: none;
}

body[data-page="welcome"] .side-card {
  display: none;
}

#welcome {
  color: #fff;
}

.welcome-stage {
  min-height: 100vh;
  padding: 22px clamp(22px,5vw,76px) 34px;
  background:
    radial-gradient(circle at 78% 32%, rgba(47,115,255,.22), transparent 23%),
    radial-gradient(circle at 50% 22%, rgba(203,46,230,.12), transparent 25%),
    linear-gradient(180deg,#020204,#050508 58%,#020204);
  overflow: hidden;
}

.welcome-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.welcome-brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}

.welcome-brand-mark span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg,#9f35ff,#2f73ff);
  box-shadow: 0 0 34px rgba(103,87,255,.36);
  font-weight: 950;
}

.welcome-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.welcome-nav-links button,
.welcome-demo {
  background: transparent;
  color: rgba(255,255,255,.86);
  font-size: 16px;
}

.welcome-nav-links button:hover,
.welcome-demo:hover {
  color: #fff;
}

.welcome-cta {
  border-radius: 999px;
  padding: 15px 28px;
  background: linear-gradient(135deg,#b133ff,#2f73ff);
  color: #fff;
  box-shadow: 0 12px 34px rgba(47,115,255,.28), 0 0 32px rgba(177,51,255,.24);
  font-weight: 850;
}

.welcome-cta.small {
  padding: 12px 20px;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(360px,.9fr) minmax(420px,1.1fr);
  gap: clamp(28px,5vw,86px);
  align-items: center;
  min-height: clamp(470px, calc(100vh - 250px), 620px);
  position: relative;
}

.welcome-copy {
  position: relative;
  z-index: 2;
}

.welcome-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(48px,6vw,82px);
  line-height: 1.08;
  font-weight: 560;
  letter-spacing: 0;
}

.welcome-copy h2 span {
  background: linear-gradient(90deg,#3a75ff,#d33af2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-copy p {
  max-width: 570px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.67);
  font-size: 21px;
  line-height: 1.55;
}

.welcome-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}

body[data-page="getting-started"] .topbar {
  display: none;
}

body[data-page="themes"] .workspace {
  grid-template-columns: 1fr;
}

.getting-started-page {
  display: grid;
  gap: 22px;
  border: 1px solid rgba(92,115,148,.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 12%, rgba(124,58,237,.28), transparent 30%),
    linear-gradient(135deg, rgba(6,14,28,.98), rgba(4,11,21,.98));
  padding: 38px;
  color: #fff;
}

.onboarding-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, .9fr);
  gap: 34px;
  align-items: center;
}

.onboarding-hero span:first-child {
  display: block;
  color: #8b5cf6;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.onboarding-hero h2 {
  margin: 0 0 18px;
  font-size: 36px;
  line-height: 1.08;
  color: #fff;
}

.onboarding-hero p,
.getting-started-steps p,
.research-disclosure {
  color: rgba(226,232,240,.82);
}

.onboarding-hero p {
  margin: 0;
  max-width: 440px;
  font-size: 18px;
  line-height: 1.45;
}

.onboarding-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 12px;
}

.onboarding-hero-actions button {
  min-width: 220px;
  min-height: 58px;
  border-radius: 8px;
  font-weight: 950;
}

.onboarding-existing {
  font-size: 14px !important;
}

.onboarding-existing button {
  border: 0;
  background: transparent;
  color: #8b5cf6;
  font-weight: 900;
  padding: 0 0 0 6px;
}

.onboarding-visual {
  position: relative;
  min-height: 260px;
}

.onboarding-laptop {
  position: absolute;
  right: 60px;
  top: 48px;
  width: 310px;
  height: 175px;
  border: 1px solid rgba(148,163,184,.32);
  border-radius: 14px 14px 8px 8px;
  background: #050b16;
  box-shadow: 0 0 70px rgba(124,58,237,.58);
  padding: 12px;
}

.onboarding-laptop:after {
  content: "";
  position: absolute;
  left: -22px;
  right: -22px;
  bottom: -20px;
  height: 18px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(90deg, #18243a, #334155, #111827);
}

.onboarding-screen {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, #071426, #0d1b31);
  padding: 14px;
}

.mini-dashboard-head,
.mini-dashboard-grid span,
.mini-dashboard-chart,
.mini-dashboard-scale span {
  display: block;
  border-radius: 8px;
  background: rgba(59,130,246,.28);
}

.mini-dashboard-head { width: 42%; height: 12px; margin-bottom: 14px; }
.mini-dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mini-dashboard-grid span { height: 28px; }
.mini-dashboard-chart { height: 58px; background: linear-gradient(135deg, rgba(37,99,235,.45), rgba(34,197,94,.36)); }
.mini-dashboard-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mini-dashboard-scale span { height: 10px; background: rgba(34,197,94,.45); }

.onboarding-orb {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-style: normal;
  font-size: 25px;
  border: 1px solid rgba(255,255,255,.16);
}

.onboarding-orb.green { left: 78px; top: 20px; background: rgba(34,197,94,.25); color: #34d399; }
.onboarding-orb.teal { left: 60px; bottom: 34px; background: rgba(20,184,166,.22); color: #2dd4bf; }
.onboarding-orb.purple { right: 0; top: 58px; background: rgba(124,58,237,.28); color: #8b5cf6; }
.onboarding-orb.gold { right: 8px; bottom: 20px; background: rgba(245,158,11,.18); color: #f59e0b; }

.onboarding-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: #fff;
  font-size: 19px;
}

.onboarding-section-title:after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148,163,184,.22);
}

.getting-started-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.getting-started-steps article {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  min-height: 210px;
  border: 1px solid rgba(92,115,148,.34);
  border-radius: 10px;
  background: rgba(10,22,39,.82);
  padding: 18px 22px 24px;
}

.getting-started-steps article:not(:last-child):after {
  content: "→";
  position: absolute;
  right: -23px;
  top: 50%;
  color: rgba(255,255,255,.84);
  font-size: 28px;
}

.getting-started-steps span {
  position: absolute;
  left: 14px;
  top: -6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-weight: 950;
}

.getting-started-steps i {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 20px 0 10px;
  border-radius: 50%;
  background: rgba(37,99,235,.26);
  color: #38bdf8;
  font-style: normal;
  font-size: 25px;
}

.getting-started-steps h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 18px;
  line-height: 1.22;
}

.getting-started-steps p {
  margin: 0;
  line-height: 1.45;
}

.onboarding-score-table {
  border: 1px solid rgba(92,115,148,.34);
  border-radius: 10px;
  overflow: hidden;
}

.onboarding-score-table div {
  display: grid;
  grid-template-columns: 190px 240px 1fr 130px;
  gap: 16px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(92,115,148,.22);
  background: rgba(7,18,32,.62);
}

.onboarding-score-table div:first-child {
  background: rgba(10,24,42,.96);
  color: #cbd5e1;
  font-size: 12px;
}

.onboarding-score-table div:last-child {
  border-bottom: 0;
}

.onboarding-score-table span,
.onboarding-score-table b {
  font-size: 13px;
}

.onboarding-score-table span:first-child {
  color: #fff;
  font-weight: 950;
}

.onboarding-score-table em {
  justify-self: end;
  border-radius: 8px;
  background: rgba(37,99,235,.26);
  color: #60a5fa;
  padding: 6px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.onboarding-score-table em.good {
  background: rgba(22,163,74,.22);
  color: #4ade80;
}

.onboarding-guide-grid,
.sample-portfolio-options,
.onboarding-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.onboarding-guide-grid article,
.sample-portfolio-options article,
.onboarding-bottom-grid article {
  border: 1px solid rgba(92,115,148,.34);
  border-radius: 10px;
  background: rgba(10,22,39,.82);
  padding: 18px;
}

.onboarding-guide-grid h4,
.sample-portfolio-options h4,
.onboarding-bottom-grid h4 {
  margin: 0 0 14px;
  color: #fff;
}

.onboarding-guide-grid h4 span,
.sample-portfolio-options span {
  color: #34d399;
  font-size: 12px;
}

.onboarding-guide-grid p {
  display: grid;
  grid-template-columns: 90px 150px 1fr;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.onboarding-guide-grid p.band-low {
  background: linear-gradient(90deg, rgba(16,185,129,.44), rgba(16,185,129,.12));
}

.onboarding-guide-grid p.band-moderate {
  background: linear-gradient(90deg, rgba(234,179,8,.42), rgba(234,179,8,.11));
}

.onboarding-guide-grid p.band-elevated {
  background: linear-gradient(90deg, rgba(249,115,22,.4), rgba(249,115,22,.1));
}

.onboarding-guide-grid p.band-high {
  background: linear-gradient(90deg, rgba(190,18,60,.58), rgba(190,18,60,.14));
}

.onboarding-guide-grid p b,
.onboarding-guide-grid p strong {
  color: #fff;
}

.onboarding-guide-grid p span,
.sample-portfolio-options p,
.onboarding-bottom-grid p {
  color: rgba(226,232,240,.82);
}

.onboarding-guide-grid small {
  display: block;
  margin-top: 14px;
  color: rgba(226,232,240,.82);
}

.sample-portfolio-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sample-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.sample-card-head h4 {
  margin: 0 0 5px;
}

.sample-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  color: #fff;
  font-size: 25px;
  font-style: normal;
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}

.sample-icon.ai {
  background: linear-gradient(135deg, #9333ea, #6d28d9);
}

.sample-icon.dividend {
  background: linear-gradient(135deg, #16a34a, #047857);
}

.sample-icon.balanced {
  background: linear-gradient(135deg, #2563eb, #0f766e);
}

.sample-tickers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148,163,184,.16);
  padding-top: 14px;
  margin: 16px 0;
}

.sample-tickers b {
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 999px;
  background: rgba(15,23,42,.9);
  color: #e2e8f0;
  padding: 5px 9px;
  font-size: 11px;
}

.sample-tickers em {
  color: rgba(226,232,240,.8);
  font-style: normal;
  font-size: 12px;
}

.sample-portfolio-options button {
  border: 0;
  background: transparent;
  color: #8b5cf6;
  padding: 0;
  font-weight: 950;
}

.sample-portfolio-options button span,
.naviquity-disclaimer button span {
  margin-left: 8px;
}

.onboarding-bottom-grid {
  grid-template-columns: 1.1fr .75fr .95fr;
}

.onboarding-bottom-grid article {
  min-height: 122px;
}

.onboarding-bottom-grid p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.naviquity-does p {
  color: #86efac;
}

.naviquity-does-not p {
  color: #fecaca;
}

.naviquity-disclaimer {
  display: grid;
  align-content: center;
  gap: 16px;
}

.naviquity-disclaimer button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #8b5cf6;
  padding: 0;
  font-weight: 950;
}

.sample-portfolio-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 12px;
  background: rgba(14,165,233,.1);
  color: rgba(255,255,255,.82);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.sample-portfolio-notice strong {
  color: #fff;
}

.sample-portfolio-notice[hidden] {
  display: none;
}

@media(max-width:900px) {
  .onboarding-hero,
  .getting-started-steps {
    grid-template-columns: 1fr;
  }

  .onboarding-visual {
    min-height: 240px;
  }

  .getting-started-steps article:not(:last-child):after {
    display: none;
  }

  .onboarding-score-table div,
  .onboarding-guide-grid,
  .sample-portfolio-options,
  .onboarding-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:720px) {
  .sample-portfolio-notice {
    flex-direction: column;
    align-items: flex-start;
  }

  .getting-started-page {
    padding: 22px;
  }

  .onboarding-laptop {
    right: 18px;
    width: 260px;
  }
}

.welcome-demo {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 14px 26px;
}

.welcome-demo span {
  margin-left: 18px;
}

.world-visual {
  position: relative;
  height: min(48vw,500px);
  min-height: 340px;
}

.world-core,
.world-orbit {
  position: absolute;
  inset: 8% 0 0 3%;
  border-radius: 50%;
}

.world-core {
  background:
    radial-gradient(circle at 58% 45%, rgba(255,255,255,.98) 0 1px, transparent 2px) 0 0/14px 14px,
    radial-gradient(circle at 42% 48%, rgba(196,81,255,.9) 0 1px, transparent 2px) 0 0/19px 19px,
    radial-gradient(circle at 57% 43%, rgba(47,115,255,.88), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.16), transparent 62%);
  mask-image: radial-gradient(circle, #000 0 58%, transparent 70%);
  opacity: .94;
  filter: drop-shadow(0 0 44px rgba(47,115,255,.42));
}

.world-orbit {
  border: 1px solid rgba(91,139,255,.25);
  transform: rotate(-15deg) scale(.93);
  box-shadow:
    0 0 0 16px rgba(47,115,255,.03),
    inset 0 0 80px rgba(47,115,255,.18);
}

.world-orbit::before,
.world-orbit::after {
  content: "";
  position: absolute;
  inset: 11% -5%;
  border-radius: 50%;
  border-top: 1px solid rgba(255,255,255,.28);
  border-bottom: 1px solid rgba(47,115,255,.22);
}

.world-orbit::after {
  inset: 22% -10%;
  transform: rotate(18deg);
  border-color: rgba(203,46,230,.28);
}

.welcome-feature-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 18px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.welcome-demo-board {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 18px auto 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  background: linear-gradient(180deg,rgba(16,24,40,.78),rgba(5,8,14,.9));
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
  overflow: hidden;
}

.demo-topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.74);
}

.demo-topbar b {
  color: #8c3dff;
  font-size: 28px;
}

.demo-topbar span:first-of-type {
  color: #fff;
  border-bottom: 2px solid #a53cff;
  padding-bottom: 8px;
}

.demo-themes-row {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  padding: 20px;
}

.demo-themes-row article,
.demo-insight-grid article {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  padding: 14px;
}

.demo-themes-row div {
  height: 70px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg,rgba(103,87,255,.8),rgba(23,183,200,.35));
}

.demo-themes-row strong,
.demo-themes-row span,
.demo-themes-row small,
.demo-themes-row b {
  display: block;
}

.demo-themes-row span,
.demo-themes-row small,
.demo-insight-grid p {
  color: rgba(255,255,255,.64);
}

.demo-themes-row b {
  color: #2563eb;
  font-size: 24px;
  margin-top: 8px;
}

.demo-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px 20px;
}

.demo-insight-grid h3 {
  margin: 0 0 12px;
  color: #fff;
}

.demo-insight-grid p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.demo-insight-grid b {
  color: #2563eb;
}

.demo-insight-grid em {
  color: #fbbf24;
  font-style: normal;
}

.demo-line {
  height: 120px;
  border-radius: 14px;
  background:
    linear-gradient(180deg,rgba(132,60,255,.4),transparent),
    linear-gradient(135deg,transparent 45%,#9f35ff 46% 49%,transparent 50% 62%,#2f73ff 63% 66%,transparent 67%);
}

.demo-donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 10px auto 0;
  background: conic-gradient(#9f35ff 0 64%,#2f73ff 64% 82%,#17b7c8 82% 92%,#4b5563 92%);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

.welcome-feature-grid article {
  min-height: 178px;
  padding: 24px 22px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 20px;
  background: rgba(0,0,0,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.welcome-feature-grid i {
  display: block;
  color: #b44cff;
  font-size: 46px;
  font-style: normal;
  line-height: 1;
  margin-bottom: 18px;
}

.welcome-feature-grid h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 22px;
}

.welcome-feature-grid p {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 16px;
  line-height: 1.45;
}

.welcome-question-block {
  position: relative;
  z-index: 2;
  margin: 34px auto 0;
  max-width: 1120px;
}

.welcome-question-head {
  text-align: center;
  margin-bottom: 18px;
}

.welcome-question-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px,3vw,34px);
  letter-spacing: 0;
}

.welcome-question-head p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.62);
  font-size: 15px;
}

.rotating-question-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
}

.rotating-question-card {
  min-height: 112px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  padding: 20px 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  opacity: 1;
  transition: opacity .2s ease;
}

.rotating-question-card.fading {
  opacity: .2;
}

.question-card-label {
  margin: 0;
  color: rgba(255,255,255,.42);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.question-card-text {
  margin: 10px 0 0;
  color: rgba(248,250,252,.94);
  font-size: 16px;
  line-height: 1.5;
}

.welcome-picker-panel {
  margin: 0 auto 34px;
  transform: none;
}

.choice-helper {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.demo-modal.show {
  display: flex;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
}

.demo-modal-panel {
  width: min(1080px, 96vw);
  max-height: 88vh;
  overflow: auto;
  margin: 0;
}

.demo-modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 24px;
}

@media(max-width:1100px) {
  .welcome-nav,
  .welcome-hero {
    grid-template-columns: 1fr;
  }

  .welcome-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-nav-links {
    gap: 12px;
    flex-wrap: wrap;
  }

  .welcome-hero {
    min-height: auto;
    padding-top: 58px;
  }

  .world-visual {
    height: 430px;
  }

  .welcome-feature-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .rotating-question-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:720px) {
  body[data-page="welcome"] .main {
    padding: 0 0 86px;
  }

  .welcome-stage {
    padding: 22px 16px 34px;
  }

  .welcome-copy h2 {
    font-size: 44px;
  }

  .welcome-copy p {
    font-size: 17px;
  }

  .world-visual {
    min-height: 300px;
    height: 330px;
  }

  .welcome-feature-grid {
    grid-template-columns: 1fr;
  }

  .welcome-question-block {
    margin-top: 24px;
  }

  .demo-themes-row,
  .demo-insight-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark application shell */
body:not([data-page="welcome"]) {
  background: #050507;
  color: #f8fafc;
}

body:not([data-page="welcome"]) .main {
  background:
    radial-gradient(circle at 80% 0,rgba(103,87,255,.14),transparent 32%),
    linear-gradient(180deg,#080a10,#050507);
}

body:not([data-page="welcome"]) .topbar {
  color: #fff;
}

.auth-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.auth-balance-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-balance-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(15,22,36,.78);
  color: rgba(255,255,255,.66);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
}

.auth-balance-strip b {
  color: #fff;
}

.welcome-auth-topbar {
  min-width: 0;
}

.welcome-auth-topbar .auth-signin-btn,
.welcome-auth-topbar .auth-user-btn {
  padding: 9px 14px;
}

.auth-signin-btn,
.auth-user-btn,
.auth-required-actions .primary,
.account-dashboard-panel .primary {
  border: 1px solid rgba(139,92,246,.45);
  background: linear-gradient(135deg,#c026d3,#6d5dfc);
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 900;
  cursor: pointer;
}

.auth-menu {
  position: relative;
}

.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,22,36,.92);
  border-color: rgba(255,255,255,.14);
}

.auth-user-btn img,
.auth-user-btn span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.auth-user-btn img {
  object-fit: cover;
}

.auth-user-btn span {
  display: grid;
  place-items: center;
  background: #6d5dfc;
  color: #fff;
}

.auth-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: none;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(10,14,24,.98);
  box-shadow: 0 20px 50px rgba(0,0,0,.42);
}

.auth-menu.open .auth-menu-panel {
  display: grid;
}

.auth-menu-panel button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.auth-menu-panel button:hover {
  background: rgba(255,255,255,.08);
}

.auth-required-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
}

.auth-required-modal.show {
  display: grid;
}

.auth-required-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.62);
}

.auth-required-panel {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: #0f1624;
  color: #f8fafc;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}

.auth-required-panel p {
  color: rgba(255,255,255,.66);
  line-height: 1.5;
}

.auth-required-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.auth-required-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.account-dashboard-content {
  display: grid;
  gap: 18px;
}

.account-profile-card,
.account-ticker-card,
.account-admin-card,
.account-metric-grid article,
.account-empty {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  padding: 18px;
}

.account-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.account-profile-card h3 {
  margin: 4px 0;
  color: #fff;
}

.account-profile-card p {
  margin: 0;
  color: rgba(255,255,255,.64);
}

.account-profile-card img {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
}

.account-metric-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}

.account-metric-grid span {
  display: block;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.account-metric-grid b {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 24px;
}

.account-ticker-card .ticker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-ticker-card .ticker-pills span {
  border: 1px solid rgba(168,85,247,.45);
  border-radius: 999px;
  padding: 6px 10px;
  color: #f8fafc;
  background: rgba(168,85,247,.1);
  font-weight: 850;
}

.account-admin-card h3 {
  margin: 0 0 12px;
}

.account-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  gap: 14px;
  align-items: start;
}

.account-admin-users {
  overflow: auto;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(3,7,18,.24);
}

.account-admin-users-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #f8fafc;
  font-size: 13px;
}

.account-admin-users-table th,
.account-admin-users-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  white-space: nowrap;
}

.account-admin-users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111827;
  color: rgba(255,255,255,.62);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-admin-users-table tbody tr {
  cursor: pointer;
}

.account-admin-users-table tbody tr:hover,
.account-admin-users-table tbody tr.selected {
  background: rgba(139,92,246,.14);
}

.account-admin-users-table td strong,
.account-admin-users-table td span {
  display: block;
}

.account-admin-users-table td span {
  margin-top: 2px;
  color: rgba(255,255,255,.52);
  font-size: 11px;
}

.account-admin-credit-form {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(15,23,42,.62);
  padding: 14px;
}

.account-admin-credit-form h4 {
  margin: 4px 0 10px;
  color: #fff;
  overflow-wrap: anywhere;
}

.account-admin-current {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.account-admin-current span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 9px 10px;
  color: rgba(255,255,255,.68);
}

.account-admin-current b {
  color: #fff;
}

.account-admin-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.account-admin-grid label {
  display: grid;
  gap: 6px;
  color: rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 850;
}

.account-admin-grid input {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 10px;
}

.add-chip.disabled {
  opacity: .52;
  cursor: not-allowed;
}

.add-chip.disabled input {
  cursor: not-allowed;
}

.account-admin-credit-form .account-admin-grid {
  grid-template-columns: 1fr;
}

@media(max-width:720px) {
  .auth-topbar {
    justify-content: flex-start;
  }
  .account-metric-grid {
    grid-template-columns: 1fr;
  }
  .account-admin-grid {
    grid-template-columns: 1fr;
  }
  .account-admin-layout {
    grid-template-columns: 1fr;
  }
}

body:not([data-page="welcome"]) .top-actions,
body:not([data-page="welcome"]) .panel,
body:not([data-page="welcome"]) .theme-card,
body:not([data-page="welcome"]) .ticker-card,
body:not([data-page="welcome"]) .event-card,
body:not([data-page="welcome"]) .brand-card,
body:not([data-page="welcome"]) .theme-signal-card,
body:not([data-page="welcome"]) .theme-article-card,
body:not([data-page="welcome"]) .affected-ticker-card {
  background: rgba(11,14,22,.86);
  border-color: rgba(255,255,255,.12);
  color: #f8fafc;
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
}

body:not([data-page="welcome"]) .muted,
body:not([data-page="welcome"]) .brand-sentiment,
body:not([data-page="welcome"]) .ticker-row .mini,
body:not([data-page="welcome"]) th,
body:not([data-page="welcome"]) .article-source {
  color: rgba(255,255,255,.64);
}

body:not([data-page="welcome"]) input,
body:not([data-page="welcome"]) .ticker-row,
body:not([data-page="welcome"]) .metric,
body:not([data-page="welcome"]) .ticker-main-metrics div,
body:not([data-page="welcome"]) .brand-life-grid div {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

body:not([data-page="welcome"]) select {
  background: #fff;
  border-color: rgba(255,255,255,.22);
  color: #111827;
}

select option {
  background: transparent;
  color: #111827;
}

select option:checked {
  background: #2563eb;
  color: #fff;
}

body:not([data-page="welcome"]) canvas,
body:not([data-page="welcome"]) .mini-chart,
body:not([data-page="welcome"]) .card-sparkline {
  background: linear-gradient(180deg,rgba(103,87,255,.13),rgba(255,255,255,.03));
  border-color: rgba(255,255,255,.12);
}

body:not([data-page="welcome"]) td,
body:not([data-page="welcome"]) th {
  border-bottom-color: rgba(255,255,255,.1);
}

.theme-photo,
.theme-tab-photo,
.theme-pulse-photo {
  background-image: var(--theme-photo);
  background-size: cover;
  background-position: center;
}

.theme-card {
  overflow: hidden;
}

.risk-good { color: #22c55e; font-weight: 850; }
.risk-watch { color: #f59e0b; font-weight: 850; }
.risk-high { color: #ef4444; font-weight: 850; }
.attr-strong { color: #f0abfc; font-weight: 850; }
.attr-good { color: #c4b5fd; font-weight: 850; }
.attr-muted { color: #cbd5e1; font-weight: 850; }
.score-top { color: #ffffff; font-weight: 900; }
.score-good { color: #d7dbea; font-weight: 875; }
.score-watch { color: #f59e0b; font-weight: 875; }
.score-weak { color: #ef4444; font-weight: 875; }
.theme-pill { border: 1px solid rgba(148,163,184,.32); border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.theme-gaming { color: #93c5fd; border-color: rgba(59,130,246,.45); background: rgba(59,130,246,.12); }
.theme-ai { color: #67e8f9; border-color: rgba(34,211,238,.42); background: rgba(34,211,238,.1); }
.theme-health { color: #d8b4fe; border-color: rgba(168,85,247,.42); background: rgba(168,85,247,.12); }
.theme-default { color: #cbd5e1; background: rgba(148,163,184,.1); }

#home .theme-card {
  padding: 0;
  border-radius: 30px;
  background: radial-gradient(circle at 20% 0%, rgba(103,87,255,.18), transparent 34%), rgba(11,14,22,.92);
  border-color: rgba(255,255,255,.16);
}

#homeThemeGrid {
  grid-template-columns: repeat(4,minmax(220px,1fr));
  gap: 14px;
}

.theme-photo {
  height: 112px;
  margin: -20px -20px 16px;
  border-radius: 24px 24px 0 0;
}

#home .theme-photo {
  height: 104px;
  margin: 0;
  border-radius: 30px 30px 0 0;
  background-image: var(--theme-photo);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.home-theme-body {
  padding: 16px;
}

.home-theme-strength {
  display: grid;
  grid-template-columns: minmax(92px,.75fr) minmax(118px,1.25fr);
  gap: 12px;
  align-items: end;
  margin: 12px 0 10px;
}

.home-theme-strength span {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 500;
}

.home-theme-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  flex-wrap: wrap;
}

.home-theme-score-number {
  color: #8a7cff;
  font-size: 42px;
  line-height: .92;
  letter-spacing: 0;
  font-weight: 500;
}

.home-theme-score-badge {
  border: 1px solid rgba(138,124,255,.55);
  border-radius: 999px;
  color: #8a7cff;
  background: rgba(103,87,255,.16);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
}

.home-theme-score-badge.weak {
  color: #fbbf24;
  border-color: rgba(251,191,36,.5);
  background: rgba(251,191,36,.12);
}

.home-theme-direction {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.home-theme-direction span {
  display: inline;
  font-size: 18px;
  font-weight: 500;
}

.home-theme-direction small {
  color: rgba(255,255,255,.68);
  font-size: 12px;
  margin-left: 5px;
}

.home-theme-direction.positive { color: #63e6a3; }
.home-theme-direction.warning { color: #fbbf24; }
.home-theme-direction.muted { color: rgba(255,255,255,.72); }

#home .theme-card h3,
#home .ticker-pill-btn,
#home .muted {
  font-weight: 500;
}

#home .ticker-pill-btn.active {
  font-weight: 500;
}

#home .theme-card h3 {
  font-size: 20px;
}

#home .theme-card-icon {
  width: 40px;
  height: 40px;
  font-size: 22px;
  border-radius: 14px;
}

#home .ticker-pills {
  gap: 6px;
}

#home .ticker-pill-btn {
  font-size: 11px;
  padding: 6px 9px;
}

#home .theme-card .muted {
  font-size: 12px;
}

.positive-text,
.warning-text {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.positive-text { color: #63e6a3; }
.warning-text { color: #fbbf24; }

.home-theme-spark-wrap {
  min-height: 80px;
  display: grid;
  align-content: end;
}

.home-theme-spark {
  width: 100%;
  height: 82px;
  overflow: visible;
}

.home-theme-spark line {
  stroke: rgba(255,255,255,.18);
  stroke-dasharray: 5 7;
}

.home-theme-spark polyline {
  fill: none;
  stroke: #8a7cff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-theme-spark text {
  fill: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 500;
}

.home-theme-spark-label,
.home-theme-spark-empty {
  display: block;
  color: rgba(255,255,255,.66);
  text-align: center;
  font-weight: 500;
  margin-top: 4px;
}

.home-theme-spark-empty {
  display: grid;
  min-height: 82px;
  place-items: center;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 18px;
}

.home-theme-detail-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #8a7cff;
  background: rgba(103,87,255,.08);
  color: #8a7cff;
  border-radius: 18px;
  padding: 11px 12px;
  font-weight: 500;
  font-size: 13px;
}

.home-theme-detail-btn:hover {
  background: rgba(103,87,255,.18);
  color: #fff;
}

.theme-trend-label {
  color: #2563eb;
  font-weight: 900;
  margin: -2px 0 10px;
}

.theme-signal-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.theme-signal-list span {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.theme-signal-list span::before {
  content: "↑ ";
  color: #2563eb;
}

.home-theme-insights {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0;
  margin: 12px 0;
  border-top: 1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.home-theme-insight {
  border-right: 1px solid rgba(255,255,255,.16);
  border-radius: 0;
  background: transparent;
  padding: 10px 8px;
  min-width: 0;
}

.home-theme-insight:last-child {
  border-right: 0;
}

.home-theme-insight:nth-child(2n) {
  border-right: 0;
}

.home-theme-insight:nth-child(n+3) {
  border-top: 1px solid rgba(255,255,255,.16);
}

.home-theme-insight span {
  display: block;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 500;
}

.home-theme-insight strong {
  display: block;
  color: #fff;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}

.home-theme-insight.stability strong { color: #63e6a3; }
.home-theme-insight.momentum strong { color: #fbbf24; }
.home-theme-insight.market-leadership strong { color: #54e0e6; }
.home-theme-insight.coverage strong { color: #60a5fa; }

.home-theme-insight p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.68);
  font-size: 10px;
  line-height: 1.25;
}

.theme-tabs {
  display: grid;
  grid-template-columns: repeat(5,minmax(160px,1fr));
  overflow-x: auto;
}

.theme-tab {
  min-height: 170px;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: rgba(11,14,22,.9);
  color: #fff;
}

.theme-tab-photo {
  display: block;
  height: 78px;
}

.theme-tab strong,
.theme-tab small,
.theme-tab b,
.theme-tab em {
  display: block;
  margin: 7px 12px;
}

.theme-tab small,
.theme-tab em {
  color: rgba(255,255,255,.62);
}

.theme-tab b {
  color: #2563eb;
  font-size: 24px;
}

.theme-pulse-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px,280px) 1fr 150px;
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  background: rgba(11,14,22,.86);
  padding: 18px;
}

.theme-pulse-photo {
  min-height: 170px;
  border-radius: 18px;
}

.theme-pulse-card h3 {
  font-size: 30px;
  margin: 0 0 8px;
}

.theme-pulse-card p {
  color: #2563eb;
  font-weight: 900;
}

.theme-pulse-orb {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(circle,#111827 46%,transparent 47%),conic-gradient(#2563eb,#2f73ff,#9f35ff,#2563eb);
}

.theme-pulse-orb b,
.theme-pulse-orb span {
  grid-area: 1 / 1;
}

.theme-pulse-orb b {
  font-size: 34px;
}

.theme-pulse-orb span {
  margin-top: 46px;
  color: rgba(255,255,255,.66);
  font-size: 12px;
}

.portfolio-grid {
  grid-template-columns: minmax(0,1fr);
}

.portfolio-analysis-grid {
  --portfolio-analysis-height: 760px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px,380px);
  gap: 18px;
  align-items: stretch;
}

.portfolio-analysis-grid > .panel {
  height: var(--portfolio-analysis-height);
  margin-bottom: 0;
  min-height: 0;
  overflow: hidden;
}

.allocation-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.allocation-panel canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.trend-chart-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trend-chart-panel .workspace-title,
.trend-chart-panel .metric-toggles,
.trend-chart-panel canvas {
  flex: 0 0 auto;
}

.trend-table-wrap {
  flex: 0 0 304px;
  max-height: 304px;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.trend-table-wrap table {
  min-width: 760px;
}

.trend-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

@media(max-width:1150px) {
  .portfolio-analysis-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-analysis-grid > .panel {
    height: auto;
    min-height: 0;
  }

  .allocation-panel canvas {
    flex: 0 0 auto;
    height: 300px;
  }
}

.portfolio-price-panel {
  margin-top: 18px;
}

.theme-stock-analytics {
  display: grid;
  gap: 18px;
}

.theme-trend-panel {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  background: rgba(11,14,22,.86);
  padding: 18px;
}

.theme-trend-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-trend-controls label {
  color: rgba(255,255,255,.72);
  font-weight: 900;
}

.theme-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.theme-trend-summary-group {
  border: 1px solid rgba(34,211,238,.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(139,92,246,.14), transparent 38%),
    rgba(8,13,22,.58);
  padding: 8px;
  min-width: 0;
}

.theme-trend-group-eyebrow {
  color: #22d3ee;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.theme-trend-group-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-trend-summary-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15,22,36,.92), rgba(8,13,22,.92));
  padding: 12px;
  min-height: 128px;
  min-width: 0;
}

.summary-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.summary-card-head strong,
.summary-card-head span:first-child {
  color: #fff;
  line-height: 1.25;
  font-size: 13px;
  font-weight: 900;
}

.theme-trend-summary-card > strong {
  display: block;
  margin-top: 12px;
  color: #c084fc;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.theme-trend-summary-card p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.68);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.theme-trend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.theme-trend-badge.strong,
.theme-trend-badge.improving,
.theme-trend-badge.accelerating,
.theme-trend-badge.high {
  background: rgba(37,99,235,.18);
  color: #bfdbfe;
}

.theme-trend-badge.moderate,
.theme-trend-badge.watch {
  background: rgba(245,158,11,.16);
  color: #fde68a;
}

.theme-trend-badge.weakening,
.theme-trend-badge.volatile {
  background: rgba(249,115,22,.16);
  color: #fed7aa;
}

.theme-trend-notice {
  margin: 0 0 14px;
  border: 1px solid rgba(245,158,11,.24);
  border-radius: 14px;
  background: rgba(245,158,11,.1);
  color: #fde68a;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.theme-trend-notice strong {
  color: #fff7ed;
}

.theme-trend-notice[hidden] {
  display: none;
}

.theme-stock-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(11,14,22,.76);
}

.theme-stock-table {
  min-width: 980px;
}

body[data-page="themes"] .theme-actions-head,
body[data-page="themes"] .workspace-left > .panel > .workspace-title {
  display: none;
}

body[data-page="themes"] .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

body[data-page="themes"] .workspace-left > .panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="themes"] .workspace-right {
  display: block;
  position: static;
  margin-top: 0;
  min-width: 330px;
}

body[data-page="themes"] .workspace-right .panel {
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(31,96,150,.14), transparent 34%),
    linear-gradient(180deg, rgba(15,22,36,.94), rgba(11,15,24,.94));
  border-color: rgba(96,116,148,.38);
}

.theme-market-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(180px, 220px);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.theme-market-identity,
.theme-market-stat,
.theme-market-meaning,
.theme-market-stock-panel {
  border: 1px solid rgba(96,116,148,.38);
  background:
    radial-gradient(circle at 10% 0%, rgba(31,96,150,.14), transparent 34%),
    linear-gradient(180deg, rgba(15,22,36,.94), rgba(11,15,24,.94));
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.theme-market-identity {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  gap: 14px;
  align-content: start;
  border-radius: 18px;
  padding: 14px;
}

.theme-market-icon,
.theme-market-meaning-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(168,85,247,.62);
  background: rgba(139,92,246,.22);
  font-size: 30px;
}

.theme-market-identity h2,
.theme-market-meaning h3,
.theme-market-stock-panel h3,
.theme-market-chart-head h3 {
  margin: 0;
  color: #f8fafc;
}

.theme-market-identity p {
  margin: 7px 0 0;
  color: rgba(226,232,240,.8);
}

.theme-market-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.theme-market-stat {
  border-radius: 16px;
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.theme-market-stat span {
  display: block;
  color: rgba(226,232,240,.64);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.theme-market-stat strong {
  display: block;
  margin-top: 16px;
  color: #c084fc;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.theme-market-stat small {
  display: block;
  margin-top: 8px;
  color: rgba(226,232,240,.72);
  font-weight: 800;
}

.theme-market-meaning {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  gap: 14px;
  border-color: rgba(168,85,247,.52);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}

.theme-market-meaning p,
.theme-market-chart-head p {
  margin: 6px 0 0;
  color: rgba(226,232,240,.78);
  line-height: 1.5;
}

.theme-market-stock-panel,
.theme-trend-panel {
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}

.theme-market-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.theme-market-section-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(226,232,240,.7);
  font-size: 12px;
  font-weight: 800;
}

.theme-market-sort {
  min-height: 34px;
  padding: 6px 32px 6px 10px;
}

.theme-stock-table th span {
  display: block;
  margin-top: 2px;
  color: rgba(226,232,240,.56);
  font-weight: 600;
}

.theme-score-bar {
  display: grid;
  gap: 5px;
  min-width: 96px;
}

.theme-score-bar strong {
  font-size: 16px;
}

.theme-score-bar span {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor var(--score), rgba(148,163,184,.24) var(--score));
}

.theme-score-blue {
  color: #60a5fa;
}

.theme-score-green {
  color: #4ade80;
}

.theme-score-amber {
  color: #fbbf24;
}

.theme-score-red {
  color: #fb7185;
}

.theme-market-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  color: rgba(226,232,240,.72);
  font-size: 12px;
}

.theme-market-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-market-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.theme-market-legend .blue { background: #60a5fa; }
.theme-market-legend .orange { background: #fb923c; }
.theme-market-legend .green { background: #4ade80; }

.theme-market-chart-head {
  margin: 16px 0 8px;
}

body[data-page="themes"] #themeTrendChart {
  height: 330px !important;
}

.theme-stock-table tbody tr {
  cursor: pointer;
}

.theme-stock-table tbody tr:hover,
.theme-stock-table tbody tr.active {
  background: rgba(103,87,255,.14);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid currentColor;
  font-weight: 900;
}

.score-pill.green {
  color: #2563eb;
  background: rgba(37,99,235,.12);
}

.score-pill.amber {
  color: #fbbf24;
  background: rgba(251,191,36,.1);
}

.score-pill.red {
  color: #f97316;
  background: rgba(249,115,22,.12);
}

@media(max-width:1150px) {
  .portfolio-analysis-grid {
    grid-template-columns: 1fr;
  }
}


/* V2 ticker cards: restore the simpler previous visual style. */
.ticker-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ticker-card {
  min-height: 245px;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
}

.ticker-card.active {
  transform: translateY(-2px);
}

.ticker-symbol-row,
.ticker-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
}

.ticker-symbol-row h3,
.ticker-title-row h3 {
  font-size: 22px;
  margin: 0;
}

.ticker-title-row {
  flex: 1;
}

.theme-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f1eeff;
  flex: 0 0 32px;
}

.theme-inline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.portfolio-status {
  font-size: 11px;
  color: var(--muted);
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
}

.risk-badge {
  min-width: 92px;
  height: 38px;
  border-radius: 999px;
  border: 2px solid rgba(103, 87, 255, .38);
  color: var(--brand2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  background: #fff;
  padding: 0 10px;
}

.risk-badge span {
  display: block;
  font-size: 9px;
  line-height: 1;
  color: var(--muted);
}

.risk-badge b {
  font-size: 17px;
  line-height: 1;
}

.theme-control-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.price-disclaimer {
  font-size: 13px;
  margin-top: 4px;
}

.score-context-note {
  display: inline-block;
  max-width: 720px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(103,87,255,.18);
  border-radius: 14px;
  background: #f7f4ff;
  color: #596174;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.price-range-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.price-range-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
}

.price-range-btn.active {
  background: #101828;
  color: #fff;
  border-color: #101828;
}

.card-sparkline {
  min-height: 120px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f2efff, #ffffff);
  position: relative;
  overflow: hidden;
  margin: 18px 0;
  padding: 10px;
}

.sim-price-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: baseline;
}

.sim-price-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.sim-price-head strong {
  font-size: 15px;
}

.sim-price-head b {
  font-size: 12px;
}

.card-sparkline svg {
  display: block;
  width: 100%;
  height: 78px;
}

.mini-chart .sim-price-head {
  grid-template-columns: 1fr auto;
}

.mini-chart .sim-price-head b {
  grid-column: 1 / 3;
}

.mini-chart svg {
  display: block;
  width: 100%;
  height: 72px;
}

.home-chart-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-top: -2px;
}

.card-sparkline polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-sparkline polyline.up {
  stroke: var(--green);
}

.card-sparkline polyline.down {
  stroke: var(--red);
}

.ticker-main-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ticker-main-metrics div {
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.ticker-main-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ticker-main-metrics b {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.ticker-card-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 14px 0 0;
}

@media(max-width:1300px){
  .ticker-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:720px){
  .ticker-card-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Theme-focused + iPhone responsive layout
   ========================================================= */

/* Remove visual noise from earlier experimental engagement sections if present */
.market-ribbon,
.nq-engagement-layer,
.financial-universe,
.impact-story,
.mission-strip {
  display: none !important;
}

/* Make the product purpose obvious */
.stock-discovery-hero {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(203,46,230,.95), rgba(103,87,255,.9));
  color: #fff;
  border-radius: 30px;
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.stock-discovery-hero .eyebrow {
  color: rgba(255,255,255,.78);
}

.stock-discovery-hero h2 {
  margin: 0 0 8px;
  font-size: 42px;
  letter-spacing: -.04em;
  line-height: 1.02;
}

.stock-discovery-hero p {
  margin: 0;
  max-width: 720px;
  color: rgba(255,255,255,.84);
  font-size: 17px;
  line-height: 1.5;
}

.hero-score-legend {
  display: grid;
  gap: 10px;
}

.hero-score-legend div {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  padding: 12px;
}

.hero-score-legend span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand2);
  font-weight: 900;
}

.hero-score-legend b {
  font-size: 15px;
}

/* Hide older home hero to reduce distractions */
#home > .hero-grid {
  display: none;
}

/* Theme cards: less text, more scoring focus */
.theme-card p.muted {
  font-size: 13px;
}

.theme-card .theme-score {
  border-radius: 50%;
}

/* Ticker cards focused on decision-making */
.ticker-card {
  border-radius: 24px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.ticker-card:hover,
.ticker-card:focus-within {
  z-index: 80;
}

.ticker-card-note {
  display: none;
}

.ticker-title-row h3 {
  font-size: 24px;
}

.risk-badge {
  min-width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #f4f1ff;
  color: var(--brand2);
  display: grid;
  place-items: center;
  text-align: center;
}

.risk-badge span {
  font-size: 10px;
  color: var(--muted);
  max-width: 58px;
  overflow-wrap: anywhere;
}

.risk-badge b {
  font-size: 22px;
}

.score-focus {
  grid-template-columns: 1fr 1fr;
}

.score-focus div:first-child {
  border-color: rgba(103,87,255,.24);
  background: #f4f1ff;
}

.score-focus div:first-child b {
  color: var(--brand2);
}

.buy-badge {
  background: #eff6ff;
  border-color: rgba(37,99,235,.28);
  color: var(--green);
}

.stock-decision-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: #eff6ff;
  color: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.price-attractive-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 5px;
}

.ticker-main-metrics .price-attractive-line b {
  margin-top: 0;
}

.ticker-main-metrics .price-attractive-line .decision-pill {
  display: inline-flex;
  color: var(--green);
  font-size: 12px;
  flex: 0 0 auto;
}

.score-help {
  position: relative;
  cursor: help;
  outline: none;
}

.score-help:focus-visible {
  box-shadow: 0 0 0 3px rgba(103,87,255,.14);
}

.score-tooltip {
  position: absolute;
  z-index: 999;
  left: 0;
  top: calc(100% + 10px);
  width: min(300px, 82vw);
  display: none;
  color: #fff;
  background: #101828;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 45px rgba(16,24,40,.22);
  text-align: left;
  white-space: normal;
}

.ticker-main-metrics .score-tooltip,
.stock-decision-row .score-tooltip,
.risk-badge .score-tooltip {
  display: none;
}

.risk-badge .score-tooltip {
  left: auto;
  right: 0;
}

.stock-decision-row .score-tooltip {
  color: #fff;
  background: #101828;
}

.score-help:hover .score-tooltip,
.score-help:focus-within .score-tooltip,
.score-help:focus .score-tooltip {
  display: grid;
  gap: 7px;
}

.score-tooltip strong {
  display: block;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
}

.score-tooltip em {
  display: block;
  color: #d7dbea;
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.tooltip-link {
  justify-self: start;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f0edff;
  color: var(--brand2);
  font-size: 12px;
  font-weight: 900;
}

.portfolio-table-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: 560px;
  scrollbar-gutter: stable both-edges;
}

.portfolio-allocation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.portfolio-allocation-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portfolio-allocation-head h3 {
  margin: 0;
}

.portfolio-objective-select {
  min-width: 112px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(96,116,148,.55);
  background: #0f1624;
  color: #f8fafc;
  padding: 4px 26px 4px 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.portfolio-backtest-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portfolio-backtest-controls[hidden] {
  display: none;
}

.portfolio-backtest-controls .portfolio-objective-select {
  min-width: 118px;
}

.portfolio-backtest-controls #portfolioBacktestDateSelect {
  min-width: 134px;
}

.portfolio-risk-summary {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: #d7dbea;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
}

.allocation-role-pill {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  border: 1px solid rgba(168,85,247,.55);
  border-radius: 999px;
  color: #d8b4fe;
  background: rgba(168,85,247,.09);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="portfolio"] #portfolioSnapshotTable th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #0f1624;
}

body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-remove-col,
body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-remove-cell {
  position: sticky;
  left: 0;
  z-index: 7;
  min-width: 82px;
  width: 82px;
  background: #0f1624;
}

body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-remove-col {
  z-index: 12;
}

body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-col-company_name,
body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-company-cell {
  position: sticky;
  left: 82px;
  z-index: 6;
  min-width: 240px;
  max-width: 320px;
  background: #0f1624;
  box-shadow: 10px 0 18px rgba(0,0,0,.22);
}

body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-col-company_name {
  z-index: 11;
}

body[data-page="portfolio"] #portfolioSnapshotTable .portfolio-company-cell strong {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

body[data-page="portfolio"] #portfolioSnapshotTable tbody tr:hover .portfolio-remove-cell,
body[data-page="portfolio"] #portfolioSnapshotTable tbody tr:hover .portfolio-company-cell,
body[data-page="portfolio"] #portfolioSnapshotTable tbody tr.active .portfolio-remove-cell,
body[data-page="portfolio"] #portfolioSnapshotTable tbody tr.active .portfolio-company-cell {
  background: #151d2d;
}

.portfolio-col-help {
  position: relative;
  cursor: help;
}

.sort-header-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.sortable-col.active .sort-header-btn {
  color: #6757ff;
}

.portfolio-col-help .score-tooltip {
  top: calc(100% + 8px);
  width: min(340px, 82vw);
}

.portfolio-col-help:nth-last-child(-n+2) .score-tooltip {
  left: auto;
  right: 0;
}

.climate-status {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.climate-status.calm {
  background: rgba(22,163,74,.22);
  color: #bbf7d0;
}

.climate-status.watch {
  background: rgba(245,158,11,.22);
  color: #fde68a;
}

.climate-status.elevated {
  background: rgba(220,38,38,.22);
  color: #fecaca;
}

.climate-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.climate-drivers span {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
}

/* Theme workspace: emphasize ticker cards */
.workspace {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.ticker-card-grid {
  grid-template-columns: repeat(3, minmax(0,1fr));
}

/* Mobile nav hidden on desktop */
.mobile-bottom-nav {
  display: none;
}

.portfolio-allocation-sidebar-card {
  display: none;
}

body[data-page="portfolio"] .portfolio-allocation-sidebar-card {
  display: block;
}

.portfolio-allocation-sidebar-card strong {
  display: block;
  margin-bottom: 10px;
}

.portfolio-allocation-sidebar-card canvas {
  display: block;
  width: 100%;
  max-height: 220px;
}

/* iPad and iPhone layout */
@media (max-width: 1024px) {
  body {
    background: #f7f8fc;
  }

  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 18px 104px;
    max-width: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(247,248,252,.92);
    backdrop-filter: blur(14px);
    padding: 8px 0 12px;
    margin-bottom: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar .eyebrow {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .top-actions {
    box-shadow: none;
    border-radius: 14px;
  }

  .top-actions input {
    min-width: 0;
    width: 100%;
  }

  .stock-discovery-hero {
    grid-template-columns: 1fr;
    border-radius: 24px;
    padding: 20px;
  }

  .stock-discovery-hero h2 {
    font-size: 31px;
  }

  .stock-discovery-hero p {
    font-size: 15px;
  }

  .hero-score-legend {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-head h2 {
    font-size: 22px;
  }

  .theme-grid,
  .ticker-card-grid,
  .portfolio-grid,
  .two-col,
  .scenario-layout,
  .event-grid,
  .brand-grid {
    grid-template-columns: 1fr !important;
  }

  .workspace {
    display: block;
  }

  .workspace-right {
    margin-top: 12px;
  }

  .sticky {
    position: static;
  }

  .workspace-title {
    flex-direction: column;
  }

  .theme-control-stack {
    width: 100%;
  }

  .big-score {
    width: 100%;
  }

  .theme-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .theme-tab {
    flex: 0 0 auto;
  }

  .ticker-card {
    padding: 16px;
  }

  .ticker-head {
    align-items: flex-start;
  }

  .ticker-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .theme-inline {
    display: none;
  }

  .risk-badge {
    min-width: 64px;
    height: 64px;
  }

  .card-sparkline {
    margin: 12px 0;
  }

  .ticker-main-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .ticker-main-metrics b {
    font-size: 24px;
  }

  .brand-grid,
  .mission-grid,
  .score-guide-grid {
    grid-template-columns: 1fr !important;
  }

  .mission-hero {
    grid-template-columns: 1fr !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(22,27,45,.18);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    padding: 8px;
  }

  .mobile-bottom-nav button {
    display: grid;
    place-items: center;
    gap: 3px;
    background: transparent;
    color: var(--muted);
    border-radius: 15px;
    padding: 8px 4px;
    font-size: 17px;
    font-weight: 850;
  }

  .mobile-bottom-nav button span {
    font-size: 10px;
    line-height: 1.12;
    text-align: center;
    max-width: 100%;
  }

  .mobile-bottom-nav button.active,
  .mobile-bottom-nav button:active,
  .mobile-bottom-nav button:hover {
    background: #f2efff;
    color: var(--brand2);
  }

  /* Tables become easier to scroll without dominating mobile */
  .table-wrap {
    max-height: 420px;
  }

  .portfolio-table-wrap {
    overflow: auto;
  }

  th,
  td {
    padding: 9px 8px;
    font-size: 13px;
  }
}

/* =========================================================
   Theme News Signal UI
   ========================================================= */

.theme-news-hero {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(16,24,40,.96), rgba(103,87,255,.88));
  color: #fff;
  border-radius: 30px;
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.theme-news-hero .eyebrow {
  color: rgba(255,255,255,.72);
}

.theme-news-hero h2 {
  margin: 0 0 6px;
  font-size: 36px;
}

.theme-news-hero p {
  margin: 0;
  color: rgba(255,255,255,.78);
  line-height: 1.5;
}

.signal-meter {
  display: grid;
  place-items: center;
  text-align: center;
  width: 150px;
  height: 150px;
  justify-self: end;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.20) 0 45%, transparent 46%),
    conic-gradient(from 220deg, var(--green), var(--cyan), var(--brand2), var(--brand), var(--green));
  box-shadow: 0 0 0 10px rgba(255,255,255,.08);
}

.signal-meter span {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  font-weight: 900;
  max-width: 90px;
}

.signal-meter b {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.theme-news-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}

.theme-news-actions-head {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-news-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin-bottom: 10px;
}

.theme-news-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
  font-weight: 900;
}

.theme-news-tab.active {
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  border-color: transparent;
  color: #fff;
}

.theme-signal-list,
.theme-article-list {
  display: grid;
  gap: 12px;
}

.theme-signal-card,
.theme-article-card,
.affected-ticker-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px;
}

.theme-signal-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
}

.signal-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f2efff;
  font-size: 22px;
}

.theme-signal-card h4,
.theme-article-card h4,
.affected-ticker-card h4 {
  margin: 0 0 4px;
}

.theme-signal-card p,
.theme-article-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.signal-score-pill {
  border-radius: 999px;
  background: #eff6ff;
  color: var(--green);
  font-weight: 900;
  padding: 8px 10px;
}

.affected-ticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.affected-ticker-card {
  min-height: 110px;
}

.affected-ticker-card .ticker-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.impact-positive { color: var(--green); }
.impact-negative { color: var(--red); }
.impact-neutral { color: var(--amber); }

.theme-article-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.theme-article-card a {
  color: var(--brand2);
  font-weight: 900;
  text-decoration: none;
}

.article-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 1024px) {
  .theme-news-hero,
  .theme-news-grid {
    grid-template-columns: 1fr;
  }

  .signal-meter {
    justify-self: start;
    width: 118px;
    height: 118px;
  }

  .signal-meter b {
    font-size: 28px;
  }

  .affected-ticker-grid {
    grid-template-columns: 1fr;
  }

  .theme-signal-card {
    grid-template-columns: 42px 1fr;
  }

  .signal-score-pill {
    grid-column: 1 / 3;
    justify-self: start;
  }

  .theme-article-card {
    grid-template-columns: 1fr;
  }

  .mobile-bottom-nav {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Theme Trends: thin selector + read-only theme stock table */
.theme-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 8px;
  margin-bottom: 16px;
}

.theme-tab {
  min-height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.82);
  text-align: center;
  overflow: visible;
}

.theme-tab.active {
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  border-color: transparent;
  color: #fff;
}

.theme-tab-photo,
.theme-tab small,
.theme-tab b,
.theme-tab em {
  display: none !important;
}

.theme-tab strong {
  display: block;
  margin: 0;
  white-space: nowrap;
}

.theme-stock-table tbody tr,
.theme-stock-table tbody tr:hover,
.theme-stock-table tbody tr.active {
  cursor: default;
  background: transparent;
}

#portfolioSnapshotTable tbody tr {
  cursor: pointer;
}

#portfolioSnapshotTable tbody tr:hover,
#portfolioSnapshotTable tbody tr.active {
  background: rgba(103,87,255,.16);
}

.trend-selected-ticker {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.theme-actions-head {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.theme-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.select-label,
.theme-select-row label {
  color: rgba(255,255,255,.72);
  font-weight: 900;
}

.theme-page-select {
  min-width: 220px;
  font-weight: 850;
}

.portfolio-actions-head {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.trend-range-select {
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(96,116,148,.55);
  background: #0f1624;
  color: #f8fafc;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

body[data-page="portfolio"] .trend-controls select,
body[data-page="portfolio"] .score-compare-select,
body[data-page="portfolio"] .portfolio-objective-select,
body:not([data-page="welcome"]) select,
.trend-controls select,
select {
  border-color: rgba(96,116,148,.55);
  background: #0f1624;
  color: #f8fafc;
}

select option,
body:not([data-page="welcome"]) select option,
body[data-page="portfolio"] .trend-controls select option,
body[data-page="portfolio"] .portfolio-objective-select option,
body[data-page="portfolio"] .score-compare-select option {
  background: #fff;
  color: #111827;
}

.choice.selected {
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 32px rgba(103,87,255,.22);
}

.choice.selected small,
.choice.selected span,
.choice.selected strong {
  color: #fff;
}

body:not([data-page="welcome"]) .choice {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.82);
}

body:not([data-page="welcome"]) .choice:hover {
  background: rgba(255,255,255,.08);
}

body:not([data-page="welcome"]) .choice.selected {
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  border-color: transparent;
  color: #fff;
}

.affected-ticker-card {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.affected-ticker-card:hover,
.affected-ticker-card.active {
  transform: translateY(-2px);
  border-color: rgba(103,87,255,.72);
  background: rgba(103,87,255,.14);
}

/* Color language: blue for favorable, orange for caution on light cards */
.theme-trend-label,
.theme-signal-list span::before,
.theme-tab b,
.theme-pulse-card p,
.score-pill.green,
.decision-pill,
.price-attractive-line .decision-pill,
.signal-score-pill,
.impact-positive,
.brand-sentiment.like {
  color: #2563eb;
}

.score-pill.green,
.signal-score-pill,
.decision-pill {
  background: #eff6ff;
}

.score-pill.red,
.impact-negative,
.brand-sentiment.dislike {
  color: #f97316;
}

.score-pill.red,
.remove-btn {
  background: #fff7ed;
}

.brand-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}

.brand-btn.dislike {
  background: #f97316;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,.18);
}

.interest-actions-head {
  justify-content: flex-end;
  margin-bottom: 12px;
}

#interestMap.map-canvas {
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
}

#interestMap .map-node {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: none;
  color: #fff;
  backdrop-filter: blur(12px);
}

body:not([data-page="welcome"]) .metric-toggle {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: #fff;
}

body:not([data-page="welcome"]) .metric-toggle.active {
  background: #fff;
  border-color: #fff;
  color: #101828;
}

@media(max-width:1400px){
  #homeThemeGrid {
    grid-template-columns: repeat(3,minmax(240px,1fr));
  }

  body[data-page="welcome"] .mobile-bottom-nav {
    display: none;
  }
}

@media(max-width:1050px){
  #homeThemeGrid {
    grid-template-columns: repeat(2,minmax(260px,1fr));
  }
}

/* iPad/iPhone parity with the desktop style updates */
@media (max-width: 1024px) {
  body:not([data-page="welcome"]) {
    background: #050507;
    color: #f8fafc;
  }

  body:not([data-page="welcome"]) .main {
    background:
      radial-gradient(circle at 80% 0,rgba(103,87,255,.14),transparent 32%),
      linear-gradient(180deg,#080a10,#050507);
    padding-bottom: 112px;
  }

  body:not([data-page="welcome"]) .panel,
  body:not([data-page="welcome"]) .theme-card,
  body:not([data-page="welcome"]) .ticker-card,
  body:not([data-page="welcome"]) .theme-signal-card,
  body:not([data-page="welcome"]) .theme-article-card,
  body:not([data-page="welcome"]) .affected-ticker-card,
  body:not([data-page="welcome"]) .brand-card {
    background: rgba(11,14,22,.86);
    border-color: rgba(255,255,255,.12);
    color: #f8fafc;
  }

  body:not([data-page="welcome"]) .top-actions,
  body:not([data-page="welcome"]) input,
  body:not([data-page="welcome"]) .ticker-row,
  body:not([data-page="welcome"]) .metric,
  body:not([data-page="welcome"]) .ticker-main-metrics div,
  body:not([data-page="welcome"]) .brand-life-grid div,
  body:not([data-page="welcome"]) .mini-chart,
  body:not([data-page="welcome"]) canvas {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.12);
    color: #fff;
  }

  body:not([data-page="welcome"]) select {
    background: #fff;
    border-color: rgba(255,255,255,.22);
    color: #111827;
  }

  .theme-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }

  .theme-trend-summary {
    grid-template-columns: 1fr;
  }

  .theme-tab {
    min-height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.82);
  }

  .theme-tab.active,
  .choice.selected,
  body:not([data-page="welcome"]) .choice.selected {
    background: linear-gradient(135deg,var(--brand),var(--brand2));
    color: #fff;
    border-color: transparent;
  }

  body:not([data-page="welcome"]) .choice {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.82);
  }

  #interestMap.map-canvas {
    height: 360px;
    background: transparent;
    border-color: rgba(255,255,255,.14);
  }

  #interestMap .map-node {
    background: rgba(255,255,255,.04);
    color: #fff;
    border-color: rgba(255,255,255,.28);
  }

  .score-pill.green,
  .signal-score-pill,
  .decision-pill {
    color: #2563eb;
    background: #eff6ff;
  }

  .score-pill.red,
  .impact-negative,
  .brand-sentiment.dislike,
  .negative {
    color: #f97316;
  }

  .impact-positive,
  .brand-sentiment.like,
  .positive {
    color: #2563eb;
  }

  .remove-btn {
    background: #fff7ed;
    color: #f97316;
  }

  .brand-btn.active {
    background: #2563eb;
    border-color: #2563eb;
  }

  .brand-btn.dislike {
    background: #f97316;
    border-color: #f97316;
  }

  .portfolio-analysis-grid {
    grid-template-columns: 1fr;
  }

  .ai-map-split {
    grid-template-columns: 1fr;
  }

  .home-theme-strength,
  .home-theme-insights {
    grid-template-columns: 1fr;
  }

  #homeThemeGrid {
    grid-template-columns: 1fr;
  }

  .home-theme-insight {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
  }

  .home-theme-insight:last-child {
    border-bottom: 0;
  }

  .trend-controls {
    align-items: stretch;
  }

  .trend-controls > * {
    flex: 1 1 auto;
  }

  .mobile-bottom-nav {
    background: rgba(11,14,22,.94);
    border-color: rgba(255,255,255,.14);
    box-shadow: 0 18px 50px rgba(0,0,0,.34);
  }

  .mobile-bottom-nav button {
    color: rgba(255,255,255,.68);
  }

  .mobile-bottom-nav button.active,
  .mobile-bottom-nav button:active,
  .mobile-bottom-nav button:hover {
    background: rgba(103,87,255,.18);
    color: #fff;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px 14px 96px;
  }

  .mobile-bottom-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 4px;
    border-radius: 18px;
    padding: 6px;
  }

  .mobile-bottom-nav button {
    padding: 7px 2px;
    font-size: 15px;
  }

  .mobile-bottom-nav button span {
    font-size: 9px;
  }
}

/* Portfolio analysis layout: keep trend wide, pie matched, and table scroll-contained. */
body[data-page="portfolio"] .portfolio-analysis-grid {
  --portfolio-analysis-height: 630px;
  display: flex !important;
  align-items: stretch;
  gap: 18px;
}

body[data-page="portfolio"] .portfolio-analysis-grid > .panel {
  height: var(--portfolio-analysis-height);
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
}

body[data-page="portfolio"] .trend-chart-panel {
  order: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body[data-page="portfolio"] .trend-chart-panel .workspace-title,
body[data-page="portfolio"] .trend-chart-panel .metric-toggles,
body[data-page="portfolio"] #portfolioTrendChart {
  flex: 0 0 auto;
}

body[data-page="portfolio"] .trend-table-wrap {
  flex: 0 0 252px;
  height: 252px;
  max-height: 252px;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
}

body[data-page="portfolio"] .trend-table-wrap table {
  min-width: 760px;
}

body[data-page="portfolio"] .trend-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b0e16;
}

body[data-page="portfolio"] .allocation-panel {
  order: 2;
  flex: 0 0 430px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body[data-page="portfolio"] .allocation-panel canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

@media(max-width:1150px) {
  body[data-page="portfolio"] .portfolio-analysis-grid {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  body[data-page="portfolio"] .portfolio-analysis-grid > .panel {
    height: auto;
  }

  body[data-page="portfolio"] .allocation-panel canvas {
    flex: 0 0 auto;
    height: 300px;
  }
}

.portfolio-analysis-grid {
  --portfolio-analysis-height: 630px;
  display: flex !important;
  align-items: stretch;
  gap: 18px;
}

.portfolio-analysis-grid > .trend-chart-panel {
  order: 1;
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
}

.portfolio-analysis-grid > .allocation-panel {
  order: 2;
  flex: 0 0 430px;
  width: 430px !important;
  min-width: 0;
}

.portfolio-analysis-grid .trend-table-wrap {
  flex: 0 0 264px !important;
  height: 264px !important;
  max-height: 264px !important;
  min-height: 0 !important;
  overflow-x: auto !important;
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
}

.portfolio-analysis-grid .trend-table-wrap th,
.portfolio-analysis-grid .trend-table-wrap td {
  height: 38px;
  padding: 8px 10px;
  line-height: 1.2;
}

.portfolio-analysis-grid .trend-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
}

@media(max-width:1150px) {
  .portfolio-analysis-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .portfolio-analysis-grid > .trend-chart-panel,
  .portfolio-analysis-grid > .allocation-panel {
    width: auto !important;
  }
}

/* Clean portfolio analysis rebuild. Old portfolio-analysis-* rules are intentionally bypassed. */
.portfolio-analysis-v2 {
  display: block;
  gap: 18px;
  margin-bottom: 18px;
}

.portfolio-analysis-v2 > .panel {
  height: auto;
  min-height: 0;
  margin-bottom: 0;
  overflow: visible;
}

.portfolio-trend-v2 {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portfolio-trend-v2 .workspace-title,
.portfolio-trend-v2 .metric-toggles,
.portfolio-trend-v2 #portfolioTrendChart {
  flex: 0 0 auto;
}

.portfolio-trend-v2 #portfolioTrendChart {
  height: 310px !important;
}

.score-scale-note,
.score-panel-note,
.score-subtitle {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0 12px;
}

.score-intelligence-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .9fr);
  gap: 14px;
  align-items: stretch;
}

.score-intelligence-middle {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr);
  gap: 14px;
  margin-top: 14px;
}

.score-intelligence-card {
  border: 1px solid rgba(96,116,148,.38);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(31,96,150,.12), transparent 34%),
    linear-gradient(180deg, rgba(15,22,36,.94), rgba(11,15,24,.94));
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
  padding: 14px;
  min-width: 0;
}

.score-intelligence-card h4 {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 14px;
}

.score-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-tile,
.score-risk-badge,
.moment-example-card {
  border: 1px solid rgba(96,116,148,.34);
  border-radius: 12px;
  background: rgba(6,11,20,.46);
  padding: 8px;
}

.score-tile span,
.score-risk-badge span,
.moment-example-card span {
  color: rgba(226,232,240,.72);
  font-size: 11px;
}

.score-tile strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 17px;
  line-height: 1.05;
}

.score-risk-badge {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.score-risk-badge .score-help {
  display: block;
  position: static;
}

.score-risk-badge .score-tooltip {
  left: auto;
  right: calc(100% + 12px);
  top: 0;
}

.score-risk-badge strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  line-height: 1.05;
}

.score-risk-badge small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 900;
}

.score-risk-caption {
  margin: 0 0 12px;
  color: rgba(226,232,240,.68);
  font-size: 12px;
  font-weight: 750;
}

.score-tile small {
  display: block;
  margin-top: 3px;
  color: #c084fc;
  font-weight: 850;
  font-size: 11px;
}

.score-tile p,
.score-risk-badge p {
  margin: 6px 0 0;
  color: rgba(226,232,240,.64);
  font-size: 11px;
  line-height: 1.35;
}

.score-tile.score-good strong,
.score-tile.score-good small,
.score-risk-badge.score-good strong,
.score-risk-badge.score-good small {
  color: #4ade80;
}

.score-tile.score-warning strong,
.score-tile.score-warning small,
.score-risk-badge.score-warning strong,
.score-risk-badge.score-warning small {
  color: #fbbf24;
}

.score-tile.score-bad strong,
.score-tile.score-bad small,
.score-risk-badge.score-bad strong,
.score-risk-badge.score-bad small {
  color: #fb7185;
}

.score-table-note {
  margin: 0 0 8px;
  color: rgba(203,213,225,.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  text-align: left;
  caption-side: top;
}

.ai-summary-table-toolbar .score-table-note {
  margin: 0 auto 0 0;
}

.score-snapshot-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.score-snapshot-heading strong {
  color: #fff;
}

.score-snapshot-heading span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

.score-read {
  margin-top: 8px;
  color: rgba(255,255,255,.74);
  font-size: 12px;
  line-height: 1.4;
}

.score-read strong {
  color: #fff;
}

.embedded-price-trend {
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 12px;
}

.embedded-price-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.embedded-price-head h4 {
  margin: 0;
}

.embedded-price-trend .muted {
  margin: 6px 0 8px;
  font-size: 12px;
}

.embedded-price-trend #portfolioPriceChart {
  height: 310px !important;
}

.score-snapshot-changes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.score-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.score-compare-head h4 {
  margin: 0;
  flex: 1 1 auto;
}

.score-compare-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.score-compare-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 850;
}

.score-compare-select {
  min-height: 30px;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 11px;
}

.score-change-table-wrap {
  overflow: auto;
}

.score-change-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.score-change-table th,
.score-change-table td {
  border-bottom: 1px solid rgba(255,255,255,.09);
  padding: 6px 5px;
  color: rgba(255,255,255,.76);
  font-size: 11px;
  text-align: left;
}

.score-change-table th {
  color: rgba(255,255,255,.55);
  font-weight: 900;
}

.score-better {
  color: #4ade80 !important;
  font-weight: 900;
}

.score-worse {
  color: #fb7185 !important;
  font-weight: 900;
}

.score-stable {
  color: #cbd5e1 !important;
  font-weight: 850;
}

.score-distribution {
  margin-bottom: 16px;
}

.score-distribution-head,
.score-range-labels,
.moment-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.score-distribution-head {
  margin-bottom: 7px;
  color: #fff;
  font-size: 13px;
}

.score-distribution-head span,
.score-range-labels {
  color: rgba(255,255,255,.62);
  font-size: 11px;
}

.score-range-bar {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34,197,94,.65), rgba(245,158,11,.65), rgba(239,68,68,.65));
  border: 1px solid rgba(255,255,255,.1);
}

.score-range-marker,
.score-range-median {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.score-range-marker {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid #8b5cf6;
}

.score-range-median {
  height: 16px;
  width: 2px;
  background: rgba(255,255,255,.58);
}

.moment-example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.moment-example-card {
  min-height: 150px;
  background:
    radial-gradient(circle at 12% 0%, rgba(168,85,247,.18), transparent 34%),
    rgba(8,13,22,.76);
}

.moment-example-card.example-ideal {
  border-color: rgba(34,197,94,.35);
  background: radial-gradient(circle at 10% 0%, rgba(34,197,94,.18), transparent 34%), rgba(8,13,22,.76);
}

.moment-example-card.example-weak {
  border-color: rgba(239,68,68,.38);
  background: radial-gradient(circle at 10% 0%, rgba(239,68,68,.18), transparent 34%), rgba(8,13,22,.76);
}

.moment-example-card.example-defensive {
  border-color: rgba(168,85,247,.38);
}

.moment-example-card.example-high {
  border-color: rgba(59,130,246,.38);
  background: radial-gradient(circle at 10% 0%, rgba(59,130,246,.2), transparent 34%), rgba(8,13,22,.76);
}

.moment-example-card strong,
.moment-example-card b {
  display: block;
  color: #fff;
}

.moment-example-card strong {
  color: #c084fc;
  margin-bottom: 7px;
  font-size: 13px;
}

.moment-example-card p {
  color: rgba(255,255,255,.68);
  font-size: 12px;
  line-height: 1.4;
}

.moment-score-row {
  margin: 9px 0;
  flex-wrap: wrap;
}

.score-empty {
  color: rgba(255,255,255,.56);
  font-size: 13px;
}

.portfolio-trend-table-scroll {
  height: 190px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable both-edges;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
}

.portfolio-trend-table-scroll table {
  min-width: 760px;
}

.portfolio-trend-table-scroll th,
.portfolio-trend-table-scroll td {
  height: 38px;
  padding: 8px 10px;
  line-height: 1.2;
}

.portfolio-trend-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b0e16;
}

@media(max-width:1150px) {
  .portfolio-analysis-v2 > .panel {
    height: auto;
  }

  .score-intelligence-top,
  .score-intelligence-middle,
  .moment-example-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablet and phone visual parity: preserve the richer desktop-style layouts on touch screens. */
@media (min-width: 700px) and (max-width: 1024px) {
  body[data-page="themes"] .main {
    overflow-x: hidden;
  }

  #homeThemeGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-page="themes"] .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  body[data-page="themes"] .workspace-left {
    grid-column: 1;
    order: 1;
    min-width: 0;
    max-width: 100%;
  }

  body[data-page="themes"] .workspace-right {
    grid-column: 1;
    order: 2;
    position: static !important;
    margin-top: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  body[data-page="themes"] .workspace-right .sticky {
    position: static;
    top: auto;
  }

  body[data-page="themes"] .workspace-right .panel {
    padding: 10px;
  }

  body[data-page="themes"] .ticker-row {
    gap: 8px;
    padding: 9px;
  }

  body[data-page="themes"] .ticker-row .remove-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .theme-market-hero {
    grid-template-columns: minmax(0, 1fr) minmax(125px, 150px);
    gap: 10px;
  }

  .theme-market-identity,
  .theme-market-stat,
  .theme-market-meaning,
  .theme-market-stock-panel,
  .theme-trend-panel {
    padding: 10px;
  }

  .theme-market-icon,
  .theme-market-meaning-icon {
    width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .theme-market-identity,
  .theme-market-meaning {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
  }

  .theme-market-identity h2 {
    font-size: 24px;
  }

  .theme-market-identity p,
  .theme-market-meaning p,
  .theme-market-chart-head p {
    font-size: 13px;
    line-height: 1.35;
  }

  .theme-market-identity {
    grid-row: auto;
  }

  .theme-trend-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .theme-trend-group-cards {
    grid-template-columns: 1fr;
  }

  .theme-trend-summary-card {
    min-height: 0;
    padding: 9px;
  }

  .theme-trend-summary-card > strong {
    font-size: 16px;
  }

  .theme-trend-summary-card p {
    font-size: 12px;
    line-height: 1.3;
  }

  .theme-stock-table {
    min-width: 680px;
  }

  body[data-page="themes"] #themeTrendChart {
    height: 280px !important;
  }

  .score-intelligence-top {
    grid-template-columns: minmax(0, 1.32fr) minmax(300px, .88fr) !important;
  }

  .score-intelligence-middle {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr) !important;
  }

  .moment-example-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .score-tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portfolio-trend-v2 #portfolioTrendChart,
  .embedded-price-trend #portfolioPriceChart {
    height: 285px !important;
  }

  #riskOpportunityPathChart {
    height: 320px !important;
  }
}

@media (max-width: 699px) {
  body[data-page="themes"] .main {
    overflow-x: hidden;
  }

  #homeThemeGrid {
    grid-template-columns: repeat(3, minmax(108px, 1fr)) !important;
    overflow-x: auto;
  }

  #home .theme-card {
    min-width: 108px;
  }

  #home .theme-photo {
    height: 72px;
  }

  .home-theme-body {
    padding: 10px;
  }

  .home-theme-body h3 {
    font-size: 13px;
  }

  .theme-market-hero,
  .theme-market-stock-panel,
  .theme-trend-panel,
  .portfolio-trend-v2 {
    overflow-x: hidden;
  }

  body[data-page="themes"] .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow-x: hidden;
    align-items: start;
    width: 100%;
    min-width: 100%;
  }

  body[data-page="themes"] .workspace-left {
    grid-column: 1;
    order: 1;
  }

  body[data-page="themes"] .workspace-right {
    grid-column: 1;
    order: 2;
    position: static !important;
    margin-top: 0 !important;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .theme-market-hero {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-market-meaning,
  .theme-market-stock-panel,
  .theme-trend-panel {
    min-width: 0;
  }

  .theme-trend-summary {
    grid-template-columns: 1fr !important;
  }

  .score-intelligence-top,
  .score-intelligence-middle {
    min-width: 900px;
    grid-template-columns: minmax(0, 1.32fr) minmax(300px, .88fr) !important;
  }

  .moment-example-grid {
    min-width: 900px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (hover: none) and (pointer: coarse) and (min-width: 700px) and (max-width: 1366px) {
  body[data-page="themes"] .main {
    overflow-x: hidden;
  }

  body[data-page="themes"] .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    align-items: start !important;
  }

  body[data-page="themes"] .workspace-left {
    grid-column: 1 !important;
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body[data-page="themes"] .workspace-right {
    grid-column: 2 !important;
    order: 2 !important;
    position: static !important;
    z-index: auto !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 320px !important;
    min-width: 260px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body[data-page="themes"] .workspace-right .sticky {
    position: static !important;
    top: auto !important;
  }

  body[data-page="themes"] .workspace-right .panel {
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-page="themes"] .ticker-row {
    min-width: 0;
  }

  body[data-page="themes"] .theme-market-hero,
  body[data-page="themes"] .theme-market-meaning,
  body[data-page="themes"] .theme-market-stock-panel,
  body[data-page="themes"] .theme-trend-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body[data-page="themes"] .theme-trend-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-page="themes"] .theme-trend-group-cards {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) and (min-width: 700px) and (max-width: 1366px) and (orientation: portrait) {
  body[data-page="themes"] .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 280px) !important;
    gap: 8px !important;
  }

  body[data-page="themes"] .workspace-right {
    min-width: 250px !important;
    max-width: 280px !important;
  }

  body[data-page="themes"] .theme-market-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-page="themes"] .theme-trend-summary {
    grid-template-columns: 1fr !important;
  }
}

.portfolio-ai-panel {
  margin-top: 18px;
}

body[data-page="scenario"] .top-actions {
  display: none;
}

.portfolio-ai-workbench {
  display: grid;
  gap: 14px;
}

.portfolio-ai-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.portfolio-ai-hero h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 30px;
  line-height: 1.12;
}

.portfolio-ai-hero h2 span {
  color: #b875ff;
  margin-right: 8px;
}

.portfolio-ai-hero p {
  margin: 0;
  color: rgba(255,255,255,.72);
}

.portfolio-ai-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.portfolio-ai-hero-actions strong,
.portfolio-ai-hero-actions span,
.portfolio-ai-hero-actions select {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
}

body[data-page="scenario"] .portfolio-ai-hero-actions select,
body[data-page="scenario"] .ai-selector-toolbar select {
  background: rgba(255,255,255,.05);
  color: #fff;
}

body[data-page="scenario"] .portfolio-ai-hero-actions option,
body[data-page="scenario"] .ai-selector-toolbar option {
  color: #111827;
  background: #fff;
}

.portfolio-ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  gap: 16px;
  align-items: stretch;
}

.ai-context-panel,
.ai-ask-panel,
.ai-results-panel {
  background: linear-gradient(145deg,rgba(15,23,42,.92),rgba(8,13,24,.95));
  border-color: rgba(255,255,255,.12);
}

.ai-context-panel {
  display: flex;
  flex-direction: column;
}

.ai-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-step-head > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(184,117,255,.72);
  color: #c18cff;
  background: rgba(126,87,255,.12);
  font-weight: 850;
}

.ai-step-head h3 {
  margin: 0 0 3px;
  color: #fff;
}

.ai-step-head p {
  margin: 0;
  font-size: 13px;
}

.portfolio-ai-question {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: 0;
  line-height: 1.5;
  margin: 10px 0 14px;
}

.portfolio-ai-scenario-input {
  width: min(170px,100%);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: #fff;
  padding: 0 8px;
  outline: 0;
  margin: 0;
  height: 24px;
  min-height: 24px;
  font-size: 12px;
}

.portfolio-ai-scenario-input::placeholder {
  color: rgba(255,255,255,.42);
}

.portfolio-ai-answer {
  min-height: 170px;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  padding: 16px;
  color: var(--ink);
  line-height: 1.55;
  margin-top: 14px;
}

body:not([data-page="welcome"]) .portfolio-ai-question,
body:not([data-page="welcome"]) .portfolio-ai-answer {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

body:not([data-page="welcome"]) .impact-row {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

body:not([data-page="welcome"]) .impact-row .muted {
  color: rgba(255,255,255,.68);
}

body:not([data-page="welcome"]) .impact-row .bar {
  background: rgba(255,255,255,.12);
}

.portfolio-remove-col,
.portfolio-remove-cell {
  width: 1%;
  min-width: 92px;
}

.portfolio-row-remove {
  padding: 6px 10px;
  font-size: 12px;
}

.ai-ticker-selector {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

.ai-selector-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(190px, 220px);
  gap: 8px;
  align-items: center;
}

.ai-selector-toolbar input,
.ai-selector-toolbar select {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 0 12px;
  outline: 0;
  height: 42px;
  min-height: 42px;
}

.ai-selector-toolbar input::placeholder {
  color: rgba(255,255,255,.56);
}

.ai-selector-toolbar .button-row {
  grid-column: 1 / -1;
  gap: 6px;
  justify-content: space-between;
}

.ai-selector-toolbar button {
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px;
  min-height: 32px;
}

.ai-selector-toolbar strong {
  color: #fff;
  white-space: nowrap;
  font-size: 14px;
}

.ai-selection-warning {
  color: #fde68a;
  margin-top: 10px;
  font-weight: 800;
}

.ai-ticker-table-wrap {
  flex: 1;
  min-height: 410px;
  max-height: 520px;
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}

.ai-ticker-table-wrap th,
.ai-ticker-table-wrap td {
  font-size: 13px;
}

.ai-ticker-table-wrap th {
  vertical-align: middle;
  white-space: nowrap;
}

.ai-ticker-table-wrap th:nth-child(3) {
  min-width: 190px;
}

.ai-ticker-table-wrap th:nth-child(4),
.ai-ticker-table-wrap th:nth-child(6) {
  min-width: 130px;
}

.ai-ticker-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  text-align: left;
  white-space: normal;
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
}

.ai-ticker-sort-btn span:first-child {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.ai-ticker-sort-btn span:last-child {
  color: #a78bfa;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
}

.ai-ticker-sort-btn.active,
.ai-ticker-sort-btn:focus-visible,
.ai-ticker-sort-btn:hover {
  color: #a78bfa;
}

.ai-ticker-sort-btn:focus-visible {
  outline: 1px solid rgba(168,85,247,.8);
  outline-offset: 3px;
  border-radius: 4px;
}

.ai-ticker-table-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand2);
}

.score-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.score-guide-main,
.score-guide-side {
  display: grid;
  gap: 16px;
}

.score-guide-intro h2 {
  margin: 0 0 6px;
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: 0;
}

.score-guide-subtitle {
  margin: 0 0 14px;
  color: rgba(226,232,240,.78);
  font-size: 18px;
}

.score-band-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.score-band-legend,
.score-guide-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(15,22,36,.86);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

.score-band-legend {
  padding: 16px;
}

.score-band-legend h3,
.score-guide-card h3,
.score-help-panel h3,
.score-reminder-panel h3,
.score-ask-panel h3 {
  margin: 0;
  color: #fff;
  letter-spacing: 0;
}

.score-band-legend > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.score-band-legend > div:first-child span {
  color: #c084fc;
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.score-band-list {
  display: grid;
  gap: 7px;
}

.score-band-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  color: rgba(226,232,240,.82);
}

.score-band-list b {
  color: #fff;
}

.score-opportunity-warning {
  border-color: rgba(245,158,11,.38);
  background: linear-gradient(135deg, rgba(245,158,11,.13), rgba(15,22,36,.86));
}

.score-opportunity-warning strong {
  color: #fbbf24;
}

.score-opportunity-warning p {
  margin-bottom: 0;
}

.score-guide-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-guide-card {
  padding: 16px;
}

.score-guide-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.score-direction-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.score-direction-badge.lower {
  color: #86efac;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.32);
}

.score-direction-badge.higher {
  color: #d8b4fe;
  background: rgba(168,85,247,.12);
  border: 1px solid rgba(168,85,247,.34);
}

.score-guide-card p,
.score-help-panel p,
.score-ask-panel p,
.score-reminder-panel li,
.score-guide-disclosure {
  color: rgba(226,232,240,.74);
  line-height: 1.55;
}

.score-tooltip-inline {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.09);
}

.score-tooltip-inline strong {
  color: #c084fc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.score-tooltip-inline span {
  color: rgba(226,232,240,.74);
  font-size: 13px;
  line-height: 1.45;
}

.score-help-panel,
.score-reminder-panel,
.score-ask-panel {
  position: relative;
}

.score-reminder-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.score-ask-panel .primary {
  margin-top: 10px;
  width: 100%;
}

.score-guide-disclosure {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
}

@media(max-width:1100px) {
  .score-guide-layout {
    grid-template-columns: 1fr;
  }

  .score-guide-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .score-guide-disclosure {
    grid-column: 1 / -1;
  }
}

@media(max-width:760px) {
  .score-band-grid,
  .score-guide-card-grid,
  .score-guide-side {
    grid-template-columns: 1fr;
  }
}

.suggested-questions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.suggested-questions button {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.score-guide-dashboard {
  min-height: calc(100vh - 120px);
  padding: 8px 0 24px;
}

.score-guide-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.score-guide-dashboard-head h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: 0;
}

.score-guide-dashboard-head p {
  max-width: 880px;
  margin: 10px 0 0;
  color: rgba(226,232,240,.86);
  line-height: 1.5;
}

.score-guide-why {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(148,163,184,.38);
  background: rgba(15,23,42,.72);
  color: #e5edf8;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 800;
  max-width: 330px;
}

.score-guide-why span {
  color: rgba(226,232,240,.86);
  font-weight: 600;
}

.score-guide-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.score-guide-summary-row,
.score-guide-read-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.score-guide-summary-row article,
.score-guide-read-grid article,
.score-guide-example-strip {
  border: 1px solid rgba(92,115,148,.34);
  border-radius: 14px;
  background: rgba(10,22,39,.82);
  padding: 18px;
}

.score-guide-summary-row article {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-guide-summary-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  flex: 0 0 58px;
}

.score-guide-summary-icon.risk { background: linear-gradient(135deg, #16a34a, #047857); }
.score-guide-summary-icon.opportunity { background: linear-gradient(135deg, #7c3aed, #4c1d95); }

.score-guide-summary-row h3 {
  margin: 0 0 8px;
  color: #fff;
}

.score-guide-summary-row h3 b {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: #86efac;
  padding: 4px 8px;
  font-size: 12px;
}

.score-guide-summary-row p,
.score-guide-helper {
  margin: 0;
  color: rgba(226,232,240,.78);
}

.score-guide-helper {
  margin-bottom: 16px;
}

.score-guide-example-strip {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  margin-top: 14px;
}

.score-guide-example-strip p {
  margin: 0;
  color: rgba(226,232,240,.82);
}

.score-guide-example-strip b {
  color: #4ade80;
}

.score-guide-example-strip.purple b {
  color: #a78bfa;
}

.score-guide-read-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}

.score-guide-read-grid article b,
.score-guide-read-grid article strong {
  display: block;
}

.score-guide-read-grid article b {
  font-size: 26px;
  margin-bottom: 10px;
}

.score-guide-read-grid article strong {
  color: #fff;
  margin-bottom: 8px;
}

.score-guide-read-grid article p {
  margin: 0;
  color: rgba(226,232,240,.78);
  line-height: 1.5;
}

.score-guide-dashboard-main,
.score-guide-dashboard-side {
  display: grid;
  gap: 18px;
}

.score-guide-section-panel,
.score-guide-side-panel,
.score-guide-warning-strip {
  border: 1px solid rgba(148,163,184,.24);
  background: linear-gradient(145deg, rgba(15,28,45,.9), rgba(5,13,23,.92));
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0,0,0,.28);
}

.score-guide-section-panel {
  padding: 16px;
}

.score-guide-section-panel h3,
.score-guide-side-panel h3 {
  margin: 0 0 18px;
  color: #fff;
  letter-spacing: 0;
}

.score-guide-section-panel h3 span {
  margin-left: 8px;
  color: #4ade80;
  font-size: 15px;
}

.score-guide-mini-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.score-guide-return-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr);
  gap: 20px;
}

.score-guide-mini-card,
.score-guide-return-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 256px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(20,39,60,.9), rgba(8,17,30,.94));
}

.score-guide-return-card {
  min-height: 270px;
}

.score-guide-mini-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px 8px;
}

.score-guide-mini-head h4 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}

.score-guide-mini-head small {
  color: rgba(226,232,240,.86);
  font-weight: 800;
}

.score-guide-mini-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  font-weight: 900;
}

.score-guide-mini-icon.icon-cprs,
.score-guide-mini-icon.icon-crs {
  background: linear-gradient(135deg, #047857, #22c55e);
}

.score-guide-mini-icon.icon-vrs,
.score-guide-mini-icon.icon-buy_score {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
}

.score-guide-mini-icon.icon-mrs,
.score-guide-mini-icon.icon-total_risk {
  background: linear-gradient(135deg, #0369a1, #3b82f6);
}

.score-guide-mini-icon.icon-ers {
  background: linear-gradient(135deg, #0891b2, #14b8a6);
}

.score-guide-mini-card p,
.score-guide-return-card p {
  margin: 0;
  padding: 0 16px 18px;
  color: rgba(226,232,240,.86);
  font-size: 14px;
  line-height: 1.48;
}

.score-guide-band-stack {
  overflow: hidden;
  border-radius: 6px;
  margin: 0 8px 8px;
}

.score-guide-band-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  font-weight: 900;
}

.score-guide-band-row.band-0 { background: linear-gradient(90deg, #059669, #047857); }
.score-guide-band-row.band-1 { background: linear-gradient(90deg, #fde047, #fbbf24); color: #111827; }
.score-guide-band-row.band-2 { background: linear-gradient(90deg, #f97316, #ea580c); }
.score-guide-band-row.band-3 { background: linear-gradient(90deg, #dc2626, #b91c1c); }

.score-guide-warning-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-color: rgba(34,197,94,.22);
}

.score-guide-warning-strip span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(34,197,94,.16);
}

.score-guide-warning-strip p {
  margin: 0;
  color: rgba(226,232,240,.9);
}

.score-guide-warning-strip strong {
  color: #facc15;
}

.score-guide-side-panel {
  padding: 18px;
}

.score-guide-help-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  margin-top: 18px;
}

.score-guide-help-row span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #34d399);
  color: #fff;
  font-weight: 900;
}

.score-guide-help-row:nth-of-type(3) span {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}

.score-guide-help-row p,
.score-guide-star-list,
.score-guide-ask-panel p {
  margin: 0;
  color: rgba(226,232,240,.82);
  line-height: 1.5;
}

.score-guide-help-row strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.score-guide-star-list {
  display: grid;
  gap: 18px;
  padding: 0;
  list-style: none;
}

.score-guide-star-list li {
  position: relative;
  padding-left: 30px;
}

.score-guide-star-list li::before {
  content: "☆";
  position: absolute;
  left: 0;
  top: 0;
  color: #facc15;
  font-size: 21px;
}

.score-guide-ask-panel h3 {
  color: #c084fc;
}

.score-guide-ask-panel .primary {
  width: 100%;
  margin-top: 16px;
}

.explore-page {
  display: grid;
  gap: 14px;
  padding-bottom: 28px;
}

.explore-top-nav,
.explore-portfolio-bar,
.explore-workspace,
.explore-review-panel {
  border: 1px solid rgba(34,211,238,.14);
  background: linear-gradient(145deg, rgba(5,29,44,.78), rgba(7,14,27,.96));
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
}

.explore-top-nav {
  display: grid;
  grid-template-columns: auto 1fr 360px;
  gap: 18px;
  align-items: center;
  padding: 12px 18px;
}

.explore-brand,
.explore-top-nav nav,
.explore-portfolio-bar,
.explore-tabs,
.explore-actions-row,
.explore-theme-filter,
.explore-quick-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.explore-brand span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a855f7, #2563eb);
  color: white;
  font-weight: 950;
}

.explore-top-nav button,
.explore-tabs button,
.explore-theme-filter button,
.explore-quick-filters button,
.explore-actions-row button,
.explore-row-action,
.explore-company-cell button,
.explore-ticker-cell button,
.explore-sort-btn {
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.44);
  color: #e5edf8;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 850;
}

.explore-top-nav button.active,
.explore-tabs button.active,
.explore-theme-filter button.active,
.explore-quick-filters button.active {
  border-color: rgba(168,85,247,.75);
  background: linear-gradient(135deg, rgba(126,34,206,.85), rgba(79,70,229,.75));
  color: white;
}

.explore-top-nav input,
.explore-search-input,
.explore-page .dark-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 8px;
  background: rgba(3,10,20,.76);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
}

.explore-portfolio-bar {
  justify-content: space-between;
  padding: 18px;
}

.explore-portfolio-bar > div {
  min-width: 130px;
  text-align: center;
  border-left: 1px solid rgba(148,163,184,.18);
}

.explore-portfolio-bar strong {
  display: block;
  color: #fff;
  font-size: 22px;
}

.explore-portfolio-bar span,
.explore-portfolio-bar em,
.explore-review-panel p,
.explore-disclosure {
  color: rgba(226,232,240,.75);
}

.explore-portfolio-bar em {
  display: block;
  color: #facc15;
  font-style: normal;
  font-weight: 850;
}

.explore-tabs button {
  min-width: 230px;
  justify-content: flex-start;
  display: grid;
  text-align: left;
}

.explore-tabs button span {
  color: rgba(226,232,240,.7);
  font-size: 12px;
}

.explore-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.explore-workspace {
  padding: 14px;
  overflow: hidden;
}

.explore-info-banner {
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(59,130,246,.36);
  border-radius: 8px;
  background: rgba(30,64,175,.16);
  color: #dbeafe;
}

.explore-filter-panel {
  display: grid;
  gap: 14px;
}

.explore-filter-grid {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(240px, 1fr) minmax(180px, 220px) minmax(190px, 240px) 96px;
  gap: 12px;
  align-items: end;
}

.explore-filter-grid label:last-child {
  justify-self: end;
  width: 96px;
}

.explore-search-filter {
  min-width: 0;
}

.explore-filter-grid label,
.explore-table-head label {
  display: grid;
  gap: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.explore-theme-filter > span,
.explore-quick-filters > span {
  color: #fff;
  font-weight: 850;
}

.explore-status-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 8px;
  overflow: hidden;
}

.explore-status-legend span {
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  color: #e5edf8;
}

.explore-status-legend small {
  color: rgba(226,232,240,.72);
}

.explore-status-legend .add { color: #38bdf8; }
.explore-status-legend .pending { color: #c084fc; }
.explore-status-legend .remove { color: #f59e0b; }

.explore-table-panel {
  margin-top: 14px;
}

.explore-table-head {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.explore-table-head .explore-actions-row {
  flex: 1 1 520px;
}

.explore-table-head > span {
  margin-left: auto;
  color: rgba(226,232,240,.72);
  font-size: 13px;
}

.explore-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 10px;
}

.explore-stock-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.explore-stock-table th,
.explore-stock-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,.14);
  color: #e5edf8;
  text-align: left;
  vertical-align: middle;
}

.explore-stock-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1728;
  color: #cbd5e1;
  font-size: 12px;
}

.explore-sort-btn {
  width: 100%;
  justify-content: space-between;
  display: inline-flex;
  border: 0;
  background: transparent;
  padding: 0;
}

.explore-company-cell,
.explore-ticker-cell {
  min-width: 220px;
}

.explore-company-cell strong,
.explore-company-cell button,
.explore-ticker-cell strong,
.explore-ticker-cell button,
.explore-ticker-cell span {
  display: block;
}

.explore-ticker-cell > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.explore-ticker-cell strong {
  color: #fff;
  font-size: 15px;
}

.explore-ticker-cell span {
  margin-top: 4px;
  color: rgba(226,232,240,.66);
  font-size: 12px;
  line-height: 1.35;
}

.explore-company-cell button,
.explore-ticker-cell button {
  margin-top: 5px;
  padding: 4px 0;
  border: 0;
  color: #38bdf8;
  background: transparent;
  font-size: 12px;
}

.explore-ticker-cell button {
  flex: 0 0 auto;
  margin-top: 0;
}

.explore-theme-chip,
.explore-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 3px 7px;
  margin: 2px;
  border: 1px solid rgba(168,85,247,.28);
  background: rgba(88,28,135,.24);
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 850;
}

.explore-score-pill.good { color: #22c55e; background: rgba(22,101,52,.28); border-color: rgba(34,197,94,.28); }
.explore-score-pill.moderate { color: #facc15; background: rgba(113,63,18,.32); border-color: rgba(250,204,21,.28); }
.explore-score-pill.high,
.explore-score-pill.very-high { color: #fb923c; background: rgba(124,45,18,.35); border-color: rgba(251,146,60,.3); }

.explore-row-action.add { color: #38bdf8; }
.explore-row-action.remove { color: #fb923c; }
.explore-row-action.pending {
  border-color: rgba(168,85,247,.62);
  background: linear-gradient(135deg, rgba(126,34,206,.95), rgba(79,70,229,.86));
  color: #fff;
}
.explore-stock-table tr.pending-add td {
  background: rgba(126,34,206,.22);
  box-shadow: inset 0 1px 0 rgba(196,181,253,.12), inset 0 -1px 0 rgba(196,181,253,.08);
}
.explore-stock-table tr.pending-add td:first-child {
  box-shadow: inset 4px 0 0 #a855f7, inset 0 1px 0 rgba(196,181,253,.12), inset 0 -1px 0 rgba(196,181,253,.08);
}
.explore-stock-table tr.pending-remove td {
  background: rgba(249,115,22,.16);
  box-shadow: inset 0 1px 0 rgba(253,186,116,.12), inset 0 -1px 0 rgba(253,186,116,.08);
}
.explore-stock-table tr.pending-remove td:first-child {
  box-shadow: inset 4px 0 0 #fb923c, inset 0 1px 0 rgba(253,186,116,.12), inset 0 -1px 0 rgba(253,186,116,.08);
}

.explore-detail-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: rgba(226,232,240,.84);
}

.explore-detail-row p {
  flex-basis: 100%;
  margin: 4px 0 0;
}

.explore-review-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.explore-review-panel h3,
.explore-review-panel h4 {
  margin: 0;
  color: #fff;
}

.explore-no-change {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  text-align: center;
}

.explore-no-change span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px dashed #a855f7;
  border-radius: 999px;
  color: #a855f7;
  font-size: 32px;
}

.explore-pending-list {
  display: grid;
  gap: 8px;
}

.explore-pending-list p,
.explore-impact p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.explore-pending-list span {
  color: rgba(226,232,240,.7);
}

.explore-impact {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 8px;
}

.explore-review-panel .primary,
.explore-review-panel .secondary {
  width: 100%;
}

.explore-disclosure {
  margin: 16px 8px 0;
  font-size: 12px;
}

@media(max-width:1200px) {
  .score-guide-dashboard-grid,
  .explore-layout {
    grid-template-columns: 1fr;
  }
  .score-guide-dashboard-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .explore-review-panel {
    position: static;
  }
}

@media(max-width:980px) {
  .score-guide-mini-grid,
  .score-guide-return-grid,
  .score-guide-dashboard-side,
  .explore-filter-grid,
  .explore-status-legend,
  .explore-top-nav {
    grid-template-columns: 1fr;
  }
  .explore-filter-grid label:last-child {
    justify-self: stretch;
    width: 100%;
  }
}

@media(max-width:720px) {
  .score-guide-dashboard-head {
    display: grid;
  }
  .score-guide-mini-grid {
    grid-template-columns: 1fr;
  }
  .explore-portfolio-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ai-field-label {
  display: block;
  color: #fff;
  font-weight: 850;
  margin-bottom: 7px;
}

.ai-query-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 16px;
}

.ai-query-options label {
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-query-options .ai-history-option {
  display: grid;
  grid-template-columns: auto minmax(150px,1fr);
  align-items: center;
}

.ai-query-options .ai-history-option select {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #fff;
}

.ai-query-options input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand2);
}

.ai-query-options .ai-custom-scenario-option {
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.ai-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ai-action-row button {
  width: 100%;
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.ai-privacy-note {
  text-align: center;
  margin: 10px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.ai-usage-panel {
  margin-top: 8px;
}

.ai-results-panel {
  margin-bottom: 14px;
  font-size: 13px;
}

.ai-results-panel h3 {
  font-size: 18px;
}

.ai-results-panel .portfolio-ai-answer {
  font-size: 12px;
  line-height: 1.45;
}

.ai-results-panel .muted,
.ai-results-panel p,
.ai-results-panel li {
  font-size: 12px;
  line-height: 1.45;
}

.ai-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portfolio-ai-answer.is-structured {
  white-space: normal;
  background: transparent;
  border: 0;
  padding: 0;
}

.portfolio-ai-answer.ai-error {
  border-color: rgba(239,68,68,.55) !important;
  color: #fecaca !important;
  background: rgba(127,29,29,.18) !important;
}

.ai-result-cards {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 12px;
  margin: 14px 0;
}

.ai-result-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  padding: 14px;
  color: #fff;
  min-height: 120px;
  font-size: 12px;
}

.ai-result-card strong {
  display: block;
  color: #b875ff;
  margin-bottom: 6px;
  font-size: 13px;
}

.ai-result-card b {
  font-size: inherit;
  margin-left: 5px;
}

.ai-result-card > b {
  display: block;
  margin-left: 0;
  font-size: 20px;
  margin-bottom: 8px;
}

.ai-usage-card {
  display: grid;
  grid-template-columns: minmax(0,.95fr) minmax(220px,1.05fr);
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
  color: #fff;
  font-size: 12px;
}

.ai-usage-card strong {
  display: block;
  color: #b875ff;
  margin-bottom: 6px;
  font-size: 12px;
}

.ai-usage-metrics {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  column-gap: 12px;
}

.ai-usage-card p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.35;
}

.ai-usage-card .ai-billing-note-inline {
  display: block;
  margin: 0;
  color: rgba(148,163,184,.9);
  font-size: 12px;
  line-height: 1.45;
}

.ai-research-disclosure {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: rgba(148,163,184,.92);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.ai-visual-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 10px 0 14px;
  max-width: none;
  align-items: start;
}

.ai-map-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.ai-map-split .ai-map-card {
  min-width: 0;
}

.ai-map-card,
.ai-takeaway-panel,
.ai-score-legend {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: radial-gradient(circle at 20% 0%,rgba(34,211,238,.06),transparent 28%),rgba(255,255,255,.035);
  color: #fff;
  padding: 14px;
}

.ai-map-card {
  width: 100%;
  max-width: none;
  min-height: 370px;
  overflow: hidden;
  min-width: 0;
}

.ai-map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ai-map-title-row > div {
  min-width: 220px;
  flex: 1 1 360px;
}

.ai-map-title-row strong,
.ai-takeaway-panel > strong,
.ai-score-legend > strong {
  color: #fff;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.ai-map-subtitle {
  margin: 4px 0 0;
  color: rgba(203,213,225,.72);
  font-size: 12px;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.ai-map-title-row span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.5);
  font-size: 11px;
}

.ai-map-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.ai-map-controls button {
  border: 1px solid rgba(168,85,247,.42);
  border-radius: 8px;
  background: rgba(8,12,20,.72);
  color: rgba(255,255,255,.92);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 9px;
  cursor: pointer;
}

.ai-map-controls button:hover,
.ai-map-controls button:focus {
  border-color: rgba(168,85,247,.8);
  background: rgba(168,85,247,.18);
  outline: none;
}

.ai-map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
  color: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 800;
}

.ai-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.ai-map-viewport {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1000 / 420;
  height: auto;
  max-height: 520px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.ai-risk-map {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 540px;
}

.ai-map-grid {
  stroke: rgba(255,255,255,.12);
  stroke-width: 1;
}

.ai-map-grid.vertical {
  stroke: rgba(255,255,255,.07);
}

.ai-map-ref {
  stroke: rgba(148,163,184,.36);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ai-map-axis,
.ai-map-axis-label {
  fill: rgba(255,255,255,.62);
  font-size: 12px;
}

.ai-map-low-risk {
  fill: #4ade80;
  font-size: 12px;
  font-weight: 900;
}

.ai-map-high-risk {
  fill: #fb7185;
  font-size: 12px;
  font-weight: 900;
}

.ai-map-quadrant rect {
  fill: rgba(255,255,255,.035);
  stroke: rgba(255,255,255,.12);
}

.ai-map-quadrant.green rect { fill: rgba(34,197,94,.10); stroke: rgba(34,197,94,.28); }
.ai-map-quadrant.yellow rect { fill: rgba(234,179,8,.09); stroke: rgba(234,179,8,.28); }
.ai-map-quadrant.blue rect { fill: rgba(56,189,248,.08); stroke: rgba(56,189,248,.24); }
.ai-map-quadrant.red rect { fill: rgba(239,68,68,.08); stroke: rgba(239,68,68,.24); }

.ai-map-quadrant text {
  fill: rgba(255,255,255,.72);
  font-size: 13px;
}

.ai-map-quadrant .quad-title {
  fill: #fff;
  font-size: 15px;
  font-weight: 900;
}

.ai-map-point text {
  font-size: 13px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(8,12,20,.95);
  stroke-width: 3px;
}

.ai-map-point,
.ai-map-cluster {
  cursor: pointer;
}

.ai-map-point:focus,
.ai-map-cluster:focus {
  outline: none;
}

.ai-map-point:focus circle,
.ai-map-point:hover circle,
.ai-map-cluster:focus circle,
.ai-map-cluster:hover circle {
  filter: drop-shadow(0 0 6px currentColor);
  stroke: #f8fafc;
  stroke-width: 2;
}

.ai-map-cluster rect {
  fill: rgba(8,12,20,.92);
  stroke: rgba(248,250,252,.42);
}

.ai-map-cluster text {
  fill: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.ai-map-detail {
  min-height: 52px;
  max-height: 150px;
  overflow: auto;
  margin-top: 8px;
  padding: 0;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 10px;
  background: rgba(8,12,20,.45);
  color: rgba(226,232,240,.9);
  font-size: 12px;
  line-height: 1.45;
}

.ai-map-detail-table-wrap {
  overflow: auto;
}

.ai-map-detail-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.ai-map-detail-table th,
.ai-map-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148,163,184,.14);
  text-align: left;
  vertical-align: top;
}

.ai-map-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15,22,36,.96);
  color: rgba(148,163,184,.95);
  font-size: 11px;
  font-weight: 800;
}

.ai-map-detail-table td {
  color: rgba(226,232,240,.92);
}

.ai-map-detail-table td:first-child {
  color: #f8fafc;
}

.ai-map-footnote {
  color: rgba(148,163,184,.86);
  font-size: 11px;
  margin: 2px 0 0;
}

.ai-visual-side {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(250px,.8fr);
  gap: 12px;
}

.ai-takeaway-list {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: 10px;
  margin-top: 10px;
}

.ai-takeaway-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: flex-start;
}

.ai-takeaway-list span {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(168,85,247,.55);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.ai-takeaway-list p {
  color: rgba(255,255,255,.82);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.ai-score-legend {
  background: rgba(17,24,39,.58);
  display: grid;
  grid-template-columns: repeat(7,minmax(118px,1fr));
  gap: 10px;
  align-items: stretch;
}

.ai-score-legend > strong {
  grid-column: 1 / -1;
}

.ai-score-legend-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 8px;
  margin-top: 0;
  align-items: center;
}

.ai-score-legend-row span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  font-size: 13px;
}

.ai-score-legend-row b {
  color: rgba(255,255,255,.9);
  font-size: 12px;
}

.ai-score-legend-row p {
  color: rgba(255,255,255,.58);
  font-size: 11px;
  margin: 1px 0 0;
}

@media(max-width:1150px){
  .ai-score-legend {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:720px){
  .ai-score-legend,
  .ai-takeaway-list {
    grid-template-columns: 1fr;
  }
}

.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-chip-row span {
  border: 1px solid rgba(184,117,255,.5);
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  font-size: 11px;
}

.ai-investment-signal-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--signal-color) 72%, transparent);
  background: color-mix(in srgb, var(--signal-color) 14%, transparent);
  color: var(--signal-color);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  margin: 0 6px 4px 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ai-result-summary {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(240px,.6fr);
  gap: 14px;
  min-height: 220px;
}

.ai-result-summary > div {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 18px;
  color: #fff;
  min-height: 200px;
}

.ai-result-summary strong {
  font-size: 16px;
}

.ai-result-summary p {
  color: rgba(255,255,255,.78);
  font-size: 15px;
  line-height: 1.65;
}

.ai-summary-dashboard {
  display: block;
}

.ai-summary-main {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 18px;
  color: #fff;
  margin-bottom: 12px;
}

.ai-summary-main strong {
  color: #d8b4fe;
  display: block;
  font-size: 15px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.ai-summary-main p {
  color: rgba(255,255,255,.84);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.ai-detail-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.ai-detail-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  color: #fff;
}

.ai-summary-sort-table {
  table-layout: fixed;
  min-width: 1420px;
}

.ai-summary-col-ticker {
  width: 90px;
}

.ai-summary-col-signal {
  width: 145px;
}

.ai-summary-col-category {
  width: 170px;
}

.ai-summary-col-score {
  width: 86px;
}

.ai-summary-col-score-wide {
  width: 102px;
}

.ai-summary-col-trend {
  width: 78px;
}

.ai-summary-col-reason {
  width: 240px;
}

.ai-detail-table th,
.ai-detail-table td {
  border-bottom: 1px solid rgba(255,255,255,.08);
  border-right: 1px solid rgba(255,255,255,.05);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.ai-detail-table th {
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 850;
  background: rgba(255,255,255,.025);
}

.ai-summary-table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(148,163,184,.92);
  font-size: 11px;
  font-weight: 750;
}

.ai-sort-th {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-columns: minmax(0,1fr) 10px;
  gap: 4px 6px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
}

.ai-sort-th span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ai-sort-th small {
  grid-column: 1;
  color: rgba(148,163,184,.86);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-sort-th b {
  color: rgba(148,163,184,.76);
  font-size: 10px;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  text-align: right;
}

.ai-sort-th.active span,
.ai-sort-th.active b,
.ai-sort-th:focus-visible span,
.ai-sort-th:hover span {
  color: #c084fc;
}

.ai-sort-th:focus-visible {
  outline: 1px solid rgba(168,85,247,.8);
  outline-offset: 3px;
  border-radius: 4px;
}

.ai-detail-table th span {
  color: rgba(148,163,184,.86);
  font-weight: 650;
}

.ai-detail-table td:nth-child(3),
.ai-detail-table td:nth-child(4),
.ai-detail-table td:nth-child(5),
.ai-detail-table td:nth-child(6),
.ai-detail-table td:nth-child(7),
.ai-detail-table td:nth-child(8),
.ai-detail-table td:nth-child(9) {
  text-align: center;
  font-weight: 850;
}

.ai-summary-sort-table td:nth-child(4),
.ai-summary-sort-table td:nth-child(5),
.ai-summary-sort-table td:nth-child(6),
.ai-summary-sort-table td:nth-child(7),
.ai-summary-sort-table td:nth-child(8),
.ai-summary-sort-table td:nth-child(9),
.ai-summary-sort-table td:nth-child(10) {
  text-align: center;
  font-weight: 850;
}

.ai-summary-sort-table td:nth-child(3) {
  text-align: left;
  font-weight: 750;
}

.ai-summary-sort-table th,
.ai-summary-sort-table td {
  padding: 9px 8px;
}

.ai-summary-sort-table th:nth-child(4),
.ai-summary-sort-table th:nth-child(5),
.ai-summary-sort-table th:nth-child(6),
.ai-summary-sort-table th:nth-child(7),
.ai-summary-sort-table th:nth-child(8),
.ai-summary-sort-table th:nth-child(9),
.ai-summary-sort-table th:nth-child(10),
.ai-summary-sort-table th:nth-child(11) {
  text-align: left;
}

.ai-summary-sort-table td:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.ai-table-ticker {
  border: 1px solid rgba(168,85,247,.6);
  border-radius: 7px;
  padding: 4px 8px;
  font-weight: 900;
  display: inline-block;
}

.ai-category-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 7px;
}

.ai-summary-category-cell {
  display: grid;
  gap: 5px;
  align-items: start;
  min-width: 0;
}

.ai-summary-category-cell .ai-investment-signal-badge {
  margin: 0;
}

.ai-summary-category-label {
  display: flex;
  align-items: center;
  min-width: 0;
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.ai-summary-category-label span:last-child {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ai-trend-arrow {
  color: #22c55e;
  font-size: 18px;
  font-weight: 900;
}

.ai-table-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ai-table-metrics span {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  color: rgba(255,255,255,.68);
  padding: 3px 6px;
  font-size: 10px;
}

.ai-candidate-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

.ai-candidate-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: radial-gradient(circle at 10% 0%,color-mix(in srgb,var(--candidate-accent) 12%,transparent),transparent 30%),rgba(255,255,255,.035);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  color: #fff;
  padding: 16px;
}

.ai-candidate-head {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  align-items: start;
  gap: 12px;
}

.ai-candidate-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb,var(--candidate-accent) 70%,#0b1020);
  color: #fff;
  font-weight: 900;
}

.ai-candidate-head h4 {
  margin: 2px 0 4px;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}

.ai-candidate-head span {
  display: inline-flex;
  width: fit-content;
  border: 1px solid color-mix(in srgb,var(--candidate-accent) 45%,transparent);
  background: color-mix(in srgb,var(--candidate-accent) 16%,transparent);
  color: color-mix(in srgb,var(--candidate-accent) 78%,#fff);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
}

.ai-candidate-price {
  text-align: right;
}

.ai-candidate-price b {
  display: block;
  font-size: 15px;
}

.ai-candidate-price small {
  color: rgba(255,255,255,.68);
  font-size: 11px;
}

.ai-candidate-metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 2px;
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
}

.ai-candidate-metric {
  background: rgba(0,0,0,.20);
  padding: 10px;
  text-align: center;
}

.ai-candidate-metric + .ai-candidate-metric {
  border-left: 1px solid rgba(255,255,255,.08);
}

.ai-candidate-metric span,
.ai-candidate-metric small {
  display: block;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}

.ai-candidate-metric b {
  display: block;
  color: #fff;
  font-size: 16px;
  margin: 3px 0;
}

.ai-candidate-metric.good b,
.ai-candidate-metric.strong b {
  color: #4ade80;
}

.ai-candidate-metric.watch b,
.ai-candidate-metric.moderate b {
  color: #f59e0b;
}

.ai-candidate-metric.bad b,
.ai-candidate-metric.weak b {
  color: #fb7185;
}

.ai-candidate-body {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 18px;
  margin-top: 14px;
}

.ai-candidate-body strong {
  color: #c084fc;
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.ai-candidate-body p,
.ai-candidate-body li {
  color: rgba(255,255,255,.78);
  font-size: 13px;
  line-height: 1.45;
}

.ai-candidate-body p {
  margin: 0;
}

.ai-candidate-body ul {
  margin: 0;
  padding-left: 17px;
}

.ai-candidate-body li::marker {
  color: var(--candidate-accent);
}

.ai-signal-detail {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--candidate-accent) 32%, rgba(255,255,255,.12));
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  padding: 10px 12px;
}

.ai-signal-detail summary {
  cursor: pointer;
  color: #e9d5ff;
  font-size: 13px;
  font-weight: 900;
}

.ai-signal-detail div {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ai-signal-detail p {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.45;
}

.ai-signal-detail b {
  display: block;
  color: var(--candidate-accent);
  font-size: 11px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ai-candidate-watch {
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  line-height: 1.4;
}

.ai-candidate-watch b {
  color: #f59e0b;
  white-space: nowrap;
}

.ai-summary-section {
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  padding: 16px 18px;
}

.ai-summary-section > strong {
  display: block;
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
}

.ai-signal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 12px;
}

.ai-signal-list > div {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0,0,0,.12);
}

.ai-signal-list b {
  display: block;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  margin-bottom: 8px;
}

.ai-summary-section li,
.ai-summary-section p {
  color: rgba(255,255,255,.78);
  font-size: 15px;
  line-height: 1.55;
}

.ai-summary-section ul {
  margin: 0;
  padding-left: 18px;
}

.ai-char-count {
  text-align: right;
  color: rgba(255,255,255,.52);
  font-size: 12px;
  margin: -8px 0 10px;
}

.ai-tabs {
  margin-top: 12px;
}

.ai-tab-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding-bottom: 6px;
}

.ai-tab-list button {
  background: transparent;
  color: rgba(255,255,255,.72);
  border-radius: 10px 10px 0 0;
  padding: 11px 12px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
}

.ai-tab-list button[data-ai-tab="summary"] {
  color: #d8b4fe;
}

.ai-tab-list button[data-ai-tab="strongest"] {
  color: #22c55e;
}

.ai-tab-list button[data-ai-tab="weakest"] {
  color: #ef4444;
}

.ai-tab-list button[data-ai-tab="improving"] {
  color: #38bdf8;
}

.ai-tab-list button[data-ai-tab="fragile"] {
  color: #f97316;
}

.ai-tab-list button[data-ai-tab="deteriorating"] {
  color: #eab308;
}

.ai-tab-list button[data-ai-tab="mismatches"] {
  color: #a855f7;
}

.ai-tab-list button[data-ai-tab="cashflow"] {
  color: #22d3ee;
}

.ai-tab-list button[data-ai-tab="raw"] {
  color: #cbd5e1;
}

.ai-tab-list button:not(.active) {
  opacity: .78;
}

.ai-tab-list button:hover,
.ai-tab-list button:focus-visible {
  opacity: 1;
}

.ai-tab-list button.active {
  opacity: 1;
  box-shadow: inset 0 -2px 0 currentColor;
}

.ai-tab-body {
  padding-top: 14px;
  font-size: 15px;
}

.ai-tab-description {
  color: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.ai-tab-body pre {
  max-height: 380px;
  overflow: auto;
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  color: #cbd5e1;
  padding: 14px;
  font-size: 12px;
}

.ai-detail-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.ai-detail-card {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 18px;
  color: #fff;
  font-size: 14px;
}

.ai-empty-tab {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 18px;
  color: rgba(255,255,255,.68);
  font-size: 14px;
  min-height: 140px;
}

body[data-page="portfolio"] #portfolioSnapshotTable th,
body[data-page="portfolio"] #portfolioSnapshotTable td {
  font-size: 13px;
}

body[data-page="portfolio"] #portfolioSnapshotTable tbody tr:hover,
body[data-page="portfolio"] #portfolioSnapshotTable tbody tr.active {
  background: rgba(103,87,255,.12);
}

.ai-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ai-detail-head strong {
  font-size: 15px;
}

.ai-detail-head span {
  color: rgba(255,255,255,.68);
  font-size: 13px;
}

.ai-detail-card p,
.ai-detail-card li {
  color: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1.55;
}

.ai-detail-card b {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.ai-metric-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-metric-list span {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: rgba(255,255,255,.74);
  font-size: 11px;
  padding: 4px 8px;
}

.ai-metric-list b {
  display: inline;
  margin: 0 4px 0 0;
  color: rgba(255,255,255,.92);
}

.scenario-lower {
  margin-top: 4px;
}

@media(max-width:1150px){
  .portfolio-ai-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .portfolio-ai-grid,
  .ai-result-summary,
  .ai-visual-row,
  .ai-visual-side,
  .ai-summary-dashboard {
    grid-template-columns: 1fr;
  }

  .ai-result-cards {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .ai-detail-grid {
    grid-template-columns: 1fr;
  }

  .ai-candidate-grid,
  .ai-candidate-body {
    grid-template-columns: 1fr;
  }

  .ai-candidate-metrics {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .ai-candidate-metric + .ai-candidate-metric {
    border-left: 0;
  }

  .ai-selector-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ai-ticker-table-wrap {
    min-height: 320px;
    max-height: 420px;
  }
}

@media (min-width:700px) and (max-width:1024px) {
  body[data-page="scenario"] .main,
  body[data-page="scenario"] .portfolio-ai-workbench,
  body[data-page="scenario"] .portfolio-ai-grid,
  body[data-page="scenario"] .ai-context-panel,
  body[data-page="scenario"] .ai-ask-panel,
  body[data-page="scenario"] .ai-results-panel,
  body[data-page="scenario"] .portfolio-ai-answer,
  body[data-page="scenario"] .ai-tabs,
  body[data-page="scenario"] .ai-tab-body,
  body[data-page="scenario"] .ai-visual-row,
  body[data-page="scenario"] .ai-visual-side,
  body[data-page="scenario"] .ai-map-card,
  body[data-page="scenario"] .ai-map-viewport,
  body[data-page="scenario"] .ai-takeaway-panel,
  body[data-page="scenario"] .ai-score-legend {
    min-width: 0;
    max-width: 100%;
  }

  body[data-page="scenario"] .main,
  body[data-page="scenario"] .portfolio-ai-workbench,
  body[data-page="scenario"] .ai-results-panel {
    overflow-x: hidden;
  }

  body[data-page="scenario"] .portfolio-ai-hero,
  body[data-page="scenario"] .ai-results-head {
    gap: 10px;
  }

  body[data-page="scenario"] .portfolio-ai-grid {
    grid-template-columns: minmax(0,1fr) minmax(260px,320px);
    gap: 10px;
    align-items: stretch;
  }

  body[data-page="scenario"] .ai-context-panel,
  body[data-page="scenario"] .ai-ask-panel,
  body[data-page="scenario"] .ai-results-panel {
    padding: 12px;
  }

  body[data-page="scenario"] .ai-step-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  body[data-page="scenario"] .ai-step-head > span {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  body[data-page="scenario"] .ai-selector-toolbar,
  body[data-page="scenario"] .ai-query-options,
  body[data-page="scenario"] .ai-action-row,
  body[data-page="scenario"] .ai-usage-card {
    grid-template-columns: 1fr;
  }

  body[data-page="scenario"] .ai-ticker-table-wrap,
  body[data-page="scenario"] .ai-detail-table-wrap {
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="scenario"] .ai-ticker-table-wrap {
    min-height: 320px;
    max-height: none;
    flex: 1 1 auto;
  }

  body[data-page="scenario"] #portfolioAiTickerTable {
    min-width: 660px;
  }

  body[data-page="scenario"] .portfolio-ai-question {
    min-height: 150px;
  }

  body[data-page="scenario"] .ai-result-cards {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
  }

  body[data-page="scenario"] .ai-result-card {
    min-height: 108px;
    padding: 10px;
  }

  body[data-page="scenario"] .ai-visual-row,
  body[data-page="scenario"] .ai-visual-side,
  body[data-page="scenario"] .ai-summary-dashboard,
  body[data-page="scenario"] .ai-result-summary {
    grid-template-columns: 1fr;
  }

  body[data-page="scenario"] .ai-map-card {
    width: 100%;
    min-height: 0;
    padding: 10px;
  }

  body[data-page="scenario"] .ai-map-viewport {
    width: 100%;
    aspect-ratio: 1000 / 460;
    max-height: 430px;
  }

  body[data-page="scenario"] .ai-risk-map {
    max-width: 100%;
    max-height: 430px;
  }

  body[data-page="scenario"] .ai-detail-table {
    min-width: 820px;
  }

  body[data-page="scenario"] .ai-tab-list {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body[data-page="scenario"] .ai-tab-list button {
    padding: 9px 10px;
    font-size: 13px;
  }
}

@media (max-width:699px) {
  body[data-page="scenario"] .main,
  body[data-page="scenario"] .portfolio-ai-workbench,
  body[data-page="scenario"] .ai-results-panel {
    overflow-x: hidden;
  }

  body[data-page="scenario"] .portfolio-ai-grid,
  body[data-page="scenario"] .ai-visual-row,
  body[data-page="scenario"] .ai-visual-side,
  body[data-page="scenario"] .ai-summary-dashboard,
  body[data-page="scenario"] .ai-result-summary {
    grid-template-columns: 1fr;
  }

  body[data-page="scenario"] #portfolioAiTickerTable {
    min-width: 620px;
  }

  body[data-page="scenario"] .ai-detail-table {
    min-width: 760px;
  }

  body[data-page="scenario"] .ai-map-card,
  body[data-page="scenario"] .ai-map-viewport {
    max-width: 100%;
  }
}

@media(max-width:720px){
  .portfolio-ai-hero h2 {
    font-size: 24px;
  }

  .portfolio-ai-hero-actions,
  .ai-action-row,
  .ai-query-options,
  .ai-usage-card,
  .ai-result-cards {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }

  .ai-ticker-table-wrap {
    min-height: 280px;
    max-height: 360px;
  }
}
