.headington-timetable-panel {
  margin-top: 56px;
  padding: clamp(16px, 3vw, 36px);
  background: #fff;
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  container-type: inline-size;
}

.headington-timetable-panel h4 {
  margin: 24px 0 10px;
  color: #14213d;
  font-size: 18px;
  line-height: 1.35;
  scroll-margin-top: 100px;
}

.headington-timetable-panel > h3 {
  scroll-margin-top: 100px;
}

.headington-timetable-note,
.headington-timetable-hint {
  margin: 0 0 8px;
  color: #5b6475;
  font-size: 15px;
}

.headington-timetable-hint {
  display: none;
}

:is(.headington-timetable-scroll, .programme-timetable) {
  --timetable-paper: #f3f5f8;
  --timetable-rule: #e3e7ee;
  --timetable-navy: #14213d;
  --timetable-activity: #a7bad2;
  --timetable-feature: #273d60;
  --timetable-routine: #e8ecf3;
  --timetable-accent: #d4a64a;
  overflow-x: auto;
  border: 1px solid #e3e7ee;
  border-radius: 10px;
}

:is(.headington-timetable-scroll, .programme-timetable):focus-visible {
  outline: 2px solid var(--timetable-navy);
  outline-offset: 3px;
}

:is(.headington-timetable-scroll, .programme-timetable) table {
  width: 100%;
  min-width: var(--timetable-width, 930px);
  table-layout: fixed;
  border-collapse: collapse;
  color: #29364d;
  font-size: 14px;
  line-height: 1.45;
}

:is(.headington-timetable-scroll, .programme-timetable) .headington-time-column {
  width: 116px;
}

:is(.headington-timetable-scroll, .programme-timetable) thead th {
  padding: 14px 12px;
  border-bottom: 1px solid #e3e7ee;
  background: var(--timetable-navy);
  color: #fff;
  font-weight: 600;
  text-align: left;
}

:is(.headington-timetable-scroll, .programme-timetable) tbody {
  background: var(--timetable-paper);
}

:is(.headington-timetable-scroll, .programme-timetable) tbody th,
:is(.headington-timetable-scroll, .programme-timetable) td {
  border-bottom: 1px solid var(--timetable-rule);
  vertical-align: middle;
}

:is(.headington-timetable-scroll, .programme-timetable) tbody th {
  height: 58px;
  padding: 10px 12px;
  color: var(--timetable-navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: nowrap;
}

:is(.headington-timetable-scroll, .programme-timetable) tbody tr:last-child > * {
  border-bottom: 0;
}

:is(.headington-timetable-scroll, .programme-timetable) td {
  position: relative;
  z-index: 0;
  padding: 15px 12px;
  color: var(--timetable-navy);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

:is(.headington-timetable-scroll, .programme-timetable) td:not(:empty)::before {
  position: absolute;
  z-index: -1;
  inset: 5px;
  border-radius: 8px;
  background: var(--timetable-activity);
  content: "";
}

:is(.headington-timetable-scroll, .programme-timetable) td.headington-timetable-block {
  color: #fff;
}

:is(.headington-timetable-scroll, .programme-timetable) td.headington-timetable-block::before {
  background: var(--timetable-feature);
}

:is(.headington-timetable-scroll, .programme-timetable) :is(td.timetable-routine, .headington-timetable-scroll td[colspan], .headington-timetable-break td) {
  color: var(--timetable-navy);
}

:is(.headington-timetable-scroll, .programme-timetable) :is(td.timetable-routine, .headington-timetable-scroll td[colspan], .headington-timetable-break td)::before {
  border: 1px dashed var(--timetable-accent);
  background: var(--timetable-routine);
}

:is(.headington-timetable-scroll, .programme-timetable) td strong {
  color: inherit;
}

:is(.headington-timetable-scroll td span, .programme-timetable td .timetable-detail) {
  display: block;
  margin-top: 4px;
  font-weight: 400;
}

.programme-timetable {
  max-inline-size: 100%;
}

.programme-timetable thead th:first-child {
  width: var(--timetable-label-width, 116px);
}

.programme-timetable tbody th {
  background: var(--timetable-paper);
  overflow-wrap: anywhere;
  white-space: normal;
}

.programme-timetable :is(thead th:first-child, tbody th[scope="row"]) {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
}

.programme-timetable td a {
  color: inherit;
}

.programme-timetable caption {
  background: var(--timetable-routine);
  color: var(--timetable-navy);
  font-weight: 700;
  padding: 12px;
  text-align: left;
}

.programme-timetable td.timetable-empty::before {
  content: none;
}

.programme-timetable td.timetable-highlight {
  color: #fff;
}

.programme-timetable td.timetable-highlight::before {
  background: #8c1d2c;
}

.timetable-supplement {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-block: 16px;
}

.timetable-supplement .programme-timetable {
  --timetable-width: 0px;
  --timetable-label-width: min(34%, 130px);
  align-self: start;
}

.timetable-supplement .programme-timetable th[scope="row"] {
  overflow-wrap: normal;
}

@container (max-width: 932px) {
  .headington-timetable-hint {
    display: block;
  }

  .headington-timetable-scroll tr > th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 #e3e7ee;
  }

  .headington-timetable-scroll tbody th {
    background: var(--timetable-paper);
  }
}

@media (max-width: 540px) {
  .headington-timetable-panel > div:last-child:not(.headington-timetable-scroll) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

