/* 授与所レジ スタイル */
:root {
  --bg: #F6F4EF;
  --card: #FFFFFF;
  --ink: #1C1B19;
  --sub: #5E5A53;
  --line: #DDD7CC;
  --line2: #D5CFC4;
  --accent: #A8322A;
  --accent-bg: #FFF4F2;
  --warn: #7A5A00;
  --warn-bg: #FBF3DC;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  -webkit-user-select: none; -webkit-touch-callout: none; user-select: none; overscroll-behavior: none; touch-action: manipulation; }
body { position: fixed; inset: 0; overflow: hidden; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; }
#app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--sub); }

/* 共通部品 */
.topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .title { font-size: 20px; font-weight: 700; }
.topbar .group { display: flex; gap: 10px; align-items: center; }
.btn { height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid #BDB6A9; background: #FFF; font-size: 15px; white-space: nowrap; }
.btn.small { height: 38px; font-size: 14px; padding: 0 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFF; font-weight: 700; }
.btn.outline { border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; }
.btn:disabled { opacity: 0.4; }
.btn.big { height: 64px; font-size: 19px; padding: 0 24px; }
.panel { background: var(--card); border: 1.5px solid var(--line2); border-radius: 12px; padding: 16px; }
.muted { color: var(--sub); }
.warnbar { background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 700; padding: 6px 16px; border-bottom: 1px solid #E8D9A8; }
.page { flex: 1; min-height: 0; overflow: auto; padding: 20px; -webkit-overflow-scrolling: touch; }
h2.sec { font-size: 17px; margin: 0 0 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--sub); }
.field input[type=text], .field input[type=number], .field input[type=password], .field input[type=url], .field select, .field textarea {
  height: 46px; border-radius: 8px; border: 1.5px solid var(--line2); padding: 0 12px; font-size: 17px; background: #FFF; }
.field textarea { height: 80px; padding: 10px 12px; }
.row2 { display: flex; gap: 14px; }
.row2 > * { flex: 1; }
.seg { display: flex; border: 1.5px solid var(--line2); border-radius: 8px; overflow: hidden; height: 44px; }
.seg button { flex: 1; border: 0; background: #FFF; font-size: 15px; }
.seg button.on { background: var(--accent); color: #FFF; font-weight: 700; }
table.list { width: 100%; border-collapse: collapse; background: #FFF; border-radius: 12px; overflow: hidden; }
table.list th { background: #EFEBE4; text-align: left; font-size: 14px; padding: 10px 12px; }
table.list td { border-top: 1px solid #E6E1D8; padding: 10px 12px; font-size: 16px; }
table.list td.num, table.list th.num { text-align: right; }
.neg { color: var(--accent); font-weight: 700; }

/* 社務の開始 */
.start { flex: 1; display: flex; align-items: center; justify-content: center; gap: 40px; padding: 40px; }
.start .left { width: 460px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.start .date { font-size: 18px; color: var(--sub); }
.start .hello { font-size: 30px; font-weight: 700; }
.start .go { width: 400px; height: 110px; border-radius: 16px; border: 0; background: var(--accent); color: #FFF; font-size: 30px; font-weight: 700; letter-spacing: 0.08em; }
.start .right { width: 380px; display: flex; flex-direction: column; gap: 14px; }
.lowitem { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; }

/* レジ画面 */
.reg { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.grid { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.grow { flex: 1; min-height: 0; display: grid; gap: 12px; }
.grow.divider { position: relative; margin-top: 4px; }
.grow.divider::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 2px; background: #CFC9BE; }
.cell-empty { border: 1.5px dashed #CFC9BE; border-radius: 10px; }
.ib { position: relative; border-radius: 10px; border: 1.5px solid var(--line2); background: #FFF; overflow: hidden; min-height: 0; }
.ib.has { border: 3px solid var(--accent); }
.ib .ib-in { position: absolute; inset: 8px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.ib .ib-img { flex-shrink: 0; border-radius: 6px; background: #E8E4DC; object-fit: cover; }
.ib .ib-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.ib .ib-price { position: absolute; left: 10px; bottom: 10px; font-size: 14px; color: #3D3A35; pointer-events: none; }
.ib .badge { position: absolute; top: 2px; left: 2px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; border: 2px solid #FFF;
  background: var(--accent); color: #FFF; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ib .badge.withimg { left: auto; }
.ib .minus { position: absolute; right: 6px; bottom: 6px; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--accent); background: #FFF; color: var(--accent); font-size: 26px; line-height: 1; }
.regbottom { height: 120px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; background: #FFF; border-top: 1px solid var(--line); }
.regbottom .sum { display: flex; align-items: baseline; gap: 28px; color: var(--sub); font-size: 16px; }
.regbottom .sum b { color: var(--ink); }
.regbottom .qty b { font-size: 32px; }
.regbottom .total b { font-size: 52px; }
.regbottom .acts { display: flex; gap: 12px; }
.regbottom .acts .btn { height: 72px; font-size: 18px; }
.regbottom .acts .pay { width: 200px; font-size: 24px; }
.empty-reg { margin: auto; text-align: center; color: var(--sub); line-height: 2; }

/* 会計確認 */
.confirm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cust { flex: 1; min-height: 0; display: flex; gap: 32px; padding: 28px 32px; background: #FFF; }
.cust.rot { transform: rotate(180deg); }
.cust .lines { flex: 1; min-width: 0; display: grid; gap: 12px; grid-auto-rows: minmax(0, 1fr); }
.cust .lines.textonly { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.cline { border: 1.5px solid #E2DDD3; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 0; overflow: hidden; }
.cline img, .cline .noimg { border-radius: 10px; background: #E8E4DC; object-fit: cover; flex-shrink: 1; min-height: 0; }
.cline .noimg { display: flex; align-items: center; justify-content: center; color: var(--sub); font-weight: 700; padding: 4px; text-align: center; }
.cline .cl-t { display: flex; flex-direction: column; align-items: center; gap: 0; max-width: 100%; line-height: 1.25; }
.cline .cl-n { color: #3D3A35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cline .cl-q { font-weight: 700; white-space: nowrap; }
.tline { display: flex; justify-content: space-between; font-size: 22px; border-bottom: 1px solid #EEE; padding: 4px 0; }
.cust .sumcol { width: 340px; flex-shrink: 0; border-left: 1px solid var(--line); padding-left: 32px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.cust .sumcol .lbl { font-size: 26px; color: var(--sub); letter-spacing: 0.2em; }
.cust .sumcol .amt { font-size: 76px; font-weight: 700; line-height: 1; }
.cust .sumcol .amt small { font-size: 34px; font-weight: 500; }
.cust .sumcol .cnt { font-size: 22px; color: var(--sub); }
.staffbar { height: 120px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 2px solid #CFC9BE; }
.staffbar .acts { display: flex; gap: 12px; }
.staffbar .acts .btn { height: 72px; font-size: 20px; min-width: 140px; }
.staffbar .acts .ok { min-width: 220px; font-size: 24px; }

/* 管理画面 */
.adminwrap { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 20px; }
.menu { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
.menu button { border-radius: 12px; border: 1.5px solid var(--line2); background: #FFF; text-align: left; padding: 12px 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.menu button b { font-size: 20px; }
.menu button span { font-size: 13px; color: var(--sub); }
.side { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 56px; border-radius: 10px; border: 1.5px solid var(--line2); background: #FFF; display: flex; align-items: center; gap: 8px; padding: 6px 10px; text-align: left; }
.tile.on { border: 3px solid var(--accent); background: var(--accent-bg); }
.tile.off { border: 1.5px dashed #BDB6A9; background: #EFEBE4; }
.tile .tn { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .ts { font-size: 12px; color: var(--sub); white-space: nowrap; }
.tile img, .tile .ph { width: 36px; height: 36px; border-radius: 6px; background: #E8E4DC; object-fit: cover; flex-shrink: 0; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 44px; height: 44px; border-radius: 8px; border: 1.5px solid #CFC9BE; }
.swatches button.on { border: 3px solid var(--accent); }
.imgedit { display: flex; gap: 14px; align-items: center; }
.imgedit img, .imgedit .ph { width: 120px; height: 120px; border-radius: 10px; background: #E8E4DC; object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 13px; }
.layoutrow { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #E6E1D8; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid #BDB6A9; background: #FFF; font-size: 22px; }
.stepper b { width: 28px; text-align: center; font-size: 20px; }
.miniprev { display: flex; flex-direction: column; gap: 6px; }
.miniprev .mr { display: grid; gap: 6px; }
.miniprev .mc { height: 34px; border-radius: 6px; border: 1px solid var(--line2); background: #FFF; font-size: 12px; display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.miniprev .mc.hidden { opacity: 0.45; border-style: dashed; }
.miniprev .mc.empty { border-style: dashed; background: transparent; }
.miniprev .mdiv { height: 2px; background: #CFC9BE; }

/* 使い方 */
.manual { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 20px; }
.manual .toc { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.manual .toc button { min-height: 60px; border-radius: 10px; border: 1.5px solid var(--line2); background: #FFF; text-align: left; padding: 8px 14px; }
.manual .toc button.on { border: 3px solid var(--accent); background: var(--accent-bg); }
.manual .toc b { display: block; font-size: 17px; }
.manual .toc span { font-size: 12px; color: var(--sub); }
.manual .body { flex: 1; overflow: auto; background: #FFF; border: 1.5px solid var(--line2); border-radius: 12px; padding: 22px 26px; font-size: 16px; line-height: 1.8; }
.manual .body h3 { font-size: 20px; margin: 0 0 8px; }
.manual .body h4 { font-size: 17px; margin: 18px 0 4px; color: var(--accent); }
.manual .body ol, .manual .body ul { margin: 4px 0 10px; padding-left: 24px; }
.manual .ver { margin-top: auto; font-size: 12px; color: var(--sub); }

/* モーダル */
.modal-bg { position: fixed; inset: 0; background: rgba(28, 27, 25, 0.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 640px; max-height: 92vh; overflow: auto; background: #FFF; border-radius: 16px; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 16px 40px rgba(28, 27, 25, 0.3); }
.modal h3 { margin: 0; font-size: 22px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.modal .acts .btn { height: 56px; min-width: 130px; font-size: 17px; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.keypad button { height: 60px; border-radius: 10px; border: 1px solid var(--line2); background: #FAF8F4; font-size: 24px; }
.keypad button.fn { font-size: 15px; }
.kdisp { height: 64px; border-bottom: 2px solid var(--ink); display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; font-size: 40px; font-weight: 700; padding: 0 6px; }
.kdisp small { font-size: 18px; font-weight: 400; color: var(--sub); }
.pindots { display: flex; gap: 16px; justify-content: center; padding: 8px 0; }
.pindots i { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--sub); }
.pindots i.f { background: var(--ink); }
.reasons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reasons button { height: 60px; border-radius: 10px; border: 1.5px solid var(--line2); background: #FFF; font-size: 17px; font-weight: 700; }
.reasons button.on { border: 3px solid var(--accent); background: var(--accent-bg); }
.check { display: flex; align-items: center; gap: 12px; font-size: 15px; background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); }
.err { color: var(--accent); font-size: 14px; font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); background: rgba(28, 27, 25, 0.88); color: #FFF; font-size: 18px; padding: 14px 24px; border-radius: 12px; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 60; }
#toast.show { opacity: 1; }
.ib img, .tile img, .cline img { -webkit-user-drag: none; pointer-events: none; }
