:root {
  --bg: #f8f7f3;
  --card: #ffffff;
  --text: #26322d;
  --muted: #68746d;
  --line: #e6e1d8;
  --primary: #447b65;
  --primary-strong: #2f634f;
  --soft: #f1eee7;
  --danger: #b84a4a;
  --shadow: 0 16px 42px rgba(43, 54, 49, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(240, 190, 115, .18), transparent 34rem),
    linear-gradient(180deg, #fbfaf7 0%, var(--bg) 22rem);
  color: var(--text);
  line-height: 1.5;
}
a { color: #356d59; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 850; text-decoration: none; font-size: 1.15rem; color: var(--text); }
.brand::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f0b26b, #5b9b80);
  vertical-align: -1px;
}
.small-link { font-size: .9rem; }
.page { width: min(1100px, 100%); margin: 0 auto; padding: 18px; }
h1, h2 { line-height: 1.15; margin: 0 0 14px; letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); font-size: .94rem; }
.eyebrow {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.narrow { max-width: 520px; margin-inline: auto; }
.intro-card {
  background: linear-gradient(135deg, #ffffff, #f5f0e7);
}
.event-card {
  border-top: 0;
  position: relative;
  overflow: hidden;
}
.event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--event-color, var(--primary));
}
.event-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.page-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-nav, .filters, .button-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  margin-bottom: 10px;
}
.admin-nav a, .filters a, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.admin-nav a:hover, .filters a:hover, .button:hover {
  transform: translateY(-1px);
  border-color: #cfc8bc;
}
.admin-nav a.active, .filters a.active, .button.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.button.primary:hover { background: var(--primary-strong); }
.danger-button {
  margin-top: 16px;
  background: #fff4f4;
  color: var(--danger);
  border-color: #efb9b9;
}
.button.full { width: 100%; min-height: 54px; font-size: 1.05rem; }
.form { display: grid; gap: 14px; }
.form.compact { gap: 10px; margin-top: 14px; }
label { display: grid; gap: 6px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d8d5cb;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid rgba(79, 143, 117, .18);
  border-color: var(--primary);
}
textarea { min-height: 94px; resize: vertical; }
.copy-text { min-height: 190px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.two, .three { display: grid; gap: 12px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin: 16px 0; }
.stats span { background: var(--soft); border-radius: 10px; padding: 11px; }
.stats small { display: block; color: var(--muted); font-size: .76rem; font-weight: 750; margin-bottom: 3px; }
.stats b { font-size: 1.08rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .88rem; }
tbody tr:hover { background: #fbfaf7; }
.actions { display: flex; gap: 8px; align-items: center; }
.link { border: 0; background: none; padding: 0; color: #356d59; text-decoration: underline; cursor: pointer; font: inherit; }
.danger { color: var(--danger); }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.good { background: #e7f4ee; color: #24624b; border-color: #b9decf; }
.chip.warn { background: #fff4d8; color: #79521b; border-color: #f0d394; }
.chip.bad { background: #fae7e7; color: #943838; border-color: #efb9b9; }
.chip.neutral { background: #eeeeea; color: #59635d; border-color: #d8d4ca; }
.flash, .error {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #e7f4ee;
  border: 1px solid #b9decf;
}
.error { background: #fae7e7; border-color: #efb9b9; }
.event-switcher { margin: 0 0 16px; }
.guest-hero {
  color: #fff;
  border-radius: 12px;
  padding: 28px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  background: var(--event-color);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--event-color) 82%, #222 18%), var(--event-color));
  display: grid;
  gap: 18px;
  overflow: hidden;
  position: relative;
}
.guest-hero::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 160px;
  height: 160px;
  border-radius: 28px;
  border: 24px solid rgba(255,255,255,.14);
  transform: rotate(16deg);
}
.guest-hero p { margin: 0 0 8px; font-weight: 700; }
.guest-hero h1 { max-width: 760px; margin-bottom: 8px; }
.hero-name { font-size: 1.2rem; opacity: .95; }
.hero-date {
  position: relative;
  z-index: 1;
  display: inline-grid;
  align-content: center;
  justify-items: center;
  width: fit-content;
  min-width: 138px;
  min-height: 92px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
}
.hero-date span { font-size: 1.25rem; font-weight: 850; }
.hero-date small { font-weight: 750; opacity: .92; }
.invitation-card { font-size: 1.03rem; }
.facts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 14px 0; }
.facts span, .list-row {
  background: var(--soft);
  border-radius: 10px;
  padding: 12px;
}
.facts small { display: block; color: var(--muted); font-weight: 800; font-size: .75rem; margin-bottom: 2px; }
.segmented { display: grid; grid-template-columns: 1fr; gap: 8px; }
.segmented input { display: none; }
.segmented span {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.segmented input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.list-row { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: center; margin-top: 10px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.section-title h2 { margin: 0; }
.section-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--event-color, var(--primary));
  box-shadow: 0 0 0 5px rgba(79, 143, 117, .12);
}
.timeline-item {
  border-left: 3px solid var(--primary);
  padding-left: 12px;
}
.save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  box-shadow: 0 14px 34px rgba(47, 99, 79, .24);
}
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #26322d;
  color: #fff;
  font-weight: 750;
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .two { grid-template-columns: repeat(2, 1fr); }
  .three { grid-template-columns: repeat(3, 1fr); }
  .segmented { grid-template-columns: repeat(3, 1fr); }
  .guest-hero { grid-template-columns: 1fr auto; align-items: end; padding: 38px; }
}

@media (max-width: 520px) {
  .page { padding: 14px; }
  .card { padding: 15px; }
  .page-head { align-items: stretch; flex-direction: column; }
  table { min-width: 650px; }
}
