:root {
  --red: #d0121b;
  --red-dark: #a30d15;
  --cream: #fdf6e6;
  --cream-deep: #f6e8c8;
  --ink: #1b1613;
  --ink-soft: #4a423c;
  --ink-mute: #8a8078;
  --yellow: #ffd400;
  --green: #1f7a4d;
  --green-dark: #145635;
  --line-green: #06c755;
  --border: #e0d3b4;
  --danger: #b3261e;
  --danger-dark: #7d1a15;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --shadow: 0 2px 8px rgba(27, 22, 19, 0.12);
}

* { box-sizing: border-box; }

/*
 * hidden 属性を常に優先させる。
 * .btn-stack / .party のように display を指定した要素では、UAの [hidden]{display:none}
 * が上書きされてしまい、同行者欄やキャンセル確認の出し分けが効かなくなるため。
 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", Meiryo, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--red-dark); }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid rgba(208, 18, 27, 0.45); outline-offset: 2px; }

/* ---------- ヘッダー / フッター ---------- */

.site-header {
  background: var(--red);
  color: #fff;
  padding: 12px 16px;
  border-bottom: 5px solid var(--yellow);
}
.site-header a { color: #fff; text-decoration: none; }
.site-header .brand { font-weight: 900; font-size: 1.02rem; letter-spacing: 0.02em; line-height: 1.25; }
.site-header .header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-header .header-nav { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.site-header .header-nav a,
.site-header .header-logout {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  background: none;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  /* 360〜390px で「マイ予約」がピル内で折り返さないようにする */
  white-space: nowrap;
}
/* 長いLINE表示名でヘッダーが崩れないよう省略表示にし、狭い画面では隠す */
.site-header .header-nav span {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 419px) {
  .site-header .header-nav span { display: none; }
}
.site-header .brand { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wrap { max-width: 680px; margin: 0 auto; padding: 16px; }

.site-footer {
  margin-top: 32px;
  padding: 20px 16px 40px;
  background: var(--ink);
  color: #e9e2d6;
  font-size: 0.82rem;
  text-align: center;
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--yellow); }

/* ---------- ヒーロー / 見出し ---------- */

.hero {
  background: var(--red);
  color: #fff;
  padding: 24px 16px 28px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.35;
  text-wrap: pretty;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}
.hero .hero-sub {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.98rem;
}
.hero p { margin: 14px 0 0; font-size: 0.92rem; }

h2 {
  font-size: 1.15rem;
  font-weight: 900;
  margin: 28px 0 12px;
  padding-left: 11px;
  border-left: 6px solid var(--red);
  line-height: 1.4;
}
h3 { font-size: 1rem; margin: 20px 0 8px; }

/* ---------- カード ---------- */

.card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card > *:first-child { margin-top: 0; }
.card > *:last-child { margin-bottom: 0; }

/* 便カード。ヘッダー帯で行き / 帰りを最初に読ませる */
.trip-card { padding: 0; overflow: hidden; border-color: var(--ink); }
.trip-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--red);
}
.trip-card.is-return .trip-card__head { background: var(--green); }
.trip-card.is-full .trip-card__head { background: var(--ink-mute); }
.trip-card__dir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}
.trip-card__tag {
  border: 1.5px solid var(--yellow);
  border-radius: 5px;
  padding: 4px 7px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
}
.trip-card__state {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 6px 11px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.trip-card__body { padding: 16px 14px; }

.trip-when { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trip-when .trip-date { font-size: 1.35rem; font-weight: 900; line-height: 1.2; }
.trip-when .trip-time { font-size: 1.9rem; font-weight: 900; line-height: 1; color: var(--red); }
.trip-card.is-return .trip-when .trip-time { color: var(--green); }

.route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px dashed rgba(27, 22, 19, 0.3);
  border-bottom: 1px dashed rgba(27, 22, 19, 0.3);
}
.route__col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.route__col.to { text-align: right; }
.route__label { font-size: 0.68rem; font-weight: 700; color: var(--ink-mute); }
.route__place { font-size: 1.02rem; font-weight: 900; line-height: 1.25; }
.route__sub { font-size: 0.7rem; color: var(--ink-soft); line-height: 1.35; }
.route__arrow { font-size: 1.25rem; font-weight: 900; color: var(--red); }
.trip-card.is-return .route__arrow { color: var(--green); }

.seats { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.95rem; font-weight: 800; }
.seats .seats-num { color: var(--red); font-size: 1.5rem; }
.trip-card.is-return .seats .seats-num { color: var(--green); }
.seats.is-full { color: var(--ink-soft); }
.seat-badge { border-radius: 5px; padding: 5px 8px; font-size: 0.75rem; font-weight: 700; margin-left: auto; }
.seat-badge.is-few { background: #fbe6e6; color: var(--danger); }
.seat-badge.is-open { background: #e6f4ec; color: var(--green); }
.seat-badge.is-full { background: #f1ece2; color: var(--ink-soft); }

/* ---------- バッジ ---------- */

.badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; }
.badge-open { background: #e6f4ec; color: var(--green); }
.badge-closed { background: #f1ece2; color: var(--ink-soft); }
.badge-full { background: #fbe6e6; color: var(--danger); }
.badge-cancelled { background: #f1ece2; color: var(--ink-soft); }
.badge-confirmed { background: #e6f4ec; color: var(--green); }
.badge-line { background: #e6f4ec; color: var(--green); }
.badge-proxy { background: #fff8dd; color: #8a5a00; }

.trip-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.trip-badge.is-return { background: var(--green); }
.trip-badge.is-inactive { background: var(--ink-mute); }

.trip-datetime { font-size: 1.3rem; font-weight: 900; line-height: 1.4; margin: 0; }
.trip-route { font-size: 0.98rem; font-weight: 700; margin: 4px 0 0; }
.trip-meta { color: var(--ink-soft); font-size: 0.86rem; margin: 6px 0 0; }

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--red-dark);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dark); }
.btn[disabled], .btn.is-disabled {
  background: #cfc6b6; box-shadow: none; color: #fff; pointer-events: none;
}
.btn-secondary {
  background: #fff; color: var(--ink); border: 2px solid var(--border);
  box-shadow: none; font-weight: 700;
}
.btn-secondary:hover { background: var(--cream-deep); }
.btn-return { background: var(--green); box-shadow: 0 3px 0 var(--green-dark); }
.btn-return:active { box-shadow: 0 1px 0 var(--green-dark); }
.btn-line { background: var(--line-green); box-shadow: 0 3px 0 #049a44; }
.btn-danger { background: var(--danger); box-shadow: 0 3px 0 var(--danger-dark); }
.btn-danger-outline {
  background: #fff; color: var(--danger); border: 2px solid var(--danger); box-shadow: none; font-weight: 700;
}
.btn-sm { min-height: 46px; width: auto; padding: 8px 16px; font-size: 0.92rem; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1 1 auto; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 注意・アラート ---------- */

.notice {
  background: var(--cream-deep);
  border: 2px dashed var(--red);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.9rem;
}
.notice strong { font-weight: 800; }

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.95rem;
}
.alert-error { background: #fbe6e6; color: var(--danger); border: 2px solid var(--danger); }
.alert-success { background: #e6f4ec; color: var(--green); border: 2px solid var(--green); }
.alert-info { background: #fff8dd; color: var(--ink); border: 2px solid var(--yellow); }

.done-head { display: flex; align-items: flex-start; gap: 12px; }
.done-head .done-mark {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 1.5rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.done-head h2 { margin: 0; border: none; padding: 0; font-size: 1.25rem; }

/* ---------- 料金 / 注意リスト ---------- */

.price-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.price-table th, .price-table td {
  border-bottom: 1px solid var(--border); padding: 10px 4px; text-align: left;
}
.price-table td:last-child { text-align: right; font-weight: 900; white-space: nowrap; font-size: 1.1rem; }
.price-table tr:last-child th, .price-table tr:last-child td { border-bottom: none; }

ul.notes { padding-left: 1.2em; margin: 8px 0; font-size: 0.9rem; }
ul.notes li { margin-bottom: 6px; }

/* ---------- フォーム ---------- */

form .field { margin-bottom: 18px; }
form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
form .req { color: var(--red); font-size: 0.78rem; margin-left: 6px; }
form .hint { color: var(--ink-soft); font-size: 0.82rem; margin-top: 5px; }

input[type="text"], input[type="tel"], input[type="password"],
input[type="number"], input[type="datetime-local"], input[type="search"], select {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 3px solid rgba(208, 18, 27, 0.35); border-color: var(--red); }
input[aria-invalid="true"] { border-color: var(--danger); }

/* 人数選択。select ではなく大きなラジオボタンで選ぶ（name/値は従来どおり） */
.party { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.party__opt { position: relative; margin: 0; }
.party__opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.party__opt span {
  display: flex; align-items: center; justify-content: center;
  min-height: 60px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  transition: transform 0.1s ease, background 0.12s ease;
}
.party__opt input:checked + span {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px);
}
.party.is-return .party__opt input:checked + span { background: var(--green); border-color: var(--green); }
.party__opt input:focus-visible + span { outline: 3px solid rgba(208, 18, 27, 0.45); outline-offset: 2px; }
.party__opt input:disabled { cursor: not-allowed; }
.party__opt input:disabled + span { background: #f1ece2; border-color: var(--border); color: #a09689; }
.party__opt input:disabled + span::after { content: "×"; margin-left: 4px; font-size: 0.85rem; }

.checkbox-field {
  display: flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 8px 12px;
  border: 2px solid var(--ink); border-radius: 10px; background: #fff;
}
.checkbox-field input[type="checkbox"] { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--red); }
.checkbox-field label { margin: 0; font-weight: 700; font-size: 0.92rem; }

.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem;
}
.summary-list li:last-child { border-bottom: none; }
.summary-list li .k { color: var(--ink-soft); font-weight: 700; flex: none; }
.summary-list li .v { text-align: right; font-weight: 700; }

.stack > * + * { margin-top: 12px; }
.muted { color: var(--ink-soft); font-size: 0.88rem; }
.center { text-align: center; }
.danger-text { color: var(--danger); font-weight: 800; }

/* キャンセル確認（予約詳細ページ内。ルート追加なし） */
.cancel-panel { border: 2px solid var(--danger); border-radius: var(--radius); padding: 14px; background: #fff; }
.cancel-panel h3 { margin: 0 0 10px; color: var(--danger); font-size: 1.05rem; }
.cancel-panel .cancel-lead {
  background: #fbe6e6; color: var(--danger); border-radius: 10px;
  padding: 10px 12px; font-weight: 800; margin: 0 0 12px;
}

/* ---------- 管理画面 ---------- */

.admin-header { background: var(--ink); border-bottom-color: var(--red); }
.admin-wrap { max-width: 1000px; }
.admin-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .admin-grid { grid-template-columns: 1fr 1fr; } }

.stat { font-size: 1.9rem; font-weight: 900; margin: 10px 0 0; line-height: 1; }
.stat small { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.stat-remaining { margin: 8px 0 0; font-size: 1rem; font-weight: 800; }
.stat-remaining.is-few { color: var(--danger); }

.admin-card { border-top: 5px solid var(--red); }
.admin-card.is-return { border-top-color: var(--green); }

.book-row { border: 2px solid var(--border); border-radius: var(--radius); background: #fff; padding: 14px; box-shadow: var(--shadow); }
.book-row.is-boarded { border-color: var(--green); }
.book-row.is-cancelled { opacity: 0.6; }
.book-row__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-row__id { font-size: 0.75rem; color: var(--ink-mute); }
.book-row__name { font-size: 1.05rem; font-weight: 900; }
.book-row__size { background: var(--cream-deep); border-radius: 6px; padding: 3px 8px; font-size: 0.82rem; font-weight: 700; }
.book-row__meta { margin: 8px 0 0; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7; }
.book-row__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.book-row__count { margin-left: auto; font-size: 1.05rem; font-weight: 900; }
.book-row__count small { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }

.inline-form { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.counter-btn {
  min-width: 52px; min-height: 52px; border: 2px solid var(--border);
  background: #fff; border-radius: var(--radius-sm);
  font-size: 1.4rem; font-weight: 900; cursor: pointer; color: var(--ink);
}
.counter-btn:hover { background: var(--cream-deep); }
.inline-form .btn-all { flex: 1 1 120px; min-height: 52px; }

.progress { height: 8px; border-radius: 999px; background: #f1ece2; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: var(--green); }

.search-form { display: flex; gap: 8px; align-items: flex-end; }
.search-form .field { flex: 1; margin: 0; }

.settings-group + .settings-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- 予約ページ（複数枠選択） ---------- */

.slot-card.is-selected { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 18, 27, 0.15); }
.slot-card.is-return.is-selected { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.15); }

.slot-pick { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(27, 22, 19, 0.3); }
.slot-toggle { min-height: 56px; }
.slot-toggle span { font-size: 1rem; }
.slot-fields { margin-top: 14px; }
.slot-fields .field:last-child { margin-bottom: 0; }

.slot-lines { list-style: none; margin: 10px 0 0; padding: 0; }
.slot-lines li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.slot-lines li:last-child { border-bottom: 0; }
.slot-line__name { font-weight: 800; min-width: 3.5em; }
.slot-line__when { color: var(--ink-soft); }
.slot-line__seats { margin-left: auto; font-weight: 800; }

.route--single { grid-template-columns: 1fr; }
.route--single .route__col.to { text-align: left; }

code {
  background: var(--cream-deep); border-radius: 4px; padding: 1px 5px; font-size: 0.86em;
}

/* ============================================================
   D1 / D2  公開予約ページ
   ============================================================ */

/* 枠カードの選択状態。行き/帰りの赤緑交互をやめ、
   ブランド赤を基本にして「選択されているか」だけを色で示す。 */
.slot-card { border-color: var(--ink); }
.slot-card .trip-card__head { background: var(--red); }
.slot-card.is-full .trip-card__head { background: var(--ink-mute); }
.slot-card.is-selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(208, 18, 27, 0.15);
}

.slot-pick {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(27, 22, 19, 0.3);
}
.slot-toggle { min-height: 56px; }
.slot-card.is-selected .slot-toggle { border-color: var(--red); background: #fff7f7; }
.slot-toggle input { accent-color: var(--red); }
.slot-fields { margin-top: 14px; }
.slot-fields > .field:last-child { margin-bottom: 0; }
.slot-single-party { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* 1予約あたりの最大人数が多い枠は3列にして、ボタンを細くしすぎない */
.party.party--wide { grid-template-columns: repeat(3, 1fr); }

/* 同行者欄をグループとして見せる（no-JSでは最大人数分が常に見える） */
.companion-group {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(246, 232, 200, 0.45);
}
.companion-group__lead { margin: 0 0 4px; font-size: 0.85rem; font-weight: 800; }
.companion-group .hint { margin-top: 0; }
.companion-group .field:last-child { margin-bottom: 0; }

/* 受付期間の案内 */
.slot-timing {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.slot-timing.is-waiting { color: var(--ink); }
.slot-timing strong { font-weight: 800; }
.seats.is-closed, .seats.is-waiting { color: var(--ink-soft); font-weight: 800; }
.slot-card.is-waiting { opacity: 0.94; }
.slot-card.is-waiting .trip-card__head { background: #6b625a; }
.section-head h2.is-waiting { color: var(--ink-soft); border-left-color: #6b625a; }
.section-head .count.is-waiting { background: #f1ece2; color: var(--ink-soft); }

/* 下部固定CTA + 選択中サマリー */
.sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 16px -16px 0;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(253, 246, 230, 0.97);
  border-top: 2px solid var(--border);
  box-shadow: 0 -6px 18px rgba(27, 22, 19, 0.12);
}
.sticky-cta__summary { margin-bottom: 10px; }
.sticky-cta__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 900;
}
.sticky-cta__total { margin-left: auto; font-weight: 700; color: var(--ink-soft); }
.sticky-cta__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sticky-cta__list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.sticky-cta__list .s-name { font-weight: 800; flex: none; }
.sticky-cta__list .s-when {
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sticky-cta__list .s-size { margin-left: auto; font-weight: 800; flex: none; }
.sticky-cta .btn { min-height: 56px; }
.sticky-cta__hint { margin: 7px 0 0; font-size: 0.74rem; color: var(--ink-soft); text-align: center; }

/* 送信前の確認セクション（同一フォーム内。JS無効時は最初から開いている） */
.confirm-panel {
  margin-top: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.confirm-panel h3 { margin: 0 0 12px; font-size: 1.1rem; }
.confirm-lead {
  background: var(--cream-deep);
  border: 2px dashed var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 0.85rem;
  line-height: 1.7;
}
.confirm-slot {
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.confirm-slot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  background: var(--red);
  color: #fff;
}
.confirm-slot__name { font-size: 1.05rem; font-weight: 900; }
.confirm-slot__size {
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 800;
  flex: none;
}
.confirm-slot__body { padding: 13px; }
.confirm-slot__when { margin: 0; font-size: 1.05rem; font-weight: 900; line-height: 1.35; }
.confirm-slot__where { margin: 5px 0 0; font-size: 0.85rem; font-weight: 700; }
.confirm-slot__comp {
  margin: 11px 0 0;
  padding-top: 11px;
  border-top: 1px dashed rgba(27, 22, 19, 0.25);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ============================================================
   D3  マイ予約：まとめて予約のグルーピング
   ============================================================ */

.booking-group {
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  background: rgba(208, 18, 27, 0.04);
  padding: 11px 11px 12px;
  margin-bottom: 16px;
}
.booking-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 0 3px;
}
.booking-group__badge {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 800;
}
.booking-group__meta { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }
.booking-group__at { margin-left: auto; font-size: 0.72rem; color: var(--ink-mute); }
.booking-group .card { margin-bottom: 10px; }
.booking-group .card:last-of-type { margin-bottom: 0; }
.booking-group__note { margin: 10px 3px 0; font-size: 0.75rem; color: var(--ink-soft); line-height: 1.6; }

/* ============================================================
   D4  公開トップ：受付中 / 受付終了の分離
   ============================================================ */

.section-head { display: flex; align-items: center; gap: 9px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; }
.section-head .count {
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #e6f4ec;
  color: var(--green);
}
.section-head .count.is-closed { background: #f1ece2; color: var(--ink-soft); }
.section-head h2.is-closed { color: var(--ink-soft); border-left-color: var(--ink-mute); }

.slot-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.slot-lines li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(27, 22, 19, 0.2);
  font-size: 0.85rem;
}
.slot-lines li:last-child { border-bottom: none; }
.slot-line__name { font-weight: 800; flex: none; }
.slot-line__when {
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-line__seats { margin-left: auto; font-weight: 700; flex: none; }

/* 受付終了のページは畳んで軽く見せる */
.page-closed {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
  opacity: 0.78;
}
.page-closed__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-closed__title { font-size: 0.95rem; font-weight: 900; color: var(--ink-soft); min-width: 0; }
.page-closed__meta { margin: 8px 0 0; font-size: 0.8rem; color: var(--ink-soft); }

/* ============================================================
   D5 / D6  管理画面：白ベースの業務UI
   ============================================================ */

/* 管理画面だけ背景を業務向けのグレーに。:has 未対応環境ではクリーム地のまま（表示は崩れない）。 */
body:has(.admin-header) { background: #f4f6f8; }
.admin-wrap h2 {
  font-size: 1.05rem;
  border-left-color: var(--red);
  margin: 24px 0 12px;
}
.admin-wrap h3 { font-size: 0.95rem; }

.admin-card-plain {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 14px;
}

/* 運用サマリーのKPI */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: #fff;
  border: 1px solid #d8dde3;
  border-top: 4px solid var(--ink);
  border-radius: 10px;
  padding: 13px;
}
.kpi.is-primary { border-top-color: var(--red); }
.kpi.is-alert { border-color: #f0c9c9; border-top-color: var(--danger); }
.kpi.is-ok { border-top-color: var(--green); }
.kpi__label { font-size: 0.74rem; font-weight: 700; color: #5b6470; line-height: 1.4; }
.kpi__value { margin: 7px 0 0; font-size: 1.55rem; font-weight: 800; line-height: 1; }
.kpi__value small { font-size: 0.74rem; font-weight: 700; color: #5b6470; }
.kpi__note { margin: 6px 0 0; font-size: 0.7rem; color: #5b6470; line-height: 1.4; }

/* 一覧テーブル風カード（本日の受付予定 / 残席わずか） */
.list-card {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.list-card.is-alert { border-color: #f0c9c9; }
.list-card__head {
  padding: 11px 13px;
  background: #fafbfc;
  border-bottom: 1px solid #d8dde3;
  font-size: 0.82rem;
  font-weight: 800;
}
.list-card.is-alert .list-card__head {
  background: #fdf5f5;
  border-bottom-color: #f0c9c9;
  color: #991b1b;
}
.list-card__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid #eef1f4;
}
.list-card__row:last-child { border-bottom: none; }
.list-card__time { width: 52px; flex: none; font-size: 0.95rem; font-weight: 800; }
.list-card__main { flex: 1; min-width: 0; }
.list-card__name {
  /* span のままだと text-overflow が効かず、右のバッジへ文字が重なる */
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-card__sub {
  display: block;
  margin: 3px 0 0;
  font-size: 0.72rem;
  color: #5b6470;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-card__num { flex: none; text-align: right; }
.list-card__num strong { display: block; font-size: 0.9rem; font-weight: 800; }
.list-card__num small { font-size: 0.7rem; color: #5b6470; }
.list-card__row .btn { width: auto; flex: none; }
.badge-few { background: #fbe6e6; color: var(--danger); border-radius: 6px; padding: 5px 9px; font-size: 0.75rem; font-weight: 800; }

/* 予約ページ一覧（管理） */
.page-row {
  background: #fff;
  border: 1px solid #d8dde3;
  border-top: 4px solid var(--red);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.page-row.is-draft { border-top-color: #b9c0c9; }
.page-row__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.page-row__title { font-size: 0.92rem; font-weight: 800; line-height: 1.35; min-width: 0; }
.page-row__meta { margin: 7px 0 0; font-size: 0.74rem; color: #5b6470; }
.page-row__stat { margin: 9px 0 0; display: flex; align-items: baseline; gap: 7px; }
.page-row__stat strong { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.page-row__stat span { font-size: 0.74rem; font-weight: 700; color: #5b6470; }
.page-row__url { margin: 9px 0 0; font-size: 0.7rem; color: #5b6470; word-break: break-all; }
.page-row .btn-row { margin-top: 11px; }
.page-row .btn { min-height: 44px; font-size: 0.8rem; }

/* 管理画面のフォームは白ベースの落ち着いた枠線に寄せる */
.admin-wrap input[type="text"], .admin-wrap input[type="tel"], .admin-wrap input[type="password"],
.admin-wrap input[type="number"], .admin-wrap input[type="datetime-local"],
.admin-wrap input[type="search"], .admin-wrap select {
  border: 1px solid #b9c0c9;
  border-radius: 8px;
  min-height: 48px;
}
.admin-wrap input:focus, .admin-wrap select:focus {
  border-color: var(--ink);
  outline: 2px solid rgba(27, 22, 19, 0.2);
}
.admin-wrap .card { border: 1px solid #d8dde3; border-radius: 10px; box-shadow: none; }
.admin-wrap .btn { border-radius: 8px; box-shadow: none; }
.admin-wrap .btn:active { transform: none; }
.admin-wrap .btn-secondary { border: 1px solid #d8dde3; }
.admin-wrap .btn-secondary:hover { background: #f4f6f8; }
.admin-wrap .counter-btn { border: 1px solid #b9c0c9; }
.admin-wrap .counter-btn:hover { background: #eef1f4; }
.admin-wrap .book-row { border: 1px solid #d8dde3; border-radius: 10px; box-shadow: none; }
.admin-wrap .book-row.is-boarded { border-color: var(--green); }
.admin-wrap .book-row__meta a { font-weight: 700; }

/* 枠設定フォームのグルーピング */
.form-section { margin-bottom: 16px; }
.form-section__title {
  font-size: 0.88rem;
  font-weight: 800;
  margin: 0 0 10px;
  padding-left: 11px;
  border-left: 6px solid var(--red);
}
.form-note {
  background: #fff8dd;
  border: 1px solid #e5c477;
  border-radius: 8px;
  padding: 11px;
  font-size: 0.75rem;
  line-height: 1.6;
  margin: 0 0 14px;
}
.field-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field-2col .field { margin-bottom: 0; }
