:root {
  /* Warm-neutral surfaces with a muted dusty-blue accent. */
  --bg: #f4f3f0;
  --card: #ffffff;
  --ink: #2a2c31;
  --muted: #8a8e98;
  --faint: #b6bac2;
  --line: #ece9e3;
  --line-strong: #e0ddd5;
  --accent: #4d6783;
  --accent-ink: #3a4f67;
  --accent-soft: #eef1f5;
  /* Muted, slightly desaturated status hues — calmer than primary colors. */
  --yes: #5e8a73;
  --maybe: #c0974c;
  --no: #b56a60;

  --r: 14px;
  --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(31, 33, 40, 0.04);
  --shadow: 0 1px 3px rgba(31, 33, 40, 0.04),
    0 10px 24px -14px rgba(31, 33, 40, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 15.5px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover {
  color: var(--ink);
  text-decoration: none;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 1.4rem;
  align-items: center;
  font-size: 0.94rem;
}
.topbar nav a {
  color: var(--muted);
}
.topbar nav a:hover {
  color: var(--accent-ink);
  text-decoration: none;
}
.who {
  color: var(--ink);
  font-weight: 500;
}

/* ---- Layout ----------------------------------------------------------- */
.container {
  max-width: 1080px;
  margin: 2.5rem auto 4rem;
  padding: 0 2rem;
}

.container > * + * {
  margin-top: 1rem;
}

.flashes {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0.85rem 1.15rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--accent-ink);
  font-size: 0.94rem;
  box-shadow: var(--shadow);
}
.flashes li + li {
  margin-top: 0.35rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.85rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card > :first-child {
  margin-top: 0 !important;
}

.stack > * + * {
  margin-top: 2rem;
}

/* ---- Typography ------------------------------------------------------- */
h1 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 0.35rem;
}
h2 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.25rem 0 0.65rem;
}
h1 + .muted,
h1 + p {
  margin-top: 0;
}
.muted {
  color: var(--muted);
}
.help {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}
.tag {
  font-size: 0.8rem;
  color: var(--muted);
}
.save-status {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Forms ------------------------------------------------------------ */
label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 1.1rem 0 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
::placeholder {
  color: var(--faint);
}

.date-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.date-row input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
}
.date-row input[type="time"] {
  flex: 0 0 auto;
  width: auto;
}
.date-row .date-remove {
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem;
  line-height: 1;
  color: var(--muted);
}
.date-row .date-remove:hover {
  color: var(--no);
  border-color: var(--no);
  background: #fff;
}
#add-date {
  margin-top: 0.35rem;
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0.55rem 1.05rem;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.04s;
}
.btn:hover {
  background: var(--accent-ink);
  color: #fff;
  text-decoration: none;
}
.btn:active {
  transform: translateY(0.5px);
}
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: #d7dde6;
}
.btn.danger {
  background: var(--no);
}
.btn.danger:hover {
  background: #a05a51;
}

/* ---- Tables ----------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 0.7rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
thead th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
tbody tr:last-child td,
tbody tr:last-child th[scope="row"] {
  border-bottom: 0;
}
tbody tr:hover td,
tbody tr:hover th[scope="row"] {
  background: #faf9f6;
}

/* Horizontally scroll wide tables (e.g. the who-picked-what grid) rather
   than letting many date columns wrap and cram. The attendee column stays
   pinned so names remain visible while scrolling across dates. */
.table-scroll {
  overflow-x: auto;
}
.table-scroll th,
.table-scroll td {
  white-space: nowrap;
}
.table-scroll th:first-child,
.table-scroll td:first-child {
  position: sticky;
  left: 0;
  background: var(--card);
}
.table-scroll tbody tr:hover td:first-child {
  background: #faf9f6;
}

/* ---- Yes / maybe / no toggle ------------------------------------------ */
.choice {
  display: inline-flex;
  gap: 0.35rem;
}
.choice label {
  margin: 0;
  font-weight: 500;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  transition: all 0.12s;
}
.choice label:hover {
  border-color: var(--faint);
}
.choice input {
  position: absolute;
  opacity: 0;
}
.choice label:has(input[value="yes"]:checked) {
  background: var(--yes);
  color: #fff;
  border-color: var(--yes);
}
.choice label:has(input[value="maybe"]:checked) {
  background: var(--maybe);
  color: #fff;
  border-color: var(--maybe);
}
.choice label:has(input[value="no"]:checked) {
  background: var(--no);
  color: #fff;
  border-color: var(--no);
}
.choice label:has(input[value="blank"]:checked) {
  background: #eceae5;
  border-color: var(--line-strong);
}

/* ---- Pills & finalists ------------------------------------------------ */
.pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.pill.yes {
  background: #e6efe9;
  color: #436e57;
}
.pill.maybe {
  background: #f4ecdb;
  color: #836229;
}
.pill.no {
  background: #f2e2df;
  color: #8c4c43;
}
.pill.blank {
  background: #efede8;
  color: var(--muted);
}

.finalist {
  border-left: 3px solid var(--yes);
  padding-left: 0.9rem;
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.8rem 1.1rem;
  }
  .container {
    margin: 1.5rem auto 2.5rem;
    padding: 0 1.1rem;
  }
  .card {
    padding: 1.25rem 1.15rem;
  }
  .topbar nav {
    gap: 1rem;
  }
}
