/* Same data and actions; phone composition prioritizes the task in hand. */
.mobile-schedule-controls,
.mobile-menu-actions,
.directory-filter-toggle,
.mobile-lesson-back {
  display: none;
}
.directory-filter-fields {
  display: contents;
}
@media (max-width: 700px) {
  body #main {
    padding: 12px 12px 24px;
  }
  body .schedule-page .schedule-tools {
    margin-bottom: 8px;
  }
  body .schedule-page .schedule-command {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
    min-height: 44px;
    border: 0;
  }
  body .schedule-command h1,
  body .schedule-command > .tool-pop-trigger {
    display: none;
  }
  body .schedule-command .week-nav {
    flex: 1;
    width: auto;
    margin: 0;
    flex-wrap: nowrap;
    gap: 0;
  }
  body .schedule-command .week-nav strong {
    font-size: 16px;
    white-space: nowrap;
  }
  body .schedule-command .week-nav button {
    width: 40px;
    min-width: 40px;
    min-height: 44px;
    padding: 8px;
  }
  body .schedule-command .command-actions {
    flex: none;
    width: auto;
    margin: 0;
  }
  body
    .schedule-command
    .command-actions
    > :not(.more-trigger):not(.tool-popover) {
    display: none;
  }
  body .schedule-command .more-trigger {
    width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  body .mobile-schedule-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 6px 0 8px;
  }
  body .mobile-schedule-controls > button {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
  }
  body .mobile-view-switch {
    display: flex;
    background: #e9edf5;
    padding: 3px;
    border-radius: 12px;
  }
  body .mobile-view-switch button {
    min-height: 38px;
    border: 0;
    background: transparent;
    padding: 6px 18px;
    font-size: 14px;
  }
  body .mobile-view-switch [aria-pressed="true"] {
    color: #3155e7;
    background: white;
    box-shadow: 0 1px 4px #24344f12;
  }
  body .schedule-page[data-mobile-filters="false"] .schedule-filterline {
    display: none;
  }
  body .schedule-page[data-mobile-filters="true"] .schedule-filterline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: white;
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    gap: 8px;
  }
  body .schedule-filterline .teacher-strip {
    width: 100%;
    min-width: 0;
  }
  body .schedule-filterline .teacher-shortcuts {
    gap: 4px;
  }
  body .schedule-filterline .teacher-shortcuts button {
    font-size: 13px;
    min-height: 44px;
    padding: 8px 10px;
  }
  body .schedule-filterline .schedule-filters {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }
  body .schedule-page[data-mobile-layout="day"] .board-controls,
  body .schedule-page[data-mobile-layout="day"] .time-trigger {
    display: none;
  }
  body .schedule-page[data-mobile-layout="day"] .board-scroll {
    display: none !important;
  }
  body .schedule-page[data-mobile-layout="day"] .mobile-agenda {
    display: block !important;
  }
  body .schedule-page[data-mobile-layout="week"] .board-scroll {
    display: block !important;
  }
  body .schedule-page[data-mobile-layout="week"] .mobile-agenda {
    display: none !important;
  }
  body .schedule-page .board-layout,
  body .schedule-page .board-main {
    min-height: 0;
    height: auto;
    display: block;
  }
  body .schedule-page .mobile-agenda .day-switch {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 4;
    gap: 2px;
    padding: 6px 0;
    background: #f5f7fb;
    margin: 0;
  }
  body .mobile-agenda .day-switch button {
    flex: 1;
    padding: 6px 0;
    min-width: 0;
    min-height: 44px;
    font-size: 14px;
    border-color: transparent;
    background: transparent;
  }
  body .mobile-agenda .day-switch button.active {
    background: #3155e7;
    color: white;
    border-radius: 12px;
  }
  body .mobile-agenda section {
    margin: 12px 0 20px;
  }
  body .mobile-agenda h3 {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 2px 8px;
    color: #20334d;
    font-size: 15px;
  }
  body .mobile-agenda h3 span {
    color: #718198;
    font-size: 12px;
    font-weight: 500;
  }
  body .mobile-agenda .class-card {
    height: auto;
    min-height: 0;
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: white;
  }
  body .mobile-agenda .class-open {
    min-height: 36px;
    font-size: 15px;
    width: 100%;
    padding-right: 0;
  }
  body .mobile-agenda .class-open strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body .mobile-agenda .class-open > span {
    font-size: 12px;
    flex: none;
  }
  body .mobile-agenda .class-pencil {
    display: none;
  }
  body .mobile-agenda .class-meta {
    white-space: normal;
    font-size: 12px;
    line-height: 1.5;
    margin: 2px 0 6px;
  }
  body .mobile-agenda .student-chips {
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    gap: 5px;
  }
  body .mobile-agenda .student-chips button {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 13px;
  }
  html body.has-utility-dock .planbar,
  body .planbar {
    margin-top: 12px;
    height: auto;
    padding: 4px 0;
  }
  body .plan-tabs {
    overflow-x: auto;
    max-width: 100%;
  }
  body .plan-tabs button {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 12px;
  }
  body .mobile-menu-actions {
    display: grid;
  }
  body .board-scroll .master-table .time-col {
    width: 42px;
    min-width: 42px;
    font-size: 11px;
  }
  body .board-scroll .master-table .teacher-col {
    left: 42px;
    width: 70px;
    min-width: 70px;
    font-size: 11px;
  }
  body .board-scroll .teacher-property-link {
    font-size: 11px;
    padding: 4px;
  }
  body .board-scroll .teacher-mark {
    flex: none;
    width: 3px;
    margin-right: 3px;
  }
  body .students-page {
    padding: 8px 0 18px;
  }
  body .students-heading {
    margin-bottom: 12px;
    justify-content: space-between;
  }
  body .students-heading h1 {
    font-size: 22px;
  }
  body .students-heading p {
    font-size: 12px;
  }
  body .directory-filters {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  body .directory-search {
    grid-column: auto;
    font-size: 0;
    gap: 0;
  }
  body .directory-search input {
    height: 44px;
    font-size: 15px;
  }
  body .directory-filter-toggle {
    display: flex;
    gap: 5px;
    align-items: center;
    height: 44px;
    font-size: 12px;
    padding: 6px 10px;
  }
  body .directory-filter-fields {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #dfe6f1;
    border-radius: 12px;
  }
  body .directory-filter-fields[data-expanded="false"] {
    display: none;
  }
  body .directory-filter-fields :is(select, button) {
    min-height: 44px;
  }
  body .directory-result {
    font-size: 12px;
    margin: 10px 0;
  }
  body .directory-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 3px 8px;
    padding: 10px 12px;
    align-items: center;
  }
  body .directory-table td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 12px;
    text-align: left;
  }
  body .directory-table td::before {
    display: none;
  }
  body .directory-table td:first-child {
    grid-column: 1/3;
    grid-row: 1;
  }
  body .directory-table td:first-child button {
    display: block;
    min-height: 32px;
    padding: 0;
    text-align: left;
    font-size: 15px;
    width: 100%;
  }
  body .directory-table td[data-label="상태"] {
    grid-column: 3;
    grid-row: 1;
  }
  body .directory-table td[data-label="학교"] {
    grid-column: 2;
    grid-row: 2;
  }
  body .directory-table td[data-label="학년"] {
    grid-column: 1;
    grid-row: 2;
  }
  body .directory-table td[data-label="이번 주 수업"] {
    grid-column: 3;
    grid-row: 2;
    color: #6b7d96;
  }
  body .student-detail-navigation {
    margin-bottom: 12px;
    gap: 6px;
  }
  body .student-detail-navigation button {
    font-size: 12px;
    padding: 6px 8px;
    min-height: 40px;
  }
  body .student-detail-tabs {
    gap: 0;
    margin: 12px 0;
  }
  body .student-detail-tabs button {
    font-size: 13px;
    min-width: 0;
    flex: 1;
    padding: 10px 4px;
  }
  body .student-detail-card {
    padding: 14px;
  }
  body .student-detail-card h2 {
    font-size: 17px;
  }
  body .student-detail-card label {
    font-size: 13px;
  }
  body
    .mobile-lesson-workspace[data-mobile-editing="false"]
    .server-lesson-editor {
    display: none;
  }
  body
    .mobile-lesson-workspace[data-mobile-editing="true"]
    > :not(.server-lessons-layout) {
    display: none;
  }
  body
    .mobile-lesson-workspace[data-mobile-editing="true"]
    .server-lesson-list {
    display: none;
  }
  body .mobile-lesson-workspace .server-lessons-layout {
    display: block;
    height: auto;
    min-height: 0;
  }
  body .mobile-lesson-workspace .server-lesson-list {
    max-height: none;
    height: auto;
    overflow: visible;
  }
  body .mobile-lesson-workspace .server-lesson-editor {
    position: static !important;
    height: auto;
    max-height: none;
    width: auto;
    margin: 0;
    padding: 14px;
    box-shadow: none;
    overflow: visible;
  }
  body .mobile-lesson-workspace .mobile-lesson-back {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    min-height: 44px;
    margin: 0 0 8px;
  }
  body .mobile-lesson-workspace .server-lesson-row {
    padding: 12px;
    gap: 4px;
    border-radius: 0;
  }
  body .mobile-lesson-workspace .server-lesson-row strong {
    font-size: 15px;
  }
  body .mobile-lesson-workspace .server-lesson-row small {
    font-size: 12px;
  }
  body .mobile-lesson-workspace .server-lesson-actions {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
    padding: 8px 0;
    margin-bottom: 12px;
  }
  body .mobile-lesson-workspace .server-lesson-actions button {
    min-height: 44px;
    font-size: 13px;
  }
  body .mobile-lesson-workspace .server-lesson-form h2 {
    font-size: 18px;
  }
  body .mobile-lesson-workspace .ops-filters {
    gap: 8px;
    margin-bottom: 10px;
  }
  body .mobile-lesson-workspace .lesson-days {
    margin-bottom: 12px;
  }
  body.mobile-chat-open {
    overflow: hidden;
  }
  body #jjbot-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body #jjbot-panel > header {
    min-height: 44px;
    padding: 2px 10px;
  }
  body #jjbot-panel > header [data-bot-maximize] {
    display: none;
  }
  body #jjbot-panel .jjbot-channels {
    padding: 0 12px;
  }
  body #jjbot-panel .jjbot-channels button {
    min-height: 44px;
    font-size: 13px;
  }
  body #jjbot-panel .jjbot-commandbar {
    padding: 0 8px;
    min-height: 44px;
  }
  body #jjbot-panel .jjbot-commandbar button {
    min-height: 40px;
    min-width: 40px;
  }
  body #jjbot-panel .jjbot-room-heading {
    position: static;
  }
  body #jjbot-panel .jjbot-body {
    padding: 12px;
  }
  body #jjbot-panel .jjbot-room-list > button {
    padding: 10px 4px;
    min-height: 72px;
  }
  body #jjbot-panel .jjbot-compose {
    padding: 8px 10px;
  }
  body #jjbot-panel textarea {
    min-height: 42px;
    max-height: 100px;
    font-size: 15px;
  }
  body #jjbot-panel .jjbot-menu {
    top: 132px;
  }
  body .ops-content {
    padding: 14px 12px 24px;
  }
  body .ops-page-heading {
    margin-bottom: 16px;
  }
  body .ops-page-heading h1 {
    font-size: 22px;
  }
  body .attendance-empty {
    padding: 22px 14px;
    min-height: 150px;
  }
  body .attendance-empty-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
  }
  body .attendance-empty h3 {
    font-size: 15px;
  }
  body .attendance-empty p {
    font-size: 12px;
    line-height: 1.5;
    margin: 5px 0;
  }
  body .video-intro {
    padding: 12px 0;
  }
  body .video-intro h1 {
    font-size: 22px;
  }
  body .video-intro p {
    font-size: 12px;
  }
}
.ops-mobile-navigation {
  display: none;
}
@media (max-width: 700px) {
  body .ops-module-nav {
    padding: 8px 12px;
    gap: 8px;
    overflow: visible;
  }
  body .ops-module-nav > a,
  body .ops-module-nav > .ops-module-label {
    display: none;
  }
  body .ops-mobile-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    min-width: 0;
  }
  body .ops-mobile-navigation > span {
    font-size: 11px;
    color: #74839c;
  }
  body .ops-mobile-navigation select {
    width: 135px;
    min-height: 44px;
    font: inherit;
    font-size: 14px;
    border: 1px solid #dce3ef;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
  }
  body .ops-module-nav > button {
    min-height: 44px;
    font-size: 12px;
    padding: 8px;
    gap: 4px;
  }
  body .ops-module-nav > button svg {
    width: 17px;
    height: 17px;
  }
  body .ops-eyebrow {
    display: none;
  }
  body .fm-header {
    padding: 12px 14px;
  }
  body .fm-header h2 {
    font-size: 19px;
  }
  body .fm-header p {
    display: none;
  }
  body .fm-header img {
    width: 32px;
    height: 32px;
  }
}
@media (max-width: 700px) {
  html body.has-utility-dock .planbar,
  body .planbar {
    position: static;
    width: auto;
    height: auto;
    z-index: auto;
    margin: 12px 0;
    border-top: 0;
    background: transparent;
  }
  body .mobile-agenda .class-open,
  body .mobile-agenda .student-chips button {
    min-height: 44px;
  }
  body .directory-table td:first-child button {
    min-height: 36px;
  }
}

/* Mobile timetable v2: overview first, details on demand. */
.ms-controls,
.ms-schedule {
  display: none;
}
.ms-sheet {
  width: min(560px, calc(100vw - 20px));
  max-height: min(88dvh, 850px);
  padding: 0;
  border: 1px solid #dce4f1;
  border-radius: 24px;
  color: #20334d;
  background: #fff;
  box-shadow: 0 24px 80px #172e5a26;
}
.ms-sheet::backdrop {
  background: #14233f66;
}
.ms-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e9edf5;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
.ms-sheet h2 {
  font-size: 19px;
  margin: 0;
}
.ms-sheet button {
  min-height: 44px;
}
.ms-sheet [data-ms-close] {
  padding: 10px;
  border: 0;
  background: #f2f5fa;
  border-radius: 50%;
  width: 44px;
}
.ms-sheet-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px;
  padding: 0 12px;
  border: 1px solid #cad5e7;
  border-radius: 12px;
}
.ms-sheet-search input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  font: inherit;
}
.ms-sheet-search input:focus {
  outline: none;
}
.ms-sheet-search:focus-within {
  outline: 2px solid #3155e7;
}
.ms-sheet-search svg {
  width: 20px;
  flex: none;
}
.ms-sheet-list {
  padding: 0 16px 16px;
}
.ms-sheet .ms-teacher-option {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf0f6;
  min-height: 60px;
  gap: 10px;
}
.ms-sheet .ms-teacher-option[hidden] {
  display: none;
}
.ms-teacher-option button {
  border: 0;
  background: transparent;
  padding: 10px;
}
.ms-teacher-option [data-ms-pick] {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-align: left;
}
.ms-teacher-option i {
  width: 10px;
  height: 28px;
  border-radius: 4px;
  flex: none;
}
.ms-teacher-option [aria-pressed="true"] {
  color: #3155e7;
  background: #eef2ff;
  border-radius: 10px;
}
.ms-sheet footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  color: #60718b;
  background: #f5f7fb;
  font-size: 12px;
}
.ms-sheet svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  flex: none;
}
.ms-class-list {
  padding-top: 12px;
}
.ms-class-list .class-card {
  height: auto;
  margin-bottom: 10px;
}
.ms-class-list .class-open {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.ms-class-list .class-open strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.ms-class-list .class-meta {
  white-space: normal;
}
.ms-class-list .class-pencil {
  display: none;
}
.ms-class-list .student-chips {
  height: auto;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  body .schedule-page .board-scroll,
  body.board-focus .schedule-page .board-scroll {
    display: none !important;
  }
  body .schedule-page .schedule-filterline .teacher-strip,
  body .schedule-page .schedule-filterline .board-controls {
    display: none !important;
  }
  body .schedule-page .schedule-filterline .schedule-filters {
    gap: 6px;
  }
  body .schedule-page .schedule-filterline .time-trigger {
    display: flex;
  }
  body .schedule-page .ms-controls {
    display: block;
    margin-top: 4px;
  }
  body .ms-primary {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  body .ms-primary .mobile-view-switch {
    margin-right: auto;
  }
  body .ms-primary .mobile-view-switch button {
    padding: 6px 14px;
    min-height: 38px;
    font-size: 13px;
  }
  body .ms-primary > button {
    min-height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
  }
  body .ms-primary > button.active {
    color: #3155e7;
    background: #eef2ff;
  }
  body .ms-primary svg {
    width: 18px;
    height: 18px;
  }
  body .ms-now {
    color: #3155e7;
  }
  body .ms-teachers {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f2;
  }
  body .ms-teachers button {
    display: flex;
    gap: 5px;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    flex: none;
    border-radius: 10px;
    background: transparent;
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  body .ms-teachers .ms-teacher-picker {
    padding: 6px;
    width: 40px;
  }
  body .ms-teacher-picker img {
    display: block;
    object-fit: contain;
  }
  body .ms-teachers .ms-all {
    padding: 8px;
  }
  body .ms-teacher-scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 3px;
    min-width: 0;
    overscroll-behavior-x: contain;
  }
  body .ms-teachers [aria-pressed="true"] {
    background: #eaf0ff;
    color: #2449d7;
    font-weight: 750;
  }
  body .ms-teachers i {
    background: var(--teacher);
    width: 5px;
    height: 15px;
    border-radius: 3px;
    flex: none;
  }
  body .ms-teachers .ms-pinned {
    background: #fff;
    border: 1px solid #d9e2f1;
    max-width: 126px;
  }
  body .ms-pinned span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body .ms-teachers svg {
    width: 12px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }
  body .ms-view-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 46px;
  }
  body .ms-view-tools button {
    min-height: 44px;
    border: 0;
    background: transparent;
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  body .ms-view-tools > button:first-child {
    padding-left: 0;
    margin-right: auto;
  }
  body .ms-view-tools svg {
    width: 17px;
    height: 17px;
  }
  body .ms-zoom {
    display: flex;
    align-items: center;
  }
  body .ms-zoom button {
    min-width: 32px;
    font-size: 21px;
    padding: 5px;
  }
  body .ms-zoom .ms-zoom-value {
    font-size: 12px;
    min-width: 46px;
    font-variant-numeric: tabular-nums;
    color: #405574;
  }
  body .ms-view-tools .ms-full {
    width: 38px;
    padding: 6px;
  }
  body .ms-view-tools .ms-full svg {
    width: 20px;
    height: 20px;
  }
  body .ms-schedule {
    display: block;
    overflow: auto;
    overscroll-behavior: contain;
    min-height: 220px;
    height: 450px;
    position: relative;
    border: 1px solid #dce4f1;
    border-radius: 14px;
    background: white;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
  }
  body .ms-schedule-content {
    width: max(100%, calc(var(--ms-base-width) * var(--ms-scale)));
    min-width: 100%;
    position: relative;
  }
  body .ms-days {
    display: grid;
    grid-template-columns: repeat(var(--ms-days), minmax(0, 1fr));
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid #dce4f1;
  }
  body .ms-days button {
    min-width: 0;
    min-height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 0;
    font-size: 13px;
    color: #60718b;
  }
  body .ms-days [aria-current="date"] {
    color: #3155e7;
    font-weight: 800;
    box-shadow: inset 0 -3px #3155e7;
  }
  body .ms-days .active {
    background: #eaf0ff;
    color: #3155e7;
    font-weight: 750;
  }
  body .ms-time-group {
    margin: 0;
  }
  body .ms-time-group h3 {
    margin: 0;
  }
  body .ms-time-group h3 button {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    gap: 8px;
    min-height: 44px;
    padding: 7px 12px;
    border: 0;
    border-top: 1px solid #e5ebf5;
    border-radius: 0;
    background: #f6f8fc;
  }
  body .ms-time-group h3 time {
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  body .ms-time-group h3 span {
    font-size: 11px;
    font-weight: 500;
    color: #687c96;
  }
  body .ms-time-group h3 em {
    font-style: normal;
    font-size: 10px;
    color: #3155e7;
    background: #e5ecff;
    padding: 2px 5px;
    border-radius: 4px;
  }
  body .ms-time-group h3 svg {
    width: 17px;
    height: 17px;
    margin-left: auto;
    fill: none;
    stroke: #60718b;
    stroke-width: 1.8;
  }
  body .ms-time-group h3 [aria-expanded="false"] svg {
    transform: rotate(-90deg);
  }
  body .ms-empty {
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }
  body .ms-empty svg {
    width: 32px;
    height: 32px;
    color: #92a7c7;
  }
  body .ms-empty span {
    font-size: 13px;
    color: #6b7e99;
  }
  body .ms-day-view .ms-time-content {
    padding: 8px;
  }
  body .ms-day-view .class-card {
    height: auto;
    min-height: 0;
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 12px;
  }
  body .ms-day-view .class-open {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    font-size: 15px;
    gap: 10px;
  }
  body .ms-day-view .class-open strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body .ms-day-view .class-open > span {
    flex: none;
    font-size: 12px;
  }
  body .ms-day-view .class-pencil {
    display: none;
  }
  body .ms-day-view .class-meta {
    white-space: normal;
    font-size: 12px;
    margin: 2px 0 6px;
    line-height: 1.5;
  }
  body .ms-day-view .student-chips {
    height: auto;
    flex-wrap: wrap;
    gap: 5px;
  }
  body .ms-day-view .student-chips button {
    min-height: 40px;
    font-size: 13px;
    padding: 6px 8px;
  }
  body .ms-sheet {
    margin: auto auto 0;
    width: 100%;
    max-width: 100%;
    max-height: 85dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.board-focus #jj-utility-dock,
  body.board-focus .planbar {
    display: none !important;
  }
  body.board-focus #main {
    padding: 4px 8px 8px;
  }
  body.board-focus .ms-schedule {
    border-radius: 10px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ms-teachers button,
  .ms-cell {
    transition:
      background-color 0.16s ease,
      color 0.16s ease;
  }
  .ms-time-group h3 svg {
    transition: transform 0.18s ease;
  }
  .ms-time-content:not([hidden]) {
    animation: ms-reveal 0.16s ease-out;
  }
  .ms-sheet[open] {
    animation: ms-sheet-in 0.2s ease-out;
  }
  @keyframes ms-reveal {
    from {
      opacity: 0.45;
      transform: translateY(-3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes ms-sheet-in {
    from {
      opacity: 0.5;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media (max-width: 700px) {
  body .schedule-page[data-mobile-layout="week"] .board-scroll,
  body .schedule-page[data-mobile-layout="day"] .board-scroll {
    display: none !important;
  }
  body .ms-full span {
    display: none;
  }
}
@media (max-width: 700px) {
  body .ms-earlier > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: #60718b;
    background: #f8faff;
    font-size: 12px;
    list-style: none;
    cursor: pointer;
  }
  body .ms-earlier > summary::-webkit-details-marker {
    display: none;
  }
  body .ms-earlier > summary svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }
  body .ms-earlier > summary svg:last-child {
    margin-left: auto;
  }
}
@media (max-width: 700px) {
  body .ms-personal-cell strong {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }
}

/* Keep every class and teacher visible: zoom changes the grid, never its content. */
@media (max-width: 700px) {
  body .ms-grid-head,
  body .ms-teacher-row {
    display: grid;
    grid-template-columns: calc(86px * var(--ms-scale)) repeat(
        var(--ms-days),
        minmax(0, 1fr)
      );
  }
  body .ms-grid-head button {
    font-size: calc(13px * var(--ms-scale));
    min-height: max(28px, calc(38px * var(--ms-scale)));
  }
  body .ms-teacher-heading,
  body .ms-row-name {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f7f9fd;
    border-right: 1px solid #dce4f1;
    display: flex;
    align-items: center;
    gap: calc(6px * var(--ms-scale));
    padding: calc(9px * var(--ms-scale));
    font-size: calc(12px * var(--ms-scale));
    font-weight: 700;
    text-align: left;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body .ms-teacher-heading {
    z-index: 4;
    justify-content: center;
    color: #60718b;
  }
  body .ms-row-name i {
    width: calc(3px * var(--ms-scale));
    height: calc(25px * var(--ms-scale));
    background: var(--teacher);
    border-radius: 3px;
    flex-shrink: 0;
  }
  body .ms-row-name small {
    display: block;
    font-size: calc(9px * var(--ms-scale));
    font-weight: 500;
    color: #78869c;
    margin-top: calc(3px * var(--ms-scale));
  }
  body .ms-teacher-row {
    border-bottom: 1px solid #e4eaf4;
  }
  body .ms-grid-cell {
    min-width: 0;
    border-right: 1px solid #e4eaf4;
    padding: calc(4px * var(--ms-scale));
    display: flex;
    flex-direction: column;
    gap: calc(4px * var(--ms-scale));
  }
  body .ms-class {
    width: 100%;
    min-width: 0;
    min-height: calc(72px * var(--ms-scale));
    padding: calc(8px * var(--ms-scale));
    border: 1px solid #e1e7f2;
    border-left: calc(3px * var(--ms-scale)) solid var(--teacher);
    border-radius: calc(7px * var(--ms-scale));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: calc(6px * var(--ms-scale));
    text-align: left;
    background: #f9fbff;
    color: #172943;
    white-space: normal;
  }
  body .ms-class strong {
    font-size: calc(13px * var(--ms-scale));
    line-height: 1.4;
    font-weight: 750;
    overflow-wrap: anywhere;
  }
  body .ms-class:active {
    background: #eaf0ff;
  }
  body .ms-class-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(3px * var(--ms-scale));
    color: #6d7f99;
    font-size: calc(10px * var(--ms-scale));
    line-height: 1.4;
  }
  body .ms-class-meta svg {
    width: calc(11px * var(--ms-scale));
    height: calc(11px * var(--ms-scale));
  }
  body .ms-class-meta > span {
    flex-basis: 100%;
  }
  body .ms-class-teacher {
    font-size: calc(10px * var(--ms-scale));
    font-weight: 650;
    color: var(--teacher);
  }
  body .ms-grid-empty {
    display: grid;
    flex: 1;
    place-items: center;
    min-height: calc(72px * var(--ms-scale));
    color: #cbd5e5;
    font-size: calc(12px * var(--ms-scale));
  }
  body .ms-time-group h3 {
    position: sticky;
    left: 0;
    width: var(--ms-viewport, 100%);
  }
  body .ms-day-view .ms-schedule-content {
    width: 100%;
  }
}
