/* styles.css — 画面（iPhone の片手で触れる大きさ。押す所は 44px 以上） */
:root {
  --bg: #f4f4f6;
  --ink: #1b1b1f;
  --muted: #6b6b75;
  --line: #d9d9de;
  --accent: #c8161d;
  --pad: 12px;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; }
body { padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, input, select { font: inherit; color: inherit; }

.top { display: flex; gap: 8px; align-items: center; padding: 8px var(--pad); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.store-pick { flex: 1; min-width: 0; }
.store-pick select { width: 100%; min-height: 44px; font-size: 17px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }

.btn { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; touch-action: manipulation; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: #fff; }
.btn.danger { background: #fff; border-color: #e7b1b3; color: #a3131a; }
.btn.arrow { width: 52px; font-size: 18px; }
.btn:disabled { opacity: .45; }
.small-btn { min-height: 40px; font-size: 14px; }

.month-bar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px var(--pad) 4px; }
.ym { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; }
.ym input { width: 5.2em; min-height: 44px; text-align: center; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; font-weight: 600; background: #fff; }
.ym select { min-height: 44px; min-width: 4em; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; font-weight: 600; padding: 0 8px; background: #fff; }

.mode { display: flex; margin: 6px var(--pad) 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg { flex: 1; min-height: 44px; border: 0; background: transparent; font-size: 15px; }
.seg[aria-checked="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.hint { margin: 6px var(--pad) 6px; font-size: 13px; color: var(--muted); }

.sheet-wrap { padding: 0 6px; }
.sheet { position: relative; max-width: 620px; margin: 0 auto; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 14px 6px; }
.sheet canvas { display: block; width: 100%; }
.cells { position: absolute; inset: 14px 6px; }
.cell { position: absolute; border: 0; padding: 0; background: transparent; cursor: pointer; touch-action: manipulation;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.cell:active, .cell.pressing { background: rgba(200, 22, 29, .10); }
.cell:focus-visible { outline: 3px solid #1f74e6; outline-offset: -3px; }

.below { padding: 10px var(--pad); }
.small { font-size: 13px; margin: 4px 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row.end { justify-content: flex-end; }
.h2 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.chip[aria-current="true"] { border-color: var(--ink); font-weight: 700; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 5; }
.bottom .btn { flex: 1; min-height: 52px; font-size: 16px; }

.banner { position: fixed; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); z-index: 20; background: #1b1b1f; color: #fff; border-radius: 12px; padding: 12px; display: flex; gap: 8px; align-items: center; }
.banner .btn { color: var(--ink); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 20; background: #1b1b1f; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 14px; max-width: 90vw; }

.dlg { width: min(560px, 94vw); max-height: 90vh; border: 0; border-radius: 14px; padding: 16px; }
.dlg::backdrop { background: rgba(0,0,0,.35); }
.dlg h2 { margin: 0 0 8px; font-size: 18px; }
.dlg label { display: block; margin: 8px 0; font-size: 14px; color: var(--muted); }
.dlg input:not([type="checkbox"]) { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 17px; color: var(--ink); }
.dlg fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 8px 10px; }
.dlg legend { font-size: 14px; color: var(--muted); }
.dlg img { display: block; max-width: 100%; max-height: 50vh; margin: 8px auto; border: 1px solid var(--line); }
.weekdays { display: flex; gap: 4px; flex-wrap: wrap; }
.weekdays label { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 44px; min-height: 44px; margin: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 16px; }
.weekdays input { width: 18px; height: 18px; }
