/* My Hair: Appointments (Upcoming | Past), Waitlist (Pending | Past requests),
   and the outlines every My Hair page (and the Salons list) loads in.

   Loaded after the phone layer (ui/mobile-native.css), so these rules decide
   the pieces they name on every width. */

/* ---- The switch -------------------------------------------------------------
   Two pages of one list, side by side in a pill; a white pill slides under the
   one shown (--me-segment-index, set in place by switchMeSegment). */
body.me-workspace-mode .me-segment {
  position: relative;
  display: grid;
  flex: none;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  min-width: 264px;
  padding: 4px;
  border: 1px solid var(--hair-line, #e8e4ec);
  border-radius: 999px;
  background: #f3f0f7;
  isolation: isolate;
}

body.me-workspace-mode .me-segment::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--me-segment-count, 2));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(36, 24, 72, 0.08), 0 8px 18px -12px rgba(82, 54, 179, 0.5);
  transform: translateX(calc(var(--me-segment-index, 0) * 100%));
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.me-workspace-mode .me-segment > button {
  display: inline-flex;
  min-width: 0;
  min-height: 38px !important;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--hair-muted, #696371);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease;
}

body.me-workspace-mode .me-segment > button .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

body.me-workspace-mode .me-segment > button.active {
  color: var(--hair-ink, #17131f);
}

body.me-workspace-mode .me-segment > button.active .icon {
  color: var(--hair-accent, #6a48d0);
}

@media (hover: hover) and (pointer: fine) {
  body.me-workspace-mode .me-segment > button:not(.active):hover {
    color: var(--hair-accent, #6a48d0);
    background: transparent;
  }
}

body.me-workspace-mode .me-segment > button:focus-visible {
  outline: 2px solid #916be8;
  outline-offset: 2px;
}

body.me-workspace-mode .me-segment-pages,
body.me-workspace-mode .me-segment-page {
  display: grid;
  min-width: 0;
}

body.me-workspace-mode .me-segment-page[hidden] {
  display: none !important;
}

/* On a phone the page's name is in the bar above, so the switch is the
   header, as wide as the page. */
@media (max-width: 760px) {
  body.customer-mode.me-workspace-mode .me-page-header:has(> .me-segment) {
    display: block;
  }

  body.customer-mode.me-workspace-mode .me-page-header > .me-segment {
    width: 100%;
    min-width: 0;
  }

  body.customer-mode.me-workspace-mode .me-segment > button {
    min-height: 40px !important;
    height: 40px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.me-workspace-mode .me-segment::before {
    transition: none;
  }
}

/* ---- A day or month above its cards, then a hairline ------------------------ */
body.me-workspace-mode .me-date-rule {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--hair-ink, #17131f);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

body.me-workspace-mode .me-date-rule > span {
  flex: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.me-workspace-mode .me-date-rule em {
  color: var(--hair-accent, #6a48d0);
  font-style: normal;
}

body.me-workspace-mode .me-date-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--hair-line, #e8e4ec);
}

/* ---- Appointments > Past: months of visits ------------------------------------ */
body.me-workspace-mode .me-history-month {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body.me-workspace-mode .me-history-month + .me-history-month {
  margin-top: 14px;
}

/* A cancelled, declined or missed visit is a quieter card. */
body.me-workspace-mode .me-history-card:is(.is-cancelled, .is-declined, .is-no_show) {
  background: #fcfbfd;
  box-shadow: none;
}

body.me-workspace-mode .me-history-card:is(.is-cancelled, .is-declined, .is-no_show) .me-history-card-icon {
  color: #8a8398;
  background: #f2f0f5;
}

body.me-workspace-mode .me-history-card:is(.is-cancelled, .is-declined, .is-no_show) .me-history-card-title h3 {
  color: #5d5867;
}

/* ---- Waitlist requests -------------------------------------------------------- */
body.customer-mode .me-waitlist-group {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body.customer-mode .me-waitlist-group + .me-waitlist-group {
  margin-top: 14px;
}

body.customer-mode .me-waitlist-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

/* Every card has the same frame; its actions sit at its foot, so buttons line
   up however long the card above them is. */
body.customer-mode .me-waitlist-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #ebe7f1;
  border-radius: 16px;
  background: #fff;
}

body.customer-mode .me-waitlist-card > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

body.customer-mode .me-waitlist-date {
  display: grid;
  width: 48px;
  height: 52px;
  align-content: center;
  justify-items: center;
  border-radius: 12px;
  color: #5236b3;
  background: #f4f0fd;
}

body.customer-mode .me-waitlist-date small {
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

body.customer-mode .me-waitlist-date strong {
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

body.customer-mode .me-waitlist-title {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding-top: 4px;
}

body.customer-mode .me-waitlist-card h3 {
  overflow: hidden;
  margin: 0;
  color: var(--hair-ink, #17131f);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.customer-mode .me-waitlist-title p {
  margin: 0;
  color: #6f6879;
  font-size: 13px;
  line-height: 1.4;
}

body.customer-mode .me-waitlist-status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #6f6879;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body.customer-mode .me-waitlist-status .icon {
  width: 14px;
  height: 14px;
}

body.customer-mode .me-waitlist-card > header > .status-badge {
  margin-top: 4px;
}

body.customer-mode .me-waitlist-status.is-waiting { color: #6a48d0; }
body.customer-mode .me-waitlist-status.is-accepted { color: #2f7a57; }
body.customer-mode .me-waitlist-status.is-declined { color: #b4322a; }
body.customer-mode .me-waitlist-status.is-expired { color: #a2620c; }
body.customer-mode .me-waitlist-status.is-cancelled { color: #6f6879; }

body.customer-mode .me-waitlist-windows {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #faf8fc;
  list-style: none;
}

body.customer-mode .me-waitlist-windows li {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 10px;
  color: var(--hair-ink, #17131f);
  font-size: 13.5px;
}

body.customer-mode .me-waitlist-windows li span {
  color: #6f6879;
}

body.customer-mode .me-waitlist-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid #f0edf4;
  color: #6f6879;
  font-size: 13px;
  line-height: 1.45;
}

body.customer-mode .me-waitlist-card > footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* A request that closed without a booking reads quieter. */
body.customer-mode .me-waitlist-card:is(.is-declined, .is-expired, .is-cancelled) {
  background: #fcfbfd;
}

body.customer-mode .me-waitlist-card:is(.is-declined, .is-expired, .is-cancelled) .me-waitlist-date {
  color: #7d7689;
  background: #f2f0f5;
}

body.customer-mode .me-waitlist-card:is(.is-declined, .is-expired, .is-cancelled) :is(h3, .me-waitlist-windows li) {
  color: #6f6879;
}

@media (max-width: 760px) {
  body.customer-mode.me-workspace-mode .me-waitlist-section {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.customer-mode .me-waitlist-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

/* ---- Loading outlines ---------------------------------------------------------
   The page is drawn with its own containers; its words are grey bars the
   length of a typical value (.sk), its photos and chips grey blocks
   (.sk-block), its buttons grey pills (.sk-button), all under one soft sheen. */
.sk,
.sk-block,
.sk-button {
  --sk-base: var(--rl-skel-base, #efedf2);
  --sk-shine: var(--rl-skel-shine, #f8f7fa);
  background: linear-gradient(100deg, var(--sk-base) 30%, var(--sk-shine) 50%, var(--sk-base) 70%) 0 0 / 250% 100% !important;
  animation: rl-skel-sheen 1.6s ease-in-out infinite;
}

.sk {
  border-radius: 6px;
  color: transparent !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  user-select: none;
}

.sk-block,
.sk-button {
  border-color: transparent !important;
  color: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
  user-select: none;
}

.sk-block > *,
.sk-button > * {
  visibility: hidden;
}

.sk-block::before,
.sk-block::after,
.sk-button::before,
.sk-button::after {
  display: none !important;
}

/* The Salons list's outline cards (renderSalonLoadingState) stay still. */
html body .directory-salon-row.is-skeleton {
  pointer-events: none;
  transform: none !important;
}

/* The pieces an outline needs that the real page fills with content. */
body.me-workspace-mode .me-feature-media.sk-block,
body.me-workspace-mode .customer-appointment-map.sk-block {
  min-height: 100%;
}

body.me-workspace-mode .me-native-next.is-skeleton {
  pointer-events: none;
}

body.me-workspace-mode .me-native-next.is-skeleton > .icon {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .sk,
  .sk-block,
  .sk-button {
    animation: none;
  }
}

/* A bar that runs past its line is cut, never ended with "…". */
[data-me-outline] *,
.me-native-next.is-skeleton *,
.me-native-tile small.is-outline {
  text-overflow: clip !important;
}

/* An outline's icons are drawn as quietly as its bars. */
[data-me-outline] .icon {
  color: #dedae4 !important;
}

/* A press on a page that is still arriving waits on the control itself
   (app.js holdHydratingPageClick) and runs on the real page. */
[data-hydrating] .me-workspace {
  cursor: progress;
}

[data-hydrating] .is-awaiting-page {
  animation: rl-awaiting-page 0.8s ease-in-out infinite alternate;
}

@keyframes rl-awaiting-page {
  to {
    opacity: 0.55;
  }
}
