html { color-scheme: light; }
html[data-panel-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1016;
  --panel: #111820;
  --line: #26323d;
  --text: #edf3f7;
  --muted: #96a5b3;
  --lime: #31c6b7;
  --red: #ef7180;
  --soft: #172029;
  --shadow: 0 10px 30px rgba(0,0,0,.24);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #d6e0e7;
  border-radius: 7px;
  background: #edf2f5;
  color: #344250;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.theme-toggle:hover { background: #e3eaee; color: #1f2b35; }
.theme-toggle span { font-size: 16px; line-height: 1; }
.auth-theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 5; }

html[data-panel-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-panel-theme="dark"] header { background: #0f161d; border-bottom-color: var(--line); box-shadow: 0 1px 10px rgba(0,0,0,.25); }
html[data-panel-theme="dark"] .brand,
html[data-panel-theme="dark"] .page-head h1,
html[data-panel-theme="dark"] .compact-head h1,
html[data-panel-theme="dark"] .panel h2,
html[data-panel-theme="dark"] .panel h3,
html[data-panel-theme="dark"] .auth-card h1 { color: var(--text); }
html[data-panel-theme="dark"] .top-nav a { color: #b7c3cd; }
html[data-panel-theme="dark"] .top-nav a:hover,
html[data-panel-theme="dark"] .top-nav a.current { background: #17312f; color: #68dfd2; }
html[data-panel-theme="dark"] .panel,
html[data-panel-theme="dark"] .auth-card,
html[data-panel-theme="dark"] .provider-card,
html[data-panel-theme="dark"] .workspace-card,
html[data-panel-theme="dark"] .release-card { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
html[data-panel-theme="dark"] .workspace-card.static,
html[data-panel-theme="dark"] .release-card.withdrawn { background: var(--soft); }
html[data-panel-theme="dark"] .summary-grid > div,
html[data-panel-theme="dark"] .check-card,
html[data-panel-theme="dark"] .endpoint-row,
html[data-panel-theme="dark"] .media-card,
html[data-panel-theme="dark"] .message-card,
html[data-panel-theme="dark"] .setting-group,
html[data-panel-theme="dark"] .preset-form,
html[data-panel-theme="dark"] .selected-theme-copy,
html[data-panel-theme="dark"] .theme-choice { background: #131b23; border-color: var(--line); color: var(--text); }
html[data-panel-theme="dark"] .theme-choice:hover,
html[data-panel-theme="dark"] .theme-choice.selected { background: #17312f; border-color: #31c6b7; }
html[data-panel-theme="dark"] .selected-theme-copy strong,
html[data-panel-theme="dark"] .setting-group legend,
html[data-panel-theme="dark"] .theme-choice strong { color: var(--text); }
html[data-panel-theme="dark"] label { color: #c2cdd6; }
html[data-panel-theme="dark"] input,
html[data-panel-theme="dark"] select,
html[data-panel-theme="dark"] textarea,
html[data-panel-theme="dark"] .colour-control { background: #0d141b; color: var(--text); border-color: #35424e; }
html[data-panel-theme="dark"] input:focus,
html[data-panel-theme="dark"] select:focus,
html[data-panel-theme="dark"] textarea:focus { border-color: #31c6b7; outline-color: rgba(49,198,183,.18); }
html[data-panel-theme="dark"] .secondary,
html[data-panel-theme="dark"] .button.secondary,
html[data-panel-theme="dark"] button.secondary,
html[data-panel-theme="dark"] summary.secondary,
html[data-panel-theme="dark"] .theme-toggle { background: #1b2630; color: #dce5eb; border-color: #35424e; }
html[data-panel-theme="dark"] .secondary:hover,
html[data-panel-theme="dark"] .button.secondary:hover,
html[data-panel-theme="dark"] button.secondary:hover,
html[data-panel-theme="dark"] .theme-toggle:hover { background: #26343f; color: #fff; }
html[data-panel-theme="dark"] .danger,
html[data-panel-theme="dark"] button.danger { background: #321a20; color: #ff9ba7; border-color: #61303a; }
html[data-panel-theme="dark"] .enable-button { background: #133328; color: #65d8ab; border-color: #285c49; }
html[data-panel-theme="dark"] .notice { background: #143125; color: #7ee0af; border-color: #285c47; }
html[data-panel-theme="dark"] .error { background: #351b21; color: #ff9eaa; border-color: #63313b; }
html[data-panel-theme="dark"] .status,
html[data-panel-theme="dark"] .count,
html[data-panel-theme="dark"] .storage-pill { background: #1a242d; color: #a7b5c1!important; border-color: #303d48; }
html[data-panel-theme="dark"] .status.active { background: #143125; color: #6bdba7!important; border-color: #285c47; }
html[data-panel-theme="dark"] .status.suspended { background: #351b21; color: #ff96a3!important; border-color: #63313b; }
html[data-panel-theme="dark"] .status.archived { background: #29223b; color: #c7b2f0!important; border-color: #493b66; }
html[data-panel-theme="dark"] .info-box { background: #102724; border-color: #28534e; }
html[data-panel-theme="dark"] .info-box strong { color: #6ce0d4; }
html[data-panel-theme="dark"] .info-box p,
html[data-panel-theme="dark"] .section-head p,
html[data-panel-theme="dark"] .panel > p,
html[data-panel-theme="dark"] .page-copy,
html[data-panel-theme="dark"] .workspace-card p,
html[data-panel-theme="dark"] .field-help { color: var(--muted); }
html[data-panel-theme="dark"] .api-url,
html[data-panel-theme="dark"] .endpoint-main code { background: #0d141b; color: #70dacf; border-color: var(--line); }
html[data-panel-theme="dark"] .endpoint-row.disabled { background: #10171e; }
html[data-panel-theme="dark"] .endpoint-editor[open] form { background: #131b23; border-color: var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
html[data-panel-theme="dark"] .service-code { background: #13312e; color: #72dfd3; border-color: #39746d; }
html[data-panel-theme="dark"] .empty { background: #10171e; color: var(--muted); border-color: var(--line); }
html[data-panel-theme="dark"] .media-card img { background: #0c1218; }
html[data-panel-theme="dark"] .message-card p { color: #b7c3cd; }
html[data-panel-theme="dark"] .colour-control code,
html[data-panel-theme="dark"] .release-meta code { color: #b7c3cd; }
html[data-panel-theme="dark"] .appearance-save { background: rgba(16,39,36,.97); border-color: #28534e; }
html[data-panel-theme="dark"] .appearance-save strong { color: #71ddd1; }
html[data-panel-theme="dark"] .appearance-save span { color: #9dabb6; }
html[data-panel-theme="dark"] .portal-frame { border-color: #34424e; }
html[data-panel-theme="dark"] .auth { background: radial-gradient(circle at 20% 10%,#17312f,#0b1016 54%); }

@media (max-width:760px) {
  .theme-toggle b { display: none; }
  .theme-toggle { padding-inline: 10px; }
}
