/* ============================================================
   IG Wedding — Instagram-style wedding invitation
   Mobile-first. Dark social-feed aesthetic.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --bg:        #0a0d0c;
  --card:      #101412;
  --card-2:    #171d1a;
  --line:      #222a26;
  --ink:       #fafafa;
  --muted:     #a4aca8;
  --dim:       #63796e;

  --blue:      #23866f;
  --red:       #e4576a;
  --green:     #2ecc71;

  --g1: #7fb59a;
  --g2: #a9c08d;
  --g3: #d3c27f;
  --g4: #e1a96b;
  --g5: #c98663;
  --grad: linear-gradient(45deg, var(--g1), var(--g2), var(--g3), var(--g4), var(--g5));

  --shell:     480px;
  --r-sm:      8px;
  --r-md:      12px;
  --r-lg:      18px;
  --r-xl:      26px;

  --ui:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif:  "Playfair Display", Georgia, "Times New Roman", serif;

  --tab-h:  58px;
  --ease:   cubic-bezier(.22, .61, .36, 1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #050706;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; height: 100vh; }

/* Component `display` rules below would otherwise beat the UA's [hidden]. */
[hidden] { display: none !important; }

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico { width: 24px; height: 24px; flex: none; display: block; }
.ico--sm { width: 16px; height: 16px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   COVER
   ============================================================ */
.cover {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: var(--bg);
  text-align: center;
  transition: opacity .6s var(--ease), visibility .6s;
}

.cover.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.cover__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%,   rgba(211, 194, 127, .28), transparent 62%),
    radial-gradient(110% 70% at 20% 100%, rgba(201, 134, 99, .24), transparent 60%),
    radial-gradient(90% 60% at 90% 85%,   rgba(127, 181, 154, .16), transparent 60%);
}

.cover__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(70% 70% at 50% 40%, #0a0d0c 30%, transparent 100%);
}

.cover__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 360px;
  animation: rise .8s var(--ease) both;
}

.cover__kicker {
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover__ring {
  padding: 3px;
  border-radius: 50%;
  background: var(--grad);
  animation: spin-ring 9s linear infinite;
}

.cover__avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--card-2);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: .02em;
  background-size: cover;
  background-position: center;
  animation: spin-ring 9s linear infinite reverse;
}

.cover__names {
  font-family: var(--serif);
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 500;
  line-height: 1.1;
  margin-top: 4px;
}

.cover__date {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover__guest {
  margin-top: 10px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(16, 20, 18, .7);
  backdrop-filter: blur(6px);
}

.cover__guest-label { display: block; font-size: 11px; color: var(--muted); }
.cover__guest-name  { display: block; font-size: 17px; margin-top: 2px; overflow-wrap: anywhere; }

.cover__note { font-size: 13px; color: var(--muted); max-width: 300px; }
.cover__hint { font-size: 11px; color: var(--dim); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s var(--ease), opacity .15s, background .15s;
}

.btn:active { transform: scale(.97); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { opacity: .9; }
.btn--ghost { background: var(--card-2); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: #202723; }
.btn--block { width: 100%; }
.btn--lg { padding: 13px 22px; border-radius: var(--r-md); font-size: 15px; }
.btn--icon { width: 42px; padding: 9px 0; flex: none; }
.btn .ico { width: 18px; height: 18px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  transition: transform .12s var(--ease), color .15s, opacity .15s;
}

.icon-btn:hover { opacity: .7; }
.icon-btn:active { transform: scale(.88); }
.icon-btn--flush { color: var(--muted); }

.icon-btn__badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ============================================================
   MUSIC PILL
   ============================================================ */
.music-pill {
  position: fixed;
  right: 14px;
  bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px));
  z-index: 150;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 20, 18, .92);
  backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}

.cover.is-open ~ .music-pill { display: inline-flex; }

.music-pill__disc {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
}

.music-pill__disc .ico { width: 15px; height: 15px; }
.music-pill.is-playing .music-pill__disc { animation: spin-ring 3.6s linear infinite; }
.music-pill__state { width: 13px; height: 13px; color: var(--muted); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  border-inline: 1px solid var(--line);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

/* ---------- TOP BAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px 0 16px;
  background: rgba(0, 0, 0, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  letter-spacing: .01em;
}

.topbar__actions { display: flex; align-items: center; gap: 4px; }

/* ---------- PROFILE ---------- */
.profile { padding: 18px 16px 0; }

.profile__top {
  display: flex;
  align-items: center;
  gap: 22px;
}

.ring {
  padding: 2px;
  border-radius: 50%;
  background: var(--grad);
  flex: none;
}

.ring--lg { padding: 3px; }
.ring--sm { padding: 2px; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--card-2);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
}

.avatar--lg { width: 84px; height: 84px; font-size: 22px; border-width: 3px; }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }

.stats {
  display: flex;
  flex: 1;
  justify-content: space-around;
  text-align: center;
}

.stats__value { display: block; font-size: 17px; font-weight: 700; }
.stats__label { display: block; font-size: 12px; color: var(--muted); }

.profile__meta { margin-top: 14px; }

.profile__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
}

.verified { color: var(--blue); }

.profile__bio { margin-top: 3px; font-size: 13px; color: #e3e5e4; }
.profile__bio p { line-height: 1.5; }
.profile__bio p:first-child { color: var(--muted); }

.profile__actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

/* Keep both labels on one line at 360px-wide screens. */
.profile__actions .btn { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; }
.profile__actions .btn--icon { flex: none; }

/* ---------- STORY HIGHLIGHTS ---------- */
.highlights {
  display: flex;
  gap: 16px;
  margin: 18px -16px 0;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.highlights::-webkit-scrollbar { display: none; }

.highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  flex: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

.highlight__ring {
  width: 62px;
  height: 62px;
  padding: 2px;
  border-radius: 50%;
  background: var(--line);
  transition: background .25s;
}

.highlight.is-active .highlight__ring { background: var(--grad); }

.highlight__face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--card-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color .25s;
}

.highlight.is-active .highlight__face { color: var(--ink); }
.highlight__face .ico { width: 22px; height: 22px; }

.highlight__label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.highlight.is-active .highlight__label { color: var(--ink); font-weight: 600; }

/* ============================================================
   POSTS
   ============================================================ */
.post {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.post.is-in { opacity: 1; transform: none; }
.post--last { border-bottom: 0; }

.post__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
}

.post__id { flex: 1; min-width: 0; line-height: 1.25; }
.post__user { font-size: 13px; font-weight: 600; }
.post__loc { display: block; font-size: 11px; color: var(--muted); }
.post__head-ico { color: var(--muted); margin-right: 6px; }

.post__pill {
  margin-right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- POST ACTION BAR ---------- */
.post__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 2px;
}

.post__bar-left { display: flex; align-items: center; gap: 6px; }

.like.is-liked { color: var(--red); animation: pop .35s var(--ease); }

.icon-btn.is-saved { color: var(--blue); }

/* ---------- POST BODY ---------- */
.post__body { padding: 4px 16px 14px; }
.post__body--flush { padding-top: 12px; }

.post__likes { font-size: 13px; font-weight: 600; }

.post__caption {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #e7e9e8;
}

.post__caption .post__user { margin-right: 5px; }

.post__more {
  display: block;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.post__more:hover { color: var(--ink); }

.post__time {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
}

.tags { margin-top: 6px; font-size: 13px; color: var(--blue); }
.tags span { margin-right: 6px; }

/* ============================================================
   MEDIA PANELS
   ============================================================ */
.media {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-block: 1px solid var(--line);
}

.media__deco {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 15% 0%,  rgba(211, 194, 127, .22), transparent 60%),
    radial-gradient(70% 60% at 95% 100%, rgba(201, 134, 99, .2), transparent 60%);
}

.media__kicker {
  position: relative;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* ---------- Quote ---------- */
.media--quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 380px;
  padding: 40px 30px;
  text-align: center;
}

.quote { position: relative; }

.quote__text {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.65;
  color: #f1f3f2;
}

.quote__src {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  font-style: normal;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.quote__names {
  position: relative;
  font-family: var(--serif);
  font-size: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

/* ---------- Couple ---------- */
.media--couple { padding: 24px 18px; }

.couple { display: grid; gap: 14px; }

.couple__card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
}

.couple__info { min-width: 0; }

.couple__handle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
}

.couple__name {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
  margin-top: 2px;
}

.couple__parents { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.couple__parents strong { color: #d6dad8; font-weight: 600; }

.couple__amp {
  text-align: center;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--muted);
  line-height: 1;
}

/* ---------- Carousel ---------- */
.media--carousel { padding: 0; }

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar { display: none; }

.carousel__slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  min-height: 340px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
  background: linear-gradient(160deg, var(--card), #0a0c0b);
}

.carousel__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 50% at 50% 0%, rgba(225, 169, 107, .2), transparent 65%);
}

.carousel__year {
  position: relative;
  font-family: var(--serif);
  font-size: 44px;
  color: rgba(255, 255, 255, .18);
  line-height: 1;
}

.carousel__title {
  position: relative;
  font-family: var(--serif);
  font-size: 24px;
}

.carousel__text {
  position: relative;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 300px;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 12px 0 14px;
  background: var(--card);
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background .25s, transform .25s;
}

.carousel__dot.is-active { background: var(--blue); transform: scale(1.25); }

/* ---------- Event ---------- */
.media--event { padding: 28px 18px 22px; }

.media--event > * { position: relative; }

.media__date {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 9vw, 40px);
  text-align: center;
  letter-spacing: .04em;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0 22px;
}

.cd {
  padding: 12px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: center;
}

.cd__num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.cd__label {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.events { display: grid; gap: 12px; margin-bottom: 14px; }

.event {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
}

.event__name {
  font-family: var(--serif);
  font-size: 20px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.event__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.event__row + .event__row { margin-top: 9px; }
.event__row .ico { width: 17px; height: 17px; color: var(--muted); margin-top: 2px; }
.event__venue { font-weight: 600; }
.event__addr { color: var(--muted); }

.event__map {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.event__map .ico { width: 14px; height: 14px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.gallery__cell {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}

.gallery__cell--empty {
  background-image: linear-gradient(140deg, #191f1c, #0e1210);
}

.gallery__cell--empty::after {
  content: attr(data-index);
  font-family: var(--serif);
  font-size: 26px;
  color: rgba(255, 255, 255, .12);
}

.gallery__cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .2s;
}

.gallery__cell:hover::before { opacity: 1; }

/* ---------- Dress code ---------- */
.media--dress { padding: 30px 22px 26px; text-align: center; }

.dress__title {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 32px;
}

.palette {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.swatch { width: 56px; }

.swatch__chip {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}

.swatch__name {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}

/* ---------- Gift ---------- */
.media--gift {
  padding: 30px 22px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.gift__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.gift__intro { font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 340px; }

/* ---------- Closing ---------- */
.media--closing {
  padding: 40px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 400px;
  justify-content: center;
}

.media--closing > *:not(.media__deco) { position: relative; }

.closing__text {
  font-size: 13.5px;
  line-height: 1.7;
  color: #dadedc;
  max-width: 320px;
}

.closing__thanks {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 34px;
}

.closing__sign { font-size: 12px; color: var(--muted); margin-top: 10px; }

.closing__names {
  font-family: var(--serif);
  font-size: 26px;
}

.closing__families { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- Credit ---------- */
.credit {
  padding: 26px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 11px;
  color: var(--dim);
}

/* ============================================================
   TAB BAR
   ============================================================ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: var(--shell);
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.cover.is-open ~ .app .tabbar { display: flex; }

.tabbar__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: color .2s, transform .12s var(--ease);
}

.tabbar__btn:active { transform: scale(.9); }
.tabbar__btn.is-active { color: var(--ink); }

.tabbar__btn--cta {
  width: 52px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--grad);
  color: #fff;
}

.tabbar__btn--cta .ico { width: 21px; height: 21px; }

/* ============================================================
   SHEETS
   ============================================================ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] { display: none; }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
  animation: fade .25s var(--ease);
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  animation: slide-up .32s var(--ease);
}

.sheet__panel--tall { height: 88vh; }

.sheet__grab {
  width: 40px;
  height: 4px;
  margin: 9px auto 0;
  border-radius: 2px;
  background: #34403a;
  flex: none;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.sheet__title { font-size: 16px; font-weight: 700; }

.sheet__body {
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

.sheet__body--list { padding: 0; flex: 1; }

.sheet__lead { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------- FORM ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: block; position: relative; }

.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field__label em { font-style: normal; font-weight: 400; color: var(--dim); }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  transition: border-color .2s;
}

.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--blue); }
.input--area { resize: vertical; min-height: 84px; }
.input.is-invalid { border-color: var(--red); }

.field__count {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 10px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.choices { display: flex; gap: 7px; }

.choice { flex: 1; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice span {
  display: block;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s;
}

.choice input:checked + span {
  border-color: var(--blue);
  background: rgba(35, 134, 111, .14);
  color: var(--ink);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 148px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}

.stepper__btn {
  width: 36px;
  height: 34px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s;
}

.stepper__btn:hover { background: #272f2b; }

.stepper__value {
  flex: 1;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper__value::-webkit-outer-spin-button,
.stepper__value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.form__note { font-size: 11px; color: var(--dim); text-align: center; line-height: 1.5; }
.form__note code { color: var(--muted); }

/* ---------- SUCCESS ---------- */
.success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 6px; }

.success__mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(46, 204, 113, .14);
  color: var(--green);
  animation: pop .4s var(--ease);
}

.success__title { font-family: var(--serif); font-size: 26px; }
.success__text { font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 300px; }
.success__text strong { color: var(--ink); }
.success .btn { margin-top: 8px; }

/* ---------- WISHES ---------- */
.wishes { padding: 8px 0; }

.wish {
  display: flex;
  gap: 11px;
  padding: 11px 20px;
  animation: fade .3s var(--ease);
}

.wish__body { flex: 1; min-width: 0; }

.wish__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wish__name { font-size: 13px; font-weight: 600; }

.wish__badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid;
}

.wish__badge--hadir { color: var(--green); border-color: rgba(46, 204, 113, .4); background: rgba(46, 204, 113, .1); }
.wish__badge--ragu  { color: #f0b429; border-color: rgba(240, 180, 41, .4); background: rgba(240, 180, 41, .1); }
.wish__badge--tidak { color: var(--dim); border-color: var(--line); }

.wish__msg { font-size: 13.5px; line-height: 1.5; color: #e5e7e6; margin-top: 2px; overflow-wrap: anywhere; }
.wish__time { font-size: 11px; color: var(--dim); margin-top: 4px; }

.wishes__empty { padding: 40px 20px; text-align: center; color: var(--dim); font-size: 13px; }

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--card);
  flex: none;
}

.composer__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.composer__name,
.composer__msg {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  padding: 8px 14px;
}

.composer__name { font-size: 12px; }
.composer__name::placeholder,
.composer__msg::placeholder { color: var(--dim); }
.composer__name:focus, .composer__msg:focus { outline: none; border-color: var(--blue); }
.composer__name.is-invalid, .composer__msg.is-invalid { border-color: var(--red); }

.composer__send {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  flex: none;
}

.composer__send:hover { opacity: .75; }

/* ---------- BANKS ---------- */
.banks { display: grid; gap: 11px; }

.bank {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 16px 46px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #161c19, #0d0f0e);
  cursor: pointer;
  transition: border-color .2s, transform .12s var(--ease);
}

.bank:hover { border-color: #34403a; }
.bank:active { transform: scale(.99); }

.bank__name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.bank__number {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  margin-top: 5px;
}

.bank__holder { font-size: 12px; color: var(--muted); margin-top: 3px; }

.bank__copy {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted);
}

.bank.is-copied { border-color: var(--green); }
.bank.is-copied .bank__copy { color: var(--green); }

.ship {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}

.ship__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.ship__name { font-size: 14px; font-weight: 600; }
.ship__addr { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .95);
  animation: fade .22s var(--ease);
}

.lightbox[hidden] { display: none; }

.lightbox__close { position: absolute; top: 14px; right: 14px; z-index: 2; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}

.lightbox__nav--prev { left: 10px; }
.lightbox__nav--prev .ico { transform: rotate(180deg); }
.lightbox__nav--next { right: 10px; }

.lightbox__figure { max-width: 460px; width: 100%; text-align: center; }

.lightbox__stage {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background-size: cover;
  background-position: center;
  background-color: #121614;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 60px;
  color: rgba(255, 255, 255, .12);
}

.lightbox__caption { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  z-index: 400;
  padding: 11px 20px;
  border-radius: 999px;
  background: #fafafa;
  color: #0f1311;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes rise      { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up  { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop       { 0% { transform: scale(.6); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes spin-ring { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .post { opacity: 1; transform: none; }
}

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 820px) {
  body {
    background:
      radial-gradient(60% 60% at 12% 10%, rgba(211, 194, 127, .1), transparent 60%),
      radial-gradient(60% 60% at 88% 90%, rgba(201, 134, 99, .1), transparent 60%),
      #050706;
    background-attachment: fixed;
  }

  .app {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .7);
  }

  .topbar { border-radius: 22px 22px 0 0; }

  .tabbar {
    bottom: 24px;
    border-radius: 0 0 22px 22px;
    border-inline: 1px solid var(--line);
  }

  .music-pill { bottom: calc(var(--tab-h) + 42px); right: max(14px, calc(50vw - var(--shell) / 2 + 14px)); }
  .toast { bottom: calc(var(--tab-h) + 50px); }
}
