:root {
  --public-bg: #f5f5ef;
  --public-surface: #fff;
  --public-raised: #e6ebe2;
  --public-text: #192729;
  --public-muted: #50635c;
  --public-line: #d2dbd1;
  --public-control-line: #7a8b81;
  --public-accent: #40654f;
  --public-action: #40654f;
  --public-action-text: #fff;
  --public-danger: #8c2b4c;
  --public-danger-bg: #fbedf1;
  --public-success: #245a45;
  --public-success-bg: #e7f4ed;
}
html[data-active-theme=light] { color-scheme: light; }
html[data-active-theme=dark] { color-scheme: dark; }
html[data-public-theme=dark] {
  --public-bg: #0d1719;
  --public-surface: #152124;
  --public-raised: #192729;
  --public-text: #f1f2ea;
  --public-muted: #afbcb2;
  --public-line: #32443f;
  --public-control-line: #6a7d73;
  --public-accent: #afc48d;
  --public-action: #507357;
  --public-action-text: #fff;
  --public-danger: #ffc2d2;
  --public-danger-bg: #402735;
  --public-success: #bbeace;
  --public-success-bg: #243a34;
}
html[data-public-theme] body { background: var(--public-bg); }

html[data-active-theme=dark] .theme-toggle .theme-icon-moon,
html:not([data-active-theme=dark]) .theme-toggle .theme-icon-sun { display: none; }

:is(.saatin-auth, .customer-app, .admin-shell, .customer-space, .business-space) button.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--appearance-line, var(--public-control-line));
  border-radius: 9px;
  background-color: var(--appearance-bg, var(--public-surface));
  color: var(--appearance-text, var(--public-text));
  cursor: pointer;
  transition-property: transform;
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--appearance-focus, var(--public-accent));
  outline-offset: 2px;
}
.customer-app button.theme-toggle {
  --appearance-bg: var(--card);
  --appearance-text: var(--ink);
  --appearance-focus: var(--accent);
  --appearance-line: #7a8b81;
}
html[data-booking-theme=dark] .customer-app button.theme-toggle,
html[data-admin-theme=dark] .admin-shell button.theme-toggle,
html[data-theme=dark] :is(.business-space, .customer-space) button.theme-toggle {
  --appearance-line: #6a7d73;
  --appearance-bg: var(--card, #192729);
  --appearance-text: var(--ink, #f1f2ea);
  --appearance-focus: #afc48d;
}

@media (max-width: 430px) {
  .business-space .topbar { flex-wrap: wrap; row-gap: 4px; }
  .business-space .topbar > div:last-child { margin-inline-start: auto; }
  .business-space .topbar > div:last-child > .avatar { display: none; }
}
