@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ageguard-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ageguard-font-body-size: 15px;
  --ageguard-line-height: 1.6;
  --ageguard-numeric-font-features: "tnum" 1;
}

:root, html[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #fcf9fc;
  --theme-surface: #ffffff;
  --theme-surface-raised: #fffdfd;
  --theme-surface-soft: #fdfafd;
  --theme-input: #fdfbfd;
  --theme-text: #342744;
  --theme-muted: #82778c;
  --theme-border: #ece4ee;
  --theme-accent: #a75f99;
  --theme-accent-secondary: #7862ab;
  --theme-accent-soft: #f4eaf3;
  --theme-focus: #aa8bd3;
  --theme-shadow: #60497012;
  --theme-error-bg: #fff6f8;
  --theme-error-text: #9b526a;
  --theme-success-bg: #f5fbf5;
  --theme-success-text: #456f4d;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #111318;
  --theme-surface: #1b1f27;
  --theme-surface-raised: #20252e;
  --theme-surface-soft: #1e232c;
  --theme-input: #252b35;
  --theme-text: #f1f3f7;
  --theme-muted: #a8b0bf;
  --theme-border: #343b47;
  --theme-accent: #a78bfa;
  --theme-accent-secondary: #c4b5fd;
  --theme-accent-soft: #2b263b;
  --theme-focus: #a78bfa;
  --theme-shadow: #00000038;
  --theme-error-bg: #38232d;
  --theme-error-text: #f0a6bc;
  --theme-success-bg: #22352a;
  --theme-success-text: #a5d6ae;
}

html[data-theme="waifu"] {
  color-scheme: dark;
  --theme-bg: #1c1725;
  --theme-surface: #292135;
  --theme-surface-raised: #30263d;
  --theme-surface-soft: #30263d;
  --theme-input: #352b43;
  --theme-text: #f8f0fa;
  --theme-muted: #c8b8d0;
  --theme-border: #493a56;
  --theme-accent: #b794f6;
  --theme-accent-secondary: #f3a6d8;
  --theme-accent-soft: #3b2e4b;
  --theme-focus: #f3a6d8;
  --theme-shadow: #0c071358;
  --theme-error-bg: #432936;
  --theme-error-text: #ffc0d1;
  --theme-success-bg: #293b39;
  --theme-success-text: #b5e1cb;
}

html[data-theme="sakura-dark"] {
  color-scheme: dark;
  --theme-bg: #160d14;
  --theme-surface: #25151f;
  --theme-surface-raised: #301c28;
  --theme-surface-soft: #2b1924;
  --theme-input: #321d29;
  --theme-text: #fff0f3;
  --theme-muted: #d9b9c4;
  --theme-border: #613044;
  --theme-accent: #a73f60;
  --theme-accent-secondary: #ffb7c5;
  --theme-accent-soft: #482333;
  --theme-focus: #ffb7c5;
  --theme-shadow: #08030970;
  --theme-error-bg: #48212d;
  --theme-error-text: #ffc2d0;
  --theme-success-bg: #22392f;
  --theme-success-text: #b6e5c5;
}

html[data-theme="light"], html:not([data-theme]) {
  --notice-info-bg: #edf6ff; --notice-info-text: #234e72; --notice-info-border: #a9c7e2; --notice-info-icon: #236fae;
  --notice-warning-bg: #fff5e5; --notice-warning-text: #704c14; --notice-warning-border: #e5bd75; --notice-warning-icon: #a66300;
  --notice-error-bg: #fff0f3; --notice-error-text: #843d52; --notice-error-border: #e5aebd; --notice-error-icon: #b33d5a;
  --notice-success-bg: #eff9f0; --notice-success-text: #315c3b; --notice-success-border: #a7d1ad; --notice-success-icon: #347647;
}

html[data-theme="dark"] {
  --notice-info-bg: #1e3041; --notice-info-text: #c9e4fc; --notice-info-border: #426987; --notice-info-icon: #8dc9f2;
  --notice-warning-bg: #3a3020; --notice-warning-text: #f5d99f; --notice-warning-border: #806338; --notice-warning-icon: #f2c46e;
  --notice-error-bg: #38232d; --notice-error-text: #f0a6bc; --notice-error-border: #8f5368; --notice-error-icon: #ff9ab5;
  --notice-success-bg: #22352a; --notice-success-text: #a5d6ae; --notice-success-border: #486b50; --notice-success-icon: #8ed39b;
}

html[data-theme="waifu"] {
  --notice-info-bg: #252d40; --notice-info-text: #d5e4ff; --notice-info-border: #536487; --notice-info-icon: #a9c3ff;
  --notice-warning-bg: #3d3328; --notice-warning-text: #f4d7a3; --notice-warning-border: #80694a; --notice-warning-icon: #f1c675;
  --notice-error-bg: #432936; --notice-error-text: #ffc0d1; --notice-error-border: #9b5b72; --notice-error-icon: #ffabc2;
  --notice-success-bg: #293b39; --notice-success-text: #b5e1cb; --notice-success-border: #557e70; --notice-success-icon: #92d8b2;
}

html[data-theme="sakura-dark"] {
  --notice-info-bg: #202b3b; --notice-info-text: #d5e5fb; --notice-info-border: #4d647e; --notice-info-icon: #a8c9ef;
  --notice-warning-bg: #3e2d20; --notice-warning-text: #f6d5a7; --notice-warning-border: #80593a; --notice-warning-icon: #f2bd73;
  --notice-error-bg: #48212d; --notice-error-text: #ffc2d0; --notice-error-border: #9c5368; --notice-error-icon: #ff9db4;
  --notice-success-bg: #22392f; --notice-success-text: #b6e5c5; --notice-success-border: #4c8062; --notice-success-icon: #91d6a5;
}

/* Shared aliases keep older page styles connected to the same design tokens. */
html[data-theme] {
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --pink: var(--theme-accent-secondary);
  --purple: var(--theme-accent);
  --line: var(--theme-border);
  --paper: var(--theme-bg);
  --white: var(--theme-surface);
}

html[data-theme="waifu"] body { position: relative; isolation: isolate; }
html[data-theme="waifu"] body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/sakura-pattern.svg") center / 480px 360px repeat;
  content: "";
  opacity: .13;
}

/* Daytime public landing: keep the existing Light palette and layer its Sakura
   decoration over it. This is scoped to the automatic public-home mode only. */
html[data-theme-mode="auto-waifu-day-night"][data-theme-season="sakura-waifu-light"] body { position: relative; isolation: isolate; }
html[data-theme-mode="auto-waifu-day-night"][data-theme-season="sakura-waifu-light"] body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/sakura-pattern.svg") center / 480px 360px repeat;
  content: "";
  opacity: .11;
}

html[data-theme="sakura-dark"] body { position: relative; isolation: isolate; }
html[data-theme="sakura-dark"] body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/sakura-dark-pattern.svg") center / 480px 360px repeat;
  content: "";
  opacity: .28;
}

@media (max-width: 720px) {
  html[data-theme-mode="auto-waifu-day-night"][data-theme-season="sakura-waifu-light"] body::before { background-size: 360px 270px; opacity: .09; }
}

html[data-theme] body {
  color: var(--theme-text);
  background-color: var(--theme-bg);
  font-family: var(--ageguard-font-sans);
  font-size: var(--ageguard-font-body-size);
  line-height: var(--ageguard-line-height);
  font-synthesis: none;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme] :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--ageguard-font-sans);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}

html[data-theme] :is(button, input, select, textarea) { font-family: var(--ageguard-font-sans); }
html[data-theme] :is(code, time, .request-id, .request-id-row code, .status-pill, .team-status-pill, .account-state, .member-id, .member-pagination, [data-numeric]) {
  font-variant-numeric: tabular-nums;
  font-feature-settings: var(--ageguard-numeric-font-features);
}

.password-input-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.password-input-wrap > input { width: 100%; padding-inline-end: 3rem !important; }
.password-visibility-toggle {
  position: absolute;
  z-index: 1;
  inset-inline-end: 6px;
  top: 50%;
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  transform: translateY(-50%);
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--theme-muted);
  background: transparent;
  cursor: pointer;
}
.password-visibility-toggle:hover { color: var(--theme-accent); background: var(--theme-accent-soft); }
.password-visibility-toggle:disabled { opacity: .55; cursor: not-allowed; }
.password-visibility-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-dialog-message { margin: 0 0 14px; color: var(--theme-muted); line-height: 1.55; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 3px;
}

/* Shared dashboard surfaces and navigation */
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-body,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .login-body,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) body {
  color: var(--theme-text);
  background: var(--theme-bg) !important;
}
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-header,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .site-header { border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .brand,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .brand-name,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-intro h1,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .section-heading h2,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .detail-dialog h2,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .request-card h2,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .summary-card strong { color: var(--theme-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-intro h1 span,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-back-link span,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-intro h1 span { color: var(--theme-accent-secondary); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.admin-subtitle, .admin-session, .admin-footer, .summary-label, .summary-foot, .admin-eyebrow, .member-pagination, .settings-pill, .field-label, .loading-cell, .empty-cell) { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-session span + span { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-tab { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-tab.active { color: var(--theme-accent-secondary); background: var(--theme-accent-soft); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .request-section,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .user-management,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .summary-card,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .detail-dialog,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .settings-preview,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .login-card,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .card { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); box-shadow: 0 8px 28px var(--theme-shadow); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .summary-total { background: linear-gradient(135deg, var(--theme-surface-raised), var(--theme-surface-soft)); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .request-section,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .user-management { border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .settings-facts,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .member-facts { background: var(--theme-border); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .settings-facts div,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .member-facts div { background: var(--theme-surface-raised); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.settings-facts dt, .settings-facts dd, .member-facts dt, .member-facts dd, .detail-list dt, .detail-list dd, .settings-card h3, .settings-note, .settings-form label, .user-section-description, .create-user-form label, .team-edit-form label, .team-link-hint, .team-details summary) { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.settings-facts dd, .member-facts dd, .detail-list dd, .admin-notice strong, .request-id, .settings-preview, .settings-preview strong, .settings-preview p) { color: var(--theme-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.settings-note, .settings-safety, .dialog-note, .admin-notice, .team-self-role-notice, .create-user-form) { color: var(--theme-muted); background: var(--theme-surface-soft); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.settings-preview, .runtime-error-item, .member-subsection, .detail-dialog, .dialog-close, .detail-button, .logout-button, .refresh-button, .user-action, .request-action, .secondary-button, .team-edit-form input, .team-edit-form select, .create-user-form input) { border-color: var(--theme-border); color: var(--theme-text); background-color: var(--theme-surface-raised); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(input, textarea, select, .search-box, .status-filter select, .settings-form input, .settings-form textarea, .settings-form select, .settings-form input[data-color-hex], .login-card input, .dialog-field input) { color: var(--theme-text); background-color: var(--theme-input); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) input::placeholder,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) textarea::placeholder,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .search-box input::placeholder { color: var(--theme-muted); opacity: .78; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.admin-intro, .settings-card, .request-card, .login-description, .login-privacy, .privacy-item strong, .privacy-item small, .hero-description, .site-footer) { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(thead, .table-wrap thead, .table-footer, .member-pagination) { background: var(--theme-surface-soft); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(th, td, .table-footer, .member-pagination, .request-id-row, .status-row, .detail-list div, .table-footer, .privacy-divider) { color: var(--theme-muted); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .admin-notice strong { color: var(--theme-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.read-only-badge, .privacy-link, .admin-nav-link, .admin-tabs, .settings-toggle) { color: var(--theme-muted); border-color: var(--theme-border); background: var(--theme-surface-soft); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.logout-button:hover, .refresh-button:hover, .detail-button:hover, .user-action:hover, .request-action:hover, .secondary-button:hover, .privacy-link:hover, .admin-nav-link:hover) { color: var(--theme-text); border-color: var(--theme-accent); background: var(--theme-accent-soft); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.dashboard-error, .settings-error, .login-error, .login-error, .team-edit-error, .user-feedback.is-error, .error-message) { color: var(--theme-error-text); background: var(--theme-error-bg); border-color: #8f5368; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.dashboard-feedback, .user-feedback:not(.is-error)) { color: var(--theme-success-text); background: var(--theme-success-bg); border-color: #486b50; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .runtime-error-item { background: var(--theme-error-bg); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .runtime-error-item :is(strong, p, small) { color: var(--theme-error-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .event-failed td { color: var(--theme-error-text); background: var(--theme-error-bg); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .account-state { color: var(--theme-success-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .account-state.is-inactive { color: var(--theme-error-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .status-pending { color: #d0b8ff; background: #3a3150; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .status-approved { color: #b9e7c0; background: #293e31; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .status-denied { color: #ffc0d1; background: #482d39; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .status-unavailable { color: #c7cbd4; background: #343943; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .dot-pending { background: #b794f6; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .dot-approved { background: #8fcf9d; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .dot-denied { background: #ef91ae; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .dot-unavailable { background: #a8b0bf; }
html[data-theme="sakura-dark"] .status-pending { color: #ffe0a8; background: #493821; }
html[data-theme="sakura-dark"] .dot-pending { background: #ffe0a8; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .detail-dialog::backdrop { background: #08070ca8; }

/* Public demo and login surfaces */
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.login-card h1, .hero h1, .request-card h2) { color: var(--theme-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.login-card h1 span, .h1 span, h1 span, .login-eyebrow, .eyebrow, .request-icon, .privacy-icon, .login-privacy span) { color: var(--theme-accent-secondary); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.request-card, .privacy-strip, .floating-note, .portrait-card) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.floating-note strong, .privacy-item strong, .portrait-caption, .portrait-topline, .floating-note small, .privacy-item small) { color: var(--theme-muted); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) :is(.request-icon, .privacy-icon, .floating-note > span, .button-arrow) { background: var(--theme-accent-soft); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .art-halo { opacity: .12; }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .secondary-button { color: var(--theme-text); background: var(--theme-surface-raised); border-color: var(--theme-border); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .invitation-body,
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) body:has(.card) { color: var(--theme-text); background: var(--theme-bg); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) .card { color: var(--theme-text); }
html:is([data-theme="dark"], [data-theme="waifu"], [data-theme="sakura-dark"]) #message[data-error="true"] { color: var(--theme-error-text); }
html[data-theme="waifu"] :is(.login-card label, .dialog-field, .invitation-body label) { color: var(--theme-muted); }
html[data-theme="waifu"] :is(.login-description, .login-privacy, .request-note, .button-caption) { color: var(--theme-muted); }
html[data-theme="waifu"] :is(.login-error, #message[data-error="true"], .error-message) { color: var(--theme-error-text); background: var(--theme-error-bg); border-color: var(--theme-border); }
html[data-theme="waifu"] :is(.privacy-link, .admin-nav-link):hover { color: var(--theme-text); background: var(--theme-accent-soft); border-color: var(--theme-accent); }

/* Theme picker */
.theme-control { display: inline-flex; align-items: center; gap: 7px; color: var(--theme-muted); font-size: 10px; white-space: nowrap; }
.theme-control select { min-height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--theme-border); border-radius: 9px; color: var(--theme-text); background: var(--theme-surface); font: inherit; cursor: pointer; }
html[data-theme="dark"] .theme-control select, html[data-theme="waifu"] .theme-control select, html[data-theme="sakura-dark"] .theme-control select { color-scheme: dark; }
.theme-control select:focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 2px; }

@media (max-width: 620px) {
  .theme-control { gap: 4px; font-size: 9px; }
  .theme-control select { max-width: min(150px, 40vw); min-height: 31px; padding-left: 6px; font-size: 9px; }
  .admin-header-actions { gap: 8px; }
}

/* Small readability pass shared by all pages and resolved themes. */
html[data-theme] .admin-header { min-height: 84px; height: auto; }
html[data-theme] .admin-header-actions { gap: 18px; }
html[data-theme] .admin-tabs { flex-wrap: wrap; gap: 8px; padding-top: 19px; }
html[data-theme] .admin-tab { padding: 9px 13px; font-size: 11px; }
html[data-theme] .admin-session,
html[data-theme] .admin-back-link,
html[data-theme] .admin-subtitle { font-size: 14px; }
html[data-theme] .logout-button { min-height: 38px; padding: 8px 12px; font-size: 11px; }
html[data-theme] .admin-intro { padding-top: 43px; padding-bottom: 27px; }
html[data-theme] .admin-intro h1 { font-size: clamp(33px, calc(4vw + 1px), 46px); }
html[data-theme] .section-heading { padding: 23px 24px 19px; }
html[data-theme] .section-heading h2 { font-size: 22px; }
html[data-theme] .member-subsection .section-heading h2 { font-size: 18px; }
html[data-theme] .request-card h2 { font-size: 21px; }
html[data-theme] .detail-dialog h2 { font-size: 26px; }
html[data-theme] .settings-card h3 { font-size: 13px; }
html[data-theme] .summary-grid { gap: 13px; }
html[data-theme] .summary-card { min-height: 136px; padding: 19px; }
html[data-theme] .request-section { margin-top: 26px; }
html[data-theme] .refresh-button,
html[data-theme] .detail-button,
html[data-theme] .request-action,
html[data-theme] .user-action,
html[data-theme] .secondary-button { min-height: 38px; padding: 9px 13px; font-size: 11px; }
html[data-theme] .search-box input { height: 42px; font-size: 12px; }
html[data-theme] .status-filter { font-size: 11px; }
html[data-theme] .status-filter select { height: 42px; font-size: 11px; }
html[data-theme] .filters { gap: 12px; padding-bottom: 20px; }
html[data-theme] th { height: 42px; font-size: 10px; }
html[data-theme] td { height: 61px; font-size: 11px; }
html[data-theme] .status-pill { padding: 6px 9px; font-size: 10px; }
html[data-theme] .request-id { font-size: 11px; }
html[data-theme] .table-footer,
html[data-theme] .member-pagination { padding-top: 14px; padding-bottom: 14px; font-size: 11px; }
html[data-theme] .admin-notice p,
html[data-theme] .settings-note,
html[data-theme] .dialog-note,
html[data-theme] .team-self-role-notice,
html[data-theme] .user-section-description { font-size: 11px; }
html[data-theme] .settings-grid { gap: 17px; }
html[data-theme] .settings-form { gap: 14px; }
html[data-theme] .settings-form label,
html[data-theme] .settings-security-form label,
html[data-theme] .team-edit-form label,
html[data-theme] .create-user-form label,
html[data-theme] .login-card label { font-size: 11px; }
html[data-theme] .settings-form input:not([type="checkbox"]):not([type="color"]),
html[data-theme] .settings-form select,
html[data-theme] .settings-form textarea,
html[data-theme] .settings-security-form input,
html[data-theme] .team-edit-form input,
html[data-theme] .team-edit-form select,
html[data-theme] .create-user-form input:not([type="checkbox"]) { min-height: 42px; font-size: 12px; }
html[data-theme] .login-card input { height: 46px; font-size: 13px; }
html[data-theme] .login-card h1 { font-size: 44px; }
html[data-theme] .login-description { font-size: 13px; }
html[data-theme] .login-card form { gap: 16px; }
html[data-theme] .card { padding: clamp(1.6rem, 6vw, 2.6rem); }
html[data-theme] .card h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); }
html[data-theme] .card form { gap: .8rem; }
html[data-theme] .card input,
html[data-theme] .card button { min-height: 3rem; }
html[data-theme] .privacy-strip { gap: 27px; padding: 25px 27px; }
html[data-theme] .request-card { padding: 20px; }
html[data-theme] .request-id-row code { font-size: 11px; }
html[data-theme] .field-label { font-size: 12px; }
html[data-theme] .theme-control { gap: 8px; font-size: 11px; }
html[data-theme] .theme-control select { min-height: 37px; padding-inline: 10px 29px; font-size: 11px; }

@media (max-width: 900px) {
  html[data-theme] .summary-grid { gap: 11px; }
  html[data-theme] .summary-card { min-height: 124px; padding: 16px; }
}
@media (max-width: 720px) {
  html[data-theme] .admin-header-actions { gap: 10px; }
  html[data-theme] .settings-form input:not([type="checkbox"]):not([type="color"]),
  html[data-theme] .settings-form select,
  html[data-theme] .settings-form textarea { min-height: 42px; }
}
@media (max-width: 620px) {
  html[data-theme] .admin-header { min-height: 68px; }
  html[data-theme] .admin-tabs { gap: 6px; padding-top: 14px; }
  html[data-theme] .admin-tab { padding: 8px 10px; }
  html[data-theme] .admin-intro { padding: 33px 0 20px; }
  html[data-theme] .admin-intro h1 { font-size: clamp(33px, calc(9vw + 1px), 43px); }
  html[data-theme] .admin-subtitle { font-size: 12px; }
  html[data-theme] .summary-grid { gap: 9px; }
  html[data-theme] .summary-card { min-height: 114px; padding: 15px; }
  html[data-theme] .section-heading { padding: 19px 16px 16px; }
  html[data-theme] .section-heading h2 { font-size: 20px; }
  html[data-theme] .member-subsection .section-heading h2 { font-size: 18px; }
  html[data-theme] .filters { gap: 11px; padding: 0 16px 16px; }
  html[data-theme] .request-section { margin-top: 18px; }
  html[data-theme] .status-filter select { min-width: 0; }
  html[data-theme] .table-footer { padding: 13px 16px; }
  html[data-theme] .admin-notice { padding: 13px; }
  html[data-theme] .admin-notice p { font-size: 10px; }
  html[data-theme] .login-card h1 { font-size: 39px; }
  html[data-theme] .theme-control { gap: 4px; font-size: 10px; }
  html[data-theme] .theme-control select { max-width: min(150px, 40vw); min-height: 34px; padding-left: 7px; font-size: 10px; }
}

@media (max-width: 720px) {
  html[data-theme="waifu"] body::before {
    background-size: 400px 320px;
    opacity: .1;
  }
  html[data-theme="sakura-dark"] body::before {
    background-size: 400px 320px;
    opacity: .25;
  }
}
