/* 店頭の2画面（受付タブレット・管理タブレット）の見た目。
   **スタッフ・お客様が慣れた今の画面の色づかい・並びを写し、良くしたいところだけ直す**（オーナー、2026年9月19日）。
   先方のプログラムや画像は使わず、写真を見て自分で書き起こす（お客様のスマホの画面と同じ考え方）。

   **色はここの :root だけで決める。** 画面側（HTML・JS）に色を直接書かない。 */

:root {
  /* 地と文字 */
  --bg: #f4f1ec;
  --surface: #ffffff;
  --ink: #1d2126;
  --muted: #646a72;
  --line: #ddd6cb;
  --line-strong: #b9b0a3;

  /* ブランド。ヘアカラーの店らしい、深いワインの色。大きなボタンの白抜き文字が読める濃さ */
  --brand: #8a2848;
  --brand-ink: #ffffff;
  --brand-soft: #f6e6ec;

  /* 管理タブレットの番号の色。**スタッフが慣れた今の画面の色を引き継ぐ**（オーナー、2026年9月19日）。
     色に意味がある：まだ案内していない人は赤＝「早く案内しなきゃ」。案内したら安心できるので青。
     値は、今の色の表（資料/その他の画面/番号の色の変化.png）から拾った。
     **背景の水色は引き継がない**（オーナー「最悪に嫌い」）。地は明るい灰色にして、白い四角を黒い枠で見せる */
  --board-bg: #e7e7e4;
  --tile-line: #2b2b2b;
  --tile-before: #ffffff;   /* 来店前（アプリ） */
  --tile-arrived: #b3282d;  /* 来店済み・まだ案内していない */
  --tile-done: #0275bc;     /* 案内済み */
  --tile-phone: #edb84e;    /* 電話受付の札（＋100円の目印）。四角の色はほかの人と同じ */
  --tile-phone-ink: #1d2126;
  --tile-canceled: #1f1f1f; /* キャンセル */
  --tile-empty: #cdcdc9;    /* 残りの枠 */
  --tile-empty-ink: #f4f4f2;
  --tile-ink: #ffffff;
  --next-ring: #1d2126;     /* 次に案内する人 */
  --goal-check-dark: #1d2126;  /* ゴールのマス（最後のマス）を囲むチェッカーフラッグの枠 */
  --goal-check-light: #ffffff;
  /* ゴールに届いた（完売手当）。黄色ではなく、光沢のある金（オーナーの見本、2026年9月19日） */
  --gold-hi: #e9d08a;
  --gold: #c9a24e;
  --gold-lo: #a07c36;
  --gold-ink: #ffffff;
  /* 完売したときの紙吹雪の色（public/cheer.js が読む） */
  --cheer-1: #ffd60a;
  --cheer-2: #ff4d6d;
  --cheer-3: #22c1a8;
  --cheer-4: #4361ee;
  --cheer-5: #ff9f1c;
  --cheer-6: #f72585;
  --cheer-veil: rgba(255, 248, 225, 0.82);

  /* 受付タブレット。今の画面の赤い「受付」と青い「アプリ・電話受付済」（写真から拾った） */
  --kiosk-red: #a8363b;
  --kiosk-blue: #3f86d9;
  --kiosk-ink: #ffffff;

  /* 赤：幅の終わりを過ぎてから案内した。本部が日報の写真で一目で分かるように（オーナー、2026年9月18日） */
  --late: #c8102e;

  /* 目印 */
  --warn: #b3261e;
  --warn-soft: #fbe9e7;
  --ok: #1b7a43;

  /* 本部のカレンダーで、体制ごとに色を分ける（一目で分かるように。オーナー、2026年9月20日）。
     並び順で決まるので、同じ体制はいつも同じ色。白地で読める濃さにそろえた。
     赤（--warn）は臨時休業に、ワイン（--brand）は「変えた日」に使っているので、ここでは外した */
  --pat-1: #1b5e8a;  /* 青 */
  --pat-2: #0f7a5f;  /* 緑 */
  --pat-3: #7a4bab;  /* 紫 */
  --pat-4: #a35a00;  /* 橙 */
  --pat-5: #1f6f78;  /* 青緑 */
  --pat-6: #8a6a00;  /* からし */
  --pat-7: #6b4a35;  /* 茶 */
  --pat-8: #4a5a6b;  /* 藍鼠 */

  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 33, 38, 0.08), 0 2px 8px rgba(29, 33, 38, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  /* Windows タブレットに標準で入っている、読みまちがえにくい書体（ユニバーサルデザイン）を先に */
  font-family: "BIZ UDPGothic", "BIZ UDゴシック", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  /* 店頭のタブレットで、長押しの選択や拡大が起きないように */
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; }

/* ---- 共通の部品 ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .store { font-size: 22px; font-weight: 700; }
.topbar .date { font-size: 18px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .clock { font-size: 26px; font-weight: 700; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 16px;
  white-space: nowrap;
}
.chip b { font-size: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: var(--radius);
  border: 2px solid var(--line-strong);
  background: var(--surface);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { background: var(--warn); border-color: var(--warn); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }

dialog {
  border: none;
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
dialog::backdrop { background: rgba(29, 33, 38, 0.45); }
dialog h2 { margin: 0 0 12px; font-size: 24px; }
dialog p { margin: 0 0 20px; font-size: 18px; line-height: 1.6; color: var(--muted); }
dialog .actions { display: flex; gap: 12px; justify-content: flex-end; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 18px;
  box-shadow: var(--shadow);
}
.toast button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.toast[hidden] { display: none; }

.error-bar {
  padding: 10px 20px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 16px;
  font-weight: 700;
}
.error-bar[hidden] { display: none; }

/* シフトとの食い違いを出す赤い帯。**本部の画面のどのタブにいても上に出る**
   （オーナー、2026年9月21日「カレンダーを開かなければ気づかないようなものではダメです」）。
   誤りの帯（薄い赤）より強くして、見落とさないようにする。 */
.alert-bar {
  background: var(--warn);
  color: var(--surface);
  padding: 10px 20px;
}
.alert-bar[hidden] { display: none; }
.alert-bar h2 { margin: 0 0 6px; font-size: 17px; }
.alert-bar ul { margin: 0; padding: 0; list-style: none; }
.alert-bar li { display: flex; gap: 10px; align-items: center; padding: 3px 0; font-size: 15px; font-weight: 700; }
.alert-bar li span { flex: 1; }
.alert-bar button {
  border: 1px solid var(--surface);
  background: transparent;
  color: var(--surface);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 14px;
  cursor: pointer;
}

/* ---- 管理タブレット ----
   **スクロールさせない。1画面に収める**（オーナー、2026年9月19日。これまでスクロールして使ったことが無い）。
   上の段・番号の四角（8列）・下のキャンセルの3つを縦に並べ、四角は残りの高さを段の数（--rows）で分ける。 */

body.board-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--board-bg);
}

.board-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}
.board-top .store { font-size: 30px; font-weight: 700; }
.board-top .set { font-size: 18px; }
.board-top .set b { font-size: 20px; margin-left: 4px; }
.board-top .spacer { flex: 1; }
.board-top .state { font-size: 20px; font-weight: 700; white-space: nowrap; }
.board-top .state b { font-size: 26px; }
.board-top .state.stop { color: var(--late); }
.board-top .clock { font-size: 30px; font-weight: 700; }

.legend { display: flex; gap: 12px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 18px; height: 18px; border-radius: 2px; }
.legend .before { background: var(--tile-before); border: 2px solid var(--tile-line); }
.legend .arrived { background: var(--tile-arrived); }
.legend .done { background: var(--tile-done); }

.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 4), minmax(0, 1fr));
  gap: 8px 10px;
  padding: 12px 16px;
  /* 段の高さから、番号と時刻の字の大きさを決める（上の段と下のキャンセルぶん 150px を引く） */
  --row-h: calc((100vh - 150px) / var(--rows, 4));
}

.cell { display: flex; flex-direction: column; gap: 3px; min-height: 0; }

.tile {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--tile-before);
  border: 2px solid var(--tile-line);
  color: var(--ink);
  cursor: pointer;
}
.tile .no { font-size: calc(var(--row-h) * 0.46); font-weight: 700; line-height: 1; }
.tile.arrived { background: var(--tile-arrived); border-color: var(--tile-arrived); color: var(--tile-ink); }
.tile.done { background: var(--tile-done); border-color: var(--tile-done); color: var(--tile-ink); }
.tile.empty-slot { background: var(--tile-empty); border-color: var(--tile-empty); color: var(--tile-empty-ink); cursor: default; }

/* ゴールのマス（並びのいちばん最後のマス。すごろくと同じ）。
   まだ＝チェッカーフラッグの枠で囲む。灰色の残りの枠なら下に「ゴール」。
   届いた（上限の人数を案内し終えた）＝マスを金色にして、左上に「♛ 完売」 */
.cell.goal-cell { position: relative; z-index: 0; }
/* 枠だけを四角の外側に重ねて描く（内側は抜く）。「次」の黒い輪より上に出すので、最後のマスが「次」でも枠が見える */
.cell.goal-cell .tile::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 1;
  padding: 7px;
  border-radius: 4px;
  background: repeating-conic-gradient(var(--goal-check-dark) 0 25%, var(--goal-check-light) 0 50%) 0 0 / 14px 14px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.cell.goal-cell.reached .tile::before { background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); }
.cell.goal-cell .time { position: relative; top: 5px; }
.goal-label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.goal-label .goal-flag { height: 1.2em; width: auto; }
.goal-flag .dark { fill: var(--goal-check-dark); }
.goal-flag .light { fill: var(--goal-check-light); }
.cell.goal-cell.reached .tile {
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
  border-color: var(--gold);
  color: var(--gold-ink);
}
.tile .goal-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: var(--gold-lo);
  color: var(--gold-ink);
  font-size: clamp(13px, calc(var(--row-h) * 0.11), 18px);
  font-weight: 700;
  line-height: 1.3;
}
.tile .goal-badge svg { height: 0.95em; width: auto; fill: currentColor; }

/* 次に案内する人（まだ案内していない先頭）。次呼出番号の欄の代わりに、並びの中で目立たせる */
.tile.next { box-shadow: 0 0 0 3px var(--board-bg), 0 0 0 7px var(--next-ring); }
.tile .next-label {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 7px;
  border-radius: 2px;
  background: var(--next-ring);
  color: var(--tile-ink);
  font-size: 15px;
  font-weight: 700;
}

/* 削除のボタン（案内前だけ）。今と同じく、右上の小さな赤い × */
.tile .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--tile-ink);
  border-radius: 2px;
  background: var(--tile-arrived);
  color: var(--tile-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

/* 四角の下の時刻。いつもお客様に見せた幅のまま（ずれは四角の中に出す） */
.cell .time {
  min-height: 1.2em;
  font-size: clamp(12px, calc(var(--row-h) * 0.1), 16px);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

/* 約束から外れた分（番号の四角の右下）。どの色の四角の上でも読めるよう、白い札にする。
   **番号をずらさずに、四角の隅に収まる大きさ**にする。大きすぎると責めているように見える（オーナー、2026年9月19日） */
.tile .gap {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--surface);
  font-size: clamp(11px, calc(var(--row-h) * 0.09), 15px);
  font-weight: 700;
  line-height: 1.25;
}
.tile .gap small { font-size: 0.8em; }

/* 電話受付の札（四角の左下）。100円のもらい忘れが無いよう、控えめにしすぎない（オーナー、2026年9月19日）。
   四角の隅は 左上「次」・右上「×」・右下「+◯分」なので、左下に置く */
.tel {
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--tile-phone);
  color: var(--tile-phone-ink);
  font-weight: 700;
  line-height: 1.2;
}
.tile .tel {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font-size: clamp(13px, calc(var(--row-h) * 0.12), 20px);
}
.legend .tel { font-size: 14px; }
.tile .gap.late { color: var(--late); }
.tile .gap.early { color: var(--ink); }

/* キャンセル。下に1列で、黒い小さな四角を番号順に */
.canceled {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px 16px;
  overflow: hidden;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
}
.canceled[hidden] { display: none; }
.canceled .label { margin-right: 8px; font-size: 16px; font-weight: 700; color: var(--muted); }
.canceled .mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  padding: 0 6px;
  border-radius: 2px;
  background: var(--tile-canceled);
  color: var(--tile-ink);
  font-size: 22px;
  font-weight: 700;
}

.empty {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  align-self: center;
  padding: 60px 20px;
  text-align: center;
  font-size: 26px;
  color: var(--muted);
}

/* ---- 受付タブレット ---- */

.kiosk {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.kiosk main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px;
  text-align: center;
}
.kiosk h1 { margin: 0; font-size: 40px; line-height: 1.4; }
.kiosk .lead { margin: 0; font-size: 24px; color: var(--muted); line-height: 1.6; }
.kiosk .closed { font-size: 24px; font-weight: 700; color: var(--warn); }

/* 受付タブレット。**お客様が見慣れた今の画面を写す**（オーナー、2026年9月19日）。
   横いっぱいの大きな帯のボタン（受付＝赤、アプリ・電話受付済＝青）。文字は大きく、少なく。
   背景の水色は引き継がない。真っ白にする（灰色は重く見える。オーナー、2026年9月19日） */
body.reception { height: 100vh; overflow: hidden; background: var(--surface); }
.reception main {
  height: 100%;
  justify-content: stretch;
  align-items: stretch;
  gap: 20px;
  padding: 16px 24px 24px;
  text-align: left;
}
.reception .store-name { font-size: 30px; font-weight: 700; }
.reception .bar {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 2px;
  font-size: 96px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kiosk-ink);
  cursor: pointer;
}
.reception .bar.red { background: var(--kiosk-red); }
/* 最初の画面は、青（アプリ・電話で受付した方）を上に大きく、赤（受付）を下に。6対4（オーナー、2026年9月19日）。
   8〜9割の人が押すのは青。アプリの人がまちがえて赤を押すと2つ目の番号を取ってしまうが、
   受付していない人がまちがえて青を押しても番号を打てないので害が無い */
.reception main > .home-blue { flex: 6; }
.reception main > .home-red { flex: 4; }
.reception .bar.blue { background: var(--kiosk-blue); }
/* 最初の画面の2つは、文字の大きさをそろえる（青だけ小さいと、8〜9割の人が押す青のほうが
   おまけに見えてしまう。オーナー、2026年9月20日）。青は12文字と長いので、
   横幅に収まる 84px を2つの共通の大きさにした。大きさが同じでも、帯の高さ（6対4）で青が主に見える */
.reception main > button.home-blue,
.reception main > button.home-red { font-size: 84px; }
/* 「いいえ」は白。赤い「はい」と見分けやすく（オーナー、2026年9月19日） */
.reception .bar.white { background: var(--surface); color: var(--ink); border: 4px solid var(--line-strong); }
.reception .bar:active { filter: brightness(0.9); }
.reception .bar:disabled { opacity: 0.6; }
/* 受付終了などの知らせ。真ん中に置く（写真では右に絵があったので左寄せだった。絵を外したので中央に） */
.reception .message {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  font-size: 60px;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
/* 完売だけは別扱い。受付時間が終わったのではなく「売り切れた」ことなので、
   大きく・赤で出す（オーナー、2026年9月20日。確定） */
.reception .message.soldout { font-size: 84px; color: var(--kiosk-red); }

/* 受付しますか？／この番号でよろしいですか？／番号札をお取りください */
.reception .ask { flex: 1.6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.reception .ask .label { font-size: 40px; }
.reception .ask .label b { font-size: 48px; }
.reception .ask .time { font-size: 120px; font-weight: 700; line-height: 1.1; letter-spacing: 0.02em; }
.reception .ask .no { font-size: 150px; font-weight: 700; line-height: 1; }
.reception .ask .question { margin-top: 8px; font-size: 56px; font-weight: 700; color: var(--kiosk-red); }
.reception .ask .note { font-size: 22px; color: var(--muted); }
.reception .ask .note b { color: var(--ink); }
.reception .pair { flex: 1; display: flex; gap: 40px; }
.reception .pair .bar { font-size: 88px; }
/* 番号札を印刷したあと。押すものは置かず、大きな字で知らせるだけ（数秒で最初の画面に戻る） */
.reception .take-ticket { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 88px; font-weight: 700; color: var(--kiosk-red); }

/* ボタンの下に添える、誰が押すものか */
.reception .bar span { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reception .bar small { font-size: 32px; font-weight: 700; letter-spacing: 0.04em; opacity: 0.95; }

/* 受付番号を打ち込む画面。電卓のように、左に打った番号、右に大きなボタン */
.reception .arrive-head { display: flex; align-items: center; gap: 20px; }
.reception .arrive-head .title { flex: 1; font-size: 44px; font-weight: 700; }
.reception .back {
  min-width: 170px;
  min-height: 72px;
  border: 4px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-size: 36px;
  font-weight: 700;
  cursor: pointer;
}
.reception .keypad-area { flex: 1; min-height: 0; display: flex; gap: 32px; }
.reception .entry { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.reception .display {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
  border: 4px solid var(--ink);
  border-radius: 2px;
  font-size: 150px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.reception .entry-msg { min-height: 2.8em; font-size: 30px; font-weight: 700; line-height: 1.4; color: var(--kiosk-red); }
.reception .keypad {
  flex: 1.25;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.reception .key {
  border: none;
  border-radius: 2px;
  background: var(--kiosk-blue);
  color: var(--kiosk-ink);
  font-size: 60px;
  font-weight: 700;
  cursor: pointer;
}
.reception .key.sub { background: var(--surface); color: var(--ink); border: 4px solid var(--line-strong); font-size: 40px; }
.reception .key.ok { background: var(--kiosk-red); font-size: 44px; }
.reception .key:active { filter: brightness(0.9); }

/* ---- 設定（店頭の2画面のすみ） ----
   **ふだんは使わない。** 店を選び間違えたときと、番号札を試したいときだけ。
   お客様やスタッフの邪魔にならないよう、すみに小さく置く（オーナー、2026年9月23日）。 */

.tablet-settings {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 40;
  min-width: 56px;
  min-height: 40px;
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  opacity: 0.5;
  cursor: pointer;
}
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.settings-panel[hidden] { display: none; }
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(520px, 86vw);
  padding: 24px;
  border-radius: 8px;
  background: var(--surface);
}
.settings-head { font-size: 22px; font-weight: 700; }
.settings-card .btn { min-height: 64px; font-size: 22px; }

/* ---- タブレットの登録の画面 ----
   **店のタブレットにキーボードは付いていない。** 合言葉も画面の数字ボタンで入れる。
   受付の画面と同じ大きさ・同じ色にして、初めて見た人でも迷わないようにする。 */

.setup-wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
  box-sizing: border-box;
}
.setup h1 { margin: 0; font-size: 34px; font-weight: 700; }
.setup-store {
  font: inherit;
  font-size: 34px;
  font-weight: 700;
  min-height: 84px;
  padding: 0 16px;
  border: 4px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
}
.setup-pin { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.setup-pin .label { font-size: 30px; font-weight: 700; }
.setup-pin .display {
  flex: 1;
  min-width: 200px;
  height: 84px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border: 4px solid var(--ink);
  border-radius: 2px;
  font-size: 46px;
  letter-spacing: 0.2em;
  box-sizing: border-box;
}
.setup-pin .msg { width: 100%; min-height: 1.6em; font-size: 26px; font-weight: 700; color: var(--kiosk-red); }
.setup .keypad {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.setup .key {
  border: none;
  border-radius: 2px;
  background: var(--kiosk-blue);
  color: var(--kiosk-ink);
  font-size: 56px;
  font-weight: 700;
  cursor: pointer;
}
.setup .key.sub { background: var(--surface); color: var(--ink); border: 4px solid var(--line-strong); font-size: 36px; }
.setup .key.ok { background: var(--kiosk-red); font-size: 36px; }
.setup .key:active { filter: brightness(0.9); }
/* 短い住所の入口（start.html）。大きなボタン2つだけ */
.start-choice { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.start-choice .key { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 56px; }
.start-choice .key.sub { font-size: 56px; }
.start-choice small { font-size: 26px; font-weight: 400; }

/* 紙の番号札。画面には出さず、印刷のときだけ出す。
   プリンターはセイコーインスツル RP-F10。紙は 58mm 幅（2026年9月23日、店で試し印刷した紙で確かめた。
   80mm のつもりで作っていたら右が切れた）。字は左右 5mm ほど空けた 48mm に収める。
   試し印刷の目盛りで、わずかに右へ寄っていた（2026年9月24日）ので、左を 0.5mm 詰めてある。
   いちばん下にメモの枠（スタッフが料金などを手書きする。高さは番号と同じくらいの 2cm。オーナー、同日）。
   紙は最後に字のある所のすぐ下で切られ、下の余白が消える（時刻の下がぎりぎりだった）。
   そこで枠の下に短い線を1本打ち、その線までは紙を送らせる。 */
.receipt { display: none; }

@media print {
  @page { size: 58mm auto; margin: 0; }
  body { background: #fff; }
  body > *:not(.receipt) { display: none !important; }
  .receipt {
    display: block;
    box-sizing: border-box;
    width: 58mm;
    padding: 4mm 5.5mm 0 4.5mm;
    color: #000;
    text-align: center;
    font-family: "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  }
  .receipt .stamp { font-size: 9pt; }
  .receipt .store { margin-top: 2mm; font-size: 14pt; font-weight: 700; }
  .receipt .label { margin-top: 4mm; font-size: 11pt; }
  .receipt .no { font-size: 48pt; font-weight: 700; line-height: 1.1; }
  .receipt .range { font-size: 17pt; font-weight: 700; }
  .receipt .memo { margin-top: 4mm; height: 20mm; border: 0.3mm solid #000; }
  .receipt .end { width: 2mm; margin: 6mm auto 0; border-top: 0.3mm solid #000; }
  /* 試し印刷だけに出す物差し。紙の左はしから 10mm ごとに目盛りを打ち、紙の幅とずれを1枚で読めるようにする */
  .receipt .ruler { position: relative; height: 4mm; margin: 0 -5.5mm 2mm -4.5mm; text-align: left; }
  .receipt .ruler span { position: absolute; top: 0; height: 4mm; border-left: 0.3mm solid #000; padding-left: 0.5mm; font-size: 6pt; line-height: 1; }
}

/* ---- 本部の画面 ----
   パソコンで一覧できることを優先する。スマホでも最低限さわれるように、表は横に流す。
   店頭の画面とちがい、文字を選んでコピーできるようにする。 */

body.admin { -webkit-user-select: text; user-select: text; touch-action: auto; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.admin h1 { margin: 0 0 12px; font-size: 24px; }
.admin h2 { margin: 24px 0 8px; font-size: 20px; }
.admin p.help { margin: 4px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tabs button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .spacer { flex: 1; }

.admin .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.admin .bar .muted { color: var(--muted); font-size: 14px; }

.admin .btn { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; border-width: 1px; }
.admin .btn.small { min-height: 32px; padding: 0 10px; font-size: 14px; }
.admin .btn:disabled { opacity: 0.4; cursor: default; }

.admin input, .admin select {
  font: inherit;
  font-size: 15px;
  min-height: 38px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.admin textarea.notice-text {
  display: block;
  width: 100%;
  min-height: 140px;
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
}
.admin input.time { width: 76px; text-align: center; }
.admin input.num { width: 64px; text-align: right; }
.admin input.name { width: 160px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.admin table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin th, .admin td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
.admin th { background: var(--bg); font-size: 13px; color: var(--muted); font-weight: 700; }
.admin td.num, .admin th.num { text-align: right; }
.admin tr:last-child td { border-bottom: none; }
.admin td .sub { display: block; font-size: 12px; color: var(--muted); }
.admin a.link { color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; }
.admin .stop { color: var(--warn); font-weight: 700; }
.admin .alert { color: var(--late); font-weight: 700; }
.admin .dim { color: var(--muted); }
/* まだ何人ぶんか決めていない雛形。決めるまで、その雛形が入っている日は自動で入らない */
.admin tr.undecided td { background: var(--warn-soft); }

/* 1日の様子。管理タブレットの並びを、本部のパソコンの幅に収める（高さは決まった大きさ） */
.admin .board { padding: 0; grid-template-rows: none; grid-auto-rows: auto; --row-h: 110px; }
.admin .tile { flex: none; height: 78px; }
.admin .tile.readonly { cursor: default; }
.admin .canceled { margin: 16px 0 0; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.admin .legend { margin: 0 0 12px; }
.admin .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* カレンダー。**体制を選んでから日付を塗る**（オーナー、2026年9月20日）。
   1日ずつプルダウンを開く形をやめたので、マスの中に入力するものは無い */

/* 塗る体制のボタン。その店で使った回数の多い順に並ぶ */
.paint-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.paint-bar .paint-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.paint {
  min-height: 38px;
  padding: 4px 14px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
/* **選んでいる印は、色ではなく「黒い枠＋✓」で出す**（オーナー、2026年9月20日）。
   ボタンはどれも体制の色で塗ってあるので、選んだ印に色を使うと、体制の色とぶつかる。
   色に頼らない印（枠・チェック・まわりを薄く）なら、どの色のボタンでも同じように分かる */
.paint.on {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: var(--shadow);
}
.paint.on::before { content: "✓ "; }
/* まだ何も選んでいないうちは薄くしない（全部が押せないように見えてしまうため）。
   ひとつ選んだあとだけ、選んでいないほうを薄くする */
.paint-bar.picked .paint:not(.on) { opacity: 0.55; }
.paint-more { min-height: 38px; font-size: 15px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; touch-action: none; }
.cal .head { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
/* 曜日の見出しは押せる（その曜日を1か月ぶんまとめて塗る）。
   **普段から枠を出して、押せると分かるようにする**（オーナー、2026年9月20日。確定）。
   カーソルを乗せないと分からないと、隠しボタンになってしまう。
   乗せたとき＝ピンク、押しているあいだ＝濃いピンク、と3段階で応える */
.cal .wd-head {
  padding: 5px 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.cal .wd-head:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.cal .wd-head:active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cal .cell {
  min-height: 96px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal .cell.paintable { cursor: pointer; }
.cal .cell.paintable:hover { border-color: var(--brand); }
.cal .cell.locked { background: var(--bg); }
.cal .cell.past { background: var(--bg); color: var(--muted); }
/* **変えた日に色を敷かない**（オーナー、2026年9月20日。確定）。
   体制の札に色が付いた今は、薄い赤は同じことを二度言っているだけで、
   変更の多い月ほど画面じゅうが赤くなって、かえって見づらかった。
   いつもの体制の日は同じ色の札がずらりと並ぶので、**違う色の札＝変えた日**が、色の違いだけで分かる。
   （体制を「いつもの体制」と同じものに塗ると行を持たない作りなので、
     札の色がいつもと違う ＝ その日だけ変えてある、と必ず一致する） */
.cal .cell.closed { background: var(--warn-soft); }
/* 緑の囲みは「今日」の目印（オーナー、2026年9月20日）。変えられないことは灰色で見せる */
.cal .cell.is-today { border: 2px solid var(--ok); }
.cal .cell .d { display: flex; align-items: baseline; font-weight: 700; font-size: 15px; }
/* 「自動」「手動」の添え字。札の色とぶつからないよう、色は使わず灰色の小さな字にする */
.cal .cell .d .by { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
/* 体制の名前は、**色で塗った札にして文字を白く**する（オーナー、2026年9月20日。確定）。
   文字の色を変えるだけでは見分けにくかった。塗るボタンと同じ見た目にしてあるので、
   「このボタンを押すと、この札になる」が見たままで分かる */
/* 体制の札。カレンダーと「今日の受付」で同じ見た目にする（オーナー、2026年9月20日） */
.what {
  align-self: flex-start;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-ink);
}
/* 表の中の札は、まわりの字に合わせて小さく（カレンダーのマスほど主張させない。
   オーナー、2026年9月20日） */
.admin td .what { padding: 4px 16px; font-size: 15px; }
/* 定休日は「何も無い日」なので、札にしない */
.what.dim { align-self: auto; padding: 0; font-size: 15px; font-weight: 400; color: var(--muted); }
/* 臨時休業・毎年のお休み */
.what.off { background: var(--warn); }
.what.pat-1 { background: var(--pat-1); }
.what.pat-2 { background: var(--pat-2); }
.what.pat-3 { background: var(--pat-3); }
.what.pat-4 { background: var(--pat-4); }
.what.pat-5 { background: var(--pat-5); }
.what.pat-6 { background: var(--pat-6); }
.what.pat-7 { background: var(--pat-7); }
.what.pat-8 { background: var(--pat-8); }
/* 塗るボタンも同じ色にして、どの色が何かを覚えなくてよいようにする */
.paint.pat-1 { background: var(--pat-1); border-color: var(--pat-1); color: var(--brand-ink); }
.paint.pat-2 { background: var(--pat-2); border-color: var(--pat-2); color: var(--brand-ink); }
.paint.pat-3 { background: var(--pat-3); border-color: var(--pat-3); color: var(--brand-ink); }
.paint.pat-4 { background: var(--pat-4); border-color: var(--pat-4); color: var(--brand-ink); }
.paint.pat-5 { background: var(--pat-5); border-color: var(--pat-5); color: var(--brand-ink); }
.paint.pat-6 { background: var(--pat-6); border-color: var(--pat-6); color: var(--brand-ink); }
.paint.pat-7 { background: var(--pat-7); border-color: var(--pat-7); color: var(--brand-ink); }
.paint.pat-8 { background: var(--pat-8); border-color: var(--pat-8); color: var(--brand-ink); }
.paint.closed { background: var(--warn); border-color: var(--warn); color: var(--brand-ink); }
.cal .cell .sub { color: var(--muted); font-size: 12px; }
.cal .cell .wd { display: none; }
/* 塗った瞬間の手ごたえ（送り終わると画面を読み直すので消える） */
.cell.painting, .allcal td.painting { outline: 3px solid var(--brand); outline-offset: -3px; }

/* 全店まとめて。縦に店舗・横に日付。いつもの体制の日は色を付けず、変えた日だけ色が付く */
.allcal-wrap { overflow-x: auto; }
/* 1か月ぶん（31日）が、横に出しっぱなしで収まる幅にする。マスの幅は中身で広げない。
   **数字は全角幅にしない**（body の tabular-nums のままだと「2.5」が3文字ぶん＝マスからはみ出して、
   真ん中からずれて見える。オーナー、2026年9月20日） */
.allcal {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: normal;
  touch-action: none;
  table-layout: fixed;
}
.allcal th, .allcal td { border: 1px solid var(--line); text-align: center; }
.allcal th.sname {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 80px;
  padding: 4px 6px;
  background: var(--bg);
  text-align: left;
  font-size: 14px;
}
.allcal th.sname small { display: block; font-weight: 400; color: var(--muted); }
.allcal th.day-head { width: 35px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.allcal th.day-head:hover { background: var(--brand-soft); color: var(--brand); }
.allcal th.day-head small { display: block; font-weight: 400; color: var(--muted); }
.allcal th.day-head.past { color: var(--muted); }
/* display は table-cell に戻す（共通の .cell が flex なので、表の行が崩れる） */
/* 余白は 0 に。本部の表の padding（8px 10px）が効くと、35px のマスの中身が 15px しか残らず、
   「2.5」がマスからはみ出して真ん中からずれて見える（オーナー、2026年9月20日） */
.allcal td { display: table-cell; padding: 0; height: 30px; overflow: hidden; background: var(--surface); color: var(--muted); }
.allcal td.paintable { cursor: pointer; }
.allcal td.paintable:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
.allcal td.past, .allcal td.locked { background: var(--bg); }
.allcal td.changed { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.allcal td.closed { background: var(--warn-soft); color: var(--tile-arrived); font-weight: 700; }
.allcal th.day-head.is-today { border: 2px solid var(--ok); color: var(--ok); }

/* 店舗の「営業する曜日」。押して入り切りする（オーナー、2026年9月20日）。
   7曜日ぶんの行をいつも出すのをやめ、ふだんの時間を1組だけ入れてもらう形にした */
.wd-toggles { display: inline-flex; gap: 6px; }
.wd-toggle {
  min-width: 40px;
  min-height: 36px;
  padding: 0 6px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.wd-toggle.on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
/* 「違う曜日」はふだんと別の意味なので、枠だけの印にして営業曜日と見分ける */
.ex-toggle { min-width: 40px; min-height: 32px; padding: 0 6px; border: 2px dashed var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
.ex-toggle.on { border-style: solid; border-color: var(--ink); color: var(--ink); }
.ex-toggle:disabled { opacity: 0.35; cursor: default; }
.ex-row { padding-left: 0; }
.vary-check { white-space: nowrap; }

/* 「1店舗ずつ／全店まとめて」の切り替え */
.toggle { display: inline-flex; }
.toggle .tog.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* スマホでは7列に並べると選べない幅になるので、1日1行にする */
@media (max-width: 720px) {
  .cal { grid-template-columns: 1fr; }
  .cal .head, .cal .blank { display: none; }
  .cal .cell { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .cal .cell .wd { display: inline; }
  .cal .cell .d { min-width: 4.5em; }
  .admin .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 設定のまとまり（店舗・体制を1つずつ） */
.box {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.box .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.box label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.box .note { font-size: 13px; color: var(--muted); }
.box .label { width: 26em; max-width: 100%; }
.box .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.box.new { border: 2px dashed var(--brand); }
.box table td { padding: 4px 8px; }

.login { max-width: 360px; margin: 80px auto; display: flex; flex-direction: column; gap: 12px; }
.login[hidden] { display: none; }
.login .err { color: var(--warn); font-weight: 700; min-height: 1.4em; }

/* 電話受付で取った番号の窓 */
/* 1日の様子の、本部の操作（切り替え・止めた時間） */
.ops { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ops .bar { margin-bottom: 6px; }
.ops ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 14px; }
.ops li { margin: 4px 0; }
dialog .field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 16px; }
dialog .field select, dialog .field input { font: inherit; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
dialog .field input { width: 90px; text-align: center; }

.phone-result { text-align: center; }
.phone-result .store { font-size: 20px; font-weight: 700; }
.phone-result .no { font-size: 72px; font-weight: 700; line-height: 1.1; color: var(--brand); }
.phone-result .range { font-size: 32px; font-weight: 700; }
.phone-result .say {
  margin: 16px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

/* ---- 完売したときのお祝い（管理タブレット。public/cheer.js） ----
   上限の人数を案内し終えた瞬間に1回だけ。5秒で必ず消え、さわればその場で消える。
   動きを減らす設定の端末には、紙吹雪を出さず言葉だけ（勤怠アプリの打刻の演出と同じ作り） */
.cheer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cheer-veil);
}
.cheer[hidden] { display: none; }
.cheer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cheer.away { animation: cheer-away 0.45s ease forwards; }
@keyframes cheer-away { to { opacity: 0; } }
.cheer-card {
  position: relative;
  padding: 36px 64px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
  color: var(--gold-ink);
  text-align: center;
  box-shadow: var(--shadow);
  animation: cheer-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes cheer-pop {
  from { transform: scale(0.72) translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.cheer-head { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 72px; font-weight: 700; line-height: 1.2; }
.cheer-head svg { height: 0.8em; width: auto; fill: currentColor; }
.cheer-sub { margin-top: 8px; font-size: 30px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .cheer-card { animation: none; }
}
