.teacher-public { margin: 0; color: #31251c; background: #fdfbf7; font-family: system-ui, sans-serif; }
.teacher-public main { max-width: 78rem; margin: auto; padding: clamp(.75rem, 3vw, 2rem); }
.teacher-public h1 { color: #78350f; margin: 0; }
.teacher-timetable-scroll { overflow: auto; max-width: 100%; border: 1px solid #d7c4af; border-radius: .5rem; }
.teacher-timetable { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1120px; background: #fff; table-layout: fixed; }
.teacher-timetable :is(th,td) { box-sizing: border-box; padding: 5px; border-bottom: 1px solid #eadfce; border-inline-end: 1px solid #eadfce; overflow-wrap: anywhere; }
.teacher-timetable th { background: #f4eadc; text-align: center; }
.teacher-timetable thead th { padding: 12px; font-size: .9rem; }
.teacher-timetable tbody th { font-size: .8rem; font-weight: 500; }
.teacher-timetable td { height: 104px; vertical-align: top; }
.teacher-timetable .weekend { background: #fff2db; }
.teacher-timetable td[data-day="Sat"], .teacher-timetable td[data-day="Sun"] { background: #fffcf5; }
.teacher-timetable th:first-child { position: sticky; left: 0; width: 100px; z-index: 1; }
.teacher-timetable small { display: block; margin-top: 4px; color: #75624f; }
.teacher-timetable .course-card { padding: 9px; overflow-wrap: anywhere; }
.teacher-timetable .course-card h3 { font-size: .95rem; line-height: 1.35; margin: 0 0 5px; }
.teacher-timetable .course-card p { font-size: .8rem; margin: 3px 0; }
td.has-course{position:relative;isolation:isolate;--card-bg:#edf4ff;--card-border:#a8c5ef;--card-accent:#487ad0}
td.has-course.emerald{--card-bg:#eaf7f0;--card-border:#80bda1;--card-accent:#80bda1}
td.has-course.purple{--card-bg:#f1edfc;--card-border:#b2a1d9;--card-accent:#b2a1d9}
td.has-course.amber{--card-bg:#fff5df;--card-border:#d6b86f;--card-accent:#d6b86f}
td.has-course.rose{--card-bg:#fff0f3;--card-border:#dba1ae;--card-accent:#dba1ae}
td.has-course::before{content:"";position:absolute;inset:5px;z-index:0;border:1px solid var(--card-border);border-left:4px solid var(--card-accent);border-radius:7px;background:var(--card-bg);pointer-events:none}
td.has-course>.course-card{position:relative;z-index:1;height:auto;min-height:91px;border-color:transparent;background:transparent}

#teacherShareDialog { width: min(58rem, 94vw); max-height: 90vh; overflow: auto; }
#teacherShareDialog [hidden] { display: none; }
#teacherShareQr { display: block; width: min(14rem, 100%); height: auto; }
#teacherShareUrl { width: 100%; }
#teacherShareDialog .teacher-timetable th { top: auto; }

.teacher-timetable-hint { display: none; }
@media (max-width: 50rem) {
  .teacher-timetable-hint { display: block; color: #68564a; font-size: .875rem; }
}

#teacherDisplayButton { display: none; }
@media screen and (max-width: 700px) {
  #teacherDisplayButton:not([hidden]) {
    display: inline-block; min-height: 44px; margin: .75rem 0 0; padding: .4rem .75rem;
    color: #78350f; background: #fff8eb; border: 1px solid #d7c4af;
    border-radius: .55rem; font: inherit;
  }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable-hint { display: none; }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable { min-width: 0; width: calc(140% - 19.2px); }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable :is(th,td) { padding: .18rem .12rem; font-size: .68rem; }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable th:first-child { width: 48px; }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable tbody :is(tr,td) { height: 50px; }
  #teacherPublicSchedule:not(.teacher-detailed) td.has-course::before { inset: 2px; border-left-width: 2px; border-radius: 4px; }
  #teacherPublicSchedule:not(.teacher-detailed) td.has-course>.course-card { min-height: 0; padding: 4px 2px; }
  #teacherPublicSchedule:not(.teacher-detailed) .course-card h3 { margin: 0; font-size: .68rem; }
  #teacherPublicSchedule:not(.teacher-detailed) .course-card p { margin: 2px 0 0; color: #4d4035; font-size: .65rem; line-height: 1.25; }
  #teacherPublicSchedule:not(.teacher-detailed) .teacher-timetable small { font-size: .64rem; }
}

/* The preview fits the time column and five weekdays within the dialog. */
#teacherSharePreview .teacher-timetable-hint { display: block; color: #68564a; font-size: .8rem; }
#teacherSharePreview .teacher-timetable { min-width: 0; width: calc(140% - 19.2px); }
#teacherSharePreview .teacher-timetable :is(th,td) { padding: 2px; font-size: .72rem; }
#teacherSharePreview .teacher-timetable th:first-child { width: 48px; }
#teacherSharePreview .teacher-timetable tbody :is(tr,td) { height: 50px; }
#teacherSharePreview td.has-course::before { inset: 2px; border-left-width: 2px; border-radius: 4px; }
#teacherSharePreview td.has-course>.course-card { min-height: 0; padding: 4px 2px; }
#teacherSharePreview .course-card h3 { margin: 0; font-size: .75rem; }
#teacherSharePreview .course-card p { margin: 2px 0 0; color: #4d4035; font-size: .7rem; line-height: 1.25; }
#teacherSharePreview .teacher-timetable small { font-size: .64rem; }
#teacherShareActive .form-actions { flex-wrap: wrap; }

@media print{td.has-course::before{inset:1mm;border-color:#8795a8;border-left-width:2px}td.has-course>.course-card{height:auto;min-height:0;border-color:transparent!important;border-left-width:2px!important}}
