:root {
  --portal-sidebar-width: 260px;
  --portal-topbar-height: 84px;
}

/* Learning records, weekly notices, and printable monthly reports */

.admin-report-import-actions,
.admin-report-monthly-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-report-import-actions label {
  cursor: pointer;
}

.admin-report-controls .admin-filter-fields {
  align-items: end;
}

.admin-report-controls input[type="month"] {
  min-width: 154px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-report-period-field {
  display: grid;
  gap: 6px;
}

.admin-report-period-field > span,
.admin-report-import-note {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.admin-report-period-field > span {
  font-weight: 700;
}

.admin-report-import-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  line-height: 1.65;
}

.admin-master-detail.admin-report-workspace {
  gap: 20px;
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, 0.72fr);
}

.admin-report-record-form {
  margin-top: 22px;
}

.admin-report-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px 0 4px;
  border: 0;
  border-top: 1px solid var(--line);
}

.admin-report-fieldset legend {
  padding: 0 10px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-report-session-grid textarea {
  min-height: 84px;
}

.admin-report-score-grid {
  display: grid;
}

.admin-report-score-row {
  display: grid;
  min-width: 0;
  align-items: end;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 64px minmax(84px, 0.7fr) repeat(2, minmax(100px, 1fr)) 62px;
}

.admin-report-score-row:last-child {
  border-bottom: 0;
}

.admin-report-score-row > strong,
.admin-report-score-row > span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.admin-report-score-row > span {
  justify-content: flex-end;
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.admin-report-score-row label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-report-score-row :where(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-report-output {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 20px;
}

.admin-report-weekly-preview > pre:not(.sr-only),
.weekly-report-preview > pre:not(.sr-only) {
  overflow: auto;
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--sky-soft);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: keep-all;
}

.admin-report-monthly-summary {
  display: grid;
  margin: 18px 0 0;
  border-block: 1px solid var(--line);
}

.admin-report-monthly-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.admin-report-monthly-summary > div:last-child {
  border-bottom: 0;
}

.admin-report-monthly-summary dt,
.admin-report-monthly-note {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.admin-report-monthly-summary dd {
  margin: 0;
  font-weight: 700;
}

.admin-report-monthly-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sky-soft);
  line-height: 1.65;
}

.admin-report-monthly-heading {
  align-items: flex-start;
}

.admin-report-monthly-progress {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow-soft);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-report-monthly-kpis {
  display: grid;
  margin-top: 22px;
  border-block: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-report-monthly-kpis > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 18px 20px;
  border-inline-end: 1px solid var(--line);
}

.admin-report-monthly-kpis > div:first-child {
  padding-inline-start: 0;
}

.admin-report-monthly-kpis > div:last-child {
  padding-inline-end: 0;
  border-inline-end: 0;
}

.admin-report-monthly-kpis span,
.admin-report-monthly-kpis small,
.admin-report-monthly-section-head p,
.admin-report-monthly-week dt {
  color: var(--ink-soft);
}

.admin-report-monthly-kpis span,
.admin-report-monthly-week dt {
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-report-monthly-kpis strong {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-report-monthly-kpis small {
  overflow-wrap: anywhere;
  font-size: 0.74rem;
}

.admin-report-monthly-weeks {
  margin-top: 26px;
}

.admin-report-monthly-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
}

.admin-report-monthly-section-head h3,
.admin-report-monthly-section-head p {
  margin: 0;
}

.admin-report-monthly-section-head h3 {
  font-size: 1rem;
  font-weight: 700;
}

.admin-report-monthly-section-head p {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.55;
}

.admin-report-monthly-section-head > strong {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-report-monthly-week-list {
  border-top: 1px solid var(--line-strong);
}

.admin-report-monthly-week {
  display: grid;
  min-width: 0;
  gap: 22px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(112px, 0.28fr) minmax(0, 1.72fr);
}

.admin-report-monthly-week.is-missing {
  color: var(--ink-soft);
}

.admin-report-monthly-week-label {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-report-monthly-week-label > strong {
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-report-monthly-week dl {
  display: grid;
  min-width: 0;
  margin: 0;
  gap: 12px;
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.85fr) minmax(90px, 0.45fr);
}

.admin-report-monthly-week dl > div {
  min-width: 0;
}

.admin-report-monthly-week dt,
.admin-report-monthly-week dd {
  margin: 0;
}

.admin-report-monthly-week dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.admin-report-monthly-actions {
  margin-top: 20px;
}

.admin-report-monthly-actions > .button {
  flex: 1 1 150px;
}

.admin-report-history {
  overflow: hidden;
}

.admin-report-history .admin-table-wrap {
  margin: 20px -24px -24px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.admin-report-history .admin-table th:first-child,
.admin-report-history .admin-table td:first-child {
  padding-left: 24px;
}

.admin-report-history .admin-table th:last-child,
.admin-report-history .admin-table td:last-child {
  padding-right: 24px;
}

.admin-report-workbench {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 20px;
  grid-template-columns: minmax(240px, 0.56fr) minmax(0, 1.44fr);
}

.admin-report-workbench.is-individual {
  grid-template-columns: minmax(0, 1fr);
}

.admin-report-roster {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.admin-report-roster-list {
  display: grid;
  max-height: 520px;
  margin: 16px -8px;
  overflow: auto;
  scrollbar-color: var(--ink) var(--sky-soft);
  scrollbar-width: thin;
}

.admin-report-roster-item {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: transparent;
  text-align: left;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-report-roster-item:hover,
.admin-report-roster-item.active {
  border-color: var(--line-strong);
  background: var(--sky-soft);
}

.admin-report-roster-item span,
.admin-report-roster-item strong,
.admin-report-roster-item small {
  display: block;
  min-width: 0;
}

.admin-report-roster-item small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-report-roster-item em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-style: normal;
}

.admin-report-roster-item[data-report-ready="true"] em {
  color: var(--ink);
}

.admin-report-batch-button {
  width: 100%;
}

.admin-report-roster-help {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.55;
}

.admin-report-lesson-rows {
  display: grid;
}

.admin-report-lesson-rows > div {
  display: grid;
  min-width: 0;
  align-items: end;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 64px minmax(145px, 0.8fr) minmax(90px, 0.55fr) minmax(220px, 1.65fr);
}

.admin-report-lesson-rows > div:last-child {
  border-bottom: 0;
}

.admin-report-lesson-rows strong {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.admin-report-lesson-rows label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-report-lesson-rows :where(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-report-weekly-preview {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.admin-alimtalk-preview {
  width: min(100%, 470px);
  margin: 18px auto 0;
  padding: 14px;
  background: #c4d6e5;
}

.admin-alimtalk-preview-title {
  padding: 11px 16px;
  color: #101820;
  background: #fee500;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.admin-alimtalk-preview-body {
  min-height: 360px;
  padding: 16px;
  background: #fff;
}

.admin-alimtalk-preview-body > p {
  margin: 0;
  color: #6e7378;
  font-size: 0.82rem;
}

.admin-alimtalk-preview-body > h3 {
  margin: 6px 0 28px;
  color: #0b0d10;
  font-size: 1.65rem;
  font-weight: 700;
}

.admin-alimtalk-preview-body > pre {
  margin: 0;
  overflow: visible;
  color: #0b0d10;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: keep-all;
}

.admin-report-preview-actions,
.admin-report-dispatch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.admin-report-dispatch-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-report-dispatch-actions p {
  flex: 1 1 300px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.admin-optional-label {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 400;
}

.admin-class-members {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.admin-class-member-list {
  display: grid;
  margin-top: 14px;
}

.admin-class-member-list > div {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-class-member-list > div:last-child {
  border-bottom: 0;
}

.admin-class-member-list strong,
.admin-class-member-list small {
  display: block;
}

.admin-class-member-list small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.portal-dialog-report {
  width: min(1180px, calc(100% - 32px));
  max-height: calc(100dvh - 24px);
}

.portal-dialog-report .portal-dialog-card {
  max-height: calc(100dvh - 24px);
}

.portal-dialog-report .portal-dialog-body {
  padding: 28px;
  background: #e9eef3;
}

.portal-dialog-weekly-report {
  width: min(720px, calc(100% - 32px));
}

.weekly-report-preview {
  display: grid;
  gap: 18px;
}

.weekly-report-meta {
  display: grid;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.weekly-report-meta > span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.weekly-report-meta > strong {
  font-size: 1.25rem;
}

.weekly-report-meta p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.weekly-report-preview pre {
  margin: 0;
}

.learning-report-document {
  display: grid;
  width: min(900px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 44px 50px 38px;
  gap: 30px;
  color: #193553;
  background: #fff;
  box-shadow: 0 4px 12px rgba(21, 50, 81, 0.14);
}

.learning-report-document-head {
  display: grid;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 3px solid #27496f;
}

.learning-report-document-head > div,
.learning-report-document-head > p {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.learning-report-document-head > div > strong {
  font-size: 0.8rem;
}

.learning-report-document-head > div > span {
  color: #60748b;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.learning-report-document-head > p {
  justify-content: flex-start;
  margin: 0;
}

.learning-report-document-head > p > strong {
  flex: 0 0 auto;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  letter-spacing: -0.05em;
}

.learning-report-document-head > p > span {
  color: #60748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.learning-report-data-note,
.learning-report-empty {
  margin: -12px 0 0;
  padding: 11px 14px;
  border: 1px solid #ead878;
  color: #4c5662;
  background: #fff9d9;
  font-size: 0.72rem;
  line-height: 1.6;
}

.learning-report-empty {
  display: grid;
  gap: 2px;
  border-color: #8da1b7;
  background: #f3f6f9;
}

.learning-report-kpis {
  display: grid;
  min-width: 0;
  margin: 0;
  border: 1px solid #ced8e2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.learning-report-kpis > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid #ced8e2;
}

.learning-report-kpis > div:last-child {
  border-right: 0;
}

.learning-report-kpis dt,
.learning-report-kpis span {
  color: #60748b;
  font-size: 0.66rem;
  font-weight: 700;
}

.learning-report-kpis dd {
  margin: 6px 0 3px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.learning-report-records,
.learning-report-analysis,
.learning-report-distribution,
.learning-report-chart {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.learning-report-section-title {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.learning-report-section-title h3,
.learning-report-analysis > h2 {
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 2px solid #27496f;
  font-size: 1rem;
}

.learning-report-section-title p {
  margin: 0;
  color: #60748b;
  font-size: 0.66rem;
}

.learning-report-table-scroll {
  min-width: 0;
  overflow-x: auto;
  scrollbar-color: #27496f #edf2f6;
  scrollbar-width: thin;
}

.learning-report-records table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  font-size: 0.68rem;
  table-layout: fixed;
}

.learning-report-records :where(th, td) {
  padding: 10px 11px;
  border-bottom: 1px solid #dbe3eb;
  text-align: left;
  vertical-align: middle;
}

.learning-report-records thead th {
  color: #fff;
  background: #27496f;
  font-size: 0.65rem;
}

.learning-report-records thead th:first-child,
.learning-report-records tbody th {
  width: 58px;
  text-align: center;
}

.learning-report-records tbody tr:nth-child(even) {
  background: #f4f7fa;
}

.learning-report-records tbody tr.is-missing {
  color: #7a8a9a;
}

.learning-report-records td > span,
.learning-report-records td > strong,
.learning-report-records td > small {
  display: block;
}

.learning-report-records td > span + span {
  margin-top: 3px;
}

.learning-report-records td span > small,
.learning-report-records td > small {
  margin-top: 3px;
  color: #60748b;
  font-size: 0.6rem;
}

.learning-report-muted {
  color: #8a99a8;
  font-weight: 500;
}

.learning-report-analysis {
  gap: 26px;
  padding-top: 8px;
}

.learning-report-analysis > h2 {
  font-size: 1.05rem;
}

.learning-report-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
  font-family: inherit;
}

.learning-report-grid line {
  stroke: #dbe3eb;
  stroke-width: 1;
}

.learning-report-line {
  fill: none;
  stroke: #27496f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.learning-report-line.comparison {
  stroke: #aeb9c5;
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.learning-report-dot {
  fill: #27496f;
  stroke: #fff;
  stroke-width: 2;
}

.learning-report-dot.comparison {
  fill: #aeb9c5;
}

.learning-report-chart text {
  fill: #435b73;
  font-size: 10px;
  font-weight: 700;
}

.learning-report-axis-label {
  fill: #6f8193 !important;
  font-size: 9px !important;
  font-weight: 600 !important;
}

.learning-report-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #60748b;
  font-size: 0.62rem;
}

.learning-report-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.learning-report-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27496f;
}

.learning-report-legend i.comparison {
  background: #aeb9c5;
}

.learning-report-rank-lanes {
  display: grid;
  min-width: 0;
  gap: 20px;
  padding: 18px 8px 4px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.learning-report-rank-lane {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 8px;
  color: #60748b;
  font-size: 0.66rem;
}

.learning-report-rank-lane > div {
  position: relative;
  display: grid;
  min-height: 176px;
  align-content: space-between;
  justify-items: center;
}

.learning-report-rank-lane > div::before {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 2px;
  background: #e0e7ee;
  content: "";
  transform: translateX(-50%);
}

.learning-report-rank-lane i {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #b5c0cb;
}

.learning-report-rank-lane i.current {
  width: 11px;
  height: 11px;
  background: #27496f;
}

.learning-report-rank-lane > span {
  color: #27496f;
  font-weight: 800;
}

.learning-report-direction {
  display: grid;
  gap: 9px;
  padding: 18px 20px;
  border: 1px solid #8da1b7;
  background: #f5f8fa;
}

.learning-report-direction h3,
.learning-report-direction p {
  margin: 0;
}

.learning-report-direction h3 {
  font-size: 0.8rem;
}

.learning-report-direction p {
  color: #435b73;
  font-size: 0.72rem;
  line-height: 1.75;
}

.learning-report-document > footer {
  padding-top: 12px;
  border-top: 1px solid #dbe3eb;
  color: #7b8b9b;
  font-size: 0.58rem;
  text-align: center;
}

.student-lesson-timeline time small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

@media (max-width: 1440px) {
  .admin-master-detail.admin-report-workspace {
    grid-template-columns: 1fr;
  }

  .admin-report-output {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-report-import-actions,
  .admin-report-monthly-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-report-import-actions > .button,
  .admin-report-import-actions > label,
  .admin-report-monthly-actions > .button {
    width: 100%;
    flex: 1 1 100%;
  }

  .admin-report-output {
    grid-template-columns: 1fr;
  }

  .admin-report-monthly-heading,
  .admin-report-monthly-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-report-monthly-kpis {
    grid-template-columns: 1fr;
  }

  .admin-report-monthly-kpis > div,
  .admin-report-monthly-kpis > div:first-child,
  .admin-report-monthly-kpis > div:last-child {
    padding: 14px 0;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-report-monthly-kpis > div:last-child {
    border-bottom: 0;
  }

  .admin-report-monthly-week {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .admin-report-monthly-week-label {
    justify-content: flex-start;
  }

  .admin-report-monthly-week dl {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .admin-report-score-row {
    align-items: stretch;
    padding-block: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-report-score-row > strong {
    grid-column: 1 / -1;
  }

  .admin-report-score-row > span {
    justify-content: flex-start;
  }

  .portal-dialog-report .portal-dialog-body {
    padding: 0;
  }

  .learning-report-document {
    padding: 28px 20px;
    gap: 24px;
    box-shadow: none;
  }

  .learning-report-document-head > div,
  .learning-report-document-head > p,
  .learning-report-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .learning-report-kpis {
    grid-template-columns: 1fr;
  }

  .learning-report-kpis > div {
    border-right: 0;
    border-bottom: 1px solid #ced8e2;
  }

  .learning-report-kpis > div:last-child {
    border-bottom: 0;
  }

  .learning-report-chart {
    overflow-x: auto;
  }

  .learning-report-chart svg {
    min-width: 620px;
  }

  .learning-report-rank-lanes {
    min-width: 620px;
  }

  .learning-report-distribution {
    overflow-x: auto;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 9mm;
  }

  body.report-printing {
    overflow: visible !important;
    color: #193553;
    background: #fff !important;
  }

  body.report-printing #app > :not(.portal-dialog-report),
  body.report-printing .portal-toast {
    display: none !important;
  }

  body.report-printing .portal-dialog-report {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  body.report-printing .portal-dialog-report::backdrop,
  body.report-printing .portal-dialog-report .portal-dialog-head {
    display: none !important;
  }

  body.report-printing .portal-dialog-report .portal-dialog-card {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  body.report-printing .portal-dialog-report .portal-dialog-body {
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.report-printing .learning-report-document {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    gap: 18px;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .learning-report-document-head,
  .learning-report-kpis,
  .learning-report-records,
  .learning-report-chart,
  .learning-report-direction {
    break-inside: avoid;
  }

  .learning-report-analysis,
  .learning-report-distribution {
    break-before: page;
  }

  .learning-report-distribution {
    break-before: auto;
  }

  .learning-report-chart svg {
    max-height: 190px;
  }

  .learning-report-rank-lane > div {
    min-height: 130px;
  }

  .learning-report-records table {
    min-width: 0;
    font-size: 8px;
  }
}

body[data-surface="portal"] {
  background: var(--sky-soft);
}

body[data-portal-menu-open="true"] {
  overflow: hidden;
}

.portal-shell {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  overflow: visible;
  background: var(--sky-soft);
  grid-template-columns: var(--portal-sidebar-width) minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  min-width: 0;
  height: 100dvh;
  flex-direction: column;
  padding: 24px 18px 20px;
  color: var(--paper);
  background: var(--ink);
}

.portal-brand {
  display: block;
  min-width: 0;
  padding: 4px 8px;
  text-decoration: none;
}

.portal-brand > span {
  display: grid;
  min-width: 0;
}

.portal-brand strong {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-brand small {
  color: rgba(255, 250, 240, 0.65);
  font-size: 0.74rem;
}

.portal-role {
  display: grid;
  gap: 3px;
  margin: 26px 8px 16px;
  padding: 14px 0;
  border-block: 1px solid rgba(255, 250, 240, 0.15);
}

.portal-role span {
  font-size: 0.85rem;
  font-weight: 700;
}

.portal-role small {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.72rem;
  line-height: 1.45;
}

.portal-navigation {
  display: grid;
  gap: 5px;
}

.portal-nav-link,
.portal-role-switch,
.portal-logout {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  color: rgba(255, 250, 240, 0.74);
  font-size: 0.91rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.portal-nav-link:hover,
.portal-role-switch:hover,
.portal-logout:hover {
  color: var(--paper);
  background: rgba(255, 250, 240, 0.09);
}

.portal-nav-link.active {
  color: var(--ink);
  background: var(--sky);
}

.portal-nav-link svg,
.portal-role-switch svg,
.portal-logout svg {
  flex: 0 0 auto;
}

.portal-nav-link > span:not(.portal-nav-count) {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-nav-count {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  padding-inline: 7px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow-soft);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.portal-nav-link.active .portal-nav-count {
  color: var(--paper);
  background: var(--ink);
}

.portal-sidebar :focus-visible {
  outline-color: var(--yellow);
}

.portal-sidebar-foot {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 250, 240, 0.15);
}

.portal-role-switch {
  color: var(--yellow-soft);
}

.portal-workspace {
  min-width: 0;
}

.portal-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  min-width: 0;
  min-height: var(--portal-topbar-height);
  align-items: center;
  gap: 28px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.portal-heading {
  min-width: 0;
}

.portal-heading-title {
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
}

.portal-heading > p:not(.portal-heading-title) {
  max-width: 62ch;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-topbar-actions time {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.portal-notification-link {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
  text-decoration: none;
}

.portal-notification-link > span {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  color: var(--white);
  background: #b33c34;
  font-size: 0.67rem;
  font-weight: 700;
}

.portal-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.portal-profile > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--yellow-soft);
}

.portal-profile > span {
  display: grid;
}

.portal-profile strong {
  font-size: 0.84rem;
  line-height: 1.35;
}

.portal-profile small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.portal-main {
  width: min(100%, 1440px);
  min-width: 0;
  margin-inline: auto;
  padding: 34px 36px 64px;
}

.portal-scrim {
  display: none;
}

.portal-toast {
  position: fixed;
  z-index: 120;
  right: 28px;
  bottom: 28px;
  display: flex;
  max-width: min(420px, calc(100% - 32px));
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-control);
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 5px 8px rgba(21, 50, 81, 0.18);
}

.portal-toast[hidden] {
  display: none;
}

.portal-page,
.student-page,
.admin-page {
  display: grid;
  min-width: 0;
  gap: 26px;
}

.portal-page-head,
.student-page-header,
.admin-page-header {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.portal-page-head h2,
.student-page-header h2,
.admin-page-header h2 {
  margin-bottom: 6px;
  font-size: clamp(1.65rem, 2.6vw, 2.35rem);
}

.portal-page-head p,
.student-page-header p,
.admin-page-header p {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.portal-demo-note,
.student-demo-note,
.admin-demo-note {
  padding: 10px 12px;
  border: 1px solid rgba(21, 50, 81, 0.22);
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 0.76rem;
}

.portal-panel,
.student-panel,
.admin-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.portal-panel-head,
.student-section-head,
.admin-section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.portal-panel-head h2,
.portal-panel-head h3,
.student-section-head h2,
.student-section-head h3,
.admin-section-head h2,
.admin-section-head h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.portal-button,
.student-action,
.admin-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.portal-button:hover,
.student-action:hover,
.admin-action:hover {
  transform: translateY(-1px);
}

.portal-button.secondary,
.student-action.secondary,
.admin-action.secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--paper);
}

.portal-button.accent,
.student-action.accent,
.admin-action.accent {
  color: var(--ink);
  background: var(--yellow);
}

.portal-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-decoration: none;
}

.portal-text-link:hover {
  text-decoration: underline;
}

.portal-grid-2,
.student-grid-2,
.admin-grid-2 {
  display: grid;
  min-width: 0;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-grid-main,
.student-dashboard-grid,
.admin-dashboard-grid {
  display: grid;
  min-width: 0;
  gap: 22px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}

.admin-dashboard-single {
  display: grid;
  min-width: 0;
}

.portal-metrics,
.student-metrics,
.admin-metrics {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-metric,
.student-metric,
.admin-metric {
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.portal-metric:last-child,
.student-metric:last-child,
.admin-metric:last-child {
  border-right: 0;
}

.portal-metric small,
.student-metric small,
.admin-metric small {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.portal-metric strong,
.student-metric strong,
.admin-metric strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1.15;
}

.portal-metric span,
.student-metric span,
.admin-metric span {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.portal-list,
.student-list,
.admin-list {
  display: grid;
  min-width: 0;
}

.portal-list-row,
.student-list-row,
.admin-list-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.portal-list-row:last-child,
.student-list-row:last-child,
.admin-list-row:last-child {
  border-bottom: 0;
}

.portal-list-copy,
.student-list-copy,
.admin-list-copy {
  min-width: 0;
}

.portal-list-copy strong,
.student-list-copy strong,
.admin-list-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-list-copy p,
.student-list-copy p,
.admin-list-copy p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.portal-badge,
.student-badge,
.admin-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--sky-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.portal-badge.warning,
.student-badge.warning,
.admin-badge.warning {
  background: var(--yellow-soft);
}

.portal-badge.danger,
.student-badge.danger,
.admin-badge.danger {
  color: #812b25;
  background: #ffe5df;
}

.portal-badge.success,
.student-badge.success,
.admin-badge.success {
  color: #1d5a43;
  background: #e0f3e9;
}

.portal-tabs,
.student-tabs,
.admin-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  scrollbar-width: none;
}

.portal-tabs::-webkit-scrollbar,
.student-tabs::-webkit-scrollbar,
.admin-tabs::-webkit-scrollbar {
  display: none;
}

.portal-tab,
.student-tab,
.admin-tab {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.portal-tab.active,
.student-tab.active,
.admin-tab.active {
  background: var(--sky);
}

.portal-form,
.student-form,
.admin-form {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.portal-field,
.student-field,
.admin-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.portal-field label,
.student-field label,
.admin-field label {
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-field input,
.portal-field select,
.portal-field textarea,
.student-field input,
.student-field select,
.student-field textarea,
.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
  outline: 0;
}

.portal-field textarea,
.student-field textarea,
.admin-field textarea {
  min-height: 120px;
  resize: vertical;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus,
.student-field input:focus,
.student-field select:focus,
.student-field textarea:focus,
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.portal-form-row,
.student-form-row,
.admin-form-row {
  display: grid;
  min-width: 0;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-toolbar,
.student-toolbar,
.admin-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.portal-toolbar-group,
.student-toolbar-group,
.admin-toolbar-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-search,
.student-search,
.admin-search {
  display: flex;
  min-width: min(320px, 100%);
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.portal-search input,
.student-search input,
.admin-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.portal-table-wrap,
.student-table-wrap,
.admin-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.portal-table,
.student-table,
.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}

.portal-table th,
.portal-table td,
.student-table th,
.student-table td,
.admin-table th,
.admin-table td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.portal-table th,
.student-table th,
.admin-table th {
  color: var(--ink-soft);
  background: rgba(143, 210, 236, 0.18);
  font-size: 0.75rem;
}

.portal-table td,
.student-table td,
.admin-table td {
  font-size: 0.84rem;
}

.portal-table tbody tr:last-child td,
.student-table tbody tr:last-child td,
.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.portal-upload,
.student-upload {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-surface);
  background: var(--sky-soft);
  text-align: center;
}

.portal-upload input[type="file"],
.student-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.portal-upload label,
.student-upload label {
  display: grid;
  place-items: center;
  gap: 9px;
  cursor: pointer;
}

.portal-upload label svg,
.student-upload label svg {
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: var(--radius-control);
  background: var(--yellow);
}

.portal-empty,
.student-empty,
.admin-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  gap: 8px;
  padding: 28px;
  color: var(--ink-soft);
  text-align: center;
}

.portal-empty strong,
.student-empty strong,
.admin-empty strong {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .portal-topbar-actions time,
  .portal-profile small {
    display: none;
  }

  .portal-main {
    padding-inline: 28px;
  }

  .portal-grid-main,
  .student-dashboard-grid,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .portal-shell {
    display: block;
  }

  .portal-sidebar {
    position: fixed;
    left: 0;
    width: min(var(--portal-sidebar-width), calc(100% - 54px));
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .portal-shell.portal-nav-open .portal-sidebar {
    transform: translateX(0);
  }

  .portal-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(10, 36, 62, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .portal-shell.portal-nav-open .portal-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .portal-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .portal-menu-toggle {
    display: inline-flex;
  }

  .portal-profile span {
    display: none;
  }

  .portal-profile {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --portal-topbar-height: 72px;
  }

  .portal-topbar {
    gap: 10px;
    padding: 10px 16px;
  }

  .portal-heading > p:not(.portal-heading-title),
  .portal-profile,
  .portal-topbar-actions time {
    display: none;
  }

  .portal-heading-title {
    margin-bottom: 0;
    font-size: 1.25rem;
  }

  .portal-topbar-actions {
    gap: 8px;
  }

  .portal-main {
    padding: 24px 16px 52px;
  }

  .portal-page,
  .student-page,
  .admin-page {
    gap: 20px;
  }

  .portal-page-head,
  .student-page-header,
  .admin-page-header,
  .portal-panel-head,
  .student-section-head,
  .admin-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-grid-2,
  .student-grid-2,
  .admin-grid-2,
  .portal-form-row,
  .student-form-row,
  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .portal-panel,
  .student-panel,
  .admin-panel {
    padding: 19px;
  }

  .portal-metrics,
  .student-metrics,
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-metric:nth-child(2),
  .student-metric:nth-child(2),
  .admin-metric:nth-child(2) {
    border-right: 0;
  }

  .portal-metric:nth-child(-n + 2),
  .student-metric:nth-child(-n + 2),
  .admin-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .portal-toolbar,
  .student-toolbar,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-search,
  .student-search,
  .admin-search {
    min-width: 100%;
  }

  .portal-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (max-width: 420px) {
  .portal-notification-link {
    width: 40px;
    height: 40px;
  }

  .portal-metric,
  .student-metric,
  .admin-metric {
    padding: 18px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-sidebar,
  .portal-scrim {
    transition-duration: 0.01ms !important;
  }
}

/* Authenticated page implementations */

body[data-surface="portal"] {
  overflow-x: hidden;
}

body[data-surface="portal"] :where(button, input, select, textarea) {
  accent-color: var(--ink);
}

body[data-surface="portal"] .motion-pending[data-motion="left"],
body[data-surface="portal"] .motion-pending[data-motion="right"] {
  transform: translate3d(0, 14px, 0);
}

.student-content,
.admin-content,
.admin-screen,
.student-list-page,
.student-learning-page {
  display: grid;
  min-width: 0;
  gap: 26px;
}

.student-page-header,
.admin-screen-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.student-page-header > div,
.admin-screen-heading > div,
.student-section-heading > div,
.admin-panel-heading > div,
.admin-inline-editor-heading > div {
  min-width: 0;
}

.student-page-header h1,
.admin-screen-heading h1 {
  max-width: 22ch;
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  word-break: keep-all;
  text-wrap: balance;
}

.student-section-heading h2,
.admin-panel-heading h2,
.admin-inline-editor-heading h2 {
  word-break: keep-all;
}

.student-page-header p,
.admin-screen-heading p {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.student-section-heading,
.admin-panel-heading,
.admin-inline-editor-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.student-section-heading {
  margin-bottom: 18px;
}

.student-section-heading h2,
.admin-panel-heading h2,
.admin-inline-editor-heading h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.student-section-heading p,
.admin-panel-heading p,
.admin-inline-editor-heading p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.student-section-heading a,
.admin-panel-heading a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.student-section-heading a:hover,
.admin-panel-heading a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.student-demo-note,
.admin-demo-banner {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.student-demo-note > svg,
.admin-demo-banner > svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.student-demo-note p,
.admin-demo-banner span {
  min-width: 0;
  margin: 0;
}

.student-demo-note p {
  display: grid;
  gap: 1px;
}

.student-demo-note span,
.admin-demo-banner {
  color: var(--ink-soft);
}

.admin-demo-banner {
  padding: 10px 12px;
  border: 1px solid rgba(21, 50, 81, 0.22);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 0.76rem;
}

.admin-demo-banner strong {
  color: var(--ink);
}

/* Student workspace */

.student-dashboard {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.72fr);
}

.student-dashboard-primary,
.student-dashboard-secondary {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 22px;
}

.student-next-class,
.student-section,
.student-list-page,
.student-learning-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.student-next-class {
  background: var(--ink);
  color: var(--paper);
}

.student-next-class .student-section-heading p,
.student-next-class .student-section-heading a {
  color: rgba(255, 250, 240, 0.68);
}

.student-next-class .student-section-heading a:hover {
  color: var(--paper);
}

.student-class-time {
  display: grid;
  min-width: 0;
  align-items: end;
  gap: 20px;
  padding: 24px 0;
  border-block: 1px solid rgba(255, 250, 240, 0.18);
  grid-template-columns: minmax(0, 1fr) auto;
}

.student-class-time time {
  display: grid;
  gap: 5px;
}

.student-class-time time strong {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.2;
}

.student-class-time time span {
  color: rgba(255, 250, 240, 0.7);
  font-size: 0.9rem;
}

.student-class-time p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--yellow-soft);
  font-weight: 700;
}

.student-prep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
}

.student-prep > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
}

.student-prep p {
  margin: 0;
  color: rgba(255, 250, 240, 0.8);
  font-size: 0.86rem;
}

.student-compact-list,
.student-text-list,
.student-board-list,
.student-assignment-list,
.student-resource-list,
.admin-timeline,
.admin-compact-list,
.admin-choice-list,
.admin-qna-list {
  display: grid;
  min-width: 0;
}

.student-compact-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.student-compact-row:last-child {
  border-bottom: 0;
}

.student-compact-row > div {
  min-width: 0;
}

.student-compact-row > div > strong,
.student-compact-row > div > p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-compact-row > div > strong {
  display: block;
  font-size: 0.9rem;
}

.student-compact-row p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.student-row-icon,
.admin-row-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.student-status,
.admin-status,
.admin-status-select {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--sky-soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.student-status[data-status="제출 전"],
.student-status[data-status="확인중"],
.student-status[data-status="중요"],
.admin-status-pending {
  background: var(--yellow-soft);
}

.student-status[data-status="피드백 완료"],
.student-status[data-status="답변완료"],
.admin-status-positive {
  color: #1d5a43;
  background: #e0f3e9;
}

.admin-status-muted {
  color: var(--ink-soft);
  background: #e8edf1;
}

.student-summary-list {
  display: grid;
  margin: 0 0 18px;
}

.student-summary-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.student-summary-list dt {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.student-summary-list dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.student-progress-summary > .button {
  width: 100%;
}

.student-text-list > button,
.student-board-row > button,
.student-assignment-row,
.student-board-table-body > button,
.admin-compact-row,
.admin-class-choice,
.admin-qna-choice {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.student-text-list > button {
  display: grid;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.student-text-list > button:last-child {
  border-bottom: 0;
}

.student-text-list > button > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.student-text-list > button > strong {
  overflow: hidden;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-text-list > button > time {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.student-list-tools,
.student-learning-toolbar,
.student-report-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.student-segments,
.admin-filter-tabs,
.admin-channel-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  scrollbar-width: none;
}

.student-segments::-webkit-scrollbar,
.admin-filter-tabs::-webkit-scrollbar,
.admin-channel-tabs::-webkit-scrollbar {
  display: none;
}

.student-segment,
.admin-filter-tabs > button,
.admin-channel-tabs > button {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.student-segment.active,
.student-segment[aria-pressed="true"],
.admin-filter-tabs > button.active,
.admin-filter-tabs > button[aria-pressed="true"],
.admin-channel-tabs > button.active,
.admin-channel-tabs > button[aria-selected="true"] {
  background: var(--sky);
}

.student-result-count {
  margin: -8px 0 -10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.student-board-row {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.student-board-row:last-child {
  border-bottom: 0;
}

.student-board-row > button {
  display: grid;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border: 0;
  background: transparent;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.student-board-row > button:hover,
.student-text-list > button:hover,
.student-assignment-row:hover,
.admin-compact-row:hover,
.admin-class-choice:hover,
.admin-qna-choice:hover {
  background: rgba(143, 210, 236, 0.14);
}

.student-board-main,
.student-board-main > strong {
  min-width: 0;
}

.student-board-main {
  display: grid;
  gap: 3px;
}

.student-board-main > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-board-meta {
  display: flex;
  min-width: 0;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.student-row-arrow {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.student-board-row > button[aria-expanded="true"] .student-row-arrow {
  transform: rotate(90deg);
}

.student-board-detail {
  padding: 0 54px 18px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.student-board-detail p {
  margin: 0;
}

.student-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.student-pagination button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
}

.student-pagination button.active {
  border-color: var(--sky);
  background: var(--sky);
  font-weight: 700;
}

.student-pagination button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.student-icon-reverse {
  transform: rotate(180deg);
}

.student-board-table {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
  overscroll-behavior-inline: contain;
}

.student-board-table-head,
.student-board-table-body > button {
  display: grid;
  min-width: 720px;
  align-items: center;
  gap: 14px;
  grid-template-columns: minmax(80px, 0.7fr) minmax(260px, 2.6fr) minmax(90px, 0.8fr) minmax(110px, 1fr) 56px;
}

.student-board-table-head {
  padding: 13px 17px;
  color: var(--ink-soft);
  background: rgba(143, 210, 236, 0.18);
  font-size: 0.75rem;
  font-weight: 700;
}

.student-board-table-body > button {
  width: 100%;
  min-height: 64px;
  padding: 13px 17px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.student-board-table-body > button:hover {
  background: rgba(143, 210, 236, 0.12);
}

.student-board-table-body strong {
  display: grid;
  min-width: 0;
}

.student-board-table-body strong > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.student-board-table-body strong > span > svg {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.student-board-table-body strong small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 400;
}

.student-learning-summary {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 22px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
}

.student-learning-summary > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.student-learning-summary > div > span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--yellow-soft);
}

.student-learning-summary p {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin: 0;
}

.student-learning-summary small {
  color: var(--ink-soft);
}

.student-learning-summary dl {
  display: grid;
  min-width: 0;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-learning-summary dl > div {
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid var(--line);
}

.student-learning-summary dt {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.student-learning-summary dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.student-report-actions {
  justify-content: flex-end;
}

.student-learning-panel[hidden] {
  display: none;
}

.student-learning-split {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 24px;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
}

.student-assignment-list {
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.student-assignment-row {
  display: grid;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.student-assignment-row + .student-assignment-row {
  margin-top: 6px;
}

.student-assignment-row.active,
.student-assignment-row[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--sky-soft);
}

.student-assignment-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.student-assignment-row > span:nth-child(2) strong,
.student-assignment-row > span:nth-child(2) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-assignment-row small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.student-upload-panel {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.student-upload-panel .student-section-heading {
  margin-bottom: 0;
}

.student-upload-dropzone {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-surface);
  background: var(--sky-soft);
  text-align: center;
  cursor: pointer;
}

.student-upload-dropzone > svg {
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: var(--radius-control);
  background: var(--yellow);
}

.student-upload-dropzone > span:not(.button) {
  max-width: 50ch;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.student-upload-dropzone:has(+ input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.student-upload-preview {
  min-width: 0;
}

.student-upload-note {
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
}

.student-upload-note textarea {
  width: 100%;
  min-height: 104px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
  resize: vertical;
}

.student-form-help,
.student-upload-warning {
  margin: -6px 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.student-upload-warning {
  margin-top: 10px;
  color: #812b25;
}

.student-lesson-timeline {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.student-lesson-timeline li {
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 92px minmax(0, 1fr);
}

.student-lesson-timeline li:first-child {
  padding-top: 2px;
}

.student-lesson-timeline li:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.student-lesson-timeline time {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.student-lesson-timeline p {
  margin: 5px 0 8px;
  color: var(--ink-soft);
}

.student-lesson-timeline li > div > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.student-test-list {
  display: grid;
  gap: 14px;
}

.student-test-list article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.student-test-list article > header {
  display: grid;
  align-items: center;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.student-test-list article > header > div {
  display: grid;
  gap: 3px;
}

.student-test-list time,
.student-test-list article > div > span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.student-test-list article > header > p {
  display: grid;
  margin: 0;
  text-align: right;
}

.student-test-list article > header > p > span,
.student-test-list article > header > p > small {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.student-test-list article > header > p > strong {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.student-test-list article > div {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.student-test-list article > div p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.student-resource-list article {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.student-resource-list article:last-child {
  border-bottom: 0;
}

.student-resource-type {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--yellow-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.student-resource-list article > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.student-resource-list article > div > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.student-resource-list article > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-resource-list article > div > p {
  display: flex;
  gap: 10px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.student-photo-grid {
  display: grid;
  min-width: 0;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-photo-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
}

.student-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--sky-soft);
}

.student-photo-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--ink-soft);
  background: var(--sky-soft);
}

.student-photo-placeholder span {
  font-size: 0.7rem;
  font-weight: 700;
}

.student-photo-card figcaption {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 9px 10px;
}

.student-photo-card figcaption strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-photo-card figcaption span {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

/* Administrator workspace */

/* Administrator palette: keep every management screen on one quiet ink-and-paper scale. */
.portal-shell-admin {
  --paper: #fffefa;
  --sky: #d6e3e8;
  --sky-deep: #b9ccd4;
  --sky-soft: #eef2f3;
  --yellow: #dce7eb;
  --yellow-soft: #eef2f3;
  --line: rgba(21, 50, 81, 0.14);
  --line-strong: rgba(21, 50, 81, 0.28);
  background: #f3f5f6;
}

.portal-shell-admin .portal-workspace,
.portal-shell-admin .portal-main {
  background: #f3f5f6;
}

.portal-shell-admin .portal-notification-link > span {
  background: var(--ink-soft);
}

.portal-shell-admin .admin-status-pending,
.portal-shell-admin .admin-status-positive,
.portal-shell-admin .admin-status-muted {
  color: var(--ink-soft);
  background: var(--sky-soft);
}

.portal-shell-admin .admin-compact-row:hover {
  background: rgba(21, 50, 81, 0.045);
}

.admin-panel-heading,
.admin-inline-editor-heading {
  margin-bottom: 18px;
}

.admin-metrics > div {
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.admin-metrics > div:last-child {
  border-right: 0;
}

.admin-metrics dt {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.admin-metrics dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.admin-metrics > div > span,
.admin-metrics > div > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-decoration: none;
}

.admin-metrics > div > a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.admin-timeline-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1.3fr) auto;
}

.admin-timeline-row:last-child {
  border-bottom: 0;
}

.admin-timeline-row time,
.admin-timeline-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-timeline-row time span,
.admin-timeline-row p {
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.admin-timeline-row h3,
.admin-timeline-row p {
  overflow: hidden;
  margin-bottom: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-timeline-row h3 {
  font-size: 0.88rem;
}

.admin-compact-row {
  display: grid;
  width: 100%;
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-compact-row:last-child {
  border-bottom: 0;
}

.admin-compact-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-compact-row > span:nth-child(2) strong,
.admin-compact-row > span:nth-child(2) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-compact-row small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.admin-operations,
.admin-inline-editor,
.admin-master-list,
.admin-detail-panel,
.admin-message-composer,
.admin-message-preview {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.admin-operations {
  display: grid;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
}

.admin-operations h2 {
  margin-bottom: 5px;
  font-size: 1.15rem;
}

.admin-operations > div > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.admin-operations ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-operations li {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-operations li:last-child {
  border-bottom: 0;
}

.admin-operations li > span,
.admin-operations li > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-operations li > strong {
  font-variant-numeric: tabular-nums;
}

.admin-operations li > a {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-operations li > a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.admin-toolbar select,
.admin-panel-heading select {
  min-width: 132px;
  min-height: 44px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--white);
}

.admin-search-field {
  display: flex;
  min-width: min(340px, 100%);
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-search-field:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.admin-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.admin-filter-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.admin-filter-panel-head,
.admin-filter-fields {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.admin-filter-panel-head {
  justify-content: space-between;
}

.admin-filter-panel-head h2 {
  margin-bottom: 2px;
  font-size: 1rem;
}

.admin-filter-panel-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.admin-filter-fields {
  align-items: end;
  flex-wrap: wrap;
}

.admin-filter-fields > label:not(.admin-search-field) {
  display: grid;
  gap: 6px;
}

.admin-filter-fields > label > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-filter-fields .admin-search-field {
  align-self: end;
  flex: 1 1 320px;
}

.admin-filter-fields select {
  min-width: 145px;
  min-height: 44px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--white);
}

.admin-toolbar-compact {
  justify-content: flex-start;
}

.admin-text-button,
.admin-row-action,
.admin-icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-text-button:hover,
.admin-row-action:hover,
.admin-icon-button:hover {
  color: var(--ink);
  background: var(--sky-soft);
}

.admin-icon-button {
  width: 44px;
  flex: 0 0 auto;
  padding: 0;
  background: var(--sky-soft);
}

.admin-table-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-table-summary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.admin-table-summary p:last-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.admin-pagination {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.admin-pagination p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.admin-pagination > div {
  display: flex;
  gap: 5px;
}

.admin-pagination button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-pagination button:hover:not(:disabled),
.admin-pagination button.active {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--sky-soft);
}

.admin-pagination button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.admin-signup-panel {
  overflow: hidden;
}

.admin-count-label {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--sky-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-signup-table-wrap {
  margin-inline: -24px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.admin-signup-table {
  min-width: 820px;
}

.admin-signup-table th:first-child,
.admin-signup-table td:first-child {
  padding-left: 24px;
}

.admin-signup-table th:last-child,
.admin-signup-table td:last-child {
  padding-right: 24px;
  text-align: right;
}

.admin-signup-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.admin-signup-name > svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.admin-table strong,
.admin-table small,
.admin-table time {
  display: block;
}

.admin-table small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.admin-table td,
.admin-table time {
  font-variant-numeric: tabular-nums;
}

.admin-person {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 9px;
}

.admin-person > svg {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 9px;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.admin-person > span {
  min-width: 0;
}

.admin-status-control {
  display: inline-flex;
}

.admin-status-select {
  min-height: 36px;
  padding-right: 26px;
  cursor: pointer;
}

.admin-inline-editor[hidden] {
  display: none;
}

.admin-inline-editor {
  border-color: var(--line-strong);
}

.admin-form-grid,
.portal-compose-form {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid > label,
.admin-reply-form,
.portal-compose-form > label {
  display: grid;
  min-width: 0;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-form-grid :where(input, select, textarea),
.admin-reply-form textarea,
.portal-compose-form :where(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-form-grid textarea,
.admin-reply-form textarea,
.portal-compose-form textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-form-grid :where(input, select, textarea):focus,
.admin-reply-form textarea:focus,
.portal-compose-form :where(input, select, textarea):focus,
.student-upload-note textarea:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.admin-form-actions,
.portal-dialog-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-form-grid > .admin-form-actions:not(.admin-field-wide) {
  grid-column: 1 / -1;
}

.admin-master-detail {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
}

.admin-choice-list,
.admin-qna-list {
  gap: 7px;
}

.admin-class-choice {
  display: grid;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-class-choice.active,
.admin-class-choice[aria-selected="true"],
.admin-qna-choice.active,
.admin-qna-choice[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--sky-soft);
}

.admin-class-choice > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-class-choice > span:last-child {
  justify-items: end;
}

.admin-class-choice small,
.admin-class-choice em {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-style: normal;
}

.admin-qna-choice {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 5px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
}

.admin-qna-choice-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.admin-qna-choice > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-qna-choice > small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.admin-qna-choice .admin-status {
  margin-top: 3px;
}

.admin-qna-detail {
  display: grid;
  gap: 18px;
}

.admin-qna-detail > header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-qna-detail > header > div {
  min-width: 0;
}

.admin-qna-detail > header span,
.admin-qna-detail > header p {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.admin-qna-detail > header h2 {
  margin: 5px 0;
  font-size: 1.3rem;
}

.admin-qna-detail > header p,
.admin-question-body p,
.admin-existing-reply p {
  margin-bottom: 0;
}

.admin-question-body,
.admin-existing-reply {
  padding: 16px;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.admin-existing-reply {
  background: var(--yellow-soft);
}

.admin-question-body p,
.admin-existing-reply p {
  color: var(--ink-soft);
}

.admin-reply-form {
  gap: 10px;
}

.admin-notification-layout {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 22px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
}

.admin-calendar {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.admin-calendar-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-month-nav,
.admin-calendar-filters {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.admin-month-nav h2 {
  min-width: 128px;
  margin: 0;
  font-size: 1.12rem;
  text-align: center;
}

.admin-month-nav button {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--white);
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-calendar-filters select {
  min-width: 132px;
  min-height: 40px;
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--white);
}

.admin-calendar-weekdays,
.admin-calendar-grid {
  display: grid;
  min-width: 826px;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
}

.admin-calendar-weekdays {
  color: var(--ink-soft);
  background: var(--sky-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-calendar-weekdays span {
  padding: 9px 12px;
  text-align: center;
}

.admin-calendar-day {
  position: relative;
  min-height: 126px;
  padding: 9px;
  overflow: visible;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-calendar-day:nth-child(7n) {
  border-right: 0;
}

.admin-calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.admin-calendar-day > time {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-calendar-day.outside {
  background: rgba(239, 244, 247, 0.48);
}

.admin-calendar-day.outside > time {
  color: var(--ink-soft);
  opacity: 0.52;
}

.admin-calendar-event {
  z-index: 2;
  display: flex;
  position: absolute;
  top: calc(34px + var(--event-lane, 0) * 42px);
  right: -1px;
  left: 0;
  width: auto;
  min-height: 38px;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--sky-soft);
  text-align: left;
}

.admin-calendar-event:not(.ends) {
  box-shadow: 1px 0 0 var(--sky-soft);
}

.admin-calendar-event.starts {
  right: -1px;
  left: 9px;
  width: auto;
  border-radius: 6px 0 0 6px;
}

.admin-calendar-event.ends {
  right: 9px;
  left: 0;
  width: auto;
  border-radius: 0 6px 6px 0;
}

.admin-calendar-event.starts.ends {
  right: 9px;
  left: 9px;
  width: auto;
  border-radius: 6px;
  box-shadow: none;
}

.admin-calendar-event:hover {
  background: var(--sky);
}

.admin-calendar-event span,
.admin-calendar-event strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-calendar-event span {
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.admin-calendar-event strong {
  font-size: 0.7rem;
}

.admin-calendar-legend {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.admin-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-calendar-legend i {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: var(--sky-soft);
}

.admin-calendar-legend p {
  margin: 0;
}

/* Timetable management and student schedules */

.admin-schedule-manager,
.student-schedule-page {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.admin-schedule-toolbar,
.student-schedule-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-schedule-toolbar h2,
.student-schedule-summary h2 {
  margin-bottom: 4px;
  font-size: 1.12rem;
}

.admin-schedule-toolbar p,
.student-schedule-summary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.admin-schedule-toolbar select {
  min-width: 150px;
  min-height: 40px;
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--white);
}

.admin-schedule-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.schedule-week-navigation {
  display: grid;
  width: fit-content;
  min-width: 178px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--white);
  grid-template-columns: 44px minmax(82px, auto) 44px;
}

.schedule-week-navigation button {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-week-navigation button + button {
  border-left: 1px solid var(--line);
}

.schedule-week-navigation button:hover {
  color: var(--ink);
  background: var(--sky-soft);
}

.schedule-week-navigation button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.schedule-week-navigation .schedule-week-current.active {
  color: var(--ink);
  background: var(--sky);
}

.student-schedule-page > .schedule-week-navigation {
  margin: 14px 20px;
}

.schedule-grid-scroll {
  width: 100%;
  max-height: min(72vh, 760px);
  min-width: 0;
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--ink) var(--sky-soft);
  scrollbar-width: thin;
}

.schedule-grid-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.schedule-grid {
  --schedule-row-height: 44px;
  display: grid;
  min-width: 1040px;
  grid-template-columns: 86px repeat(6, minmax(150px, 1fr));
  grid-template-rows: 62px repeat(var(--schedule-row-count), var(--schedule-row-height));
  background: var(--line);
  gap: 1px;
}

.schedule-grid-corner,
.schedule-grid-day,
.schedule-grid-time,
.schedule-grid-cell {
  min-width: 0;
  background: var(--paper);
}

.schedule-grid-corner,
.schedule-grid-day {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  min-height: 62px;
  place-content: center;
  gap: 2px;
  padding: 10px;
  background: var(--sky-soft);
  text-align: center;
}

.schedule-grid-corner {
  left: 0;
  z-index: 5;
}

.schedule-grid-corner,
.schedule-grid-day strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.schedule-grid-day time {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.schedule-grid-time {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  min-height: var(--schedule-row-height);
  place-content: center;
  padding: 4px 8px;
  color: var(--ink-soft);
  background: #f4f7f8;
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.schedule-grid-time-half {
  color: #6d7881;
  font-size: 0.68rem;
  font-weight: 500;
}

.schedule-grid-cell {
  display: grid;
  min-height: var(--schedule-row-height);
  align-content: start;
  gap: 7px;
  padding: 0;
}

.schedule-grid-cell-half {
  background: #fbfcfc;
}

.schedule-event {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  gap: 5px;
  margin-block: 3px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid #dadb85;
  border-radius: var(--radius-control);
  background: var(--yellow-soft);
}

.schedule-event time {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.schedule-event > strong,
.schedule-event-main > strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-event > span,
.schedule-event-main > small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-event-admin {
  padding: 0;
  overflow: hidden;
}

.schedule-event-main {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-content: start;
  gap: 5px;
  padding: 10px 42px 10px 10px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
}

.schedule-event-main > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.schedule-event-main .admin-status {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 0.62rem;
}

.schedule-event-main:hover {
  background: rgba(255, 255, 255, 0.35);
}

.schedule-event-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
}

.schedule-event-delete:hover {
  color: #812b25;
  background: #fff;
}

.admin-schedule-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.admin-schedule-note p {
  margin: 0;
}

.admin-schedule-note strong {
  color: var(--ink);
}

.student-schedule-summary > span,
.student-count-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--sky-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-channel-tabs {
  margin-bottom: 20px;
}

.admin-notification-form {
  display: grid;
  gap: 16px;
}

.admin-approved-template-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  padding: 11px 12px;
  border-block: 1px solid var(--line);
}

.admin-approved-template-meta span,
.admin-approved-template-meta em {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.admin-approved-template-meta span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--yellow-soft);
  font-style: normal;
  font-weight: 700;
}

.admin-approved-template-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.admin-approved-template-meta em {
  margin-inline-start: auto;
  font-style: normal;
}

.admin-variable-settings {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.admin-variable-settings legend {
  padding: 0 5px;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-variable-settings > p {
  margin: 0 0 13px;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.admin-variable-settings > div {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-variable-settings label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.admin-variable-settings label span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-field-help {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 400;
}

.admin-field-help span:last-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.admin-send-timing {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.admin-send-timing legend {
  padding: 0 5px;
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-send-timing > label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 400;
}

.admin-send-timing input[type="radio"] {
  width: 18px;
  min-height: 18px;
}

.admin-schedule-field {
  flex: 1 1 230px;
}

.admin-schedule-field input {
  width: 100%;
}

.admin-recipient-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: var(--sky-soft);
  font-size: 0.8rem;
}

.admin-form-disclaimer {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: right;
}

.admin-message-preview {
  position: sticky;
  top: calc(var(--portal-topbar-height) + 24px);
}

.admin-preview-dialog {
  display: grid;
  gap: 18px;
}

.admin-preview-dialog > dl {
  display: grid;
  margin: 0;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-preview-dialog > dl > div {
  min-width: 0;
  padding: 11px;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.admin-preview-dialog dt {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.admin-preview-dialog dd {
  overflow: hidden;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-preview-dialog .admin-phone-preview {
  min-height: 260px;
  border-width: 8px;
  border-radius: 24px;
}

.admin-phone-preview {
  min-height: 390px;
  padding: 12px;
  border: 10px solid var(--ink);
  border-radius: 28px;
  background: var(--sky-soft);
}

.admin-phone-preview-head {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-phone-preview-head span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.admin-phone-preview > h3 {
  margin: 14px 8px 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-phone-preview > p {
  margin: 14px 8px;
  padding: 13px;
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.admin-notification-history .admin-table-wrap {
  border: 0;
  border-radius: 0;
}

/* Portal overlays and generated reports */

.portal-notification-link {
  width: 44px;
  height: 44px;
}

.student-tab {
  min-height: 44px;
}

.portal-toast {
  transition: opacity 160ms ease, transform 160ms ease;
}

.portal-toast.is-hiding {
  opacity: 0;
  transform: translateY(6px);
}

.portal-dialog {
  width: min(640px, calc(100% - 32px));
  max-width: none;
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-surface);
  color: var(--ink);
  background: transparent;
}

.portal-dialog-wide {
  width: min(920px, calc(100% - 32px));
}

.portal-dialog::backdrop {
  background: rgba(10, 36, 62, 0.58);
}

.portal-dialog-card {
  display: grid;
  max-height: min(88dvh, 820px);
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 6px 8px rgba(21, 50, 81, 0.2);
  grid-template-rows: auto minmax(0, 1fr);
}

.portal-dialog-head {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-dialog-head-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

.portal-dialog-head h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.portal-dialog-head p {
  min-width: 0;
  max-width: 68ch;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-dialog-close {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.portal-dialog-icon-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-dialog-icon-action:hover {
  color: var(--ink);
  background: var(--sky-soft);
}

.portal-dialog-icon-danger:hover {
  color: #812b25;
  background: #f8e7e3;
}

.portal-dialog-body {
  min-width: 0;
  overflow-y: auto;
  padding: 24px;
  overscroll-behavior: contain;
  scrollbar-color: var(--ink) var(--sky-soft);
  scrollbar-width: thin;
}

.portal-dialog-actions {
  margin-top: 22px;
}

.portal-compose-form .portal-dialog-actions {
  margin-top: 4px;
}

.portal-check {
  display: flex !important;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  font-weight: 400 !important;
}

.portal-check input {
  width: 18px !important;
  min-height: 18px !important;
  flex: 0 0 auto;
  padding: 0 !important;
}

.portal-reading p {
  margin: 0;
  color: var(--ink-soft);
}

.portal-community-detail {
  display: grid;
  min-width: 0;
  gap: 28px;
}

.portal-community-owner-mobile {
  display: none;
}

.portal-community-body {
  display: grid;
  gap: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.portal-community-body > p {
  max-width: 72ch;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.portal-community-body figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-surface);
  background: var(--sky-soft);
}

.portal-community-body img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.portal-comments {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.portal-comments-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.portal-comments-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.portal-comments-heading h3 span {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.portal-comments-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.portal-comment-list {
  display: grid;
}

.portal-comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.portal-comment:first-child {
  padding-top: 0;
}

.portal-comment header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.portal-comment header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-comment header > div:first-child > span {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--sky-soft);
  font-size: 0.66rem;
  font-weight: 700;
}

.portal-comment header button {
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-comment header button:hover {
  color: #812b25;
}

.portal-comment header strong {
  font-size: 0.82rem;
}

.portal-comment header time {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.portal-comment p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.portal-comment-empty {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-soft);
}

.portal-comment-empty p {
  margin: 0;
}

.portal-comment-form {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-surface);
  background: var(--sky-soft);
}

.portal-comment-form > label {
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-comment-form textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
}

.portal-dialog-community {
  width: min(860px, calc(100% - 32px));
}

.portal-dialog-editor {
  width: min(820px, calc(100% - 32px));
}

.portal-dialog-community .portal-dialog-head {
  padding: 20px 22px;
}

.portal-dialog-community .portal-dialog-head h2 {
  margin-bottom: 5px;
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.35;
}

.portal-dialog-community .portal-dialog-body {
  padding: 26px 28px 28px;
}

.portal-compose-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
}

.portal-community-editor {
  gap: 18px;
}

.portal-rich-field {
  display: grid;
  min-width: 0;
  gap: 0;
}

.portal-rich-label {
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-rich-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-color: var(--line);
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--sky-soft);
}

.portal-rich-toolbar-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
}

.portal-rich-toolbar button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.portal-rich-toolbar button:hover {
  color: var(--ink);
  background: var(--paper);
}

.portal-rich-toolbar button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.portal-rich-toolbar button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.portal-rich-toolbar-divider {
  width: 1px;
  height: 28px;
  margin-inline: 2px;
  flex: 0 0 auto;
  background: var(--line-strong);
}

.portal-rich-editor {
  min-height: 238px;
  padding: 17px 18px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  outline: 0;
  background: var(--white);
  font-size: 0.95rem;
  line-height: 1.75;
  caret-color: var(--ink);
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.portal-rich-field:focus-within .portal-rich-toolbar,
.portal-rich-field:focus-within .portal-rich-editor {
  border-color: var(--focus);
}

.portal-rich-field:focus-within .portal-rich-editor {
  box-shadow: 0 0 0 2px rgba(36, 107, 141, 0.16);
}

.portal-rich-field.is-empty .portal-rich-editor::before {
  color: var(--ink-soft);
  content: attr(data-placeholder);
  pointer-events: none;
}

.portal-rich-editor :where(p, div, h3, h4, ul, ol) {
  max-width: 72ch;
  margin: 0;
}

.portal-rich-editor :where(p, div, h3, h4, ul, ol) + :where(p, div, h3, h4, ul, ol) {
  margin-top: 0.8em;
}

.portal-rich-editor :where(p, div) {
  min-height: 1.75em;
}

.portal-rich-editor h3 {
  font-size: 1.55rem;
  line-height: 1.35;
}

.portal-rich-editor h4 {
  font-size: 1.25rem;
  line-height: 1.4;
}

.portal-rich-editor :where(h3, h4, strong) {
  font-weight: 700;
}

.portal-rich-editor :where(ul, ol) {
  padding-left: 1.5em;
}

.portal-rich-editor li + li {
  margin-top: 0.28em;
}

.portal-rich-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.portal-rich-meta > span:last-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.portal-rich-field.is-over-limit .portal-rich-meta > span:last-child,
.portal-rich-error {
  color: #812b25;
}

.portal-rich-error {
  margin: 5px 0 0;
  font-size: 0.74rem;
  font-weight: 700;
}

.portal-rich-error[hidden] {
  display: none;
}

.portal-rich-field.has-error .portal-rich-toolbar,
.portal-rich-field.has-error .portal-rich-editor {
  border-color: #a4463d;
}

.portal-community-rich-content {
  min-width: 0;
  max-width: 72ch;
  font-size: 0.95rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.portal-community-rich-content :where(p, h3, h4, ul, ol) {
  margin: 0;
}

.portal-community-rich-content :where(p, h3, h4, ul, ol) + :where(p, h3, h4, ul, ol) {
  margin-top: 1em;
}

.portal-community-rich-content p {
  white-space: pre-wrap;
}

.portal-community-rich-content h3 {
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  line-height: 1.35;
}

.portal-community-rich-content h4 {
  font-size: clamp(1.12rem, 2vw, 1.3rem);
  line-height: 1.4;
}

.portal-community-rich-content :where(h3, h4, strong) {
  font-weight: 700;
}

.portal-community-rich-content :where(ul, ol) {
  padding-left: 1.5em;
}

.portal-community-rich-content li + li {
  margin-top: 0.32em;
}

.portal-image-field {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--sky-soft);
}

.portal-image-field > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.portal-image-field > div:first-child span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.portal-image-picker {
  display: inline-flex !important;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 8px !important;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  cursor: pointer;
}

.portal-image-picker:has(+ input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.portal-image-preview {
  position: relative;
  width: min(100%, 520px);
  overflow: hidden;
  border-radius: var(--radius-surface);
  background: var(--paper);
}

.portal-image-preview[hidden] {
  display: none;
}

.portal-image-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.portal-image-preview button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--paper);
  background: rgba(16, 44, 72, 0.88);
  font-size: 0.74rem;
  font-weight: 700;
}

.portal-dialog-confirm {
  width: min(430px, calc(100% - 32px));
}

.portal-dialog-confirm .portal-dialog-body {
  padding-top: 18px;
}

.portal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.schedule-delete-options {
  display: grid;
  gap: 10px;
}

.schedule-delete-options + .portal-confirm-actions {
  margin-top: 16px;
}

.schedule-delete-option {
  display: grid;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--white);
  text-align: left;
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.schedule-delete-option > span:first-child {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--sky-soft);
}

.schedule-delete-option > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.schedule-delete-option strong,
.schedule-delete-option small {
  overflow-wrap: anywhere;
}

.schedule-delete-option strong {
  font-size: 0.88rem;
}

.schedule-delete-option small {
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.schedule-delete-option:hover,
.schedule-delete-option:focus-visible {
  border-color: var(--focus);
  background: var(--sky-soft);
}

.schedule-delete-option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.schedule-delete-option-danger {
  border-color: #d6aaa5;
}

.schedule-delete-option-danger > span:first-child {
  color: #812b25;
  background: #f8e7e3;
}

.schedule-delete-option-danger:hover,
.schedule-delete-option-danger:focus-visible {
  border-color: #a33b32;
  background: #fbefed;
}

.button-danger {
  color: #fff;
  background: #a33b32;
}

.button-danger:hover {
  background: #812b25;
}

.admin-community-toolbar {
  justify-content: space-between;
}

.admin-community-count {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.admin-table-link {
  display: inline-flex;
  max-width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.admin-table-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table-link:hover span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portal-comment-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.portal-comment-form > div > span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.portal-detail-list {
  display: grid;
  margin: 0;
}

.portal-detail-list > div {
  display: grid;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1.45fr);
}

.portal-detail-list > div:last-child {
  border-bottom: 0;
}

.portal-detail-list dt {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.portal-detail-list dd {
  margin: 0;
  font-weight: 700;
}

.report-sheet {
  display: grid;
  min-width: 0;
  gap: 22px;
}

.report-sheet-lead {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border-radius: var(--radius-surface);
  color: var(--paper);
  background: var(--ink);
  grid-template-columns: minmax(0, 1fr) auto;
}

.report-sheet-lead > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.report-sheet-lead > div > span,
.report-sheet-lead p,
.report-score small {
  color: rgba(255, 250, 240, 0.7);
}

.report-sheet-lead > div > span {
  font-size: 0.74rem;
}

.report-sheet-lead > div > strong {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.report-sheet-lead p {
  max-width: 58ch;
  margin: 0;
  font-size: 0.8rem;
}

.report-score {
  display: grid;
  min-width: 118px;
  justify-items: end;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 250, 240, 0.22);
}

.report-score small {
  font-size: 0.7rem;
}

.report-score strong {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.report-metrics {
  display: grid;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-metrics > div {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.report-metrics > div:last-child {
  border-right: 0;
}

.report-metrics dt,
.report-metrics span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.report-metrics dd {
  margin: 5px 0 3px;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.report-feedback {
  display: grid;
}

.report-feedback > div {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.report-feedback > div:first-child {
  padding-top: 0;
}

.report-feedback > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.report-feedback span {
  font-size: 0.8rem;
  font-weight: 700;
}

.report-feedback p {
  max-width: 72ch;
  margin: 0;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .portal-dialog[open] .portal-dialog-card {
    animation: portal-dialog-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes portal-dialog-enter {
  from {
    opacity: 0.72;
    clip-path: inset(0 0 12px 0 round var(--radius-surface));
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 round var(--radius-surface));
    transform: translateY(0);
  }
}

/* Actual authenticated layouts at narrower viewports */

@media (max-width: 1180px) {
  .student-dashboard {
    grid-template-columns: 1fr;
  }

  .student-dashboard-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-notification-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.62fr);
  }
}

@media (max-width: 980px) {
  .student-learning-split,
  .admin-master-detail,
  .admin-notification-layout {
    grid-template-columns: 1fr;
  }

  .student-assignment-list {
    padding-right: 0;
    padding-bottom: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-message-preview {
    position: static;
  }

  .admin-report-workbench {
    grid-template-columns: 1fr;
  }

  .admin-report-roster-list {
    max-height: 320px;
  }

  .admin-phone-preview {
    min-height: 320px;
  }

  .admin-calendar {
    overflow-x: auto;
    scrollbar-color: var(--ink) var(--sky-soft);
    scrollbar-width: thin;
  }

}

@media (max-width: 760px) {
  .student-content,
  .admin-content,
  .admin-screen,
  .student-list-page,
  .student-learning-page {
    gap: 20px;
  }

  .student-page-header,
  .admin-screen-heading,
  .student-section-heading,
  .admin-panel-heading,
  .admin-inline-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .student-page-header > .button,
  .admin-screen-heading > .button {
    width: 100%;
  }

  .student-next-class,
  .student-section,
  .student-list-page,
  .student-learning-panel,
  .admin-operations,
  .admin-inline-editor,
  .admin-master-list,
  .admin-detail-panel,
  .admin-message-composer,
  .admin-message-preview {
    padding: 19px;
  }

  .student-dashboard-secondary,
  .student-learning-summary,
  .admin-operations {
    grid-template-columns: 1fr;
  }

  .student-learning-summary dl {
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .student-learning-summary dl > div {
    padding: 14px 10px 0;
    border-left: 0;
    text-align: center;
  }

  .student-learning-summary dl > div + div {
    border-left: 1px solid var(--line);
  }

  .student-list-tools,
  .student-learning-toolbar,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .student-search,
  .admin-search-field {
    width: 100%;
    min-width: 100%;
  }

  .student-segments,
  .admin-filter-tabs,
  .admin-channel-tabs {
    width: 100%;
  }

  .student-report-actions,
  .admin-form-actions,
  .portal-dialog-actions {
    justify-content: stretch;
  }

  .student-report-actions > .button,
  .admin-form-actions > .button,
  .portal-dialog-actions > .button {
    flex: 1 1 180px;
  }

  .student-class-time {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .student-board-row > button {
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .student-board-row > button .student-status {
    grid-column: 2;
    justify-self: start;
  }

  .student-board-row > button .student-row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .student-board-detail {
    padding-inline: 48px 8px;
  }

  .student-resource-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .student-resource-list article > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .student-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .admin-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .admin-timeline-row {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-timeline-row > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .admin-report-lesson-rows > div,
  .admin-report-score-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-report-lesson-rows strong,
  .admin-report-score-row > strong,
  .admin-report-score-row > span {
    min-height: auto;
  }

  .admin-report-score-row > span {
    justify-content: flex-start;
  }

  .admin-filter-panel-head,
  .admin-filter-fields,
  .admin-calendar-toolbar,
  .admin-calendar-legend {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-filter-fields > label,
  .admin-filter-fields select,
  .admin-month-nav,
  .admin-calendar-filters {
    width: 100%;
  }

  .admin-calendar-toolbar,
  .admin-calendar-legend {
    min-width: 826px;
  }

  .admin-calendar-filters {
    flex-wrap: wrap;
  }

  .admin-signup-table-wrap {
    margin-inline: -19px;
  }

  .admin-signup-table th:first-child,
  .admin-signup-table td:first-child {
    padding-left: 19px;
  }

  .admin-signup-table th:last-child,
  .admin-signup-table td:last-child {
    padding-right: 19px;
  }

  .admin-variable-settings > div,
  .admin-preview-dialog > dl {
    grid-template-columns: 1fr;
  }

  .admin-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-pagination > div {
    max-width: 100%;
    overflow-x: auto;
  }

  .admin-field-wide,
  .admin-form-grid > .admin-form-actions:not(.admin-field-wide) {
    grid-column: auto;
  }

  .admin-send-timing {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .admin-schedule-toolbar,
  .student-schedule-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-schedule-toolbar select {
    width: 100%;
  }

  .admin-schedule-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-schedule-controls .schedule-week-navigation,
  .admin-schedule-controls label,
  .admin-schedule-controls select {
    width: 100%;
  }

  .schedule-week-navigation {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .student-schedule-page > .schedule-week-navigation {
    width: calc(100% - 40px);
  }

  .schedule-grid {
    --schedule-row-height: 40px;
    min-width: 940px;
    grid-template-columns: 70px repeat(6, minmax(145px, 1fr));
    grid-template-rows: 56px repeat(var(--schedule-row-count), var(--schedule-row-height));
  }

  .schedule-grid-corner,
  .schedule-grid-day {
    min-height: 56px;
    padding: 8px;
  }

  .schedule-event {
    padding: 9px;
  }

  .schedule-event-main {
    padding: 9px 38px 9px 9px;
  }

  .schedule-event > strong,
  .schedule-event-main > strong {
    font-size: 0.76rem;
  }

  .schedule-event > span,
  .schedule-event-main > small {
    font-size: 0.66rem;
  }

  .admin-field-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-form-disclaimer {
    text-align: left;
  }

  .portal-dialog,
  .portal-dialog-wide {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .portal-dialog-card {
    max-height: calc(100dvh - 24px);
  }

  .portal-dialog-head,
  .portal-dialog-body {
    padding-inline: 18px;
  }

  .portal-dialog-head-copy {
    display: block;
  }

  .portal-dialog-head-copy p {
    display: none;
  }

  .admin-alimtalk-preview {
    width: 100%;
    padding: 8px;
  }

  .report-sheet-lead {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .portal-comments-heading,
  .portal-comment-form > div {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-comment-form .button {
    width: 100%;
  }

  .report-score {
    width: 100%;
    min-width: 0;
    justify-items: start;
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 250, 240, 0.22);
    border-left: 0;
  }

  .report-metrics {
    grid-template-columns: 1fr;
  }

  .report-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-metrics > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  .portal-notification-link {
    width: 44px;
    height: 44px;
  }

  .student-learning-summary dl {
    grid-template-columns: 1fr;
  }

  .student-learning-summary dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 0;
    text-align: left;
  }

  .student-learning-summary dl > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .student-compact-row {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .student-compact-row > .student-status {
    grid-column: 2;
  }

  .student-assignment-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .student-assignment-row > .student-status {
    grid-column: 2;
    justify-self: start;
  }

  .student-photo-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-metrics > div,
  .admin-metrics > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-metrics > div:last-child {
    border-bottom: 0;
  }

  .admin-operations li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-operations li > a {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .admin-class-choice {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .admin-class-choice > span:last-child {
    justify-items: start;
  }

  .portal-dialog-actions > .button,
  .admin-form-actions > .button,
  .student-report-actions > .button {
    width: 100%;
    flex-basis: 100%;
  }

  .portal-detail-list > div {
    gap: 3px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portal-dialog-community .portal-dialog-head,
  .portal-dialog-community .portal-dialog-body {
    padding-inline: 16px;
  }

  .portal-dialog-head-actions {
    align-items: flex-start;
  }

  .portal-dialog-community .portal-dialog-head-actions > .portal-dialog-icon-action {
    display: none;
  }

  .portal-community-owner-mobile {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .portal-community-owner-mobile button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-control);
    color: var(--ink-soft);
    background: var(--sky-soft);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .portal-compose-grid {
    grid-template-columns: 1fr;
  }

  .portal-rich-toolbar {
    display: grid;
    gap: 4px;
  }

  .portal-rich-toolbar-group {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .portal-rich-toolbar button {
    width: 100%;
  }

  .portal-rich-toolbar-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .portal-rich-editor {
    min-height: 210px;
    padding: 15px;
  }

  .portal-image-field > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .portal-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .schedule-delete-options + .portal-confirm-actions {
    grid-template-columns: 1fr;
  }

  .admin-community-table {
    min-width: 760px;
  }
}
