body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 24px 16px;
  color: #222;
  background: #fafafa;
}

main.narrow {
  max-width: 480px;
  margin: 0 auto;
}

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
}

label.inline {
  display: inline-block;
  margin-right: 20px;
  font-weight: normal;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 4px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}

legend {
  font-weight: 600;
  margin-bottom: 6px;
}

.hint {
  color: #666;
  margin-top: 0;
}

.error {
  color: #b00020;
}

button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  background: #333;
  color: white;
  cursor: pointer;
}

/* --- Organizer page --- */

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.count {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 16px;
  /* Same width for every box, so the Total and Confirmed rows line up. */
  width: 215px;
  box-sizing: border-box;
}

.count .number {
  display: block;
  font-size: 28px;
  font-weight: 700;
}

/* The page scrolls as a whole: the tabs stick to the top of the window
   and the column titles stick just below them (organizer.js measures the
   tabs' height into --toolbar-height). */
.table-wrap {
  margin-top: 0;
}

th {
  position: sticky;
  /* Tuck 2px under the tabs bar (which sits on top), so no sliver of the rows
     shows between the tabs and the column titles while scrolling. */
  top: calc(var(--toolbar-height, 2px) - 2px);
  z-index: 1;
  /* Sticky cells leave their shared table borders behind, so draw the title
     row's lines with shadows, which move with it. */
  box-shadow: inset 0 -1px 0 #ddd, inset 0 1px 0 #ddd;
}

/* --- Tabs and "Hide paid" --- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 8px;
  border-bottom: 2px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafafa;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tabs a {
  padding: 8px 10px;
  border-radius: 6px 6px 0 0;
  color: #444;
  text-decoration: none;
  font-weight: 600;
}

.tabs a:hover {
  background: #eee;
}

.tabs a.active {
  background: #333;
  color: white;
}

.toolbar label.inline {
  margin: 0 0 6px;
}

body.hide-paid tr.paid {
  display: none;
}

table {
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}

th,
td {
  border: 1px solid #ddd;
  padding: 6px 7px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f0f0f0;
}

td.box {
  text-align: center;
}

td.box input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Row colours: pastel yellow once the registration email is sent,
   soft green once paid. */
tr.emailed td {
  background: #fff6d5;
}

/* Payment clock: soft orange when the time to pay is nearly up,
   soft red once it has passed. (Green, below, still wins once paid.) */
tr.due-soon td {
  background: #ffe2c2;
}

tr.overdue td {
  background: #ffd6d6;
}

tr.paid td,
tr td.paid {
  background: #dff3e6;
}

/* "Paid Dancers" sits apart from the Confirmed counts. */
.count.separate {
  margin: 0 12px;
  border-style: dashed;
}

/* Small notes just under a form field. */
.field-note {
  margin: -10px 0 16px;
  font-size: 14px;
}

/* --- Send list: a bar along the bottom of the window --- */

.send-list {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 10px 16px;
  background: white;
  border-top: 2px solid #6b9bd2;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

/* display: flex above would otherwise override the hidden attribute. */
.send-list[hidden] {
  display: none;
}

/* Room at the bottom of the page so the bar never covers the last rows. */
body.has-send-list {
  padding-bottom: 110px;
}

.send-text p {
  margin: 0;
}

#send-summary {
  font-weight: 600;
}

.send-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.send-buttons button {
  padding: 8px 14px;
  font-size: 14px;
}

#send-note:empty,
#send-warning:empty {
  display: none;
}

#send-warning {
  font-weight: 600;
}

/* A soft blue edge on rows that are in the send list. */
tr.selected td:first-child {
  box-shadow: inset 4px 0 0 #6b9bd2;
}

.tab-selected {
  font-weight: normal;
}

button.secondary {
  background: white;
  color: #333;
  border: 1px solid #333;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#copy-fallback {
  width: 100%;
  font-size: 13px;
}

/* The Pay by column: the deadline, or "Overdue by …". */
td.pay-by {
  font-size: 13px;
  line-height: 1.35;
}

tr.overdue td.pay-by {
  color: #a3001b;
  font-weight: 600;
}

/* --- Capacity panel --- */

.capacity {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  max-width: 900px;
}

.capacity table {
  background: none;
  font-size: 15px;
  width: 100%;
}

.capacity th,
.capacity td {
  border: none;
  background: none;
  padding: 4px 10px 4px 0;
  position: static;  /* the column titles of the long lists stick; these shouldn't */
  box-shadow: none;  /* nor do they get the lists' title lines */
}

.capacity thead th {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.capacity thead th:first-child {
  font-size: 15px;
  color: #222;
}

.capacity td.left {
  font-weight: 700;
}

.bar {
  width: 220px;
  height: 14px;
  border-radius: 7px;
  background: #eee;
  display: flex;
  overflow: hidden;
}

.bar-paid {
  background: #6dbb8a;
}

.bar-awaiting {
  background: #f2d675;
}

/* Nearly full: orange; full or over: red. */
.capacity tr.nearly-full .bar-paid {
  background: #f0a35e;
}

.capacity tr.nearly-full td.left {
  color: #c25e00;
}

.capacity tr.full .bar-paid {
  background: #e06666;
}

.capacity tr.full td.left,
.capacity tr.full td:nth-child(3) {
  color: #a3001b;
}

.capacity .balance {
  margin: 8px 0 0;
  color: #444;
}

/* --- Title row and Overview --- */

.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.page-title a {
  color: #444;
  font-weight: 600;
  text-decoration: none;
}

.page-title a:hover {
  text-decoration: underline;
}

.overview summary {
  cursor: pointer;
  margin-bottom: 10px;
}

.overview-title {
  font-weight: 700;
  font-size: 18px;
}

/* The one-line summary only shows while the Overview is folded. */
#overview-line {
  color: #444;
  margin-left: 8px;
}

.overview[open] #overview-line {
  display: none;
}

.overview .hint {
  margin-bottom: 0;
}

/* Keep wide lists (especially Couples) within a laptop screen: long column
   titles and the Pay by text wrap onto two lines instead of widening the table. */
th {
  white-space: normal;
  vertical-align: bottom;
}

td.pay-by {
  white-space: normal;
  min-width: 80px;
  max-width: 130px;
}

/* --- Search --- */

.toolbar-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

#search {
  width: 150px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
}

/* Rows that don't match the search are hidden... */
tr.no-match {
  display: none;
}

/* ...and while searching, paid people show even with "Hide paid" on,
   since you're often searching to tick Paid. */
body.searching.hide-paid tr.paid:not(.no-match) {
  display: table-row;
}

.tab-found {
  font-weight: normal;
}

.toolbar-tools label.inline {
  margin: 0;
}

/* While searching, tabs with no matches are greyed out. */
.tabs a.no-results {
  opacity: 0.4;
}

#search-empty {
  margin: 16px 0;
  font-size: 16px;
}

/* --- Possible duplicates box and Removed tab --- */

.duplicates {
  background: #fff8e6;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  padding: 10px 16px;
  margin-top: 12px;
}

.duplicates summary {
  cursor: pointer;
  font-weight: 700;
}

.duplicates > .hint {
  margin: 6px 0 0;
}

.dup-group {
  margin-top: 12px;
}

.dup-label {
  margin: 0 0 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dup-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dup-group li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid #f3dca8;
}

.dup-group .hint {
  font-size: 13px;
}

.suggested {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #dff3e6;
  font-size: 12px;
}

.duplicates button,
button.small {
  padding: 5px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.tabs a.removed-tab {
  color: #888;
  font-weight: normal;
}

/* --- Edit registration --- */

/* Names in the lists open the Edit page. */
a.name-link {
  color: inherit;
  text-decoration: none;
}

a.name-link:hover {
  color: #1a5fb4;
  text-decoration: underline;
}

/* The couple hint is for people signing up, not for the organizer editing. */
body.editing .couple-hint {
  display: none;
}

.notice {
  background: #fff8e6;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.notice form {
  display: inline;
  margin-left: 8px;
}

.cancel-box {
  margin-top: 28px;
  border-top: 1px solid #ddd;
  padding-top: 14px;
}

.cancel-box summary {
  cursor: pointer;
  color: #a3001b;
  font-weight: 600;
}

.cancel-box form {
  margin-top: 12px;
}

button.danger {
  background: #b00020;
}

.history {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.history li {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.history .when {
  display: inline-block;
  min-width: 130px;
  color: #666;
}

/* --- Waiting only (not emailed yet = the waitlist) --- */

/* Hide everyone already emailed; this also wins over the search showing
   paid people while Hide paid is on. */
body.waiting-only tr.sent,
body.waiting-only.searching.hide-paid tr.sent {
  display: none;
}

.waiting-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 12px;
  margin: 8px 0;
  background: #eef3fa;
  border: 1px solid #c9d8ec;
  border-radius: 6px;
  font-size: 14px;
}

/* display: flex above would otherwise override the hidden attribute. */
.waiting-bar[hidden] {
  display: none;
}

#waiting-summary {
  font-weight: 600;
}

#waiting-note:empty {
  display: none;
}

#waiting-fallback {
  flex-basis: 100%;
  font-size: 13px;
}

.capacity td.waiting {
  color: #1a5fb4;
  font-weight: 600;
}

/* --- Check-in list (printed for the door) --- */

.page-links {
  display: flex;
  gap: 20px;
}

body.checkin main {
  max-width: 900px;
  margin: 0 auto;
}

body.checkin .no-print {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkin-table {
  width: 100%;
  font-size: 14px;
  margin-bottom: 24px;
}

.checkin-table th {
  position: static;  /* no sticky titles here */
  box-shadow: none;
}

.checkin-table td {
  padding: 7px 8px;
}

.checkin-table td.who {
  font-weight: 600;
}

/* An empty square to tick with a pen. */
.checkin-table td.tick,
.checkin-table th.tick {
  width: 28px;
  text-align: center;
}

.checkin-table td.tick::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid #333;
  border-radius: 2px;
}

@media print {
  body.checkin {
    background: white;
    padding: 0;
  }

  .no-print {
    display: none !important;
  }

  .checkin-table {
    font-size: 11pt;
  }

  /* A little tighter on paper, so more people fit on each page. */
  .checkin-table td {
    padding: 4px 8px;
  }

  /* Keep each person on one page, and repeat the column titles on every page. */
  .checkin-table tr {
    break-inside: avoid;
  }

  .checkin-table thead {
    display: table-header-group;
  }

  h2 {
    break-after: avoid;
  }
}

/* --- Comped guests: soft purple --- */

tr.comp td,
tr td.comp {
  background: #ece6f7;
}

.comp-label {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: #7a5fb3;
  color: white;
  font-size: 11px;
  font-weight: 600;
}

/* "Waiting only" hides comped guests too: they aren't waiting. */
body.waiting-only tr.comp {
  display: none;
}

.comp-tick {
  display: block;
  margin: 4px 0 18px;
}

.count .number small {
  font-size: 14px;
  font-weight: 600;
  color: #7a5fb3;
}

/* --- Dietary restrictions and comments --- */

.optional {
  font-weight: normal;
  color: #666;
}

textarea[name="comments"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #bbb;
  border-radius: 4px;
}

/* Small marks next to a name when the person wrote something; hover to read. */
.note-mark {
  margin-left: 4px;
  cursor: help;
  font-size: 12px;
}

@media print {
  /* The dietary list starts on its own page, to hand to whoever does the food. */
  h2.page-break {
    break-before: page;
  }
}

/* --- Going online: spam trap, login, backups --- */

/* Off-screen, so people never see it; bots that fill it in get ignored. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 4px;
}

a.button-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  background: #333;
  color: white;
  text-decoration: none;
}

.restore-box {
  margin-top: 16px;
}

.restore-box summary {
  cursor: pointer;
  font-weight: 600;
  color: #444;
}

/* --- The public form, styled like the El Motivo Google Form --- */

body.gform {
  --accent: #9b5951;       /* the Google Form's dusty rose */
  --accent-soft: #ebdedc;
  --page: #f5eeee;
  background: var(--page);
  font-family: Roboto, Arial, sans-serif;
  color: #202124;
  padding: 12px 12px 48px;
}

/* Never let a layout rule un-hide a hidden question. */
body.gform [hidden] {
  display: none !important;
}

.gform-page {
  max-width: 770px;
  margin: 0 auto;
}

.gform .banner {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}

.gform .card {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 24px;
  margin: 0 0 12px;
  min-width: 0;
}

/* The title card's thick rose bar along the top, as on Google Forms. */
.gform .title-card {
  border-top: 10px solid var(--accent);
  padding-top: 22px;
}

.gform h1 {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 12px;
}

.gform .intro p {
  margin: 0 0 14px;
  line-height: 1.5;
  font-size: 14px;
}

.gform .required-note {
  margin: 16px -24px 0;
  padding: 12px 24px 0;
  border-top: 1px solid #dadce0;
  color: #d93025;
  font-size: 14px;
}

.gform .req {
  color: #d93025;
}

/* The questions: compact, like the earlier version of the form: labels
   above boxed inputs, options side by side, all in one white panel. */
.gform .form-card {
  padding: 24px 28px;
}

.gform .form-card label {
  font-weight: 500;
  font-size: 15px;
}

.gform .form-card label.inline {
  font-weight: 400;
}

.gform legend {
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 6px;
}

.gform .form-card input[type="text"],
.gform .form-card input[type="email"],
.gform .form-card input[type="tel"],
.gform .form-card textarea {
  font-family: inherit;
}

.gform textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 4px;
  resize: vertical;
}

.gform input:focus,
.gform textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.gform input[type="radio"],
.gform input[type="checkbox"] {
  accent-color: var(--accent);
}

.gform .field-note {
  margin: -10px 0 16px;
}

.gform .form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.gform .form-actions button[type="submit"] {
  background: var(--accent);
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 500;
}

.gform .clear-form {
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 8px;
}

/* The Edit / Add registration pages reuse the form: no banner or invitation. */
body.gform.editing .banner,
body.gform.editing .intro,
body.gform.editing .couple-hint {
  display: none;
}

body.gform.editing .title-card h1 {
  font-size: 28px;
}

body.gform .comp-tick {
  margin: 0 0 12px;
}

@media (max-width: 600px) {
  .gform .card,
  .gform .form-card {
    padding: 18px 16px;
  }

  .gform .required-note {
    margin: 16px -16px 0;
    padding: 12px 16px 0;
  }

  .gform h1 {
    font-size: 26px;
  }

}

/* No "Clear form" on the organizer's Edit / Add pages. */
body.gform.editing .clear-form {
  display: none;
}

/* The State or country box: a short answer, so it can be narrower. */
.gform input.state-box {
  max-width: 260px;
}

/* Hover bubble for the 🍽 / 💬 marks next to names: shows the dietary
   restriction or comment straight away (also when the mark is tabbed to). */
.note-mark {
  position: relative;
}

.note-mark:hover::after,
.note-mark:focus::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-20%);
  z-index: 5;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #3b2724;
  color: white;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* --- Cancellations and refunds --- */

.cancel-box fieldset {
  margin-bottom: 12px;
}

.gform input.amount-box {
  max-width: 140px;
}

.refund-summary {
  font-weight: 600;
  margin: 8px 0;
}

.notice form + form {
  margin-left: 6px;
}

/* --- Revenue panel (next to Capacity in the Overview) --- */

.overview-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.overview-panels .capacity {
  margin-bottom: 0;
}

.revenue {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
}

.revenue table {
  background: none;
  font-size: 15px;
}

.revenue th,
.revenue td {
  border: none;
  background: none;
  padding: 4px 14px 4px 0;
  position: static;
  box-shadow: none;
  white-space: nowrap;
}

.revenue thead th {
  font-size: 15px;
}

.revenue tr.net td {
  font-weight: 700;
  border-top: 1px solid #ddd;
}

/* Capacity and Revenue line up with the count boxes underneath: Capacity
   spans the first four boxes (Leaders to Volunteers / Staff, 4 x 215px wide
   with 12px gaps, plus the 12px space before the dashed box), and Revenue
   starts above Total Registrations (another 12px gap + 12px space). */
.overview-panels {
  gap: 24px;
}

.overview-panels .capacity {
  flex: 0 0 auto;
  width: calc(4 * 215px + 3 * 12px + 12px);
  max-width: 100%;
  box-sizing: border-box;
}

.overview-panels .revenue {
  min-width: 215px;
  box-sizing: border-box;
}

.overview-panels .capacity table {
  width: auto;
}

.overview-panels .capacity thead th {
  white-space: nowrap;
}

.overview-panels .revenue {
  flex: 0 0 auto;
}

/* The notes in brackets go on a small second line, keeping the Revenue
   panel narrow enough to sit beside Capacity on a laptop screen. */
.revenue td .hint {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}
