/* ==========================================================================
   Hat Yai Transit — shared design system
   Layout language copied from SG-JB Transit (navbar, hero, cards) and Malaysia
   Transit (map controls), re-skinned in "Lake Teal + Temple Gold".
   ========================================================================== */

:root {
  /* Brand */
  --brand: #0B6E79;          /* Songkhla Lake teal */
  --brand-2: #12939A;        /* lighter teal (gradient end, EV loop line) */
  --brand-dark: #095A63;     /* hover / pressed */
  --accent: #F2B33D;         /* temple gold */
  --accent-dark: #C98E1C;
  --brand-tint: #E0F2F1;
  --accent-tint: #FDF3DC;

  /* Route line colours */
  --line-ev: #12939A;
  --line-minibus: #B8860B;   /* darker gold, so the line stands out from orange main roads on the map */
  --line-srt: #C8102E;
  --line-srt-se: #8B0A1F;
  --line-ktm: #1C3F94;

  /* Neutrals (same as SG-JB) */
  --bg-light: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6b7280;
  --border-color: #e5e5e7;

  /* Status */
  --live: #22c55e;
  --sched: #6b7280;
  --est: #f59e0b;
  --danger: #c62828;
  --danger-bg: #fce4ec;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Noto Sans", Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Thai script needs a little more room for vowel/tone marks */
:lang(th) body, body:lang(th) { line-height: 1.6; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.85em; }

/* ── Navbar (SG-JB pattern) ─────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.navbar-brand {
  font-size: 1.2em;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.navbar-brand:hover { color: #fff; }
.navbar-brand .hy { color: var(--accent); }
.navbar-brand .brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.15);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, 0.15); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lang-toggle { display: flex; gap: 3px; }
.lang-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.lang-btn.active { background: #fff; color: var(--brand); font-weight: 700; }
.lang-btn:hover:not(.active) { background: rgba(255, 255, 255, 0.25); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5em; cursor: pointer; }
/* Hamburger menu below 1080px: the full navbar (7 links + language buttons) needs ~1050px in Malay */
@media (max-width: 1080px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--brand);
    flex-direction: column;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .lang-btn { padding: 4px 8px; font-size: 0.7rem; }
  .navbar { padding: 0 12px; }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 60%, var(--accent) 100%);
  color: #fff;
  text-align: center;
  padding: 56px 20px 48px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 2.6em; font-weight: 800; margin: 0 0 12px; position: relative; }
.hero h1 .hy { color: #FFE08A; }
.hero .tagline { font-size: 1.12em; opacity: 0.95; max-width: 560px; margin: 0 auto 8px; position: relative; }
.hero .tagline-sub { font-size: 0.92em; opacity: 0.85; position: relative; }
@media (max-width: 600px) { .hero h1 { font-size: 1.9em; } }

/* ── Page shell (content pages) ─────────────────────────────────────────── */
.page { max-width: 1000px; margin: 0 auto; padding: 28px 20px 48px; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.6em; font-weight: 800; margin: 0 0 6px; color: var(--brand-dark); }
.page-header p { margin: 0; color: var(--text-secondary); }
.panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.panel h2 { font-size: 1.15em; margin: 0 0 10px; color: var(--text-primary); }
.panel h3 { font-size: 1em; margin: 16px 0 8px; }

/* ── Quick actions / cards ──────────────────────────────────────────────── */
.quick-actions { padding: 36px 20px; max-width: 1000px; margin: 0 auto; }
.quick-actions-title { text-align: center; font-size: 1.1em; font-weight: 500; color: #555; margin: 0 0 22px; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.action-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
}
.action-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); color: inherit; }
.action-card h3 { font-size: 1.05em; font-weight: 700; margin: 0 0 4px; }
.action-card p { font-size: 0.85em; color: #666; margin: 0; }
.action-icon {
  font-size: 1.9em; flex-shrink: 0; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
}
.teal-bg { background: var(--brand-tint); }
.gold-bg { background: var(--accent-tint); }
.red-bg { background: #fde8ea; }
.green-bg { background: #dcfce7; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #2b1d00; }
.btn-accent:hover { background: var(--accent-dark); color: #1f1500; }
.btn-outline { background: #fff; color: var(--brand); border: 2px solid var(--brand-tint); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-white { background: #fff; color: var(--brand); }
.btn-white:hover { background: var(--accent-tint); color: var(--brand-dark); }

/* ── Status badges & route chips ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.7em; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap; line-height: 1.6;
}
.badge-sched { background: var(--sched); color: #fff; }
.badge-est { background: var(--est); color: #3b2500; }
.badge-hours { background: #fff; color: var(--sched); box-shadow: inset 0 0 0 1.5px var(--sched); }
.badge-live { background: var(--live); color: #fff; }
.route-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 2px 8px; border-radius: 6px;
  font-weight: 800; font-size: 0.85em; color: #fff; background: var(--brand-2);
}

/* ── Notices ────────────────────────────────────────────────────────────── */
.notice { border-radius: 10px; padding: 10px 14px; font-size: 0.9em; margin: 10px 0; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid #fcd98a; }
.notice-info { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid #a7dcd8; }
.notice-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #f5b5c4; }
.unofficial-box {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.85em;
  line-height: 1.5;
}
.unofficial-box.light { background: var(--accent-tint); border-color: #f3d18a; color: #5b4300; }

/* ── "Going beyond Hat Yai?" band ───────────────────────────────────────── */
.beyond-cta {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff; padding: 40px 20px; text-align: center;
}
.beyond-cta-inner { max-width: 760px; margin: 0 auto; }
.beyond-cta h2 { margin: 0 0 8px; font-size: 1.5em; }
.beyond-cta p { margin: 0 auto 18px; opacity: 0.92; max-width: 620px; }
.beyond-cta .beyond-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ── Sister apps ("Going beyond Hat Yai?"): used by the map's popup and the homepage band ── */
.beyond-hero {
  position: relative; padding: 22px 24px 18px; color: #fff; text-align: center;
  background: radial-gradient(120% 140% at 0% 0%, #12939A 0%, #0B6E79 45%, #0d3b40 100%);
}
.beyond-hero h2 { margin: 2px 0 6px; font-size: 22px; color: #fff; }
.beyond-hero p { max-width: 560px; margin: 0 auto; color: rgba(255, 255, 255, 0.88); font-size: 14px; line-height: 1.5; }
.beyond-globe { font-size: 34px; line-height: 1; }
/* The trip south as a line of stops: teal = this app; Malaysia is the bridge in the middle
   (Malaysia Transit's purple, a big pill with thick lines out to Padang Besar and Johor Bahru);
   SG-JB Transit's navy-to-red box holds the last hop (Johor Bahru — Singapore).
   The hibiscus is Malaysia's national flower (Bunga Raya). */
.beyond-route { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 0; max-width: 700px; margin: 16px auto 0; color: #fff; font-size: 12px; font-weight: 700; }
.br-stop { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.br-stop::before { content: ''; width: 10px; height: 10px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--dot, #fff); }
.br-stop.hy { --dot: #7fe0d6; }
.br-stop.sg { --dot: #f87171; }
.br-line { flex: 0 0 22px; height: 3px; margin: 0 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); }
.br-line.mt { flex: 1 1 40px; min-width: 24px; max-width: 70px; height: 6px; margin: 0; border-radius: 3px; background: linear-gradient(90deg, #b5a9ff, #8b7cf6); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3); }
.br-stop + .br-line.mt { margin-left: 8px; }
.br-line.mt + .br-stop { margin-left: 8px; }
.br-country {
  display: inline-flex; flex-direction: column; align-items: center; padding: 7px 18px 6px; line-height: 1.1;
  border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 16px;
  background: linear-gradient(135deg, #8b7cf6 0%, #5b4bd8 100%); box-shadow: 0 8px 22px rgba(30, 16, 90, 0.4);
}
.br-country-name { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 800; letter-spacing: 0.2px; }
.br-flower { font-size: 16px; }
.br-country-sub { margin-top: 3px; font-size: 10.5px; font-weight: 700; opacity: 0.88; }
/* SG-JB Transit's box: same shape as the Malaysia pill, in SG-JB's colours, with both cities inside */
.br-region {
  display: inline-flex; flex-direction: column; align-items: center; padding: 8px 14px 6px; line-height: 1.1;
  border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #b91c1c 100%); box-shadow: 0 8px 22px rgba(30, 16, 90, 0.4);
}
.br-region-stops { display: inline-flex; align-items: center; }
.br-region .br-stop.sg { --dot: #fecaca; }
.br-region .br-line { background: rgba(255, 255, 255, 0.6); }
.beyond-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px; background: #f5f7f8; }
.beyond-app { display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07); }
.beyond-app.mt { border-top: 4px solid #6b5ce7; }
.beyond-app.sg { border-top: 4px solid #1e3a8a; }
/* Screenshot in a little browser window */
.beyond-shot { margin: 12px 12px 0; overflow: hidden; border-radius: 8px; border: 1px solid #dbe2ea; background: #e2e8f0; }
.beyond-shot-bar { display: flex; align-items: center; gap: 5px; padding: 6px 8px; background: #eef2f6; border-bottom: 1px solid #dbe2ea; }
.beyond-shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.beyond-shot-bar i:nth-child(1) { background: #f87171; }
.beyond-shot-bar i:nth-child(2) { background: #fbbf24; }
.beyond-shot-bar i:nth-child(3) { background: #34d399; }
.beyond-shot-bar span { flex: 1; min-width: 0; margin-left: 6px; padding: 2px 8px; overflow: hidden; border-radius: 999px; background: #fff; color: #64748b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.beyond-shot img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.beyond-app-body { display: flex; flex: 1; flex-direction: column; padding: 12px 14px 14px; }
.beyond-app-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.beyond-app-head h3 { margin: 0; font-size: 17px; color: #0f172a; }
.beyond-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.beyond-app.mt .beyond-tag { background: #ede9fe; color: #4c1d95; }
.beyond-app.sg .beyond-tag { background: #fee2e2; color: #991b1b; }
.beyond-app-body p { margin: 0 0 10px; color: #475569; font-size: 13.5px; line-height: 1.5; }
.beyond-feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.beyond-feats li { padding: 4px 9px; border-radius: 8px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 600; }
/* App card button (the homepage; the map popup styles its own .dialog-btn) */
.beyond-btn { display: block; margin-top: auto; padding: 10px 14px; border-radius: 10px; color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.beyond-app.mt .beyond-btn { background: #5b4bd8; }
.beyond-app.mt .beyond-btn:hover { background: #4636c0; color: #fff; }
.beyond-app.sg .beyond-btn { background: #1e3a8a; }
.beyond-app.sg .beyond-btn:hover { background: #172e6e; color: #fff; }
/* Homepage: the band's teal background is the hero; the cards sit on it */
.beyond-home { padding: 44px 20px 40px; }
.beyond-home .beyond-hero { padding: 0; background: none; }
.beyond-home .beyond-hero h2 { font-size: 1.6em; }
.beyond-home .beyond-hero p { max-width: 600px; font-size: 1em; opacity: 1; }
.beyond-home .beyond-apps { max-width: 880px; margin: 24px auto 0; padding: 0; background: none; text-align: left; }
.beyond-home .beyond-app { border-color: transparent; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); }
.beyond-home .beyond-app-body p { max-width: none; opacity: 1; }
.beyond-home .beyond-madeby { margin: 18px auto 0; font-size: 0.85em; opacity: 0.85; }
@media (max-width: 680px) {
  .beyond-apps { grid-template-columns: 1fr; }
  .br-line { flex-basis: 14px; margin: 0 5px; }
  .br-country { padding: 6px 14px 5px; }
  .br-region { padding: 7px 10px 5px; }
  .beyond-home { padding: 32px 16px; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #0d3b40;
  color: rgba(255, 255, 255, 0.85);
  padding: 26px 20px 30px;
  font-size: 0.85em;
  text-align: center;
}
.site-footer a { color: #FFE08A; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 10px 0; }
.site-footer .footer-unofficial { max-width: 760px; margin: 10px auto 0; opacity: 0.85; font-size: 0.92em; }

/* ── Modals (content pages) ─────────────────────────────────────────────── */
.hyt-modal {
  position: fixed; inset: 0; z-index: 9000; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(13, 59, 64, 0.45); backdrop-filter: blur(4px);
}
.hyt-modal.show { display: flex; }
.hyt-modal-card {
  width: min(520px, 100%); max-height: min(760px, 90vh); overflow: hidden;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  animation: hytModalIn 0.2s ease-out;
}
@keyframes hytModalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.hyt-modal-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff;
}
.hyt-modal-header h2 { margin: 0; font-size: 1.05em; flex: 1; }
.hyt-modal-close {
  border: 0; background: transparent; color: rgba(255,255,255,0.9); font-size: 22px;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
}
.hyt-modal-close:hover { background: rgba(255,255,255,0.2); }
.hyt-modal-body { padding: 16px 18px 18px; overflow-y: auto; }
.hyt-modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 18px 18px; flex-wrap: wrap; }

/* ── Source list (sources page + modal) ─────────────────────────────────── */
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.source-item { border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; background: #fff; }
.source-item a { font-weight: 700; text-decoration: none; }
.source-item a:hover { text-decoration: underline; }
.source-item .source-supports { color: var(--text-secondary); font-size: 0.88em; margin-top: 3px; }
.source-item .source-meta { color: #94a3b8; font-size: 0.78em; margin-top: 3px; }
.source-type { font-size: 0.72em; font-weight: 800; border-radius: 999px; padding: 1px 8px; margin-right: 6px; white-space: nowrap; }
.source-type.official { background: #dcfce7; color: #166534; }
.source-type.community { background: #fef3c7; color: #92400e; }
.source-type.news { background: #e0e7ff; color: #3730a3; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.hyt-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.hyt-table th, .hyt-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.hyt-table th { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ── Dual-language stop names ───────────────────────────────────────────── */
.name-primary { font-weight: 600; }
.name-secondary { display: block; font-size: 0.82em; color: var(--text-secondary); font-weight: 400; }

/* ── Wordmark: English "Hat Yai Transit" / Thai "หาดใหญ่ทรานสิท" ─────────── */
.brand-th { display: none; }
html[lang="th"] .brand-th { display: inline; }
html[lang="th"] .brand-en { display: none; }

/* ── "Verify External Link" popup (js/url-verify.js; same pattern as Malaysia Transit / SG-JB) ── */
.url-verify-modal {
  display: none; position: fixed; inset: 0; z-index: 10000;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(13, 59, 64, 0.35); backdrop-filter: blur(4px);
}
.url-verify-modal.show { display: flex; }
.url-verify-content {
  width: 100%; max-width: 400px; background: #fff; border-radius: 12px; border: 1px solid #e0e0e0;
  box-shadow: 0 25px 50px -12px rgba(11, 110, 121, 0.35); animation: hytModalIn 0.2s ease-out; overflow: hidden;
}
.url-verify-header {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.url-verify-icon { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255, 255, 255, 0.2); }
.url-verify-icon svg { width: 24px; height: 24px; color: #fff; }
.url-verify-title { margin: 0; padding-right: 30px; font-size: 18px; font-weight: 800; color: #fff; }
.url-verify-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, 0.85); cursor: pointer;
}
.url-verify-close:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.url-verify-close svg { width: 18px; height: 18px; }
.url-verify-body { padding: 20px; }
.url-verify-text { margin: 0 0 14px; color: #555; font-size: 14px; }
.url-verify-text .site-name { color: #1f2937; font-weight: 700; }
.url-verify-note { margin: -6px 0 14px; color: #6b7280; font-size: 12px; font-style: italic; }
.url-verify-note[hidden] { display: none; }
.url-verify-box { margin-bottom: 16px; padding: 12px; border: 1px solid #e0e0e0; border-radius: 8px; background: #f8f9fa; }
.url-verify-label { margin: 0 0 8px; color: #666; font-size: 12px; }
.url-verify-url { display: flex; align-items: center; gap: 8px; }
.url-verify-url svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand); }
.url-verify-url code { color: var(--brand-dark); font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.url-verify-buttons { display: flex; gap: 8px; }
.url-verify-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  border-radius: 8px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.2s;
}
.url-verify-btn.cancel { background: #f0f0f0; border: 1px solid #ddd; color: #555; }
.url-verify-btn.cancel:hover { background: #e5e5e5; color: #333; }
.url-verify-btn.confirm { background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%); border: 0; color: #fff; }
.url-verify-btn.confirm:hover { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); }
.url-verify-btn svg { width: 16px; height: 16px; }
.url-verify-btn:focus-visible, .url-verify-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── "Before you download the GTFS" popup (js/gtfs-disclaimer.js): the external-link popup's look,
      wider, with a list that scrolls on small screens ── */
.gtfs-note-modal .url-verify-content { max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.gtfs-note-modal .url-verify-body { overflow-y: auto; }
.gtfs-note-modal .url-verify-text { color: #374151; }
.gtfs-note-list { margin: 0 0 14px; padding-left: 18px; color: #374151; font-size: 13.5px; line-height: 1.5; }
.gtfs-note-list li { margin: 7px 0; }
.gtfs-note-list strong { color: #1f2937; }
.gtfs-note-list code { padding: 1px 4px; border-radius: 4px; background: #f1f5f9; font-size: 12px; }
.gtfs-note-foot { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #78350f; font-size: 12.5px; }

/* ── "Track live in ViaBus" and "Call to confirm" popups (js/contact-modals.js): the external-link
      popup's look, with store badges and a big phone number ── */
.contact-modal .url-verify-content { max-width: 440px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.contact-modal .url-verify-body { overflow-y: auto; }
.contact-modal .url-verify-text { color: #374151; line-height: 1.5; }
.contact-list { margin: 0 0 14px; padding: 0; list-style: none; color: #374151; font-size: 13.5px; line-height: 1.45; }
.contact-list li { margin: 6px 0; }
.contact-notes { padding: 10px 12px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #78350f; font-size: 12.5px; }
.contact-notes li { margin: 3px 0; }
.contact-label { margin: 0 0 6px; color: #6b7280; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.contact-org { margin: 0 0 12px; color: #1f2937; font-size: 14px; font-weight: 600; line-height: 1.45; }
.contact-number { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand-dark); font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.contact-stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 10px; }
.contact-store { display: inline-block; line-height: 0; border-radius: 8px; }
.contact-store img { height: 44px; width: auto; }
.contact-store:focus-visible, .contact-web a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact-web { margin: 0 0 14px; text-align: center; font-size: 13px; }
.contact-web a { color: var(--brand-dark); font-weight: 700; }
.contact-foot { margin: 0 0 16px; color: #6b7280; font-size: 12px; line-height: 1.45; }
a.url-verify-btn { text-decoration: none; }
a.url-verify-btn.confirm:hover { color: #fff; }

/* ── Page popup (js/page-modal.js): the FAQ or Developers page inside a large popup instead of a separate page ── */
.page-modal {
  display: none; position: fixed; inset: 0; z-index: 9000;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(13, 59, 64, 0.35); backdrop-filter: blur(4px);
}
.page-modal.show { display: flex; }
html.page-modal-open { overflow: hidden; }
.page-modal-card {
  width: 100%; max-width: 880px; height: min(88vh, 920px); display: flex; flex-direction: column;
  background: var(--bg-light); border-radius: 14px; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(11, 110, 121, 0.35); animation: hytModalIn 0.2s ease-out;
}
.page-modal-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.page-modal-icon { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255, 255, 255, 0.2); }
.page-modal-icon svg { width: 22px; height: 22px; color: #fff; }
.page-modal-title { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.page-modal-page { color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; opacity: 0.9; }
.page-modal-page:hover { color: #fff; opacity: 1; }
.page-modal-close {
  width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: rgba(255, 255, 255, 0.85); cursor: pointer;
}
.page-modal-close:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.page-modal-close svg { width: 20px; height: 20px; }
.page-modal-close:focus-visible, .page-modal-page:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-modal-body { position: relative; flex: 1; min-height: 0; }
.page-modal-body iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg-light); opacity: 0; transition: opacity 0.15s; }
.page-modal.loaded .page-modal-body iframe { opacity: 1; }
.page-modal-loading { position: absolute; top: 24px; left: 0; right: 0; margin: 0; text-align: center; color: #6b7280; }
.page-modal.loaded .page-modal-loading { display: none; }
@media (max-width: 640px) {
  .page-modal { padding: 0; }
  .page-modal-card { max-width: none; height: 100%; border-radius: 0; }
  .page-modal-page { display: none; }
}

/* ── Numbered stop pins: a route + direction is selected, stops are numbered in travel order.
      Same look on the maps and in the stop lists, so the numbers match. ── */
.seq-pin-icon { background: transparent; border: 0; }
.seq-pin {
  box-sizing: border-box; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 3px solid var(--brand); border-radius: 50%; background: #fff; color: var(--brand);
  font: 800 11px/1 var(--font); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.seq-pin.terminal { width: 28px; height: 28px; font-size: 12px; }
.seq-pin.unverified { border-style: dashed; }
.seq-pin.small { width: 22px; height: 22px; border-width: 2px; font-size: 10.5px; box-shadow: none; flex-shrink: 0; }
