:root {
  --bg: #f7f5f1;
  --card: #ffffff;
  --ink: #2b2a28;
  --muted: #8a857c;
  --line: #e8e3da;
  --brand: #3a8fb7;      /* 空色 */
  --brand-ink: #ffffff;
  --ok: #2e9d62;
  --few: #d98a1c;
  --wait: #7a5cc4;
  --ng: #c9463d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px; line-height: 1.6; padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 640px; margin: 0 auto; padding: 12px 16px 48px; }
body.admin main { max-width: 900px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.devbar { background: #fff3c4; color: #6b5200; font-size: 12px; text-align: center; padding: 4px; }
.fatal { padding: 24px; color: var(--ng); }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .02em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paw { margin-right: 6px; }
.admin-link { white-space: nowrap; flex-shrink: 0; margin-left: 8px; font-size: 13px; color: var(--brand); text-decoration: none; border: 1px solid var(--brand); border-radius: 999px; padding: 2px 12px; }

.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tab { flex: 1; border: 0; background: none; padding: 12px 0; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; }

.live { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.day { flex: 0 0 56px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.day .dw { font-size: 11px; color: var(--muted); }
.day .dd { font-size: 18px; font-weight: 700; line-height: 1.2; }
.day .dm { font-size: 13px; font-weight: 700; }
.day.w0 .dw { color: var(--ng); } .day.w6 .dw { color: var(--brand); }
.day.available .dm { color: var(--ok); } .day.few .dm { color: var(--few); } .day.waitlist .dm { color: var(--wait); }
.day.full .dm, .day.closed .dm, .day.none .dm { color: var(--muted); }
.day.none { opacity: .55; }
.day.sel { border-color: var(--brand); background: var(--brand); color: #fff; }
.day.sel .dw, .day.sel .dm { color: #fff !important; }

.day-title { font-size: 16px; margin: 8px 0 10px; }
.slots { display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.slot.closed, .slot.full { opacity: .6; }
.slot .time { font-size: 18px; font-weight: 700; line-height: 1.2; }
.slot .time small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.st { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; background: var(--muted); vertical-align: 1px; }
.st.available { background: var(--ok); } .st.few { background: var(--few); } .st.waitlist { background: var(--wait); } .st.full { background: var(--ng); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.legend .st { margin-right: 4px; width: 18px; height: 18px; font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 32px 8px; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }

.btn { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.wait { background: var(--wait); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.xs { padding: 4px 10px; font-size: 12px; font-weight: 600; }
.pill { white-space: nowrap; display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eaf4f9; color: var(--brand); font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
.sheet-body { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 12px; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-body h3 { margin: 0; font-size: 18px; }
.sheet-body p { margin: 0; }
.sheet-body.center { text-align: center; justify-items: center; }
.sheet-body.center p { white-space: pre-line; }
.big { font-size: 44px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; font-weight: 400; }
.row { display: flex; gap: 10px; } .row .btn { flex: 1; }
.notice { background: #f1ecfb; color: #4a3585; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

.mine { display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; justify-items: start; }
.card .when { font-size: 18px; font-weight: 700; }
.card .btn { margin-top: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.badge.confirmed { background: #e3f4ea; color: var(--ok); }
.badge.waitlisted { background: #efe9fa; color: var(--wait); }
.badge.cancelled { background: #eee; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: #2b2a28; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.toast.error { background: var(--ng); }

.shop-info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 4px 0 12px; }
.shop-info summary { font-weight: 700; cursor: pointer; }
.shop-info p { margin: 8px 0; font-size: 14px; }
.shop-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: 14px; }
.shop-info dt { color: var(--muted); }
.shop-info dd { margin: 0; }
.shop-info a { color: var(--brand); }
.features { list-style: none; padding: 0; margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.features li { font-size: 12px; background: #eaf4f9; color: #2a6a89; border-radius: 999px; padding: 2px 10px; }
.fee { background: #f6f3ec; border-radius: 10px; padding: 8px 12px; font-size: 14px; }

.req { font-size: 11px; color: #fff; background: var(--ng); border-radius: 4px; padding: 0 5px; margin-left: 4px; font-weight: 600; }
#fieldsBox { display: grid; gap: 12px; }
.saved { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafaf7; }
.saved-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.saved-head .btn { margin-left: auto; }
.policy-check { border-radius: 10px; padding: 8px 10px; background: #f6f3ec; }
.policy-check.warn { outline: 2px solid var(--ng); }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: 20px; height: 20px; flex: 0 0 auto; }
.policy-check a, #policyAgreedNote a { color: var(--brand); }
.policy { font-size: 14px; }
.policy h2 { font-size: 18px; margin: 0 0 4px; }
.policy h3 { font-size: 15px; margin: 16px 0 4px; }
.policy ul { margin: 0; padding-left: 1.2em; }
.policy p { margin: 4px 0; }
.my-info { margin-top: 16px; }
.my-info .btn { justify-self: start; }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.card-actions .btn { margin-top: 0; }
.move-banner { display: flex; align-items: center; gap: 10px; background: #eaf4f9; border: 1px solid #bcdcea; color: #1f5670; border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 10px; font-size: 14px; }
.move-banner .btn { margin-left: auto; flex-shrink: 0; background: #fff; }
.move-compare { display: grid; gap: 4px; background: #f6f3ec; border-radius: 12px; padding: 12px; }
.move-compare .strike { text-decoration: line-through; color: var(--muted); }
.move-compare .when { font-size: 18px; font-weight: 700; }
.move-compare .arrow { color: var(--muted); }

/* お店への連絡（キャンセル） */
.contact-shop { margin-top: 8px; padding: 8px 10px; background: #f6f3ec; border-radius: 10px; display: grid; gap: 6px; justify-items: start; width: 100%; }
.contact-shop p { margin: 0; }
.btn.line { background: #06c755; color: #fff; text-decoration: none; display: inline-block; }
.warn-text { color: var(--ng); }

/* 管理画面 */
.cal-toolbar { justify-content: space-between; }
.back-cal { margin-bottom: 8px; color: var(--brand); border-color: #bcdcea; background: #fff; }
.cal-title { font-size: 17px; flex: 1; text-align: center; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head span { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.cal-head .w0 { color: var(--ng); } .cal-head .w6 { color: var(--brand); }
.cal-cell { min-height: 76px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 3px 3px 4px; display: flex; flex-direction: column; align-items: stretch; gap: 1px; text-align: left; cursor: pointer; font: inherit; color: inherit; overflow: hidden; }
.cal-cell.empty { border: 0; background: none; cursor: default; }
.cal-cell.off { background: #f5f3ee; }
.cal-cell.past { opacity: .55; }
.cal-cell.today { border: 2px solid var(--brand); }
.cal-cell.w0 .cal-d { color: var(--ng); } .cal-cell.w6 .cal-d { color: var(--brand); }
.cal-d { font-size: 12px; font-weight: 700; line-height: 1.2; }
.cal-off { font-size: 11px; color: var(--muted); margin-top: auto; text-align: center; }
.cal-g { font-size: 13px; font-weight: 700; line-height: 1.2; }
.cal-p { font-size: 10px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.cal-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; margin-top: 2px; }
.cal-bar i { display: block; height: 100%; background: var(--ok); }
.cal-bar i.high { background: var(--few); } .cal-bar i.full { background: var(--ng); }
.cal-marks { display: flex; gap: 2px; min-height: 14px; margin-top: 1px; }
.wl, .stp { font-size: 9px; line-height: 14px; padding: 0 3px; border-radius: 3px; color: #fff; font-style: normal; }
.wl { background: var(--wait); } .stp { background: var(--ng); }
.cal-legend { margin-top: 8px; }
.panel.export { margin-top: 16px; }
.panel.export .row { flex-direction: column; }
@media (min-width: 640px) {
  .cal-cell { min-height: 92px; padding: 6px; }
  .cal-d { font-size: 14px; } .cal-g { font-size: 15px; } .cal-p { font-size: 12px; }
}
.day-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill.stop { background: #fbe9e7; color: var(--ng); }
.slot-admin.stopped { border-color: #f0c8c2; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.toolbar input { width: auto; flex: 1; max-width: 200px; padding: 6px 10px; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.panel h3 { margin: 0; font-size: 15px; }
.panel p { margin: 0; }
.slot-admin.closed { background: #f3f1ec; }
.slot-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.slot-head .t { font-size: 17px; margin-right: 8px; }
.slot-tools { display: flex; gap: 6px; align-items: center; }
.slot-tools label { display: flex; align-items: center; gap: 4px; font-weight: 400; }
.slot-tools input { width: 64px; padding: 4px 6px; font-size: 14px; }
table.res { width: 100%; border-collapse: collapse; font-size: 14px; }
table.res td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.res tr.cancelled { opacity: .45; }
table.res a { color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.weekdays { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.weekdays legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.weekdays label { display: flex; align-items: center; gap: 4px; font-weight: 400; font-size: 15px; }
.weekdays input { width: auto; }
table.res .note { background: #fdf6e3; border-radius: 6px; padding: 2px 6px; margin-top: 2px; }
