/* UTU Engine · Navy surface parity for Application Topology and Settings.
   Dark-theme scoped: preserve explicit light theme and semantic status colors.
   Reference: Rule table body #0d1722, header #122334, line #223647. */
:root[data-theme="dark"] #application-topology-panel {
  --utu-panel:#0d1722;
  --utu-panel-soft:#122334;
  --utu-field:#101e2d;
  --utu-stroke:#223647;
  color:#edf5fb!important;
}
:root[data-theme="dark"] #application-topology-panel :is(
  .topology-settings-card,.topology-builder-card,.topology-relationships,
  .topology-settings-grid,.topology-builder-head,.topology-section-head,
  .topology-connect-bar,.topology-type-help,.topology-alias-box,
  .topology-merge-box,.topology-legend,.topology-edge-list
) {
  background-color:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
  color:#edf5fb!important;
  box-shadow:none!important;
}
:root[data-theme="dark"] #application-topology-panel .topology-settings-grid > *,
:root[data-theme="dark"] #application-topology-panel .topology-edge-row,
:root[data-theme="dark"] #application-topology-panel .topology-legend-item {
  background:#122334!important;
  background-image:none!important;
  border-color:#223647!important;
  color:#dceaf5!important;
}
:root[data-theme="dark"] #application-topology-panel :is(
  .topology-node-card,.topology-merge-controls,.topology-node-body
) {
  background:#122334!important;
  border-color:#30485b!important;
  color:#edf5fb!important;
}
:root[data-theme="dark"] #application-topology-panel :is(
  .topology-visual,.topology-canvas
) {
  background-color:#0a1622!important;
  border-color:#223647!important;
  color:#edf5fb!important;
}
:root[data-theme="dark"] #application-topology-panel :is(
  input:not([type="checkbox"]):not([type="radio"]),select,textarea
) {
  background:#101e2d!important;
  border:1px solid #30485b!important;
  color:#edf5fb!important;
  color-scheme:dark;
  box-shadow:none!important;
}
:root[data-theme="dark"] #application-topology-panel select option {
  background:#101e2d;color:#edf5fb;
}
:root[data-theme="dark"] #application-topology-panel :is(
  .topology-section-head,.topology-builder-head,.application-topology-intro
) :is(h2,h3,strong) {color:#edf5fb!important}
:root[data-theme="dark"] #application-topology-panel :is(
  .topology-section-head,.topology-builder-head,.application-topology-intro,
  .topology-type-help,.topology-node-body
) :is(p,small,.muted,.meta) {color:#a7b4c6!important}

/* The Settings page should not switch to a visibly brighter navy on
   General, Sensitive Data, Log analysis, Investigation Triggers, or LLM pricing. */
:root[data-theme="dark"] #settings-view {
  --utu-panel:#0d1722;
  --utu-panel-soft:#122334;
  --utu-field:#101e2d;
  --utu-stroke:#223647;
  --utu-stroke-soft:#1e3041;
  color:#edf5fb;
}
:root[data-theme="dark"] #settings-view .settings-layout > .settings-content,
:root[data-theme="dark"] #settings-view .settings-content > :is(
  .panel,.subpanel,.card,section
),
:root[data-theme="dark"] #settings-view .settings-content :is(
  .utu-settings-general-card,.utu-log-reference-card,.utu-pricing-reference-card,
  .sensitive-settings-card,.sensitive-data-content,.sensitive-policy-card,
  .analytics-settings-layout,.analytics-settings-pane,.utu-settings-list,
  .utu-pricing-list-wrap,.utu-pricing-table-scroll,.sensitive-settings-list
) {
  background-color:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
  color:#edf5fb!important;
  box-shadow:none!important;
}
:root[data-theme="dark"] #settings-view .settings-content .utu-settings-row,
:root[data-theme="dark"] #settings-view .settings-content .sensitive-policy-item,
:root[data-theme="dark"] #settings-view .settings-content .sensitive-rule-row,
:root[data-theme="dark"] #settings-view .settings-content .analytics-pricing-item {
  background:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
  color:#edf5fb!important;
}
:root[data-theme="dark"] #settings-view .settings-content .utu-settings-row:hover,
:root[data-theme="dark"] #settings-view .settings-content .analytics-pricing-item:hover {
  background:#122334!important;
}
:root[data-theme="dark"] #settings-view .settings-content :is(
  .utu-pricing-table thead,.utu-pricing-table th,.analytics-pricing-head,
  .sensitive-settings-head
) {
  background:#122334!important;
  background-image:none!important;
  border-color:#223647!important;
  color:#e3eef7!important;
}
:root[data-theme="dark"] #settings-view .settings-content :is(
  input:not([type="checkbox"]):not([type="radio"]),select,textarea
) {
  background:#101e2d!important;
  border:1px solid #30485b!important;
  color:#edf5fb!important;
  box-shadow:none!important;
  color-scheme:dark;
}
:root[data-theme="dark"] #settings-view .settings-content select option {
  background:#101e2d!important;color:#edf5fb!important;
}
:root[data-theme="dark"] #settings-view .settings-content :is(
  h2,h3,label,strong,.utu-settings-row-copy label
) {color:#edf5fb!important}
:root[data-theme="dark"] #settings-view .settings-content :is(
  p,.field-help,.hint,.muted,.utu-general-description,.utu-settings-row-copy p
) {color:#a7b4c6!important}
:root[data-theme="dark"] #settings-view .settings-nav-card {
  background:#0d1722!important;border-color:#223647!important;
}
:root[data-theme="dark"] #settings-view .settings-nav-card button {
  background:#122334!important;color:#c8d9e6!important;
  border-color:transparent!important;
}
:root[data-theme="dark"] #settings-view .settings-nav-card button.active {
  background:#145066!important;color:#69dce9!important;
}

/* Application editor owns higher-specificity legacy selectors. Fix their
   residual soft-blue backgrounds without altering nested node contrast. */
:root[data-theme="dark"] #application-editor #application-topology-panel :is(
  .topology-settings-card,.topology-builder-card,.topology-relationships,
  .topology-visual-shell,.topology-legend,.topology-edge-list
) {
  background:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
  box-shadow:none!important;
}
:root[data-theme="dark"] #application-editor #application-topology-panel :is(
  .topology-settings-grid,.topology-connect-bar,.topology-visual
) {
  background:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
}

/* Keep Topology control rows identical to dark Rule table rows.
   Older Application theme assigned #122334 to full-width labels. */
:root[data-theme="dark"] #application-editor #application-topology-panel
.topology-settings-grid > label {
  background:#0d1722!important;
  background-image:none!important;
  border-color:#223647!important;
  box-shadow:none!important;
}
:root[data-theme="dark"] #application-editor #application-topology-panel
.topology-settings-grid > label:hover {
  background:#101e2d!important;
}
:root[data-theme="dark"] #application-editor #application-topology-panel
.topology-settings-grid > label > select {
  background:#101e2d!important;
  border-color:#223647!important;
  color:#edf5fb!important;
}
