.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.record-detail-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e8ebf2;
  border-radius: 8px;
  background: #fff;
}

.record-detail-grid dt {
  color: #78857b;
  font-size: 10px;
  font-weight: 650;
}

.record-detail-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: #202b25;
  font-size: 12px;
}

#recordForm.readonly-detail #formError {
  display: none;
}

.schedule-table,
.staff-record-table,
.student-record-table {
  border: 1px solid #aebbb2;
}

.schedule-table th,
.staff-record-table th,
.student-record-table th {
  border: 1px solid #aebbb2;
  background: #edf4ef;
  color: #385346;
}

.schedule-table td,
.staff-record-table td,
.student-record-table td {
  border: 1px solid #c4cec7;
}

.schedule-table tbody tr:nth-child(even),
.staff-record-table tbody tr:nth-child(even),
.student-record-table tbody tr:nth-child(even) {
  background: #f7faf8;
}

@media (max-width: 600px) {
  .application,
  .main,
  .page {
    min-width: 0;
    max-width: 100%;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .heading-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
    gap: 8px;
    margin-left: 0;
  }

  .heading-actions .button {
    min-width: 0;
    padding: 9px 7px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .module-toolbar {
    min-width: 0;
    flex-wrap: wrap;
  }

  .module-toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  .module-toolbar input,
  .module-toolbar select {
    width: 100%;
    min-width: 0;
  }

  .student-class-filter {
    flex: 1 1 100%;
  }

  .row-actions {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 72px), 1fr));
    gap: 5px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
    gap: 8px;
  }

  .row-actions button,
  .row-actions a {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .responsive-record-table-wrap {
    overflow: visible;
  }

  .record-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .responsive-record-table {
    min-width: 0;
    table-layout: fixed;
  }

  .responsive-record-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .responsive-record-table tbody {
    display: grid;
    gap: 10px;
  }

  .responsive-record-table tbody tr:not(.schedule-empty-row):not(.schedule-row):not(.staff-row):not(.student-row) {
    display: block;
    overflow: hidden;
    border: 1px solid #e8ebf2;
    border-radius: 10px;
    background: #fff;
  }

  .responsive-record-table tbody tr:not(.schedule-empty-row):not(.schedule-row):not(.staff-row):not(.student-row) td {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(76px, 31%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f2f0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .responsive-record-table tbody tr:not(.schedule-empty-row):not(.schedule-row):not(.staff-row):not(.student-row) td::before {
    content: attr(data-label);
    color: #78857b;
    font-size: 9px;
    font-weight: 650;
  }

  .responsive-record-table tbody tr:not(.schedule-empty-row):not(.schedule-row):not(.staff-row):not(.student-row) .responsive-actions-cell {
    display: block;
  }

  .responsive-record-table .schedule-empty-row {
    display: block;
  }

  .responsive-record-table .schedule-empty-row td,
  .responsive-record-table td[colspan] {
    display: block;
    white-space: normal;
  }

  .schedule-table-wrap,
  .staff-table-wrap,
  .student-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .schedule-table,
  .staff-record-table,
  .student-record-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .schedule-table {
    min-width: 920px;
  }

  .staff-record-table,
  .student-record-table {
    min-width: 1000px;
  }

  .schedule-table thead,
  .staff-record-table thead,
  .student-record-table thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .schedule-table tbody,
  .staff-record-table tbody,
  .student-record-table tbody {
    display: table-row-group;
  }

  .schedule-table tbody .schedule-row,
  .staff-record-table tbody .staff-row,
  .student-record-table tbody .student-row {
    display: table-row;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .schedule-table tbody .schedule-row td,
  .staff-record-table tbody .staff-row td,
  .student-record-table tbody .student-row td {
    display: table-cell;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #c4cec7;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .schedule-table tbody .schedule-row td::before,
  .staff-record-table tbody .staff-row td::before,
  .student-record-table tbody .student-row td::before {
    content: none;
  }

  .schedule-table .schedule-empty-row {
    display: table-row;
  }

  .schedule-table .schedule-empty-row td,
  .schedule-table td[colspan] {
    display: table-cell;
  }

  .public-site {
    overflow-x: clip;
  }

  .public-site main,
  .public-site .public-hero,
  .public-site .public-section,
  .public-site .public-footer,
  .public-site .public-hero-copy,
  .public-site .public-hero-card {
    min-width: 0;
    max-width: 100%;
  }

  .public-hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
    gap: 8px;
  }

  .public-hero-actions .public-button {
    min-width: 0;
    padding: 8px;
    font-size: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .public-quick-grid > *,
  .public-section > *,
  .public-contact-panel > * {
    min-width: 0;
  }
}
