/* TransitHub board — Agnico Eagle brand theme. Scoped under .transithub so it never fights the theme.*/
.transithub {
  --th-bg: #101820;
  --th-panel: #101820;
  --th-line: #263445;
  --th-text: #F5F6F7;
  --th-muted: #A7A8AA;
  --th-dim: #63666A;
  --th-amber: #F1C400;
  --th-bus: #F1C400;
  --th-flight: #009CDE;
  --th-green: #5D8F7F;
  --th-ochre: #DE8C40;
  --th-red: #C93326;
  --th-mono: "Arial Nova", Arial, "Helvetica Neue", sans-serif;
  background: var(--th-bg);
  color: var(--th-text);
  font-family: "Arial Nova", Arial, "Helvetica Neue", sans-serif;
  line-height: 1.5;
  border: 1px solid var(--th-line);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}
.transithub *, .transithub *::before, .transithub *::after { box-sizing: border-box; }

.th-loading { padding: 48px; text-align: center; font-family: var(--th-mono); font-size: 12px; color: var(--th-dim); letter-spacing: 0.15em; text-transform: uppercase; }

/* Title bar */
.th-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--th-line); flex-wrap: wrap; }
.th-brand { font-size: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.th-brand-logo { height: 100px; width: auto; display: block; border-radius: 3px; }
.th-brand-badge { width: 26px; height: 26px; background: var(--th-amber); color: #101820; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.th-brand-badge svg { width: 14px; height: 14px; fill: currentColor; }
.th-tagline { font-size: 11px; color: var(--th-muted); width: 100%; font-weight: 400; text-transform: none; letter-spacing: normal; }
.th-clock { font-family: var(--th-mono); font-size: 12px; color: var(--th-muted); display: flex; align-items: center; gap: 8px; }
.th-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--th-green); animation: th-pulse 2s infinite; }
@keyframes th-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(93,143,127,.5);} 50% { box-shadow: 0 0 0 5px rgba(93,143,127,0);} }

/* Ticker */
.th-ticker { border-bottom: 1px solid var(--th-line); background: #182230; padding: 8px 18px; display: flex; align-items: center; gap: 10px; }
.th-ticker.has-alerts { background: #1A1305; border-bottom-color: rgba(241,196,0,.35); }
.th-ticker-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; background: var(--th-amber); color: #101820; font-family: var(--th-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; }
.th-ticker-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #101820; animation: th-badge-ping 1.2s cubic-bezier(0,0,.2,1) infinite; }
@keyframes th-badge-ping { 0% { box-shadow: 0 0 0 0 rgba(16,24,32,.55);} 75%,100% { box-shadow: 0 0 0 6px rgba(16,24,32,0);} }
.th-ticker-calm { font-family: var(--th-mono); font-size: 10px; color: var(--th-dim); letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.th-ticker-calm::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--th-green); }
.th-marquee { overflow: hidden; flex: 1; }
.th-marquee-track { display: flex; width: max-content; gap: 48px; animation: th-marquee 42s linear infinite; }
@keyframes th-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .th-marquee-track { animation: none; } }
.th-ticker-item { font-family: var(--th-mono); font-size: 11px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.th-ticker-item.sev-info { color: #6FC5EE; }
.th-ticker-item.sev-warning { color: #F1C400; }
.th-ticker-item.sev-critical { color: #C93326; }

/* Sections */
.th-section { padding: 22px 18px; border-bottom: 1px solid var(--th-line); }
.th-section:last-child { border-bottom: none; }
.th-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.th-sec-head h2 { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; color: var(--th-text); font-family: "Arial Nova", Arial, sans-serif; }
.th-sec-note { font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); text-transform: uppercase; letter-spacing: 0.12em; }

/* Day chips */
.th-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; align-items: center; }
.th-days-label { font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); text-transform: uppercase; letter-spacing: 0.12em; margin-right: 4px; }
.th-chip { font-family: var(--th-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 12px; background: transparent; color: var(--th-muted); border: 1px solid var(--th-line); border-radius: 4px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.th-chip:hover { color: var(--th-amber); border-color: rgba(241,196,0,.5); }
.th-chip.active { background: var(--th-amber); border-color: var(--th-amber); color: #101820; }
.th-chip:focus-visible { outline: 2px solid var(--th-amber); outline-offset: 2px; }

/* Boards */
.th-boards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .th-boards { grid-template-columns: 1fr 1fr; } }
.th-board { background: var(--th-panel); border: 1px solid var(--th-line); border-radius: 8px; overflow: hidden; }
.th-board-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--th-line); }
.th-board-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-text); }
.transithub .th-board-title svg {
  width: 14px;
  height: 14px;}
.transithub .th-board-title {
  color: var(--th-text);}
.transithub .th-board-title svg {
  width: 14px;
  height: 14px;}
.transithub .th-board-title.bus svg,
.transithub .th-board-title.bus svg :not([fill="none"]) {
  color: var(--th-bus) !important;
  fill: var(--th-bus) !important;}
.transithub .th-board-title.flight svg,
.transithub .th-board-title.flight svg :not([fill="none"]) {
  color: var(--th-flight) !important;
  fill: var(--th-flight) !important;}
.th-board-count { font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); }
.th-empty { padding: 26px 14px; text-align: center; font-family: var(--th-mono); font-size: 11px; color: var(--th-dim); }
.th-row { border-bottom: 1px solid var(--th-line); }
.th-row:last-child { border-bottom: none; }
.th-row-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.th-row-btn:hover { background: rgba(38,52,69,.45); }
.th-row-btn:focus-visible { outline: 2px solid var(--th-amber); outline-offset: -2px; }
.th-row-main { flex: 1; min-width: 0; }
.th-row-name { font-family: var(--th-mono); font-size: 13px; font-weight: 700; color: var(--th-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-row-route { font-size: 10px; color: var(--th-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-row-times { font-family: var(--th-mono); font-size: 11px; color: var(--th-muted); display: none; }
@media (min-width: 560px) { .th-row-times { display: block; } }
.th-status { flex-shrink: 0; font-family: var(--th-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 8px; border: 1px solid; border-radius: 3px; position: relative; }
.th-status.st-scheduled { color: var(--th-muted); border-color: #3A4A5E; background: rgba(38,52,69,.5); }
.th-status.st-checkin { color: #6FC5EE; border-color: #005F88; background: rgba(0,156,222,.14); }
.th-status.st-boarding { color: #8FC9B2; border-color: #006147; background: rgba(0,97,71,.35); }
.th-status.st-transit { color: #A26E9F; border-color: #572469; background: rgba(87,36,105,.35); }
.th-status.st-arrived { color: #7FBFA8; border-color: #006147; background: rgba(0,97,71,.25); }
.th-status.st-delayed { color: var(--th-ochre); border-color: #8A5520; background: rgba(222,140,64,.15); }
.th-status.st-cancelled { color: #DA7067; border-color: #9C1D20; background: rgba(201,51,38,.15); }
.th-status.is-live::before { content: ''; position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: th-ping 1.4s cubic-bezier(0,0,.2,1) infinite; }
@keyframes th-ping { 75%,100% { transform: scale(2); opacity: 0; } }
.th-chev { width: 14px; height: 14px; color: var(--th-dim); transition: transform .2s; flex-shrink: 0; }
.th-row.open .th-chev { transform: rotate(180deg); }
.th-detail { display: none; }
.th-row.open .th-detail { display: block; }
.th-reason { margin: 0 14px 12px; padding-left: 12px; border-left: 2px solid var(--th-ochre); font-size: 11px; color: #F8EEE4; }
.th-note { margin: 0 14px 12px; font-size: 10px; color: var(--th-dim); }

/* Multi-stop tracker */
.th-track { padding: 52px 16px 46px; }
.th-track-bar { position: relative; height: 4px; background: #263445; border-radius: 2px; }
.th-track-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 2px; transition: width 1s linear; }
.th-track-icon { position: absolute; top: -8px; transition: left 1s linear; transform: translateX(-50%); }
.th-track-icon svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.th-track-dot { position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--th-bg); border: 2px solid #3A4A5E; transform: translateX(-50%); }
.th-track-stop { position: absolute; width: 74px; text-align: center; transform: translateX(-50%); }
.th-track-stop.above { bottom: 16px; }
.th-track-stop.below { top: 14px; }
.th-track-stop.first { transform: translateX(0); text-align: left; margin-left: -2px; }
.th-track-stop.last { transform: translateX(-100%); text-align: right; margin-left: 2px; }
.th-track-stop b { display: block; font-family: var(--th-mono); font-size: 9px; font-weight: 700; color: var(--th-text); }
.th-track-stop span { display: block; font-family: var(--th-mono); font-size: 8px; color: var(--th-dim); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Map */
.th-map { height: 380px; border-radius: 6px; overflow: hidden; border: 1px solid var(--th-line); }
@media (min-width: 860px) { .th-map { height: 440px; } }
.transithub .leaflet-container { background: #101820; font-family: inherit; }
.transithub .leaflet-tile-pane { filter: invert(0.92) hue-rotate(180deg) brightness(0.9) contrast(0.85) saturate(0.35); }
.transithub .th-map-tip { background: #182230 !important; color: #F5F6F7 !important; border: 1px solid #263445 !important; font-family: var(--th-mono) !important; font-size: 10px !important; font-weight: 700 !important; padding: 2px 7px !important; border-radius: 0 !important; box-shadow: none !important; }
.transithub .th-map-tip::before { display: none !important; }
.th-map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-family: var(--th-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--th-dim); }
.th-map-legend span { display: flex; align-items: center; gap: 6px; }
.th-swatch { width: 14px; display: inline-block; border-top: 2px solid; }
.th-map-note { margin-top: 8px; font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); }

/* Weather & roads */
.th-env { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .th-env { grid-template-columns: 1fr 1fr; } }
.th-panel { background: var(--th-panel); border: 1px solid var(--th-line); border-radius: 8px; overflow: hidden; }
.th-panel-head { padding: 10px 14px; border-bottom: 1px solid var(--th-line); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.th-wx-row { padding: 12px 14px; border-bottom: 1px solid var(--th-line); }
.th-wx-row:last-child { border-bottom: none; }
.th-wx-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.th-wx-name { font-size: 12px; font-weight: 700; }
.th-wx-src { font-family: var(--th-mono); font-size: 8px; color: var(--th-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-left: 8px; }
.th-wx-cond { font-size: 10px; color: var(--th-muted); margin-top: 2px; }
.th-wx-temp { font-family: var(--th-mono); font-size: 18px; font-weight: 700; color: var(--th-amber); }
.th-wx-details { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); }
.th-wx-details b { color: var(--th-text); font-weight: 700; }
.th-road-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--th-line); }
.th-road-row:last-child { border-bottom: none; }
.th-road-dot { flex-shrink: 0; margin-top: 4px; width: 9px; height: 9px; border-radius: 50%; }
.th-road-name { font-size: 12px; font-weight: 700; }
.th-road-note { font-size: 10px; color: var(--th-muted); }
.th-road-status { margin-left: auto; flex-shrink: 0; font-family: var(--th-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; }

/* Hubs */
.th-hub { background: var(--th-panel); border: 1px solid var(--th-line); border-left: 3px solid var(--th-dim); border-radius: 6px; margin-bottom: 8px; }
.th-hub.type-bus { border-left-color: var(--th-bus); }
.th-hub.type-air { border-left-color: var(--th-flight); }
.th-hub.type-mixed { border-left-color: #572469; }
.th-hub.type-other { border-left-color: var(--th-green); }
.th-hub-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 16px; background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.th-hub-btn:hover { background: rgba(38,52,69,.4); }
.th-hub-name { font-size: 13px; font-weight: 700; }
.th-hub-tag { display: block; font-family: var(--th-mono); font-size: 9px; color: var(--th-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.th-hub-plus { font-family: var(--th-mono); font-size: 14px; color: var(--th-dim); transition: transform .2s; }
.th-hub.open .th-hub-plus { transform: rotate(45deg); color: var(--th-amber); }
.th-hub-body { display: none; border-top: 1px solid var(--th-line); padding: 12px 16px 14px; }
.th-hub.open .th-hub-body { display: block; }
.th-hub-detail { display: flex; gap: 8px; font-size: 12px; color: var(--th-muted); margin-bottom: 8px; }
.th-hub-detail::before { content: ''; flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%; background: rgba(241,196,0,.7); margin-top: 7px; }

/* Timetable */
.th-tt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.th-table-wrap { overflow-x: auto; border: 1px solid var(--th-line); border-radius: 8px; background: var(--th-panel); }
.th-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.th-table th { font-family: var(--th-mono); font-size: 8px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--th-dim); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--th-line); white-space: nowrap; font-weight: 700; }
.th-table td { padding: 9px 12px; border-bottom: 1px solid var(--th-line); color: var(--th-text); white-space: nowrap; }
.th-table tr:last-child td { border-bottom: none; }
.th-table .tt-name { font-family: var(--th-mono); font-weight: 700; font-size: 11px; display: flex; align-items: center; gap: 6px; }
.th-table .tt-name svg { width: 12px; height: 12px; fill: currentColor; }
.th-table .tt-route { color: var(--th-muted); font-size: 10px; }
.th-table .tt-time { font-family: var(--th-mono); }

/* Footer */
.th-foot { padding: 12px 18px; font-family: var(--th-mono); font-size: 8px; color: var(--th-dim); text-transform: uppercase; letter-spacing: 0.12em; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Hero header (optional — enable in TransitHub → Settings) */
.th-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--th-line); }
.th-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.th-hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,24,32,.85), rgba(16,24,32,.78) 55%, #101820); }
.th-hero-scrim::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(38,52,69,.9) 1px, transparent 1px); background-size: 16px 16px; opacity: .35; }
.th-hero-inner { position: relative; padding: 56px 20px 40px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 720px) { .th-hero-inner { padding: 84px 28px 56px; } }
.th-hero-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--th-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.25em; color: var(--th-amber); margin-bottom: 22px; }
.th-hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--th-amber); animation: th-pulse 2s infinite; }
.th-hero-title { font-family: "Alfa Slab One", "Arial Nova", Arial, sans-serif; font-weight: 400; font-size: 34px; text-transform: uppercase; line-height: 1.08; letter-spacing: 0; color: var(--th-text); }
@media (min-width: 720px) { .th-hero-title { font-size: 58px; } }
@media (min-width: 1024px) { .th-hero-title { font-size: 68px; } }
.th-hero-line { display: block; overflow: hidden; padding-bottom: 3px; }
.th-hero-line-inner { display: block; transform: translateY(112%); animation: th-line-up .85s cubic-bezier(.16,1,.3,1) forwards; }
.th-hero-line-inner.amber { color: var(--th-amber); }
@keyframes th-line-up { to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .th-hero-line-inner { animation: none; transform: none; } }
.th-hero-tagline { max-width: 520px; margin: 20px 0 0; font-size: 14px; line-height: 1.6; color: var(--th-muted); }
.th-hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.th-hero-btn { font-family: var(--th-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; padding: 12px 22px; border-radius: 4px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.th-hero-btn.primary { background: var(--th-amber); color: #101820; border: 1px solid var(--th-amber); }
.th-hero-btn.primary:hover { filter: brightness(1.1); }
.th-hero-btn.ghost { background: transparent; color: var(--th-text); border: 1px solid #3A4A5E; }
.th-hero-btn.ghost:hover { border-color: rgba(241,196,0,.5); color: var(--th-amber); }
.th-hero-btn:focus-visible { outline: 2px solid var(--th-amber); outline-offset: 2px; }
.th-hero-marquee { position: relative; border-top: 1px solid var(--th-line); background: rgba(16,24,32,.7); padding: 10px 0; overflow: hidden; }
.th-hero-marquee-item { font-family: var(--th-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3em; color: var(--th-dim); display: flex; align-items: center; gap: 40px; white-space: nowrap; }
.th-hero-marquee-item::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: rgba(241,196,0,.6); }
.th-compact .th-hero { display: none; }
