/* From 0 to 1: the project as a subway line, in the site's own type and colour. */
.k-zero { --zline: color-mix(in srgb, var(--fg) 82%, transparent); --zmute: color-mix(in srgb, var(--fg) 60%, transparent); --zfaint: color-mix(in srgb, var(--fg) 14%, transparent); --zai: #7fdccb; --zme: #ff6a3d; }
.k-zero .card-in { padding: 0; display: block; }
.zero { position: absolute; inset: 0; color: var(--fg); overflow: hidden; }
.zero .label { margin: 0; font: 600 11.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--zmute); }

/* Header, top left (one size up from before) */
.z-head { position: absolute; z-index: 3; left: var(--pad); top: calc(var(--pad) - 6px); width: min(500px, 40%); }
.z-head .eyebrow { margin: 0 0 10px; }
.z-title { margin: 0; font: 300 clamp(2.6rem, 4.9vw, 4.7rem)/.92 var(--display); font-stretch: 74%; letter-spacing: -0.02em; }
.z-sub { margin: 14px 0 0; font-size: 16.5px; line-height: 1.5; color: color-mix(in srgb, var(--fg) 84%, transparent); text-wrap: pretty; }
.z-note { margin: 8px 0 0; font-size: 13px; color: var(--zmute); }

/* Right column: the AI switch first (it's what people ask about), then the numbers, then the threads */
.z-tools { position: absolute; z-index: 3; right: var(--pad); top: calc(clamp(12px, 2.4vw, 28px) + 58px); display: flex; gap: 10px; align-items: center; }
.z-ai { display: inline-flex; align-items: center; gap: 14px; height: 56px; padding: 0 22px 0 14px; border-radius: 999px; border: 0; cursor: pointer; color: var(--fg);
  background: color-mix(in srgb, var(--zai) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--zai) 55%, transparent); transition: background .25s, box-shadow .25s; }
.z-ai[aria-checked="false"] { background: color-mix(in srgb, var(--fg) 8%, transparent); box-shadow: inset 0 0 0 1.5px var(--zfaint); }
.z-sw { position: relative; width: 46px; height: 28px; border-radius: 999px; background: color-mix(in srgb, var(--fg) 22%, transparent); transition: background .25s; flex: none; }
.z-sw i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); transition: transform .3s cubic-bezier(.16,1,.3,1); }
.z-ai[aria-checked="true"] .z-sw { background: var(--zai); }
.z-ai[aria-checked="true"] .z-sw i { transform: translateX(18px); background: #10241f; }
.z-ai-t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.z-ai-t b { font: 700 15px/1 var(--body); }
.z-ai-t em { font: 500 12.5px/1 var(--body); font-style: normal; opacity: .7; }
.z-keybtn { height: 56px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer; background: color-mix(in srgb, var(--fg) 9%, transparent); color: var(--fg); font: 700 14px/1 var(--body); }
.z-keybtn:hover { background: color-mix(in srgb, var(--fg) 16%, transparent); }
.z-keybtn[aria-expanded="true"] { background: var(--fg); color: var(--bg); }
.z-stats { position: absolute; z-index: 3; right: var(--pad); top: calc(clamp(12px, 2.4vw, 28px) + 136px); display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.z-stats li { display: flex; flex-direction: column; gap: 6px; }
.z-stats b { font: 300 clamp(1.9rem, 2.7vw, 2.7rem)/1 var(--display); font-stretch: 76%; font-variant-numeric: tabular-nums; }
.z-stats span { font: 600 11px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--zmute); }
.z-threads { position: absolute; z-index: 3; right: var(--pad); top: calc(clamp(12px, 2.4vw, 28px) + 214px); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; max-width: calc(100% - min(500px, 40%) - var(--pad) * 2 - 30px); }
.z-threads .label { margin-right: 4px; }
.z-threads button { height: 38px; padding: 0 15px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--c) 65%, transparent); background: none; color: var(--fg); font: 600 14px/1 var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .2s; }
.z-threads button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.z-threads button:hover, .z-threads button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 24%, transparent); }
.z-key { position: absolute; z-index: 7; right: var(--pad); top: calc(clamp(12px, 2.4vw, 28px) + 124px); width: 290px; padding: 18px 20px; border-radius: 16px; background: #232321; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.z-key ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.z-key li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.z-key svg { width: 30px; height: 30px; flex: none; overflow: visible; }
.k-st { fill: var(--bg); stroke: var(--fg); stroke-width: 2; } .k-in { fill: var(--fg); }
.k-dec { fill: var(--zme); } .k-no { fill: none; stroke: var(--zmute); stroke-width: 1.5; stroke-dasharray: 3 3; }
.k-ai { fill: color-mix(in srgb, var(--zai) 18%, transparent); stroke: var(--zai); stroke-width: 2.5; }
.k-brand { stroke: var(--zline); stroke-width: 5; stroke-linecap: round; } .k-rail { stroke: var(--zline); stroke-width: 2; }
.k-upd { fill: var(--zmute); } .k-end { fill: var(--fg); }

/* The map */
.z-stage { position: absolute; left: 0; right: 0; top: clamp(270px, 35vh, 318px); bottom: 100px; overflow: hidden; }
.z-svg { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; -webkit-user-select: none; overflow: visible; }
.z-svg.dragging { cursor: grabbing; }
.z-svg text { font-family: var(--display); fill: var(--fg); }
.lane line { stroke: var(--zline); stroke-linecap: round; }
.lane-brand line { stroke-width: 5; }
.lane-build line { stroke-width: 2; }
.lane-plain line { stroke-width: 2; stroke-dasharray: 1 7; stroke: var(--zmute); }
.br-line { fill: none; stroke: var(--zmute); stroke-width: 1.5; stroke-dasharray: 4 5; }
.br-yes, .br-noTxt { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; fill: var(--zmute) !important; }
.ph { cursor: pointer; }
.ph-br { fill: none; stroke: var(--zfaint); stroke-width: 1.5; }
.ph-n { font-size: 16px; font-weight: 500; letter-spacing: .1em; fill: var(--zmute) !important; }
.ph-t { font-size: 30px; font-weight: 300; font-stretch: 76%; }
.ph-w { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; fill: var(--zmute) !important; }
.ph-far { display: none; text-anchor: middle; font-size: 84px; font-weight: 300; font-stretch: 76%; }
.ph-hit { fill: transparent; }
.ph:hover .ph-t, .ph:hover .ph-far, .ph:focus-visible .ph-t, .ph.cur .ph-t, .ph.cur .ph-far { fill: var(--zme); }
.ph:focus { outline: none; }

.st { cursor: pointer; outline: none; transition: opacity .3s; }
.st .dot { fill: var(--bg); stroke: var(--fg); stroke-width: 2.5; transition: fill .2s, stroke .2s; }
.st .in { fill: var(--fg); }
.st .hit { fill: transparent; }
.st-dec .dot { fill: var(--zme); stroke: var(--zme); }
.st-pill .dot { fill: var(--fg); }
.st-end .dot { fill: var(--fg); stroke: none; }
.end-n { text-anchor: middle; font-size: 30px; font-weight: 300; fill: var(--bg) !important; }
.st-br .dot { stroke-dasharray: 3 3; stroke-width: 1.5; stroke: var(--zmute); }
.st-br .st-l { fill: var(--zmute); }
.st-l { text-anchor: middle; font-size: 15px; font-weight: 500; font-stretch: 86%; }
.st-sub { text-anchor: middle; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; fill: var(--zmute) !important; }
.st:hover .dot, .st:focus-visible .dot { fill: var(--fg); }
.st-dec:hover .dot { fill: var(--fg); stroke: var(--fg); }
.st.cur .dot { fill: var(--zme); stroke: var(--zme); }
.st.cur .st-l { fill: var(--zme); }
.st-upd .dot, .st-upd-big .dot { fill: var(--zmute); stroke: none; }
.st-upd-big .ring { fill: none; stroke: var(--zme); stroke-width: 1.5; }
.st-upd-big .st-sub { fill: var(--zme) !important; }
.st-upd-dec .dot { fill: var(--zme); stroke: none; }
.ru-line { stroke: var(--zfaint); stroke-width: 1.5; }
.ru-wk { text-anchor: middle; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; fill: var(--zmute) !important; }
.ru-lab { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; fill: var(--zmute) !important; }

/* AI markers: a solid halo and a small tag, big enough to see from far away */
.st .ai-ring { fill: color-mix(in srgb, var(--zai) 16%, transparent); stroke: var(--zai); stroke-width: 3; opacity: 0; transition: opacity .3s; }
.st .ai-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; fill: var(--zai) !important; opacity: 0; transition: opacity .3s; }
.zero.ai-on .st .ai-ring, .zero.ai-on .st .ai-tag { opacity: 1; }
.zero.ai-on .st.no-ai:not(.st-upd):not(.st-upd-big):not(.st-upd-dec):not(.st-dec):not(.st-end):not(.cur) { opacity: .55; }

/* Pulled far back: names hide; phases, stations and AI halos grow so the whole route still reads */
.z-svg.far .st-l, .z-svg.far .st-sub, .z-svg.far .ph-n, .z-svg.far .ph-t, .z-svg.far .ph-w, .z-svg.far .ru-wk, .z-svg.far .br-yes, .z-svg.far .br-noTxt, .z-svg.far .ru-lab, .z-svg.far .ai-tag { display: none; }
.z-svg.far .ph-far { display: block; }
.z-svg.far .st .dot { stroke-width: 6; }
.z-svg.far .st:not(.st-upd):not(.st-upd-dec):not(.st-upd-big):not(.st-end) circle.dot { r: 24px; }
.z-svg.far .st .ai-ring { r: 46px; stroke-width: 8; }
.z-svg.far .st-dec .dot { transform: rotate(45deg) scale(2.2); }
.z-svg.far .lane-brand line { stroke-width: 12; }
.z-svg.far .lane-build line { stroke-width: 5; }
.z-svg.far .st-upd .dot { r: 12px; }

/* Threads */
.thr-drop { stroke-width: 1.5; stroke-dasharray: 2 5; opacity: .85; }
.thr-arc { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.thr-name { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; paint-order: stroke; stroke: var(--bg); stroke-width: 10px; stroke-linejoin: round; }
.st.thr .dot { stroke: var(--c); stroke-width: 4; }
.zero.thr-on .st:not(.thr):not(.st-upd):not(.st-upd-big):not(.st-upd-dec) { opacity: .4; }

/* Tooltip */
.z-tip { position: absolute; z-index: 4; transform: translate(-50%, calc(-100% - 12px)); padding: 9px 12px; border-radius: 10px; background: var(--fg); color: var(--bg); pointer-events: none; opacity: 0; transition: opacity .15s; display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.z-tip.on { opacity: 1; }
.z-tip b { font: 600 13px/1.2 var(--body); }
.z-tip span { font: 500 10px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; opacity: .65; }

/* The three floating boxes, grown out of the station on lines, drifting gently */
.z-float { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.z-float[hidden] { display: none; }
.z-links { position: absolute; left: 0; top: 0; overflow: visible; }
.zl { fill: none; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.zl.l-me { stroke: var(--zme); } .zl.l-ai { stroke: var(--zai); } .zl.l-gets { stroke: var(--fg); }
.zl-end.l-me { fill: var(--zme); } .zl-end.l-ai { fill: var(--zai); } .zl-end.l-gets { fill: var(--fg); }
.z-box { position: absolute; pointer-events: auto; padding: 14px 16px 15px; border-radius: 14px; background: #f4f3f0; color: #141414; box-shadow: 0 18px 44px rgba(0,0,0,.42);
  animation: zDrift 7s ease-in-out infinite alternate; }
.zb-ai { animation-duration: 8.5s; animation-delay: -3s; background: #e3f6f1; }
.zb-ai.is-cant { background: #ecebe8; }
.zb-gets { animation-duration: 9.5s; animation-delay: -5s; }
@keyframes zDrift { 0% { translate: 0 0; } 50% { translate: 0 -4px; } 100% { translate: 2px -1px; } }
.zb-t { margin: 0 0 8px; font: 700 11px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.zb-me .zb-t { color: #b8411b; } .zb-ai .zb-t { color: #1d7565; } .zb-gets .zb-t { color: rgba(20,20,20,.6); }
.z-box ul { margin: 0; padding: 0 0 0 16px; display: grid; gap: 5px; font-size: 14px; line-height: 1.4; }
.zb-none { margin: 0; font-size: 13.5px; color: rgba(20,20,20,.6); }
.z-float.in .zl { animation: zDraw .55s cubic-bezier(.3,.1,.2,1) both; }
.z-float.in .l-ai { animation-delay: .12s; } .z-float.in .l-gets { animation-delay: .24s; }
.z-float.in .zl-end { animation: zFade .3s ease both .4s; }
.z-float.in .z-box { animation: zPop .5s cubic-bezier(.16,1,.3,1) both .3s, zDrift 7s ease-in-out .8s infinite alternate; }
.z-float.in .zb-ai { animation: zPop .5s cubic-bezier(.16,1,.3,1) both .42s, zDrift 8.5s ease-in-out .9s infinite alternate; }
.z-float.in .zb-gets { animation: zPop .5s cubic-bezier(.16,1,.3,1) both .54s, zDrift 9.5s ease-in-out 1s infinite alternate; }
@keyframes zDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes zFade { from { opacity: 0; } }
@keyframes zPop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* Ride the line, bottom centre: zoom, back, where you are, next */
.z-step { position: absolute; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: #232321; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 14%, transparent), 0 10px 30px rgba(0,0,0,.3); transition: left .5s cubic-bezier(.16,1,.3,1); }
.z-step button { height: 48px; border-radius: 999px; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--fg); background: none; }
.z-step button:disabled { opacity: .28; cursor: default; }
.z-step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zs-zoom { display: flex; gap: 2px; padding-right: 8px; margin-right: 2px; border-right: 1px solid color-mix(in srgb, var(--fg) 16%, transparent); }
.zs-zoom button { width: 44px; font: 400 22px/1 var(--body); }
.zs-zoom .zs-all { width: auto; padding: 0 14px; font: 700 12.5px/1 var(--body); }
.zs-zoom button:hover, .zs-prev:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.zs-prev { width: 48px; }
.zs-next { display: inline-flex !important; gap: 10px; padding: 0 18px 0 22px; background: var(--fg) !important; color: var(--bg) !important; font: 700 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.zs-where { margin: 0; padding: 0 10px; min-width: 220px; max-width: 320px; display: flex; flex-direction: column; gap: 4px; }
.zs-where b { font: 600 10.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--zmute); }
.zs-where span { font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zero.open .z-step { left: calc((100% - min(440px, 36%) - 30px) / 2); }

/* The panel: flush against the right edge, rounded only where it meets the map. Sized to read without scrolling. */
.z-panel { position: absolute; z-index: 6; right: 0; top: calc(clamp(12px, 2.4vw, 28px) + 58px); bottom: 0; width: min(440px, 36%); display: flex; flex-direction: column;
  background: #f4f3f0; color: #141414; border-radius: 18px 0 0 0; box-shadow: -24px 0 60px rgba(0,0,0,.4); overflow: hidden; }
.z-panel.in { animation: zIn .55s cubic-bezier(.16,1,.3,1); }
@keyframes zIn { from { transform: translateX(100%); } }
.zp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px 26px; border-bottom: 1px solid rgba(20,20,20,.08); }
.zp-top .eyebrow { margin: 0; color: rgba(20,20,20,.6); font-weight: 600; }
.zp-x { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid rgba(20,20,20,.18); background: none; color: #141414; font-size: 20px; line-height: 1; cursor: pointer; }
.zp-x:hover { background: rgba(20,20,20,.06); }
.zp-thread { display: flex; align-items: center; gap: 8px; padding: 10px 20px 10px 26px; background: color-mix(in srgb, var(--c) 26%, #f4f3f0); }
.zp-thread[hidden] { display: none; }
.zt-name { font: 700 11px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.zt-n { font-size: 12.5px; color: rgba(20,20,20,.6); margin-right: auto; }
.zp-thread button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(20,20,20,.08); color: #141414; font-size: 18px; line-height: 1; cursor: pointer; }
.zp-thread button:disabled { opacity: .3; cursor: default; }
.zp-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 26px 24px; scrollbar-width: thin; overscroll-behavior: contain; }
.zp-t { margin: 0; font: 400 clamp(1.6rem, 2.2vw, 2.1rem)/1.04 var(--display); font-stretch: 78%; letter-spacing: -0.01em; }
.zp-t.is-dec::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .4em; background: var(--zme); transform: rotate(45deg) translateY(-.1em); }
.zp-line { margin: 10px 0 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.zp-meta { margin: 10px 0 0; font: 600 11px/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: rgba(20,20,20,.55); }
.zp-you { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: rgba(20,20,20,.8); }
.zp-you b { display: block; margin-bottom: 3px; font: 700 10.5px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: rgba(20,20,20,.55); }
.zp-sum { margin-top: 14px; display: grid; gap: 8px; }
.zp-sum section { padding: 10px 14px 11px; border-radius: 12px; }
.zp-sum h4 { margin: 0 0 5px; font: 700 10.5px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.zp-sum ul { margin: 0; padding: 0 0 0 16px; display: grid; gap: 3px; font-size: 13.5px; line-height: 1.4; }
.zp-sum p { margin: 0; font-size: 13.5px; color: rgba(20,20,20,.6); }
.s-me { background: color-mix(in srgb, var(--zme) 13%, #f4f3f0); } .s-me h4 { color: #b8411b; }
.s-ai { background: #e3f6f1; } .s-ai h4 { color: #1d7565; }
.s-gets { background: rgba(20,20,20,.05); } .s-gets h4 { color: rgba(20,20,20,.6); }
.zp-h { margin: 18px 0 8px; display: flex; justify-content: space-between; font: 700 11px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: rgba(20,20,20,.6); }
.zp-h span { font-weight: 500; letter-spacing: .08em; }
.zp-stations, .zp-steps { list-style: none; margin: 0; padding: 0; }
.zp-stations button, .zp-steps button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-bottom: 1px solid rgba(20,20,20,.08); background: none; color: #141414; text-align: left; cursor: pointer; font: 500 14px/1.3 var(--body); border-radius: 6px; }
.zp-stations button:hover, .zp-steps button:hover { background: rgba(20,20,20,.05); }
.zp-stations span, .zp-steps span { flex: 1; min-width: 0; }
.zp-stations small { font: 600 10px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: rgba(20,20,20,.5); white-space: nowrap; }
.zp-stations i { width: 11px; height: 11px; flex: none; border-radius: 50%; border: 2px solid #141414; }
.zp-stations i.i-dec { border: 0; background: var(--zme); border-radius: 1px; transform: rotate(45deg) scale(.85); }
.zp-stations i.i-end { background: #141414; }
em.ai { font: 700 10px/1 var(--display); letter-spacing: .08em; font-style: normal; color: #1d7565; background: #e3f6f1; padding: 4px 6px; border-radius: 6px; }
.zp-steps { columns: 1; }
.zp-steps .sl-g { margin: 10px 0 2px; font: 700 10px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: rgba(20,20,20,.5); }
.zp-steps .sl-g:first-child { margin-top: 0; }
.zp-steps button { padding: 6px 6px; font-size: 13.5px; }
.zp-steps .sl-dec i { width: 9px; height: 9px; flex: none; background: var(--zme); transform: rotate(45deg); }
.zp-steps .sl-dec span { font-weight: 600; }
.sd-back { margin: 14px 0 0; padding: 0; border: 0; background: none; font: 700 12px/1 var(--body); color: rgba(20,20,20,.6); cursor: pointer; }
.sd { margin-top: 12px; }
.sd.in { animation: zPop .4s cubic-bezier(.16,1,.3,1); }
.sd-g { margin: 0 0 6px; font: 700 10.5px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: rgba(20,20,20,.55); }
.sd-t { margin: 0; font: 600 19px/1.25 var(--body); }
.sd-t.sd-dec::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 9px; background: var(--zme); transform: rotate(45deg); }
.sd-d { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: rgba(20,20,20,.8); }
.sd-f { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff; font-size: 14.5px; line-height: 1.45; }
.sd-f::before { content: "Found  "; font: 700 10px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: rgba(20,20,20,.5); }
.sd-p, .sd-a { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; display: flex; gap: 10px; }
.sd-p { background: color-mix(in srgb, var(--zme) 13%, #f4f3f0); } .sd-a { background: #e3f6f1; }
.sd-p b, .sd-a b { flex: none; width: 22px; font: 700 10.5px/1.8 var(--display); letter-spacing: .1em; }
.sd-p b { color: #b8411b; } .sd-a b { color: #1d7565; }
.sd-yn { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sd-yn span { padding: 6px 10px; border-radius: 999px; font-size: 12.5px; }
.sd-yn .y { background: #141414; color: #f4f3f0; } .sd-yn .y::before { content: "Yes · "; opacity: .6; }
.sd-yn .n { border: 1px dashed rgba(20,20,20,.35); color: rgba(20,20,20,.65); } .sd-yn .n::before { content: "No · "; opacity: .7; }
.sd-nav { margin-top: 16px; display: flex; justify-content: space-between; gap: 8px; }
.sd-nav button { padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(20,20,20,.18); background: none; font: 600 12.5px/1 var(--body); color: #141414; cursor: pointer; }
.sd-nav button:disabled { opacity: .3; cursor: default; }

/* Exits: up at top centre as usual. No down arrow on this card; Field notes is in the main map. */
.k-zero .go-up { z-index: 4; }

/* Phones and short screens: the line runs down the page and scrolls; the panel covers the map. */
@media (max-width: 760px), (max-height: 560px) {
  .zero { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
  .z-head { position: relative; left: auto; top: auto; width: auto; padding: 78px 22px 0; }
  .z-title { font-size: 2.7rem; }
  .z-sub { font-size: 15px; }
  .z-tools { position: relative; right: auto; top: auto; padding: 16px 22px 0; }
  .z-ai { height: 50px; }
  .z-keybtn { height: 50px; }
  .z-stats { position: relative; right: auto; top: auto; padding: 18px 22px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .z-stats b { font-size: 1.7rem; }
  .z-stats span { font-size: 9.5px; letter-spacing: .1em; }
  .z-threads { position: relative; right: auto; top: auto; max-width: none; padding: 14px 22px 0; justify-content: flex-start; }
  .z-threads button { height: 34px; font-size: 13px; }
  .z-key { position: relative; right: auto; top: auto; margin: 10px 22px 0; width: auto; }
  .z-stage { position: relative; top: auto; bottom: auto; flex: none; overflow: visible; margin: 18px 0 10px; }
  .z-svg { height: auto; cursor: default; }
  .z-step { position: sticky; left: auto; transform: none; bottom: 86px; margin: 10px 12px 150px; align-self: center; }
  .zs-zoom { display: none; }
  .zero.open .z-step { left: auto; }
  .zs-where { min-width: 0; max-width: 46vw; }
  .z-panel { position: fixed; left: 10px; right: 10px; top: 74px; bottom: 10px; width: auto; z-index: 40; border-radius: 20px 20px 22px 22px; }
  .z-panel.in { animation-name: zUp; }
  @keyframes zUp { from { transform: translateY(40px); opacity: 0; } }
  .st-l { text-anchor: start; font-size: 17px; }
  .st-sub { text-anchor: start; font-size: 11px; }
  .ph-t { font-size: 26px; }
  .st .ai-tag { display: none; }
  .k-zero .go-up { left: 14px; }
}
@media (prefers-reduced-motion: reduce) { .z-panel.in, .z-float.in .z-box, .z-box, .z-float.in .zl, .sd.in { animation: none !important; } .z-step { transition: none; } }
/* In the close-up, everything but the chosen station steps back */
.zero[data-level="2"] .st:not(.cur):not(.st-upd):not(.st-upd-big):not(.st-upd-dec) { opacity: .28 !important; }
.zero[data-level="2"] .ph:not(.cur) { opacity: .4; }

/* Zoomed in (panel open): the intro, numbers and threads tuck away, the AI switch moves under the title so it's always
   reachable, and the map takes the extra height. */
@media (min-width: 761px) and (min-height: 561px) {
  .zero.open .z-sub, .zero.open .z-note, .zero.open .z-stats, .zero.open .z-threads { display: none; }
  .zero.open .z-tools { right: auto; left: var(--pad); top: calc(var(--pad) + 26px + clamp(2.6rem, 4.9vw, 4.7rem) * .92 + 14px); }
  .zero.open .z-key { right: auto; left: var(--pad); top: calc(var(--pad) + 26px + clamp(2.6rem, 4.9vw, 4.7rem) * .92 + 80px); }
  .zero.open .z-stage { top: calc(var(--pad) + 26px + clamp(2.6rem, 4.9vw, 4.7rem) * .92 + 84px); }
}

/* ================= round 13 ================= */
/* The AI switch has one home, under the intro. Zooming in folds the intro away, so the switch just slides up. */
.z-tools { position: static; margin-top: 18px; }
.z-head .z-sub, .z-head .z-note { max-height: 9em; overflow: hidden; transition: max-height .45s cubic-bezier(.16,1,.3,1), opacity .25s ease, margin .45s cubic-bezier(.16,1,.3,1); }
@media (min-width: 761px) and (min-height: 561px) {
  .zero.open .z-sub, .zero.open .z-note { display: block; max-height: 0; opacity: 0; margin-top: 0; }
  .zero.open .z-tools { position: static; left: auto; top: auto; margin-top: 14px; }
  .z-stats { top: calc(clamp(12px, 2.4vw, 28px) + 66px); }
  .z-threads { top: calc(clamp(12px, 2.4vw, 28px) + 146px); }
  .z-stage { top: clamp(360px, 44vh, 400px); }
}

/* Count-up: the numbers keep their width while they climb */
.z-stats b { min-width: 2ch; }

/* The key: docked at the left end of the ride bar, opening upward in two columns */
.z-step .z-keybtn { height: 48px; padding: 0 16px; margin-right: 2px; border-radius: 999px; background: none; color: var(--fg); font: 700 12.5px/1 var(--body); }
.z-step .z-keybtn:hover { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.z-step .z-keybtn[aria-expanded="true"] { background: var(--fg); color: var(--bg); }
.z-step .zs-zoom { border-left: 1px solid color-mix(in srgb, var(--fg) 16%, transparent); padding-left: 8px; }
.z-step .z-key, .zero.open .z-key { position: absolute; left: 0; right: auto; top: auto; bottom: calc(100% + 12px); width: min(580px, 92vw); padding: 18px 22px 20px; border-radius: 18px; background: #232321; box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 8; }
.z-step .z-key ul { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.z-step .z-key[hidden] { display: none; }

/* The panel's close tab sits on its left edge, where the panel meets the map, so you never reach across it */
.z-panel { overflow: visible; }
.zp-x { position: absolute; z-index: 2; left: -23px; top: 18px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #f4f3f0; color: #141414; font-size: 22px; line-height: 1;
  box-shadow: -6px 4px 18px rgba(0,0,0,.35); cursor: pointer; transition: transform .25s cubic-bezier(.16,1,.3,1), background .2s; }
.zp-x:hover { background: #fff; transform: translateX(-3px); }
.zp-top { padding-left: 34px; }
.zp-thread { padding-left: 34px; }
.zp-body { padding-left: 34px; border-bottom-left-radius: 0; }

@media (max-width: 760px), (max-height: 560px) {
  .z-tools { margin-top: 16px; }
  .zp-x { left: auto; right: 12px; top: 12px; width: 40px; height: 40px; box-shadow: none; border: 1px solid rgba(20,20,20,.18); }
  .zp-top, .zp-thread, .zp-body { padding-left: 22px; }
  .zp-top { padding-right: 60px; }
  .z-step .z-key ul { grid-template-columns: 1fr; }
  .z-step .z-key { width: calc(100vw - 44px); }
}
.zs-zoom .zs-all, .z-step .z-keybtn { white-space: nowrap; }

/* ================= round 14 ================= */
/* Deep navy, like a transit map at night: the orange calls and teal AI halos glow against it */
.k-zero { --zpanel: color-mix(in srgb, var(--bg) 80%, #ffffff 9%); }
.z-step, .z-step .z-key, .zero.open .z-key { background: var(--zpanel); }
.z-key { background: var(--zpanel); }

/* Where AI helps: off to start. On, every AI station says what AI did there. */
.ai-call { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.ai-call-bg { fill: color-mix(in srgb, var(--zai) 16%, var(--bg)); stroke: var(--zai); stroke-width: 1.2; }
.ai-call-tip { fill: var(--zai); }
.ai-call-t { text-anchor: middle; font-family: var(--body) !important; font-size: 11.5px; font-weight: 500; fill: #dff6f0 !important; }
.zero.ai-on .ai-call { opacity: 1; }
.z-svg.far .ai-call { display: none; }
.zero[data-level="2"] .st.cur .ai-call { opacity: 0; }

/* Floating boxes: three to five, each drifting at its own pace */
.z-box { animation: zDrift var(--dur, 8s) ease-in-out var(--dl, 0s) infinite alternate; }
.z-float.in .z-box, .z-float.in .zb-ai, .z-float.in .zb-gets { animation: zPop .5s cubic-bezier(.16,1,.3,1) both, zDrift var(--dur, 8s) ease-in-out var(--dl, 0s) infinite alternate; }
@keyframes zDrift { 0% { translate: 0 0; } 50% { translate: var(--dx, 2px) var(--dy, -4px); } 100% { translate: calc(var(--dx, 2px) * -.5) 1px; } }
.zb-found { background: #fbf3dc; } .zb-found .zb-t { color: #8a6a12; }
.zb-you { background: #e9edf5; } .zb-you .zb-t { color: #3c4f78; }
.zb-q { margin: 0; font-size: 14px; line-height: 1.45; }
.zl.l-found { stroke: #f2c14e; } .zl-end.l-found { fill: #f2c14e; }
.zl.l-you { stroke: #9fb3dc; } .zl-end.l-you { fill: #9fb3dc; }
.z-float.in .zl { animation: zDraw .55s cubic-bezier(.3,.1,.2,1) both; }

/* round 14b: callouts stay out of the close-up views */
.zero[data-level="2"] .ai-call, .z-svg.near .ai-call { display: none; }
@media (max-width: 760px), (max-height: 560px) {
  .z-step { max-width: calc(100vw - 24px); box-sizing: border-box; }
  .z-step .zs-where { flex: 1 1 auto; min-width: 0; max-width: none; overflow: hidden; }
  .z-step .zs-where * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ================= round 17 ================= */
/* Nothing moves when you zoom: the map fills the card, the intro and the bar float over it,
   and only the camera changes. The intro fades out in place, then fades back in place. */
@media (min-width: 761px) and (min-height: 561px) {
  .z-stage, .zero.open .z-stage { top: 0 !important; bottom: 0 !important; }
  .z-head { z-index: 4; pointer-events: none; }
  .z-head > *, .z-stats, .z-threads { pointer-events: auto; }
  .z-stats, .z-threads { z-index: 4; }
  .z-head .z-sub, .z-head .z-note, .z-stats, .z-threads { transition: opacity .35s ease, visibility 0s linear 0s; }
  .zero.open .z-sub, .zero.open .z-note { display: block; max-height: 9em; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s linear .25s; }
  .zero.open .z-sub { margin-top: 14px; } .zero.open .z-note { margin-top: 8px; }
  .zero.open .z-stats, .zero.open .z-threads { display: flex; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s linear .25s; }

  /* Frosted glass: the map stays visible behind the panel and the bar, blurred enough to read over. */
  .z-panel { right: 16px; bottom: 16px; border-radius: 20px; background: rgba(244,243,240,.8); -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
    box-shadow: 0 24px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.5); }
  .z-panel .zp-top { border-bottom-color: rgba(20,20,20,.1); }
  .zero.open .z-step { left: calc((100% - min(440px, 36%) - 46px) / 2); }
  @keyframes zIn { from { transform: translateX(24px); opacity: 0; } }
}
.z-step { background: color-mix(in srgb, var(--bg) 52%, transparent) !important; -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 14px 40px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.12); }
.z-step .z-key { background: color-mix(in srgb, var(--bg) 78%, transparent) !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
@media (min-width: 761px) and (min-height: 561px) {
  .z-tools { transition: transform .5s cubic-bezier(.16,1,.3,1); }
  .z-panel { background: rgba(246,245,242,.88); }
}
@media (prefers-reduced-motion: reduce) { .z-tools { transition: none !important; } }
@media (min-width: 761px) and (min-height: 561px) { .zero.open .z-tools { margin-top: 18px; } }

/* ================= round 19 ================= */
/* The way on to the next card: bottom right, clear of the ride bar, out of the way while a panel is open. */
.k-zero .go-down { z-index: 4; left: auto; right: 30px; transform: none; align-items: flex-end; }
.k-zero:has(.zero.open) .go-down { opacity: 0; pointer-events: none; }
@media (max-width: 760px), (max-height: 560px) { .k-zero .go-down { right: 14px; } }

/* How to read it: fills the empty band on first arrival, desktop only, fades once someone starts. */
.z-guide { display: none; }
@media (min-width: 1000px) and (min-height: 760px) {
  .z-guide { display: block; position: absolute; z-index: 3; right: var(--pad); top: calc(clamp(12px, 2.4vw, 28px) + 300px); width: min(560px, calc(100% - min(500px, 40%) - var(--pad) * 2 - 30px)); padding: 16px 20px 14px; border-radius: 16px; background: color-mix(in srgb, var(--fg) 5%, transparent); box-shadow: inset 0 0 0 1px var(--zfaint); transition: opacity .4s ease, transform .4s ease; }
  .z-guide.gone { opacity: 0; transform: translateY(-6px); pointer-events: none; }
}
.z-guide .label { margin: 0 0 10px; }
.z-guide ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.z-guide li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.35; color: color-mix(in srgb, var(--fg) 86%, transparent); text-wrap: pretty; }
.z-guide li b { color: var(--fg); }
.z-guide svg { width: 24px; height: 24px; flex: none; overflow: visible; }
.z-guide .g-line { stroke: var(--fg); stroke-width: 2; }
.z-guide .g-st { fill: none; stroke: var(--fg); stroke-width: 1.6; }
.z-guide .g-in { fill: var(--fg); }
.z-guide .g-dec { fill: var(--ac, #ff6a3d); }
.z-guide .g-go { fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.z-guide-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 10px; }
.z-guide-top .label { margin: 0; }
.z-guide-more { margin: 0; font-size: 12.5px; color: var(--zmute); }
.z-guide-key { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
