/* The heart uses viewport coordinates while travelling between the button and postcard. */
.kiss-flight {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: clamp(29px, 3vw, 40px);
  height: auto;
  overflow: visible;
  pointer-events: none;
  fill: #e8664b;
  stroke: #753223;
  stroke-width: 1.25;
  filter: drop-shadow(0 3px 3px #542a2547);
  will-change: transform;
}

.kiss-airborne [data-kiss-action] .icon {
  animation: kiss-launch 400ms ease-out;
}

.kiss-delivered .kiss-seal {
  animation: kiss-impression 510ms cubic-bezier(.22, .7, .26, 1) both;
}

.kiss-delivered .kiss-seal::after,
.kiss-local-receipt [data-kiss-action]::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid #bc533c;
  border-radius: inherit;
  pointer-events: none;
  animation: kiss-ring 590ms ease-out both;
}

/* A second receipt stays next to the action when the postcard is outside the viewport. */
.kiss-local-receipt [data-kiss-action] { position: relative; }
.kiss-local-receipt [data-kiss-action] .icon {
  fill: #fac5ac;
  color: #fac5ac;
}
.kiss-local-receipt [data-kiss-action]::after {
  animation-name: kiss-button-ring;
}

@keyframes kiss-launch {
  0% { transform: scale(1); }
  28% { transform: scale(.78); }
  60% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes kiss-impression {
  0% { transform: rotate(17deg) scale(1.18); }
  24% { transform: rotate(8deg) scale(.88); }
  59% { transform: rotate(14deg) scale(1.055); }
  100% { transform: rotate(13deg) scale(1); }
}

@keyframes kiss-ring {
  from { transform: scale(.9); opacity: .85; }
  to { transform: scale(1.65); opacity: 0; }
}

@keyframes kiss-button-ring {
  from { transform: scale(.98); opacity: .8; }
  to { transform: scale(1.12, 1.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kiss-flight { display: none; }
  .kiss-airborne [data-kiss-action] .icon,
  .kiss-delivered .kiss-seal,
  .kiss-delivered .kiss-seal::after,
  .kiss-local-receipt [data-kiss-action]::after { animation: none; }
  .kiss-delivered .kiss-seal::after,
  .kiss-local-receipt [data-kiss-action]::after { content: none; }
}

/* Sharing a grid cell with the first day keeps the moving tab aligned at every width. */
.day-picker[data-active-day] {
  --picker-gap: 2px;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: var(--picker-gap);
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-deep);
  isolation: isolate;
}
.day-picker[data-active-day]::before {
  content: '';
  grid-area: 1 / 1;
  border-radius: 3px;
  border: 1px solid #b2785e;
  background: #f6bd9e;
  box-shadow: 0 1px 2px #4f382823;
  pointer-events: none;
  transition: transform 340ms cubic-bezier(.22,.8,.23,1);
}
.day-picker[data-active-day="sat"]::before { transform: translateX(calc(100% + var(--picker-gap))); }
.day-picker[data-active-day="sun"]::before { transform: translateX(calc(200% + var(--picker-gap) + var(--picker-gap))); }
.day-picker[data-active-day] button {
  z-index: 1;
  grid-row: 1;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  border-color: transparent;
  color: var(--ink);
  background: transparent;
}
.day-picker[data-active-day] [data-plan-day="fri"] { grid-column: 1; }
.day-picker[data-active-day] [data-plan-day="sat"] { grid-column: 2; }
.day-picker[data-active-day] [data-plan-day="sun"] { grid-column: 3; }
.day-picker[data-active-day] button[aria-pressed="true"] {
  border-color: transparent;
  color: var(--ink);
  background: transparent;
}
@media (hover: hover) {
  .day-picker[data-active-day] button[aria-pressed="false"]:hover { background: #513e2710; }
}

@media (prefers-reduced-motion: no-preference) {
  .day-picker[data-active-day] button strong { transition: transform 130ms ease-out; }
  .day-picker[data-active-day] button:active strong { transform: translateY(1px) scale(.92); }
}

/* Both captions occupy the same space, so choosing a time never moves the control. */
.plan-choice-captions { display: grid; }
.plan-choice-captions > span { grid-area: 1 / 1; }
.plan-choice-captions [aria-hidden="true"] { visibility: hidden; }
.plan-choice-calendar {
  transform-origin: center;
  transition: opacity 130ms, transform 200ms ease-out;
}
.plan-choice-check {
  fill: none;
  stroke-width: 2.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: opacity 110ms, stroke-dashoffset 230ms ease-out;
}
.slot-action [data-plan-select] {
  transition: background-color 180ms, color 180ms, box-shadow 180ms;
}
.slot-action [data-plan-select][data-chosen="true"] {
  color: #253c2d;
  background: #dce7d8;
  box-shadow: inset 0 0 0 1px #7e9780;
}
[data-plan-select][data-chosen="true"] .plan-choice-calendar {
  opacity: 0;
  transform: scale(.78);
}
[data-plan-select][data-chosen="true"] .plan-choice-check {
  opacity: 1;
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .day-picker[data-active-day]::before,
  .slot-action [data-plan-select],
  .plan-choice-calendar, .plan-choice-check { transition: none; }
}
@media (forced-colors: active) {
  .day-picker[data-active-day]::before { border: 2px solid Highlight; }
  .slot-action [data-plan-select][data-chosen="true"] { border: 1px solid ButtonText; }
}
