:root {
  --paper: #f8f9f6;
  --ink: #283c32;
  --green: #315d48;
  --muted: #637261;
  --line: #dde3d9;
  --sage: #edf1e9;
  --red: #913b36;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #a07d2b;
  outline-offset: 4px;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid #6c927b;
  outline-offset: 1px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 32px; line-height: 1.25; margin-bottom: 14px; }
h2 { font-size: 21px; line-height: 1.4; }
h3 { font-size: 16px; }

.site-header, main, .site-footer {
  width: min(100% - 48px, 820px);
  margin-inline: auto;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; font-size: 20px; font-weight: 700; }
.header-note { font-size: 13px; color: var(--muted); }
.hero, .manage-header { padding-block: 34px 12px; }
.hero p, .manage-header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 650px;
}
.workspace { display: grid; gap: 22px; margin-bottom: 36px; }
.form-card, .manage-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.card-heading h2 { margin: 0; }
.step-pill, .count-pill {
  border-radius: 20px;
  background: var(--sage);
  color: #4e6549;
  padding: 7px 11px;
  font-size: 12px;
  white-space: nowrap;
}
.form-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 25px;
  margin-bottom: 25px;
}
.form-section h3 { display: flex; align-items: center; gap: 10px; }
.section-number {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: var(--sage);
  border-radius: 50%;
  color: #4e6549;
  font-size: 11px;
  font-weight: 400;
}
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.optional { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 5px; }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #cdd7c7;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 14px;
}
input::placeholder, textarea::placeholder { color: #717c6d; }
textarea { resize: vertical; line-height: 1.6; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 95px; }
.input-suffix > span {
  position: absolute;
  right: 12px;
  top: 15px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-heading h3 { margin-bottom: 8px; }
.field-hint { font-size: 13px; line-height: 1.65; color: var(--muted); margin-bottom: 17px; }
.small { font-size: 12px; margin: 10px 0 0; }
.participant-row {
  display: grid;
  grid-template-columns: 23px minmax(0, .85fr) minmax(0, 1.2fr) 30px;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}
.person-number { font-size: 12px; text-align: center; color: var(--muted); }
.icon-button { min-height: 44px; border: 0; background: transparent; font-size: 24px; color: var(--muted); }
.icon-button:hover { color: var(--red); }
.add-button {
  margin-top: 4px;
  width: 100%;
  min-height: 44px;
  border: 1px dashed #aebfa3;
  border-radius: 6px;
  background: #fbfcf8;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}
.add-button:hover { background: var(--sage); }
.add-button span { margin-right: 5px; }
.exclusion-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.exclude-arrow { text-align: center; color: var(--muted); }
.secondary-button, .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 15px;
  border: 1px solid #c8d4c2;
  border-radius: 6px;
  background: white;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.secondary-button:hover { background: var(--sage); }
.exclusion-list, #exclusions { display: flex; flex-wrap: wrap; gap: 8px; }
.exclusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d1ddc9;
  background: #f6f8f0;
  border-radius: 20px;
  font-size: 12px;
  padding: 6px 12px;
  margin-bottom: 12px;
}
.exclusion-chip button {
  border: 0;
  background: none;
  color: #52694b;
  font-size: 20px;
  min-height: 30px;
  padding: 0 5px;
}
.inline-error { font-size: 13px; color: var(--red); margin: 10px 0 0; }
.inline-error:empty { display: none; }
.last-section { border: 0; margin: 0; padding: 0; }
.last-section > .field-hint { margin-top: 9px; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
.checkbox-label input {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 1px 0 0;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 13px 20px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.primary-button:hover { background: #254a38; }
.create-button { width: 100%; }
.submit-note { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.recover-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 28px;
  background: white;
  font-size: 13px;
  color: var(--muted);
}
.recover-card summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.recover-card p { line-height: 1.6; margin-top: 16px; }
.recover-card form { max-width: 400px; }
.recover-card input { margin-bottom: 12px; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.notice {
  border: 1px solid #d0ddc7;
  border-radius: 7px;
  padding: 14px 16px;
  margin: 20px 0;
  background: #f1f5ed;
  color: #4c6644;
  font-size: 13px;
  line-height: 1.7;
}
.notice.error { background: #fff1ed; border-color: #e8b7ae; color: #8c3631; }
.notice.warning { background: #fff8e6; border-color: #e7d7a8; color: #76602e; }
.notice.success { background: #edf5ed; color: #3e6641; }
.message-card {
  max-width: 700px;
  margin: 40px auto 60px;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.message-card p { font-size: 14px; line-height: 1.8; color: var(--muted); }
.message-card .field-hint { font-size: 13px; }
.message-card .text-link { display: block; font-size: 13px; margin-top: 18px; }
.privacy-page h2 { font-size: 18px; margin-top: 28px; }
.manage-card { margin-bottom: 40px; }
.manage-card .card-heading { margin-bottom: 20px; }
.draw-details { font-size: 13px; color: var(--muted); }
.organizer-note {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--sage);
  padding: 16px;
  border-radius: 6px;
}
.table-scroll { overflow-x: auto; margin: 22px 0; }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
td, th { padding: 14px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
td:nth-child(2) { color: var(--muted); }
.delivery-status {
  display: inline-block;
  border-radius: 20px;
  background: var(--sage);
  padding: 6px 9px;
  font-size: 12px;
}
.status-failed, .status-uncertain { background: #fff1e9; color: #8d492d; }
.status-sent { background: #e9f2e6; color: #48683c; }
.delivery-error { font-size: 12px; color: #8d492d; margin: 8px 0 0; max-width: 220px; }
.manage-card h3 { font-size: 15px; margin-top: 24px; }
.retry-form, .delete-section { border-top: 1px solid var(--line); margin-top: 24px; }
.delete-section { padding-top: 24px; font-size: 13px; color: #77685a; }
.delete-section summary { cursor: pointer; }
.delete-section p { line-height: 1.7; margin-top: 15px; }
.danger-button { border-color: #e5c3ba; color: #963f31; background: #fff9f6; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link { position: absolute; left: 20px; top: -60px; background: var(--green); color: white; padding: 15px; z-index: 10; }
.skip-link:focus { top: 10px; }
.hidden { display: none; }

@media (max-width: 600px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { padding-block: 20px; }
  .brand { font-size: 18px; }
  h1 { font-size: 27px; }
  .hero, .manage-header { padding-block: 26px 10px; }
  .form-card, .manage-card { padding: 22px 16px; }
  .two-columns { gap: 12px; }
  input:not([type="checkbox"]), select, textarea { font-size: 16px; }
  .participant-row { grid-template-columns: 19px minmax(0, 1fr) 30px; gap: 7px; margin-bottom: 17px; }
  .participant-row > div:nth-child(3) { grid-column: 2; grid-row: auto; }
  .participant-row > .remove-person { grid-column: 3; grid-row: 1 / span 2; }
  .participant-row > .person-number { grid-row: 1 / span 2; }
  .exclusion-builder { grid-template-columns: minmax(0, 1fr) 15px minmax(0, 1fr); }
  .exclusion-builder > button { grid-column: 1 / -1; width: 100%; }
  .form-section h3 { flex-wrap: wrap; }
  .recover-card { padding: 20px 16px; }
  .message-card { margin-block: 28px 40px; padding: 24px 18px; }
  .card-heading { flex-wrap: wrap; }
  .manage-card .primary-button { width: 100%; }
  td, th { padding-left: 4px; padding-right: 8px; }
  .site-footer { flex-wrap: wrap; gap: 12px; }
}
