/* ============================================================
   HIGHLANDS FORWARD — STUDENT BUS ROUTE PLANNER
   Stylesheet — redesign pass (visual/responsive only)
   Sections:
     1. Design tokens
     2. Base styles
     3. Header
     4. Language selector
     5. Layout (shell / grid / support column)
     6. Alerts
     7. Form
     8. Results
     9. Maps
    10. Footer / legal links
    11. Responsive breakpoints
    12. Accessibility
    13. Print
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Highlands palette */
  --navy:    #1A2744;
  --navy2:   #1f3057;
  --navy3:   #223864; /* tonal surface, one step lighter than navy2 */
  --surface: #111e2e; /* input / recessed surface */
  --surface2:#0d1b2a; /* deep recessed surface */
  --gold:    #F4B400;
  --gold2:   #d9a000;
  --white:   #ffffff;
  --light:   #e8edf4;
  --muted:   #a6b7cc; /* raised from original for contrast on navy */
  --muted-dim: #8fa3bc;
  --green:   #27ae60;
  --blue:    #0077C8;
  --danger:  #ff7675;
  --danger-border: #c0392b;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius: var(--radius-md); /* legacy alias used throughout existing markup/JS-authored HTML */

  /* Borders / shadows */
  --border-subtle: rgba(255,255,255,0.10);
  --border-color: #2a3f58;
  --shadow-card: 0 12px 32px rgba(0,0,0,0.28);
  --shadow: var(--shadow-card); /* legacy alias */
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.38);

  /* Layout */
  --shell-max: 1220px;
  --header-height: 96px;

  /* Type scale */
  --fs-page-title: 1.9rem;
  --fs-section: 1.35rem;
  --fs-card-title: 1.15rem;
  --fs-body: 0.98rem;
  --fs-label: 0.78rem;
  --fs-support: 0.92rem;
}

/* ============================================================
   2. BASE STYLES
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

:lang(ar), :lang(fa), :lang(ps), [dir="rtl"] {
  font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; }

/* Centered application shell — nothing stretches edge-to-edge on wide screens */
.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-content {
  width: min(100% - 32px, var(--shell-max));
  margin-inline: auto;
  padding: 20px 0 8px;
  flex: 1;
}

/* ============================================================
   3. HEADER
   ============================================================ */
.app-header {
  background: var(--navy2);
  border-bottom: 3px solid var(--gold);
}

.app-header-inner {
  width: min(100% - 32px, var(--shell-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  min-height: 72px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 52px;
}
.header-logo { width: 100%; height: auto; object-fit: contain; display: block; }

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.header-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.header-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 480px) { .logo-container { width: 60px; } }
@media (min-width: 900px) { .logo-container { width: 70px; } }

/* ============================================================
   4. LANGUAGE SELECTOR
   ============================================================ */
.lang-wrap {
  position: relative;
  z-index: 2000;
  width: 100%;
  max-width: 260px;
  flex-shrink: 0;
}

.lang-dropdown {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s;
  min-height: 44px;
}
.lang-dropdown:hover, .lang-dropdown:focus-visible { border-color: var(--gold); }

.lang-flag { font-size: 1.15rem; line-height: 1; }
.lang-label { font-size: 0.92rem; font-weight: 700; color: var(--white); flex: 1; }
.lang-chevron { transition: transform 0.2s; flex-shrink: 0; }

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #162032;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 70vh;
  overflow-y: auto;
}

.lang-option {
  padding: 13px 16px; font-size: 1rem; font-weight: 700;
  color: var(--white); cursor: pointer;
  border-bottom: 1px solid #1c2f44; transition: background 0.15s;
  display: flex; align-items: center; gap: 4px;
  min-height: 44px;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: #1c2f44; }
.lang-option.active { color: var(--gold); background: #0d2035; }

/* ============================================================
   5. LAYOUT — two-column desktop grid / support column
   ============================================================ */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .layout-grid {
    grid-template-columns: minmax(0, 65%) minmax(280px, 35%);
    gap: 28px;
  }
}

.col-main { min-width: 0; }

.col-support {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.support-card {
  background: var(--navy2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 18px;
  box-shadow: var(--shadow-card);
}

.support-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.how-it-works-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--fs-support);
  color: var(--light);
  line-height: 1.4;
}
.how-it-works-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.how-it-works-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

.tip-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #0a1f35;
  border-color: var(--blue);
}
.tip-card-icon { font-size: 1.1rem; line-height: 1.3; }
.tip-card-text { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.btn-secondary-block {
  width: 100%; padding: 13px; border: 2px solid var(--border-color); border-radius: var(--radius-md);
  background: transparent; color: var(--muted);
  font-family: 'Nunito', sans-serif; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s;
  min-height: 48px;
}
.btn-secondary-block:hover, .btn-secondary-block:focus-visible { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   6. SERVICE ALERTS
   ============================================================ */
.service-alerts { display: none; margin: 0 0 16px; }
.service-alerts.visible { display: block; }
.service-alerts-heading {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 8px; font-weight: 700;
}
.service-alerts-header { margin-bottom: 8px; }

.service-alert {
  position: relative; background: #0a1f35; border: 1px solid var(--blue);
  border-left: 3px solid var(--blue); border-radius: var(--radius-sm);
  padding: 12px 40px 12px 14px; margin-bottom: 8px; font-size: 0.88rem; line-height: 1.5;
  max-height: none;
}
.service-alert.severity-warning { background: #2a2010; border-color: var(--gold); }
.service-alert.severity-severe  { background: #2d1020; border-color: var(--danger-border); }
.service-alert-header { font-weight: 800; color: var(--light); margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.service-alert-desc { color: var(--muted); }
.service-alert-meta { margin-top: 6px; font-size: 0.76rem; color: var(--muted); opacity: 0.85; }
.service-alert-link { color: var(--gold); }
.service-alert-dismiss {
  position: absolute; top: 8px; right: 8px; min-width: 32px; min-height: 32px;
  background: none; border: none; color: var(--muted); font-size: 0.85rem; cursor: pointer;
  border-radius: 6px;
}
.service-alert-dismiss:hover, .service-alert-dismiss:focus-visible { color: var(--light); background: rgba(255,255,255,0.06); }

.route-alerts { display: none; margin: 12px 0 0; }
.route-alerts.visible { display: block; }
.route-alerts .service-alert { font-size: 0.82rem; }

.service-alerts-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btn-pill {
  background: transparent; border: 2px solid var(--border-color); border-radius: 30px; color: var(--white);
  font-family: 'Nunito', sans-serif; font-size: 0.82rem; font-weight: 700; padding: 8px 16px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  min-height: 40px;
}
.btn-pill:hover, .btn-pill:focus-visible { border-color: var(--gold); color: var(--gold); }
.btn-icon-only {
  background: transparent; border: 2px solid var(--border-color); border-radius: 50%; min-width: 34px; min-height: 34px;
  color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.btn-icon-only:hover, .btn-icon-only:focus-visible { border-color: var(--gold); color: var(--gold); }
.service-alerts-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.service-alerts-navcount { font-size: 0.76rem; color: var(--muted); min-width: 2.6em; text-align: center; }

.alerts-modal {
  display: none; position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,0.88);
  align-items: center; justify-content: center; padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
}
.alerts-modal.visible { display: flex; }
.alerts-modal-inner {
  max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column;
  background: var(--navy2); border: 2px solid var(--gold); border-radius: var(--radius-md); overflow: hidden;
}
.alerts-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 2px solid var(--border-color); flex-shrink: 0;
}
.alerts-modal-title { font-size: 1.05rem; font-weight: 800; color: var(--gold); }
.alerts-modal-list { padding: 16px; overflow-y: auto; flex: 1; }
.alerts-modal-list .service-alert:last-child { margin-bottom: 0; }
.alerts-modal-empty, .alerts-modal-loading, .alerts-modal-error { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 28px 8px; }
.alerts-modal-error { color: var(--danger); }

@media (max-width: 420px) {
  .alerts-modal { align-items: flex-start; padding: 8px; padding-top: max(24px, calc(env(safe-area-inset-top, 0px) + 16px)); }
  .alerts-modal-inner { max-height: calc(92vh - env(safe-area-inset-top, 0px)); }
  .service-alerts-viewall { flex: 1; text-align: center; }
}

/* ============================================================
   7. FORM
   ============================================================ */
.card {
  background: var(--navy2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.section-title {
  font-size: var(--fs-section);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}
.card-subtext {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.field-group { margin-bottom: 14px; }
.field-label {
  font-size: var(--fs-label); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 7px;
}
.field-helper-text {
  font-size: 0.76rem; color: var(--muted-dim); line-height: 1.4;
  margin: 6px 2px 0; font-weight: 400;
}

select, input[type="text"] {
  width: 100%; padding: 14px 14px;
  border-radius: var(--radius-sm); border: 2px solid var(--border-color);
  background: var(--surface); color: var(--white);
  font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 600;
  transition: border-color 0.2s;
  min-height: 50px;
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%238fa3bc'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  background-color: var(--surface); cursor: pointer;
}
select:focus, input[type="text"]:focus { outline: none; border-color: var(--gold); }
input[type="text"]::placeholder { color: var(--muted); font-weight: 400; }

.address-row { display: flex; gap: 8px; align-items: stretch; }
.address-row input { flex: 1; }
#saveAddrBtn {
  flex-shrink: 0; padding: 0 16px;
  border: 2px solid var(--border-color); border-radius: var(--radius-sm);
  background: #1c2f44; color: var(--muted);
  font-family: 'Nunito', sans-serif; font-size: 0.78rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  line-height: 1.2; text-align: center;
  min-height: 50px;
}
#saveAddrBtn.saved { border-color: var(--green); color: var(--green); background: #0d2218; }
#saveAddrBtn:active { transform: scale(0.97); }

#savedAddrBanner {
  display: none;
  background: #0d2218; border: 1px solid var(--green);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  font-size: 0.88rem; color: var(--green);
  align-items: center; gap: 10px;
}
#savedAddrBanner strong { color: var(--light); }
#useSavedBtn {
  margin-left: auto; flex-shrink: 0;
  background: var(--green); border: none; border-radius: 8px;
  color: var(--navy); font-family: 'Nunito', sans-serif;
  font-size: 0.8rem; font-weight: 800; padding: 7px 12px; cursor: pointer;
  min-height: 32px;
}
#clearSavedBtn {
  flex-shrink: 0; background: none; border: none;
  color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0 4px;
  min-width: 32px; min-height: 32px;
}

#findBtn {
  width: 100%; padding: 16px; border: none; border-radius: var(--radius-md);
  background: var(--gold); color: var(--navy);
  font-family: 'Nunito', sans-serif; font-size: 1.1rem; font-weight: 800;
  cursor: pointer; letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  margin-top: 4px;
  min-height: 54px;
  box-shadow: 0 8px 20px rgba(244,180,0,0.18);
}
#findBtn:hover { background: var(--gold2); }
#findBtn:active { transform: scale(0.99); background: var(--gold2); }
#findBtn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
#findBtn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

#arrivalBanner {
  display: none;
  background: #0a1f35; border: 2px solid var(--gold);
  border-radius: var(--radius-md); padding: 14px 16px; margin-top: 16px;
  text-align: center;
}
#arrivalBanner .arrive-label {
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}
#arrivalBanner .arrive-time {
  font-size: 1.8rem; font-weight: 800; color: var(--gold); line-height: 1;
}
#arrivalBanner .arrive-sub {
  font-size: 0.85rem; color: var(--muted); margin-top: 4px;
}

#loading { display: none; text-align: center; padding: 24px 0 8px; color: var(--muted); font-size: 0.95rem; font-weight: 700; }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--border-color); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.4s; }
}

#errorMsg {
  display: none; background: #2d1020; border: 2px solid var(--danger-border); color: var(--danger);
  border-radius: var(--radius-md); padding: 13px 14px; font-size: 0.95rem; font-weight: 700; margin-top: 16px;
}
#mapError {
  display: none; background: #2d1020; border: 2px solid var(--danger-border); color: var(--danger);
  border-radius: var(--radius-md); padding: 13px 14px; font-size: 0.9rem; font-weight: 700; margin-top: 16px; line-height: 1.5;
}
#mapError a { color: var(--gold); }

/* Saved-address banner label */
.saved-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; margin-bottom: 2px;
}

/* Form field stacking + address autocomplete z-index context */
.fields-wrapper { display: flex; flex-direction: column; gap: 0; }
.address-field-wrap { position: relative; z-index: 1000; }

/* Swap direction control */
.swap-wrap { display: flex; align-items: center; justify-content: center; margin: -4px 0 8px; }
.swap-btn {
  background: #1c2f44; border: 2px solid var(--border-color); border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s; flex-shrink: 0;
}
.swap-arrow-svg { transition: transform 0.4s; }

/* Site photo card (campus thumbnail) */
#sitePhotoCard { display: none; margin-bottom: 14px; }
.site-photo-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 2px solid var(--border-color); border-radius: var(--radius-md);
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.site-photo-row:hover { border-color: var(--gold); }
.site-photo-thumb {
  width: 64px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--surface2);
}
.site-photo-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: opacity 0.35s;
}
.site-photo-label-wrap { flex: 1; min-width: 0; }
.site-photo-caption {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px;
}
.site-photo-name {
  font-size: 0.95rem; font-weight: 800; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-photo-expand {
  flex-shrink: 0; color: var(--muted); display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 700;
}

/* Photo lightbox */
.photo-lightbox {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center; padding: 20px;
}
.photo-lightbox-inner { position: relative; max-width: 700px; width: 100%; }
.photo-lightbox-img {
  width: 100%; height: auto; max-height: 80vh; object-fit: contain;
  border-radius: var(--radius-md); display: block; box-shadow: var(--shadow-lg);
}
.photo-lightbox-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.photo-lightbox-meta { display: flex; align-items: center; gap: 8px; }
.photo-lightbox-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.photo-lightbox-label { font-size: 0.9rem; font-weight: 800; color: var(--white); }
.photo-lightbox-close {
  background: none; border: 2px solid var(--border-color); border-radius: 8px;
  color: var(--muted); font-family: 'Nunito', sans-serif; font-size: 0.82rem;
  font-weight: 700; padding: 6px 12px; cursor: pointer; min-height: 36px;
}

/* Bell schedule modal */
.bell-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.75); align-items: center; justify-content: center; padding: 16px;
}
.bell-modal-inner {
  background: var(--navy2); border-radius: var(--radius-md); border: 2px solid var(--gold);
  width: 100%; max-width: 680px; max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.bell-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 2px solid var(--border-color); flex-shrink: 0;
}
.bell-modal-header-left { display: flex; align-items: center; gap: 10px; }
.bell-modal-title { font-size: 1rem; font-weight: 800; color: var(--gold); }
.bell-modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.5rem;
  cursor: pointer; line-height: 1; padding: 0 4px; font-family: 'Nunito', sans-serif;
  min-width: 44px; min-height: 44px;
}
.bell-frame-wrap {
  flex: 1; overflow-y: auto; background: var(--surface2); padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.bell-pdf-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; color: var(--muted); gap: 12px;
}
.bell-pdf-loading-text { font-size: 0.9rem; font-weight: 700; }
.bell-pdf-error { display: none; text-align: center; padding: 32px; color: var(--muted); }
.bell-pdf-error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.bell-pdf-error-text { font-size: 0.9rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.bell-pdf-error-download {
  background: var(--gold); color: var(--navy); font-weight: 800; padding: 11px 22px;
  border-radius: var(--radius-md); text-decoration: none; font-size: 0.95rem; display: inline-block;
}
.bell-modal-footer { padding: 10px 16px; border-top: 1px solid var(--border-color); flex-shrink: 0; text-align: right; }
.bell-modal-download-link { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-decoration: none; }

/* ============================================================
   8. RESULTS
   ============================================================ */
#results { display: none; margin-top: 4px; }
.result-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 18px; margin-top: 14px; border-left: 4px solid var(--gold);
}
.result-card.green-border { border-left-color: var(--green); }
.result-card.blue-border  { border-left-color: var(--blue); }
.result-card h3 {
  font-size: 0.78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px;
}

.summary-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: #1c2f44; border-radius: 30px; padding: 8px 13px;
  font-size: 0.88rem; font-weight: 700; border: 2px solid var(--border-color); color: var(--white);
}
.pill.gold  { border-color: var(--gold);  color: var(--gold); }
.pill.green { border-color: var(--green); color: var(--green); }

.steps-list { list-style: none; }
.steps-list li {
  padding: 12px 0; border-bottom: 1px solid #1c2f44;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 0.95rem; line-height: 1.45;
}
.steps-list li:last-child { border-bottom: none; }
.step-badge {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 800; color: var(--navy);
  margin-top: 1px; letter-spacing: -0.01em; text-align: center;
}
.badge-walk { background: var(--muted-dim); }
.badge-bus  { background: var(--gold); }
.badge-rail { background: var(--green); color: #fff; }
.step-time  { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.step-stop  { font-weight: 700; color: var(--light); }

.route-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: 0; }
.route-tab {
  flex-shrink: 0; padding: 8px 14px; border-radius: 30px;
  border: 2px solid var(--border-color); background: transparent; color: var(--muted);
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  min-height: 40px;
}
.route-tab.active { background: var(--gold); border-color: var(--gold); color: var(--navy); }

#openMapsBtn {
  display: none; width: 100%; padding: 15px;
  border: 2px solid var(--gold); border-radius: var(--radius-md);
  background: transparent; color: var(--gold);
  font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800;
  cursor: pointer; margin-top: 16px; transition: background 0.2s;
  min-height: 52px;
}
#openMapsBtn:hover { background: rgba(245,197,24,0.08); }

/* ============================================================
   9. MAPS
   ============================================================ */
#map {
  width: 100%; height: 320px; border-radius: var(--radius-md);
  margin-top: 16px; border: 2px solid var(--border-color); display: none;
}

#walkMapSection { display: none; margin-top: 14px; }
#walkMap {
  width: 100%; height: 220px; border-radius: var(--radius-md);
  border: 2px solid var(--blue);
}
.walk-map-label {
  font-size: 0.78rem; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.walk-map-label::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  background: var(--blue); border-radius: 50%;
}

/* Google Places autocomplete dropdown */
.pac-container {
  background: #162032 !important; border: 2px solid #f5c518 !important;
  border-radius: var(--radius-sm) !important; font-family: 'Nunito', sans-serif !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 99999 !important; pointer-events: auto !important;
}
.pac-item {
  color: #fff !important; padding: 12px 14px !important;
  font-size: 0.95rem !important; cursor: pointer !important;
  border-top: 1px solid #1c2f44 !important;
}
.pac-item:first-child { border-top: none !important; }
.pac-item:hover, .pac-item-selected { background: #1c2f44 !important; cursor: pointer !important; }
.pac-item-query { color: #f5c518 !important; font-weight: 700 !important; }
.pac-matched { color: #f5c518 !important; font-weight: 700 !important; }
.pac-icon { display: none !important; }

/* ============================================================
   10. FOOTER / LEGAL LINKS
   ============================================================ */
.site-footer {
  width: min(100% - 32px, var(--shell-max));
  margin-inline: auto;
  margin-top: 26px; padding: 18px 0 24px; border-top: 1px solid #1c2f44;
  text-align: center;
}
.powered-by { font-size: 0.82rem; margin-bottom: 10px; }
.powered-by .pb-muted { color: var(--muted); }
.powered-by .pb-strong { color: var(--light); font-weight: 800; }
.legal-links { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.legal-links a { color: var(--muted); text-decoration: underline; }
.legal-links a:hover, .legal-links a:focus-visible { color: var(--gold); }
.legal-links a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.copyright { font-size: 0.76rem; color: var(--muted); opacity: 0.85; padding-bottom: 4px; }

/* school-note reused both as legacy class name and as a support-card in the aside */
.school-note {
  font-size: 0.85rem; color: var(--muted); line-height: 1.6;
}
.school-note strong { color: var(--light); }

/* ============================================================
   10b. LEGAL PAGES (privacy.html / terms.html)
   ============================================================ */
.legal-header-inner { justify-content: flex-start; }
.legal-main {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
  padding: 28px 0 8px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--gold);
  text-decoration: none; font-weight: 800; font-size: 0.92rem; margin-bottom: 18px;
  min-height: 44px;
}
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }
.legal-main h1 { font-size: 1.7rem; font-weight: 800; color: var(--gold); margin-bottom: 6px; }
.legal-main .meta-dates { font-size: 0.82rem; color: var(--muted); margin-bottom: 24px; }
.legal-main h2 {
  font-size: 1.15rem; font-weight: 800; color: var(--light); margin: 28px 0 10px;
  padding-top: 6px; border-top: 1px solid #1c2f44;
}
.legal-main h2:first-of-type { border-top: none; padding-top: 0; }
.legal-main p, .legal-main li { font-size: 0.95rem; line-height: 1.65; color: var(--light); margin-bottom: 12px; }
.legal-main ul { padding-left: 22px; margin-bottom: 12px; }
.legal-main strong { color: var(--white); }
.legal-main a { color: var(--gold); }
.note-box {
  background: #0a1520; border: 1px solid #1c2f44; border-radius: var(--radius-md);
  padding: 14px 16px; margin: 14px 0; font-size: 0.9rem; color: var(--muted);
}
.warn-box {
  background: #2d1020; border: 1px solid var(--danger-border); border-radius: var(--radius-md);
  padding: 14px 16px; margin: 14px 0; font-size: 0.9rem; color: var(--danger);
}
.warn-box strong { color: #ffb3ae; }
.legal-main ~ .site-footer,
body:has(.legal-main) .site-footer {
  width: min(100% - 32px, 760px);
}

@media print {
  .legal-main, .legal-main * { color: #000 !important; }
  .warn-box, .note-box { border-color: #999; }
}

/* ============================================================
   11. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 899px) {
  .shell-content { padding: 18px 0 8px; }
  .layout-grid { gap: 18px; }
  .card { padding: 22px; }
}

/* Mobile */
@media (max-width: 599px) {
  .shell-content { width: min(100% - 28px, var(--shell-max)); padding: 16px 0 8px; }
  .app-header-inner { width: min(100% - 28px, var(--shell-max)); padding: 12px 0; gap: 12px; }
  .site-footer { width: min(100% - 28px, var(--shell-max)); }
  .card { padding: 18px; border-radius: var(--radius-md); }
  .section-title { font-size: 1.2rem; }
  .header-subtitle { display: none; }
  .lang-wrap { max-width: none; order: 3; width: 100%; }
  .brand { flex: 1; }
  #findBtn { font-size: 1.05rem; }
}

@media (max-width: 375px) {
  .logo-container { width: 46px; }
  .header-title { font-size: 0.9rem; }
}

/* No horizontal scrolling anywhere */
html, body { overflow-x: hidden; }

/* ============================================================
   12. ACCESSIBILITY
   ============================================================ */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* Ensure interactive touch targets stay >=44px even inside dense components */
button, .lang-option, #saveAddrBtn, .route-tab, .btn-pill, .btn-icon-only {
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   13. PRINT
   ============================================================ */
@media print {
  .app-header, .lang-wrap, .service-alerts, .col-support, .site-footer,
  #findBtn, #bellBtn, #openMapsBtn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .result-card { box-shadow: none; border: 1px solid #ccc; }
}
