:root {
  color-scheme: dark;
  --theme-page: #09120e;
  --theme-surface: #0f1b16;
  --theme-raised: #14231b;
  --theme-subtle: #11251a;
  --theme-text: #eef6f1;
  --theme-secondary: #c1d0c7;
  --theme-muted: #9fb3a9;
  --theme-border: #26372e;
  --theme-accent: #5be0a4;
  --theme-link: #5be0a4;
  --theme-control: #09120e;
  --theme-action: #45dca5;
  --theme-action-hover: #35ca96;
  --theme-on-action: #071a12;
  --theme-shadow: 0 10px 34px rgb(0 0 0 / 35%);
}

:root[data-theme="light"] {
  color-scheme: light;
  --theme-page: #f7f9f7;
  --theme-surface: #fff;
  --theme-raised: #f1f5f2;
  --theme-subtle: #e8f3eb;
  --theme-text: #17221c;
  --theme-secondary: #344139;
  --theme-muted: #59675e;
  --theme-border: #d7e0d9;
  --theme-accent: #08764f;
  --theme-link: #08764f;
  --theme-control: #fff;
  --theme-action: #45dca5;
  --theme-action-hover: #35ca96;
  --theme-on-action: #071a12;
  --theme-shadow: 0 8px 24px rgb(29 42 35 / 7%);
}

:root { --ink: var(--theme-text); --muted: var(--theme-muted); --green: var(--theme-accent); --green-dark: var(--theme-link); --paper: var(--theme-page); --line: var(--theme-border); --shadow: var(--theme-shadow); }
body { color: var(--theme-text); background: var(--theme-page); color-scheme: inherit; }
button, input, select, textarea { color-scheme: inherit; }
input, select, textarea { accent-color: var(--theme-accent); }
::selection { color: var(--theme-page); background: var(--theme-accent); }

:root[data-theme="dark"] .clinic-dashboard-page {
  --dash-page: #07120e;
  --dash-side: #0d1d16;
  --dash-card: #10231a;
  --dash-border: #263b30;
  --dash-accent: #45dca5;
  --dash-accent-soft: #153d2d;
  --dash-action: #45dca5;
  --dash-action-hover: #35ca96;
  --dash-on-accent: #071a12;
  --dash-text: #eaf5ef;
  --dash-muted: #9bafa4;
  --dash-input: #0a1812;
  color-scheme: dark;
  color: var(--dash-text);
  background: var(--dash-page);
}
:root[data-theme="light"] .clinic-dashboard-page {
  --dash-page: #e9f0ec;
  --dash-side: #e5ede7;
  --dash-card: #f3f6f3;
  --dash-border: #d6e2db;
  --dash-accent: #13805a;
  --dash-accent-soft: #dcefe3;
  --dash-action: #45dca5;
  --dash-action-hover: #35ca96;
  --dash-on-accent: #071a12;
  --dash-text: #111b15;
  --dash-muted: #46564c;
  --dash-input: #edf2ee;
  color-scheme: light;
  color: var(--dash-text);
  background: var(--dash-page);
}
:root[data-theme] .clinic-dashboard-page .clinic-header,
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar { background: var(--dash-side); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar { border-color: var(--dash-border); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar details,
:root[data-theme] .clinic-dashboard-page .dashboard-stat-card,
:root[data-theme] .clinic-dashboard-page .dashboard-panel,
:root[data-theme] .clinic-dashboard-page .module-card {
  border-color: var(--dash-border);
  color: var(--dash-text);
  background: var(--dash-card);
}
:root[data-theme] .clinic-dashboard-page .dashboard-welcome h1,
:root[data-theme] .clinic-dashboard-page .panel-heading h2,
:root[data-theme] .clinic-dashboard-page .dashboard-stat-card > strong,
:root[data-theme] .clinic-dashboard-page .appointment-person strong { color: var(--dash-text); }
:root[data-theme] .clinic-dashboard-page .dashboard-welcome p,
:root[data-theme] .clinic-dashboard-page .dashboard-stat-card > span,
:root[data-theme] .clinic-dashboard-page .dashboard-stat-card > small,
:root[data-theme] .clinic-dashboard-page .appointment-person > span,
:root[data-theme] .clinic-dashboard-page .appointment-time,
:root[data-theme] .clinic-dashboard-page .appointment-table td,
:root[data-theme] .clinic-dashboard-page .appointment-table th,
:root[data-theme] .clinic-dashboard-page .sidebar-help span { color: var(--dash-muted); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a { color: var(--dash-muted); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current {
  color: var(--dash-accent);
  background-color: var(--dash-accent-soft);
  font-weight: 700;
}
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current span,
:root[data-theme] .clinic-dashboard-page .panel-eyebrow { color: var(--dash-accent); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a:hover,
:root[data-theme] .clinic-dashboard-page .appointment-table tbody tr:hover { color: var(--dash-text); background: var(--dash-accent-soft); }
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current:hover,
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current:active {
  color: var(--dash-accent);
  background-color: var(--dash-accent-soft);
}
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current:hover span,
:root[data-theme] .clinic-dashboard-page .dashboard-sidebar nav a.is-current:active span {
  color: var(--dash-accent);
}
:root[data-theme] .clinic-dashboard-page .sidebar-logout { border-color: var(--dash-border); }
:root[data-theme] .clinic-dashboard-page .sidebar-logout button { color: var(--dash-muted); }
:root[data-theme] .clinic-dashboard-page .clinic-header-context strong,
:root[data-theme] .clinic-dashboard-page .clinic-header-context .clinic-name-primary { color: var(--dash-text); }
:root[data-theme] .clinic-dashboard-page .clinic-header-context .clinic-name-accent,
:root[data-theme] .clinic-dashboard-page .brand-accent { color: var(--dash-accent); }
:root[data-theme] .clinic-dashboard-page .clinic-profile-panel {
  border-color: var(--dash-border);
  color: var(--dash-text);
  background: var(--dash-card);
}
:root[data-theme] .clinic-dashboard-page .clinic-profile-panel a,
:root[data-theme] .clinic-dashboard-page .clinic-profile-panel button,
:root[data-theme] .clinic-dashboard-page .clinic-drawer-details h2,
:root[data-theme] .clinic-dashboard-page .clinic-drawer-details dd { color: var(--dash-text); }
:root[data-theme] .clinic-dashboard-page .clinic-profile-menu > summary:hover,
:root[data-theme] .clinic-dashboard-page .clinic-profile-menu[open] > summary { border-color: var(--dash-border); background: var(--dash-card); }
:root[data-theme] .clinic-dashboard-page .button-dark { color: var(--dash-on-accent); background: var(--dash-accent); }
:root[data-theme] .clinic-dashboard-page .button-dark:hover { color: var(--dash-on-accent); filter: brightness(1.07); }
:root[data-theme] .clinic-dashboard-page .button-light { color: var(--dash-text); border-color: var(--dash-border); background: var(--dash-card); }
:root[data-theme] .clinic-dashboard-page .button-light:hover { color: var(--dash-accent); border-color: var(--dash-accent); background: var(--dash-accent-soft); }
:root[data-theme] .clinic-dashboard-page .appointment-table th { background: var(--dash-side); }
:root[data-theme] .clinic-dashboard-page .appointment-table td { border-color: var(--dash-border); }
:root[data-theme] .clinic-dashboard-page .appointment-table td strong,
:root[data-theme] .clinic-dashboard-page .appointment-table td code { color: var(--dash-text); }
:root[data-theme] .clinic-dashboard-page .appointment-filter-form,
:root[data-theme] .clinic-dashboard-page .doctor-profile-form { border-color: var(--dash-border); background: var(--dash-card); }
:root[data-theme] .clinic-dashboard-page .appointment-filter-form label,
:root[data-theme] .clinic-dashboard-page .doctor-profile-form p { color: var(--dash-muted); }
:root[data-theme] .clinic-dashboard-page .appointment-filter-form input,
:root[data-theme] .clinic-dashboard-page .appointment-filter-form select,
:root[data-theme] .clinic-dashboard-page .doctor-profile-form .clinic-field input,
:root[data-theme] .clinic-dashboard-page .doctor-profile-form .clinic-field textarea,
:root[data-theme] .clinic-dashboard-page .doctor-profile-form .clinic-field select {
  color: var(--dash-text);
  border-color: var(--dash-border);
  background: var(--dash-input);
}
:root[data-theme] .clinic-dashboard-page .appointment-row,
:root[data-theme] .clinic-dashboard-page .activity-row { border-color: var(--dash-border); }
:root[data-theme] .clinic-dashboard-page .table-detail-link {
  border-color: var(--dash-border);
  color: var(--dash-accent);
  background: var(--dash-accent-soft);
}
:root[data-theme] .clinic-dashboard-page .dashboard-empty-state { color: var(--dash-muted); }

.theme-toggle {
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--theme-border);
  border-radius: 99px;
  color: var(--theme-text);
  background: var(--theme-surface);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s;
}
.theme-toggle:hover { border-color: var(--theme-accent); }
.theme-toggle:focus-visible { outline: 3px solid rgb(91 224 164 / 55%); outline-offset: 3px; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }
.clinic-header > .theme-toggle { margin-left: auto; }

.clinic-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  margin-bottom: 24px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-page);
}
.clinic-auth-tabs a {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 999px;
  color: var(--theme-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.clinic-auth-tabs a[aria-current="page"] {
  color: var(--theme-accent);
  background: var(--theme-raised);
}
.clinic-auth-tabs a:focus-visible,
.clinic-sso-button:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}
.clinic-sso-divider {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 22px 0 14px;
  color: var(--theme-muted);
  font-size: 12px;
}
.clinic-sso-divider::before,
.clinic-sso-divider::after {
  height: 1px;
  flex: 1;
  background: var(--theme-border);
  content: "";
}
.clinic-sso-providers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.clinic-sso-providers form { min-width: 0; }
.clinic-sso-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  color: var(--theme-text);
  background: var(--theme-surface);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.clinic-sso-button:not(:disabled):hover {
  border-color: var(--theme-accent);
  background: var(--theme-raised);
  transform: translateY(-1px);
}
.clinic-sso-button:disabled { opacity: .62; cursor: not-allowed; }
.clinic-sso-mark { width: 18px; flex: 0 0 auto; text-align: center; }
.clinic-sso-mark-google { color: #4285f4; font-size: 17px; font-weight: 700; }
.clinic-sso-mark-apple { color: var(--theme-text); }
.clinic-sso-mark-apple svg { display: block; width: 15px; height: 15px; fill: currentColor; }
.clinic-sso-mark-microsoft {
  width: 16px;
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
}
.clinic-sso-mark-microsoft i:nth-child(1) { background: #f25022; }
.clinic-sso-mark-microsoft i:nth-child(2) { background: #7fba00; }
.clinic-sso-mark-microsoft i:nth-child(3) { background: #00a4ef; }
.clinic-sso-mark-microsoft i:nth-child(4) { background: #ffb900; }

.clinic-page { color: var(--theme-text); color-scheme: inherit; background: var(--theme-page); }
.clinic-header-link { color: var(--theme-muted); }
.clinic-card, .clinic-page .dashboard-panel, .clinic-page .appointment-filter-form,
.clinic-page .clinic-profile-panel, .clinic-page .clinic-profile-menu .clinic-profile-panel,
.clinic-page .doctor-profile-form, .clinic-page .rx-card,
.clinic-page .doctor-filter-card, .clinic-page .doctor-card,
.clinic-page .booking-card, .clinic-page .confirmation-card,
.clinic-page .no-doctors, .clinic-page .clinic-directory-card,
.clinic-page .clinic-details-panel, .clinic-page .clinic-details-hero {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}
.clinic-page .clinic-main { color: var(--theme-text); }
.clinic-page .patient-form-card { color: var(--theme-text); border-color: var(--theme-border); background: var(--theme-surface); box-shadow: var(--theme-shadow); }
.clinic-page .patient-form-card h1 { color: var(--theme-text); }
.clinic-page .patient-form-card > p,
.clinic-page .patient-form-grid .clinic-field label { color: var(--theme-muted); }
.clinic-page .rx-page { color: var(--theme-text); }
.clinic-page .clinic-field label, .clinic-page .clinic-field legend,
.clinic-page .doctor-filter-card label, .clinic-page .booking-field label,
.clinic-page.clinic-dashboard-page .panel-heading h2,
.clinic-page.clinic-dashboard-page .clinic-header-context strong,
.clinic-page.clinic-dashboard-page .clinic-header-context .clinic-name-primary,
.clinic-page.clinic-dashboard-page .dashboard-welcome h1,
.clinic-page.clinic-dashboard-page .appointment-person strong,
.clinic-page.clinic-dashboard-page .dashboard-stat-card > strong,
.clinic-page.clinic-dashboard-page .dashboard-empty-state strong,
.clinic-page.clinic-dashboard-page .clinic-detail-list dd,
.clinic-page.clinic-dashboard-page .appointment-table td,
.clinic-page.clinic-dashboard-page .appointment-detail-list dd,
.clinic-page.clinic-dashboard-page .doctor-row strong,
.clinic-page .rx-page h1, .clinic-page .rx-card h2, .clinic-page .rx-card h3 {
  color: var(--theme-secondary);
}
.clinic-page .clinic-field input:not([type=checkbox]), .clinic-page .clinic-field textarea,
.clinic-page .clinic-field select, .clinic-page .doctor-filter-card input,
.clinic-page .doctor-filter-card select, .clinic-page .booking-field input,
.clinic-page .booking-field select, .clinic-page .booking-field textarea,
.clinic-page .rx-search input, .clinic-page .rx-field input:not([type=checkbox]),
.clinic-page .rx-field select, .clinic-page .rx-field textarea,
.clinic-page .rx-amendment textarea {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
.clinic-page input::placeholder, .clinic-page textarea::placeholder { color: var(--theme-muted); opacity: 1; }
.clinic-page .clinic-header, .clinic-page .clinic-workspace { color: var(--theme-text); }
.clinic-page.clinic-dashboard-page .dashboard-stat-card,
.clinic-page.clinic-dashboard-page .appointment-row,
.clinic-page.clinic-dashboard-page .dashboard-empty-state,
.clinic-page.clinic-dashboard-page .sidebar-help,
.clinic-page.clinic-dashboard-page .clinic-detail-list,
.clinic-page.clinic-dashboard-page .doctor-row,
.clinic-page.clinic-dashboard-page .clinic-weekly-preview-row,
.clinic-page.clinic-dashboard-page .clinic-period-row,
.clinic-page.clinic-dashboard-page .clinic-closure-row,
.clinic-page.clinic-dashboard-page .clinic-schedule-section,
.clinic-page.clinic-dashboard-page .clinic-profile-panel,
.clinic-page.clinic-dashboard-page .clinic-drawer-details,
.clinic-page.clinic-dashboard-page .rx-info-grid > div,
.clinic-page.clinic-dashboard-page .rx-vitals li,
.clinic-page .rx-info-grid > div,
.clinic-page .rx-vitals li {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background-color: var(--theme-raised);
}
.clinic-page.clinic-dashboard-page p, .clinic-page.clinic-dashboard-page small,
.clinic-page.clinic-dashboard-page .clinic-schedule-note,
.clinic-page.clinic-dashboard-page .appointment-person > span,
.clinic-page.clinic-dashboard-page .clinic-detail-list dd,
.clinic-page.clinic-dashboard-page .clinic-detail-list dt,
.clinic-page.clinic-dashboard-page .doctor-row > div > span,
.clinic-page .rx-page p, .clinic-page .rx-table td, .clinic-page .rx-table th,
.clinic-page .rx-table td small, .clinic-page .rx-reference,
.clinic-page .rx-muted, .clinic-page .rx-info-grid span,
.clinic-page .rx-info-grid small, .clinic-page .rx-preview > p,
.clinic-page .rx-preview > ul, .clinic-page .rx-document-footer,
.clinic-page .rx-signature-space {
  color: var(--theme-muted);
}
.clinic-page .rx-table td, .clinic-page .rx-table th,
.clinic-page .rx-document-header, .clinic-page .rx-document-footer,
.clinic-page .rx-info-grid { border-color: var(--theme-border); }
.clinic-page .rx-card, .clinic-page .rx-finalized-state,
.clinic-page .rx-medicine-form, .clinic-page .rx-info-grid,
.clinic-page .rx-notice, .clinic-page .rx-vitals li {
  border-color: var(--theme-border);
  background-color: var(--theme-raised);
}
.clinic-page .rx-field label, .clinic-page .rx-amendment label,
.clinic-page .rx-table td, .clinic-page .rx-info-grid strong,
.clinic-page .rx-summary-item strong, .clinic-page .rx-preview > h3 { color: var(--theme-secondary); }
.clinic-page .clinic-profile-menu .clinic-profile-panel,
.clinic-page .clinic-profile-menu .clinic-drawer-details,
.clinic-page .clinic-profile-menu .clinic-drawer-details > div,
.clinic-page .clinic-profile-menu .clinic-drawer-details dd { color: var(--theme-text); }
.clinic-page .clinic-profile-menu .clinic-drawer-details h2 { color: var(--theme-text); }
.clinic-page .clinic-profile-menu .clinic-profile-panel button,
.clinic-page .clinic-profile-menu .clinic-profile-panel a { color: var(--theme-link); }
.clinic-page .button-light {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-raised);
}
.clinic-page.clinic-dashboard-page .doctor-edit-link { color: var(--theme-link); border-color: var(--theme-border); background: var(--theme-raised); }
.clinic-page.clinic-dashboard-page .clinic-preview-closed,
.clinic-page.clinic-dashboard-page .clinic-availability-disabled { color: var(--theme-muted); }
.clinic-page .doctor-specializations span, .clinic-page .specialization-chip span {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-raised);
}
.clinic-page .specialization-chip input:checked + span { color: var(--theme-link); border-color: var(--theme-accent); background: var(--theme-subtle); }
.clinic-page .clinic-profile-menu > summary { color: var(--theme-text); }
.clinic-page .clinic-header-context { color: var(--theme-text); }
.clinic-page .clinic-header .brand { color: var(--theme-text); }
.clinic-page .clinic-flash-message { border-color: var(--theme-border); }
.clinic-page .clinic-profile-edit-form .clinic-field input:not([type=checkbox]),
.clinic-page .clinic-profile-edit-form .clinic-field textarea,
.clinic-page .clinic-profile-edit-form .clinic-field select,
.clinic-page .clinic-schedule-form .clinic-field input:not([type=checkbox]),
.clinic-page .clinic-schedule-form .clinic-field textarea,
.clinic-page .clinic-schedule-form .clinic-field select,
.clinic-page .clinic-availability-form input {
  color-scheme: inherit;
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
.clinic-page .clinic-schedule-page .dashboard-welcome h1,
.clinic-page .clinic-profile-edit-section h2,
.clinic-page .clinic-profile-edit-heading h1 { color: var(--theme-text); }
.clinic-page .clinic-period-fields .clinic-field label,
.clinic-page .clinic-closure-fields .clinic-field label,
.clinic-page .clinic-weekday-row,
.clinic-page .clinic-weekly-preview-row,
.clinic-page .clinic-weekly-preview-row > div span,
.clinic-page .clinic-period-row,
.clinic-page .clinic-closure-row { color: var(--theme-secondary); }
.clinic-page .clinic-profile-specialization-list label,
.clinic-page .clinic-profile-login-note,
.clinic-page .clinic-profile-edit-heading p,
.clinic-page .clinic-schedule-note { color: var(--theme-muted); }
.clinic-page .clinic-profile-login-note { border-color: var(--theme-border); background: var(--theme-raised); }
.clinic-page .clinic-profile-edit-actions { border-color: var(--theme-border); }
.clinic-page .clinic-row-remove { color: #ffaaaa; border-color: #75403e; background: #3a201f; }
.clinic-page .clinic-row-remove:hover { background: #512a28; }
.clinic-page .clinic-preview-slots li { color: #9af0bb; border-color: #286846; background: #123c29; }
.clinic-page .clinic-schedule-warning { color: #f4d48d; border-color: #705b2d; background: #322a17; }
.clinic-page .clinic-flash-message { color: #9af0bb; border-color: #286846; background: #123c29; }
.clinic-page .clinic-flash-error { color: #ffaaa1; border-color: #75403e; background: #3a201f; }
.clinic-page .clinic-flash-warning { color: #f4d48d; border-color: #705b2d; background: #322a17; }
.clinic-page .clinic-booking-dialog {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}
.clinic-page .clinic-booking-close {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-raised);
}
.clinic-page .clinic-booking-dialog .booking-field label { color: var(--theme-secondary); }
.clinic-page .clinic-booking-dialog .booking-field input,
.clinic-page .clinic-booking-dialog .booking-field textarea {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
.clinic-page .clinic-date-option,
.clinic-page .clinic-date-option strong,
.clinic-page .clinic-availability-form label { color: var(--theme-secondary); }
.clinic-page .clinic-date-option {
  border-color: var(--theme-border);
  background: var(--theme-surface);
}
.clinic-page .clinic-date-option.is-selected { color: var(--theme-link); border-color: var(--theme-accent); background: var(--theme-subtle); }
.clinic-page .availability-slot.is-available { color: #9af0bb; border-color: #286846; background: #123c29; }
.clinic-page .availability-slot.is-available:hover,
.clinic-page .availability-slot.is-available.is-selected { color: #d8ffe3; border-color: #5be0a4; background: #185638; }
.clinic-page .availability-slot.is-full { color: #ffaaaa; border-color: #75403e; background: #3a201f; }
.clinic-page .availability-slot.is-unavailable { color: #aab5ae; border-color: #39463e; background: #202a24; }
.clinic-page .clinic-details-week .clinic-directory-hours-row { border-color: var(--theme-border); }
.clinic-page .clinic-preview-closed, .clinic-page .clinic-weekly-closed { color: var(--theme-muted); }
.clinic-page.clinic-dashboard-page {
  color-scheme: inherit;
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --green: var(--theme-accent);
  --green-dark: var(--theme-link);
  --paper: var(--theme-page);
  --line: var(--theme-border);
  --shadow: var(--theme-shadow);
  color: var(--theme-text);
  background: var(--theme-page);
}
.clinic-page.clinic-dashboard-page .dashboard-panel,
.clinic-page.clinic-dashboard-page .dashboard-sidebar,
.clinic-page.clinic-dashboard-page .dashboard-sidebar details,
.clinic-page.clinic-dashboard-page .clinic-profile-menu .clinic-profile-panel,
.clinic-page.clinic-dashboard-page .dashboard-stat-card,
.clinic-page.clinic-dashboard-page .clinic-schedule-form,
.clinic-page.clinic-dashboard-page .clinic-schedule-section,
.clinic-page.clinic-dashboard-page .clinic-period-row,
.clinic-page.clinic-dashboard-page .clinic-closure-row,
.clinic-page.clinic-dashboard-page .appointment-filter-form,
.clinic-page.clinic-dashboard-page .appointment-detail-panel,
.clinic-page.clinic-dashboard-page .appointment-table-panel,
.clinic-page.clinic-dashboard-page .patient-history-panel,
.clinic-page.clinic-dashboard-page .vital-panel,
.clinic-page.clinic-dashboard-page .patient-profile-grid > *,
.clinic-page.clinic-dashboard-page .appointment-table th,
.clinic-page.clinic-dashboard-page .workflow-unavailable-note,
.clinic-page.clinic-dashboard-page .clinic-weekly-preview-row {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background-color: var(--theme-surface);
}
.clinic-page.clinic-dashboard-page .appointment-table td,
.clinic-page.clinic-dashboard-page .appointment-table th,
.clinic-page.clinic-dashboard-page .appointment-detail-list dd,
.clinic-page.clinic-dashboard-page .appointment-detail-list dt,
.clinic-page.clinic-dashboard-page .appointment-table td strong,
.clinic-page.clinic-dashboard-page .appointment-table td code,
.clinic-page.clinic-dashboard-page .clinic-weekly-preview-row,
.clinic-page.clinic-dashboard-page .clinic-period-row label,
.clinic-page.clinic-dashboard-page .clinic-closure-row label {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
}
.clinic-page.clinic-dashboard-page .appointment-table td small,
.clinic-page.clinic-dashboard-page .dashboard-welcome p,
.clinic-page.clinic-dashboard-page .dashboard-stat-card > span,
.clinic-page.clinic-dashboard-page .dashboard-stat-card > small,
.clinic-page.clinic-dashboard-page .appointment-table th,
.clinic-page.clinic-dashboard-page .appointment-pagination,
.clinic-page.clinic-dashboard-page .dashboard-list-note,
.clinic-page.clinic-dashboard-page .dashboard-empty-state p,
.clinic-page.clinic-dashboard-page .sidebar-help span,
.clinic-page.clinic-dashboard-page .clinic-header-context .clinic-name-accent,
.clinic-page.clinic-dashboard-page .dashboard-data-note,
.clinic-page.clinic-dashboard-page .appointment-person > span,
.clinic-page.clinic-dashboard-page .clinic-detail-list dt {
  color: var(--theme-muted);
}
.clinic-page.clinic-dashboard-page .appointment-filter-form input,
.clinic-page.clinic-dashboard-page .appointment-filter-form select,
.clinic-page.clinic-dashboard-page .clinical-entry-form input,
.clinic-page.clinic-dashboard-page .clinical-entry-form select,
.clinic-page.clinic-dashboard-page .clinical-entry-form textarea,
.clinic-page.clinic-dashboard-page .patient-form-grid input,
.clinic-page.clinic-dashboard-page .patient-form-grid select,
.clinic-page.clinic-dashboard-page .patient-form-grid textarea {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
.clinic-page.clinic-dashboard-page .appointment-row,
.clinic-page.clinic-dashboard-page .doctor-row,
.clinic-page.clinic-dashboard-page .appointment-table td,
.clinic-page.clinic-dashboard-page .appointment-detail-list > div,
.clinic-page.clinic-dashboard-page .patient-edit-details,
.clinic-page.clinic-dashboard-page .appointment-detail-list,
.clinic-page.clinic-dashboard-page .clinic-weekly-preview-row {
  border-color: var(--theme-border);
}
.clinic-page.clinic-dashboard-page .workflow-unavailable-note strong { color: var(--theme-secondary); }
.clinic-page.clinic-dashboard-page .clinic-header-context .clinic-name-accent,
.clinic-page.clinic-dashboard-page .clinic-detail-list a,
.clinic-page.clinic-dashboard-page .appointment-detail-list a { color: var(--theme-link); }
.clinic-page.clinic-dashboard-page .dashboard-welcome .section-badge,
.clinic-page.clinic-dashboard-page .clinic-profile-menu > summary,
.clinic-page.clinic-dashboard-page .clinic-profile-menu[open] > summary,
.clinic-page.clinic-dashboard-page .clinic-profile-menu > summary:hover {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-raised);
}
.clinic-page.clinic-dashboard-page .allergy-chip,
.clinic-page.clinic-dashboard-page .allergy-status-banner,
.clinic-page.clinic-dashboard-page .allergy-list li,
.clinic-page.clinic-dashboard-page .appointment-status {
  border-color: var(--theme-border);
  background: var(--theme-raised);
}
.clinic-page.clinic-dashboard-page .clinic-flash-message { color: var(--theme-secondary); background: var(--theme-raised); }
.clinic-page.clinic-dashboard-page .clinic-row-remove { color: var(--theme-secondary); background: var(--theme-raised); }

.clinic-page .doctor-card h3, .clinic-page .doctor-card .clinic-name,
.clinic-page .doctor-card-bottom strong, .clinic-page .booking-card h1,
.clinic-page .confirmation-card h1, .clinic-page .doctor-results-heading h2 {
  color: var(--theme-text);
}
.clinic-page .clinic-directory-card-heading h3,
.clinic-page .clinic-directory-schedule h4,
.clinic-page .clinic-directory-doctors h4,
.clinic-page .clinic-directory-hours-row > strong,
.clinic-page .clinic-directory-doctor > div:first-child strong,
.clinic-page .clinic-details-panel h2,
.clinic-page .clinic-details-hero h1,
.clinic-page .appointment-details dd { color: var(--theme-text); }
.clinic-page .clinic-profile-title-row h1,
.clinic-page .clinic-profile-facts dd { color: var(--theme-text); }
.clinic-page .clinic-profile-facts dt,
.clinic-page .clinic-profile-address,
.clinic-page .clinic-profile-address span { color: var(--theme-muted); }
.clinic-page .clinic-profile-schedule { border-color: var(--theme-border); }
.clinic-page .doctor-filter-card label, .clinic-page .booking-field label,
.clinic-page .doctor-specializations span, .clinic-page .back-link,
.clinic-page .doctor-card-bottom p, .clinic-page .pin-search-notice,
.clinic-page .email-note {
  color: var(--theme-secondary);
}
.clinic-page .pin-search-notice, .clinic-page .email-note { border-color: var(--theme-border); background: var(--theme-raised); }
.clinic-page .doctor-card-bottom { border-color: var(--theme-border); }
.clinic-page .doctor-avatar, .clinic-page .distance-chip,
.clinic-page .no-doctors-icon, .clinic-page .confirmation-check {
  color: var(--theme-link);
  background: var(--theme-subtle);
}
.clinic-page .form-error-summary { color: #ffaaa1; background: #321c1b; }
.clinic-page .clinic-error, .clinic-page .field-error { color: #ffaaa1; }

:root[data-theme="light"] .clinic-page.clinic-dashboard-page {
  --green: #17b57a;
  --green-dark: #12885c;
}
:root[data-theme="light"] .clinic-page.clinic-dashboard-page .appointment-status,
:root[data-theme="light"] .clinic-page.clinic-dashboard-page .allergy-chip,
:root[data-theme="light"] .clinic-page.clinic-dashboard-page .allergy-status-banner,
:root[data-theme="light"] .clinic-page.clinic-dashboard-page .allergy-list li,
:root[data-theme="light"] .clinic-page.clinic-dashboard-page .clinic-flash-message {
  background: var(--theme-raised);
}

:root[data-theme="light"] .clinic-page {
  --paper: var(--theme-page);
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --line: var(--theme-border);
  --green: var(--theme-accent);
  --green-dark: var(--theme-link);
  background: radial-gradient(circle at 10% 10%, #edf8f0, transparent 34%), var(--theme-page);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card h1,
:root[data-theme="light"] .clinic-page .clinic-auth-card label {
  color: var(--theme-secondary);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card > p {
  color: var(--theme-muted);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-field input:not([type=checkbox]),
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-field textarea,
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-field select {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-submit {
  color: #fff;
  background: #151916;
}
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-switch a {
  color: var(--theme-link);
}
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-notice {
  color: #325541;
  border-color: #d7e9da;
  background: #f1f8f2;
}
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-errors {
  color: #9d3438;
  background: #fff0f0;
}
:root[data-theme="light"] .clinic-page .registration-trial,
:root[data-theme="light"] .clinic-page .registration-form {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}
:root[data-theme="light"] .clinic-page .registration-intro h1,
:root[data-theme="light"] .clinic-page .registration-section-heading h2 {
  color: var(--theme-text);
}
:root[data-theme="light"] .clinic-page .registration-intro > p,
:root[data-theme="light"] .clinic-page .registration-section-heading p,
:root[data-theme="light"] .clinic-page .registration-location-note,
:root[data-theme="light"] .clinic-page .registration-trial p,
:root[data-theme="light"] .clinic-page .registration-submit-area > p,
:root[data-theme="light"] .clinic-page .registration-footer-link {
  color: var(--theme-muted);
}
:root[data-theme="light"] .clinic-page .registration-trial {
  border-color: var(--theme-border);
  background: var(--theme-subtle);
}
:root[data-theme="light"] .clinic-page .registration-trial-number,
:root[data-theme="light"] .clinic-page .registration-section-index {
  color: var(--theme-accent);
  border-color: var(--theme-border);
  background: var(--theme-subtle);
}
:root[data-theme="light"] .clinic-page .registration-field > label,
:root[data-theme="light"] .clinic-page .registration-specializations legend,
:root[data-theme="light"] .clinic-page .registration-terms {
  color: var(--theme-secondary);
}
:root[data-theme="light"] .clinic-page .registration-field > input,
:root[data-theme="light"] .clinic-page .registration-field > textarea,
:root[data-theme="light"] .clinic-page .registration-field > select,
:root[data-theme="light"] .clinic-page .registration-password input,
:root[data-theme="light"] .clinic-page .registration-specialization-search input,
:root[data-theme="light"] .clinic-page .registration-specialization-picker .specialization-control input {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-control);
}
:root[data-theme="light"] .clinic-page .registration-specialization-scroll {
  border-color: var(--theme-border);
  background: var(--theme-raised);
  scrollbar-color: #9aac9f var(--theme-raised);
}
:root[data-theme="light"] .clinic-page .registration-specialization-scroll::-webkit-scrollbar-track {
  background: var(--theme-raised);
}
:root[data-theme="light"] .clinic-page .registration-specialization-scroll::-webkit-scrollbar-thumb {
  border-color: var(--theme-raised);
  background: #9aac9f;
}
:root[data-theme="light"] .clinic-page .registration-specialization-pill span {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}
:root[data-theme="light"] .clinic-page .registration-specialization-pill input:checked + span {
  color: #126b49;
  border-color: #b8e8ce;
  background: #eaf8f0;
}
:root[data-theme="light"] .clinic-page .registration-page .clinic-error {
  color: #9d3438;
}
:root[data-theme="light"] .clinic-page .registration-form .clinic-errors {
  color: #9d3438;
  background: #fff0f0;
}
:root[data-theme="light"] .clinic-page .registration-submit {
  color: #fff;
  background: #151916;
}
:root[data-theme="light"] .clinic-page .clinic-field input:not([type=checkbox]),
:root[data-theme="light"] .clinic-page .clinic-field textarea,
:root[data-theme="light"] .clinic-page .clinic-field select,
:root[data-theme="light"] .clinic-page .doctor-filter-card input,
:root[data-theme="light"] .clinic-page .doctor-filter-card select,
:root[data-theme="light"] .clinic-page .booking-field input,
:root[data-theme="light"] .clinic-page .booking-field select,
:root[data-theme="light"] .clinic-page .booking-field textarea,
:root[data-theme="light"] .clinic-page .rx-field input:not([type=checkbox]),
:root[data-theme="light"] .clinic-page .rx-field select,
:root[data-theme="light"] .clinic-page .rx-field textarea {
  color: #26332a;
  background: #fff;
}
:root[data-theme="light"] .clinic-page .clinic-profile-edit-form .clinic-field input:not([type=checkbox]),
:root[data-theme="light"] .clinic-page .clinic-profile-edit-form .clinic-field textarea,
:root[data-theme="light"] .clinic-page .clinic-profile-edit-form .clinic-field select,
:root[data-theme="light"] .clinic-page .clinic-schedule-form .clinic-field input:not([type=checkbox]),
:root[data-theme="light"] .clinic-page .clinic-schedule-form .clinic-field textarea,
:root[data-theme="light"] .clinic-page .clinic-schedule-form .clinic-field select,
:root[data-theme="light"] .clinic-page .clinic-availability-form input,
:root[data-theme="light"] .clinic-page .clinic-booking-dialog .booking-field input,
:root[data-theme="light"] .clinic-page .clinic-booking-dialog .booking-field textarea {
  color-scheme: light;
  color: #26332a;
  border-color: #dfe7e0;
  background: #fff;
}
:root[data-theme="light"] .clinic-page .clinic-booking-dialog {
  color: #17221c;
  border-color: #e4ebe5;
  background: #fff;
  box-shadow: var(--theme-shadow);
}
:root[data-theme="light"] .clinic-page .clinic-booking-close { color: #26332a; border-color: #dfe7e0; background: #f5f8f5; }
:root[data-theme="light"] .clinic-page .clinic-booking-dialog .booking-field label { color: #344139; }
:root[data-theme="light"] .clinic-page .availability-slot.is-available { color: #126b49; border-color: #b8e4c8; background: #eef9f1; }
:root[data-theme="light"] .clinic-page .availability-slot.is-available:hover,
:root[data-theme="light"] .clinic-page .availability-slot.is-available.is-selected { color: #126b49; border-color: #16885b; background: #dff4e6; }
:root[data-theme="light"] .clinic-page .availability-slot.is-full { color: #a33939; border-color: #f0c8c8; background: #fff1f1; }
:root[data-theme="light"] .clinic-page .availability-slot.is-unavailable { color: #828a84; border-color: #e2e6e2; background: #f2f4f2; }
:root[data-theme="light"] .clinic-page .clinic-date-option,
:root[data-theme="light"] .clinic-page .clinic-date-option strong,
:root[data-theme="light"] .clinic-page .clinic-availability-form label { color: #17221c; }
:root[data-theme="light"] .clinic-page .clinic-date-option.is-selected { color: #126b49; border-color: #70c998; background: #e5f6eb; }
:root[data-theme="light"] .clinic-page .clinic-date-option > span { color: #68766e; }
:root[data-theme="light"] .clinic-page .clinic-profile-doctor-avatar,
:root[data-theme="light"] .clinic-page .clinic-row-remove { color: #8e4343; border-color: #e8dada; background: #fff; }
:root[data-theme="light"] .clinic-page .clinic-row-remove:hover { background: #fff4f3; }
:root[data-theme="light"] .clinic-page .clinic-preview-slots li { color: #176e4b; border-color: #d6eadd; background: #f0f8f2; }
:root[data-theme="light"] .clinic-page .clinic-schedule-warning { color: #765319; border-color: #ecdcb6; background: #fff9eb; }
:root[data-theme="light"] .clinic-page .clinic-flash-message { color: #325541; border-color: #d7e9da; background: #f1f8f2; }
:root[data-theme="light"] .clinic-page .clinic-flash-error { color: #9d3438; border-color: #f0d5d3; background: #fff0f0; }
:root[data-theme="light"] .clinic-page .clinic-flash-warning { color: #765319; border-color: #ecdcb6; background: #fff9eb; }
:root[data-theme="light"] .clinic-page .button-dark { color: #fff; background: #151916; }
:root[data-theme="light"] .clinic-page .registration-form,
:root[data-theme="light"] .clinic-page .registration-trial,
:root[data-theme="light"] .clinic-page .registration-specialization-scroll,
:root[data-theme="light"] .clinic-page .registration-specialization-pill span,
:root[data-theme="light"] .clinic-page .registration-field > input,
:root[data-theme="light"] .clinic-page .registration-field > textarea,
:root[data-theme="light"] .clinic-page .registration-field > select,
:root[data-theme="light"] .clinic-page .registration-password input,
:root[data-theme="light"] .clinic-page .registration-specialization-search input,
:root[data-theme="light"] .clinic-page .registration-specialization-picker .specialization-control input {
  color: #17221c;
  border-color: #dfe7e0;
  background: #fff;
}
:root[data-theme="light"] .clinic-page .registration-field > label,
:root[data-theme="light"] .clinic-page .registration-specializations legend,
:root[data-theme="light"] .clinic-page .registration-terms { color: #344139; }
:root[data-theme="light"] .clinic-page .registration-specialization-pill input:checked + span {
  color: #12885c;
  border-color: #b8e8ce;
  background: #eaf8f0;
}
:root[data-theme="light"] .clinic-page .specialization-selected-chip {
  color: #126b49;
  border-color: #b8e8ce;
  background: #eaf8f0;
}
:root[data-theme="light"] .clinic-page .specialization-toggle { color: #344139; }
:root[data-theme="light"] .clinic-page .specialization-menu {
  color: #17221c;
  border-color: #dfe8e1;
  background: #fff;
}
:root[data-theme="light"] .clinic-page .specialization-option:hover,
:root[data-theme="light"] .clinic-page .specialization-option:focus-visible {
  color: #17221c;
  background: #edf5ef;
}
:root[data-theme="light"] .clinic-page .specialization-option[aria-selected="true"] {
  color: #126b49;
  background: #eaf8f0;
}
:root[data-theme="light"] .clinic-page .specialization-clear {
  color: #536159;
  border-color: #dfe8e1;
}
:root[data-theme="light"] .clinic-page .registration-trial { background: #f1f8f2; }
:root[data-theme="light"] .clinic-page .registration-trial p { color: #68766e; }
:root[data-theme="light"] .clinic-page .registration-trial h2,
:root[data-theme="light"] .clinic-page .registration-section-heading h2,
:root[data-theme="light"] .clinic-page .registration-intro h1 { color: #17221c; }
:root[data-theme="light"] .clinic-page .patient-form-card { background: #fff; }
:root[data-theme="light"] .clinic-page .patient-form-card h1 { color: #1c2a21; }
:root[data-theme="light"] .clinic-page .patient-form-card > p,
:root[data-theme="light"] .clinic-page .patient-form-grid .clinic-field label { color: #6d7971; }
:root[data-theme="light"] .clinic-page .rx-page { color: #17221c; }
:root[data-theme="light"] .clinic-page .clinic-errors,
:root[data-theme="light"] .clinic-page .rx-errors,
:root[data-theme="light"] .clinic-page .form-error-summary { color: #9d3438; background: #fff0f0; }

:root[data-theme="light"] .marketing-page {
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --green: var(--theme-accent);
  --green-dark: var(--theme-link);
  --paper: var(--theme-page);
  --line: var(--theme-border);
  --shadow: var(--theme-shadow);
  color: var(--theme-text);
  background: var(--theme-page);
}
:root[data-theme="light"] .marketing-page .site-header.is-scrolled { background: rgb(247 249 247 / 94%); }
:root[data-theme="light"] .marketing-page .nav-links { color: #525a56; }
:root[data-theme="light"] .marketing-page .dropdown-menu,
:root[data-theme="light"] .marketing-page .feature-card,
:root[data-theme="light"] .marketing-page .step-art,
:root[data-theme="light"] .marketing-page .calculator-card,
:root[data-theme="light"] .marketing-page .cta-card,
:root[data-theme="light"] .marketing-page .modal,
:root[data-theme="light"] .marketing-page .social-links a,
:root[data-theme="light"] .marketing-page .button-light,
:root[data-theme="light"] .marketing-page .icon-button { color: #151916; border-color: #e9ece8; background: #fff; }
:root[data-theme="light"] .marketing-page .paperless-section { background: #f1f5f1; }
:root[data-theme="light"] .marketing-page .paper-benefits,
:root[data-theme="light"] .marketing-page .range-label,
:root[data-theme="light"] .marketing-page .calc-input-label,
:root[data-theme="light"] .marketing-page .form-field label { color: #344139; }
:root[data-theme="light"] .marketing-page .number-input,
:root[data-theme="light"] .marketing-page .form-field input,
:root[data-theme="light"] .marketing-page .form-field select { color: #17221c; border-color: #dfe7e0; background: #fff; }
:root[data-theme="light"] .marketing-page .art-calendar,
:root[data-theme="light"] .marketing-page .art-card,
:root[data-theme="light"] .marketing-page .rx-paper { color: #17221c; border-color: #e9ece8; background: #fff; box-shadow: 0 8px 20px rgb(29 42 35 / 8%); }
:root[data-theme="light"] .marketing-page .cta-art { background: radial-gradient(ellipse at 80% 45%, rgb(51 128 88 / 10%), transparent 64%); }
:root[data-theme="light"] .marketing-page .site-footer { border-color: #e9ece8; background: #f3f5f2; }
:root[data-theme="light"] .marketing-page .footer-bottom { border-color: #d8dfd8; }
:root[data-theme="light"] .marketing-page .dot-wordmark { opacity: .9; -webkit-text-stroke-color: #9eaca1; background-image: radial-gradient(#829486 1px, transparent 1.25px); }
:root[data-theme="light"] .marketing-page .modal-inner > p,
:root[data-theme="light"] .marketing-page .footer-about > p,
:root[data-theme="light"] .marketing-page .footer-links a,
:root[data-theme="light"] .marketing-page .footer-bottom { color: #68716d; }
:root[data-theme="light"] .marketing-page .footer-links h3 { color: #151916; }
:root[data-theme="light"] .marketing-page .button-dark { color: #fff; background: #151916; }
:root[data-theme="light"] .marketing-page .video-placeholder { color: #68716d; border-color: #dfe7e0; background: linear-gradient(135deg, #f1f7f2, #f8f8f6); }
:root[data-theme="light"] .marketing-page .form-errors { color: #9d3438; background: #fff0f0; }
:root[data-theme="light"] .marketing-page .toast,
:root[data-theme="light"] .marketing-page .fallback-success { color: #26332a; border-color: #dfe7e0; background: #fff; }
:root[data-theme="light"] .marketing-page .dropdown-menu { color: #344139; border-color: #e9ece8; background: #fff; }
:root[data-theme="light"] .marketing-page .dropdown-menu a:hover { background: #f4f8f5; }
:root[data-theme="light"] .marketing-page .clinic-header-link { color: #657169; }
:root[data-theme="light"] .marketing-page .clinic-header { background: #f8f8f6; }

@media (max-width: 900px) {
  .clinic-header > .theme-toggle { margin-left: auto; }
}
@media (max-width: 650px) {
  .marketing-page .theme-toggle { min-height: 36px; padding: 0 9px; font-size: 12px; }
  .clinic-header > .theme-toggle { margin-left: auto; }
}
@media (max-width: 480px) {
  .clinic-sso-providers { grid-template-columns: 1fr; }
  .clinic-sso-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .clinic-sso-button { transition: none; }
}

:root[data-theme="light"] .clinic-page,
:root[data-theme="light"] .marketing-page {
  color: var(--theme-text);
  background-color: var(--theme-page);
}

:root[data-theme="light"] .clinic-page :is(
  .clinic-card,
  .clinic-auth-card,
  .clinic-profile-panel,
  .dashboard-panel,
  .appointment-filter-form,
  .clinic-directory-card,
  .clinic-details-panel,
  .clinic-details-hero,
  .doctor-filter-card,
  .doctor-card,
  .booking-card,
  .confirmation-card,
  .no-doctors,
  .clinic-schedule-section,
  .clinic-profile-menu .clinic-profile-panel,
  .rx-card,
  .rx-medicine-form,
  .rx-finalized-state
),
:root[data-theme="light"] .marketing-page :is(
  .dropdown-menu,
  .feature-card,
  .step-art,
  .calculator-card,
  .cta-card,
  .modal,
  .social-links a,
  .app-window,
  .app-panel,
  .stat-card
) {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background-color: var(--theme-surface);
}

:root[data-theme="light"] .clinic-page :is(
  .dashboard-stat-card,
  .appointment-row,
  .dashboard-empty-state,
  .sidebar-help,
  .clinic-detail-list,
  .doctor-row,
  .clinic-weekly-preview-row,
  .clinic-period-row,
  .clinic-closure-row,
  .clinic-schedule-section,
  .rx-info-grid > div,
  .rx-vitals li
) {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background-color: var(--theme-raised);
}

:root[data-theme="light"] .clinic-page a:not(.button):not(.brand):not(.icon-button),
:root[data-theme="light"] .marketing-page a:not(.button):not(.brand):not(.icon-button) {
  color: var(--theme-link);
}

:root[data-theme="light"] .clinic-page a:not(.button):not(.brand):not(.icon-button):hover,
:root[data-theme="light"] .marketing-page a:not(.button):not(.brand):not(.icon-button):hover {
  color: #075c3f;
}

:root[data-theme="light"] .clinic-page :is(
  .clinic-header-link,
  .clinic-profile-menu .clinic-profile-panel a,
  .clinic-profile-menu .clinic-profile-panel button,
  .back-link,
  .clinic-profile-back,
  .rx-text-link,
  .rx-pagination
),
:root[data-theme="light"] .marketing-page :is(
  .nav-links,
  .dropdown-menu,
  .footer-links a,
  .footer-bottom,
  .hero-note,
  .app-sidebar > small,
  .side-link,
  .sidebar-profile small,
  .profile-more,
  .crumb,
  .crumb b,
  .app-notice,
  .app-date,
  .app-greeting p,
  .stat-head,
  .stat-card > small,
  .panel-title small,
  .calendar-strip > span,
  .calc-input-label span,
  .estimate-label,
  .calc-footnote,
  .calc-results small,
  .feature-card p,
  .workflow-step p,
  .footer-about > p
) {
  color: var(--theme-muted);
}

:root[data-theme="light"] .clinic-page :is(
  .clinic-field label,
  .clinic-field legend,
  .clinic-auth-card label,
  .doctor-filter-card label,
  .booking-field label,
  .rx-field label,
  .rx-amendment label,
  .clinic-availability-form label
),
:root[data-theme="light"] .marketing-page :is(
  .form-field label,
  .range-label,
  .calc-input-label,
  .paper-benefits
) {
  color: var(--theme-secondary);
}

:root[data-theme="light"] .clinic-page :is(
  .clinic-intro p,
  .clinic-card > p,
  .clinic-dashboard > p,
  .clinic-switch,
  .clinic-directory-no-hours,
  .clinic-details-note,
  .clinic-profile-address,
  .clinic-profile-address span,
  .clinic-profile-facts dt,
  .clinic-schedule-note,
  .clinic-preview-closed,
  .clinic-availability-disabled,
  .location-status,
  .form-note,
  .pin-code-status,
  .rx-page-heading p,
  .rx-table th,
  .rx-table td small,
  .rx-reference,
  .rx-pagination,
  .rx-empty p,
  .rx-muted,
  .rx-vitals time,
  .rx-info-grid span,
  .rx-info-grid small,
  .rx-document-footer,
  .rx-signature-space
),
:root[data-theme="light"] .marketing-page :is(
  .hero-copy > p,
  .section-heading p,
  .paperless-copy > p,
  .cta-copy > p,
  .hero-note,
  .footer-about > p,
  .footer-links a,
  .footer-bottom,
  .video-placeholder
) {
  color: var(--theme-muted);
}

:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  min-height: 42px;
  border: 1px solid var(--theme-border);
  border-radius: 9px;
  color: var(--theme-text);
  background: var(--theme-control);
  color-scheme: light;
}

:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):hover,
:root[data-theme="light"] select:hover,
:root[data-theme="light"] textarea:hover {
  border-color: #aebfb3;
}

:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):focus-visible,
:root[data-theme="light"] select:focus-visible,
:root[data-theme="light"] textarea:focus-visible {
  border-color: var(--theme-accent);
  outline: 3px solid rgb(8 118 79 / 18%);
  outline-offset: 1px;
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

:root[data-theme="light"] .clinic-page .registration-form .registration-field input::placeholder,
:root[data-theme="light"] .clinic-page .clinic-field input::placeholder,
:root[data-theme="light"] .clinic-page .clinic-field textarea::placeholder,
:root[data-theme="light"] .marketing-page .form-field input::placeholder,
:root[data-theme="light"] .marketing-page .form-field textarea::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

:root[data-theme="light"] input[readonly],
:root[data-theme="light"] textarea[readonly] {
  background: var(--theme-raised);
}

:root[data-theme="light"] input:disabled,
:root[data-theme="light"] select:disabled,
:root[data-theme="light"] textarea:disabled {
  color: var(--theme-muted);
  border-color: var(--theme-border);
  background: #e9eeea;
  opacity: 1;
  cursor: not-allowed;
}

:root[data-theme="light"] input[aria-invalid="true"],
:root[data-theme="light"] select[aria-invalid="true"],
:root[data-theme="light"] textarea[aria-invalid="true"],
:root[data-theme="light"] .clinic-page input[aria-invalid="true"],
:root[data-theme="light"] .clinic-page select[aria-invalid="true"],
:root[data-theme="light"] .clinic-page textarea[aria-invalid="true"],
:root[data-theme="light"] .marketing-page input[aria-invalid="true"],
:root[data-theme="light"] .marketing-page select[aria-invalid="true"],
:root[data-theme="light"] .marketing-page textarea[aria-invalid="true"],
:root[data-theme="light"] .has-error input,
:root[data-theme="light"] .has-error select,
:root[data-theme="light"] .has-error textarea,
:root[data-theme="light"] .clinic-page .has-error input,
:root[data-theme="light"] .clinic-page .has-error select,
:root[data-theme="light"] .clinic-page .has-error textarea,
:root[data-theme="light"] .marketing-page .has-error input,
:root[data-theme="light"] .marketing-page .has-error select,
:root[data-theme="light"] .marketing-page .has-error textarea,
:root[data-theme="light"] .clinic-page .registration-form .registration-field :is(input, select, textarea)[aria-invalid="true"],
:root[data-theme="light"] .clinic-page .clinic-field :is(input, select, textarea)[aria-invalid="true"],
:root[data-theme="light"] .clinic-page .rx-field :is(input, select, textarea)[aria-invalid="true"],
:root[data-theme="light"] .marketing-page .form-field :is(input, select, textarea)[aria-invalid="true"] {
  border-color: #b13f45;
}

:root[data-theme="light"] .clinic-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"])[aria-invalid="true"],
:root[data-theme="light"] .clinic-page select[aria-invalid="true"],
:root[data-theme="light"] .clinic-page textarea[aria-invalid="true"],
:root[data-theme="light"] .clinic-page .has-error input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
:root[data-theme="light"] .clinic-page .has-error select,
:root[data-theme="light"] .clinic-page .has-error textarea,
:root[data-theme="light"] .marketing-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"])[aria-invalid="true"],
:root[data-theme="light"] .marketing-page select[aria-invalid="true"],
:root[data-theme="light"] .marketing-page textarea[aria-invalid="true"],
:root[data-theme="light"] .marketing-page .has-error input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
:root[data-theme="light"] .marketing-page .has-error select,
:root[data-theme="light"] .marketing-page .has-error textarea {
  border-color: #b13f45;
}

:root[data-theme="light"] input[type="checkbox"],
:root[data-theme="light"] input[type="radio"] {
  accent-color: var(--theme-accent);
}

:root[data-theme="light"] input[type="file"]::file-selector-button {
  min-height: 34px;
  padding: 0 11px;
  margin-right: 10px;
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  color: var(--theme-secondary);
  background: var(--theme-raised);
  font: inherit;
  cursor: pointer;
}

:root[data-theme="light"] input[type="file"]::file-selector-button:hover {
  border-color: var(--theme-accent);
  background: var(--theme-subtle);
}

:root[data-theme="light"] .button-dark,
:root[data-theme="light"] .clinic-page .button-dark,
:root[data-theme="light"] .clinic-page .clinic-submit,
:root[data-theme="light"] .clinic-page .clinic-auth-card .clinic-submit,
:root[data-theme="light"] .clinic-page .registration-submit,
:root[data-theme="light"] .rx-action.button-dark {
  min-height: 44px;
  border-color: var(--theme-accent);
  border-radius: 10px;
  color: #fff;
  background: var(--theme-accent);
  box-shadow: none;
  font-weight: 600;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}

:root[data-theme="light"] .button-dark:not(:disabled):hover,
:root[data-theme="light"] .clinic-page .button-dark:not(:disabled):hover,
:root[data-theme="light"] .clinic-page .clinic-submit:not(:disabled):hover,
:root[data-theme="light"] .clinic-page .registration-submit:not(:disabled):hover {
  border-color: #075c3f;
  color: #fff;
  background: #075c3f;
  box-shadow: 0 3px 9px rgb(8 78 53 / 16%);
  transform: translateY(-1px);
}

:root[data-theme="light"] .button-light,
:root[data-theme="light"] .clinic-page .button-light,
:root[data-theme="light"] .clinic-page .clinic-page-link,
:root[data-theme="light"] .rx-action.button-light {
  min-height: 42px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  color: var(--theme-secondary);
  background: var(--theme-surface);
  box-shadow: none;
  font-weight: 600;
  transition: color .16s, border-color .16s, background-color .16s;
}

:root[data-theme="light"] .button-light:hover,
:root[data-theme="light"] .clinic-page .button-light:hover,
:root[data-theme="light"] .clinic-page .clinic-page-link:hover,
:root[data-theme="light"] .rx-action.button-light:hover {
  border-color: #9eafa3;
  color: var(--theme-text);
  background: var(--theme-raised);
  box-shadow: none;
}

:root[data-theme="light"] .button:focus-visible,
:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] a:focus-visible,
:root[data-theme="light"] summary:focus-visible {
  outline: 3px solid rgb(8 118 79 / 38%);
  outline-offset: 2px;
}

:root[data-theme="light"] .button:disabled,
:root[data-theme="light"] .clinic-page .button-dark:disabled,
:root[data-theme="light"] .marketing-page .button-dark:disabled,
:root[data-theme="light"] button:disabled {
  border-color: #c4cec7;
  color: #435148;
  background: #e9eeea;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}

:root[data-theme="light"] .clinic-page .clinic-row-remove {
  color: #8e3439;
  border-color: #e2c8c9;
  background: #fff;
}

:root[data-theme="light"] .clinic-page .clinic-row-remove:hover {
  color: #78292e;
  border-color: #c98588;
  background: #fff0f0;
}

:root[data-theme="light"] .clinic-page .clinic-directory-actions .button-dark {
  color: #fff;
  background: var(--theme-accent);
}

:root[data-theme="light"] .clinic-page .specialization-menu,
:root[data-theme="light"] .clinic-page .clinic-profile-menu .clinic-profile-panel,
:root[data-theme="light"] .clinic-page .clinic-booking-dialog {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}

:root[data-theme="light"] .clinic-page .specialization-option,
:root[data-theme="light"] .clinic-page .clinic-profile-menu .clinic-profile-panel button {
  color: var(--theme-secondary);
}

:root[data-theme="light"] .clinic-page .specialization-toggle {
  height: 48px;
  min-height: 48px;
  border: 0;
  color: var(--theme-secondary);
  background: transparent;
}

:root[data-theme="light"] .clinic-page .specialization-option {
  min-height: 37px;
  border: 0;
  color: var(--theme-secondary);
  background: transparent;
}

:root[data-theme="light"] .clinic-page .specialization-option:hover,
:root[data-theme="light"] .clinic-page .specialization-option:focus-visible {
  color: var(--theme-text);
  background: var(--theme-raised);
}

:root[data-theme="light"] .clinic-page .specialization-option[aria-selected="true"] {
  color: var(--theme-link);
  background: var(--theme-subtle);
}

:root[data-theme="light"] .clinic-page .clinic-profile-menu .clinic-profile-panel a {
  color: var(--theme-link);
}

:root[data-theme="light"] .clinic-page .appointment-table th,
:root[data-theme="light"] .clinic-page .appointment-table td,
:root[data-theme="light"] .clinic-page .rx-table th,
:root[data-theme="light"] .clinic-page .rx-table td {
  border-color: var(--theme-border);
}

:root[data-theme="light"] .clinic-page .appointment-table th,
:root[data-theme="light"] .clinic-page .rx-table th {
  color: var(--theme-secondary);
  background: var(--theme-raised);
}

:root[data-theme="light"] .clinic-page .clinic-flash-success,
:root[data-theme="light"] .clinic-page .clinic-notice,
:root[data-theme="light"] .clinic-page .rx-notice,
:root[data-theme="light"] .clinic-page .clinic-schedule-warning {
  color: #325541;
}

:root[data-theme="light"] .clinic-page :is(
  .clinic-error,
  .field-error,
  .rx-field-error,
  .rx-errors,
  .form-error-summary
),
:root[data-theme="light"] .marketing-page :is(.field-error, .form-errors) {
  color: #9d3438;
}

:root[data-theme="light"] .clinic-page .clinic-closure-status,
:root[data-theme="light"] .clinic-page .clinic-closure-status.is-inactive {
  color: var(--theme-secondary);
  background: var(--theme-raised);
}

:root[data-theme="light"] .clinic-page .clinic-date-option:disabled {
  color: var(--theme-muted);
  background: var(--theme-raised);
  opacity: 1;
}

:root[data-theme="light"] .marketing-page .site-header.is-scrolled {
  background: rgb(247 249 247 / 94%);
}

:root[data-theme="light"] .marketing-page .nav-links {
  color: var(--theme-secondary);
}

:root[data-theme="light"] .marketing-page .dropdown-menu {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root[data-theme="light"] .marketing-page .button-light {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root[data-theme="light"] .marketing-page .button-dark {
  color: #fff;
  background: var(--theme-accent);
}

:root[data-theme="light"] .marketing-page .button-dark:not(:disabled):hover {
  color: #fff;
  background: #075c3f;
}

:root[data-theme="light"] .marketing-page :is(
  .app-sidebar > small,
  .side-link,
  .sidebar-profile small,
  .profile-more,
  .crumb,
  .crumb b,
  .app-notice,
  .app-date,
  .app-greeting p,
  .stat-head,
  .stat-card > small,
  .panel-title small,
  .calendar-strip > span,
  .calc-input-label span,
  .estimate-label,
  .calc-footnote,
  .calc-results small,
  .feature-card p,
  .workflow-step p,
  .demo-stamp
) {
  color: var(--theme-muted);
}

:root[data-theme="light"] .marketing-page .site-footer {
  border-color: var(--theme-border);
  background: #eef2ef;
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointments-panel {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root:not([data-theme="light"]) .marketing-page .app-window {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-page);
  box-shadow: var(--theme-shadow);
}

:root:not([data-theme="light"]) .marketing-page .app-sidebar {
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root:not([data-theme="light"]) .marketing-page .stat-card,
:root:not([data-theme="light"]) .marketing-page .app-panel {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root:not([data-theme="light"]) .marketing-page :is(
  .side-link,
  .stat-head,
  .calendar-strip > span,
  .appointment-time,
  .app-notice,
  .panel-title button
) {
  color: var(--theme-muted);
}

:root:not([data-theme="light"]) .marketing-page :is(
  .app-brand,
  .sidebar-profile,
  .side-link.active,
  .app-greeting h2,
  .stat-card > strong,
  .panel-title h3,
  .appointment-row b,
  .activity-line b
) {
  color: var(--theme-text);
}

:root:not([data-theme="light"]) .marketing-page .side-link.active {
  background: rgb(91 224 164 / 12%);
}

:root:not([data-theme="light"]) .marketing-page :is(
  .sidebar-profile,
  .appointment-row,
  .activity-line
) {
  border-color: var(--theme-border);
}

:root:not([data-theme="light"]) .marketing-page .live-chip {
  color: var(--theme-secondary);
  background: var(--theme-raised);
}

:root:not([data-theme="light"]) .marketing-page .appointment-row em {
  color: var(--theme-accent);
  background: rgb(91 224 164 / 12%);
}

:root:not([data-theme="light"]) .marketing-page .appointment-row em.arrived {
  color: #c4b8ff;
  background: rgb(131 115 202 / 18%);
}

:root:not([data-theme="light"]) .marketing-page .activity-symbol {
  color: var(--theme-accent);
  background: rgb(91 224 164 / 12%);
}

:root:not([data-theme="light"]) .marketing-page .activity-symbol.violet {
  color: #c4b8ff;
  background: rgb(131 115 202 / 18%);
}

:root:not([data-theme="light"]) .marketing-page .activity-symbol.peach {
  color: #f0bc88;
  background: rgb(207 140 82 / 16%);
}

:root:not([data-theme="light"]) .marketing-page .dashboard-fade {
  background: linear-gradient(0deg, var(--theme-page), transparent);
}

:root[data-theme="light"] .marketing-page .app-window {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}

:root[data-theme="light"] .marketing-page .app-sidebar {
  border-color: var(--theme-border);
  background: var(--theme-raised);
}

:root[data-theme="light"] .marketing-page .stat-card,
:root[data-theme="light"] .marketing-page .app-panel {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-surface);
}

:root[data-theme="light"] .marketing-page .side-link.active {
  color: var(--theme-link);
  background: var(--theme-subtle);
}

:root[data-theme="light"] .marketing-page .side-link.active span {
  color: var(--theme-link);
}

:root[data-theme="light"] .marketing-page :is(
  .sidebar-profile,
  .appointment-row,
  .activity-line
) {
  border-color: var(--theme-border);
}

:root[data-theme="light"] .marketing-page .live-chip {
  color: #4f735f;
  background: #f0f8f2;
}

:root[data-theme="light"] .marketing-page .appointment-row em {
  color: #238557;
  background: #eaf7ef;
}

:root[data-theme="light"] .marketing-page .appointment-row em.arrived {
  color: #7561ba;
  background: #f1effb;
}

:root[data-theme="light"] .marketing-page .activity-symbol {
  color: #1d9b65;
  background: #eaf8ef;
}

:root[data-theme="light"] .marketing-page .activity-symbol.violet {
  color: #7662c7;
  background: #f1effb;
}

:root[data-theme="light"] .marketing-page .activity-symbol.peach {
  color: #d49354;
  background: #fff4e8;
}

:root[data-theme="light"] .marketing-page .dashboard-fade {
  background: linear-gradient(0deg, var(--theme-page), transparent);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointments-panel .panel-heading h2 {
  color: var(--theme-text);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointments-panel .dashboard-empty-state {
  color: var(--theme-secondary);
  border-color: var(--theme-border);
  background: var(--theme-raised);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointments-panel .dashboard-empty-state strong {
  color: var(--theme-secondary);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointments-panel .dashboard-empty-state p {
  color: var(--theme-muted);
}

@media (max-width: 640px) {
  :root[data-theme="light"] .button,
  :root[data-theme="light"] .rx-action {
    min-height: 42px;
  }
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page
  :is(.appointment-filter-form, .clinic-schedule-form, .clinic-profile-edit-form, .patient-form-grid)
  .clinic-field :is(input:not([type="checkbox"]), select, textarea) {
  color: var(--theme-text);
  color-scheme: dark;
  border-color: var(--theme-border);
  background-color: var(--theme-control);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointment-filter-form :is(input, select, textarea) {
  color: var(--theme-text);
  color-scheme: dark;
  border-color: var(--theme-border);
  background-color: var(--theme-control);
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page .appointment-filter-form :is(input, select, textarea)::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

:root:not([data-theme="light"]) .clinic-page.clinic-dashboard-page select option {
  color: var(--theme-text);
  background-color: var(--theme-surface);
}

:root:not([data-theme="light"]) .clinic-page :is(.rx-search input, .rx-field input:not([type="checkbox"]), .rx-field select, .rx-field textarea, .rx-amendment textarea) {
  color: var(--theme-text);
  color-scheme: dark;
  border-color: var(--theme-border);
  background-color: var(--theme-control);
}

:root:not([data-theme="light"]) .clinic-page :is(.rx-field, .rx-amendment) select option {
  color: var(--theme-text);
  background-color: var(--theme-surface);
}

/* Clinic profile panel: readable actions in both themes, plus plan end date. */
.clinic-page.clinic-dashboard-page .clinic-profile-panel .clinic-drawer-edit-link {
  color: var(--theme-link);
  border: 1px solid var(--theme-border);
  background: var(--theme-subtle);
}
.clinic-page.clinic-dashboard-page .clinic-profile-panel .clinic-drawer-edit-link:hover {
  color: var(--theme-text);
  border-color: var(--theme-accent);
  background: var(--theme-raised);
}
.clinic-page.clinic-dashboard-page .clinic-profile-panel .clinic-drawer-plan-end {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--theme-muted);
  background: var(--theme-subtle);
  font-size: 11px;
}
.clinic-page.clinic-dashboard-page .clinic-profile-panel .clinic-drawer-plan-end strong { color: var(--theme-text); }
.clinic-page.clinic-dashboard-page .clinic-profile-panel form button {
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  background: var(--theme-control);
  font-weight: 600;
}
.clinic-page.clinic-dashboard-page .clinic-profile-panel form button:hover {
  color: var(--theme-link);
  border-color: var(--theme-accent);
  background: var(--theme-raised);
}

:root[data-theme] .clinic-page.clinic-dashboard-page .button-dark {
  color: var(--dash-on-accent);
  border-color: var(--dash-action);
  background: var(--dash-action);
  box-shadow: 0 3px 10px rgb(6 40 28 / 14%);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .button-dark:not(:disabled):hover {
  color: var(--dash-on-accent);
  border-color: var(--dash-action-hover);
  background: var(--dash-action-hover);
  box-shadow: 0 5px 14px rgb(6 40 28 / 20%);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .button-dark:not(:disabled):active {
  color: var(--dash-on-accent);
  border-color: var(--dash-action-hover);
  background: var(--dash-action-hover);
  box-shadow: inset 0 2px 4px rgb(6 40 28 / 20%);
  transform: translateY(1px);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .button-light {
  color: var(--dash-text);
  border-color: var(--dash-border);
  background: var(--dash-card);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .button-light:not(:disabled):hover,
:root[data-theme] .clinic-page.clinic-dashboard-page .button-light:not(:disabled):active {
  color: var(--dash-text);
  border-color: var(--dash-accent);
  background: var(--dash-accent-soft);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .button-light:not(:disabled):active {
  box-shadow: inset 0 1px 3px rgb(6 40 28 / 12%);
  transform: translateY(1px);
}
:root[data-theme] .clinic-page.clinic-dashboard-page :is(.button-dark, .button-light):focus-visible {
  outline: 3px solid var(--dash-accent);
  outline-offset: 3px;
}
:root[data-theme] .clinic-page.clinic-dashboard-page .appointment-tabs a.is-current {
  border-color: var(--dash-accent);
  color: var(--dash-accent);
}
:root[data-theme] .clinic-page.clinic-dashboard-page .appointment-tabs a:active {
  color: var(--dash-text);
  background: var(--dash-accent-soft);
}

:root[data-theme] :is(.clinic-page, .marketing-page) .button-dark {
  color: var(--theme-on-action);
  border-color: var(--theme-action);
  background: var(--theme-action);
  box-shadow: 0 3px 10px rgb(6 40 28 / 14%);
  transition: color .16s, border-color .16s, background-color .16s, box-shadow .16s, transform .16s;
}
:root[data-theme] :is(.clinic-page, .marketing-page) .button-dark:not(:disabled):hover {
  color: var(--theme-on-action);
  border-color: var(--theme-action-hover);
  background: var(--theme-action-hover);
  box-shadow: 0 5px 14px rgb(6 40 28 / 20%);
}
:root[data-theme] :is(.clinic-page, .marketing-page) .button-dark:not(:disabled):active {
  color: var(--theme-on-action);
  border-color: var(--theme-action-hover);
  background: var(--theme-action-hover);
  box-shadow: inset 0 2px 4px rgb(6 40 28 / 20%);
  transform: translateY(1px);
}
:root[data-theme] :is(.clinic-page, .marketing-page) .button-light {
  color: var(--theme-text);
  border-color: var(--theme-border);
  background: var(--theme-raised);
  box-shadow: none;
  transition: color .16s, border-color .16s, background-color .16s, box-shadow .16s, transform .16s;
}
:root[data-theme] :is(.clinic-page, .marketing-page) .button-light:not(:disabled):hover,
:root[data-theme] :is(.clinic-page, .marketing-page) .button-light:not(:disabled):active {
  color: var(--theme-text);
  border-color: var(--theme-accent);
  background: var(--theme-subtle);
}
:root[data-theme] :is(.clinic-page, .marketing-page) .button-light:not(:disabled):active {
  box-shadow: inset 0 1px 3px rgb(6 40 28 / 12%);
  transform: translateY(1px);
}
:root[data-theme] :is(.clinic-page, .marketing-page) :is(.button-dark, .button-light):focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 3px;
}
:root[data-theme] :is(.clinic-page, .marketing-page) :is(.button-dark, .button-light):disabled {
  color: var(--theme-muted);
  border-color: var(--theme-border);
  background: var(--theme-raised);
  box-shadow: none;
  opacity: .7;
}

:root[data-theme] .clinic-page.clinic-dashboard-page .dashboard-sidebar details {
  border: 0;
  background: transparent;
  box-shadow: none;
}
:root[data-theme] .clinic-page.clinic-dashboard-page .sidebar-account-card {
  border-color: var(--dash-border);
  color: var(--dash-text);
  background: var(--dash-side);
  cursor: not-allowed;
  transform: none;
}
