/* public/css/market-state-widget.css */

.msw-card{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:22px;
  box-shadow:0 8px 28px rgba(15,23,42,.05);
  padding:22px;
  margin-top:18px;
}

.msw-trend-card {
    margin-top: 14px;
}

.msw-card.is-risk-off{
  border-color:rgba(220,38,38,.18);
}

.msw-card.is-risk-on{
  border-color:rgba(22,163,74,.18);
}

.msw-card.is-neutral{
  border-color:rgba(37,99,235,.14);
}

.msw-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.msw-kicker{
  font-size:12px;
  line-height:1;
  color:#64748b;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:.08em;
  display: none;
}

.msw-title{
  margin:0;
  font-size:30px;
  line-height:1.06;
  color:#0f172a;
  font-weight:800;
}

.msw-regime{
  flex:0 0 auto;
  border:1px solid rgba(15,23,42,.08);
  background:#f8fafc;
  color:#0f172a;
  border-radius:999px;
  padding:10px 14px;
  font-size:14px;
  font-weight:800;
}

.msw-topline{
  display:grid;
  grid-template-columns:minmax(180px,240px) 1fr;
  gap:16px;
  align-items:start;
  margin-bottom:16px;
}

.msw-main-score-label{
  color:#64748b;
  font-size:14px;
  margin-bottom:6px;
}

.msw-main-score-value{
  font-size:46px;
  line-height:1;
  font-weight:900;
  color:#0f172a;
}

.msw-risk-heat{
  position:relative;
  margin-top:12px;
  padding-top:6px;
}

.msw-risk-heat-bar{
  height:14px;
  border-radius:999px;
  background:linear-gradient(90deg,#16a34a 0%,#f59e0b 50%,#dc2626 100%);
}

.msw-risk-marker{
  position:absolute;
  top:0;
  width:16px;
  height:26px;
  border-radius:10px;
  background:#0f172a;
  border:2px solid #fff;
  box-shadow:0 4px 12px rgba(15,23,42,.18);
}

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

.msw-mini-metric,
.msw-stat-box{
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
  border-radius:16px;
  padding:12px 14px;
}

.msw-mini-metric span,
.msw-stat-box span{
  display:block;
  font-size:12px;
  color:#64748b;
  margin-bottom:5px;
  line-height: 1.2;
}

.msw-mini-metric strong,
.msw-stat-box strong{
  display:block;
  font-size:20px;
  color:#0f172a;
  line-height:1.1;
}

.msw-market-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(110px,1fr));
  gap:10px;
  margin-bottom:14px;
}

.msw-combined-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:14px 0;
  align-items:stretch;
}

.msw-subpanel{
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  border-radius:16px;
  padding:14px;
  min-width:0;
  overflow:hidden;
}

.msw-subpanel-title{
  font-size:15px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:10px;
}

.msw-subpanel-loading,
.msw-empty{
  font-size:14px;
  color:#64748b;
}

.msw-trust-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.msw-trust-metrics {
    gap: 5px!important;
}

.msw-trust-regime{
  font-weight:100;
  color:#0f172a;
}

.msw-trust-caption{
  margin-top:4px;
  font-size:13px;
  color:#64748b;
  line-height:1.35;
}

.msw-trust-score{
  font-size:30px;
  line-height:1;
  font-weight:900;
  color:#2563eb;
  white-space:nowrap;
}

.msw-trust-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}

.msw-trust-metrics div{
  border:1px solid rgba(15,23,42,.08);
  background:#f8fafc;
  border-radius:12px;
  padding:9px;
  min-width:0;
}

.msw-trust-metrics span{
  display:block;
  font-size:12px;
  color:#64748b;
}

.msw-trust-metrics b{
  display:block;
  margin-top:4px;
  color:#0f172a;
}

.msw-trust-foot{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
  font-size:13px;
  color:#64748b;
}

.msw-moves-list{
  display:grid;
  gap:8px;
}

.msw-move-item{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  text-decoration:none;
  color:inherit;
  border-bottom:1px solid rgba(15,23,42,.06);
  padding-bottom:8px;
}

.msw-move-item:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.msw-move-ticker{
  font-weight:900;
  color:#0f172a;
}

.msw-move-name{
  color:#64748b;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.msw-move-item b{
  white-space:nowrap;
}

.msw-trend-card{
  border:1px solid rgba(15,23,42,.08);
  background:#fbfdff;
  border-radius:18px;
  padding:14px 16px;
  margin:14px 0;
}

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

.msw-trend-title{
  font-size:18px;
  font-weight:800;
  color:#0f172a;
}

.msw-trend-legend{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  font-size:12px;
  color:#64748b;
}

.msw-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:999px;
  vertical-align:middle;
  margin-right:6px;
}

.msw-dot.risk{ background:#0f172a; }
.msw-dot.raw{ background:#334155; }
.msw-dot.overlay{ background:#ea580c; }
.msw-dot.sp500{ background:#2563eb; }

.msw-trend-canvas{
  display:block;
  width:100%;
  height:180px;
}

.msw-situation{
  border:1px solid rgba(15,23,42,.08);
  background:#f8fafc;
  border-radius:18px;
  padding:14px 16px;
  margin:14px 0;
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#334155;
  font-size:15px;
  line-height:1.5;
}

.msw-situation strong{
  color:#0f172a;
  font-size:15px;
}

.msw-anomalies-strip{
  border:1px solid rgba(154,52,18,.14);
  background:#fff7ed;
  border-radius:18px;
  padding:12px 14px;
  margin-top:14px;
}

.msw-anomalies-title{
  font-size:14px;
  font-weight:800;
  color:#9a3412;
  margin-bottom:8px;
}

.msw-anomalies-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.msw-anomaly-note{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  font-size:14px;
  line-height:1.4;
}

.msw-anomaly-note strong{
  color:#7c2d12;
}

.msw-anomaly-note span{
  color:#9a3412;
}

.msw-anomaly-note em{
  font-style:normal;
  color:#c2410c;
  font-weight:700;
}

.is-up{ color:#047857 !important; }
.is-down{ color:#b91c1c !important; }

@media (max-width:980px){
  .msw-title{
    font-size:26px;
  }

  .msw-topline{
    grid-template-columns:1fr;
  }

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

  .msw-market-stats{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width:820px){
  .msw-combined-grid{
    grid-template-columns:1fr;
  }

  .msw-trust-metrics{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media (max-width:720px){
  .msw-card{
    padding:16px;
    border-radius:18px;
  }

  .msw-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .msw-title{
    font-size:22px;
  }

  .msw-main-score-value{
    font-size:36px;
  }

  .msw-deltas{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .msw-market-stats{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:520px){
  .msw-deltas,
  .msw-market-stats{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .msw-trust-metrics{
    grid-template-columns:1fr;
  }

  .msw-title{
    font-size:20px;
  }

  .msw-main-score-value{
    font-size:32px;
  }

  .msw-trust-row{
    flex-direction:column;
  }
}

@media (max-width:360px){
  .msw-deltas,
  .msw-market-stats{
    grid-template-columns:1fr;
  }
}

/* Event pressure compact block */

/* Event pressure compact block — same visual logic as AI Lab */

.msw-event-pressure{
  min-width:0;
  margin-top:14px;
  padding:12px 14px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f8fafc;
}

.msw-event-pressure.is-risk-off{
  border-color:#fde68a;
  background:#fffbeb;
}

.msw-event-pressure.is-risk-on{
  border-color:#bbf7d0;
  background:#f0fdf4;
}

.msw-event-pressure.is-neutral{
  border-color:#e5e7eb;
  background:#f8fafc;
}

.msw-event-pressure span{
  display:block;
  margin-bottom:5px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.msw-event-pressure b{
  display:block;
  color:#0f172a;
  font-size:16px;
  line-height:1.35;
  font-weight:900;
}

.msw-event-pressure p{
  margin:8px 0 0;
  color:#475569;
  font-size:13px;
  line-height:1.45;
}

@media (max-width:700px){
  .msw-event-pressure-head{
    flex-direction:column;
  }

  .msw-event-pressure-head b{
    white-space:normal;
  }
}
/* Market state v2 confirmation tiles */
.msw-confirmation-stats .msw-stat-box em {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-style: normal;
  line-height: 1.25;
  color: #64748b;
}

.msw-confirmation-stats .msw-stat-box.is-confirmed em {
  color: #b45309;
  font-weight: 700;
}

.msw-confirmation-stats .msw-stat-box.is-partial em {
  color: #92400e;
  font-weight: 700;
}

.msw-confirmation-stats .msw-stat-box.is-not-confirmed em {
  color: #64748b;
}

/* Market state v2 sector rotation */
.msw-sector-rotation-strip {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
}

.msw-sector-rotation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.msw-sector-rotation-col {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.msw-sector-rotation-col-title {
  margin-bottom: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.msw-sector-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.msw-sector-row:first-of-type {
  border-top: 0;
}

.msw-sector-row strong {
  color: #0f172a;
  font-size: 15px;
}

.msw-sector-row span {
  color: #64748b;
  font-size: 14px;
  white-space: nowrap;
}

.msw-sector-row.is-weak span {
  color: #b42318;
  font-weight: 700;
}

.msw-sector-row.is-strong span {
  color: #027a48;
  font-weight: 700;
}

@media (max-width: 720px) {
  .msw-sector-rotation-grid {
    grid-template-columns: 1fr;
  }
}

/* Market state v2 trend colors */
.msw-dot.risk {
  background: #2563eb;
}

.msw-dot.warning {
  background: #7c3aed;
}

.msw-dot.overlay {
  background: #ea580c;
}

/* Compact sector picture */
.msw-sector-rotation-strip {
  margin-top: 12px !important;
  padding: 12px !important;
  border-radius: 16px !important;
}

.msw-sector-rotation-strip .msw-anomalies-title {
  margin-bottom: 8px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
}

.msw-sector-rotation-grid {
  gap: 10px !important;
  margin-top: 8px !important;
}

.msw-sector-rotation-col {
  padding: 10px 12px !important;
  border-radius: 14px !important;
}

.msw-sector-rotation-col-title {
  margin-bottom: 6px !important;
  font-size: 11px !important;
  letter-spacing: .05em !important;
}

.msw-sector-row {
  padding: 6px 0 !important;
  gap: 8px !important;
}

.msw-sector-row strong {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

.msw-sector-row span {
  font-size: 13px !important;
}

/* Market state score captions */
.msw-main-score-caption {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.msw-mini-metric em {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
  line-height: 1.25;
  font-weight: 700;
}

.msw-dot.confirmation {
  background: #059669;
}

/* Market state short explanation */
.msw-summary-line {
  margin: -4px 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

/* Market state short explanation */
.msw-summary-line {
  margin: -4px 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
