/* 餃子レジ  色は青・灰・白を基本に最小限 */
:root {
  --blue: #0b4ea2;
  --blue-d: #083b7c;
  --bg: #e3e3e3;
  --panel: #ffffff;
  --line: #d4d4d4;
  --text: #111111;
  --sub: #666666;
  --red: #c62828;
  --pink: #e4007f;
  --amber: #f5b400;
  --sky: #8fd3f4;
  --green: #2e9d5b;
  --purple: #7e57c2;
  --gray: #8a8a8a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--text);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
input, select { font: inherit; -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }

/* 触れたことが分かる押下表示 */
.tap { transition: transform .06s ease, filter .06s ease; }
.tap.pressed { transform: scale(.96); filter: brightness(.88); }
button:disabled { opacity: .4; }

#app {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ヘッダー */
.topbar {
  flex: 0 0 52px; display: flex; align-items: center; justify-content: space-between;
  background: var(--blue); color: #fff; padding: 0 6px 0 10px;
}
.subtotal {
  display: flex; align-items: baseline; gap: 10px; background: none; border: 0; color: #fff;
  padding: 8px 10px 8px 4px; border-radius: 6px;
}
.subtotal-label { font-size: 13px; opacity: .85; }
.subtotal-count { font-size: 15px; font-weight: 700; }
.subtotal-amount { font-size: 21px; font-weight: 800; }
.gear { position: relative; background: none; border: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.badge { position: absolute; top: 8px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); }

/* 履歴（リアルタイム表示） */
.history {
  flex: 0 0 140px; background: var(--panel); overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid #9a9a9a; padding: 2px 10px;
}
.history-empty { color: var(--sub); font-size: 14px; padding: 12px 4px; }
.hrow {
  display: flex; align-items: center; min-height: 33px; border-bottom: 1px solid var(--line);
  padding: 0 2px; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left;
}
.hrow.first { border-top: 2px solid transparent; }
.hrow .hname { flex: 1 1 auto; font-weight: 800; font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hrow .hqty { flex: 0 0 34px; text-align: right; font-weight: 800; font-size: 16px; }
.hrow .hamt { flex: 0 0 92px; text-align: right; font-weight: 800; font-size: 16px; }
.hrow .htime { flex: 0 0 104px; text-align: right; font-size: 12px; color: #333; }
.hgroup { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.hgroup:nth-child(even) { background: #f6f6f6; }

/* 表示枠 */
.cart {
  flex: 0 0 auto; height: 188px; margin: 10px 12px 0; background: var(--panel);
  border: 1px solid #9a9a9a; display: flex; flex-direction: column;
}
.cart-lines { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px 4px; }
.cline { display: flex; align-items: baseline; font-weight: 800; font-size: 24px; line-height: 1.45; }
.cline .cname { flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cline .cqty { flex: 0 0 auto; padding-left: 10px; }
.cline .camt { flex: 0 0 auto; width: 110px; text-align: right; font-size: 18px; color: #333; }
.cart-empty { color: #aaa; font-size: 16px; padding-top: 4px; }
.cart-foot {
  flex: 0 0 42px; display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  border-top: 1px solid var(--line); margin: 0 8px; padding: 0 6px; font-weight: 800;
}
.cart-qty, .cart-label { font-size: 17px; }
.cart-total { font-size: 24px; min-width: 120px; text-align: right; }

/* 商品ボタン */
.products {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; padding: 12px;
}
.pbtn {
  width: calc((100% - 20px) / 3); height: 112px; background: #fff; border: 7px solid var(--gray);
  outline: 1px solid #9a9a9a; display: flex; flex-direction: column; justify-content: space-between;
  padding: 6px 6px 8px; text-align: left;
}
.pbtn .pname { font-weight: 800; font-size: 16px; line-height: 1.25; word-break: break-all; }
.pbtn .pprice { font-weight: 800; font-size: 17px; text-align: center; }
.c-pink { border-color: var(--pink); } .c-amber { border-color: var(--amber); } .c-sky { border-color: var(--sky); }
.c-green { border-color: var(--green); } .c-purple { border-color: var(--purple); } .c-gray { border-color: var(--gray); }
.products-empty { color: var(--sub); padding: 16px 4px; font-size: 15px; }

/* 下部ボタン */
.actions { flex: 0 0 72px; display: flex; align-items: center; gap: 10px; padding: 0 12px 6px; }
.btn-outline {
  flex: 0 0 96px; height: 54px; background: #fff; border: 3px solid var(--blue); font-weight: 800; font-size: 19px;
}
.btn-primary {
  flex: 1 1 auto; height: 54px; background: var(--blue); color: #fff; border: 0; font-weight: 800; font-size: 21px;
  margin-left: 12px; letter-spacing: .2em;
}

/* 共通：重ね表示 */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20;
  background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center;
}
.overlay.center { align-items: center; }
.sheet {
  width: 100%; max-width: 520px; max-height: 100%; background: #fff; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.full { height: 100%; }
.dialog { width: calc(100% - 40px); max-width: 400px; background: #fff; border-radius: 10px; padding: 18px; }
.dialog h3 { margin: 0 0 10px; font-size: 19px; }
.dialog p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; white-space: pre-line; }
.row-btns { display: flex; gap: 10px; }
.row-btns button { flex: 1 1 0; height: 50px; font-weight: 800; font-size: 17px; }
.btn-plain { background: #fff; border: 2px solid #999; }
.btn-blue { background: var(--blue); color: #fff; border: 0; }
.btn-red { background: var(--red); color: #fff; border: 0; }
.btn-blue-outline { background: #fff; color: var(--blue); border: 2px solid var(--blue); }

/* ページ（設定メニュー各画面） */
.page { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 15; background: var(--bg); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.page-head { flex: 0 0 52px; background: var(--blue); color: #fff; display: flex; align-items: center; padding: 0 6px; }
.page-head .back { background: none; border: 0; color: #fff; font-size: 17px; font-weight: 700; padding: 10px 12px; min-width: 76px; text-align: left; }
.page-head h2 { flex: 1 1 auto; margin: 0; font-size: 18px; text-align: center; }
.page-head .spacer { min-width: 76px; }
.page-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.page-foot { flex: 0 0 auto; padding: 10px 12px 12px; background: var(--bg); border-top: 1px solid #c8c8c8; }
.page-foot button { width: 100%; height: 56px; font-size: 19px; font-weight: 800; }
.card { background: #fff; border: 1px solid #c8c8c8; padding: 12px; margin-bottom: 12px; }
.note { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 6px 0 0; }

/* 設定メニュー */
.menu-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 18; background: rgba(0,0,0,.25); }
.menu {
  position: absolute; top: calc(env(safe-area-inset-top) + 52px); right: 8px; width: 250px; background: #fff;
  border: 1px solid #999; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.menu button { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line);
  padding: 16px 16px; font-size: 18px; font-weight: 800; }
.menu button:last-child { border-bottom: 0; }
.menu .menu-sub { font-size: 15px; font-weight: 700; color: #333; }
.menu .menu-update { color: var(--blue); }

/* 会計 */
.pay-top { padding: 14px 16px 6px; }
.pay-row { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pay-row .k { font-size: 16px; font-weight: 700; color: #333; }
.pay-row .v { font-size: 30px; font-weight: 800; }
.pay-row .v.short { color: var(--red); }
.pay-bills { display: flex; gap: 8px; padding: 8px 16px; }
.pay-bills button { flex: 1 1 0; height: 50px; background: #fff; border: 2px solid var(--blue); color: var(--blue); font-weight: 800; font-size: 16px; }
.keypad { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 8px; }
.keypad button { width: calc((100% - 16px) / 3); height: 54px; background: #f2f2f2; border: 1px solid #bbb; font-size: 24px; font-weight: 800; }
.pay-actions { display: flex; gap: 10px; padding: 6px 16px 14px; }
.pay-actions button { height: 58px; font-size: 19px; font-weight: 800; }
.pay-actions .btn-plain { flex: 0 0 120px; }
.pay-actions .btn-blue { flex: 1 1 auto; letter-spacing: .1em; }

.done { text-align: center; padding: 34px 20px 26px; }
.done .lbl { font-size: 18px; font-weight: 700; color: #333; }
.done .big { font-size: 52px; font-weight: 800; margin: 6px 0 14px; }
.done .sub { font-size: 15px; color: var(--sub); }

/* レポート（中間計・清算） */
.report h3 { margin: 0 0 4px; font-size: 20px; }
.report .period { font-size: 13px; color: var(--sub); margin-bottom: 10px; white-space: pre-line; }
.rtable { width: 100%; border-collapse: collapse; }
.rtable th { font-size: 13px; color: var(--sub); font-weight: 700; text-align: right; padding: 4px 2px; border-bottom: 2px solid #333; }
.rtable th:first-child { text-align: left; }
.rtable td { font-size: 18px; font-weight: 800; padding: 10px 2px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rtable td:first-child { text-align: left; white-space: normal; }
.rsum { margin-top: 12px; }
.rsum .r { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 17px; font-weight: 700; }
.rsum .r.total { border-top: 2px solid #333; margin-top: 4px; padding-top: 10px; }
.rsum .r.total .v { font-size: 32px; font-weight: 800; }
.rsum .r .v { font-weight: 800; }
.stamp { display: inline-block; border: 2px solid var(--blue); color: var(--blue); font-weight: 800; padding: 2px 8px; font-size: 14px; margin-left: 8px; vertical-align: middle; }

/* 履歴確認 */
.tabs { display: flex; margin-bottom: 12px; border: 2px solid var(--blue); }
.tabs button { flex: 1 1 0; height: 44px; background: #fff; border: 0; font-weight: 800; font-size: 16px; color: var(--blue); }
.tabs button.on { background: var(--blue); color: #fff; }
.daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.daynav button { width: 52px; height: 46px; background: #fff; border: 2px solid var(--blue); color: var(--blue); font-size: 20px; font-weight: 800; }
.daynav input { flex: 1 1 auto; height: 46px; border: 1px solid #999; background: #fff; text-align: center; font-size: 17px; font-weight: 700; padding: 0 6px; -webkit-appearance: none; }
.txcard { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid #c8c8c8; padding: 10px 12px; margin-bottom: 8px; }
.txcard .th { display: flex; justify-content: space-between; font-size: 13px; color: var(--sub); margin-bottom: 4px; }
.txcard .tl { display: flex; font-size: 16px; font-weight: 800; padding: 2px 0; }
.txcard .tl .n { flex: 1 1 auto; } .txcard .tl .q { flex: 0 0 40px; text-align: right; } .txcard .tl .a { flex: 0 0 96px; text-align: right; }
.txcard .tt { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; font-size: 15px; font-weight: 700; }
.txcard .tt .a { font-size: 18px; font-weight: 800; }
.txcard.void { opacity: .55; }
.txcard.void .tl, .txcard.void .tt .a { text-decoration: line-through; }
.tag { font-size: 12px; font-weight: 800; border: 1px solid currentColor; padding: 0 5px; margin-left: 6px; }
.tag.red { color: var(--red); } .tag.blue { color: var(--blue); }
.list-empty { color: var(--sub); padding: 18px 4px; text-align: center; }
.setl { display: flex; justify-content: space-between; align-items: center; width: 100%; background: #fff; border: 1px solid #c8c8c8; padding: 14px 12px; margin-bottom: 8px; text-align: left; }
.setl .d { font-size: 15px; font-weight: 700; } .setl .d small { display: block; color: var(--sub); font-weight: 400; font-size: 12px; margin-top: 2px; }
.setl .a { font-size: 20px; font-weight: 800; }

/* 取引の編集 */
.edit-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.edit-line .n { flex: 1 1 auto; font-size: 17px; font-weight: 800; }
.edit-line .n small { display: block; font-size: 13px; color: var(--sub); font-weight: 700; }
.edit-line .q { width: 44px; text-align: center; font-size: 22px; font-weight: 800; }
.stepper { width: 48px; height: 48px; background: #fff; border: 2px solid var(--blue); color: var(--blue); font-size: 24px; font-weight: 800; }
.edit-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; font-weight: 800; }
.edit-total .a { font-size: 28px; }

/* 商品管理 */
.prow { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #c8c8c8; margin-bottom: 8px; padding: 6px 6px 6px 0; }
.prow .chip { flex: 0 0 8px; align-self: stretch; }
.prow .info { flex: 1 1 auto; background: none; border: 0; text-align: left; padding: 8px 4px; }
.prow .info .n { font-size: 17px; font-weight: 800; }
.prow .info .p { font-size: 16px; font-weight: 800; color: #333; margin-top: 2px; }
.prow.off .info .n, .prow.off .info .p { color: #999; }
.prow .mv { width: 44px; height: 44px; background: #fff; border: 2px solid #999; font-size: 18px; font-weight: 800; }
.bg-pink { background: var(--pink); } .bg-amber { background: var(--amber); } .bg-sky { background: var(--sky); }
.bg-green { background: var(--green); } .bg-purple { background: var(--purple); } .bg-gray { background: var(--gray); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: #333; margin-bottom: 6px; }
.field input[type=text], .field input[type=tel] { width: 100%; height: 50px; border: 1px solid #999; padding: 0 12px; font-size: 20px; font-weight: 700; border-radius: 0; -webkit-appearance: none; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 46px; height: 46px; border: 3px solid #fff; outline: 1px solid #999; }
.swatch.on { outline: 3px solid #111; }
.switch-row { display: flex; gap: 10px; }
.switch-row button { flex: 1 1 0; height: 46px; background: #fff; border: 2px solid #999; font-weight: 800; font-size: 16px; }
.switch-row button.on { border-color: var(--blue); background: var(--blue); color: #fff; }
.err { color: var(--red); font-size: 14px; font-weight: 700; min-height: 20px; margin: 0 0 8px; }

/* データ管理 */
.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.kv .v { font-weight: 800; }
.kv .v.ok { color: var(--blue); } .kv .v.ng { color: var(--red); }
.big-btn { display: block; width: 100%; height: 54px; margin-bottom: 10px; font-size: 18px; font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%); z-index: 40;
  background: rgba(20,20,20,.9); color: #fff; padding: 12px 18px; font-size: 15px; font-weight: 700; border-radius: 8px; max-width: 86%; text-align: center;
}
