/* Experiment 08: the Petersburg metro in 3D with real station depths. */
.metro-page{background:var(--paper)}
.mt-main{padding:0 var(--page-gutter,clamp(20px,5.5vw,88px)) 72px}
.mt{container:metro/inline-size;--mt-ink:#151515;--mt-paper:#f6f5f1;--mt-line:#d6d4cd;--mt-muted:#64635d;--mt-mono:'IBM Plex Mono',monospace;--mt-edge:#c9c6bd;--mt-lift:0 1px 2px rgba(21,21,21,.08);position:relative;height:min(86vh,940px);min-height:640px;overflow:hidden;isolation:isolate;border:1px solid var(--mt-ink);background:linear-gradient(180deg,#fbfaf7 0%,#eceae3 58%,#dcd9d0 100%);color:var(--mt-ink);font-variant-numeric:tabular-nums;user-select:none;-webkit-user-select:none}
.mt ::selection{background:var(--mt-ink);color:var(--mt-paper)}
.mt-canvas{position:absolute;inset:0;display:block;width:100%;height:100%;outline:0;touch-action:none}
.mt-canvas:focus-visible{box-shadow:inset 0 0 0 2px var(--mt-ink)}
.mt-canvas.is-panning{cursor:grabbing!important}
.mt-labels{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none}

/* Labels projected from 3D */
.mt-label{position:absolute;left:0;top:0;display:flex;align-items:baseline;gap:6px;margin:-11px 0 0 9px;padding:3px 8px 3px 6px;border-radius:6px;background:rgba(246,245,241,.92);font:500 12px/1.25 var(--sans);white-space:nowrap;opacity:0;transition:opacity .18s}
.mt-label::before{content:"";align-self:center;width:8px;height:8px;flex:none;border-radius:50%;background:var(--line)}
.mt-label b{font-weight:600}
.mt-label i{font:500 11px/1 var(--mt-mono);font-style:normal;color:var(--mt-muted)}
.mt-label.is-shown{opacity:1}
.mt-label.is-dim.is-shown{opacity:.4}
.mt-label.is-active{z-index:2;background:#fff;box-shadow:0 1px 3px rgba(21,21,21,.2)}
.mt-label.is-closed b{color:var(--mt-muted);text-decoration:line-through;text-decoration-thickness:1px}
.mt-label em{align-self:center;padding:2px 6px;border-radius:999px;background:var(--mt-ink);color:var(--mt-paper);font:600 11px/1.2 var(--sans);font-style:normal}
.mt-ruler{position:absolute;left:0;top:0;margin:-7px 0 0 8px;padding:1px 4px;background:rgba(246,245,241,.85);font:500 11px/1.2 var(--mt-mono);color:#3f3e39;white-space:nowrap;opacity:0;transition:opacity .18s}
.mt-water{position:absolute;left:0;top:0;display:flex;align-items:baseline;gap:6px;margin:-9px 0 0 6px;font:italic 500 12px/1.2 var(--sans);color:#285f8c;white-space:nowrap;text-shadow:0 0 3px #f6f5f1,0 0 3px #f6f5f1,0 0 3px #f6f5f1;opacity:0;transition:opacity .18s}
.mt-water b{font-weight:600}
.mt-water i{font:500 11px/1 var(--mt-mono);font-style:normal;color:#3d6f97}
.mt-water--deep{font-size:12px}
.mt.is-night .mt-water{color:#a9cdf0;text-shadow:0 0 3px #0c111b,0 0 3px #0c111b,0 0 3px #0c111b}
.mt.is-night .mt-water i{color:#8fb6dc}
.mt-escalator{position:absolute;left:0;top:0;margin:-9px 0 0 8px;padding:2px 7px;border-radius:999px;background:#3d3a33;color:#f6f5f1;font:500 12px/1.3 var(--sans);white-space:nowrap;opacity:0;transition:opacity .18s}
.mt-ruler.is-shown,.mt-water.is-shown,.mt-escalator.is-shown{opacity:1}
.mt.is-night .mt-label{background:rgba(17,22,33,.88);color:#eef0f4}
.mt.is-night .mt-label i{color:#a3abbb}
.mt.is-night .mt-label em{background:#eef0f4;color:#111621}
.mt.is-night .mt-label.is-active{background:#252d40;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.mt.is-night .mt-label.is-closed b{color:#8d94a3}
.mt.is-night .mt-ruler{background:rgba(17,22,33,.85);color:#d6dae3}

/* Panel */
/* --mt-cover: how far the site header, fixed at the top of the window, reaches over the map. */
.mt-panel{position:absolute;z-index:3;top:calc(16px + var(--mt-cover,0px));left:16px;bottom:16px;display:flex;flex-direction:column;width:min(370px,calc(100% - 32px));border:1px solid var(--mt-edge);border-radius:14px;background:rgba(246,245,241,.96);box-shadow:var(--mt-lift);user-select:text;-webkit-user-select:text}
.mt-panel-head{position:relative;flex:none;padding:20px 64px 14px 20px}
.mt-collapse{position:absolute;top:14px;right:14px;display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid var(--mt-line);border-radius:50%;background:#fff;color:var(--mt-ink);cursor:pointer;transition:background-color .2s}
.mt-collapse:hover{background:#efede6}
.mt-collapse:focus-visible{outline:2px solid var(--mt-ink);outline-offset:2px}
.mt-collapse svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .25s}
.mt.is-collapsed .mt-collapse svg{transform:rotate(180deg)}
.mt-summary{max-width:100%;margin:10px 0 0;padding:0;border:0;background:none;color:var(--mt-ink);font:500 14px/1.35 var(--sans);text-align:left;cursor:pointer}
.mt-summary[hidden],.mt-panel-body[hidden]{display:none}
.mt-summary:hover{text-decoration:underline;text-underline-offset:4px}
.mt-panel-body{display:flex;flex:1;min-height:0;flex-direction:column}
.mt-summary{display:none}
.mt.is-collapsed .mt-summary:not([hidden]){display:block}
.mt.is-collapsed .mt-panel{bottom:auto;width:min(340px,calc(100% - 32px))}
.mt.is-collapsed .mt-panel-body{display:none}
.mt.is-collapsed .mt-panel-head{padding-bottom:16px}
.mt-panel h1{margin:0;font:600 26px/1.08 var(--sans)}
.mt-sheet-toggle{display:none}
.mt-tabs{display:flex;flex:none;justify-content:space-between;gap:0;margin:0 16px;padding:4px;border-radius:999px;background:#e7e5de;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#bdbab1 transparent}
.mt-tabs button{flex:1 0 auto;min-height:44px;padding:0 8px;border:0;border-radius:999px;background:transparent;color:var(--mt-ink);font:600 13px/1.2 var(--sans);cursor:pointer}
.mt-tabs button[aria-selected=true]{background:var(--mt-ink);color:var(--mt-paper)}
.mt-tabs button:focus-visible{outline:2px solid var(--mt-ink);outline-offset:-2px}
.mt-tabs button[aria-selected=true]:focus-visible{outline-color:var(--mt-paper);outline-offset:-4px}
.mt-tabpanel{flex:1;min-height:0;min-width:0;overflow:auto;padding:16px 20px 20px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bdbab1 transparent;scroll-padding-block:12px;overflow-wrap:anywhere}
.mt-tabpanel[hidden]{display:none}

/* Fields and suggestions */
.mt-field{position:relative;display:flex;flex-direction:column;gap:6px}
.mt-field label,.mt-game legend{font:600 13px/1.3 var(--sans);color:#3c3b37}
.mt-field input{width:100%;min-width:0;min-height:44px;padding:0 14px;border:1px solid #bdbab1;border-radius:10px;background:#fff;color:var(--mt-ink);font:500 16px/1.25 var(--sans)}
.mt-field input::placeholder{color:var(--mt-muted);opacity:1}
.mt-field input:focus{outline:2px solid var(--mt-ink);outline-offset:1px}
.mt-suggest{position:relative;max-height:240px;overflow:auto;overscroll-behavior:contain;margin:0;padding:4px;list-style:none;border:1px solid var(--mt-edge);border-radius:10px;background:#fff;scrollbar-width:thin;scrollbar-color:#bdbab1 transparent}
.mt-search-status{margin:0;color:var(--mt-muted);font-size:14px;line-height:1.4}
.mt-search-status:empty{display:none}
.mt-suggest[hidden]{display:none}
.mt-suggest li{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 10px;border-radius:6px;cursor:pointer;font-size:14px}
.mt-suggest li::before{content:"";width:10px;height:10px;flex:none;border-radius:50%;background:var(--line)}
.mt-suggest li span{flex:1;min-width:0}
.mt-suggest li small{font:500 12px/1 var(--mt-mono);color:var(--mt-muted);white-space:nowrap}
.mt-suggest li:hover,.mt-suggest li[aria-selected=true]{background:#f0eee8}

/* Station card */
/* Hints and footnotes share one small caption size. */
.mt-hint{margin:16px 0 0;font-size:12px;line-height:1.5;color:var(--mt-muted)}
.mt-subtitle{margin:24px 0 6px;font:600 15px/1.3 var(--sans);color:var(--mt-ink)}
/* Station tab: every line as a disclosure, its stations as stops on the line. */
.mt-line-group{border-bottom:1px solid var(--mt-line)}
.mt-line-group:first-of-type{margin-top:14px;border-top:1px solid var(--mt-line)}
.mt-line-head{display:grid;grid-template-columns:22px minmax(0,1fr) 14px;align-items:center;column-gap:10px;row-gap:2px;min-height:52px;padding:8px 0;list-style:none;cursor:pointer}
.mt-line-head::-webkit-details-marker{display:none}
.mt-line-head b{grid-row:span 2;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--line);color:#fff;font:600 12px/1 var(--sans)}
.mt-line-head span{min-width:0;font:600 15px/1.3 var(--sans);overflow-wrap:anywhere}
.mt-line-head small{grid-column:2;font-size:12px;line-height:1.3;color:var(--mt-muted)}
.mt-line-head::after{content:"";grid-column:3;grid-row:1/span 2;width:8px;height:8px;margin:-4px auto 0;border-right:1.75px solid currentColor;border-bottom:1.75px solid currentColor;transform:rotate(45deg);transition:transform .2s}
.mt-line-group[open] .mt-line-head::after{margin-top:4px;transform:rotate(-135deg)}
.mt-line-head:hover span{text-decoration:underline;text-underline-offset:4px}
.mt-line-head:focus-visible{outline:2px solid var(--mt-ink);outline-offset:2px;border-radius:8px}
.mt-stop-list{margin:0 0 10px;padding:0;list-style:none}
.mt-stop-list li{position:relative}
/* The line through the stops: a thin band of the line's colour from the first stop to the last. */
.mt-stop-list li::before{content:"";position:absolute;left:10px;top:0;bottom:0;width:2px;background:var(--line)}
.mt-stop-list li:first-child::before{top:50%}
.mt-stop-list li:last-child::before{bottom:50%}
.mt-stop{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:4px 0 4px 32px;border:0;background:transparent;color:var(--mt-ink);font:500 14px/1.3 var(--sans);text-align:left;cursor:pointer}
.mt-stop::before{content:"";position:absolute;left:5px;top:50%;width:12px;height:12px;margin-top:-6px;box-sizing:border-box;border:2.5px solid var(--line);border-radius:50%;background:var(--mt-paper)}
.mt-stop-name{flex:1;min-width:0}
.mt-stop:hover .mt-stop-name{text-decoration:underline;text-underline-offset:4px}
.mt-stop:focus-visible{outline:2px solid var(--mt-ink);outline-offset:-2px;border-radius:8px}
.mt-stop-depth{flex:none;font:600 13px/1 var(--mt-mono);white-space:nowrap}
.mt-tag{flex:none;padding:4px 8px;border-radius:999px;background:var(--mt-ink);color:var(--mt-paper);font:600 12px/1 var(--sans);font-style:normal;white-space:nowrap}
.mt-tag--muted{background:#e2e0d9;color:var(--mt-muted)}
.mt-stop-list .is-closed .mt-stop-name{color:var(--mt-muted)}
.mt-stop-list .is-closed .mt-stop::before{border-style:dashed}
.mt-chip{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 4px 0 0;border:0;background:transparent;color:var(--mt-ink);font:500 14px/1.2 var(--sans);text-align:left;cursor:pointer}
.mt-chip::before{content:"";width:10px;height:10px;flex:none;border-radius:50%;background:var(--line)}
.mt-chip:hover{text-decoration:underline;text-underline-offset:4px}
.mt-card{margin-top:16px}
.mt-card-back{gap:8px;max-width:100%;margin-bottom:16px}
.mt-card-back svg{flex:none}
.mt-card h2{margin:0;font:600 28px/1.1 var(--sans)}
.mt-card-line{display:flex;align-items:center;gap:8px;margin:8px 0 0;font:500 14px/1.35 var(--sans);color:#3c3b37}
.mt-card-line b,.mt-leg-badge{display:grid;place-items:center;width:22px;height:22px;flex:none;border-radius:50%;background:var(--line);color:#fff;font:600 12px/1 var(--sans);font-style:normal}
.mt-card-depth{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:14px 0 8px}
.mt-card-depth strong{font:600 44px/1 var(--sans)}
.mt-card-depth span{font-size:14px;color:#3c3b37}
.mt-depthbar{height:6px;border-radius:999px;background:#e2e0d9;overflow:hidden}
.mt-card-section{margin-top:14px}
.mt-depthbar i{display:block;height:100%;border-radius:inherit;background:var(--line)}
.mt-facts{margin:16px 0 0}
.mt-facts div{display:grid;grid-template-columns:118px minmax(0,1fr);gap:12px;padding:9px 0;border-top:1px solid var(--mt-line)}
.mt-facts dt{font:500 13px/1.45 var(--sans);color:var(--mt-muted)}
.mt-facts dd{margin:0;font-size:14px;line-height:1.45}
.mt-fact-note{display:block;margin-top:3px;font-size:12px;line-height:1.4;color:var(--mt-muted)}
.mt-card-note{margin:14px 0 0;padding:10px 12px;border-radius:10px;background:#f6e3df;color:#5a1d14;font-size:13px;line-height:1.45}
.mt-card-transfer{display:flex;flex-wrap:wrap;align-items:center;gap:2px 12px;margin-top:12px;padding-top:10px;border-top:1px solid var(--mt-line)}
.mt-card-transfer>span{font:500 13px/1.3 var(--sans);color:var(--mt-muted)}
.mt-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.mt-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border:1px solid var(--mt-ink);border-radius:999px;background:transparent;color:var(--mt-ink);font:600 14px/1 var(--sans);cursor:pointer;transition:background-color .2s,color .2s}
.mt-button:hover{background:var(--mt-ink);color:var(--mt-paper)}
.mt-button:focus-visible,.mt-chip:focus-visible,.mt-swap:focus-visible,.mt-views button:focus-visible,.mt-hud-exit:focus-visible{outline:2px solid var(--mt-ink);outline-offset:3px}
.mt-button--primary{background:var(--mt-ink);color:var(--mt-paper)}
.mt-button--primary:hover{background:#000}
.mt-button--ghost{border-color:var(--mt-line)}
.mt-button--small{min-height:36px;padding:0 14px;font-size:13px}
.mt-footnote{margin:18px 0 0;font-size:12px;line-height:1.5;color:var(--mt-muted)}

/* Route */
.mt-route-fields{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-areas:"from swap" "to swap";gap:10px 8px;align-items:end}
.mt-route-fields .mt-field:first-child{grid-area:from}
.mt-route-fields .mt-field:last-child{grid-area:to}
.mt-swap{grid-area:swap;align-self:center;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--mt-edge);border-radius:50%;background:#fff;color:var(--mt-ink);cursor:pointer}
.mt-swap:hover{border-color:var(--mt-ink)}
.mt-swap svg,.mt-hud-exit svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mt-route-result{margin-top:18px}
.mt-route-time{display:flex;align-items:baseline;gap:6px;margin:0}
.mt-route-time strong{font:600 40px/1 var(--sans)}
.mt-route-meta{margin:8px 0 0;font-size:14px;line-height:1.45;color:#3c3b37}
.mt-legs{margin:16px 0 0;padding:0;list-style:none}
.mt-legs li{display:grid;grid-template-columns:22px minmax(0,1fr);column-gap:10px;row-gap:3px;align-items:start;padding:10px 0;border-bottom:1px solid var(--mt-line)}
.mt-legs li:last-child{border-bottom:0}
.mt-leg-badge{grid-row:span 2}
.mt-legs li b{font-size:15px;line-height:1.3}
.mt-legs li span{font-size:13px;line-height:1.45;color:#3c3b37}
.mt-legs .mt-leg-transfer{align-items:center}
.mt-leg-walk{width:22px;height:22px;border:1.5px dashed #9c9a92;border-radius:50%}

/* Lines */
.mt-line-list{margin:0;padding:0;list-style:none}
/* The name and its switch take the first row; the counts and the profile button share the second. */
.mt-line{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"toggle toggle" "stats profile";gap:2px 10px;align-items:center;padding:6px 0 12px;border-bottom:1px solid var(--mt-line)}
.mt-line-toggle{grid-area:toggle;display:grid;grid-template-columns:22px minmax(0,1fr) 34px;align-items:center;gap:10px;width:100%;min-height:44px;padding:0;border:0;background:transparent;color:var(--mt-ink);font:600 15px/1.3 var(--sans);text-align:left;cursor:pointer}
.mt-line-toggle b{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--line);color:#fff;font:600 12px/1 var(--sans)}
.mt-line-toggle span{min-width:0;overflow-wrap:anywhere}
.mt-line-toggle[aria-pressed=false] b{background:#c9c6bd}
.mt-line-toggle[aria-pressed=false] span{color:var(--mt-muted)}
.mt-line-toggle:focus-visible{outline:2px solid var(--mt-ink);outline-offset:2px;border-radius:8px}
.mt-line-stats{grid-area:stats;margin:0 0 0 32px;font-size:13px;color:var(--mt-muted)}
.mt-line .mt-button{grid-area:profile}
.mt-profile .mt-button{margin-bottom:6px}
.mt-chart{display:block;width:100%;height:auto;margin-top:6px;overflow:visible}
.mt-chart-grid{stroke:#d6d4cd;stroke-width:1}
.mt-chart-axis{font:500 11px var(--mt-mono);fill:var(--mt-muted)}
.mt-chart-area{fill:var(--line);opacity:.14}
.mt-chart-sea{stroke:#3d6f97;stroke-width:1;stroke-dasharray:3 3}
.mt-chart-earth{fill:#e9e2d2;opacity:.8}
.mt-chart-ground{fill:none;stroke:#8a7a5c;stroke-width:1.5}
.mt-chart-water{fill:#4f87b5;opacity:.75}
.mt-chart-line{fill:none;stroke:var(--line);stroke-width:2.5;stroke-linejoin:round}
.mt-chart-dot{fill:#fff;stroke:var(--line);stroke-width:2.2;cursor:pointer}
.mt-chart-dot:hover,.mt-chart-dot:focus{fill:var(--line);outline:0}

/* Game setup */
.mt-game h2{margin:0;font:600 24px/1.1 var(--sans)}
.mt-game>p{margin:10px 0 0;font-size:14px;line-height:1.5}
.mt-game fieldset{margin:16px 0 0;padding:0;border:0}
.mt-game legend{margin-bottom:8px;padding:0}
.mt-radios{display:flex;flex-direction:column;gap:2px}
.mt-radio{display:flex;align-items:center;gap:10px;min-height:40px;font-size:14px;cursor:pointer}
.mt-radio input{width:18px;height:18px;margin:0;accent-color:var(--line,var(--mt-ink))}
.mt-game .mt-button--primary{width:100%;min-height:48px;margin-top:18px;font-size:16px}

/* Map controls, top right: time of day, the layers menu and the view reset. */
.mt-views{position:absolute;z-index:4;top:calc(16px + var(--mt-cover,0px));right:16px;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;max-width:calc(100% - 32px)}
.mt-time,.mt-views-toggle,.mt-reset{height:44px;border:1px solid var(--mt-edge);background:rgba(246,245,241,.96);color:var(--mt-ink);box-shadow:var(--mt-lift)}
.mt-time{display:flex;align-items:center;gap:10px;min-width:0;padding:0 6px 0 14px;border-radius:999px}
.mt-time-icon{display:grid;flex:none;width:20px;height:20px}
.mt-time-icon svg{grid-area:1/1;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:opacity .3s}
.mt-moon,.mt.is-night .mt-sun{opacity:0}
.mt.is-night .mt-moon{opacity:1}
.mt-time-value{flex:none;min-width:46px;font:600 15px/1 var(--mt-mono);font-variant-numeric:tabular-nums}
/* The track shows night and day; the gold stripe is the drawbridge window, 1:10–5:30. */
.mt-time-range{--track:linear-gradient(90deg,transparent 4.9%,#e2a43b 4.9% 22.9%,transparent 22.9%) bottom/100% 3px no-repeat,linear-gradient(90deg,#26304a 0 15%,#e9e4d6 31% 74%,#26304a 90%);width:clamp(110px,15vw,210px);height:28px;margin:0;background:transparent;-webkit-appearance:none;appearance:none;cursor:pointer}
.mt-time-range::-webkit-slider-runnable-track{height:9px;border-radius:999px;background:var(--track)}
.mt-time-range::-moz-range-track{height:9px;border-radius:999px;background:var(--track)}
.mt-time-range::-webkit-slider-thumb{width:18px;height:18px;margin-top:-4.5px;border:2px solid #fff;border-radius:50%;background:var(--mt-ink);box-shadow:0 1px 4px rgba(21,21,21,.35);-webkit-appearance:none}
.mt-time-range::-moz-range-thumb{width:14px;height:14px;border:2px solid #fff;border-radius:50%;background:var(--mt-ink)}
.mt-time-range:focus-visible{outline:2px solid var(--mt-ink);outline-offset:4px;border-radius:999px}
.mt-time-play,.mt-time-now{display:grid;flex:none;place-items:center;height:36px;border:0;border-radius:999px;background:transparent;color:var(--mt-ink);cursor:pointer}
.mt-time-play{width:36px}
.mt-time-play svg{width:15px;height:15px;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.mt-time-play .mt-play{fill:currentColor;stroke-width:1.5}
.mt-time-play .mt-pause{display:none;fill:none}
.mt-time-play[aria-pressed=true] .mt-play{display:none}
.mt-time-play[aria-pressed=true] .mt-pause{display:inline}
.mt-time-now{padding:0 12px;background:#ecebe5;font:600 13px/1 var(--sans)}
.mt-time-play:hover,.mt-time-now:hover{background:#e2e0d9}
.mt-time-play:focus-visible,.mt-time-now:focus-visible{outline:2px solid var(--mt-ink);outline-offset:2px}
.mt-views-toggle{display:inline-flex;align-items:center;gap:8px;padding:0 16px 0 13px;border-radius:999px;font:600 14px/1 var(--sans);cursor:pointer}
.mt-reset{display:grid;place-items:center;width:44px;padding:0;border-radius:50%;cursor:pointer}
.mt-views-toggle svg,.mt-reset svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mt-views-toggle:hover,.mt-reset:hover{border-color:var(--mt-ink)}
.mt-views-toggle[aria-expanded=true]{border-color:var(--mt-ink);background:var(--mt-ink);color:var(--mt-paper)}
.mt-views-toggle:focus-visible,.mt-reset:focus-visible{outline:2px solid var(--mt-ink);outline-offset:3px}
.mt-layers{position:absolute;top:calc(100% + 8px);right:0;width:min(310px,calc(100vw - 32px));max-height:var(--mt-layers-max,68vh);overflow:auto;padding:8px;border:1px solid var(--mt-edge);border-radius:14px;background:rgba(246,245,241,.98);box-shadow:0 2px 6px rgba(21,21,21,.1);overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bdbab1 transparent}
.mt-layers[hidden]{display:none}
.mt-layers-title{margin:6px 8px 4px;font:600 13px/1.3 var(--sans);color:var(--mt-muted)}
.mt-layer{font-family:var(--sans);display:grid;grid-template-columns:14px minmax(0,1fr) 34px;align-items:center;gap:12px;width:100%;min-height:52px;padding:6px 8px;border:0;border-radius:10px;background:transparent;color:var(--mt-ink);text-align:left;cursor:pointer}
.mt-layer:hover{background:#ecebe5}
.mt-layer:focus-visible{outline:2px solid var(--mt-ink);outline-offset:-2px}
.mt-layer i{width:14px;height:14px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px rgba(21,21,21,.12)}
.mt-layer b{display:block;font:600 14px/1.25 var(--sans)}
.mt-layer small{display:block;margin-top:2px;font-size:12px;line-height:1.3;color:var(--mt-muted)}
.mt-layer::after,.mt-line-toggle::after{content:"";width:34px;height:20px;border-radius:999px;background:radial-gradient(circle at 24px 50%,#fff 6px,transparent 6.5px),var(--mt-ink)}
.mt-layer[aria-pressed=false]::after,.mt-line-toggle[aria-pressed=false]::after{background:radial-gradient(circle at 10px 50%,#fff 6px,transparent 6.5px),#c9c6bd}
.mt-layer[aria-pressed=false] i{opacity:.35}
.mt-layer[aria-pressed=false] b{color:var(--mt-muted)}
.mt-layer.is-loading i{animation:mt-pulse 1s ease-in-out infinite}
@keyframes mt-pulse{50%{opacity:.25}}
[data-layer=buildings]{--swatch:#c9c4b8}
[data-layer=roads]{--swatch:#9d9a94}
[data-layer=parks]{--swatch:#7fa86a}
[data-layer=terrain]{--swatch:#cdb98f}
[data-layer=water]{--swatch:#4f87b5}
[data-layer=bridges]{--swatch:#8b8377}
[data-layer=boats]{--swatch:linear-gradient(#f3f1eb 0 52%,#24324a 52%)}
[data-layer=metro]{--swatch:conic-gradient(#D6083B 0 17%,#0078C9 0 34%,#009A49 0 51%,#EA7125 0 68%,#6E0A78 0 85%,#8C5646 0)}
[data-layer=escalators]{--swatch:repeating-linear-gradient(135deg,#5f5a50 0 2px,#c9c4b8 2px 3.5px)}
[data-layer=labels]{--swatch:#151515}
[data-layer=gauge]{--swatch:repeating-linear-gradient(0deg,#151515 0 1.5px,#e2e0d9 1.5px 3px)}

/* Night: the map background darkens with the scene lighting (--mt-night is set from the time of day). */
.mt::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#2a3550 0%,#161d2c 58%,#0c111b 100%);opacity:var(--mt-night,0);pointer-events:none}

/* Drawbridges tab */
.mt-bridges-head h2{margin:0;font:600 22px/1.15 var(--sans)}
.mt-bridges-head p{margin:8px 0 0;font-size:14px;line-height:1.5;color:#3c3b37}
.mt-bridges-head .mt-button{margin-top:14px}
.mt-bridges-now{margin:20px 0 4px;font:600 14px/1.4 var(--sans);color:var(--mt-ink)}
.mt-bridge-list{margin:0;padding:0;list-style:none}
.mt-bridge{font:inherit;display:grid;grid-template-columns:10px minmax(0,1fr);column-gap:10px;row-gap:2px;width:100%;padding:10px 6px;border:0;border-bottom:1px solid var(--mt-line);background:transparent;color:var(--mt-ink);text-align:left;cursor:pointer}
.mt-bridge:hover{background:#efede6}
.mt-bridge:focus-visible{outline:2px solid var(--mt-ink);outline-offset:-2px}
.mt-bridge i{grid-row:1/span 3;width:10px;height:10px;margin-top:5px;border-radius:50%;background:#c9c6bd}
.mt-bridge.is-open i{background:#e2a43b}
.mt-bridge b{font-size:15px;line-height:1.3}
.mt-bridge span{font-size:13px;line-height:1.4;color:#3c3b37}
.mt-bridge small{font:500 13px/1.4 var(--sans);color:var(--mt-muted)}
.mt-bridge small:empty{display:none}
.mt-bridge.is-open small{color:#9a6a12}

.mt-credit{position:absolute;z-index:2;right:16px;bottom:12px;margin:0;max-width:min(560px,calc(100% - 420px));padding:4px 8px;border-radius:8px;background:rgba(246,245,241,.86);font-size:11px;line-height:1.4;color:var(--mt-muted);text-align:right;user-select:text}
.mt-credit a{text-decoration:underline;text-underline-offset:2px}
.mt-credit-short{display:none}
.mt.is-night .mt-credit{background:rgba(17,22,33,.8);color:#aab1c0}
.mt-fallback{display:none}
.mt.is-no-webgl .mt-fallback{position:absolute;z-index:4;inset:auto 16px 16px 400px;display:block;margin:0;padding:16px;border:1px solid var(--mt-line);background:var(--mt-paper);font-size:15px}

/* Driver HUD */
.mt-hud{position:absolute;z-index:4;left:50%;bottom:16px;width:min(560px,calc(100% - 32px));padding:14px 16px 16px;border-radius:16px;background:rgba(21,21,21,.92);color:var(--mt-paper);transform:translateX(-50%);box-shadow:0 18px 40px rgba(21,21,21,.3);user-select:none;-webkit-user-select:none}
.mt-hud[hidden]{display:none}
.mt-hud-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.mt-hud-title{margin:0;font:600 13px/1.3 var(--sans);color:#c9c7bf}
.mt-hud-exit{display:grid;flex:none;place-items:center;width:40px;height:40px;padding:0;border:1px solid #555;border-radius:50%;background:transparent;color:#fff;cursor:pointer}
.mt-hud-exit:focus-visible{outline-color:#fff}
.mt-hud-next{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:6px 0 10px;font-size:15px;font-weight:600}
.mt-hud-next b{font:600 18px/1 var(--mt-mono);white-space:nowrap}
.mt-gauge{position:relative;height:12px;border-radius:999px;background:#33332f}
.mt-gauge-zone{position:absolute;top:0;bottom:0;left:calc(400 / 460 * 100% - 25 / 460 * 100%);width:calc(50 / 460 * 100%);border-radius:999px;background:#1d8f52}
.mt-gauge-mark{position:absolute;top:-4px;bottom:-4px;left:calc(400 / 460 * 100%);width:2px;background:#fff}
.mt-gauge b{position:absolute;top:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid #fff;border-radius:50%;background:#f0b429}
.mt-gauge.is-close b{background:#2ecc71}
.mt-hud-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0 0}
.mt-hud-stats div{min-width:0}
.mt-hud-stats dt{font:500 12px/1.2 var(--sans);color:#b3b2ab}
.mt-hud-stats dd{margin:4px 0 0;font:600 18px/1 var(--mt-mono);white-space:nowrap}
.mt-hud-controls{display:grid;grid-template-columns:1fr 1.4fr;gap:10px;margin-top:14px}
.mt-pedal{min-height:58px;border:0;border-radius:12px;font:700 17px/1 var(--sans);cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.mt-pedal--brake{background:#c0392b;color:#fff}
.mt-pedal--throttle{background:#f6f5f1;color:var(--mt-ink)}
.mt-pedal.is-down{transform:translateY(2px);filter:brightness(.85)}
.mt-hud-toast{position:absolute;left:50%;bottom:calc(100% + 12px);margin:0;padding:10px 16px;border-radius:999px;background:#fff;color:var(--mt-ink);font-size:14px;font-weight:600;white-space:nowrap;transform:translate(-50%,8px);opacity:0;transition:.25s;pointer-events:none;box-shadow:0 8px 20px rgba(21,21,21,.2)}
.mt-hud-toast.is-visible{opacity:1;transform:translate(-50%,0)}
.mt-hud-result{margin-top:14px;padding-top:14px;border-top:1px solid #444}
.mt-hud-result[hidden]{display:none}
.mt-hud-result p{margin:0;font-size:15px;line-height:1.5}
.mt-hud-result .mt-button{border-color:#f6f5f1;color:#f6f5f1}
.mt-hud-result .mt-button--primary{background:#f6f5f1;color:var(--mt-ink)}
.mt.is-driving .mt-panel,.mt.is-driving .mt-views{display:none}

/* A playable cabinet on Beliy island. The map stays in the same scene. */
.mt.is-arcade .mt-panel,.mt.is-arcade .mt-credit,.mt.is-arcade .mt-views{display:none}

/* Notes below the map */
.mt-notes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(24px,4vw,56px);padding:clamp(48px,6vw,80px) 0 0}
.mt-notes h2{margin:0 0 14px;font:600 clamp(22px,2vw,28px)/1.15 var(--sans)}
.mt-notes p,.mt-notes li{font-size:16px;line-height:1.55}
.mt-notes p{margin:0 0 12px}
.mt-notes ul,.mt-notes ol{margin:0;padding-left:20px}
.mt-notes li{margin:0 0 8px}
.mt-notes small{display:block;margin-top:14px;font-size:13px;line-height:1.5;color:#64635d}

@media (max-width:900px){
  .mt-notes{grid-template-columns:minmax(0,1fr)}
}
/* Respect short windows and landscape phones: the sheet must not start below the viewport. */
.mt{height:min(940px,calc(100dvh - var(--mt-page-top,130px)));min-height:240px}
@media (max-width:760px){
  .mt-main{padding:0}
  .mt-notes{padding:40px var(--page-gutter,20px) 0}
  /* The map fills the screen below the header and the back link (--mt-page-top), with nothing below the fold. */
  .mt{height:calc(100dvh - var(--mt-page-top,111px));min-height:240px;border-width:1px 0}
}
/* Controls share the top edge with the panel: they shed their text labels as the map narrows. */
@container metro (max-width:1060px){
  .mt-time-now{display:none}
  .mt-views-toggle{width:44px;padding:0;justify-content:center}
  .mt-views-toggle span{display:none}
}
@container metro (max-width:900px){
  .mt-time-range{width:80px}
}
/* Narrow maps (phones, tablets in portrait): the panel becomes a bottom sheet and the controls take the
   full top edge. Keep 800 in step with SHEET_WIDTH in metro-app.js. */
@container metro (max-width:800px){
  .mt-panel{--sheet-space:calc(100% - 64px - var(--mt-cover,0px) - var(--mt-keyboard,0px));top:auto;left:0;right:0;bottom:var(--mt-keyboard,0px);width:auto;height:min(max(58%,360px),var(--sheet-space));max-height:var(--sheet-space);border-width:1px 0 0;border-radius:16px 16px 0 0;background:var(--mt-paper);transition:transform .2s ease-out}
  .mt.is-sheet-full .mt-panel{height:var(--sheet-space)}
  .mt.is-collapsed .mt-panel{top:auto;bottom:0;width:auto;height:auto;max-height:none}
  .mt.is-collapsed .mt-panel-head{padding-bottom:12px}
  .mt-collapse{top:8px;right:8px;width:40px;height:40px}
  .mt-collapse svg{transform:rotate(-90deg)}
  .mt.is-collapsed .mt-collapse svg{transform:rotate(90deg)}
  .mt-panel-head{padding:20px 112px 12px 16px;min-height:62px;touch-action:none;user-select:none;-webkit-user-select:none}
  .mt-panel-head::before{content:"";position:absolute;top:6px;left:50%;width:40px;height:4px;margin-left:-20px;border-radius:999px;background:#bdbab1;pointer-events:none}
  .mt-panel h1{font-size:20px}
  /* A dedicated resize button stays separate from both the title and collapse control. */
  .mt-sheet-toggle{position:absolute;top:10px;right:60px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--mt-line);border-radius:50%;background:#fff;color:var(--mt-ink);cursor:pointer}
  .mt-sheet-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .mt-sheet-toggle .mt-shrink,.mt-sheet-toggle[aria-expanded=true] .mt-grow{display:none}
  .mt-sheet-toggle[aria-expanded=true] .mt-shrink{display:inline}
  .mt-sheet-toggle:hover{background:#efede6}
  .mt-collapse{top:10px;width:44px;height:44px}
  .mt-sheet-toggle:focus-visible{outline:2px solid var(--mt-ink);outline-offset:-4px}
  .mt-tabs{margin:0 12px}
  .mt-tabs button{padding-inline:6px}
  .mt-tabpanel{padding:12px 16px max(18px,env(safe-area-inset-bottom))}
  .mt-views{top:calc(10px + var(--mt-cover,0px));right:10px;left:10px;gap:6px;flex-wrap:nowrap;max-width:none}
  .mt-time{flex:1;gap:6px;padding-left:10px}
  .mt-time-range{flex:1;width:auto;min-width:60px}
  .mt-layers{width:min(310px,calc(100cqw - 20px))}
  .mt-credit{right:10px;bottom:calc(var(--mt-sheet,0px) + 8px);max-width:calc(100% - 20px);padding:3px 8px}
  .mt-credit-long{display:none}
  .mt-credit-short{display:inline}
  .mt-card-depth strong{font-size:36px}
  .mt-facts div{grid-template-columns:104px minmax(0,1fr)}
  .mt-hud{bottom:10px;width:calc(100% - 20px);padding:12px}
  .mt-hud-stats dd{font-size:15px}
  .mt.is-no-webgl .mt-fallback{inset:auto 12px 50% 12px}
}
@media (max-height:540px){
  .mt{min-height:0}
  .mt-panel-head{padding-top:10px;padding-bottom:8px}
  .mt-panel h1{font-size:18px}
  .mt-panel-head{min-height:56px}
  @container metro (min-width:500px) and (max-width:800px){
    .mt-panel,.mt.is-sheet-full .mt-panel{top:calc(8px + var(--mt-cover,0px));bottom:8px;left:8px;right:auto;width:min(340px,55%);height:auto;max-height:none;border:1px solid var(--mt-edge);border-radius:14px}
    .mt.is-collapsed .mt-panel{top:calc(8px + var(--mt-cover,0px));bottom:auto;width:min(340px,55%)}
    .mt-panel-head{padding-right:64px}
    .mt-panel-head::before,.mt-sheet-toggle{display:none}
    .mt-collapse svg{transform:none}
    .mt.is-collapsed .mt-collapse svg{transform:rotate(180deg)}
    .mt-views{left:calc(min(340px,55%) + 20px);right:8px;gap:4px}
    .mt-time-icon{display:none}
    .mt-time{min-width:0;padding-left:8px;gap:4px}
    .mt-time-range{min-width:20px}
    .mt-credit{bottom:8px;max-width:calc(100% - min(340px,55%) - 28px)}
  }
}
@media (pointer:coarse){
  .mt-tabs button,.mt-chip,.mt-radio,.mt-button--small,.mt-stop{min-height:44px}
  .mt-collapse,.mt-hud-exit{width:44px;height:44px}
  .mt-time,.mt-views-toggle,.mt-reset{height:48px}
  .mt-views-toggle{min-width:48px}
  .mt-reset{width:48px}
  .mt-time-play{width:44px;height:44px}
  .mt-time-now{height:44px}
  .mt-time-range{height:44px}
  .mt-time-range::-webkit-slider-thumb{width:24px;height:24px;margin-top:-7.5px}
  .mt-time-range::-moz-range-thumb{width:20px;height:20px}
  .mt-suggest li{min-height:48px}
}
@media (prefers-reduced-motion:reduce){
  .mt-label,.mt-water,.mt-ruler,.mt-escalator,.mt-hud-toast,.mt-panel,.mt-collapse svg,.mt-time-icon svg{transition:none}
  .mt-layer.is-loading i{animation:none;opacity:.5}
}
