/* A source keeps one color across its gauge, readings and history. */
.risk-card {
  --chart-cnn:#edb45f;
  --chart-fgc:#86b4f8;
  --chart-grid:#afc1ac24;
  --chart-grid-minor:#afc1ac0d;
  --chart-neutral:#99a99a70;
}
[data-theme="light"] .risk-card {
  --chart-cnn:#a26315;
  --chart-fgc:#326bc0;
  --chart-grid:#304e401b;
  --chart-grid-minor:#304e400a;
  --chart-neutral:#667d6870;
}
.risk-card .cnn { --source-color:var(--chart-cnn); }
.risk-card .feargreedchart { --source-color:var(--chart-fgc); }
.risk-card .risk-overview { display:block; }
.risk-overview-heading, .risk-source-row, .risk-overview-footer { display:grid; grid-template-columns:minmax(235px,.65fr) minmax(0,1.35fr); gap:18px; }
.risk-overview-heading { align-items:start; margin-bottom:12px; }
.risk-overview-heading h2 { font-size:19px; font-weight:550; line-height:1.5; }
.risk-overview-heading h3 { font-size:18px; font-weight:550; line-height:1.5; }
.risk-card .risk-section-caption { margin:5px 0 0; color:var(--faint); font-size:12px; font-weight:400; line-height:1.6; font-variant-numeric:tabular-nums; }
.risk-card .history-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:8px 12px; }
.risk-card .sentiment-period { min-height:38px; max-width:none; border-color:var(--line); border-radius:8px; background:var(--field); font-size:12px; }
.risk-source-row { align-items:stretch; margin-bottom:10px; }
.risk-card .sentiment-meter, .risk-card .risk-history-panel { margin:0; min-width:0; padding:10px 14px; border:1px solid color-mix(in srgb,var(--source-color) 23%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--source-color) 3%,var(--panel)); }
.risk-card .sentiment-meter-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:5px 10px; margin:0 0 4px; }
.risk-card .sentiment-meter-heading a, .risk-card .chart-panel-heading h4 { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:550; }
.risk-card .sentiment-meter-heading time { font-size:11px; color:var(--faint); font-variant-numeric:tabular-nums; }
.risk-card .source-swatch { display:inline-block; width:8px; height:8px; flex:0 0 8px; border-radius:50%; background:var(--source-color); }
.risk-card .sentiment-gauge { max-width:180px; margin:auto; }
.risk-card .sentiment-gauge svg { display:block; width:100%; height:auto; overflow:visible; }
.risk-card .gauge-track, .risk-card .gauge-fill { fill:none; stroke-width:10; stroke-linecap:round; }
.risk-card .gauge-track { stroke:color-mix(in srgb,var(--source-color) 13%,var(--panel)); }
.risk-card .gauge-fill { stroke:var(--source-color); }
.risk-card .gauge-midpoint { stroke:var(--chart-neutral); stroke-width:1; }
.risk-card .gauge-point { fill:var(--panel); stroke:var(--source-color); stroke-width:3; }
.risk-card .sentiment-gauge text { font-family:var(--font); font-variant-numeric:tabular-nums; }
.risk-card .gauge-neutral, .risk-card .gauge-end-label { fill:var(--faint); font-size:11px; }
.risk-card .gauge-value { fill:var(--source-color); font-size:42px; font-weight:600; letter-spacing:-1px; }
.risk-card .gauge-zone { fill:var(--source-color); font-size:15px; font-weight:500; }
.risk-card .gauge-scale-labels { display:flex; justify-content:space-between; max-width:170px; margin:0 auto; color:var(--faint); font-size:11px; }
.risk-card .risk-history-panel { display:flex; flex-direction:column; justify-content:center; }
.risk-card .chart-panel-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:4px 14px; margin-bottom:4px; }
.risk-card .chart-panel-heading h4 { margin:0; }
.risk-card .chart-readout { display:flex; align-items:baseline; gap:12px; min-height:26px; font-variant-numeric:tabular-nums; }
.risk-card .chart-readout:empty { display:none; }
.risk-card .chart-readout time { color:var(--faint); font-size:11px; }
.risk-card .chart-readout strong { color:var(--source-color); font-size:20px; font-weight:600; min-width:4.2ch; }
.risk-card .chart-readout small { font-size:11px; font-weight:400; }
.risk-card .risk-chart-plot { min-width:0; }
.risk-card .sentiment-chart { cursor:crosshair; border-radius:6px; touch-action:pan-y; }
.risk-card .sentiment-chart:focus-visible { outline:2px solid var(--source-color); outline-offset:3px; }
.risk-card .chart-grid { stroke:var(--chart-grid); stroke-width:1; stroke-dasharray:none; }
.risk-card .chart-grid.major { stroke:var(--chart-grid); stroke-dasharray:none; }
.risk-card .chart-grid.minor, .risk-card .chart-grid.vertical { stroke:var(--chart-grid-minor); }
.risk-card .chart-grid.neutral { stroke:var(--chart-neutral); stroke-dasharray:5 5; }
.risk-card .chart-axis { font-size:10px; font-variant-numeric:tabular-nums; }
.risk-card .chart-neutral-label { fill:var(--faint); font-size:10px; font-family:var(--font); paint-order:stroke; stroke:var(--panel); stroke-width:3px; stroke-linejoin:round; }
.risk-card .chart-path.cnn, .risk-card .chart-path.feargreedchart { stroke:var(--source-color); stroke-width:2.5; vector-effect:non-scaling-stroke; }
.risk-card .chart-path.estimate { stroke-dasharray:5 6; }
.risk-card .chart-area { pointer-events:none; }
.risk-card .chart-area-stop { stop-color:var(--source-color); }
.risk-card .chart-point.cnn, .risk-card .chart-point.feargreedchart { fill:var(--source-color); stroke:var(--panel); stroke-width:2; }
.risk-card .chart-point.estimate { fill:var(--panel); stroke:var(--source-color); }
.risk-card .chart-end-halo { fill:var(--source-color); opacity:.12; }
.risk-card .sentiment-chart-cursor { stroke:var(--source-color); stroke-width:1; stroke-dasharray:3 4; opacity:.45; }
.risk-card .chart-selected { fill:var(--panel); stroke:var(--source-color); stroke-width:2.5; pointer-events:none; }
.risk-card .chart-estimate-note { color:var(--faint); font-size:11px; margin:6px 0 0; }
.risk-card .chart-scale-note { color:var(--muted); font-size:10px; line-height:1.7; margin:3px 0 0; }
.risk-card .sentiment-empty-chart { min-height:132px; }
.risk-overview-footer { align-items:start; }
.risk-card .risk-overview-footer .sentiment-values { margin:0; }
.risk-card .chart-interaction-hint { margin:10px 0 0; color:var(--faint); font-size:11px; line-height:1.7; text-align:right; }
@container (max-width:650px) {
  .risk-overview-heading, .risk-source-row, .risk-overview-footer { grid-template-columns:minmax(0,1fr); gap:12px; }
  .risk-overview-heading { gap:18px; }
  .risk-source-row { gap:0; margin-bottom:12px; }
  .risk-card .sentiment-meter { display:grid; grid-template-columns:minmax(0,1fr) 150px; align-items:center; column-gap:10px; border-radius:12px 12px 0 0; border-bottom:0; padding-bottom:8px; }
  .risk-card .sentiment-meter-heading { grid-row:1 / 3; flex-direction:column; align-items:flex-start; justify-content:center; margin:0; }
  .risk-card .gauge-scale-labels { grid-column:2; width:100%; font-size:10px; }
  .risk-card .sentiment-meter > .source-warning { grid-column:1 / -1; }
  .risk-card .risk-history-panel { border-radius:0 0 12px 12px; border-top-style:dashed; padding-top:8px; }
  .risk-card .sentiment-gauge { grid-column:2; width:150px; max-width:100%; margin:0; }
  .risk-card .chart-panel-heading h4 { font-size:12px; }
  .risk-card .chart-readout { gap:8px; }
  .risk-card .chart-readout time { font-size:10px; }
  .risk-card .chart-readout strong { font-size:18px; }
  .risk-card .chart-interaction-hint { margin:0; text-align:left; }
}
@container (max-width:310px) {
  .risk-card .sentiment-meter { grid-template-columns:minmax(0,1fr) 120px; }
  .risk-card .sentiment-meter-heading a { flex-wrap:wrap; overflow-wrap:anywhere; }
  .risk-card .sentiment-meter, .risk-card .risk-history-panel { padding-left:10px; padding-right:10px; }
}
