.theme-toggle {
  width: 40px !important;
  min-width: 40px;
  height: 40px;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line) !important;
  border-radius: 50% !important;
  background: var(--surface, var(--panel)) !important;
  color: var(--ink) !important;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .10);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--brand) !important;
  background: var(--surface-2, var(--panel)) !important;
  color: var(--brand) !important;
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.theme-toggle--floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body,
.topbar,
.sidebar,
.panel,
.metric,
.brief-card,
.setup-panel,
.run-panel,
.login-shell .intro,
.login-shell .panel,
input,
select,
textarea,
button {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

@media (max-width: 640px) {
  .theme-toggle--floating { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  body,
  .topbar,
  .sidebar,
  .panel,
  .metric,
  .brief-card,
  .setup-panel,
  .run-panel,
  .login-shell .intro,
  .login-shell .panel,
  input,
  select,
  textarea,
  button { transition: none !important; }
}
