html[data-dashboard-mode=dark] {
  color-scheme: dark;
  --brand-surface: #15161c;
  --brand-card: #202129;
  --brand-ink: #f4eee8;
  --brand-primary: #a84536;
  --brand-primary-hover: #b95040;
  --brand-soft: #33282b;
  --brand-muted: #c8b9b6;
  --brand-line: #3c3d48;
}
[data-dashboard-mode=dark] :is(.admin-main,.workspace) { background:var(--brand-surface); color:var(--ink); }
[data-dashboard-mode=dark] :is(.topbar,.panel,.stat-card,.quick-link,.icon-btn,.template-tile,.template-card-preview,.library-grid article,.empty,.date-pill) {
  background:var(--brand-card); color:var(--ink); border-color:var(--line);
}
[data-dashboard-mode=dark] :is(.admin,dialog) :is(input:not([type=color]),select,textarea) { background:var(--brand-surface); color:var(--ink); border-color:var(--line); }
[data-dashboard-mode=dark] :is(.template-tile small,.template-own-preview,.template-card-preview,.button.soft) { color:var(--muted); }
[data-dashboard-mode=dark] .template-option:has(input:checked) .template-tile { border-color:var(--highlight); }
[data-dashboard-mode=dark] :is(.owner-context,.subscription-notice) { background:var(--brand-soft); color:var(--ink); }
@media(max-width:560px) { #dashboard-mode { font-size:11px; padding-inline:7px; } }
/* Navigation and the overview banner are dark surfaces in both modes. */
html[data-dashboard-mode=dark] { --nav: #251c22; }
[data-dashboard-mode=dark] .sidebar { color:#fff1e9; }
[data-dashboard-mode=dark] .sidebar :is(.menu-switch,.side-profile,.plan-card,.side-link.active) { color:#fff1e9; }
[data-dashboard-mode=dark] .admin-hero {
  background:url('assets/brand/pattern.svg') 0 0/224px,linear-gradient(110deg,#78332b,#2d151a 70%);
}
[data-dashboard-mode=dark] :is(.order-row,.order-details dl,.quick-link:hover) {
  background:var(--brand-card);
  color:var(--ink);
}
[data-dashboard-mode=dark] :is(.order-row:hover,.quick-link:hover) { background:var(--brand-soft); }
[data-dashboard-mode=dark] .button.highlight { color:#26140f; }
.auth-header { width:100%; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
@media(max-width:880px) {
  html[dir=ltr] .admin:not(.sidebar-open) .sidebar { transform:translateX(-105%); }
}
#admin-preferences { display:flex; align-items:center; flex-wrap:nowrap; gap:12px; }
#admin-preferences > :is(a,button) { justify-content:center; min-width:37px; min-height:37px; height:37px; padding:5px 7px; }
#admin-preferences .mode-icon-button { width:37px; font-size:18px; }
.top-actions { flex-shrink:0; }
@media(max-width:650px) {
  #admin-preferences { gap:10px; }
  #admin-preferences > :is(a,button) { min-width:33px; min-height:33px; height:33px; padding-inline:5px; }
  #admin-preferences .mode-icon-button { width:33px; }
  .topbar .crumb { min-width:0; }
  .topbar .crumb b { overflow:hidden; text-overflow:ellipsis; }
}
[data-dashboard-mode=dark] .website-picker .template-option input:checked+.template-tile{background:var(--brand-soft);color:var(--ink)}[data-dashboard-mode=dark] .website-picker .template-option input:checked+.template-tile small{color:var(--muted)}
