/* Settings (platform.js renderSettings): the subjects down the left, the
   chosen subject's settings beside them, and a search over all of them. On a
   phone the subjects are a row of chips above. Every setting is edited
   right here, in its own card. */
body.pro-mode .dashboard-shell .dashboard-content .business-settings-page.is-settings-hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-hub {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

/* The subjects, with the search over them. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav {
  position: sticky;
  top: 16px;
  z-index: 4;
  display: grid;
  gap: 12px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #dfe7e3;
  border-radius: 12px;
  color: #6b7c75;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-search:focus-within {
  border-color: #2f9e6e;
  box-shadow: 0 0 0 3px rgb(47 158 110 / 14%);
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-search > svg {
  flex: none;
  width: 16px;
  height: 16px;
}

/* The field is the box around it: the page's own input box is taken off. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-search > input:not(#rl) {
  flex: 1;
  min-width: 0;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  color: #1f2d27;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit;
  font-size: .875rem;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list {
  display: grid;
  gap: 2px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:not(#rl) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: 11px;
  color: #3d4f47;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button > span {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #5d7068;
  background: #f1f5f3;
  transition: background-color 200ms ease, color 200ms ease, transform 260ms cubic-bezier(.34, 1.56, .64, 1);
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button > span svg {
  width: 16px;
  height: 16px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button > b {
  overflow: hidden;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:not(#rl):hover {
  background: #f4f8f6;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:not(#rl)[aria-selected="true"] {
  color: #14412f;
  background: #e8f5ee;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button[aria-selected="true"] > span {
  color: #fff;
  background: #2f9e6e;
  transform: scale(1.04);
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:focus-visible {
  outline: 2px solid #2f9e6e;
  outline-offset: 2px;
}

/* While searching no subject is chosen: every match shows. */
body.pro-mode .dashboard-shell .dashboard-content .is-searching .rl-settings-nav-list > button:not(#rl)[aria-selected="true"] {
  color: #3d4f47;
  background: transparent;
}

body.pro-mode .dashboard-shell .dashboard-content .is-searching .rl-settings-nav-list > button[aria-selected="true"] > span {
  color: #5d7068;
  background: #f1f5f3;
  transform: none;
}

/* The chosen subject. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-content {
  display: grid;
  min-width: 0;
  gap: 32px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-section {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-section[hidden] {
  display: none;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-section-head h2 {
  margin: 0;
  color: #172b23;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-section-head p {
  margin: 4px 0 0;
  color: #66776f;
  font-size: .875rem;
  line-height: 1.5;
}

body.pro-mode .dashboard-shell .dashboard-content .is-searching .rl-settings-section-head p {
  display: none;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-section-body {
  display: grid;
  gap: 16px;
  min-width: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-card {
  display: grid;
  min-width: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-card[hidden] {
  display: none;
}

/* Booking settings: the window's groups as cards, in one form, with its save
   bar held at the foot of the screen while the form is in view. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-booking-form {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-group {
  display: grid;
  gap: 16px;
  min-width: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 18px;
  border: 1px solid #e3ebe7;
  border-radius: 14px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 10px 30px rgb(23 43 35 / 8%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 220ms ease, transform 360ms cubic-bezier(.22, 1, .36, 1), border-color 200ms ease, box-shadow 200ms ease;
}

/* Only changes bring it up; once saved it slides away again. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar[data-state="saved"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 24px));
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar[data-state="dirty"] {
  border-color: #9fd9bf;
  box-shadow: 0 12px 34px rgb(47 158 110 / 16%);
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar[data-state="error"] {
  border-color: #f0b8b2;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar .business-booking-settings-save-state {
  min-width: 0;
  color: #5f7068;
  font-size: .85rem;
  font-weight: 600;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

/* The calendar's settings, laid out as one card. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  padding: 6px 20px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid #edf2ef;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section:nth-child(-n + 2) {
  border-top: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section.rl-calendar-setting-checks {
  grid-row: span 2;
  gap: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section.rl-calendar-setting-checks > h3 {
  margin-bottom: 6px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar h3 {
  margin: 0;
  color: #4f7d6c;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar h3 label {
  color: inherit;
  font: inherit;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar section > small {
  color: #6f8a80;
  font-size: .75rem;
}

/* Messaging settings: each of the window's tabs as a card. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-messaging {
  padding: 20px;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-messaging .communication-settings.is-inline,
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-messaging .communication-settings-content {
  display: grid;
  gap: 16px;
  min-width: 0;
  height: auto;
  max-height: none;
  padding: 0;
  overflow: visible;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-messaging .communication-settings-panel {
  display: grid;
  gap: 16px;
  padding: 0;
  scroll-margin-top: 16px;
}

/* A new message template, written in its card. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-inline-form {
  display: grid;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 16px;
  border: 1px solid #e3ebe7;
  border-radius: 12px;
  background: #f8fbf9;
  animation: rl-settings-reveal 260ms cubic-bezier(.22, 1, .36, 1) both;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-inline-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Privacy & safety: the privacy module's cards, at the width of the others. */
body.pro-mode .dashboard-shell .dashboard-content .rl-settings-privacy {
  display: grid;
  min-width: 0;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-privacy .rl-privacy-panel {
  width: 100%;
  max-width: none;
  margin: 0;
}

@keyframes rl-settings-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-empty {
  margin: 0;
  padding: 40px 16px;
  border: 1px dashed #d8e2dd;
  border-radius: 14px;
  color: #6c7c75;
  font-size: .9rem;
  text-align: center;
}

body.pro-mode .dashboard-shell .dashboard-content .rl-settings-empty[hidden] {
  display: none;
}

/* A tablet: a narrower list of subjects. */
@media (max-width: 1100px) {
  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-hub {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar {
    grid-template-columns: minmax(0, 1fr);
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section:nth-child(2) {
    border-top: 1px solid #edf2ef;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar > section.rl-calendar-setting-checks {
    grid-row: auto;
  }
}

/* A phone: the subjects become a row of chips over the settings. */
@media (max-width: 860px) {
  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-hub {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav {
    position: static;
    gap: 10px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list {
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list::-webkit-scrollbar {
    display: none;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:not(#rl) {
    flex: none;
    width: auto;
    min-height: 38px;
    padding: 0 14px 0 5px;
    border: 1px solid #e1e9e5;
    border-radius: 999px;
    background: #fff;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button:not(#rl)[aria-selected="true"] {
    border-color: #2f9e6e;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button > span {
    width: 26px;
    height: 26px;
    border-radius: 999px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-calendar {
    padding-inline: 16px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-messaging {
    padding: 16px;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar {
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-nav-list > button > span {
    transition: none;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-inline-form {
    animation: none;
  }

  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar {
    transition: none;
  }
}

/* A phone: the bar rides above the tab bar at the foot of the screen. */
@media (max-width: 760px) {
  body.pro-mode .dashboard-shell .dashboard-content .rl-settings-savebar {
    bottom: calc(var(--mobile-nav-height, 72px) + env(safe-area-inset-bottom) + 10px);
  }
}
