.wedding-gallery-grid {
  width: 100%;
  max-width: min(25rem, 100%);
  margin: 0 auto;
  padding: 0;
}

.wedding-gallery-grid--empty .wedding-gallery-grid__empty-placeholder {
  min-height: min(42vw, 220px);
  border-radius: 4px;
}

.wedding-gallery-grid__items {
  --gallery-grid-gap: clamp(10px, 2.8vw, 14px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gallery-grid-gap);
  align-items: stretch;
  grid-auto-flow: row;
  overflow: hidden;
  contain: layout;
}

/** 더보기/접기 시 높이 전환 — `max-height`는 JS가 px로 갱신 */
.wedding-gallery-grid__items--collapsible {
  transition: max-height 0.52s cubic-bezier(0.33, 1, 0.68, 1);
}

/**
 * 3열 + 가로·세로 혼합(theirmood `photoRatio: multiple` / `imageDirections`에 가깝게).
 * 실제 비율은 로드 후 `naturalWidth`/`naturalHeight`로 분류.
 */
.wedding-gallery-grid__items--masonry {
  grid-auto-flow: dense;
  grid-auto-rows: minmax(100px, 100px);
}

.wedding-gallery-grid__item {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: rgb(248 246 243);
  border-radius: 10px;
  isolation: isolate;
  transform: translateZ(0);
  transition:
    opacity 0.42s ease,
    transform 0.48s cubic-bezier(0.33, 1, 0.68, 1);
}

.wedding-gallery-grid__item--square {
  grid-column: span 1;
  grid-row: span 1;
  aspect-ratio: 1;
}

.wedding-gallery-grid__item--tall {
  grid-column: span 1;
  grid-row: span 2;
}

.wedding-gallery-grid__item--wide {
  grid-column: span 2;
  grid-row: span 1;
}

.wedding-gallery-grid__item--extra {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 10px, 0);
}

.wedding-gallery-grid__items--extras-visible .wedding-gallery-grid__item--extra {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .wedding-gallery-grid__item {
    transition-duration: 0.01ms;
  }
}

.wedding-gallery-grid__thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.wedding-gallery-grid__item--square .wedding-gallery-grid__thumb {
  height: 100%;
}

.wedding-gallery-grid__item--tall .wedding-gallery-grid__thumb,
.wedding-gallery-grid__item--wide .wedding-gallery-grid__thumb {
  min-height: 100%;
}

.wedding-gallery-grid__thumb:focus-visible {
  outline: 2px solid rgb(112 112 112);
  outline-offset: -2px;
}

.wedding-gallery-grid__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.wedding-gallery-grid__more {
  display: block;
  min-width: 6rem;
  margin: clamp(22px, 6vw, 32px) auto 0;
  padding: 7px 14px;
  border: 1px solid rgb(180 180 180 / 0.85);
  border-radius: 10px;
  background: #fff;
  color: rgb(82 82 82);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    transform 0.2s ease;
}

.wedding-gallery-grid__more:hover {
  background: rgb(245 245 245);
}

.wedding-gallery-grid__more:focus-visible {
  outline: 2px solid rgb(112 112 112);
  outline-offset: 3px;
}

.wedding-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  animation: wedding-gallery-lightbox-in 0.24s ease-out both;
}

.wedding-gallery-lightbox--closing {
  pointer-events: none;
  animation: wedding-gallery-lightbox-out 0.22s ease-in both;
}

.wedding-gallery-lightbox__scrim {
  position: absolute;
  inset: 0;
  border: none;
  background: rgb(0 0 0 / 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.wedding-gallery-lightbox__stage {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(100%, var(--shell-max, 430px));
  height: min(86vh, 760px);
  padding-bottom: max(56px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.wedding-gallery-lightbox__figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, calc(var(--shell-max, 430px) - 54px));
  max-height: 100%;
  margin: 0;
  animation: wedding-gallery-photo-next 0.24s ease-out both;
}

.wedding-gallery-lightbox__figure--prev {
  animation-name: wedding-gallery-photo-prev;
}

.wedding-gallery-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(min(86vh, 760px) - 58px - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 22px 52px rgb(0 0 0 / 0.34);
}

.wedding-gallery-lightbox__count {
  margin-top: 12px;
  color: rgb(255 255 255 / 0.86);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.wedding-gallery-lightbox__nav {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 25%;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  color: rgb(255 255 255 / 0.82);
  cursor: pointer;
}

.wedding-gallery-lightbox__nav:hover,
.wedding-gallery-lightbox__nav:focus:not(:focus-visible),
.wedding-gallery-lightbox__nav:active {
  background: transparent;
  color: rgb(255 255 255 / 0.82);
}

.wedding-gallery-lightbox__nav--prev {
  left: 0;
}

.wedding-gallery-lightbox__nav--next {
  right: 0;
}

.wedding-gallery-lightbox__nav span {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 9vw, 3.4rem);
  line-height: 1;
  text-shadow: 0 2px 14px rgb(0 0 0 / 0.32);
}

.wedding-gallery-lightbox__nav--prev span {
  left: clamp(4px, 2.6vw, 14px);
}

.wedding-gallery-lightbox__nav--next span {
  right: clamp(4px, 2.6vw, 14px);
}

.wedding-gallery-lightbox__close {
  position: absolute;
  z-index: 3;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  right: auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.36);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.18);
  color: #fff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wedding-gallery-lightbox__close-x {
  display: block;
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0;
  margin-top: -0.06em;
}

.wedding-gallery-lightbox__nav:focus-visible,
.wedding-gallery-lightbox__close:focus-visible,
.wedding-gallery-lightbox__scrim:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes wedding-gallery-lightbox-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes wedding-gallery-lightbox-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes wedding-gallery-photo-next {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes wedding-gallery-photo-prev {
  from {
    opacity: 0;
    transform: translateX(-18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wedding-gallery-grid__items,
  .wedding-gallery-grid__item,
  .wedding-gallery-lightbox,
  .wedding-gallery-lightbox--closing,
  .wedding-gallery-lightbox__figure,
  .wedding-gallery-lightbox__figure--prev {
    animation: none;
    transition: none;
  }
}

/* --- SPA gallery section title/hint (App.css) --- */
.wedding-circular-gallery-section .wedding-section__title > h2 {
  margin-bottom: 8px;
}

.gallery-section__hint {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
  letter-spacing: 0.02em;
  word-break: keep-all;
}

/* --- SPA guestbook (App.css) --- */
/* 방명록 — 본문·제목: `--guestbook-body-ink` / `muted`는 `wedding-body-colors.css`(:root)에서 톤 기반 */
#guestbook.section.guestbook .wedding-section__title > h2 {
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook__toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 14px auto 0;
  max-width: min(var(--shell-max), 100%);
}

.guestbook__write-btn,
.guestbook__fullscreen-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--body-palette-ui-border, rgb(210 210 210));
  background: #fff;
  color: var(--guestbook-body-ink, var(--ink));
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgb(40 40 40 / 0.06);
  -webkit-tap-highlight-color: transparent;
}

.guestbook__toolbar-icon {
  display: block;
  flex-shrink: 0;
}

.guestbook__write-btn:hover,
.guestbook__fullscreen-btn:hover {
  border-color: var(--body-palette-ui-border-hover, rgb(150 150 150));
  color: var(--guestbook-body-muted, rgb(86 86 86));
}

.guestbook__fullscreen-btn {
  margin-right: 6px;
}

.guestbook__fullscreen-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.guestbook__write-btn:focus-visible,
.guestbook__fullscreen-btn:focus-visible {
  outline: 2px solid var(--guestbook-accent-fill, rgb(105 105 105));
  outline-offset: 2px;
}

.guestbook__list-err {
  margin: 0 auto 12px;
  max-width: min(var(--shell-max), 100%);
  font-size: 0.88rem;
  color: #9a5348;
  line-height: 1.5;
}

.guestbook__list-scroll {
  max-width: min(var(--shell-max), 100%);
  width: 100%;
  margin: 0 auto;
  min-height: 178px;
  overflow-y: hidden;
  overflow-x: hidden;
  padding: 18px 0;
  border-radius: 0;
  border: 1px solid var(--body-palette-ui-border, rgb(230 230 230));
  background: #fff;
  box-shadow: 0 10px 30px rgb(42 42 42 / 0.05);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.guestbook__marquee-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guestbook__marquee-lane {
  overflow: hidden;
}

.guestbook__list-empty {
  margin: 48px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--guestbook-body-muted, var(--muted));
}

.guestbook__offline {
  max-width: min(26rem, 100%);
  margin: 0 auto;
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, #b08d57 35%, var(--line));
  background: var(--paper);
}

.guestbook__offline-msg {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--guestbook-body-muted, var(--muted));
  text-align: center;
}

.guestbook__local-hint {
  max-width: min(var(--shell-max), 100%);
  margin: 0 auto 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--guestbook-body-muted, var(--muted));
  text-align: center;
  background: color-mix(in srgb, #d4bc91 18%, var(--blush));
  border: 1px solid color-mix(in srgb, #b08d57 22%, var(--line));
}

.guestbook__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.guestbook__list--marquee {
  width: max-content;
  /* `--guestbook-marquee-duration`: GuestbookSection에서 너비 기준으로 설정(가로 px/s 일정) */
  animation: guestbook-marquee var(--guestbook-marquee-duration, 28s) linear infinite;
}

.guestbook__list--bride-marquee {
  animation-direction: reverse;
}

.guestbook__list--full {
  flex-direction: column;
  gap: 12px;
}

.guestbook__card {
  width: min(280px, calc(var(--shell-max) - 56px));
  height: 138px;
  padding: 16px 16px 14px;
  border-radius: 12px;
  border: 1px solid rgb(226 226 226);
  background: #fff;
  box-shadow: 0 12px 28px rgb(44 44 44 / 0.08);
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook__list--full .guestbook__card {
  width: 100%;
  height: 150px;
}

.guestbook__card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.guestbook__card-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.guestbook__card-menu {
  position: relative;
  flex-shrink: 0;
  margin-top: -2px;
}

.guestbook__card-more {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgb(216 216 216);
  background: var(--paper);
  color: var(--guestbook-body-muted, var(--muted));
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  font-family: var(--serif);
}

.guestbook__card-more:hover {
  border-color: rgb(150 150 150);
  color: var(--guestbook-body-ink, rgb(86 86 86));
}

/* `position`·`top`·`right`는 포털에서 인라인으로 지정 (스크롤 영역 밖에 표시) */
.guestbook__dropdown {
  position: fixed;
  z-index: 12500;
  min-width: 7.5rem;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 28px rgb(42 38 34 / 0.12);
}

.guestbook__dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.86rem;
  font-family: var(--serif);
  color: var(--guestbook-body-ink, var(--ink));
  cursor: pointer;
}

.guestbook__dropdown-item:hover {
  background: var(--blush);
}

.guestbook__dropdown-item--danger {
  color: #9a5348;
}

.guestbook__card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.guestbook__badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0;
  border-radius: 0;
  border: none;
}

.guestbook__badge--groom {
  color: var(--guestbook-body-muted, rgb(88 88 88));
  background: transparent;
}

.guestbook__badge--bride {
  color: var(--guestbook-body-muted, rgb(88 88 88));
  background: transparent;
}

.guestbook__card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook__card-time {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--guestbook-body-muted, var(--muted));
  white-space: nowrap;
}

.guestbook__card-body {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook__card-from {
  margin: 14px 0 0;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--guestbook-body-muted, rgb(128 128 128));
}

.guestbook-full-root {
  position: fixed;
  inset: 0;
  z-index: 12400;
  display: grid;
  place-items: center;
  padding: 22px 0;
  pointer-events: none;
}

.guestbook-full-root--closing {
  pointer-events: none;
}

.guestbook-full-backdrop {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(var(--shell-max), calc(100vw - 28px));
  transform: translateX(-50%);
  background: rgb(245 245 245 / 0.78);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: guestbook-full-backdrop-in 0.24s ease-out both;
}

.guestbook-full-root--closing .guestbook-full-backdrop {
  animation: guestbook-full-backdrop-out 0.22s ease-in both;
}

.guestbook-full {
  position: relative;
  z-index: 1;
  width: min(var(--shell-max), calc(100vw - 28px));
  height: min(82vh, 760px);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  border: 1px solid var(--color-border-midgray);
  background: #fff;
  box-shadow: 0 22px 60px rgb(30 30 30 / 0.18);
  pointer-events: auto;
  transform-origin: center;
  animation: guestbook-full-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.guestbook-full-root--closing .guestbook-full {
  animation: guestbook-full-out 0.22s ease-in both;
}

.guestbook-full__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border-card);
  flex-shrink: 0;
}

.guestbook-full__title {
  margin: 0;
  font-size: 1rem;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook-full__close {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--color-border-midgray);
  border-radius: 999px;
  background: #fff;
  color: var(--guestbook-body-muted, rgb(88 88 88));
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.guestbook-full__tools {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-card);
  background: rgb(248 248 248);
  flex-shrink: 0;
}

.guestbook-full__tool-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: center;
  gap: 8px;
}

.guestbook-full__tool-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--guestbook-body-muted, rgb(112 112 112));
}

.guestbook-full__segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--body-palette-ui-border, rgb(224 224 224));
  background: #fff;
}

.guestbook-full__seg-btn {
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--guestbook-body-muted, rgb(118 118 118));
  font-size: 0.76rem;
  font-family: var(--serif);
  letter-spacing: 0.02em;
  cursor: pointer;
}

.guestbook-full__seg-btn.is-on {
  background: var(--guestbook-accent-fill, rgb(105 105 105));
  color: #fff;
}

.guestbook-full__search-row {
  display: flex;
  gap: 8px;
}

.guestbook-full__search-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--body-palette-ui-border, rgb(218 218 218));
  border-radius: 0;
  background: #fff;
  color: var(--guestbook-body-ink, var(--ink));
  font-size: 0.86rem;
  font-family: var(--serif);
  outline: none;
}

.guestbook-full__search-input:focus {
  border-color: var(--guestbook-accent-fill, rgb(116 116 116));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guestbook-accent-fill, rgb(116 116 116)) 22%, transparent);
}

.guestbook-full__clear {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--body-palette-ui-border, rgb(218 218 218));
  border-radius: 0;
  background: #fff;
  color: var(--guestbook-body-muted, rgb(104 104 104));
  font-size: 0.78rem;
  font-family: var(--serif);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.guestbook-full__clear:hover {
  border-color: var(--body-palette-ui-border-hover, rgb(150 150 150));
  background: color-mix(in srgb, var(--body-palette-tone-en, rgb(220 220 220)) 6%, rgb(255 255 255));
}

.guestbook-full__result-count {
  margin: 0;
  text-align: right;
  font-size: 0.74rem;
  color: var(--guestbook-body-muted, rgb(132 132 132));
}

.guestbook-full__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

@keyframes guestbook-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes guestbook-full-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes guestbook-full-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
}

@keyframes guestbook-full-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes guestbook-full-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guestbook__list--marquee {
    animation: none;
  }

  .guestbook-full,
  .guestbook-full-backdrop,
  .guestbook-full-root--closing .guestbook-full,
  .guestbook-full-root--closing .guestbook-full-backdrop,
  .guestbook-modal,
  .guestbook-modal-backdrop,
  .guestbook-modal-root--closing .guestbook-modal,
  .guestbook-modal-root--closing .guestbook-modal-backdrop {
    animation: none;
  }
}

.guestbook-modal--compact {
  max-width: 360px;
}

.guestbook-modal-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.guestbook-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(245 245 245 / 0.74);
  backdrop-filter: blur(10px);
  animation: guestbook-modal-backdrop-in 0.24s ease-out both;
}

.guestbook-modal-root--closing .guestbook-modal-backdrop {
  animation: guestbook-modal-backdrop-out 0.22s ease-in both;
}

.guestbook-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(90dvh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--color-border-midgray);
  background: #fff;
  box-shadow:
    0 28px 56px rgb(40 40 40 / 0.14),
    inset 0 1px 0 rgb(255 255 255 / 0.95);
  color: var(--ink);
  font-family: var(--serif);
  transform-origin: center;
  animation: guestbook-modal-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.guestbook-modal-root--closing .guestbook-modal {
  animation: guestbook-modal-out 0.22s ease-in both;
}

.guestbook-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.guestbook-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--color-border-card);
  flex-shrink: 0;
}

.guestbook-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border-midgray);
  border-radius: 10px;
  background: #fff;
  color: var(--guestbook-body-muted, rgb(112 112 112));
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.guestbook-modal__close:hover:not(:disabled) {
  border-color: rgb(150 150 150);
  color: var(--guestbook-body-ink, rgb(68 68 68));
}

.guestbook-modal__close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guestbook-modal__body {
  padding: 14px 18px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.guestbook-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--color-border-card);
  flex-shrink: 0;
  background: rgb(250 250 250);
}

.guestbook-modal__hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--guestbook-body-muted, var(--muted));
}

.guestbook-modal__hint--emph {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--guestbook-body-ink, var(--ink));
  margin-bottom: 12px;
}

.guestbook-modal__field {
  margin-bottom: 14px;
}

.guestbook-modal__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--guestbook-body-muted, rgb(88 88 88));
}

.guestbook-modal__side-toggle {
  display: flex;
  gap: 8px;
}

.guestbook-modal__side-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--body-palette-ui-border, rgb(218 218 218));
  background: #fff;
  color: var(--guestbook-body-muted, rgb(112 112 112));
  font-family: var(--serif);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.guestbook-modal__side-btn.is-on {
  border-color: var(--guestbook-accent-fill, rgb(105 105 105));
  background: var(--guestbook-accent-fill, rgb(105 105 105));
  color: #fff;
  font-weight: 600;
}

.guestbook-modal__side-toggle--readonly {
  pointer-events: none;
}

.guestbook-modal__side-pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgb(218 218 218);
  font-size: 0.88rem;
  font-weight: 600;
  background: rgb(255 255 255 / 0.75);
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook-modal__side-pill--groom {
  border-color: rgb(204 204 204);
  background: rgb(248 248 248);
  color: var(--guestbook-body-muted, rgb(88 88 88));
}

.guestbook-modal__side-pill--bride {
  border-color: rgb(204 204 204);
  background: rgb(248 248 248);
  color: var(--guestbook-body-muted, rgb(88 88 88));
}

.guestbook-modal__input,
.guestbook-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--body-palette-ui-border, rgb(218 218 218));
  background: #fff;
  color: var(--guestbook-body-ink, var(--ink));
  font-size: 0.9rem;
  font-family: var(--serif);
}

.guestbook-modal__input:focus,
.guestbook-modal__textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--guestbook-accent-fill, rgb(116 116 116)) 28%, transparent);
  outline-offset: 1px;
  border-color: var(--guestbook-accent-fill, rgb(116 116 116));
}

.guestbook-modal__input--pin {
  -webkit-text-security: disc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.22em;
  font-family: ui-monospace, monospace;
}

.guestbook-modal__input--pin-readonly {
  letter-spacing: 0.35em;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--guestbook-body-muted, var(--muted));
  background: rgb(246 246 246);
  cursor: not-allowed;
}

.guestbook-modal__textarea {
  resize: vertical;
  min-height: 100px;
}

.guestbook-modal__err {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #9a5348;
}

.guestbook-modal__preview {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgb(224 224 224);
  background: rgb(248 248 248);
  font-size: 0.86rem;
  color: var(--guestbook-body-ink, var(--ink));
}

.guestbook-modal__preview p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: color-mix(in srgb, var(--guestbook-body-ink, var(--ink)) 88%, var(--guestbook-body-muted, var(--muted)) 12%);
}

.guestbook-modal__preview-side {
  color: var(--guestbook-body-muted, var(--muted));
  font-weight: 500;
}

.guestbook-modal__btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: var(--serif);
  cursor: pointer;
  border: 1px solid var(--body-palette-ui-border, rgb(218 218 218));
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}

.guestbook-modal__btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.guestbook-modal__btn.ghost {
  background: #fff;
  color: var(--guestbook-body-muted, rgb(104 104 104));
}

.guestbook-modal__btn.ghost:hover:not(:disabled) {
  border-color: var(--body-palette-ui-border-hover, rgb(150 150 150));
  color: var(--guestbook-body-ink, rgb(68 68 68));
}

.guestbook-modal__btn.primary {
  background: var(--guestbook-accent-fill, rgb(88 88 88));
  color: #fff;
  border-color: var(--guestbook-accent-fill, rgb(88 88 88));
  font-weight: 700;
}

.guestbook-modal__btn.primary:hover:not(:disabled) {
  background: var(--guestbook-accent-fill-hover, rgb(76 76 76));
  border-color: var(--guestbook-accent-fill-hover, rgb(76 76 76));
  filter: none;
}

.guestbook-modal__btn.danger {
  background: color-mix(in srgb, var(--body-palette-tone-en, rgb(220 220 220)) 8%, rgb(238 236 234));
  color: var(--guestbook-body-ink, rgb(88 88 88));
  border-color: var(--body-palette-ui-border, rgb(204 204 204));
  font-weight: 600;
}

.guestbook-modal__btn.danger:hover:not(:disabled) {
  border-color: var(--body-palette-ui-border-hover, rgb(180 180 180));
  filter: brightness(0.98);
}

@keyframes guestbook-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes guestbook-modal-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
}

@keyframes guestbook-modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes guestbook-modal-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
