@font-face {
  font-family: "BP Sans";
  src: url("https://bp.driade.es/assets/fonts/bpsans/woff/bpSans-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BP Sans";
  src: url("https://bp.driade.es/assets/fonts/bpsans/woff/bpSans-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BP Sans";
  src: url("https://bp.driade.es/assets/fonts/bpsans/woff/bpSans-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BP Sans";
  src: url("https://bp.driade.es/assets/fonts/bpsans/woff/bpSans-Black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6c7a;
  --line: #d7dee7;
  --panel: #ffffff;
  --panel-soft: #f5f7fa;
  --accent: #0d766e;
  --accent-strong: #075e59;
  --pin: #d42d2d;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.16);
  font-family: "BP Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--panel-soft);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 500;
}

.brand {
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: #008000;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.controls {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.search-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#stationSearch {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

#stationSearch:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.14);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.station-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

#stationList {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
}

.station-item {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.station-item:hover,
.station-item:focus {
  background: #edf7f5;
  outline: none;
}

.station-name {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  line-height: 1.25;
}

.station-place {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.map-area {
  position: relative;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

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

#status {
  position: absolute;
  top: 16px;
  left: 50%;
  max-width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.14);
  color: var(--muted);
  font-size: 14px;
  z-index: 600;
}

#status:empty {
  display: none;
}

.leaflet-popup-content {
  min-width: 230px;
  margin: 14px 16px;
}

.popup-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.popup-details {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.popup-details div {
  display: grid;
  gap: 2px;
}

.popup-details dt {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.popup-details dd {
  margin: 0;
}

.popup-schedule {
  display: grid;
  gap: 3px;
  margin: 0;
}

.popup-details .popup-schedule-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
}

.popup-schedule-row dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.popup-schedule-row dd {
  color: var(--ink);
}

.popup-links {
  display: grid;
  gap: 4px;
}

.popup-details a {
  color: var(--accent-strong);
  font-weight: 700;
}

.popup-empty {
  margin: 0;
}

@media (max-width: 780px) {
  .map-shell {
    height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(58vh, 1fr) 42vh;
  }

  .sidebar {
    order: 2;
    height: 42vh;
    min-height: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand {
    padding: 14px 16px 10px;
  }

  h1 {
    font-size: 22px;
  }

  .controls {
    padding: 12px 16px;
  }

  .map-area {
    order: 1;
    height: 58vh;
    min-height: 58vh;
  }
}
