/* ui/assets/style.css
   Clean consolidated version
   Theme root: #app-root.theme-dark / #app-root.theme-light
*/

/* =========================
   Base
   ========================= */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, sans-serif;
}

.bg-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: url("/assets/background_wide.png") no-repeat center center;
  background-size: cover;
  opacity: 0.22;
}

#app-root.theme-light .bg-overlay{
  opacity: 0.10;
  filter: saturate(0.9) contrast(1.02);
}

/* =========================
   Layout wrappers
   ========================= */
.woi-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 14px 30px 14px;
}

.woi-topbar {
  padding: 10px 10px 12px 10px;
}

.woi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.woi-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.woi-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

/* =========================
   Buttons / controls
   ========================= */
.woi-btn {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.woi-btn:hover { filter: brightness(1.05); }

.btn-icon{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 800;
}
.btn-icon:hover{ filter: brightness(1.06); }

#app-root .btn{
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}
#app-root .btn:hover{ filter: brightness(1.06); }

#app-root button{
  -webkit-appearance: none;
  appearance: none;
}

#app-root input,
#app-root select,
#app-root textarea{
  background: var(--panel) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
}

#app-root input::placeholder,
#app-root textarea::placeholder{
  color: var(--muted2) !important;
}

input, button, select {
  font-family: Arial, sans-serif;
}

input[type="text"], input[type="search"], input[type="number"] {
  height: 30px;
  line-height: 30px;
}

/* =========================
   Panels
   ========================= */
.woi-panel {
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.woi-titlebar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.woi-explain {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  overflow-x: auto;
}

/* =========================
   DataTable - consolidated
   ========================= */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner{
  color: var(--fg) !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell *,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell *,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-cell-value,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-cell-value *{
  opacity: 1 !important;
  color: inherit !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell{
  background-color: var(--panel);
  color: var(--fg);
  border-color: var(--border2) !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-header,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell{
  background-color: var(--panel2) !important;
  color: var(--fg) !important;
  border-color: var(--border) !important;
  font-weight: 800 !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr td.dash-cell {
  border-bottom: 1px solid rgba(10,20,28,0.08) !important;
}

#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr td.dash-cell {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* hover */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td.dash-cell {
  background-color: rgba(10,20,28,0.035) !important;
  color: var(--fg) !important;
}

#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td.dash-cell {
  background-color: rgba(255,255,255,0.045) !important;
  color: var(--fg) !important;
}

/* selected / focused */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected {
  color: var(--fg) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused.cell--selected {
  background-color: rgba(0, 180, 140, 0.12) !important;
  color: var(--fg) !important;
  outline: 1px solid rgba(0, 180, 140, 0.35) !important;
  outline-offset: -1px !important;
}

#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected,
#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused,
#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused.cell--selected {
  background-color: rgba(0, 230, 180, 0.18) !important;
  color: var(--fg) !important;
  outline: 1px solid rgba(0, 230, 180, 0.55) !important;
  outline-offset: -1px !important;
}

/* light mode text clarity */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell {
  color: rgba(8,15,24,0.92) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell {
  color: rgba(8,15,24,0.94) !important;
  background-color: rgba(10,20,28,0.05) !important;
  border-bottom: 1px solid rgba(10,20,28,0.12) !important;
}

/* header sort icons */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort:hover,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .dash-sort,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th svg{
  color: var(--muted) !important;
  fill: var(--muted) !important;
}

/* filter row */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter{
  background-color: var(--panel2) !important;
}
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input{
  background-color: rgba(0,0,0,0) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
}
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input::placeholder{
  color: var(--muted2) !important;
}

/* numeric columns */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.column-0,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.column-1{
  font-variant-numeric: tabular-nums;
}

/* =========================
   Dropdowns
   ========================= */
.dd .Select-control,
.dd .Select-control:hover {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  color: var(--fg) !important;
}

.dd .Select-placeholder,
.dd .Select-value-label { color: var(--fg) !important; }

.dd .Select-arrow-zone,
.dd .Select-clear-zone { color: var(--muted) !important; }

.dd .Select-menu-outer {
  background: var(--panel2) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
}

.dd .Select-menu { background: transparent !important; }

.dd .Select-option {
  background: transparent !important;
  color: var(--fg) !important;
}

.dd .Select-option.is-focused {
  background: var(--accent2) !important;
  color: var(--fg) !important;
}

.dd .Select-option.is-selected {
  background: var(--accent) !important;
  color: var(--fg) !important;
  font-weight: 800 !important;
}

.dd .Select-input > input { color: var(--fg) !important; }

#app-root .Select-menu-outer{
  opacity: 1 !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,0.28) !important;
  z-index: 9999 !important;
}

#app-root.theme-dark .Select-menu-outer{
  background: rgba(5,10,15,1) !important;
}

#app-root.theme-light .Select-menu-outer{
  background: rgba(255,255,255,1) !important;
}

#app-root .Select-menu{
  background: transparent !important;
}

#app-root .Select-option{
  background: transparent !important;
  color: var(--fg) !important;
}

#app-root .Select-option.is-focused{
  background: var(--accent2) !important;
  color: var(--fg) !important;
}

#app-root .Select-option.is-selected{
  background: var(--accent) !important;
  color: var(--fg) !important;
  font-weight: 800 !important;
}

#app-root .Select-control,
#app-root .Select-control:hover{
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  color: var(--fg) !important;
}

.Select-control {
  min-height: 30px !important;
  height: 30px !important;
}
.Select-placeholder, .Select--single > .Select-control .Select-value {
  line-height: 30px !important;
}
.Select-input {
  height: 30px !important;
}
.Select-input > input {
  line-height: 30px !important;
}
.Select-menu-outer {
  border-radius: 10px !important;
  overflow: hidden !important;
}

.dd .VirtualizedSelectOption {
  background: transparent !important;
  color: var(--fg) !important;
}
.dd .VirtualizedSelectFocusedOption {
  background: var(--accent2) !important;
  color: var(--fg) !important;
}

/* =========================
   Details
   ========================= */
.details-box {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.details-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--fg);
  background: var(--card);
  border-bottom: 1px solid var(--border2);
  user-select: none;
}

.details-summary:hover { filter: brightness(1.05); }

.details {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--fg);
  background: var(--panel2);
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

/* =========================
   Market overview
   ========================= */
.mkt-overview{
  margin: 10px 0 12px 0;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  padding: 10px 12px 12px 12px;
}

.mkt-title{
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--fg);
}

.mkt-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 10px;
}

.mkt-card{
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.mkt-hdr{
  padding: 8px 10px;
  border-bottom: 1px solid var(--border2);
  font-weight: 700;
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.mkt-fig{ height: 140px; }

/* YouTube CTA */
.mkt-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yt-cta{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0.95;
}

.yt-cta-text{
  font-size: 12px;
  color: var(--muted, rgba(232,241,242,0.75));
  white-space: nowrap;
}

.yt-cta-link{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: var(--fg, rgba(232,241,242,0.92));
}

.yt-cta-link:hover{
  filter: brightness(1.08);
}

@media (max-width: 720px){
  .mkt-head{
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .yt-cta{
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .yt-cta-text{
    font-size: 11px;
    white-space: normal;
    line-height: 1.2;
  }
  .yt-cta-link{
    font-size: 11px;
    padding: 5px 9px;
  }
}

/* =========================
   Ticker tape
   ========================= */
.ticker-area{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  margin:8px 12px 0 12px;
  border-radius:12px;
  background: var(--panel);
  border: 1px solid var(--border2);
  backdrop-filter: blur(10px);
}

.ticker-controls{ display:flex; gap:6px; flex:0 0 auto; }

.tape-btn{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
}
.tape-btn:hover{ filter: brightness(1.06); }

.ticker-wrap{
  position:relative;
  overflow:hidden;
  width:100%;
  height:34px;
}
.ticker-wrap.paused .ticker{ animation-play-state: paused; }

.ticker{
  display:flex;
  gap:18px;
  align-items:center;
  height:34px;
  white-space:nowrap;
  will-change: transform;
  animation: ticker-marquee 18s linear infinite;
}

@keyframes ticker-marquee{
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:4px 10px;
  border-radius:999px;
  background: var(--card);
  border: 1px solid var(--border2);
  font-size:14px;
}

.ticker-sym{ font-weight:800; letter-spacing:0.5px; }
.ticker-price{ opacity:0.9; }
.ticker-chg{ opacity:0.9; font-weight:700; }
.ticker-chg.up{ color: var(--up); }
.ticker-chg.down{ color: var(--down); }

.ticker-badge-hot{
  font-size:12px;
  font-weight:800;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,140,0,0.18);
  border: 1px solid rgba(255,140,0,0.25);
}

.ticker-badge-top{
  font-size:12px;
  font-weight:800;
  padding:2px 8px;
  border-radius:999px;
  background: var(--card);
  border: 1px solid var(--border);
}

@media (max-width: 720px){
  .ticker-controls{ display:none !important; }
  .ticker{ animation-duration: 12s !important; }
  .ticker-item{ font-size: 13px; padding: 4px 8px; gap: 6px; }
}

@media (min-width: 721px){
  .ticker{ animation-duration: 14s; }
}

/* =========================
   Overlays checklist
   ========================= */
#overlays {
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid rgba(10,20,28,0.10);
  background: rgba(10,20,28,0.03);
}

#app-root.theme-dark #overlays {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

#overlays label {
  margin-right: 14px;
  user-select: none;
}

/* =========================
   Plotly modebar
   ========================= */
.js-plotly-plot .modebar {
  opacity: 0.72;
  transition: opacity 0.15s ease;
}
.js-plotly-plot:hover .modebar {
  opacity: 1;
}

#app-root.theme-light .js-plotly-plot .modebar-btn {
  opacity: 0.85;
}
#app-root.theme-light .js-plotly-plot .modebar-btn:hover {
  opacity: 1;
}

/* =========================
   Analyst cards
   ========================= */
.analyst-card{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  border-radius: 14px;
  padding: 12px 12px;
  margin-top: 10px;
}

.analyst-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.analyst-title{
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 14px;
  opacity: .95;
}

.pill{
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}
.pill.pos{ color:#00ff9a; border-color: rgba(0,255,154,0.25); background: rgba(0,255,154,0.08); }
.pill.neg{ color:#ff4d6d; border-color: rgba(255,77,109,0.25); background: rgba(255,77,109,0.08); }
.pill.neutral{ color: rgba(232,241,242,0.75); }

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

.kv .k{
  font-size: 11px;
  opacity: .65;
  margin-bottom: 2px;
}
.kv .v{
  font-size: 13px;
  font-weight: 800;
  opacity: .95;
}

.analyst-subhdr{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.muted{
  opacity:.65;
  font-size: 12px;
}

.recbar{
  height: 10px;
  border-radius: 999px;
  overflow:hidden;
  display:flex;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  margin-top: 8px;
}
.recseg{ height:100%; }
.recseg.buy{ background: rgba(0,255,154,0.75); }
.recseg.hold{ background: rgba(255,209,102,0.75); }
.recseg.sell{ background: rgba(255,77,109,0.75); }

@media (max-width: 720px){
  .analyst-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* =========================
   Watchlist / mobile cards
   ========================= */
.wl-mob-card{
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 10px;
  background: rgba(0,0,0,0.22);
}

.wl-mob-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}

.wl-mob-sym{
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-color, #4da3ff);
  letter-spacing: 0.4px;
}

.wl-mob-pill .pill{
  font-size: 12px;
  padding: 6px 10px;
}

.wl-mob-metrics{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-bottom: 12px;
}

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

.kv{
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.kv .k{
  font-size: 11px;
  opacity: 0.70;
  margin-bottom: 4px;
}

.kv .v{
  font-size: 15px;
  font-weight: 800;
}

.wl-mob-bottom{
  display:flex;
  align-items:center;
  gap:10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.wl-mob-reason{
  font-size: 12px;
  opacity: 0.70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-mob-card .mob-open-btn{
  width: 100%;
  margin-top: 10px;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
}

.wl-card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 14px 14px 12px;
  margin: 12px 0;
  position: relative;
  overflow: hidden;
}

.wl-card::before{
  content:"";
  position:absolute;
  left:0; top:0; right:0;
  height: 6px;
  background: rgba(255,255,255,0.10);
}
.wl-ok::before   { background: rgba(0,220,120,0.85); }
.wl-warn::before { background: rgba(255,190,0,0.90); }
.wl-exit::before { background: rgba(255,80,180,0.90); }

.wl-hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 2px;
}
.wl-sym{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
}
.wl-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  white-space: nowrap;
}
.wl-pill .tag{
  opacity: .75;
  font-weight: 800;
}

.wl-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wl-m{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
}
.wl-k{ font-size: 11px; opacity: .70; margin-bottom: 4px; }
.wl-v{ font-size: 15px; font-weight: 900; }

.pos{ color: rgba(0,220,120,0.95); }
.neg{ color: rgba(255,80,80,0.95); }
.neu{ color: rgba(232,241,242,0.92); }

.wl-reason{
  margin-top: 10px;
  font-size: 12px;
  opacity: .78;
  line-height: 1.25;
}

.wl-btn{
  margin-top: 12px;
}
.wl-btn button{
  width: 100%;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font-weight: 900 !important;
}

/* =========================
   Premium normal mobile cards
   ========================= */
@media (max-width: 992px){
  .mcard.premium .msym,
  .mcard.premium .msym.link{
    color: #4da3ff !important;
    font-weight: 900 !important;
    letter-spacing: 0.4px;
  }

  .mcard.premium{
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    background: rgba(0,0,0,0.20) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.28);
    padding: 14px !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #app-root.theme-light .mcard.premium{
    background: rgba(255,255,255,0.92) !important;
    border: 1px solid rgba(10,20,28,0.10) !important;
    box-shadow: 0 10px 26px rgba(10,20,28,0.10);
  }

  .mcard.premium .mscore{
    font-weight: 800;
    opacity: 0.78;
  }

  .mcard.premium .mrow2{
    margin-top: 10px !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .mcard.premium .kv{
    padding: 10px 10px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    min-width: 0 !important;
  }

  #app-root.theme-light .mcard.premium .kv{
    background: rgba(10,20,28,0.03) !important;
    border: 1px solid rgba(10,20,28,0.08) !important;
  }

  .mcard.premium .kv .v{
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .mcard.premium .mbadge{
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    background: rgba(255,255,255,0.06) !important;
  }

  .mcard.premium .mbadge.good{
    color: var(--up) !important;
    border-color: rgba(0,255,154,0.30) !important;
    background: rgba(0,255,154,0.10) !important;
  }
  .mcard.premium .mbadge.bad{
    color: var(--down) !important;
    border-color: rgba(255,77,109,0.30) !important;
    background: rgba(255,77,109,0.12) !important;
  }

  .mcard.premium .mob-open-btn{
    width: 100% !important;
    margin-top: 10px !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    font-weight: 900 !important;
    border: 1px solid var(--border) !important;
    background: rgba(255,255,255,0.06) !important;
    color: var(--fg) !important;
    box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  }
  .mcard.premium .mob-open-btn:hover{ filter: brightness(1.05); }
  .mcard.premium .mob-open-btn:active{ transform: translateY(1px); }

  #tbl-mobile, .mobile-cards, .mcard-wrap, .mcard-list{
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .mcard.premium,
  .mcard.premium *{
    box-sizing: border-box !important;
  }

  .mcard.premium .pill{
    font-weight: 900 !important;
    letter-spacing: 0.2px;
    padding: 7px 12px !important;
    border-width: 2px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  }

  .mcard.premium .pill.pill-ok{
    background: rgba(0,255,154,0.16) !important;
    border-color: rgba(0,255,154,0.55) !important;
  }

  .mcard.premium .pill.pill-risk{
    background: rgba(255,77,109,0.18) !important;
    border-color: rgba(255,77,109,0.55) !important;
  }

  .mcard.premium .v.pos{
    color: var(--up) !important;
    -webkit-text-fill-color: var(--up) !important;
    font-weight: 900 !important;
    text-shadow: 0 0 10px rgba(0,255,154,0.18);
  }
  .mcard.premium .v.neg{
    color: var(--down) !important;
    -webkit-text-fill-color: var(--down) !important;
    font-weight: 900 !important;
    text-shadow: 0 0 10px rgba(255,77,109,0.18);
  }
  .mcard.premium .v.neu{
    color: var(--fg) !important;
    -webkit-text-fill-color: var(--fg) !important;
    opacity: 0.85;
    font-weight: 800;
  }
}

/* =========================
   Topbar / help
   ========================= */
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.help-label-mobile { display: none; }
.help-label-desktop { display: inline; }

@media (max-width: 520px) {
  .help-label-desktop { display: none; }
  .help-label-mobile { display: inline; }

  .btn-help {
    min-width: 44px;
    padding: 10px 12px;
  }

  .top-actions .btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}

.help-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
}

.help-panel{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 92vw);
  z-index: 9999;
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.help-panel.open{
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.help-backdrop.open{
  display: block;
}

.topbar-spacer{ flex: 1; }

@media (max-width: 520px){
  .topbar-spacer{ display:none; }
  .topbar-row{ flex-wrap: wrap; }
}

button.btn-help,
.btn-help{
  border: none !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  background: rgba(120, 240, 215, 0.92) !important;
  color: #071017 !important;
  box-shadow: 0 8px 22px rgba(0,0,0,0.25) !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}
button.btn-help:hover{ filter: brightness(1.03) !important; }
button.btn-help:active{ transform: translateY(1px) !important; }

/* =========================
   SEO microcopy
   ========================= */
.seo-microcopy{
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.62;
  margin-top: 2px;
  max-width: 820px;
  white-space: normal;
}

@media (max-width: 768px){
  .seo-microcopy{
    font-size: 11px;
    opacity: 0.58;
    max-width: 92vw;
  }
}

/* =========================
   Narrative
   ========================= */
.narrative-md{
  font-size: 14px;
  line-height: 1.7;
}

#app-root.theme-dark .narrative-md{
  color: #e6e6e6;
}
#app-root.theme-dark .narrative-md a{
  color: #93c5fd;
  text-decoration: underline;
  word-break: break-word;
}

#app-root.theme-light .narrative-md{
  color: #111827;
}
#app-root.theme-light .narrative-md a{
  color: #1d4ed8;
  text-decoration: underline;
  word-break: break-word;
}

.narrative-md h2{ font-size:18px; margin:0 0 6px 0; }
.narrative-md h3{ font-size:15px; margin:14px 0 6px 0; }
.narrative-md ul{ margin-left:16px; }
.narrative-md li{ margin-bottom:6px; }

/* =========================
   Guide images - deduped
   ========================= */
img.guide-hero-img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  border-radius: 16px;
}

img.guide-thumb-card{
  display:block !important;
  width:100% !important;
  height:auto !important;
  border-radius: 12px;
}

@media (min-width: 1024px){
  img.guide-hero-img{
    max-width: 980px !important;
    margin: 10px auto 14px auto !important;
  }

  img.guide-thumb-card{
    max-width: 170px !important;
  }

  img.guide-thumb,
  img[src^="/static/guides/"],
  img[src*="/static/guides/"],
  img[src*="/assets/guides/"],
  img[src*="/assets/guide_"]{
    display: block !important;
    width: 100% !important;
    max-width: 980px !important;
    height: auto !important;
    margin: 0 auto !important;
    border-radius: 14px;
  }

  div[style*="max-width:980px"][style*="margin:0 auto"] img{
    width: 100% !important;
    height: auto !important;
    max-width: 980px !important;
    margin: 0 auto !important;
    display: block !important;
  }

  div[style*="max-width:170px"],
  div[style*="max-width: 170px"]{
    max-width: 980px !important;
    width: 100% !important;
  }

  div[style*="flex:0 0 170px"],
  div[style*="flex: 0 0 170px"]{
    flex: 1 1 100% !important;
    max-width: 980px !important;
    width: 100% !important;
  }

  .guide-hero-grid, .guide-hero-tile, .guide-card, .guide-card-row{
    max-width: 980px;
  }
}
/* ===== Dash DataTable internal vars override ===== */
#app-root.theme-dark .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
  --hover: rgba(255,255,255,0.045) !important;
  --background-color-ellipses: rgba(255,255,255,0.045) !important;
  --selected-background: rgba(0,230,180,0.18) !important;
  --faded-text: rgba(232,241,242,0.55) !important;
  --faded-text-header: rgba(232,241,242,0.55) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
  --hover: rgba(10,20,28,0.035) !important;
  --background-color-ellipses: rgba(10,20,28,0.035) !important;
  --selected-background: rgba(0,180,140,0.12) !important;
  --faded-text: rgba(8,15,24,0.45) !important;
  --faded-text-header: rgba(8,15,24,0.45) !important;
}

/* DARK THEME DEFAULT */

:root {
    --woi-card-bg: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
    --woi-card-border: rgba(255,255,255,0.10);
    --woi-card-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

/* LIGHT THEME */

body.light-mode {
    --woi-card-bg: #f7f9fc;
    --woi-card-border: #e3e8ef;
    --woi-card-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.footer-link:hover {
    transform: translateY(-1px);
    border-color: #39ffb6;
}


/* === WOI LIGHT ANALYSIS SECTION PATCH START === */
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #explore-analysis-wrap,
#app-root.theme-light #details-howto {
  background: #ffffff !important;
  border: 1px solid #dbe3ee !important;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06) !important;
  color: #0f172a !important;
}

#app-root.theme-light #narrative-wrap > div:first-child,
#app-root.theme-light #analysis-wrap > div:first-child,
#app-root.theme-light #explore-analysis-wrap > div:first-child,
#app-root.theme-light #details-howto > div:first-child {
  color: #0f172a !important;
}

#app-root.theme-light #narrative-panel,
#app-root.theme-light #analysis-panel,
#app-root.theme-light #details-howto,
#app-root.theme-light #details-howto li,
#app-root.theme-light #details-howto div,
#app-root.theme-light #details-howto span,
#app-root.theme-light #details-howto p {
  color: #334155 !important;
}

#app-root.theme-light #details-howto a,
#app-root.theme-light #narrative-wrap a,
#app-root.theme-light #analysis-wrap a,
#app-root.theme-light #explore-analysis-wrap a {
  color: #2563eb !important;
}

#app-root.theme-light #details-howto a:hover,
#app-root.theme-light #narrative-wrap a:hover,
#app-root.theme-light #analysis-wrap a:hover,
#app-root.theme-light #explore-analysis-wrap a:hover {
  color: #0f766e !important;
}

#app-root.theme-light #explore-analysis-wrap {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
}

#app-root.theme-light #explore-analysis-wrap > div:nth-child(2) {
  color: #64748b !important;
}

#app-root.theme-light #explore-analysis-wrap [style*="flex: 1 1 260px"],
#app-root.theme-light #explore-analysis-wrap [style*="flex":"1 1 260px"] {
  background: #ffffff !important;
  border: 1px solid #dbe3ee !important;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05) !important;
}

#app-root.theme-light #explore-analysis-wrap [style*="fontWeight\": \"800\""],
#app-root.theme-light #explore-analysis-wrap [style*="fontWeight':'800'"] {
  color: #0f172a !important;
}

#app-root.theme-light #explore-analysis-wrap .footer-link {
  color: #1d4ed8 !important;
}

#app-root.theme-light #explore-analysis-wrap a.footer-link,
#app-root.theme-light #explore-analysis-wrap a[href^="/analysis/"] {
  background: #f8fafc !important;
  border: 1px solid #dbe3ee !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
}

#app-root.theme-light #explore-analysis-wrap a.footer-link:hover,
#app-root.theme-light #explore-analysis-wrap a[href^="/analysis/"]:hover {
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  color: #0f766e !important;
  transform: translateY(-1px);
}

#app-root.theme-light #analysis-wrap pre,
#app-root.theme-light #narrative-panel {
  color: #334155 !important;
}

#app-root.theme-light #details-howto ul {
  color: #334155 !important;
}

#app-root.theme-light #details-howto {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
}

#app-root.theme-light #analysis-wrap [style*="background"],
#app-root.theme-light #narrative-wrap [style*="background"] {
  color: inherit !important;
}
/* === WOI LIGHT ANALYSIS SECTION PATCH END === */

/* --------------------------------------------------
   Explore More Stock Analysis chips – readability pass
-------------------------------------------------- */
.explore-chip a,
.explore-card a,
.analysis-chip a {
  color: #6ec3ff !important;
  text-decoration: none !important;
  text-shadow: none !important;
  font-weight: 700 !important;
  transition: color 140ms ease, transform 140ms ease, opacity 140ms ease !important;
}

.explore-chip a:visited,
.explore-card a:visited,
.analysis-chip a:visited {
  color: #86b6ff !important;
  text-shadow: none !important;
}

.explore-chip a:hover,
.explore-card a:hover,
.analysis-chip a:hover,
.explore-chip a:focus,
.explore-card a:focus,
.analysis-chip a:focus {
  color: #a855f7 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

.explore-chip:hover,
.explore-card .chip:hover,
.analysis-chip:hover {
  transform: translateY(-1px);
}

#app-root.theme-light .explore-chip a,
#app-root.theme-light .explore-card a,
#app-root.theme-light .analysis-chip a {
  color: #2563eb !important;
  text-shadow: none !important;
}

#app-root.theme-light .explore-chip a:visited,
#app-root.theme-light .explore-card a:visited,
#app-root.theme-light .analysis-chip a:visited {
  color: #4f46e5 !important;
}

#app-root.theme-light .explore-chip a:hover,
#app-root.theme-light .explore-card a:hover,
#app-root.theme-light .analysis-chip a:hover,
#app-root.theme-light .explore-chip a:focus,
#app-root.theme-light .explore-card a:focus,
#app-root.theme-light .analysis-chip a:focus {
  color: #7c3aed !important;
  text-shadow: none !important;
}

/* --------------------------------------------------
   WOI light theme refresh – premium soft slate palette
-------------------------------------------------- */
#app-root.theme-light {
  --woi-inst-bg: #eaf2fb;
  --woi-inst-panel: #f6faff;
  --woi-inst-card: #ffffff;
  --woi-inst-header: #dbe8f5;
  --woi-inst-border: #c8d8ea;
  --woi-inst-border-2: #b8cde3;
  --woi-inst-text: #17212b;
  --woi-inst-text-soft: #566779;
  --woi-inst-blue: #1d4ed8;
  --woi-inst-blue-soft: #dbeafe;
  --woi-inst-green-bg: rgba(22, 163, 74, 0.16);
  --woi-inst-green-text: #166534;
  --woi-inst-red-bg: rgba(220, 38, 38, 0.16);
  --woi-inst-red-text: #991b1b;
  --woi-inst-cyan-bg: rgba(14, 165, 233, 0.18);
  --woi-inst-cyan-text: #0c4a6e;
  --woi-inst-gold-bg: rgba(245, 158, 11, 0.20);
  --woi-inst-gold-text: #92400e;
  --woi-inst-row-alt: #f4f8fd;
  --woi-inst-row-hover: #e6f0fa;
  --woi-inst-shadow: 0 12px 28px rgba(20, 32, 44, 0.08);
}

/* page background */
#app-root.theme-light,
#app-root.theme-light.page,
#app-root.theme-light .page,
#app-root.theme-light body {
  background: var(--woi-light-bg-main) !important;
  color: var(--woi-light-text) !important;
}

/* top-level sections / wrappers */
#app-root.theme-light .topbar,
#app-root.theme-light .mkt-overview,
#app-root.theme-light .tablewrap,
#app-root.theme-light .chartwrap,
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #details-howto,
#app-root.theme-light .details-box,
#app-root.theme-light footer.footer {
  background: var(--woi-light-bg-panel) !important;
  border-color: var(--woi-light-border) !important;
  box-shadow: var(--woi-light-shadow) !important;
}

/* cards */
#app-root.theme-light .mkt-card,
#app-root.theme-light .explore-section,
#app-root.theme-light .explore-card,
#app-root.theme-light .guide-card,
#app-root.theme-light .mcard,
#app-root.theme-light .details-box,
#app-root.theme-light .help-panel,
#app-root.theme-light .watchlist-bar {
  background: var(--woi-light-bg-card) !important;
  border: 1px solid var(--woi-light-border) !important;
  box-shadow: var(--woi-light-shadow) !important;
}

/* generic text cleanup */
#app-root.theme-light .title,
#app-root.theme-light .mkt-title,
#app-root.theme-light .lbl,
#app-root.theme-light h1,
#app-root.theme-light h2,
#app-root.theme-light h3,
#app-root.theme-light h4,
#app-root.theme-light h5,
#app-root.theme-light h6,
#app-root.theme-light strong,
#app-root.theme-light b {
  color: var(--woi-light-text) !important;
}

#app-root.theme-light .seo-microcopy,
#app-root.theme-light .status,
#app-root.theme-light .footer,
#app-root.theme-light .footer-left,
#app-root.theme-light .mkt-hdr,
#app-root.theme-light #screener-help,
#app-root.theme-light #analysis-panel,
#app-root.theme-light #narrative-panel,
#app-root.theme-light .details,
#app-root.theme-light .yt-cta-text {
  color: var(--woi-light-text-soft) !important;
}

/* buttons / controls */
#app-root.theme-light .btn,
#app-root.theme-light .btn-help,
#app-root.theme-light .tape-btn,
#app-root.theme-light button,
#app-root.theme-light input,
#app-root.theme-light textarea,
#app-root.theme-light .Select-control,
#app-root.theme-light .Select-menu-outer,
#app-root.theme-light .Select-menu {
  background: #ffffff !important;
  color: var(--woi-light-text) !important;
  border-color: var(--woi-light-border-strong) !important;
  box-shadow: none !important;
}

#app-root.theme-light .btn:hover,
#app-root.theme-light .btn-help:hover,
#app-root.theme-light .tape-btn:hover,
#app-root.theme-light button:hover {
  border-color: #b8c7d6 !important;
  background: #f8fbff !important;
}

/* dropdown / links */
#app-root.theme-light a,
#app-root.theme-light .seo-inline-link,
#app-root.theme-light .footer-link,
#app-root.theme-light .yt-cta-link {
  color: var(--woi-light-accent) !important;
}

#app-root.theme-light a:hover,
#app-root.theme-light .seo-inline-link:hover,
#app-root.theme-light .footer-link:hover,
#app-root.theme-light .yt-cta-link:hover {
  color: #1d4ed8 !important;
}

/* data table shell */
#app-root.theme-light .dash-table-container,
#app-root.theme-light .dash-spreadsheet-container,
#app-root.theme-light .dash-spreadsheet-inner,
#app-root.theme-light .dash-table-container table {
  background: #ffffff !important;
  color: var(--woi-light-text) !important;
}

/* table headers */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-header,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell {
  background: #e8f0f7 !important;
  color: var(--woi-light-text) !important;
  border-color: var(--woi-light-border) !important;
}

/* table cells */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell {
  background: rgba(255,255,255,0.92) !important;
  color: var(--woi-light-text) !important;
  border-color: #e1e8f0 !important;
}

/* row hover */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td.dash-cell {
  background: #f2f7fc !important;
}

/* selected / focused cells */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused.cell--selected {
  background: #e6f1ff !important;
  border-color: #93c5fd !important;
  color: var(--woi-light-text) !important;
}

/* plotly paper area */
#app-root.theme-light .js-plotly-plot,
#app-root.theme-light .plot-container,
#app-root.theme-light .svg-container {
  background: transparent !important;
}

/* modebar buttons */
#app-root.theme-light .js-plotly-plot .modebar {
  background: rgba(255,255,255,0.88) !important;
  border: 1px solid var(--woi-light-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--woi-light-shadow) !important;
}

#app-root.theme-light .js-plotly-plot .modebar-btn {
  color: var(--woi-light-text-soft) !important;
}

#app-root.theme-light .js-plotly-plot .modebar-btn:hover {
  color: var(--woi-light-accent) !important;
  background: #eef5ff !important;
}

/* explore section specifically */
#app-root.theme-light .explore-section {
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%) !important;
  border: 1px solid var(--woi-light-border) !important;
  box-shadow: var(--woi-light-shadow) !important;
}

#app-root.theme-light .explore-card {
  background: #ffffff !important;
  border: 1px solid var(--woi-light-border) !important;
}

#app-root.theme-light .explore-chip,
#app-root.theme-light .analysis-chip {
  background: #f8fbff !important;
  border: 1px solid #d6e3f0 !important;
  box-shadow: none !important;
}

/* narrative / analysis boxes */
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #details-howto {
  background: #f7fafc !important;
  border: 1px solid var(--woi-light-border) !important;
}

/* mobile cards */
#app-root.theme-light .mobile-card,
#app-root.theme-light .mcard,
#app-root.theme-light .mcard.premium {
  background: #ffffff !important;
  border: 1px solid var(--woi-light-border) !important;
  box-shadow: var(--woi-light-shadow) !important;
}

/* help backdrop/panel */
#app-root.theme-light #help-panel {
  background: #ffffff !important;
  color: var(--woi-light-text) !important;
  border-left: 1px solid var(--woi-light-border) !important;
}

/* footer */
#app-root.theme-light footer.footer {
  background: #f3f7fb !important;
  color: var(--woi-light-text-soft) !important;
}



/* --- restore table heatmap colors in light theme --- */

#app-root.theme-light .dash-table-container td.positive,
#app-root.theme-light .dash-table-container td.chg-positive {
  background: rgba(16,185,129,0.18) !important;
  color: #065f46 !important;
}

#app-root.theme-light .dash-table-container td.negative,
#app-root.theme-light .dash-table-container td.chg-negative {
  background: rgba(239,68,68,0.18) !important;
  color: #7f1d1d !important;
}

/* score bar */

#app-root.theme-light .scorebar {
  background: linear-gradient(90deg,#60a5fa,#22d3ee) !important;
  opacity: .75;
}

/* row hover */

#app-root.theme-light .dash-spreadsheet-inner tr:hover td {
  background: #eaf3fb !important;
}

/* --------------------------------------------------
   WOI institutional light theme – table + finance UI polish
-------------------------------------------------- */

/* root palette */
#app-root.theme-light {
  --woi-inst-bg: #eaf2fb;
  --woi-inst-panel: #f6faff;
  --woi-inst-card: #ffffff;
  --woi-inst-header: #dbe8f5;
  --woi-inst-border: #c8d8ea;
  --woi-inst-border-2: #b8cde3;
  --woi-inst-text: #17212b;
  --woi-inst-text-soft: #566779;
  --woi-inst-blue: #1d4ed8;
  --woi-inst-blue-soft: #dbeafe;
  --woi-inst-green-bg: rgba(22, 163, 74, 0.16);
  --woi-inst-green-text: #166534;
  --woi-inst-red-bg: rgba(220, 38, 38, 0.16);
  --woi-inst-red-text: #991b1b;
  --woi-inst-cyan-bg: rgba(14, 165, 233, 0.18);
  --woi-inst-cyan-text: #0c4a6e;
  --woi-inst-gold-bg: rgba(245, 158, 11, 0.20);
  --woi-inst-gold-text: #92400e;
  --woi-inst-row-alt: #f4f8fd;
  --woi-inst-row-hover: #e6f0fa;
  --woi-inst-shadow: 0 12px 28px rgba(20, 32, 44, 0.08);
}

/* main surfaces */
#app-root.theme-light,
#app-root.theme-light.page,
#app-root.theme-light .page {
  background: var(--woi-inst-bg) !important;
  color: var(--woi-inst-text) !important;
}

#app-root.theme-light .topbar,
#app-root.theme-light .mkt-overview,
#app-root.theme-light .tablewrap,
#app-root.theme-light .chartwrap,
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #details-howto,
#app-root.theme-light .details-box,
#app-root.theme-light footer.footer,
#app-root.theme-light .watchlist-bar {
  background: var(--woi-inst-panel) !important;
  border-color: var(--woi-inst-border) !important;
  box-shadow: var(--woi-inst-shadow) !important;
}

#app-root.theme-light .mkt-card,
#app-root.theme-light .explore-section,
#app-root.theme-light .explore-card,
#app-root.theme-light .guide-card,
#app-root.theme-light .mcard,
#app-root.theme-light .help-panel {
  background: var(--woi-inst-card) !important;
  border: 1px solid var(--woi-inst-border) !important;
  box-shadow: var(--woi-inst-shadow) !important;
}

/* text */
#app-root.theme-light .title,
#app-root.theme-light .mkt-title,
#app-root.theme-light .lbl,
#app-root.theme-light h1,
#app-root.theme-light h2,
#app-root.theme-light h3,
#app-root.theme-light h4,
#app-root.theme-light h5,
#app-root.theme-light h6,
#app-root.theme-light strong,
#app-root.theme-light b {
  color: var(--woi-inst-text) !important;
}

#app-root.theme-light .seo-microcopy,
#app-root.theme-light .status,
#app-root.theme-light .footer,
#app-root.theme-light .footer-left,
#app-root.theme-light .mkt-hdr,
#app-root.theme-light #screener-help,
#app-root.theme-light #analysis-panel,
#app-root.theme-light #narrative-panel,
#app-root.theme-light .details,
#app-root.theme-light .yt-cta-text {
  color: var(--woi-inst-text-soft) !important;
}

/* controls */
#app-root.theme-light .btn,
#app-root.theme-light .btn-help,
#app-root.theme-light .tape-btn,
#app-root.theme-light button,
#app-root.theme-light input,
#app-root.theme-light textarea,
#app-root.theme-light .Select-control,
#app-root.theme-light .Select-menu-outer,
#app-root.theme-light .Select-menu {
  background: #ffffff !important;
  color: var(--woi-inst-text) !important;
  border-color: var(--woi-inst-border-2) !important;
  box-shadow: none !important;
}

#app-root.theme-light .btn:hover,
#app-root.theme-light .btn-help:hover,
#app-root.theme-light .tape-btn:hover,
#app-root.theme-light button:hover {
  border-color: #b6c4d2 !important;
  background: #f8fbff !important;
}

/* links */
#app-root.theme-light a,
#app-root.theme-light .seo-inline-link,
#app-root.theme-light .footer-link,
#app-root.theme-light .yt-cta-link {
  color: var(--woi-inst-blue) !important;
}

#app-root.theme-light a:hover,
#app-root.theme-light .seo-inline-link:hover,
#app-root.theme-light .footer-link:hover,
#app-root.theme-light .yt-cta-link:hover {
  color: #1e40af !important;
}

/* datatable shell */
#app-root.theme-light .dash-table-container,
#app-root.theme-light .dash-spreadsheet-container,
#app-root.theme-light .dash-spreadsheet-inner,
#app-root.theme-light .dash-table-container table {
  background: transparent !important;
  color: var(--woi-inst-text) !important;
}

/* IMPORTANT:
   Avoid killing Dash conditional formatting with a hard cell background.
   Use mild base styling only.
*/
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell {
  color: var(--woi-inst-text) !important;
  border-color: #dde6ee !important;
}

/* header */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-header,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell {
  background: var(--woi-inst-header) !important;
  color: var(--woi-inst-text) !important;
  border-color: var(--woi-inst-border) !important;
  font-weight: 800 !important;
}

/* alternating rows */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) td.dash-cell {
  background: var(--woi-inst-row-alt) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) td.dash-cell {
  background: rgba(255,255,255,0.92) !important;
}

/* hover */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td.dash-cell {
  background: var(--woi-inst-row-hover) !important;
}

/* selection */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused.cell--selected {
  background: #e6f1ff !important;
  border-color: #93c5fd !important;
  color: var(--woi-inst-text) !important;
}

/* light-theme readability support for common highlighted cells/chips */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(0, 255, 154"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(57,255,182"] {
  color: var(--woi-inst-green-text) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(255, 77, 109"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(255,77,109"] {
  color: var(--woi-inst-red-text) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(0, 200, 255"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(127,216,255"] {
  color: var(--woi-inst-cyan-text) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(255, 209, 102"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="rgba(255,216,77"] {
  color: var(--woi-inst-gold-text) !important;
}

/* preserve positive/negative visual emphasis when Dash inline styles exist */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="#00ff9a"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="#39ffb6"] {
  color: var(--woi-inst-green-text) !important;
  font-weight: 700 !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="#ff4d6d"],
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="#ff6b8a"] {
  color: var(--woi-inst-red-text) !important;
  font-weight: 700 !important;
}

/* market cards */
#app-root.theme-light .mkt-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
}

/* explore section */
#app-root.theme-light .explore-section {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fb 100%) !important;
  border: 1px solid var(--woi-inst-border) !important;
  box-shadow: var(--woi-inst-shadow) !important;
}

#app-root.theme-light .explore-card {
  background: #ffffff !important;
  border: 1px solid var(--woi-inst-border) !important;
}

#app-root.theme-light .explore-chip,
#app-root.theme-light .analysis-chip {
  background: #f8fbff !important;
  border: 1px solid #d7e3ef !important;
  box-shadow: none !important;
}

/* chart wrappers */
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #details-howto {
  background: #f8fbfd !important;
  border: 1px solid var(--woi-inst-border) !important;
}

/* plotly modebar */
#app-root.theme-light .js-plotly-plot .modebar {
  background: rgba(255,255,255,0.90) !important;
  border: 1px solid var(--woi-inst-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--woi-inst-shadow) !important;
}

#app-root.theme-light .js-plotly-plot .modebar-btn {
  color: var(--woi-inst-text-soft) !important;
}

#app-root.theme-light .js-plotly-plot .modebar-btn:hover {
  color: var(--woi-inst-blue) !important;
  background: #eef5ff !important;
}

/* footer */
#app-root.theme-light footer.footer {
  background: #f3f7fb !important;
  color: var(--woi-inst-text-soft) !important;
}

/* --------------------------------------------------
   WOI light theme blue surface upgrade
-------------------------------------------------- */
#app-root.theme-light,
#app-root.theme-light.page,
#app-root.theme-light .page {
  background: linear-gradient(180deg, #eaf2fb 0%, #e3edf8 100%) !important;
  color: var(--woi-inst-text) !important;
}

#app-root.theme-light .topbar,
#app-root.theme-light .mkt-overview,
#app-root.theme-light .tablewrap,
#app-root.theme-light .chartwrap,
#app-root.theme-light #narrative-wrap,
#app-root.theme-light #analysis-wrap,
#app-root.theme-light #details-howto,
#app-root.theme-light .details-box,
#app-root.theme-light footer.footer,
#app-root.theme-light .watchlist-bar {
  background: linear-gradient(180deg, #f7fbff 0%, #f1f7fd 100%) !important;
  border-color: #cad9e8 !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06) !important;
}

#app-root.theme-light .mkt-card,
#app-root.theme-light .explore-section,
#app-root.theme-light .explore-card,
#app-root.theme-light .guide-card,
#app-root.theme-light .mcard,
#app-root.theme-light .help-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  border: 1px solid #c9d9ea !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) {
  background: #f4f8fd !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) {
  background: #ffffff !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover {
  background: #e8f1fb !important;
}

#app-root.theme-light .explore-section {
  background: linear-gradient(180deg, #f7fbff 0%, #edf5fd 100%) !important;
  border: 1px solid #c8d8ea !important;
}

#app-root.theme-light .explore-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
  border: 1px solid #cedbeb !important;
}

#app-root.theme-light .explore-chip,
#app-root.theme-light .analysis-chip {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fd 100%) !important;
  border: 1px solid #cad8e8 !important;
}

#app-root.theme-light .mkt-card .mkt-hdr,
#app-root.theme-light .title,
#app-root.theme-light .mkt-title {
  color: #132030 !important;
}

#app-root.theme-light .seo-microcopy,
#app-root.theme-light .status,
#app-root.theme-light #screener-help,
#app-root.theme-light .footer,
#app-root.theme-light .footer-left {
  color: #5b6c7d !important;
}

/* --------------------------------------------------
   WOI light theme table color restore
-------------------------------------------------- */

/* IMPORTANT:
   Let Dash conditional cell colors be visible in light mode.
   Do not paint td backgrounds globally.
*/
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell {
  background-color: transparent !important;
  background: transparent !important;
  color: #17212b !important;
}

/* Keep row striping on TR, not on TD */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) {
  background-color: #f4f8fd !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) {
  background-color: #ffffff !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover {
  background-color: #e6f0fa !important;
}

/* selected/focused cells stay visible */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell.cell--selected,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell.focused.cell--selected {
  background-color: rgba(59,130,246,0.12) !important;
  background: rgba(59,130,246,0.12) !important;
  border-color: #60a5fa !important;
  color: #0f172a !important;
}

/* Header remains solid */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-header,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-cell {
  background-color: #dbe8f5 !important;
  background: #dbe8f5 !important;
  color: #17212b !important;
  border-color: #c8d8ea !important;
}

/* Filter row inputs */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner input,
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input {
  background: #ffffff !important;
  color: #17212b !important;
  border: 1px solid #bfd2e6 !important;
}

/* If Dash injects inline background-image/databar, never kill it */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell[style*="background"] {
  background-blend-mode: normal !important;
}

/* dark mode */
body.dark #explore-analysis-wrap,
html[data-theme="dark"] #explore-analysis-wrap {
  background: linear-gradient(180deg, rgba(8,16,28,0.96), rgba(5,10,18,0.96)) !important;
  box-shadow:
    0 14px 36px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-analysis-title,
html[data-theme="dark"] .explore-analysis-title {
  color: #f8fbff;
}

body.dark .explore-analysis-subtitle,
html[data-theme="dark"] .explore-analysis-subtitle {
  color: rgba(219,229,255,0.72);
}

body.dark .explore-group-card,
html[data-theme="dark"] .explore-group-card {
  background: linear-gradient(180deg, rgba(17,26,40,0.88), rgba(11,18,30,0.84));
  box-shadow:
    0 8px 20px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-group-card:hover,
html[data-theme="dark"] .explore-group-card:hover {
  border-color: rgba(88,135,255,0.28);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.26),
    0 0 0 1px rgba(72,116,255,0.08);
}

body.dark .explore-group-title,
html[data-theme="dark"] .explore-group-title {
  color: #ffffff;
}

body.dark .explore-chip,
html[data-theme="dark"] .explore-chip {
  color: #8fb1ff !important;
  background: rgba(20,30,46,0.96) !important;
  border: 1px solid rgba(110,130,160,0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-chip:hover,
html[data-theme="dark"] .explore-chip:hover {
  color: #dce8ff !important;
  background: rgba(28,42,64,0.98) !important;
  border-color: rgba(88,135,255,0.40) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

/* light mode */
body:not(.dark) #explore-analysis-wrap,
body.light #explore-analysis-wrap,
html[data-theme="light"] #explore-analysis-wrap {
  background: linear-gradient(180deg, #ffffff, #f7f9fc) !important;
  box-shadow:
    0 10px 28px rgba(15,23,42,0.06),
    inset 0 1px 0 rgba(255,255,255,0.70);
}

body:not(.dark) .explore-analysis-title,
body.light .explore-analysis-title,
html[data-theme="light"] .explore-analysis-title {
  color: #0f172a;
}

body:not(.dark) .explore-analysis-subtitle,
body.light .explore-analysis-subtitle,
html[data-theme="light"] .explore-analysis-subtitle {
  color: #64748b;
}

body:not(.dark) .explore-group-card,
body.light .explore-group-card,
html[data-theme="light"] .explore-group-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow:
    0 8px 20px rgba(15,23,42,0.05),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

body:not(.dark) .explore-group-card:hover,
body.light .explore-group-card:hover,
html[data-theme="light"] .explore-group-card:hover {
  border-color: rgba(59,130,246,0.25);
  box-shadow:
    0 12px 24px rgba(15,23,42,0.08),
    0 0 0 1px rgba(59,130,246,0.06);
}

body:not(.dark) .explore-group-title,
body.light .explore-group-title,
html[data-theme="light"] .explore-group-title {
  color: #0f172a;
}

body:not(.dark) .explore-chip,
body.light .explore-chip,
html[data-theme="light"] .explore-chip {
  color: #3158d3 !important;
  background: #f8fbff !important;
  border: 1px solid rgba(148,163,184,0.25) !important;
}

body:not(.dark) .explore-chip:hover,
body.light .explore-chip:hover,
html[data-theme="light"] .explore-chip:hover {
  color: #17399f !important;
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.28) !important;
  box-shadow: 0 8px 16px rgba(37,99,235,0.10);
}

@media (max-width: 1200px) {
  .explore-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #explore-analysis-wrap {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .explore-analysis-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .explore-group-card {
    padding: 14px;
    border-radius: 16px;
  }
}

/* Dark mode */
body.dark #explore-analysis-wrap,
[data-bs-theme="dark"] #explore-analysis-wrap,
html[data-theme="dark"] #explore-analysis-wrap {
  background: linear-gradient(180deg, rgba(8,16,28,0.96), rgba(5,10,18,0.96)) !important;
  box-shadow: 0 14px 36px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-analysis-title,
[data-bs-theme="dark"] .explore-analysis-title,
html[data-theme="dark"] .explore-analysis-title,
body.dark .explore-group-title,
[data-bs-theme="dark"] .explore-group-title,
html[data-theme="dark"] .explore-group-title {
  color: #f8fbff;
}

body.dark .explore-analysis-subtitle,
[data-bs-theme="dark"] .explore-analysis-subtitle,
html[data-theme="dark"] .explore-analysis-subtitle {
  color: rgba(219,229,255,0.72);
}

body.dark .explore-group-card,
[data-bs-theme="dark"] .explore-group-card,
html[data-theme="dark"] .explore-group-card {
  background: linear-gradient(180deg, rgba(17,26,40,0.88), rgba(11,18,30,0.84));
  box-shadow: 0 8px 20px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-chip,
[data-bs-theme="dark"] .explore-chip,
html[data-theme="dark"] .explore-chip {
  color: #8fb1ff !important;
  background: rgba(20,30,46,0.96) !important;
  border: 1px solid rgba(110,130,160,0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark .explore-chip:hover,
[data-bs-theme="dark"] .explore-chip:hover,
html[data-theme="dark"] .explore-chip:hover {
  color: #dce8ff !important;
  background: rgba(28,42,64,0.98) !important;
  border-color: rgba(88,135,255,0.40) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

/* Light mode */
body.light #explore-analysis-wrap,
[data-bs-theme="light"] #explore-analysis-wrap,
html[data-theme="light"] #explore-analysis-wrap,
body:not(.dark):not(.theme-dark) #explore-analysis-wrap {
  background: linear-gradient(180deg, #ffffff, #f7f9fc) !important;
  box-shadow: 0 10px 28px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.70);
}

body.light .explore-analysis-title,
[data-bs-theme="light"] .explore-analysis-title,
html[data-theme="light"] .explore-analysis-title,
body:not(.dark):not(.theme-dark) .explore-analysis-title,
body.light .explore-group-title,
[data-bs-theme="light"] .explore-group-title,
html[data-theme="light"] .explore-group-title,
body:not(.dark):not(.theme-dark) .explore-group-title {
  color: #0f172a;
}

body.light .explore-analysis-subtitle,
[data-bs-theme="light"] .explore-analysis-subtitle,
html[data-theme="light"] .explore-analysis-subtitle,
body:not(.dark):not(.theme-dark) .explore-analysis-subtitle {
  color: #64748b;
}

body.light .explore-group-card,
[data-bs-theme="light"] .explore-group-card,
html[data-theme="light"] .explore-group-card,
body:not(.dark):not(.theme-dark) .explore-group-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 20px rgba(15,23,42,0.05), inset 0 1px 0 rgba(255,255,255,0.85);
}

body.light .explore-chip,
[data-bs-theme="light"] .explore-chip,
html[data-theme="light"] .explore-chip,
body:not(.dark):not(.theme-dark) .explore-chip {
  color: #3158d3 !important;
  background: #f8fbff !important;
  border: 1px solid rgba(148,163,184,0.25) !important;
}

body.light .explore-chip:hover,
[data-bs-theme="light"] .explore-chip:hover,
html[data-theme="light"] .explore-chip:hover,
body:not(.dark):not(.theme-dark) .explore-chip:hover {
  color: #17399f !important;
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.28) !important;
  box-shadow: 0 8px 16px rgba(37,99,235,0.10);
}

@media (max-width: 1200px) {
  #explore-analysis-wrap > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #explore-analysis-wrap > div:last-child {
    grid-template-columns: 1fr;
    gap: 12px !important;
  }

  .explore-group-card {
    padding: 14px;
    border-radius: 16px;
  }
}

/* =========================================
   Explore Analysis Premium Section
   ========================================= */

#explore-analysis-wrap {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 18px 20px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(127, 140, 160, 0.18) !important;
  background: transparent !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 24px rgba(0,0,0,0.06);
}

#explore-analysis-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.06), transparent 30%),
    radial-gradient(circle at top right, rgba(168,85,247,0.05), transparent 28%);
}

.explore-analysis-title {
  position: relative;
  z-index: 1;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px 0;
}

.explore-analysis-subtitle {
  position: relative;
  z-index: 1;
  font-size: 0.98rem;
  opacity: 0.72;
  line-height: 1.45;
  margin: 0 0 18px 0;
}

#explore-analysis-wrap > div:last-child {
  position: relative;
  z-index: 1;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px !important;
}

.explore-group-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(127, 140, 160, 0.16);
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 6px 18px rgba(0,0,0,0.05);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.explore-group-card:hover {
  transform: translateY(-2px);
  border-color: rgba(90,130,255,0.24);
  background: rgba(255,255,255,0.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 24px rgba(0,0,0,0.08);
}

.explore-group-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.explore-group-empty {
  opacity: 0.62;
  font-size: 12px;
  line-height: 1.45;
}

.explore-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.explore-chip {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 38px;
  padding: 0 14px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  font-weight: 700;
  border: 1px solid rgba(127, 140, 160, 0.18) !important;
  background: rgba(255,255,255,0.04) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.explore-chip:hover {
  transform: translateY(-1px);
  text-decoration: none !important;
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(90,130,255,0.24) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 6px 14px rgba(0,0,0,0.07);
}

.explore-chip-symbol {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.explore-chip-label {
  opacity: 0.74;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 600;
}

@media (max-width: 1200px) {
  #explore-analysis-wrap > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #explore-analysis-wrap {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  #explore-analysis-wrap > div:last-child {
    grid-template-columns: 1fr;
    gap: 12px !important;
  }

  .explore-analysis-title {
    font-size: 1.45rem;
  }

  .explore-group-card {
    padding: 14px;
    border-radius: 16px;
  }
}

