.tt-actions, .tt-week-controls, .tt-dialog-footer, .tt-dialog-footer > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tt-actions button, [data-timetable-options], .tt-dialog button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tt-actions svg, [data-timetable-options] svg, .tt-icon svg, .tt-dialog svg { width: 17px; height: 17px; flex-shrink: 0; }
.tt-heading { flex-wrap: wrap; gap: 10px; }
.tt-heading h2 { margin-right: auto; }
.tt-weekbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 10px; border-bottom: 1px solid #d6dce5; color: #526076; font-size: 12px; flex-shrink: 0; }
.tt-week-controls input { width: 146px; }
body.campus-ui .tt-icon { min-width: 34px; width: 34px; height: 34px; padding: 6px; }
body.campus-ui .timetable-wrap { overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
body.campus-ui .timetable { min-width: 1230px; width: 100%; table-layout: fixed; }
body.campus-ui .timetable tr > :first-child { width: 106px; min-width: 106px; }
body.campus-ui .timetable tr > :nth-child(2) { width: 68px; min-width: 68px; }
body.campus-ui .timetable thead th { position: sticky; top: 0; z-index: 3; color: #fff; background: #1b2b4a; padding: 9px 6px; }
body.campus-ui .timetable thead th .timetable-date { display: block; color: #dde3ee; margin-top: 4px; }
body.campus-ui .timetable tr > th:first-child { position: sticky; left: 0; z-index: 2; }
body.campus-ui .timetable tr > th:nth-child(2) { position: sticky; left: 106px; z-index: 2; }
body.campus-ui .timetable thead th:nth-child(-n+2) { z-index: 4; }
body.campus-ui .timetable thead th.is-selected-date { color: #1b2b4a; background: #ead79b; box-shadow: inset 0 -3px #b88726; }
body.campus-ui .timetable thead th.is-selected-date .timetable-date { color: #39465b; }
body.campus-ui .timetable td { height: auto; padding: 8px; }
body.campus-ui .timetable .timetable-entry { max-height: none; overflow: visible; padding: 6px 0 10px; margin-bottom: 7px; line-height: 1.55; }
body.campus-ui .timetable .timetable-entry:last-child { margin-bottom: 0; padding-bottom: 3px; }
.tt-field { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 6px; align-items: baseline; margin: 3px 0; font-size: 13px; line-height: 1.55; }
.tt-field-label { color: #657187; font-size: 12px; }
.tt-field-value { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #24334b; }
.tt-field-course .tt-field-value { font-size: 14px; font-weight: 700; }
body.campus-ui .tt-dialog { padding: 0; width: min(660px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); color: #24334b; background: #fff; border: 1px solid #cbd3df; border-radius: 8px; box-shadow: 0 18px 64px #101b3540; }
.tt-dialog[open] { display: flex; flex-direction: column; }
.tt-dialog::backdrop { background: #15213b80; }
.tt-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: #1b2b4a; color: #fff; flex: 0 0 auto; }
body.campus-ui #timetableOptionsDialog .tt-dialog-header h2 { margin: 0 0 4px; font-size: 18px; color: #fff; }
.tt-dialog-header span { color: #e5d39d; font-size: 13px; }
.tt-dialog-body { overflow: auto; padding: 8px 20px 16px; min-height: 0; }
.tt-dialog fieldset { margin: 12px 0; padding: 12px 0 16px; border: 0; border-bottom: 1px solid #d6dce5; }
.tt-dialog legend { font-size: 15px; font-weight: 700; padding: 0; }
.tt-field-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tt-field-options label, .tt-follow { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; font-size: 14px; font-weight: 500; }
.tt-dialog input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: #1b2b4a; }
.tt-dialog .tt-mode-label { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.tt-mode-label select { width: auto; min-width: 160px; }
.tt-follow { margin-bottom: 8px; }
.tt-scope-label { display: grid; gap: 6px; font-size: 14px; }
.tt-preview-heading { font-size: 13px; font-weight: 700; margin-top: 14px; }
.tt-preview-heading span { color: #66728a; font-weight: 400; margin-left: 8px; }
#ttOptionsPreview { padding: 10px 12px; margin-top: 8px; border-left: 3px solid #c6a14e; background: #f4f6fa; }
#ttOptionsError { color: #a12d30; margin: 8px 0 0; min-height: 20px; font-size: 13px; }
.tt-dialog-footer { flex-shrink: 0; justify-content: space-between; border-top: 1px solid #d6dce5; padding: 12px 20px; background: #f8f9fb; }
#timetablePrintOutput { display: none; }
@media (max-width: 680px) {
  body.campus-ui .timetable tr > :first-child { width: 82px; min-width: 82px; }
  body.campus-ui .timetable tr > :nth-child(2) { width: 52px; min-width: 52px; }
  body.campus-ui .timetable tr > th:nth-child(2) { left: 82px; }
  body.campus-ui .tt-heading { align-items: stretch; }
  body.campus-ui .tt-heading .timetable-class-filter { width: 100%; flex-wrap: wrap; white-space: normal; }
  .tt-actions { width: 100%; }
  .tt-actions button { flex: 1; }
  #timetableWeekLabel { width: 100%; }
  body.campus-ui .tt-icon { width: 44px; height: 44px; }
  body.campus-ui #timetablePanel .timetable-wrap { max-height: 70vh; max-height: 70dvh; }
  .tt-dialog-header { padding: 12px; }
  .tt-dialog-body { padding: 6px 12px 12px; }
  .tt-dialog-footer { padding: 10px 12px; }
  .tt-field-options { gap: 6px; }
  .tt-field-options label { min-height: 42px; }
  .tt-dialog-footer button { min-height: 44px; padding: 6px 10px; }
}
@page timetable-report { size: A3 landscape; margin: 10mm; }
@media print {
  body.printing-selected-timetable > *:not(#timetablePrintOutput) { display: none !important; }
  body.printing-selected-timetable { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  body.printing-selected-timetable #timetablePrintOutput { display: block !important; page: timetable-report; color: #1b2b4a; }
  #timetablePrintOutput h1 { font-size: 18px; margin: 0 0 8px; }
  #timetablePrintOutput p { font-size: 12px; }
  body.campus-ui #timetablePrintOutput .timetable { width: 100%; min-width: 0; }
  body.campus-ui #timetablePrintOutput .timetable th { position: static; }
  #timetablePrintOutput .timetable thead { display: table-header-group; }
  #timetablePrintOutput .tt-field { font-size: 12px; grid-template-columns: 26px minmax(0, 1fr); gap: 4px; }
  #timetablePrintOutput .tt-field-label { font-size: 10px; white-space: nowrap; }
  #timetablePrintOutput .tt-field-course .tt-field-value { font-size: 12px; }
  #timetablePrintOutput .timetable-entry { break-inside: avoid; }
  body.campus-ui #timetablePrintOutput .timetable th, body.campus-ui #timetablePrintOutput .timetable td { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
