:root { color-scheme: light; }
.theme-toggle { min-width: 104px; min-height: 30px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
:focus-visible { outline: 2px solid #4d8eff; outline-offset: 3px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e0e8f3;
  background: #0c1422;
  --line: #2a3c55;
  --muted: #a2b2c8;
  --blue: #79aaff;
}
:root[data-theme="dark"] * { scrollbar-color: #3c526f #131f30; }
:root[data-theme="dark"] .sidebar { background: #101c2b; border-right: 1px solid #24364e; }
:root[data-theme="dark"] .sidebar-caption { color: #91a6c1; }
:root[data-theme="dark"] .sidebar-bottom { border-color: var(--line); color: #c0cee0; }
:root[data-theme="dark"] .sidebar-bottom > span:last-child { color: #9aafc9; }
:root[data-theme="dark"] .nav-item { color: #aebfd5; }
:root[data-theme="dark"] .nav-item.active { background: #23466b; color: #f0f6ff; }
:root[data-theme="dark"] .nav-item:hover { background: #1e3855; }
:root[data-theme="dark"] .card { background: #141f30; border-color: var(--line); box-shadow: 0 2px 8px #00000015; }
:root[data-theme="dark"] h1 span { color: #a5c9ff; background: #1e3658; border-color: #355a87; }
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .page-header p,
:root[data-theme="dark"] time { color: #a0b3cd; }
:root[data-theme="dark"] .badge { background: #1d2a3d; color: #bbcade; border-color: #344963; }
:root[data-theme="dark"] .badge.connected { background: #123e34; color: #80e0bd; border-color: #236653; }
:root[data-theme="dark"] .badge.connected i { background: #66d9ad; }
:root[data-theme="dark"] .step { color: #9cb1cf; }
:root[data-theme="dark"] .small-tag { background: #22334b; color: #b1c5de; }
:root[data-theme="dark"] label { color: #b4c3d7; }
:root[data-theme="dark"] .checkbox-label { color: #adbed5; }
:root[data-theme="dark"] .port-field > span { background: #101a29; color: #a5b7cf; border-color: #375173; }
:root[data-theme="dark"] select,
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] textarea { color: #e0e9f6; background: #101a29; border-color: #354b67; }
:root[data-theme="dark"] select:hover { border-color: #6087b9; }
:root[data-theme="dark"] select:disabled,
:root[data-theme="dark"] input:disabled { background: #192435; color: #889cb7; border-color: #2b3b52; }
:root[data-theme="dark"] textarea::placeholder { color: #91a7c2; }
:root[data-theme="dark"] .primary { background: #3474e8; color: #fff; box-shadow: none; }
:root[data-theme="dark"] .primary:not(:disabled):hover { background: #4585f6; }
:root[data-theme="dark"] .secondary { background: #1c2b40; color: #d0dded; border-color: #3a506d; }
:root[data-theme="dark"] .secondary:not(:disabled):hover { background: #263b55; }
:root[data-theme="dark"] .field-help { color: #9fb1ca; }
:root[data-theme="dark"] .file-picker { background: #14243c; border-color: #3a587b; }
:root[data-theme="dark"] .file-picker:hover { background: #1c3151; }
:root[data-theme="dark"] .file-picker strong { color: #bad4fc; }
:root[data-theme="dark"] .file-picker > span:last-of-type { color: #9fb3ce; }
:root[data-theme="dark"] .upload-icon { color: #b2d1ff; background: #253f62; }
:root[data-theme="dark"] .progress-label { color: #adbed6; }
:root[data-theme="dark"] progress { background: #293b54; }
:root[data-theme="dark"] progress::-webkit-progress-bar { background: #293b54; }
:root[data-theme="dark"] progress::-webkit-progress-value { background: #6d9fff; }
:root[data-theme="dark"] progress::-moz-progress-bar { background: #6d9fff; }
:root[data-theme="dark"] .text-button { color: #a7bfde; }
:root[data-theme="dark"] .text-button:not(:disabled):hover { color: #d0e3ff; }
:root[data-theme="dark"] .log-toolbar { border-color: var(--line); }
:root[data-theme="dark"] .segmented { background: #0d1829; }
:root[data-theme="dark"] .segmented button { color: #a9bdd9; }
:root[data-theme="dark"] .segmented .selected { color: #d6e6ff; background: #29405e; box-shadow: none; }
:root[data-theme="dark"] .log-view { background: #0d1726; }
:root[data-theme="dark"] .empty-state { color: #a8bad2; }
:root[data-theme="dark"] .empty-state strong { color: #bdcce0; }
:root[data-theme="dark"] .empty-state > span { color: #99aecb; }
:root[data-theme="dark"] .empty-symbol { color: #a4c6f2; background: #172b44; border-color: #2c4563; }
:root[data-theme="dark"] .log-row { border-color: #213149; }
:root[data-theme="dark"] .log-time { color: #9fb2cc; }
:root[data-theme="dark"] .log-kind { color: #b2c1d7; }
:root[data-theme="dark"] .log-body { color: #d4dfef; }
:root[data-theme="dark"] .log-row.rx .log-kind { color: #68d7b5; }
:root[data-theme="dark"] .log-row.tx .log-kind { color: #8cb7ff; }
:root[data-theme="dark"] .log-row.err .log-body,
:root[data-theme="dark"] .log-row.err .log-kind { color: #ff9d94; }
:root[data-theme="dark"] .terminal-dot { background: #68d7b5; box-shadow: 0 0 0 4px #19382f; }
:root[data-theme="dark"] .terminal-status { color: #a4b8d3; background: #141f30; }
:root[data-theme="dark"] .terminal-status b { color: #d4e0f0; }
:root[data-theme="dark"] .report-card pre { color: #c6d3e4; background: #0d1726; }
:root[data-theme="dark"] .connection-foot { color: #9bafca; border-color: var(--line); }
:root[data-theme="dark"] .connection-foot > span:last-child { color: #88c6b0; }
:root[data-theme="dark"] footer { color: #a0b3cd; }
:root[data-theme="dark"] footer b { color: #7f95b3; }
:root[data-theme="dark"] .notice { color: #f4d49a; background: #3b301a; border-color: #69532a; }
:root[data-theme="dark"] dialog { color: #e3eaf3; background: #172337; border-color: #3c526d; }
:root[data-theme="dark"] dialog p { color: #b4c4d9; }
:root[data-theme="dark"] dialog::backdrop { background: #020611b0; }
:root[data-theme="dark"] .dialog-icon { color: #ffd78e; background: #48351c; }
:root[data-theme="dark"] .toast { color: #f2f6fc; background: #243955; border-color: #41617f; }
:root[data-theme="dark"] .toast.error { background: #7b3036; border-color: #ac5960; }

@media (max-width: 760px) {
  .header-right { gap: 8px; }
  .theme-toggle { min-width: 98px; }
}
