/* Shared reservation presentation. Native dialog and search behavior stay intact. */
.is-reservation-modal-open {
  overflow: hidden;
}

.reservation-search-modal {
  background: transparent;
  border: 0;
  color: var(--ink);
  margin: auto;
  max-height: calc(100svh - 48px);
  max-width: min(760px, calc(100vw - 48px));
  overflow: visible;
  padding: 0;
  width: 100%;
}

.reservation-search-modal[open] {
  display: block;
}

.reservation-search-modal::backdrop {
  background: rgba(47, 47, 47, 0.58);
}

.reservation-search-modal-panel {
  --reservation-chevron: url("/assets/icons/lucide/source/chevron-right.svg");
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  font-family: Inter, "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100svh - 48px);
  overflow: hidden;
}

.reservation-search-modal-header {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  min-height: 76px;
  padding: 14px 24px;
}

.reservation-search-modal-header > div {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  text-align: left;
}

.reservation-search-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 34px;
  margin: 0;
}

.reservation-search-modal-icon,
.reservation-search-modal-change,
.reservation-search-results-footer button,
.reservation-search-results-footer a,
.reservation-search-modal-footer button {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  border-radius: 4px;
}

.reservation-search-modal-icon {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  grid-column: 3;
  grid-row: 1;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.reservation-search-modal-icon svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  width: 20px;
}

.reservation-search-modal-change {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  grid-column: 2;
  grid-row: 1;
  min-height: 48px;
  padding: 12px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reservation-search-modal-search,
.reservation-search-modal-results {
  min-height: 0;
}

.reservation-search-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100svh - 124px);
}

.reservation-search-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  scrollbar-gutter: stable;
}

.reservation-search-modal-intro {
  margin-bottom: 24px;
}

.reservation-search-modal-intro > p {
  display: none;
}

.reservation-search-modal-intro h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 24px;
  margin: 0;
}

/* The heading and field names already say it (owner 10/12: a shorter form). */
.reservation-search-modal-intro > span {
  display: none;
}

/* Rooms come last, after the children's ages (reservation-modal.js). */
.reservation-search-children ~ .reservation-search-field {
  margin-top: 12px;
}

.reservation-search-fields,
.reservation-search-child-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reservation-search-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  position: relative;
}

.reservation-search-field.is-wide {
  grid-column: 1 / -1;
}

.reservation-search-field > span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.reservation-search-field input,
.reservation-search-field select {
  appearance: none;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  height: 48px;
  line-height: 24px;
  min-width: 0;
  padding: 0 16px;
  width: 100%;
}

.reservation-search-field select {
  background-image: none;
  padding-right: 44px;
}

.reservation-search-field:has(select)::after {
  background: var(--ink);
  bottom: 14px;
  content: "";
  height: 20px;
  mask: var(--reservation-chevron) center / contain no-repeat;
  pointer-events: none;
  position: absolute;
  right: 14px;
  transform: rotate(90deg);
  width: 20px;
}

.reservation-search-field input[type="date"]::-webkit-calendar-picker-indicator {
  background: url("/assets/icons/lucide/source/calendar-check.svg") center / contain no-repeat;
  cursor: pointer;
  height: 20px;
  opacity: 1;
  padding: 0;
  width: 20px;
}

.reservation-search-field input:focus-visible,
.reservation-search-field select:focus-visible,
.reservation-search-modal button:focus-visible,
.reservation-search-modal a:focus-visible,
.reservation-search-children summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.reservation-search-children {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.reservation-search-children summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  min-height: 72px;
  padding: 12px 2px;
}

.reservation-search-children summary::after {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: var(--ink);
  mask: var(--reservation-chevron) center / contain no-repeat;
  transform: rotate(90deg);
}

.reservation-search-children[open] summary::after {
  transform: rotate(-90deg);
}

.reservation-search-children summary::-webkit-details-marker {
  display: none;
}

.reservation-search-children summary > span:first-child {
  display: grid;
  gap: 2px;
}

.reservation-search-children summary strong {
  font-size: 16px;
  font-weight: 500;
}

.reservation-search-children summary small,
.reservation-search-children summary > span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.reservation-search-children summary > span:last-child {
  color: var(--ink);
  font-family: inherit;
  font-weight: 400;
  margin-left: auto;
}

.reservation-search-child-grid {
  padding: 2px 0 22px;
}

.reservation-search-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  margin: 16px 0 0;
}

.reservation-search-modal-footer {
  align-items: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
}

.reservation-search-modal-footer p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.reservation-search-modal-footer p span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.reservation-search-modal-footer p strong {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.reservation-search-modal-footer button {
  background: var(--ink);
  border: 0;
  color: var(--paper);
  cursor: pointer;
  height: 44px;
  padding: 0 24px;
}

.reservation-search-modal-results {
  background: var(--surface);
  display: grid;
  grid-template-rows: minmax(420px, 1fr) auto;
  height: min(760px, calc(100svh - 124px));
  position: relative;
}

.reservation-search-modal-results[hidden],
.reservation-search-modal-search[hidden],
.reservation-search-modal-change[hidden],
.reservation-search-results-loading[hidden] {
  display: none !important;
}

.reservation-search-modal-results iframe {
  background: var(--paper);
  border: 0;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.reservation-search-results-loading {
  align-items: center;
  background: var(--paper);
  color: var(--muted);
  display: flex;
  font-size: 14px;
  inset: 0 0 69px;
  justify-content: center;
  position: absolute;
  z-index: 1;
}

.reservation-search-results-footer {
  align-items: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  min-height: 69px;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
}

.reservation-search-results-footer button,
.reservation-search-results-footer a {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  padding: 0 20px;
  text-decoration: none;
}

.reservation-search-results-footer a {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

@media (max-width: 640px) {
  .reservation-search-modal {
    margin: auto 0 0;
    max-height: calc(100svh - 40px);
    max-width: none;
    width: 100%;
  }

  .reservation-search-modal-panel {
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    border-right: 0;
    max-height: calc(100svh - 40px);
  }

  .reservation-search-modal-header {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    min-height: 68px;
    padding: 10px 20px;
  }

  .reservation-search-modal-header h2 {
    font-size: 20px;
    line-height: 30px;
  }

  .reservation-search-form {
    max-height: calc(100svh - 108px);
  }

  .reservation-search-modal-body {
    padding: 22px 20px 20px;
  }

  .reservation-search-modal-intro {
    margin-bottom: 20px;
  }

  .reservation-search-fields,
  .reservation-search-child-grid {
    gap: 14px 12px;
  }

  .reservation-search-field input,
  .reservation-search-field select {
    padding-left: 13px;
  }

  .reservation-search-child-grid {
    grid-template-columns: 1fr;
  }

  .reservation-search-modal-footer {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .reservation-search-modal-footer p {
    display: none;
  }

  .reservation-search-modal-footer button {
    width: 100%;
  }

  .reservation-search-modal-results {
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100svh - 108px);
  }

  .reservation-search-results-loading {
    bottom: 66px;
  }

  .reservation-search-results-footer {
    justify-content: stretch;
    min-height: 66px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  }

  .reservation-search-results-footer button,
  .reservation-search-results-footer a {
    flex: 1 1 0;
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reservation-search-modal,
  .reservation-search-modal::backdrop {
    scroll-behavior: auto;
  }
}

/* Search view in TOP's tone (owner, 2026-10-06; CSS only, the markup is shared by every page):
   12px-round fields on the BUB grey without hard borders, bold small labels, 子ども as the same kind of
   field, a 12px-round full-width ink button, and wording that wraps at phrases. */
.reservation-search-modal-panel { border-radius: 16px; }
.reservation-search-modal-header h2 { font-size: 20px; line-height: 30px; }
.reservation-search-modal-intro h3 { font-size: 18px; line-height: 28px; font-weight: 700; }
.reservation-search-modal-intro > span, .reservation-search-note { text-wrap: pretty; }
.reservation-search-field { gap: 6px; }
.reservation-search-field > span { color: rgb(47 47 47 / 72%); font-size: 13px; line-height: 18px; font-weight: 700; }
.reservation-search-field input,
.reservation-search-field select { height: 52px; border: 1px solid transparent; border-radius: 12px; background-color: #eef1f1; font-weight: 500; }
.reservation-search-field input:hover,
.reservation-search-field select:hover { border-color: rgb(47 47 47 / 16%); }
.reservation-search-field:has(select)::after { bottom: 16px; }
.reservation-search-children { margin-top: 16px; border: 0; border-radius: 12px; background: #eef1f1; }
.reservation-search-children summary { min-height: 60px; padding: 10px 16px; }
.reservation-search-children summary strong { font-size: 15px; font-weight: 700; }
.reservation-search-children summary > span:last-child { font-weight: 700; }
.reservation-search-child-grid { padding: 0 16px 16px; }
.reservation-search-child-grid .reservation-search-field input,
.reservation-search-child-grid .reservation-search-field select { background-color: #fcfcfc; }
.reservation-search-note { font-size: 12px; line-height: 20px; }
.reservation-search-modal-footer button { height: 52px; border-radius: 12px; font-size: 15px; font-weight: 700; }
/* The dialog opens with focus on 閉じる; its ring is a soft round one, not a hard black box. */
.reservation-search-modal-icon { border-radius: 12px; }
.reservation-search-modal .reservation-search-modal-icon:focus-visible { outline: 2px solid rgb(47 47 47 / 35%); outline-offset: -2px; }
/* The results view's two actions follow the same buttons. */
.reservation-search-results-footer button,
.reservation-search-results-footer a { min-height: 48px; border-radius: 12px; font-weight: 700; }

/* Counts as app steppers (reservation-modal.js enhanceStepper): one row per count — label at left,
   − value ＋ at right — on the BUB grey. The select stays in the form, visually hidden. */
.reservation-search-field.has-stepper { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 12px 0 16px; border-radius: 12px; background: #eef1f1; }
.reservation-search-field.has-stepper::after { content: none; }
.reservation-search-field.has-stepper > span { color: #2f2f2f; font-size: 15px; line-height: 22px; }
.reservation-search-field.has-stepper > select { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.reservation-stepper { display: flex; align-items: center; gap: 4px; }
.reservation-stepper-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgb(47 47 47 / 22%); border-radius: 50%; background: #fcfcfc; color: #2f2f2f; font: 400 20px/1 Inter, sans-serif; cursor: pointer; transition: background-color var(--feedback-duration, 150ms) ease; }
.reservation-stepper-button:active:not(:disabled) { background: #e7ecec; }
.reservation-stepper-button:disabled { opacity: .3; cursor: default; }
.reservation-stepper-value { min-width: 3.2em; color: #2f2f2f; font-size: 16px; line-height: 24px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.reservation-search-child-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.reservation-search-child-grid .reservation-search-field.has-stepper { min-height: 56px; padding: 0; border-top: 1px solid rgb(47 47 47 / 10%); border-radius: 0; background: none; }
.reservation-search-child-grid .reservation-search-field.has-stepper > span { color: rgb(47 47 47 / 80%); font-size: 14px; }
.reservation-search-fields { row-gap: 10px; }
@media (hover: hover) { .reservation-stepper-button:hover:not(:disabled) { background: #e7ecec; } }
.reservation-search-modal-intro > span, .reservation-search-note { word-break: auto-phrase; }
/* One sentence per line (reservation-modal.js splits the note; owner 2026-10-19). */
.reservation-search-note > span:not([hidden]) { display: block; }
/* Shown when a room reaches 6 people (reservation-modal.js ROOM_CAPACITY). */
.reservation-capacity-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: #eef1f1; color: #2f2f2f; font-size: 13px; line-height: 20px; font-weight: 700; word-break: auto-phrase; text-wrap: pretty; }
.reservation-capacity-note[hidden] { display: none; }

/* The last search, remembered on this device (owner, 2026-10-11): one quiet line with a way to clear it. */
.reservation-search-remembered { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: rgb(47 47 47 / 5%); color: rgb(47 47 47 / 72%); font-size: 13px; line-height: 20px; }
.reservation-search-remembered[hidden] { display: none; }
.reservation-search-remembered button { flex: none; min-height: 32px; padding: 0 4px; border: 0; background: none; color: var(--ink, #2f2f2f); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* A shorter form (owner 10/12): facility and check-in side by side, lower fields and steppers, so the
   whole form sits in the lower half of a phone. */
.reservation-search-modal-intro { margin-bottom: 12px; }
.reservation-search-fields { gap: 10px; }
.reservation-search-fields > .reservation-search-field.is-wide { grid-column: auto; }
.reservation-search-field.is-wide > span { font-size: 12px; line-height: 16px; }
.reservation-search-field input,
.reservation-search-field select { height: 44px; }
.reservation-search-field:has(select)::after { bottom: 12px; }
.reservation-search-field.has-stepper { min-height: 52px; }
.reservation-stepper-button { width: 36px; height: 36px; }
.reservation-search-children { margin-top: 10px; }
.reservation-search-children summary { min-height: 52px; padding: 6px 16px; }
.reservation-search-child-grid .reservation-search-field.has-stepper { min-height: 46px; }
.reservation-search-children ~ .reservation-search-field { margin-top: 10px; }

/* The chosen stay above the search button (reservation-modal.js renderStay): photograph, day and season,
   what the stay includes. It takes the place of the plain 選択中 line. */
.reservation-search-modal-footer > p:has([data-reservation-condition-summary]) { display: none; }
.reservation-stay { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reservation-stay img { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.reservation-stay > span { display: grid; gap: 2px; min-width: 0; }
.reservation-stay b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #2f2f2f; font-size: 14px; line-height: 20px; font-weight: 700; }
.reservation-stay em { padding: 1px 8px; border-radius: 999px; background: #d56e59; color: #fcfcfc; font-size: 11px; line-height: 18px; font-style: normal; font-weight: 700; }
.reservation-stay small { color: rgb(47 47 47 / 66%); font-size: 11.5px; line-height: 16px; }

/* Results: a date in the calendar already opens the booking site, and 条件を変更 sits in the header, so the
   footer's 予約を続ける / 条件を変更 pair only repeated them (owner, 2026-10-13). */
.reservation-search-results-footer { display: none !important; }
