:root {
  color-scheme: light;
  --hotel: #96382f;
  --hotel-dark: #70271f;
  --hotel-soft: #f7ecea;
  --ink: #231f20;
  --muted: #625c5a;
  --line: #ddd7d4;
  --surface: #ffffff;
  --surface-muted: #f7f6f5;
  --focus: #194a8d;
  --danger: #a61b1b;
  --radius: 12px;
  font-family: Arial, "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-width: 0; margin: 0; background: transparent; color: var(--ink); }

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

button, label, input, select, textarea { -webkit-tap-highlight-color: transparent; }

.booking-widget {
  width: min(100%, 414px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.booking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.booking-header h1,
.form-header h1 {
  margin: 3px 0 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.room-name {
  margin: 0;
  color: var(--hotel);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.icon-button,
.back-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.icon-button:hover:not(:disabled) { background: var(--surface-muted); }
.icon-button:disabled { cursor: not-allowed; opacity: .35; }

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  padding: 10px 12px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.calendar-grid { padding: 4px 12px 12px; }

.calendar-spacer { min-height: 58px; }

.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 7px 2px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.calendar-day span { display: block; font-size: 13px; font-weight: 700; }
.calendar-day small { display: block; margin-top: 7px; color: var(--hotel-dark); font-size: 9px; font-weight: 700; }
.calendar-day:hover:not(:disabled) { background: var(--hotel-soft); }
.calendar-day.is-in-range { border-radius: 0; background: var(--hotel-soft); }
.calendar-day.is-selected { border-radius: 8px; background: var(--hotel); color: #fff; }
.calendar-day.is-selected small { color: #fff; }
.calendar-day.is-selected:hover:not(:disabled) { background: var(--hotel-dark); }
.calendar-day:disabled { cursor: not-allowed; color: #a29c99; text-decoration: line-through; }
.calendar-day:disabled small { color: #a29c99; text-decoration: none; }

.status-message {
  min-height: 24px;
  margin: 0;
  padding: 2px 16px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.status-message.is-error { color: var(--danger); }

.calendar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.calendar-summary span { display: block; color: var(--muted); font-size: 11px; }
.calendar-summary strong { display: block; margin-top: 3px; font-size: 13px; }

.primary-button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--hotel);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.primary-button:hover:not(:disabled) { background: var(--hotel-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.form-view { min-height: 100vh; padding: 20px; }

.form-header { margin-bottom: 18px; }
.form-header .room-name { margin-top: 16px; }
.back-button { padding: 4px 0; color: var(--hotel-dark); font-size: 13px; font-weight: 700; }
.stay-copy { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

form { display: flex; flex-direction: column; gap: 18px; }

.rate-options { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.rate-options legend { margin-bottom: 8px; font-size: 14px; font-weight: 700; }

.rate-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.rate-option:has(input:checked) { border-color: var(--hotel); background: var(--hotel-soft); }
.rate-option input { accent-color: var(--hotel); }
.rate-option strong, .rate-option small { display: block; }
.rate-option strong { font-size: 13px; }
.rate-option small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.rate-option b { color: var(--hotel-dark); font-size: 13px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid label { min-width: 0; }
.field-grid label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.field-wide { grid-column: 1 / -1; }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #a9a29e;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 82px; resize: vertical; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 2px; }

.privacy-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; text-wrap: pretty; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff0f0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.submit-button { width: 100%; min-height: 48px; }

@media (max-width: 360px) {
  .calendar-summary { flex-direction: column; align-items: stretch; gap: 10px; }
  .calendar-summary .primary-button { width: 100%; }
  .calendar-day { min-height: 52px; }
  .calendar-day small { font-size: 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
