/* Shared binary appearance control. Device appearance is used until a person
   makes an explicit choice; theme.js applies it before styles paint. */
.theme-control {
  position: relative; display: inline-flex; align-items: center; justify-content: space-between;
  width: 4.25rem; min-height: 2.5rem; padding: .375rem;
  margin-left: auto; flex: 0 0 auto; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted);
}
.theme-control[hidden] { display: none; }
.theme-control::before {
  content: ""; position: absolute; top: .25rem; bottom: .25rem; left: .25rem;
  width: 1.75rem; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border-strong);
}
.theme-control[aria-checked="true"]::before { left: auto; right: .25rem; }
.theme-control .ico { position: relative; width: 1.25rem; height: 1.25rem; }
.theme-control[aria-checked="false"] .ico-sun,
.theme-control[aria-checked="true"] .ico-moon { color: var(--text); }
.auth-form > .theme-control { display: flex; margin-bottom: 1.5rem; }
.auth-form > .theme-control[hidden] { display: none; }
.portal-topbar { flex-wrap: wrap; }
@media (pointer: coarse), (max-width: 40rem) {
  .theme-control { min-height: 2.75rem; }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000; --surface: #111111; --surface-2: #1a1a1a; --surface-3: #242424;
    --border: #303030; --border-strong: #808080;
    --text: #f5f5f5; --text-muted: #a3a3a3;
    --accent: #5ed3a3; --accent-hover: #95e4c2; --accent-soft: #112c21; --focus: #5ed3a3;
    --ok: #8de0b2; --ok-soft: #1c3b2d;
    --warn: #f3ce86; --warn-soft: #3d321f;
    --danger: #ffb0bb; --danger-soft: #422630;
    --info: #a4d7fa; --info-soft: #213748;
    --neutral: #c2cfdc; --neutral-soft: #2b3540;
    --rail-bg: #000000; --rail-bg-raised: #111111; --rail-line: #303030;
    --rail-text: #a3a3a3; --rail-text-strong: #f5f5f5; --rail-active: #1a1a1a;
    --paper: #111111; --section-title-bg: #111111; --section-border: #303030;
    --section-title-text: #f5f5f5; --section-title-muted: #a3a3a3;
    --line: var(--border); --panel: var(--surface-2);
    --shadow-sm: 0 2px 8px rgb(0 0 0 / 18%); --shadow: 0 20px 50px rgb(0 0 0 / 30%);
  }
  [data-theme="dark"] .portal-topbar { background: #000000; }
  [data-theme="dark"] :is(button.primary, .button.primary, .action-button) {
    background: var(--accent); color: #071b14; border-color: var(--accent);
  }
  [data-theme="dark"] :is(button.primary, .button.primary, .action-button):hover {
    background: var(--accent-hover); color: #071b14; border-color: var(--accent-hover);
  }

}
@media print { .theme-control, .auth-form > .theme-control { display: none; } }
