/* Date navigation and adaptive timetable. The base visual palette stays unchanged. */
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 7px 14px; border: 1px solid #cbd5e1; border-radius: 5px; color: inherit; text-decoration: none; background: #fff; }
.button-link:hover { background: #f0f4f8; }
.slot-query { display: block; width: 100%; height: 100%; min-height: 0; padding: 0; background: transparent; border: 0; border-radius: 0; color: #567593; }
.slot-query-label { opacity: 0; font-size: 12px; }
.slot-query:hover, .slot-query:focus-visible { background: #dfeaf6; outline-offset: -3px; }
.slot-query:hover .slot-query-label, .slot-query:focus-visible .slot-query-label { opacity: 1; }
.now-line { position: absolute; z-index: 6; height: 2px; background: #d34a4a; pointer-events: none; transform: translateY(-1px); }
.now-line::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d34a4a; }
.now-line-time { position: absolute; right: 4px; top: -17px; color: #a83434; background: #fff; border-radius: 2px; padding: 0 2px; font-size: 11px; line-height: 15px; font-variant-numeric: tabular-nums; }
.location-dialog { width: min(520px,calc(100% - 24px)); }
.location-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.location-status { border: 1px solid var(--line); border-radius: 5px; padding: 10px; font-size: 14px; line-height: 1.6; }
.location-status.supported { background: #eef7f1; border-color: #b9d6c1; color: #275d38; }
.location-status.unsupported { background: #fff5f2; border-color: #e5c7bd; color: #8b3b2d; }
.location-dialog > select { width: 100%; margin-bottom: 10px; }
.campus-map-frame svg { cursor: crosshair; }
.campus-map-frame { margin: 10px 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #f8fafc; }
.campus-map-frame svg { display: block; width: 100%; height: min(35vh,280px); }
.campus-map-frame figcaption { border-top: 1px solid var(--line); padding: 7px 9px; color: #697687; font-size: 12px; }
.campus-boundary { fill: #e2ebf4; stroke: #50759a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.campus-center { fill: #617c97; }
.location-point { fill: #d34a4a; stroke: white; stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-attribution { font-size: 12px; color: #6c7886; margin-bottom: 0; }
.map-attribution a { color: #365e89; }
.catalog-filters { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(240px,1.5fr); gap: 12px; }
.catalog-filters > div { min-width: 0; }
#add-department { width: 100%; min-width: 0; }
.campus-filter { border: 0; padding: 0; margin: 13px 0 0; }
.campus-filter legend { font-size: 14px; margin-bottom: 7px; }
.campus-status { color: #697687; font-size: 12px; font-weight: 400; margin-left: 6px; }
.campus-options { display: flex; flex-wrap: wrap; gap: 6px; }
.campus-options label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d5dde6; border-radius: 4px; padding: 5px 8px; font-size: 13px; margin: 0; cursor: pointer; }
.campus-options label:has(input:checked) { background: #e5edf6; border-color: #91aac4; color: #294f76; }
.campus-options input { width: auto; min-height: 0; margin: 0; accent-color: #365e89; }
.query-dialog { width: min(800px,calc(100% - 24px)); max-height: 92dvh; }
.query-scope { margin: 6px 0 0; }
.query-controls, .query-filters { display: grid; gap: 10px; align-items: end; }
.query-controls { grid-template-columns: 1fr 1fr 1.25fr auto; }
.query-filters { grid-template-columns: 1fr .75fr 1.5fr auto; margin-top: 12px; }
.query-controls > div, .query-filters > div { min-width: 0; }
.query-controls input, .query-controls select, .query-filters select { min-width: 0; width: 100%; }
.query-summary { font-size: 15px; font-weight: 600; line-height: 1.6; margin: 18px 0 8px; }
.date-with-day { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; overflow: hidden; }
.date-with-day input { border: 0; border-radius: 0; min-width: 0; }
.date-with-day span { min-width: 3.4em; padding-right: 8px; font-size: 13px; color: #465b70; white-space: nowrap; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #cbd5e1; border-radius: 5px; overflow: hidden; }
.mode-button { border: 0; border-radius: 0; min-height: 42px; padding: 5px 8px; font-size: 13px; }
.mode-button + .mode-button { border-left: 1px solid #cbd5e1; }
.mode-button[aria-pressed=true] { background: #365e89; color: #fff; }
.period-state { display: inline-block; font-size: 12px; border-radius: 3px; padding: 2px 6px; margin-right: 8px; vertical-align: 1px; }
.period-state.ended { background: #edf0f3; color: #697481; }
.period-state.running { background: #e4f2e8; color: #28613b; }
.period-state.upcoming { background: #fff2d9; color: #805a16; }
.query-results { max-height: 43dvh; overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 22px; align-items: start; }
.query-results > .empty-note { grid-column: 1 / -1; }
.query-course { padding: 12px 0; border-bottom: 1px solid var(--line); }
.query-course-head { display: flex; align-items: start; gap: 12px; justify-content: space-between; }
.query-course-name { padding: 0; min-height: 0; border: 0; background: transparent; text-align: left; font-size: 16px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; color: #365e89; }
.query-course-name:hover { text-decoration: underline; background: transparent; }
.query-add { flex: none; font-size: 13px; min-height: 34px; padding: 4px 10px; }
.query-meta { font-size: 13px; color: #687587; margin: 4px 0; line-height: 1.55; }
.query-location { font-size: 15px; margin: 7px 0 3px; font-weight: 500; }
.query-remark { font-size: 13px; margin: 7px 0 0; line-height: 1.65; color: #5c6572; overflow-wrap: anywhere; }
.query-data-note { padding-top: 10px; border-top: 1px solid var(--line); margin-bottom: 0; }
#query-breaks { margin-top: 18px; }
#query-breaks h3 { font-size: 15px; font-weight: 500; color: #83633f; }
.next-slot { font-size: 13px; margin-left: 8px; min-height: 30px; padding: 3px 8px; }
#query-more { margin-top: 10px; font-size: 13px; }
main { padding: 20px 24px; }
.top { margin-bottom: 14px; }
.brand { letter-spacing: .04em; }
.toolbar { gap: 8px 12px; }
.week-control { gap: 4px; }
.week-control button { width: 32px; min-height: 36px; font-size: 21px; }
.week-control #open-calendar { width: auto; min-width: 202px; font-size: 14px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.subtle { font-size: 13px; min-height: 34px; padding: 5px 9px; }
.statistics { display: flex; align-items: baseline; gap: 4px; color: #667385; margin-left: auto; font-size: 13px; flex-wrap: wrap; }
.statistics .count { margin: 0; font-size: 13px; }
.duration { font-size: 13px; color: #365e89; min-height: 32px; padding: 3px 5px; border-color: transparent; border-bottom: 1px dotted #93a9bf; border-radius: 0; font-variant-numeric: tabular-nums; }
.duration:hover { background: #eaf0f6; }
.hint { margin: 8px 0 12px; }
.schedule-scroll { min-height: 0; scrollbar-gutter: auto; scroll-behavior: auto; }
.schedule { grid-template-columns: 4.5rem repeat(7,minmax(6.4rem,1fr)); min-width: 49.3rem; }
.grid-cell.day-head { padding: 0; }
.day-button { border: 0; border-radius: 0; background: transparent; width: 100%; height: 100%; padding: 4px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; font-size: 14px; }
.day-button small { font-size: 12px; font-weight: 400; color: #6b7c8e; font-variant-numeric: tabular-nums; }
.day-button:hover { background: #dfe9f4; }
.selected-day { box-shadow: inset 0 -3px #4f7caa; background: #dbe8f6 !important; }
.selected-day .day-button { color: #214e7b; font-weight: 700; }
.selected-day .day-button small { color: #375f89; }
.grid-cell.selected-column { background: #fafcff; }
.grid-cell.collapsed { background: #f0f3f7; border-bottom-color: #e5eaf0; }
.grid-cell.period.collapsed { gap: 0; }
.period { gap: 1px; overflow: hidden; }
.period b { font-size: 13px; }
.period small { line-height: 1.2; }
.period small { font-size: 10px; letter-spacing: -.02em; }
.period-toggle { width: 100%; min-height: 22px; padding: 1px 0; font-size: 12px; border: 0; border-radius: 0; background: transparent; white-space: nowrap; }
.period-toggle:hover { background: #dce7f2; }
.period-toggle:focus-visible { outline-offset: -3px; }
.break-before { border-top-width: 1px; }
.event { margin-top: 3px; margin-bottom: 3px; padding: 6px 7px; gap: 3px; }
.event strong { line-height: 1.35; flex-shrink: 0; }
.event .room { line-height: 1.3; }
.event.conflict { position: relative; }
.event .conflict-label { position: absolute; right: 2px; bottom: 2px; font-size: 11px; line-height: 1.2; border-radius: 2px; padding: 1px 2px; background: #fff8ee; }
.event.conflict .event-meta { padding-right: 24px; }
.schedule.dense .event { padding: 4px 5px; gap: 2px; }
.schedule.dense .event strong { -webkit-line-clamp: 2; font-size: 13px; }
.schedule.dense .event .room { font-size: 12px; }
.schedule.dense .event .event-meta { display: none; }
.schedule.dense .event.single { padding: 2px 4px; gap: 0; }
.schedule.dense .event.single strong { -webkit-line-clamp: 1; }
.schedule.dense .event.single .room { font-size: 11px; }
.schedule.dense .event.conflict .room { padding-right: 0; }
footer { margin-top: 10px; }
footer a { color: #365e89; }
.calendar-dialog { max-width: 380px; }
.calendar-dialog .dialog-head { margin-bottom: 12px; }
.month-control { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-control h3 { font-size: 16px; font-weight: 600; margin: 0; }
.month-control button { width: 36px; min-height: 36px; padding: 2px; font-size: 22px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); row-gap: 3px; }
.calendar-weekday { text-align: center; font-size: 13px; color: #748297; padding: 8px 0; }
.calendar-day { border: 0; border-radius: 0; padding: 0; min-height: 42px; font-size: 14px; position: relative; background: transparent; font-variant-numeric: tabular-nums; }
.calendar-day.in-week { background: linear-gradient(transparent 46%,#f4ed99 46%,#f4ed99 82%,transparent 82%); }
.calendar-day.chosen-date { box-shadow: inset 0 0 0 2px #5780a9; border-radius: 5px; font-weight: 700; color: #234f7d; }
.calendar-day[aria-current=date]::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; bottom: 2px; left: calc(50% - 2px); background: #5780a9; }
.calendar-day:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #a8bdd3; border-radius: 5px; }
.calendar-day.outside-month { color: #8c97a3; }
.calendar-day:disabled { opacity: .3; }
.calendar-dialog .muted { margin: 12px 0 0; }
.calendar-dialog .dialog-actions { margin-top: 14px; }
@media (max-width: 1100px) { .statistics { width: 100%; margin-left: 0; } }
@media (max-width: 650px) {
 .top-actions { gap: 5px; }
 .top-actions button { font-size: 12px; padding: 6px 8px; }
 .top-actions .button-link { font-size: 12px; min-height: 40px; padding: 6px 8px; }
 .top-actions .primary { font-size: 12px; padding: 6px 8px; }
 .query-controls, .query-filters { grid-template-columns: 1fr 1fr; }
 .query-controls > div:first-child { grid-column: 1 / -1; }
 .query-controls select, .query-controls input, .query-filters input { font-size: 14px; }
 .query-controls #query-now { min-height: 42px; }
 .query-filters button { grid-column: span 2; }
 .query-results { max-height: 35dvh; grid-template-columns: 1fr; }
 .query-course-name { font-size: 15px; }
 .query-course-head { gap: 6px; }
 main { padding: 14px 10px; }
 .top { margin-bottom: 10px; }
 .semester { font-size: 13px; }
 .toolbar { gap: 5px 8px; }
 .week-control #open-calendar { min-width: 190px; font-size: 13px; }
 .statistics { gap: 2px; font-size: 12px; }
 .statistics .count, .duration { font-size: 12px; }
 .schedule { grid-template-columns: 4rem repeat(7,6.25rem); min-width: 47.75rem; }
 .schedule-scroll { min-height: 0; }
 .hint { font-size: 12px; line-height: 1.5; margin: 6px 0 9px; }
 .day-button { font-size: 13px; }
 .pending { padding: 10px; }
}
 .catalog-filters { grid-template-columns: 1fr; gap: 8px; }
 .campus-options { gap: 5px; }
 .campus-options label { padding: 4px 6px; font-size: 12px; }
