/* Staging-only theme and viewport-safe sheets. The public site keeps its own theme. */
html[data-theme] .profile-app { color: var(--text); }
html[data-theme] .profile-shell, html[data-theme] .profile-auth { background: var(--surface); border-color: var(--line); }
html[data-theme] .profile-hero { background: linear-gradient(130deg, var(--surface-2), var(--surface)); color: var(--text); border-bottom: 1px solid var(--line); }
html[data-theme] .profile-hero h2, html[data-theme] .profile-hero-meta { color: var(--text); }
html[data-theme] .profile-kicker { color: var(--accent); opacity: 1; font-weight: 800; }
html[data-theme] .profile-btn, html[data-theme] .profile-subtabs button.active { background: var(--primary); color: var(--on-primary); }
html[data-theme] .profile-btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
html[data-theme] .profile-btn.warn { background: #ad312b; color: #fff; }
html[data-theme] .profile-form input, html[data-theme] .profile-form textarea, html[data-theme] .profile-form select,
html[data-theme] .profile-card, html[data-theme] .profile-request, html[data-theme] .profile-entry,
html[data-theme] .profile-subtabs button, html[data-theme] .profile-close { background: var(--surface-2); color: var(--text); border-color: var(--line); }
html[data-theme] .profile-month, html[data-theme] .profile-day, html[data-theme] .profile-recipient,
html[data-theme] .profile-sheet-card { background: var(--surface); color: var(--text); border-color: var(--line); }
html[data-theme] .profile-card strong, html[data-theme] .profile-month strong, html[data-theme] .profile-day span { color: var(--primary); }
html[data-theme] .profile-status { background: var(--surface-2); color: var(--text); }
html[data-theme] .profile-alert { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
html[data-theme] .profile-alert.error { background: #4d1919; color: #fff0ea; border-color: #af5c50; }
html[data-theme="light"] .profile-alert.error { background: #fbe4de; color: #812519; }
html[data-theme] .profile-btn:focus-visible, html[data-theme] .profile-close:focus-visible,
html[data-theme] .profile-day:focus-visible, html[data-theme] .profile-request:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
html[data-theme] .profile-sheet {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  overflow-y: auto; overscroll-behavior: contain; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, .78);
}
html[data-theme] .profile-sheet-card {
  flex: 0 1 680px; width: min(680px, 100%); min-width: 0; min-height: 0;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 22px; padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
}
html[data-theme] .profile-sheet-head { position: sticky; top: -1px; z-index: 1; padding: 4px 0 10px; background: var(--surface); }
html[data-theme] .profile-sheet-head h3 { margin: 0; }
html[data-theme] .profile-close { flex: 0 0 40px; min-width: 40px; min-height: 40px; font-size: 18px; }
html[data-theme] .profile-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
html[data-theme] .profile-day { min-width: 0; }
body.profile-dialog-open { overflow: hidden; }
@media (max-width: 600px) {
  html[data-theme] .profile-auth { margin: 12px auto; padding: 18px; }
  html[data-theme] .profile-sheet { align-items: flex-end; padding: max(8px, env(safe-area-inset-top)) 0 0; }
  html[data-theme] .profile-sheet-card { flex-basis: 100%; width: 100%; max-height: calc(100dvh - max(8px, env(safe-area-inset-top))); border-radius: 20px 20px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
  html[data-theme] .profile-day { min-height: 60px; padding: 6px 1px; }
}
