* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: #17211f;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f3ec;
}

a {
  color: #0b5f6a;
  font-weight: 700;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 900;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(23, 33, 31, 0.14);
  box-shadow: 0 8px 28px rgba(23, 33, 31, 0.12);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.site-header p {
  margin: 5px 0 0;
  color: #4f5d5a;
  font-size: 0.95rem;
}

.site-header > a,
.details-link {
  white-space: nowrap;
}

.map-shell {
  position: fixed;
  top: 78px;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.filter-panel {
  position: absolute;
  top: 14px;
  left: 56px;
  z-index: 1050;
  width: min(980px, calc(100vw - 500px));
  min-width: 540px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 33, 31, 0.16);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.school-search {
  position: relative;
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.filter-panel label {
  display: grid;
  gap: 5px;
}

.filter-panel span {
  color: #52605d;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.filter-panel select,
.school-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 32px 9px 10px;
  color: #17211f;
  background: #ffffff;
  border: 1px solid rgba(23, 33, 31, 0.22);
  border-radius: 6px;
  font: inherit;
}

.school-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 1150;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(23, 33, 31, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 33, 31, 0.18);
  max-height: min(320px, 52vh);
  overflow-y: auto;
}

.school-suggestion,
.school-suggestion-empty {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  color: #17211f;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
  font: inherit;
  text-align: left;
}

.school-suggestion {
  cursor: pointer;
}

.school-suggestion:last-child,
.school-suggestion-empty:last-child {
  border-bottom: 0;
}

.school-suggestion:hover,
.school-suggestion:focus {
  background: #e7f3f1;
  outline: 0;
}

.school-suggestion-empty {
  color: #687470;
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.filter-footer p {
  margin: 0;
  color: #44514e;
  font-size: 0.9rem;
}

.filter-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-footer button {
  min-height: 42px;
  padding: 9px 12px;
  color: #0b5f6a;
  background: #e7f3f1;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.filter-footer button:hover {
  background: #d6ebe7;
}

.filter-toggle {
  display: none;
}

.empty-state {
  position: absolute;
  top: 132px;
  left: 56px;
  z-index: 850;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #17211f;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 33, 31, 0.16);
  line-height: 1.35;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  background: #dde7df;
  outline: 0;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-overlay-pane svg,
.leaflet-overlay-pane canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  max-width: none;
  max-height: none;
}

.leaflet-map-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  float: left;
  clear: both;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom {
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: #fff;
}

.leaflet-control-zoom a {
  display: block;
  width: 36px;
  height: 36px;
  color: #17211f;
  border-bottom: 1px solid #ccd4d2;
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  line-height: 36px;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
}

.leaflet-control-attribution {
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
}

.leaflet-popup {
  position: absolute;
  margin-bottom: 20px;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(23, 33, 31, 0.24);
  text-align: left;
}

.leaflet-popup-content {
  line-height: 1.4;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 14px;
  height: 14px;
  margin: -7px auto 0;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 0 6px 20px rgba(23, 33, 31, 0.2);
}

.leaflet-container a.leaflet-popup-close-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  color: #687470;
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  line-height: 28px;
}

.school-marker {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  background: #0b5f6a;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(23, 33, 31, 0.28);
}

.school-marker::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
}

.school-marker.is-multi-program {
  background: #087f73;
}

.site-footer {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 800;
  width: auto;
  max-width: min(360px, calc(100vw - 36px));
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(23, 33, 31, 0.12);
  color: #52605d;
  font-size: 0.72rem;
  line-height: 1.25;
}

.site-footer p {
  margin: 0;
}

.leaflet-popup-content {
  width: min(300px, calc(100vw - 56px));
  min-width: 220px;
  max-width: min(300px, calc(100vw - 56px));
  max-height: min(360px, calc(100vh - 250px));
  margin: 12px;
  overflow: hidden;
}

.popup-title {
  margin: 0 0 6px;
  color: #17211f;
  font-size: 0.98rem;
  line-height: 1.2;
}

.popup-meta,
.popup-focus {
  margin: 0 0 9px;
  color: #44514e;
  line-height: 1.35;
}

.popup-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 0 10px;
  padding: 5px 9px;
  color: #084d56;
  background: #e7f3f1;
  border: 1px solid rgba(11, 95, 106, 0.18);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.popup-programs {
  display: grid;
  gap: 4px;
  max-height: min(140px, 26vh);
  margin: 0 0 10px;
  padding-left: 17px;
  overflow-y: auto;
  color: #44514e;
  line-height: 1.3;
  font-size: 0.9rem;
}

.popup-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  color: #fff;
  background: #0b5f6a;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.popup-button:hover {
  background: #084d56;
}

.details-panel {
  position: fixed;
  top: 78px;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  max-width: 420px;
  height: calc(100vh - 78px);
  overflow-y: auto;
  padding: 26px 24px 88px;
  background: #ffffff;
  border-left: 1px solid rgba(23, 33, 31, 0.16);
  box-shadow: -18px 0 44px rgba(23, 33, 31, 0.2);
  transform: translateX(100%);
  transition: transform 190ms ease;
}

.details-panel.is-open {
  transform: translateX(0);
}

.details-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin: -10px -10px 2px 0;
  color: #17211f;
  background: #ffffff;
  border: 0;
  border-radius: 6px;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.details-close:hover {
  background: #edf4f2;
}

.details-title {
  margin: 0 34px 4px 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.details-location {
  margin: 0 0 18px;
  color: #52605d;
}

.program-count-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 30px;
  margin: -4px 0 18px;
  padding: 6px 10px;
  color: #084d56;
  background: #e7f3f1;
  border: 1px solid rgba(11, 95, 106, 0.18);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.details-list {
  display: grid;
  gap: 13px;
  margin: 0 0 18px;
}

.details-list div {
  display: grid;
  gap: 4px;
}

.details-list dt {
  color: #687470;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.details-list dd {
  margin: 0;
  line-height: 1.42;
}

.details-list .major-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
}

.details-list .major-chip {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  color: #084d56;
  background: #e7f3f1;
  border: 1px solid rgba(11, 95, 106, 0.16);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.admissions-snapshot {
  display: grid;
  gap: 11px;
  margin: 0 0 20px;
  padding: 14px;
  background: #f7faf8;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
}

.admissions-snapshot h3 {
  margin: 0;
  color: #17211f;
  font-size: 1rem;
  letter-spacing: 0;
}

.admissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.admissions-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  background: #ffffff;
  border: 1px solid rgba(23, 33, 31, 0.08);
  border-radius: 6px;
}

.admissions-item span {
  color: #687470;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admissions-item strong {
  color: #17211f;
  font-size: 1rem;
  line-height: 1.25;
}

.admissions-note,
.admissions-empty {
  margin: 0;
  color: #52605d;
  font-size: 0.88rem;
  line-height: 1.4;
}

.admissions-pathway {
  margin: 4px 0 22px;
  background: #ffffff;
  border: 1px solid rgba(11, 95, 106, 0.22);
  border-radius: 8px;
  overflow: hidden;
}

.admissions-pathway summary {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 13px 42px 13px 14px;
  color: #084d56;
  background: #e7f3f1;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.admissions-pathway summary::-webkit-details-marker {
  display: none;
}

.admissions-pathway summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 22px;
  height: 22px;
  color: #ffffff;
  background: #0b5f6a;
  border-radius: 999px;
  text-align: center;
  line-height: 22px;
  transform: translateY(-50%);
}

.admissions-pathway[open] summary::after {
  content: "-";
}

.admissions-pathway summary:hover {
  background: #d6ebe7;
}

.admissions-pathway summary small {
  color: #52605d;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

.admissions-pathway-content {
  display: grid;
  gap: 0;
  padding: 14px 14px 0;
}

.scholarship-pathway {
  margin: 0 0 20px;
  padding: 0;
  background: #ffffff;
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.scholarship-pathway h3 {
  margin: 0;
  padding: 13px 14px 4px;
  color: #17211f;
  background: #f7faf8;
  font-size: 1rem;
  letter-spacing: 0;
}

.scholarship-pathway-subtitle {
  margin: 0;
  padding: 0 14px 13px;
  color: #52605d;
  background: #f7faf8;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

.scholarship-pathway-content {
  display: grid;
  gap: 10px;
  padding: 14px;
  color: #44514e;
  font-size: 0.9rem;
  line-height: 1.45;
}

.scholarship-pathway-content p,
.scholarship-pathway-content h4 {
  margin: 0;
}

.scholarship-pathway-content h4 {
  color: #17211f;
  font-size: 0.92rem;
}

.scholarship-pathway-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.scholarship-pathway-note {
  margin: 0;
  color: #52605d;
  font-size: 0.88rem;
  line-height: 1.4;
}

.school-actions {
  display: grid;
  gap: 8px;
  margin: 2px 0 22px;
}

.school-actions .details-link {
  flex: 0 1 auto;
  width: 100%;
  color: #ffffff;
  background: #0b5f6a;
}

.school-actions .details-link:hover {
  background: #084d56;
}

.action-empty {
  display: block;
  padding: 10px 12px;
  color: #687470;
  background: #f2f5f4;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 6px;
  line-height: 1.35;
}

.programs-section {
  display: grid;
  gap: 12px;
  margin: 4px 0 22px;
}

.programs-section h3 {
  margin: 0;
  color: #17211f;
  font-size: 1rem;
  letter-spacing: 0;
}

.programs-list {
  display: grid;
  gap: 10px;
}

.program-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #f4f8f6;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
}

.program-card h4 {
  margin: 0;
  font-size: 0.98rem;
}

.program-card p {
  margin: 0;
  color: #44514e;
  line-height: 1.35;
}

.program-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.program-links .details-link {
  flex: 0 1 auto;
}

.details-link {
  display: inline-flex;
  flex: 1 1 150px;
  justify-content: center;
  min-height: 44px;
  align-items: center;
  padding: 10px 12px;
  color: #0b5f6a;
  background: #e7f3f1;
  border-radius: 6px;
  text-decoration: none;
}

.details-empty {
  display: block;
  width: 100%;
  color: #767d7b;
}

@media (max-width: 1100px) {
  .filter-panel {
    right: 16px;
    left: 56px;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel {
    max-width: none;
  }

  .filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .filter-panel:not(.is-expanded) .filter-grid,
  .filter-panel:not(.is-expanded) #clear-filters {
    display: none;
  }

  .details-panel {
    width: min(390px, 100vw);
    max-width: 390px;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 96px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  .site-header h1 {
    font-size: 1.18rem;
  }

  .site-header p {
    font-size: 0.88rem;
  }

  .map-shell {
    top: 96px;
    bottom: 0;
  }

  .filter-panel {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    min-width: 0;
    max-height: min(50vh, 390px);
    overflow-y: auto;
    padding: 10px;
  }

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

  .school-search {
    margin-bottom: 8px;
  }

  .filter-panel select,
  .school-search input {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .school-suggestions {
    max-height: min(260px, 42vh);
  }

  .filter-footer {
    align-items: center;
    flex-direction: row;
  }

  .filter-buttons {
    flex: 0 0 auto;
  }

  .filter-footer button {
    width: auto;
  }

  .filter-panel:not(.is-expanded) {
    max-height: none;
    overflow: visible;
  }

  .filter-panel.is-expanded {
    overflow-y: auto;
  }

  .empty-state {
    top: auto;
    right: 10px;
    bottom: 64px;
    left: 10px;
    max-width: none;
  }

  .details-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: min(76vh, 640px);
    max-height: calc(100vh - 96px);
    padding: 20px 18px 92px;
    border-top: 1px solid rgba(23, 33, 31, 0.16);
    border-left: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -18px 44px rgba(23, 33, 31, 0.22);
    transform: translateY(100%);
  }

  .details-panel.is-open {
    transform: translateY(0);
  }

  .site-footer {
    bottom: 40px;
    left: 8px;
    max-width: min(220px, calc(100vw - 16px));
    max-height: none;
    overflow: hidden;
    padding: 5px 8px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(23, 33, 31, 0.12);
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .site-footer {
    max-width: min(190px, calc(100vw - 16px));
    font-size: 0.64rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-footer p {
    font-size: 0.84rem;
  }

  .leaflet-popup-content {
    min-width: 220px;
    max-width: calc(100vw - 40px);
    max-height: min(330px, calc(100vh - 230px));
    margin: 12px;
  }

  .popup-title {
    font-size: 0.98rem;
  }

  .popup-programs {
    max-height: 120px;
    overflow-y: auto;
  }

  .details-title {
    font-size: 1.2rem;
  }

  .admissions-grid {
    grid-template-columns: 1fr;
  }

  .program-card {
    padding: 11px;
  }
}
