/* Let the shared header determine its geometry; hang the sprig over the lower edge. */
html[data-app-theme="theme-mandarin-time"] body > header {
  overflow: visible;
}
html[data-app-theme="theme-mandarin-time"] body > header::after {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  bottom: -9px;
  width: min(62%, 275px);
  height: clamp(24px, 7.4vw, 33px);
  background: url("mandarin-garland.v2.webp") left bottom / 100% 100% no-repeat;
  pointer-events: none;
}
/* Pin the knot to the rounded lower-right corner, independently of the label. */
html[data-app-theme="theme-mandarin-time"] #app > .bm-section-tabs {
  position: relative;
  z-index: 1;
  overflow: visible;
}
html[data-app-theme="theme-mandarin-time"] .bm-section-tabs > .bm-section-tab.is-active {
  position: relative;
  overflow: visible;
}
html[data-app-theme="theme-mandarin-time"] .bm-section-tabs > .bm-section-tab.is-active::after {
  content: "";
  position: absolute;
  inset-inline-end: 8%;
  bottom: 12%;
  transform: translate(50%, 50%) rotate(-15deg);
  transform-origin: 50% 45%;
  width: clamp(28px, 8.4vw, 36px);
  aspect-ratio: 1.35;
  background: url("mandarin-tab-bow.v3.webp") center top / contain no-repeat;
  pointer-events: none;
}
html[data-app-theme="theme-mandarin-time"] .bm-section-tab.is-active > span {
  position: relative;
  z-index: 1;
}
/* Give the tree its own space beside the tabs in both search modes. */
html[data-app-theme="theme-mandarin-time"] #app .sd-search > .sd-tabs {
  --mt-tree-width: clamp(64px, 19vw, 94px);
  position: relative;
  margin-inline-start: calc(var(--mt-tree-width) + 8px);
  margin-block: 12px 20px;
}
html[data-app-theme="theme-mandarin-time"] #app .sd-search > .sd-tabs::before {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: calc(100% + 8px);
  width: var(--mt-tree-width);
  height: 78px;
  transform: translateY(-50%);
  background: url("mandarin-search-tree.v2.webp") center / contain no-repeat;
  pointer-events: none;
}
html[data-app-theme="theme-mandarin-time"] #app .sd-tab {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The bow and mandarins occupy a separate column, away from the booking controls. */
html[data-app-theme="theme-mandarin-time"] #app .su-bookings > h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 10px;
}
html[data-app-theme="theme-mandarin-time"] #app .su-bookings > h2::after {
  content: "";
  flex: 0 0 clamp(78px, 25vw, 124px);
  height: 57px;
  background: url("mandarin-bow-citrus.v2.webp") right center / contain no-repeat;
  pointer-events: none;
}
@media (max-height: 450px) and (orientation: landscape) {
  html[data-app-theme="theme-mandarin-time"] body > header::after { width: min(58%, 175px); }
}
/* A single backdrop sits behind both the portrait and its independently selected frame. */
html[data-app-theme="theme-mandarin-time"] #app :is(.cp-client-avatar, .mt-master-avatar) {
  position: relative;
  isolation: isolate;
}
html[data-app-theme="theme-mandarin-time"] #app :is(.cp-client-avatar, .mt-master-avatar)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(calc(100vw - 64px), 440px);
  height: clamp(94px, 30vw, 126px);
  background: url("mandarin-kremlin.v4.webp") center bottom / 100% 100% no-repeat;
  opacity: .72;
  filter: blur(.8px);
}
html[data-app-theme="theme-mandarin-time"] #app .pr-post > .pr-author::after {
  content: "";
  display: block;
  flex: 0 0 clamp(32px, 10vw, 46px);
  height: 36px;
  margin-left: auto;
  align-self: center;
  background: url("mandarin-mandarins.v1.webp") center / contain no-repeat;
  pointer-events: none;
}
html[data-app-theme="theme-mandarin-time"] #app .pr-post > .pr-author > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Show the same skyline in the seasonal theme picker. */
.vxp-mini[data-app-theme="theme-mandarin-time"] {
  isolation: isolate;
}
.vxp-mini[data-app-theme="theme-mandarin-time"] > .vxp-mini-tools {
  position: relative;
  padding-bottom: 9px;
  background: url("mandarin-garland.v2.webp") left bottom / 60% 12px no-repeat;
}
.vxp-mini[data-app-theme="theme-mandarin-time"] > .vxp-mini-tools::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  left: 0;
  top: calc(100% + 4px);
  width: 100%;
  height: 73px;
  background: url("mandarin-kremlin.v4.webp") center bottom / 100% 100% no-repeat;
  opacity: .72;
  filter: blur(.65px);
}

/* A frozen nameplate for the existing VIP status, including its seasonal swatch. */
html[data-app-theme="theme-mandarin-time"] #app :is(.vxp-name > .vxp-vip-badge, .sd-price > .sd-vip):not(:where(.vxp-mini *)),
.vxp-mini[data-app-theme="theme-mandarin-time"] .vxp-vip-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-block: 2px 3px;
  padding: 2px .55em;
  border: 1px solid #74b6d7;
  border-top-color: #c7eefc;
  border-radius: 4px;
  background:
    linear-gradient(128deg, #ffffffda 0 9%, transparent 10% 54%, #ffffff80 55% 59%, transparent 60%),
    linear-gradient(32deg, #56a2d4 0 18%, transparent 19% 78%, #87cfe9 79%),
    linear-gradient(173deg, #f5fdff 0%, #d4f4ff 42%, #98d7f4 64%, #c3eafa 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #5199c3, 0 1px 3px #377baa42;
  color: #123f62 !important;
  text-shadow: 0 1px 0 #fff;
  font-weight: 850;
  letter-spacing: .07em;
}
html[data-app-theme="theme-mandarin-time"] #app :is(.vxp-name > .vxp-vip-badge, .sd-price > .sd-vip):not(:where(.vxp-mini *))::after,
.vxp-mini[data-app-theme="theme-mandarin-time"] .vxp-vip-badge::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 100%;
  inset-inline: 1px;
  height: 4px;
  background: linear-gradient(100deg, #5397c8, #d9f6ff 30%, #76b6dd 55%, #c8ecff 80%, #69abcf);
  clip-path: polygon(0 0,100% 0,100% 20%,88% 22%,84% 72%,79% 22%,56% 20%,51% 54%,47% 20%,24% 25%,18% 100%,13% 25%,0 20%);
}

/* The existing route and button drive both frames of the tree ornament. */
html[data-app-theme="theme-mandarin-time"] nav #qr-bub > svg {
  left: 29% !important;
  top: 21.5% !important;
  width: 42% !important;
  height: 42% !important;
  z-index: 3 !important;
  filter: none !important;
  background: url("mandarin-orb-tree.v7.svg") left center / 200% 100% no-repeat;
}
html[data-app-theme="theme-mandarin-time"] nav #qr-bub > svg > path {
  display: none;
  animation: none !important;
}
html[data-app-theme="theme-mandarin-time"] nav[data-bm-active-view="find"] #qr-bub > svg {
  background-position: right center;
}
.vxp-mini[data-app-theme="theme-mandarin-time"] .vxp-mini-heart {
  position: relative;
  font-size: 0;
}
.vxp-mini[data-app-theme="theme-mandarin-time"] .vxp-mini-heart::after {
  content: "";
  position: absolute;
  inset: 18%;
  background: url("mandarin-orb-tree.v7.svg") left center / 200% 100% no-repeat;
  pointer-events: none;
}

/* Negative delays distribute a small, fixed number of flakes across the first frame. */
@media screen and (prefers-reduced-motion: no-preference) {
  html[data-app-theme="theme-mandarin-time"] body > .mt-snow {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 900;
    overflow: hidden;
    contain: strict;
    pointer-events: none;
    user-select: none;
    --mt-fall: 100vh;
  }
  @supports (height: 100dvh) {
    html[data-app-theme="theme-mandarin-time"] body > .mt-snow { --mt-fall: 100dvh; }
  }
  .mt-snow > i {
    position: absolute;
    top: -16px;
    left: var(--x);
    font: normal 10px/1 sans-serif;
    color: #9389ab;
    text-shadow: 0 0 1px #fff;
    opacity: .31;
    animation: mt-snowfall var(--period, 33s) linear var(--phase) infinite;
  }
  .mt-snow > i::before { content: "❄︎"; }
  .mt-snow > i:nth-child(3n) { font-size: 8px; color: #8c9eb8; --period: 39s; }
  .mt-snow > i:nth-child(3n + 1) { font-size: 12px; color: #bcaccb; --period: 36s; }
  .mt-snow > i:nth-child(36n + 1)  { --x: 3%;  --phase: -11s; }
  .mt-snow > i:nth-child(36n + 2)  { --x: 13%; --phase: -27s; }
  .mt-snow > i:nth-child(36n + 3)  { --x: 22%; --phase: -4s; }
  .mt-snow > i:nth-child(36n + 4)  { --x: 31%; --phase: -22s; }
  .mt-snow > i:nth-child(36n + 5)  { --x: 40%; --phase: -2s; }
  .mt-snow > i:nth-child(36n + 6)  { --x: 48%; --phase: -32s; }
  .mt-snow > i:nth-child(36n + 7)  { --x: 59%; --phase: -16s; }
  .mt-snow > i:nth-child(36n + 8)  { --x: 68%; --phase: -31s; }
  .mt-snow > i:nth-child(36n + 9)  { --x: 77%; --phase: -9s; }
  .mt-snow > i:nth-child(36n + 10) { --x: 85%; --phase: -25s; }
  .mt-snow > i:nth-child(36n + 11) { --x: 93%; --phase: -13s; }
  .mt-snow > i:nth-child(36n + 12) { --x: 8%; --phase: -22s; }
  .mt-snow > i:nth-child(36n + 13) { --x: 18%; --phase: -9s; }
  .mt-snow > i:nth-child(36n + 14) { --x: 26%; --phase: -27s; }
  .mt-snow > i:nth-child(36n + 15) { --x: 35%; --phase: -6s; }
  .mt-snow > i:nth-child(36n + 16) { --x: 44%; --phase: -31s; }
  .mt-snow > i:nth-child(36n + 17) { --x: 54%; --phase: -8s; }
  .mt-snow > i:nth-child(36n + 18) { --x: 63%; --phase: -28s; }
  .mt-snow > i:nth-child(36n + 19) { --x: 73%; --phase: -17s; }
  .mt-snow > i:nth-child(36n + 20) { --x: 81%; --phase: -3s; }
  .mt-snow > i:nth-child(36n + 21) { --x: 89%; --phase: -32s; }
  .mt-snow > i:nth-child(36n + 22) { --x: 96%; --phase: -19s; }
  .mt-snow > i:nth-child(36n + 23) { --x: 1%; --phase: -21s; }
  .mt-snow > i:nth-child(36n + 24) { --x: 6%; --phase: -4s; }
  .mt-snow > i:nth-child(36n + 25) { --x: 15%; --phase: -18s; }
  .mt-snow > i:nth-child(36n + 26) { --x: 20%; --phase: -35s; }
  .mt-snow > i:nth-child(36n + 27) { --x: 29%; --phase: -13s; }
  .mt-snow > i:nth-child(36n + 28) { --x: 34%; --phase: -26s; }
  .mt-snow > i:nth-child(36n + 29) { --x: 42%; --phase: -21s; }
  .mt-snow > i:nth-child(36n + 30) { --x: 50%; --phase: -5s; }
  .mt-snow > i:nth-child(36n + 31) { --x: 56%; --phase: -34s; }
  .mt-snow > i:nth-child(36n + 32) { --x: 61%; --phase: -9s; }
  .mt-snow > i:nth-child(36n + 33) { --x: 69%; --phase: -19s; }
  .mt-snow > i:nth-child(36n + 34) { --x: 74%; --phase: -28s; }
  .mt-snow > i:nth-child(36n + 35) { --x: 83%; --phase: -15s; }
  .mt-snow > i:nth-child(36n + 36) { --x: 98%; --phase: -4s; }
  .mt-snow > i:nth-child(n + 37) {
    left: calc(var(--x) + 1%);
    animation-delay: calc(var(--phase) - 17s);
    opacity: .26;
  }
}
@keyframes mt-snowfall {
  0%   { transform: translate3d(-3px, 0, 0) rotate(-8deg); }
  50%  { transform: translate3d(5px, calc(var(--mt-fall) * .5 + 10px), 0) rotate(12deg); }
  100% { transform: translate3d(-2px, calc(var(--mt-fall) + 20px), 0) rotate(24deg); }
}

/* Wrap only the selected side tab. Put the knot on the outside, away from the orb and counters. */
html[data-app-theme="theme-mandarin-time"] #nav.bm-bubble-nav {
  --mt-ribbon-x: 12%;
  --mt-knot-turn: -12deg;
}
html[data-app-theme="theme-mandarin-time"] #nav.bm-bubble-nav > .on:not(#qr-bub):not(.bm-dock-canvas) {
  position: relative;
  overflow: visible;
  /* A narrow satin band wraps the box and lid together, clear of the label. */
  border-radius: 8px 8px 11px 11px !important;
  background:
    linear-gradient(90deg, #831c3a, #ce4661 25%, #f696a3 45%, #c93453 68%, #85213c)
      var(--mt-ribbon-x) top / 7px 100% no-repeat,
    linear-gradient(#fff7ff, #ead3fc 65%, #c7a1d9 84%, #9d73b9)
      center top / 100% 7px no-repeat,
    radial-gradient(ellipse, #fff9 0 .7px, transparent 1px) 2px 8px / 11px 11px,
    linear-gradient(125deg, #f0dbfa, #ddc0f4 52%, #c6a6e9) !important;
  color: #462556 !important;
  box-shadow: inset 0 0 0 1px #ba95d0, inset 0 -3px 0 #b695d3,
    0 2px 4px #65358233 !important;
}
html[data-app-theme="theme-mandarin-time"] #nav.bm-bubble-nav > #mine-nav-button.on {
  --mt-ribbon-x: 88%;
  --mt-knot-turn: 12deg;
}
html[data-app-theme="theme-mandarin-time"] #nav.bm-bubble-nav > .on:not(#qr-bub):not(.bm-dock-canvas)::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  width: clamp(23px, 7vw, 32px);
  aspect-ratio: 192 / 154;
  /* The gradient positions the ribbon within the space left by its 7px width. */
  left: clamp(8px, var(--mt-ribbon-x), calc(100% - 8px));
  top: 3px;
  transform: translate(-50%, -50%) rotate(var(--mt-knot-turn));
  --mt-knot: url("mandarin-tab-bow.v3.webp") center / contain no-repeat;
  background: transparent var(--mt-knot) !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  -webkit-mask: var(--mt-knot) !important;
  mask: var(--mt-knot) !important;
  pointer-events: none;
}
html[data-app-theme="theme-mandarin-time"] #app [data-beauty-center-entry] {
  position: relative;
  overflow: visible;
}
html[data-app-theme="theme-mandarin-time"] #app [data-beauty-center-entry] > .mt-studio-hat {
  display: block !important;
  position: absolute;
  z-index: 2;
  width: clamp(40px, 13vw, 62px);
  aspect-ratio: 210 / 206;
  right: clamp(-12px, -2.5vw, -7px);
  top: clamp(-29px, calc(45% - 48px), 21px);
  transform: rotate(5deg);
  transform-origin: 72% 65%;
  background: url("mandarin-studio-hat.v8.webp") center / contain no-repeat;
  pointer-events: none;
}
html[data-app-theme="theme-mandarin-time"] #nav.bm-bubble-nav > #mine-nav-button.on:has([data-waitlist-count]:not([hidden])) {
  --mt-ribbon-x: 12%;
  --mt-knot-turn: -12deg;
}
