/* 回答フォーム（SC-08/09）— 375px基準のモバイルファースト */
:root {
  --accent: #00A29A; --brand: #00857E; --brand-d: #00655F; --brand-bg: #e6f5f4; --bg: #f4f6f6; --card: #fff;
  --ink: #1a1d24; --ink2: #5b6270; --ink3: #8a90a0; --line: #e3e6ee;
  --err: #b3261e; --err-bg: #fdecea; --ok: #0a7a0a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 15px;
  -webkit-text-size-adjust: 100%;
}
.muted { color: var(--ink3); }
.af-wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.af-head { background: var(--accent); color: #fff; padding: 22px 18px 16px; }
.af-head h1 { font-size: 19px; line-height: 1.4; margin-bottom: 6px; }
.af-head p { font-size: 13px; opacity: .92; }
.af-head .af-meta { margin-top: 8px; font-size: 12px; opacity: .8; }
.af-body { flex: 1; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 12px; }
.af-q { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.af-q.has-error { border-color: var(--err); }
.af-qbody { font-size: 16px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }
.af-req { display: inline-block; vertical-align: 2px; background: var(--err-bg); color: var(--err); border-radius: 5px; font-size: 10.5px; padding: 1px 6px; margin-left: 6px; }
.af-error { background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.af-choice {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px; margin-bottom: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.af-choice:last-child { margin-bottom: 0; }
.af-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-mark { width: 20px; height: 20px; border: 2px solid var(--ink3); flex: none; position: relative; }
.af-mark.radio { border-radius: 50%; }
.af-mark.check { border-radius: 5px; }
.af-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.af-choice:has(input:checked) .af-mark { border-color: var(--brand); }
.af-choice:has(input:checked) .af-mark.radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand);
}
.af-choice:has(input:checked) .af-mark.check::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--brand); font-weight: 800; font-size: 14px;
}
.af-choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.af-label { font-size: 15px; }
/* 評価スケール（NPS 形式。左が低評価・右が高評価＋両矢印。施主指示 2026-09-16） */
.af-scale { display: flex; flex-direction: column; gap: 10px; }
.af-scale-row { display: grid; grid-template-columns: repeat(var(--sc-n), minmax(0, 1fr)); gap: 6px; }
.af-choice.af-scale-item {
  margin: 0; padding: 10px 2px; justify-content: center; text-align: center; min-height: 52px; border-radius: 10px;
}
.af-scale-item .af-label { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.af-choice.af-scale-item:has(input:checked) { background: var(--brand); border-color: var(--brand); }
.af-choice.af-scale-item:has(input:checked) .af-label { color: #fff; }
.af-scale-axis { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink2); font-weight: 700; }
.af-scale-axis .lo, .af-scale-axis .hi { flex: none; white-space: nowrap; }
.af-scale-axis .arrow { flex: 1; height: 1.5px; background: var(--line); position: relative; border-radius: 2px; }
.af-scale-axis .arrow::before, .af-scale-axis .arrow::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px;
  border-top: 1.5px solid var(--line); border-right: 1.5px solid var(--line);
}
.af-scale-axis .arrow::before { left: 0; transform: translateY(-50%) rotate(-135deg); }
.af-scale-axis .arrow::after { right: 0; transform: translateY(-50%) rotate(45deg); }
@media (max-width: 420px) {
  .af-scale-row { gap: 4px; }
  .af-choice.af-scale-item { padding: 8px 1px; min-height: 46px; border-radius: 8px; }
  .af-scale-item .af-label { font-size: 15px; }
  .af-scale-axis { font-size: 12px; gap: 6px; }
}
/* 選択式設問の自由記入欄（設問単位・その他/補足用） */
.af-text.af-qfree { min-height: 46px; margin-top: 8px; }
.af-text {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 12px;
  font-size: 15px; font-family: inherit; resize: vertical; min-height: 100px; background: var(--card);
}
.af-text:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.af-date { min-height: 48px; max-width: 240px; }
.af-word { max-width: 320px; min-height: 48px; }
.af-selnote { font-size: 12.5px; color: var(--ink3); font-weight: 600; margin-left: 4px; }
.af-prefsel { min-height: 48px; max-width: 240px; resize: none; appearance: auto; }
.af-numrow { display: flex; align-items: center; gap: 8px; }
.af-num { min-height: 48px; max-width: 160px; }
.af-affix { font-size: 15px; font-weight: 700; }
.af-count { text-align: right; font-size: 12px; margin-top: 4px; }
.af-foot {
  position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--bg) 30%);
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
}
.af-submit {
  width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 13px;
  padding: 15px; font-size: 16px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(0, 133, 126, .35);
}
.af-submit:active { background: var(--brand-d); }
.af-submit:disabled { opacity: .6; }
/* 完了・エラー画面 */
.af-done { margin: auto; text-align: center; padding: 60px 24px; }
.af-done-icon {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
  background: #e7f5e7; color: var(--ok); font-size: 36px; font-weight: 800;
  display: grid; place-items: center;
}
.af-done-icon.gray { background: #eceef3; color: var(--ink3); }
.af-done h1 { font-size: 19px; margin-bottom: 10px; }
.af-done p { color: var(--ink2); font-size: 14px; }
/* Google クチコミ案内（docs/14）。完了の表示を上に寄せ、その下にカードを置く */
.af-done.has-review { margin: 0 auto; padding: 44px 24px 18px; }
.af-review { margin: 0 12px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px 16px; }
.af-review h2 { font-size: 16px; line-height: 1.5; margin-bottom: 6px; }
.af-review h2 .opt { font-size: 13px; font-weight: 400; color: var(--ink3); }
.af-review .lead { font-size: 13.5px; color: var(--ink2); margin-bottom: 14px; }
.af-review .place { font-weight: 700; color: var(--ink); }
.af-review-lbl { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; }
.af-review-text { width: 100%; min-height: 110px; resize: vertical; margin-bottom: 12px; font-size: 15px; line-height: 1.7; }
.af-review-go { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.af-review-sub { display: grid; gap: 8px; margin-top: 8px; }
.af-review-sub:empty { display: none; }
.af-review-msg { font-size: 13px; color: var(--ok); font-weight: 700; margin-top: 8px; min-height: 1em; }
.af-review-msg.err { color: var(--err); }
.af-review-note { font-size: 12px; color: var(--ink3); margin-top: 6px; }
.af-review-qr { text-align: center; }
.af-review-qr .slot { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.af-review-qr p { font-size: 13px; color: var(--ink2); margin-top: 8px; }

/* 日付の3分割入力（年4桁→月→日 自動移動） */
.af-dategroup { display: flex; align-items: center; gap: 6px; }
.af-dseg {
  border: 1.5px solid var(--line); border-radius: 11px; padding: 12px 8px; text-align: center;
  font-size: 16px; font-family: inherit; background: var(--card); min-height: 48px;
}
.af-dseg:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.af-dy { width: 5.2em; }
.af-dm, .af-dd { width: 3.4em; }
.af-dunit { font-size: 15px; font-weight: 700; }

/* ============================== イベント受付（docs/10） ============================== */
.af-head .af-kind { font-size: 12px; font-weight: 700; letter-spacing: .08em; opacity: .9; margin-bottom: 4px; }
.af-notice { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ink2); }
.af-notice.full { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.af-hint { font-size: 12px; color: var(--ink3); margin-top: 4px; }
/* プランカード */
.af-plan {
  display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px; margin-bottom: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; position: relative;
}
.af-plan:last-of-type { margin-bottom: 0; }
.af-plan > input[type="radio"], .af-plan > input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-plan .af-mark { margin-top: 2px; }
.af-plan:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.af-plan:has(input:checked) .af-mark { border-color: var(--brand); }
.af-plan:has(input:checked) .af-mark.radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.af-plan:has(input:checked) .af-mark.check::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); font-weight: 800; font-size: 14px; }
.af-plan:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.af-plan.full { background: #f7f8f9; color: var(--ink3); cursor: not-allowed; }
.af-plan.full.waitok { cursor: pointer; color: var(--ink); background: #fffaf0; }
.af-plan-main { flex: 1; min-width: 0; }
.af-plan-name { display: block; font-size: 15px; font-weight: 700; }
.af-plan-desc { display: block; font-size: 12.5px; color: var(--ink2); margin-top: 2px; line-height: 1.5; }
.af-plan.full .af-plan-name, .af-plan.full .af-plan-desc { color: var(--ink3); }
.af-remain { flex: none; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-bg); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.af-remain:empty { display: none; }
.af-remain.full { color: var(--err); background: var(--err-bg); }
/* 人数ステッパー */
.af-qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.af-qty-label, .af-qty-unit { font-size: 13px; color: var(--ink2); }
.af-qty-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--brand); background: #fff; color: var(--brand); font-size: 18px; font-weight: 700; cursor: pointer; font-family: inherit; }
.af-qty-btn:active { background: var(--brand); color: #fff; }
.af-qty-val { width: 44px; min-height: 36px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; background: #fff; }
/* 個人情報注記 */
/* 管理者の代理入力の案内（施主指示 2026-09-16） */
.af-admin-note {
  background: #fff8e1; border: 1.5px solid #e0b64a; border-radius: 12px;
  padding: 10px 14px; font-size: 13px; line-height: 1.6; color: #6b4e00;
}
/* 施設名（フォーム下部。部門ごとに設定。施主指示 2026-09-16） */
.af-facility {
  position: relative; z-index: 6; background: var(--bg);
  text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink2);
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}
.af-privacy { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: var(--ink2); line-height: 1.6; }
.af-privacy b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 4px; }
/* 確認画面（オーバーレイ） */
.af-confirm { position: fixed; inset: 0; background: var(--bg); z-index: 50; overflow: auto; }
.af-confirm-box { max-width: 560px; margin: 0 auto; padding: 20px 14px 40px; }
.af-confirm-box h2 { font-size: 18px; margin-bottom: 6px; }
.af-confirm-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin: 12px 0; }
.af-confirm-list dt { font-size: 12px; color: var(--ink3); margin-top: 10px; }
.af-confirm-list dd { margin: 2px 0 10px; font-size: 15px; word-break: break-word; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.af-confirm-list dd:last-child { border-bottom: none; }
.af-confirm-actions { display: flex; flex-direction: column; gap: 10px; }
.af-btn-sub { display: block; width: 100%; text-align: center; background: #fff; color: var(--brand); border: 1.5px solid var(--brand); border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; text-decoration: none; box-sizing: border-box; }
.af-btn-danger { display: block; width: 100%; text-align: center; background: #fff; color: var(--err); border: 1.5px solid var(--err); border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.af-btn-danger:disabled, .af-btn-sub:disabled { opacity: .6; }
body.af-modal-open { overflow: hidden; }
/* 完了画面（イベント） */
.af-done-event { padding: 36px 16px 40px; }
.af-done-event > p { margin-bottom: 14px; }
.af-done-code { display: inline-flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--brand); border-radius: 14px; padding: 10px 26px; margin: 4px auto 16px; }
.af-done-code .lbl { font-size: 12px; color: var(--ink2); letter-spacing: .08em; }
.af-done-code .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 26px; font-weight: 800; letter-spacing: .12em; color: var(--brand); }
.af-done-code.small { padding: 6px 18px; margin: 6px 0 10px; }
.af-done-code.small .code { font-size: 20px; }
.af-done-box { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 10px 0; }
.af-done-box > div { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.af-done-box > div:last-child { border-bottom: none; }
.af-done-box .k { flex: none; width: 80px; color: var(--ink3); font-size: 12.5px; padding-top: 2px; }
.af-done-box .v { flex: 1; color: var(--ink); word-break: break-word; }
.af-thanks { text-align: left; background: var(--brand-bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--ink); margin: 10px 0; line-height: 1.6; }
.af-self-link { text-align: left; margin-top: 16px; }
.af-self-link p { font-size: 13px; margin-bottom: 8px; }
.af-url { min-height: 44px; font-size: 12.5px; margin-bottom: 8px; resize: none; }
/* 本人用ページ */
.af-self-status { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 3px 12px; background: #e7f5e7; color: var(--ok); margin-bottom: 8px; }
.af-self-status.st-waitlisted { background: #fdf3d7; color: #8a5b00; }
.af-self-status.st-canceled { background: #eceef3; color: var(--ink3); }

/* ---- オンライン決済（docs/11） ---- */
.af-price { display: inline-block; font-size: 13px; font-weight: 700; color: var(--brand-d); background: var(--brand-bg); border-radius: 6px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.af-price.free { color: var(--ink3); background: #eef0f3; }
.af-plan.full .af-price { opacity: .6; }
.af-pay .af-qbody { margin-bottom: 8px; }
.af-total { display: flex; align-items: baseline; justify-content: space-between; background: var(--brand-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.af-total span { font-size: 13px; color: var(--brand-d); font-weight: 700; }
.af-total b { font-size: 22px; color: var(--brand-d); letter-spacing: .02em; }
.af-hint { font-size: 12.5px; color: var(--ink2); margin: 6px 0; line-height: 1.55; }
.af-hint a { color: var(--brand); }
.af-paychoice { margin: 8px 0 4px; }
.af-policy { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.af-policy summary { cursor: pointer; font-weight: 700; color: var(--ink2); }
.af-policy p { margin-top: 6px; color: var(--ink2); line-height: 1.6; }
.af-self-status.st-pending_payment { background: #fff3e2; color: #a85a00; }
.af-self-status.st-expired { background: #eceef3; color: var(--ink3); }

/* ---- 公開ページの質感（2026-08-24。パレット対応と合わせて） ---- */
.af-head { background: linear-gradient(140deg, var(--accent), var(--brand) 90%); }
.af-q { box-shadow: 0 1px 2px rgba(16, 42, 40, .04); }
@media (prefers-reduced-motion: no-preference) {
  .af-choice, .af-plan, .af-submit, .af-btn-sub, .af-btn-danger { transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease; }
}
.af-choice:hover, .af-plan:not(.full):hover { border-color: var(--brand); }
.af-submit:active, .af-btn-sub:active, .af-btn-danger:active { transform: translateY(1px); }
.af-text:focus, .af-dseg:focus, .af-prefsel:focus, .af-num:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }

/* ---- 日時予約（docs/12）: カレンダーから日を選び、その日の時間枠を選ぶ ---- */
.af-slotpick { display: flex; flex-direction: column; gap: 10px; }
.af-cal { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; background: #fff; }
.af-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.af-cal-title { font-weight: 800; font-size: 15px; }
.af-cal-nav { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.af-cal-nav:disabled { opacity: .35; cursor: default; }
.af-chev { width: 9px; height: 9px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(-45deg); margin-left: -3px; }
.af-chev.left { transform: rotate(135deg); margin-left: 3px; }
.af-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.af-cal-wd { text-align: center; font-size: 11px; color: var(--ink3); padding: 2px 0 4px; font-weight: 700; }
.af-cal-wd.sun { color: #c0392b; }
.af-cal-wd.sat { color: #2b62b3; }
.af-cal-cell { aspect-ratio: 1 / 1; min-height: 40px; border-radius: 9px; border: 1.5px solid transparent; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-family: inherit; font-size: 14px; color: var(--ink3); padding: 0; }
.af-cal-cell.has { background: var(--bg); color: var(--ink); cursor: pointer; font-weight: 700; border-color: var(--line); }
.af-cal-cell.has.full { color: var(--ink3); font-weight: 500; background: #f7f8f9; }
/* 選択済みの枠がある日はブランド色（日付だけを選ぶフォームで「選んだ日」が分かるように） */
.af-cal-cell.has.picked, .af-cal-cell.has.picked.full { background: var(--brand); color: #fff; border-color: var(--brand-d); }
.af-cal-cell.has.picked .mk { background: #fff; opacity: 1; }
.af-cal-cell.today .d { text-decoration: underline; text-underline-offset: 2px; }
/* 「直前に見た日」は色を変えない（施主指示 2026-09-11）。色が付くのは選択済みの枠がある日（.picked）だけ */
.af-cal-cell .mk { width: 7px; height: 7px; border-radius: 50%; }
.af-cal-cell.open .mk { background: var(--ok); }
.af-cal-cell.few .mk { background: #e0a800; }
.af-cal-cell.full .mk { background: var(--err); opacity: .6; }
.af-cal-cell.none .d { opacity: .45; }
.af-cal-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.af-cal-legend { display: flex; gap: 12px; justify-content: flex-end; font-size: 11px; color: var(--ink3); margin-top: 6px; }
.af-cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.af-cal-legend i.ok { background: var(--ok); }
.af-cal-legend i.few { background: #e0a800; }
.af-cal-legend i.full { background: var(--err); opacity: .6; }
.af-slot-hint { font-size: 12.5px; color: var(--ink3); }
/* カレンダー下の日ごとのカードは出さない（ラジオ／チェックと人数欄の実体。選択はカレンダーとモーダルで行う） */
.af-slotpick .af-slot-days { display: none; }
.af-slot-daytitle { font-weight: 800; font-size: 14px; margin: 2px 0 8px; color: var(--brand-d); }
.af-slot .af-plan-name { font-variant-numeric: tabular-nums; }
.af-slot-chosen { background: var(--brand-bg); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; color: var(--brand-d); }
.af-slot-chosen b { font-weight: 800; }
.af-slot-name { color: var(--brand-d); }

/* ---- 月／週の切替（docs/12 §13） ---- */
.af-viewsw { display: inline-flex; align-self: flex-end; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.af-viewbtn { border: 0; background: transparent; padding: 6px 16px; font-size: 13px; font-weight: 700; color: var(--ink2); cursor: pointer; font-family: inherit; }
.af-viewbtn[aria-pressed="true"] { background: var(--brand); color: #fff; }
.af-viewbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---- 週カレンダー: 左に時刻、横に日〜土、枠は時刻の位置にカード ---- */
.af-week { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; background: #fff; }
.af-week-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
/* 7 日を画面の幅に収める（スマホでも横スクロールにしない。施主指示 2026-11-13・docs/12 §16）。
   列の数は slot-picker.js が grid-template-columns に入れる（週表示は 7 列、横並びの表示は選べる日の数）。
   列が狭いほどカードの中身を減らし、広いほど文字を大きくする（下の @container） */
.af-week-grid { --hour: 96px; --wgut: 40px; display: grid; grid-template-columns: var(--wgut) repeat(7, minmax(0, 1fr)); padding-bottom: 8px; font-size: 12px; }
/* 見出しは曜日の下に日付（狭い列でも収まるように縦に積む） */
.af-wd-head { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 6px; line-height: 1.2; font-weight: 700; color: var(--ink2); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.af-wd-head .w { font-size: 11px; }
.af-wd-head .n { font-size: 15px; display: inline-block; min-width: 24px; line-height: 24px; padding: 0 3px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.af-wd-head .n .mo { font-size: .72em; }
.af-wd-head.sun { color: #c0392b; }
.af-wd-head.sat { color: #2b62b3; }
.af-wd-head.today .n { background: var(--brand); color: #fff; }
.af-wd-head.selected .n { box-shadow: none; }
.af-wcorner { border-bottom: 1px solid var(--line); }
.af-wgut { position: relative; font-size: 10.5px; color: var(--ink3); text-align: right; padding-right: 4px; }
/* 横スクロールしても時刻の目盛りは左に残す */
.af-wcorner, .af-wgut { position: sticky; left: 0; z-index: 2; background: #fff; }
.af-wgut-body span { position: absolute; right: 4px; transform: translateY(-50%); background: #fff; padding: 0 2px; }
.af-wgut-allday { display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--line); }
.af-wallday { min-height: 30px; padding: 2px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.af-wallday .af-wcard { position: relative; min-height: 26px; }
.af-wcol {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour));
}
.af-wcol.today { background-color: #f7fbfa; }
/* 枠のカード: 未選択は白（施主指示 2026-09-11「選択したときに着色」）。空き状況は「残り」の前の小さな点で示す（凡例と同じ色）。
   満席・受付終了は灰、選択中はブランド色 */
.af-wcard {
  position: absolute; border-radius: 6px; padding: 0; background: #fff; border: 1.5px solid #cfd5df; color: var(--ink);
  font-size: 10px; line-height: 1.2; cursor: pointer; overflow: hidden; text-align: left; font-family: inherit; box-sizing: border-box;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
/* 中身（時間帯・名称）は .in に入れ、余白と文字の大きさは .in に付ける（週表示ではカードの幅で切り替えるため。下の @container） */
.af-wcard .in { display: block; padding: 2px 3px 12px; }
/* 「時間帯 → 名称 → 残り」。時間帯は列に収まらなければ「〜」の後で折り返す（<wbr>）。名称は文字単位で折り返す */
.af-wcard .t { display: block; font-weight: 700; font-variant-numeric: tabular-nums; word-break: keep-all; }
.af-wcard .nm { display: block; font-weight: 500; overflow-wrap: anywhere; }
/* 残数（残数表示の設定が ON のとき）や満席・受付終了は、セルの右下に小さく（施主指示 2026-09-11） */
.af-wcard .r { position: absolute; right: 4px; bottom: 2px; display: flex; align-items: center; gap: 3px; font-size: 9px; line-height: 1; color: var(--ink2); white-space: nowrap; }
.af-wcard .r::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.af-wcard.few .r { color: #7a5a00; }
.af-wcard.few .r::before { background: #e0a800; }
.af-wcard.full { background: #f3f4f6; border-color: #e3e6ee; color: var(--ink3); cursor: not-allowed; }
.af-wcard.full .r { color: var(--ink3); }
.af-wcard.full .r::before { background: var(--err); opacity: .6; }
.af-wcard.full.waitok { cursor: pointer; background: #fff; border-color: #e0a800; color: var(--ink2); }
.af-wcard:not(.full):hover { border-color: var(--brand); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.af-wcard.sel, .af-wcard.sel:hover { background: var(--brand); color: #fff; border-color: var(--brand-d); box-shadow: none; }
.af-wcard.sel .r { color: #fff; }
.af-wcard.sel .r::before { background: #fff; }
.af-wcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* 週表示の幅に応じた切り替え（container query。未対応の古いブラウザは上の基本の大きさのまま）。1 日ビュー（.af-day-grid）は対象にしない。
   カードの中身はカード 1 枚の幅で決める（同じ時刻に枠が重なって列を分け合うカードも、その幅に合わせる） */
.af-week-grid .af-wcol, .af-week-grid .af-wallday { container: wcol / inline-size; }
.af-week-grid .af-wcard { container: wcard / inline-size; }
.af-week-grid .af-wd-head { container: whead / inline-size; }
/* 列が 50px 未満（スマホの週表示）: 列とカードの隙間を詰める */
@container wcol (max-width: 49.98px) {
  .af-week-grid .af-wcard { --wcin: 1px; border-radius: 4px; }
}
/* カードが 46px 未満: 時間帯は開始時刻だけ（終了はカードの高さで分かり、押すとモーダルに全文）。残りは文字を省いて点だけ（色は凡例どおり） */
@container wcard (max-width: 45.98px) {
  .af-week-grid .af-wcard .in { padding: 2px 2px 9px; font-size: 9.5px; line-height: 1.15; }
  .af-week-grid .af-wcard .e { display: none; }
  .af-week-grid .af-wcard .r { font-size: 0; gap: 0; right: 3px; bottom: 3px; }
}
/* さらに狭い（幅 320px の端末の週表示など）: 開始時刻が収まる大きさまで下げる。重なった枠で列を分け合い 24px 未満になったカードは、
   切れた数字を見せないよう文字を出さない（位置と高さで時間が分かり、押すとモーダルに全文） */
@container wcard (max-width: 32.98px) {
  .af-week-grid .af-wcard .in { padding: 2px 1px 9px; font-size: 8.5px; }
}
@container wcard (max-width: 23.98px) {
  .af-week-grid .af-wcard .in { visibility: hidden; }
}
/* カードが広いとき（横並びの表示で日数が少ない）: 文字を大きく。190px 以上は 1 日ビューと同じ大きさ */
@container wcard (min-width: 100px) {
  .af-week-grid .af-wcard .in { font-size: 12.5px; line-height: 1.3; padding: 4px 7px 16px; }
  .af-week-grid .af-wcard .t { font-size: 13px; }
  .af-week-grid .af-wcard .r { font-size: 11px; right: 6px; bottom: 4px; gap: 4px; }
}
@container wcard (min-width: 190px) {
  .af-week-grid .af-wcard .in { font-size: 14px; padding: 6px 10px 18px; }
  .af-week-grid .af-wcard .t { font-size: 15px; }
  .af-week-grid .af-wcard .r { font-size: 12px; right: 8px; bottom: 5px; }
  .af-week-grid .af-wcard .r::before { width: 6px; height: 6px; }
}
/* 日付の見出し: 狭い列では小さく、広い列では大きく */
@container whead (max-width: 49.98px) {
  .af-week-grid .af-wd-head .w { font-size: 10px; }
  .af-week-grid .af-wd-head .n { font-size: 13px; min-width: 22px; line-height: 22px; padding: 0 1px; }
}
@container whead (min-width: 110px) {
  .af-week-grid .af-wd-head .w { font-size: 12px; }
}
@container whead (min-width: 200px) {
  .af-week-grid .af-wd-head .w { font-size: 12.5px; }
  .af-week-grid .af-wd-head .n { font-size: 17px; }
}
/* スマホ: 枠の内側の余白と時刻の目盛りの幅を詰めて、7 列に幅を回す */
@media (max-width: 480px) {
  .af-week { padding: 8px 4px 6px; }
  .af-week-grid { --wgut: 32px; }
  .af-week .af-wgut { font-size: 10px; padding-right: 3px; }
  .af-week .af-wgut-body span { right: 2px; padding: 0 1px; }
}
/* 横並びの表示（選べる日が 7 日以下）: 前週／次週が無いので見出しを中央に */
.af-week.is-strip .af-cal-head { justify-content: center; min-height: 32px; }
/* 終日の枠だけ（時刻の目盛りなし）のときは、カードを押しやすい高さに */
.af-week-grid.no-time .af-wallday { border-bottom: 0; padding: 4px 3px; gap: 4px; }
.af-week-grid.no-time .af-wallday .af-wcard { min-height: 56px; }

/* ---- 1 日ビュー（月の日付を押すと開く。週表示の 1 列版・通常の文字サイズ） ---- */
.af-day { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; background: #fff; }
.af-day-grid { --hour: 80px; display: grid; grid-template-columns: 44px minmax(0, 1fr); font-size: 12px; padding-bottom: 8px; }
.af-day-grid .af-wallday { min-height: 44px; padding: 4px; border-bottom: 0; }
.af-day-grid .af-wgut-allday { border-bottom: 0; }
.af-day-grid .af-wcorner { display: none; }
.af-dcard { font-size: 14px; line-height: 1.3; border-radius: 8px; }
.af-dcard .in { padding: 6px 10px 16px; }
.af-dcard .t { font-size: 15px; }
.af-dcard .nm { font-size: 14px; }
.af-dcard .r { right: 8px; bottom: 5px; font-size: 12px; gap: 4px; }
.af-dcard .r::before { width: 6px; height: 6px; }
.af-day-back {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 8px; border: 0; background: transparent;
  color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; border-radius: 8px;
}
.af-day-back .af-chev { width: 8px; height: 8px; border-color: var(--brand); }
.af-day-back:hover { background: var(--brand-bg); }
.af-day-back:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- コース予約（docs/13）: コース一覧 → そのコースの枠 ---- */
.af-course { display: flex; flex-direction: column; gap: 10px; }
.af-course-step { font-size: 12.5px; font-weight: 700; color: var(--ink2); letter-spacing: .02em; }
.af-course-list { display: flex; flex-direction: column; gap: 8px; }
.af-course-card .af-course-prices { display: block; font-size: 12.5px; color: var(--ink2); margin-top: 3px; }
.af-course-slots { display: flex; flex-direction: column; gap: 10px; }
.af-price-note { font-size: 13px; color: var(--ink2); background: var(--bg); border-radius: 8px; padding: 6px 10px; }
/* 区分ごとの人数（カード内は隠し欄。モーダルに区分の行） */
.af-qty-party { display: flex; flex-direction: column; gap: 4px; }
.af-qty-row { display: inline-flex; align-items: center; gap: 6px; }
.af-qmodal-party { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.af-qmodal-prow { display: grid; grid-template-columns: minmax(0, 1fr) 46px 60px 46px auto; align-items: center; gap: 8px; }
.af-qmodal-prow .af-qty-label { font-size: 14px; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-qmodal-prow .af-qty-btn { width: 46px; height: 46px; font-size: 22px; }
.af-qmodal-prow .af-qty-val { width: 60px; min-height: 46px; font-size: 20px; font-weight: 700; }
.af-qmodal-ptotal { text-align: right; font-size: 13.5px; color: var(--ink2); padding-top: 4px; border-top: 1px solid var(--line); }
.af-qmodal-ptotal b { font-size: 18px; color: var(--ink); margin: 0 2px; }
.af-qmodal-ok:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 人数入力のモーダル（枠を押したら開く。スマホは下から、広い画面は中央。docs/12 §13） ---- */
.af-qmodal {
  position: fixed; inset: 0; z-index: 70; background: rgba(20, 24, 30, .45); display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .2s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.af-qmodal.is-open { opacity: 1; }
.af-qmodal[hidden] { display: none; }
.af-qmodal-box {
  background: #fff; border-radius: 18px; padding: 18px 16px 16px; width: 100%; max-width: 420px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); box-sizing: border-box;
  opacity: 0; transform: translateY(40px);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.af-qmodal.is-open .af-qmodal-box { opacity: 1; transform: none; }
@media (min-width: 600px) {
  .af-qmodal { align-items: center; }
  .af-qmodal-box { transform: translateY(14px) scale(.97); }
}
.af-qmodal-qty .af-qty-val.is-bump { animation: af-bump .18s ease-out; }
@keyframes af-bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .af-qmodal, .af-qmodal-box { transition: none; }
  .af-qmodal-qty .af-qty-val.is-bump { animation: none; }
}
.af-qmodal-date { font-size: 13px; color: var(--ink2); font-weight: 700; }
.af-qmodal-title { font-size: 19px; font-weight: 800; margin-top: 2px; color: var(--ink); line-height: 1.35; }
.af-qmodal-sub { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.af-qmodal-qty { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0; }
.af-qmodal-qty[hidden] { display: none; }
.af-qmodal-actions { margin-top: 16px; }
.af-qmodal-ok[hidden] { display: none; }
.af-qmodal-qty .af-qty-btn { width: 46px; height: 46px; font-size: 22px; }
.af-qmodal-qty .af-qty-val { width: 60px; min-height: 46px; font-size: 20px; font-weight: 700; }
.af-qmodal-actions { display: flex; flex-direction: column; gap: 8px; }
.af-qmodal-ok { width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.af-qmodal-ok:active { background: var(--brand-d); }
.af-qmodal-ok:focus-visible, .af-qmodal .af-btn-sub:focus-visible, .af-qmodal .af-btn-danger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.af-qmodal .af-btn-sub, .af-qmodal .af-btn-danger { padding: 11px; font-size: 14px; }
