:root{
  --bg:#0b0f1a;
  --panel:#0f172a;
  --panel2:#0b1224;
  --stroke:rgba(255,255,255,.10);
  --stroke2:rgba(255,255,255,.06);
  --text:#e8eefc;
  --muted:rgba(232,238,252,.72);
  --good:#22c55e;
  --bad:#ef4444;
  --blue:rgba(47,125,246,.45);
  --blueBg:rgba(47,125,246,.18);
}

*{box-sizing:border-box}

html,body{
  height:100%;
  width:100%;
  margin:0;
  padding:0;
}

body{
  margin:0;
  font-family:system-ui,Segoe UI,Arial,sans-serif;
  background:black;
  color:var(--text);
  overflow-x:hidden;
  width:100%;
}

/* optional parent wrappers if present */
.wrap,
.app,
.page,
.dashboard,
.container{
  width:100%;
  max-width:100%;
  margin:0;
}

/* Reset */
h1,h2,h3,h4{margin:0}
h2{font-size:26px;letter-spacing:.2px}
h3{font-size:16px}
a{color:inherit}

/* =========================
   TOPBAR
========================= */
.topbar{
  display:flex;
  gap:14px;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
  flex-wrap:wrap;
  width:100%;
}

.brand{font-weight:800;letter-spacing:.2px}

.search{
  flex:1 1 320px;
  min-width:0;
}

.search input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  color:var(--text);
  outline:none;
}

.search input::placeholder{color:rgba(232,238,252,.45)}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.ghost{
  padding:10px 12px;
  border-radius:14px;
  background:transparent;
  border:1px solid var(--stroke);
  color:var(--text);
  cursor:pointer;
}

.ghost:hover{border-color:var(--blue)}

/* =========================
   TABS WRAP
========================= */
.tabsWrap{
  position:relative;
  z-index:5000;
  overflow:visible;
  width:100%;
}

/* =========================
   TABS
========================= */
.tabs{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid var(--stroke);
  overflow:visible;
  position:relative;
  z-index:3000;
  flex-wrap:wrap;
  width:100%;
}

/* market dropdown wrapper */
.marketDropdown{
  position:relative;
  flex:0 0 auto;
  z-index:4000;
}

/* dropdown button */
.marketToggle{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  white-space:nowrap;
  font-size:14px;
}

.marketToggle:hover{border-color:var(--blue)}

.flag{
  width:20px;
  height:14px;
  object-fit:cover;
  border-radius:2px;
  flex:0 0 auto;
  display:block;
}

.caret{
  font-size:12px;
  color:var(--muted);
}

/* dropdown menu */
.marketMenu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  min-width:190px;
  max-width:min(280px, 90vw);
  padding:8px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--panel);
  box-shadow:0 12px 28px rgba(0,0,0,.35);
  display:none;
  z-index:5000;
}

.marketMenu.show{
  display:block;
}

/* dropdown option */
.marketOption{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:none;
  border-radius:12px;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  text-align:left;
  font-size:14px;
}

.marketOption:hover{
  background:rgba(255,255,255,.06);
}

.marketOption .check{
  margin-left:auto;
  opacity:0;
  font-weight:800;
}

.marketOption.selected .check{
  opacity:1;
}

.tab{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  white-space:nowrap;
}

.tab:hover{border-color:var(--blue)}

.tab.active{
  background:var(--blueBg);
  border-color:var(--blue);
}

/* =========================
   MAIN LAYOUT
========================= */
.grid{
  display:grid;
  grid-template-columns:360px minmax(0,1fr);
  gap:14px;
  padding:14px;
  width:100%;
  max-width:100%;
  align-items:start;
}

/* left area */
.grid > :first-child{
  min-width:0;
  width:100%;
}

/* right area */
.grid > :last-child{
  min-width:0;
  width:100%;
}

/* inner right layout */
.mainArea,
.main,
.midGrid,
.side,
.panel,
.card{
  width:100%;
  min-width:0;
}

.midGrid{
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr);
  gap:14px;
  width:100%;
  min-width:0;
}

.side{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
  width:100%;
}

/* IMPORTANT: remove conflicting old wide-screen rules */
@media (min-width:1600px){
  .grid{
    grid-template-columns:380px minmax(0,1fr);
    gap:16px;
  }

  .midGrid{
    grid-template-columns:minmax(0,1.75fr) minmax(320px,1fr);
    gap:16px;
  }
}

@media (max-width:1200px){
  .grid{
    grid-template-columns:340px minmax(0,1fr);
  }

  .midGrid{
    grid-template-columns:minmax(0,1.35fr) minmax(280px,.95fr);
  }
}

@media (max-width:1100px){
  .grid{
    grid-template-columns:1fr;
  }

  .midGrid{
    grid-template-columns:1fr;
  }
}

@media (max-width:980px){
  .grid{
    grid-template-columns:1fr;
  }

  .midGrid{
    grid-template-columns:1fr;
  }
}

/* =========================
   PANELS / CARDS
========================= */
.panel,
.card{
  border:1px solid var(--stroke);
  border-radius:18px;
  padding:14px;
  background:rgba(255,255,255,.02);
  width:100%;
  min-width:0;
}

.panelHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  flex-wrap:wrap;
}

.muted{color:var(--muted);font-size:12px}
.divider{height:1px;background:var(--stroke);margin:14px 0}

/* =========================
   CAROUSEL
========================= */
.carousel{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
  min-width:0;
  width:100%;
}

.carBtn{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  flex:0 0 auto;
}

.carBtn:hover{border-color:var(--blue)}
.carBtn:disabled{opacity:.45;cursor:not-allowed}

.carWindow{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  padding:10px;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.carWindow::-webkit-scrollbar{display:none}

.carTrack{
  display:flex;
  gap:10px;
  align-items:stretch;
  scroll-snap-type:x mandatory;
  transform:none !important;
  transition:none !important;
  will-change:auto;
  min-width:max-content;
}

.pill{
  flex:0 0 clamp(220px, 24vw, 280px);
  min-width:220px;
  max-width:280px;
  scroll-snap-align:start;
  border-radius:999px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(15,23,42,.55);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pill .left{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.pill .name{
  font-size:12px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.pill .value{
  font-size:16px;
  font-weight:800;
}

.pill .right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  flex:0 0 auto;
}

.chg.good{color:var(--good);font-weight:800}
.chg.bad{color:var(--bad);font-weight:800}

.spark{
  width:92px;
  height:26px;
  display:block;
  border-radius:8px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}

/* =========================
   SUMMARY
========================= */
.summary{padding-top:2px}
.summaryTitle{font-weight:900;margin:6px 0}
.summarySentiment{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.05);
  font-size:12px;
  color:var(--muted);
  margin:6px 0 10px;
}

.summaryList{
  margin:0;
  padding-left:18px;
}

.summaryList li{
  margin:7px 0;
  color:rgba(232,238,252,.86);
  line-height:1.35;
}

/* =========================
   NEWS
========================= */
.newsList{
  min-width:0;
}

.newsList a{
  display:block;
  color:rgba(232,238,252,.92);
  text-decoration:none;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  margin-top:8px;
  line-height:1.25;
  word-break:break-word;
}

.newsList a:hover{border-color:var(--blue)}

/* =========================
   RECENT DEVELOPMENTS
========================= */
.devGrid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

@media(max-width:1100px){
  .devGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:700px){
  .devGrid{grid-template-columns:1fr}
}

.devCard{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  border-radius:14px;
  padding:12px;
  min-width:0;
}

.devMeta{
  display:flex;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  flex-wrap:wrap;
}

.devTitle{
  margin-top:8px;
  font-weight:900;
  font-size:14px;
  line-height:1.35;
  word-break:break-word;
}

.devLink{
  display:inline-block;
  margin-top:10px;
  color:rgba(47,125,246,.95);
  text-decoration:none;
  font-weight:800;
  font-size:13px;
}

.devLink:hover{text-decoration:underline}

/* =========================
   EQUITY SECTORS
========================= */
.sectorList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sectorRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
}

.sectorName{
  font-weight:800;
  font-size:13px;
  color:rgba(232,238,252,.92);
}

.sectorRight{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.sectorPrice{
  color:var(--muted);
  font-weight:800;
  font-size:13px;
}

.sectorPct{
  padding:4px 8px;
  border-radius:10px;
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(255,255,255,.10);
}

.sectorPct.good{
  background:rgba(34,197,94,.12);
  color:var(--good);
}

.sectorPct.bad{
  background:rgba(239,68,68,.12);
  color:var(--bad);
}

/* =========================
   WATCHLIST
========================= */
.watchList{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}

.watchRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  min-width:0;
}

.watchLeft{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.watchName{
  font-weight:900;
  font-size:13px;
}

.watchSub{
  color:var(--muted);
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.watchRight{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.watchPct{
  padding:4px 8px;
  border-radius:10px;
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(255,255,255,.10);
}

.watchPct.good{
  background:rgba(34,197,94,.12);
  color:var(--good);
}

.watchPct.bad{
  background:rgba(239,68,68,.12);
  color:var(--bad);
}

.starBtn{
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:rgba(232,238,252,.9);
  cursor:pointer;
}

.starBtn:hover{border-color:var(--blue)}
.starBtn.on{
  border-color:var(--blue);
  background:var(--blueBg);
}

/* =========================
   PREDICTIONS
========================= */
.predList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.predItem{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  border-radius:14px;
  padding:10px;
}

.predQ{
  font-weight:900;
  margin-bottom:8px;
  line-height:1.25;
}

.predRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:6px 0;
}

.predLbl{color:rgba(232,238,252,.88)}

.predProb{
  display:flex;
  align-items:center;
  gap:8px;
}

.predPct{
  min-width:56px;
  text-align:right;
  font-weight:900;
}

.predBar{
  width:88px;
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
}

.predFill{
  height:100%;
  background:rgba(47,125,246,.45);
}

.predMeta{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

/* =========================
   ASK BOX
========================= */
.askBox{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  border-radius:18px;
  overflow:hidden;
  width:100%;
  min-width:0;
}

.askSuggestions{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;
  flex-direction:column;
  gap:6px;
}

.askSug{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  cursor:pointer;
  color:rgba(232,238,252,.92);
}

.askSug:hover{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
}

.askIcon{
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(232,238,252,.65);
}

.askRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  min-width:0;
}

.askPlus{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(232,238,252,.85);
  cursor:pointer;
  flex:0 0 auto;
}

.askInput{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.02);
  color:var(--text);
  outline:none;
}

.askInput::placeholder{color:rgba(232,238,252,.45)}

.askSend{
  width:44px;
  height:36px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(232,238,252,.9);
  cursor:pointer;
  flex:0 0 auto;
}

.askSend:hover{border-color:var(--blue)}

.askAnswer{
  padding:12px;
  border-top:1px solid rgba(255,255,255,.08);
  color:rgba(232,238,252,.90);
  white-space:pre-wrap;
  line-height:1.45;
}

.askLoading{color:var(--muted)}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1100px){
  .pill{
    flex:0 0 250px;
    min-width:250px;
    max-width:250px;
  }
}

@media (max-width:700px){
  h2{font-size:22px}

  .topbar{
    padding:12px;
    gap:10px;
  }

  .tabs{
    gap:6px;
    padding:10px;
  }

  .marketToggle,
  .tab{
    font-size:13px;
    padding:8px 10px;
  }

  .marketMenu{
    min-width:170px;
  }

  .carousel{
    gap:8px;
  }

  .carBtn{
    width:34px;
    height:34px;
    border-radius:10px;
  }

  .carWindow{
    border-radius:18px;
    padding:8px;
  }

  .pill{
    flex:0 0 82vw;
    min-width:82vw;
    max-width:82vw;
  }

  .pill .value{
    font-size:15px;
  }

  .spark{
    width:78px;
    height:24px;
  }

  .watchRow,
  .sectorRow,
  .predRow,
  .askRow{
    align-items:flex-start;
  }

  .watchRow,
  .sectorRow,
  .predRow{
    flex-direction:column;
  }

  .watchRight,
  .sectorRight,
  .predProb{
    width:100%;
    justify-content:space-between;
  }
}