:root {
  --navy: #073253;
  --navy-deep: #042946;
  --gold: #c29245;
  --gold-soft: #d8bd87;
  --ink: #111827;
  --muted: #606873;
  --line: #dfc8a7;
  --paper: #fffdf8;
  --bg: #f7f0e6;
  --error: #b42318;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.75;
}

button, input, select, textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0 0 72px;
  background: var(--paper);
  box-shadow: 0 28px 54px rgba(35, 28, 18, .11);
}

.thanks-page {
  padding-top: 28px;
}

.masthead {
  margin: 0;
  padding: 24px 42px 30px;
  text-align: center;
  border-bottom: 0;
  background: linear-gradient(90deg, var(--navy-deep), #0b3b60 48%, var(--navy-deep));
}

.eyebrow {
  margin: 0 0 4px;
  color: #e0ae63;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 8px;
  color: #e7b465;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #111;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

h2::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  flex: 0 0 auto;
}

.masthead-lead {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.section {
  margin: 0 44px;
  padding: 28px 0;
  border-bottom: 1px solid #eadcca;
}

#activitySection {
  padding-bottom: 18px;
}

.activity-list, .slot-grid, .participant-list {
  display: grid;
  gap: 12px;
}

.activity-card, .slot-card, .participant-row, .summary-box, .notice {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
}

.activity-card, .slot-card {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, opacity .18s ease, transform .18s ease, max-height .18s ease, padding .18s ease, margin .18s ease;
}

.slot-card {
  overflow: hidden;
  max-height: 180px;
}

.activity-card[aria-pressed="true"], .activity-card.is-selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.slot-card[aria-pressed="true"] {
  border-color: #bd8e54;
  background: #f3eadc;
  box-shadow: inset 0 0 0 2px #bd8e54;
}

.activity-card h3, .slot-card h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
}

.slot-card.is-full {
  color: #7a8290;
  background: #f1eee9;
  cursor: not-allowed;
}

.slot-card.is-collapsing {
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  pointer-events: none;
}

.slot-card.is-gather-target {
  transform: translateY(-4px);
}

.slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 0;
  border: 1px solid;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.availability-icon {
  font-size: 13px;
  line-height: 1;
}

.availability-open {
  border-color: var(--ok);
  color: var(--ok);
}

.availability-low {
  border-color: #c2650b;
  color: #c2650b;
}

.availability-closed {
  border-color: #a3a9b3;
  color: #687180;
  background: #eee8df;
}

.is-full .pill {
  background: #e7e1d8;
  color: #687180;
}

.participant-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
}

.participant-row strong {
  display: block;
  margin-bottom: 2px;
}

.participant-row small {
  color: var(--muted);
}

.stepper {
  display: grid;
  grid-template-columns: 40px 56px 40px;
  gap: 6px;
  align-items: center;
}

.stepper button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf8;
  color: var(--navy);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

.stepper button:disabled {
  color: #b9b0a5;
  background: #f0e9df;
  cursor: not-allowed;
}

.stepper input {
  width: 56px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px 22px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

.form-grid label {
  grid-column: 1 / -1;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 22px;
  margin-bottom: 0;
  min-width: 0;
}

.field-error {
  grid-column: 1 / -1;
  color: var(--error);
  font-size: 12px;
  font-weight: 700;
}

.section-error {
  margin: -8px 0 14px;
  color: var(--error);
  font-size: 13px;
  font-weight: 700;
}

.participant-hint {
  margin: -10px 0 14px;
  color: var(--muted);
  font-size: 11.2px;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  background: var(--paper);
  color: var(--ink);
}

input.is-invalid, select.is-invalid {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

input[type="date"] {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  color-scheme: light;
}

.slot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.participant-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-toggle {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7bd8f;
  background: #f8efdf;
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
}

textarea {
  resize: vertical;
}

.summary-box {
  min-height: 96px;
  padding: 16px 18px;
}

.summary-box dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 14px;
  margin: 0;
}

.summary-box dt {
  color: var(--muted);
  font-weight: 800;
}

.summary-box dd {
  margin: 0;
}

.payment-note {
  margin: 10px 0 0;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.free-stay-note {
  color: var(--gold);
  font-weight: 700;
}

.thanks-message {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 2;
}

.thanks-message a {
  color: var(--navy);
  font-weight: 800;
}

.submit-button {
  display: block;
  width: min(640px, 90%);
  min-height: 58px;
  margin: 24px auto 0;
  border: 0;
  border-radius: 2px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--gold);
}

.notice {
  margin: 20px 44px 0;
  padding: 12px 16px;
}

.notice.error {
  border-color: #f0b8b2;
  color: var(--error);
  background: #fff6f5;
}

.notice.closed-notice {
  padding: 28px 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(246, 248, 251, .86);
}

.loading-overlay.is-active {
  display: flex;
}

.loader-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
}

.loader-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 6px solid #e5e9f0;
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}

.loader-dots {
  display: flex;
  gap: 10px;
}

.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  animation: bounce 1s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: .15s; }
.loader-dots span:nth-child(3) { animation-delay: .3s; }

.loader-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-7px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .activity-card, .slot-card {
    transition: none;
  }
}

@media (max-width: 700px) {
  body {
    background: var(--bg);
  }

  .page {
    width: 100%;
    padding-top: 0;
  }

  .masthead {
    padding: 22px 20px 26px;
  }

  h1 {
    font-size: 28px;
  }

  .section {
    margin: 0 20px;
  }

  .notice {
    margin-right: 20px;
    margin-left: 20px;
  }

  .form-grid, .form-grid label, .participant-row, .summary-box dl {
    grid-template-columns: 1fr;
  }

  .slot-grid, .participant-list {
    grid-template-columns: 1fr;
  }

  .form-grid label {
    gap: 7px;
  }

  .date-field input {
    max-width: 100%;
  }

  .stepper {
    justify-content: start;
  }
}
