:root {
  --ink: #27221f;
  --muted: #746a64;
  --paper: #fffdf8;
  --cream: #f5efe4;
  --red: #b64032;
  --red-dark: #8d2e25;
  --green: #214e3f;
  --green-soft: #dfeae4;
  --gold: #dda94b;
  --line: #ded4c7;
  --shadow: 0 18px 55px rgba(76, 55, 40, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(221, 169, 75, 0.17), transparent 31rem),
    radial-gradient(circle at 100% 20%, rgba(33, 78, 63, 0.12), transparent 28rem),
    var(--cream);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='none' stroke='%23bda991' stroke-width='.7' opacity='.3'%3E%3Cpath d='M8 16h8M12 12v8M72 62h10M77 57v10M45 4v6M42 7h6'/%3E%3C/g%3E%3C/svg%3E");
}

a { color: var(--green); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.22rem;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 45% 55%;
  color: #fff;
  background: var(--red);
  transform: rotate(-7deg);
  box-shadow: 0 5px 0 #802b22;
}
.header-link { text-decoration: none; font-size: .9rem; font-weight: 700; }

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
  position: relative;
  z-index: 1;
}
.page.narrow { width: min(760px, calc(100% - 32px)); }
.hero {
  min-height: calc(100vh - 130px);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(35px, 7vw, 100px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.05; margin-top: 0; }
h1 { font-size: clamp(3rem, 7vw, 6.2rem); letter-spacing: -.055em; margin: 18px 0 22px; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.035em; margin-bottom: 12px; }
h3 { font-size: 1.35rem; margin-bottom: 10px; }
.lead { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.65; max-width: 620px; }
.hero-art { position: relative; min-height: 440px; display: grid; place-items: center; }
.envelope {
  width: min(410px, 90%);
  aspect-ratio: 1.35;
  border-radius: 10px;
  background: #f4e1c5;
  position: relative;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
  overflow: hidden;
}
.envelope::before, .envelope::after { content: ""; position: absolute; inset: 0; }
.envelope::before { clip-path: polygon(0 0, 50% 58%, 100% 0); background: #e8cda8; }
.envelope::after { clip-path: polygon(0 100%, 0 28%, 50% 66%, 100% 28%, 100% 100%); background: #f8e9d2; }
.seal {
  position: absolute; z-index: 2; width: 82px; height: 82px; border-radius: 50%;
  display: grid; place-items: center; color: #f5dcc1; font-family: Georgia, serif; font-size: 2rem;
  background: var(--red); box-shadow: inset 0 0 0 5px rgba(255,255,255,.12), 0 6px 14px rgba(97,34,27,.3);
}
.spark { position: absolute; color: var(--gold); font-size: 2rem; }
.spark.one { top: 8%; left: 5%; }.spark.two { bottom: 10%; right: 2%; }.spark.three { top: 20%; right: 10%; font-size: 1rem; }

.card {
  background: rgba(255, 253, 248, .94);
  border: 1px solid rgba(222, 212, 199, .85);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 22px; }
.form-grid { display: grid; gap: 18px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 8px; color: #504842; font-size: .88rem; font-weight: 750; }
input, textarea, select {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33,78,63,.12); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .16s, background .16s;
}
.button:hover { transform: translateY(-1px); background: #163b2f; }
.button.red { background: var(--red); }.button.red:hover { background: var(--red-dark); }
.button.secondary { color: var(--green); background: var(--green-soft); }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.danger { color: var(--red-dark); background: #f7e4e0; }
.button.small { padding: 8px 12px; font-size: .8rem; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.muted { color: var(--muted); }
.small-text { font-size: .84rem; line-height: 1.5; }
.hidden { display: none !important; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: .9rem; line-height: 1.45; }
.notice.error { color: #77251e; background: #f7dfda; border: 1px solid #eac1b8; }
.notice.success { color: #174333; background: var(--green-soft); border: 1px solid #bed4c9; }
.notice.info { color: #5c4515; background: #fbefcf; border: 1px solid #ead498; }

.dashboard-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 28px; }
.dashboard-head h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); margin-bottom: 5px; }
.dashboard-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 20px; }
.event-list { display: grid; gap: 8px; margin: 18px 0; }
.event-choice { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; color: var(--ink); }
.event-choice.active { border-color: var(--green); background: var(--green-soft); }
.event-choice strong, .event-choice span { display: block; }
.event-choice span { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-head h2, .section-head h3 { margin-bottom: 4px; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status.draft { color: #72551a; background: #f8e8bb; }
.status.active { color: #174333; background: var(--green-soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 24px; }
.stat { padding: 14px; border-radius: 14px; background: #f7f1e7; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.55rem; }
.stat span { color: var(--muted); font-size: .75rem; }
.link-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 7px 7px 7px 12px; background: #fff; }
.link-box code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 12px 9px; text-align: left; border-bottom: 1px solid #e9e0d5; vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: #b7afa8; }
.dot.ok { background: #358362; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.restriction-form { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: end; gap: 10px; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.divider { height: 1px; background: var(--line); margin: 26px 0; }

.reveal-card { text-align: center; overflow: hidden; position: relative; }
.reveal-card::after { content: "✦"; position: absolute; font-size: 12rem; right: -30px; bottom: -80px; color: rgba(221,169,75,.12); }
.result-name { font-family: Georgia, serif; color: var(--red); font-size: clamp(2.4rem, 8vw, 5rem); line-height: 1; margin: 16px 0; }
.gift-details { position: relative; z-index: 1; text-align: left; margin-top: 26px; padding: 20px; background: #f8f2e8; border-radius: 16px; }
.gift-details p { white-space: pre-wrap; line-height: 1.55; }
.warning-strip { border-left: 4px solid var(--gold); padding: 10px 14px; background: #fff7df; border-radius: 0 10px 10px 0; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 24px; }
.person-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 8px 26px rgba(76,55,40,.07); }
.person-card.pending { opacity: .68; border-style: dashed; }
.person-card h3 { color: var(--green); }
.sizes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.size-pill { background: var(--green-soft); color: var(--green); padding: 6px 9px; border-radius: 999px; font-size: .75rem; font-weight: 750; }
.suggestion-text { white-space: pre-wrap; line-height: 1.55; color: #514943; }
.login-shell { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login-shell .card { width: min(460px, 100%); }

.toast { position: fixed; z-index: 20; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 17px; font-size: .85rem; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; padding-top: 30px; }
  .hero-art { min-height: 330px; order: -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .restriction-form { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  .page, .site-header { width: min(100% - 22px, 1180px); }
  .site-header { padding-top: 16px; }
  .hero-art { min-height: 260px; }
  .card { border-radius: 17px; }
  .two-columns, .stats { grid-template-columns: 1fr; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .inline-form { grid-template-columns: 1fr; }
  .button { width: 100%; }
  td .button { width: auto; }
  h1 { font-size: 3.3rem; }
}
