:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, sans-serif;
  color: #192f28;
  background: #eef1e9;
  --ink: #192f28;
  --muted: #4f6459;
  --line: #ccd6cc;
  --green: #1a664e;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #c17c2a; outline-offset: 2px; }
.top {
  min-height: 70px;
  padding: 12px max(24px, calc((100% - 1400px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f9faf6;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #14503d; color: #eaf7ed; }
.languages { display: flex; gap: 3px; }
.languages a { padding: 7px 9px; text-decoration: none; font-size: .86rem; font-weight: 650; border-radius: 7px; }
.languages a[aria-current] { background: #d7e7dc; }
main { width: min(100% - 48px, 1400px); margin: 0 auto; }
.intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: end; padding: clamp(20px, 3.5vw, 54px) 0 22px; }
.intro a { color: var(--green); font-weight: 650; text-underline-offset: 3px; }
.intro p { color: var(--muted); max-width: 43ch; margin: 0 0 3px; line-height: 1.55; }
h1 { margin: 9px 0 0; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.02; letter-spacing: -.049em; text-wrap: balance; }
h2 { margin: 0; font-size: 1.16rem; }
.route-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.route-nav a, .places a { text-decoration: none; font-weight: 650; }
.route-nav a { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #f9faf6; }
.route-nav a[aria-current], .places a[aria-current] { background: #15533f; color: white; border-color: #15533f; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 265px); gap: 14px; }
.map-card, aside { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: #f9faf6; }
.map-header { min-height: 76px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-header p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.modes { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.modes button { border: 0; background: transparent; min-height: 37px; padding: 5px 13px; color: var(--ink); font-weight: 730; }
.modes button[aria-pressed="true"] { background: #d7e7dc; }
.stage { isolation: isolate; position: relative; height: max(420px, min(60vh, 650px)); background: #172e29; overflow: hidden; }
.stage canvas, #sceneCanvas, .markers { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage canvas { touch-action: none; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
#sceneCanvas canvas { outline-offset: -6px; }
.controls { position: absolute; z-index: 2; top: 12px; left: 12px; display: flex; gap: 6px; }
.controls button { min-width: 40px; min-height: 39px; background: #f6faf4; color: var(--ink); border: 1px solid #cedbd0; border-radius: 7px; font-weight: 700; padding: 5px 11px; }
.controls button:hover, .modes button:hover { background: #e4ede1; }
.markers { pointer-events: none; z-index: 1; }
.marker { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: .78rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 8px; border: 1px solid #93aa9a; border-radius: 6px; background: #f8fbf6; color: #1a3329; box-shadow: 0 2px 4px #0d282655; }
.marker.reference { border-style: dashed; background: #fff2d8; }
#message { position: absolute; z-index: 3; left: 12px; bottom: 32px; pointer-events: none; background: #172e29ec; color: white; border-radius: 6px; max-width: calc(100% - 24px); padding: 7px 10px; font-size: .83rem; }
#message:empty { display: none; }
.attribution { position: absolute; z-index: 2; right: 7px; bottom: 6px; background: #102a26e5; color: #f1f7e9; padding: 3px 6px; border-radius: 4px; font-size: .7rem; }
.legend { display: flex; gap: 9px 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); padding: 11px 16px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 16px; height: 4px; border-radius: 3px; }
aside { padding: 16px; align-self: start; }
.places { display: grid; gap: 5px; margin: 12px 0 15px; }
.places a { display: block; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; font-size: .91rem; }
.places a:hover:not([aria-current]) { background: #e4ede1; }
.notes { color: var(--muted); font-size: .87rem; line-height: 1.5; border-top: 1px solid var(--line); padding-top: 12px; }
.notes p { margin: 0 0 8px; }
.notes p:last-child { margin-bottom: 0; }
footer { padding: 10px 0 30px; color: var(--muted); font-size: .83rem; line-height: 1.45; }
footer p { margin: 7px 0; }
@media (max-width: 820px) {
  main { width: calc(100% - 28px); }
  .top { padding-inline: 14px; }
  .intro, .layout { grid-template-columns: 1fr; }
  .intro { gap: 11px; padding-bottom: 15px; }
  .intro h1 { max-width: 17ch; }
  .stage { height: max(380px, 52svh); }
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .languages a { padding-inline: 7px; }
  .route-nav a { padding: 8px 10px; font-size: .86rem; }
  .stage { height: 390px; }
}
