/* 教室の1週間ページ・教室から探すページ */
/* 戻るリンクは指で押しやすいよう上下の当たり判定だけ広げる（見た目の位置は変えない） */
.room-page .back { color: var(--accent); text-decoration: none; font-size: 14px; display: inline-block; padding: 13px 0; margin: -9px 0 -7px; }
.room-page .card { margin-top: 18px; }
.room-page .disclaimer { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 12px 0 10px; }
.room-head .badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.room-head h1 { font-size: 1.7rem; font-weight: 800; margin-top: 6px; word-break: break-all; line-height: 1.2; }
.free-count { flex: none; text-align: right; color: var(--muted); font-size: 0.78rem; }
.free-count em { display: block; font-style: normal; font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.8rem; color: #4dd9a0; line-height: 1; }

.view-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.view-switch select { padding: 9px 34px 9px 12px; font-size: 0.88rem; width: auto; }

.week-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week { width: 100%; min-width: 330px; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 11px; }
.week th { color: var(--muted); font-weight: 500; padding: 4px 0; }
.week th small { display: block; font-size: 9px; font-weight: 400; }
.week th.today { color: var(--accent); font-weight: 700; }
.week th.p { width: 34px; }
.week td { height: 54px; border-radius: 8px; text-align: center; vertical-align: middle; padding: 2px; overflow: hidden; position: relative; }
.week td.free { background: rgba(77,217,160,0.12); color: #4dd9a0; font-weight: 700; }
.week td.busy { background: var(--surface2); color: var(--muted); line-height: 1.25; word-break: break-all; }
.week td.busy .subj { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.week td.busy .more { display: block; font-size: 9px; opacity: 0.8; }
.week td.biweekly { background: repeating-linear-gradient(135deg, rgba(255,200,90,0.10) 0 6px, var(--surface2) 6px 12px); }
.week td .bw-tag { display: inline-block; margin-top: 2px; padding: 0 5px; border-radius: 4px; font-size: 9px; font-weight: 700; color: #ffc85a; border: 1px solid rgba(255,200,90,0.5); }
.week td.today { box-shadow: inset 0 0 0 1px rgba(108,143,255,0.35); }
.week td.now { box-shadow: inset 0 0 0 2px var(--accent); }
.week td[data-slot] { cursor: pointer; }
.week td.picked { outline: 2px solid var(--text); outline-offset: -2px; }
.week td:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell-detail { margin-top: 8px; min-height: 1.6em; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 0.82rem; color: var(--text); line-height: 1.5; }
.week td .now-tag { display: block; font-size: 9px; font-weight: 700; color: var(--accent); }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 0.75rem; color: var(--muted); }
.legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend .lg.free { background: rgba(77,217,160,0.35); }
.legend .lg.busy { background: var(--surface2); border: 1px solid var(--border); }
.legend .lg.biweekly { background: repeating-linear-gradient(135deg, rgba(255,200,90,0.55) 0 3px, var(--surface2) 3px 6px); }

.search-title { font-size: 1.5rem; font-weight: 800; margin: 12px 0 2px; }
.room-page .sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 12px; }
.list-title { font-size: 0.9rem; color: var(--muted); font-weight: 700; margin: 18px 0 10px; }
a.room-card.room-link { display: block; text-decoration: none; }
a.room-card.room-link:active { transform: scale(0.96); }
.room-page .empty-state { margin: 16px 0; }
.room-page .empty-state small { color: var(--muted); }
.room-page .empty-state { overflow-wrap: anywhere; }

@media (min-width: 768px) {
    .week { font-size: 12px; }
    .week td { height: 60px; }
}
