/* Assured Hearts system theme
   All pages inherit this semantic palette. Component CSS should use these tokens
   instead of introducing new neutral shades. */
:root,
html[data-theme="light"]{
  color-scheme:light;
  --ah-canvas:#f5f5f5;
  --ah-canvas-subtle:#fafafa;
  --ah-surface:#ffffff;
  --ah-surface-raised:#ffffff;
  --ah-surface-soft:#f4f4f5;
  --ah-surface-hover:#eeeeef;
  --ah-text:#18181b;
  --ah-text-secondary:#52525b;
  --ah-text-muted:#71717a;
  --ah-border:#e4e4e7;
  --ah-border-strong:#d4d4d8;
  --ah-accent:#0f7480;
  --ah-accent-deep:#06464e;
  --ah-accent-hover:#0b5f69;
  --ah-accent-soft:#e5f3f5;
  --ah-on-accent:#ffffff;
  --ah-overlay:rgba(0,0,0,.48);
  --ah-shadow:0 18px 44px rgba(0,0,0,.10);
  --ah-success:#15803d;
  --ah-success-soft:#dcfce7;
  --ah-warning:#a16207;
  --ah-warning-soft:#fef3c7;
  --ah-danger:#b91c1c;
  --ah-danger-soft:#fee2e2;
  --ah-info:#0369a1;
  --ah-info-soft:#e0f2fe;
  --ah-status-pending:#2563eb;
  --ah-status-completed:#15803d;
  --ah-status-cancelled:#b91c1c;

  /* Compatibility aliases for existing page styles. */
  --bg:var(--ah-canvas);
  --card:var(--ah-surface);
  --muted:var(--ah-text-muted);
  --accent:var(--ah-accent);
  --accent-gradient:linear-gradient(135deg,#67b3c2 0%,var(--ah-accent) 100%);
  --journey-ink:var(--ah-text);
  --journey-muted:var(--ah-text-muted);
  --journey-bg:var(--ah-canvas);
  --journey-card:var(--ah-surface);
  --journey-border:var(--ah-border);
  --cg-accent:var(--ah-accent);
}

html[data-theme="dark"]{
  color-scheme:dark;
  --ah-canvas:#000000;
  --ah-canvas-subtle:#050505;
  --ah-surface:#0a0a0a;
  --ah-surface-raised:#111111;
  --ah-surface-soft:#171717;
  --ah-surface-hover:#202020;
  --ah-text:#f5f5f5;
  --ah-text-secondary:#d4d4d8;
  --ah-text-muted:#a1a1aa;
  --ah-border:#27272a;
  --ah-border-strong:#3f3f46;
  --ah-accent:#67b3c2;
  --ah-accent-deep:#67b3c2;
  --ah-accent-hover:#8bcbd6;
  --ah-accent-soft:rgba(103,179,194,.16);
  --ah-on-accent:#071315;
  --ah-overlay:rgba(0,0,0,.76);
  --ah-shadow:0 22px 54px rgba(0,0,0,.54);
  --ah-success:#4ade80;
  --ah-success-soft:rgba(34,197,94,.14);
  --ah-warning:#fbbf24;
  --ah-warning-soft:rgba(245,158,11,.14);
  --ah-danger:#f87171;
  --ah-danger-soft:rgba(239,68,68,.14);
  --ah-info:#7dd3fc;
  --ah-info-soft:rgba(14,165,233,.14);

  --bg:var(--ah-canvas);
  --card:var(--ah-surface);
  --muted:var(--ah-text-muted);
  --accent:var(--ah-accent);
  --accent-gradient:linear-gradient(135deg,#8bcbd6 0%,#3a8f9e 100%);
  --journey-ink:var(--ah-text);
  --journey-muted:var(--ah-text-muted);
  --journey-bg:var(--ah-canvas);
  --journey-card:var(--ah-surface);
  --journey-border:var(--ah-border);
  --cg-accent:var(--ah-accent);
}

html,
body{
  background:var(--ah-canvas);
  color:var(--ah-text);
}

body{
  transition:background-color .18s ease,color .18s ease;
}

html[data-theme] body :where(h1,h2,h3,h4,h5,h6){
  color:var(--ah-text);
}

html[data-theme] label,
html[data-theme] legend{
  color:var(--ah-text-secondary) !important;
}

html[data-theme] small,
html[data-theme] .lead{
  color:var(--ah-text-muted) !important;
}

*{
  scrollbar-color:var(--ah-border-strong) var(--ah-surface);
}

::selection{
  background:var(--ah-accent);
  color:var(--ah-on-accent);
}

.global-banner{
  position:fixed;
  top:max(16px,env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:12000;
  width:min(420px,calc(100vw - 32px));
  padding:12px 16px;
  border:1px solid;
  border-radius:12px;
  box-shadow:var(--ah-shadow);
  font-weight:700;
  text-align:center;
}

.global-banner--success{
  background:var(--ah-success-soft);
  border-color:color-mix(in srgb,var(--ah-success) 45%,transparent);
  color:var(--ah-success);
}

.global-banner--error{
  background:var(--ah-danger-soft);
  border-color:color-mix(in srgb,var(--ah-danger) 45%,transparent);
  color:var(--ah-danger);
}

.global-banner--info{
  background:var(--ah-info-soft);
  border-color:color-mix(in srgb,var(--ah-info) 45%,transparent);
  color:var(--ah-info);
}

a{
  color:var(--ah-accent);
}

input,
select,
textarea,
button{
  font:inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea{
  background-color:var(--ah-surface-raised) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
  -webkit-text-fill-color:var(--ah-text) !important;
  caret-color:var(--ah-accent);
}

input::placeholder,
textarea::placeholder{
  color:var(--ah-text-muted) !important;
  -webkit-text-fill-color:var(--ah-text-muted) !important;
  opacity:1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--ah-text) !important;
  -webkit-box-shadow:0 0 0 1000px var(--ah-surface-raised) inset !important;
  box-shadow:0 0 0 1000px var(--ah-surface-raised) inset !important;
  caret-color:var(--ah-accent) !important;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--ah-accent) !important;
  outline-color:var(--ah-accent);
}

/* Navigation and app chrome */
.navbar,
html[data-theme] .provider-dashboard .navbar{
  background:var(--ah-surface);
  border-color:var(--ah-border);
}

.nav-links a,
.nav-center-title,
html[data-theme] .provider-dashboard .nav-links a,
html[data-theme] .provider-dashboard .nav-center-title{
  color:var(--ah-text);
}

html[data-theme="dark"] .provider-dashboard .logo span{
  color:var(--ah-text);
  background:none;
  -webkit-text-fill-color:var(--ah-text);
}

.provider-top-profile-btn,
.mobile-menu-panel{
  background:var(--ah-surface);
  border-color:var(--ah-border);
  color:var(--ah-text);
}

.mobile-menu-panel .mobile-nav a{
  color:var(--ah-text);
}

.mobile-menu-panel .mobile-nav a:hover{
  background:var(--ah-surface-hover);
}

.mobile-auth{
  border-color:var(--ah-border);
}

.nav-auth .signed-label,
.mobile-auth .signed-label{
  color:var(--ah-text-secondary);
}

html[data-theme] .landing-pill--ghost,
html[data-theme] .auth-flow-action,
html[data-theme] .togglePassword{
  background:var(--ah-surface-soft) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .text-link-button,
html[data-theme] .profile-photo-actions .provider-header-btn{
  min-height:0;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  color:var(--ah-accent) !important;
}

html[data-theme] .text-link-button:hover,
html[data-theme] .profile-photo-actions .provider-header-btn:hover{
  background:transparent !important;
  color:var(--ah-accent-hover) !important;
}

html[data-theme] .landing-pill--solid,
html[data-theme] .auth-flow-primary,
html[data-theme] .login-modal-form .btn{
  background:var(--ah-accent) !important;
  border-color:var(--ah-accent) !important;
  color:var(--ah-on-accent) !important;
}

body > footer,
.footer{
  background:var(--ah-surface) !important;
  border-top:1px solid var(--ah-border);
  color:var(--ah-text) !important;
}

/* Shared surfaces */
.modal,
.unsaved-changes-modal,
.parent-booking-panel,
.booking-availability-modal,
.verify-modal,
.profile-photo-modal{
  background:var(--ah-overlay) !important;
}

.modal-content,
.meet-modal-content,
.unsaved-changes-card,
.parent-city-change-card,
.booking-availability-card,
.parent-booking-card,
.parent-booking-checkout,
.chat-booking-checkout,
.access-modal-content,
.welcome-modal-content{
  background:var(--ah-surface-raised) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
  box-shadow:var(--ah-shadow) !important;
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.unsaved-changes-card h3,
.parent-booking-card h2,
.parent-booking-card h3{
  color:var(--ah-text) !important;
}

.modal-content p,
.unsaved-changes-card p,
.parent-city-change-card #parentCityChangeMessage,
.parent-booking-sub,
.parent-booking-message-tail{
  color:var(--ah-text-secondary) !important;
}

.parent-city-change-icon{
  background:var(--ah-accent-soft);
  color:var(--ah-accent);
}

.parent-city-change-note,
.parent-booking-warning,
.saved-caregiver-remove-note{
  background:var(--ah-warning-soft) !important;
  border-color:color-mix(in srgb,var(--ah-warning) 45%,transparent) !important;
  color:var(--ah-warning) !important;
}

/* Dashboard canvas: black in dark mode, neutral white/gray in light mode. */
html[data-theme] .provider-dashboard,
html[data-theme] body.provider-dashboard{
  background:var(--ah-canvas);
  color:var(--ah-text);
}

html[data-theme] .provider-shell{
  background:var(--ah-canvas);
  color:var(--ah-text);
  box-shadow:none;
}

html[data-theme] .provider-sidebar,
html[data-theme] .provider-content{
  background:var(--ah-surface);
  border-color:var(--ah-border);
  box-shadow:none;
}

html[data-theme] .provider-panel,
html[data-theme] .provider-panel-card,
html[data-theme] .provider-bookings-card,
html[data-theme] .provider-requests-card,
html[data-theme] .provider-kpi-card,
html[data-theme] .parent-provider-row,
html[data-theme] .parent-results-wrap,
html[data-theme] .parent-search-card,
html[data-theme] .parent-booking-card,
html[data-theme] .parent-time-card,
html[data-theme] .parent-find-card,
html[data-theme] .provider-chart-card,
html[data-theme] .provider-profile-section,
html[data-theme] .provider-profile-summary,
html[data-theme] .provider-doc-card,
html[data-theme] .provider-upgrade-card,
html[data-theme] .parent-child-form-card,
html[data-theme] .parent-caregiver-card,
html[data-theme] .family-post,
html[data-theme] .parent-child-details,
html[data-theme] .parent-child-details-card,
html[data-theme] .resource-card,
html[data-theme] .provider-mini-card,
html[data-theme] .account-settings-section{
  background:var(--ah-surface-raised);
  border-color:var(--ah-border);
  color:var(--ah-text);
  box-shadow:none;
}

html[data-theme] .provider-bookings-item,
html[data-theme] .provider-requests-item,
html[data-theme] .provider-requests-empty,
html[data-theme] .parent-bookings-item,
html[data-theme] .calendar-controls,
html[data-theme] .calendar-event-card,
html[data-theme] .parent-time-form,
html[data-theme] .parent-find-inputs{
  background:var(--ah-surface-soft);
  border-color:var(--ah-border);
  color:var(--ah-text);
}

html[data-theme] .provider-booking-mobile-title,
html[data-theme] .provider-booking-mobile-time,
html[data-theme] .provider-request-mobile-title,
html[data-theme] .provider-request-mobile-time{
  color:var(--ah-text);
}

html[data-theme] .provider-booking-mobile-divider,
html[data-theme] .provider-booking-mobile-meta,
html[data-theme] .provider-request-mobile-divider,
html[data-theme] .provider-request-mobile-family,
html[data-theme] .provider-request-mobile-meta{
  color:var(--ah-text-secondary);
}

/* Search fields nested inside an outlined control should read as one surface. */
html[data-theme] .parent-find-inputs{
  background:transparent;
  border-color:var(--ah-border-strong);
}

html[data-theme] .parent-find-inputs:focus-within{
  border-color:var(--ah-accent);
  box-shadow:0 0 0 2px var(--ah-accent-soft);
}

html[data-theme] .parent-find-select{
  background-color:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

html[data-theme] .provider-booking-mobile-meta,
html[data-theme] .provider-request-mobile-meta{
  border-top:1px solid var(--ah-border);
  border-bottom:1px solid var(--ah-border);
}

html[data-theme] .provider-booking-mobile-meta span + span,
html[data-theme] .provider-request-mobile-meta span + span,
html[data-theme] .provider-booking-actions{
  border-color:var(--ah-border);
}

html[data-theme] .provider-requests-terms-note{
  color:var(--ah-text-muted);
}

html[data-theme] .provider-requests-terms-note a{
  color:var(--ah-accent);
}

html[data-theme] .provider-request-mobile-status.is-pending{
  background:var(--ah-info-soft);
  border-color:color-mix(in srgb,var(--ah-info) 45%,transparent);
  color:var(--ah-info);
}

html[data-theme] .provider-request-mobile-status.is-completed{
  background:var(--ah-success-soft);
  border-color:color-mix(in srgb,var(--ah-success) 45%,transparent);
  color:var(--ah-success);
}

html[data-theme] .provider-request-mobile-status.is-cancelled{
  background:var(--ah-danger-soft);
  border-color:color-mix(in srgb,var(--ah-danger) 45%,transparent);
  color:var(--ah-danger);
}

html[data-theme] .provider-booking-mobile-address{
  background:var(--ah-surface-raised) !important;
  border-color:var(--ah-border-strong) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .provider-booking-mobile-address:hover{
  background:var(--ah-surface-hover) !important;
}

html[data-theme] .provider-booking-address{
  border-color:var(--ah-border);
}

html[data-theme] .provider-booking-address-link{
  background:var(--ah-surface-raised);
  border-color:var(--ah-border-strong);
  color:var(--ah-text);
}

html[data-theme] .provider-booking-address-link:hover{
  background:var(--ah-surface-hover);
  border-color:var(--ah-accent);
}

html[data-theme] .booking-address-text{
  color:var(--ah-text);
}

html[data-theme] .provider-booking-address-hint{
  color:var(--ah-text-muted);
}

/* Account sections use one surface. Borders—not alternating fills—show structure. */
html[data-theme] .account-fields,
html[data-theme] .account-password-editor,
html[data-theme] .account-edit-actions,
html[data-theme] .account-settings-section .provider-security-row{
  background:var(--ah-surface-raised);
  border-color:var(--ah-border);
  color:var(--ah-text);
}

html[data-theme] .account-settings-section .provider-security-copy strong{
  color:var(--ah-text) !important;
}

html[data-theme] .account-settings-section .provider-security-text{
  color:var(--ah-text-muted) !important;
}

html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-form-field{
  gap:7px;
  border-bottom:0;
}

html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-form-field > span{
  color:var(--ah-text) !important;
}

html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-input[readonly],
html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-input:disabled{
  min-height:44px;
  padding:10px 12px !important;
  background:var(--ah-surface-raised) !important;
  border:1px solid var(--ah-border-strong) !important;
  border-radius:10px;
  color:var(--ah-text-secondary) !important;
  -webkit-text-fill-color:var(--ah-text-secondary) !important;
  opacity:1;
}

html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-input[readonly]::placeholder,
html[data-theme] .account-settings-section:not(.is-editing) .account-fields .provider-input:disabled::placeholder{
  color:var(--ah-text-muted) !important;
  -webkit-text-fill-color:var(--ah-text-muted) !important;
}

html[data-theme] .account-edit-button{
  background:var(--ah-surface-soft) !important;
  border-color:var(--ah-border-strong) !important;
  color:var(--ah-text) !important;
  box-shadow:none;
}

html[data-theme] .account-edit-button:hover{
  background:var(--ah-surface-hover) !important;
  border-color:var(--ah-text-muted) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .language-add-btn{
  background:var(--ah-surface-soft) !important;
  border-color:var(--ah-border-strong) !important;
  color:var(--ah-text) !important;
  box-shadow:none;
}

html[data-theme] .language-add-btn:hover{
  background:var(--ah-surface-hover) !important;
  border-color:var(--ah-text-muted) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .language-add-btn:focus-visible{
  outline:3px solid color-mix(in srgb,var(--ah-accent) 35%,transparent);
  outline-offset:2px;
}

/* Availability uses the same switch, surface, and action hierarchy as profiles. */
html[data-theme] .availability-day{
  border-bottom-color:var(--ah-border);
}

html[data-theme] .availability-day.is-disabled{
  opacity:1;
  padding-block:8px;
}

html[data-theme] .availability-day-toggle{
  color:var(--ah-text);
  align-self:end;
}

.availability-switch-control{
  position:relative;
  display:inline-flex;
  flex-direction:row;
  align-items:center;
  gap:7px;
  min-height:44px;
  width:max-content;
  flex-wrap:nowrap;
  white-space:nowrap;
  cursor:pointer;
  user-select:none;
}

.availability-slots[hidden],
.availability-day-actions[hidden]{
  display:none !important;
}

.availability-checkbox{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.availability-switch-track{
  position:relative;
  display:inline-flex;
  width:42px;
  height:24px;
  min-width:42px;
  max-width:42px;
  min-height:24px;
  max-height:24px;
  flex:0 0 42px;
  box-sizing:border-box;
  border:1px solid var(--ah-border-strong);
  border-radius:999px;
  padding:0 !important;
  overflow:hidden;
  align-self:center;
  background:var(--ah-danger-soft);
  border-color:color-mix(in srgb,var(--ah-danger) 48%,var(--ah-border));
  transition:background-color .18s ease,border-color .18s ease;
}

.availability-switch-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--ah-danger);
  box-shadow:0 1px 3px rgba(0,0,0,.24);
  transition:transform .18s ease;
}

.availability-checkbox:checked + .availability-switch-track{
  background:var(--ah-success-soft);
  border-color:color-mix(in srgb,var(--ah-success) 55%,var(--ah-border));
}

.availability-checkbox:checked + .availability-switch-track .availability-switch-thumb{
  background:var(--ah-success);
  transform:translateX(20px);
}

.availability-checkbox:focus-visible + .availability-switch-track{
  outline:3px solid color-mix(in srgb,var(--ah-accent) 35%,transparent);
  outline-offset:2px;
}

.availability-switch-state{
  min-width:20px;
  color:var(--ah-text-muted);
  font-size:11px;
  font-weight:700;
}

.availability-checkbox:not(:checked) ~ .availability-switch-state{
  color:var(--ah-danger);
}

.availability-checkbox:checked ~ .availability-switch-state{
  color:var(--ah-success);
}

.availability-slots:not([hidden]),
.availability-day-actions:not([hidden]){
  animation:availability-reveal .18s ease-out;
}

@keyframes availability-reveal{
  from{
    opacity:0;
    transform:translateY(-6px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

html[data-theme] .availability-slot{
  background:transparent;
  border:0;
  border-radius:0;
  padding:0;
  align-items:end;
  grid-template-columns:minmax(120px,1fr) 18px minmax(120px,1fr);
}

html[data-theme] .availability-slot.has-remove{
  grid-template-columns:minmax(120px,1fr) 18px minmax(120px,1fr) auto;
}

.availability-time-field{
  display:grid;
  gap:5px;
  min-width:0;
  color:var(--ah-text-muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
}

html[data-theme] .availability-slot input[type="time"]{
  background:var(--ah-surface-raised);
  border-color:var(--ah-border-strong);
  color:var(--ah-text);
  box-shadow:none;
}

html[data-theme] .availability-slot input[type="time"]:focus{
  border-color:var(--ah-accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--ah-accent) 22%,transparent);
}

html[data-theme] .availability-slot-sep,
html[data-theme] .availability-status{
  color:var(--ah-text-muted);
}

html[data-theme] .availability-slot-sep{
  align-self:end;
  display:flex;
  align-items:center;
  justify-content:center;
  height:38px;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}

html[data-theme] .availability-actions{
  border-top-color:var(--ah-border);
}

html[data-theme] .availability-icon-btn,
html[data-theme] .availability-btn-ghost{
  background:var(--ah-surface-soft) !important;
  border:1px solid var(--ah-border-strong) !important;
  color:var(--ah-text) !important;
  box-shadow:none;
}

html[data-theme] .availability-btn-ghost{
  min-height:40px;
  padding:10px 18px;
}

html[data-theme] .availability-icon-btn:hover,
html[data-theme] .availability-btn-ghost:hover{
  background:var(--ah-surface-hover) !important;
  border-color:var(--ah-text-muted) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .availability-remove-slot:hover{
  background:var(--ah-danger-soft) !important;
  border-color:color-mix(in srgb,var(--ah-danger) 45%,transparent) !important;
  color:var(--ah-danger) !important;
}

html[data-theme] .availability-icon-btn:focus-visible,
html[data-theme] .availability-btn:focus-visible,
html[data-theme] .availability-save-btn:focus-visible{
  outline:3px solid color-mix(in srgb,var(--ah-accent) 35%,transparent);
  outline-offset:2px;
}

.availability-add-slot,
.availability-remove-slot{
  width:auto;
  min-height:38px;
  padding:0 11px;
  gap:6px;
  white-space:nowrap;
}

.availability-add-slot{
  min-height:40px;
}

.availability-remove-slot,
.availability-day-actions{
  align-self:end;
}

.two-factor-switch-control{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  cursor:pointer;
  user-select:none;
}

.two-factor-switch{
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

.two-factor-switch-track{
  position:relative;
  width:48px;
  height:28px;
  flex:0 0 auto;
  border:1px solid var(--ah-border-strong);
  border-radius:999px;
  background:var(--ah-surface-hover);
  transition:background-color .18s ease,border-color .18s ease;
}

.two-factor-switch-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#ffffff;
  box-shadow:0 1px 4px rgba(0,0,0,.28);
  transition:transform .18s ease;
}

.two-factor-switch:checked + .two-factor-switch-track{
  background:var(--ah-status-completed);
  border-color:var(--ah-status-completed);
}

.two-factor-switch:checked + .two-factor-switch-track .two-factor-switch-thumb{
  transform:translateX(20px);
}

.two-factor-switch:focus-visible + .two-factor-switch-track{
  outline:3px solid color-mix(in srgb,var(--ah-accent) 35%,transparent);
  outline-offset:3px;
}

.two-factor-switch:disabled + .two-factor-switch-track,
.two-factor-switch:disabled ~ .two-factor-switch-state{
  opacity:.55;
}

.two-factor-switch-state{
  min-width:22px;
  color:var(--ah-text-secondary);
  font-size:12px;
  font-weight:750;
}

html[data-theme] .provider-sidebar-title,
html[data-theme] .provider-upgrade-title,
html[data-theme] .provider-section-title h3,
html[data-theme] .provider-profile-card-head h3,
html[data-theme] .provider-doc-title,
html[data-theme] .parent-provider-name,
html[data-theme] .parent-caregiver-name,
html[data-theme] .parent-caregiver-link,
html[data-theme] .parent-time-title,
html[data-theme] .provider-title,
html[data-theme] .provider-card-head h2,
html[data-theme] .provider-panel-card h2,
html[data-theme] .provider-kpi-value,
html[data-theme] .parent-child-name,
html[data-theme] .family-post-title,
html[data-theme] .account-settings-section h2,
html[data-theme] .account-settings-section h3{
  color:var(--ah-text);
}

html[data-theme] .provider-sidebar-eyebrow,
html[data-theme] .provider-sidebar-name,
html[data-theme] .provider-upgrade-copy,
html[data-theme] .provider-card-sub,
html[data-theme] .provider-panel-card p,
html[data-theme] .provider-kpi-label,
html[data-theme] .provider-kpi-foot,
html[data-theme] .parent-provider-meta,
html[data-theme] .parent-results-sub,
html[data-theme] .parent-caregiver-service-note,
html[data-theme] .parent-time-sub,
html[data-theme] .parent-find-meta,
html[data-theme] .parent-request-muted,
html[data-theme] .provider-form-status,
html[data-theme] .subscription-hint,
html[data-theme] .family-post-meta,
html[data-theme] .account-page-eyebrow,
html[data-theme] .account-password-help{
  color:var(--ah-text-muted);
}

html[data-theme] .provider-nav-item{
  color:var(--ah-text-secondary);
}

html[data-theme] .provider-nav-item:hover{
  background:var(--ah-surface-hover);
  color:var(--ah-text);
}

html[data-theme] .provider-nav-item.is-active{
  background:var(--ah-accent-soft);
  color:var(--ah-accent);
}

html[data-theme] .provider-header-btn,
html[data-theme] .parent-provider-btn,
html[data-theme] .parent-booking-btn,
html[data-theme] .calendar-action-btn,
html[data-theme] .parent-page-btn,
html[data-theme] .provider-page-btn{
  background:var(--ah-surface-soft);
  border-color:var(--ah-border-strong);
  color:var(--ah-text);
}

html[data-theme] .provider-header-btn:hover,
html[data-theme] .parent-provider-btn:hover,
html[data-theme] .parent-booking-btn:hover,
html[data-theme] .calendar-action-btn:hover{
  background:var(--ah-surface-hover);
}

html[data-theme] .provider-header-btn--primary,
html[data-theme] .provider-primary-btn,
html[data-theme] .parent-provider-btn.primary,
html[data-theme] .parent-booking-btn.primary,
html[data-theme] .parent-time-submit,
html[data-theme] .parent-find-submit,
html[data-theme] .parent-saved-browse-btn,
html[data-theme] .chat-send-btn,
html[data-theme] .save-btn{
  background:var(--ah-accent) !important;
  border-color:var(--ah-accent) !important;
  color:var(--ah-on-accent) !important;
}

html[data-theme] .provider-header-btn--primary:hover,
html[data-theme] .provider-primary-btn:hover,
html[data-theme] .parent-provider-btn.primary:hover,
html[data-theme] .parent-booking-btn.primary:hover,
html[data-theme] .parent-time-submit:hover,
html[data-theme] .parent-find-submit:hover{
  background:var(--ah-accent-hover) !important;
  border-color:var(--ah-accent-hover) !important;
}

html[data-theme] .provider-header-btn--danger,
html[data-theme] .parent-booking-btn.danger,
html[data-theme] .provider-request-btn.decline,
html[data-theme] .provider-cancel-btn,
html[data-theme] .parent-booking-cancel{
  background:var(--ah-danger) !important;
  border-color:var(--ah-danger) !important;
  color:#ffffff !important;
}

html[data-theme] .provider-header-btn--success,
html[data-theme] .provider-request-btn.accept,
html[data-theme] .parent-meet-complete{
  background:var(--ah-success) !important;
  border-color:var(--ah-success) !important;
  color:var(--ah-on-accent) !important;
}

html[data-theme] .parent-caregiver-card.is-outside-city,
html[data-theme] .parent-provider-row.is-outside-city{
  background:var(--ah-warning-soft);
  border-color:color-mix(in srgb,var(--ah-warning) 45%,transparent);
}

html[data-theme] .parent-caregiver-service-note.is-warning,
html[data-theme] .parent-provider-row.is-outside-city .parent-provider-meta{
  color:var(--ah-warning);
}

/* Request status tabs keep the same semantic colors on every dashboard. */
html[data-theme] .dashboard-status-tab--pending{
  background:var(--ah-info-soft) !important;
  border-color:color-mix(in srgb,var(--ah-status-pending) 48%,transparent) !important;
  color:var(--ah-info) !important;
}

html[data-theme] .dashboard-status-tab--completed{
  background:var(--ah-success-soft) !important;
  border-color:color-mix(in srgb,var(--ah-status-completed) 48%,transparent) !important;
  color:var(--ah-success) !important;
}

html[data-theme] .dashboard-status-tab--cancelled{
  background:var(--ah-danger-soft) !important;
  border-color:color-mix(in srgb,var(--ah-status-cancelled) 48%,transparent) !important;
  color:var(--ah-danger) !important;
}

html[data-theme] .dashboard-status-tab--pending.is-active{
  background:var(--ah-status-pending) !important;
  border-color:var(--ah-status-pending) !important;
  color:#ffffff !important;
}

html[data-theme] .dashboard-status-tab--completed.is-active{
  background:var(--ah-status-completed) !important;
  border-color:var(--ah-status-completed) !important;
  color:#ffffff !important;
}

html[data-theme] .dashboard-status-tab--cancelled.is-active{
  background:var(--ah-status-cancelled) !important;
  border-color:var(--ah-status-cancelled) !important;
  color:#ffffff !important;
}

html[data-theme] .dashboard-status-tab .parent-request-count{
  background:color-mix(in srgb,currentColor 14%,transparent);
  color:inherit;
}

html[data-theme] .dashboard-status-tab.is-active .parent-request-count{
  background:rgba(255,255,255,.22);
  color:#ffffff;
}

html[data-theme] .dashboard-status-tab:focus-visible{
  outline:3px solid color-mix(in srgb,currentColor 32%,transparent);
  outline-offset:2px;
}

html[data-theme] .provider-distance-setting-copy{
  color:var(--ah-text-secondary);
}

html[data-theme] .provider-distance-switch-track{
  background:var(--ah-surface-soft);
  border-color:var(--ah-border-strong);
}

html[data-theme] .provider-distance-switch-thumb{
  background:var(--ah-text-muted);
}

html[data-theme] .provider-distance-switch:checked + .provider-distance-switch-track{
  background:var(--ah-accent-soft);
  border-color:color-mix(in srgb,var(--ah-accent) 55%,var(--ah-border));
}

html[data-theme] .provider-distance-switch:checked + .provider-distance-switch-track .provider-distance-switch-thumb{
  background:var(--ah-accent);
}

html[data-theme] .provider-distance-switch:focus-visible + .provider-distance-switch-track{
  outline:3px solid color-mix(in srgb,var(--ah-accent) 35%,transparent);
  outline-offset:2px;
}

html[data-theme] .provider-distance-switch:disabled + .provider-distance-switch-track,
html[data-theme] .provider-distance-switch-control.is-pending{
  opacity:.55;
  cursor:wait;
}

html[data-theme] .provider-title-count,
html[data-theme] .provider-distance-switch-option{
  color:var(--ah-text-secondary);
}

html[data-theme] .provider-distance-switch-option--home{
  color:var(--ah-text);
}

html[data-theme] .provider-distance-switch-control:has(.provider-distance-switch:checked) .provider-distance-switch-option--home{
  color:var(--ah-text-muted);
}

html[data-theme] .provider-distance-switch-control:has(.provider-distance-switch:checked) .provider-distance-switch-option--current{
  color:var(--ah-accent);
}

/* Chat uses the same neutral surface hierarchy as the rest of the app. */
html[data-theme] #chatModal.chat-modal,
html[data-theme] .chat-modal .chat-shell,
html[data-theme] .chat-modal .chat-list-view,
html[data-theme] .chat-modal .chat-list-header,
html[data-theme] .chat-modal .chat-convo-view,
html[data-theme] .chat-modal .chat-convo-header,
html[data-theme] .chat-modal .chat-history,
html[data-theme] .chat-modal .chat-composer{
  background:var(--ah-surface) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .chat-modal .chat-thread,
html[data-theme] .chat-modal .chat-bubble,
html[data-theme] .chat-modal .chat-icon-btn,
html[data-theme] .chat-modal .chat-input,
html[data-theme] .chat-modal .chat-request-btn,
html[data-theme] .chat-modal .chat-bubble.chat-bubble--request,
html[data-theme] .chat-modal .chat-photo-remove{
  background:var(--ah-surface-raised) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
}

html[data-theme] .chat-modal .chat-thread:hover,
html[data-theme] .chat-modal .chat-thread.is-active{
  background:var(--ah-surface-hover) !important;
}

html[data-theme] .chat-modal .chat-list-title,
html[data-theme] .chat-modal .chat-thread-name,
html[data-theme] .chat-modal .chat-user-name,
html[data-theme] .chat-modal .chat-request-title,
html[data-theme] .chat-modal .chat-request-row strong{
  color:var(--ah-text) !important;
}

html[data-theme] .chat-modal .chat-empty,
html[data-theme] .chat-modal .chat-thread-time,
html[data-theme] .chat-modal .chat-thread-preview,
html[data-theme] .chat-modal .chat-user-sub,
html[data-theme] .chat-modal .chat-request-text,
html[data-theme] .chat-modal .chat-request-meta,
html[data-theme] .chat-modal .chat-status{
  color:var(--ah-text-muted) !important;
}

html[data-theme] .chat-modal .chat-message.is-mine .chat-bubble,
html[data-theme] .chat-modal .chat-book-btn{
  background:var(--ah-accent-soft) !important;
  border-color:color-mix(in srgb,var(--ah-accent) 45%,transparent) !important;
  color:var(--ah-text) !important;
}

/* Marketing, signup, profile, and policy pages */
html[data-theme] body.landing,
html[data-theme] body.careplus-page,
html[data-theme] .journey-page,
html[data-theme] body.cg-profile-page,
html[data-theme] .hero,
html[data-theme] .signup-section,
html[data-theme] .support-section,
html[data-theme] .glance-section,
html[data-theme] .home-learning-section{
  background:var(--ah-canvas) !important;
  color:var(--ah-text);
}

html[data-theme] body.landing{
  --landing-bg:var(--ah-canvas);
  --landing-ink:var(--ah-text);
  --landing-accent:var(--ah-accent);
  --landing-accent-strong:var(--ah-accent);
  --landing-warm:var(--ah-accent);
}

html[data-theme] .landing-copy h1,
html[data-theme] .landing-sub,
html[data-theme] .landing-note,
html[data-theme] .landing-scroll-hint,
html[data-theme] .glance-copy h2,
html[data-theme] .glance-label,
html[data-theme] .glance-title,
html[data-theme] .glance-waitlist-title,
html[data-theme] .signin-card-head h2{
  color:var(--ah-text) !important;
  -webkit-text-fill-color:currentColor;
}

html[data-theme] .glance-copy p,
html[data-theme] .glance-waitlist-text,
html[data-theme] .signin-card-head p,
html[data-theme] .signin-helper-copy,
html[data-theme] .signin-footer{
  color:var(--ah-text-muted) !important;
}

html[data-theme] .signin-card,
html[data-theme] .glance-input-row,
html[data-theme] .glance-waitlist{
  background:var(--ah-surface-raised);
  border-color:var(--ah-border);
  color:var(--ah-text);
  box-shadow:var(--ah-shadow);
}

html[data-theme] .journey-card,
html[data-theme] .journey-step,
html[data-theme] .cg-profile-shell,
html[data-theme] .cg-section,
html[data-theme] .glance-panel,
html[data-theme] .support-card,
html[data-theme] .role-card,
html[data-theme] .hero-login-card,
html[data-theme] .policy-card,
html[data-theme] body:not(.provider-dashboard) main > section{
  background-color:var(--ah-surface) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text);
  box-shadow:var(--ah-shadow);
}

html[data-theme] .journey-lead,
html[data-theme] .journey-card p,
html[data-theme] .cg-meta,
html[data-theme] .cg-section p,
html[data-theme] .lead,
html[data-theme] .policy-subtitle,
html[data-theme] .login-modal-subtitle{
  color:var(--ah-text-muted) !important;
}

html[data-theme] body:not(.provider-dashboard) main > section p,
html[data-theme] body:not(.provider-dashboard) main > section li,
html[data-theme] .terms-meta,
html[data-theme] .privacy-meta,
html[data-theme] .disclaimer-meta,
html[data-theme] .agreement-meta,
html[data-theme] .cancellation-meta,
html[data-theme] .terms-card p,
html[data-theme] .privacy-card p,
html[data-theme] .disclaimer-card p,
html[data-theme] .agreement-card p,
html[data-theme] .cancellation-card p{
  color:var(--ah-text-secondary) !important;
}

html[data-theme] .terms-list,
html[data-theme] .privacy-list,
html[data-theme] .disclaimer-list,
html[data-theme] .agreement-list,
html[data-theme] .cancellation-list{
  color:var(--ah-text-secondary) !important;
}

html[data-theme] .careplus-partner-blurb,
html[data-theme] .careplus-partner-plan,
html[data-theme] .careplus-auth-note{
  background:var(--ah-surface-raised) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
  box-shadow:none !important;
}

html[data-theme] .careplus-support,
html[data-theme] .careplus-note,
html[data-theme] .careplus-partner-blurb p,
html[data-theme] .careplus-partner-plan p,
html[data-theme] .careplus-partner-sub{
  color:var(--ah-text-muted) !important;
}

html[data-theme] .cg-hero-title h1,
html[data-theme] .policy-card h1,
html[data-theme] .policy-card h2,
html[data-theme] .policy-card h3{
  color:var(--ah-text) !important;
}

/* Admin inherits the same palette without a separate mode preference. */
html[data-theme] body.admin-page{
  --admin-bg:var(--ah-canvas);
  --admin-panel:var(--ah-surface-raised);
  --admin-panel-soft:var(--ah-surface-raised);
  --admin-border:var(--ah-border);
  --admin-muted:var(--ah-text-muted);
  --admin-text:var(--ah-text);
  --admin-accent:var(--ah-accent);
  --admin-accent-dark:var(--ah-accent-hover);
  --admin-warm:var(--ah-warning);
  --admin-danger:var(--ah-danger);
  --admin-success:var(--ah-success);
  background:var(--ah-canvas) !important;
  color:var(--ah-text);
}

html[data-theme] .application-card,
html[data-theme] .admin-action-card,
html[data-theme] .pricing-card,
html[data-theme] .admin-metric-card,
html[data-theme] .admin-detail-card,
html[data-theme] .admin-data-table-wrap,
html[data-theme] .admin-empty-state{
  background:var(--ah-surface-raised) !important;
  border-color:var(--ah-border) !important;
  color:var(--ah-text) !important;
  box-shadow:none !important;
}

html[data-theme="dark"] body{
  background-image:none !important;
}

@media (max-width:719px){
  html[data-theme] .provider-shell{
    background:var(--ah-canvas);
  }

  html[data-theme] .provider-sidebar,
  html[data-theme] .provider-content{
    background:var(--ah-canvas);
  }

  html[data-theme] .provider-dashboard .provider-nav{
    box-shadow:0 -1px 0 var(--ah-border);
  }

  html[data-theme="dark"] .provider-dashboard .provider-nav{
    background:#000000;
    border-color:var(--ah-border);
  }

  html[data-theme] .provider-card-head--upcoming,
  html[data-theme] .provider-card-head--requests{
    flex-direction:row;
    flex-wrap:wrap;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
  }

  html[data-theme] .provider-card-head--upcoming > :first-child,
  html[data-theme] .provider-card-head--requests > :first-child{
    min-width:0;
  }

  html[data-theme] .provider-card-head--upcoming .parent-card-pill-wrap{
    width:auto;
    margin-left:auto;
    flex:0 0 auto;
  }

  html[data-theme] .provider-card-head--upcoming .provider-card-pill{
    align-self:flex-start;
  }

  html[data-theme] .provider-card-head--upcoming .provider-upcoming-actions{
    width:auto;
    margin-left:auto;
    flex:0 0 auto;
    align-items:flex-end;
  }

  html[data-theme] .provider-card-head--requests .provider-requests-distance-setting{
    width:auto;
    margin-left:auto;
    flex:0 0 auto;
    align-items:flex-end;
  }

  html[data-theme] .availability-day-toggle{
    align-items:center;
    justify-content:space-between;
  }

  html[data-theme] .provider-availability-card{
    gap:10px;
  }

  html[data-theme] .provider-availability-card > .provider-card-head{
    margin-bottom:0;
  }

  html[data-theme] .availability-day{
    gap:10px;
    padding-block:10px;
  }

  html[data-theme] .availability-slot,
  html[data-theme] .availability-slot.has-remove{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:10px;
  }

  html[data-theme] .availability-time-field--start{
    grid-column:1;
  }

  html[data-theme] .availability-time-field--end{
    grid-column:2;
  }

  html[data-theme] .availability-slot-sep{
    display:none;
  }

  html[data-theme] .availability-day-actions{
    display:flex;
  }

  html[data-theme] .availability-add-slot{
    width:100%;
    justify-content:center;
  }

  html[data-theme] .availability-remove-slot{
    width:auto;
    grid-column:1 / -1;
    justify-self:end;
  }
}

@media (max-width:600px){
  html[data-theme] .provider-insights-card{
    gap:10px;
    padding:14px;
  }

  html[data-theme] .provider-insights-card > .provider-card-head{
    margin-bottom:0;
  }

  html[data-theme] .provider-insights-card .provider-pie-grid{
    gap:10px;
  }

  html[data-theme] .provider-insights-card .provider-mini-card{
    display:grid;
    grid-template-columns:108px minmax(0,1fr);
    grid-template-areas:
      "title title"
      "subtitle subtitle"
      "chart legend";
    align-items:center;
    column-gap:12px;
    row-gap:6px;
    padding:12px;
  }

  html[data-theme] .provider-insights-card .provider-mini-card h3{
    grid-area:title;
    font-size:13px;
  }

  html[data-theme] .provider-insights-card .provider-mini-sub{
    grid-area:subtitle;
    line-height:1.4;
  }

  html[data-theme] .provider-insights-card .provider-chart-wrap{
    grid-area:chart;
  }

  html[data-theme] .provider-insights-card .provider-pie{
    width:108px;
    height:108px;
  }

  html[data-theme] .provider-insights-card .provider-pie::after{
    width:70px;
    height:70px;
  }

  html[data-theme] .provider-insights-card .provider-pie-value{
    font-size:17px;
  }

  html[data-theme] .provider-insights-card .provider-legend{
    grid-area:legend;
    gap:6px;
    min-width:0;
  }

  html[data-theme] .provider-insights-card .provider-legend-item{
    display:grid;
    grid-template-columns:8px minmax(0,1fr) auto;
    align-items:center;
    gap:6px;
    font-size:11px;
    line-height:1.35;
  }

  html[data-theme] .provider-insights-card .provider-dot{
    width:8px;
    height:8px;
  }
}

@media (max-width:360px){
  html[data-theme] .provider-insights-card .provider-mini-card{
    grid-template-columns:96px minmax(0,1fr);
    column-gap:10px;
  }

  html[data-theme] .provider-insights-card .provider-pie{
    width:96px;
    height:96px;
  }

  html[data-theme] .provider-insights-card .provider-pie::after{
    width:62px;
    height:62px;
  }
}

@media (prefers-reduced-motion:reduce){
  body{
    transition:none;
  }

  .availability-slots,
  .availability-day-actions{
    animation:none !important;
  }
}
