:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --panel: #ffffff;
  --ink: #2b2b28;
  --ink-soft: #6b6660;
  --line: #a89c88;        /* 2026-11-08: もう少し濃く(店主の声「枠の色が全体的にもう少し濃いほうが見やすい」。11/07 は #bfb4a2、その前は #ddd6c8) */
  --line-strong: #7a6f5e; /* 入力欄・ボタンなど、押す所の枠(2026-11-08 #8f8473 から濃く) */
  --accent: #a8323e;      /* 近又をイメージした朱(D106: 以前の #7a1f2b は暗いという声で明るくした) */
  --accent-soft: #f8e6e3;
  --occupied: #8a7a3d;
  --danger: #a33;
  --trial: #8a6a1f;
  --trial-soft: #f3ead2;
  --tap-min: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-tap-highlight-color: transparent; user-select: none; overscroll-behavior: none; }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 14px; }

.trial-banner { background: var(--trial); color: #fff; text-align: center; font-weight: 700;
  padding: 8px; font-size: 13px; letter-spacing: 0.02em; }

.app-shell { display: flex; height: 100%; }
.app-shell.has-banner { height: calc(100% - 38px); }
/* 左のメニューをしまう(この端末で覚える)。端末の役割の札はヘッダーに常に出す */
.app-shell.nav-hidden .side-nav { display: none; }
.nav-brand .role-tag { display: none; }

.side-nav { width: 160px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; overflow-y: auto; }
.nav-brand { font-size: 15px; font-weight: 700; padding: 6px 4px 14px; }
.badge-test { display: block; font-size: 10px; font-weight: 500; color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 2px 6px; margin-top: 4px; width: fit-content; }
.nav-btn { min-height: 48px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); text-align: left; padding: 0 12px; }
.nav-btn:active { background: var(--accent-soft); }
.nav-btn.active { background: var(--accent); color: #fff; }
.nav-spacer { flex: 1; }
.nav-role { font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 8px; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-header { display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.app-header h1 { flex: 1; font-size: 19px; font-weight: 600; margin: 0; letter-spacing: 0.02em; }
.icon-btn { width: var(--tap-min); height: 44px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; font-size: 20px; color: var(--ink-soft); }
.icon-btn:active { background: var(--accent-soft); }
/* 左上のメニュー(三本線)は枠なし。三本線だけを少し大きく */
#btn-nav-toggle, #btn-nav-toggle:focus { border: 0; background: none; box-shadow: none; font-size: 26px; color: var(--ink); }
#btn-nav-toggle:active { background: var(--accent-soft); }
.settings-fab { position: fixed; right: 18px; bottom: 18px; z-index: 15; width: 52px; height: 52px; border-radius: 26px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

.view { flex: 1; padding: 18px; overflow-y: auto; min-height: 0; }

.seat-group { margin-bottom: 22px; }
.seat-group h2 { font-size: 15px; color: var(--ink-soft); font-weight: 600; margin: 0 0 10px 2px; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }

.seat-btn {
  min-height: 84px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 18px; font-weight: 600; color: var(--ink); padding: 8px;
}
.seat-btn:active { background: var(--accent-soft); }
.seat-btn .seat-status { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.seat-btn.occupied { border-color: var(--occupied); background: #fbf7ea; }
.seat-btn.occupied .seat-status { color: var(--occupied); }

.register-layout { display: grid; grid-template-columns: 150px 1fr 320px; gap: 14px; height: 100%; }

.category-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.category-btn { min-height: var(--tap-min); border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-size: 15px; font-weight: 600; color: var(--ink); text-align: center; }
.category-btn:active { background: var(--accent-soft); }
.category-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* カテゴリーのジャンルごとの色分け(2026-11-06 店舗の指示)。選んでいるカテゴリーはジャンルの色で塗る。白い文字が読める濃さにしている */
.genre-drink { --g: #2f6690; --g-soft: #e4eef7; }
.genre-food { --g: #3d7a4b; --g-soft: #e3f0e5; }
.genre-retail { --g: #6b4d9a; --g-soft: #ece6f5; }
.genre-fee { --g: #a3541f; --g-soft: #f9e8db; }
.genre-account { --g: #57606a; --g-soft: #e8ebee; }
.category-btn.has-genre { background: var(--g-soft); border-color: var(--g-soft); border-left: 6px solid var(--g); }
.category-btn.has-genre:active { background: var(--g-soft); filter: brightness(0.95); }
.category-btn.has-genre.active { background: var(--g); color: #fff; border-color: var(--g); }
.product-btn.has-genre { border-left: 5px solid var(--g); }

.product-pane { display: flex; flex-direction: column; min-height: 0; }
.order-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.order-meta label { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
/* 人数とお客様名は部屋番号の段(ヘッダー)に置く */
.order-meta-people { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; max-width: 760px; }
.order-meta-people[hidden] { display: none; }
.order-meta-people label { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.app-header.has-order-meta h1 { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-meta-name { flex: 1; min-width: 0; }
.order-meta-name .meta-input { flex: 1; min-width: 0; width: 100%; }
#party-size { width: 64px; }
.order-meta .search-input { min-width: 160px; flex: 1 1 200px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; align-content: start; overflow-y: auto; padding-right: 4px; flex: 1; min-height: 0; }
.product-btn { min-height: 86px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.product-btn:active { background: var(--accent-soft); }
.product-btn .p-name { font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.3; }
.product-btn .p-price { font-size: 13px; color: var(--ink-soft); }

.order-panel { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; overflow: hidden; }
.order-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.order-item .oi-name { flex: 1 1 100px; min-width: 0; font-size: 14px; font-weight: 600; word-break: break-word; }
.order-item .oi-price { font-size: 13px; color: var(--ink-soft); min-width: 64px; text-align: right; flex-shrink: 0; }
.qty-stepper { display: flex; align-items: center; gap: 6px; }
.qty-stepper button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); font-size: 16px; font-weight: 700; }
.qty-stepper button:active { background: var(--accent-soft); }
.qty-stepper .qty-val { min-width: 20px; text-align: center; font-weight: 600; }
.order-empty { color: var(--ink-soft); font-size: 13px; text-align: center; padding: 30px 0; }

.order-total-row { display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 6px; border-top: 2px solid var(--ink); font-weight: 700; }
.order-total-row span:first-child { font-size: 14px; color: var(--ink-soft); }
#order-total { font-size: 26px; color: var(--accent); }

.checkout-btn { min-height: 56px; border-radius: 12px; border: none; background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 700; margin-top: 10px; width: 100%; }
.checkout-btn:active { opacity: 0.85; }
.checkout-btn:disabled { background: var(--line); color: var(--ink-soft); }

.ghost-btn { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-top: 8px; width: 100%; }
.ghost-btn.danger { color: var(--danger); border-color: var(--danger); }
.ghost-btn:active { background: var(--accent-soft); }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex;
  align-items: flex-end; justify-content: center; z-index: 20; }
.sheet[hidden] { display: none; }
.sheet-inner { background: var(--panel); border-radius: 16px 16px 0 0; padding: 20px; width: 100%;
  max-width: 480px; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.sheet-inner.wide { max-width: 720px; }
.sheet-inner h2 { margin: 0 0 6px; font-size: 16px; }
.sheet-inner label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sheet-btn { min-height: var(--tap-min); border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-size: 15px; font-weight: 600; }
.sheet-btn-secondary { color: var(--ink-soft); }
.meta-input { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); padding: 0 10px; }
.search-input { min-width: 220px; flex: 1; }
.meta-btn { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  font-weight: 600; font-size: 13px; padding: 0 14px; }
.radio-row { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
/* 詳細度を".sheet-inner label"(0,1,1)と同等以上にし、ソース順で後勝ちさせるため type+class で指定する
   (クラスのみの .checkbox-row だと負けて縦積みのまま直らない、という実際にあったレイアウト不具合の修正) */
label.checkbox-row { display: flex; flex-direction: row; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink); }
.checkbox-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-methods button { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  font-size: 15px; font-weight: 700; }
.payment-methods button:active, .payment-methods button.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
#ledger-backfill-box[hidden] { display: none; }
.range-btn { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 0 14px; font-weight: 600; }
.range-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: var(--ink-soft); font-weight: 600; background: #faf8f3; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .row-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12px; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.open { background: var(--accent-soft); color: var(--accent); }
.status-pill.paid { background: #e5f2e6; color: #2f7a36; }
.status-pill.voided { background: #f2e5e5; color: var(--danger); }

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.report-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.report-card .rc-label { font-size: 12px; color: var(--ink-soft); }
.report-card .rc-value { font-size: 22px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.report-card.wide { grid-column: 1 / -1; }
.report-sub-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.settings-card.wide-card { grid-column: 1 / -1; }
.settings-card h3 { margin: 0 0 10px; font-size: 14px; }
.settings-note { font-size: 11px; color: var(--ink-soft); margin: 8px 0 0; }
.diagnostics-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; font-size: 12px; margin-bottom: 10px; }
.diagnostics-body .d-row { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.diagnostics-body .d-row span:first-child { color: var(--ink-soft); }
.diagnostics-log { grid-column: 1 / -1; max-height: 160px; overflow-y: auto; background: #faf8f3; border-radius: 8px;
  padding: 8px; font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 11px; white-space: pre-wrap; }
.diagnostics-actions { display: flex; gap: 10px; }

/* 会計画面(Phase5) */
.checkout-summary { background: #faf8f3; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.checkout-summary .report-sub-row { padding: 6px 0; }
.checkout-section { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.checkout-section summary { font-weight: 700; cursor: pointer; padding: 4px 0; list-style-position: outside; }
.checkout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 10px; }
.checkout-grid label, .sheet-inner label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

/* 友の会: 商品名/数量・対象人数ステッパーを両端揃えで横並びにし、折り返しても崩れないようにする */
.tomonokai-item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.tomonokai-item-row:last-child { border-bottom: none; }
.tomonokai-item-info { flex: 1 1 220px; min-width: 0; }
.tomonokai-item-name { font-weight: 700; font-size: 14px; word-break: break-word; }
.tomonokai-summary { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 8px; }

/* 支払い内訳: 方法セレクト/金額/削除ボタンの列幅を固定して揃える */
.payment-row { display: grid; grid-template-columns: 1fr 140px 40px; align-items: center; gap: 8px; margin-bottom: 8px; }
.payment-row select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; width: 100%; }
.payment-row input { min-height: 44px; width: 100%; }
.payment-row button { width: 40px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; }

.oi-item-actions { display: flex; gap: 4px; }
.oi-discount-tag { font-size: 11px; color: var(--accent); margin-left: 4px; }
.oi-price-tag { font-size: 11px; color: #2f6690; background: #e4eef7; border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }

/* 分割会計(Phase6) */
/* display:flex等を指定したクラスをJSの el.hidden で非表示にする場合、hidden属性より
   クラスの display 指定(同じauthor stylesheet内)が勝ってしまい消えなくなる(D20と同種の不具合)。
   .sheet[hidden]{display:none} に倣い、個別に[hidden]時のdisplay:noneを明示する。 */
.split-config { display: flex; flex-direction: column; gap: 10px; }
.split-config[hidden] { display: none; }
.sp-groups-header { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-group-chip { display: flex; align-items: center; gap: 6px; background: #faf8f3;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.sp-group-chip .sp-group-name { width: 100px; min-height: 36px; }
.sp-method-config { display: flex; flex-direction: column; gap: 8px; }
.sp-method-config[hidden] { display: none; }

.sp-item-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sp-item-name { font-weight: 700; font-size: 13px; }
.sp-item-group-inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-item-group-input { display: flex; flex-direction: column; gap: 2px; font-size: 11px;
  color: var(--ink-soft); font-weight: 600; }
.sp-item-group-input input { width: 76px; min-height: 36px; }

.sp-group-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.sp-group-card.paid { background: #f3f8f3; border-color: #bcdcc0; }
.sp-group-card-head { display: flex; justify-content: space-between; align-items: center; }
.sp-group-items { font-size: 12px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 2px; }
.sp-group-payments { display: flex; flex-direction: column; gap: 6px; }

/* ポイントの分割配分(Phase7 5章) */
.sp-point-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px;
  background: #faf8f3; display: flex; flex-direction: column; gap: 10px; }
.sp-point-card .meta-input { min-height: 48px; font-size: 15px; }
.sp-point-card select.meta-input, .sp-point-card select { min-height: 48px; font-size: 15px; }
.payment-row.point-managed { background: var(--accent-soft); border-radius: 8px; padding: 0 10px; }
.payment-row.point-managed span:first-child { font-size: 13px; font-weight: 600; }
.payment-row.point-managed span:nth-child(2) { font-weight: 700; text-align: right; }
#sp-point-add-select { min-height: 48px; font-size: 15px; border-radius: 8px; border: 1px solid var(--line); padding: 0 10px; width: 100%; }

.receipt-preview { background: #faf8f3; border: 1px solid var(--line); border-radius: 10px; padding: 16px 14px;
  position: relative; display: flex; flex-direction: column; gap: 4px; }
.receipt-watermark { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700;
  color: var(--danger); border: 1px solid var(--danger); border-radius: 6px; padding: 2px 8px; }

/* PC(広い画面)向け: 表の密度を上げ、サイドナビにラベルを広く表示 */
@media (min-width: 1000px) {
  .side-nav { width: 200px; }
  .view { padding: 24px 32px; }
  .data-table th, .data-table td { padding: 8px 14px; }
}

/* ===== Phase9: 通信・同期状態の表示 ===== */
/* ヘッダー右端の常時表示(通常時はコンパクト、異常時は色で目立たせる)。 */
.sync-status { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 700;
  color: var(--ink-soft); white-space: nowrap; flex-shrink: 0; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: #b9b2a5; flex-shrink: 0; }
.sync-status[data-status="synced"] { color: #2f7a36; border-color: #b8d9bb; background: #f1f8f1; }
.sync-status[data-status="synced"] .sync-dot { background: #2f9a3a; }
.sync-status[data-status="syncing"], .sync-status[data-status="awaiting_confirmation"], .sync-status[data-status="connecting"] {
  color: #2a5b8a; border-color: #b9cfe4; background: #f0f5fa; }
.sync-status[data-status="syncing"] .sync-dot, .sync-status[data-status="awaiting_confirmation"] .sync-dot,
.sync-status[data-status="connecting"] .sync-dot { background: #3b7cc0; animation: sync-pulse 1s ease-in-out infinite; }
.sync-status[data-status="waiting"] { color: #1f5f99; border-color: #b4cfe8; background: #eef5fb; }
.sync-status[data-status="waiting"] .sync-dot { background: #3b7cc0; animation: sync-pulse 1s ease-in-out infinite; }
.sync-status[data-status="pending"] { color: #8a5a00; border-color: #e6cf9b; background: #fbf4e3; }
.sync-status[data-status="pending"] .sync-dot { background: #d79a12; }
.sync-status[data-status="offline"], .sync-status[data-status="error"], .sync-status[data-status="conflict"] {
  color: #fff; border-color: var(--danger); background: var(--danger); }
.sync-status[data-status="offline"] .sync-dot, .sync-status[data-status="error"] .sync-dot,
.sync-status[data-status="conflict"] .sync-dot { background: #fff; }
.sync-status[data-status="conflict"] { animation: sync-pulse 1.4s ease-in-out infinite; }
@keyframes sync-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ヘッダー直下の警告帯(オフライン会計中・閲覧のみ・競合・メインPOS不通)。 */
.sync-banner { display: block; width: 100%; border: none; text-align: left; padding: 10px 18px;
  font-size: 14px; font-weight: 700; color: #fff; background: var(--danger); line-height: 1.5; }
.sync-banner[hidden] { display: none; }
.sync-banner.offline-main { background: #8a3d12; }
.sync-banner.warn { background: #8a6a1f; }
.sync-banner.wait { background: #2f6ea5; }
.sync-banner small { display: block; font-weight: 500; font-size: 12px; opacity: 0.92; }

/* 詳細シート */
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 7px 10px 7px 0; width: 9.5em; vertical-align: top; }
.kv-table td { padding: 7px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
.sync-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.conflict-card { border: 2px solid var(--danger); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: #fdf6f6; }
.conflict-card.failed { border-color: #8a6a1f; background: #fbf7ec; }
.conflict-card h4 { margin: 0 0 4px; font-size: 14px; }
.conflict-card .conflict-msg { font-size: 13px; color: var(--ink); margin: 0 0 8px; }
.conflict-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.conflict-compare > div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.conflict-compare h5 { margin: 0 0 4px; font-size: 12px; color: var(--ink-soft); }
.conflict-compare .cc-total { font-size: 15px; font-weight: 700; }
.conflict-changes { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; }
.conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.conflict-actions .meta-btn { min-height: 48px; }
.conflict-actions .meta-btn.danger { color: var(--danger); border-color: var(--danger); }

/* 設定画面 */
.sync-settings-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; color: var(--ink-soft); font-weight: 600; flex-wrap: wrap; }
.sync-settings-row .meta-input { flex: 1; min-width: 200px; }
.sync-role-info { font-size: 13px; line-height: 1.7; background: #faf8f3; border-radius: 8px; padding: 8px 12px; }

/* 取引履歴の伝票ごとの同期状態 */
.sync-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-left: 4px; }
.sync-pill.pending, .sync-pill.local { background: #fbf4e3; color: #8a5a00; }
.sync-pill.conflict, .sync-pill.failed { background: #f2e5e5; color: var(--danger); }
.sync-pill.synced { background: #f1f8f1; color: #2f7a36; }
.local-settlement-note { font-size: 12px; color: #8a3d12; font-weight: 700; }

/* 他端末から届いた変更の明細を一瞬強調する(差分更新であることを分かりやすくする) */
.order-item.remote-updated { animation: remote-flash 1.6s ease-out; }
@keyframes remote-flash { 0% { background: #fff1c2; } 100% { background: transparent; } }

@media (max-width: 760px) {
  .conflict-compare, .sync-detail-actions { grid-template-columns: 1fr; }
  .sync-status { padding: 0 10px; font-size: 12px; }
}
.sync-tech { margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.sync-tech summary { cursor: pointer; padding: 6px 0; }
.sync-tech pre { white-space: pre-wrap; word-break: break-all; background: #faf8f3; border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; font-size: 11px; }

/* ===== Phase10: 消費税率・税区分の表示 ===== */
/* 商品タイル・注文欄・伝票詳細の税率の小さな表示(いま適用中の税率。確定済みの会計は取引当時の税率) */
.tax-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: var(--ink-soft); background: #f1ede4; vertical-align: middle; white-space: nowrap; }
.field-note { display: block; font-size: 11px; font-weight: 500; color: var(--ink-soft); margin-top: 2px; }
.order-total-row .field-note { display: inline; margin-left: 4px; }
/* 入力欄を2つ横に並べる(狭い画面では縦に積む) */
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-pair > label { min-width: 0; }
.form-pair select, .form-pair input { width: 100%; }
@media (max-width: 560px) { .form-pair { grid-template-columns: 1fr; } }

/* 会計画面の税率別の内訳と注意 */
.tax-breakdown { margin: 2px 0 6px; }
.tax-row { font-size: 12px; color: var(--ink-soft); }
.tax-safety { border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; line-height: 1.6; margin: 8px 0; }
.tax-safety[hidden] { display: none; }
.tax-safety.warn { background: #fbf4e3; color: #8a5a00; border: 1px solid #e6cf9b; }
.tax-safety.block { background: #fdf0f0; color: var(--danger); border: 2px solid var(--danger); }

/* 消費税率管理 */
.tax-current { margin: 8px 0; }
.tax-current-table .tax-rate-cell, .tax-entries-table .tax-rate-cell { font-size: 16px; font-weight: 700; }
.tax-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tax-subhead { font-size: 14px; margin: 14px 0 6px; }
.tax-entries-table td { white-space: normal; vertical-align: middle; }
.tax-entries-table td.tax-acts { white-space: nowrap; }
.tax-entries-table .row-btn { margin: 2px; }
.tax-status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tax-status-pill.draft { background: #eee; color: #555; }
.tax-status-pill.pending { background: #e7f0fa; color: #2a5b8a; }
.tax-status-pill.active { background: #f1f8f1; color: #2f7a36; }
.tax-status-pill.ended { background: #f3f1ec; color: #888; }
.tax-status-pill.cancelled { background: #f2e5e5; color: var(--danger); text-decoration: line-through; }
tr.tax-status-cancelled td, tr.tax-status-ended td { color: #999; }
.danger-text { color: var(--danger); border-color: var(--danger) !important; }
.tax-rules-details { margin-top: 10px; font-size: 13px; }
.tax-rules-details summary { cursor: pointer; padding: 6px 0; color: var(--ink-soft); font-weight: 600; }

/* 注文欄の上部(伝票の削除はここ。会計ボタンから離して誤タップを防ぐ) */
.order-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.order-panel-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.danger-link-btn { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #e3c6c6; background: var(--panel);
  color: var(--danger); font-size: 12px; font-weight: 600; }
.danger-link-btn:active { background: #fdf0f0; }

/* Phase10: 実データ(カテゴリー32件・商品419件)でも「会計へ進む」が画面の外に出ないよう、
   注文画面を画面の高さに収め、カテゴリー・商品・注文内容はそれぞれの欄の中でスクロールする。 */
#order-screen:not([hidden]) { height: 100%; }
.register-layout { grid-template-rows: minmax(0, 1fr); }
.category-list, .order-panel { min-height: 0; }
.category-btn { flex-shrink: 0; }
/* 注文画面では、右下の設定ボタンが「会計へ進む」に重なって誤タップの原因になるため隠す(席一覧・他の画面では表示) */
body:has(#order-screen:not([hidden])) .settings-fab { display: none; }

/* ===== Phase11: レシート・領収書設定、帳票のプレビュー、商品管理の一括編集 ===== */
.primary-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary-btn:active { opacity: 0.85; }
.compact-btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
.warn-text { color: #8a5a00; }
.danger-text { color: var(--danger); }
.header-spacer { flex: 1; }

/* 全画面のシート(設定画面・名前の表) */
.fullscreen-sheet { align-items: stretch; }
.fullscreen-sheet .sheet-inner.rs-sheet { max-width: 1440px; max-height: none; height: 100%; border-radius: 0; padding: 14px 18px; gap: 8px; }
.print-sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.print-sheet-head h2 { margin: 0; font-size: 17px; letter-spacing: 0.04em; }
.rs-dirty { font-size: 12px; font-weight: 700; color: #8a5a00; background: #fbf4e3; border: 1px solid #e6cf9b; border-radius: 999px; padding: 3px 10px; }
.rs-dirty[hidden] { display: none; }
.rs-readonly { margin: 0; }
.rs-readonly[hidden] { display: none; }

/* 帳票のプレビュー・試験印刷 */
.sheet-inner.print-sheet { max-width: 1080px; max-height: 94vh; }
.print-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.print-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.print-controls select, .print-controls input[type="text"] { width: 100%; }
.print-preview-col { min-width: 0; }
.printer-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.print-warnings { background: #fbf4e3; border: 1px solid #e6cf9b; color: #8a5a00; border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.6; }
.print-warnings[hidden] { display: none; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.segmented button { min-height: 40px; padding: 0 16px; border: 0; background: var(--panel); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.active { background: var(--accent); color: #fff; }
/* 紙の見た目: 机の上に置いた感熱紙 */
.paper-scroll { background: #e8e2d4; border-radius: 12px; padding: 18px 12px; overflow: auto; max-height: 72vh; }
.paper { width: min(100%, 380px); margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(60, 40, 20, 0.18); padding: 8px 0 14px;
  display: flex; justify-content: center; min-height: 160px; }
.paper-canvas { display: block; height: auto; }
.paper .settings-note { padding: 0 12px; }
.td-print-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }

/* レシート・領収書設定 */
.receipt-settings-summary { margin: 8px 0; }
.rs-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; font-size: 13px; }
.rs-summary-grid > div { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.rs-summary-grid span { font-size: 11px; color: var(--ink-soft); }
.rs-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 18px; flex: 1; min-height: 0; }
.rs-form { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rs-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.rs-tabs button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; font-weight: 600;
  font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.rs-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.rs-panel { overflow-y: auto; padding: 12px 4px 30px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.rs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.rs-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.rs-field input[type="text"], .rs-field select, .rs-textarea { width: 100%; }
.rs-field select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; background: var(--panel); }
.rs-textarea { padding: 8px 10px; line-height: 1.6; resize: vertical; font-size: 14px; font-family: inherit; }
.rs-range { display: flex; align-items: center; gap: 10px; }
.rs-range input { flex: 1; min-height: 36px; }
.rs-range output { font-size: 12px; color: var(--ink); min-width: 110px; }
label.rs-check { margin: 2px 0; }
.rs-image-card { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fcfbf8; }
.rs-thumb { width: 150px; height: 110px; flex-shrink: 0; border: 1px dashed var(--line); border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--ink-soft); font-size: 12px; }
.rs-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rs-image-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; }
.rs-image-actions { display: flex; gap: 8px; flex-wrap: wrap; }
label.file-btn { display: inline-flex; flex-direction: row; align-items: center; cursor: pointer; width: auto; color: var(--ink); font-size: 13px; }
.rs-check-list { display: flex; flex-direction: column; gap: 4px; }
.rs-check-list > div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: #f6f9f4; }
.rs-check-list > div.ng { background: #fbf4e3; }
.rs-check-list > div > span { font-weight: 800; width: 16px; color: #2f7a36; }
.rs-check-list > div.ng > span { color: #8a5a00; }
.rs-docs-table td, .rs-docs-table th { text-align: center; }
.rs-docs-table td:first-child, .rs-docs-table th:first-child { text-align: left; }
.rs-docs-table input[type="checkbox"] { width: 22px; height: 22px; }
.rs-hist { display: flex; flex-direction: column; gap: 4px; }
.rs-hist-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.rs-hist-row.viewing { border-color: var(--accent); background: var(--accent-soft); }
.rs-hist-row .field-note { display: block; }
.rs-hist-acts { display: flex; gap: 6px; flex-shrink: 0; }
.rs-hist-row .row-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12px; }
.rs-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rs-asset { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.rs-asset img { width: 100%; height: 80px; object-fit: contain; }
.rs-preview { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.rs-preview-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rs-preview-controls select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; background: var(--panel); }
.rs-preview .paper-scroll { flex: 1; max-height: none; min-height: 0; }

/* 商品管理: 一覧・まとめて変更 */
.toolbar-secondary { margin-top: -6px; }
.products-table .sel-col { width: 44px; text-align: center; padding-left: 10px; padding-right: 4px; }
.products-table .sel-col input { width: 20px; height: 20px; }
.products-table tr.selected td { background: #fbf5ef; }
.pn-cell { white-space: normal !important; min-width: 240px; max-width: 560px; }
.pn-pos { font-weight: 600; }
.pn-sub { font-size: 11px; color: var(--ink-soft); margin-top: 2px; line-height: 1.6; }
.pn-label { display: inline-block; font-size: 10px; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.pn-sep { display: inline-block; width: 12px; }
.flag-pill { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.flag-pill.review { background: #fbf0dc; color: #8a5a00; }
.flag-pill.candidate { background: #e7f0fa; color: #2a5b8a; }
.flag-pill.muted { background: #f1ede4; color: var(--ink-soft); }
.row-acts .row-btn + .row-btn { margin-left: 4px; }
/* 選んだときに表を動かさない(位置がずれて隣の行を誤ってタップしないよう)、画面の下に重ねて出す */
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 16;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; background: #fff8ef; max-width: calc(100vw - 260px);
  border: 1px solid #e8d2b5; border-radius: 14px; padding: 10px 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
#view-products { padding-bottom: 96px; }
.bulk-bar[hidden] { display: none; }
.bulk-bar .checkout-btn { width: auto; margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.chip-btn { min-height: 34px; border-radius: 999px; border: 1px solid #e6cf9b; background: #fbf4e3; color: #8a5a00; font-size: 12px; font-weight: 700; padding: 0 12px; }
.notice-card { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; line-height: 1.6;
  background: #f6f9f4; border: 1px solid #cfe1cf; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.notice-card.warn { background: #fbf4e3; border-color: #e6cf9b; }
.be-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.be-fields select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; background: var(--panel); width: 100%; }
.be-preview { display: flex; flex-direction: column; gap: 6px; }
.be-headline { font-weight: 700; font-size: 14px; }
.be-table-wrap { max-height: 46vh; overflow: auto; }
.be-table td { white-space: normal; vertical-align: top; }
.be-table td.before { color: var(--ink-soft); text-decoration: line-through; }
.be-table td.after { color: var(--accent); font-weight: 600; }
.be-table td.wrap { white-space: normal; font-size: 12px; color: var(--ink-soft); }
.be-table select { min-height: 36px; border-radius: 8px; border: 1px solid var(--line); }
.be-table input[type="checkbox"], .sc-check { width: 20px; height: 20px; }
.rc-value.small { font-size: 13px; word-break: break-all; }
.nt-wrap { flex: 1; overflow: auto; min-height: 0; }
.nt-table td { white-space: normal; vertical-align: top; padding: 6px 8px; }
.nt-table input.meta-input { width: 100%; min-width: 160px; }
.nt-table .nt-in.changed { border-color: var(--accent); background: #fff8f5; }
.nt-table .nt-cat { font-size: 11px; color: var(--ink-soft); max-width: 110px; }
.name-fields { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--accent-soft); padding-left: 10px; }

@media (max-width: 900px) {
  .print-layout, .rs-layout { grid-template-columns: 1fr; }
  .rs-preview .paper-scroll { max-height: 70vh; }
  .rs-grid2 { grid-template-columns: 1fr; }
}
.print-sheet-head .checkout-btn, .print-sheet-head .sheet-btn { width: auto; margin: 0; flex: 0 0 auto; }
/* D25と同じ: .sheet-inner label などの display 指定に hidden 属性が負けないようにする */
.sheet-inner [hidden], .rs-panel [hidden], .print-controls [hidden] { display: none !important; }
.rs-subgroup { border-left: 3px solid var(--accent-soft); padding: 2px 0 2px 10px; display: flex; flex-direction: column; gap: 2px; }
.file-pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Phase12: 売上・締め・履歴検索・返金 ---- */
.sales-toolbar, .hs-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sales-toolbar .meta-input, .hs-form .meta-input { min-height: 40px; }
.hs-form .amount-input, .dc-cash .amount-input { width: 120px; }
.history-search { margin-bottom: 12px; }
.history-search .segmented { margin-bottom: 8px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sales-tabs { margin: 14px 0 8px; }
.sales-csv-row { margin-top: 10px; }
.close-card { margin-top: 18px; }
.close-card h4 { font-size: 13px; margin: 14px 0 6px; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.total-row td { font-weight: 700; background: #faf8f3; }
.ev-type { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #eef3ee; color: #2f7a36; }
.ev-type.ev-correction { background: #e7f0fa; color: #2a5b8a; }
.ev-type.ev-refund, .ev-type.ev-void { background: #f2e5e5; color: var(--danger); }
.status-pill.refund { background: #fbeee0; color: #9a5a12; margin-left: 4px; }
.status-pill.corrected { background: #e7f0fa; color: #2a5b8a; margin-left: 4px; }
.status-pill.voided + .status-pill, .status-pill.completed + .status-pill { margin-left: 4px; }
.dc-cash { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbf8; font-size: 13px; }
.dc-cash strong { font-size: 16px; margin-left: 4px; }
.dc-closed { font-size: 13px; font-weight: 600; color: #2f7a36; margin: 6px 0; }
/* D108 最終調整: 値引きの記録の要確認・値引きの決まり */
.dc-flagged td { background: #fff6e5; }
.dc-flag { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #b5651d; color: #fff; white-space: nowrap; }
.dc-list { margin: 6px 0; padding-left: 18px; font-size: 12px; line-height: 1.7; }
#btn-hs-more { margin-top: 10px; }
#refund-sheet [hidden], #split-pay-sheet [hidden], #view-report [hidden], #view-history [hidden] { display: none !important; }
.flag-pill.ok { background: #e5f2e6; color: #2f7a36; }
/* Phase12: ログイン・承認 */
.approval-chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 12px; color: var(--ink-soft); margin-right: 8px; }
.approval-chip.on { background: #fbeee0; border-color: #e7c48f; color: #8a5a00; }
.approval-chip.warn { background: #fdecea; border-color: #e8a29a; color: #b00020; }
.auth-login-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.auth-login-form .meta-input { min-width: 220px; min-height: 40px; }
#approval-sheet .meta-input { display: block; width: 100%; margin: 6px 0; min-height: 42px; }
.ap-purpose { margin: 2px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.5; }
/* 承認の画面: 小さな画面・キーボード表示中でも、入力欄と「承認する」が隠れないように、中央に寄せて高さを実際の表示領域に合わせる(--vvh は js/app-auth.js が更新) */
#approval-sheet { align-items: center; }
#approval-sheet .sheet-inner { border-radius: 16px; max-height: calc(var(--vvh, 100vh) - 16px); }
.ap-kinds { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
/* ".sheet-inner label"(縦並び・中央)に負けないよう詳細度を上げ、チェックと文字を横に並べる */
.sheet-inner label.ap-kind { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 44px;
  font-size: 15px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; }
.sheet-inner label.ap-kind input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
#auth-card [hidden], #approval-sheet [hidden], .approval-chip[hidden] { display: none !important; }

/* Phase12: 端末内の記録の保存場所(IndexedDB)を開けないとき・書けないとき */
.storage-failed { position: fixed; inset: 0; z-index: 9999; background: var(--bg, #fff); display: flex; align-items: center; justify-content: center; padding: 24px; }
.storage-failed[hidden], .storage-warn[hidden] { display: none !important; }
.storage-warn { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; background: #b00020; color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); font-size: 15px; text-align: center; }

/* 「接続先とログイン」: この端末のID(省略表示・タップで全文・コピー) */
.device-id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.device-id-label { font-weight: 600; }
.device-id-value { flex: 1 1 200px; min-width: 0; min-height: 44px; text-align: left; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 17px;
  background: transparent; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; color: inherit; overflow-wrap: anywhere; cursor: pointer; }
.device-id-value[aria-expanded="true"] { border-style: solid; }

/* Phase 14: 権限のない画面に出す「責任者の承認が必要です」の案内 */
.approval-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; padding: 8px 12px; border: 1px solid #e7c48f; border-radius: 10px; background: #fbeee0; color: #6b4600; font-size: 13px; font-weight: 600; }
.approval-note[hidden] { display: none !important; }
.approval-note .approval-note-btn { min-height: 36px; }

/* Phase 14: 承認の管理(管理者) */
.aa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; font-size: 14px; line-height: 1.6; }
.aa-row .aa-info { flex: 1 1 auto; }
#approval-admin-sheet .meta-input { display: block; width: 100%; margin: 6px 0; min-height: 42px; }
#approval-admin-sheet [hidden] { display: none !important; }

/* Phase 15: 印刷の状態の記録(この伝票の印刷) */
.rp-jobs { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rp-job { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.rp-job-unconfirmed { border-color: #e7c48f; background: #fbeee0; }
.rp-job-failed { border-color: #e8a29a; background: #fdecea; }
.rp-job-delivered, .rp-job-confirmed_printed { border-color: #bcd9bf; background: #eef7ee; }
.rp-job-btns { display: flex; gap: 6px; }
.rp-job-btns .meta-btn { min-height: 36px; }

/* Phase16: 売上の「金額のつじつまの確認」 */
.recon-list { list-style: none; margin: 8px 0 0; padding: 0; }
.recon-list li { padding: 6px 0; border-top: 1px solid var(--line, #e5e0d8); font-size: 13px; }
.recon-list li:first-child { border-top: 0; }
.recon-mark { display: inline-block; width: 1.4em; font-weight: 700; }
.recon-list li.ok .recon-mark { color: #2f7d4f; }
.recon-list li.warn .recon-mark { color: #b7791f; }
.recon-list li.ng .recon-mark { color: #c53030; }

/* Phase16: 商品管理の「店舗確認の進み具合」 */
.review-progress { border: 1px solid var(--line, #e5e0d8); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #fffdf8; }
.rp-title { font-weight: 700; margin-bottom: 6px; }
.rp-row { display: grid; grid-template-columns: 9em 110px 1fr auto; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line, #eee7dc); font-size: 13px; }
.rp-row:first-of-type { border-top: 0; }
.rp-bar { display: inline-block; height: 8px; border-radius: 4px; background: #e9e4da; overflow: hidden; }
.rp-fill { display: block; height: 100%; background: #2f7d4f; }
.rp-bar-empty { background: transparent; }
.rp-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .rp-row { grid-template-columns: 1fr; } .rp-acts { justify-content: flex-start; } }

/* Phase16: 「元に戻す」つきの知らせ */
.undo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; background: #2b2b28; color: #fff; padding: 8px 8px 8px 18px; border-radius: 999px; font-size: 14px; max-width: 92vw; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.undo-toast button { min-height: 40px; min-width: 96px; border: 0; border-radius: 999px; background: #f3e3b3; color: #3a2a00; font-weight: 700; font-size: 14px; cursor: pointer; }

/* calc-r4: 会計を確定できない理由(税込と税抜の混在・税抜の商品の奉仕料など)は赤字で目立たせる */
.policy-block { color: #b00020; font-weight: 600; }

/* 領収書の宛名・但し書き(キーボードで入力・空欄にするボタン)と、但し書きの定型文のボタン */
.rp-input-row { display: flex; gap: 8px; align-items: center; }
.rp-input-row .meta-input { flex: 1; min-width: 0; }
.rp-note-templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.rp-note-templates .chip-btn { border: 1px solid #c9bfae; background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; min-height: 40px; cursor: pointer; }
.rp-note-templates .chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 高島屋・リンベルのお食事チケット(0円)と月末請求用の商品の札 */
.tax-tag.meal-ticket-tag { background: #e7f2e8; color: #1e5b2a; border-color: #a9d0af; }
.tax-tag.billing-tag { background: #f3eee6; color: #7a5a2a; }

/* 注文欄の上部: お勘定票(よく使う)と削除(右端・離して置く) */
.order-panel-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.ghost-mini-btn { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.ghost-mini-btn:disabled { opacity: 0.45; }
.ghost-mini-btn:active { background: #f3efe6; }
.order-panel-head .danger-link-btn { white-space: nowrap; padding: 0 10px; }

/* D106: 客席用の端末の案内 */
.seat-note { background: #f3efe6; border: 1px solid #e2d8c6; border-radius: 8px; padding: 8px 10px; color: var(--ink); }
/* 確認の画面の文は改行をそのまま表示し、長いときはスクロールする(店舗の決まりの変更の一覧など) */
#confirm-message { white-space: pre-line; max-height: 50vh; overflow-y: auto; }

/* D106: メインPOS(レジ)と客席用のタブレットを、ぱっと見て分かるようにする。
   メインPOS = 朱(赤系)。客席用 = 藍(青系)。左上の札と、画面の上端の帯の色でも分かるようにする。 */
body.role-seat {
  --accent: #2c6aa0;
  --accent-soft: #e2edf7;
  --bg: #f0f4f8;
}
.role-tag { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); letter-spacing: 0.04em; }
body.role-main .app-shell, body.role-seat .app-shell { border-top: 4px solid var(--accent); }
/* 左のメニューの背景もうすく色分けする(D106: ぱっと見てメインPOSか客席用か分かるように) */
body.role-main .side-nav { background: #fbf1ef; }
body.role-seat .side-nav { background: #e9f1f8; }
/* 管理用のPC = 深緑(2026-11-08 店主の指示「管理用の見やすい色に」)。レジ=朱・客席用=藍・PC=深緑の3色で見分ける */
body.role-pc { --accent: #2f6b55; --accent-soft: #e2f0e9; --bg: #f1f5f2; }
body.role-pc .side-nav { background: #e8f2ec; }
body.role-main .role-tag, body.role-seat .role-tag { font-size: 12px; padding: 3px 10px; }

/* D108: 会計画面の値引きボタン(よく使う値引きを1回で) */
.discount-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.discount-quick .chip-btn { min-height: 40px; font-size: 14px; padding: 0 14px; cursor: pointer; }
.discount-quick .chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* D108: 店内・持ち帰りの表示 */
.serving-tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.serving-tag.takeout { background: #e7f3e8; color: #2f6b34; border: 1px solid #b9d8bc; }
.serving-tag.eatin { background: #fdeee0; color: #8a4b12; border: 1px solid #efc9a4; }
/* D110: 店内/持ち帰りの税区分 */
.serving-taxes { margin: 4px 0 8px 24px; display: flex; flex-wrap: wrap; gap: 6px 12px; }

/* D113: 利用者管理 */
.users-admin .ua-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin: 10px 0; padding: 10px; border: 1px solid #ccd; border-radius: 6px; background: #f8f9fc; }
.users-admin .ua-form label { display: flex; flex-direction: column; font-size: 13px; gap: 2px; max-width: 100%; }
.users-admin .ua-form input, .users-admin .ua-form select { min-width: 0; max-width: 100%; }
.users-admin .ua-msg { margin: 6px 0; }
.users-admin .ua-msg.ng { color: #a40000; }
.users-admin .ua-msg.ok { color: #1a6a1a; }
.users-admin .ua-off td { color: #888; }
.users-admin .ua-tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: #e6ecf5; margin-left: 4px; white-space: nowrap; }
.users-admin .ua-acts { display: flex; flex-wrap: wrap; gap: 4px; }

/* PC管理画面(Firebase Hosting)でログインしていない間: ログインの欄だけを見せる(端末に残った伝票・売上・顧客の控えを見せない) */
body.hosted-locked .nav-btn:not([data-view="settings"]) { display: none !important; }
body.hosted-locked main.view:not(#view-settings) { display: none !important; }
body.hosted-locked #view-settings .settings-card:not(#auth-card) { display: none !important; }
.role-tag.header-role-tag { margin-top: 0; white-space: nowrap; flex-shrink: 0; }

/* 前受金の呼び出し(D127) */
.advance-ref-note { font-size: 12px; color: var(--muted, #6b6660); margin: 6px 0 2px; }
.advance-pick-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: 50vh; overflow-y: auto; }
.advance-pick-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 56px; flex-shrink: 0; padding: 8px 14px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.advance-pick-row .settings-note { display: block; margin: 2px 0 0; }
.advance-pick-row:active { background: var(--accent-soft); }
.advance-pick-left { font-weight: 700; white-space: nowrap; }

/* 会計の支払い欄: 全額ボタンと現金の候補(2026-11-07) */
.checkout-section-title { font-weight: 700; padding: 4px 0; margin-bottom: 6px; }
.payment-row.with-full { grid-template-columns: 1fr 120px 60px 40px; }
.payment-row button.pay-full { width: 100%; font-size: 13px; font-weight: 700; padding: 0; }
.cash-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cash-suggest .chip-btn { min-height: 40px; font-size: 14px; padding: 0 14px; cursor: pointer; }
.cash-suggest .chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.customer-suffix { font-size: 14px; color: var(--ink); }
.customer-suffix[hidden] { display: none; }

/* 会計画面の2列(広い画面だけ。右に支払い内訳) */
.sheet-inner.checkout-wide { max-width: 1120px; }
.checkout-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 900px) {
  .checkout-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}
@media (max-width: 899px) { .checkout-columns { display: flex; flex-direction: column; gap: 10px; } }
/* ポイント利用の予定 */
.planned-point-btn { width: 100%; margin-top: 6px; }
.planned-point-btn.has-plan { border-color: #e6cf9b; background: #fbf4e3; color: #8a5a00; font-weight: 700; }

/* お会計の完了 */
.checkout-done-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; padding: 6px 0; }
.checkout-done-total strong { font-size: 26px; }
#cd-change-row strong { color: var(--accent); font-size: 30px; }

/* プルダウン(全画面): 細すぎないように高さと余白をそろえる(2026-11-07) */
select:not([multiple]) { min-height: 44px; padding: 0 36px 0 12px; border: 1px solid var(--line); border-radius: 10px; background-color: #fff;
  -webkit-appearance: none; appearance: none; font-size: 15px; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6660' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select:not([multiple]):disabled { background-color: #f3f1ec; color: var(--ink-soft); }

/* 分割会計(2026-11-07 作り直し) */
.split-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.split-head strong { font-size: 18px; }
.split-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.split-methods button { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 15px; font-weight: 700; color: var(--ink-soft); padding: 0 8px; }
.split-methods button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp-people-stepper { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.sp-people-stepper strong { font-size: 20px; min-width: 52px; text-align: center; }
.stepper-btn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; font-weight: 700; }
.stepper-btn:disabled { opacity: .4; }
.sp-preview-list { display: flex; flex-direction: column; gap: 4px; }
.sp-preview-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: #faf8f3; border-radius: 10px; }
.sp-preview-row strong { font-size: 16px; }
.sp-amount-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.sp-amount-name { font-weight: 700; }
.sp-amount-row .meta-input { min-height: 44px; font-size: 16px; }
.sp-check { font-weight: 700; color: #a8323e; }
.sp-check.ok { color: #2f7d4a; }
.sp-person-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-person-tab { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.sp-person-tab span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.sp-person-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp-person-tab.active span { color: #fff; }
.sp-person-tab.add { border-style: dashed; color: var(--ink-soft); }
.sp-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.sp-pick-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 60px; flex-shrink: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.sp-pick-row.on { border-color: var(--accent); background: #fdf3f3; }
.sp-pick-row.done { opacity: .45; }
.sp-pick-check { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.sp-pick-row.on .sp-pick-check { background: var(--accent); border-color: var(--accent); }
.sp-pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-pick-main strong { font-size: 15px; }
.sp-pick-meta { font-size: 12px; color: var(--ink-soft); }
.sp-pick-qty { display: inline-flex; align-items: center; gap: 8px; }
.sp-pick-qty strong { min-width: 24px; text-align: center; font-size: 18px; }
.sp-pick-sub { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
/* 人数とお名前の画面 */
.ss-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.ss-people-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ss-people-btn { min-height: 56px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 20px; font-weight: 700; color: var(--ink); }
.ss-people-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ss-more { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ss-more .stepper-btn { width: 56px; height: 56px; font-size: 24px; }
.ss-count-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.ss-count-input { width: 96px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; }
.ss-more-note { text-align: center; margin: 0; }
.party-size-btn { width: 64px; text-align: center; cursor: pointer; caret-color: transparent; }
.sp-tomo-label { font-weight: 700; color: var(--ink); }
.sp-tomo-note { font-size: 12px; color: var(--ink-soft); }
.sp-active-summary { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.sp-active-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-active-actions .meta-btn { min-height: 48px; padding: 0 18px; }
.sp-settle-list { display: flex; flex-direction: column; gap: 8px; }
.sp-settle-person { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.sp-settle-person.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.sp-settle-person.paid { background: #f3f8f3; }
.sp-settle-name { font-weight: 700; font-size: 16px; }
.sp-settle-amount { font-weight: 700; font-size: 16px; }
.sp-pay-tools { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) {
  #split-sheet #split-config { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #split-sheet #split-config[hidden] { display: none; }
}

/* 押す所・入力する所の枠は濃く(2026-11-07) */
input.meta-input, input[type="text"], input[type="number"], input[type="date"], input[type="search"], textarea, select:not([multiple]),
.meta-btn, .ghost-mini-btn, .stepper-btn, .row-btn, .split-methods button, .sp-person-tab, .sp-pick-row, .sp-settle-person, .sp-pick-check,
.payment-row button, .segmented, .sp-group-card, .checkout-section, .advance-pick-row { border-color: var(--line-strong); }
.sp-pick-row.on, .sp-settle-person.active, .split-methods button.active, .sp-person-tab.active { border-color: var(--accent); }
.meta-btn.primary-btn, .primary-btn { border-color: var(--accent); }
/* 席・商品・カテゴリーのボタンの枠も濃く */
.seat-btn:not(.occupied), .product-btn, .category-btn:not(.has-genre):not(.active) { border-color: var(--line-strong); }

/* スクロールできる所は、右側にいつもバーを出す(タブレットでは指で動かすまでバーが出ないため。2026-11-07 店舗の指示) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.025); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: #d6cec1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:active { background: #b9ae9c; background-clip: padding-box; }

/* 開閉する欄(値引き・友の会など)の三角形: 枠の外に出て重なっていたので、枠の内側に置く(2026-11-07) */
.checkout-section > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 2px; }
.checkout-section > summary::-webkit-details-marker { display: none; }
.checkout-section > summary::before { content: ""; flex: 0 0 auto; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent var(--ink-soft); transition: transform .15s; }
.checkout-section[open] > summary::before { transform: rotate(90deg); }

/* 支払い欄のボタン(支払いを追加・前受金を呼び出す): 行のすぐ下に横並び・同じ大きさ(2026-11-07) */
.pay-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 6px; }
.pay-tools .meta-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 0 10px; background: #fff; }
.pay-tools-icon { font-size: 17px; color: var(--accent); }

/* 奉仕料の対象を見るボタン(会計画面) */
.sc-label { display: inline-flex; align-items: center; gap: 8px; }
.sc-detail-btn { min-height: 34px; padding: 0 12px; font-size: 13px; font-weight: 700; border-radius: 999px; }

/* 注文の欄: ポイント利用・値引きの予定(横並び) */
.order-plan-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.order-plan-tools .planned-point-btn { margin-top: 0; min-height: 44px; font-size: 13px; padding: 0 6px; }

/* 友の会割引の率(現金・カード)を選ぶボタン */
.tomo-method { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.tomo-method button { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.tomo-method button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 注文内容を大きく見る */
.order-view-btn { background: none; border: 0; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.order-view-icon { font-size: 14px; color: var(--accent); }
.order-view-list { display: flex; flex-direction: column; max-height: 62vh; overflow-y: auto; border-top: 1px solid var(--line); }
.order-view-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 18px; }
.order-view-row.course { background: #fdf8ee; }
.ov-name { font-weight: 700; display: flex; flex-direction: column; gap: 2px; }
.ov-tags { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ov-qty { text-align: right; font-weight: 700; }
.ov-amount { text-align: right; font-weight: 700; }

/* 売上・締め(2026-11-07 整理): 上の4つのページ */
.report-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.report-pages button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.report-pages button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.report-page[hidden] { display: none; }
.sr-more-toggle { border-style: dashed !important; }
.csv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.csv-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.csv-item .meta-btn { min-height: 48px; font-size: 15px; font-weight: 700; }
.csv-item span { font-size: 13px; color: var(--ink-soft); }
/* 取引履歴(2026-11-07 整理) */
.hs-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.hs-quick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hs-quick button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 14px; }
.hs-quick button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hs-main { display: flex; gap: 8px; margin-bottom: 8px; }
.hs-main-input { flex: 1; min-height: 48px; font-size: 16px; }
.hs-main .meta-btn { min-height: 48px; padding: 0 24px; }
.hs-more { margin-bottom: 8px; }
.history-row { cursor: pointer; }
.history-row:active { background: var(--accent-soft); }
.history-table td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.hr-seat strong { font-size: 15px; }
.hr-total { font-size: 16px; font-weight: 700; white-space: nowrap; }

/* 伝票の詳細のボタン(2026-11-07 整理) */
.td-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.td-actions .meta-btn, .td-actions .ghost-btn { min-height: 52px; font-size: 15px; font-weight: 700; }
.td-actions .settings-note, .td-actions .td-print-row { grid-column: 1 / -1; }
#corr-terminal-row[hidden] { display: none; }

/* 商品の表示の切り替え(パネル/リスト) */
.product-view-seg { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.product-view-seg button { min-height: 44px; padding: 0 12px; border: 0; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.product-view-seg button + button { border-left: 1px solid var(--line-strong); }
.product-view-seg button.active { background: var(--accent); color: #fff; }
.product-grid.list-mode { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.product-grid.list-mode .product-btn { min-height: 54px; flex-direction: row; justify-content: space-between; align-items: center; padding: 8px 14px; gap: 12px; }
.product-grid.list-mode .p-name { text-align: left; font-size: 15px; }
.product-grid.list-mode .p-price { white-space: nowrap; font-size: 14px; }

/* 商品の欄の上の段: 検索・緊急商品登録・パネル|リストを1段に並べる(入りきらず下の段に落ちていた) */
.product-pane .order-meta { flex-wrap: nowrap; }
.product-pane .order-meta .search-input { flex: 1 1 auto; min-width: 0; }
.product-pane .order-meta #btn-quick-add { flex: 0 0 auto; white-space: nowrap; }
.order-plan-tools .planned-point-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.product-view-btn { flex: 0 0 auto; min-width: 72px; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 700; white-space: nowrap; }

/* 注文内容の横の「大きく見る」の印を大きく(小さすぎるという声) */
.order-view-btn { min-height: 44px; gap: 2px; font-size: 15px; }
.order-view-icon { display: inline-block; width: auto; height: auto; border: 0; font-size: 28px; line-height: 1; background: none; margin-left: -2px; transform: translateY(-6px); } /* 文字の形で下寄りに見えるので上へ */

/* ---- 会計の訂正(2026-11-07 作り直し)。枠・高さ・角の丸みを1つの決まりにそろえる ---- */
.corr-sheet { gap: 12px; }
.corr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.corr-head h2 { margin: 0; font-size: 18px; }
.corr-head-meta { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.corr-totals { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #faf8f3; border: 1px solid var(--line); border-radius: 12px; }
.corr-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.corr-total span { font-size: 12px; color: var(--ink-soft); }
.corr-total strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.corr-total.after strong { font-size: 22px; color: var(--ink); }
.corr-arrow { color: var(--ink-soft); font-size: 18px; }
.corr-diff { min-width: 88px; text-align: center; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #efece5; color: var(--ink-soft); }
.corr-diff.up { background: #fbe9e7; color: #a8323e; }
.corr-diff.down { background: #e6f0f9; color: #2c6aa0; }
.corr-lead { margin: 0; font-size: 12px; color: var(--ink-soft); }
.corr-notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fdf3e2; border: 1px solid #e8c98f; font-size: 13px; }
.corr-columns { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) {
  .corr-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .corr-side { position: sticky; top: 0; }
}
.corr-col, .corr-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.corr-stack[hidden], .corr-col [hidden] { display: none !important; }
.corr-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.corr-card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.sheet-inner .corr-card > label, .sheet-inner label.corr-card { gap: 6px; }
/* 開閉する欄: 見出しの右に今の内容(なし・○円引き など) */
.corr-fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 28px; cursor: pointer; font-size: 15px; font-weight: 700; }
.corr-fold > summary::-webkit-details-marker { display: none; }
.corr-fold > summary::before { content: ""; flex: 0 0 auto; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent var(--ink-soft); transition: transform .15s; }
.corr-fold[open] > summary::before { transform: rotate(90deg); }
.corr-fold-state { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.corr-fold[open] > summary { margin-bottom: 4px; }
.corr-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .corr-grid3 { grid-template-columns: 1fr; } }
.corr-card .meta-input, .corr-card select:not([multiple]) { min-height: 44px; height: 44px; border-radius: 10px; font-size: 15px; }
/* 明細: 商品 | 数量 | 単価 | 割引・加算 | 金額 の表 */
.corr-items { display: flex; flex-direction: column; }
.corr-items-head, .corr-item { display: grid; grid-template-columns: minmax(0, 1fr) 128px 112px 96px; align-items: center; gap: 10px; }
.corr-items-head { padding: 0 2px 6px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.corr-items-head span:last-child, .corr-item-amount { text-align: right; }
.corr-item { min-height: 60px; padding: 8px 2px; border-bottom: 1px solid #d8cfc0; }
.corr-item:last-child { border-bottom: 0; }
.corr-item-name { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.corr-item-name .oi-discount-tag { margin-left: 6px; }
.corr-qty { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.corr-qty button { height: 100%; border: 0; background: #faf8f3; font-size: 20px; color: var(--ink); }
.corr-qty button:active { background: var(--accent-soft); }
.corr-qty span { text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.corr-item .corr-item-price { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.corr-item-discount { height: 44px; padding: 0 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.corr-item-discount:active { background: var(--accent-soft); }
.corr-item-amount { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.corr-empty { padding: 14px 4px; color: var(--ink-soft); font-size: 13px; text-align: center; }
.corr-search { width: 100%; box-sizing: border-box; }
.corr-product-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.corr-product-results:empty { display: none; }
.corr-product-add { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; font-size: 14px; color: var(--ink); }
.corr-product-add strong { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.corr-product-add:active { background: var(--accent-soft); }
.corr-remaining { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.corr-terminal { background: #fdf8ee; }
.corr-actions { display: flex; flex-direction: column; gap: 8px; }
.corr-actions .checkout-btn, .corr-actions .sheet-btn { width: 100%; margin: 0; }
.corr-card .pay-tools { grid-template-columns: 1fr; margin: 0; }
.rp-jobs-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
#rp-printer-row[hidden], #rp-version-note[hidden] { display: none !important; }

/* ---- 伝票の詳細(2026-11-07 作り直し。訂正の画面と同じカードの決まり) ---- */
#ticket-detail-body { display: flex; flex-direction: column; gap: 12px; }
.td-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.td-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.td-title-row h2 { margin: 0; font-size: 18px; }
.td-items { display: flex; flex-direction: column; }
.td-item { display: grid; grid-template-columns: minmax(0, 1fr) 48px 88px 96px; align-items: center; gap: 10px; min-height: 44px; padding: 6px 2px; border-bottom: 1px solid #d8cfc0; }
.td-item:last-child { border-bottom: 0; }
.td-item-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.td-item-qty { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.td-item-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.td-sum { display: flex; flex-direction: column; padding-top: 8px; border-top: 1px solid var(--line); }
.td-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 2px; font-size: 14px; }
.td-row span:last-child, .td-row strong { font-variant-numeric: tabular-nums; text-align: right; }
.td-row small { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.td-row-soft { color: var(--ink-soft); font-size: 13px; }
.td-row-total { padding-top: 10px; border-top: 2px solid var(--ink); font-size: 16px; font-weight: 700; }
.td-row-total strong { font-size: 20px; }
.td-row-strong { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }
.td-tax { padding: 10px 12px; background: #faf8f3; border-radius: 10px; }
.td-sub-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.td-sub-title span { display: block; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.td-ops { gap: 8px; }
.td-ops > .meta-btn, .td-ops > .ghost-btn, .td-ops-group .meta-btn { width: 100%; min-height: 52px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.td-ops > .ghost-btn.danger { margin-top: 6px; }
.td-ops-group { display: flex; flex-direction: column; gap: 8px; }
.td-ops .settings-note { margin: 0; }
.td-log { padding: 8px 0; border-bottom: 1px solid #d8cfc0; }
.td-log:last-of-type { border-bottom: 0; }
.td-log-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.td-log-head span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.td-log-line { margin-top: 3px; font-size: 13px; color: var(--ink-soft); }
.td-log-line .row-btn { margin-left: 6px; }
.corr-head { align-items: center; }
.corr-head-title { flex: 0 0 auto; }
.corr-basic-inline { flex: 1 1 420px; display: flex; gap: 10px; align-items: flex-end; min-width: 0; }
.sheet-inner .corr-basic-inline label { gap: 4px; font-size: 12px; }
.corr-basic-inline .cb-name { flex: 1 1 200px; min-width: 0; }
.corr-basic-inline .cb-people { flex: 0 0 84px; }
.corr-basic-inline .cb-seat { flex: 0 0 120px; }
.corr-basic-inline .meta-input, .corr-basic-inline select:not([multiple]) { width: 100%; min-height: 44px; height: 44px; border-radius: 10px; font-size: 15px; box-sizing: border-box; }
.corr-basic-inline .cb-people .meta-input { text-align: center; }

/* ---- 商品管理(2026-11-07 作り直し) ---- */
.pm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pm-toolbar .pm-search { flex: 1 1 220px; min-height: 44px; height: 44px; border-radius: 10px; font-size: 15px; }
.pm-toolbar select { flex: 0 1 220px; }
.pm-add { min-height: 44px; padding: 0 18px; font-size: 15px; white-space: nowrap; margin: 0; width: auto; }
.pm-more { position: relative; }
.pm-more > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pm-more > summary::-webkit-details-marker { display: none; }
.pm-more > summary::after { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 5px 0 5px; border-color: var(--ink-soft) transparent transparent transparent; }
.pm-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; display: flex; flex-direction: column; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.pm-more-item { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 15px; color: var(--ink); cursor: pointer; }
.pm-more-item:active, .pm-more-item:hover { background: var(--accent-soft); }
.pm-more-item[hidden] { display: none !important; }
.pm-help { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.pm-notices { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pm-notices > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; cursor: pointer; font-size: 14px; font-weight: 700; }
.pm-notices > summary::-webkit-details-marker { display: none; }
.pm-notices > summary::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent var(--ink-soft); transition: transform .15s; }
.pm-notices[open] > summary::before { transform: rotate(90deg); }
.pm-notices > #products-notices { padding: 0 12px 12px; }
.pm-table { font-size: 14px; }
.pm-table thead th { position: sticky; top: 0; z-index: 2; background: #faf8f3; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.pm-table tbody tr { cursor: pointer; }
.pm-table tbody tr:hover { background: #fcfaf6; }
.pm-table td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.pm-table .pn-pos { font-size: 15px; font-weight: 600; }
.pm-table .pm-cat { color: var(--ink-soft); white-space: nowrap; }
.pm-table .pm-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-table .pm-tax, .pm-table .pm-sc, .pm-table .pm-tomo { white-space: nowrap; }
.pm-table .row-acts { white-space: nowrap; text-align: right; }
.pm-table .row-acts .row-btn { min-height: 40px; min-width: 64px; margin-left: 6px; }
.pm-toolbar select:not([multiple]) { width: auto; flex: 0 0 168px; min-width: 0; }
.pm-toolbar .pm-search { min-width: 160px; }
.pm-table { width: 100%; table-layout: fixed; }
.pm-table th:nth-child(1), .pm-table td:nth-child(1) { width: 44px; }
.pm-table th:nth-child(3), .pm-table td:nth-child(3) { width: 120px; }
.pm-table th:nth-child(4), .pm-table td:nth-child(4) { width: 96px; }
.pm-table th:nth-child(5), .pm-table td:nth-child(5) { width: 64px; }
.pm-table th:nth-child(6), .pm-table td:nth-child(6) { width: 96px; }
.pm-table th:nth-child(7), .pm-table td:nth-child(7) { width: 56px; }
.pm-table th:nth-child(8), .pm-table td:nth-child(8) { width: 168px; }
.pm-table .pm-cat { white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.pm-table .pn-cell { overflow-wrap: anywhere; }

/* ---- 飲み方・サイズを選ぶ(バリエーションを1つのボタンに) ---- */
.product-btn.variant-btn .variant-count { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--accent); }
.vs-options { display: flex; gap: 10px; flex-wrap: wrap; }
.vs-option { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 16px; font-weight: 700; color: var(--ink); }
.vs-option span { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.vs-option.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.vs-option.active span { color: var(--accent); }
.vs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vs-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 64px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; font-size: 16px; font-weight: 600; color: var(--ink); }
.vs-item strong { flex: 0 0 auto; font-size: 17px; font-variant-numeric: tabular-nums; }
.vs-item:active { background: var(--accent-soft); border-color: var(--accent); }

/* ---- カテゴリーの名前・色・並び順(2026-11-07 作り直し) ---- */
.cm-help { margin: 0 0 8px; }
.cm-list { display: flex; flex-direction: column; gap: 8px; }
.cm-row { display: grid; grid-template-columns: 40px 8px minmax(180px, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px 8px 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.cm-row.dragging { box-shadow: 0 10px 24px rgba(0,0,0,.18); border-color: var(--accent); position: relative; z-index: 5; background: #fffdf9; }
.cm-handle { display: flex; align-items: center; justify-content: center; height: 48px; font-size: 24px; color: var(--ink-soft); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cm-row.dragging .cm-handle { cursor: grabbing; color: var(--accent); }
.cm-swatch { align-self: stretch; border-radius: 4px; background: var(--g); }
.cm-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-main .meta-input { height: 44px; min-height: 44px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.cm-main small { font-size: 11px; color: var(--ink-soft); }
.cm-genres { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 640px; }
.cm-genre-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.cm-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--g); flex: 0 0 auto; }
.cm-genre-chip.no-genre .cm-dot { background: #fff; border: 2px dashed #b9b2a5; box-sizing: border-box; }
.cm-genre-chip.active { background: var(--g-soft); border-color: var(--g); border-width: 2px; color: var(--ink); font-weight: 700; }
.cm-genre-chip.no-genre.active { border-color: var(--ink-soft); }
.cm-actions { position: sticky; bottom: 0; padding-top: 10px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 30%); }
.cm-actions .checkout-btn { width: 100%; margin: 0; }
.cm-row.no-genre, .cm-genre-chip.no-genre { --g: #c9c2b5; --g-soft: #f3f1ec; }
.cm-genres { max-width: none; }
.cm-genre-select { width: 190px; height: 44px; min-height: 44px; font-size: 15px; font-weight: 600; border: 2px solid var(--g) !important; background-color: var(--g-soft) !important; }
.cm-row.no-genre .cm-genre-select { border: 1px solid var(--line) !important; background-color: #fff !important; }
/* カテゴリーの行を低く(できるだけ多く見えるように。2026-11-07 店舗の指示) */
.cm-list { gap: 4px; }
.cm-row { grid-template-columns: 36px 6px minmax(180px, 1fr) auto; gap: 8px; padding: 3px 8px 3px 4px; border-radius: 10px; }
.cm-handle { height: 38px; font-size: 20px; }
.cm-main { flex-direction: row; align-items: center; gap: 10px; }
.cm-main .meta-input { height: 36px; min-height: 36px; flex: 1 1 auto; min-width: 0; font-size: 14px; }
.cm-main small { flex: 0 0 auto; white-space: nowrap; }
.cm-genre-select { height: 36px; min-height: 36px; font-size: 14px; width: 170px; }
.cm-help { margin-bottom: 6px; }

/* ---- 前受金の画面 ---- */
.adv-layout { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) { .adv-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; gap: 16px; } .adv-receive { position: sticky; top: 0; } }
.adv-receive .meta-input { height: 48px; min-height: 48px; border-radius: 10px; font-size: 16px; }
.adv-receive .checkout-btn { margin: 4px 0 0; width: 100%; }
.adv-list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adv-list-head .corr-card-title { margin-right: auto; }
.adv-search { height: 40px; min-height: 40px; border-radius: 10px; width: 180px; }
.adv-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.adv-sum { display: flex; flex-direction: column; padding: 10px 14px; background: #faf8f3; border-radius: 10px; }
.adv-sum span { font-size: 12px; color: var(--ink-soft); }
.adv-sum strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.adv-sum.soft strong { font-size: 15px; padding-top: 6px; }
.adv-list { display: flex; flex-direction: column; gap: 10px; }
.adv-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.adv-card.is-done { background: #fbfaf7; }
.adv-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.adv-name { font-size: 17px; font-weight: 700; }
.adv-meta { font-size: 13px; color: var(--ink-soft); }
.adv-memo { color: var(--ink); font-weight: 600; }
.adv-remaining { text-align: right; }
.adv-remaining span { display: block; font-size: 12px; color: var(--ink-soft); }
.adv-remaining strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.adv-state { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: 2px; }
.adv-state.open { background: #e6f0f9; color: #2c6aa0; }
.adv-state.part { background: #fdf3e2; color: #9a6514; }
.adv-state.done { background: #efece5; color: var(--ink-soft); }
.adv-state.over { background: #fbe9e7; color: #a8323e; }
.adv-nums { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.adv-uses { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid #d8cfc0; }
.adv-uses li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #d8cfc0; font-size: 13px; }
.adv-uses li strong { font-variant-numeric: tabular-nums; }
.adv-actions { display: flex; gap: 8px; margin-top: 10px; }
.adv-actions .meta-btn { min-height: 44px; padding: 0 16px; font-weight: 700; }
.adv-unlinked { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.adv-receive label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.adv-receive label > .meta-input, .adv-receive .rp-input-row { width: 100%; }
.adv-receive .rp-input-row { display: flex; align-items: center; gap: 6px; }
.adv-receive .rp-input-row .meta-input { flex: 1 1 auto; min-width: 0; }
/* 印刷の画面の宛名・但し書きの欄: 入力欄を1行いっぱいに、ボタンは下の行へ(欄がつぶれていた) */
.print-controls .rp-input-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.print-controls .rp-input-row .meta-input { flex: 1 1 100%; min-width: 0; height: 44px; }

/* AirPay・PAYGATE の種類(カード・QR・電子マネー) */
.pay-kind { display: flex; align-items: center; gap: 6px; margin: -2px 0 6px; flex-wrap: wrap; }
.pay-kind-label { font-size: 12px; color: var(--ink-soft); margin-right: 2px; }
.pay-kind-btn { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); }
.pay-kind-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- 会計の画面(2026-11-07 作り直し) ---- */
.co-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.co-head-title { flex: 1 1 auto; min-width: 0; }
.co-head-title h2 { margin: 0; font-size: 18px; }
.co-head-total { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 16px; background: #faf8f3; border: 1px solid var(--line); border-radius: 12px; line-height: 1.15; }
.co-head-total span { font-size: 12px; color: var(--ink-soft); }
.co-head-total strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.co-close { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.co-sheet .checkout-summary .report-sub-row { align-items: center; }
.co-due { margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--ink); }
.co-due-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px; font-size: 16px; font-weight: 700; }
.co-due-row strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.co-due-row.change { color: var(--accent); }
.co-due-row.change strong { font-size: 30px; }
.co-due-row[hidden] { display: none; }
.co-sheet .checkout-btn { margin: 0; width: 100%; }
.co-sub-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.co-sub-actions .meta-btn { min-height: 48px; font-size: 15px; font-weight: 700; }
.co-sub-actions .meta-btn[hidden] { display: none; }

/* 会計の画面(2回目の見直し): 内訳は白いカード・細い線、合計は上の段だけ、閉じた欄に今の状態 */
.co-sheet .checkout-columns { gap: 18px; }
.co-sheet .checkout-summary { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin-bottom: 0; }
.co-sheet .checkout-summary .report-sub-row { padding: 11px 0; font-size: 15px; border-bottom: 1px solid #ddd4c6; }
.co-sheet .checkout-summary .report-sub-row[hidden] { display: none; }
.co-sheet .checkout-summary .report-sub-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.co-sheet .tax-breakdown { margin: 0; padding: 6px 0 8px; }
.co-sheet .tax-breakdown .report-sub-row { padding: 3px 0 3px 12px; border-bottom: 0; font-size: 12px; color: var(--ink-soft); }
.co-sheet:not(.co-adv) .checkout-summary .order-total-row { display: none; }
.co-sheet .checkout-summary .order-total-row { border: 0; padding: 12px 0; }
.co-sheet .sc-detail-btn { min-height: 0; padding: 2px 6px; margin-left: 6px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.co-sheet .checkout-section { border-radius: 12px; padding: 6px 16px; margin-bottom: 0; background: #fff; }
.co-sheet details.checkout-section > summary { font-size: 15px; }
.co-fold-state { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.co-sheet details.checkout-section[open] > summary { margin-bottom: 6px; }
.co-sheet .checkout-col { gap: 12px; }
.co-sheet .checkout-col > .checkout-section:not(details) { padding: 14px 16px; }
.co-sheet .checkout-section-title { font-size: 15px; }
/* 支払いの行(会計・訂正・分割): 2段にして金額の欄を大きく(2026-11-07 店舗の声: 金額を入れるところが小さい)
   上の段: 支払方法 | ×   下の段: 金額(大きく) | 全額 */
.payment-row.with-full { grid-template-columns: minmax(0, 1fr) 84px 52px; grid-template-areas: "method method remove" "amount full full"; row-gap: 8px; column-gap: 8px; margin-bottom: 10px; }
.payment-row.with-full > select { grid-area: method; min-height: 48px; height: 48px; border-radius: 10px; font-size: 16px; }
.payment-row.with-full > input { grid-area: amount; min-height: 56px; height: 56px; border-radius: 10px; font-size: 26px; font-weight: 700; text-align: right; padding: 0 14px; font-variant-numeric: tabular-nums; }
.payment-row.with-full > input::placeholder { font-size: 16px; font-weight: 400; }
.payment-row.with-full > button.pay-full { grid-area: full; width: 100%; height: 56px; font-size: 16px; border-radius: 10px; }
.payment-row.with-full > button:last-child { grid-area: remove; width: 100%; height: 48px; border-radius: 10px; font-size: 18px; color: var(--ink-soft); }
.cash-suggest { gap: 8px; margin: -2px 0 12px; }
.cash-suggest .chip-btn { min-height: 44px; font-size: 16px; padding: 0 16px; }
/* お支払いの中の色・線・枠(2026-11-08 店舗の声): 白地に細い枠でそろえ、残額・お釣りは薄い色の囲みに */
.co-sheet .checkout-col > .checkout-section:not(details) { border: 1px solid var(--line); }
.payment-row.with-full > select, .payment-row.with-full > input { border: 1px solid var(--line); background-color: #fff; }
.payment-row.with-full > input:focus, .payment-row.with-full > select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.payment-row.with-full > button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.payment-row.with-full > button.pay-full { background: #faf8f3; }
.cash-suggest .chip-btn, .discount-quick .chip-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; }
.cash-suggest .chip-btn.active, .discount-quick .chip-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pay-kind-btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
.pay-kind-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.co-sheet .pay-tools { margin: 4px 0 10px; }
.co-sheet .pay-tools .meta-btn { min-height: 44px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.co-due { margin-top: 2px; padding: 10px 14px; border: 0; border-radius: 10px; background: #faf8f3; }
.co-due-row { padding: 2px 0; font-size: 15px; }
.co-due-row strong { font-size: 26px; }
.co-due-row.change { margin-top: 4px; padding-top: 8px; border-top: 1px solid #d8cfc0; }
.co-due-row.change strong { font-size: 30px; }
#co-validation-message { margin: 8px 2px 0; font-size: 13px; font-weight: 600; }
#co-validation-message.co-ok { color: #2f7a46; }
#co-validation-message.co-ng { color: #a8323e; }
/* 支払方法を選んでいない欄: 赤い点線の枠で目立たせる(必ず選ぶ。2026-11-08) */
.payment-row select.unselected { border: 2px dashed var(--accent) !important; color: var(--accent); font-weight: 700; background-color: #fff8f7 !important; }
/* ×は右端に上下2段ぶんの高さで置き、支払方法の欄と「全額」の右端をそろえる(2026-11-08 店舗の声) */
.payment-row.with-full { grid-template-columns: minmax(0, 1fr) 84px 48px; grid-template-areas: "method method remove" "amount full remove"; }
.payment-row.with-full > button:last-child { height: auto; align-self: stretch; }
/* ×の枠を小さく(2段ぶんの高さはそのまま、幅を細く。2026-11-08 店舗の声) */
.payment-row.with-full { grid-template-columns: minmax(0, 1fr) 84px 34px; }
.payment-row.with-full > button:last-child { font-size: 15px; padding: 0; border-color: #ddd5c8; color: #9a948c; background: #fff; }
/* 金額の欄: 左端に「¥」を出す(2026-11-08 店舗の声)。空のときは「受け取り金額」 */
.payment-row.with-full > input { padding-left: 40px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='32'><text x='0' y='25' font-size='24' font-weight='700' font-family='sans-serif' fill='%236b6660'>¥</text></svg>"); background-repeat: no-repeat; background-position: 14px center; background-size: 18px 24px; }
.payment-row.with-full > input::placeholder { text-align: right; color: #a9a39a; }
/* 会計の上の段(2026-11-08): 部屋番号・人数・お名前を大きく。合計は箱なしの大きな文字。閉じるは離して控えめに */
.co-head { align-items: flex-end; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #d8cfc0; }
.co-head-title h2 { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 2px; }
.co-sheet #co-head-meta { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.co-sheet #co-head-meta .co-seat { font-size: 26px; }
.co-head-total { flex-direction: row; align-items: baseline; gap: 12px; padding: 0; background: none; border: 0; border-radius: 0; }
.co-head-total span { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.co-head-total strong { font-size: 34px; }
.co-close { margin-left: 18px; align-self: center; min-height: 40px; padding: 0 14px; font-size: 14px; border-color: #ddd5c8; color: #8a847b; }
/* 受け取り金額の欄: はっきりした色・太い枠に(2026-11-08 店舗の声)。入力中は朱色 */
.payment-row.with-full > input { border: 2px solid #8f8576; }
.payment-row.with-full > input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- 注文の欄(2026-11-08 見直し): 行は名前・数・金額だけ。押すと値段・割引/加算。削除は「…」の中 ---- */
.order-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid #d8cfc0; cursor: pointer; }
.order-item .oi-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.order-item .oi-price { font-size: 15px; font-weight: 700; color: var(--ink); min-width: 0; font-variant-numeric: tabular-nums; }
.order-item .oi-item-actions { display: none; grid-column: 1 / -1; gap: 8px; padding-top: 4px; }
.order-item.expanded { background: #fcf8f2; border-radius: 10px; }
.order-item.expanded .oi-item-actions { display: flex; }
.order-item .oi-item-actions .row-btn { min-height: 40px; padding: 0 14px; font-size: 13px; font-weight: 700; }
.order-item .qty-stepper button { width: 40px; height: 40px; }
.oi-more { position: relative; }
.oi-more > summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 18px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.oi-more > summary::-webkit-details-marker { display: none; }
.oi-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.oi-more-item { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font-size: 15px; text-align: left; cursor: pointer; }
.oi-more-item.danger { color: #a8323e; font-weight: 700; }
.oi-more-item:active, .oi-more-item:hover { background: #fdf0f0; }
/* 注文の行を2段に: 上=商品名(横いっぱい)、下=数と金額。押すとさらに下に値段・割引/加算(2026-11-08) */
.order-item { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "name name" "qty price" "acts acts"; row-gap: 6px; padding: 10px 6px; }
.order-item .oi-name { grid-area: name; }
.order-item .qty-stepper { grid-area: qty; }
.order-item .oi-price { grid-area: price; text-align: right; font-size: 16px; }
.order-item .oi-item-actions { grid-area: acts; }
.order-item .qty-stepper button { width: 38px; height: 38px; }
/* 人数の欄: 数字だけ(「—」「人」「上下の矢印」は出さない。2026-11-08) */
.ss-count-input { width: 88px; }
.ss-count-input::-webkit-outer-spin-button, .ss-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* 人数とお名前の画面: お名前の欄を目立たせる(大きく・はっきりした枠。2026-11-08 店舗の声) */
#seat-start-sheet label { font-size: 14px; color: var(--ink); }
#ss-name { height: 56px; min-height: 56px; border: 2px solid #8f8576; border-radius: 10px; font-size: 20px; font-weight: 600; padding: 0 14px; }
#ss-name::placeholder { font-size: 16px; font-weight: 400; color: #a9a39a; }
#ss-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#ss-name-suffix { font-size: 20px; font-weight: 700; }
/* ---- 席一覧(2026-11-08 見直し): 使用中ははっきりした色。人数・お名前・時間・金額 ---- */
.seat-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.seat-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 92px; padding: 8px 6px; }
.seat-btn .seat-label { font-size: 22px; font-weight: 700; line-height: 1.2; }
.seat-btn.occupied { background: #fdf0e6; border: 2px solid #c8742f; }
.seat-btn.occupied .seat-label { color: #8a4a17; }
.seat-btn .seat-meta { font-size: 12px; font-weight: 600; color: #8a4a17; }
.seat-btn .seat-name { font-size: 13px; font-weight: 700; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-btn .seat-amount { font-size: 15px; font-weight: 700; color: #8a4a17; font-variant-numeric: tabular-nums; }
.seat-btn.no-order { background: #fbf6ef; border-style: dashed; }
.seat-btn.no-order .seat-amount { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
/* 右下の歯車(テスト機能)は、設定の画面のときだけ出す */
.settings-fab { display: none; }
body:has(#view-settings:not([hidden])) .settings-fab { display: block; }
/* 席のボタンは元の大きさ(高さ84px・幅120px〜)に戻し、情報は3行に詰める(2026-11-08 店舗の声: 縦に伸びてスクロールが必要になった) */
.seat-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.seat-btn { min-height: 84px; gap: 1px; padding: 6px; }
.seat-btn .seat-label { font-size: 20px; }
.seat-btn .seat-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.seat-btn .seat-amount { font-size: 14px; }

/* ---- 今日の締め(2026-11-08 作り直し) ---- */
.dc-state { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 14px; border-radius: 10px; background: #fdf3e2; color: #8a5a10; }
.dc-state strong { font-size: 15px; }
.dc-state span { font-size: 13px; }
.dc-state.done { background: #e7f3ea; color: #2f7a46; }
.dc-cash-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dc-cash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1.1fr) 24px minmax(0, 1fr); align-items: center; gap: 8px; }
.dc-cash-cell { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; background: #faf8f3; border-radius: 12px; }
.dc-cash-cell span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.dc-cash-cell strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.dc-cash-cell.input { background: #fff; padding: 0; }
.dc-cash-cell.input span { padding: 0 2px; }
.dc-cash-input { height: 56px; min-height: 56px; border: 2px solid #8f8576 !important; border-radius: 10px; font-size: 26px; font-weight: 700; text-align: right; padding: 0 14px; font-variant-numeric: tabular-nums; width: 100%; box-sizing: border-box; }
.dc-cash-input:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.dc-cash-input::placeholder { font-size: 16px; font-weight: 400; color: #a9a39a; }
.dc-cash-op { text-align: center; font-size: 20px; color: var(--ink-soft); padding-top: 18px; }
#dc-cash-diff.ok { color: #2f7a46; }
#dc-cash-diff.ng { color: #a8323e; }
.dc-note { height: 44px; min-height: 44px; border-radius: 10px; font-size: 15px; }
.dc-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.dc-actions .checkout-btn { margin: 0; width: 100%; }
.dc-actions .meta-btn { min-height: 52px; padding: 0 18px; font-weight: 700; }
.dc-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.dc-sum-cell { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dc-sum-cell span { font-size: 12px; color: var(--ink-soft); }
.dc-sum-cell strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.dc-sum-cell.main strong { font-size: 24px; }
.dc-fold { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; background: #fff; }
.dc-fold > summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 14px; cursor: pointer; }
.dc-cash-sub { font-size: 12px; font-weight: 600; color: #2c6aa0; }
.dc-sum-cell.advance { background: #f1f6fb; border-color: #c9dbec; }
.dc-sum-cell.advance strong { color: #2c6aa0; }
.dc-table .dc-adv-row td { color: #2c6aa0; font-size: 13px; background: #f6f9fc; }

.dc-cash-line { font-size: 12px; color: var(--ink-soft); }
.dc-sub-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.dc-float { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.dc-float .meta-input { width: 110px; height: 44px; min-height: 44px; border-radius: 10px; text-align: right; font-size: 16px; font-weight: 700; }

/* ---- 売上を見る(2026-11-08 見直し) ---- */
.sr-summary { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.sr-top { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 12px; }
.sr-main { display: flex; flex-direction: column; justify-content: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sr-main span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sr-main strong { font-size: 36px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sr-minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sr-mini { display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sr-mini span { font-size: 12px; color: var(--ink-soft); }
.sr-mini strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.sr-adj { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 10px 14px; border-radius: 10px; background: #fdf3e2; color: #8a5a10; font-size: 14px; font-weight: 700; }
.sr-adj small { flex-basis: 100%; font-size: 12px; font-weight: 400; }
.sr-adj.none { background: #f5f2ec; color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.sr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sr-card { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sr-card-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.sr-card .report-sub-row { padding: 6px 0; border-bottom: 1px solid #ddd4c6; font-size: 14px; }
.sr-card .report-sub-row:last-of-type { border-bottom: 0; }
.sr-card .report-sub-row small { display: block; text-align: right; font-size: 11px; color: var(--ink-soft); }
@media (max-width: 760px) { .sr-top, .sr-cards { grid-template-columns: 1fr; } .sr-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sr-card .order-empty { padding: 4px 0; text-align: left; font-size: 13px; color: var(--ink-soft); }
/* 売上を見る: 取引一覧(行を押すと詳細)と、金額の確認(たたむ) */
.sr-tx tbody tr.sr-row { cursor: pointer; }
.sr-tx tbody tr.sr-row:hover { background: #fcfaf6; }
.sr-tx td { padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
.ev-type.ev-advance { background: #e6f0f9; color: #2c6aa0; }
#sr-reconcile { padding: 0; border: 0; background: none; }
.sr-recon { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 4px 16px; }
.sr-recon > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.sr-recon > summary small { font-weight: 400; color: var(--ink-soft); font-size: 12px; }

/* 取引履歴(2026-11-08 見直し): 行を押すと詳細。状態の札を少し大きく */
.history-table tbody tr.history-row { cursor: pointer; }
.history-table tbody tr.history-row:hover { background: #fcfaf6; }
.history-table td { padding-top: 12px; padding-bottom: 12px; font-size: 14px; }
.history-table .status-pill { font-size: 12px; padding: 3px 12px; }
.history-table .hr-total { font-size: 16px; font-weight: 700; }
#hs-source[hidden] { display: none !important; }
.status-pill.completed { background: #e5f2e6; color: #2f7a36; }
.status-pill.advance { background: #e6f0f9; color: #2c6aa0; }

/* ---- 商品の編集(2026-11-08 作り直し) ---- */
.pe-sheet { gap: 12px; }
.pe-head { display: flex; align-items: center; gap: 10px; }
.pe-head h2 { flex: 1 1 auto; margin: 0; font-size: 18px; }
.pe-head .co-close { margin-left: 0; }
.pe-head .pe-save { width: auto; margin: 0; min-height: 44px; padding: 0 28px; }
.pe-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .pe-columns { grid-template-columns: 1fr; } }
.pe-sheet .corr-card > label, .pe-sheet .pe-grid2 > label, .pe-sheet .name-fields > label, .pe-sheet .pe-more > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pe-sheet .meta-input, .pe-sheet select:not([multiple]) { height: 44px; min-height: 44px; border-radius: 10px; font-size: 15px; color: var(--ink); font-weight: 400; }
.pe-sheet #pe-name { font-size: 17px; font-weight: 700; }
.pe-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pe-sheet .name-fields { display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; }
.pe-sheet .checkbox-row { flex-direction: row !important; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--ink); }
.pe-sheet .pe-more { gap: 10px; }


/* 商品の編集だけ: のっぺりしないよう、地を薄いベージュにしてカードを白く浮かせ、見出しに朱色の線(2026-11-08 店舗の声) */
.sheet-inner.pe-sheet { background: #f5f0e7; }
.pe-sheet .corr-card { border-color: #e3d9c9; box-shadow: 0 1px 2px rgba(70, 45, 20, 0.06), 0 6px 16px rgba(70, 45, 20, 0.05); }
.pe-sheet .corr-card-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.pe-sheet .corr-card-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.pe-sheet .pe-head { padding-bottom: 10px; border-bottom: 1px solid #e3d9c9; }
.pe-sheet #pe-name { background: #fffdf9; }

/* ---- 設定(2026-11-08 見直し): まとまりごとに出す ---- */
.settings-tabs { display: inline-flex; margin-bottom: 14px; }
.settings-tabs button { min-height: 48px; padding: 0 22px; font-size: 15px; font-weight: 700; }
.settings-grid[data-tab="common"] > .settings-card:not([data-sgroup="common"]),
.settings-grid[data-tab="device"] > .settings-card:not([data-sgroup="device"]),
.settings-grid[data-tab="tax"] > .settings-card:not([data-sgroup="tax"]),
.settings-grid[data-tab="maint"] > .settings-card:not([data-sgroup="maint"]) { display: none; }
.settings-card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
/* 設定の支払い方法の表: はみ出さないように詰める */
#payment-method-manage-body .data-table td { padding-top: 6px; padding-bottom: 6px; }
#payment-method-manage-body .pm-receipt-name { width: 150px !important; height: 40px; min-height: 40px; }
#payment-method-manage-body .pm-acts { white-space: nowrap; }
#payment-method-manage-body .row-btn { min-height: 38px; padding: 0 10px; }
#payment-method-manage-body .pm-toggle.on { background: #e5f2e6; border-color: #9cc5a5; color: #2f7a36; font-weight: 700; }
#payment-method-manage-body .pm-toggle.off { background: #f3f1ec; color: var(--ink-soft); }
#payment-method-manage-body td .settings-note { display: block; max-width: 170px; font-size: 11px; }
#payment-method-manage-body .pm-kind-note { white-space: normal; line-height: 1.4; }
#payment-method-manage-body .pm-drag { width: 36px; padding-left: 4px; padding-right: 0; }
#payment-method-manage-body .pm-handle { height: 40px; }
#payment-method-manage-body tr.pm-row.dragging { background: #fffdf9; box-shadow: 0 8px 20px rgba(0,0,0,.15); outline: 2px solid var(--accent); }
#payment-method-manage-body .pm-name { width: 190px; height: 40px; min-height: 40px; font-weight: 600; }

.pm-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: #fcfaf6; }
.pm-add-row[hidden] { display: none; }
.pm-add-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pm-add-row .meta-input { flex: 1 1 200px; height: 44px; min-height: 44px; border-radius: 10px; }
.pm-add-row select { width: auto; flex: 0 0 160px; }
.pm-add-row .meta-btn { min-height: 44px; padding: 0 18px; font-weight: 700; }

/* 設定「この端末」(2026-11-08): 名前・種類・役割を1枚に。ラベルを左にそろえた低めの行 */
.dv-form { display: grid; gap: 8px; max-width: 720px; }
label.dv-row { display: grid; grid-template-columns: 9em minmax(0, 1fr); align-items: center; gap: 12px; margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.dv-row .meta-input { height: 44px; min-height: 44px; border-radius: 10px; width: 100%; }
.dv-label { color: var(--ink-soft); font-size: 13px; }
.dv-hint { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.dv-form .dv-hint { padding-left: calc(9em + 12px); }
.dv-status { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #faf8f3; font-size: 13px; line-height: 1.7; }
.dv-card [hidden] { display: none !important; }
label.dv-switch { font-size: 15px; font-weight: 700; color: var(--ink); min-height: 40px; }
#auth-part, .dv-main { margin-top: 10px; display: grid; gap: 8px; }
.dv-more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.dv-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); list-style: none; padding: 4px 0; }
.dv-more > summary::-webkit-details-marker { display: none; }
.dv-more > summary::before { content: "▸ "; }
.dv-more[open] > summary::before { content: "▾ "; }
@media (max-width: 640px) { label.dv-row { grid-template-columns: 1fr; gap: 4px; } .dv-form .dv-hint { padding-left: 0; } }

/* 端末の情報(機種・CPU・OS など)。2列の見出しつき一覧 */
.dv-spec-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.dv-mini { min-height: 32px; padding: 0 12px; font-size: 12px; }
.dv-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 24px; margin: 8px 0 0; }
.dv-spec-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.dv-spec dt { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.dv-spec dd { margin: 0; font-size: 14px; min-width: 0; }
.dv-spec dd b { font-weight: 700; overflow-wrap: anywhere; }
.dv-spec dd small { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.dv-spec-note { grid-column: 1 / -1; margin-top: 8px; }

/* 保守・診断(2026-11-08): いまの状態の札・1列の一覧・控えの表 */
.mt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mt-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); border-left-width: 5px; background: var(--panel); min-width: 0; }
.mt-tile.ok { border-left-color: #4f8a5b; }
.mt-tile.warn { border-left-color: #c58a1c; background: #fdf7ea; }
.mt-tile.na { border-left-color: #b9b2a6; }
.mt-k { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.mt-v { font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.mt-tile.na .mt-v { color: var(--ink-soft); font-size: 15px; }
.mt-sub { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.mt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mt-card-head h3 { margin: 0; }
.mt-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mt-empty { margin: 6px 0; padding: 12px 14px; border-radius: 10px; background: #faf8f3; font-size: 13px; color: var(--ink-soft); }
.mt-snap-table td, .mt-snap-table th { padding-top: 7px; padding-bottom: 7px; }
.mt-ok { color: #3d7a4a; font-weight: 700; }
.mt-ng { color: #a8323e; font-weight: 700; }
.kv-list { display: block; margin-bottom: 6px; }
.kv-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; line-height: 1.6; align-items: baseline; }
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--ink-soft); font-weight: 600; font-size: 12px; }
.kv-v { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.kv-v small { display: block; font-size: 12px; color: var(--ink-soft); }
.kv-block .diagnostics-log { margin: 0; }
@media (max-width: 640px) { .kv-row { grid-template-columns: 1fr; gap: 2px; } }

/* 設定: 奉仕料の率 */
.scr-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.scr-now { display: flex; flex-direction: column; padding: 10px 18px; border-radius: 12px; background: #faf8f3; border: 1px solid var(--line); min-width: 120px; }
.scr-now span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.scr-now b { font-size: 28px; line-height: 1.2; }
.scr-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scr-edit[hidden] { display: none; }
.scr-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0; }
.scr-input-wrap { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.scr-input-wrap .meta-input { width: 100px; height: 44px; min-height: 44px; font-size: 18px; text-align: right; border-radius: 10px; }
.scr-edit .meta-btn { min-height: 44px; padding: 0 18px; font-weight: 700; }
#scr-note { margin-top: 10px; }
.scr-history { margin-top: 8px; }
.scr-hist-title { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 6px 0 2px; }
.scr-hist-row { display: grid; grid-template-columns: 9em 15em minmax(0, 1fr); gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }

.scr-share { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; border-left: 4px solid #b9b2a6; background: #faf8f3; color: var(--ink-soft); }
.scr-share.ok { border-left-color: #4f8a5b; color: #2f5f3a; }
.scr-share.wait { border-left-color: #c58a1c; }
.scr-share.warn { border-left-color: #a8323e; background: #fbefef; color: #8a2430; }

/* 設定画面のパスコード */
.pcs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcs-status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pcs-status.on { background: #e6f1e8; color: #2f5f3a; }
.pcs-status.off { background: #f1eee8; color: var(--ink-soft); }
.pcs-row .meta-btn { min-height: 44px; padding: 0 16px; font-weight: 700; }
.pc-sheet .pc-inner { width: min(360px, 92vw); max-width: 360px; text-align: center; padding: 24px 22px 20px; }
.pc-inner h2 { margin: 0 0 6px; font-size: 20px; }
.pc-msg { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); min-height: 1.5em; }
.pc-msg.ng { color: #a8323e; font-weight: 700; }
.pc-dots { display: flex; justify-content: center; gap: 18px; margin-bottom: 20px; }
.pc-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #8f8576; background: transparent; transition: background .1s; }
.pc-dots span.on { background: var(--ink); border-color: var(--ink); }
.pc-dots.shake { animation: pc-shake .35s; }
@keyframes pc-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pc-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pc-pad button { height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 24px; font-weight: 700; color: var(--ink); }
.pc-pad button:active { background: #ddd4c6; }
.pc-pad button.pc-sub { font-size: 15px; color: var(--ink-soft); background: #faf8f3; }
.pc-sheet { align-items: center; justify-content: center; }
.pc-sheet .pc-inner { margin: auto; max-height: none; overflow: visible; border-radius: 18px; }

/* ヘルプ(Q&A・検索) */
.help-wrap { max-width: 920px; margin: 0 auto; display: grid; gap: 12px; }
.help-search .meta-input { width: 100%; height: 52px; min-height: 52px; font-size: 17px; border-radius: 14px; padding: 0 16px; border: 2px solid #8f8576; }
.help-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.help-cats button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 600; color: var(--ink); }
.help-cats button.active { background: var(--accent, #a8323e); border-color: var(--accent, #a8323e); color: #fff; }
.help-count { font-size: 13px; color: var(--ink-soft); }
.help-list { display: grid; gap: 8px; padding-bottom: 40px; }
.help-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; scroll-margin-top: 12px; }
.help-item > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary::after { content: "＋"; margin-left: auto; color: var(--ink-soft); font-weight: 400; }
.help-item[open] > summary::after { content: "－"; }
.help-item[open] > summary { border-bottom: 1px solid var(--line); background: #faf8f3; }
.help-cat-tag { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--ink-soft); background: #f1eee8; border-radius: 999px; padding: 2px 8px; }
.help-a { padding: 10px 18px 14px; font-size: 14px; line-height: 1.8; }
.help-a p { margin: 6px 0; }
.help-a ul { margin: 4px 0 6px; padding-left: 1.3em; }
.help-a li { margin: 2px 0; }
.help-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.help-tag { border: 1px solid var(--line); background: #faf8f3; border-radius: 999px; font-size: 12px; padding: 3px 10px; color: var(--ink-soft); }
.help-empty { padding: 24px; text-align: center; color: var(--ink-soft); background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; }
/* エラーのお知らせ(ヘルプを見る) */
.help-notice { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 3000;
  display: flex; align-items: center; gap: 12px; width: min(760px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); border-left: 6px solid #a8323e; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.help-notice[hidden] { display: none; }
.help-notice.warn { border-left-color: #c58a1c; }
.help-notice.info { border-left-color: #4f8a5b; }
.hn-icon { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #a8323e; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.help-notice.warn .hn-icon { background: #c58a1c; }
.help-notice.info .hn-icon { background: #4f8a5b; }
.hn-msg { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.5; }
.hn-btn { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #a8323e; background: #a8323e; color: #fff; font-weight: 700; font-size: 13px; }
.help-notice.warn .hn-btn { background: #c58a1c; border-color: #c58a1c; }
.hn-close { flex: 0 0 auto; width: 36px; height: 36px; border: none; background: transparent; font-size: 20px; color: var(--ink-soft); }

/* お座敷の A と B は1組で2マス分。B は幅だけ狭く、高さはそろえる(2026-11-08。最初の「B だけ小さく」はガタガタに見えたため) */
.seat-pair { grid-column: span 2; display: flex; gap: 6px; min-width: 0; }
.seat-pair > .seat-btn { flex: 1.35 1 0; min-width: 0; }
.seat-pair > .seat-btn.seat-sub { flex: 0.85 1 0; }
.seat-btn.seat-sub .seat-label { font-size: 19px; }
/* カウンターの席をつなぐ(2026-11-08) */
.seat-btn.linked { border-style: dashed; }
.seat-link-mark { font-size: 12px !important; color: #8a4a17; font-weight: 700; }
.ss-links-row { margin-top: 4px; }
.ss-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-link-chip { min-width: 64px; min-height: 48px; padding: 4px 12px; border-radius: 12px; border: 1px solid var(--line-strong, #b8ad9c); background: var(--panel); font-size: 16px; font-weight: 700; color: var(--ink); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
.ss-link-chip small { font-size: 10px; font-weight: 600; color: var(--ink-soft); }
.ss-link-chip.on { background: #fdf0e6; border: 2px solid #c8742f; color: #8a4a17; }
.ss-link-chip.self { background: #c8742f; border-color: #c8742f; color: #fff; }
.ss-link-chip:disabled { opacity: .45; }
.ss-move-row select { height: 44px; min-height: 44px; }
.ss-links-note { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ss-links-note.warn { color: #a8323e; }
/* 注文の画面の席の名前(押すと席をつなぐ・移す) */
.seat-title-btn { cursor: pointer; text-decoration: underline dotted 2px; text-underline-offset: 5px; }
.seat-title-btn::after { content: " ▾"; font-size: 0.6em; color: var(--ink-soft); }

/* 税と営業日(2026-11-08 見直し) */
.tax-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.tax-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #faf8f3; }
.tax-tile-k { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.tax-tile-v { font-size: 30px; line-height: 1.2; }
.tax-tile-sub { font-size: 12px; color: var(--ink-soft); }
.tax-sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.cut-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cut-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0; }
.cut-select { width: auto; min-width: 180px; height: 44px; min-height: 44px; font-size: 16px; }
.settings-fab[hidden] { display: none !important; }
/* つないだカウンターの席を大きい枠で囲む(2026-11-08) */
.seat-link-group { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 92px; padding: 8px 12px; border: 3px solid #c8742f; border-radius: 14px; background: #fdf0e6; cursor: pointer; min-width: 0; }
.seat-link-group:active { background: #f8e2d0; }
.slg-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.slg-seats { font-size: 20px; font-weight: 800; color: #8a4a17; }
.slg-info { font-size: 12px; color: #8a4a17; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slg-amount { font-size: 15px; font-weight: 700; color: #8a4a17; }
.slg-seats-row { display: flex; gap: 6px; }
.slg-seat { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: #8a4a17; background: rgba(255,255,255,.7); border: 1px dashed #c8742f; border-radius: 8px; padding: 3px 0; }
/* 返金の完了 */
#refund-done-sheet .rd-after { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
#refund-done-sheet .rd-sub-btn { background: var(--panel); color: var(--accent, #a8323e); border: 2px solid var(--accent, #a8323e); }
/* パスコードのボタン: 触れた瞬間に色が変わる */
.pc-pad button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.pc-pad button.pc-hit { animation: pc-hit .18s ease-out; }
@keyframes pc-hit { 0% { background: #e8dccb; transform: scale(.94); } 100% { background: var(--panel); transform: scale(1); } }
/* 近又MEMBERS(2026-11-08) */
.km-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: #8f8576; margin-right: 4px; vertical-align: 1px; white-space: nowrap; }
.km-chip.km-member { background: #8f8576; }
.km-chip.km-silver { background: #8d97a1; }
.km-chip.km-gold { background: #b8891f; }
.km-chip.km-platinum { background: #5d6f86; }
.km-chip.km-vip { background: #1f1f1f; }
.km-box { margin: 2px 0 6px; }
.km-msg { font-size: 13px; color: var(--ink-soft); padding: 8px 12px; background: #faf8f3; border-radius: 10px; }
.km-msg.ng { color: #a8323e; background: #fbefef; }
.km-card { border: 2px solid #c8742f; border-radius: 14px; background: #fffaf4; padding: 10px 14px; display: grid; gap: 8px; }
.km-card-main { display: flex; align-items: center; gap: 8px; }
.km-card-name b { font-size: 18px; }
.km-card-name small { display: block; font-size: 12px; color: var(--ink-soft); }
.km-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.km-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #f1eee8; color: var(--ink-soft); }
.km-tag.on { background: #e6f1e8; color: #2f5f3a; }
.km-tag.bday { background: #fdeaea; color: #a8323e; }
.km-tag.mock { background: #fff3d6; color: #8a5a00; }
.km-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.km-card-actions .meta-btn { min-height: 40px; font-weight: 700; }
.km-linked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 10px; background: #fffaf4; border: 1px solid #e8cfb6; }
.km-badge { border: none; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; color: #fff; background: #8f8576; white-space: nowrap; cursor: pointer; }
.km-badge[hidden] { display: none; }
.km-badge.km-silver { background: #8d97a1; } .km-badge.km-gold { background: #b8891f; } .km-badge.km-platinum { background: #5d6f86; } .km-badge.km-vip { background: #1f1f1f; }
.km-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.km-sheet-head h2 { margin: 2px 0 0; font-size: 24px; }
.km-sheet-no { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.km-sheet-no small { font-weight: 600; }
.km-sheet-kana { font-size: 13px; color: var(--ink-soft); }
.km-sheet-actions { display: flex; gap: 8px; align-items: center; }
.km-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.km-sec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--panel); }
.km-sec h3 { margin: 0 0 8px; font-size: 15px; }
.km-coupon { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.km-coupon:last-child { border-bottom: none; }
.km-coupon.on b { color: #2f5f3a; }
.km-coupon-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.km-coupon-side small { font-size: 11px; color: var(--ink-soft); }
.km-tag.alert { background: #a8323e; color: #fff; }
.km-tag.warn { background: #fdeaea; color: #a8323e; }
.km-staff { border: 2px solid #a8323e; border-radius: 12px; background: #fff6f6; padding: 10px 14px; margin-bottom: 12px; }
.km-staff-title { font-size: 12px; font-weight: 800; color: #a8323e; margin-bottom: 4px; }
.km-staff-row { display: flex; gap: 12px; font-size: 15px; padding: 3px 0; }
.km-staff-row b { flex: 0 0 6em; color: #a8323e; }
.km-staff-row.alert span { font-weight: 800; }
.km-today { margin-bottom: 12px; border-color: #4f8a5b; }
.km-names { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.km-names-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.km-name-chip { display: inline-block; border: 1px solid var(--line); background: #faf8f3; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
button.km-name-chip { cursor: pointer; min-height: 36px; }
.km-add-name { display: flex; gap: 8px; }
.km-add-name .meta-input { flex: 1; height: 40px; min-height: 40px; }
.km-co-note { border: 2px solid #4f8a5b; background: #f1f8f2; border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-size: 13px; font-weight: 600; display: grid; gap: 4px; }
.km-co-note[hidden] { display: none; }
.km-co-note > .km-chip { justify-self: start; }
.km-co-note .km-co-sub { font-weight: 400; font-size: 12px; color: #4a5a4d; }
.km-staff.empty { border-color: var(--line); background: #faf8f3; }
.km-staff.empty .km-staff-title { color: var(--ink-soft); }
.km-staff-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.km-staff-row.note b { color: var(--ink-soft); }
.km-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 12px; margin: 6px 0; }
.km-edit label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 0; }
.km-edit label.wide { grid-column: 1 / -1; }
.km-edit .meta-input { height: 42px; min-height: 42px; }
.km-edit-actions { display: flex; gap: 8px; }

/* 近又MEMBERS: 注文の画面の会員番号の欄と会員の札(何人でも。2026-11-08) */
.order-meta-km .meta-input { width: 64px; }
.order-meta-people .order-meta-name { min-width: 170px; flex: 1 1 240px; }
#header-title { flex: 0 0 auto; }
.km-chips { display: flex; gap: 6px; flex: 0 0 auto; }
.km-chips:empty { display: none; }
.km-chip-btn { display: inline-flex; align-items: center; border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.km-chip-btn .km-badge { border-radius: 999px 0 0 999px; padding: 6px 8px 6px 12px; }
.km-chip-btn .km-x { border: none; color: #fff; background: rgba(0,0,0,.18); padding: 6px 10px; font-size: 13px; font-weight: 800; cursor: pointer; }
.km-linked-list { display: grid; gap: 6px; }
.km-ask { max-width: 460px; }
.km-ask p { font-size: 15px; line-height: 1.7; }
.km-ask-actions { display: grid; gap: 8px; margin-top: 12px; }
.km-ask-actions button { padding: 12px; font-size: 15px; }
#km-list-sheet .sheet-inner { max-width: 620px; }
.km-linked-list .km-linked > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.km-add-btn { border: 1px dashed #b8a98f; background: #fffaf4; color: #6d5f49; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; flex: 0 0 auto; }
.order-meta-people .order-meta-km[hidden] { display: none; }
/* 役割の札と同期の表示: 小さめにして上下に並べる(2026-11-08 店主の指示) */
.header-status-stack { display: flex; flex-direction: column; align-items: stretch; gap: 3px; flex-shrink: 0; }
.header-status-stack .header-role-tag:empty { display: none; }
body.role-main .header-status-stack .role-tag, body.role-seat .header-status-stack .role-tag, .header-status-stack .role-tag { font-size: 10px; padding: 2px 8px; text-align: center; line-height: 1.4; }
.header-status-stack .sync-status { min-height: 0; padding: 2px 8px; gap: 5px; font-size: 10px; justify-content: center; line-height: 1.4; }
.header-status-stack .sync-dot { width: 7px; height: 7px; }
/* 見た目の見直し(2026-11-08) */
.seat-meta-member { display: flex; align-items: center; gap: 4px; justify-content: center; min-width: 0; max-width: 100%; white-space: nowrap; line-height: 1.2; }
.seat-meta-member .km-chip { flex: 0 0 auto; font-size: 9px; padding: 1px 5px; }
.seat-meta-member .seat-member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.checkout-btn.checkout-btn-outline { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.ss-actions { position: sticky; bottom: -1px; background: var(--panel, #fff); padding-top: 8px; margin-top: 4px; display: grid; gap: 8px; z-index: 2; box-shadow: 0 -8px 12px -8px rgba(0,0,0,.12); }
.ss-actions > button { margin: 0; }
/* つないだ席の名前(任意。2026-11-08) */
.slg-name { font-size: 14px; font-weight: 800; color: #fff; background: #b4692c; border-radius: 6px; padding: 1px 8px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-group-name-row { display: grid; gap: 4px; margin-top: 8px; font-size: 13px; }
.ss-group-name-row[hidden] { display: none; }
/* 名前があるときは、人数・時間・お客様名を2行目に(名前で切れないように) */
.seat-link-group.has-name .slg-head { row-gap: 0; }
.slg-break { display: none; }
.seat-link-group.has-name .slg-break { display: block; flex-basis: 100%; height: 0; }
.seat-link-group.has-name .slg-info { flex: 1 1 0; }
.seat-link-group.has-name .slg-amount { margin-left: auto; font-size: 14px; }
.seat-link-group.has-name .slg-seats-row .slg-seat { padding-block: 2px; }
.ss-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-group-chip { min-width: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 800; color: #8a4a17; cursor: pointer; }
.ss-group-chip.on { background: #b4692c; border-color: #b4692c; color: #fff; }
.ss-group-chip.clear { font-weight: 600; font-size: 12px; color: var(--ink-soft); }
/* ご利用の目的(任意。2026-11-08) */
.ss-purpose-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px; }
.ss-purpose-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.ss-purpose-chip.on { background: #4f6f52; border-color: #4f6f52; color: #fff; }
.seat-purpose { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #4f6f52; color: #fff; font-size: 10px; font-weight: 700; vertical-align: middle; max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.6; }
.slg-purpose { font-size: 13px; font-weight: 800; color: #fff; background: #4f6f52; border-radius: 6px; padding: 1px 8px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 取引履歴・伝票の詳細: ご利用の目的と会員の札(2026-11-08) */
.ti-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ti-purpose { padding: 1px 8px; border-radius: 6px; background: #4f6f52; color: #fff; font-size: 11px; font-weight: 700; }
.ti-member { padding: 1px 8px; border-radius: 999px; border: none; color: #fff; background: #8f8576; font-size: 11px; font-weight: 700; white-space: nowrap; }
button.ti-member { cursor: pointer; }
.ti-member.km-silver { background: #8d97a1; } .ti-member.km-gold { background: #b8891f; } .ti-member.km-platinum { background: #5d6f86; } .ti-member.km-vip { background: #1f1f1f; }
/* 会計の内容を直す画面の見直し(2026-11-08 店主の声「ひどい」) */
.corr-item-name .corr-item-discount { display: block; height: auto; margin-top: 2px; padding: 0; border: none; background: none; font-size: 12px; font-weight: 600; color: var(--accent); text-align: left; }
.corr-price-wrap { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.corr-price-wrap .corr-item-price { flex: 1; min-width: 0; }
.corr-sheet .payment-row.with-full > input { font-size: 20px; height: 48px; min-height: 48px; }
.corr-sheet .payment-row.with-full > button.pay-full { height: 48px; }
/* 支払いが1つのとき(消すボタンなし)は、支払い方法の欄を横いっぱいに */
.payment-row.with-full.single { grid-template-areas: "method method method" "amount full full"; }
/* 消すボタンがないときは「全額」が最後のボタンになるので、消すボタン用の見た目がかからないように戻す */
.payment-row.with-full.single > button.pay-full { grid-area: full; height: 56px; align-self: auto; font-size: 16px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); }
.corr-sheet .payment-row.with-full.single > button.pay-full { height: 48px; }
.corr-sheet .corr-item label.corr-price-wrap { display: flex; flex-direction: row; align-items: center; gap: 4px; margin: 0; }
/* 注文の画面の「目的」の札(2026-11-08) */
.order-purpose-btn { flex: 0 0 auto; border: 1px dashed #7d9a80; background: #f3f8f3; color: #4f6f52; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.order-purpose-btn.on { border-style: solid; border-color: #4f6f52; background: #4f6f52; color: #fff; }
.order-purpose-btn[hidden] { display: none; }
/* カウンターの席の名前をおもな席名に・C1 などは小さく(2026-11-08) */
.seat-label .seat-sub { margin-left: 4px; font-size: 11px; font-weight: 600; color: var(--ink-soft); vertical-align: middle; }
.slg-sub { font-size: 12px; font-weight: 700; color: #a0652e; }
/* 注文の途中のカウンター: つなぐ/移すの切り替え・移す先の知らせ */
.ss-counter-mode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.ss-counter-mode[hidden] { display: none; }
.ss-counter-mode button { border: none; background: #fff; padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.ss-counter-mode button + button { border-left: 1px solid var(--line-strong); }
.ss-counter-mode button.active { background: #b4692c; color: #fff; }
.ss-link-chip.now { border-style: dashed; }
.ss-move-note { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #fff4e8; border: 1px solid #e0b98c; font-size: 14px; color: #6a3d12; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ss-move-note[hidden] { display: none; }
/* 起動の画面(2026-11-08)。役割の色(赤・青・緑)が決まる前なので、落ち着いた決まった色で出す */
.app-splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: #f4f1ea; transition: opacity .25s ease; }
.app-splash[hidden] { display: none; }
.app-splash.leaving { opacity: 0; pointer-events: none; }
.as-box { display: grid; justify-items: center; gap: 14px; text-align: center; }
.as-brand { font-size: 28px; font-weight: 800; letter-spacing: .08em; color: #3d3a35; }
.as-spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid #ddd5c6; border-top-color: #6b6255; animation: as-spin .9s linear infinite; }
@keyframes as-spin { to { transform: rotate(360deg); } }
.as-step { font-size: 16px; font-weight: 700; color: #3d3a35; }
.as-steps { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a69d8e; }
.as-steps i { font-style: normal; }
.as-steps .now { color: #3d3a35; font-weight: 800; }
.as-steps .done { color: #6f8a6f; }
.as-steps .done::before { content: "✓ "; }
.as-sub { min-height: 1.4em; font-size: 12px; color: #7a7266; }
