/* ============================================================
   1A文化祭 共通スタイル
   1. 変数・土台
   2. 汎用パーツ（ボタン・フォーム・カード・テーブル）
   3. スタッフ画面の共通シェル（ヘッダー・タブ）
   4. 注文カード / ボード
   5. 受付（メニュー選択・カート）
   6. お客様画面
   7. ログ画面
   8. スマホ幅の調整
   ============================================================ */

/* ===== 1. 変数・土台 ===== */
:root {
  --bg: #f2f4f7;
  --surface: #fff;
  --line: #e2e6ec;
  --text: #1f2733;
  --muted: #6b7683;
  --brand: #2e8b57;
  --brand-dark: #24704a;
  --danger: #c0392b;
  --danger-dark: #9c2d20;
  --warn: #d68a00;
  --info: #2b6cb0;
  --gray: #7c8797;
  --gray-dark: #626c7a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  /* ページの最大幅。お客様画面は読みやすさ優先で狭いまま、
     スタッフ画面は画面いっぱいまで使う。 */
  --page-max: 960px;
}

.staff-page { --page-max: 1640px; }
/* 入力フォーム中心のページは、広げすぎると逆に見づらいので抑える */
.staff-page.narrow { --page-max: 1040px; }

* { box-sizing: border-box; }

/* display を明示した要素にも hidden 属性を効かせる。
   .col や .tab-btn のように display:flex を持つ要素は、
   これが無いとブラウザ標準の [hidden]{display:none} に勝ってしまい、
   hidden を立てても消えない。 */
[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  margin: 0;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1 { font-size: 24px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }

.muted { color: var(--muted); }
.text-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* 認証確認が終わるまで中身を出さない（ログイン画面への一瞬のちらつき防止） */
.staff-page main { display: none; }
.staff-page.is-ready main { display: block; }

/* ===== 2. 汎用パーツ ===== */
button {
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: #333;
  color: #fff;
  cursor: pointer;
  transition: background 0.12s;
}
button:hover { background: #4a4a4a; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.small { font-size: 13px; padding: 7px 12px; }
button.big { font-size: 18px; padding: 16px 22px; }
button.block { width: 100%; }

button.green { background: var(--brand); }
button.green:hover { background: var(--brand-dark); }
button.red { background: var(--danger); }
button.red:hover { background: var(--danger-dark); }
button.gray { background: var(--gray); }
button.gray:hover { background: var(--gray-dark); }
button.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
button.ghost:hover { background: #f4f6f9; }

input, select, textarea {
  font-size: 15px;
  font-family: inherit;
  padding: 10px;
  border: 1px solid #ccd2da;
  border-radius: 8px;
  width: 100%;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(46, 139, 87, 0.35);
  border-color: var(--brand);
}
label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 auto 16px;
  max-width: var(--page-max);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-header h2 { margin: 0; }

.login-card { max-width: 380px; margin-top: 60px; }
.error { color: var(--danger); font-weight: bold; }

.note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.note-warn {
  font-size: 13px;
  color: #8a5300;
  background: #fff6e5;
  border: 1px solid #f5dda8;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 0;
}

.big-number {
  font-size: 76px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  margin: 6px 0;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* まとめ発行のときは「16〜25」のように幅を取るので少し小さくする */
.big-number.is-range { font-size: 46px; }

/* 番号が未設定のとき。「－」が1本だけ浮くと壊れて見えるので、
   文章に切り替えて余白も詰める。 */
.big-number.is-empty {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  min-height: 56px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 130px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 人数・待ち時間のように、数を増減させる操作 */
.counter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.counter-row button { flex: 1 1 0; }
.counter-value {
  flex: 1 1 0;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* まとめて呼ぶ：一度に複数の番号を呼び出し中にする操作 */
.bulk-call {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bulk-call-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}
.bulk-call button { flex: 1 1 auto; min-width: 52px; }

/* いま何番を呼んでいるか。複数同時に呼べることが伝わるようにする。 */
.calling-summary {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}
th { background: #f7f9fb; font-size: 13px; color: var(--muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
.table-scroll table { margin-top: 0; }

/* 工程ごとの色。発行→呼び出し→購入→提供 の順に進む。 */
.status-issued    { color: var(--muted);  font-weight: 700; }
.status-called    { color: var(--danger); font-weight: 700; }
.status-purchased { color: var(--info);   font-weight: 700; }
.status-served    { color: var(--brand);  font-weight: 700; }
.status-skipped   { color: var(--warn);   font-weight: 700; }
.status-cancelled { color: var(--muted);  text-decoration: line-through; }
/* 旧データ用 */
.status-pending   { color: var(--muted);  font-weight: 700; }

/* 空状態。ただの余白だと「壊れている」ように見えるので、
   破線の枠で「いま空である」ことを意図的に見せる。
   ログ画面の <td class="empty"> には枠を付けないよう、箱にするのは
   カート／ボードの中だけに限定する。 */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 10px;
  font-size: 13px;
  margin: 0;
}

.board .empty,
.menu-grid .empty,
#cart-list .empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  background: #fafbfc;
  border: 1px dashed #d9dfe6;
  border-radius: 10px;
}
.board .empty,
.menu-grid .empty { grid-column: 1 / -1; }

/* ===== 3. スタッフ画面の共通シェル ===== */
.topbar {
  max-width: var(--page-max);
  margin: 0 auto 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.staff-chip {
  font-size: 13px;
  font-weight: 700;
  background: #e8eef5;
  color: #37475c;
  padding: 4px 10px;
  border-radius: 999px;
}

.tabbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.page-tabbar { max-width: var(--page-max); margin: 0 auto 16px; }

.tabbar a.tab-link, .tabbar button.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tabbar a.tab-link:hover, .tabbar button.tab-btn:hover { background: #eef1f5; }
.tabbar a.tab-link.active, .tabbar button.tab-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.tab-badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.tab-link.active .tab-badge { background: #fff; color: var(--brand); }

/* ===== 4. 注文カード / ボード ===== */
.board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.order-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--gray);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-card.is-issued    { border-left-color: #c9ced6; }
.order-card.is-called    { border-left-color: var(--danger); background: #fff6f5; }
.order-card.is-purchased { border-left-color: var(--info); }
.order-card.is-served    { border-left-color: var(--brand); }
.order-card.is-skipped   { border-left-color: var(--warn); background: #fffaf0; }
.order-card.is-cancelled { border-left-color: #c9ced6; background: #fafbfc; }
.order-card.is-pending   { border-left-color: #c9ced6; }

/* 取りこぼし候補の強調 */
.order-card.is-overdue {
  border-left-color: var(--danger);
  background: #fff6f5;
}

/* 新着ハイライト */
@keyframes flash-in {
  0%   { box-shadow: 0 0 0 4px rgba(46, 139, 87, 0.55); }
  100% { box-shadow: 0 0 0 4px rgba(46, 139, 87, 0); }
}
.order-card.is-new { animation: flash-in 2.2s ease-out 2; }

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.order-num small { font-size: 14px; font-weight: 600; color: var(--muted); }
.order-meta { text-align: right; font-size: 12px; color: var(--muted); }

.order-items { display: flex; flex-wrap: wrap; gap: 6px; }
.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2f7;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 14px;
}
.item-chip b { font-size: 15px; }

.order-note {
  font-size: 13px;
  background: #fff8e1;
  border: 1px solid #f0e0ac;
  border-radius: 6px;
  padding: 6px 9px;
}

.order-total { font-size: 15px; font-weight: 700; }
.order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.order-actions button { flex: 1 1 auto; min-width: 92px; }

.overdue-flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ===== 5. 受付（メニュー選択・カート） ===== */
.split {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  max-width: var(--page-max);
  margin: 0 auto 16px;
}
.split > .card { margin: 0; max-width: none; }

/* 受付ページの3カラム
   左：呼び出し番号と状況 ／ 中央：呼び出し中 ／ 右：呼び飛ばし
   呼び飛ばしは常に画面の右端に置き、受付をしながら横目で見られるようにする。 */
.reception-layout {
  display: grid;
  gap: 16px;
  align-items: start;
  max-width: var(--page-max);
  margin: 0 auto;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) minmax(330px, 430px);
}
.reception-layout .col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.reception-layout .col > .card { margin: 0; max-width: none; }

/* 右カラムは中身が増えても画面内で完結するよう、単独でスクロールさせる */
.reception-layout .col-right { position: sticky; top: 20px; }
.reception-layout .col-right .board {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-right: 4px;
}

/* 整理券を使わない運用。残るカードは1枚なので、1列で中央に置く。 */
.reception-layout.is-tickets-off {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

.reception-off-note {
  max-width: var(--page-max);
  margin: 0 auto 12px;
  background: #fff6e5;
  border: 1px solid #f5dda8;
  color: #8a5300;
  border-radius: 8px;
  padding: 10px 12px;
}

/* ワンオペモード：受付1台で提供まで回すので列が増える。 */
/* 1台で全部やるので、4列とも画面内に収まることを優先する。
   よく触る「呼び出し中」と「提供待ち」が伸び縮みする列。 */
.reception-layout.is-solo {
  grid-template-columns:
    minmax(250px, 285px) minmax(255px, 1fr) minmax(255px, 1fr) minmax(270px, 310px);
}

/* 通常モードは3列。窮屈になったら呼び飛ばしを下段へ回す。 */
@media (max-width: 1360px) {
  .reception-layout:not(.is-solo) { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .reception-layout:not(.is-solo) .col-right { grid-column: 1 / -1; position: static; }
  .reception-layout:not(.is-solo) .col-right .board { max-height: none; overflow-y: visible; }
}

/* ワンオペは4列のまま粘り、収まらなくなってから2列に落とす */
@media (max-width: 1130px) {
  .reception-layout.is-solo { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .reception-layout.is-solo .col-right { position: static; }
  .reception-layout.is-solo .col-right .board { max-height: none; overflow-y: visible; }
}

@media (max-width: 900px) {
  .reception-layout,
  .reception-layout.is-solo { grid-template-columns: 1fr; }
  .reception-layout .col-right,
  .reception-layout .col-serve { grid-column: auto; }
}

/* 狭い列に入れても等幅で並ぶよう、flex ではなく grid で折り返す */
.stat-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
}
.stat {
  min-width: 0;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-label { font-size: 12px; color: var(--muted); }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.menu-item-btn {
  background: #fff;
  color: var(--text);
  border: 2px solid #d6dce4;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font-size: 15px;
  line-height: 1.35;
}
.menu-item-btn:hover { background: #f1f5f9; border-color: var(--brand); }
.menu-item-btn span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.cart-row .qty-ctrl { display: flex; align-items: center; gap: 6px; }
.cart-row .qty-ctrl button { min-width: 40px; }
.cart-qty { min-width: 28px; text-align: center; font-weight: 700; font-size: 17px; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  font-size: 16px;
  font-weight: 700;
}
.cart-total b { font-size: 28px; color: var(--danger); }

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

/* トースト */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #1f2733;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--danger); }

/* ===== 6. お客様画面 ===== */
.site-title {
  text-align: center;
  font-size: 30px;
  margin: 10px 0 20px;
  color: var(--text);
}
.now-card { text-align: center; }
.now-card .big-number { font-size: 96px; }
/* 同じ詳細度なので、空状態は必ずこちらが後に来るように書く */
.now-card .big-number.is-empty { font-size: 17px; }
.now-label { font-size: 15px; color: var(--muted); font-weight: 600; }

.wait-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.wait-box {
  flex: 1 1 140px;
  max-width: 220px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 10px;
}
.wait-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--warn);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.wait-value small { font-size: 16px; }
.wait-label { font-size: 13px; color: var(--muted); }

.menu-detail-list { list-style: none; padding: 0; margin: 0; }
.menu-detail-list li { border-bottom: 1px solid var(--line); padding: 12px 4px; }
.menu-detail-list li:last-child { border-bottom: none; }
.menu-detail-main { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.menu-detail-name { font-weight: 700; }
.menu-detail-price { font-weight: 700; white-space: nowrap; }
.menu-detail-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

.menu-list-view { list-style: none; padding: 0; margin: 0; }
.menu-list-view li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.footer-login { text-align: center; margin: 30px 0 10px; }
.footer-login a { font-size: 12px; color: #a3aab4; text-decoration: none; }
.footer-login a:hover { text-decoration: underline; }

.back-home-link { display: block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 12px; }
.back-home-link:hover { text-decoration: underline; }

.updated-note { text-align: center; font-size: 12px; color: #a3aab4; margin-top: 6px; }

/* ===== 7. ログ画面 ===== */
.log-detail { max-width: 340px; word-break: break-word; }
.log-ua {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 12px;
  color: var(--muted);
}
.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.log-count { font-size: 13px; color: var(--muted); }

/* ===== 8. スマホ幅（760px以下） ===== */
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { padding: 12px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  .card { padding: 14px; }
  .big-number { font-size: 56px; }
  .now-card .big-number { font-size: 72px; }

  .topbar { align-items: flex-start; }
  .topbar-right { width: 100%; }

  .tabbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .tabbar a.tab-link, .tabbar button.tab-btn { flex: 0 0 auto; }

  .table-scroll table { min-width: 520px; }
  .board { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .log-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .order-actions button { flex: 1 1 100%; }
}

/* ===== 9. 番号チップ（お客様画面の呼び出し一覧） ===== */
.number-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.number-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6c0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.number-chip small { font-size: 13px; font-weight: 700; }
.number-chip.is-skipped {
  background: #fff6e5;
  color: #8a5300;
  border-color: #f5dda8;
}

/* ===== 10. 設定のスイッチ行 ===== */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
}
.switch-row:hover { background: #f7f9fb; }
.switch-row input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.switch-row strong { display: block; font-size: 15px; }
.switch-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ===== 11. 売上の内訳 ===== */
.sales-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sales-row:last-child { border-bottom: none; }
.sales-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.sales-name { font-size: 16px; font-weight: 700; }
.sales-qty {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.sales-qty small { font-size: 13px; color: var(--muted); margin-left: 2px; }
.sales-bar {
  height: 8px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.sales-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.sales-sub { font-size: 13px; color: var(--muted); }
.sales-sub strong { color: var(--text); font-size: 14px; }

/* ===== 12. 番号表示ページ（会場のモニター用） =====
   遠くから読めるよう、暗い背景に大きな番号だけを出す。
   文字の大きさは vh 基準なので、縦長のタブレットでも横長の
   モニターでもはみ出さない。 */
body.display-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: #10151d;
  color: #fff;
}

.display-wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2vh 2vw;
  gap: 1vh;
}

.display-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.display-title { font-size: clamp(16px, 2.4vh, 30px); font-weight: 700; color: #7d8899; }
.display-label { font-size: clamp(18px, 3.4vh, 44px); font-weight: 800; letter-spacing: 0.04em; }

.display-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* 番号は縦に積む。件数が多くて1列に収まらないときは、
   新聞のように次の列へ折り返して全部を画面内に収める。 */
.display-numbers {
  --num-size: 20vh;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 0.6vh 5vw;
  width: 100%;
  height: 100%;
}

.display-num {
  font-size: var(--num-size);
  font-weight: 900;
  line-height: 1;
  color: #ff5b4a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 3vh rgba(255, 91, 74, 0.35);
}

/* 番号の代わりに人数・待ち時間を出すとき */
.display-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5vh;
}
.display-num small { font-size: 0.4em; margin-left: 0.08em; }
.display-stat-label {
  font-size: clamp(13px, 2.4vh, 28px);
  font-weight: 700;
  color: #7d8899;
}

.display-empty {
  font-size: clamp(18px, 4vh, 48px);
  font-weight: 700;
  color: #5d6879;
  text-align: center;
}

.display-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2vw;
  flex-wrap: wrap;
  border-top: 1px solid #29313d;
  padding-top: 1.5vh;
}
.display-foot-label {
  font-size: clamp(13px, 2.2vh, 26px);
  font-weight: 700;
  color: #e0a63a;
  white-space: nowrap;
}
.display-foot-numbers { display: flex; flex-wrap: wrap; gap: 1vh 1.5vw; }
.display-skip {
  font-size: clamp(20px, 5vh, 64px);
  font-weight: 800;
  line-height: 1;
  color: #f2c66b;
  font-variant-numeric: tabular-nums;
}

/* 映しっぱなしでも邪魔にならないよう、操作がないと薄く消える */
.display-tools {
  position: fixed;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 1;
  transition: opacity 0.4s;
}
.display-tools.is-idle { opacity: 0; pointer-events: none; }
.display-tools .text-link { color: #7d8899; }
.display-page button.ghost { background: #1c2531; color: #c9d2de; border-color: #2f3947; }
.display-page button.ghost:hover { background: #263141; }
.display-status { font-size: 12px; color: #5d6879; font-variant-numeric: tabular-nums; }
.display-status.is-error { color: #ff5b4a; font-weight: 700; }

/* ===== 13. 喫茶一瑛のお品書き =====
   壁に貼るメニュー表と同じ体裁。クリーム地に焦げ茶、二重の飾り枠。
   品名と価格を点線でつなぎ、その下に材料、さらに小さくアレルギーを置く。 */
:root {
  --menu-ink: #5b3a2e;
  --menu-paper: #fffdf9;
  --menu-line: #8a6552;
}

.site-head {
  max-width: var(--page-max);
  margin: 0 auto 20px;
  text-align: center;
}
/* お客様画面はロゴと同じ生成り色にして、ロゴが紙に見えるようにする */
body.guest-page { --bg: #fdf8f2; }

/* ロゴは既定で非表示。読み込めたときだけ出すので、
   ファイルが無くても壊れた画像の印は出ない。
   画像は正方形だが絵は中央の帯だけなので、上下を切り取って出す。 */
.site-logo {
  display: none;
  width: min(430px, 94%);
  aspect-ratio: 2.6 / 1;
  object-fit: cover;
  object-position: center;
  margin: 0 auto;
}
.site-head.has-logo .site-logo { display: block; }
.site-head .site-title { margin: 10px 0 0; color: var(--menu-ink); }
/* ロゴに店名が入っているので、出せたら文字は伏せる */
.site-head.has-logo .site-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.menu-board {
  max-width: min(var(--page-max), 680px);
  margin: 0 auto 20px;
  background: var(--menu-paper);
  border: 3px solid var(--menu-ink);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.menu-board-inner {
  border: 1px solid var(--menu-line);
  border-radius: 12px;
  padding: 26px 22px 30px;
}

.menu-board-title {
  text-align: center;
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--menu-ink);
  margin: 0 0 22px;
}

.menu-list { list-style: none; padding: 0; margin: 0; }

.menu-item {
  position: relative;
  padding: 0 0 20px 20px;
  color: var(--menu-ink);
}
.menu-item::before {
  content: "・";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 18px;
  line-height: 1.3;
}
.menu-item:last-child { padding-bottom: 4px; }

.menu-item-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.menu-item-name {
  font-size: clamp(17px, 4.6vw, 24px);
  font-weight: 800;
  line-height: 1.3;
}
/* 品名と価格を点線でつなぐ */
.menu-item-dots {
  flex: 1 1 auto;
  min-width: 14px;
  border-bottom: 2px dotted var(--menu-line);
  transform: translateY(-4px);
}
.menu-item-price {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.menu-item-price small { font-size: 0.62em; margin-left: 2px; font-weight: 700; }

.menu-item-desc {
  font-size: clamp(13px, 3.4vw, 17px);
  margin-top: 3px;
  line-height: 1.5;
}
.menu-item-allergens {
  font-size: clamp(11px, 2.7vw, 13px);
  margin-top: 2px;
  padding-left: 1.2em;
  color: #8a6552;
  line-height: 1.5;
}

/* 売り切れ。消さずに残して、売り切れだと分かるようにする */
.menu-item.is-sold-out .menu-item-name,
.menu-item.is-sold-out .menu-item-dots,
.menu-item.is-sold-out .menu-item-price,
.menu-item.is-sold-out .menu-item-desc,
.menu-item.is-sold-out .menu-item-allergens { opacity: 0.38; }
/* 価格に重ねず、品名のとなりに置く */
.menu-sold-out {
  flex: 0 0 auto;
  background: var(--danger);
  color: #fff;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.menu-board-note {
  margin: 22px 0 0;
  text-align: center;
  font-size: clamp(13px, 3.4vw, 17px);
  line-height: 1.7;
  color: var(--menu-ink);
  white-space: pre-wrap;
}

/* 並べ替えの上下ボタン。幅を揃えて押しやすくする */
.move-btn {
  min-width: 38px;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 12px;
  line-height: 1;
}
.move-btn:disabled { opacity: 0.3; }

/* スタッフ画面の一覧に付ける売り切れの印 */
.sold-out-tag {
  display: inline-block;
  margin-left: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: 1px;
}

.menu-empty {
  text-align: center;
  color: var(--menu-line);
  padding: 20px 0;
}

.scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar::-webkit-scrollbar {
    display: none;
}


