.notes-page {
  padding-top: clamp(1.8rem, 5vw, 4rem);
}

.notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(16rem, 0.32fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--lightgray);
}

.notes-page .section-block {
  border-bottom: 0;
}

.notes-hero h1 {
  max-width: none;
  margin: 0.2rem 0 1rem;
  color: var(--dark);
  font-family: var(--title-font);
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

@media (min-width: 901px) {
  .notes-hero h1 {
    white-space: nowrap;
  }
}

.notes-hero p {
  max-width: 48rem;
  color: var(--darkgray);
  font-size: 1.12rem;
  line-height: 1.55;
}

.privacy-note {
  padding: 1rem 1.1rem;
  border: 1px solid var(--lightgray);
  border-left: 3px solid var(--secondary);
  border-radius: 8px;
  background: var(--surface);
  color: var(--darkgray);
  font-family: var(--title-font);
  font-size: 0.86rem;
  line-height: 1.5;
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.5rem 0;
}

.notes-filter {
  padding: 0.48rem 0.82rem;
  border: 1px solid var(--lightgray);
  border-radius: 999px;
  background: var(--surface);
  color: var(--darkgray);
  font: 600 0.76rem var(--title-font);
  cursor: pointer;
}

.notes-filter:hover,
.notes-filter.is-active {
  border-color: var(--secondary);
  background: var(--secondary);
  color: #061111;
}

.pathway-map {
  --education-route: #e5963b;
  --technology-route: #9e77d2;
  --physiotherapy-route: #45a970;
  --research-route: #4e9fbd;
  display: grid;
  gap: 0.25rem;
  overflow: hidden;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--lightgray);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--secondary) 6%);
  box-shadow: 0 18px 42px color-mix(in srgb, black 10%, transparent);
}

.pathway-legend {
  display: flex;
  justify-content: flex-end;
  gap: 1.2rem;
  margin-bottom: 0.7rem;
  color: var(--darkgray);
  font: 500 0.72rem var(--title-font);
}

.pathway-legend span {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.legend-station,
.station-dot {
  display: block;
  width: 0.82rem;
  height: 0.82rem;
  flex: 0 0 auto;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 2px currentColor;
}

.legend-station.is-interchange {
  background: conic-gradient(var(--education-route) 0 25%, var(--technology-route) 25% 50%, var(--physiotherapy-route) 50% 75%, var(--research-route) 75%);
}

.pathway-route {
  --route-colour: var(--education-route);
  display: grid;
  grid-template-columns: minmax(8rem, 0.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  min-height: 8.2rem;
  border-top: 1px solid color-mix(in srgb, var(--lightgray) 55%, transparent);
  transition: opacity 0.18s ease;
}

.pathway-route:first-of-type {
  border-top: 0;
}

.pathway-route.is-muted {
  opacity: 0.36;
}

.pathway-technology { --route-colour: var(--technology-route); }
.pathway-physiotherapy { --route-colour: var(--physiotherapy-route); }
.pathway-research { --route-colour: var(--research-route); }

.pathway-route-label {
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border: 0;
  border-left: 4px solid var(--route-colour);
  background: transparent;
  color: var(--dark);
  font: 700 0.88rem var(--title-font);
  text-align: left;
  cursor: pointer;
}

.pathway-route-label small {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--route-colour) 16%, var(--surface));
  color: var(--route-colour);
  font-size: 0.7rem;
}

.pathway-track {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  padding: 1rem 0;
}

.pathway-line {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--route-colour);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 80%, transparent);
  transform: translateY(-50%);
}

.pathway-stations {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--station-count), minmax(0, 1fr));
  width: 100%;
  gap: 0.55rem;
}

.pathway-station {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dark);
  font-family: var(--title-font);
  cursor: pointer;
}

.pathway-station::before {
  content: "";
}

.station-dot {
  grid-row: 2;
  width: 1rem;
  height: 1rem;
  color: var(--route-colour);
  background: var(--station-marker);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pathway-station.is-interchange .station-dot {
  width: 1.18rem;
  height: 1.18rem;
  border-width: 4px;
  box-shadow: 0 0 0 2px var(--dark), 0 0 0 5px var(--surface);
}

.station-copy {
  grid-row: 1;
  align-self: end;
  display: grid;
  width: min(100%, 9.4rem);
  gap: 0.15rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--route-colour) 28%, var(--lightgray));
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 5px 12px color-mix(in srgb, black 7%, transparent);
  text-align: left;
}

.station-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  line-height: 1.18;
}

.station-copy small {
  color: var(--darkgray);
  font-size: 0.62rem;
  line-height: 1.2;
}

.pathway-station:hover .station-dot,
.pathway-station:focus-visible .station-dot {
  transform: scale(1.18);
}

.pathway-station:hover .station-copy,
.pathway-station:focus-visible .station-copy {
  border-color: var(--route-colour);
  color: var(--route-colour);
}

.pathway-route-label:focus-visible,
.pathway-station:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

.notes-library {
  display: grid;
  grid-template-columns: minmax(14rem, 0.3fr) minmax(0, 0.7fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-top: 3rem;
}

.notes-library-intro {
  position: sticky;
  top: 6rem;
  align-self: start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--lightgray);
  border-radius: 8px;
  background: var(--surface);
}

.notes-library-intro h2 {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.notes-list {
  display: grid;
  gap: 0.8rem;
}

.academic-note {
  border: 1px solid var(--lightgray);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  scroll-margin-top: 6.5rem;
}

.academic-note[open] {
  border-color: color-mix(in srgb, var(--secondary) 55%, var(--lightgray));
  box-shadow: 0 12px 24px color-mix(in srgb, black 10%, transparent);
}

.academic-note summary {
  display: grid;
  grid-template-columns: minmax(7rem, 0.25fr) minmax(0, 0.75fr);
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.academic-note summary::-webkit-details-marker {
  display: none;
}

.academic-note summary span {
  color: var(--tertiary);
  font: 700 0.7rem var(--title-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.academic-note summary strong {
  color: var(--dark);
  font: 700 1rem var(--title-font);
  line-height: 1.25;
}

.academic-note summary:hover strong {
  color: var(--secondary);
}

.note-body {
  padding: 0 1rem 1.1rem calc(25% + 1.75rem);
  color: var(--darkgray);
}

.note-body h3 {
  margin: 1.2rem 0 0.4rem;
  font-family: var(--title-font);
}

.note-body p,
.note-body li {
  line-height: 1.58;
}

.note-body li {
  margin-bottom: 0.25rem;
}

.academic-note.is-hidden {
  display: none;
}

.notes-back {
  display: inline-flex;
  margin-top: 2rem;
  font-family: var(--title-font);
}

@media (max-width: 900px) {
  .notes-hero,
  .notes-library {
    grid-template-columns: 1fr;
  }

  .notes-library-intro {
    position: static;
  }

  .academic-note summary {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .note-body {
    padding: 0 1rem 1rem;
  }

  .pathway-map {
    padding: 0.8rem;
  }

  .pathway-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pathway-route {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0.6rem 0 0.9rem;
  }

  .pathway-route-label {
    margin-bottom: 0.4rem;
  }

  .pathway-track {
    padding: 0;
  }

  .pathway-line {
    display: none;
  }

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

  .pathway-station {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    justify-items: stretch;
    gap: 0.55rem;
    padding: 0.5rem;
    border: 1px solid var(--lightgray);
    border-radius: 6px;
    background: var(--surface);
    text-align: left;
  }

  .pathway-station::before {
    display: none;
  }

  .station-dot,
  .station-copy {
    grid-row: 1;
  }

  .station-dot {
    grid-column: 1;
  }

  .station-copy {
    grid-column: 2;
    align-self: center;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  .pathway-stations {
    grid-template-columns: 1fr;
  }
}
