@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-var.woff') format('woff');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
:root {
  --bg: #efeae1;
  --glass: rgb(251 249 245 / 90%);
  --line: rgb(43 39 34 / 12%);
  --ink: #2b2722;
  --ink-2: #6f665a;
  --teal: #146c80;
  --route: #d2492a;
  --amber: #c98a3c;
  --r: 12px;
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.c3-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.c3-map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--line); box-shadow: 0 6px 20px -10px rgb(0 0 0 / 30%) !important; }

/* Loading */
.c3-loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(ellipse at center, #f8f5ef, var(--bg) 70%); z-index: 20; transition: opacity .8s ease, visibility .8s; color: var(--ink-2); }
.c3-loading.is-done { opacity: 0; visibility: hidden; }
.c3-loading__ring { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--route); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Panel */
.c3-panel {
  position: fixed; z-index: 10; top: 16px; left: 16px; bottom: 16px; width: 360px;
  display: flex; flex-direction: column; padding: 18px 18px 16px;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -24px rgb(60 45 25 / 35%);
  overflow: hidden; animation: rise .8s .2s both cubic-bezier(.2,.7,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.c3-body { overflow-y: auto; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.c3-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.c3-logo img { height: 30px; width: auto; display: block; }
.c3-pill { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; color: var(--teal); padding: 4px 10px; border: 1px solid rgb(20 108 128 / 30%); border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; }
.c3-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgb(20 108 128 / 50%); } 70%, 100% { box-shadow: 0 0 0 7px rgb(20 108 128 / 0%); } }
h1 { font-size: 30px; line-height: 1.05; margin: 0 0 6px; font-stretch: 82%; font-weight: 650; letter-spacing: -.01em; }
.c3-question { margin: 0 0 14px; color: var(--ink-2); }
.c3-h { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 18px 0 8px; }
.c3-sheet { display: none; }

/* Route card */
.c3-route { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.c3-badge { grid-row: span 2; min-width: 52px; height: 40px; padding: 0 8px; border-radius: 10px; display: grid; place-content: center; background: var(--route); color: #fff; font-weight: 700; font-size: 18px; font-stretch: 85%; }
.c3-route__name { font-weight: 600; line-height: 1.25; }
.c3-route__meta { color: var(--ink-2); font-size: 13px; }
.c3-play { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; transition: background .2s; }
.c3-play:hover { background: #000; }
.c3-play svg { width: 16px; height: 16px; fill: currentColor; }
.c3-play[aria-pressed="true"] { background: var(--route); }

/* Stops */
.c3-stops { list-style: none; margin: 0; padding: 0; position: relative; }
.c3-stops::before { content: ''; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--route); opacity: .85; }
.c3-stop { position: relative; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 7px 8px 7px 0; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 10px; transition: background .15s; }
.c3-stop:hover, .c3-stop.is-hot { background: rgb(210 73 42 / 8%); }
.c3-stop.is-hot .c3-num { transform: scale(1.12); box-shadow: 0 0 0 4px rgb(210 73 42 / 22%); }
.c3-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; background: var(--route); color: #fff; font-weight: 700; font-size: 13px; border: 2px solid #fff; position: relative; z-index: 1; transition: transform .15s, box-shadow .15s; }
.c3-stop__name { font-weight: 600; line-height: 1.2; }
.c3-stop__en { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.c3-stop__m { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Toggles */
.c3-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.c3-toggle { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 14px; }
.c3-toggle i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); opacity: .35; transition: opacity .2s; }
.c3-toggle[aria-pressed="true"] i { opacity: 1; }
.c3-toggle[aria-pressed="false"] { color: var(--ink-2); }

.c3-about { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.c3-about summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.c3-about p { margin: 8px 0; }
.c3-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.c3-stack span { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgb(20 108 128 / 8%); color: var(--teal); }
.c3-cta { display: block; margin-top: 14px; padding: 12px; border-radius: 10px; text-align: center; text-decoration: none; font-weight: 650; background: var(--teal); color: #fff; }
.c3-cta:hover { background: #0f5868; }

/* Map tools */
.c3-tools { position: fixed; z-index: 9; top: 16px; right: 16px; display: flex; gap: 6px; }
.c3-tools button { height: 38px; min-width: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px -12px rgb(0 0 0 / 35%); }
.c3-tools button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c3-tools button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.maplibregl-ctrl-top-right { top: 58px; }

/* Markers: style inner elements only, never the marker root (MapLibre positions it with transform) */
.maplibregl-marker.c3-pin { cursor: pointer; z-index: 3; }
.c3-labels-z1 .c3-label--t2, .c3-labels-z2 .c3-label--t3 { display: none; }
.maplibregl-popup { z-index: 6; }
.c3-pin__in { display: flex; flex-direction: column; align-items: center; transition: transform .18s; transform-origin: bottom center; }
.c3-pin__head { width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; background: var(--route); color: #fff; font-weight: 700; font-size: 13px; border: 2px solid #fff; box-shadow: 0 4px 12px -4px rgb(0 0 0 / 45%); }
.c3-pin__stem { width: 2px; height: 26px; background: var(--ink); }
.c3-pin__foot { width: 8px; height: 4px; border-radius: 50%; background: var(--ink); }
.c3-pin.is-hot .c3-pin__in { transform: scale(1.22); }
.c3-pin.is-hot .c3-pin__head { box-shadow: 0 0 0 5px rgb(210 73 42 / 28%), 0 4px 12px -4px rgb(0 0 0 / 45%); }

.c3-label { pointer-events: auto; cursor: pointer; }
.c3-label__in { display: flex; flex-direction: column; align-items: center; }
.c3-label__txt { padding: 3px 8px; border-radius: 6px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 3px 10px -4px rgb(0 0 0 / 35%); }
.c3-label__stem { width: 1px; height: 22px; background: rgb(43 39 34 / 55%); }
.c3-label--park .c3-label__txt { background: none; box-shadow: none; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; color: #4e6640; text-shadow: 0 0 3px #fff, 0 0 6px #fff; font-size: 13.5px; }
.c3-label--park .c3-label__stem { display: none; }
.c3-hide-labels .c3-label { display: none; }

.c3-bus { width: 44px; height: 26px; border-radius: 8px; display: grid; place-content: center; background: var(--route); color: #fff; font-weight: 700; font-size: 12.5px; border: 2px solid #fff; box-shadow: 0 6px 16px -6px rgb(0 0 0 / 55%); }

/* Popups */
.maplibregl-popup-content { padding: 14px 16px 12px; border-radius: 12px; box-shadow: 0 16px 40px -16px rgb(0 0 0 / 40%); font: 14px/1.4 var(--font); color: var(--ink); max-width: 290px; }
.maplibregl-popup-close-button { font-size: 20px; width: 28px; height: 28px; color: var(--ink-2); }
.c3-pop__k { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 2px; }
.c3-pop h3 { margin: 0 24px 2px 0; font-size: 17px; line-height: 1.2; }
.c3-pop__sub { margin: 0 0 8px; color: var(--ink-2); font-size: 13px; }
.c3-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 8px 0 0; font-size: 13px; }
.c3-pop dt { color: var(--ink-2); }
.c3-pop dd { margin: 0; font-weight: 550; }
.c3-pop__note { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.c3-pop ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.c3-pop li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px dashed var(--line); }
.c3-pop li span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.c3-noscript { position: fixed; inset: 0; display: grid; place-content: center; }

@media (max-width: 760px) {
  .c3-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 36vh; border-radius: 18px 18px 0 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); transition: max-height .35s cubic-bezier(.2,.7,.2,1); }
  .c3-panel.is-open { max-height: 86vh; }
  .c3-brand { margin-bottom: 8px; }
  .c3-logo img { height: 24px; }
  h1 { font-size: 24px; }
  .c3-question { font-size: 14px; margin-bottom: 10px; }
  .c3-sheet { display: block; width: 100%; padding: 10px; margin-bottom: 8px; border-radius: 10px; border: 1px solid rgb(20 108 128 / 35%); background: rgb(20 108 128 / 8%); font-weight: 600; cursor: pointer; }
  .c3-tools { top: 12px; right: 12px; }
  .c3-tools .c3-tlabel { display: none; }
  .maplibregl-ctrl-top-right { top: 52px; }
  .c3-label__txt { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
