/* RATES diagnostic geometry and C-FLOW chart framing, scoped to FINSTATE. */
#view-finstate .finstate-selected-ratio { padding:14px; margin-bottom:16px; border:1px solid #bcccdc; border-radius:10px; background:#fff; color:#102a43; font-size:12px; line-height:1.6; }
#view-finstate .finstate-selected-ratio h3 { margin:0 0 8px; font-size:14px; }
#view-finstate .finstate-selected-ratio label { display:block; }
#view-finstate .finstate-selected-ratio select { width:100%; max-width:100%; min-height:44px; color:#102a43; background:#fff; }
#view-finstate .finstate-selected-ratio-statistics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
#view-finstate .finstate-selected-ratio-statistics dt { color:#48617c; }
#view-finstate .finstate-selected-ratio-statistics dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
#view-finstate .finstate-chart-frame .finstate-series-shell .finstate-chart-stage { min-height:0; padding:12px; }
#view-finstate .finstate-history-boundary { margin-top:12px; font-size:11px; line-height:1.6; }
#view-finstate .finstate-history-boundary summary { cursor:pointer; min-height:44px; display:list-item; }
#view-finstate .finstate-chart-frame .finstate-chart-context,
#view-finstate .finstate-chart-frame .finstate-chart-metadata { font-size:11px; }
#view-finstate .fx-panel.finstate-i2-panel { background:#f7fafc!important; color:#102a43; }
#view-finstate .fx-panel.finstate-i2-panel > .panel-title { color:#102a43!important; }
#view-finstate .finstate-i2-panel .finstate-validation-hold,
#view-finstate .finstate-i2-panel .finstate-chart-frame { background:#f7fafc!important; color:#102a43; }
#view-finstate .finstate-chart-frame h2,
#view-finstate .finstate-chart-frame .finstate-chart-stage strong { color:#755720; }
#view-finstate .finstate-iv-panel .finstate-diagnostic-boundary,
#view-finstate .finstate-i2-panel .finstate-validation-hold,
#view-finstate .finstate-chart-frame .finstate-chart-footnote,
#view-finstate .finstate-chart-frame .finstate-series-stats { color:#334e68; }
#view-finstate .finstate-chart-frame .finstate-chart-stage { background:#edf2f7; color:#102a43; }
#view-finstate .finstate-chart-frame .finstate-chart-context dt,
#view-finstate .finstate-chart-frame .finstate-chart-metadata dt { color:#48617c; }

#view-finstate .finstate-diagnostic-boundary { font-size:12px; line-height:1.6; color:var(--iv-text-secondary,#a5b0c1); }
#view-finstate .finstate-geoscen-navigation { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
#view-finstate .finstate-geoscen-navigation a,
#view-finstate .finstate-research-action { display:inline-flex; align-items:center; min-height:44px; padding:8px 12px; box-sizing:border-box; border:1px solid currentColor; border-radius:6px; color:inherit; font-size:12px; line-height:1.4; text-decoration:underline; overflow-wrap:anywhere; }
#view-finstate .finstate-geoscen-navigation a[aria-current] { font-weight:700; border-width:2px; }
#view-finstate .finstate-geoscen-navigation a:focus-visible,
#view-finstate .finstate-research-action:focus-visible,
#view-finstate .finstate-geoscen-section:focus,
#view-finstate #finstate-financial-explanations:focus { outline:2px solid currentColor; outline-offset:3px; }
#view-finstate .finstate-geoscen-section,
#view-finstate #finstate-financial-explanations { scroll-margin-top:24px; }
#view-finstate .finstate-chart-frame {
  text-transform: none; letter-spacing: normal; font-weight: 400;
}
#view-finstate .finstate-series-shell { min-width: 0; }
#view-finstate .finstate-series-stats {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 0 0 12px; padding: 10px 0;
  font-size: 11px; color: var(--iv-text-secondary, #a5b0c1);
  border-bottom: 1px solid var(--iv-border, #294359);
}
#view-finstate .finstate-chart-context { gap: 10px; }
#view-finstate .finstate-chart-stage {
  background: rgba(7, 15, 27, .45); min-height: 240px;
  border-color: rgba(126, 153, 196, .22);
}
#view-finstate .finstate-chart-stage strong {
  color: var(--iv-gold, #d5b37c); font-size: 12px; letter-spacing: .06em;
}
#view-finstate .finstate-geoscen-panel [data-finstate-geoscen-status] {
  display: block; text-align: left; padding: 14px 0 0;
  text-transform: none; letter-spacing: normal; font-weight: 400;
}
#view-finstate .finstate-geoscen-availability {
  color: var(--iv-gold, #d5b37c); font-size: 12px; line-height: 1.6;
}
#view-finstate .finstate-geoscen-selection {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 16px 0 20px;
}
#view-finstate .finstate-geoscen-selection dt {
  font-size: 11px; color: var(--muted, #a9c6dd);
}
#view-finstate .finstate-geoscen-selection dd {
  margin: 4px 0 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere;
}
#view-finstate .finstate-geoscen-section { margin: 18px 0; }
#view-finstate .finstate-geoscen-section h3 {
  color: var(--iv-gold, #d5b37c); font-size: 11px;
  letter-spacing: .08em; margin: 0 0 6px;
}
#view-finstate .finstate-geoscen-section p,
#view-finstate .finstate-narrative-provenance {
  margin: 0; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere;
}
#view-finstate .finstate-narrative-provenance summary { cursor: pointer; }
#view-finstate .finstate-narrative-provenance p { margin: 10px 0; }
#view-finstate .finstate-narrative-provenance summary:focus-visible {
  outline: 2px solid var(--iv-gold, #d5b37c); outline-offset: 3px;
}
@media (max-width: 599px) {
  #view-finstate .finstate-geoscen-selection { grid-template-columns: 1fr; }
  #view-finstate .finstate-chart-stage { min-height: 200px; }
}

/* Diagnostic cards retain the RATES dark surface in both themes. */
#finstate-iv-vector .finstate-iv-vector-card .g3-state,
#finstate-iv-vector .finstate-iv-vector-card .g3-meta,
#finstate-iv-vector .finstate-iv-vector-card .g3-evidence,
#finstate-iv-vector .finstate-iv-value[data-value-available="false"] { color: #d7e5f2; }
#finstate-iv-vector > .g3-meta { color: var(--iv-text-secondary, #a5b0c1); }
html[data-theme="light"] #view-finstate .finstate-chart-stage { background: #eef2f7; }
html[data-theme="light"] #view-finstate .finstate-chart-stage strong,
html[data-theme="light"] #view-finstate .finstate-geoscen-availability,
html[data-theme="light"] #view-finstate .finstate-geoscen-section h3 { color: #755720; }

/* Presentation cleanup only; retain selection state, guards and table contents. */
#view-finstate .finstate-geoscen-panel .finstate-geoscen-navigation,
#view-finstate .finstate-geoscen-panel .finstate-geoscen-availability,
#view-finstate .finstate-geoscen-panel .finstate-geoscen-selection,
#view-finstate .finstate-constituents-panel > #finstate-current-ratio-research {
  display: none !important;
}

#view-finstate .fx-panel.finstate-i2-panel.finstate-work-in-progress {
  display:flex;
  flex-direction:column;
  background:#000!important;
}
#view-finstate .fx-panel.finstate-i2-panel.finstate-work-in-progress > .panel-title { color:#fff!important; }
#view-finstate .finstate-work-in-progress > .panel-placeholder {
  flex:1;
  min-height:280px;
  flex-direction:column;
  gap:12px;
  border:0;
  color:#fff;
}
#view-finstate .finstate-work-in-progress .panel-placeholder h2,
#view-finstate .finstate-work-in-progress .panel-placeholder p { margin:0; color:#fff; }
#view-finstate .finstate-work-in-progress .panel-placeholder footer { font-size:0.75rem; }
