/* Shuttle services (2026-09-29). Route colours are the proposal's: Route A teal,
   Route B purple, carried in --route on each piece that belongs to a route. */

.pc-shuttle { --route: var(--brand); }

/* Only with the script: buttons that need it stay out of a page without it. */
.sh-js-only { display: none !important; }
.pc-js .sh-js-only { display: revert !important; }
.pc-js .btn.sh-js-only, .pc-js .sh-toggle.sh-js-only { display: inline-flex !important; }
.pc-js .sh-tt-pick.sh-js-only { display: flex !important; }
.pc-js .sh-js-only[hidden] { display: none !important; }   /* e.g. Near me with no geolocation */

/* Fingers, not pointers, below 768px: 40px targets (review, 2026-09-29). */
@media (max-width: 767.98px) {
  .sh-stop-actions .btn, .sh-result-actions .btn, .sh-pop-actions .btn, .sh-toggle button, .sh-find-row .btn {
    min-height: 40px; display: inline-flex; align-items: center;
  }
  .sh-serves summary, .sh-pop-serves summary { padding-block: .5rem; }
  .leaflet-container a.leaflet-popup-close-button { width: 40px; height: 40px; font-size: 22px; line-height: 40px; }
}

.sh-h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; font-weight: 700; margin: 0 0 .75rem; }
.sh-h2 .bi { color: var(--brand); }
.sh-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 .9rem; color: var(--brand-deep); }
.sh-lede { color: var(--muted); max-width: 52rem; }
.sh-section { margin-top: 2.5rem; }

/* ── At a glance ─────────────────────────────────────────────────────────── */
.sh-facts {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem;
}
.sh-facts li {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.sh-facts .bi { font-size: 1.5rem; color: var(--reef); flex: none; }
.sh-facts span { display: flex; flex-direction: column; line-height: 1.25; font-size: .85rem; color: var(--muted); }
.sh-facts strong { color: var(--ink); font-size: 1rem; }
@media (max-width: 991.98px) { .sh-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .sh-facts li { padding: .7rem .75rem; gap: .55rem; } .sh-facts .bi { font-size: 1.25rem; } }

/* ── Find your pickup point ──────────────────────────────────────────────── */
.sh-find-row { display: flex; gap: .5rem; }
.sh-find-row .form-control { flex: 1; min-width: 0; }
.sh-find-row .btn { white-space: nowrap; }
.sh-results { display: flex; flex-direction: column; gap: .6rem; }
.sh-result {
  border: 1px solid var(--line); border-left: 4px solid var(--route); border-radius: var(--radius-sm);
  padding: .7rem .8rem; background: var(--surface);
}
.sh-result-top { display: flex; gap: .6rem; align-items: flex-start; }
.sh-result-sub { font-size: .82rem; color: var(--muted); }
.sh-result-time { font-size: .85rem; margin: .45rem 0 .5rem; }
.sh-result-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.sh-result-none { font-size: .9rem; color: var(--muted); margin: 0; }

/* ── Next shuttle ────────────────────────────────────────────────────────── */
.sh-next { margin-top: 1rem; }
.sh-next-for { font-weight: 600; color: var(--brand-deep); margin: 0 0 .35rem; }
.sh-next-line { margin: 0 0 .35rem; }
.sh-next-line.is-big strong { font-size: 1.6rem; color: var(--brand-deep); margin-right: .25rem; }
.sh-next-bus { display: block; font-size: .82rem; color: var(--muted); }
.sh-fiji-time { margin-top: .5rem; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
.sh-mapcard { overflow: hidden; }
.sh-map-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
}
.sh-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.sh-toggle button {
  border: 0; background: transparent; border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; font-weight: 600;
  color: var(--ink); display: inline-flex; align-items: center; gap: .35rem;
}
.sh-toggle button:hover { background: var(--brand-soft); }
.sh-toggle button.is-on { background: var(--brand); color: #fff; }
.sh-swatch { width: .8rem; height: .8rem; border-radius: 50%; background: var(--route); box-shadow: 0 0 0 2px #fff; }
.sh-map { height: 460px; background: #e9eef2; }
@media (max-width: 767.98px) { .sh-map { height: 380px; } }
.sh-map-fallback { padding: 1rem; color: var(--muted); margin: 0; }
.sh-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: .6rem 1rem; border-top: 1px solid var(--line); color: var(--ink); }
.sh-legend > span { display: inline-flex; align-items: center; gap: .4rem; }
.sh-line { width: 26px; height: 0; border-top: 5px solid var(--muted); border-radius: 3px; }
.sh-line.is-back { border-top: 3px dashed var(--muted); }
.sh-venue-dot { width: 18px; height: 18px; border-radius: 50%; background: #0C3075; color: #FFD34D; font-size: .6rem; display: inline-flex; align-items: center; justify-content: center; }

/* Pins drawn by the script (L.divIcon). */
.sh-pin-wrap { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.sh-pin {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--route); color: #fff; font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .02em;
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.sh-pin.is-venue { width: 40px; height: 40px; background: #0C3075; color: #FFD34D; font-size: 1rem; }
.leaflet-marker-icon:focus-visible .sh-pin { outline: 3px solid #FFD34D; outline-offset: 2px; }

/* Popups. */
.sh-pop { font-size: .85rem; line-height: 1.35; min-width: 210px; }
.sh-pop-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; font-size: .95rem; }
.sh-pop-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 .35rem;
  border-radius: 999px; background: var(--route); color: #fff; font-weight: 700; font-size: .72rem;
}
.sh-pop-sub { color: #55677A; font-size: .8rem; }
.sh-pop-time { margin-top: .45rem; font-weight: 600; }
.sh-pop-note { margin-top: .35rem; color: #33475B; }
.sh-pop-serves { margin-top: .4rem; }
.sh-pop-serves summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.sh-pop-serves ul { margin: .3rem 0 0; padding-left: 1.1rem; max-height: 9rem; overflow: auto; }
.sh-pop-actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.sh-pop-actions .btn { font-size: .78rem; }
.leaflet-container a.btn-brand { color: #fff; }

/* ── The routes ──────────────────────────────────────────────────────────── */
.sh-route { height: auto; }
.sh-route-head {
  display: flex; gap: .85rem; align-items: center; padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--route) 8%, var(--surface));
  border-radius: var(--radius) var(--radius) 0 0;
}
.sh-route-badge {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--route); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem;
}
.sh-route-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.sh-route-meta { font-size: .85rem; color: var(--muted); }

.sh-stops { list-style: none; margin: 0; padding: .9rem 1.1rem 1rem; position: relative; }
.sh-stop { position: relative; display: flex; gap: .85rem; padding: 0 0 1.1rem; }
.sh-stop:last-child { padding-bottom: 0; }
/* The line between the dots. */
.sh-stop::before {
  content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 3px;
  background: color-mix(in srgb, var(--route) 45%, transparent); border-radius: 2px;
}
.sh-stop:last-child::before { display: none; }
.sh-stop-dot {
  position: relative; z-index: 1; flex: none; width: 33px; height: 33px; border-radius: 50%;
  background: var(--route); color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; border: 3px solid var(--surface);
}
.sh-stop.is-venue .sh-stop-dot { background: #0C3075; color: #FFD34D; font-size: .8rem; }
.sh-stop-body { flex: 1; min-width: 0; padding-top: .3rem; }
.sh-stop-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.sh-stop-name { font-size: .98rem; font-weight: 700; margin: 0; }
.sh-stop-time { font-size: .82rem; font-weight: 700; color: var(--route); white-space: nowrap; }
.sh-stop-also { font-size: .82rem; color: var(--muted); margin: .1rem 0 0; }
.sh-stop-note { font-size: .85rem; margin: .35rem 0 0; display: flex; gap: .4rem; }
.sh-stop-note .bi { color: var(--muted); flex: none; }
.sh-serves { margin-top: .4rem; font-size: .85rem; }
.sh-serves summary { cursor: pointer; color: var(--brand); font-weight: 600; width: fit-content; }
.sh-serves ul { margin: .4rem 0 0; padding-left: 1.1rem; columns: 2; column-gap: 1.5rem; }
.sh-serves li { break-inside: avoid; }
@media (max-width: 575.98px) { .sh-serves ul { columns: 1; } }
.sh-stop-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.sh-stop.is-chosen .sh-stop-body {
  background: color-mix(in srgb, var(--route) 9%, transparent); border-radius: var(--radius-sm);
  margin: -.3rem -.5rem 0; padding: .6rem .5rem .5rem;
}
/* A real element (shuttle.js adds it), so a screen reader says it too. */
.sh-your-stop {
  margin-left: .3rem; font-size: .7rem; font-weight: 700; color: #fff; white-space: nowrap;
  background: var(--route); border-radius: 999px; padding: .1rem .45rem; vertical-align: middle;
}

/* ── Timetable ───────────────────────────────────────────────────────────── */
.sh-tt-pick { align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sh-tt-pick .form-select { width: auto; max-width: 100%; }
/* Out-specifies app.css's `.table > thead th { white-space: nowrap; padding: 11px 14px }`,
   which pushed the bus columns off the card on laptops (review, 2026-09-29). */
.table.sh-table > thead th { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: normal; padding: .55rem .6rem; }
.table.sh-table > tbody td { padding: .6rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sh-table .sh-time { font-weight: 700; }
.sh-table td.sh-at { font-weight: 700; color: var(--brand-deep); }
.sh-table tr.is-past td { color: var(--muted); opacity: .6; }
.sh-table tr.is-next td { background: color-mix(in srgb, var(--reef) 14%, transparent); }
.sh-table tr.is-next .sh-time::after,
.sh-table.has-at tr.is-next td.sh-at::after {
  content: 'Next'; margin-left: .45rem; font-size: .68rem; color: #fff; background: var(--reef);
  border-radius: 999px; padding: .08rem .45rem; vertical-align: 1px;
}
/* With a stop chosen, the pill belongs to the time at that stop. */
.sh-table.has-at tr.is-next .sh-time::after { content: none; }
/* Long headings for wide screens and screen readers, short ones on a phone. */
.sh-short { display: none; }
@media (max-width: 575.98px) {
  .sh-long { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sh-short { display: inline; }
  /* A phone with a stop chosen: its time replaces the first stop's. */
  .sh-table.has-at th:first-child, .sh-table.has-at td:first-child { display: none; }
}
/* The narrowest phones (360 ran 23px over with a stop chosen). */
@media (max-width: 400px) {
  .table.sh-table > thead th, .table.sh-table > tbody td { padding-inline: .4rem; }
}
.sh-bus {
  display: inline-block; font-size: .78rem; font-weight: 700; color: var(--route);
  border: 1px solid color-mix(in srgb, var(--route) 45%, transparent); border-radius: 999px; padding: .05rem .5rem;
  white-space: nowrap;
}
.sh-tt-foot { padding: .6rem 1rem; border-top: 1px solid var(--line); }

/* ── Good to know ────────────────────────────────────────────────────────── */
.sh-know { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.sh-know li { display: flex; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.sh-know .bi { color: var(--reef); font-size: 1.25rem; flex: none; }
@media (max-width: 767.98px) { .sh-know { grid-template-columns: 1fr; } }
