* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  background: #faf7f2;
  color: #2b2b2b;
}

header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
}

h2 {
  font-size: 1.1rem;
  border-bottom: 2px solid #d8cdb8;
  padding-bottom: 4px;
}

.btn {
  background: #2f6f4f;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.stay-note {
  font-size: 0.8rem;
  color: #6b6b6b;
  margin-top: 4px;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.booking-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.booking-form input {
  padding: 8px;
  border: 1px solid #d8cdb8;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

.booking-form button {
  margin-top: 4px;
}

.booking-form button:disabled {
  background: #b7b7b7;
  cursor: not-allowed;
}

.stay-estimate {
  font-weight: bold;
  margin: 0;
}

.terms-box {
  border: 1px solid #d8cdb8;
  border-radius: 6px;
  background: #fff;
  padding: 8px 12px;
}

.terms-title {
  font-weight: bold;
  margin: 4px 0;
  font-size: 0.9rem;
}

.terms-text {
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0;
}

.terms-agree {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}

.stay-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: #b23b3b;
}

.banner {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.banner.success {
  background: #e3f3e8;
  color: #1f6b3a;
}

.banner.cancel {
  background: #fbe9e9;
  color: #b23b3b;
}

.cal-legend {
  font-size: 0.8rem;
  color: #6b6b6b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 12px;
}

.cal-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-left: 10px;
}

.cal-swatch:first-child {
  margin-left: 0;
}

.cal-swatch.available {
  background: #fff;
  border: 1px solid #d8cdb8;
}

.cal-swatch.booked {
  background: #e8e4dc;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
}

.cal-header h4 {
  margin: 0;
  font-size: 0.95rem;
  text-align: center;
  flex: 1;
}

.cal-nav-btn {
  background: none;
  border: 1px solid #d8cdb8;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #2b2b2b;
}

.cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 4px;
}

.cal-cell.weekday {
  font-weight: bold;
  color: #6b6b6b;
  aspect-ratio: auto;
}

.cal-cell.empty {
  visibility: hidden;
}

.cal-cell.available {
  background: #fff;
  border: 1px solid #eee;
  cursor: pointer;
}

.cal-cell.available:hover {
  border-color: #2f6f4f;
  background: #e3f3e8;
}

.cal-cell.booked {
  background: #e8e4dc;
  color: #9b9b9b;
  text-decoration: line-through;
  cursor: pointer;
}

.cal-cell.selected {
  background: #2f6f4f;
  color: #fff;
  border-color: #2f6f4f;
}

.cal-hint {
  font-size: 0.75rem;
  color: #6b6b6b;
  margin: 8px 0 0;
}

.cal-cell.past {
  color: #ccc;
}
