/* 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;
  }
}


/* =========================
   Market overview ratio tune
   ========================= */
.mkt-card{
  padding: 10px 12px 10px 12px !important;
}

.mkt-card .mkt-hdr{
  margin-bottom: 8px !important;
}

.mkt-card .mkt-stats{
  gap: 8px !important;
  margin: 4px 0 8px 0 !important;
}

.mkt-card .mkt-stat{
  padding: 8px 10px !important;
  min-height: auto !important;
  border-radius: 12px !important;
}

.mkt-card .mkt-stat-label{
  font-size: 10px !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 3px !important;
}

.mkt-card .mkt-stat-value{
  font-size: 15px !important;
  line-height: 1.1 !important;
}

.mkt-card .mkt-badge{
  padding: 6px 10px !important;
  font-size: 11px !important;
}

.mkt-card .mkt-meta{
  margin-top: 6px !important;
  font-size: 11px !important;
  opacity: 0.72 !important;
}

.mkt-fig{
  height: 168px !important;
}

@media (max-width: 720px){
  .mkt-fig{
    height: 150px !important;
  }

  .mkt-card .mkt-stats{
    gap: 6px !important;
    margin: 4px 0 6px 0 !important;
  }

  .mkt-card .mkt-stat{
    padding: 7px 8px !important;
  }

  .mkt-card .mkt-stat-value{
    font-size: 14px !important;
  }
}



/* =========================
   Market overview chart expand
   ========================= */
.mkt-card{
  padding: 8px 10px 8px 10px !important;
}

.mkt-card .mkt-hdr{
  margin-bottom: 6px !important;
}

.mkt-card .mkt-stats{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin: 2px 0 4px 0 !important;
}

.mkt-card .mkt-stat{
  padding: 6px 8px !important;
  min-height: auto !important;
  border-radius: 10px !important;
}

.mkt-card .mkt-stat-label{
  font-size: 9px !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 2px !important;
  opacity: 0.82 !important;
}

.mkt-card .mkt-stat-value{
  font-size: 13px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-badge{
  padding: 5px 9px !important;
  font-size: 10px !important;
}

.mkt-card .mkt-meta{
  display: none !important;
}

.mkt-fig{
  height: 196px !important;
}

@media (max-width: 720px){
  .mkt-card{
    padding: 8px 8px 8px 8px !important;
  }

  .mkt-card .mkt-stats{
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    margin: 2px 0 4px 0 !important;
  }

  .mkt-card .mkt-stat{
    padding: 6px 8px !important;
  }

  .mkt-fig{
    height: 170px !important;
  }
}



/* =========================
   Market overview density tighten
   ========================= */
.mkt-card{
  padding: 6px 8px 6px 8px !important;
}

.mkt-card .mkt-hdr{
  margin-bottom: 2px !important;
  padding-bottom: 2px !important;
}

.mkt-card .mkt-stats{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
  margin: 0 0 1px 0 !important;
}

.mkt-card .mkt-stat{
  padding: 4px 7px !important;
  min-height: auto !important;
  border-radius: 9px !important;
}

.mkt-card .mkt-stat-label{
  font-size: 9px !important;
  margin-bottom: 1px !important;
  line-height: 1 !important;
  opacity: 0.82 !important;
}

.mkt-card .mkt-stat-value{
  font-size: 12px !important;
  line-height: 1.02 !important;
}

.mkt-card .mkt-badge{
  padding: 4px 8px !important;
  font-size: 10px !important;
}

.mkt-card .mkt-meta{
  display: none !important;
}

.mkt-card .mkt-fig{
  height: 222px !important;
  margin-top: -2px !important;
}

@media (max-width: 720px){
  .mkt-card{
    padding: 6px 7px 6px 7px !important;
  }

  .mkt-card .mkt-stats{
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    margin: 0 0 2px 0 !important;
  }

  .mkt-card .mkt-stat{
    padding: 4px 7px !important;
  }

  .mkt-card .mkt-fig{
    height: 182px !important;
    margin-top: -1px !important;
  }
}



/* =========================
   Market overview compact fill
   ========================= */
.mkt-card{
  padding: 4px 8px 4px 8px !important;
}

.mkt-card .mkt-hdr{
  padding: 0 2px 2px 2px !important;
  margin-bottom: 0 !important;
  border-bottom: 0 !important;
  min-height: auto !important;
}

.mkt-card .mkt-title-row,
.mkt-card .mkt-top,
.mkt-card .mkt-topline{
  margin-bottom: 2px !important;
  padding-bottom: 0 !important;
}

.mkt-card .mkt-badge{
  padding: 3px 8px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.mkt-card .mkt-stats{
  gap: 4px !important;
  margin: 0 0 2px 0 !important;
}

.mkt-card .mkt-stat{
  padding: 3px 7px !important;
  min-height: 42px !important;
}

.mkt-card .mkt-stat-label{
  font-size: 9px !important;
  line-height: 1 !important;
  margin-bottom: 1px !important;
}

.mkt-card .mkt-stat-value{
  font-size: 11px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-fig{
  height: 244px !important;
  margin-top: -6px !important;
  margin-bottom: -10px !important;
}

.mkt-card .js-plotly-plot,
.mkt-card .plot-container,
.mkt-card .svg-container{
  margin: 0 !important;
  padding: 0 !important;
}

.mkt-card .mkt-meta,
.mkt-card .mkt-foot,
.mkt-card .mkt-footer,
.mkt-card .mkt-subnote{
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 720px){
  .mkt-card{
    padding: 4px 6px 4px 6px !important;
  }

  .mkt-card .mkt-fig{
    height: 190px !important;
    margin-top: -4px !important;
    margin-bottom: -8px !important;
  }

  .mkt-card .mkt-stats{
    gap: 3px !important;
    margin-bottom: 2px !important;
  }

  .mkt-card .mkt-stat{
    padding: 3px 6px !important;
    min-height: 38px !important;
  }
}


/* =========================
   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,
  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 */
  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 */
  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;
}

  background-blend-mode: normal !important;
}

/* dark mode */
    padding: 14px;
    border-radius: 16px;
  }
}


/* Explore Analysis - clean minimal patch */
#explore-analysis-wrap {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 24px rgba(0,0,0,0.06);
}

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

.explore-group-card {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.explore-group-card:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 10px 24px rgba(0,0,0,0.08);
}

.explore-chip {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.explore-chip:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 6px 14px rgba(0,0,0,0.06);
}

.explore-analysis-title {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.explore-analysis-subtitle {
  opacity: 0.74;
}

@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-analysis-title {
    font-size: 1.4rem;
  }
}

/* Explore subtle enhancement */

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

.explore-group-card {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.explore-group-card:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 10px 26px rgba(0,0,0,0.10);
}

.explore-chip {
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.explore-chip:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 6px 14px rgba(0,0,0,0.08);
}

.explore-analysis-title {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.explore-analysis-subtitle {
  opacity: 0.75;
}

@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;
  }
}
/* Explore premium polish */

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

.explore-group-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.explore-group-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  opacity: 0.95;
}

.explore-group-card::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 44px;
  height: 1px;
  background: rgba(127, 140, 160, 0.16);
  pointer-events: none;
}

.explore-group-card:hover {
  transform: translateY(-3px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 12px 28px rgba(0,0,0,0.10);
}

/* category accents by order */
#explore-analysis-wrap > div:last-child > .explore-group-card:nth-child(1)::before {
  background: #f5c542;
}

#explore-analysis-wrap > div:last-child > .explore-group-card:nth-child(2)::before {
  background: #ffd84d;
}

#explore-analysis-wrap > div:last-child > .explore-group-card:nth-child(3)::before {
  background: #60a5fa;
}

#explore-analysis-wrap > div:last-child > .explore-group-card:nth-child(4)::before {
  background: #fb7185;
}

.explore-group-title {
  position: relative;
  padding-left: 8px;
  margin-bottom: 16px !important;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.explore-group-chips {
  gap: 10px !important;
  padding-top: 4px;
}

.explore-chip {
  min-height: 38px;
  padding: 0 14px !important;
  border-radius: 999px !important;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease;
}

.explore-chip:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--woi-card-shadow, inset 0 1px 0 rgba(255,255,255,0.03)),
    0 6px 14px rgba(0,0,0,0.08);
}

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

.explore-chip-label {
  opacity: 0.78;
}

.explore-analysis-title {
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.explore-analysis-subtitle {
  opacity: 0.75;
  margin-bottom: 18px !important;
}

@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-analysis-title {
    font-size: 1.45rem;
  }

  .explore-group-card::after {
    top: 42px;
  }
}
/* Explore final refinement */

.explore-group-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.018));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 8px 22px rgba(0,0,0,0.10);
}

.explore-group-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 30px rgba(0,0,0,0.14);
}

.explore-group-card::after {
  background: rgba(127, 140, 160, 0.10);
}

.explore-chip {
  background: rgba(255,255,255,0.055) !important;
  border-color: rgba(127, 140, 160, 0.20) !important;
}

.explore-chip:hover {
  background: rgba(255,255,255,0.085) !important;
  border-color: rgba(90,130,255,0.30) !important;
}

.explore-chip-label {
  opacity: 0.84;
}

#explore-analysis-wrap > div:last-child > .explore-group-card {
  min-height: 346px;
}

/* Light theme DataTable - clean single source of truth */
#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;
}

#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: #eef3f9 !important;
  color: #0f172a !important;
  border-color: #d7e0ea !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell {
  color: #0f172a !important;
  border-color: #dde5ef !important;
}

/* zebra rows only where cell has no inline background from Dash conditional styling */
#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) td.dash-cell:not([style*="background"]) {
  background: #f8fbff !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) td.dash-cell:not([style*="background"]) {
  background: #ffffff !important;
}

#app-root.theme-light .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td.dash-cell:not([style*="background"]) {
  background: #f1f6fc !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: rgba(59, 130, 246, 0.10) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #0f172a !important;
}

#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: #0f172a !important;
  border-color: #cfd8e3 !important;
}
/* Analyst Snapshot - light mode readability fix */

#app-root.theme-light .analyst-card,
#app-root.theme-light .analysis-card,
#app-root.theme-light [id*="analyst"],
#app-root.theme-light [class*="analyst-snapshot"] {
  color: #0f172a;
}

/* main analyst snapshot container */
#app-root.theme-light [class*="analyst-snapshot"],
#app-root.theme-light [id*="analyst-snapshot"] {
  background: linear-gradient(180deg, #f8fafc, #eef3f9) !important;
  border: 1px solid #d8e1ec !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 8px 18px rgba(15,23,42,0.05);
}

/* small stat cards inside analyst snapshot */
#app-root.theme-light [class*="analyst-snapshot"] > div div[style*="borderRadius"],
#app-root.theme-light [id*="analyst-snapshot"] > div div[style*="borderRadius"] {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1px solid #dbe4ee !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.90),
    0 4px 10px rgba(15,23,42,0.04);
}

/* labels */
#app-root.theme-light [class*="analyst-snapshot"] div[style*="fontSize"] {
  color: #64748b !important;
}

/* values */
#app-root.theme-light [class*="analyst-snapshot"] div[style*="fontWeight: 700"],
#app-root.theme-light [class*="analyst-snapshot"] div[style*="fontWeight:700"],
#app-root.theme-light [class*="analyst-snapshot"] div[style*="fontWeight: 800"],
#app-root.theme-light [class*="analyst-snapshot"] div[style*="fontWeight:800"] {
  color: #0f172a !important;
}

/* analyst title */
#app-root.theme-light [class*="analyst-snapshot"] h3,
#app-root.theme-light [class*="analyst-snapshot"] h4,
#app-root.theme-light [class*="analyst-snapshot"] strong {
  color: #0f172a !important;
}

/* upside badge */
#app-root.theme-light [class*="analyst-snapshot"] [style*="Upside"],
#app-root.theme-light [id*="analyst-snapshot"] [style*="Upside"] {
  color: #065f46 !important;
}

/* recs row text */
#app-root.theme-light [class*="analyst-snapshot"] {
  color: #334155 !important;
}

/* progress/recs bar */
#app-root.theme-light [class*="analyst-snapshot"] div[style*="height: 14px"],
#app-root.theme-light [class*="analyst-snapshot"] div[style*="height:14px"] {
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}
/* Analyst Snapshot - exact light mode fix */

#app-root.theme-light .analyst-card {
  background: linear-gradient(180deg, #f8fafc, #eef3f9) !important;
  border: 1px solid #d8e1ec !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 8px 18px rgba(15,23,42,0.05);
  color: #0f172a !important;
}

#app-root.theme-light .analyst-title {
  color: #0f172a !important;
}

#app-root.theme-light .analyst-top {
  color: #334155 !important;
}

#app-root.theme-light .analyst-grid {
  gap: 14px;
}

#app-root.theme-light .analyst-grid .kv {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1px solid #dbe4ee !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.90),
    0 4px 10px rgba(15,23,42,0.04);
}

#app-root.theme-light .analyst-grid .k {
  color: #64748b !important;
}

#app-root.theme-light .analyst-grid .v {
  color: #0f172a !important;
  font-weight: 800 !important;
}

#app-root.theme-light .analyst-subhdr {
  color: #475569 !important;
}

#app-root.theme-light .analyst-card .pill,
#app-root.theme-light .analyst-card [class*="pill"] {
  background: rgba(16, 185, 129, 0.10) !important;
  border-color: rgba(16, 185, 129, 0.30) !important;
  color: #065f46 !important;
}

/* recs progress area */
#app-root.theme-light .analyst-card .bar-bg,
#app-root.theme-light .analyst-card [class*="bar-bg"] {
  background: #dfe8f2 !important;
}

/* if inline-styled progress wrapper is used */
#app-root.theme-light .analyst-card div[style*="height: 14px"],
#app-root.theme-light .analyst-card div[style*="height:14px"] {
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}


/* =========================
   Market overview premium polish
   ========================= */
.mkt-overview{
  border-radius: 16px;
  padding: 14px 16px 16px 16px;
}

.mkt-card{
  border-radius: 16px;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.mkt-card:hover{
  transform: translateY(-1px);
}

.mkt-hdr{
  padding: 10px 14px;
}

.mkt-fig{
  height: 152px;
}

#app-root.theme-dark .mkt-overview{
  box-shadow:
    0 14px 36px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

#app-root.theme-dark .mkt-card{
  background:
    linear-gradient(180deg, rgba(16,22,33,0.92), rgba(11,16,26,0.94));
  box-shadow:
    0 10px 28px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

#app-root.theme-dark .mkt-card:hover{
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

#app-root.theme-light .mkt-overview{
  box-shadow:
    0 12px 30px rgba(15,23,42,0.06),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

#app-root.theme-light .mkt-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.90);
}

#app-root.theme-light .mkt-card:hover{
  border-color: rgba(148,163,184,0.32);
  box-shadow:
    0 12px 24px rgba(15,23,42,0.07),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

#app-root.theme-light .mkt-hdr{
  border-bottom-color: rgba(148,163,184,0.18);
}

#app-root.theme-light .yt-cta-link{
  background: rgba(255,255,255,0.82);
  border-color: rgba(148,163,184,0.22);
}




/* =========================
   Market overview premium upgrade
   ========================= */

.mkt-overview{
  margin: 12px 0 14px 0;
  border-radius: 16px;
  padding: 14px 16px 16px 16px;
}

.mkt-head{
  margin-bottom: 10px;
}

.mkt-title{
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.mkt-grid{
  gap: 14px;
}

.mkt-card{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.mkt-card::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  opacity: 0.95;
  pointer-events: none;
}

.mkt-card-spx::before{ background: linear-gradient(90deg, rgba(22,224,162,0.95), rgba(22,224,162,0.10)); }
.mkt-card-ndx::before{ background: linear-gradient(90deg, rgba(87,165,255,0.95), rgba(87,165,255,0.10)); }
.mkt-card-dow::before{ background: linear-gradient(90deg, rgba(255,88,118,0.95), rgba(255,88,118,0.10)); }

.mkt-card:hover{
  transform: translateY(-2px);
}

.mkt-hdr{
  padding: 14px 16px 8px 16px;
}

.mkt-hdr-inner{
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.mkt-name{
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08px;
  opacity: 0.88;
}

.mkt-value-row{
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.mkt-last{
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.mkt-chg{
  font-size: 0.98rem;
  font-weight: 700;
}

.mkt-fig{
  height: 172px;
}

.yt-cta-link{
  border-radius: 12px;
  padding: 7px 12px;
}

#app-root.theme-dark .mkt-overview{
  background:
    linear-gradient(180deg, rgba(6,13,24,0.94), rgba(5,10,19,0.96));
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow:
    0 16px 38px rgba(0,0,0,0.26),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

#app-root.theme-dark .mkt-card{
  background:
    linear-gradient(180deg, rgba(14,21,33,0.94), rgba(9,14,24,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 12px 26px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

#app-root.theme-dark .mkt-card:hover{
  box-shadow:
    0 16px 34px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

#app-root.theme-dark .mkt-hdr{
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

#app-root.theme-dark .mkt-name{
  color: rgba(223,231,244,0.82);
}

#app-root.theme-light .mkt-overview{
  background:
    linear-gradient(180deg, #f7fafe, #eef4fb);
  border: 1px solid rgba(180,196,218,0.75);
  box-shadow:
    0 14px 34px rgba(16,24,40,0.06),
    inset 0 1px 0 rgba(255,255,255,0.72);
}

#app-root.theme-light .mkt-card{
  background:
    linear-gradient(180deg, #ffffff, #f6f9fd);
  border: 1px solid rgba(186,199,218,0.72);
  box-shadow:
    0 10px 24px rgba(16,24,40,0.05),
    inset 0 1px 0 rgba(255,255,255,0.88);
}

#app-root.theme-light .mkt-card:hover{
  box-shadow:
    0 14px 30px rgba(16,24,40,0.08),
    inset 0 1px 0 rgba(255,255,255,0.94);
}

#app-root.theme-light .mkt-hdr{
  border-bottom: 1px solid rgba(196,208,224,0.78);
}

#app-root.theme-light .mkt-name{
  color: #5b6b81;
}

#app-root.theme-light .yt-cta-link{
  background: linear-gradient(180deg, #ffffff, #f3f7fc);
  border: 1px solid rgba(184,198,219,0.85);
  color: #2b5ecf;
  box-shadow: 0 6px 14px rgba(37,99,235,0.06);
}

#app-root.theme-dark .yt-cta-link{
  background: linear-gradient(180deg, rgba(12,19,31,0.92), rgba(8,13,22,0.96));
  border: 1px solid rgba(255,255,255,0.10);
}

@media (max-width: 900px){
  .mkt-fig{
    height: 158px;
  }
}


/* =========================================
   Market Overview Premium Cards - Step 3
   ========================================= */
.mkt-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 4px 14px;
}

.mkt-badge{
  font-size:11px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
  letter-spacing:.2px;
}

.mkt-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  padding:8px 14px 8px 14px;
}

.mkt-stat{
  border-radius:12px;
  padding:10px 12px;
  transition:transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.mkt-card:hover .mkt-stat{
  transform:translateY(-1px);
}

.mkt-stat-k{
  font-size:10px;
  font-weight:800;
  letter-spacing:.25px;
  text-transform:uppercase;
  opacity:.66;
  margin-bottom:4px;
}

.mkt-stat-v{
  font-size:14px;
  font-weight:800;
  line-height:1.2;
}

.mkt-foot{
  padding:2px 14px 14px 14px;
}

.mkt-meta{
  font-size:11px;
  font-weight:700;
  opacity:.68;
  letter-spacing:.15px;
}

.mkt-card{
  position:relative;
  overflow:hidden;
}

.mkt-card::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:1px;
  opacity:.9;
}

.mkt-card-spx::before{
  background:linear-gradient(90deg, rgba(34,197,94,.0), rgba(34,197,94,.95), rgba(16,185,129,.0));
}

.mkt-card-ndx::before{
  background:linear-gradient(90deg, rgba(56,189,248,.0), rgba(59,130,246,.95), rgba(56,189,248,.0));
}

.mkt-card-dow::before{
  background:linear-gradient(90deg, rgba(244,63,94,.0), rgba(251,113,133,.95), rgba(244,63,94,.0));
}

/* stronger header look */
.mkt-hdr{
  padding:0 !important;
  border-bottom:none !important;
  min-height:auto;
}

.mkt-hdr > span{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  gap:5px !important;
}

.mkt-hdr > span > span:first-child{
  font-size:12px;
  font-weight:800 !important;
  letter-spacing:.2px;
  text-transform:uppercase;
}

.mkt-hdr > span > span:last-child{
  font-size:18px;
  font-weight:800 !important;
  line-height:1.15;
}

/* dark mode */
#app-root.theme-dark .mkt-overview{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.07), transparent 24%),
    radial-gradient(circle at top left, rgba(16,185,129,.05), transparent 22%),
    linear-gradient(180deg, rgba(9,14,24,.96), rgba(7,11,19,.96));
  box-shadow:0 18px 46px rgba(0,0,0,.24);
}

#app-root.theme-dark .mkt-card{
  border:1px solid rgba(255,255,255,.07);
  border-radius:16px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.03), transparent 30%),
    linear-gradient(180deg, rgba(15,22,35,.94), rgba(9,14,24,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 10px 28px rgba(0,0,0,.22);
}

#app-root.theme-dark .mkt-card:hover{
  border-color:rgba(255,255,255,.11);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 14px 34px rgba(0,0,0,.26);
}

#app-root.theme-dark .mkt-badge{
  color:rgba(226,232,240,.94);
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

#app-root.theme-dark .mkt-stat{
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.025);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}

#app-root.theme-dark .mkt-stat-v{
  color:#f8fafc;
}

/* light mode */
#app-root.theme-light .mkt-overview{
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.06), transparent 24%),
    radial-gradient(circle at top left, rgba(16,185,129,.04), transparent 22%),
    linear-gradient(180deg, #f8fbff, #eef4fb);
  box-shadow:0 18px 42px rgba(15,23,42,.06);
}

#app-root.theme-light .mkt-card{
  border:1px solid rgba(148,163,184,.20);
  border-radius:16px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.95), transparent 30%),
    linear-gradient(180deg, #ffffff, #f6f9fd);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 10px 24px rgba(15,23,42,.05);
}

#app-root.theme-light .mkt-card:hover{
  border-color:rgba(100,116,139,.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 14px 30px rgba(15,23,42,.08);
}

#app-root.theme-light .mkt-badge{
  color:#334155;
  border:1px solid rgba(148,163,184,.24);
  background:rgba(255,255,255,.92);
  box-shadow:inset 0 1px 2px rgba(15,23,42,.04);
}

#app-root.theme-light .mkt-stat{
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.78);
  box-shadow:inset 0 1px 2px rgba(15,23,42,.04);
}

#app-root.theme-light .mkt-stat-v{
  color:#0f172a;
}

#app-root.theme-light .mkt-meta{
  color:#64748b;
}

/* responsive */
@media (max-width: 860px){
  .mkt-stats{
    grid-template-columns:1fr;
    gap:8px;
  }
  .mkt-card-top{
    flex-direction:column;
    align-items:flex-start;
  }
  .mkt-hdr > span > span:last-child{
    font-size:16px;
  }
}



/* =========================
   Market overview FINAL density override
   ========================= */
.mkt-card{
  padding: 6px 8px 6px 8px !important;
}

.mkt-card .mkt-hdr{
  padding: 0 !important;
  margin-bottom: 4px !important;
  border-bottom: 0 !important;
}

.mkt-card .mkt-hdr-inner{
  gap: 2px !important;
}

.mkt-card .mkt-name{
  font-size: 13px !important;
  margin-bottom: 0 !important;
}

.mkt-card .mkt-value-row{
  gap: 10px !important;
  margin-bottom: 0 !important;
}

.mkt-card .mkt-last{
  font-size: 17px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-chg{
  font-size: 12px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-badge{
  padding: 4px 9px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.mkt-card .mkt-stats{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin: 2px 0 2px 0 !important;
}

.mkt-card .mkt-stat{
  padding: 5px 8px !important;
  border-radius: 10px !important;
  min-height: auto !important;
}

.mkt-card .mkt-stat-label{
  font-size: 9px !important;
  margin-bottom: 1px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-stat-value{
  font-size: 13px !important;
  line-height: 1.05 !important;
}

.mkt-card .mkt-fig{
  height: 208px !important;
  margin: 0 !important;
}

.mkt-card .js-plotly-plot,
.mkt-card .plot-container,
.mkt-card .svg-container{
  margin: 0 !important;
  padding: 0 !important;
}

.mkt-card .mkt-meta{
  margin-top: 1px !important;
  padding-top: 0 !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
  opacity: 0.70 !important;
}

@media (max-width: 720px){
  .mkt-card{
    padding: 6px 7px !important;
  }

  .mkt-card .mkt-stats{
    gap: 5px !important;
    margin: 2px 0 2px 0 !important;
  }

  .mkt-card .mkt-stat{
    padding: 5px 7px !important;
  }

  .mkt-card .mkt-fig{
    height: 186px !important;
  }
}


/* =========================
   Market stat chips color
   ========================= */

.mkt-stat{
  position: relative;
  background: linear-gradient(145deg, rgba(30,40,60,0.45), rgba(10,14,24,0.55));
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.25s ease;
}

/* LOW */
.mkt-stat:nth-child(1){
  border-color: rgba(80,160,255,0.28);
  box-shadow: inset 0 0 12px rgba(80,160,255,0.06);
}

/* HIGH */
.mkt-stat:nth-child(2){
  border-color: rgba(170,120,255,0.28);
  box-shadow: inset 0 0 12px rgba(170,120,255,0.06);
}

/* DISTANCE FROM HIGH */
.mkt-stat:nth-child(3){
  border-color: rgba(255,190,90,0.28);
  box-shadow: inset 0 0 12px rgba(255,190,90,0.06);
}

.mkt-stat:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.35);
}



/* =========================
   Market stat chips color fix
   ========================= */

.mkt-card .mkt-stats{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.mkt-card .mkt-stats > .mkt-stat{
  background: linear-gradient(145deg, rgba(20,28,40,0.92), rgba(11,16,27,0.96)) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03) !important;
  transition: all 0.22s ease !important;
}

.mkt-card .mkt-stats > .mkt-stat:nth-child(1){
  border-color: rgba(90,160,255,0.34) !important;
  background: linear-gradient(145deg, rgba(22,34,56,0.96), rgba(10,16,27,0.98)) !important;
  box-shadow: inset 0 0 18px rgba(90,160,255,0.08), 0 0 0 1px rgba(90,160,255,0.05) !important;
}

.mkt-card .mkt-stats > .mkt-stat:nth-child(2){
  border-color: rgba(170,120,255,0.34) !important;
  background: linear-gradient(145deg, rgba(34,24,52,0.96), rgba(10,16,27,0.98)) !important;
  box-shadow: inset 0 0 18px rgba(170,120,255,0.08), 0 0 0 1px rgba(170,120,255,0.05) !important;
}

.mkt-card .mkt-stats > .mkt-stat:nth-child(3){
  border-color: rgba(255,190,90,0.34) !important;
  background: linear-gradient(145deg, rgba(44,32,18,0.96), rgba(10,16,27,0.98)) !important;
  box-shadow: inset 0 0 18px rgba(255,190,90,0.08), 0 0 0 1px rgba(255,190,90,0.05) !important;
}

.mkt-card .mkt-stats > .mkt-stat:hover{
  transform: translateY(-1px) !important;
  border-color: rgba(255,255,255,0.20) !important;
}

#app-root.theme-light .mkt-card .mkt-stats > .mkt-stat{
  background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(245,248,252,0.98)) !important;
}

#app-root.theme-light .mkt-card .mkt-stats > .mkt-stat:nth-child(1){
  border-color: rgba(59,130,246,0.24) !important;
  background: linear-gradient(145deg, rgba(239,246,255,0.98), rgba(248,250,252,0.98)) !important;
}

#app-root.theme-light .mkt-card .mkt-stats > .mkt-stat:nth-child(2){
  border-color: rgba(147,51,234,0.22) !important;
  background: linear-gradient(145deg, rgba(250,245,255,0.98), rgba(248,250,252,0.98)) !important;
}

#app-root.theme-light .mkt-card .mkt-stats > .mkt-stat:nth-child(3){
  border-color: rgba(245,158,11,0.24) !important;
  background: linear-gradient(145deg, rgba(255,251,235,0.98), rgba(248,250,252,0.98)) !important;
}

/* =========================
   Market overview hover polish
   ========================= */
.mkt-card{
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mkt-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.26);
}
