/* ---------------------------------------------------------------------------
   One on/off switch for the whole Pro dashboard.

   Every switch looks and moves like the Booking settings › Stylist assignment
   switch: a 38×22 fully rounded track, #d5dbd7 when off and the accent green
   when on, a white 18px knob 2px in that slides 16px, 180ms on the track
   colour and the knob, an accent focus ring, and half opacity when disabled.

   Owner, 2026-11-07: "toggle buttons are not bright enough. it looks like
   they are deactivated. make sure all buttons throughout pro dashboard look
   the same." The pale #81bfa7 on Messages settings was the offender.

   This sheet loads after every other Pro sheet. Earlier layers style the same
   switches with !important and :not(#rl) boosts, so every rule here carries
   two ID-weight :not(#none) boosts and !important. The switch lists sit in
   :where(), so every rule below has the same weight and the order of this
   file decides between off, on, focus and disabled.

   Switch                      Track                                   Knob
   business-switch             > input + span                          ::after
   communication-switch        > input + span                          ::after
   business-booking-policy-    input + .business-booking-policy-switch ::after
     switch / rl-sd-switch
   rl-team-hours-switch        > input + .rl-switch                    ::after
   business-crm-blacklist-     > input + span                          ::after
     switch
   business-holiday-closed-    > input + span                          ::after
     toggle
   business-closed-toggle      > input + .business-closed-toggle-track ::after
                               (on = open = the "closed" box unticked)
   business-settings-search-   > input + i                             ::after
     switch
   business-service-phase-     > input + span                          ::after
     occupancy
   rl-request-switch           .rl-request-soon > input + span         ::after
   rl-privacy-switch (Pro)     the input itself                        ::after
   onboarding-hours-toggle     > input[type=checkbox] itself           ::after
   rl-ntf-switch               > i                                     ::after
   business-permission-        > span                                  ::after
     bucket-toggle
   rl-sd-switch-button         the button itself                       > span
   business-service-archive-   > span                                  > span > i
     toggle
   rl-late-switch              .rl-late-toggle > .rl-late-switch       > i

   Pills that hold a switch (Unread only, Archived, Late, a group's access
   buckets) keep their own pill styling and focus ring; only the switch inside
   them changes.
--------------------------------------------------------------------------- */

/* ---- Track, off --------------------------------------------------------- */
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input + span,
  .communication-switch > input + span,
  input + .business-booking-policy-switch,
  .rl-team-hours-switch > input + .rl-switch,
  .business-crm-blacklist-switch > input + span,
  .business-holiday-closed-toggle > input + span,
  .business-closed-toggle > input + .business-closed-toggle-track,
  .business-settings-search-switch > input + i,
  .business-service-phase-occupancy > input + span,
  .rl-request-soon > input + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch,
  .onboarding-hours-toggle > input[type="checkbox"],
  .rl-ntf-switch > i,
  .business-permission-bucket-toggle > span,
  .rl-sd-switch-button,
  .business-service-archive-toggle > span,
  .rl-late-toggle > .rl-late-switch
) {
  position: relative !important;
  box-sizing: border-box !important;
  flex: none !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #d5dbd7 !important;
  box-shadow: none !important;
  transition: background-color 180ms var(--ease-standard, cubic-bezier(0.22, 1, 0.36, 1)) !important;
}

/* ---- Knob, off ---------------------------------------------------------- */
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input + span,
  .communication-switch > input + span,
  input + .business-booking-policy-switch,
  .rl-team-hours-switch > input + .rl-switch,
  .business-crm-blacklist-switch > input + span,
  .business-holiday-closed-toggle > input + span,
  .business-closed-toggle > input + .business-closed-toggle-track,
  .business-settings-search-switch > input + i,
  .business-service-phase-occupancy > input + span,
  .rl-request-soon > input + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch,
  .onboarding-hours-toggle > input[type="checkbox"],
  .rl-ntf-switch > i,
  .business-permission-bucket-toggle > span
)::after {
  content: "" !important;
}
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input + span,
  .communication-switch > input + span,
  input + .business-booking-policy-switch,
  .rl-team-hours-switch > input + .rl-switch,
  .business-crm-blacklist-switch > input + span,
  .business-holiday-closed-toggle > input + span,
  .business-closed-toggle > input + .business-closed-toggle-track,
  .business-settings-search-switch > input + i,
  .business-service-phase-occupancy > input + span,
  .rl-request-soon > input + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch,
  .onboarding-hours-toggle > input[type="checkbox"],
  .rl-ntf-switch > i,
  .business-permission-bucket-toggle > span
)::after,
body.pro-mode:not(#none):not(#none) :where(
  .rl-sd-switch-button > span,
  .business-service-archive-toggle > span > i,
  .rl-late-toggle > .rl-late-switch > i
) {
  position: absolute !important;
  top: 2px !important;
  right: auto !important;
  bottom: auto !important;
  left: 2px !important;
  box-sizing: border-box !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(22, 32, 28, 0.25) !important;
  transform: none !important;
  transition: transform 180ms var(--ease-standard, cubic-bezier(0.22, 1, 0.36, 1)) !important;
}

/* ---- On ----------------------------------------------------------------- */
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input:checked + span,
  .communication-switch > input:checked + span,
  input:checked + .business-booking-policy-switch,
  .rl-team-hours-switch > input:checked + .rl-switch,
  .business-crm-blacklist-switch > input:checked + span,
  .business-holiday-closed-toggle > input:checked + span,
  .business-closed-toggle > input:not(:checked) + .business-closed-toggle-track,
  .business-settings-search-switch > input:checked + i,
  .business-service-phase-occupancy > input:checked + span,
  .rl-request-soon > input:checked + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch:checked,
  .onboarding-hours-toggle > input[type="checkbox"]:checked,
  .rl-ntf-switch[aria-checked="true"] > i,
  .business-permission-bucket-toggle[aria-checked="true"] > span,
  .rl-sd-switch-button[aria-checked="true"],
  .business-service-archive-toggle:is(.is-active, [aria-checked="true"]) > span,
  .rl-late-toggle.is-on > .rl-late-switch
) {
  background: var(--color-accent, #1f6b52) !important;
}
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input:checked + span,
  .communication-switch > input:checked + span,
  input:checked + .business-booking-policy-switch,
  .rl-team-hours-switch > input:checked + .rl-switch,
  .business-crm-blacklist-switch > input:checked + span,
  .business-holiday-closed-toggle > input:checked + span,
  .business-closed-toggle > input:not(:checked) + .business-closed-toggle-track,
  .business-settings-search-switch > input:checked + i,
  .business-service-phase-occupancy > input:checked + span,
  .rl-request-soon > input:checked + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch:checked,
  .onboarding-hours-toggle > input[type="checkbox"]:checked,
  .rl-ntf-switch[aria-checked="true"] > i,
  .business-permission-bucket-toggle[aria-checked="true"] > span
)::after,
body.pro-mode:not(#none):not(#none) :where(
  .rl-sd-switch-button[aria-checked="true"] > span,
  .business-service-archive-toggle:is(.is-active, [aria-checked="true"]) > span > i,
  .rl-late-toggle.is-on > .rl-late-switch > i
) {
  transform: translateX(16px) !important;
}

/* ---- Keyboard focus ------------------------------------------------------ */
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input:focus-visible + span,
  .communication-switch > input:focus-visible + span,
  input:focus-visible + .business-booking-policy-switch,
  .rl-team-hours-switch > input:focus-visible + .rl-switch,
  .business-crm-blacklist-switch > input:focus-visible + span,
  .business-holiday-closed-toggle > input:focus-visible + span,
  .business-closed-toggle > input:focus-visible + .business-closed-toggle-track,
  .business-settings-search-switch > input:focus-visible + i,
  .business-service-phase-occupancy > input:focus-visible + span,
  .rl-request-soon > input:focus-visible + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch:focus-visible,
  .onboarding-hours-toggle > input[type="checkbox"]:focus-visible,
  .rl-sd-switch-button:focus-visible
) {
  outline: 2px solid var(--color-accent, #1f6b52) !important;
  outline-offset: 2px !important;
}

/* ---- Disabled ------------------------------------------------------------
   Rows that already fade as a whole when disabled (salon search, the weekly
   Closed boxes, access buckets) and switches that are only disabled while a
   save is running (Archived, Takes bookings) are left to their own rules. */
body.pro-mode:not(#none):not(#none) :where(
  .business-switch > input:disabled + span,
  .communication-switch > input:disabled + span,
  input:disabled + .business-booking-policy-switch,
  .rl-team-hours-switch > input:disabled + .rl-switch,
  .business-crm-blacklist-switch > input:disabled + span,
  .business-holiday-closed-toggle > input:disabled + span,
  .business-service-phase-occupancy > input:disabled + span,
  .rl-request-soon > input:disabled + .rl-request-switch,
  .rl-privacy-panel.is-pro .rl-privacy-switch:disabled,
  .onboarding-hours-toggle > input[type="checkbox"]:disabled
) {
  opacity: 0.5 !important;
}

/* ---- Room for the 38px track -------------------------------------------- */
body.pro-mode:not(#none):not(#none) :where(.communication-switch) {
  flex: 0 0 38px !important;
  width: 38px !important;
  height: 22px !important;
}
body.pro-mode:not(#none):not(#none) :where(.business-holiday-closed-toggle, .business-permission-bucket-toggle) {
  grid-template-columns: 38px auto !important;
}
body.pro-mode:not(#none):not(#none) :where(.business-service-phase-occupancy) {
  grid-template-columns: 38px minmax(0, 1fr) !important;
}

@media (prefers-reduced-motion: reduce) {
  body.pro-mode:not(#none):not(#none) :where(
    .business-switch > input + span,
    .communication-switch > input + span,
    input + .business-booking-policy-switch,
    .rl-team-hours-switch > input + .rl-switch,
    .business-crm-blacklist-switch > input + span,
    .business-holiday-closed-toggle > input + span,
    .business-closed-toggle > input + .business-closed-toggle-track,
    .business-settings-search-switch > input + i,
    .business-service-phase-occupancy > input + span,
    .rl-request-soon > input + .rl-request-switch,
    .rl-privacy-panel.is-pro .rl-privacy-switch,
    .onboarding-hours-toggle > input[type="checkbox"],
    .rl-ntf-switch > i,
    .business-permission-bucket-toggle > span,
    .rl-sd-switch-button,
    .rl-sd-switch-button > span,
    .business-service-archive-toggle > span,
    .business-service-archive-toggle > span > i,
    .rl-late-toggle > .rl-late-switch,
    .rl-late-toggle > .rl-late-switch > i
  ),
  body.pro-mode:not(#none):not(#none) :where(
    .business-switch > input + span,
    .communication-switch > input + span,
    input + .business-booking-policy-switch,
    .rl-team-hours-switch > input + .rl-switch,
    .business-crm-blacklist-switch > input + span,
    .business-holiday-closed-toggle > input + span,
    .business-closed-toggle > input + .business-closed-toggle-track,
    .business-settings-search-switch > input + i,
    .business-service-phase-occupancy > input + span,
    .rl-request-soon > input + .rl-request-switch,
    .rl-privacy-panel.is-pro .rl-privacy-switch,
    .onboarding-hours-toggle > input[type="checkbox"],
    .rl-ntf-switch > i,
    .business-permission-bucket-toggle > span
  )::after {
    transition: none !important;
  }
}
