:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.dp-theme-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 40px; flex: 0 0 auto; padding: 7px 11px; border: 1px solid #637083;
    border-radius: 22px; background: #f5f7fa; color: #182230; font: 600 13px/1.2 system-ui, sans-serif;
    cursor: pointer; white-space: nowrap;
}
.dp-theme-toggle:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; }
.dp-theme-track { width: 32px; height: 19px; padding: 3px; border-radius: 12px; background: #657184; box-sizing: border-box; }
.dp-theme-track > span { display: block; width: 13px; height: 13px; border-radius: 50%; background: white; }
[data-theme="dark"] .dp-theme-toggle { background: #202a38; color: #f3f5f8; border-color: #708099; }
[data-theme="dark"] .dp-theme-track { background: #b52235; }
[data-theme="dark"] .dp-theme-track > span { transform: translateX(13px); }
.dp-theme-bar { display:flex; justify-content:flex-end; padding:8px 24px; background:#eef1f5; border-bottom:1px solid #cbd2dc; }
[data-theme="dark"] .dp-theme-bar { background:#141b25; border-color:#364253; }
.dp-theme-floating { position:fixed; top:12px; right:16px; z-index:10001; }
@media (max-width: 760px) {
    .topbar { height:auto !important; min-height:64px; padding:10px 12px !important; flex-wrap:wrap; gap:8px !important; }
    .topbar .navbar-right { flex-wrap:wrap; gap:8px !important; }
    .topbar .user-info { flex-wrap:wrap; }
    .dp-theme-bar { padding:8px 12px; }
}
@media print { .dp-theme-toggle, .dp-theme-bar { display:none !important; } }

@media print { :root[data-theme] { color-scheme: light; } }
/* Keep wordmarks and the mobile navigation icon recognizable in both modes. */
@media screen {
    :root[data-theme="dark"] .sidebar-logo-pill,
    :root[data-theme="dark"] .login-logo-pill { background: #fff !important; }
    :root[data-theme="dark"] .topbar .hamburger span { background: #fff !important; }
}
