:root {
  --pink: #ffd6e7;
  --lav: #e6d9ff;
  --cream: #fff8f0;
  --rose: #ff8fab;
  --deep: #d6336c;
  --ink: #4a2540;
  --r: 30px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Quicksand, Poppins, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(255, 214, 231, .92), transparent 42%),
    radial-gradient(ellipse at 88% 18%, rgba(230, 217, 255, .9), transparent 44%),
    radial-gradient(ellipse at 52% 96%, rgba(255, 227, 239, .9), transparent 48%),
    var(--cream);
  background-size: 130% 130%;
  animation: pastel-shift 24s ease-in-out infinite alternate;
}

body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .43;
  pointer-events: none;
  animation: glow-drift 20s ease-in-out infinite alternate;
}

body::before { top: -18vmax; left: -14vmax; background: #ffb3cf; }
body::after { right: -15vmax; bottom: -19vmax; background: #cdb8ff; animation-delay: -9s; }

@keyframes pastel-shift {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

@keyframes glow-drift {
  to { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}

main {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: calc(22px + env(safe-area-inset-top, 0px))
    calc(14px + env(safe-area-inset-right, 0px))
    calc(22px + env(safe-area-inset-bottom, 0px))
    calc(14px + env(safe-area-inset-left, 0px));
}

.view {
  display: flex;
  width: 100%;
  max-width: 640px;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.view[hidden] { display: none; }

.glass {
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 12px 38px rgba(255, 143, 171, .26), inset 0 1px 0 rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

.card {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 34px 30px;
  border-radius: var(--r);
  text-align: center;
  animation: rise .6s ease backwards;
}

.card > * { position: relative; z-index: 1; }

#card::before, #card::after {
  position: absolute;
  z-index: 0;
  color: rgba(255, 143, 171, .58);
  pointer-events: none;
  animation: sparkle 4s ease-in-out infinite;
}

#card::before { content: "✧"; top: 16px; left: 20px; font-size: 1.5rem; }
#card::after { content: "✦"; right: 22px; bottom: 18px; font-size: 1.15rem; animation-delay: -2s; }

@keyframes sparkle {
  50% { opacity: .32; transform: scale(.8) rotate(18deg); }
}

.card.wide { max-width: 680px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

@keyframes slide-in-next {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-prev {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.top {
  margin: 0;
  color: var(--deep);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: clamp(2.15rem, 7vw, 2.9rem);
  font-style: italic;
  line-height: 1.15;
}

h2 { font-size: clamp(1.65rem, 5vw, 2.05rem); }
.date-title { color: var(--deep); font-size: clamp(2.2rem, 8vw, 3.2rem); }
p { margin: 9px 0; line-height: 1.65; }
.big { color: var(--deep); font-size: 1.45rem; font-weight: 700; }
.sign { font-weight: 600; }
.sub { opacity: .88; }
.status { min-height: 1.5em; margin: 0; color: var(--deep); font-weight: 700; }
.counter { margin: 0; font-size: .95rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

.btn, .opt, .day, .dates button {
  color: var(--ink);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .46);
  box-shadow: 0 7px 22px rgba(255, 143, 171, .23), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  transition: transform .2s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}

.btn {
  min-width: 48px;
  min-height: 48px;
  padding: 12px 23px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
}

.btn:hover:not(:disabled), .opt:hover, .day:hover:not(:disabled), .dates button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 143, 171, .34), inset 0 1px 0 #fff;
}

.btn:active:not(:disabled), .opt:active, .day:active:not(:disabled), .dates button:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-yes {
  padding: 15px 38px;
  border-color: rgba(255, 255, 255, .72);
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 143, 171, .96), rgba(214, 51, 108, .9));
  font-size: 1.18rem;
  text-shadow: 0 1px 2px rgba(120, 20, 60, .35);
  box-shadow: 0 0 22px rgba(255, 143, 171, .48), 0 8px 24px rgba(214, 51, 108, .27), inset 0 1px 0 rgba(255, 255, 255, .75);
  animation: yes-glow 3s ease-in-out infinite;
}

.btn-yes:hover:not(:disabled) { box-shadow: 0 0 30px rgba(255, 143, 171, .62), 0 10px 28px rgba(214, 51, 108, .34), inset 0 1px 0 #fff; }

@keyframes yes-glow {
  50% { box-shadow: 0 0 30px rgba(255, 143, 171, .62), 0 8px 24px rgba(214, 51, 108, .32), inset 0 1px 0 rgba(255, 255, 255, .8); }
}

.no-slot { display: inline-block; min-width: 96px; min-height: 48px; }
.btn-no { position: relative; }
.btn-no.free { position: fixed; z-index: 50; transition: left .28s cubic-bezier(.3, 1.4, .5, 1), top .28s cubic-bezier(.3, 1.4, .5, 1); }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }

.pbar {
  height: 10px;
  overflow: hidden;
  margin: 8px 0 20px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 99px;
  background: rgba(255, 255, 255, .48);
  box-shadow: inset 0 2px 4px rgba(74, 37, 64, .08);
}

.pbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb4cc, #d99cff, var(--deep));
  box-shadow: 0 0 12px rgba(214, 51, 108, .35);
  transition: width .45s ease;
}

.qnum { margin: 0; font-size: .95rem; font-weight: 700; }
.opts { display: grid; gap: 12px; margin: 18px 0; text-align: left; }

.opt {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border-width: 1.5px;
  border-radius: 20px;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
}

.opt .em { font-size: 1.5rem; }
.opt .heart { margin-left: auto; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.opt[aria-pressed="true"] { transform: scale(1.015); border-color: var(--deep); background: rgba(255, 143, 171, .4); }
.opt[aria-pressed="true"] .heart { opacity: 1; transform: scale(1); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 13px; margin: 18px 0; }
.tile { position: relative; min-height: 142px; flex-direction: column; justify-content: center; padding: 15px 11px; text-align: center; }
.tile .em { display: grid; width: 66px; height: 66px; place-items: center; border-radius: 21px; background: linear-gradient(135deg, rgba(255, 214, 231, .9), rgba(230, 217, 255, .9)); font-size: 2.5rem; }
.tile .heart { position: absolute; top: 10px; right: 12px; margin: 0; }
.tile .line { display: block; max-height: 0; overflow: hidden; padding-top: 0; opacity: 0; font-size: .88rem; font-weight: 600; line-height: 1.4; transition: max-height .3s ease, opacity .2s ease, padding .3s ease; }
.tile[aria-pressed="true"] { transform: translateY(-2px) scale(1.025); border-color: var(--deep); background: rgba(255, 235, 243, .72); box-shadow: 0 12px 28px rgba(214, 51, 108, .22), inset 0 1px 0 #fff; }
.tile[aria-pressed="true"] .line { max-height: 90px; padding-top: 8px; opacity: 1; }
.react { min-height: 1.5em; margin: 5px 0; color: var(--deep); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 8px 0; }
.chip { padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 99px; background: rgba(255, 143, 171, .32); font-size: .9rem; font-weight: 700; }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

.cal { margin: 15px 0; padding: 13px; border: 1px solid rgba(255, 255, 255, .82); border-radius: 23px; background: rgba(255, 255, 255, .38); box-shadow: inset 0 1px 0 #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 700; }
.cal-head button { width: 48px; height: 48px; padding: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-grid span { align-self: center; font-size: .8rem; font-weight: 700; opacity: .72; }

.day {
  position: relative;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border-color: rgba(255, 255, 255, .68);
  border-radius: 14px;
  aspect-ratio: 1;
  font: inherit;
  font-weight: 700;
}

.day:hover:not(:disabled) { background: rgba(255, 214, 231, .9); }
.day:disabled { opacity: .3; cursor: not-allowed; }
.day.sel { border-color: var(--deep); color: #fff; background: rgba(255, 143, 171, .78); text-shadow: 0 1px 2px rgba(120, 20, 60, .4); }
.day.sel::after { position: absolute; top: -5px; right: -2px; content: "💗"; font-size: .7rem; }
.day.today { border-color: var(--rose); }

.add-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; }
.add-row input[type="date"] { flex: 1 1 160px; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 999px; color: var(--ink); background: rgba(255, 255, 255, .62); font: inherit; font-size: 16px; }
.add-row .btn { flex: 1 1 100px; }
.err { min-height: 1.4em; margin: 0; color: #b0124f; font-size: .95rem; font-weight: 700; }
.flex-opt { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; margin: 10px 0; font-weight: 700; cursor: pointer; }
.flex-opt input { width: 22px; height: 22px; accent-color: var(--deep); }
.dates { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 8px 0; padding: 0; list-style: none; }
.dates button { min-height: 48px; padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 700; }

.summary { margin: 18px 0; padding: 6px 16px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 20px; text-align: left; background: rgba(255, 255, 255, .4); }
.row { padding: 11px 0; border-bottom: 1px dashed rgba(214, 51, 108, .3); overflow-wrap: anywhere; }
.row:last-child { border: 0; }
.row b { display: block; color: var(--deep); font-size: .95rem; }
.row em { display: block; font-size: .92rem; opacity: .88; }
.delivery { margin: 10px 0; padding: 11px 14px; border-radius: 16px; background: rgba(255, 255, 255, .5); font-size: .96rem; font-weight: 700; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.toast { position: fixed; z-index: 99; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; max-width: calc(100vw - 32px); padding: 13px 22px; transform: translate(-50%, 30px); border-radius: 99px; opacity: 0; font-weight: 700; pointer-events: none; transition: .3s; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.decor {
  position: fixed;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  inset: 0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
.decor span, .fall { position: absolute; opacity: .55; animation: float linear infinite; }

@keyframes float {
  from { transform: translateY(105vh) rotate(0); }
  to { transform: translateY(-12vh) rotate(40deg); }
}

.fall { z-index: 60; top: -6vh; opacity: 1; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(112vh) rotate(540deg); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 480px) {
  main { padding-right: calc(10px + env(safe-area-inset-right, 0px)); padding-left: calc(10px + env(safe-area-inset-left, 0px)); }
  .card { padding: 28px 17px; }
  .big { font-size: 1.3rem; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(min(126px, 100%), 1fr)); gap: 10px; }
  .tile { min-height: 136px; }
  .nav .btn { padding-right: 15px; padding-left: 15px; }
}

@media (max-width: 350px) {
  .cal { padding: 9px; }
  .cal-grid { gap: 2px; }
  .day { border-radius: 10px; }
  .btn-row { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .decor { display: none; }
}
