:root {
  --paper: #FFFFFF;
  --panel: #F2F3EF;
  --grey: #D6D8D2;
  --ink: #000000;
  --ink-2: #55585E;
  --red: #E0301E;
  --blue: #1F3FBF;
  --blue-dark: #142C8C;
  --yellow: #F2B705;
  --font: 'Jost', 'Futura', 'Century Gothic', 'Segoe UI', Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
h1, h2, h3 { font-weight: 600; line-height: 1; margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 500 15px/1 var(--font); padding: .8em 1.15em; border-radius: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.small { font-size: 14px; padding: .55em .85em; }
.btn.big { font-size: 18px; padding: .95em 1.4em; }
.btn[disabled] { opacity: .45; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.linkbtn:hover { color: var(--blue); }
.langbtn { font: 600 13px/1 var(--font); border: 2px solid var(--ink); background: var(--paper); color: var(--ink); width: 38px; height: 34px; cursor: pointer; letter-spacing: .02em; }
.langbtn:hover { background: var(--ink); color: var(--paper); }

/* Logo: a three-stop line, like a transit diagram */
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1 var(--font); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { flex: none; }

/* Map chrome */
.leaflet-container { background: #EEF0EC; font-family: var(--font); }
.leaflet-tile-pane { filter: grayscale(1) contrast(1.08) brightness(1.02); }
.leaflet-tooltip.mk-label {
  background: none; border: 0; box-shadow: none; padding: 0; color: var(--ink);
  font: 500 14px/1 var(--font); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff, 0 0 8px #fff;
}
.leaflet-tooltip.mk-label::before { display: none; }
.mk-arrow, .mk-pulse, .mk-target { background: none; border: 0; }
.mk-pulse i { display: block; width: 44px; height: 44px; border: 3px solid; border-radius: 50%; animation: mkpulse 1.1s ease-out 2; opacity: 0; }
@keyframes mkpulse { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
.mk-target i { display: block; width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 50%; background: radial-gradient(circle, var(--yellow) 0 5px, transparent 6px); }
.mk-picking, .mk-picking .leaflet-interactive { cursor: crosshair !important; }
.leaflet-popup-content-wrapper { border-radius: 0; border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.18); }
.leaflet-popup-tip { border: 2px solid var(--ink); }
.leaflet-popup-content { margin: 14px 16px; }
.mk-pop h4 { font: 600 19px/1.1 var(--font); margin: 0 0 8px; }
.mk-pop ul { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.4; }
.mk-pop li + li { margin-top: 6px; }
.mk-pop span { color: var(--ink-2); }
.leaflet-bar { border: 2px solid var(--ink) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-bar a { border-radius: 0 !important; color: var(--ink); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.85) !important; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; font-weight: 500; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; flex: none; }
.legend small { color: var(--ink-2); font-weight: 400; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 11px 16px; font-size: 15px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 3000;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
