/* For Kayes — styles */

:root {
  --bg: #0D0F12;
  --surface: #16191E;
  --surface-2: #1E2228;
  --surface-3: #262B32;
  --text: #ECE8DF;
  --text-2: #A9ABAF;
  --text-3: #6F737A;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(212, 175, 106, .30);

  --gold: #D4AF6A;
  --gold-2: #E8CC90;
  --gold-deep: #A8843F;
  --wine: #8E262C;
  --wine-2: #B0393F;

  --paper: #F1ECE1;
  --paper-2: #E6DECD;
  --paper-ink: #16181C;
  --paper-ink-2: #55514A;
  --paper-line: rgba(22, 24, 28, .16);

  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, .75), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 36px 70px -24px rgba(0, 0, 0, .85), 0 4px 12px -4px rgba(0, 0, 0, .5);

  --f-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --f-jp: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tray-h: 128px;
}

/* ── base ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* low light, a little warmth, film grain */
body::before, body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background:
    radial-gradient(900px 540px at 108% -10%, rgba(142, 38, 44, .30) 0%, transparent 60%),
    radial-gradient(760px 560px at -20% 16%, rgba(44, 64, 96, .30) 0%, transparent 62%),
    radial-gradient(900px 640px at 50% 120%, rgba(212, 175, 106, .10) 0%, transparent 62%),
    var(--bg);
}
body::after {
  z-index: -1;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(212, 175, 106, .35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.hand { font-family: var(--f-display); font-style: italic; font-weight: 400; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#embers, #confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#embers { z-index: 0; }
#confetti { z-index: 90; }

#app { position: relative; z-index: 1; }

/* ── screens ──────────────────────────────────────── */

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100svh;
  padding: 22px 16px calc(36px + var(--safe-b));
}
.screen.is-active { display: block; }
.screen--center.is-active { display: flex; align-items: center; justify-content: center; }

.wrap { width: 100%; max-width: 480px; margin: 0 auto; }

.screen.is-active > .wrap,
.screen.is-active > .env-stage { animation: enter .6s var(--ease-out) both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0;
  font: 700 11px/1 var(--f-mono);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}

.title {
  margin: 0;
  font: 400 44px/1 var(--f-display);
  letter-spacing: -.01em;
}
.sub {
  margin: 10px 0 20px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.55;
}
.fine {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

/* ── buttons ──────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  font: 700 15.5px/1.2 var(--f-body);
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .18s var(--ease-out), box-shadow .2s, background-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--block { display: flex; width: 100%; }

.btn--primary {
  position: relative;
  overflow: hidden;
  color: #121418;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 14px 28px -14px rgba(212, 175, 106, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--primary:not([disabled])::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 4.2s ease-in-out infinite 1.4s;
}
@keyframes shine { 0%, 72% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.btn--ghost {
  color: var(--gold-2);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.btn--soft {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  min-height: 48px;
  padding: 12px 14px;
}
.btn--big { min-height: 60px; font-size: 16.5px; }

.btn.is-nudge { animation: nudge .9s var(--spring) 2; }
@keyframes nudge {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.05); box-shadow: 0 0 0 7px rgba(212, 175, 106, .16), 0 16px 30px -12px rgba(212, 175, 106, .6); }
}

.link-btn {
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--gold);
  font: 700 12px/1.2 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: underline dotted 1.5px;
  text-underline-offset: 5px;
  cursor: pointer;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: 400 24px/1 var(--f-body);
  cursor: pointer;
}
.icon-btn[disabled] { opacity: .3; cursor: default; }

/* ── 1 · envelope ─────────────────────────────────── */

.env-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  transition: opacity .4s, transform .4s var(--ease-out);
}
.env-stage.is-leaving { opacity: 0; transform: scale(.96) translateY(10px); }

.env-psst {
  margin: 4px 0 26px;
  font-size: 30px;
  line-height: 1.1;
  color: var(--text-2);
}

.envelope {
  --w: min(320px, 82vw);
  position: relative;
  width: var(--w);
  aspect-ratio: 10 / 7;
  margin: 18px 0 8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, .65));
  animation: float 4.2s ease-in-out infinite;
}
.envelope.is-opening { animation: none; transform: none; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(.8deg); }
}

.env-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(165deg, #17191E, #0B0C0F);
}

.env-letter {
  position: absolute;
  z-index: 1;
  left: 7%;
  right: 7%;
  top: 7%;
  bottom: 6%;
  display: flex;
  flex-direction: column;
  gap: 9%;
  padding: 11% 10%;
  border-radius: 6px;
  background: var(--paper);
  transition: transform .85s var(--ease-out);
}
.env-letter i { display: block; height: 6%; min-height: 5px; border-radius: 3px; background: #D9D0BE; }
.env-letter i.short { width: 55%; }

.env-front {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(172deg, #2A2E35 0%, #1B1E23 100%);
  clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
}
.env-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(255, 255, 255, .07) 50%, transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(255, 255, 255, .07) 50%, transparent calc(50% + 1px));
}

.env-to {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font: italic 400 clamp(20px, 6.8vw, 26px)/1.05 var(--f-display);
  color: var(--gold-2);
}
.env-to small {
  margin-bottom: 5px;
  font: 700 9.5px/1 var(--f-mono);
  font-style: normal;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-3);
}

.env-stamp {
  position: absolute;
  right: 6%;
  bottom: 10%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 38px;
  background: var(--paper);
  border-radius: 2px;
  outline: 1.5px dotted rgba(168, 132, 63, .8);
  outline-offset: -5px;
  transform: rotate(6deg);
  color: var(--gold-deep);
  font-size: 15px;
}

.env-flap {
  position: absolute;
  z-index: 4;
  inset: 0;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45));
  transition: transform .75s var(--ease-out), z-index 0s linear .36s;
}
.env-flap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #33383F, #24282E);
  clip-path: polygon(0 0, 100% 0, 50% 54%);
}

.seal {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 54%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55));
}
.seal__half {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, #C9474E 0%, #8E262C 48%, #521317 100%);
  box-shadow: inset 0 -3px 6px rgba(40, 0, 8, .5), inset 0 3px 5px rgba(255, 255, 255, .22);
  transition: transform .8s cubic-bezier(.55, 0, .75, .2), opacity .8s ease-in;
}
.seal__half::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 204, 144, .35);
}
.seal__half span {
  font: italic 400 34px/1 var(--f-display);
  color: var(--gold-2);
  text-shadow: 0 -1px 0 rgba(60, 5, 12, .8), 0 1px 0 rgba(255, 255, 255, .2);
}
.seal__half--l { clip-path: polygon(0 0, 54% 0, 46% 30%, 58% 55%, 44% 78%, 52% 100%, 0 100%); }
.seal__half--r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 52% 100%, 44% 78%, 58% 55%, 46% 30%); }

.envelope.is-cracked .seal { animation: wiggle .32s ease-in-out; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg) scale(1.05); }
  75% { transform: rotate(8deg) scale(1.05); }
}
.envelope.is-open .seal__half--l { transform: translate(-30px, 110px) rotate(-50deg); opacity: 0; }
.envelope.is-open .seal__half--r { transform: translate(30px, 115px) rotate(45deg); opacity: 0; }
.envelope.is-open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.is-out .env-letter { transform: translateY(-60%); }

.tap-hint {
  margin: 10px 0 0;
  font: 700 11.5px/1 var(--f-mono);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.env-note {
  margin: 18px 0 0;
  padding: 6px 12px;
  border: 1px solid rgba(212, 175, 106, .4);
  border-radius: 4px;
  color: var(--gold);
  font: 700 9.5px/1.2 var(--f-mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .8;
  transform: rotate(-3deg);
}

/* ── 2 · the letter (cream card on the dark page) ─── */

.letter {
  position: relative;
  margin-top: 26px;
  padding: 34px 22px 24px;
  border-radius: 4px 4px 16px 16px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: var(--shadow-lg);
  transform: rotate(-.5deg);
}
.screen[data-screen="ask"].is-active .letter { animation: unfold .8s var(--ease-out) both .05s; }
@keyframes unfold {
  from { opacity: 0; transform: translateY(46px) rotate(2deg) scale(.96); }
  to { opacity: 1; transform: rotate(-.5deg); }
}
.letter::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 104px;
  height: 25px;
  margin-left: -52px;
  background: repeating-linear-gradient(45deg, rgba(28, 30, 35, .94) 0 7px, rgba(40, 43, 49, .94) 7px 14px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transform: rotate(-2.5deg);
}

.dict {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-left: 3px solid var(--wine);
  border-radius: 2px 10px 10px 2px;
  background: var(--paper-2);
  color: var(--paper-ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.dict p { margin: 0 0 4px; }
.dict b { color: var(--paper-ink); font-weight: 700; }
.dict i { color: #8A847A; }
.dict em { color: var(--wine); font-size: 12px; }
.dict .jp { font: 600 21px/1 var(--f-jp); color: var(--wine); vertical-align: -2px; margin-right: 2px; }
.dict__see { margin: 6px 0 0 !important; }
.dict__see .hand { font-size: 20px; color: var(--wine); }

.letter__hi { margin: 0 0 8px; font-size: 40px; line-height: 1; color: var(--paper-ink); }
.letter__body { margin: 0 0 18px; color: var(--paper-ink-2); }

.ask {
  margin: 0 0 16px;
  font: 400 44px/1.02 var(--f-display);
  letter-spacing: -.01em;
}
.ask em {
  font-style: italic;
  color: var(--wine);
  background: linear-gradient(transparent 64%, rgba(212, 175, 106, .5) 64% 90%, transparent 90%);
  padding: 0 3px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 6px 13px 6px 7px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 600 14px/1.2 var(--f-body);
}
.letter .date-chip { background: rgba(22, 24, 28, .05); box-shadow: inset 0 0 0 1px var(--paper-line); }
.cal-ic {
  flex: none;
  display: inline-grid;
  grid-template-rows: auto 1fr;
  width: 26px;
  height: 28px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .2);
  text-align: center;
  line-height: 1;
}
.cal-ic b { padding: 2.5px 0 2px; background: var(--wine); color: var(--paper); font: 800 7px/1 var(--f-mono); letter-spacing: .08em; }
.cal-ic i { display: grid; place-items: center; color: var(--paper-ink); font: 800 12.5px/1 var(--f-body); font-style: normal; }
.date-chip--sm { margin: 12px 0 0; font-size: 13.5px; }

.actions { display: grid; gap: 10px; }
.letter .btn--primary {
  color: var(--paper);
  background: linear-gradient(135deg, #2B2F36, var(--paper-ink));
  box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -2px 0 rgba(212, 175, 106, .45);
}
.letter .btn--primary::after { background: linear-gradient(105deg, transparent 35%, rgba(232, 204, 144, .22) 50%, transparent 65%); }
.letter .btn--ghost { color: var(--paper-ink); box-shadow: inset 0 0 0 1.5px var(--paper-line); }

.sig { margin: 20px 4px 0 0; text-align: right; font-size: 34px; line-height: 1; color: var(--paper-ink); }

/* ── top bar / steps ──────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
}
.steps {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  font: 700 9.5px/1 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.steps li::before {
  content: '';
  display: block;
  height: 3px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .09);
}
.steps li.is-done::before { background: var(--gold-deep); }
.steps li.is-current { color: var(--gold); }
.steps li.is-current::before { background: var(--gold); box-shadow: 0 0 10px rgba(212, 175, 106, .6); }

/* ── 3 · calendar ─────────────────────────────────── */

.cal { padding: 16px 14px 14px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal__month { margin: 0; font: 400 26px/1.1 var(--f-display); }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal__dow { margin-bottom: 8px; }
.cal__dow span {
  text-align: center;
  font: 700 9.5px/1 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cal__dow .we { color: var(--gold); }

.day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  font: 600 15px/1 var(--f-body);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  opacity: .55;
  cursor: default;
  transition: transform .2s var(--spring), background-color .2s, color .2s;
}
.day--blank { visibility: hidden; }
.day--past { opacity: .25; text-decoration: line-through; }
.day--we {
  opacity: 1;
  color: var(--gold-2);
  background: rgba(212, 175, 106, .08);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, .28);
  cursor: pointer;
}
.day--we:hover { transform: translateY(-2px); background: rgba(212, 175, 106, .16); }
.day--today::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.day--nope { opacity: .5; text-decoration: line-through; }
.day.is-selected {
  color: #121418;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
  box-shadow: 0 8px 18px -8px rgba(212, 175, 106, .8);
  transform: scale(1.07);
}

.picked {
  min-height: 34px;
  margin: 20px 0 12px;
  text-align: center;
  font: italic 400 26px/1.2 var(--f-display);
  color: var(--gold-2);
}

/* ── 4 · plan the day ─────────────────────────────── */

.screen--plan .wrap { padding-bottom: calc(var(--tray-h) + 12px); }

.plan-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 12px;
}
.plan-tools > span:last-child { display: flex; gap: 14px; }
.plan-count { font: 700 11.5px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.plan-count.is-some { color: var(--gold); }

.timeline { position: relative; margin: 0 0 10px; padding: 0; list-style: none; user-select: none; -webkit-user-select: none; }
.timeline::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(212, 175, 106, .35) 0 5px, transparent 5px 11px);
}

.slot {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
}
.slot__time {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: 700 13.5px/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.slot.is-filled .slot__time { background: var(--gold); color: #121418; box-shadow: none; }
.slot__time--edit {
  width: 100%;
  min-width: 64px;
  padding: 0 4px;
  text-align: center;
  font-size: 16px;
  color-scheme: dark;
  outline: 1.5px solid var(--gold);
  -webkit-appearance: none;
  appearance: none;
}
.slot:has(.slot__time--edit) { grid-template-columns: 112px 1fr; }

.slot__drop {
  display: flex;
  align-items: stretch;
  min-height: 62px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-2);
  background: rgba(255, 255, 255, .015);
  transition: border-color .2s, background-color .2s, transform .2s var(--spring), box-shadow .2s;
}
.slot__empty {
  flex: 1;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text-3);
  font: 700 11px/1.3 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.is-dragging .slot__drop,
.is-picking .slot__drop { border-color: rgba(212, 175, 106, .6); }
.is-picking .slot:not(.is-filled) .slot__drop { background: rgba(212, 175, 106, .06); animation: breathe 1.4s ease-in-out infinite; }
.is-picking .slot__empty { color: var(--gold); }
@keyframes breathe { 50% { transform: scale(1.012); box-shadow: 0 0 0 4px rgba(212, 175, 106, .07); } }

.slot.is-filled .slot__drop {
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.slot.is-over .slot__drop {
  border: 1.5px solid var(--gold);
  background: rgba(212, 175, 106, .14);
  transform: scale(1.02);
  animation: none;
}

.item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 8px 8px 2px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.item.is-new { animation: pop .5s var(--spring); }
.item.is-lifted { opacity: .3; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.item__grip {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  align-self: stretch;
  color: var(--text-3);
  font: 700 15px/1 var(--f-body);
  letter-spacing: -3px;
  touch-action: none;
}
.item__emoji { flex: none; font-size: 26px; line-height: 1; }
.item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item__label { font: 600 15.5px/1.2 var(--f-body); overflow-wrap: anywhere; }
.item__detail {
  width: 100%;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px dashed var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--gold-2);
  font: 500 16px/1.3 var(--f-body);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.item__detail:focus { border-bottom: 1px solid var(--gold); }
.item__detail::placeholder { color: var(--text-3); font-style: italic; }
.item__x {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--text-2);
  font: 400 20px/1 var(--f-body);
  cursor: pointer;
}

.add-slot {
  display: block;
  width: 100%;
  margin: 4px 0 22px;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: none;
  color: var(--text-2);
  font: 700 11.5px/1 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* the menu tray */
.tray-wrap {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 10px calc(10px + var(--safe-b));
  pointer-events: none;
  transition: transform .3s var(--ease-out);
}
.is-typing .tray-wrap { transform: translateY(130%); }
.tray {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 0 12px;
  border-radius: 20px;
  background: rgba(20, 22, 27, .96);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .9), inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .05);
  pointer-events: auto;
}
.tray.is-hint { animation: nudge .8s var(--spring); }
.tray__label {
  margin: 0 0 8px;
  padding: 0 16px;
  font: 700 10.5px/1 var(--f-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.tray__label span { color: var(--text-3); letter-spacing: .08em; }

.chips {
  display: flex;
  gap: 8px;
  padding: 4px 14px 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 600px) {
  .chips { flex-wrap: wrap; overflow: visible; }
  :root { --tray-h: 150px; }
}

.chip {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 15px 9px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: 600 14.5px/1 var(--f-body);
  white-space: nowrap;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  transition: transform .2s var(--spring), background-color .2s, color .2s;
}
.chip span { font-size: 18px; }
.chip.is-used::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.chip.is-selected {
  color: #121418;
  background: var(--gold);
  box-shadow: 0 10px 18px -8px rgba(212, 175, 106, .7);
  transform: translateY(-4px);
}
.chip.is-selected::after { background: #121418; }
.chip.is-lifted { opacity: .4; }

.drag-ghost {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px 11px 13px;
  border-radius: 12px;
  background: var(--gold);
  color: #121418;
  font: 700 15px/1 var(--f-body);
  white-space: nowrap;
  box-shadow: 0 22px 34px -10px rgba(0, 0, 0, .8);
  pointer-events: none;
  will-change: transform;
}
.drag-ghost span { font-size: 19px; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* ── 5 · requests ─────────────────────────────────── */

.wishes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.wish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font: 500 14px/1.1 var(--f-body);
  cursor: pointer;
  transition: transform .2s var(--spring), background-color .2s, box-shadow .2s, color .2s;
}
.wish[aria-pressed="true"] {
  color: var(--gold-2);
  background: rgba(212, 175, 106, .12);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.wish[aria-pressed="true"]::before { content: '✓'; font-weight: 800; }
.wish:active { transform: scale(.95); }

.note {
  position: relative;
  display: block;
  margin: 0 0 20px;
  padding: 16px 16px 30px;
}
.note textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font: 400 16px/1.55 var(--f-body);
  color: var(--text);
}
.note textarea::placeholder { color: var(--text-3); }
.note:focus-within { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--gold); }
.note__count {
  position: absolute;
  right: 16px;
  bottom: 10px;
  font: 700 11px/1 var(--f-mono);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ── 6 · review ticket ────────────────────────────── */

.ticket {
  position: relative;
  margin: 2px 0 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.ticket__top {
  position: relative;
  padding: 20px 22px 22px;
  background:
    radial-gradient(280px 140px at 100% 0%, rgba(142, 38, 44, .45), transparent 70%),
    linear-gradient(135deg, #1F2329, #0B0C0F);
  border-bottom: 1px solid rgba(212, 175, 106, .35);
}
.ticket__admit {
  margin: 0;
  font: 800 10px/1 var(--f-mono);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
}
.ticket__names { margin: 12px 0 2px; font: italic 400 22px/1.2 var(--f-display); color: var(--text-2); }
.ticket__date { margin: 0; font: 400 36px/1.02 var(--f-display); color: var(--text); letter-spacing: -.01em; }
.ticket__edit {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font: 700 10px/1 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.ticket__sec { padding: 16px 22px; }
.ticket__sec + .ticket__sec { border-top: 1px dashed var(--line); }
.ticket__h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  font: 700 10px/1 var(--f-mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ticket__h .link-btn { font-size: 10.5px; padding: 0; }
.trow {
  display: grid;
  grid-template-columns: 52px 28px 1fr;
  gap: 4px;
  align-items: baseline;
  padding: 5px 0;
  font-size: 15.5px;
  line-height: 1.35;
}
.trow__t { font: 700 13.5px/1.35 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--gold); }
.trow__e { font-size: 18px; line-height: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(212, 175, 106, .1);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, .25);
  color: var(--gold-2);
  font: 600 13px/1.1 var(--f-body);
}
.quote { margin: 0; font: italic 400 24px/1.2 var(--f-display); color: var(--text); overflow-wrap: anywhere; }
.muted { margin: 0; color: var(--text-3); font-size: 14.5px; }
.ticket__perf { position: relative; height: 0; margin: 4px 0 0; border-top: 1.5px dashed rgba(255, 255, 255, .12); }
.ticket__perf::before, .ticket__perf::after {
  content: '';
  position: absolute;
  top: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ticket__perf::before { left: -12px; }
.ticket__perf::after { right: -12px; }
.ticket__stub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  color: var(--text-3);
  font: 700 9.5px/1.6 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.barcode {
  flex: none;
  width: 86px;
  height: 30px;
  border-radius: 2px;
  opacity: .6;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 8px, var(--text) 8px 11px, transparent 11px 12px, var(--text) 12px 13px, transparent 13px 16px);
}

/* the reject button, and what's left of it */
.reject-home {
  position: relative;
  height: 128px;
  margin-top: 22px;
}
.btn--reject {
  position: absolute;
  left: 50%;
  top: 50%;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font: 700 12px/1 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: left .3s var(--spring), top .3s var(--spring), transform .3s var(--spring);
}
.btn--reject:active { transform: translate(-50%, -50%) scale(.97); }
.btn--reject.is-loose, .btn--reject.is-loose:active { transform: none; }
.btn--reject.is-cracked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M47 0 L43 11 L53 18 L45 27 L50 40 M43 11 L31 8 M53 18 L66 23 M45 27 L34 34 M66 23 L74 17' stroke='%23C9CBCF' stroke-width='1.1' fill='none' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  animation: tremble .28s linear infinite;
}
@keyframes tremble {
  0%, 100% { translate: 0 0; }
  25% { translate: -1px 1px; }
  75% { translate: 1px -1px; }
}
.shard {
  position: fixed !important;
  z-index: 95;
  margin: 0;
  pointer-events: none;
  translate: none !important;
}
.remnant {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--text-3);
  font: 700 10.5px/1.6 var(--f-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: enter .5s var(--ease-out) both .35s;
}
.remnant span { font: italic 400 24px/1.1 var(--f-display); letter-spacing: 0; text-transform: none; color: var(--gold-2); }

.is-shaking #app { animation: shake .42s linear; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-7px) rotate(-.4deg); }
  40% { transform: translateX(6px) rotate(.4deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ── modal ────────────────────────────────────────── */

.modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + var(--safe-b));
  background: rgba(5, 6, 8, .7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal__card {
  width: 100%;
  max-width: 380px;
  padding: 28px 22px 20px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(212, 175, 106, .25);
  text-align: center;
  animation: popin .5s var(--spring) both .05s;
}
@keyframes popin { from { opacity: 0; transform: scale(.85) translateY(20px); } }
.modal__icon { font-size: 50px; line-height: 1; animation: bang .6s var(--spring) both .2s; }
@keyframes bang { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.modal h3 { margin: 14px 0 8px; font: 400 36px/1.05 var(--f-display); }
.modal p { margin: 0 0 10px; color: var(--text-2); }
.modal__big { margin: 8px 0 20px !important; font-size: 28px; line-height: 1.1; color: var(--gold-2) !important; }
.modal .fine { margin-top: 14px; }

/* ── 7 · it's a date ──────────────────────────────── */

.done { text-align: center; }
.done__heart {
  display: inline-block;
  font-size: 70px;
  line-height: 1;
  animation: clink 2.4s ease-in-out infinite;
}
@keyframes clink {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-12deg) scale(1.06); }
  80% { transform: rotate(8deg); }
  90% { transform: rotate(-4deg); }
}
.done .eyebrow { margin-top: 18px; }
.done__title { margin: 12px 0 10px; font: 400 64px/.95 var(--f-display); letter-spacing: -.02em; }
.done__when { margin: 0 0 8px; font: 700 12px/1.5 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.done__msg { margin: 0 0 22px; font-size: 26px; line-height: 1.15; color: var(--text-2); }
.cal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 16px; }
.cal-links .btn { white-space: nowrap; padding: 12px 10px; }
.done .link-btn { margin-top: 2px; }

/* ── toast ────────────────────────────────────────── */

.toast {
  position: fixed;
  z-index: 85;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(calc(100vw - 32px), 420px);
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--paper-ink);
  font: 600 14px/1.35 var(--f-body);
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .8);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .3s var(--spring);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-on .toast__btn { pointer-events: auto; }
body[data-screen="plan"] .toast { bottom: calc(var(--tray-h) + 22px + var(--safe-b)); }
.toast__btn {
  flex: none;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--paper-ink);
  color: var(--gold-2);
  font: 800 11px/1.2 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.noscript { position: fixed; inset: auto 16px 24px; z-index: 5; text-align: center; font-weight: 600; }

/* ── wider screens ────────────────────────────────── */

@media (min-width: 720px) {
  .screen { padding-top: 48px; }
  .title { font-size: 52px; }
  .ask { font-size: 52px; }
  .letter { padding: 42px 38px 28px; }
}

@media (max-width: 360px) {
  .title { font-size: 38px; }
  .ask { font-size: 38px; }
  .slot { grid-template-columns: 58px 1fr; }
  .slot__time { width: 58px; font-size: 12.5px; }
  .timeline::before { left: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}
