@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --surface: #fffdf8;
  --cream: #edeadc;
  --olive: #3f492f;
  --olive-dark: #2c3520;
  --olive-soft: #e5e8d9;
  --plum: #70505c;
  --ink: #292921;
  --muted: #666459;
  --line: #e1ddd1;
  --radius: 18px;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.1; }
h3 { line-height: 1.2; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 4px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.1em; height: 1.1em; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.17em; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 5; background: var(--surface); padding: 10px; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { width: min(1260px, calc(100% - 96px)); margin: auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: clamp(18px, 3.3vw, 56px); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--olive-dark); text-decoration: none; font: 700 25px/1 var(--serif); white-space: nowrap; letter-spacing: -.055em; }
.wordmark-accent { color: var(--plum); }
.brand-icon { display: inline-grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--surface); background: var(--olive); }
.brand-icon .icon { width: 19px; height: 19px; }
.site-nav { display: flex; justify-content: center; gap: clamp(18px, 3.2vw, 45px); margin-inline: auto; }
.site-nav a, .footer-inner > a:last-child { color: var(--muted); font-size: .94rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current], .footer-inner > a:last-child:hover { color: var(--olive-dark); text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; min-height: 42px; padding: 9px 16px; font-size: .91rem; line-height: 1.25; font-weight: 700; text-align: center; text-decoration: none; transition: background .18s, color .18s, border-color .18s; }
.button-primary { color: #fffdf6; background: var(--olive); }
.button-primary:hover { background: var(--olive-dark); }
.button-secondary { color: var(--olive-dark); background: transparent; border-color: #c6c8b8; }
.button-secondary:hover, .button-ghost:hover { background: var(--olive-soft); }
.button-ghost { color: var(--olive-dark); background: transparent; }
.button-danger { color: #792e37; border-color: #dfbfc2; background: #fff9f8; }
.button-danger:hover { background: #f9e4e4; }
.button:disabled, .button[aria-disabled="true"] { color: #656659; border-color: var(--line); background: #f0efe7; }
.header-create { white-space: nowrap; }

#app { min-height: 61vh; width: min(1260px, calc(100% - 96px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 45% 55%; overflow: hidden; border-radius: var(--radius); margin: 36px 0 54px; background: #efede2; min-height: clamp(305px, 28vw, 410px); }
.hero-content { grid-column: 1; grid-row: 1; align-self: center; padding: clamp(28px, 4.4vw, 66px); }
.hero-image { grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-height: 0; display: block; overflow: hidden; background: #c2bc9c; object-fit: cover; object-position: center 54%; }
.hero-image img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 54%; }
.hero-kicker { margin-bottom: 15px; color: var(--plum); font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { color: var(--olive-dark); font-size: clamp(40px, 4.55vw, 70px); line-height: 1.02; letter-spacing: -.06em; }
.hero-note { max-width: 36ch; margin-top: 20px; color: #555748; font-size: 1rem; }
.hero-details { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; font-size: .88rem; color: var(--olive); font-weight: 700; }
.hero-details:empty { display: none; }
.hero-date, .hero-details > span { display: inline-flex; gap: 7px; align-items: center; }
.hero-details button { margin-right: 6px; }

.list-section { margin-bottom: 74px; }
.section-top { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 23px; }
.section-top h2, .portal h1 { font-size: clamp(32px, 3.3vw, 48px); letter-spacing: -.045em; color: var(--olive-dark); }
.list-intro p, .section-top > p { color: var(--muted); margin-top: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.filter-chip { padding: 7px 14px; min-height: 38px; border-radius: 40px; background: transparent; border: 1px solid #d7d6c8; color: var(--olive-dark); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.filter-chip:hover { background: #edeee4; }
.filter-chip.is-active, .filter-chip[aria-pressed="true"] { color: #fffdf6; background: var(--olive); border-color: var(--olive); }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.gift-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gift-media { position: relative; overflow: hidden; display: block; width: 100%; aspect-ratio: 1.75; background: #ddd9c9; }
.gift-media img, .gift-media picture { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 52%; }
.gift-placeholder { height: 100%; display: grid; place-items: center; color: #6b7455; background: #e4e7d6; }
.gift-placeholder .icon { width: 44px; height: 44px; stroke-width: 1; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 40px; padding: 5px 9px; color: #36402b; background: #e5eadb; font-size: .8rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.gift-media .status-pill { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 8px #25251b18; }
.status-pill.is-reserved, .status-pill.is-pending { color: #644c30; background: #f3ead6; }
.status-pill.is-completed, .status-pill.is-declined, .status-pill.is-cancelled { color: #6f4252; background: #f0e4e9; }
.gift-body { display: flex; flex-direction: column; flex: 1; padding: 17px 19px 19px; gap: 9px; }
.gift-category { color: var(--plum); font-weight: 700; font-size: .8rem; letter-spacing: .075em; text-transform: uppercase; }
.gift-body h3 { font: 600 23px/1.17 var(--serif); color: var(--olive-dark); }
.gift-description { color: var(--muted); font-size: .9rem; }
.gift-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; align-content: start; gap: 6px 12px; padding-top: 6px; color: var(--muted); font-size: .87rem; }
.gift-price { font-weight: 700; color: var(--olive-dark); }
.card-action { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 5px; }
.card-action .button, .button.card-action { width: 100%; }
.empty-state, .loading { border: 1px dashed #cfcbbd; border-radius: 14px; color: var(--muted); padding: 28px; text-align: center; }
.loading { margin: 36px auto; }

.portal { max-width: 980px; margin: 46px auto 70px; }
.portal-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.portal-header p { color: var(--muted); margin-top: 8px; max-width: 64ch; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(16px, 3vw, 28px); }
.panel h2 { font-size: 26px; color: var(--olive-dark); margin-bottom: 12px; }
.panel p { color: var(--muted); }
.stack { display: grid; gap: 13px; }
.notice, .address-box { color: var(--olive-dark); background: #eef0e4; border: 1px solid #dbdfce; border-radius: 9px; padding: 12px 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.notice.is-error, .form-error:not(:empty) { color: #822d36; background: #fff1f0; border-radius: 8px; padding: 10px; }
.link-row, .reservation-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.reservation-row p { margin-top: 3px; }
.reservation-row:last-child, .link-row:last-child { border-bottom: 0; }
.link-row input { flex: 1 1 180px; min-width: 0; }

dialog { width: min(610px, calc(100% - 30px)); max-height: calc(100dvh - 28px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 70px #25251b35; }
dialog::backdrop { background: #2b302593; backdrop-filter: blur(3px); }
.dialog-body { padding: clamp(18px, 4.6vw, 32px); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 13px; margin-bottom: 17px; }
.dialog-header h2 { color: var(--olive-dark); font-size: clamp(27px, 5vw, 36px); }
.dialog-header p { color: var(--muted); margin-top: 7px; }
.dialog-close { min-width: 38px; min-height: 38px; padding: 4px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--olive-dark); background: var(--paper); line-height: 1; }
.dialog-close:hover { background: var(--olive-soft); }
.form-grid, .alternative-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.alternative-rows { grid-template-columns: 1fr; }
.field { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: .9rem; font-weight: 700; }
.field > span, .field small, .check-field small { color: var(--muted); }
.field:has(textarea), .field-wide { grid-column: 1 / -1; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: #fffefb; border: 1px solid #d8d5c8; border-radius: 7px; font-weight: 400; font-size: 1rem; }
select { appearance: none; padding-right: 28px; background: #fffefb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none' stroke='%23444f36' stroke-width='1.6'%3E%3Cpath d='m5 7 5 5 5-5'/%3E%3C/svg%3E") right 9px center no-repeat; }
textarea { min-height: 78px; resize: vertical; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { margin-bottom: 6px; padding: 0; font-weight: 700; font-size: .93rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--olive); width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
.check-field { display: flex; align-items: flex-start; gap: 9px; }
.check-field input { margin-top: 4px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-card { display: flex; gap: 8px; align-items: center; padding: 10px; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .9rem; }
.choice-card:has(input:checked) { background: #f0f1e8; border-color: #91997d; }
.choice-card:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.alternative-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.form-error { color: #822d36; font-size: .9rem; }
.toast:empty { display: none; }
.toast { position: fixed; z-index: 5; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 12px 16px; color: #fffdf6; background: var(--olive-dark); border: 1px solid #637158; border-radius: 9px; box-shadow: 0 7px 20px #26261a24; font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 84px; }
.footer-inner .wordmark { font-size: 22px; }
.footer-inner .brand-icon { width: 30px; height: 30px; }
.footer-inner .brand-icon .icon { width: 16px; height: 16px; }

@media (max-width: 1050px) {
  .header-inner, .footer-inner, #app { width: calc(100% - 56px); }
  .gift-grid { gap: 16px; }
  .gift-body { padding: 15px; }
}
@media (max-width: 760px) {
  .header-inner, .footer-inner, #app { width: calc(100% - 32px); }
  .header-inner { min-height: 65px; gap: 10px 18px; flex-wrap: wrap; padding: 12px 0 10px; }
  .site-nav { order: 3; justify-content: flex-start; flex-basis: 100%; margin: 0; gap: 21px; }
  .site-nav a, .footer-inner > a:last-child { font-size: .88rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; margin: 20px 0 35px; }
  .hero-image { grid-column: 1; grid-row: 2; aspect-ratio: 1.85; }
  .hero-content { padding: 29px 23px; }
  .hero-kicker { margin-bottom: 10px; }
  .hero h1 { font-size: clamp(39px, 8.1vw, 58px); }
  .hero-note { margin-top: 13px; }
  .section-top { margin-bottom: 16px; }
  .filter-row { margin-bottom: 16px; }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-grid { grid-template-columns: 1fr; }
  .portal { margin: 29px auto 45px; }
}
@media (max-width: 440px) {
  .wordmark { font-size: 23px; gap: 7px; }
  .brand-icon { width: 33px; height: 33px; }
  .header-create { font-size: .86rem; padding-inline: 11px; }
  .gift-grid { grid-template-columns: minmax(0, 1fr); }
  .gift-media { aspect-ratio: 1.88; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
