body:has(.card-wishes) .card-size {
  z-index: 2;
}

.card-wishes {
  --wish-ink: #313339;
  --wish-secondary: rgb(38 42 51 / 70%);
  --wish-glass: linear-gradient(164deg, #f8f8f9dc 0%, #edeef0da 50%, #dcdee2d6 100%);
  --wish-edge: #b7bbc450;
  --wish-glint: #fff;
  --wish-shadow: inset 0 1px 2px #fff, inset 0 -1px 2px #fffd, 0 6px 19px #21263115, 0 2px 5px #2529310a;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  color: var(--wish-ink);
  font-family: system-ui, sans-serif;
  transition: opacity .23s cubic-bezier(.24, .7, .34, 1), translate .23s ease-out;
}

.card-wishes--departing {
  opacity: 0;
  translate: 0 4px;
}

.card-wishes [hidden] { display: none; }

.card-wishes button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.card-wishes--departing button {
  pointer-events: none;
}

.card-wishes :focus-visible {
  outline: 2px solid #48668f;
  outline-offset: 4px;
}

.wish-all,
.wish-bubble {
  border: 1px solid var(--wish-edge);
  border-block-color: var(--wish-glint);
  background: var(--wish-glass);
  box-shadow: var(--wish-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.wish-all {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inset-inline-end: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  min-height: 44px;
  inline-size: max-content;
  max-inline-size: calc(100% - 30px);
  padding: 0 17px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 630;
}

.wish-all:hover { background: #f4f5f7; }

.wish-all__count {
  position: absolute;
  inset-block-start: -8px;
  inset-inline-end: -8px;
  display: grid;
  place-items: center;
  min-inline-size: 25px;
  block-size: 25px;
  padding-inline: 5px;
  border: 1px solid #b5bdce7d;
  border-block-color: #fffffff2;
  border-radius: 999px;
  background: linear-gradient(155deg, #ffffffe0, #f0f3f88a 47%, #ced6e371);
  box-shadow: inset 0 1px 2px #fff, inset 0 -1px 1px #fffa, 0 2px 6px #27324828;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #364157;
  font-size: 11px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.wish-flight {
  position: absolute;
  inset: auto;
  top: var(--wish-top);
  left: var(--wish-left);
  inline-size: max-content;
  max-inline-size: var(--wish-width);
  translate: 0 -50%;
}

.wish-bubble {
  display: block;
  inline-size: max-content;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: 11px 16px 12px;
  border-radius: 26px;
  text-align: left;
  font-size: 14px;
  font-weight: 470;
  line-height: 1.4;
  transition: box-shadow .22s ease, background .22s ease;
}

.wish-flight--compact .wish-bubble {
  min-block-size: 37px;
  padding: 7px 12px 8px;
  font-size: 13px;
  line-height: 1.35;
}

.wish-flight--compact .wish-author {
  margin-top: 3px;
  font-size: 11px;
}

.wish-bubble[aria-pressed="true"] {
  background: linear-gradient(164deg, #fbfbfceb, #e2e4e8ed);
  box-shadow: var(--wish-shadow), 0 0 0 1px #9ba6b22e;
}

.wish-flight--moving {
  animation: wish-flight var(--wish-duration) linear var(--wish-delay) both;
  animation-play-state: var(--wish-play, running);
}

.wish-flight--moving .wish-bubble {
  animation:
    wish-pop .49s var(--wish-delay) both,
    wish-fade .8s ease-in calc(var(--wish-delay) + var(--wish-duration) - .8s) forwards;
  animation-play-state: var(--wish-play, running);
}

@keyframes wish-flight {
  0% { transform: translate3d(0, var(--wish-sway), 0); }
  31% { transform: translate3d(calc(var(--wish-travel) * .31), calc(var(--wish-sway) - var(--wish-rise) * .8), 0); }
  66% { transform: translate3d(calc(var(--wish-travel) * .66), calc(var(--wish-sway) - var(--wish-rise) * .45), 0); }
  100% { transform: translate3d(var(--wish-travel), calc(var(--wish-sway) - var(--wish-rise)), 0); }
}

@keyframes wish-pop {
  0% { opacity: 0; scale: .93 .91; animation-timing-function: cubic-bezier(.18, .75, .28, 1); }
  58% { opacity: 1; scale: 1.016 1.021; }
  100% { opacity: 1; scale: 1; }
}

@keyframes wish-fade {
  to { opacity: 0; }
}

.wish-flight:has(.wish-bubble:focus-visible),
.wish-flight:has(.wish-bubble[aria-pressed="true"]),
.card-wishes:has(.wish-dialog[open]) .wish-flight {
  --wish-play: paused;
}

.wish-bubble:focus-visible {
  opacity: 1 !important;
  scale: 1 !important;
}

@media (hover: hover) {
  .wish-flight:has(.wish-bubble:hover) { --wish-play: paused; }
}

.wish-copy,
.wish-author {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
}

.wish-copy { white-space: pre-line; }

.wish-bubble .wish-copy {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--wish-lines, 9);
  overflow: hidden;
}

.wish-author {
  margin-top: 5px;
  color: var(--wish-secondary);
  font-size: 12px;
  font-weight: 550;
}

.wish-bubble .wish-author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 699px) {
  .wish-all {
    inset-inline: 0;
    margin-inline: auto;
  }
}

.wish-dialog {
  --wish-dialog-height: min(640px, calc(100vh - 48px));
  --wish-dialog-height: min(640px, calc(100dvh - 48px));
  --wish-close-size: 50px;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(520px, calc(100% - 32px));
  max-width: none;
  max-height: var(--wish-dialog-height);
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff9e;
  border-block-color: #fffffff5;
  border-radius: 28px;
  background: #f5f6f9;
  color: #282b33;
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 1px #ffffff80,
    0 22px 76px #171e332f, 0 3px 16px #171e3312;
  pointer-events: auto;
  transition: opacity .18s ease;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wish-dialog {
    background: linear-gradient(157deg, #ffffffdf, #f0f2f7d1);
    -webkit-backdrop-filter: blur(27px) saturate(.9);
    backdrop-filter: blur(27px) saturate(.9);
  }
}

.wish-dialog::backdrop {
  background: #1c23322e;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: opacity .22s ease;
}

@starting-style {
  .wish-dialog[open], .wish-dialog[open]::backdrop { opacity: 0; }
}

.wish-dialog__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--wish-dialog-height) - 2px);
  min-height: 0;
}

.wish-dialog__grip { display: none; }

.wish-dialog__header {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  grid-template-columns: var(--wish-close-size) minmax(0, 1fr) var(--wish-close-size);
  align-items: center;
  gap: 4px;
  padding: 8px 12px 7px;
}

.wish-dialog__header::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 27px;
  background: linear-gradient(#f1f3f8ee, #f1f3f800);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.wish-dialog--scrolled .wish-dialog__header::after { opacity: 1; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and
          ((mask-image: linear-gradient(black, transparent)) or (-webkit-mask-image: linear-gradient(black, transparent))) {
  .wish-dialog__header::after {
    background: none;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    -webkit-mask-image: linear-gradient(black 5%, transparent);
    mask-image: linear-gradient(black 5%, transparent);
  }

  .wish-dialog--scrolled .wish-dialog__list {
    -webkit-mask-image: linear-gradient(transparent, black 24px);
    mask-image: linear-gradient(transparent, black 24px);
  }
}

.wish-dialog__title {
  grid-column: 2;
  margin: 0;
  color: #424650;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-align: center;
}

.wish-dialog__title:focus { outline: none; }

.wish-dialog__close {
  grid-column: 3;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--wish-close-size);
  height: var(--wish-close-size);
  padding: 0;
  border: 1px solid var(--wish-edge);
  border-block-color: var(--wish-glint);
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--wish-glass);
  box-shadow: var(--wish-shadow);
  cursor: pointer;
  touch-action: manipulation;
}

.wish-dialog__close-icon {
  color: #40454f;
  font-size: 21px;
  font-weight: 440;
  line-height: 1;
}

.wish-dialog__close:focus-visible {
  outline: 2px solid #565961;
  outline-offset: 1px;
}

.wish-dialog__close:hover, .wish-dialog__close:active {
  background: linear-gradient(164deg, #fff 0%, #f0f2f7e6 52%, #d6dbe7e6 100%);
}

.wish-dialog__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 14px 19px 20px;
  list-style: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-y: contain;
  scroll-padding-block-start: 30px;
  scrollbar-width: thin;
  scrollbar-color: #343b4d40 transparent;
  touch-action: pan-y;
}

.wish-dialog__item {
  width: fit-content;
  max-width: min(100%, 420px);
  padding: 9px 13px 10px;
  border: 1px solid #ffffff9c;
  border-radius: 17px 17px 17px 8px;
  background: #ffffff65;
  box-shadow: inset 0 1px #ffffff50;
  font-size: 14px;
  line-height: 1.5;
}

.wish-dialog__item--selected {
  border-color: #65789452;
  background: #ffffffab;
}

@media (max-width: 640px) and (orientation: portrait),
       (max-width: 1000px) and (max-height: 530px) and (pointer: coarse) {
  .wish-dialog {
    --wish-sheet-bottom: max(9px, env(safe-area-inset-bottom));
    --wish-dialog-height: min(620px, 78vh, calc(100vh - var(--wish-sheet-bottom) - 30px));
    --wish-dialog-height: min(620px, 78dvh, calc(100dvh - var(--wish-sheet-bottom) - 30px));
    inset: auto max(10px, env(safe-area-inset-right)) var(--wish-sheet-bottom) max(10px, env(safe-area-inset-left));
    width: auto;
    margin: 0;
    border-radius: 27px;
    transform: translateY(var(--wish-sheet-offset, 0px));
    transition: transform .24s cubic-bezier(.22, .78, .3, 1), opacity .18s ease;
  }

  .wish-dialog--dragging { transition: none; }
  .wish-dialog--leaving { transition: transform .22s cubic-bezier(.35, .12, .6, .99); }
  .wish-dialog--leaving::backdrop { opacity: 0; }

  .wish-dialog__grip {
    flex: none;
    display: grid;
    place-items: center;
    height: 22px;
    touch-action: none;
  }

  .wish-dialog__grip::before {
    content: "";
    width: 34px;
    height: 4px;
    border-radius: 100px;
    background: #343b4e42;
  }

  .wish-dialog__header {
    padding: 0 8px 4px;
    touch-action: none;
  }

  .wish-dialog__list { padding: 12px 13px 16px; }

  @starting-style {
    .wish-dialog[open] { transform: translateY(30px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .wish-flight--moving,
  .wish-flight--moving .wish-bubble { animation: none; }
  .card-wishes, .wish-bubble, .wish-dialog, .wish-dialog::backdrop,
  .wish-dialog__header::after { transition: none; }
}
