:root {
  --accent: #1F6FEB;
  --accent-deep: #1550b8;
  --ink: #1c1e21;
  --muted: #8a9099;
  --line: #e6e8eb;
  --bg: #f4f6f8;
  --card: #ffffff;
  --warn: #d9822b;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* hidden 属性を常に最優先で効かせる。
   （.loading や .progress が display:flex を持ち、UAの [hidden]{display:none} を詳細度同点で上書きしてしまう問題の対策。
     これが無いとローディングのスピナーが hidden でも消えず、画面が「くるくる」したまま固着する。） */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }

.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.appbar .brand { display: flex; flex-direction: column; line-height: 1.2; }
.appbar .brand span { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; font-size: 16px; }
.appbar .brand small { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.back { border: 0; background: transparent; color: var(--accent); font-size: 14px; cursor: pointer; padding: 4px 6px; }

.progress { display: flex; gap: 6px; padding: 12px 16px 0; }
.progress i { flex: 1; height: 4px; border-radius: 3px; background: var(--line); transition: background .2s; }
.progress i.on { background: var(--accent); }

.appbody { flex: 1; }
.screen { display: none; }
.screen.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pad { padding: 18px 16px 24px; }
.sec-h { font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 20px; margin: 4px 0 6px; }
.sec-s { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* menu card */
.menucard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.menucard .mname { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; font-size: 19px; }
.menucard .mmeta { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 10px; }
.menucard .price { color: var(--accent); font-weight: 700; font-size: 24px; }
.menucard .dur { color: var(--muted); font-size: 13px; }
.menucard .mdesc { color: #4a5058; font-size: 14px; margin: 0; }

/* calendar */
.calbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calbar button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 18px; cursor: pointer; }
.calbar button:disabled { opacity: .35; }
.calbar .mo { font-weight: 700; font-size: 16px; }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dow .sun { color: #d9534f; } .dow .sat { color: #4a7fd9; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 15px; }
.day.empty { visibility: hidden; }
.day.past { color: #cfd3d8; }
.day.ok { background: var(--card); border: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.day.ok:active { background: #eef4ff; }
.day.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

/* slots */
.selbar { display: flex; gap: 12px; align-items: baseline; margin-bottom: 12px; font-size: 14px; }
.selbar .d { font-weight: 700; }
.selbar .du { color: var(--muted); font-size: 12px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { padding: 14px 0; text-align: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.slot:active { background: #eef4ff; }
.slot.sel { background: var(--accent); color: #fff; border-color: var(--accent); }
.slots-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 32px 0; font-size: 14px; }

/* form */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field label em { color: #d9534f; font-style: normal; font-size: 11px; margin-left: 4px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 16px; font-family: inherit; background: var(--card);
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }

/* receipt */
.receipt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.receipt .rrow { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.receipt .rrow:last-child { border-bottom: 0; }
.receipt .k { width: 92px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.receipt .v { flex: 1; font-weight: 500; }
.receipt .rtotal { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 12px; border-top: 2px solid var(--line); }
.receipt .rtotal .v { color: var(--accent); font-size: 22px; font-weight: 700; text-align: right; }
.note-conf { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* done */
.done { text-align: center; padding: 48px 24px; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.done h2 { font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 20px; margin: 0 0 8px; }
.done p { color: var(--muted); font-size: 14px; }
.done .receipt { text-align: left; margin-top: 20px; }

/* foot */
.appfoot { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.cta { width: 100%; padding: 15px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.cta:disabled { background: #b8c4d4; }
.cta:active:not(:disabled) { background: var(--accent-deep); }
.footnote { text-align: center; color: var(--muted); font-size: 11px; margin-top: 6px; min-height: 14px; }

/* overlay */
.loading { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #1c1e21; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 60; max-width: 90%; text-align: center; }
