/* Current workflow layouts adapted to the ASU design. No data or permission rules. */
@media screen {
  html[data-theme] {
    --mac-zebra: var(--mac-hover);
  }
  html[data-theme] .bulk-mark-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
  }
  html[data-theme] .bulk-mark-controls label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    color: var(--mac-secondary);
    min-width: 0;
  }
  html[data-theme] .bulk-mark-controls select {
    min-width: 210px;
    max-width: 100%;
  }
  html[data-theme] .journal-table .day-head.distance-day {
    min-width: 80px;
    background: var(--mac-accent-soft);
  }
  html[data-theme] .journal-table .distance-label {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--mac-accent);
    white-space: nowrap;
  }
  html[data-theme] .journal-table .mark-td.distance-day {
    min-width: 80px;
    border-right-color: var(--table-rule-strong);
  }
  html[data-theme] .journal-table .mark[aria-disabled='true'] {
    cursor: default;
  }
  html[data-theme] :is(.journal-table .mark-td, .meals-table .meals-cell) {
    position: relative;
  }
  html[data-theme] :is(.journal-table, .meals-table) .fill-range {
    background: var(--mac-accent-soft);
    box-shadow: inset 0 0 0 1px var(--mac-accent);
  }
  html[data-theme] :is(.journal-fill-handle, .meals-fill-handle) {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--mac-accent);
    background: none;
    cursor: crosshair;
    touch-action: none;
  }
  html[data-theme] :is(.journal-fill-handle, .meals-fill-handle)::after {
    content: '';
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 8px;
    height: 8px;
    border: 1px solid var(--mac-surface);
    background: var(--mac-accent);
  }
  html[data-theme] :is(.journal-fill-handle, .meals-fill-handle):focus-visible {
    outline: 2px solid var(--mac-accent);
    outline-offset: -2px;
  }
  html[data-theme] .journal-fill-handle {
    visibility: hidden;
  }
  html[data-theme] .journal-table .mark-td:is(:hover, :focus-within) .journal-fill-handle {
    visibility: visible;
  }
  html[data-theme] .journal-table .mark-td:focus-within {
    background: var(--mac-accent-soft);
  }
  /* New workflows share the same field, panel and table vocabulary. */
  html[data-theme] :is(.meals-page, .student-attendance-page, .student-attendance-results) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    min-width: 0;
  }

  html[data-theme] :is(.meals-page, .student-attendance-page, .student-attendance-results) > * {
    min-width: 0;
    max-width: 100%;
  }

  html[data-theme] #meals-plan-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    min-width: 0;
    max-width: 100%;
  }

  html[data-theme] #meals-plan-form > * {
    min-width: 0;
    max-width: 100%;
  }

  html[data-theme] :is(.meals-page, .student-attendance-page) > .page-heading {
    margin-bottom: 0;
  }

  html[data-theme] :is(.meals-toolbar, .student-attendance-controls, .student-attendance-filters) {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    min-width: 0;
    background: var(--mac-surface);
    border: 1px solid var(--mac-line);
    border-radius: var(--mac-radius);
  }

  html[data-theme]
    :is(.meals-toolbar, .student-attendance-controls, .student-attendance-filters)
    > label {
    display: grid;
    gap: 8px;
    min-width: 0;
    flex: 1 1 180px;
    color: var(--mac-text);
    font-size: 14px;
    line-height: 1.5;
  }

  html[data-theme]
    :is(.meals-toolbar, .student-attendance-controls, .student-attendance-filters)
    :is(input, select, .search-field) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  html[data-theme] .student-attendance-controls > .student-attendance-search {
    flex: 2 1 300px;
  }

  html[data-theme] .student-attendance-search .search-field {
    margin: 0;
  }

  html[data-theme]
    :is(.meals-report-actions, .feedback-actions, .student-attendance-pagination > div) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  html[data-theme] .meals-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-variant-numeric: tabular-nums;
  }

  /* Reserve the roster column; share the remaining width across the whole month. */
  html[data-theme] .meals-table.meals-matrix {
    --meals-roster-width: 190px;
    --meals-total-width: 64px;
    --meals-day-min: 28px;
    width: 100%;
    min-width: calc(
      var(--meals-roster-width) + var(--meals-total-width) + var(--meals-days, 23) *
        var(--meals-day-min)
    );
    table-layout: fixed;
  }

  html[data-theme] .meals-matrix .meals-roster-col {
    width: var(--meals-roster-width);
  }

  html[data-theme] .meals-matrix .meals-total-col {
    width: var(--meals-total-width);
  }

  html[data-theme] .meals-table.meals-matrix tr > :first-child {
    width: var(--meals-roster-width);
    min-width: 0;
    max-width: none;
    padding: 12px;
  }

  html[data-theme] .meals-table.meals-matrix :is(.meals-date-column, .meals-cell) {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 4px 1px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-date-column {
    padding-block: 10px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-date-column > strong {
    font-size: 14px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-date-column > small {
    margin-top: 2px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-count {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    padding: 4px 1px;
    border-radius: 4px;
    font-size: 14px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-row-total {
    width: var(--meals-total-width);
    min-width: 0;
    padding-inline: 3px;
    font-size: 13px;
  }

  html[data-theme] .meals-table.meals-matrix tfoot :is(th, td):not(:first-child) {
    min-width: 0;
    padding: 8px 1px;
    font-size: 12px;
  }

  html[data-theme] .meals-table :is(th, td) {
    padding: 12px 8px;
    text-align: center;
    min-width: 76px;
    vertical-align: middle;
  }

  html[data-theme] .meals-table tr > :first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    padding: 16px;
    text-align: left;
    background: var(--mac-surface);
    border-right: 1px solid var(--table-rule-strong);
  }

  html[data-theme] .meals-table thead tr > :first-child {
    z-index: 6;
    background: var(--mac-header);
  }

  html[data-theme] .meals-table :is(.meals-input, .meals-count) {
    width: 60px;
    min-width: 56px;
    min-height: 44px;
    padding: 8px 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: var(--mac-surface);
    border-radius: 8px;
    appearance: textfield;
    -moz-appearance: textfield;
  }

  html[data-theme] .meals-count::-webkit-inner-spin-button,
  html[data-theme] .meals-count::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  html[data-theme] .meals-matrix-scroll {
    max-width: 100%;
    overflow: auto;
    max-height: 68dvh;
    isolation: isolate;
    scrollbar-width: auto;
    border-top: 1px solid var(--mac-line);
    border-bottom: 1px solid var(--mac-line);
  }

  html[data-theme] .meals-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--mac-header);
    border-bottom: 1px solid var(--table-rule-strong);
  }

  html[data-theme] .meals-matrix .meals-date-column {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding: 16px 8px;
  }

  html[data-theme] .meals-date-column > strong {
    display: block;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 650;
  }

  html[data-theme] .meals-date-column > small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--mac-secondary);
  }

  html[data-theme] .meals-group-column {
    vertical-align: middle;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-theme] .meals-group-column > :is(strong, small, span) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-theme] :is(.curator, .full-date-table .sticky-curator) {
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  html[data-theme] .curator {
    max-width: none;
    overflow: visible;
  }

  html[data-theme] .meals-group-column > strong {
    display: block;
    color: var(--mac-accent);
    font-size: 16px;
  }

  html[data-theme] .meals-group-column > small,
  html[data-theme] .meals-roster-count {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mac-secondary);
  }

  html[data-theme] .meals-matrix .meals-cell {
    position: relative;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding: 10px 8px;
    background: var(--mac-surface);
  }

  html[data-theme] .meals-cell-selected {
    box-shadow: inset 0 0 0 2px var(--mac-accent);
  }

  html[data-theme] .meals-matrix .meals-cell-invalid {
    background: var(--mac-component-danger-bg);
    box-shadow: inset 0 0 0 2px var(--mac-component-danger);
  }

  html[data-theme] .meals-cell-invalid > .meals-count {
    border-color: var(--mac-component-danger);
    color: var(--mac-component-danger);
  }

  html[data-theme] .meals-matrix :is(.meals-range-selected, .fill-range) {
    background: var(--mac-accent-soft);
    box-shadow: inset 0 0 0 1px var(--mac-accent);
  }

  html[data-theme] .meals-matrix .meals-row-total {
    min-width: 92px;
    font-weight: 650;
    background: var(--mac-raised);
  }

  html[data-theme] .meals-matrix tfoot :is(th, td) {
    background: var(--mac-accent-soft);
    color: var(--mac-text);
    font-size: 15px;
    font-weight: 650;
    border-top: 1px solid var(--table-rule-strong);
  }

  html[data-theme] .meals-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 32px;
    padding: 24px 26px;
    border: 1px solid var(--mac-line);
    border-radius: var(--mac-radius);
    background: var(--mac-surface);
    color: var(--mac-secondary);
  }

  html[data-theme] .meals-summary strong {
    color: var(--mac-accent);
  }

  html[data-theme] .meals-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  html[data-theme] .meals-stats > article {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 24px;
    min-height: 112px;
  }

  html[data-theme] .meals-stats > article > span {
    color: var(--mac-secondary);
    font-size: 14px;
    line-height: 1.6;
  }

  html[data-theme] .meals-stats > article > strong {
    color: var(--mac-accent);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 650;
  }

  html[data-theme] :is(.meals-help, .meals-matrix-help) {
    margin: 22px 26px;
    max-width: 820px;
    color: var(--mac-secondary);
    font-size: 15px;
    line-height: 1.75;
  }

  html[data-theme] .meals-report-panel > .form-footnote {
    margin: 0 26px 26px;
    color: var(--mac-secondary);
    font-size: 14px;
    line-height: 1.75;
  }

  html[data-theme] .meals-table tbody th {
    font-size: 15px;
    font-weight: 500;
  }

  html[data-theme] .meals-table .meals-weekend > :is(th, td) {
    background: var(--mac-raised);
  }

  html[data-theme] .meals-group-heading {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    padding: 26px;
    border-bottom: 1px solid var(--mac-line);
  }

  html[data-theme] .meals-group-heading p {
    font-size: 15px;
    color: var(--mac-secondary);
    margin-top: 8px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  html[data-theme] .meals-savebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    border: 1px solid var(--mac-line);
    border-radius: var(--mac-radius);
    background: var(--mac-surface);
  }

  html[data-theme] .meals-status {
    color: var(--mac-secondary);
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  html[data-theme] .meals-status > span {
    display: block;
  }

  html[data-theme] .meals-status > span + span {
    font-size: 12px;
    margin-top: 5px;
  }

  html[data-theme] .meals-layout > .form-error:empty {
    margin: 0;
  }

  html[data-theme] .meals-group-error {
    margin: 16px 26px;
    padding: 16px 18px;
    border: 1px solid var(--mac-component-danger-line);
    border-radius: 10px;
    color: var(--mac-component-danger);
    background: var(--mac-component-danger-bg);
    font-size: 14px;
    line-height: 1.7;
  }

  html[data-theme] .meals-conflict {
    padding: 24px 26px;
    color: var(--mac-component-warning);
    background: var(--mac-component-warning-bg);
    border-top: 1px solid var(--mac-component-warning-line);
    font-size: 15px;
    line-height: 1.75;
  }

  html[data-theme] .meals-conflict p {
    margin-top: 8px;
  }

  html[data-theme] .meals-conflict ul {
    padding-left: 22px;
    margin-top: 12px;
  }

  html[data-theme] .meals-empty {
    padding: 30px;
  }

  html[data-theme] .meals-empty p {
    margin-top: 10px;
    color: var(--mac-secondary);
    font-size: 15px;
  }

  html[data-theme] .meals-report-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    padding: 26px;
  }

  html[data-theme] .meals-report-form > label {
    display: grid;
    gap: 8px;
    flex: 1 1 180px;
    min-width: 0;
    font-size: 14px;
    color: var(--mac-text);
  }

  html[data-theme] .meals-report-form select {
    width: 100%;
    min-width: 0;
  }

  html[data-theme] :is(.student-attendance-list, .student-attendance-detail, .meals-page .panel) {
    min-width: 0;
    overflow: hidden;
  }

  html[data-theme] .student-attendance-detail {
    scroll-margin-top: 26px;
  }

  html[data-theme] .student-attendance-metrics {
    margin: 0 26px 24px;
    gap: 18px;
  }

  html[data-theme] .student-attendance-metrics .stat-card {
    padding: 20px;
    min-height: 150px;
    box-shadow: none;
    background: var(--mac-raised);
  }

  html[data-theme] .student-attendance-explanation {
    margin: 0 26px 26px;
    color: var(--mac-secondary);
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  html[data-theme] .student-attendance-table {
    min-width: 1040px;
  }

  html[data-theme] .student-attendance-days {
    min-width: 620px;
  }

  html[data-theme] :is(.student-attendance-table, .student-attendance-days) :is(th, td) {
    padding: 18px 20px;
    line-height: 1.6;
  }

  html[data-theme] .student-attendance-table tbody th,
  html[data-theme] .student-attendance-days tbody th {
    background: var(--mac-surface);
    color: var(--mac-text);
    font-size: 15px;
    font-weight: 500;
  }

  html[data-theme] .student-attendance-name {
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 200px;
    max-width: 280px;
    padding: 0;
  }

  html[data-theme] .student-attendance-selected > :is(th, td) {
    background: var(--mac-accent-soft);
  }

  html[data-theme] .student-attendance-free-day > :is(th, td) {
    background: var(--mac-raised);
    color: var(--mac-secondary);
  }

  html[data-theme] .student-attendance-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    padding: 22px 26px;
    color: var(--mac-secondary);
    font-size: 14px;
    border-top: 1px solid var(--mac-line);
  }

  html[data-theme]
    :is(
      .student-attendance-placeholder,
      .student-attendance-loading,
      .student-attendance-error,
      .student-attendance-warning,
      .student-attendance-empty
    ) {
    padding: 30px;
    color: var(--mac-secondary);
  }

  html[data-theme]
    :is(
      .student-attendance-placeholder,
      .student-attendance-error,
      .student-attendance-warning,
      .student-attendance-empty
    )
    p {
    margin: 10px 0 18px;
    max-width: 740px;
    font-size: 15px;
    line-height: 1.7;
  }
  html[data-theme] .student-attendance-warning {
    color: var(--mac-component-warning);
    background: var(--mac-component-warning-bg);
    border-color: var(--mac-component-warning-line);
  }

  html[data-theme] .feedback-contacts {
    display: grid;
    gap: 22px;
    margin-bottom: 28px;
  }

  html[data-theme] .feedback-contact {
    display: grid;
    gap: 7px;
    padding: 18px 20px;
    border: 1px solid var(--mac-line);
    border-radius: 10px;
    background: var(--mac-raised);
  }

  html[data-theme] .feedback-contact > span {
    color: var(--mac-secondary);
    font-size: 13px;
  }

  html[data-theme] .feedback-contact > a {
    color: var(--mac-accent);
    font-size: 17px;
    font-weight: 600;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  html[data-theme] .feedback-note,
  html[data-theme] .feedback-empty p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--mac-secondary);
    white-space: pre-line;
    overflow-wrap: anywhere;
  }

  html[data-theme] .feedback-actions {
    justify-content: flex-end;
    margin-top: 28px;
  }

  html[data-theme] .feedback-form > .form-footnote {
    margin-bottom: 24px;
    font-size: 15px;
    color: var(--mac-secondary);
  }

  html[data-theme] .sidebar-bottom [data-action='feedback'] {
    border-radius: 10px;
    width: 100%;
    color: var(--mac-accent);
    background: var(--mac-accent-soft);
    text-align: left;
  }

  html[data-theme] .btn.danger {
    background: var(--mac-component-danger-bg);
    color: var(--mac-component-danger);
    border: 1px solid var(--mac-component-danger-line);
    box-shadow: none;
  }

  html[data-theme] .btn.danger:hover {
    border-color: var(--mac-component-danger);
  }

  html[data-theme] .user-actions .user-delete-button {
    color: var(--mac-component-danger);
    white-space: normal;
    text-align: left;
  }

  /* A navigation split view: collection, one-point divider, selected detail. */
  html[data-theme] .workspace-split {
    display: grid;
    grid-template-columns:
      minmax(420px, min(var(--split-list-size, 45%), calc(100% - 421px))) 1px
      minmax(420px, 1fr);
    gap: 0;
    min-width: 0;
    max-width: 100%;
    height: min(760px, calc(100dvh - 280px));
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--mac-line);
    border-radius: 8px;
    background: var(--mac-surface);
  }

  html[data-theme] :is(.workspace-list-pane, .workspace-detail-pane) {
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--mac-surface);
    box-shadow: none;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  html[data-theme] .workspace-list-pane {
    display: flex;
    flex-direction: column;
  }

  html[data-theme] .workspace-detail-pane {
    animation: workspace-detail-enter 160ms ease-out;
  }

  html[data-theme] .workspace-detail-pane > .panel,
  html[data-theme] .workspace-list-pane > .panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  html[data-theme] .workspace-divider {
    position: relative;
    align-self: stretch;
    z-index: 8;
    width: 1px;
    min-width: 1px;
    background: var(--mac-line);
    cursor: col-resize;
    touch-action: none;
    outline: 0;
  }

  html[data-theme] .workspace-divider::before {
    content: '';
    position: absolute;
    left: -5px;
    right: -5px;
    top: 0;
    bottom: 0;
  }

  html[data-theme] .workspace-divider:is(:hover, :focus-visible) {
    background: var(--mac-accent);
    box-shadow: 0 0 0 1px var(--mac-accent);
  }

  html[data-theme] .workspace-split.is-resizing {
    user-select: none;
    cursor: col-resize;
  }

  html[data-theme] :is(.split-back, .care-split-back) {
    display: none;
  }

  html[data-theme] .workspace-list-pane > .panel-head {
    flex: 0 0 auto;
    padding: 18px;
    border-bottom: 1px solid var(--mac-line);
    background: var(--mac-raised);
  }

  html[data-theme] .workspace-list-pane > .panel-head p {
    font-size: 13px;
    margin-top: 5px;
  }

  html[data-theme] .student-attendance-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    overflow: auto;
  }

  html[data-theme] .workspace-list-pane .student-attendance-compact-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    white-space: normal;
  }

  html[data-theme] .student-attendance-compact-table :is(th, td) {
    padding: 8px 10px;
    font-size: 15px;
    line-height: 1.55;
    vertical-align: middle;
    white-space: normal;
  }

  html[data-theme] .student-attendance-compact-table thead th {
    font-size: 12px;
    padding: 12px 6px;
    position: sticky;
    top: 0;
    z-index: 3;
  }

  html[data-theme] .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  html[data-theme] .student-attendance-compact-table tr > :nth-child(2) {
    width: 76px;
    overflow-wrap: anywhere;
  }

  html[data-theme] .student-attendance-compact-table tr > :nth-child(3) {
    width: 60px;
    padding-inline: 4px;
  }

  html[data-theme] .student-attendance-compact-table tr > :nth-child(4) {
    width: 48px;
    padding-inline: 4px;
  }

  html[data-theme] .student-attendance-compact-table tr > :last-child {
    width: 52px;
    padding: 4px;
  }

  html[data-theme] .workspace-list-pane .student-attendance-name {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    width: 100%;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
  }

  html[data-theme] .student-attendance-compact-table tbody tr > :first-child {
    padding: 0 10px;
  }

  html[data-theme] .student-attendance-compact-table tbody tr > :last-child {
    padding: 0 4px;
  }

  html[data-theme] .table-scroll .journal-table tbody tr > .mark-td {
    padding: 4px 6px;
  }

  html[data-theme] .table-scroll .meals-matrix tbody tr > .meals-cell {
    padding: 2px 1px;
  }

  html[data-theme] .student-attendance-selected .student-attendance-name {
    color: var(--mac-accent);
    font-weight: 600;
  }

  html[data-theme] .student-attendance-selected > :first-child {
    box-shadow: inset 3px 0 var(--mac-accent);
  }

  html[data-theme] .workspace-list-pane .student-attendance-pagination {
    flex: 0 0 auto;
    padding: 12px 16px;
    gap: 10px;
    background: var(--mac-raised);
    font-size: 12px;
  }

  html[data-theme] .student-attendance-pagination .btn {
    padding: 9px 12px;
    font-size: 14px;
  }

  html[data-theme] .workspace-detail-pane .student-attendance-detail {
    overflow: visible;
  }

  html[data-theme] .student-attendance-detail-heading {
    border-bottom: 1px solid var(--mac-line);
    padding: 20px;
  }

  html[data-theme] .student-attendance-detail-heading h2 {
    font-size: 21px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  html[data-theme] .workspace-detail-pane .student-attendance-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    gap: 0;
  }

  html[data-theme] .workspace-detail-pane .student-attendance-metrics .stat-card {
    display: block;
    min-height: 100px;
    padding: 16px 20px;
    border: 0;
    border-bottom: 1px solid var(--mac-line);
    border-right: 1px solid var(--mac-line);
    border-radius: 0;
    background: var(--mac-surface);
  }

  html[data-theme] .student-attendance-metrics .stat-icon {
    display: none;
  }

  html[data-theme] .student-attendance-metrics .stat-card strong {
    font-size: 26px;
  }

  html[data-theme] .workspace-detail-pane .student-attendance-explanation {
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--mac-line);
    background: var(--mac-raised);
    font-size: 13px;
  }

  html[data-theme] .student-attendance-detail-scroll {
    max-width: 100%;
    overflow: auto;
  }

  html[data-theme] .student-attendance-days {
    min-width: 480px;
    white-space: normal;
  }

  html[data-theme] .student-attendance-days :is(th, td) {
    padding: 10px 12px;
    font-size: 14px;
  }

  html[data-theme] .student-attendance-days tr > :first-child {
    white-space: nowrap;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    white-space: normal;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) :is(th, td) {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.55;
    vertical-align: middle;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) tbody th {
    font-size: 15px;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) tr > :first-child {
    width: 42%;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) tr > :nth-child(2) {
    width: 29%;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) :is(td, th) > small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--mac-secondary);
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) .text-button {
    padding: 0;
    min-height: 32px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) .badge {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-theme] .care-case-table small.care-review-due {
    display: block;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--mac-component-warning-line);
    border-radius: 6px;
    background: var(--mac-component-warning-bg);
    color: var(--mac-component-warning);
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.55;
  }

  html[data-theme] :is(.care-signal-table, .care-case-table) .is-selected > :first-child {
    box-shadow: inset 3px 0 var(--mac-accent);
  }

  html[data-theme] .care-list-pane .care-section {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--mac-line);
    border-radius: 0;
    box-shadow: none;
  }

  html[data-theme] .care-list-pane .panel-head {
    padding: 18px;
    border-bottom: 1px solid var(--mac-line);
    background: var(--mac-raised);
  }

  html[data-theme] .care-list-pane .panel-head h2 {
    font-size: 17px;
    line-height: 1.5;
  }

  html[data-theme] .care-list-pane .panel-head p {
    font-size: 13px;
  }

  html[data-theme] .care-list-pane .care-history-switch {
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 0;
    border-bottom: 1px solid var(--mac-line);
    border-radius: 0;
    background: var(--mac-raised);
  }

  html[data-theme] .care-list-pane .care-history-switch > button {
    flex: 1 1 140px;
    padding: 8px;
    font-size: 13px;
  }

  html[data-theme] .care-detail-placeholder {
    padding: 28px 24px;
    color: var(--mac-secondary);
    font-size: 15px;
    line-height: 1.75;
  }

  html[data-theme] .care-detail-placeholder h2 {
    margin-bottom: 12px;
  }

  html[data-theme] .care-inline-content {
    min-width: 0;
    max-width: 100%;
  }

  html[data-theme] .care-inline-content > .care-form-actions {
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid var(--mac-line);
    flex-wrap: wrap;
  }

  html[data-theme]
    .care-inline-content
    > :is(
      .care-signal-basis,
      .care-action-history,
      .care-student-signal-history,
      .care-case-details,
      .care-note,
      .care-empty,
      .care-subheading
    ) {
    margin: 18px 20px;
    max-width: calc(100% - 40px);
  }

  html[data-theme] .care-inline-content .care-work-heading {
    margin: 0;
    flex-wrap: wrap;
  }

  html[data-theme] .care-detail-pane .care-protocol-actions {
    flex-wrap: wrap;
  }

  html[data-theme] .care-detail-pane .care-evidence {
    flex-wrap: wrap;
  }

  html[data-theme] .care-detail-pane .care-case-form,
  html[data-theme] .care-detail-pane .care-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] .care-detail-pane .care-form-grid > .span-two {
    grid-column: auto;
  }

  html[data-theme] .care-detail-pane :is(.care-action-record, .care-case-details) {
    min-width: 0;
  }

  html[data-theme] .care-detail-pane :is(.care-student-header, .care-work-heading) {
    padding: 20px;
    border-bottom: 1px solid var(--mac-line);
  }

  html[data-theme] .care-detail-pane :is(.care-student-header, .care-work-heading) h3 {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  html[data-theme] .care-detail-pane :is(.care-signal-card, .care-case-card) {
    margin: 16px 20px;
    padding: 16px;
    border-radius: 8px;
  }

  @keyframes workspace-detail-enter {
    from {
      transform: translateX(4px);
    }
    to {
      transform: translateX(0);
    }
  }
}

@media screen and (max-width: 760px) {
  html[data-theme] .meals-table.meals-matrix {
    --meals-roster-width: 140px;
    --meals-day-min: 44px;
  }

  html[data-theme] .meals-table.meals-matrix .meals-count {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }

  /* The summary table hides columns on phones; student records need their marks. */
  html[data-theme] .student-attendance-days :is(th, td) {
    display: table-cell;
  }

  html[data-theme] .student-attendance-days {
    min-width: 520px;
    table-layout: fixed;
  }

  html[data-theme] .student-attendance-days tr > :first-child {
    width: 100px;
  }

  html[data-theme] .student-attendance-days tr > :nth-child(2) {
    width: 110px;
  }

  html[data-theme] .student-attendance-days tr > :nth-child(3) {
    width: 70px;
  }

  html[data-theme]
    .student-attendance-compact-table
    tr
    > :is(:nth-child(3), :nth-child(4), :last-child) {
    display: table-cell;
  }

  html[data-theme] .student-attendance-compact-table tr > :nth-child(2) {
    display: none;
  }
}

@media screen and (max-width: 1180px) {
  html[data-theme]
    .care-page:has(.care-split-view.is-detail-open)
    > :is(.care-filters, .care-scope-note, .care-stats, .care-method-note),
  html[data-theme]
    .student-attendance-page:has(.student-attendance-split.is-detail-open)
    > .student-attendance-controls {
    display: none;
  }
  html[data-theme] .workspace-split {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: visible;
  }

  html[data-theme] .workspace-divider {
    display: none;
  }

  html[data-theme] :is(.workspace-list-pane, .workspace-detail-pane) {
    min-width: 0;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--mac-line);
    border-radius: 8px;
  }

  html[data-theme] .workspace-detail-pane {
    display: none;
  }

  html[data-theme]
    .workspace-split:is(.is-detail-open, [data-detail-open='true'])
    > .workspace-list-pane {
    display: none;
  }

  html[data-theme]
    .workspace-split:is(.is-detail-open, [data-detail-open='true'])
    > .workspace-detail-pane:not([hidden]) {
    display: block;
  }

  html[data-theme] :is(.split-back, .care-split-back):not([hidden]) {
    display: inline-flex;
    margin: 16px 20px 0;
  }

  html[data-theme] .student-attendance-list-scroll {
    max-height: 68dvh;
  }

  html[data-theme] .workspace-detail-pane > .panel {
    border-radius: 8px;
  }
}

@container (max-width: 620px) {
  @media screen {
    html[data-theme] .documents-cards {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}

@media screen and (max-width: 760px) {
  html[data-theme] .admin-group {
    padding: 20px;
  }

  html[data-theme] .care-stat {
    padding: 18px;
  }

  html[data-theme] :is(.care-signal-card, .care-case-card) {
    padding: 17px;
  }

  html[data-theme] .modal {
    max-height: calc(100svh - 24px);
    border-radius: 10px;
    width: calc(100vw - 24px);
  }

  html[data-theme] .modal.wide-modal {
    width: calc(100vw - 24px);
  }

  html[data-theme] .modal-head {
    padding: 15px 18px;
    gap: 12px;
  }

  html[data-theme] .modal-head h2 {
    font-size: 20px;
  }

  html[data-theme] .modal-body {
    padding: 22px;
  }

  html[data-theme] .student-attendance-metrics {
    margin-inline: 20px;
  }

  html[data-theme] .student-attendance-explanation {
    margin-inline: 20px;
  }

  html[data-theme] :is(.meals-toolbar, .student-attendance-controls, .student-attendance-filters) {
    padding: 22px;
    gap: 18px;
  }

  html[data-theme] .student-attendance-pagination {
    padding: 20px;
  }

  html[data-theme] .student-attendance-detail {
    scroll-margin-top: 94px;
  }
}

@media screen and (max-width: 600px) {
  html[data-theme] :is(.documents-selector, .documents-history, .documents-card) {
    padding: 20px;
    border-radius: 10px;
  }

  html[data-theme] .documents-history-item {
    padding: 17px;
  }

  html[data-theme] .care-history-switch {
    width: 100%;
  }

  html[data-theme] .care-history-switch > button {
    font-size: 13px;
  }

  html[data-theme] :is(.document-preview-actions, .characteristic-actions, .group-delete-actions) {
    gap: 10px;
  }

  html[data-theme] .modal-body {
    padding: 20px;
  }

  html[data-theme] :is(.meals-toolbar, .student-attendance-controls, .student-attendance-filters) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme]
    :is(.meals-report-actions, .feedback-actions, .student-attendance-pagination > div) {
    width: 100%;
  }

  html[data-theme]
    :is(.meals-report-actions, .feedback-actions, .student-attendance-pagination > div)
    > .btn {
    flex: 1 1 140px;
  }

  html[data-theme] .student-attendance-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] .student-attendance-metrics .stat-card {
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 18px;
  }

  html[data-theme] .meals-summary {
    padding: 22px;
  }

  html[data-theme] .meals-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  html[data-theme] .meals-stats > article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    min-height: 80px;
    padding: 18px 22px;
  }

  html[data-theme] .meals-table :is(th, td) {
    padding: 12px 8px;
  }

  html[data-theme] .meals-table tr > :first-child {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    padding: 14px 12px;
  }

  html[data-theme] .meals-table :is(.meals-count, .meals-input) {
    width: 60px;
    min-width: 56px;
  }

  html[data-theme] :is(.meals-group-heading, .meals-savebar, .meals-report-form) {
    padding: 22px;
  }

  html[data-theme] :is(.meals-help, .meals-matrix-help) {
    margin: 20px 22px;
  }

  html[data-theme] .meals-report-panel > .form-footnote {
    margin: 0 22px 22px;
  }

  html[data-theme] .meals-savebar > .btn {
    width: 100%;
  }

  html[data-theme] .modal-body .report-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme] .modal-body .report-form-grid > .span-two {
    grid-column: auto;
  }

  html[data-theme] .modal-body :is(.care-document-button, .document-preview-actions > .btn) {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  html[data-theme] .characteristic-section {
    padding: 14px;
  }
}
