:root {
  --ink: #12302A;
  --green: #0F5C45;
  --mint: #DDF3E8;
  --marigold: #F7B32B;
  --muted: #4B625B;
  --dashed: #6B8279;
  --tint: #3C544C;
  --error: #A32A1E;
  --display: 'Fredoka', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--green); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

h1, h2 { font-family: var(--display); margin: 0; }
h1 { font-weight: 700; line-height: 1.08; }
h2 { font-weight: 600; font-size: 23px; line-height: 1.15; }
p { margin: 0; }

.wrap { max-width: 1160px; margin: 0 auto; }
.narrow { max-width: 560px; margin: 0 auto; width: 100%; }
.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.optional { font-weight: 600; color: var(--muted); }
.error { font-size: 15px; font-weight: 700; color: var(--error); }

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #FFFFFF;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  text-decoration: none;
}
.logo:hover { color: #FFFFFF; }
/* The ring separates the icon's green from the green header behind it. */
.logo::before {
  content: '';
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: 9px;
  background: url('/favicon.svg') center / contain no-repeat;
  border-radius: 24%;
  box-shadow: 0 0 0 2px #FFFFFF;
}

/* Buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  background: var(--marigold);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}
.pill:hover { color: var(--ink); }
.pill-small { min-height: 44px; padding: 0 18px; font-size: 17px; }
.pill-wide { width: 100%; }
.pill-outline { background: transparent; color: #FFFFFF; border: 2px solid #FFFFFF; }
.pill-outline:hover { color: #FFFFFF; }
.pill-green { background: var(--green); color: #FFFFFF; min-height: 48px; font-size: 17px; }
.pill-green:hover { color: #FFFFFF; }

.text-button {
  min-height: 44px;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--green);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Home */
.site-header { background: var(--green); padding: 16px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-weight: 700; }
.bar nav a:not(.pill) { display: inline-flex; align-items: center; min-height: 44px; color: #FFFFFF; }
@media (max-width: 520px) {
  .bar nav:not(.admin-nav) a:not(.pill) { display: none; }
}

.hero { background: var(--green); color: #FFFFFF; padding: 32px 16px 64px; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-copy { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.04; }
.hero p { font-size: 20px; max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.sample {
  flex: 1 1 300px;
  min-width: 0;
  background: #FFFFFF;
  color: var(--ink);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sample-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.sample-head span { font-family: var(--display); font-weight: 700; font-size: 25px; }
.sample-head strong { color: var(--muted); white-space: nowrap; }

.section { padding: 56px 16px 24px; }
#how { padding-bottom: 64px; }
.section-title { font-weight: 700; font-size: 36px; line-height: 1.1; margin-bottom: 4px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 24px; }
.template {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 96px;
  padding: 16px 18px;
  background: var(--mint);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}
.template:hover { background: #CDEBDC; }
.template-name { font-family: var(--display); font-weight: 600; font-size: 21px; }
.template-detail { font-size: 15px; color: var(--tint); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.how-grid h2 { font-size: 25px; margin-bottom: 4px; }

.site-footer { background: var(--ink); color: #FFFFFF; padding: 20px 16px; font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: #FFFFFF; }
.footer-links a:hover { color: var(--mint); }
.footer-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.footer-line { margin: 0; font-size: 14px; color: #C9D9D2; }

/* Admin */
.admin-main { padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.admin-main h1 { font-size: 34px; overflow-wrap: anywhere; }
.admin-count { font-size: 20px; font-weight: 500; color: var(--muted); }
.admin-nav form { margin: 0; }
.admin-nav a[aria-current] { text-decoration-thickness: 3px; }
.admin-logout { min-height: 44px; padding: 0 4px; color: #FFFFFF; background: transparent; border: 0; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.admin-stat { display: flex; flex-direction: column; padding: 14px; background: var(--mint); border-radius: 14px; }
.admin-stat strong { font-family: var(--display); font-size: 32px; line-height: 1.1; }
.admin-stat span { font-size: 15px; color: var(--tint); }
.admin-search { display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.admin-search div { display: flex; gap: 8px; align-items: center; }
.admin-table { overflow-x: auto; border: 1px solid var(--dashed); border-radius: 12px; }
.admin-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #DDE7E2; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th { background: #F1F6F3; }
.admin-table input { min-width: 90px; min-height: 42px; padding: 0 8px; }
.admin-pager { display: flex; gap: 16px; align-items: center; }
.admin-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.admin-fields .field { flex: none; }
.admin-sheet > form, .admin-sheet > section { padding-top: 12px; border-top: 1px solid #DDE7E2; }
.admin-claim { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: #F1F6F3; border-radius: 12px; }
.admin-claim-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-claim-form input { flex: 1 1 180px; width: auto; }
.admin-danger { width: auto; padding: 0; color: var(--error); text-align: left; }
.admin-confirm { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.admin-confirm input { width: 20px; height: 20px; }

/* Search pages */
.article { max-width: 720px; margin: 0 auto; width: 100%; }
.guide-hero { background: var(--green); color: #FFFFFF; padding: 24px 16px 40px; }
.guide-hero h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: 12px; }
.guide-hero p { font-size: 19px; }
.guide-body { padding: 24px 16px 48px; }
.guide-grid { padding: 24px 16px 48px; }
.guide-grid .template-grid { margin-top: 0; }
h3 { margin: 10px 0 2px; font-size: 18px; line-height: 1.25; }
.guests-plain { background: #FFFFFF; }
.guests-plain label { flex: 1 1 auto; }
.guests-plain input[type='number'] { width: 88px; flex: none; text-align: center; font-weight: 700; }
.choice { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; border: 0; }
.choice legend { padding: 0; font-weight: 800; }
.choice label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.choice input { width: 20px; height: 20px; accent-color: var(--green); }
.calc-note { font-size: 15px; margin: 6px 0; }
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; margin: 0; padding: 0; list-style: none; }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

.legal h2 { margin: 30px 0 8px; }
.legal h3 { margin: 16px 0 4px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.form-note { text-align: center; }

.see-all { margin-top: 18px; font-weight: 800; }
.hub { display: flex; flex-direction: column; gap: 40px; }
.hub section { scroll-margin-top: 16px; }
.hub-jump { display: flex; flex-wrap: wrap; gap: 0 20px; }
.hub-jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.sample { margin: 0 0 14px; padding: 12px 14px; background: #F1F6F3; border-radius: 12px; white-space: pre-line; }
.article-cta { margin: 28px 0 8px; }
.article-cta h2 { margin: 0; }
.article-cta p { margin: 0; }

.print-sheet { max-width: 800px; margin: 0 auto; padding: 20px 16px 40px; }
.print-sheet h1 { font-size: 32px; margin-bottom: 8px; }
.print-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 28px; }
.print-line { margin-bottom: 14px; overflow-wrap: anywhere; }
.print-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.print-table th, .print-table td { height: 34px; padding: 4px 8px; border: 1px solid var(--dashed); text-align: left; overflow-wrap: anywhere; }
.print-table td:first-child { width: 34%; }
.print-group th { background: var(--mint); }
.print-foot { margin-top: 12px; font-size: 13px; color: var(--muted); }

@media print {
  .no-print { display: none; }
  body { font-size: 12pt; }
  .print-sheet { max-width: none; padding: 0; }
  .print-table tr { break-inside: avoid; }
  .print-group th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* App pages */
.page-header { background: var(--green); color: #FFFFFF; padding: 8px 16px 20px; }
.page-header .narrow { display: flex; flex-direction: column; gap: 4px; }
.page-header h1 { font-size: 34px; overflow-wrap: anywhere; }
.eyebrow { font-weight: 700; }
.badge {
  align-self: flex-start;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--marigold);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 800;
}

main.narrow { padding: 18px 16px 40px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-large { display: flex; flex-direction: column; gap: 22px; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 0; }
.field-row { display: flex; gap: 10px; }
label { font-weight: 800; }
input[type='text'], input[type='email'], input[type='date'], input[type='time'], input[type='number'], textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: #FFFFFF;
  border: 2px solid var(--dashed);
  border-radius: 12px;
  font: inherit;
}
textarea { padding: 10px 12px; resize: vertical; }
.trap { position: absolute; left: -9999px; height: 1px; overflow: hidden; }

.guests {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--mint);
  border-radius: 14px;
}
.guests > div:first-child { display: flex; flex-direction: column; }
.guests .hint { color: var(--tint); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input {
  width: 64px;
  padding: 0 4px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  appearance: textfield;
}
.stepper input::-webkit-inner-spin-button { appearance: none; }
.round {
  width: 44px;
  height: 44px;
  flex: none;
  background: var(--green);
  color: #FFFFFF;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.item-wrap { display: flex; flex-direction: column; gap: 2px; }
.item-claims { padding-left: 70px; }
.item-row { display: flex; align-items: center; gap: 6px; }
input.item-qty { flex: 0 0 64px; width: 64px; text-align: center; padding: 0 4px; }
input.item-name { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.remove {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.add-item {
  min-height: 48px;
  color: var(--green);
  background: #FFFFFF;
  border: 2px dashed var(--dashed);
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.row-taken { background: var(--mint); }
.row-open { border: 2px dashed var(--dashed); }
.row-end { display: flex; align-items: center; gap: 2px; flex: none; }
.open-label { font-weight: 800; color: var(--green); white-space: nowrap; }
.count { font-weight: 600; font-size: 15px; color: var(--muted); }

.claim { border: 2px dashed var(--dashed); border-radius: 12px; }
.claim[open] { border: 2px solid var(--green); }
.claim summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}
.claim summary::-webkit-details-marker { display: none; }
.claim form { padding: 4px 12px 12px; }
.claim .field { flex: none; }

.notice { padding: 12px 14px; background: #F1F6F3; border-radius: 12px; }
.notice-error { background: #FBE9E6; color: var(--error); font-weight: 700; }

.thanks, .panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--mint);
  border-radius: 16px;
}
.thanks h2 { font-size: 24px; }
.next-host, .preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  background: #FFFFFF;
  border-radius: 12px;
}
.next-host a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; }
.preview-label { font-size: 13px; font-weight: 800; color: var(--muted); }

.split { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.reminder-label { margin-top: 8px; }
.center-link { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 800; }
