:root {
  --bg: #080b0c;
  --bg-soft: #101617;
  --surface: #151d1f;
  --surface-strong: #1e2a2d;
  --surface-raised: #202b2e;
  --text: #f2f7f3;
  --muted: #a8b6ad;
  --line: #314044;
  --green: #2fbf71;
  --green-dark: #17975a;
  --yellow: #d79a2b;
  --red: #e05252;
  --cyan: #62c4d8;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

body.theme-light {
  --bg: #f5f7f2;
  --bg-soft: #edf3ef;
  --surface: #ffffff;
  --surface-strong: #e7eee9;
  --surface-raised: #f4f8f5;
  --text: #17211c;
  --muted: #5f6d64;
  --line: #d3ded7;
  --green: #188a54;
  --green-dark: #126b42;
  --yellow: #b97912;
  --red: #c94141;
  --cyan: #24748c;
  --shadow: 0 18px 40px rgba(23, 33, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 191, 113, 0.12), transparent 34rem),
    linear-gradient(180deg, #080b0c 0%, #101617 52%, #080b0c 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body.theme-light {
  background:
    radial-gradient(circle at top left, rgba(24, 138, 84, 0.14), transparent 34rem),
    linear-gradient(180deg, #f5f7f2 0%, #edf3ef 52%, #f5f7f2 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8, 11, 12, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

body.theme-light .site-header {
  background: rgba(245, 247, 242, 0.92);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
}

.brand,
.nav-actions,
.hero-actions,
.filter-control,
.official-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #06100b;
  font-size: 0.85rem;
}

.nav-actions {
  gap: 4px;
  overflow: visible;
}

.nav-actions a,
.nav-bridge-toggle,
.theme-toggle,
.language-toggle {
  flex: 0 0 auto;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-actions a:focus,
.nav-actions a:hover,
.nav-bridge-toggle:focus,
.nav-bridge-toggle:hover,
.nav-bridge-menu.is-open .nav-bridge-toggle,
.theme-toggle:focus,
.theme-toggle:hover,
.language-toggle:focus,
.language-toggle:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.nav-bridge-menu {
  position: relative;
}

.nav-bridge-toggle {
  cursor: pointer;
}

.nav-bridge-panel {
  position: absolute;
  z-index: 1100;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: min(330px, calc(100vw - 24px));
  max-height: min(70vh, 430px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 21, 23, 0.98);
  box-shadow: var(--shadow);
  padding: 8px;
}

body.theme-light .nav-bridge-panel {
  background: rgba(255, 255, 255, 0.98);
}

.theme-toggle,
.language-toggle {
  display: grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  cursor: pointer;
  font-size: 1.08rem;
  line-height: 1;
}

.language-toggle {
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.nav-bridge-menu.is-open .nav-bridge-panel {
  display: grid;
  gap: 6px;
}

.nav-bridge-option {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
}

.nav-bridge-option:focus,
.nav-bridge-option:hover,
.nav-bridge-option[aria-current="page"] {
  border-color: var(--cyan);
  background: var(--surface-strong);
}

.nav-bridge-option.is-closed {
  color: var(--muted);
  opacity: 0.74;
}

.nav-bridge-option.is-closed strong,
.nav-bridge-option.is-closed small {
  color: var(--muted);
}

.nav-bridge-option strong,
.nav-bridge-option small {
  display: block;
}

.nav-bridge-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 12px currentColor;
}

.status-light.low {
  background: var(--green);
  color: var(--green);
}

.status-light.medium {
  background: var(--yellow);
  color: var(--yellow);
}

.status-light.high {
  background: var(--red);
  color: var(--red);
}

.status-light.closed {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 14px rgba(224, 82, 82, 0.7);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.is-hidden {
  display: none;
}

/* Hero area uses the bridge ranking as the first visual decision point. */
.hero-section {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 120px);
  padding: 36px 0 24px;
  align-items: end;
}

.hero-copy {
  padding: 28px 0 8px;
}

.eyebrow,
.panel-label,
.status-label,
.promo-tag {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p,
li {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 780px;
  font-size: 2.8rem;
}

h2 {
  font-size: 1.7rem;
}

h3 {
  font-size: 1.12rem;
}

h4 {
  font-size: 1rem;
}

.hero-text,
.section-copy,
.bridge-summary {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-button,
.secondary-button,
.filter-button,
.bridge-link {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.bridge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.primary-button {
  background: var(--green);
  color: #06100b;
}

.primary-button:focus,
.primary-button:hover {
  background: #56d98d;
}

.secondary-button,
.bridge-link {
  background: var(--surface-raised);
  border-color: var(--line);
  color: var(--text);
}

.secondary-button:focus,
.secondary-button:hover,
.bridge-link:focus,
.bridge-link:hover {
  border-color: var(--cyan);
}

.fastest-panel,
.status-tile,
.bridge-card,
.alert-item,
.camera-card,
.report-form,
.bridge-detail-panel,
.live-card,
.promo-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 29, 31, 0.96);
  box-shadow: var(--shadow);
}

body.theme-light .fastest-panel,
body.theme-light .status-tile,
body.theme-light .bridge-card,
body.theme-light .alert-item,
body.theme-light .camera-card,
body.theme-light .report-form,
body.theme-light .bridge-detail-panel,
body.theme-light .live-card,
body.theme-light .promo-card,
body.theme-light .contact-card {
  background: rgba(255, 255, 255, 0.96);
}

.back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-weight: 800;
}

.back-link:focus,
.back-link:hover {
  border-color: var(--cyan);
}

.fastest-panel {
  padding: 22px;
}

.fastest-panel h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.fastest-panel p,
.fastest-panel small,
.status-tile strong,
.bridge-meta,
.alert-item p,
.camera-card p,
.form-message,
.live-card p,
.promo-card p,
.contact-card p,
.bridge-detail-top p,
.feed-list {
  margin: 0;
  color: var(--muted);
}

.queue-summary {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.prediction-summary {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.prediction-summary span,
.prediction-summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.prediction-summary strong {
  font-size: 1.35rem;
}

.queue-summary span,
.refresh-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.queue-summary strong {
  font-size: 1.45rem;
}

.distance-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.distance-toggle span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.distance-toggle button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.distance-toggle button.is-active {
  background: var(--green);
  color: #06100b;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-tile {
  min-height: 92px;
  padding: 16px;
}

.status-tile strong {
  display: block;
  color: var(--text);
  font-size: 1.2rem;
}

/* Sections share spacing so new data modules can be added cleanly. */
.content-section {
  padding: 52px 0 0;
  scroll-margin-top: 86px;
}

.bridge-page-hero {
  display: grid;
  gap: 18px;
  padding: 40px 0 10px;
  align-items: end;
}

.bridge-page-stats {
  margin-top: 18px;
}

.section-heading,
.split-section,
.promo-section,
.contact-section {
  display: grid;
  gap: 18px;
}

.filter-control {
  width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-button {
  flex: 1;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
}

.filter-button.is-active {
  background: var(--green);
  color: #06100b;
}

.bridge-list,
.bridge-detail-list,
.traffic-map,
.alert-list,
.camera-grid,
.promo-grid {
  display: grid;
  gap: 12px;
}

.bridge-list {
  margin-top: 18px;
}

.bridge-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.bridge-card-header,
.bridge-detail-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bridge-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-box {
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.detail-box span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.wait-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #06100b;
  font-weight: 800;
  white-space: nowrap;
}

.wait-badge.low,
.condition-dot.low {
  background: var(--green);
}

.wait-badge.medium,
.condition-dot.medium {
  background: var(--yellow);
}

.wait-badge.high,
.condition-dot.high {
  background: var(--red);
  color: #ffffff;
}

.route-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) 1fr minmax(72px, auto);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.route-name,
.route-speed {
  font-weight: 800;
}

.route-speed {
  color: var(--muted);
  text-align: right;
}

.route-bar {
  height: 16px;
  border-radius: 999px;
  background: #0a0f10;
  overflow: hidden;
}

body.theme-light .route-bar {
  background: #d9e4de;
}

.route-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bridge-detail-list {
  margin-top: 18px;
}

.bridge-detail-panel {
  padding: 18px;
  scroll-margin-top: 90px;
}

.bridge-detail-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.live-card,
.alert-item,
.camera-card,
.promo-card,
.contact-card {
  padding: 16px;
}

.live-card h4,
.alert-item h3,
.camera-card h3,
.promo-card h3 {
  margin-bottom: 8px;
}

.live-card h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.camera-window {
  display: grid;
  min-height: 150px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(98, 196, 216, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(98, 196, 216, 0.16) 1px, transparent 1px),
    #0b1112;
  background-size: 28px 28px;
  color: var(--cyan);
  font-weight: 800;
}

.map-card {
  grid-column: 1 / -1;
}

.map-frame {
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.leaflet-map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.leaflet-traffic-map {
  min-height: 260px;
}

.leaflet-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.leaflet-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
}

.map-disclaimer {
  margin-top: 10px;
  font-size: 0.9rem;
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
}

.map-link {
  justify-self: start;
  margin-top: 12px;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

body.theme-light .camera-window {
  background:
    linear-gradient(90deg, rgba(36, 116, 140, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(36, 116, 140, 0.14) 1px, transparent 1px),
    #eef5f1;
}

.bridge-heat-map {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.heat-map-stage {
  display: grid;
  gap: 14px;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(98, 196, 216, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(98, 196, 216, 0.1) 1px, transparent 1px),
    #0b1112;
  background-size: 28px 28px;
  padding: 42px 18px;
}

body.theme-light .heat-map-stage {
  background:
    linear-gradient(90deg, rgba(36, 116, 140, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(36, 116, 140, 0.12) 1px, transparent 1px),
    #eef5f1;
}

.heat-map-road {
  display: grid;
  gap: 12px;
}

.heat-direction {
  display: grid;
  gap: 10px;
}

.heat-direction h3 {
  color: var(--text);
  font-size: 1rem;
}

.heat-map-lane {
  position: relative;
  display: grid;
  min-height: 48px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

body.theme-light .heat-map-lane {
  background: rgba(255, 255, 255, 0.72);
}

.heat-map-lane::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--heat-width);
  opacity: 0.82;
}

.heat-map-lane.low::before {
  background: linear-gradient(90deg, rgba(47, 191, 113, 0.86), rgba(47, 191, 113, 0.08));
}

.heat-map-lane.medium::before {
  background: linear-gradient(90deg, rgba(215, 154, 43, 0.9), rgba(215, 154, 43, 0.08));
}

.heat-map-lane.high::before {
  background: linear-gradient(90deg, rgba(224, 82, 82, 0.9), rgba(224, 82, 82, 0.08));
}

.heat-map-lane span,
.heat-map-lane strong {
  position: relative;
  z-index: 1;
}

.heat-map-lane span {
  font-weight: 800;
}

.heat-map-lane strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.heat-map-lane em {
  font-style: normal;
}

.hours-card,
.toll-card {
  grid-column: 1 / -1;
}

.hours-grid {
  display: grid;
  gap: 10px;
}

.hours-row,
.toll-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.hours-icon,
.toll-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 900;
}

.hours-icon {
  font-size: 1.08rem;
}

.hours-row.open .hours-icon {
  background: var(--green);
  color: #06100b;
}

.hours-row.soon .hours-icon,
.hours-row.opening .hours-icon {
  background: var(--yellow);
  color: #06100b;
}

.hours-row.closed .hours-icon {
  position: relative;
  border: 2px solid rgba(224, 82, 82, 0.82);
  border-radius: 999px;
  background: rgba(224, 82, 82, 0.08);
  color: var(--red);
  font-size: 1.16rem;
  line-height: 1;
}

.hours-row strong,
.hours-row span,
.hours-row small,
.toll-row strong,
.toll-row span,
.toll-row small {
  display: block;
}

.hours-row > div > span,
.hours-row > div > small,
.toll-row > div > span,
.toll-row > div > small {
  color: var(--muted);
}

.hours-row small span {
  display: inline;
}

.notice-card {
  border-color: rgba(215, 154, 43, 0.62);
}

.toll-grid {
  display: grid;
  gap: 10px;
}

.toll-icon {
  background: var(--surface-strong);
  color: var(--cyan);
}

.toll-icon.inbound {
  transform: rotate(-90deg);
}

.toll-icon.outbound {
  transform: rotate(90deg);
}

.hours-row .hours-icon,
.toll-row .toll-icon {
  display: grid;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.heat-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.heat-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.heat-map-legend .status-light {
  display: inline-block;
}

.official-links {
  flex-wrap: wrap;
  gap: 8px;
}

.official-links a,
.official-links span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 800;
}

.official-links a:focus,
.official-links a:hover {
  border-color: var(--cyan);
}

.official-links span {
  color: var(--muted);
}

.feed-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.report-section {
  display: grid;
  gap: 18px;
  padding-bottom: 0;
}

.report-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.report-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.report-form select,
.report-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0b1112;
  color: var(--text);
}

body.theme-light .report-form select,
body.theme-light .report-form textarea {
  background: #ffffff;
}

.report-form textarea {
  resize: vertical;
}

.promo-card {
  min-height: 150px;
}

.contact-card {
  display: grid;
  gap: 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  max-width: 760px;
}

@media (max-width: 520px) {
  .top-bar {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 24px, 1120px);
    padding: 10px 0;
  }

  main {
    width: min(100% - 24px, 1120px);
  }

  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-actions a,
  .nav-bridge-toggle,
  .theme-toggle,
  .language-toggle {
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  .nav-bridge-panel {
    left: 0;
    right: auto;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .bridge-card-header,
  .bridge-detail-top,
  .bridge-details {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wait-badge {
    justify-self: start;
  }

  .route-row {
    grid-template-columns: 1fr;
  }

  .route-speed {
    text-align: left;
  }
}

@media (min-width: 760px) {
  .hero-section {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    padding-top: 58px;
  }

  .bridge-page-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  }

  h1 {
    font-size: 4.4rem;
  }

  h2 {
    font-size: 2.15rem;
  }

  .fastest-panel h2 {
    font-size: 2.8rem;
  }

  .section-heading,
  .split-section,
  .promo-section,
  .report-section,
  .contact-section {
    grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
    align-items: start;
  }

  .filter-control {
    justify-self: end;
    max-width: 320px;
  }

  .bridge-list,
  .camera-grid,
  .promo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bridge-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1020px) {
  h1 {
    font-size: 5.2rem;
  }

  .bridge-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
