/* WEB予約 画面 */
.rs-body { background: var(--c-bg); }
.rs-main { padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 6vw, 80px); }
.rs-wrap { max-width: 860px; }
.rs-head { text-align: center; margin-bottom: 24px; }
.rs-head .en { font-family: var(--font-display); letter-spacing: .3em; font-size: .78rem; color: var(--c-primary); }
.rs-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rs-24 { font-size: .85rem; background: var(--c-accent); color: #fff; padding: 4px 12px; border-radius: 99px; letter-spacing: .1em; }
.rs-head p { color: var(--c-ink-soft); margin-top: 10px; font-size: .95rem; }
.rs-head p a { color: var(--c-primary-strong); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pc-only { display: inline; }
@media (max-width: 640px) { .pc-only { display: none; } }

.stepper { display: flex; justify-content: space-between; margin: 0 auto 20px; max-width: 560px; position: relative; counter-reset: s; }
.stepper::before { content: ""; position: absolute; left: 10%; right: 10%; top: 16px; height: 2px; background: var(--c-line); z-index: 0; }
.stepper li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-display); font-size: .78rem; color: var(--c-ink-faint); font-weight: 700; flex: 1; }
.stepper li span { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--c-line); display: grid; place-items: center; font-size: .9rem; transition: all .3s; }
.stepper li.is-current { color: var(--c-primary-strong); }
.stepper li.is-current span { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 0 0 5px var(--c-primary-soft); }
.stepper li.is-done { color: var(--c-primary-strong); }
.stepper li.is-done span { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary-strong); }

.rs-card { background: var(--c-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: clamp(20px, 4vw, 40px); }
.rs-step__title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin-bottom: 18px; }
.rs-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--c-primary-strong); font-family: var(--font-display); font-weight: 700; font-size: .9rem; padding: 4px 0; margin-bottom: 10px; }
.rs-back svg { width: 16px; height: 16px; }
.rs-back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* カレンダー */
.cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal__nav strong { font-family: var(--font-display); font-size: 1.2rem; }
.cal__btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--c-line); background: #fff; color: var(--c-primary-strong); display: grid; place-items: center; }
.cal__btn svg { width: 20px; height: 20px; }
.cal__btn:disabled { opacity: .3; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__dow { text-align: center; font-family: var(--font-display); font-size: .8rem; color: var(--c-ink-faint); padding: 6px 0; }
.cal__dow.sat { color: var(--c-primary-strong); } .cal__dow.sun { color: #d9603a; }
.cal__day { aspect-ratio: 1 / .95; border-radius: 12px; border: 2px solid transparent; background: var(--c-bg-alt); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--font-display); font-weight: 700; cursor: pointer; transition: all .15s; padding: 0; color: var(--c-ink); }
.cal__day .d { font-size: 1rem; line-height: 1; }
.cal__day .m { font-size: .95rem; line-height: 1; }
.cal__day.is-empty { background: transparent; cursor: default; }
.cal__day.out, .cal__day.closed, .cal__day.full { cursor: default; color: var(--c-ink-faint); background: #f6f6f3; }
.cal__day.closed .m { color: #d9603a; font-size: .72rem; }
.cal__day.full .m { color: var(--c-ink-faint); }
.cal__day.open .m { color: var(--c-primary); }
.cal__day.few .m { color: var(--c-accent-strong); }
.cal__day.open, .cal__day.few { background: #fff; border-color: var(--c-line); }
.cal__day.open:hover, .cal__day.few:hover { border-color: var(--c-primary); background: var(--c-primary-tint); transform: translateY(-1px); }
.cal__day.is-today { box-shadow: inset 0 0 0 2px var(--c-accent-soft); }
.cal__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .82rem; color: var(--c-ink-soft); }
.cal__legend .lg { font-family: var(--font-display); margin-right: 4px; }
.lg-open { color: var(--c-primary); } .lg-few { color: var(--c-accent-strong); } .lg-full { color: var(--c-ink-faint); } .lg-closed { color: #d9603a; }

/* 時間枠 */
.slots__group { margin-bottom: 18px; }
.slots__label { font-family: var(--font-display); font-weight: 700; color: var(--c-primary-strong); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.slots__label::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c-accent); }
.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slot { padding: 12px 6px; border-radius: 12px; border: 2px solid var(--c-line); background: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all .15s; color: var(--c-ink); }
.slot small { font-size: .7rem; font-weight: 500; color: var(--c-ink-faint); }
.slot.open small { color: var(--c-primary); }
.slot.few small { color: var(--c-accent-strong); }
.slot:hover:not(:disabled) { border-color: var(--c-primary); background: var(--c-primary-tint); }
.slot:disabled { background: #f6f6f3; color: var(--c-ink-faint); cursor: default; border-color: transparent; }
.slots__empty { padding: 24px; text-align: center; color: var(--c-ink-soft); background: var(--c-bg-alt); border-radius: 12px; }

.rs-picked { display: inline-flex; align-items: center; gap: 10px; background: var(--c-primary-tint); border: 1px solid var(--c-primary-soft); color: var(--c-primary-strong); font-family: var(--font-display); font-weight: 700; padding: 10px 18px; border-radius: 99px; margin-bottom: 20px; }
.rs-picked::before { content: "📅"; }

.field__label { display: block; font-family: var(--font-display); font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.field__hint { display: block; font-size: .8rem; color: var(--c-ink-faint); margin-top: 4px; }
.field.is-error input, .field.is-error select { border-color: #d64545; }
.field__err { display: block; color: #b3261e; font-size: .82rem; margin-top: 4px; font-weight: 500; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; }
.radio span { display: inline-block; padding: 10px 18px; border-radius: 99px; border: 2px solid var(--c-line); background: #fff; font-weight: 500; cursor: pointer; transition: all .15s; }
.radio input:checked + span { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary-strong); font-weight: 700; }
.radio input:focus-visible + span { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.rs-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.confirm { display: grid; grid-template-columns: 9em 1fr; gap: 0; margin: 0; border: 1px solid var(--c-line); border-radius: var(--radius-md); overflow: hidden; }
.confirm dt, .confirm dd { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--c-line); }
.confirm dt { background: var(--c-bg-alt); font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.confirm dd { white-space: pre-wrap; word-break: break-all; }
.confirm dd.hl { font-family: var(--font-display); font-weight: 700; color: var(--c-primary-strong); font-size: 1.05rem; }
.confirm dt:nth-last-child(2), .confirm dd:last-child { border-bottom: 0; }
@media (max-width: 520px) { .confirm { grid-template-columns: 1fr; } .confirm dt { border-bottom: 0; padding-bottom: 4px; } }

.rs-done { text-align: center; }
.rs-done__ic { width: 72px; height: 72px; margin: 0 auto 12px; color: var(--c-primary); }
.rs-done__ic svg { width: 100%; height: 100%; }
.rs-done__code { font-size: 1.05rem; color: var(--c-ink-soft); }
.rs-done__code strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--c-primary-strong); letter-spacing: .08em; margin-left: 6px; }
.rs-done__when { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin-top: 6px; }
.rs-done__mail { color: var(--c-ink-soft); font-size: .9rem; margin-top: 8px; }
.rs-done__notes { text-align: left; background: var(--c-primary-tint); border: 1px solid var(--c-primary-soft); border-radius: var(--radius-md); padding: 18px 22px; margin-top: 24px; }
.rs-done__notes h3 { font-size: 1rem; color: var(--c-primary-strong); margin-bottom: 8px; }
.rs-done__notes li { font-size: .92rem; color: var(--c-ink-soft); display: flex; gap: 8px; }
.rs-done__notes li::before { content: "・"; color: var(--c-primary); }

.rs-note { font-size: .82rem; color: var(--c-ink-faint); margin-top: 20px; line-height: 1.8; }
.rs-footer { padding-top: 24px; font-size: .8rem; }
.rs-footer .footer__bottom { padding: 16px 0 24px; }
.btn.is-loading { opacity: .7; pointer-events: none; }

/* 管理画面 */
.mg-body { background: #f3f6f9; }
.mg-main { padding: 24px 0 64px; }
.mg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mg-top h1 { font-size: 1.3rem; }
.mg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.mg-tabs a { padding: 8px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--c-line); font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--c-ink-soft); }
.mg-tabs a.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.mg-card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); padding: 20px; margin-bottom: 16px; }
.mg-card h2 { font-size: 1.1rem; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mg-daynav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mg-daynav input[type=date] { font: inherit; padding: 8px 10px; border: 2px solid var(--c-line); border-radius: 8px; }
.mg-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mg-table th, .mg-table td { padding: 10px 8px; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.mg-table th { background: var(--c-bg-alt); font-family: var(--font-display); font-size: .8rem; color: var(--c-ink-soft); white-space: nowrap; }
.mg-table .t { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.mg-table tr.cancelled td { color: var(--c-ink-faint); text-decoration: line-through; }
.mg-table tr.cancelled td.act, .mg-table tr.cancelled td .st { text-decoration: none; }
.st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-confirmed { background: var(--c-primary-soft); color: var(--c-primary-strong); }
.st-done { background: #e8ecf5; color: #3b4f80; }
.st-cancelled { background: #f0f0ee; color: #777; }
.st-noshow { background: #fdecea; color: #b3261e; }
.src { font-size: .7rem; color: var(--c-ink-faint); margin-left: 4px; }
.mg-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.mg-actions button, .btn-xs { font: inherit; font-size: .78rem; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--c-line); background: #fff; cursor: pointer; white-space: nowrap; }
.mg-actions button:hover, .btn-xs:hover { background: var(--c-bg-alt); }
.mg-actions button.danger { color: #b3261e; }
.mg-empty { padding: 20px; text-align: center; color: var(--c-ink-faint); }
.mg-form { display: grid; gap: 12px; }
.mg-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.mg-form input, .mg-form select, .mg-form textarea { width: 100%; font: inherit; padding: 9px 12px; border: 2px solid var(--c-line); border-radius: 8px; }
.mg-form label { font-size: .8rem; font-weight: 700; color: var(--c-ink-soft); display: block; margin-bottom: 4px; }
.mg-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mg-month .c { background: var(--c-bg-alt); border-radius: 8px; padding: 8px 6px; min-height: 64px; font-size: .8rem; }
.mg-month .c.closed { background: #fdecea; color: #b3261e; }
.mg-month .c .n { font-family: var(--font-display); font-weight: 700; display: block; }
.mg-month .c .cnt { color: var(--c-primary-strong); font-weight: 700; }
.mg-month .c a { display: block; color: inherit; }
.mg-month .c.empty { background: transparent; }
.mg-login { max-width: 420px; margin: 60px auto; }
.mg-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--c-bg-alt); border-radius: 99px; padding: 6px 6px 6px 14px; font-size: .88rem; }
.mg-chip button { border: 0; background: #fff; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; color: #b3261e; font-weight: 700; }
.mg-flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.mg-flash.ok { background: var(--c-primary-soft); color: var(--c-primary-strong); }
.mg-flash.ng { background: #fdecea; color: #b3261e; }
.mg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mg-stat { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-soft); }
.mg-stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--c-primary-strong); line-height: 1.2; }
.mg-stat span { font-size: .78rem; color: var(--c-ink-faint); }
@media (max-width: 760px) { .mg-table { font-size: .82rem; } .mg-table th, .mg-table td { padding: 8px 6px; } }

/* --- 週間スケジュール ------------------------------------------------ */
.mg-today h2 { margin-bottom: 8px; }
.mg-today__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mg-today__item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; background: var(--c-primary-tint); border: 1px solid var(--c-primary-soft); border-radius: 12px; padding: 10px 14px; transition: background .15s; }
.mg-today__item:hover { background: var(--c-primary-soft); }
.mg-today__item b { font-family: var(--font-display); font-size: 1.1rem; color: var(--c-primary-strong); grid-row: span 2; }
.mg-today__item .n { font-weight: 700; font-size: .95rem; }
.mg-today__item .s { font-size: .8rem; color: var(--c-ink-soft); }
.mg-today__item i.first, .sch__ev i { font-style: normal; font-size: .65rem; background: var(--c-accent); color: #fff; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }

.sch-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; }
.sch { display: grid; grid-template-columns: 56px repeat(6, minmax(120px, 1fr)); grid-template-rows: auto var(--gridh); min-width: 820px; position: relative; }
.sch__corner, .sch__head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 2px solid var(--c-line); }
.sch__head { padding: 8px 6px; text-align: center; border-left: 1px solid var(--c-line); line-height: 1.3; }
.sch__head .dn { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; display: inline-block; width: 32px; height: 32px; line-height: 32px; border-radius: 50%; }
.sch__head .dw { font-size: .8rem; color: var(--c-ink-faint); margin-left: 2px; }
.sch__head .cnt, .sch__head .cl { display: block; font-size: .72rem; color: var(--c-ink-faint); }
.sch__head .cl { color: #b3261e; }
.sch__head.is-today .dn { background: var(--c-primary); color: #fff; }
.sch__head.is-closed { background: #faf7f7; }
.sch__times { position: relative; border-right: 1px solid var(--c-line); }
.sch__time { position: absolute; right: 6px; transform: translateY(-50%); font-size: .72rem; color: var(--c-ink-faint); font-family: var(--font-display); }
.sch__col { position: relative; border-left: 1px solid var(--c-line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--rowh) - 1px), var(--c-line) calc(var(--rowh) - 1px), var(--c-line) var(--rowh)); }
.sch__col.is-today { background-color: #f5f9fd; }
.sch__col.is-closed { background-color: #faf7f7; background-image: repeating-linear-gradient(135deg, transparent 0 8px, #f0e8e8 8px 10px); }
.sch__off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f3f3f1 0 8px, #ecece9 8px 10px); z-index: 0; }
.sch__blocked { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #fdecea 0 6px, #f8d7d3 6px 8px); z-index: 1; }
.sch__ev { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; border-radius: 8px; overflow: hidden; line-height: 1.25; background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); color: var(--c-ink); box-shadow: 0 1px 3px rgba(31,60,100,.12); transition: transform .12s, box-shadow .12s; }
.sch__ev:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,60,100,.18); z-index: 4; }
.sch__ev .t { font-family: var(--font-display); font-size: .7rem; color: var(--c-primary-strong); font-weight: 700; white-space: nowrap; }
.sch__ev .n { font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch__ev .s { font-size: .72rem; color: var(--c-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch__ev.st-done { background: #eef1f7; border-left-color: #8ea0c9; color: var(--c-ink-faint); }
.sch__ev.st-done .t { color: #5d6f99; }
.sch__ev.st-noshow { background: #fdecea; border-left-color: #d64545; }
.sch__ev.st-noshow .t { color: #b3261e; }
.sch__ev.is-first { border-left-color: var(--c-accent); }
.sch__now { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; z-index: 3; pointer-events: none; }
.sch__now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; }
.sch__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .78rem; color: var(--c-ink-soft); align-items: center; }
.sch__legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.sch__legend .lg.st-confirmed { background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); }
.sch__legend .lg.st-done { background: #eef1f7; border-left: 4px solid #8ea0c9; }
.sch__legend .lg.st-noshow { background: #fdecea; border-left: 4px solid #d64545; }
.sch__legend .lg-first { background: var(--c-primary-soft); border-left: 4px solid var(--c-accent); }
.sch__legend .lg-off { background: repeating-linear-gradient(135deg, #f3f3f1 0 4px, #ecece9 4px 6px); }
.sch__legend .lg-blocked { background: repeating-linear-gradient(135deg, #fdecea 0 4px, #f8d7d3 4px 6px); }

/* --- カレンダー共通 ---------------------------------------------------- */
.mg-container { max-width: 1320px; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-bar__nav { display: flex; align-items: center; gap: 6px; }
.cal-bar__title { font-family: var(--font-display); font-size: 1.15rem; margin-left: 8px; }
.cal-bar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-bar input[type=date] { font: inherit; padding: 7px 10px; border: 2px solid var(--c-line); border-radius: 8px; }
.seg { display: inline-flex; border: 2px solid var(--c-line); border-radius: 10px; overflow: hidden; }
.seg a { padding: 7px 16px; font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--c-ink-soft); background: #fff; }
.seg a + a { border-left: 2px solid var(--c-line); }
.seg a.is-active { background: var(--c-primary); color: #fff; }
.cal-hint { font-size: .8rem; color: var(--c-ink-faint); margin-top: 8px; }
.sch { grid-template-columns: 56px repeat(var(--cols, 6), minmax(120px, 1fr)); min-width: calc(56px + var(--cols, 6) * 120px); }
.sch__head a { color: inherit; }
.sch__head a:hover .dn { background: var(--c-primary-soft); }
.sch__col { cursor: cell; }
.sch__col:hover { background-color: #f8fbfe; }
.sch__ev { cursor: grab; user-select: none; touch-action: none; }
.sch__ev.is-drag { opacity: .85; box-shadow: 0 10px 24px rgba(31,60,100,.3); z-index: 10; cursor: grabbing; }
.sch__rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.sch__rz::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 24px; height: 3px; margin-left: -12px; border-radius: 2px; background: rgba(0,0,0,.15); opacity: 0; transition: opacity .15s; }
.sch__ev:hover .sch__rz::after { opacity: 1; }
.mg-today__item { text-align: left; border: 1px solid var(--c-primary-soft); font: inherit; cursor: pointer; }

/* --- 月カレンダー ------------------------------------------------------ */
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mcal__dow { text-align: center; font-size: .78rem; font-weight: 700; color: var(--c-ink-faint); padding: 4px 0; }
.mcal__dow.sat { color: var(--c-primary-strong); } .mcal__dow.sun { color: #d9603a; }
.mcal__cell { min-height: 118px; background: #fff; border: 1px solid var(--c-line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: cell; transition: background .15s; }
.mcal__cell:hover { background: #f8fbfe; }
.mcal__cell.is-empty { background: transparent; border-color: transparent; cursor: default; }
.mcal__cell.is-closed { background: #faf7f7; background-image: repeating-linear-gradient(135deg, transparent 0 8px, #f3ecec 8px 10px); }
.mcal__cell.is-today { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.mcal__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.mcal__top .d { font-family: var(--font-display); font-weight: 700; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; }
.mcal__top .d:hover { background: var(--c-primary-soft); }
.mcal__cell.is-today .d { background: var(--c-primary); color: #fff; }
.mcal__top .cnt { font-size: .7rem; color: var(--c-ink-faint); }
.mcal__top .cl { font-size: .68rem; color: #b3261e; }
.mcal__ev { display: block; width: 100%; text-align: left; font: inherit; font-size: .74rem; line-height: 1.3; padding: 2px 6px; border: 0; border-left: 3px solid var(--c-primary); border-radius: 4px; background: var(--c-primary-soft); color: var(--c-ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcal__ev b { font-family: var(--font-display); color: var(--c-primary-strong); font-weight: 700; margin-right: 2px; }
.mcal__ev:hover { filter: brightness(.96); }
.mcal__ev.is-first { border-left-color: var(--c-accent); }
.mcal__ev.st-done { background: #eef1f7; border-left-color: #8ea0c9; color: var(--c-ink-faint); }
.mcal__ev.st-done b { color: #5d6f99; }
.mcal__ev.st-noshow { background: #fdecea; border-left-color: #d64545; }
.mcal__ev.st-noshow b { color: #b3261e; }
.mcal__more { font-size: .72rem; color: var(--c-primary-strong); font-weight: 700; padding-left: 6px; }
@media (max-width: 900px) { .mcal { gap: 2px; } .mcal__cell { min-height: 80px; padding: 3px; } .mcal__ev { font-size: .65rem; padding: 1px 4px; } }

/* --- ダイアログ -------------------------------------------------------- */
.dlg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.dlg[hidden], .toast[hidden], #dlg-alert[hidden], #dlg-delete[hidden] { display: none; }
.dlg__back { position: absolute; inset: 0; background: rgba(20, 40, 36, .45); }
.dlg__box { position: relative; width: min(100%, 680px); max-height: 92vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.25); padding: 20px 22px 18px; }
.dlg__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlg__head h3 { font-size: 1.15rem; }
.dlg__x { border: 0; background: var(--c-bg-alt); width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.dlg__meta { font-size: .78rem; color: var(--c-ink-faint); }
.dlg__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.dlg__foot .chk { font-size: .82rem; display: inline-flex; gap: 6px; align-items: center; margin: 0; color: var(--c-ink-soft); }
.dlg__btns { display: flex; gap: 8px; align-items: center; }
.dlg .mg-flash { margin-bottom: 10px; }
.btn-xs.danger { color: #b3261e; }

/* --- トースト ---------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 200; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: .9rem; opacity: 0; transition: all .3s; box-shadow: var(--shadow-card); }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--c-primary); color: #fff; }
.toast.ng { background: #b3261e; color: #fff; }

/* =====================================================================
   タブレット最適化（768〜1024px / タッチ操作）
   ===================================================================== */
/* 時間軸と見出しを固定して、横スクロールしても時刻が見えるように */
.sch__times { position: sticky; left: 0; z-index: 2; background: #fff; }
.sch__corner { z-index: 4; left: 0; position: sticky; }

@media (max-width: 1024px) {
  .mg-container { width: calc(100% - 24px); }
  .mg-main { padding-top: 12px; }
  .mg-top h1 { font-size: 1.15rem; }
  .mg-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .mg-stat { padding: 10px 12px; }
  .mg-stat b { font-size: 1.3rem; }
  .mg-stat span { font-size: .7rem; }
  .mg-tabs a { padding: 10px 16px; font-size: .95rem; }
  .mg-card { padding: 14px; border-radius: 12px; }
  .mg-today__list { grid-template-columns: repeat(2, 1fr); }
  .mg-today__item { padding: 12px 14px; }
  .cal-bar { gap: 8px; }
  .cal-bar .btn-xs { padding: 9px 14px; font-size: .95rem; }
  .cal-bar__title { font-size: 1.05rem; }
  .seg a { padding: 10px 20px; font-size: 1rem; }

  /* タイムライン: 枠を高く、カードは指で押しやすく */
  .sch { --rowh: 64px; grid-template-columns: 48px repeat(var(--cols, 6), minmax(108px, 1fr)); min-width: calc(48px + var(--cols, 6) * 108px); }
  .sch-wrap { max-height: calc(100vh - 220px); }
  .sch__head { padding: 8px 4px; }
  .sch__head .dn { width: 34px; height: 34px; line-height: 34px; font-size: 1.2rem; }
  .sch__time { font-size: .74rem; right: 4px; }
  .sch__ev { padding: 5px 6px 8px; border-radius: 10px; gap: 2px; }
  .sch__ev .t { font-size: .74rem; }
  .sch__ev .n { font-size: .92rem; }
  .sch__ev .s { font-size: .72rem; }
  .sch__rz { height: 16px; }
  .sch__rz::after { opacity: .6; width: 32px; height: 4px; }
  .mcal__cell { min-height: 104px; }
  .mcal__ev { font-size: .8rem; padding: 4px 6px; }
}

/* 縦向きタブレット（〜840px）: 週表示は横スクロール前提で列を少し狭く、カードは時刻＋名前を優先 */
@media (max-width: 840px) {
  .mg-stats { grid-template-columns: repeat(2, 1fr); }
  .sch { grid-template-columns: 44px repeat(var(--cols, 6), minmax(96px, 1fr)); min-width: calc(44px + var(--cols, 6) * 96px); }
  .sch__ev .s { display: none; }
  .sch__ev .n { white-space: normal; line-height: 1.2; font-size: .88rem; }
  .cal-hint { display: none; }
  .mcal__cell { min-height: 88px; padding: 4px; }
  .mcal__ev { font-size: .74rem; }
}

/* タッチ端末: ホバー前提の演出をやめ、当たり判定を広げる */
@media (pointer: coarse) {
  .sch__ev:hover { transform: none; }
  .sch__rz::after { opacity: .6; }
  .mg-actions button, .btn-xs { padding: 9px 14px; font-size: .9rem; }
  .mg-chip { padding: 8px 8px 8px 14px; }
  .mg-chip button { width: 30px; height: 30px; }
  .dlg__box { width: min(100%, 720px); padding: 18px 18px 16px; }
  .dlg input, .dlg select, .dlg textarea { font-size: 16px; padding: 12px 14px; } /* iOS の自動ズーム防止 */
  .dlg .row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .dlg__btns .btn { padding: 12px 22px; font-size: 1rem; }
  .dlg__x { width: 40px; height: 40px; }
  .mg-table th, .mg-table td { padding: 12px 8px; }

  /* 患者向け予約画面 */
  .cal__day { aspect-ratio: 1 / 1.05; border-radius: 14px; }
  .cal__day .d { font-size: 1.15rem; }
  .cal__btn { width: 48px; height: 48px; }
  .slot { padding: 16px 6px; font-size: 1.1rem; border-radius: 14px; }
  .slot small { font-size: .78rem; }
  .slots__grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
  .radio span { padding: 14px 22px; font-size: 1.02rem; }
  .field input, .field textarea, .field select { font-size: 16px; padding: 14px 16px; }
  .rs-actions .btn { padding: 16px 30px; font-size: 1.05rem; }
  .stepper li span { width: 36px; height: 36px; }
}
@media (min-width: 700px) and (max-width: 1024px) {
  .rs-wrap { max-width: 760px; }
  .rs-card { padding: 28px; }
  .cal { gap: 8px; }
}

/* タブレット幅では 30 分カードの相談内容を省略（名前を優先） */
@media (max-width: 1024px) { .sch__ev.is-short .s { display: none; } .sch__ev.is-short .n { white-space: normal; line-height: 1.2; } }
/* サイト共通CSSがモバイル幅でヘッダーボタンを隠すのを、管理・予約画面では打ち消す */
@media (max-width: 1024px) { .mg-body .header__cta .btn, .rs-body .header__cta .btn { display: inline-flex; } }

/* --- コンパクト表示（1日分をスクロールなしで） ------------------------- */
.sch-wrap { max-height: none; }
.sch__time { font-size: .66rem; }
.sch__head { padding: 5px 4px; }
.sch__head .dn { width: 26px; height: 26px; line-height: 26px; font-size: 1rem; }
.sch__head .dw { font-size: .74rem; }
.sch__head .cnt, .sch__head .cl { font-size: .66rem; }
.sch__ev { padding: 2px 6px 4px; gap: 0; border-radius: 6px; line-height: 1.2; }
.sch__ev .t { font-size: .64rem; }
.sch__ev .n { font-size: .8rem; }
.sch__ev .s { font-size: .66rem; }
.sch__ev.is-short .s { display: none; }
.sch__ev.is-short .n { white-space: nowrap; }
.sch__ev i { font-size: .58rem; padding: 0 4px; margin-left: 4px; }
.sch__rz { height: 7px; }

/* --- 時間ブロック -------------------------------------------------------- */
.sch__blocked { cursor: pointer; display: flex; align-items: flex-start; padding: 2px 6px; z-index: 1; border-left: 3px solid #e0a0a0; }
.sch__blocked span { font-size: .64rem; color: #b3261e; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch__blocked:hover { filter: brightness(.97); }

/* --- ダイアログ: 予約 / ブロック切替 ------------------------------------ */
.kind { display: flex; gap: 8px; margin-bottom: 14px; }
.kind__opt { position: relative; flex: 1; }
.kind__opt input { position: absolute; opacity: 0; inset: 0; }
.kind__opt span { display: block; text-align: center; padding: 9px 10px; border-radius: 10px; border: 2px solid var(--c-line); font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--c-ink-soft); cursor: pointer; }
.kind__opt input:checked + span { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary-strong); }
.kind__opt:last-child input:checked + span { border-color: #d64545; background: #fdecea; color: #b3261e; }
#dlg-form .only-block, #dlg-form .lbl-block { display: none; }
#dlg-form.is-block .only-block { display: block; }
#dlg-form.is-block .lbl-block { display: inline; }
#dlg-form.is-block .lbl-reserve, #dlg-form.is-block .only-reserve { display: none; }
#dlg-kind[hidden] { display: none; }

/* タブレットは指で押せる高さに戻す */
@media (max-width: 1024px) {
  .sch { --rowh: 52px; }
  .sch__ev .t { font-size: .7rem; } .sch__ev .n { font-size: .88rem; }
}

/* --- メイン画面の整理 ------------------------------------------------- */
.mg-top { margin-bottom: 12px; }
.mg-tabs { margin-bottom: 0; }
.mg-tabs__badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--c-accent); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; }
.mg-tabs a.is-active .mg-tabs__badge { background: #fff; color: var(--c-primary-strong); }
.mg-card--main { padding: 16px 18px 14px; }
.mg-today__item.is-past { opacity: .6; }
.mg-today__item .st { margin-left: 6px; font-size: .68rem; padding: 1px 8px; }
@media (max-width: 840px) { .mg-top { flex-direction: column; align-items: stretch; } .mg-top .mg-daynav { justify-content: flex-end; } }

/* --- 休み時間を赤字で明示・クリックで強制登録 --------------------------- */
.sch__off { background: repeating-linear-gradient(135deg, #fbf3f2 0 8px, #f5e6e4 8px 10px); cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 3px; }
.sch__off span { font-size: .66rem; font-weight: 700; color: #c0392b; letter-spacing: .08em; opacity: .85; pointer-events: none; }
.sch__off:hover { filter: brightness(.97); }
.sch__col.is-closed { cursor: pointer; }
.sch__closedlabel { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: .72rem; font-weight: 700; color: #c0392b; line-height: 1.3; pointer-events: none; }
.sch__closedlabel small { font-weight: 500; font-size: .62rem; color: #c0392b; opacity: .8; }
.sch__legend .lg-off { background: repeating-linear-gradient(135deg, #fbf3f2 0 4px, #f5e6e4 4px 6px); }
.dlg__warn { background: #fdecea; color: #b3261e; border-left: 4px solid #d64545; border-radius: 8px; padding: 10px 14px; font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
.dlg__warn[hidden] { display: none; }

/* --- 「枠を無視して登録」スイッチ ------------------------------------- */
#dlg-form .force { display: flex; position: relative; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--c-bg-alt); border: 1px solid var(--c-line); cursor: pointer; margin: 2px 0 10px; }
#dlg-form .force > input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; appearance: none; -webkit-appearance: none; pointer-events: none; }
.force__sw { flex: none; width: 40px; height: 22px; border-radius: 99px; background: #cfd6de; position: relative; transition: background .2s; }
.force__sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.force input:checked + .force__sw { background: #d64545; }
.force input:checked + .force__sw::after { transform: translateX(18px); }
.force input:focus-visible + .force__sw { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.force__txt { display: flex; flex-direction: column; line-height: 1.3; }
.force__txt b { font-family: var(--font-display); font-size: .92rem; color: var(--c-ink); }
.force__txt small { font-size: .76rem; color: var(--c-ink-faint); }
.force:has(input:checked) { background: #fdecea; border-color: #f3b8b3; }
.force:has(input:checked) .force__txt b { color: #b3261e; }
.dlg__foot { justify-content: flex-end; }
#dlg-form.is-block .force { display: none; }

/* 区分 / 相談内容 / 状態 の列配分（相談内容を広く） */
#dlg-form .row--sym { grid-template-columns: 7em minmax(0, 1fr) 8em; }
#dlg-form .row--sym select { min-width: 0; }
@media (max-width: 560px) { #dlg-form .row--sym { grid-template-columns: 1fr 1fr; } #dlg-form .row--sym > div:nth-child(2) { grid-column: 1 / -1; } }

/* 狭い幅でもヘッダーの「患者画面を見る」「ログアウト」を両方表示 */
@media (max-width: 1024px) {
  .mg-body .header__cta { gap: 6px; }
  .mg-body .header__cta .btn { display: inline-flex; padding: 8px 12px; font-size: .82rem; white-space: nowrap; }
  .mg-body .brand img { height: 30px; }
}
@media (max-width: 480px) {
  .mg-body .header__cta .btn { padding: 7px 10px; font-size: .76rem; }
  .mg-body .brand img { height: 26px; }
}

/* 電話番号はハイフンで折り返さない */
.nowrap { white-space: nowrap; }
.header__tel { white-space: nowrap; }
.rs-head__tel { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 18px; border-radius: 99px; background: #fff; border: 2px solid var(--c-primary-soft); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--c-primary-strong); letter-spacing: .04em; white-space: nowrap; }
.rs-head__tel svg { width: 18px; height: 18px; }
.rs-head__tel:hover { border-color: var(--c-primary); background: var(--c-primary-tint); }

/* タッチ: 長押しメニュー・選択を抑止、ドラッグ中は列をまたいでも見えるように */
.sch__ev { -webkit-touch-callout: none; -webkit-user-select: none; }
.sch__ev.is-drag { pointer-events: none; }
.sch__col { overflow: visible; }

/* 長押し成立: カードが浮き上がる */
.sch__ev.is-armed { transform: scale(1.04); box-shadow: 0 10px 24px rgba(31,60,100,.35); z-index: 10; outline: 2px solid var(--c-accent); }
.sch__ev.is-armed.is-drag { transform: none; }
