/*
 * Lシステム 画面の土台。
 *
 * 店内は暗いのでダークを既定にする（docs/03_SCREENS.md）。
 * 明るい環境の端末のためにライトも用意する。
 * タップ領域は 44px 以上。片手で押せる位置に主要操作を置く。
 */

:root {
  color-scheme: dark light;

  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #212530;
  --line: #2c313d;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #3ddc97;
  --accent-ink: #06281c;
  --danger: #ff6b6b;
  --warn: #ffc857;

  --free: #2f3542;
  --occupied: #1f6f4f;
  --checking: #7a5c12;
  --paid: #384766;
  --cleaning: #4a3a55;
  --disabled: #23262d;

  --radius: 12px;
  --tap: 44px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #eef0f4;
    --line: #d8dce3;
    --text: #1b2027;
    /*
     * 🔴 明るいほうは、色を**濃くしないと読めない**（D-058）。
     * 白い紙の上の色は、暗い画面の上の同じ色より薄く見える。
     * ここは `npm run check:contrast` が数字で見ている。
     */
    --muted: #535a65;
    --accent: #0b7a4d;
    --accent-ink: #ffffff;
    --danger: #c62828;
    --warn: #8a6000;
    --free: #e6e9ef;
    --occupied: #cdebdc;
    --checking: #f6e6b8;
    --paid: #dbe3f5;
    --cleaning: #e7dcee;
    --disabled: #e0e2e6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .spacer { flex: 1; }
.topbar .clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: var(--tap);
  white-space: nowrap;
}

/*
 * 店舗名は長いことがある（「◯◯◯◯ 銀座本店」など）。
 * 2行まで折り返し、それ以上は省略する。ボタンを押し出さない。
 */
.topbar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  padding-top: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* ── ハンバーガーメニュー ───────────────── */
/*
 * ハンバーガー。
 *
 * grid + place-items にすると、行が高さいっぱいに引き伸ばされて
 * 線の間隔が gap ではなく 15px 開いてしまう（place-items は行の中の位置しか
 * 決めない）。flex なら主軸方向に伸びないので、指定した間隔のまま出る。
 */
.nav-toggle {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border-color: transparent;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  flex: none;
  background: var(--text);
  border-radius: 1px;
}

.nav-overlay {
  position: fixed;
  /* inset は Safari 14.1 から。古い端末では**帯が広がらず、外を押しても閉じない** */
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 20;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 82vw);
  z-index: 21;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}
.nav-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.35;
  padding-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.nav-close {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: transparent;
  border-color: transparent;
  font-size: 1.1rem;
}

.nav-list { padding: 8px; display: flex; flex-direction: column; }
.nav-item {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-size: 1rem;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current="page"] { background: var(--surface-2); font-weight: 600; }

/*
 * 広い画面では、メニューを開いたままにする（2026-09-08）。
 *
 * パソコンで画面を移るたびにハンバーガーを押すのは、手数が増えるだけ。
 * ただし畳めるようにもしておく（広く使いたいときがある）。
 *
 * 開いているときは**かぶせずに押し出す**。かぶせると、開けたまま
 * 作業ができない（後ろが暗くなって押せない）。畳むとスマホと同じ形に戻る。
 *
 * 🔴 **開閉の状態は端末に覚えさせて、全ページで同じにする**
 * （共通ルール4：ナビは全ページ・全実装で同一——開閉状態も含む）。
 */
@media (min-width: 1000px) {
  body.nav-docked { padding-left: 260px; }
  body.nav-docked .nav-drawer { width: 260px; }
}

main { padding: 14px; max-width: 1100px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

button, .btn {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
.btn-danger { color: var(--danger); }
/* style="" 属性は CSP（style-src 'self'）で弾かれるので、クラスで持つ */
.btn-wide { flex: 1; }
.btn-flex { flex: 1 1 160px; }
.btn-link { display: inline-flex; align-items: center; text-decoration: none; }
.mt { margin-top: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .9rem; }
input, select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

/* エラーは人間の言葉で出す。403 や例外をそのまま見せない */
.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.notice-error { border-color: var(--danger); }
.notice-hint { color: var(--muted); font-size: .9rem; margin-top: 4px; }
[hidden] { display: none !important; }

/* ── ログイン ───────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 6px; font-size: 1.3rem; font-weight: 600; }
.brand-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }

/* ── ホール ─────────────────────────────── */
.floors { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.floors button { white-space: nowrap; }
.floors button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.floor-view { position: relative; width: 100%; overflow: auto; }
/* 入りきらない幅では縮めて出す（transform-origin を左上に固定して測れるようにする） */
.floor-canvas { position: relative; min-height: 320px; transform-origin: 0 0; }

.obj { position: absolute; border-radius: 8px; }
.obj-wall, .obj-pillar { background: var(--line); }
.obj-door { background: transparent; border: 2px dashed var(--muted); }
.obj-counter { background: var(--surface-2); border: 1px solid var(--line); }
.obj-text { color: var(--muted); font-size: .8rem; display: grid; place-items: center; }

.table-btn {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 4px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: .8rem; line-height: 1.25;
}
.table-btn .no { font-size: 1rem; font-weight: 700; }
/* 色だけで状態を表さない。必ず文字を併記する */
.table-btn .state { font-size: .75rem; }
.st-free { background: var(--free); }
.st-occupied { background: var(--occupied); }
/* 🔴 文字の色を書き込まない。暗いほうの背景（#7a5c12）の上で読めなくなる（D-058） */
.st-checking { background: var(--checking); color: var(--text); }
.st-paid { background: var(--paid); }
.st-cleaning { background: var(--cleaning); }
.st-disabled { background: var(--disabled); color: var(--muted); }

/* ── 見取り図を直す（/tables）─────────────
 * 卓を指でつまんで動かす。刻みに吸い付くので、目分量でも揃って見える。
 */
.plan {
  position: relative;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.plan-inner {
  position: relative;
  transform-origin: 0 0;
  /* 方眼。置く場所の見当がつくようにする（薄く敷くだけ） */
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 20px 20px;
}
.plan-obj {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 4px; text-align: center;
  min-height: 0;                 /* 卓の大きさは店舗が決める（ボタンの既定に負けない） */
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--free); color: var(--text);
  font-size: .8rem; line-height: 1.25;
  touch-action: none;            /* 卓の上では画面を動かさない（指は卓を運ぶ） */
  user-select: none; -webkit-user-select: none;
}
.plan-obj .no { font-size: 1rem; font-weight: 700; }
.plan-obj[data-drag="true"] { z-index: 3; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
/* 重なる場所に持っていったとき。置くと元に戻ることを、置く前に見せる */
.plan-obj[data-over="true"] { border-color: var(--danger); }
.plan-obj[data-fresh="true"] { border-color: var(--accent); }
/* :focus-visible は Safari 15.4 から。**古い端末で枠が消えない**ように両方書く */
.plan-obj:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-obj:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-wall, .plan-pillar { background: var(--line); }
.plan-door { background: transparent; border: 2px dashed var(--muted); }
.plan-counter { background: var(--surface-2); }
.plan-text { color: var(--muted); background: transparent; border-color: transparent; }

.plan-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.plan-bar .grow { flex: 1; min-width: 0; }

/* 置く（壁・カウンター・柱） */
.plan-place { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/*
 * 細い置きもの（壁・柱）でも指が当たるように、**当たり判定だけ**外へ広げる。
 * 見た目の太さは店舗様が決めたまま、押せる範囲は 44px に近づける（共通ルール7）。
 */
.plan-wall::before, .plan-pillar::before, .plan-counter::before {
  content: ""; position: absolute; top: -12px; right: -12px; bottom: -12px; left: -12px;
}

/* 選んでいる1つ。大きさを変える取っ手が右下に出る */
.plan-obj[data-picked="true"] { border-color: var(--accent); z-index: 2; }
.plan-handle {
  position: absolute; right: -10px; bottom: -10px;
  width: 26px; height: 26px;
  border: 2px solid var(--accent); border-radius: 50%;
  background: var(--surface);
  touch-action: none; cursor: nwse-resize;
}

/* 選んだ1つを直す帯。見取り図の**上**に出す（変わったところが見えていること） */
.plan-edit {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px; border: 1px solid var(--accent); border-radius: var(--radius);
}
.plan-group { display: inline-flex; align-items: center; gap: 6px; }
.plan-num { min-width: 2.5em; text-align: center; font-variant-numeric: tabular-nums; }
.plan-edit button { padding: 0 14px; }

/* 狭い画面は縦リスト。俯瞰図は出さない（切れて読めないため） */
.floor-list { display: flex; flex-direction: column; gap: 8px; }
.list-table {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}
.list-table .no { font-size: 1.05rem; font-weight: 700; min-width: 5.5em; }
.list-table .state { font-size: .9rem; }
.list-table .grow { flex: 1; }

.summary {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
}
.summary b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── 卓詳細・注文 ───────────────────────── */
.rows { border-top: 1px solid var(--line); margin-top: 12px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row .grow { flex: 1; min-width: 0; }
.row .amount { font-variant-numeric: tabular-nums; }
.row.voided { color: var(--muted); text-decoration: line-through; }
.meta { color: var(--muted); font-size: .85rem; }

.total-line {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; font-size: 1.1rem;
}
.total-line b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

.grid-products {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 12px;
}
.grid-products button { flex-direction: column; padding: 10px; min-height: 72px; }
.grid-products .price { color: var(--muted); font-size: .85rem; }

.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
/* 空状態の導線。リンクをボタンと同じ形にして、タップ領域を確保する */
.empty-actions { justify-content: center; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

.section-title { font-size: 1rem; margin: 0 0 4px; font-weight: 600; }

/* 初回パスワードの表示。読み上げ・書き写しのため大きく等幅で */
/*
 * QR。**白地は必ず残す**（O-31）——ダークモードの黒地にそのまま置くと、
 * 読み取り機が模様を見つけられない。余白（クワイエットゾーン）は SVG 側に入っている。
 */
.qr-box {
  margin: 12px 0;
  text-align: center;
}

.qr-box .qr {
  width: min(220px, 60vw);
  height: auto;
  border-radius: 8px;
  background: #ffffff;
}

.creds {
  margin: 10px 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  white-space: pre-line;
  user-select: all;
}

/* ── 本部が「見ている」ことを画面に出す ──── */
/*
 * 本部が店舗を見ているとき、画面のどこにいても分かるようにする。
 * 「いま自分は他店のデータを見ている」を隠さない（docs/02_RBAC.md §4）。
 */
.viewing-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.viewing-banner b { color: var(--text); }
.viewing-banner .grow { flex: 1; }

/* ── 一覧の行（店舗・代理店・会員証） ────── */
.row-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px; margin-bottom: 8px;
  text-align: left; min-height: var(--tap);
}
/* 店舗名・会社名は長いことがある。2行まで折り返して、ボタンを押し出さない */
.row-title {
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .78rem; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pill-active { background: var(--occupied); color: var(--text); border-color: transparent; }
.pill-quiet { background: var(--checking); color: var(--text); border-color: transparent; }
.pill-dormant { background: var(--surface-2); color: var(--danger); }

/* いくつか選ぶ枠（`askPick`）。選んだ行が、暗い店内でもすぐ分かるようにする */
.row-btn[aria-pressed="true"] { border-color: var(--accent); }
.pick-mark { color: var(--accent); font-weight: 700; margin-left: 8px; min-width: 1em; }

.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-row .grow { flex: 1 1 200px; }

/* ── デジタル会員証 ─────────────────────── */
/*
 * お客様が開く画面。片手・暗い店内・人に見られる前提。
 * 出すのは呼び名とポイントまで。連絡先も来店履歴も出さない。
 */
.member-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.member-card {
  width: 100%; max-width: 380px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.member-store { font-size: .9rem; color: var(--muted); }
.member-name { font-size: 1.6rem; font-weight: 700; margin: 6px 0 2px; overflow-wrap: anywhere; }
.member-rank { display: inline-block; margin-top: 6px; }
.member-points {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
}
.member-points b { font-size: 2rem; font-variant-numeric: tabular-nums; }
.member-no {
  margin-top: 16px; color: var(--muted); font-size: .85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.member-note { margin-top: 14px; color: var(--muted); font-size: .8rem; line-height: 1.5; }

/* 入力欄のあいだに置くラベル。上の欄と近づきすぎないように */
.mt-label { display: block; margin-top: 14px; }

/* 行の中に置く小さなボタン（指名の取消など） */
.btn-inline {
  min-height: 0; padding: 2px 8px; margin-left: 8px;
  font-size: .8rem; vertical-align: middle;
}

/*
 * 入り口の行き来。
 *
 * 立場ごとに入り口を分けてあるので、間違えた人がすぐ移れるようにする。
 * ただし主役はいまの入り口なので、小さく置く（1画面1目的を崩さない）。
 */
.other-doors {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .9rem;
}
/* 見た目は控えめでも、押せることが分かる形にする（タップ領域は44px） */
.other-doors a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text); text-decoration: none;
}
.other-doors a:hover { border-color: var(--muted); }

/*
 * セット時間を過ぎた卓。
 *
 * 色だけで表さない——店内は暗く、色の見え方も人による。文字の側で
 * 「延長◯分」と出したうえで、色を足すだけにする。
 */
.overtime { color: var(--warn); font-weight: 600; }
/* キープの期限切れ（→ D-154）。状態は変えず、過ぎていることだけを言う */
.meta.expired { color: var(--warn); font-weight: 600; }
/* まもなく終わる卓。延長（--warn）より前に気づけるよう、別の色で出す */
.soon { color: var(--accent); font-weight: 600; }

/* 卓に座っているキャスト。名前が増えても卓のカードを壊さない */
.casts {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  opacity: .9;
}

/* ── 紙で渡す1枚（支給額の下書き）───────── */
/*
 * 本人に手渡す形（O-38 / D-020）。画面には出さず、印刷のときだけ出す。
 *
 * 🔴 **表題と注記は、どの形でも必ず付ける。** 紙になった瞬間に
 * 「これは下書きです」が消えると、受け取った人が確定額だと思う。
 * 文言はサーバが返すものをそのまま出す（画面で書き換えない）。
 */
.sheet { display: none; }

@media print {
  /* 画面の道具（ナビ・入力欄・ボタン）は紙に要らない */
  body > :not(.sheet) { display: none !important; }

  body { background: #fff; color: #000; }
  .sheet {
    display: block;
    padding: 0;
    font-size: 11pt;
    line-height: 1.6;
  }
  .sheet-store { font-size: 10pt; }
  .sheet-title { font-size: 16pt; margin: 4mm 0 2mm; }
  .sheet-facts { margin: 0 0 4mm; }
  .sheet-facts div { display: flex; gap: 8mm; }
  .sheet-facts dt { width: 20mm; }
  .sheet-lines { width: 100%; border-collapse: collapse; }
  .sheet-lines th, .sheet-lines td {
    border-bottom: 1px solid #999; padding: 2mm 1mm; text-align: left;
  }
  .sheet-lines td.num, .sheet-lines th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .sheet-lines tfoot td { border-top: 2px solid #000; border-bottom: none; font-weight: 700; }
  .sheet-note { margin-top: 6mm; font-size: 9.5pt; }
  /* 出典（いつ・どの記録から作ったか）。紙だけ見て後から辿れるように */
  .sheet-source { margin-top: 3mm; font-size: 8.5pt; color: #444; }
}

@page { margin: 16mm; }

/* 確定したあとに元の記録が変わった下書き。一覧でも気づけるようにする（O-39） */
.pill-warn { background: transparent; color: var(--warn); border-color: var(--warn); }

/*
 * ひとつ選ぶ画面（choose.js）。
 *
 * 番号を打たせずに**押して選ぶ**。下から出すのは、片手で親指が届くため。
 */
.choose-overlay {
  position: fixed;
  /* inset は Safari 14.1 から（→ D-096）。書き下せば古い端末でも効く */
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 30;
}
.choose-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
}
.choose-list { margin-top: 10px; }

/* 数を選ぶ（人数など）。片手で押せる大きさで並べる */
.ask-counts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px;
}
.ask-counts button { min-height: 56px; font-size: 1.2rem; font-weight: 600; }

/* 広い画面では中央に小さく出す（下いっぱいに広げても読みにくいだけ） */
@media (min-width: 700px) {
  .choose-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw);
    border: 1px solid var(--line);
    border-radius: 16px;
  }
}

/*
 * 「この端末では開けませんでした」の帯（too-old.js）。
 *
 * 画面を消さずに**上に重ねるだけ**。読み込みが遅かっただけの端末で、
 * 動いている画面を消してしまわないため。
 */
.too-old {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding: 14px 16px calc(14px + env(safe-area-inset-top));
  /* 明るい黄色に白文字は読めない。**帯だけは固定の濃い色**で出す */
  background: #7a3b00;
  color: #ffffff;
  font-size: .95rem;
  line-height: 1.6;
}
.too-old-head { font-weight: 700; margin-bottom: 4px; }
