.learning-timetable-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #f5f7f8;
}

.learning-timetable-toolbar,
.learning-week-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #c8d2d8;
  background: #ffffff;
}

.learning-timetable-title h2 {
  margin: 0 0 3px;
  font-size: 19px;
  letter-spacing: 0;
}

.learning-timetable-title span,
.learning-week-range {
  color: #52636d;
  font-size: 13px;
}

.learning-week-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.learning-identity-controls,
.learning-week-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.learning-identity-controls label,
.learning-week-actions label {
  display: grid;
  gap: 4px;
  color: #42525b;
  font-size: 12px;
}

.learning-identity-controls select,
.learning-week-actions input,
.learning-week-actions button {
  min-height: 38px;
}

.learning-day-tabs {
  display: none;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid #c8d2d8;
  background: #eef2f4;
}

.learning-day-tabs button {
  display: grid;
  min-width: 66px;
  min-height: 44px;
  place-items: center;
  gap: 2px;
  border: 1px solid #b7c5cc;
  border-radius: 4px;
  background: #ffffff;
}

.learning-day-tabs button[aria-selected="true"] {
  border-color: #267287;
  background: #267287;
  color: #ffffff;
}

.learning-day-tabs span {
  font-size: 11px;
}

.learning-table-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}

.learning-week-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
}

.learning-week-table th,
.learning-week-table td {
  border-right: 1px solid #ced7dc;
  border-bottom: 1px solid #ced7dc;
  vertical-align: top;
}

.learning-week-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 52px;
  padding: 8px 6px;
  background: #213644;
  color: #ffffff;
  text-align: center;
}

.learning-week-table thead th:first-child {
  width: 104px;
}

.learning-week-table thead th:nth-child(2) {
  width: 82px;
}

.learning-week-table thead th span {
  display: block;
  margin-top: 3px;
  color: #c9d7de;
  font-size: 11px;
}

.learning-week-table tbody > tr > th {
  height: 84px;
  padding: 10px 6px;
  background: #edf2f4;
  color: #31444f;
  text-align: center;
  font-size: 12px;
}

.learning-week-table tbody td {
  height: 84px;
  padding: 5px;
  background: #ffffff;
}

.learning-display-period > th {
  height: 38px !important;
  padding: 8px 6px !important;
  background: #e6ebed !important;
}

.learning-display-period td {
  height: 38px !important;
  padding: 8px !important;
  background: #f1f3f2 !important;
  color: #53636b;
  text-align: center;
  font-weight: 700;
}

.learning-course {
  display: grid;
  width: 100%;
  min-height: 76px;
  align-content: start;
  gap: 4px;
  padding: 6px 7px;
  border: 1px solid #c3d0d6;
  border-left: 5px solid var(--course-accent);
  border-radius: 4px;
  background: #f9fbfb;
  color: #1d303a;
  text-align: left;
}

.learning-course:hover,
.learning-course:focus-visible {
  border-color: var(--course-accent);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(32, 55, 67, 0.14);
}

.learning-course-main,
.learning-course-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.learning-course-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.learning-course-action {
  flex: 0 0 auto;
  color: #2a697c;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.learning-course-meta {
  justify-content: flex-start;
  color: #52656e;
  font-size: 11px;
  line-height: 1.2;
}

.learning-course-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-course-meta > span + span::before {
  margin-right: 6px;
  color: #a2afb5;
  content: "·";
}

.learning-course-badges {
  display: flex;
  min-width: 0;
  gap: 4px;
  margin-top: 1px;
}

.learning-resource-chip,
.learning-course-badges > span {
  display: flex;
  min-width: 0;
  min-height: 27px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 4px;
  border: 1px solid #d4dde1;
  border-radius: 3px;
  background: #ffffff;
  color: #53636b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.learning-course-badges b {
  font-size: 12px;
}

.learning-course-badges em {
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  text-overflow: ellipsis;
}

.learning-course-badges .courseware-chip.has-content {
  border-color: #2d879d;
  background: #dff3f7;
  color: #0d5d72;
}

.learning-course-badges .homework-chip.has-content {
  border-color: #d38a2e;
  background: #fff0cf;
  color: #7a4709;
}

.learning-course-badges > .is-empty {
  border-color: #d9e0e3;
  background: #f3f6f7;
  color: #78868d;
}

.learning-course-badges .learning-submit-count {
  border-color: #be842f;
  background: #fff8e9;
  color: #805314;
}

.learning-course-badges .learning-submit-count:not(.is-empty) {
  background: #e8f2df;
  border-color: #78a052;
  color: #41672e;
}

.learning-status {
  display: flex;
  width: auto;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
}
.status-submitted {
  background: #fff1cf;
  color: #79500f;
}

.status-reviewed {
  background: #e2f0df;
  color: #35622f;
}

.status-redo {
  background: #f8e1e1;
  color: #8a3636;
}

.learning-loading,
.learning-empty {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: #667780;
}

.learning-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(21, 34, 42, 0.42);
}

.learning-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(760px, 96vw);
  height: 100vh;
  overflow: auto;
  border-left: 1px solid #aebdc4;
  background: #ffffff;
  box-shadow: -8px 0 24px rgba(22, 40, 50, 0.2);
}

.learning-detail-drawer[hidden],
.learning-detail-backdrop[hidden] {
  display: none;
}

.learning-drawer-open {
  overflow: hidden;
}

.learning-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #c8d2d8;
  background: #213644;
  color: #ffffff;
}

.learning-detail-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.learning-detail-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: #81949e;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.learning-detail-summary {
  padding: 16px;
  border-bottom: 1px solid #d5dde1;
  background: #eef3f5;
}

.learning-detail-summary > strong {
  display: block;
  margin-bottom: 8px;
  color: #1e3541;
  font-size: 18px;
}

.learning-detail-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: #52636d;
  font-size: 12px;
}

.learning-detail-section {
  padding: 16px;
  border-bottom: 1px solid #d5dde1;
}

.learning-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.learning-section-heading h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.learning-section-heading > span,
.learning-list-empty {
  color: #687981;
  font-size: 12px;
}

.learning-file-list {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.learning-file-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d4dde1;
  border-radius: 4px;
  background: #f8fafb;
}

.learning-file-list li > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.learning-file-list a {
  overflow-wrap: anywhere;
  color: #1e687d;
  font-weight: 700;
}

.learning-file-list span {
  color: #6a7980;
  font-size: 11px;
}

.learning-file-list.compact {
  margin-top: 8px;
}

.learning-upload-form,
.learning-homework-form,
.learning-review-form {
  display: grid;
  gap: 9px;
}

.learning-upload-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding-top: 8px;
}

.learning-upload-form input[type="file"] {
  min-width: 0;
  padding: 8px;
  border: 1px dashed #9aabb3;
  border-radius: 4px;
  background: #f8fafb;
}

.learning-homework-form label,
.learning-review-form label {
  display: grid;
  gap: 4px;
  color: #445760;
  font-size: 12px;
}

.learning-homework-form textarea,
.learning-review-form textarea {
  resize: vertical;
}

.learning-homework-form button,
.learning-review-form button {
  width: fit-content;
}

.learning-submission-list {
  display: grid;
  gap: 10px;
}

.learning-submission-row {
  padding: 12px 0;
  border-top: 1px solid #d9e0e3;
}

.learning-submission-row:first-child {
  border-top: 0;
}

.learning-submission-row > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.learning-submission-row > header > div {
  display: grid;
  gap: 3px;
}

.learning-submission-row > header span:not(.learning-status),
.learning-homework-copy span,
.learning-my-submission > div > span:not(.learning-status) {
  color: #6a7980;
  font-size: 11px;
}

.learning-homework-copy {
  margin-bottom: 10px;
  padding: 10px;
  border-left: 4px solid #be842f;
  background: #fff9ec;
}

.learning-homework-copy p,
.learning-feedback p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.learning-my-submission > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.learning-feedback {
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid #6f924e;
  background: #f0f7ee;
}

@media (max-width: 960px) {
  .learning-timetable-toolbar,
  .learning-week-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-identity-controls,
  .learning-week-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .learning-day-tabs {
    display: flex;
  }

  .learning-timetable-title h2 {
    font-size: 17px;
  }

  .learning-identity-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .learning-week-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .learning-week-actions label,
  .learning-week-range {
    grid-column: 1 / -1;
  }

  .learning-week-table {
    min-width: 100%;
  }

  .learning-week-table .learning-day-column:not(.is-selected-day) {
    display: none;
  }

  .learning-week-table thead th:first-child {
    width: 82px;
  }

  .learning-week-table thead th:nth-child(2) {
    width: 66px;
  }

  .learning-week-table tbody > tr > th {
    padding: 8px 3px;
    font-size: 11px;
  }

  .learning-detail-drawer {
    width: 100%;
    max-width: none;
    border-left: 0;
  }

  .learning-upload-form {
    grid-template-columns: 1fr;
  }

  .learning-upload-form button,
  .learning-homework-form button,
  .learning-review-form button {
    width: 100%;
    min-height: 42px;
  }

  .learning-file-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-file-list li button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .learning-course {
    gap: 3px;
    padding: 5px;
  }

  .learning-course-main strong {
    font-size: 13px;
  }

  .learning-course-action,
  .learning-course-meta {
    font-size: 10px;
  }

  .learning-course-badges {
    gap: 2px;
  }

  .learning-course-badges > span {
    min-height: 32px;
    flex-direction: column;
    gap: 1px;
    padding: 2px;
    white-space: normal;
  }

  .learning-course-badges b,
  .learning-course-badges em {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.1;
  }
}
/* Responsive scroll system */
.learning-timetable-toolbar,
.learning-week-toolbar {
  flex: 0 0 auto;
}

.learning-day-tabs {
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.learning-day-tabs button {
  scroll-snap-align: start;
}

.learning-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.learning-table-wrap::-webkit-scrollbar-track {
  background: #e7ecef;
}

.learning-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #e7ecef;
  border-radius: 6px;
  background: #71858f;
}

.learning-week-table thead th:first-child {
  left: 0;
  z-index: 6;
}

.learning-week-table thead th:nth-child(2) {
  left: 104px;
  z-index: 6;
}

.learning-week-table tbody > tr > th:first-child,
.learning-week-table tbody > tr > th:nth-child(2) {
  position: sticky;
  z-index: 2;
}

.learning-week-table tbody > tr > th:first-child {
  left: 0;
}

.learning-week-table tbody > tr > th:nth-child(2) {
  left: 104px;
}

.learning-week-meta {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
}

.learning-scroll-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.learning-scroll-controls button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.learning-scroll-controls button:disabled {
  cursor: default;
  opacity: 0.38;
}

.learning-detail-drawer {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.learning-detail-header {
  flex: 0 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}

#learningDetailContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 960px) {
  .learning-day-tabs {
    display: flex;
  }

  .learning-week-table {
    min-width: 100%;
  }

  .learning-week-table .learning-day-column:not(.is-selected-day) {
    display: none;
  }

  .learning-week-table thead th:first-child {
    width: 88px;
  }

  .learning-week-table thead th:nth-child(2) {
    left: 88px;
    width: 68px;
  }

  .learning-week-table tbody > tr > th:nth-child(2) {
    left: 88px;
  }

  .learning-scroll-controls {
    display: none;
  }
}

@media (max-width: 820px) {
  .learning-timetable-shell {
    height: auto;
    overflow: visible;
  }

  .learning-table-wrap {
    flex: 0 0 auto;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .learning-week-meta {
    justify-content: flex-start;
  }
}
/* Teacher engagement statistics */
.learning-engagement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #d5dde1;
  background: #f1f5f6;
}

.learning-engagement-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid #ced9dd;
  border-radius: 4px;
  background: #ffffff;
}

.learning-engagement-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.learning-engagement-card header strong {
  color: #263e49;
  font-size: 13px;
}

.learning-engagement-card header span,
.learning-engagement-card > p {
  margin: 0;
  color: #738188;
  font-size: 11px;
}

.learning-engagement-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.learning-engagement-metrics.submission-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.learning-engagement-metrics span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 5px 3px;
  border-left: 3px solid #a8b4b9;
  background: #f4f6f7;
  color: #607078;
  font-size: 10px;
  text-align: center;
}

.learning-engagement-metrics b {
  font-size: 17px;
  line-height: 1;
}

.learning-engagement-metrics .is-complete {
  border-color: #5f8f55;
  background: #edf6eb;
  color: #35622f;
}

.learning-engagement-metrics .is-partial {
  border-color: #c28a32;
  background: #fff6e3;
  color: #79500f;
}

.learning-engagement-metrics .is-redo,
.learning-engagement-metrics .is-missing {
  border-color: #b85b57;
  background: #fbeded;
  color: #843c38;
}

.learning-file-list.learning-teacher-materials {
  gap: 8px;
}

.learning-file-list .learning-material-item {
  display: grid;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}

.learning-material-item > .learning-material-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.learning-material-file {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.learning-material-stat {
  border-top: 1px solid #d8e0e3;
}

.learning-material-stat summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 2px 0;
  cursor: pointer;
  color: #435963;
  font-size: 12px;
  font-weight: 700;
  list-style-position: inside;
}

.learning-material-stat summary span {
  margin-right: auto;
  color: #435963;
  font-size: 12px;
}

.learning-material-stat summary strong {
  color: #35622f;
}

.learning-material-stat summary em {
  color: #843c38;
  font-style: normal;
}

.learning-download-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 9px;
}

.learning-download-roster > section {
  padding-left: 9px;
  border-left: 3px solid #6d9a62;
}

.learning-download-roster > section.missing {
  border-left-color: #bd6863;
}

.learning-download-roster h4 {
  margin: 0 0 6px;
  color: #344a55;
  font-size: 12px;
}

.learning-download-roster ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning-download-roster li {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px dashed #d8e0e3;
}

.learning-download-roster li:first-child {
  border-top: 0;
}

.learning-download-roster li strong {
  color: #2c414b;
  font-size: 12px;
}

.learning-download-roster li span,
.learning-download-roster li em {
  color: #697980;
  font-size: 10px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.learning-download-roster li em {
  color: #315f70;
  font-weight: 700;
}

.learning-submission-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.learning-submission-filters button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 4px;
  color: #4b5e67;
  background: #f3f6f7;
}

.learning-submission-filters button b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 10px;
  background: #dfe7ea;
  font-size: 11px;
}

.learning-submission-filters button[aria-pressed="true"] {
  border-color: #2a7184;
  color: #ffffff;
  background: #2a7184;
}

.learning-submission-filters button[aria-pressed="true"] b {
  color: #254b58;
  background: #ffffff;
}

.learning-submission-row[hidden],
.learning-filter-empty[hidden] {
  display: none !important;
}

.learning-filter-empty {
  margin: 8px 0;
}

@media (max-width: 720px) {
  .learning-engagement-grid,
  .learning-download-roster {
    grid-template-columns: 1fr;
  }

  .learning-engagement-grid {
    padding: 10px;
  }

  .learning-material-item > .learning-material-main {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-material-main button {
    width: 100%;
  }

  .learning-material-stat summary {
    flex-wrap: wrap;
  }

  .learning-material-stat summary span {
    flex: 1 1 100%;
  }

  .learning-submission-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-submission-filters button:first-child {
    grid-column: 1 / -1;
  }
}
.learning-review-return {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid #2a7184;
  background: #f1f7f8;
}

.learning-review-return-heading,
.learning-student-feedback-files > strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #2b4e5b;
  font-size: 12px;
}

.learning-review-return-heading span {
  color: #6a7980;
  font-size: 11px;
  font-weight: 400;
}

.learning-review-return .learning-feedback-files {
  margin: 0;
}

.learning-review-return-upload {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: end;
  padding-top: 4px;
}

.learning-review-return-upload .learning-review-file-input {
  grid-column: 1 / -1;
}

.learning-review-file-input input[type="file"] {
  min-width: 0;
  padding: 8px;
  border: 1px dashed #7299a4;
  border-radius: 4px;
  background: #ffffff;
}

.learning-review-return-upload button {
  width: fit-content;
  min-height: 38px;
}

.learning-feedback-files {
  margin-top: 8px;
}

.learning-feedback-files li {
  background: #f4f8f9;
}

.learning-student-feedback-files {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid #2a7184;
  background: #f1f7f8;
}

.learning-student-feedback-files .learning-feedback-files {
  margin: 0;
}

@media (max-width: 720px) {
  .learning-review-return-upload {
    grid-template-columns: 1fr;
  }

  .learning-review-return-upload .learning-review-file-input {
    grid-column: auto;
  }

  .learning-review-return-upload button {
    width: 100%;
  }

  .learning-review-return-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Compact adaptive learning workbench */
@media screen and (min-width: 821px) {
  .learning-timetable-toolbar,
  .learning-week-toolbar {
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
  }

  .learning-timetable-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
  }

  .learning-timetable-title h2 { margin: 0; font-size: 17px; white-space: nowrap; }
  .learning-timetable-title span,
  .learning-week-range { font-size: 12px; }

  .learning-identity-controls,
  .learning-week-actions,
  .learning-week-meta { align-items: center; gap: 6px; }

  .learning-identity-controls label,
  .learning-week-actions label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    white-space: nowrap;
  }

  .learning-identity-controls select,
  .learning-week-actions input,
  .learning-week-actions button {
    min-height: 34px;
    height: 34px;
    padding: 4px 7px;
  }

  .learning-identity-controls select { width: 156px; }
  .learning-identity-controls label:last-child select { width: 180px; }
  .learning-week-actions input { width: 140px; }

  .learning-scroll-controls { gap: 3px; }
  .learning-scroll-controls button { width: 34px; height: 34px; }
}

@media screen and (min-width: 821px) and (max-width: 960px) {
  .learning-timetable-toolbar,
  .learning-week-toolbar {
    align-items: center;
    flex-direction: row;
  }

  .learning-timetable-title span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .learning-identity-controls select { width: 128px; }
  .learning-identity-controls label:last-child select { width: 148px; }
  .learning-week-range { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media screen and (min-width: 821px) and (max-height: 720px) {
  .learning-timetable-toolbar,
  .learning-week-toolbar {
    min-height: 42px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .learning-timetable-title span { display: none; }
  .learning-identity-controls select,
  .learning-week-actions input,
  .learning-week-actions button { min-height: 32px; height: 32px; }
  .learning-scroll-controls button { width: 32px; height: 32px; }
}

@media screen and (max-width: 820px) {
  .learning-timetable-toolbar,
  .learning-week-toolbar {
    gap: 7px;
    padding: 7px 8px;
  }

  .learning-timetable-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px;
  }
  .learning-timetable-title h2 { margin: 0; font-size: 17px; white-space: nowrap; }
  .learning-timetable-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .learning-identity-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .learning-identity-controls label { min-width: 0; margin: 0; }

  .learning-week-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }
  .learning-week-actions > button:nth-of-type(1) { grid-column: 1 / 3; }
  .learning-week-actions > button:nth-of-type(2) { grid-column: 3 / 5; }
  .learning-week-actions > button:nth-of-type(3) { grid-column: 5 / 7; }
  .learning-week-actions label {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 5px;
    margin: 0;
    white-space: nowrap;
  }
  .learning-week-actions label input { min-width: 0; flex: 1; }

  .learning-week-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .learning-week-range { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .learning-scroll-controls { flex: 0 0 auto; }
  .learning-scroll-controls button { width: 44px; height: 44px; }

  .learning-day-tabs {
    gap: 4px;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  }

  .learning-week-table,
  .learning-week-table thead,
  .learning-week-table tbody {
    display: block;
    width: 100%;
  }

  .learning-week-table tr {
    display: grid;
    width: 100%;
    grid-template-columns: 88px 68px minmax(0, 1fr);
  }

  .learning-week-table th,
  .learning-week-table td {
    width: auto !important;
    min-width: 0;
  }

  .learning-week-table thead th,
  .learning-week-table tbody > tr > th {
    position: static;
  }

  .learning-display-period td { grid-column: 3; }
}

@media screen and (max-width: 360px) {
  .learning-timetable-title span { display: none; }
  .learning-scroll-controls button { width: 40px; }
}
