/* ===== ネット予約（/reserve）専用 ===== */
.rsv-page {
    --rsv-sat: #2a64b0;
    --rsv-sun: #d42a55;
    --rsv-line: #cfd6dc;
    --rsv-gray: #dcdfe3;
    --rsv-pale: #f1f3f5;
}
.rsv-page [hidden] { display: none !important; }
.rsv-page .section-title { margin-bottom: 32px; }
.rsv-sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.rsv-wrap { max-width: 780px; margin: 0 auto; }
.rsv-page :focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 2px; }
.rsv-screen-title:focus { outline: none; }

/* ----- 手順表示 ----- */
.rsv-steps {
    list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
    max-width: 620px; margin: 0 auto 28px;
}
.rsv-step {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 0 4px; text-align: center; font-size: 0.8rem; line-height: 1.4; color: var(--text-light);
    word-break: keep-all;
}
.rsv-step::before {
    content: ''; position: absolute; top: 15px; left: calc(-50% + 20px); right: calc(50% + 20px);
    height: 2px; background: var(--border);
}
.rsv-step:first-child::before { display: none; }
.rsv-step-num {
    position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: white; border: 2px solid var(--border); font-weight: 700; color: var(--text-light);
}
.rsv-step.is-done::before, .rsv-step.is-current::before { background: var(--primary); }
.rsv-step.is-done .rsv-step-num { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
.rsv-step.is-current { color: var(--text); font-weight: 700; }
.rsv-step.is-current .rsv-step-num {
    background: var(--primary); border-color: var(--primary); color: white;
    box-shadow: 0 0 0 4px rgba(91,164,164,0.2);
}

/* ----- 共通パーツ ----- */
.rsv-screen-title { font-size: 1.2rem; font-weight: 700; text-align: center; margin-bottom: 20px; }
.rsv-card {
    background: white; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 28px 32px; margin-bottom: 20px;
}
.rsv-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.05rem; font-weight: 700; margin-bottom: 14px;
}
.rsv-card-title i { color: var(--primary); }
.rsv-lead { margin-bottom: 20px; font-size: 0.95rem; }

.rsv-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; margin-bottom: 20px; border-radius: var(--radius-sm);
    font-size: 0.9rem; line-height: 1.7;
}
.rsv-alert > i { margin-top: 0.3em; }
.rsv-alert a { color: inherit; font-weight: 700; text-decoration: underline; }
.rsv-alert-error { background: #f8d7da; color: #721c24; }
.rsv-alert-info { background: var(--primary-light); color: #2f6363; }
.rsv-alert-warn { background: #fff3cd; color: #664d03; }

.rsv-link-btn {
    margin-top: 8px; padding: 6px 14px; border: 1px solid currentColor; border-radius: 999px;
    background: white; color: inherit; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}

.rsv-boot {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 48px 0; color: var(--text-light);
}
.rsv-spinner {
    display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--primary-light); border-top-color: var(--primary);
    animation: rsv-spin 0.8s linear infinite;
}
.rsv-spinner-light { border-color: rgba(255,255,255,0.45); border-top-color: white; }
@keyframes rsv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rsv-spinner { animation-duration: 2.4s; } }

/* ボタン（style.css の .btn をもとに） */
.rsv-page .btn-primary:disabled {
    background: #b9c5ca; box-shadow: none; cursor: not-allowed; transform: none;
}
.rsv-actions { display: flex; gap: 12px; margin-top: 8px; }
.rsv-actions .btn { flex: 1 1 0; padding-left: 16px; padding-right: 16px; }
.rsv-actions .btn-primary { flex-grow: 2; }
.rsv-btn-back {
    background: white; color: var(--text); border: 1px solid var(--border);
}
.rsv-btn-back:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- 画面1：人数・アルコール ----- */
.rsv-field { display: grid; grid-template-columns: 140px 1fr; gap: 8px 20px; }
.rsv-field + .rsv-field { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.rsv-field-label {
    display: flex; align-items: center; gap: 8px; align-self: start;
    min-height: 44px; font-weight: 700;
}
.rsv-field-label i { color: var(--primary); width: 18px; text-align: center; }
.rsv-people { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.rsv-people-item { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.rsv-select {
    min-width: 84px; height: 44px; padding: 0 36px 0 14px;
    border: 1px solid var(--rsv-line); border-radius: var(--radius-sm);
    font: inherit; font-size: 1rem; font-weight: 700; color: var(--text); background-color: white;
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-light) 50%), linear-gradient(135deg, var(--text-light) 50%, transparent 50%);
    background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
    background-size: 5px 5px; background-repeat: no-repeat;
}
.rsv-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,164,164,0.2); }
.rsv-select:disabled { background-color: var(--rsv-pale); color: var(--text-light); cursor: not-allowed; }
.rsv-notes {
    list-style: none; margin-top: 12px; font-size: 0.8rem; color: var(--text-light); line-height: 1.7;
}
.rsv-notes li { position: relative; padding-left: 1em; }
.rsv-notes li::before { content: '・'; position: absolute; left: 0; }

.rsv-alcohol { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rsv-alcohol-q { font-weight: 500; margin-right: 6px; }
.rsv-toggle {
    min-width: 96px; height: 44px; padding: 0 20px;
    border: 1px solid var(--rsv-line); border-radius: 999px; background: white;
    font: inherit; font-weight: 700; color: var(--text); cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.rsv-toggle[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: white; }
.rsv-alcohol-note {
    display: flex; align-items: flex-start; gap: 8px; margin-top: 10px;
    font-size: 0.82rem; color: #7a5c1e; background: var(--accent-light);
    padding: 8px 12px; border-radius: var(--radius-sm);
}
.rsv-alcohol-note i { margin-top: 0.35em; }

/* ----- 画面1：週間空き状況表 ----- */
.rsv-grid-card { padding: 24px 20px 28px; }
.rsv-grid-card > .rsv-card-title { max-width: 720px; margin-left: auto; margin-right: auto; }
.rsv-week-nav {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
    max-width: 720px; margin: 0 auto 12px; padding-bottom: 12px;
    border-bottom: 1px solid #b9c2c9;
}
.rsv-week-btn {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 6px 4px;
    background: none; border: none; font: inherit; font-size: 0.85rem; color: var(--text-light); cursor: pointer;
}
.rsv-week-btn i { font-size: 0.9em; }
.rsv-week-prev { justify-self: start; }
.rsv-week-next { justify-self: end; }
.rsv-week-btn:disabled { opacity: 0.35; cursor: default; }
.rsv-week-center { text-align: center; }
.rsv-week-title {
    font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rsv-today-btn {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 2px 6px;
    background: none; border: none; font: inherit; font-size: 0.75rem; color: var(--text); cursor: pointer;
}
.rsv-today-btn i { font-size: 0.85em; }
.rsv-today-btn:disabled { color: var(--text-light); opacity: 0.6; cursor: default; }

.rsv-minor-note { max-width: 720px; margin: 0 auto 10px; font-size: 0.82rem; justify-content: center; }

.rsv-grid-wrap { position: relative; max-width: 720px; margin: 0 auto; }
.rsv-grid-wrap.is-empty { min-height: 260px; }
.rsv-grid-wrap.is-loading .rsv-grid { opacity: 0.4; pointer-events: none; }
.rsv-grid {
    width: 100%; table-layout: fixed;
    border-collapse: separate; border-spacing: 4px;
}
.rsv-col-time { width: 58px; }
.rsv-grid th, .rsv-grid td { padding: 0; }
.rsv-day { padding: 2px 0 6px !important; text-align: center; vertical-align: bottom; line-height: 1.15; }
.rsv-day-num { display: block; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rsv-day-dow { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 500; white-space: nowrap; }
.rsv-day.is-sat { color: var(--rsv-sat); }
.rsv-day.is-sun { color: var(--rsv-sun); }
.rsv-day.is-off { opacity: 0.4; }
.rsv-day.is-today .rsv-day-num { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; text-decoration-color: var(--primary); }
.rsv-time {
    padding-right: 8px !important; text-align: right; white-space: nowrap;
    font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.rsv-cell {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 30px; border-radius: 4px;
    font-size: 0.95rem; line-height: 1; color: #6b737b;
}
.rsv-cell.is-blank { background: var(--rsv-pale); }
.rsv-cell.is-open { background: white; border: 1px solid var(--rsv-line); }
.rsv-cell.is-full, .rsv-cell.is-minor { background: var(--rsv-gray); }
.rsv-cell.is-lockout {
    background: var(--accent-light); color: #7a5c1e; border: 1px solid #e3d3b1;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap;
}
.rsv-cell.is-ok {
    padding: 0; border: 1px solid var(--rsv-line); background: white;
    font: inherit; cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.rsv-mark-ok { width: 14px; height: 14px; border: 2px solid var(--primary); border-radius: 50%; }
button.rsv-cell.is-ok:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 1px; position: relative; z-index: 1; }
/* 選択中の利用時間の枠。途中の×や空白の枠も含めて塗り、記号は出さない */
.rsv-cell.is-selected { background: var(--primary); border-color: var(--primary-dark); cursor: pointer; }
.rsv-cell.is-selected .rsv-mark-ok { border-color: white; }
.rsv-cell.is-full.is-selected > [aria-hidden="true"] { visibility: hidden; }

/* 当日の列: 縦書きで「お電話で」。上下2等分し、文言は上半分の下端・電話番号は下半分の上端に置く
   （文言と電話番号の間がちょうど上下中央になる） */
.rsv-grid td.rsv-today {
    position: relative; padding: 0 !important; text-align: center;
    background: #eef6f6; border: 1px solid #cfe5e5; border-radius: 4px;
}
.rsv-today-inner {
    position: absolute; inset: 0; padding: 12px 0;
    display: grid; grid-template-rows: 1fr 1fr; row-gap: 14px; justify-items: center;
}
.rsv-today-inner > .rsv-today-text { align-self: end; }
.rsv-today-inner > .rsv-today-tel { align-self: start; }
.rsv-today-text {
    display: inline-block; writing-mode: vertical-rl; text-orientation: upright;
    font-size: 0.95rem; font-weight: 700; letter-spacing: 0.2em; line-height: 1.3; color: var(--primary-dark);
}
.rsv-today-tel {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 2px; width: 90%; border-radius: 6px;
    background: white; color: var(--primary-dark); font-weight: 700; line-height: 1.2;
    font-size: 0.8rem; font-variant-numeric: tabular-nums;
}
.rsv-today-tel i { margin-bottom: 4px; font-size: 0.9rem; }
.rsv-today-num { display: block; }

/* 表の上に重ねる案内・読み込み中・エラー */
.rsv-grid-prompt {
    /* 当日の列の「お電話で」と電話番号（表の上下中央）に重ならないよう、表の下寄りに置く */
    position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%);
    width: min(88%, 340px); padding: 16px 18px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: white; color: var(--primary-dark); border: 2px solid var(--primary);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    font: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1.6; cursor: pointer;
}
.rsv-grid-prompt i { font-size: 1.3rem; color: var(--primary); }
.rsv-grid-loading {
    position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
    padding: 10px 20px; background: white; border-radius: 999px; box-shadow: var(--shadow-lg);
    font-size: 0.88rem; font-weight: 500;
}
.rsv-grid-error {
    padding: 40px 16px; text-align: center; color: #721c24;
    background: #fbeaec; border-radius: var(--radius-sm);
}

.rsv-legend {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
    max-width: 720px; margin: 16px auto 0; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text-light);
}
.rsv-legend li { display: flex; align-items: center; gap: 6px; }
.rsv-legend .rsv-cell { flex: none; width: 36px; height: 24px; }

/* ----- まとめ ----- */
.rsv-next-card { scroll-margin-bottom: 16px; }
.rsv-summary { display: grid; gap: 6px; margin-bottom: 14px; }
.rsv-summary > div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; font-size: 0.95rem; }
.rsv-summary dt { color: var(--text-light); font-size: 0.85rem; padding-top: 0.1em; }
.rsv-summary dd { font-weight: 700; }
.rsv-summary .is-empty dd { font-weight: 400; color: #9aa6b2; }
.rsv-summary-box {
    padding: 14px 18px; margin-bottom: 24px; border-left: 4px solid var(--primary);
    background: var(--bg-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rsv-summary-box > div { font-size: 0.9rem; }
.rsv-missing { margin-bottom: 10px; font-size: 0.82rem; color: var(--text-light); }
.rsv-missing:empty { display: none; }

/* ----- 画面2 ----- */
.rsv-field-error { margin-top: 6px; font-size: 0.82rem; color: #b02a37; }
.rsv-page .form-group input[aria-invalid="true"] { border-color: #dc3545; }
.rsv-page .form-group input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.15); }

/* ----- 画面3・4：内容表 ----- */
.rsv-confirm-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; border-top: 1px solid var(--border); }
.rsv-confirm-table th, .rsv-confirm-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    text-align: left; vertical-align: top; font-size: 0.95rem;
}
.rsv-confirm-table th {
    width: 32%; background: var(--bg-alt); color: var(--text-light); font-weight: 500; font-size: 0.85rem;
}
.rsv-confirm-table td { font-weight: 500; overflow-wrap: anywhere; }

.rsv-policy {
    padding: 18px 20px; margin-bottom: 20px;
    background: var(--accent-light); border: 1px solid #e3d3b1; border-radius: var(--radius-sm);
}
.rsv-policy-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; color: #7a5c1e; }
.rsv-policy ul { padding-left: 1.3em; font-size: 0.88rem; line-height: 1.8; }
.rsv-policy li + li { margin-top: 4px; }
.rsv-policy a { overflow-wrap: anywhere; }
.rsv-deadline { margin-top: 10px; font-size: 0.85rem; font-weight: 700; color: #7a5c1e; }
.rsv-agree {
    display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px;
    background: white; border: 1px solid #e3d3b1; border-radius: var(--radius-sm);
    font-weight: 700; cursor: pointer;
}
.rsv-agree input { flex: none; width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.rsv-agree:has(input:disabled) { opacity: 0.6; cursor: default; }

.rsv-page .form-result { margin: 0 0 16px; }
#rsvSubmit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
#rsvSubmit.is-sending:disabled { background: var(--primary-dark); cursor: progress; }

/* ----- 画面4 ----- */
.rsv-done { text-align: center; }
.rsv-done-lead {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 20px; font-size: 1.3rem; font-weight: 700; color: var(--primary-dark);
}
.rsv-done-lead i { font-size: 1.6rem; }
.rsv-code-box {
    max-width: 420px; margin: 0 auto 20px; padding: 18px 16px;
    background: var(--primary-light); border-radius: var(--radius);
}
.rsv-code-label { font-size: 0.85rem; font-weight: 700; color: var(--primary-dark); }
.rsv-code {
    margin: 4px 0 8px; font-family: Consolas, 'SFMono-Regular', Menlo, 'Roboto Mono', monospace;
    font-size: 2.1rem; font-weight: 700; letter-spacing: 0.16em; line-height: 1.3;
    color: var(--text); user-select: all; overflow-wrap: anywhere;
}
.rsv-copy {
    padding: 6px 16px; border: 1px solid var(--primary); border-radius: 999px;
    background: white; color: var(--primary-dark); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.rsv-copy-status { min-height: 1.4em; margin-top: 4px; font-size: 0.8rem; color: var(--primary-dark); }
.rsv-mail-msg { margin-bottom: 20px; font-size: 0.92rem; overflow-wrap: anywhere; }
.rsv-done .rsv-alert { text-align: left; }
.rsv-done .rsv-confirm-table { max-width: 520px; margin-left: auto; margin-right: auto; }
.rsv-keep {
    display: flex; align-items: flex-start; justify-content: center; gap: 8px;
    margin-bottom: 24px; font-size: 0.85rem; color: var(--text-light); text-align: left;
}
.rsv-keep i { margin-top: 0.35em; color: var(--accent-dark); }
.rsv-btn-home { width: auto; min-width: 240px; }
.rsv-btn-home:hover { color: white; }

/* ----- ホバー（マウス操作の端末のみ。タップ後に色が残らないように） ----- */
@media (hover: hover) {
    .rsv-link-btn:hover { background: rgba(255,255,255,0.7); }
    .rsv-btn-back:not(:disabled):hover { background: var(--bg-alt); border-color: var(--primary); }
    .rsv-toggle:not([aria-pressed="true"]):hover { border-color: var(--primary); background: #f0f8f8; }
    .rsv-week-btn:hover:not(:disabled) { color: var(--primary-dark); }
    .rsv-today-btn:hover:not(:disabled) { color: var(--primary-dark); }
    button.rsv-cell.is-ok:not(.is-selected):hover { border-color: var(--primary); background: #eaf5f5; }
    .rsv-today-tel:hover { background: var(--primary); color: white; }
    .rsv-grid-prompt:hover { background: #f0f8f8; }
    .rsv-copy:hover { background: var(--primary); color: white; }
}

/* ----- スマホ ----- */
@media (max-width: 600px) {
    /* style.css の .section（60px）が .page-section のヘッダー分の余白を打ち消すため戻す */
    .rsv-page.page-section { padding-top: calc(var(--header-h) + 32px); }
    .rsv-page .container { padding: 0 12px; }
    .rsv-page .section-title { margin-bottom: 24px; }
    .rsv-steps { margin-bottom: 22px; }
    .rsv-step { font-size: 0.66rem; padding: 0 2px; }
    .rsv-step-num { width: 28px; height: 28px; font-size: 0.85rem; }
    .rsv-step::before { top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); }
    .rsv-screen-title { font-size: 1.1rem; margin-bottom: 16px; }
    .rsv-card { padding: 20px 16px; }
    .rsv-field { grid-template-columns: 1fr; gap: 8px; }
    .rsv-field-label { min-height: 0; }
    .rsv-people { gap: 10px 16px; }
    .rsv-select { min-width: 76px; }
    .rsv-toggle { min-width: 84px; }

    .rsv-grid-card { padding: 18px 6px 20px; }
    .rsv-grid-card > .rsv-card-title { padding: 0 8px; }
    .rsv-week-nav { margin: 0 6px 10px; }
    .rsv-week-btn { font-size: 0.78rem; }
    .rsv-week-title { font-size: 1.35rem; }
    .rsv-minor-note { margin-left: 6px; margin-right: 6px; }
    .rsv-grid { border-spacing: 2px 3px; }
    .rsv-col-time { width: 38px; }
    .rsv-time { padding-right: 3px !important; font-size: 0.7rem; }
    .rsv-day-num { font-size: 1.05rem; }
    .rsv-day-dow { font-size: 0.6rem; }
    .rsv-cell { height: 30px; }
    .rsv-mark-ok { width: 13px; height: 13px; }
    .rsv-cell.is-lockout { font-size: 0.58rem; letter-spacing: 0; }
    .rsv-today-text { font-size: 0.8rem; letter-spacing: 0.12em; }
    .rsv-today-tel { width: 94%; padding: 6px 0; font-size: 0.62rem; }
    .rsv-today-tel i { font-size: 0.75rem; }
    .rsv-grid-prompt { bottom: 36px; font-size: 0.88rem; }
    .rsv-grid-loading { top: 80px; }
    .rsv-legend { gap: 6px 14px; margin-left: 6px; margin-right: 6px; font-size: 0.75rem; }

    .rsv-summary > div { grid-template-columns: 5.5em 1fr; gap: 8px; font-size: 0.9rem; }

    .rsv-confirm-table th, .rsv-confirm-table td { padding: 10px; font-size: 0.88rem; }
    .rsv-confirm-table th { width: 34%; font-size: 0.78rem; }
    .rsv-policy { padding: 14px 14px; }
    .rsv-actions .btn { padding: 14px 10px; font-size: 0.95rem; }
    .rsv-code { font-size: 1.7rem; letter-spacing: 0.1em; }
    .rsv-btn-home { width: 100%; min-width: 0; }
}
