@charset "UTF-8";

/* =====================================================================
   保養所予約システム 共通スタイル
   スマホ優先（宿泊者向け画面は幅 375px を基準に設計）。
   ===================================================================== */

:root {
  /* 文字。夕日に焼けた流木の茶。黒より柔らかく、暖色の面になじむ */
  --ink:        #402318;
  --ink-soft:   #6e4534;
  --ink-mute:   #8a6152;

  /* 罫線・面。夕暮れの砂浜 */
  --line:       #efd2bc;
  --line-soft:  #fae9dd;
  --bg:         #fff8f2;
  --panel:      #ffffff;

  /* アクセント（夕日のオレンジ）。文字・ボタンに使うので明るさの上限は AA で決まる */
  --accent:     #c2410c;
  --accent-dk:  #9a3009;
  --accent-lt:  #ffe8d9;
  /* 主ボタンのグラデーション。明るい側も白文字が AA を満たす範囲に留めること
     （#cc4a1c で 4.60:1。これ以上明るくすると白文字が読めなくなる） */
  --accent-g1:  #b8390f;
  --accent-g2:  #cc4a1c;

  /* 差し色の海。夕景のなかに覗く水面として、リンクと空き状況に使う */
  --aqua:       #0f7a86;
  --aqua-dk:    #0b5d66;
  --aqua-lt:    #e3f5f7;

  /* ヘッダーなど大きな面に使う夕景。濃い茶の文字を載せる前提で明るくとる */
  --dusk-1:     #fb8f4a;
  --dusk-2:     #f6779e;
  --on-dusk:    #4a1f10;

  /* 差し色（サンゴールド）。ナビの下線など要所だけに使う */
  --gold:       #f5a524;
  --gold-dk:    #92400e;
  --gold-lt:    #fef1d6;

  /* 状態。danger は主色のオレンジと混ざらないよう赤紫寄りにとる */
  --ok:         #0f7a55;
  --ok-bg:      #e4f6ed;
  --warn:       #b45309;
  --warn-bg:    #fef3c7;
  --danger:     #a8102f;
  --danger-bg:  #ffe3e9;

  --radius:     10px;
  --shadow:     0 1px 2px rgba(124, 45, 18, .08), 0 4px 12px rgba(124, 45, 18, .07);
  --shadow-lift: 0 2px 4px rgba(124, 45, 18, .10), 0 10px 24px rgba(124, 45, 18, .13);
  --wrap:       1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* 上ほど夕焼けを濃くして、砂浜から見る空のような抜け感を出す */
  background: var(--bg);
  background-image: linear-gradient(180deg, #ffe7d5 0%, var(--bg) 320px);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--aqua); }
a:hover { color: var(--aqua-dk); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}

/* --- ヘッダー / ナビ --------------------------------------------- */
.site-header {
  /* 夕日からピンクへ流れる帯。白文字だとコントラストが取れないので、
     文字を濃い茶にして「明るい面 × 濃い文字」で読ませる */
  background: linear-gradient(100deg, var(--dusk-1) 0%, #fa8a63 55%, var(--dusk-2) 100%);
  color: var(--on-dusk);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
}
.site-header .brand {
  color: var(--on-dusk);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.0625rem;
}
.header-actions {
  display: flex;
  gap: 16px;
  font-size: .875rem;
}
.header-actions a { color: var(--on-dusk); text-decoration: none; }
.header-actions a:hover { text-decoration: underline; }

.site-nav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
/* 幅が足りないときは折り返す（横スクロールにすると、はみ出た項目に気づきにくい） */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 12px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .9375rem;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--accent-lt); color: var(--accent-dk); }
.site-nav a.active {
  color: var(--accent-dk);
  font-weight: 700;
  /* 現在地は差し色のゴールドで示す */
  border-bottom-color: var(--gold);
  background: var(--accent-lt);
}

/* 保養所配下のサブナビ（本文の上に置く） */
.site-nav.subnav {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.site-nav.subnav a { padding: 10px 14px; font-size: .875rem; }

/* スマホ幅では余白と文字を詰めて、折り返しの段数を減らす */
@media (max-width: 699px) {
  .site-nav ul { gap: 0; }
  .site-nav a,
  .site-nav.subnav a { padding: 10px; font-size: .875rem; }
}

main.wrap { padding-block: 24px 48px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: .8125rem;
  padding-block: 16px;
  text-align: center;
}
.site-footer p { margin: 0; }
/* 法務文書へのリンク。スマホでは折り返して中央で積まれる */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent-dk); }

/* --- 見出し ------------------------------------------------------- */
h1 { font-size: 1.5rem;   margin: 0 0 16px; }
h2 { font-size: 1.1875rem; margin: 32px 0 12px; }
h3 { font-size: 1.0625rem; margin: 24px 0 8px; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; }
.lead { color: var(--ink-soft); margin-top: -8px; }

/* --- カード ------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child  { margin-bottom: 0; }
.card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--accent-dk);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-lt);
}

/* --- 通知 --------------------------------------------------------- */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
/* 左端の色帯で、色が見えにくい環境でも種類が分かるようにする */
.alert { border-left-width: 5px; }
.alert-success { background: var(--ok-bg);     border-color: #b7e6d0; border-left-color: var(--ok);     color: var(--ok); }
.alert-error   { background: var(--danger-bg); border-color: #f8c6d2; border-left-color: var(--danger); color: var(--danger); }
.alert-info    { background: var(--accent-lt); border-color: #fbcdb4; border-left-color: var(--accent); color: var(--accent-dk); }
.alert-warn    { background: var(--warn-bg);   border-color: #f7d492; border-left-color: var(--gold);   color: var(--warn); }

/* --- フォーム ----------------------------------------------------- */
.field { margin-bottom: 18px; }
.field > label,
.field-label {
  display: block;
  font-weight: 700;
  font-size: .875rem;
  margin-bottom: 6px;
}
.required-mark {
  color: var(--danger);
  font-size: .75rem;
  margin-left: 6px;
}
.hint {
  color: var(--ink-mute);
  font-size: .8125rem;
  margin: 4px 0 0;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"],
input[type="time"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  /* iOS で入力時に画面が拡大するのを防ぐ */
  font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--line-soft);
  color: var(--ink-mute);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }
.field-error {
  color: var(--danger);
  font-size: .8125rem;
  margin: 6px 0 0;
}

.checkline { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.checkline input[type="checkbox"], .checkline input[type="radio"] {
  width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent);
}
.checkline label { font-weight: normal; }

.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 220px; }
/* 狭い画面でも折り返さず、2 つの入力欄を半分ずつ横に並べる（ログイン画面の事業所コード・パスワードなど） */
.field-pair { display: flex; gap: 12px; }
.field-pair > .field { flex: 1 1 0; min-width: 0; }

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
/* ボタンを右端に寄せる版（一覧の中で行ごとに操作するカードなど） */
.form-actions.right { justify-content: flex-end; }
/* ボタンを中央に置く版（絞り込みなど、その場で完結する操作） */
.form-actions.center { justify-content: center; }

/* --- ボタン ------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--accent-g1);
  border-radius: 6px;
  /* 夕日の光沢。明るい側は白文字が AA を満たす範囲に収めてある */
  background: linear-gradient(135deg, var(--accent-g1) 0%, var(--accent-g2) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px; /* スマホでのタップ領域を確保 */
}
/* hover は有効なボタンにだけ当てる。無効なボタンにも当たると、
   マウスを載せたときだけ配色が変わってしまう。 */
.btn:not(:disabled):not([aria-disabled="true"]):hover {
  background: linear-gradient(135deg, var(--accent-dk) 0%, var(--accent) 100%);
  border-color: var(--accent-dk); color: #fff;
}
.btn:not(:disabled):not([aria-disabled="true"]) { box-shadow: 0 1px 3px rgba(154, 48, 9, .28); }
/* 無効時は文字色も必ず打ち消す。指定を省くと .btn-sub 等の文字色が残り、
   グレー背景に同輝度の文字が乗って読めなくなる。 */
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--ink-mute); border-color: var(--ink-mute); color: #fff; cursor: not-allowed;
}
.btn-sub {
  background: #fff;
  color: var(--accent);
}
.btn-sub:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--accent-lt); color: var(--accent-dk);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #c01a3c 100%);
  border-color: var(--danger);
}
.btn-danger:not(:disabled):not([aria-disabled="true"]):hover {
  background: linear-gradient(135deg, #8c0a26 0%, var(--danger) 100%);
  border-color: #8c0a26;
}
.btn-sm { padding: 6px 12px; min-height: 0; font-size: .8125rem; font-weight: normal; }
.btn-block { display: block; width: 100%; }

/* --- テーブル ----------------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: .9375rem;
}
table.data th, table.data td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
table.data thead th {
  background: var(--accent-lt);
  color: var(--accent-dk);
  font-size: .875rem;
  white-space: nowrap;
}
table.data tbody tr:hover { background: #fff4ea; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.actions { white-space: nowrap; }
table.data td.thumb-cell { width: 96px; }

/* --- 一覧表のスマホ表示（table.data.stack） ---
   列の多い一覧は、スマホ幅では 1 行を 1 枚のカードにし、各項目を「見出し：値」で縦に並べる。
   見出しは td の data-label を使う。.stack-title の列は見出しなしでカードの先頭に出す */
@media (max-width: 699px) {
  table.data.stack,
  table.data.stack tbody { display: block; background: transparent; }
  table.data.stack thead { display: none; }
  table.data.stack tr {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 12px;
    margin-bottom: 12px;
  }
  table.data.stack tbody tr:hover { background: var(--panel); }
  /* 中身の改行や <br> を崩さないよう、見出しは左の余白に絶対配置で置く */
  table.data.stack td {
    position: relative;
    border: 0;
    border-top: 1px solid var(--line-soft);
    padding: 6px 0 6px 7em;
    width: auto;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table.data.stack td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 6px;
    width: 6.5em;
    color: var(--ink-mute);
    font-size: .8125rem;
    font-weight: 700;
  }
  table.data.stack td.stack-title {
    order: -1;
    border-top: 0;
    padding: 6px 0 8px;
    font-size: 1rem;
  }
  table.data.stack td.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 0 6px;
  }
  table.data.stack td.stack-title::before,
  table.data.stack td.actions::before { content: none; }
  /* 表の外枠で横スクロールさせる必要はなくなる */
  .table-scroll:has(> table.data.stack) { overflow-x: visible; }

  /* 絞り込みフォームの幅固定（インライン指定）を解き、日付の From / To 以外は 1 行ずつにする */
  .filter-form .field-row > .field { flex: 1 1 100% !important; }
  .filter-form .field-row > .field:has(input[type="date"]) { flex: 1 1 calc(50% - 8px) !important; min-width: 0; }
}

.empty {
  color: var(--ink-mute);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
}

/* --- 定義リスト（確認画面） --------------------------------------- */
dl.detail { margin: 0; }
dl.detail > div {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
dl.detail dt {
  flex: 0 0 180px;
  font-weight: 700;
  font-size: .875rem;
  color: var(--ink-soft);
}
dl.detail dd { flex: 1; margin: 0; word-break: break-word; }

/* --- バッジ ------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-bg);     color: var(--ok); }
.badge-warn   { background: var(--warn-bg);   color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-mute   { background: var(--line-soft); color: var(--ink-soft); }
.badge-info   { background: var(--accent-lt); color: var(--accent-dk); }
.badge-gold   { background: var(--gold-lt);   color: var(--gold-dk); }

/* --- 保養所選択（宿泊者向けトップ） -------------------------------- */
.facility-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.facility-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}
.facility-card:has(a:hover) {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.facility-card a { display: block; color: inherit; text-decoration: none; }
.facility-card a:hover { background: #fff4ea; }
.facility-card .name { color: var(--accent-dk); }
@media (prefers-reduced-motion: reduce) {
  .facility-card { transition: none; }
  .facility-card:has(a:hover) { transform: none; }
}
.facility-card .photo {
  aspect-ratio: 16 / 9;
  background: var(--line-soft) center/cover no-repeat;
  display: block;
}
.facility-card .body { display: block; padding: 14px 16px; }
.facility-card .name { display: block; font-size: 1.0625rem; font-weight: 700; margin: 0 0 4px; }
.facility-card .tagline { display: block; color: var(--ink-soft); font-size: .875rem; margin: 0; }
.facility-card.is-closed { opacity: .72; }
.facility-card.is-closed .photo { filter: grayscale(1); }
.facility-card .closed-note {
  display: block;
  margin-top: 8px;
  color: var(--danger);
  font-size: .8125rem;
  font-weight: 700;
}

/* --- 写真ギャラリー（横スライダ） ------------------------------------ */
/* 枚数が増えても高さが変わらないよう 1 段に並べ、横に送る。
   右端の 1 枚を少し欠けて見せ、続きがあることを伝える */
.photo-slider { position: relative; }
.photo-strip {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  /* ホバーで持ち上げた写真の影が切れないよう、上下に少し余白を取る */
  padding: 6px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.photo-strip > li {
  flex: 0 0 calc((100% - 16px * 4) / 4.3);  /* パソコン幅で約 4 枚 */
  scroll-snap-align: start;
}
@media (max-width: 699px) {
  .photo-strip > li { flex-basis: calc((100% - 16px * 2) / 2.2); }  /* スマホ幅で約 2 枚 */
}
/* 前後ボタンで送れるときだけスクロールバーを隠す（JS が無いときは送る手段として残す） */
.photo-slider.is-ready .photo-strip { scrollbar-width: none; }
.photo-slider.is-ready .photo-strip::-webkit-scrollbar { display: none; }
.photo-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.photo-strip figure { margin: 0; }
.photo-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--line-soft);
}
.photo-strip figcaption {
  font-size: .8125rem;
  color: var(--ink-soft);
  margin-top: 6px;
}
/* 押せることが分かるように、ホバーで少し持ち上げる */
.photo-strip a { display: block; border-radius: 6px; }
.photo-strip a img { transition: transform .18s ease, box-shadow .18s ease; }
.photo-strip a:hover img,
.photo-strip a:focus-visible img {
  transform: scale(1.02);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}
/* 前後ボタン。写真の高さの中央に重ねる（--slider-mid はキャプションを除いた位置を JS で入れる） */
.slider-btn {
  position: absolute;
  top: var(--slider-mid, 50%);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.slider-btn.prev { left: -8px; }
.slider-btn.next { right: -8px; }
.slider-btn:hover { background: #fff; color: var(--accent-dk); }
.slider-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.slider-btn:disabled { opacity: .35; cursor: default; }
.slider-btn[hidden] { display: none; }

/* --- 写真の拡大表示 -------------------------------------------------- */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(6, 40, 50, .88); }
.lightbox-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 16px 64px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
}
.lightbox-caption {
  color: #fff;
  font-size: .9375rem;
  text-align: center;
  margin: 0;
  max-width: 60ch;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.lightbox-count {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  color: #f7d9c6;
  font-size: .8125rem;
}
.lightbox-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lightbox-btn.close { top: 12px; right: 12px; font-size: 1.125rem; }
.lightbox-btn.prev  { top: 50%; left: 12px;  transform: translateY(-50%); }
.lightbox-btn.next  { top: 50%; right: 12px; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) {
  .photo-strip { scroll-behavior: auto; }
  .photo-strip a img { transition: none; }
  .photo-strip a:hover img, .photo-strip a:focus-visible img { transform: none; }
}

/* --- カレンダー ---------------------------------------------------- */
.calendar { margin-bottom: 24px; }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-head .month { font-size: 1.0625rem; font-weight: 700; margin: 0; }
.calendar-grid {
  display: grid;
  /* 1fr は最小がコンテンツ幅になるため、特記事項が長い日があると
     列が押し広げられて右端（木金土）が overflow で隠れてしまう。
     minmax(0, 1fr) で必ず 7 等分にする */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.calendar-grid .dow {
  background: var(--accent-lt);
  color: var(--accent-dk);
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  padding: 6px 0;
}
.calendar-grid .dow.sun { color: var(--danger); }
.calendar-grid .dow.sat { color: var(--aqua-dk); }
.cal-cell {
  background: var(--panel);
  min-height: 74px;
  min-width: 0;
  padding: 4px;
  font-size: .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-cell a { min-width: 0; }
/* セル内は 1 行 1 要素。特記事項は折り返して全文を出す
   （列幅は minmax(0, 1fr) で固定しているので、はみ出さずに縦へ伸びる） */
.cal-cell .day,
.cal-cell .price,
.cal-cell .mark,
.cal-cell .small { display: block; }
.cal-cell .small {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.cal-cell.blank { background: var(--line-soft); }
.cal-cell .day { font-weight: 700; font-size: .8125rem; }
.cal-cell.sun .day { color: var(--danger); }
.cal-cell.sat .day { color: var(--aqua-dk); }
.cal-cell .price { font-weight: 700; }
.cal-cell .mark  { font-size: .8125rem; font-weight: 700; text-align: center; }

/* --- 日の状態ごとの色分け ---
   背景の色みだけに頼らず、上端の色帯と文字色でも区別できるようにする。
   is-open だけがクリックでき、それ以外は操作できないことを彩度で示す。 */
.cal-cell[class*="is-"] { border-top: 3px solid transparent; }

/* 販売中：予約できる日。唯一の「進める」状態なので明るく見せる */
.cal-cell.is-open {
  background: var(--aqua-lt);
  border-top-color: var(--aqua);
}
.cal-cell.is-open .price { color: var(--accent-dk); font-size: .875rem; }
.cal-cell.is-open a { display: block; text-decoration: none; color: inherit; }
.cal-cell.is-open:hover { background: var(--accent-lt); }

/* 予約済み・満室：埋まっている日 */
.cal-cell.is-booked {
  background: var(--danger-bg);
  border-top-color: var(--danger);
  color: var(--danger);
}
.cal-cell.is-booked .mark { color: var(--danger); }

/* 販売停止：意図して閉じた日 */
.cal-cell.is-closed {
  background: #f3ece8;
  border-top-color: var(--ink-mute);
  color: var(--ink-soft);
}
.cal-cell.is-closed .mark { color: var(--ink-soft); }

/* 施設休止 */
.cal-cell.is-closure {
  background: var(--warn-bg);
  border-top-color: var(--gold);
  color: var(--warn);
}
.cal-cell.is-closure .mark { color: var(--warn); }

/* 未設定・受付期間外：まだ何も決まっていない日 */
.cal-cell.is-none {
  background: #fdfaf7;
  color: var(--ink-mute);
}
.cal-cell.is-none .mark { color: var(--ink-mute); font-weight: normal; }

.cal-cell.is-selected { outline: 2px solid var(--gold); outline-offset: -2px; }

/* --- 宿泊者の予約状況：スマホ幅では 1 日 1 行のリストにする ---
   7 列のままだと 1 列が 45px ほどになり、料金や特記事項が読めないため。
   マークアップは共通で、.list-only / .desk-only で表記を出し分ける */
.cal-listable .list-only { display: none; }
@media (max-width: 699px) {
  .cal-listable .list-only { display: inline; }
  .cal-listable .desk-only { display: none; }
  /* 上端の枠線は各行の区切り線が兼ねる */
  .calendar-grid.cal-listable { display: block; background: var(--panel); border-top: 0; }
  .cal-listable .dow,
  .cal-listable .cal-cell.blank { display: none; }

  /* 状態の色帯は上端ではなく左端に置き、行どうしは細い線で区切る */
  .cal-listable .cal-cell[class*="is-"] {
    min-height: 0;
    padding: 10px 12px;
    font-size: .875rem;
    border-top: 1px solid var(--line);
    border-left: 4px solid transparent;
  }
  .cal-listable .cal-cell.is-open    { border-left-color: var(--aqua); }
  .cal-listable .cal-cell.is-booked  { border-left-color: var(--danger); }
  .cal-listable .cal-cell.is-closed  { border-left-color: var(--ink-mute); }
  .cal-listable .cal-cell.is-closure { border-left-color: var(--gold); }
  /* 受付期間外は選べないので、行を低くして予約できる日を探しやすくする */
  .cal-listable .cal-cell.is-none { padding-block: 5px; font-size: .8125rem; }

  /* 選べない日：日付と状態を横に並べる */
  .cal-listable .cal-cell:not(.is-open) { flex-direction: row; align-items: baseline; gap: 12px; }
  .cal-listable .cal-cell .day { flex: 0 0 6em; font-size: inherit; }
  .cal-listable .cal-cell .mark { text-align: left; font-size: inherit; }

  /* 予約できる日：行全体をタップ領域にし、右端に「›」を出す */
  .cal-listable .cal-cell.is-open a {
    display: grid;
    grid-template-columns: 6em 1fr auto;
    column-gap: 12px;
    align-items: baseline;
  }
  .cal-listable .cal-cell.is-open .price { font-size: .9375rem; }
  .cal-listable .cal-cell.is-open .small { grid-column: 2; }
  .cal-listable .cal-cell .chev {
    grid-column: 3;
    grid-row: 1;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--accent-dk);
  }
}

.cal-legend {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: .8125rem;
  color: var(--ink-soft);
  margin-top: 10px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
/* 凡例の色見本。カレンダーのセルと同じ配色にする */
.cal-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--line);
  flex: none;
}
.cal-legend .swatch.open    { background: var(--aqua-lt);         border-top: 3px solid var(--aqua); }
.cal-legend .swatch.booked  { background: var(--danger-bg); border-top: 3px solid var(--danger); }
.cal-legend .swatch.closed  { background: #f3ece8;         border-top: 3px solid var(--ink-mute); }
.cal-legend .swatch.closure { background: var(--warn-bg);   border-top: 3px solid var(--gold); }
.cal-legend .swatch.none    { background: #fdfaf7; }

/* --- 料金内訳 ------------------------------------------------------ */
table.charges { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.charges th, table.charges td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
table.charges td.num, table.charges th.num { text-align: right; white-space: nowrap; }
table.charges tfoot td {
  border-top: 2px solid var(--line);
  border-bottom: none;
  font-weight: 700;
  font-size: 1.0625rem;
  padding-top: 12px;
}
.borne-note { color: var(--ok); font-size: .8125rem; }

/* --- ステップ表示（予約フロー） ------------------------------------ */
.steps {
  display: flex;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: .8125rem;
  gap: 4px;
  flex-wrap: wrap;
}
.steps li {
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line-soft);
}
.steps li.current { background: var(--accent); color: #fff; font-weight: 700; }
/* 済んだ手順は緑にして、現在地（シアン）と一目で区別できるようにする */
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.steps li.done::before { content: "✓ "; }

/* --- ログイン等の 1 カラム画面 -------------------------------------- */
body.plain { background: var(--bg); }
main.centered {
  max-width: 460px;
  margin-inline: auto;
  padding: 40px 16px 64px;
}
/* 規約などの長文向け。1 行が長くなりすぎない範囲で広げる */
main.centered.reading { max-width: 760px; }
.app-title {
  font-size: 1.125rem;
  text-align: center;
  color: var(--accent-dk);
  font-weight: 700;
  margin-bottom: 20px;
}
.passcode-input {
  font-size: 1.75rem !important;
  letter-spacing: .5em;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- エラーページ --------------------------------------------------- */
.error-card { text-align: center; }
.error-status { font-size: 3rem; font-weight: 700; color: var(--ink-mute); margin: 0; line-height: 1.2; }
.error-message { font-size: 1.0625rem; margin: 8px 0 0; }
.error-detail {
  text-align: left;
  background: var(--line-soft);
  border-radius: 6px;
  padding: 12px;
  font-size: .8125rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- 操作説明 --------------------------------------------------------- */
/* 読み物なので、本文の行長を抑えて目で追いやすくする */
.manual { max-width: 820px; }
.manual h2 {
  margin-top: 40px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-lt);
  /* 目次のリンクで飛んだとき、見出しがヘッダーに隠れないようにする */
  scroll-margin-top: 16px;
}
.manual h3 { margin-top: 24px; color: var(--accent-dk); }
.manual .card > h3:first-child { margin-top: 0; }
.manual ul, .manual ol { padding-left: 1.4em; }
.manual li { margin-bottom: 6px; }
.manual code {
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .9375em;
  word-break: break-all;
}
/* 手順。番号を目立たせて、上から順に追えるようにする */
.manual-steps { counter-reset: step; list-style: none; padding-left: 0; }
.manual-steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 34px;
  margin-bottom: 12px;
}
.manual-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
.manual-toc { margin: 0; }
.manual-toc li { margin-bottom: 4px; }
/* 「なぜそうするのか」の補足。本文より控えめに */
.manual-why { display: block; color: var(--ink-mute); font-size: .8125rem; margin-top: 2px; }

/* --- 補助 ----------------------------------------------------------- */
.mt   { margin-top: 16px; }
.mb   { margin-bottom: 16px; }
.mute { color: var(--ink-mute); }
.small { font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.inline-form { display: inline; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- 画面幅が広いとき ------------------------------------------------ */
@media (min-width: 700px) {
  .facility-list { grid-template-columns: repeat(2, 1fr); }
  /* 1 件だけのとき（奇数件の最後の 1 件も）は左に寄せず、1 列ぶんの幅で中央に置く */
  .facility-list > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 16px) / 2);
  }
  .cal-cell { min-height: 88px; font-size: .8125rem; }
}
@media (max-width: 699px) {
  h1 { font-size: 1.3125rem; }
  .card { padding: 16px; }
  dl.detail > div { display: block; }
  dl.detail dt { margin-bottom: 2px; }
  .form-actions .btn { flex: 1 1 100%; }
}

/* reCAPTCHA v3 のバッジは隠し、代わりにフォーム下に表記を出す（Google の規約で認められた方法）。
   display:none にするとスパム判定が動かなくなるため、必ず visibility で隠すこと */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-notice {
  color: var(--ink-mute);
  font-size: .75rem;
  margin: 12px 0 0;
}

/* --- 宿泊者向け画面の背景画像（layout/_bg.php） -------------------------
   画面全体に固定し、その上に淡い幕を重ねて文字の読みやすさを保つ。
   background-attachment: fixed は iOS で効かないため、position: fixed の層で実現している */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.page-bg > span {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
}
/* ログイン後の画面は見出しや説明文がカードの外にも出るので、幕を濃くとる */
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 248, 242, .72) 0%, rgba(255, 248, 242, .82) 100%);
}
/* ログイン等の 1 カラム画面は内容がカードに収まるので、写真を活かして幕を薄くする */
body.plain .page-bg::after {
  background: linear-gradient(180deg, rgba(255, 248, 242, .10) 0%, rgba(255, 248, 242, .30) 100%);
}
/* 複数の画像はゆっくり切り替える（2 枚目を重ねて透明度を変える） */
.page-bg--rotate > span + span {
  opacity: 0;
  animation: page-bg-fade 18s ease-in-out infinite;
}
@keyframes page-bg-fade {
  0%, 40%  { opacity: 0; }
  50%, 90% { opacity: 1; }
  100%     { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .page-bg--rotate > span + span { animation: none; }
}

/* 写真の上に直接載る文字（カードの外）は、白い下地を敷いて読めるようにする */
body.plain.has-bg .app-title {
  display: table;
  margin-inline: auto;
  padding: 4px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
}
body.plain.has-bg main.centered > p {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
}
body.plain.has-bg main.centered > .form-actions,
body.plain.has-bg main.centered > form > .form-actions {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
}
body.has-bg .site-footer {
  background: rgba(255, 255, 255, .85);
  border-top-color: transparent;
}
body.has-bg { background: transparent; }
