:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #f0f4ef;
  --text: #1f2a28;
  --muted: #66706d;
  --line: #d8ded8;
  --primary: #256d5a;
  --primary-dark: #174b40;
  --accent: #2f6f9f;
  --warning: #a45f15;
  --danger: #a5352b;
  --success-bg: #e7f6ed;
  --error-bg: #fae8e5;
  --radius: 8px;
  --shadow: 0 16px 40px rgb(31 42 40 / 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

code {
  padding: 0.12rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f4f6f4;
  font-size: 0.94em;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgb(247 248 245 / 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}

.user {
  max-width: 34vw;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

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

.narrow {
  width: min(720px, 100%);
  margin: 4rem auto 0;
}

.hero {
  display: grid;
  min-height: 320px;
  align-items: center;
  padding: clamp(2rem, 8vw, 5rem) 0;
}

.hero-copy {
  width: min(780px, 100%);
}

.section {
  padding: 1rem 0;
}

.section-heading {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.45rem;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.block {
  display: block;
}

.right {
  text-align: right;
}

.actions,
.toolbar,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.button,
.text-button,
.icon-button {
  min-height: 46px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.icon {
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  stroke-width: 2.35;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.button.small {
  min-height: 38px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0;
  background: transparent;
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.danger-text {
  color: var(--danger);
}

.panel,
.card,
.trip-card,
.empty-state,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(1rem, 3vw, 1.4rem);
}

.card-list {
  display: grid;
  gap: 0.85rem;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.card h2 {
  margin-bottom: 0.2rem;
}

.empty-state,
.empty-row {
  padding: 1.2rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

label,
fieldset {
  min-width: 0;
}

label span,
.field-label,
legend {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

label small {
  color: var(--muted);
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  border: 1px solid #bdc8c1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
}

input:focus {
  outline: 3px solid rgb(47 111 159 / 0.24);
  outline-offset: 1px;
  border-color: var(--accent);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.date-picker {
  display: grid;
  gap: 1rem;
  padding-top: 0.5rem;
}

.date-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
}

.date-tools:has(label:nth-of-type(2)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.selected-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 46px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  font-weight: 700;
}

.date-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.notice {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.notice.success {
  border-color: #a9d8bb;
  background: var(--success-bg);
  color: #245d38;
}

.notice.error {
  border-color: #e7b4ad;
  background: var(--error-bg);
  color: #7d2d25;
}

.auth-options,
.setup-list {
  display: grid;
  gap: 0.8rem;
}

.auth-button {
  width: 100%;
}

.setup-list {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.setup-list div {
  display: grid;
  gap: 0.35rem;
}

.setup-list code {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.share-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.day-block {
  margin-top: 2rem;
}

.day-block > h2 {
  margin-bottom: 0.8rem;
  text-transform: capitalize;
}

.day-heading {
  display: block;
  margin-bottom: 0.85rem;
  border-bottom: 3px solid var(--primary);
}

.day-date {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "number weekday"
    "number month";
  column-gap: 0.75rem;
  align-items: center;
  min-width: 240px;
  padding: 0.8rem 1rem;
  border-radius: 7px 7px 0 0;
  background: var(--primary);
  color: #ffffff;
}

.day-number {
  grid-area: number;
  font-size: 3rem;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.day-weekday {
  grid-area: weekday;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.1;
}

.day-month {
  grid-area: month;
  font-size: 0.98rem;
  font-weight: 700;
  opacity: 0.9;
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.trip-card {
  padding: 1rem;
}

.trip-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.open {
  background: #e7f6ed;
  color: #245d38;
}

.pill.almost {
  background: #fff1dd;
  color: var(--warning);
}

.pill.full {
  background: #eeeeee;
  color: #666666;
}

.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.slot-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b7c5bd;
  border-radius: 7px;
  appearance: none;
  background: #ffffff;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.slot-button:hover {
  border-color: var(--primary);
  background: #eef8f3;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.slot-button:focus-visible {
  outline: 3px solid rgb(47 111 159 / 0.24);
  outline-offset: 2px;
}

.slot-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5f3ec;
  color: var(--primary);
  flex: 0 0 22px;
}

.slot-button span:last-child {
  min-width: 0;
}

.slot-button.full,
.slot-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.75;
}

.slot-button.full:hover,
.slot-button:disabled:hover {
  border-color: #d6ded8;
  background: #f6f7f5;
  box-shadow: none;
}

.slot-button.full .slot-icon,
.slot-button:disabled .slot-icon {
  background: #eeeeee;
  color: var(--muted);
}

.signup-list,
.public-names {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.signup-list li,
.public-names li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.public-names li > span:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.public-role {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.self-remove-form {
  margin: 0;
  flex: 0 0 auto;
}

.self-remove-button {
  min-height: 34px;
  color: var(--danger);
  font-size: 0.9rem;
}

.signup-list li div {
  display: grid;
  gap: 0.12rem;
}

.signup-list li span {
  color: var(--muted);
  font-size: 0.95rem;
}

.public-layout {
  display: block;
}

.public-main {
  min-width: 0;
}

.event-title {
  padding: 1rem 0;
}

.event-title h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.radio-line,
.check-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 42px;
  margin: 0;
  padding: 0.25rem 0;
}

.radio-line input,
.check-line input {
  width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
}

.radio-line span,
.check-line span {
  margin: 0;
  font-weight: 700;
}

.check-line[aria-disabled="true"] {
  color: var(--muted);
  text-decoration: line-through;
}

.trip-choice-list {
  display: grid;
  gap: 0.6rem;
  max-height: 290px;
  overflow: auto;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}

.trip-choice-day {
  display: grid;
  gap: 0.25rem;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(31 42 40 / 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  display: grid;
  gap: 1rem;
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 1rem));
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.35rem) clamp(1rem, 3vw, 1.35rem) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(31 42 40 / 0.28);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.modal-card h2 {
  padding-right: 3rem;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 0 calc(clamp(1rem, 3vw, 1.35rem) * -1);
  padding: 0.9rem clamp(1rem, 3vw, 1.35rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(rgb(255 255 255 / 0.94), #ffffff);
  backdrop-filter: blur(10px);
}

@media (max-width: 920px) {
  .trip-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .page-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .topbar {
    min-height: 60px;
    padding: 0.6rem 0.75rem;
  }

  .nav {
    gap: 0.5rem;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0 1rem;
  }

  .day-block {
    margin-top: 1.7rem;
  }

  .day-heading {
    border-bottom-width: 2px;
  }

  .day-date {
    min-width: 0;
    padding: 0.7rem 0.85rem;
  }

  .day-number {
    font-size: 2.55rem;
  }

  .toolbar,
  .card,
  .share-box,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .two-cols,
  .date-tools,
  .date-tools:has(label:nth-of-type(2)) {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
