:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --motion-fast: 160ms;
  --motion-ui: 240ms;
  --visible-height: 100dvh;
}

.mobile-dock { display: none; }
.field-control { min-width: 0; }
.field-error { margin-top: 8px; color: #9b2620; font-size: 13px; line-height: 1.6; text-align: left; }
.form-row > label > .required-label { display: inline; margin-left: 7px; font-size: 11px; color: #62645c; font-weight: 500; }
.form-row input[aria-invalid="true"] { border-color: #9b2620; }
.dialog-close { width: 44px; height: 44px; }
.response-dialog h2, .share-dialog h2 { padding-inline: 13px; }
dialog { overscroll-behavior: contain; max-height: calc(var(--visible-height) - 32px); }
.poster-dialog .dialog-close { position: sticky; top: 10px; margin: 10px 10px -54px auto; width: 44px; height: 44px; }
.confetti-gsap .confetti { animation: none; }

@media (max-width: 740px) {
  html { scroll-padding-top: calc(88px + env(safe-area-inset-top)); }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .site-header { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); }
  .header-inner { min-height: 70px; padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); }
  .brand { min-height: 44px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-title { font-size: 24px; }
  .menu-toggle { width: 46px; height: 46px; flex-shrink: 0; }
  .mobile-nav { position: absolute; top: 100%; inset-inline: 0; padding: 8px 20px 15px; max-height: calc(100dvh - 88px - env(safe-area-inset-top)); overflow-y: auto; background: var(--paper); border-bottom: var(--line); box-shadow: 0 6px 0 var(--ink); transform-origin: top center; }
  .mobile-nav a { min-height: 52px; padding: 12px 8px; font-size: 17px; }
  .hero-inner { padding: 30px 24px 42px; gap: 32px; }
  .invitation-label { margin-bottom: 16px; }
  .invitation-label span { font-size: 15px; }
  h1 { font-size: clamp(58px, 15.6vw, 86px); line-height: 1.2; margin-bottom: 17px; }
  .hero-names { margin-top: 18px; font-size: 25px; gap: 15px; }
  .hero-description { font-size: 15px; line-height: 1.85; letter-spacing: 0; margin-top: 9px; }
  .hero-actions { gap: 12px; margin-top: 21px; }
  .hero-actions .button { min-height: 52px; font-size: 15px; padding: 13px 14px; }
  .hero-actions .button:first-child { flex: 1.4; }
  .hero-actions .button:last-child { flex: 1; padding-inline: 12px; }
  .hero-actions .icon { width: 20px; height: 20px; }
  .hero-date { margin-top: 23px; }
  .hero-date time { font-size: clamp(38px, 10.5vw, 60px); }
  .hero-date > a { min-height: 44px; font-size: 16px; padding-top: 8px; }
  .hero-art { width: calc(100% - 20px); max-width: 390px; }
  .section-wrap { padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
  .together-section { padding-top: 52px; padding-bottom: 48px; gap: 33px; }
  .candidate { padding: 18px 14px 20px; }
  .candidate p { font-size: 12px; line-height: 1.65; }
  .candidate h3 { font-size: clamp(28px, 8vw, 40px); }
  .promise p { font-size: 16px; line-height: 1.8; letter-spacing: 0; }
  .couple-intro p, .event-copy p { font-size: 16px; }
  .promise-signoff { font-size: 13px; letter-spacing: 0; }
  .event-details { min-width: 0; }
  .event-table dd { font-size: 16px; padding: 13px 12px; line-height: 1.6; }
  .event-actions .button { min-height: 52px; font-size: 15px; }
  .event-actions .arrow-small { display: none; }
  .event-note { font-size: 13px; line-height: 1.7; letter-spacing: 0; }
  .rsvp-inner { gap: 30px; padding-top: 40px; padding-bottom: 48px; }
  .rsvp-copy h2 { font-size: clamp(30px, 8.4vw, 45px); letter-spacing: -1.3px; }
  .response-card { transform: none; margin: 0 4px 0 0; padding: 25px 20px 22px; box-shadow: 5px 5px 0 var(--ink); }
  .response-card h3 { font-size: clamp(23px, 6.2vw, 30px); }
  .response-card-intro { font-size: 14px; margin: 11px 0 26px; line-height: 1.7; }
  .form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 21px; }
  .form-row > label { font-size: 16px; line-height: 1.5; text-align: left; padding: 0; }
  .form-row > label > span { display: inline; margin-left: 5px; font-size: 13px; }
  .form-row > label > .required-label { font-size: 12px; }
  .form-row input, .form-row select, .form-row textarea { min-height: 52px; border-width: 2px; padding: 12px 13px; font-size: 16px; line-height: 1.6; background: #fffefa; }
  .form-row input::placeholder, .form-row textarea::placeholder { font-size: 15px; }
  .form-row textarea { min-height: 104px; max-height: 240px; }
  .attendance-field { display: block; margin: 0 0 21px; }
  .attendance-field legend { float: none; width: 100%; font-size: 16px; line-height: 1.5; margin-bottom: 9px; }
  .attendance-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .radio-option { min-height: 54px; gap: 8px; font-size: 15px; border-width: 2px; }
  .radio-option input { width: 18px; height: 18px; }
  .radio-option:has(input:checked) { background: #06c6cc12; }
  .response-submit { min-height: 56px; font-size: 18px; margin-top: 0; }
  .form-note { font-size: 13px; line-height: 1.8; text-align: left; margin-top: 18px; letter-spacing: 0; }
  .site-footer { padding: 30px 24px 24px; }
  .footer-brand { min-height: 44px; }
  .footer-actions { gap: 20px; margin-top: 15px; }
  .footer-actions a, .footer-actions button { min-height: 44px; font-size: 14px; gap: 7px; }
  .footer-actions .icon { width: 18px; height: 18px; }
  .site-footer > p { font-size: 12px; letter-spacing: 1px; }
  .site-footer small { font-size: 12px; margin-top: 12px; }
  .mobile-dock { position: fixed; z-index: 35; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; align-items: center; padding: 12px max(18px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); border-top: var(--line); background: var(--paper); }
  .mobile-dock .dock-details { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 800; }
  .mobile-dock .button { min-height: 48px; font-size: 16px; padding: 11px 14px; gap: 18px; box-shadow: 3px 3px 0 var(--ink); }
  .mobile-dock .icon { width: 21px; height: 21px; }
  dialog { max-width: calc(100% - 28px); max-height: calc(var(--visible-height) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 28px 20px 23px; box-shadow: 5px 5px 0 var(--ink); }
  .dialog-close { position: sticky; top: 0; right: auto; margin: -13px -5px -31px auto; width: 46px; height: 46px; z-index: 3; border-width: 2px; }
  .dialog-close .icon { width: 22px; height: 22px; }
  .dialog-check { margin-top: 5px; }
  .response-dialog h2 { font-size: 23px; line-height: 1.5; padding-inline: 9px; margin-top: 18px; }
  .response-dialog > p, .share-dialog p { font-size: 14px; line-height: 1.8; }
  .response-dialog textarea, .share-dialog input { font-size: 16px; line-height: 1.65; padding: 13px; }
  .response-dialog textarea { height: clamp(190px, 28dvh, 250px); }
  .dialog-actions .button { min-height: 52px; font-size: 16px; }
  .response-dialog .dialog-note { font-size: 13px; }
  .text-button { min-height: 44px; font-size: 14px; margin-top: 9px; }
  .poster-dialog { width: calc(100% - 28px); padding: 0 0 22px; }
  .poster-dialog img { max-height: none; }
  .poster-dialog .dialog-close { margin: 10px 10px -56px auto; top: 10px; width: 46px; height: 46px; }
  .poster-dialog .button { min-height: 50px; font-size: 16px; }
  .share-dialog h2 { font-size: 25px; margin-top: 29px; padding-inline: 0; }
  .toast { bottom: calc(98px + env(safe-area-inset-bottom)); font-size: 14px; padding: 13px 18px; max-width: calc(100vw - 28px); }
  body:has(.mobile-dock[hidden]) .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .hero-inner { padding-inline: 22px; }
  h1 { font-size: 16.8vw; }
  .hero-names { font-size: 23px; gap: 12px; letter-spacing: 1px; }
  .hero-description { font-size: 14px; }
  .hero-actions { flex-direction: column; gap: 13px; }
  .hero-actions .button { width: 100%; font-size: 15px; }
  .hero-date time { font-size: 37px; }
  .hero-date p > span { font-size: 16px; }
  .section-wrap { padding-inline: 22px; }
  .candidate-pair { gap: 13px; padding-inline: 2px; }
  .candidate { padding: 17px 11px 19px; }
  .candidate p { font-size: 11px; }
  .candidate h3 { font-size: 28px; gap: 5px; }
  .candidate h3 .icon { width: 17px; }
  .event-copy h2 { font-size: 34px; }
  .event-actions { flex-direction: column; }
  .response-card { padding-inline: 17px; }
  .radio-option { font-size: 14px; gap: 6px; }
  .radio-option input { width: 17px; height: 17px; }
  .footer-actions { flex-direction: column; gap: 4px; align-items: center; }
  .mobile-dock { gap: 9px; padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .poster-button, .vote-mark, .menu-toggle span { transition-duration: 0.01ms; }
}
