/* BMH appearance layer. Light mode continues to use styles.css unchanged.
 * These rules override colour properties only; layout and state selectors are preserved.
 * Palette: charcoal surfaces, jade accents, original status colour meanings.
 */
:root { --theme-button-text: #fff; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101419;
  --panel: #181e25;
  --ink: #e6ebf1;
  --muted: #a8b3c1;
  --line: #303943;
  --accent: #62cda3;
  --accent-dark: #87dfb9;
  --warn: #e8b967;
  --bad: #ef9292;
  --soft: #203a32;
  --theme-button-text: #102219;
}
.theme-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.theme-control select { width: auto; padding: 7px 28px 7px 10px; font-size: 13px; }

html[data-theme="dark"] .direct-node-group-card {
  border: 1px solid #303943;
  border-left: 4px solid #365d4d;
  background: #181e25;
  box-shadow: 0 10px 26px rgba(7,10,14,0.055);
}

html[data-theme="dark"] .direct-node-group-card.offline {
  border-left-color: #303943;
}

html[data-theme="dark"] .direct-node-card-head small,
html[data-theme="dark"] .direct-route-coverage article header small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-card-head strong,
html[data-theme="dark"] .direct-route-coverage article header strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-card-place {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-card-kpis > span,
html[data-theme="dark"] .direct-node-detail-facts > span {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-node-card-kpis small,
html[data-theme="dark"] .direct-node-detail-facts small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-card-kpis strong,
html[data-theme="dark"] .direct-node-detail-facts strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-card-badges i.allowed {
  background: #203a32;
  color: #62cda3;
}

html[data-theme="dark"] .direct-node-card-badges i.blocked {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-card-badges b {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-group-card > summary > em {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-card-detail {
  border-top: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .direct-node-member-grid > span {
  border-left: 3px solid #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .direct-node-member-grid > span.offline {
  border-left-color: #303943;
}

html[data-theme="dark"] .direct-node-member-grid small,
html[data-theme="dark"] .direct-node-member-grid em {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-member-grid strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-route-coverage article {
  border: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .direct-route-coverage article > div b {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-route-coverage article > div small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-route-coverage article p span,
html[data-theme="dark"] .direct-route-coverage article p em {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .settings-block.tcping-quality-shell {
  border: 1px solid #303943;
  background: #202832;
  box-shadow: 0 12px 32px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .tcping-quality-toolbar {
  border-bottom: 1px solid #303943;
  background: rgba(24,30,37,0.96);
}

html[data-theme="dark"] .tcping-panel-heading h4 {
  color: #e6ebf1;
}

html[data-theme="dark"] .tcping-panel-heading p {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-window-control {
  border: 1px solid #303943;
  background: linear-gradient(135deg, #181e25, #202f43);
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-window-control select {
  border-color: #303943;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-summary-grid.tcping-summary-grid > span {
  border-color: #303943;
  background: #181e25;
  box-shadow: 0 4px 14px rgba(7,10,14,0.05);
}

html[data-theme="dark"] .tcping-summary-grid > span::before {
  background: #202f43;
}

html[data-theme="dark"] .tcping-panel {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 6px 18px rgba(7,10,14,0.05);
}

html[data-theme="dark"] .tcping-panel-heading {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .tcping-node-group + .tcping-node-group {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .tcping-node-group > header {
  color: #e6ebf1;
}

html[data-theme="dark"] .tcping-node-group > header span {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-node-card {
  border: 1px solid #303943;
  background: #181e25;
  color: inherit;
}

html[data-theme="dark"] .tcping-node-card:hover {
  border-color: #303943;
  box-shadow: 0 8px 20px rgba(7,10,14,0.12);
}

html[data-theme="dark"] .tcping-node-card.selected {
  border-color: #303943;
  box-shadow: 0 0 0 3px rgba(7,10,14,0.16);
}

html[data-theme="dark"] .tcping-node-card.online {
  border-top: 3px solid #365d4d;
}

html[data-theme="dark"] .tcping-node-card.offline {
  border-top: 3px solid #72603c;
  background: #202832;
}

html[data-theme="dark"] .tcping-node-dot {
  background: #203a32;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.13);
}

html[data-theme="dark"] .tcping-node-card.offline .tcping-node-dot {
  background: #393122;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.13);
}

html[data-theme="dark"] .tcping-node-card > strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .tcping-node-card > small,
html[data-theme="dark"] .tcping-node-card dt {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-node-facts > span {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .tcping-node-facts em {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-node-facts b {
  color: #e6ebf1;
}

html[data-theme="dark"] .tcping-empty-state {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-carrier-legend span {
  border: 1px solid transparent;
}

html[data-theme="dark"] .tcping-carrier-legend .telecom {
  border-color: #3f5878;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-carrier-legend .unicom {
  border-color: #365d4d;
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .tcping-carrier-legend .mobile {
  border-color: #72603c;
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .tcping-carrier-legend .other {
  border-color: #303943;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-matrix-wrap {
  border: 0;
}

html[data-theme="dark"] .tcping-matrix-table th {
  border-bottom: 1px solid #303943;
  background: #202f43;
  color: #e6ebf1;
}

html[data-theme="dark"] .tcping-matrix-table th:first-child,
html[data-theme="dark"] .tcping-matrix-table td:first-child {
  box-shadow: 1px 0 0 #070a0e;
}

html[data-theme="dark"] .tcping-matrix-table th:first-child {
  background: #202f43;
}

html[data-theme="dark"] .tcping-matrix-table td {
  border-color: rgba(48,57,67,0.55);
}

html[data-theme="dark"] .tcping-matrix-table tr.tcping-carrier-telecom td {
  background: #202832;
}

html[data-theme="dark"] .tcping-matrix-table tr.tcping-carrier-unicom td {
  background: #202832;
}

html[data-theme="dark"] .tcping-matrix-table tr.tcping-carrier-mobile td {
  background: #393122;
}

html[data-theme="dark"] .tcping-matrix-table tr.tcping-carrier-other td {
  background: #202832;
}

html[data-theme="dark"] .tcping-matrix-table tr.bad td {
  box-shadow: inset 0 0 0 1px rgba(7,10,14,0.32);
}

html[data-theme="dark"] .tcping-matrix-table tr.tcping-target-invalid td {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-cell-state.good {
  background: #203a32;
  color: #62cda3;
}

html[data-theme="dark"] .tcping-cell-state.warning {
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .tcping-cell-state.timeout {
  background: #3b242b;
  color: #ef9292;
}

html[data-theme="dark"] .tcping-cell-state.invalid {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .tcping-quality-bar {
  background: rgba(38,50,62,0.15);
}

html[data-theme="dark"] .tcping-quality-bar i {
  background: #203a32;
}

html[data-theme="dark"] .e2fm {
  color: var(--e2fm-text);
  background: #181e25;
}

html[data-theme="dark"] button[data-resource-detail="files"]:focus-visible {
  outline: 2px solid rgba(54,93,77,0.24);
}

html[data-theme="dark"] .e2fm-icon {
  background: currentColor;
}

html[data-theme="dark"] .e2fm-page-head,
html[data-theme="dark"] .e2fm-command-bar,
html[data-theme="dark"] .e2fm-action-bar {
  border-bottom: 1px solid var(--e2fm-line);
}

html[data-theme="dark"] .e2fm-online {
  border: 1px solid var(--e2fm-green-line);
  color: var(--e2fm-green-dark);
  background: #202832;
}

html[data-theme="dark"] .e2fm-online.offline {
  border-color: #72603c;
  color: #e8b967;
  background: #202832;
}

html[data-theme="dark"] .e2fm-current-time {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-current-time strong {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-breadcrumbs {
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-breadcrumbs button {
  border: 0;
  color: inherit;
  background: transparent;
}

html[data-theme="dark"] .e2fm-breadcrumbs button:hover {
  color: var(--e2fm-green);
  background: transparent;
}

html[data-theme="dark"] .e2fm-breadcrumbs .separator {
  color: #8391a2;
}

html[data-theme="dark"] .e2fm-search .e2fm-icon {
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-search input {
  border-color: #303943;
}

html[data-theme="dark"] .e2fm-view-toggle button,
html[data-theme="dark"] .e2fm-icon-button {
  border: 1px solid #303943;
  color: #e6ebf1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-view-toggle button.active {
  border-color: var(--e2fm-green);
  color: var(--e2fm-green);
  background: var(--e2fm-green-soft);
}

html[data-theme="dark"] .e2fm-action-bar button {
  border-color: #303943;
  color: #e6ebf1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-action-bar button:hover:not(:disabled) {
  border-color: var(--e2fm-green);
  color: var(--e2fm-green);
  background: var(--e2fm-green-soft);
}

html[data-theme="dark"] .e2fm-action-bar button .e2fm-icon {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-action-hint {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-workspace {
  background: #181e25;
}

html[data-theme="dark"] .e2fm-tree-panel,
html[data-theme="dark"] .e2fm-list-panel,
html[data-theme="dark"] .e2fm-confirm-panel {
  border: 1px solid var(--e2fm-line);
  background: #181e25;
}

html[data-theme="dark"] .e2fm-tree-head {
  border-bottom: 1px solid var(--e2fm-line);
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-live-dot {
  background: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-tree-row {
  border: 0;
  color: #a8b3c1;
  background: transparent;
}

html[data-theme="dark"] .e2fm-tree-row:hover,
html[data-theme="dark"] .e2fm-tree-row.selected {
  color: var(--e2fm-green-dark);
  background: var(--e2fm-green-soft);
}

html[data-theme="dark"] .e2fm-tree-row .e2fm-icon[data-icon="folder"],
html[data-theme="dark"] .e2fm-tree-row .e2fm-icon[data-icon="folder-open"] {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-tree-row.selected .e2fm-icon,
html[data-theme="dark"] .e2fm-tree-row.expanded > .e2fm-icon[data-icon="folder-open"] {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-recycle-link {
  border: 0;
  border-top: 1px solid var(--e2fm-line);
  color: #e6ebf1;
  background: transparent;
}

html[data-theme="dark"] .e2fm-recycle-link:hover {
  color: var(--e2fm-green);
  background: transparent;
}

html[data-theme="dark"] .e2fm-storage-overview {
  border-top: 1px solid var(--e2fm-line);
}

html[data-theme="dark"] .e2fm-storage-overview dt {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-storage-overview dd {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-storage-overview dd.normal {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-storage-overview dd.disabled {
  color: #e8b967;
}

html[data-theme="dark"] .e2fm-storage-refresh {
  border-color: #303943;
  color: #a8b3c1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-list-head {
  border-bottom: 1px solid var(--e2fm-line);
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-list-head small {
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-file-row {
  border-bottom: 1px solid #303943;
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-file-row:hover {
  background: #202832;
}

html[data-theme="dark"] .e2fm-file-row.selected {
  background: var(--e2fm-green-soft);
}

html[data-theme="dark"] .e2fm-file-name .e2fm-icon {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-file-row.selected .e2fm-file-name,
html[data-theme="dark"] .e2fm-file-row.selected .e2fm-file-name .e2fm-icon,
html[data-theme="dark"] .e2fm-file-row.expanded .e2fm-file-name,
html[data-theme="dark"] .e2fm-file-row.expanded .e2fm-file-name .e2fm-icon {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-file-name .expand-icon {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-file-size,
html[data-theme="dark"] .e2fm-file-time {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-status-pill {
  border: 1px solid var(--e2fm-green-line);
  color: var(--e2fm-green-dark);
  background: #202832;
}

html[data-theme="dark"] .e2fm-status-pill.protected {
  border-color: #72603c;
  color: #e8b967;
  background: #202832;
}

html[data-theme="dark"] .e2fm-status-pill.refresh_pending {
  border-color: #3f5878;
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .e2fm-row-more {
  border: 0;
  color: #a8b3c1;
  background: transparent;
}

html[data-theme="dark"] .e2fm-row-more:hover {
  color: var(--e2fm-green);
  background: #203a32;
}

html[data-theme="dark"] .e2fm-recycle-name small {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-status-pill.restoring {
  border-color: #3f5878;
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .e2fm-status-pill.restored {
  border-color: #303943;
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .e2fm-restore-button {
  border: 1px solid var(--e2fm-green-line);
  color: var(--e2fm-green-dark);
  background: #202832;
}

html[data-theme="dark"] .e2fm-restore-button:disabled {
  border-color: #303943;
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .e2fm-load-more-row,
html[data-theme="dark"] .e2fm-inline-notice {
  border-bottom: 1px solid #303943;
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-load-more-row button {
  border: 1px solid var(--e2fm-green-line);
  color: var(--e2fm-green-dark);
  background: #202832;
}

html[data-theme="dark"] .e2fm-inline-notice {
  background: #181e25;
}

html[data-theme="dark"] .e2fm-empty,
html[data-theme="dark"] .e2fm-error {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-error {
  color: var(--bad);
}

html[data-theme="dark"] .e2fm-list-footer {
  border-top: 1px solid var(--e2fm-line);
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-list-panel.grid-mode .e2fm-file-row {
  border: 1px solid var(--e2fm-line);
}

html[data-theme="dark"] .e2fm-confirm-panel h3 {
  color: var(--e2fm-green-dark);
}

html[data-theme="dark"] .e2fm-confirm-empty {
  border: 1px dashed #303943;
  color: var(--e2fm-muted);
  background: #181e25;
}

html[data-theme="dark"] .e2fm-confirm-checks {
  border: 1px solid var(--e2fm-green-line);
  background: #202832;
}

html[data-theme="dark"] .e2fm-confirm-checks > div {
  color: #e6ebf1;
}

html[data-theme="dark"] .e2fm-confirm-checks .e2fm-icon {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-confirm-note,
html[data-theme="dark"] .e2fm-confirm-warning {
  border: 1px solid #3f5878;
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .e2fm-confirm-warning {
  border-color: #72603c;
  color: #e8b967;
  background: #202832;
}

html[data-theme="dark"] .e2fm-confirm-actions button {
  border-color: #303943;
  color: #e6ebf1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-confirm-actions button.primary {
  border-color: var(--e2fm-green);
  color: #e6ebf1;
  background: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-confirm-actions button.danger {
  color: #ef9292;
}

html[data-theme="dark"] .e2fm-rules-link {
  color: #99bcf8;
}

html[data-theme="dark"] .e2fm-transfers {
  border-top: 1px solid var(--e2fm-line);
  background: #181e25;
}

html[data-theme="dark"] .e2fm-transfers > header {
  border-bottom: 1px solid var(--e2fm-line);
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-transfer-toggle {
  border: 0;
  color: #e6ebf1;
  background: transparent;
}

html[data-theme="dark"] .e2fm-transfer-toggle:hover {
  color: var(--e2fm-green);
  background: transparent;
}

html[data-theme="dark"] .e2fm-transfer-row {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .e2fm-transfer-name > .e2fm-icon {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-transfer-name small {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-transfer-progress {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-progress-track {
  background: #202832;
}

html[data-theme="dark"] .e2fm-progress-track span {
  background: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-transfer-meta {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-transfer-actions button {
  border-color: #303943;
  color: #e6ebf1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-transfer-actions button.danger {
  border-color: #70464b;
  color: #ef9292;
}

html[data-theme="dark"] .e2fm-transfer-empty {
  color: var(--e2fm-muted);
}

html[data-theme="dark"] .e2fm-transfers > footer {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-dialog {
  border: 1px solid #303943;
  color: var(--e2fm-text);
  background: #181e25;
  box-shadow: 0 22px 70px rgba(7,10,14,0.2);
}

html[data-theme="dark"] .e2fm-dialog::backdrop {
  background: rgba(20,28,37,0.42);
}

html[data-theme="dark"] .e2fm-dialog form > header,
html[data-theme="dark"] .e2fm-dialog form > footer {
  border-bottom: 1px solid var(--e2fm-line);
}

html[data-theme="dark"] .e2fm-dialog form > footer {
  border-top: 1px solid var(--e2fm-line);
  border-bottom: 0;
}

html[data-theme="dark"] .e2fm-dialog header small {
  color: var(--e2fm-green);
}

html[data-theme="dark"] .e2fm-dialog-close {
  border: 0;
  color: #a8b3c1;
  background: transparent;
}

html[data-theme="dark"] .e2fm-dialog-selection {
  border: 1px solid var(--e2fm-line);
  color: #a8b3c1;
  background: #181e25;
}

html[data-theme="dark"] .e2fm-dialog-warning {
  border: 1px solid #72603c;
  color: #e8b967;
  background: #202832;
}

html[data-theme="dark"] .e2fm-dialog-warning .e2fm-icon {
  color: var(--e2fm-orange);
}

html[data-theme="dark"] .e2fm-destination-field,
html[data-theme="dark"] .e2fm-confirm-phrase {
  color: #a8b3c1;
}

html[data-theme="dark"] .e2fm-dialog-error {
  color: var(--bad);
}

html[data-theme="dark"] .e2fm-dialog-primary {
  border-color: var(--e2fm-green);
  background: var(--e2fm-green);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .eyebrow {
  color: var(--accent-dark);
}

html[data-theme="dark"] p,
html[data-theme="dark"] small {
  color: var(--muted);
}

html[data-theme="dark"] label {
  color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #181e25;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  outline: 2px solid rgba(54,93,77,0.24);
  border-color: var(--accent);
}

html[data-theme="dark"] button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #e6ebf1;
}

html[data-theme="dark"] button:hover {
  background: var(--accent-dark);
}

html[data-theme="dark"] .form-error,
html[data-theme="dark"] .bad {
  color: var(--bad);
}

html[data-theme="dark"] .side-nav {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(7,10,14,0.05);
}

html[data-theme="dark"] .side-brand {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .side-brand strong {
  color: var(--accent-dark);
}

html[data-theme="dark"] .side-brand span {
  color: var(--muted);
}

html[data-theme="dark"] .side-logout {
  border-color: #303943;
  background: #181e25;
  color: var(--ink);
}

html[data-theme="dark"] .side-logout:hover {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .side-menu button {
  border-color: transparent;
  color: var(--ink);
}

html[data-theme="dark"] .side-menu-main {
  border: 1px solid #303943;
  background: #181e25;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .side-menu-main::before {
  background: rgba(32,58,50,0.28);
}

html[data-theme="dark"] .side-menu-main[aria-controls]::after {
  border: 1px solid #365d4d;
  background-color: #202832;
  background-image: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 26 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 7l6 6-6 6' fill='none' stroke='%23155f46' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: var(--accent-dark);
}

html[data-theme="dark"] .side-menu-main[aria-expanded="true"]::after {
  border-color: var(--accent);
  background-color: #203a32;
}

html[data-theme="dark"] .side-menu-main.active {
  border-color: rgba(54,93,77,0.48);
  background: var(--soft);
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .side-menu-main.active::before {
  background: var(--accent);
}

html[data-theme="dark"] .side-submenu {
  border-left: 2px solid #365d4d;
}

html[data-theme="dark"] .side-submenu button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

html[data-theme="dark"] .side-menu button:hover,
html[data-theme="dark"] .side-submenu button.active {
  background: #202832;
  color: var(--accent-dark);
}

html[data-theme="dark"] .page-refresh-strip {
  border: 1px solid var(--line);
  border-left: 4px solid #365d4d;
  background: #181e25;
  box-shadow: 0 10px 24px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .page-refresh-strip.refreshing {
  border-left-color: #72603c;
  background: #202832;
}

html[data-theme="dark"] .page-refresh-strip.failed {
  border-left-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .page-refresh-main strong {
  color: var(--ink);
}

html[data-theme="dark"] .page-refresh-main span {
  color: var(--muted);
}

html[data-theme="dark"] .page-refresh-strip.refreshing .page-refresh-main span {
  color: #e8b967;
}

html[data-theme="dark"] .page-refresh-strip.failed .page-refresh-main span {
  color: #ef9292;
}

html[data-theme="dark"] .page-refresh-meta {
  color: var(--muted);
}

html[data-theme="dark"] .portal-card {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

html[data-theme="dark"] .portal-card:hover,
html[data-theme="dark"] .portal-card.active {
  border-color: rgba(54,93,77,0.45);
  background: var(--soft);
}

html[data-theme="dark"] .portal-card span {
  color: var(--accent-dark);
}

html[data-theme="dark"] .compact-portal-card {
  color: var(--accent-dark);
}

html[data-theme="dark"] .panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

html[data-theme="dark"] .panel-header {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .ai-subnav {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .ai-subnav button {
  border-color: var(--line);
  border-bottom-color: transparent;
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-subnav button.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .settings-block {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .settings-block:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .pixel-account {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .pixel-account-amounts span {
  color: var(--muted);
}

html[data-theme="dark"] .ai-provider-panel:first-child {
  border-right: 1px solid var(--line);
}

@media (max-width: 900px) {
html[data-theme="dark"] .ai-provider-panel:first-child {
  border-right: 0;
}
}

html[data-theme="dark"] .control-section-title,
html[data-theme="dark"] .ai-governor-section-title,
html[data-theme="dark"] .settings-block > h3,
html[data-theme="dark"] .split-title > h3,
html[data-theme="dark"] .request-entry-switch h3,
html[data-theme="dark"] .operator-status-row h3,
html[data-theme="dark"] .stats-decision h3,
html[data-theme="dark"] .task-section-head h3,
html[data-theme="dark"] .ledger-panel-head h3,
html[data-theme="dark"] .ai-usage-header h3,
html[data-theme="dark"] .details-panel:not(.compact-details) > summary > span:first-child {
  color: #62cda3;
}

html[data-theme="dark"] .control-section-title::before,
html[data-theme="dark"] .settings-block > h3::before,
html[data-theme="dark"] .split-title > h3::before,
html[data-theme="dark"] .request-entry-switch h3::before,
html[data-theme="dark"] .operator-status-row h3::before,
html[data-theme="dark"] .stats-decision h3::before,
html[data-theme="dark"] .task-section-head h3::before,
html[data-theme="dark"] .ledger-panel-head h3::before,
html[data-theme="dark"] .ai-usage-header h3::before,
html[data-theme="dark"] .details-panel:not(.compact-details) > summary > span:first-child::before {
  background: #203a32;
  box-shadow: 0 0 0 3px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .section-toggle {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

html[data-theme="dark"] .section-toggle:hover {
  background: transparent;
  color: var(--accent-dark);
}

html[data-theme="dark"] .section-toggle-title {
  color: #62cda3;
}

html[data-theme="dark"] .section-toggle-title::before {
  background: #203a32;
  box-shadow: 0 0 0 3px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .section-toggle strong {
  color: var(--accent-dark);
}

html[data-theme="dark"] .danger-button {
  background: #3b242b;
  border-color: #70464b;
}

html[data-theme="dark"] .danger-button:hover {
  background: #3b242b;
}

html[data-theme="dark"] .request-entry-switch p {
  color: var(--muted);
}

html[data-theme="dark"] #request-entry-status {
  background: transparent;
}

html[data-theme="dark"] #request-entry-status::before {
  background: currentColor;
}

html[data-theme="dark"] #request-entry-toggle[data-enabled="true"] {
  border-color: #303943;
  background: #181e25;
  color: #a8b3c1;
}

html[data-theme="dark"] #request-entry-toggle[data-enabled="true"]:hover {
  border-color: #303943;
  background: #202832;
  color: #e6ebf1;
}

html[data-theme="dark"] .primary-action-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #e6ebf1;
}

html[data-theme="dark"] .primary-action-button:hover {
  background: var(--accent-dark);
  color: #e6ebf1;
}

html[data-theme="dark"] .pt-login-meta small {
  color: var(--muted);
}

html[data-theme="dark"] .pt-login-viewport {
  border: 1px solid var(--line);
  background: #202832;
}

html[data-theme="dark"] .pt-login-viewport:focus {
  outline: 2px solid var(--accent);
}

html[data-theme="dark"] .local-import-strip span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .local-import-strip small {
  color: var(--muted);
}

html[data-theme="dark"] .role-grid article {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .role-card-head span {
  background: var(--soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .role-columns div {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .role-columns span {
  color: var(--muted);
}

html[data-theme="dark"] .role-columns li {
  color: var(--ink);
}

html[data-theme="dark"] .provider-box {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .fact-grid article {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .fact-grid span {
  color: var(--muted);
}

html[data-theme="dark"] .fact-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .operator-overview,
html[data-theme="dark"] .task-manager-overview {
  border-bottom: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .task-manager-overview,
html[data-theme="dark"] .task-flow-board,
html[data-theme="dark"] .task-action-board {
  border: 1px solid var(--line);
  background: #181e25;
  box-shadow: 0 12px 28px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .task-hero {
  border-left: 8px solid #365d4d;
}

html[data-theme="dark"] .task-hero.good {
  background: #202832;
  border-left-color: #365d4d;
}

html[data-theme="dark"] .task-hero.watch {
  background: #393122;
  border-left-color: #72603c;
}

html[data-theme="dark"] .task-hero.danger {
  background: #202832;
  border-left-color: #70464b;
}

html[data-theme="dark"] .task-hero-badge {
  background: #181e25;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .task-hero-main small,
html[data-theme="dark"] .task-hero-impact small {
  color: var(--muted);
}

html[data-theme="dark"] .task-hero-main h3 {
  color: var(--ink);
}

html[data-theme="dark"] .task-hero-main p {
  color: #e6ebf1;
}

html[data-theme="dark"] .task-hero-impact {
  border: 1px solid rgba(48,57,67,0.08);
  background: rgba(24,30,37,0.72);
}

html[data-theme="dark"] .task-hero-impact strong {
  color: var(--ink);
}

html[data-theme="dark"] .operator-hero {
  border: 1px solid var(--line);
  border-left: 8px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .operator-hero.good {
  border-left-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .operator-hero.watch {
  border-left-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .operator-hero.danger {
  border-left-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .operator-hero small,
html[data-theme="dark"] .operator-hero-card small {
  color: var(--muted);
}

html[data-theme="dark"] .operator-hero h3 {
  color: var(--ink);
}

html[data-theme="dark"] .operator-hero p {
  color: #e6ebf1;
}

html[data-theme="dark"] .operator-hero-card {
  border: 1px solid rgba(48,57,67,0.08);
  background: rgba(24,30,37,0.72);
}

html[data-theme="dark"] .operator-hero-card strong {
  color: var(--ink);
}

html[data-theme="dark"] .operator-hero-card em {
  color: var(--muted);
}

html[data-theme="dark"] .e2-stats-grid article {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .e2-stats-grid small,
html[data-theme="dark"] .e2-stats-note small {
  color: var(--muted);
}

html[data-theme="dark"] .e2-stats-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .e2-stats-grid em {
  color: var(--muted);
}

html[data-theme="dark"] .e2-stats-note {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .e2-stats-note.has-issues {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .e2-stats-note strong {
  color: var(--ink);
}

html[data-theme="dark"] .e2-stats-note p {
  color: var(--muted);
}

html[data-theme="dark"] .e2-stats-note li {
  color: var(--muted);
}

html[data-theme="dark"] .e2-stats-note li span {
  color: var(--ink);
}

html[data-theme="dark"] .task-human-metrics {
  border-top: 1px solid var(--line);
  background: var(--line);
}

html[data-theme="dark"] .task-human-metrics span {
  background: #181e25;
}

html[data-theme="dark"] .task-human-metrics small {
  color: var(--muted);
}

html[data-theme="dark"] .task-human-metrics strong {
  color: var(--ink);
}

html[data-theme="dark"] .task-human-metrics em {
  color: var(--muted);
}

html[data-theme="dark"] .task-section-head p,
html[data-theme="dark"] .task-section-head span {
  color: var(--muted);
}

html[data-theme="dark"] .task-flow-step {
  border: 1px solid var(--line);
  background: #202832;
}

html[data-theme="dark"] .task-flow-dot {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .task-flow-step.done {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .task-flow-step.done .task-flow-dot {
  background: #203a32;
  color: #e6ebf1;
}

html[data-theme="dark"] .task-flow-step.running {
  border-color: #3f5878;
  background: #202832;
}

html[data-theme="dark"] .task-flow-step.running .task-flow-dot {
  background: #26323e;
  color: #e6ebf1;
}

html[data-theme="dark"] .task-flow-step.waiting {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .task-flow-step.waiting .task-flow-dot {
  background: #393122;
  color: #e6ebf1;
}

html[data-theme="dark"] .task-flow-step.failed {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .task-flow-step.failed .task-flow-dot {
  background: #3b242b;
  color: #e6ebf1;
}

html[data-theme="dark"] .task-flow-step small {
  color: var(--muted);
}

html[data-theme="dark"] .task-flow-step strong {
  color: var(--ink);
}

html[data-theme="dark"] .task-flow-step em {
  color: var(--muted);
}

html[data-theme="dark"] .task-action-card {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .task-action-card > span {
  background: #202832;
}

html[data-theme="dark"] .task-action-card.good {
  background: #202832;
}

html[data-theme="dark"] .task-action-card.good > span {
  background: #203a32;
}

html[data-theme="dark"] .task-action-card.info {
  background: #202832;
}

html[data-theme="dark"] .task-action-card.info > span {
  background: #26323e;
}

html[data-theme="dark"] .task-action-card.warning {
  background: #393122;
}

html[data-theme="dark"] .task-action-card.warning > span {
  background: #393122;
}

html[data-theme="dark"] .task-action-card.danger {
  background: #202832;
}

html[data-theme="dark"] .task-action-card.danger > span {
  background: #3b242b;
}

html[data-theme="dark"] .task-action-card.muted {
  background: #202832;
}

html[data-theme="dark"] .task-action-card strong {
  color: var(--ink);
}

html[data-theme="dark"] .task-action-card p {
  color: #a8b3c1;
}

html[data-theme="dark"] .task-action-card small {
  color: var(--muted);
}

html[data-theme="dark"] .task-technical-details {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .task-technical-details > summary {
  color: var(--ink);
}

html[data-theme="dark"] .task-technical-details > summary small {
  color: var(--muted);
}

html[data-theme="dark"] .operator-status-row p,
html[data-theme="dark"] .stats-decision p {
  color: var(--muted);
}

html[data-theme="dark"] .ledger-panel,
html[data-theme="dark"] .maintenance-panel {
  border-bottom: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .task-status-grid span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .task-status-grid span.ok {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .task-status-grid span.running {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .task-status-grid span.error {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .task-status-grid span.unknown {
  background: #202832;
}

html[data-theme="dark"] .task-status-grid small {
  color: var(--muted);
}

html[data-theme="dark"] .task-status-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .task-status-grid em {
  color: var(--muted);
}

html[data-theme="dark"] .task-run-summary strong {
  color: var(--ink);
}

html[data-theme="dark"] .task-run-summary small {
  color: var(--muted);
}

html[data-theme="dark"] .ledger-kpi-grid span,
html[data-theme="dark"] .ledger-visual-grid > div,
html[data-theme="dark"] .ledger-progress {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ledger-kpi-grid small {
  color: var(--muted);
}

html[data-theme="dark"] .ledger-kpi-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .ledger-kpi-grid em {
  color: var(--muted);
}

html[data-theme="dark"] .maintenance-plan span,
html[data-theme="dark"] .maintenance-state > div,
html[data-theme="dark"] .maintenance-steps span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .maintenance-plan strong,
html[data-theme="dark"] .maintenance-state strong {
  color: var(--ink);
}

html[data-theme="dark"] .maintenance-plan em,
html[data-theme="dark"] .maintenance-state em,
html[data-theme="dark"] .maintenance-plan small,
html[data-theme="dark"] .maintenance-state small,
html[data-theme="dark"] .maintenance-steps span {
  color: var(--muted);
}

html[data-theme="dark"] .details-panel {
  border-bottom: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .details-panel summary {
  color: var(--ink);
}

html[data-theme="dark"] .details-panel summary small {
  color: var(--muted);
}

html[data-theme="dark"] .compact-details {
  border-bottom: 0;
}

html[data-theme="dark"] .management-details {
  background: #181e25;
}

html[data-theme="dark"] .resource-page-actions {
  background: #181e25;
}

html[data-theme="dark"] .section-toolbar {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .section-toolbar h3 {
  color: var(--accent-dark);
}

html[data-theme="dark"] .secondary-button {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .secondary-button:hover {
  background: #202832;
}

html[data-theme="dark"] .muted-text {
  color: var(--muted);
}

html[data-theme="dark"] .flat-block {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .health-card {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .health-card div span {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .health-card.ok div span {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .health-card.warning div span {
  background: #393122;
  color: var(--warn);
}

html[data-theme="dark"] .health-card.unconfigured div span {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .health-card.error div span {
  background: #202832;
  color: var(--bad);
}

html[data-theme="dark"] .emby-refresh-block {
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .emby-media-info-block {
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .refresh-status-grid span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .refresh-status-grid small {
  color: var(--muted);
}

html[data-theme="dark"] .refresh-status-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-human-block {
  border-left: 3px solid var(--accent);
}

html[data-theme="dark"] .xcdn-overview-grid section {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-cost-policy-card {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-cost-policy-head p {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-cost-toggle {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-cost-priority-grid > label {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-cost-priority-grid > label small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-cost-policy-actions small,
html[data-theme="dark"] .xcdn-cost-decision-status {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-cost-decision-status {
  border-top: 1px solid #365d4d;
}

html[data-theme="dark"] .xcdn-policy-grid section {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-policy-grid h4 {
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-policy-steps span {
  border: 1px solid var(--line);
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-overview-grid h4 {
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-overview-list > div,
html[data-theme="dark"] .xcdn-overview-node {
  border: 1px solid var(--line);
  background: #202832;
}

html[data-theme="dark"] .xcdn-overview-list small,
html[data-theme="dark"] .xcdn-overview-node small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-overview-node.ok {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-overview-node.warning {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .xcdn-overview-node.failed {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .xcdn-ops-hero {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-ops-hero.ok {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-ops-hero.watch {
  border-color: #303943;
  background: #202832;
}

html[data-theme="dark"] .xcdn-ops-hero.warning {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .xcdn-ops-hero strong {
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-ops-hero small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-details {
  background: #202832;
}

html[data-theme="dark"] .xcdn-details summary::after {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-details[open] summary {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .xcdn-details summary small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-summary-grid > span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .domain-ledger-filter {
  color: var(--muted);
}

html[data-theme="dark"] .domain-ledger-table td small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-summary-grid small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-summary-grid em {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-category-card {
  border: 1px solid #303943;
  background: #181e25;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .xcdn-node-category-card:hover {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-category-card.selected {
  border-color: #365d4d;
  background: linear-gradient(135deg, #202832, #202832);
  box-shadow: 0 8px 20px rgba(7,10,14,0.1);
}

html[data-theme="dark"] .xcdn-node-category-icon {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .xcdn-node-category-card.selected .xcdn-node-category-icon {
  background: var(--accent);
  color: #e6ebf1;
}

html[data-theme="dark"] .xcdn-node-category-copy small,
html[data-theme="dark"] .xcdn-node-category-facts em {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-category-content {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-section-head {
  border-bottom: 1px solid #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-node-section-head h4,
html[data-theme="dark"] .xcdn-node-members-head h5 {
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-node-section-head p,
html[data-theme="dark"] .xcdn-node-members-head p {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-eyebrow {
  color: var(--accent);
}

html[data-theme="dark"] .xcdn-node-group-card {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 4px 14px rgba(7,10,14,0.045);
}

html[data-theme="dark"] .xcdn-node-group-card::before {
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-group-card.ok::before {
  background: #203a32;
}

html[data-theme="dark"] .xcdn-node-group-card.warning::before {
  background: #393122;
}

html[data-theme="dark"] .xcdn-node-group-card.expanded {
  border-color: #365d4d;
  box-shadow: 0 10px 28px rgba(7,10,14,0.09);
}

html[data-theme="dark"] .xcdn-node-group-toggle {
  border: 0;
  background: transparent;
  color: var(--ink);
}

html[data-theme="dark"] .xcdn-node-group-toggle:hover {
  background: #181e25;
}

html[data-theme="dark"] .xcdn-node-group-head small,
html[data-theme="dark"] .xcdn-node-group-place,
html[data-theme="dark"] .xcdn-node-group-kpis small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-group-kpis {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-group-kpis > span {
  border-right: 1px solid #303943;
}

html[data-theme="dark"] .xcdn-node-group-kpis > span:last-child {
  border-right: 0;
}

html[data-theme="dark"] .xcdn-node-eligibility {
  border: 1px solid #303943;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .xcdn-node-eligibility.allowed {
  border-color: #365d4d;
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .xcdn-node-eligibility.blocked {
  border-color: #303943;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .xcdn-node-cost {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-expand-label {
  color: var(--accent);
}

html[data-theme="dark"] .xcdn-node-group-detail {
  border-top: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-detail-summary {
  border: 1px solid #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-node-detail-summary > span {
  border-right: 1px solid #303943;
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .xcdn-node-detail-summary > span:nth-child(3n) {
  border-right: 0;
}

html[data-theme="dark"] .xcdn-node-detail-summary > span:nth-last-child(-n + 3) {
  border-bottom: 0;
}

html[data-theme="dark"] .xcdn-node-detail-summary small,
html[data-theme="dark"] .xcdn-node-member-meta small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-detail-summary em,
html[data-theme="dark"] .xcdn-node-member-meta em {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-fact-note {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .xcdn-node-fact-note.warning {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .xcdn-node-fact-note p {
  color: #a8b3c1;
}

html[data-theme="dark"] .xcdn-node-member-card {
  border: 1px solid #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-node-member-card.ok {
  border-top: 3px solid #365d4d;
}

html[data-theme="dark"] .xcdn-node-member-card.warning {
  border-top: 3px solid #72603c;
}

html[data-theme="dark"] .xcdn-node-member-card.unknown {
  border-top: 3px solid #303943;
}

html[data-theme="dark"] .xcdn-node-member-card header {
  border-bottom: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-node-member-card header small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-node-member-meta > span {
  border-right: 1px solid #303943;
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .xcdn-node-member-meta > span:nth-child(2n) {
  border-right: 0;
}

html[data-theme="dark"] .xcdn-node-member-meta > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

html[data-theme="dark"] .xcdn-node-member-card footer {
  border-top: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-isif-capacity-editor {
  border: 1px solid #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .xcdn-isif-capacity-grid > label span {
  color: var(--muted);
}

@media (max-width: 760px) {
html[data-theme="dark"] .xcdn-node-group-kpis > span,
html[data-theme="dark"] .xcdn-node-detail-summary > span,
html[data-theme="dark"] .xcdn-node-member-meta > span {
  border-right: 0;
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .xcdn-node-group-kpis > span:last-child,
html[data-theme="dark"] .xcdn-node-detail-summary > span:last-child,
html[data-theme="dark"] .xcdn-node-member-meta > span:last-child {
  border-bottom: 0;
}
}

html[data-theme="dark"] .bunny-speedtest-table td > small {
  color: var(--muted);
}

html[data-theme="dark"] .bunny-speedtest-result {
  border: 1px solid var(--line);
  background: #202832;
}

html[data-theme="dark"] .bunny-speedtest-result.is-observation {
  border-color: #3f5878;
  background: #202832;
}

html[data-theme="dark"] .bunny-speedtest-result b {
  color: var(--ink);
}

html[data-theme="dark"] .bunny-speedtest-result b.bad {
  color: var(--bad);
}

html[data-theme="dark"] .bunny-speedtest-result small {
  color: var(--muted);
}

html[data-theme="dark"] .bunny-provider-table td > small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-source-stats-panel {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .traffic-dashboard-shell {
  background: #202832;
}

html[data-theme="dark"] .traffic-chart-card {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 8px 24px rgba(7,10,14,0.06);
}

html[data-theme="dark"] .traffic-chart-card h4 {
  color: #e6ebf1;
}

html[data-theme="dark"] .traffic-chart-actions button,
html[data-theme="dark"] .traffic-chart-tag {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
  box-shadow: 0 6px 16px rgba(7,10,14,0.06);
}

html[data-theme="dark"] .traffic-chart-actions button:hover,
html[data-theme="dark"] .traffic-chart-actions button:focus-visible,
html[data-theme="dark"] .traffic-footer-actions button:hover,
html[data-theme="dark"] .traffic-footer-actions button:focus-visible,
html[data-theme="dark"] .traffic-detail-heading button:hover,
html[data-theme="dark"] .traffic-detail-heading button:focus-visible {
  border-color: #303943;
  background: #202832;
  outline: none;
}

html[data-theme="dark"] .traffic-chart-actions button.active {
  border-color: #3f5878;
  background: #202832;
  color: #99bcf8;
}

html[data-theme="dark"] .traffic-dashboard-footer {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 8px 24px rgba(7,10,14,0.05);
}

html[data-theme="dark"] .traffic-footer-metrics small {
  color: #a8b3c1;
}

html[data-theme="dark"] .traffic-footer-metrics strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .traffic-footer-metrics p {
  color: #a8b3c1;
}

html[data-theme="dark"] .traffic-footer-actions button,
html[data-theme="dark"] .traffic-detail-heading button {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .traffic-detail-dialog {
  border: 0;
  background: #181e25;
  box-shadow: 0 24px 80px rgba(7,10,14,0.25);
}

html[data-theme="dark"] .traffic-detail-dialog::backdrop {
  background: rgba(20,28,37,0.42);
}

html[data-theme="dark"] .traffic-detail-heading small {
  color: #a8b3c1;
}

html[data-theme="dark"] .traffic-detail-heading h3 {
  color: #e6ebf1;
}

html[data-theme="dark"] .traffic-detail-table-wrap tr.selected td {
  background: #202f43;
}

html[data-theme="dark"] .server-ledger-summary > span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .server-ledger-summary small,
html[data-theme="dark"] .server-ledger-summary em {
  color: var(--muted);
}

html[data-theme="dark"] .server-ledger-summary strong {
  color: var(--ink);
}

html[data-theme="dark"] .server-node-card {
  border: 1px solid var(--line);
  border-left: 5px solid #303943;
  background: #181e25;
  box-shadow: 0 10px 24px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .server-node-card.ok {
  border-left-color: #365d4d;
}

html[data-theme="dark"] .server-node-card.warning {
  border-left-color: #72603c;
}

html[data-theme="dark"] .server-node-card.failed {
  border-left-color: #70464b;
}

html[data-theme="dark"] .server-node-card.unknown {
  border-left-color: #303943;
}

html[data-theme="dark"] .server-node-topline strong {
  color: var(--ink);
}

html[data-theme="dark"] .server-node-topline small {
  color: var(--muted);
}

html[data-theme="dark"] .server-node-quick span,
html[data-theme="dark"] .server-detail-grid span {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .server-node-quick small,
html[data-theme="dark"] .server-detail-grid small {
  color: var(--muted);
}

html[data-theme="dark"] .server-node-quick b,
html[data-theme="dark"] .server-detail-grid b {
  color: var(--ink);
}

html[data-theme="dark"] .server-node-details summary {
  border: 1px solid #365d4d;
  color: var(--accent-dark);
}

html[data-theme="dark"] .server-node-details summary::before {
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

html[data-theme="dark"] .server-node-details summary small {
  color: var(--muted);
}

html[data-theme="dark"] .server-node-note {
  border: 1px solid #303943;
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .profile-node + .profile-node {
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .profile-node strong {
  color: var(--ink);
}

html[data-theme="dark"] .profile-node small {
  color: var(--muted);
}

html[data-theme="dark"] .quality-pill {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--ink);
}

html[data-theme="dark"] .quality-pill small {
  color: var(--muted);
}

html[data-theme="dark"] .quality-pill.ok {
  border-color: #365d4d;
  background: #202832;
}

html[data-theme="dark"] .quality-pill.warning {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .quality-pill.failed {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .quality-pill.unknown {
  background: #202832;
}

html[data-theme="dark"] .xcdn-quality-dialog {
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .xcdn-quality-dialog::backdrop {
  background: rgba(20,28,37,0.48);
}

html[data-theme="dark"] .xcdn-quality-panel {
  border: 1px solid var(--line);
  background: #181e25;
  box-shadow: 0 22px 70px rgba(7,10,14,0.22);
}

html[data-theme="dark"] .xcdn-quality-summary span {
  border: 1px solid var(--line);
  background: #202832;
}

html[data-theme="dark"] .xcdn-quality-summary small {
  color: var(--muted);
}

html[data-theme="dark"] .current-quality-row {
  background: #202832;
}

html[data-theme="dark"] .inline-details summary {
  color: var(--accent-dark);
}

html[data-theme="dark"] .inline-details ul {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-alert-card {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .xcdn-alert-card summary small {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-alert-detail {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-alert-detail li small,
html[data-theme="dark"] .xcdn-alert-detail li em {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-policy-grid article,
html[data-theme="dark"] .xcdn-template-grid article,
html[data-theme="dark"] .xcdn-agent-grid article {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .policy-head span {
  background: var(--soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .xcdn-policy-grid dt {
  color: var(--muted);
}

html[data-theme="dark"] .xcdn-template-grid pre {
  border: 1px solid var(--line);
  background: #141c25;
  color: #8391a2;
}

html[data-theme="dark"] .xcdn-log-source {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .xcdn-log-source:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .xcdn-log-source code {
  color: var(--accent-dark);
}

html[data-theme="dark"] .queue-tab {
  border-color: var(--line);
  background: #181e25;
  color: var(--ink);
}

html[data-theme="dark"] .queue-tab:hover,
html[data-theme="dark"] .queue-tab.active {
  border-color: rgba(54,93,77,0.45);
  background: var(--soft);
}

html[data-theme="dark"] .queue-tab strong {
  background: var(--soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .manual-automation-health span {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .manual-automation-health span.warn {
  border-color: rgba(114,96,60,0.35);
  background: #202832;
}

html[data-theme="dark"] .manual-automation-health small {
  color: var(--muted);
}

html[data-theme="dark"] .queue-tab.active strong {
  background: #181e25;
}

html[data-theme="dark"] .queue-table-wrap {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .request-next-step,
html[data-theme="dark"] .request-handoff-status {
  border: 1px solid rgba(63,88,120,0.24);
  background: #202832;
}

html[data-theme="dark"] .request-handoff-status {
  border-color: rgba(54,93,77,0.28);
  background: #202832;
}

html[data-theme="dark"] .request-handoff-status.needs-attention {
  border-color: rgba(112,70,75,0.32);
  background: #202832;
}

html[data-theme="dark"] .request-next-step small,
html[data-theme="dark"] .request-handoff-status small {
  color: var(--muted);
}

html[data-theme="dark"] #request-work-detail .request-queue-table .request-current-detail {
  border: 1px solid rgba(63,88,120,0.26);
  background: #202832;
}

html[data-theme="dark"] #request-work-detail .request-queue-table .request-current-detail strong {
  color: var(--ink);
}

html[data-theme="dark"] .manual-ops-cell small {
  color: var(--muted);
}

html[data-theme="dark"] .manual-issues-cell small,
html[data-theme="dark"] .manual-decision-cell small {
  color: var(--muted);
}

html[data-theme="dark"] .manual-issue-list li::before {
  color: var(--ink);
}

html[data-theme="dark"] .manual-issue-title {
  color: var(--ink);
}

html[data-theme="dark"] .manual-flow-chip {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .manual-flow-chip.done {
  border-color: rgba(54,93,77,0.28);
  background: #202832;
  color: var(--accent-dark);
}

html[data-theme="dark"] .manual-flow-chip.current {
  border-color: rgba(63,88,120,0.32);
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .manual-flow-chip.warn {
  border-color: rgba(114,96,60,0.32);
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .manual-source-chip {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .manual-source-chip.request {
  border-color: rgba(112,70,75,0.3);
  background: #202832;
  color: #ef9292;
}

html[data-theme="dark"] .manual-source-chip.manual {
  border-color: rgba(54,93,77,0.28);
  background: #202832;
  color: var(--accent-dark);
}

html[data-theme="dark"] .manual-source-chip.migration {
  border-color: rgba(114,96,60,0.32);
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] #auto-upload-detail .manual-queue-table .manual-current-detail {
  border: 1px solid rgba(63,88,120,0.26);
  background: #202832;
}

html[data-theme="dark"] #auto-upload-detail .manual-queue-table .manual-current-detail strong {
  color: var(--ink);
}

html[data-theme="dark"] .manual-subtitle-summary progress {
  accent-color: #26323e;
}

html[data-theme="dark"] .manual-subtitle-summary .manual-subtitle-secondary {
  color: var(--muted);
}

html[data-theme="dark"] .manual-subtitle-summary details {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .manual-subtitle-summary summary {
  color: #a8b3c1;
}

html[data-theme="dark"] .manual-step-target span,
html[data-theme="dark"] .manual-step-target small {
  color: var(--muted);
}

html[data-theme="dark"] .manual-step-target .manual-replace-badge {
  color: #e8b967;
}

html[data-theme="dark"] .manual-step-target strong {
  color: var(--ink);
}

html[data-theme="dark"] #request-work-detail .request-queue-table .manual-flow-chip {
  box-shadow: none;
}

html[data-theme="dark"] #auto-upload-detail .manual-queue-table .manual-flow-chip {
  box-shadow: none;
}

html[data-theme="dark"] .request-issue-number {
  color: var(--ink);
}

html[data-theme="dark"] .request-issue strong {
  color: var(--ink);
}

html[data-theme="dark"] .request-issue small {
  color: var(--muted);
}

html[data-theme="dark"] .request-candidate-links {
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .request-candidate-links > strong {
  color: var(--ink);
}

html[data-theme="dark"] .request-candidate-links a {
  border: 1px solid #3f5878;
  background: #202832;
  color: #99bcf8;
}

html[data-theme="dark"] .request-candidate-links a:hover {
  border-color: #3f5878;
  background: #202f43;
}

html[data-theme="dark"] .request-candidate-links a small {
  color: #a8b3c1;
}

html[data-theme="dark"] .request-type-summary,
html[data-theme="dark"] .request-type-details summary {
  color: var(--ink);
}

html[data-theme="dark"] .request-type-details.is-upgrade summary {
  color: #e8b967;
}

html[data-theme="dark"] .request-type-details dl {
  border: 1px solid #72603c;
  background: #393122;
  box-shadow: 0 16px 36px rgba(7,10,14,0.16);
}

html[data-theme="dark"] .request-type-details dt {
  color: #e8b967;
}

html[data-theme="dark"] .request-type-details dd {
  color: var(--muted);
}

html[data-theme="dark"] .queue-work-link {
  color: var(--accent);
}

html[data-theme="dark"] .queue-work-link:hover {
  color: var(--accent-dark);
}

html[data-theme="dark"] .queue-work-link:focus-visible {
  outline: 2px solid var(--accent);
}

html[data-theme="dark"] .inline-actions button {
  border-color: var(--line);
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .inline-actions .danger-inline {
  color: var(--bad);
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(20,28,37,0.34);
}

html[data-theme="dark"] .action-modal {
  border: 1px solid var(--line);
  background: #181e25;
  box-shadow: 0 24px 80px rgba(7,10,14,0.22);
}

html[data-theme="dark"] .confirm-stack dt {
  color: var(--muted);
}

html[data-theme="dark"] .confirm-stack .inline-input {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .tmdb-link-modal label {
  color: var(--text);
}

html[data-theme="dark"] .tmdb-link-modal textarea {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--text);
}

html[data-theme="dark"] .tmdb-link-modal textarea:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme="dark"] .request-torrent-import label {
  color: var(--muted);
}

html[data-theme="dark"] .request-torrent-import input[type="file"] {
  border: 1px solid var(--line);
  color: var(--text);
}

html[data-theme="dark"] .series-episode-checkbox {
  border: 1px solid var(--border);
  background: var(--surface-soft, #f7f9fb);
}

html[data-theme="dark"] .directory-list {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .directory-item {
  border-color: var(--line);
  background: #181e25;
  color: var(--ink);
}

html[data-theme="dark"] .empty-state {
  border: 1px dashed var(--line);
  color: var(--muted);
}

html[data-theme="dark"] .model-candidates article {
  border: 1px solid var(--tier-border, var(--line));
  background: var(--tier-bg, #fbfcfd);
  box-shadow: inset 4px 0 0 var(--tier-accent, var(--accent));
}

html[data-theme="dark"] .ai-model-card-head strong {
  color: var(--ink);
}

html[data-theme="dark"] .ai-model-card-badges em {
  border: 1px solid rgba(114,96,60,0.2);
  background: rgba(24,30,37,0.78);
  color: #e8b967;
}

html[data-theme="dark"] .ai-model-card-status {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-model-card-status::before {
  background: currentColor;
}

html[data-theme="dark"] .ai-model-card-status.is-ready {
  border-color: #365d4d;
  color: #62cda3;
  box-shadow: 0 0 0 2px rgba(7,10,14,0.1);
}

html[data-theme="dark"] .ai-model-card-status.is-missing {
  border-color: #72603c;
  color: #e8b967;
}

html[data-theme="dark"] .ai-model-card-status.is-off {
  border-color: #303943;
  color: #a8b3c1;
}

html[data-theme="dark"] .ai-provider-inline {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-workflow-title h4 {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-workflow-title span {
  color: var(--muted);
}

html[data-theme="dark"] .ai-flow-step {
  border: 2px solid var(--tier-border, var(--line));
  background: var(--tier-bg, #fff);
  box-shadow: inset 4px 0 0 var(--tier-accent, transparent);
}

html[data-theme="dark"] .ai-flow-step span,
html[data-theme="dark"] .ai-flow-step em {
  color: var(--muted);
}

html[data-theme="dark"] .ai-model-select {
  border-color: var(--tier-border, var(--line));
  background: var(--tier-bg, #fff);
}

html[data-theme="dark"] .ai-budget-panel span {
  color: var(--muted);
}

html[data-theme="dark"] .ai-budget-input-row strong {
  color: var(--muted);
}

html[data-theme="dark"] .ai-consumed-amount strong,
html[data-theme="dark"] .ai-period-cost > strong {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--ink);
}

html[data-theme="dark"] .ai-billing-overview span,
html[data-theme="dark"] .ai-billing-overview small {
  color: var(--muted);
}

html[data-theme="dark"] .ai-period-tabs button {
  border: 1px solid var(--line);
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-period-tabs button.active {
  border-color: #365d4d;
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .ai-billing-overview small.estimated {
  color: #e8b967;
}

html[data-theme="dark"] .ai-usage-card {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-usage-card-head h4 {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-usage-card-head span {
  color: var(--muted);
}

html[data-theme="dark"] .ai-usage-current-model span,
html[data-theme="dark"] .ai-usage-current-model strong {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .ai-usage-current-model span {
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-usage-current-model strong {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-usage-metrics div {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-usage-metrics span {
  color: var(--muted);
}

html[data-theme="dark"] .ai-usage-metrics strong {
  color: var(--ink);
}

html[data-theme="dark"] .ai-usage-note {
  color: var(--muted);
}

html[data-theme="dark"] .ai-usage-operation-note {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-usage-empty {
  border: 1px dashed var(--line);
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-chat-block {
  background: #202832;
}

html[data-theme="dark"] .ai-governor-section-title {
  color: #62cda3;
}

html[data-theme="dark"] .ai-governor-section-title h3,
html[data-theme="dark"] .ai-governor-section-title span:last-child {
  color: inherit;
}

html[data-theme="dark"] .ai-governor-title-mark {
  background: #203a32;
  box-shadow: 0 0 0 3px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .ai-governor-self-status {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .ai-governor-self-status::before {
  background: currentColor;
}

html[data-theme="dark"] .ai-governor-self-status span {
  color: inherit;
}

html[data-theme="dark"] .ai-governor-self-status.normal {
  border-color: #365d4d;
  background: #203a32;
  color: #62cda3;
}

html[data-theme="dark"] .ai-governor-self-status.fault {
  border-color: #70464b;
  background: #3b242b;
  color: #ef9292;
}

html[data-theme="dark"] .ai-governor-self-status.warning {
  border-color: #72603c;
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .ai-governor-self-status.loading {
  border-color: var(--line);
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-self-meta {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-status-strip > p {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-chat-header {
  border-bottom: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-chat-form {
  background: transparent;
}

html[data-theme="dark"] .ai-governor-chat-composer {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 8px 24px rgba(7,10,14,0.08);
}

html[data-theme="dark"] .ai-governor-chat-form textarea {
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .ai-governor-chat-form textarea:focus {
  outline: 0;
  border-color: transparent;
}

html[data-theme="dark"] .ai-governor-chat-log {
  background: #202832;
}

html[data-theme="dark"] .ai-governor-issue-group {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-issue-group.real {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .ai-governor-issue-group.pending {
  border-color: #303943;
  background: #202832;
}

html[data-theme="dark"] .ai-governor-issue-group.noise {
  border-color: #303943;
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-issue-group strong {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-issue-group > div span {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-governor-issue-item {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-issue-item.real {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .ai-governor-issue-item.pending {
  border-color: #303943;
  background: #202832;
}

html[data-theme="dark"] .ai-governor-issue-item.noise {
  border-color: #303943;
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-issue-item b {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-issue-item span {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-governor-issue-item li {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-feedback-summary {
  border: 1px solid rgba(54,93,77,0.18);
  background: rgba(32,58,50,0.72);
}

html[data-theme="dark"] .ai-governor-feedback-summary strong {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-governor-feedback-summary p {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-feedback-summary small {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-feedback-form .secondary-button {
  background: #181e25;
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-bmh-status {
  border: 1px solid var(--line);
}

html[data-theme="dark"] .ai-governor-bmh-status.normal {
  border-color: #365d4d;
  background: #203a32;
  color: #62cda3;
}

html[data-theme="dark"] .ai-governor-bmh-status.warning {
  border-color: #72603c;
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .ai-governor-bmh-status.fault {
  border-color: #70464b;
  background: #3b242b;
  color: #ef9292;
}

html[data-theme="dark"] .ai-governor-bmh-status.loading {
  border-color: var(--line);
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-subsystem,
html[data-theme="dark"] .ai-governor-list-item {
  border: 1px solid var(--line);
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-subsystem.warning,
html[data-theme="dark"] .ai-governor-subsystem.blocked {
  border-color: #72603c;
  background: #393122;
}

html[data-theme="dark"] .ai-governor-subsystem.unknown {
  border-color: #303943;
  background: #202832;
}

html[data-theme="dark"] .ai-governor-subsystem strong,
html[data-theme="dark"] .ai-governor-list-item strong {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-subsystem span,
html[data-theme="dark"] .ai-governor-list-item span {
  color: var(--accent-dark);
}

html[data-theme="dark"] .ai-governor-subsystem p,
html[data-theme="dark"] .ai-governor-list-item p {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-subsystem small,
html[data-theme="dark"] .ai-governor-list-item small,
html[data-theme="dark"] .ai-governor-list-item time {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-list-item.notification {
  border-color: #3f5878;
  background: #202832;
}

html[data-theme="dark"] .ai-governor-chat-message strong,
html[data-theme="dark"] .ai-governor-chat-message small {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-chat-bubble {
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(7,10,14,0.04);
}

html[data-theme="dark"] .ai-governor-chat-section b {
  color: var(--ink);
}

html[data-theme="dark"] .ai-governor-chat-section span {
  color: inherit;
}

html[data-theme="dark"] .ai-governor-chat-message.user .ai-governor-chat-bubble {
  border-color: #365d4d;
  background: #203a32;
}

html[data-theme="dark"] .ai-governor-chat-message.assistant .ai-governor-chat-bubble {
  border-color: #303943;
  background: #181e25;
}

html[data-theme="dark"] .ai-governor-chat-message.pending .ai-governor-chat-bubble {
  color: var(--muted);
}

html[data-theme="dark"] .ai-governor-chat-message.error .ai-governor-chat-bubble {
  border-color: #70464b;
  background: #202832;
  color: var(--bad);
}

html[data-theme="dark"] .ai-governor-work-log summary::before {
  border-right: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
}

html[data-theme="dark"] .check-row {
  color: var(--ink);
}

html[data-theme="dark"] .legacy-xcdn-readonly-notice {
  border: 1px solid #72603c;
  background: #202832;
  color: #e8b967;
}

html[data-theme="dark"] .legacy-xcdn-readonly-notice strong {
  color: #e8b967;
}

html[data-theme="dark"] .legacy-xcdn-readonly-notice small {
  color: #e8b967;
}

html[data-theme="dark"] .direct-window-picker {
  border: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .direct-window-picker > span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-window-picker select {
  border: 0;
  background-color: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-window-picker select:focus-visible {
  outline: 2px solid rgba(48,57,67,0.28);
}

html[data-theme="dark"] .direct-overall-status {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .direct-overall-status i {
  border: 3px solid #365d4d;
  background: var(--direct-green);
}

html[data-theme="dark"] .direct-overall-status small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-overall-status strong {
  color: #62cda3;
}

html[data-theme="dark"] .direct-overall-status.neutral {
  border-color: #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-overall-status.neutral i {
  border-color: #303943;
  background: #26323e;
}

html[data-theme="dark"] .direct-overall-status.neutral small,
html[data-theme="dark"] .direct-overall-status.neutral strong {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-overall-status.problem {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .direct-overall-status.problem i {
  border-color: #70464b;
  background: var(--direct-red);
}

html[data-theme="dark"] .direct-overall-status.problem small,
html[data-theme="dark"] .direct-overall-status.problem strong {
  color: #ef9292;
}

html[data-theme="dark"] .direct-overview-card {
  border: 1px solid var(--direct-border);
  background: var(--direct-surface);
  box-shadow: 0 8px 25px rgba(7,10,14,0.045);
}

html[data-theme="dark"] .direct-overview-card h3 {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-overview-card > header span {
  color: var(--direct-muted);
}

html[data-theme="dark"] .direct-overview-card > header button {
  border: 1px solid #303943;
  background: #181e25;
  box-shadow: 0 3px 9px rgba(7,10,14,0.05);
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-overview-card > header button:hover,
html[data-theme="dark"] .direct-overview-card > header button:focus-visible {
  border-color: #303943;
  background: #202832;
  outline: 0;
}

html[data-theme="dark"] .direct-chart-empty {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-chart-empty strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-overview-card.unavailable {
  background: #181e25;
}

html[data-theme="dark"] .direct-pie-base {
  fill: none;
  stroke: #e6ebf1;
}

html[data-theme="dark"] .direct-pie-segment:hover,
html[data-theme="dark"] .direct-pie-segment:focus {
  outline: none;
}

html[data-theme="dark"] .direct-pie-center-value {
  fill: #e6ebf1;
}

html[data-theme="dark"] .direct-pie-center-label {
  fill: #a8b3c1;
}

html[data-theme="dark"] .direct-pie-callout-line {
  fill: none;
}

html[data-theme="dark"] .direct-pie-callout-name {
  fill: #e6ebf1;
}

html[data-theme="dark"] .direct-pie-callout-detail {
  fill: #a8b3c1;
}

html[data-theme="dark"] .direct-pie-tooltip {
  border: 1px solid rgba(48,57,67,0.18);
  background: rgba(24,30,37,0.98);
  box-shadow: 0 8px 24px rgba(7,10,14,0.16);
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-pie-tooltip strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-overview-card > footer {
  border-top: 1px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .direct-overview-card > footer strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-overview-card > footer span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-trend-legend span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-trend-legend span::before {
  background: #26323e;
}

html[data-theme="dark"] .direct-trend-legend span.traffic::before {
  background: #393122;
}

html[data-theme="dark"] .direct-overview-trend-grid {
  stroke: #e6ebf1;
}

html[data-theme="dark"] .direct-overview-trend-axis {
  fill: #a8b3c1;
}

html[data-theme="dark"] .direct-overview-trend-line {
  fill: none;
}

html[data-theme="dark"] .direct-overview-trend-line.sessions {
  stroke: #a8b3c1;
}

html[data-theme="dark"] .direct-overview-trend-line.traffic {
  stroke: #e8b967;
}

html[data-theme="dark"] .direct-overview-trend-point {
  stroke: #e6ebf1;
}

html[data-theme="dark"] .direct-overview-trend-point.sessions {
  fill: #a8b3c1;
}

html[data-theme="dark"] .direct-overview-trend-point.traffic {
  fill: #e8b967;
}

html[data-theme="dark"] .direct-status-strip {
  border: 1px solid var(--direct-border);
  background: var(--direct-surface);
  box-shadow: 0 8px 28px rgba(7,10,14,0.045);
}

html[data-theme="dark"] .direct-status-strip > div {
  border-left: 1px solid var(--direct-border);
}

html[data-theme="dark"] .direct-status-strip > div:first-child {
  border-left: 0;
}

html[data-theme="dark"] .direct-status-strip > div.healthy {
  background: #202832;
}

html[data-theme="dark"] .direct-status-strip > div.watch {
  background: #202832;
}

html[data-theme="dark"] .direct-status-strip small,
html[data-theme="dark"] .direct-status-strip em {
  color: var(--direct-muted);
}

html[data-theme="dark"] .direct-status-strip strong {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-status-dot {
  border: 4px solid #365d4d;
  background: var(--direct-green);
}

html[data-theme="dark"] .direct-kpi-grid article {
  border: 1px solid var(--direct-border);
  background: var(--direct-surface);
}

html[data-theme="dark"] .direct-kpi-grid article.good {
  border-top: 3px solid #365d4d;
}

html[data-theme="dark"] .direct-kpi-grid article.watch {
  border-top: 3px solid #72603c;
}

html[data-theme="dark"] .direct-kpi-grid header span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-kpi-grid header b {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .direct-kpi-grid article.watch header b {
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .direct-kpi-grid article > strong {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-kpi-grid article > small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-mini-trend.up {
  color: var(--direct-green);
}

html[data-theme="dark"] .direct-mini-trend.down {
  color: var(--direct-red);
}

html[data-theme="dark"] .direct-kpi-unit {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-monitor-card {
  border: 1px solid var(--direct-border);
  background: var(--direct-surface);
  box-shadow: 0 7px 22px rgba(7,10,14,0.035);
}

html[data-theme="dark"] .direct-card-heading {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .direct-card-heading h3 {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-card-heading span {
  color: var(--direct-muted);
}

html[data-theme="dark"] .direct-card-heading > strong {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-card-heading > strong.direct-all-good {
  color: var(--direct-green);
}

html[data-theme="dark"] .direct-chart-legend span::before {
  background: var(--direct-green);
}

html[data-theme="dark"] .direct-chart-legend span.stall::before {
  background: #393122;
}

html[data-theme="dark"] .direct-chart-axis {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-chart-grid line {
  stroke: #e6ebf1;
}

html[data-theme="dark"] .direct-chart-area {
  fill: url("#direct-success-fill");
}

html[data-theme="dark"] .direct-chart-line {
  fill: none;
}

html[data-theme="dark"] .direct-chart-line--success {
  stroke: var(--direct-green);
}

html[data-theme="dark"] .direct-chart-line--stall {
  stroke: #e8b967;
}

html[data-theme="dark"] .direct-chart-times {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-count-badge,
html[data-theme="dark"] .direct-table-count {
  background: #202832;
  color: var(--direct-purple);
}

html[data-theme="dark"] .direct-event-controls label > span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-event-controls select {
  border: 1px solid #303943;
  background: #181e25;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-incident-table td:last-child strong {
  color: #e8b967;
}

html[data-theme="dark"] .direct-alert-list article {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .direct-alert-list article:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .direct-alert-list i {
  background: #26323e;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.1);
}

html[data-theme="dark"] .direct-alert-list article.critical i {
  background: var(--direct-red);
  box-shadow: 0 0 0 4px rgba(7,10,14,0.11);
}

html[data-theme="dark"] .direct-alert-list article.warning i {
  background: var(--direct-amber);
  box-shadow: 0 0 0 4px rgba(7,10,14,0.11);
}

html[data-theme="dark"] .direct-alert-list strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-alert-list p {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-alert-list time {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-distribution-bar {
  background: #202832;
}

html[data-theme="dark"] .direct-distribution-bar span.isif,
html[data-theme="dark"] .direct-distribution-list i.isif {
  background: #203a32;
}

html[data-theme="dark"] .direct-distribution-bar span.gm,
html[data-theme="dark"] .direct-distribution-list i.gm {
  background: #26323e;
}

html[data-theme="dark"] .direct-distribution-bar span.bwg,
html[data-theme="dark"] .direct-distribution-list i.bwg {
  background: #393122;
}

html[data-theme="dark"] .direct-distribution-bar span.bunny,
html[data-theme="dark"] .direct-distribution-list i.bunny {
  background: #26323e;
}

html[data-theme="dark"] .direct-distribution-list b {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-distribution-list strong {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-heartbeat-grid > div {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-heartbeat-grid span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-heartbeat-grid i {
  background: var(--direct-green);
  box-shadow: 0 0 0 3px rgba(7,10,14,0.1);
}

html[data-theme="dark"] .direct-heartbeat-grid strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-heartbeat-grid small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-filterbar {
  border: 1px solid var(--direct-border);
  background: var(--direct-soft);
}

html[data-theme="dark"] .direct-filterbar label > span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-filterbar select,
html[data-theme="dark"] .direct-filterbar input {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-filterbar input:disabled {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-filter-note {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-compact-kpis article {
  border: 1px solid var(--direct-border);
  background: #181e25;
}

html[data-theme="dark"] .direct-compact-kpis article.watch {
  border-color: #72603c;
  background: #202832;
}

html[data-theme="dark"] .direct-compact-kpis span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-compact-kpis strong {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-compact-kpis small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-monitor-table th,
html[data-theme="dark"] .direct-monitor-table td {
  border-bottom: 1px solid #303943;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-monitor-table th {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-monitor-table tbody tr:last-child td {
  border-bottom: 0;
}

html[data-theme="dark"] .direct-monitor-table tbody tr.watch {
  background: #202832;
}

html[data-theme="dark"] .direct-monitor-table td strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-monitor-table td small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-state {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-state.good {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .direct-state.watch {
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .direct-state.neutral {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-state.bad {
  background: #3b242b;
  color: #ef9292;
}

html[data-theme="dark"] .direct-monitor-table tbody tr.critical {
  background: #202832;
}

html[data-theme="dark"] .direct-rescue-bars span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-rescue-bars b {
  background: #202832;
}

html[data-theme="dark"] .direct-rescue-bars b i {
  background: #203a32;
}

html[data-theme="dark"] .direct-rescue-bars strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-evidence-grid > div {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-evidence-grid strong {
  color: var(--direct-ink);
}

html[data-theme="dark"] .direct-evidence-grid span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-evidence-grid small {
  color: #a8b3c1;
}

html[data-theme="dark"] .fixed-entry-node {
  border: 1px solid var(--border,#dce2e8);
  background: var(--panel,#fff);
}

html[data-theme="dark"] .fixed-entry-node small {
  color: var(--muted,#6b7280);
}

html[data-theme="dark"] .fixed-entry-usage {
  color: var(--muted,#6b7280);
}

html[data-theme="dark"] .fixed-entry-timing {
  border-top: 1px solid var(--border,#dce2e8);
}

html[data-theme="dark"] .fixed-entry-node footer {
  border-top: 1px solid var(--border,#dce2e8);
  color: var(--muted,#6b7280);
}

html[data-theme="dark"] .direct-fixed-entry-card {
  border-left: 4px solid #365d4d;
}

html[data-theme="dark"] .direct-entry-health > div {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-entry-health span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-entry-health strong {
  color: #62cda3;
}

html[data-theme="dark"] .direct-entry-health small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-entry-chain {
  background: #202832;
}

html[data-theme="dark"] .direct-entry-chain span {
  border: 1px solid #303943;
  background: #181e25;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-entry-chain span.active {
  border-color: #365d4d;
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .direct-entry-chain b {
  color: #8391a2;
}

html[data-theme="dark"] .direct-member-list > div {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .direct-member-list > div:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .direct-member-list i {
  background: var(--direct-green);
}

html[data-theme="dark"] .direct-member-list .watch i {
  background: var(--direct-amber);
}

html[data-theme="dark"] .direct-member-list .offline i {
  background: #202832;
}

html[data-theme="dark"] .direct-member-list .offline strong,
html[data-theme="dark"] .direct-member-list .offline b {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-member-list strong,
html[data-theme="dark"] .direct-member-list b {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-member-list small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-check-list span {
  border-bottom: 1px solid #303943;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-check-list span:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .direct-check-list i {
  background: #202832;
  color: var(--direct-green);
}

html[data-theme="dark"] .direct-change-timeline li {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .direct-change-timeline li:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .direct-change-timeline time {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-change-timeline li > i {
  background: #26323e;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.09);
}

html[data-theme="dark"] .direct-change-timeline li.rescue > i {
  background: var(--direct-green);
}

html[data-theme="dark"] .direct-change-timeline li.watch > i {
  background: var(--direct-amber);
}

html[data-theme="dark"] .direct-change-timeline strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-change-timeline p {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-change-timeline li > span {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-scope-strip {
  border: 1px solid var(--direct-border);
  background: #181e25;
  box-shadow: 0 8px 28px rgba(7,10,14,0.045);
}

html[data-theme="dark"] .direct-scope-strip > div {
  border-left: 1px solid var(--direct-border);
}

html[data-theme="dark"] .direct-scope-strip > div:first-child {
  border-left: 0;
}

html[data-theme="dark"] .direct-scope-strip .direct-scope-primary {
  background: #202832;
}

html[data-theme="dark"] .direct-scope-strip span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-scope-strip strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-scope-strip small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-page-purpose {
  border: 1px solid #303943;
  border-left: 5px solid var(--direct-purple);
  background: linear-gradient(100deg, #202832, #181e25);
}

html[data-theme="dark"] .direct-page-purpose strong {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-page-purpose p {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-page-purpose > span {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-segment-switcher {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-segment-switcher button {
  border: 0;
  background: transparent;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-segment-switcher button:hover,
html[data-theme="dark"] .direct-segment-switcher button:focus-visible {
  background: #202832;
  outline: 0;
}

html[data-theme="dark"] .direct-segment-switcher button.active {
  background: #181e25;
  box-shadow: 0 2px 8px rgba(7,10,14,0.11);
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-customer-lookup {
  border-left: 4px solid #303943;
}

html[data-theme="dark"] .direct-lookup-layout label span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-lookup-layout input,
html[data-theme="dark"] .direct-lookup-layout button {
  border: 1px solid #303943;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-lookup-layout p {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-service-contracts {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .direct-service-contracts > div {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-service-contracts span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-service-contracts strong {
  color: #62cda3;
}

html[data-theme="dark"] .direct-service-contracts small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-control-grid article {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-control-grid article.bad {
  border-color: #70464b;
  background: #202832;
}

html[data-theme="dark"] .direct-control-grid span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-control-grid strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-control-grid small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-control-grid em {
  color: #ef9292;
}

html[data-theme="dark"] .direct-control-grid em.good {
  color: #62cda3;
}

html[data-theme="dark"] .direct-control-grid em.neutral {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-severity.critical {
  background: #3b242b;
  color: #ef9292;
}

html[data-theme="dark"] .direct-severity.warning {
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .direct-severity.info {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-protection-strip {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .direct-protection-strip > div {
  border-left: 1px solid #365d4d;
}

html[data-theme="dark"] .direct-protection-strip > div:first-child {
  border-left: 0;
}

html[data-theme="dark"] .direct-protection-strip span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-protection-strip strong {
  color: #62cda3;
}

html[data-theme="dark"] .direct-protection-strip small {
  color: #a8b3c1;
}

@media (max-width: 1380px) {
html[data-theme="dark"] .direct-scope-strip > div:nth-child(odd) {
  border-left: 0;
}

html[data-theme="dark"] .direct-scope-strip > div:nth-child(n + 3) {
  border-top: 1px solid var(--direct-border);
}
}

@media (max-width: 1100px) {
html[data-theme="dark"] .direct-status-strip > div:nth-child(3) {
  border-top: 1px solid var(--direct-border);
  border-left: 0;
}

html[data-theme="dark"] .direct-status-strip > div:nth-child(4) {
  border-top: 1px solid var(--direct-border);
}
}

@media (max-width: 760px) {
html[data-theme="dark"] .direct-scope-strip > div,
html[data-theme="dark"] .direct-scope-strip > div:nth-child(odd),
html[data-theme="dark"] .direct-protection-strip > div {
  border-top: 1px solid var(--direct-border);
  border-left: 0;
}

html[data-theme="dark"] .direct-scope-strip > div:first-child,
html[data-theme="dark"] .direct-protection-strip > div:first-child {
  border-top: 0;
}

html[data-theme="dark"] .direct-status-strip > div,
html[data-theme="dark"] .direct-status-strip > div:nth-child(3),
html[data-theme="dark"] .direct-status-strip > div:nth-child(4) {
  border-top: 1px solid var(--direct-border);
  border-left: 0;
}

html[data-theme="dark"] .direct-status-strip > div:first-child {
  border-top: 0;
}
}

html[data-theme="dark"] .cdn-space-kicker {
  color: #a8b3c1;
}

html[data-theme="dark"] .cdn-window-badge {
  border: 1px solid #303943;
  background: #181e25;
  color: #a8b3c1;
}

html[data-theme="dark"] .cdn-space-header h2 {
  color: #e6ebf1;
}

html[data-theme="dark"] .cdn-space-badge {
  border: 1px solid;
}

html[data-theme="dark"] .cdn-space-badge--trial {
  border-color: #303943;
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .cdn-space-badge--trial i {
  background: #26323e;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.12);
}

html[data-theme="dark"] .cdn-node-pill.isif {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .cdn-node-pill.gm {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .cdn-node-pill.bwg {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .cdn-node-pill.bunny {
  background: #393122;
  color: #e8b967;
}

html[data-theme="dark"] .rss-summary {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .rss-summary span {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .rss-summary strong {
  color: var(--ink);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] th {
  color: var(--muted);
  background: #202832;
}

html[data-theme="dark"] .status {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .status.candidate {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .status.duplicate_candidate {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .status.pending_search {
  background: #202f43;
  color: #a8b3c1;
}

html[data-theme="dark"] .status.pending_library_check {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .status.searched,
html[data-theme="dark"] .status.candidates_found,
html[data-theme="dark"] .status.imported {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .status.search_failed,
html[data-theme="dark"] .status.needs_identity,
html[data-theme="dark"] .status.library_check_failed,
html[data-theme="dark"] .status.search_source_missing,
html[data-theme="dark"] .status.no_candidates {
  background: #393122;
  color: var(--warn);
}

html[data-theme="dark"] .status.existing {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .status.downloading {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .status.completed {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .status.stalled,
html[data-theme="dark"] .status.no_speed,
html[data-theme="dark"] .status.disk_low {
  background: #393122;
  color: var(--warn);
}

html[data-theme="dark"] .status.failed {
  background: #202832;
  color: var(--bad);
}

html[data-theme="dark"] .status.duplicate,
html[data-theme="dark"] .status.paused,
html[data-theme="dark"] .status.unknown {
  background: #202832;
  color: var(--muted);
}

html[data-theme="dark"] .status.ok {
  background: #202832;
  color: #62cda3;
}

html[data-theme="dark"] .status.warning {
  background: #393122;
  color: var(--warn);
}

html[data-theme="dark"] .status.needs_review {
  background: #393122;
  color: var(--warn);
}

html[data-theme="dark"] .status.rejected_rule {
  background: #202832;
  color: var(--bad);
}

html[data-theme="dark"] .direct-fixed-access,
html[data-theme="dark"] .direct-fixed-speed-grid article,
html[data-theme="dark"] .direct-fixed-provider-traffic,
html[data-theme="dark"] .direct-physical-node-card {
  border: 1px solid #365d4d;
  background: #202832;
}

html[data-theme="dark"] .direct-fixed-access {
  border-left: 4px solid #365d4d;
}

html[data-theme="dark"] .direct-fixed-access.bad {
  border-left-color: #70464b;
}

html[data-theme="dark"] .direct-fixed-access.neutral {
  border-left-color: #303943;
}

html[data-theme="dark"] .direct-fixed-access > span,
html[data-theme="dark"] .direct-fixed-speed-grid article > span,
html[data-theme="dark"] .direct-fixed-provider-heading small,
html[data-theme="dark"] .direct-fixed-provider-facts small,
html[data-theme="dark"] .direct-provider-strip small,
html[data-theme="dark"] .direct-host-metric-grid small,
html[data-theme="dark"] .direct-node-traffic-row small,
html[data-theme="dark"] .direct-node-capacity small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-fixed-access > strong {
  color: #62cda3;
}

html[data-theme="dark"] .direct-fixed-access > small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-fixed-access > em {
  color: #62cda3;
}

html[data-theme="dark"] .direct-fixed-speed-grid article.unavailable {
  background: #202832;
}

html[data-theme="dark"] .direct-fixed-speed-grid article strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-fixed-speed-grid article small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-fixed-speed-grid article em {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-fixed-provider-traffic {
  background: #181e25;
}

html[data-theme="dark"] .direct-fixed-provider-heading > span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-fixed-provider-heading strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-traffic-progress {
  background: #394653;
}

html[data-theme="dark"] .direct-traffic-progress i {
  background: #62d6a5;
}

html[data-theme="dark"] .direct-fixed-provider-facts strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-region,
html[data-theme="dark"] .direct-provider-strip {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-region > span { color: #a8b3c1; }

html[data-theme="dark"] .direct-node-region:hover,
html[data-theme="dark"] .direct-provider-strip:hover {
  border-color: #365d4d;
}

html[data-theme="dark"] .direct-node-region.active {
  border-color: #62d6a5;
  background: #203a32;
  box-shadow: inset 0 0 0 1px #62d6a5;
}

html[data-theme="dark"] .direct-node-region.active > strong { color: #83e4bb; }

html[data-theme="dark"] .direct-provider-strip.active {
  border-color: #62d6a5;
  background: #203a32;
  box-shadow: inset 4px 0 0 #62d6a5;
}

html[data-theme="dark"] .direct-node-region:focus-visible,
html[data-theme="dark"] .direct-provider-strip:focus-visible { outline-color: #83e4bb; }

html[data-theme="dark"] .direct-provider-strip > b {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-provider-name > i {
  background: #203a32;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.12);
}

html[data-theme="dark"] .direct-provider-strip.active .direct-provider-name > i {
  background: #62d6a5;
  box-shadow: 0 0 0 4px rgba(98, 214, 165, .12);
}

html[data-theme="dark"] .direct-carrier-strip {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-carrier-strip:hover {
  border-color: #365d4d;
}

html[data-theme="dark"] .direct-carrier-strip.active {
  border-color: #365d4d;
  background: #202832;
  box-shadow: inset 4px 0 0 #070a0e;
}

html[data-theme="dark"] .direct-carrier-strip small,
html[data-theme="dark"] .direct-route-quality-strip small,
html[data-theme="dark"] .direct-carrier-route-heading span,
html[data-theme="dark"] .direct-carrier-route-heading small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-route-quality-strip .direct-fastest-target {
  color: #62cda3;
}

html[data-theme="dark"] .direct-carrier-strip strong,
html[data-theme="dark"] .direct-route-quality-strip strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-carrier-strip em {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-carrier-strip > b {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-carrier-name > i,
html[data-theme="dark"] .direct-route-quality-name > i {
  background: #203a32;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.12);
}

html[data-theme="dark"] .direct-carrier-strip.carrier-unicom .direct-carrier-name > i {
  background: #26323e;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.12);
}

html[data-theme="dark"] .direct-carrier-strip.carrier-mobile .direct-carrier-name > i {
  background: #393122;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.14);
}

html[data-theme="dark"] .direct-carrier-strip.carrier-other .direct-carrier-name > i {
  background: #26323e;
  box-shadow: 0 0 0 4px rgba(7,10,14,0.13);
}

html[data-theme="dark"] .direct-carrier-route-stage {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .direct-carrier-route-heading strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-route-quality-strip {
  border: 1px solid #303943;
  border-left: 4px solid #303943;
  background: #181e25;
}

html[data-theme="dark"] .direct-route-quality-strip.state-ready {
  border-left-color: #365d4d;
  background: #181e25;
}

html[data-theme="dark"] .direct-route-quality-strip.state-observing {
  border-left-color: #72603c;
}

html[data-theme="dark"] .direct-quality-purpose {
  border-left-color: #365d4d;
}

html[data-theme="dark"] .direct-provider-node-stage {
  border-top: 1px solid #303943;
}

html[data-theme="dark"] .direct-provider-node-heading strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-provider-node-heading span,
html[data-theme="dark"] .direct-provider-node-heading small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-physical-node-card {
  border-left: 4px solid #365d4d;
  background: #181e25;
}

/* Only the existing accepting-customer state receives the bright outline. */
html[data-theme="dark"] .direct-physical-node-card.active {
  border-color: #62d6a5;
  box-shadow: inset 0 0 0 1px rgba(98,214,165,.18);
}

html[data-theme="dark"] .direct-physical-node-card.offline {
  border-color: #46515f;
  background: #202832;
}

html[data-theme="dark"] .direct-physical-node-card > header > div::before {
  background: #62d6a5;
  box-shadow: 0 0 0 3px rgba(98,214,165,.16);
}

html[data-theme="dark"] .direct-physical-node-card.offline > header > div::before {
  background: #202832;
  box-shadow: 0 0 0 3px #070a0e;
}

html[data-theme="dark"] .direct-physical-node-card > header strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-physical-node-card > header span {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-physical-node-card > header .direct-node-billing,
html[data-theme="dark"] .direct-physical-node-card > header .direct-node-traffic-source,
html[data-theme="dark"] .direct-physical-node-card > header .direct-node-reset-cycle {
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .direct-physical-node-card > header .direct-node-service-state > small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-host-metric-grid > span {
  border: 1px solid #303943;
  background: #202832;
}

html[data-theme="dark"] .direct-host-metric-grid strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-host-metric-grid i {
  background: #394653;
}

html[data-theme="dark"] .direct-host-metric-grid i b {
  background: #62d6a5;
}

html[data-theme="dark"] .direct-node-traffic-row > span {
  background: #202832;
}

html[data-theme="dark"] .direct-node-traffic-row strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-capacity {
  border: 1px solid #303943;
}

html[data-theme="dark"] .direct-node-capacity strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .direct-node-capacity .direct-capacity-percent {
  color: #fff;
}

html[data-theme="dark"] .direct-node-capacity > small {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-node-capacity.capacity-green .direct-traffic-progress i {
  background: #62d6a5;
}

html[data-theme="dark"] .direct-node-capacity.capacity-yellow .direct-traffic-progress i {
  background: #f6c65b;
}

html[data-theme="dark"] .direct-node-capacity.capacity-red .direct-traffic-progress i {
  background: #ff8585;
}

html[data-theme="dark"] .direct-node-capacity.capacity-gray .direct-traffic-progress {
  background: #394653;
}

html[data-theme="dark"] .direct-node-capacity.capacity-gray .direct-traffic-progress i {
  background: #9daaba;
}

html[data-theme="dark"] .direct-node-capacity.capacity-yellow .direct-capacity-remaining strong {
  color: #e8b967;
}

html[data-theme="dark"] .direct-node-capacity.capacity-red .direct-capacity-remaining strong {
  color: #ef9292;
}

html[data-theme="dark"] .direct-node-capacity.capacity-gray .direct-capacity-remaining strong {
  color: #a8b3c1;
}

html[data-theme="dark"] .direct-physical-node-card > footer .allowed {
  color: #62cda3;
  background: #203a32;
}

html[data-theme="dark"] .direct-physical-node-card > footer .blocked {
  color: #a8b3c1;
  background: #202832;
}

html[data-theme="dark"] .direct-physical-node-card > footer b {
  color: #a8b3c1;
}

html[data-theme="dark"] #cdn-cost-management {
  color: var(--cp-text);
}

html[data-theme="dark"] #cdn-cost-management .cp-shell {
  background: var(--cp-bg);
  border: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-sidebar {
  background: var(--cp-surface);
  border-right: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-nav-item {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-nav-item[aria-current] {
  color: var(--cp-blue);
  background: var(--cp-active);
}

html[data-theme="dark"] #cdn-cost-management .cp-kicker {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-badge {
  color: var(--cp-muted);
  background: var(--cp-soft);
}

html[data-theme="dark"] #cdn-cost-management .cp-section {
  border: 1px solid var(--cp-line);
  background: var(--cp-surface);
}

html[data-theme="dark"] #cdn-cost-management .cp-toolbar {
  border-bottom: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-mode {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management button {
  border: 1px solid var(--cp-line);
  background: var(--cp-surface);
  color: var(--cp-text);
}

html[data-theme="dark"] #cdn-cost-management button:focus-visible,
html[data-theme="dark"] #cdn-cost-management input:focus-visible,
html[data-theme="dark"] #cdn-cost-management select:focus-visible {
  outline: 2px solid var(--cp-blue);
}

html[data-theme="dark"] #cdn-cost-management button.cp-edit {
  border: 0;
  background: transparent;
  color: var(--cp-blue);
}

html[data-theme="dark"] #cdn-cost-management button.cp-primary {
  background: var(--cp-blue);
  color: light-dark(#fff,#142440);
  border-color: var(--cp-blue);
}

html[data-theme="dark"] #cdn-cost-management th {
  color: var(--cp-muted);
  background: var(--cp-bg);
}

html[data-theme="dark"] #cdn-cost-management td {
  border-top: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-sub {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-unit {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-pending {
  color: var(--cp-warn);
}

html[data-theme="dark"] #cdn-cost-management .cp-foot {
  border-top: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-message {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-editor {
  background: var(--cp-surface);
  border: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management label {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management input,
html[data-theme="dark"] #cdn-cost-management select {
  color: var(--cp-text);
  background: var(--cp-bg);
  border: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-estimate {
  color: var(--cp-text);
}

@media (max-width:520px) {
html[data-theme="dark"] #cdn-cost-management tr {
  border-top: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management td {
  border: 0;
}
}

html[data-theme="dark"] #cdn-cost-management .cp-bindings {
  border: 1px solid var(--cp-line);
}

html[data-theme="dark"] #cdn-cost-management .cp-bindings legend {
  color: var(--cp-muted);
}

html[data-theme="dark"] #cdn-cost-management .cp-bindings label {
  color: var(--cp-text);
}

html[data-theme="dark"] #cdn-tcp-status {
  --tcp-surface:#202832; --tcp-border:#303943; --tcp-muted:#a8b3c1; --tcp-selected:#1f3d33; --tcp-accent:#65c6a1;
}

html[data-theme="dark"] .tcp-status-toolbar select,
html[data-theme="dark"] .tcp-status-toolbar input {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .tcp-status-summary>div {
  background: #202832;
  border: 1px solid #303943;
}

html[data-theme="dark"] .tcp-status-summary span {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcp-status-summary strong {
  color: #e6ebf1;
}

html[data-theme="dark"] .tcp-status-table th,
html[data-theme="dark"] .tcp-status-table td {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .tcp-status-table thead {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .tcp-status-table small {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcp-status-caption,
html[data-theme="dark"] .tcp-status-muted {
  color: #a8b3c1;
}

html[data-theme="dark"] .tcp-status-error {
  color: #e8b967;
}

html[data-theme="dark"] .media-pagination span {
  color: var(--muted, #778);
}

html[data-theme="dark"] .commercial-cdn-card {
  border: 1px solid #303943;
  background: #181e25;
  color: #e6ebf1;
}

html[data-theme="dark"] .commercial-cdn-card.is-serving {
  border-color: #365d4d;
}

html[data-theme="dark"] .commercial-cdn-eyebrow {
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-state {
  background: #202832;
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-state.is-serving {
  background: #203a32;
  color: #62cda3;
}

html[data-theme="dark"] .commercial-cdn-metrics>div {
  background: #202832;
}

html[data-theme="dark"] .commercial-cdn-metrics span {
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-coverage p {
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-regions {
  border-bottom: 1px solid #303943;
}

html[data-theme="dark"] .commercial-cdn-regions summary b {
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-card footer {
  border-top: 1px solid #303943;
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-card footer b {
  color: #a8b3c1;
}

html[data-theme="dark"] .commercial-cdn-updated {
  color: #a8b3c1;
}

/* Shared paint and the approved charcoal/jade shell. */
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] button { background: #244c3b; color: #e6ebf1; }
html[data-theme="dark"] button:hover { background: #2c5e49; }
html[data-theme="dark"] .side-brand { background: #19272a; border-color: var(--line); }
html[data-theme="dark"] .side-menu-main { background: var(--panel); }
html[data-theme="dark"] .side-menu-main.active,
html[data-theme="dark"] .side-submenu button.active,
html[data-theme="dark"] .side-menu button:hover { background: var(--soft); color: var(--accent); }
html[data-theme="dark"] .side-submenu button { background: transparent; }
html[data-theme="dark"] .side-menu-main[aria-controls]::after {
  background-image: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 26 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 7l6 6-6 6' fill='none' stroke='%2362cda3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background-color: #202832; color: var(--ink); }
html[data-theme="dark"] .primary-action-button { background: #244c3b; color: #e6ebf1; }
html[data-theme="dark"] .queue-row-highlight td { animation-name: queue-row-highlight-dark; }
@keyframes queue-row-highlight-dark { 0%, 45% { background: #393122; } 100% { background: transparent; } }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8391a2; }
html[data-theme="dark"] dialog { color: var(--ink); background-color: var(--panel); }
html[data-theme="dark"] dialog::backdrop { background: rgba(0,0,0,.65); }
html[data-theme="dark"] :focus-visible { outline-color: #87dfb9; }
html[data-theme="dark"] #cdn-cost-management {
  --cp-bg: #101419; --cp-surface: #181e25; --cp-text: #e6ebf1;
  --cp-muted: #a8b3c1; --cp-line: #303943; --cp-active: #202f43;
  --cp-blue: #99bcf8; --cp-soft: #222a33; --cp-warn: #e8b967;
}

/* Keep the existing section markers visible on charcoal surfaces. */
html[data-theme="dark"] .control-section-title::before,
html[data-theme="dark"] .settings-block > h3::before,
html[data-theme="dark"] .split-title > h3::before,
html[data-theme="dark"] .request-entry-switch h3::before,
html[data-theme="dark"] .operator-status-row h3::before,
html[data-theme="dark"] .stats-decision h3::before,
html[data-theme="dark"] .task-section-head h3::before,
html[data-theme="dark"] .ledger-panel-head h3::before,
html[data-theme="dark"] .ai-usage-header h3::before,
html[data-theme="dark"] .details-panel:not(.compact-details) > summary > span:first-child::before { background: var(--accent); }
html[data-theme="dark"] .page-refresh-strip { border-left-color: var(--accent); }
html[data-theme="dark"] .manual-flow-chip.current {
  background: #202f43;
  border-color: #3f5878;
  color: #99bcf8;
}

/* Page-local palettes inherit the same dark appearance. */
html[data-theme="dark"] .e2fm {
  --e2fm-green: #62cda3;
  --e2fm-green-dark: #87dfb9;
  --e2fm-green-soft: #203a32;
  --e2fm-green-line: #365d4d;
  --e2fm-text: #e6ebf1;
  --e2fm-muted: #a8b3c1;
  --e2fm-line: #303943;
  --e2fm-orange: #e8b967;
}
html[data-theme="dark"] .direct-monitor-page {
  --direct-ink: #e6ebf1;
  --direct-muted: #a8b3c1;
  --direct-border: #303943;
  --direct-surface: #181e25;
  --direct-soft: #202832;
  --direct-purple: #c7a7ed;
  --direct-green: #62cda3;
  --direct-amber: #e8b967;
  --direct-red: #ef9292;
}
html[data-theme="dark"] .ai-model-card,
html[data-theme="dark"] .ai-flow-step,
html[data-theme="dark"] .ai-model-select {
  --tier-bg: #181e25;
  --tier-border: var(--line);
  --tier-accent: var(--accent);
}
html[data-theme="dark"] :is(.ai-model-card,.ai-flow-step,.ai-model-select):is(.tier-lite,.tier-next-lite) {
  --tier-bg: #302b22; --tier-border: #665638; --tier-accent: #d5b571;
}
html[data-theme="dark"] :is(.ai-model-card,.ai-flow-step,.ai-model-select):is(.tier-flash,.tier-next-flash) {
  --tier-bg: #393122; --tier-border: #82683d; --tier-accent: #e8b967;
}
html[data-theme="dark"] :is(.ai-model-card,.ai-flow-step,.ai-model-select).tier-pro {
  --tier-bg: #433123; --tier-border: #996944; --tier-accent: #f2bd81;
}
html[data-theme="dark"] :is(.ai-flow-step,.ai-model-select).tier-empty {
  --tier-bg: #181e25; --tier-border: var(--line); --tier-accent: var(--line);
}

html[data-theme="dark"] .fixed-entry-node { border-color:var(--line); }
html[data-theme="dark"] .fixed-entry-node.is-serving { border-color:#3c775f; box-shadow:inset 0 3px #40a97c; }
html[data-theme="dark"] .fixed-entry-node .fixed-entry-timing { border-top:0; }
html[data-theme="dark"] .fixed-entry-policy-strip b { color:var(--ink,#dce5ef); }
html[data-theme="dark"] :is(.fixed-entry-subheading,.fixed-entry-comparison,.fixed-entry-quality-grid > div,.fixed-entry-notices,.fixed-entry-node footer) { border-color:var(--line); }
html[data-theme="dark"] .fixed-entry-window button,
html[data-theme="dark"] .fixed-entry-sources button { color:var(--muted); border-color:var(--line); background:transparent; }
html[data-theme="dark"] .fixed-entry-window button[aria-pressed=true],
html[data-theme="dark"] .fixed-entry-sources button[aria-pressed=true] { color:#75d5a9; border-color:#3c775f; background:rgba(47,158,109,.14); }
