/* ko-order 共通 — 虎 KO café の HP と同じ色（紙・墨・弁柄） */
:root {
  --paper: #f6f2e9;
  --paper-white: #fcfaf5;
  --paper-warm: #efe9db;
  --ink: #26211a;
  --ink-soft: #585045;
  --ink-faint: #8a8174;
  --line: #ddd3c3;
  --sumi: #1c1813;
  --bengara: #7c3a2d;
  --bengara-deep: #63291f;
  --ok: #2f6b45;
  --warn: #b7791f;
  --alert: #b3261e;
  --radius: 12px;
  --shadow: 0 10px 30px rgb(28 24 19 / 0.14);
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', sans-serif;
  --font-mincho: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid rgb(124 58 45 / 0.45); outline-offset: 2px; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.num { font-variant-numeric: tabular-nums; }

/* ボタン */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-white); color: var(--ink);
  font-weight: 600; white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; }
.btn-primary { background: var(--bengara); border-color: var(--bengara); color: #fff; }
.btn-dark { background: var(--sumi); border-color: var(--sumi); color: #fff; }
.btn-danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: 0.9rem; }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.grow { flex: 1; }

.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 16px;
}
textarea.input { min-height: 80px; resize: vertical; }

/* シート・ダイアログ */
.sheet-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgb(28 24 19 / 0.42);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.18s ease;
}
.sheet-back.in { opacity: 1; }
.sheet-back.out { opacity: 0; }
.sheet-panel {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--paper-white); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(24px); transition: transform 0.2s ease;
}
.sheet-back.in .sheet-panel { transform: none; }
@media (min-width: 760px) {
  .sheet-back { align-items: center; }
  .sheet-panel { border-radius: 18px; max-width: 560px; }
  .sheet-panel.wide { max-width: 920px; }
}
body.has-sheet { overflow: hidden; }

.confirm-msg { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; }
.confirm-detail { margin: 0; color: var(--ink-soft); white-space: pre-line; }
.confirm .input { margin-top: 8px; }

/* テンキー */
.pad-title { font-weight: 700; color: var(--ink-soft); }
.pad-value { font-size: 2.2rem; font-weight: 800; text-align: right; padding: 4px 6px 10px; font-variant-numeric: tabular-nums; border-bottom: 2px solid var(--line); margin-bottom: 12px; }
.pad-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad-key { min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 1.5rem; font-weight: 700; }
.pad-key:active { background: var(--paper-warm); }
.sheet-pad { max-width: 420px; }

/* 通知 */
.toasts { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 90; display: grid; gap: 6px; width: min(92vw, 520px); pointer-events: none; }
.toast { background: var(--sumi); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; transition: opacity 0.3s, transform 0.3s; }
.toast-error { background: var(--alert); }
.toast-ok { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* 印刷（レシート・領収書・QR） */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  body { background: #fff; }
}
