/* AIpamys: logo colours from the supplied posters; quiet water-model surfaces. */
:root{--brand-navy:#071d36;--brand-yellow:#ffc400;--brand-green:#08b317;--brand-school-green:#006b2d;--water:#468ca9;--paper:#f4f1e9;--surface:#fffdf8;--surface-alt:#e7eef1;--ink:#16334d;--muted:#526978;--line:#d1dce1;--accent:#326d8a;--accent-soft:#e4eef3;--school-navy:#16334d;--school-green:#326d8a;--school-yellow:#e4eef3;color:var(--ink);background:var(--paper)}
body,body.city-exhibit-on{color:var(--ink);background:var(--paper)}
.app-header,.top{background:var(--brand-navy);color:white;border-color:#294358}
.brand{background:var(--brand-navy);padding:7px 12px;border-radius:15px;letter-spacing:-.8px}
.brand .brand-ai{color:var(--brand-yellow)}.brand .brand-name{color:var(--brand-green)}.brand small{color:#dae3eb}.brand-symbol{display:none}
.app-header .game-entry{background:#dceaf2;color:#16334d}.app-header .presentation-tools button,.app-header .language-switch button{color:#dce7ee}.app-header .language-switch [aria-pressed=true]{background:#304b62;color:#fff}.app-header .district-search{background:#f4f1e9}
.top nav a{color:white}.primary,.primary-action,#map-save-water{background:#326d8a;color:white;border-color:#326d8a}.quiet{color:#244b64;border-color:#c6d5dd}.intro h1,.task-dialog h3,h1,h2{color:var(--ink)}
.water-panel,.content,.task-dialog,#project-intro{background:var(--surface);color:var(--ink);border-color:var(--line)}.water-panel{background:#e4edf2}.tank{border-color:#7299ae}.water,.tank .water{background:#468ca9}.help,.model-note,.brand small,.task-dialog p{line-height:1.6}.task-dialog p{color:#304b60}.walk-choice{color:#16334d;background:#f5f8fa;border:2px solid #c5d5df;font-size:16px}.walk-choice:hover{border-color:#326d8a;background:#e4eef3}.walk-choice b{color:#214c69;font-size:24px}.route-strip .active{background:#326d8a;color:white}.route-strip [data-phase="2"].active{background:#006b2d;color:white;border-color:#ffc400}
.voice-button{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:8px 12px!important;background:#f1f5f7!important;border:1px solid #b8cbd7!important;border-radius:10px;color:#183d57!important;font:600 13px/1.2 system-ui;cursor:pointer}.voice-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;flex-shrink:0}.voice-button[aria-pressed=true]{background:#16334d!important;color:white!important}.voice-button:disabled{opacity:.5}.intro-top{gap:12px}.task-dialog>.voice-button{margin-top:16px}
.city-exhibit-on #map-root{inset:68px 0 240px;background:var(--paper)!important}
#city-exhibit{inset:82px 18px 14px;color:var(--ink)}
.exhibit-top{margin-right:0}.cycle-buttons{background:#fffdf8;border-color:#d4dfe5}.cycle-buttons button{color:#355166;font-size:13px}.cycle-buttons [aria-pressed=true]{background:#16334d;color:white}.exhibit-tools{flex-wrap:wrap;justify-content:flex-end}.exhibit-tools button{font-size:12px;color:#294c64;border-color:#cedbe2;background:#fffdf8}
.exhibit-bottom{top:auto;left:0;right:0;bottom:0;width:auto;height:216px;overflow:auto;padding:18px 22px;border-radius:18px;background:#16334d;color:#fff;display:grid;grid-template-columns:1.1fr 1fr 2fr .8fr;grid-template-rows:auto auto auto;gap:10px 24px;align-content:start;border:1px solid #345169}
.exhibit-bottom h1{font-size:21px;color:white;margin:0;grid-column:1;grid-row:1}.exhibit-years{grid-column:2;grid-row:1;margin:0;align-self:start}.exhibit-years button{font-size:14px;color:#183d57;background:#e6eef3}.exhibit-years [aria-pressed=true]{background:#468ca9;color:white}
.population-control{grid-column:1/3;grid-row:2;display:flex;align-items:center;gap:15px;flex-wrap:wrap}.population-control>span{color:#d5e5ee;font-size:13px}.population-control>strong{color:white;font-size:32px;margin:0}.map-people-actions button{background:#edf3f6;color:#16334d;border-color:#edf3f6;font-size:13px}.map-people-actions{margin:0}
.exhibit-meters{grid-column:3;grid-row:1/4;display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;padding:0;border:0}.meter-demand{grid-column:1;grid-row:1}.meter-demand>span,.meter-demand>small{color:#d5e5ee;font-size:13px}.meter-demand>strong{font-size:32px;color:white}.water-tank{display:none}.capacity-line{grid-column:1;grid-row:2;margin:0;display:block;font-size:13px;color:#d5e5ee}.capacity-line b{display:block;font-size:25px;color:white;margin-top:4px}.capacity-line span{max-width:none}#exhibit-balance-card{grid-column:2;grid-row:1/3;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;background:#244b63;border:1px solid #5e8095;border-radius:12px;padding:14px;color:white}#exhibit-balance-card[data-shortfall=true]{background:#6c403a;border-color:#b78879}#exhibit-margin-label,.balance-unit{font-size:13px;color:#eef3f6}#exhibit-margin{font-size:32px;color:white}
#map-save-water{grid-column:4;grid-row:1;margin:0;background:#d8e9f2;color:#173950;font-size:18px}#pipe-condition{grid-column:4;grid-row:2;background:#eaf0f4;color:#183d57;border:1px solid #a8bdca;border-radius:10px;font-size:13px;padding:10px}.pipe-note{grid-column:1/3;grid-row:3;font-size:12px;line-height:1.4;color:#d5e5ee;margin:0}.exhibit-details{grid-column:1/-1;border-color:#456176;margin:0;padding-top:8px;font-size:13px}.exhibit-details summary{color:#d5e5ee;font-size:12px}.exhibit-details[open]{background:#16334d;padding-bottom:15px}
.map-key{bottom:225px;color:#345166;font-size:11px;background:#fffdf8eb;border-radius:6px;padding:5px 8px}.city-exhibit-on .map-tools{bottom:270px}.district-crowd>b,.city-landmark span{color:#2d4b60}.district-crowd{background:#faf8efeb}.illustrated-city .resource-geometry{fill:#9fcbdc;stroke:#87b6c9}.illustrated-city .schematic-route.street-aligned{stroke-width:4}.illustrated-city .city-flow{stroke:#f5fdff;stroke-width:3;opacity:1;stroke-dasharray:1 23;animation:pipe-travel 2s linear infinite;filter:drop-shadow(0 0 2px #468ca9)}@keyframes pipe-travel{to{stroke-dashoffset:-24}}
.pipe-leak-marker{pointer-events:none}.pipe-leak{position:absolute;width:0;height:0}.leak-drop{position:absolute;display:block;width:4px;height:5px;border-radius:50%;background:#72bfdc;border:1px solid white;transform-origin:center;animation:pipe-spray 1.3s ease-out infinite;--dx:-15px;--dy:-22px}.drop-1{--dx:-7px;--dy:-28px;animation-delay:-.2s}.drop-2{--dx:3px;--dy:-31px;animation-delay:-.5s}.drop-3{--dx:12px;--dy:-25px;animation-delay:-.8s}.drop-4{--dx:19px;--dy:-17px;animation-delay:-1s}@keyframes pipe-spray{0%{transform:translate(0,0);opacity:1}75%{transform:translate(var(--dx),var(--dy));opacity:1}100%{transform:translate(var(--dx),-4px);opacity:0}}.city-paused .leak-drop,.city-paused .city-flow{animation-play-state:paused}
:root[data-theme=night]{--surface:#18334b;--surface-alt:#26465d;--ink:#edf4f7;--muted:#bdcfdb;--line:#466177;--accent:#a6cfe1;--accent-soft:#284d66;background:#10283e}:root[data-theme=night] body{background:#10283e;color:#edf4f7}:root[data-theme=night] #project-intro{color:#edf4f7}:root[data-theme=night] #project-intro h1{color:#edf4f7}
@media(max-width:1000px){.exhibit-bottom{grid-template-columns:1.2fr 1.8fr .8fr;gap:10px 14px}.exhibit-bottom h1{display:none}.exhibit-years{grid-column:1}.population-control{grid-column:1;grid-row:2;gap:7px}.population-control>span{display:none}.population-control>strong{font-size:26px}.exhibit-meters{grid-column:2}#map-save-water,#pipe-condition{grid-column:3}.pipe-note{grid-column:1/4;grid-row:4}.exhibit-bottom{height:235px}.city-exhibit-on #map-root{bottom:260px}.map-key{bottom:242px}.city-exhibit-on .map-tools{bottom:295px}}
@media(max-width:760px){.city-exhibit-on #map-root{inset:111px 0 290px}.city-exhibit-on .app-header{height:110px}.brand{padding:5px 8px}.brand small{font-size:6px}.exhibit-top{gap:6px}.cycle-buttons button{font-size:10px;min-height:36px}.exhibit-tools button{font-size:10px;padding:6px!important}.exhibit-tools .voice-button{min-height:31px}#city-exhibit{inset:119px 8px 8px}.exhibit-bottom{height:274px;padding:12px;grid-template-columns:1fr 1fr;gap:8px 12px}.exhibit-years{grid-column:1;grid-row:1}.exhibit-years button{font-size:12px}.population-control{grid-column:1;grid-row:2;display:block}.population-control>strong{font-size:24px;display:block;margin-bottom:8px}.map-people-actions button{font-size:10px}.exhibit-meters{grid-column:2;grid-row:1/4;display:block}.meter-demand>span,.meter-demand>small,.capacity-line{font-size:10px}.meter-demand>strong{font-size:25px}.capacity-line{margin:5px 0}.capacity-line b{font-size:19px}#exhibit-balance-card{padding:6px 9px;gap:1px}#exhibit-margin{font-size:23px}#exhibit-margin-label,.balance-unit{font-size:10px}#map-save-water{grid-column:1;grid-row:3;min-height:32px;font-size:14px}#pipe-condition{grid-column:1;grid-row:4;padding:7px;font-size:11px}.pipe-note{grid-column:2;grid-row:4;font-size:9px}.exhibit-details{grid-row:5}.map-key{bottom:280px;font-size:8px}.city-exhibit-on .map-tools{bottom:310px}.voice-button{font-size:12px}.top{padding:14px}.top nav{gap:10px}.top nav a{font-size:12px}.task-dialog{max-height:85dvh;overflow:auto}.walk-choice{font-size:14px}.intro{flex-wrap:wrap}.intro>.voice-button{margin-top:-12px}}
@media(prefers-reduced-motion:reduce){.illustrated-city .city-flow,.leak-drop{animation:none!important}.leak-drop{transform:translate(var(--dx),var(--dy))}}
#exhibit-balance-card{flex-wrap:nowrap;min-width:0}#exhibit-margin-label{flex:0 0 auto;line-height:1.4}#exhibit-margin{font-size:clamp(24px,2.4vw,32px);white-space:nowrap}.source-strip{pointer-events:auto;display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:8px;max-width:580px;font-size:11px}.source-strip>span{background:#16334d;color:white;padding:7px 10px;border-radius:8px}.source-strip button{border:1px solid #c7d7df;background:#fffdf8;color:#294c64;font-size:11px;padding:7px 10px;border-radius:8px;min-height:30px}.map-key{right:auto;max-width:calc(100% - 145px)}
@media(max-width:760px){.source-strip{gap:3px;margin-top:4px}.source-strip>span{display:none}.source-strip button{font-size:9px;min-height:25px;padding:4px 6px}.map-key{max-width:calc(100% - 15px);left:5px}#exhibit-margin{font-size:23px}}
#map-save-water[aria-pressed=true]{background:#b9d6e4;color:#16334d;border-color:#8db9cf}
.big-equation .answer,.math-total,.tank-label strong{color:#245b79}.world-goal{color:#24465e;background:#e6eff4;border-color:#c5d7e2}.world-wrap{border-color:#c2d4df}.world-controls p{color:#506776}.world-controls .dpad button{color:#234b65;background:#e5edf2}.season-badge{background:#e4edf2;color:#294c64}.live-dot{background:#468ca9}
/* Transparent portraits sit at the map edges, separate from its geographic layers. */
.map-companions{position:absolute;inset:160px -18px 216px;display:flex;justify-content:space-between;align-items:flex-end;pointer-events:none;user-select:none}
.map-companion{display:block;width:clamp(120px,14vw,200px);height:auto;max-height:min(30vh,245px);object-fit:contain;object-position:bottom;filter:drop-shadow(0 4px 5px #16334d18)}
@media(max-width:1100px){.map-companion{width:110px;max-height:175px}.map-companions{left:-18px;right:-18px;bottom:235px}}
@media(max-width:760px){.map-companions{inset:auto -8px 274px -8px}.map-companion{width:64px;max-height:90px}}
@media(max-height:600px) and (min-width:761px){.map-companion{max-height:105px;width:85px}}

.map-companions{overflow:hidden}.map-companion{transform:translateY(12px)}
/* Keep zoom and legend clear of the lower-corner companions. */
.city-exhibit-on .map-tools{left:220px}.map-key{left:220px}
@media(max-width:1100px){.city-exhibit-on .map-tools{left:130px}.map-key{left:130px}}
@media(max-width:760px){.city-exhibit-on .map-tools{left:8px;bottom:395px}.map-key{left:75px;max-width:calc(100% - 150px);font-size:7px;gap:2px}}
/* One fixed sign replaces source windows and cycle tabs. No source popups or map jump. */
.exhibit-top{justify-content:flex-end}
.water-source-sign{position:absolute;top:0;left:0;width:194px;background:#16334df5;color:#fff;border:1px solid #7692a4;border-radius:5px 15px 15px 5px;padding:15px 16px;box-shadow:0 3px 12px #16334d12;pointer-events:none}
.water-source-sign h2{font-size:12px;line-height:1.3;color:#d4e6ef;margin:0 0 13px;letter-spacing:.08em;text-transform:uppercase}
.water-source-sign ul{list-style:none;padding:0;margin:0;display:grid;gap:13px}.water-source-sign li{display:flex;gap:10px;align-items:center;font-size:14px;font-weight:600;line-height:1.35}.water-source-sign .ui-icon{width:20px;height:20px;flex-shrink:0;color:#9fcbdc}
@media(max-width:760px){.water-source-sign{width:147px;padding:11px 10px}.water-source-sign h2{font-size:10px;margin-bottom:10px}.water-source-sign ul{gap:9px}.water-source-sign li{font-size:11px;gap:6px}.water-source-sign .ui-icon{width:16px;height:16px}.exhibit-top .exhibit-tools{max-width:calc(100% - 155px)}}
.water-process-sign{pointer-events:auto;width:210px;padding:13px 10px}.water-process-sign h2{margin:0 8px 9px}.water-process-sign ol{list-style:none;padding:0;margin:0;display:grid;gap:11px}.water-process-sign li{position:relative;display:block}
.water-process-sign button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:1px solid transparent;color:#f5f9fc;border-radius:9px;padding:9px 7px;min-height:48px;font:inherit}.water-process-sign button:hover{background:#254b64}.water-process-sign button[aria-pressed=true]{background:#e4eff5;border-color:#a8c9dc;color:#16334d}.water-process-sign button[aria-pressed=true] .ui-icon{color:#326d8a}.water-process-sign b{display:block;font-size:14px}.water-process-sign small{display:block;font-size:10px;line-height:1.4;opacity:.85;margin-top:3px}.process-number{font-size:10px;opacity:.75}.water-stage-note{position:absolute;left:235px;top:0;max-width:370px;margin:0;padding:9px 12px;border-radius:8px;background:#fffdf8eb;color:#244b63;font-size:12px;line-height:1.4;pointer-events:none}
#map-root[data-cycle=source] .schematic-route:not(.inlet-route),#map-root[data-cycle=source] .route-casing:not(.inlet-route),#map-root[data-cycle=source] .city-flow:not(.inlet-route){display:none}
#map-root[data-cycle=source] .district-crowd-marker,#map-root[data-cycle=treatment] .district-crowd-marker,#map-root[data-cycle=return] .district-crowd-marker{opacity:.15}
#map-root[data-cycle=source] .landmark-marker,#map-root[data-cycle=treatment] .landmark-marker,#map-root[data-cycle=return] .landmark-marker{opacity:.3}
#map-root[data-cycle=treatment] .schematic-route,#map-root[data-cycle=treatment] .route-casing,#map-root[data-cycle=treatment] .city-flow{opacity:.25}
#map-root[data-cycle=treatment] .facility-picture{filter:drop-shadow(0 0 6px #468ca9)}
#map-root[data-cycle=source] .resource-geometry{fill:#76b9d1;stroke:#468ca9;stroke-width:2}
@media(max-width:1000px){.water-stage-note{left:235px;top:48px;max-width:300px}}
@media(max-width:760px){.water-process-sign{width:147px;padding:9px 6px}.water-process-sign ol{gap:8px}.water-process-sign button{padding:6px 3px;min-height:37px;gap:5px}.water-process-sign b{font-size:11px}.water-process-sign small{font-size:8px;line-height:1.25;margin-top:2px}.water-process-sign .ui-icon{width:14px;height:14px}.process-number{display:none}.water-stage-note{left:155px;right:0;top:45px;max-width:none;padding:6px;font-size:10px}.water-process-sign h2{margin-bottom:5px}}
.water-process-sign{z-index:2}.water-process-sign ol{gap:6px}.water-process-sign button{height:43px;min-height:0;padding:5px 7px;line-height:1.2}.water-process-sign li:first-child button{height:60px}.water-process-sign small{color:#d5e6f0;opacity:1}.water-process-sign [aria-pressed=true] small{color:#38576c}
@media(max-width:760px){.water-process-sign button{height:38px;padding:4px 3px}.water-process-sign li:first-child button{height:52px}.water-process-sign small{font-size:8px}}
/* Population desk: a shared scale connects residents, demand and available capacity. */
.exhibit-bottom{height:285px;grid-template-columns:minmax(310px,1.25fr) minmax(320px,1.35fr) minmax(140px,.6fr);grid-template-rows:auto auto auto;gap:12px 26px;padding:18px 24px}
.exhibit-bottom h1{display:block;grid-column:1;grid-row:1;font-size:21px}.exhibit-years{grid-column:2;grid-row:1;max-width:290px}.population-control{grid-column:1;grid-row:2/4;display:grid;grid-template-columns:1fr auto;gap:5px 10px;align-content:start}.population-control>span{display:flex;font-size:12px}.population-control>strong{font-size:30px}.population-slider{grid-column:1/-1}.population-slider label{display:block;font-size:12px;color:#d5e5ee;margin-bottom:4px}#map-population-slider{width:100%;height:24px;margin:0;cursor:ew-resize;accent-color:#83d8ed;background:transparent}.population-ticks{display:flex;justify-content:space-between;font-size:10px;color:#bed3df;font-variant-numeric:tabular-nums}#population-silhouettes{grid-column:1/-1;display:flex;gap:2px;color:#4c6375}#population-silhouettes span{flex:1;min-width:0}#population-silhouettes .ui-icon{width:100%;height:24px}#population-silhouettes .inhabited{color:#83d8ed}.map-people-actions{grid-column:1/-1;margin-top:4px}.map-people-actions button{min-height:30px;padding:4px 10px;font-size:11px}#map-add-people{flex:0 1 auto}
.exhibit-meters{grid-column:2;grid-row:2/4;gap:10px 18px;align-content:start}.meter-demand>strong{font-size:27px;margin-top:5px}.meter-demand>span,.meter-demand>small,.capacity-line{font-size:11px}.capacity-line b{font-size:25px}.balance-track{height:9px;background:#0d273d;border-radius:3px;overflow:hidden;margin-top:8px}.balance-track i{display:block;height:100%;background:#79d6ee;transition:width .15s}.capacity-line .balance-track i{background:#b1d8a4}#exhibit-balance-card{padding:12px;background:#234e50;border-color:#59877f;justify-content:center;gap:8px}#balance-verdict{font-size:17px;color:#d5f3c9;line-height:1.25}#exhibit-balance-card[data-shortfall=true] #balance-verdict{color:#ffe1c8}#exhibit-margin{font-size:28px}#exhibit-margin-label,.balance-unit{font-size:11px}#map-save-water{grid-column:3;grid-row:1;min-height:39px}#pipe-condition{grid-column:3;grid-row:2;align-self:start}.pipe-note{grid-column:3;grid-row:3;font-size:10px}.experiment-status{display:block;grid-column:1/3;grid-row:4;margin:0;text-align:left;font-size:11px;color:#bed3df}.exhibit-details{grid-column:3;grid-row:4;padding:0;border:0}.exhibit-details[open]{grid-column:1/-1;grid-row:5}.exhibit-details p{color:#d5e5ee}.city-exhibit-on #map-root{bottom:310px}.map-companions{bottom:285px}.map-key{bottom:294px}.city-exhibit-on .map-tools{bottom:338px}
#city-exhibit input:focus-visible,#city-exhibit button:focus-visible{outline:3px solid #ffc400;outline-offset:3px}
@media(max-width:1000px){.exhibit-bottom{height:310px;grid-template-columns:1fr 1.2fr;gap:10px 18px}.population-control{grid-row:2}.exhibit-meters{grid-row:2}.exhibit-bottom h1{font-size:18px}#map-save-water{grid-column:1;grid-row:3;font-size:14px}#pipe-condition{grid-column:2;grid-row:3}.pipe-note{display:none}.experiment-status{grid-column:1;grid-row:4}.exhibit-details{grid-column:2;grid-row:4}.city-exhibit-on #map-root{bottom:335px}.map-companions{bottom:310px}.map-key{bottom:318px}.city-exhibit-on .map-tools{bottom:360px}}
@media(max-width:760px){.exhibit-bottom{height:340px;padding:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.exhibit-bottom h1{font-size:16px}.exhibit-years{align-self:center}.population-control>span{grid-column:1/-1;font-size:10px}.population-control>strong{grid-column:1/-1;font-size:25px}.population-control{gap:5px}.population-slider label{font-size:10px}.population-ticks{font-size:8px}#population-silhouettes{gap:0}#population-silhouettes .ui-icon{height:19px}.exhibit-meters{grid-template-columns:1fr 1fr;gap:8px}.meter-demand{grid-column:1;grid-row:1}.capacity-line{grid-column:2;grid-row:1}.meter-demand>strong,.capacity-line b{font-size:19px;letter-spacing:-.5px}.meter-demand>span,.capacity-line>span{font-size:9px;min-height:27px;display:block}.meter-demand .ui-icon{display:none}#exhibit-balance-card{grid-column:1/-1;grid-row:2;padding:8px;gap:3px}#balance-verdict{font-size:14px}#exhibit-margin{font-size:23px}.experiment-status{font-size:9px}.exhibit-details summary{font-size:10px}.city-exhibit-on #map-root{bottom:355px}.map-companions{bottom:340px}.map-key{bottom:348px}.city-exhibit-on .map-tools{bottom:440px}}
@media(prefers-reduced-motion:reduce){.balance-track i{transition:none}}
@media(max-width:760px){.population-control,.exhibit-meters{display:grid}.exhibit-meters{grid-row:2}.exhibit-years{grid-column:2}.population-control>strong{margin:0}.capacity-line{margin:0}#pipe-condition{grid-column:2;grid-row:3}.exhibit-details{grid-column:2;grid-row:4}}
/* Ansar speaks from beside his portrait, rather than from a detached map caption. */
.map-companions{overflow:visible}
.ansar-speech{position:absolute;right:clamp(140px,15vw,215px);bottom:44px;width:280px;max-width:calc(100% - 250px);padding:14px 17px;border:2px solid #9fcbdc;border-radius:20px 20px 4px 20px;background:#fffdf8;color:#16334d;box-shadow:0 3px 12px #16334d15;text-align:left;user-select:text}
.ansar-speech:after{content:'';position:absolute;right:-15px;bottom:18px;width:23px;height:19px;background:#fffdf8;border-right:2px solid #9fcbdc;border-bottom:2px solid #9fcbdc;transform:skewX(35deg);border-radius:0 0 5px 0}
.ansar-speech strong{display:block;color:#326d8a;font-size:12px;margin-bottom:5px}.ansar-speech p{position:relative;z-index:1;font-size:14px;line-height:1.5;margin:0}
.illustrated-city .station-label.major{max-width:145px;white-space:normal;font-size:10px;line-height:1.25;text-align:center;padding:4px 7px}
@media(max-width:1100px){.ansar-speech{right:125px;bottom:34px;width:250px}}
@media(max-width:760px){.ansar-speech{right:76px;bottom:14px;width:210px;max-width:calc(100% - 150px);padding:9px 11px;border-radius:15px 15px 3px 15px}.ansar-speech strong{font-size:10px;margin-bottom:3px}.ansar-speech p{font-size:11px;line-height:1.4}.ansar-speech:after{right:-11px;bottom:13px;width:16px;height:13px}.illustrated-city .station-label.major{max-width:100px;font-size:9px}.water-process-sign li:last-child button{height:49px}}
.water-process-sign li:last-child button{height:auto;min-height:49px}.water-process-sign button>span:last-child{min-width:0}
.ansar-speech{z-index:1}
@media(max-width:760px){.ansar-speech{bottom:32px}}
.pipe-controls{grid-column:3;grid-row:2/4;display:flex;flex-direction:column;gap:7px;min-width:0}.pipe-controls #pipe-condition{width:100%;margin:0;min-height:38px}.pipe-controls .pipe-note{display:block;font-size:10px;margin:0;line-height:1.35}.pipe-controls #pipe-cost{font-size:11px;color:#ffe0a5;line-height:1.35;margin:0}#pipe-alarm{font-size:13px;font-weight:700;color:#c9eabf}#pipe-alarm[data-state=overloaded]{color:#ffceac}#pipe-condition:disabled{opacity:1;background:#b8dcc1;color:#214d36;cursor:default}
.infrastructure-alarm .exhibit-bottom{border:3px solid #e99b6f;box-shadow:inset 0 0 0 3px #71392b}.infrastructure-alarm #pipe-alarm{animation:infrastructure-beacon 2s ease-in-out infinite}
@keyframes infrastructure-beacon{50%{color:#fff4dc;text-shadow:0 0 12px #ffbb78}}
.pipe-leak:before{content:'';position:absolute;width:22px;height:10px;left:-11px;top:-3px;border:1px solid #468ca9;border-radius:50%;background:#9fdef1c9;box-shadow:0 0 0 3px #b8e3ef55}.pipe-leak .leak-drop{width:6px;height:8px;background:#4bb9eb}
@media(max-width:1000px){.pipe-controls{grid-column:2;grid-row:3/5}.experiment-status{grid-row:4}.exhibit-details{grid-column:1/-1;grid-row:5}.exhibit-bottom{height:360px}.city-exhibit-on #map-root{bottom:385px}.map-companions{bottom:360px}.map-key{bottom:368px}.city-exhibit-on .map-tools{bottom:410px}}
@media(max-width:760px){.exhibit-bottom{height:395px}.city-exhibit-on #map-root{bottom:410px}.map-companions{bottom:395px}.map-key{bottom:403px}.city-exhibit-on .map-tools{bottom:480px}.pipe-controls{gap:4px}#pipe-alarm{font-size:11px}.pipe-controls #pipe-cost,.pipe-controls .pipe-note{font-size:9px}.pipe-controls #pipe-condition{min-height:31px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.infrastructure-alarm #pipe-alarm{animation:none}}
.city-paused~#city-exhibit #pipe-alarm{animation:none}
@media(max-width:760px){.ansar-speech{right:12px;bottom:70px;width:205px;max-width:calc(100% - 170px)}.ansar-speech:after{right:22px;bottom:-12px;transform:skewY(35deg)}}
/* The water drop speaks the calculated balance beside its portrait. */
#exhibit-balance-card.mascot-speech{position:absolute;left:clamp(155px,15vw,215px);bottom:44px;width:245px;max-width:calc(100% - 250px);display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:14px 18px;background:#f4fbef;border:2px solid #91ba94;border-radius:20px 20px 20px 4px;color:#24533b;z-index:1;box-shadow:0 3px 12px #16334d15;user-select:text}
#exhibit-balance-card.mascot-speech:after{content:'';position:absolute;left:-13px;bottom:20px;width:20px;height:18px;background:inherit;border-left:2px solid #91ba94;border-bottom:2px solid #91ba94;transform:skewX(-35deg);border-radius:0 0 0 4px}
.mascot-speech .mascot-speaker{font-size:11px;font-weight:700;color:#326d8a}.mascot-speech #balance-verdict{font-size:20px;color:#24533b}.mascot-speech #exhibit-margin{font-size:30px;color:inherit}.mascot-speech #exhibit-margin-label,.mascot-speech .balance-unit{font-size:12px;color:inherit}
#exhibit-balance-card.mascot-speech[data-shortfall=true]{background:#fff2e9;border-color:#d79c7e;color:#843f28}.mascot-speech[data-shortfall=true] #balance-verdict{color:#843f28!important}#exhibit-balance-card.mascot-speech[data-shortfall=true]:after{border-color:#d79c7e}
.exhibit-meters{grid-template-columns:1fr;gap:14px}.meter-demand{grid-column:1;grid-row:1}.capacity-line{grid-column:1;grid-row:2}
@media(max-width:1100px){#exhibit-balance-card.mascot-speech{left:125px;width:215px;bottom:34px}.ansar-speech{width:235px}}
@media(max-width:760px){#exhibit-balance-card.mascot-speech{left:76px;bottom:30px;width:220px;max-width:calc(100% - 150px);padding:10px 13px;gap:3px}.mascot-speech #balance-verdict{font-size:16px}.mascot-speech #exhibit-margin{font-size:25px}.mascot-speech #exhibit-margin-label,.mascot-speech .balance-unit{font-size:10px}#city-exhibit[data-speaker=balance] .ansar-speech{display:none}#city-exhibit[data-speaker=ansar] .mascot-speech{display:none}.exhibit-meters{grid-template-columns:1fr;gap:9px}.capacity-line{grid-column:1;grid-row:2}.meter-demand>span,.capacity-line>span{min-height:0}.meter-demand>strong,.capacity-line b{font-size:25px}}
#exhibit-balance-card.mascot-speech{left:250px}.city-exhibit-on .map-tools{left:520px}
@media(max-width:1100px) and (min-width:761px){#exhibit-balance-card.mascot-speech{left:240px;width:200px}.city-exhibit-on .map-tools{left:460px}.ansar-speech{width:210px;right:120px}}
@media(max-width:760px){#exhibit-balance-card.mascot-speech{left:auto;right:12px;bottom:65px;width:205px;max-width:calc(100% - 170px)}.city-exhibit-on .map-tools{left:8px}}
/* A dedicated dialogue strip keeps all speech outside the geographic viewport. */
.city-exhibit-on #map-root{inset:68px 0 320px}
#city-exhibit{inset:82px 18px 14px}
.exhibit-bottom{height:195px;padding:14px 20px;grid-template-columns:1.1fr 1fr .75fr;grid-template-rows:32px 1fr auto;gap:8px 24px;border-radius:15px}
.exhibit-bottom h1{font-size:18px;grid-column:1;grid-row:1}.exhibit-years{grid-column:2;grid-row:1;max-width:260px}.exhibit-years button{min-height:30px;font-size:12px;padding:5px}
.population-control{grid-column:1;grid-row:2;display:grid;grid-template-columns:1fr auto;gap:5px 8px;align-content:start}.population-control>span{font-size:11px;grid-column:1;grid-row:1}.population-control>strong{font-size:26px;grid-column:2;grid-row:1;margin:0}.population-slider{grid-column:1/-1;grid-row:2}.population-slider label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.population-ticks{font-size:9px}.map-people-actions{grid-row:3;grid-column:2;justify-content:flex-end;margin:0}.map-people-actions #map-reset-people{min-height:25px;height:25px;width:30px;font-size:16px}
.exhibit-meters{grid-column:2;grid-row:2/4;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto;gap:16px;align-content:start}.meter-demand{grid-column:1;grid-row:1}.capacity-line{grid-column:2;grid-row:1}.meter-demand>span,.capacity-line>span{display:block;font-size:11px;min-height:28px}.meter-demand .ui-icon{display:none}.meter-demand>strong,.capacity-line b{font-size:25px;margin:4px 0;letter-spacing:-.5px}.meter-demand>small{font-size:10px}.capacity-line:after{content:'м³ / day';display:block;font-size:10px;color:#d5e5ee;margin-top:5px}.balance-track{height:6px;margin-top:7px}
#map-save-water{grid-column:3;grid-row:1;font-size:14px;min-height:32px}.pipe-controls{grid-column:3;grid-row:2/4;gap:6px}.pipe-controls #pipe-condition{min-height:32px;font-size:12px}.pipe-controls #pipe-cost{font-size:10px;color:#e8d2ab}.experiment-status{grid-column:1;grid-row:3;font-size:9px;align-self:end;margin:0;color:#b6cbd7}#pipe-alarm{font-size:11px}#pipe-alarm[hidden]{display:none}
.map-companions{inset:auto 0 195px;height:105px;display:flex;align-items:flex-end;justify-content:space-between;overflow:visible;background:var(--paper);border-radius:12px 12px 0 0;padding:0 4px}
.map-companion{width:80px;height:100px;max-height:100px;transform:none;object-fit:contain}.map-companion.mascot{width:88px}
#exhibit-balance-card.mascot-speech{left:100px;right:auto;bottom:15px;width:235px;max-width:calc(45% - 100px);padding:9px 13px;display:grid;grid-template-columns:auto 1fr;gap:2px 6px;border-radius:13px;box-shadow:none}
.mascot-speech #balance-verdict{grid-column:1/-1;font-size:15px}.mascot-speech #exhibit-margin-label{font-size:10px;grid-column:1/-1}.mascot-speech #exhibit-margin{font-size:23px}.mascot-speech .balance-unit{font-size:10px;align-self:end;padding-bottom:3px}#exhibit-balance-card.mascot-speech:after{bottom:14px;width:12px;height:12px;left:-8px}
.ansar-speech{right:95px;left:auto;bottom:20px;width:310px;max-width:calc(48% - 90px);padding:10px 13px;border-radius:13px;box-shadow:none}.ansar-speech p{font-size:13px;line-height:1.4}.ansar-speech:after{right:-9px;bottom:12px;width:13px;height:12px;transform:skewX(35deg)}
.water-process-sign{width:168px;padding:9px}.water-process-sign h2{font-size:10px;margin-bottom:5px}.water-process-sign ol{gap:2px}.water-process-sign button,.water-process-sign li:first-child button,.water-process-sign li:last-child button{height:34px;min-height:34px;padding:5px}.water-process-sign b{font-size:12px}.water-process-sign .ui-icon{width:17px;height:17px}
.city-exhibit-on .map-tools{left:18px;bottom:328px}.exhibit-tools button{font-size:10px;min-height:28px}
@media(max-width:1000px) and (min-width:761px){.exhibit-bottom{gap:8px 14px;grid-template-columns:1.1fr 1fr .8fr}.exhibit-bottom h1{font-size:16px}.population-control>strong{font-size:23px}.meter-demand>strong,.capacity-line b{font-size:21px}}
@media(max-width:760px){.city-exhibit-on #map-root{inset:111px 0 376px}#city-exhibit{inset:119px 8px 8px}.exhibit-bottom{height:268px;padding:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:34px 1fr auto;gap:10px 14px}.exhibit-bottom h1{font-size:15px}.exhibit-years{grid-column:2;grid-row:1}.exhibit-years button{font-size:10px;padding:4px;min-height:27px}.population-control{grid-column:1;grid-row:2;grid-template-columns:1fr auto;gap:5px}.population-control>span{grid-column:1/-1;grid-row:1;font-size:10px}.population-control>strong{grid-column:1/-1;grid-row:2;font-size:25px}.population-slider{grid-row:3}.map-people-actions{grid-row:4}.population-ticks{font-size:8px}.exhibit-meters{grid-column:2;grid-row:2;grid-template-columns:1fr;gap:8px}.meter-demand{grid-column:1;grid-row:1}.capacity-line{grid-column:1;grid-row:2}.meter-demand>span,.capacity-line>span{font-size:10px;min-height:0}.meter-demand>strong,.capacity-line b{font-size:22px;margin:2px 0}.meter-demand>small{font-size:8px}.capacity-line:after{display:none}.balance-track{margin-top:4px;height:5px}#map-save-water{grid-column:1;grid-row:3;align-self:start}.pipe-controls{grid-column:2;grid-row:3;gap:3px}.pipe-controls #pipe-cost{font-size:9px}.experiment-status{grid-column:1/-1;grid-row:4;font-size:8px}.map-companions{bottom:268px;height:100px;padding:0}.map-companion,.map-companion.mascot{width:55px;height:78px;max-height:78px}#exhibit-balance-card.mascot-speech{left:65px;right:65px;bottom:10px;width:auto;max-width:none;padding:8px 11px}.mascot-speech #balance-verdict{font-size:14px}.mascot-speech #exhibit-margin{font-size:22px}.ansar-speech{left:65px;right:65px;bottom:15px;width:auto;max-width:none;padding:9px 11px}.ansar-speech p{font-size:12px}.ansar-speech:after{right:-9px;bottom:12px;transform:skewX(35deg)}.city-exhibit-on .map-tools{left:8px;bottom:384px}.water-process-sign{width:133px}.water-process-sign b{font-size:11px}.water-process-sign button,.water-process-sign li:first-child button,.water-process-sign li:last-child button{height:30px;min-height:30px}}
.capacity-line:after{display:none}.capacity-line small{display:block;font-size:10px;color:#d5e5ee}@media(max-width:760px){.capacity-line small{font-size:8px}}
@media(max-width:760px){.exhibit-bottom{height:290px}.map-companions{bottom:290px}.city-exhibit-on #map-root{bottom:398px}.city-exhibit-on .map-tools{bottom:406px}}

/* Water escaping from the pipe: a small pool and continuous upward jet. */
.pipe-leak:after{content:'';position:absolute;left:-4px;bottom:0;width:8px;height:23px;border-radius:70% 70% 30% 30%;background:linear-gradient(90deg,#468ca9,#d8f5ff 48%,#65b5d0);transform:rotate(-12deg);transform-origin:50% 100%;opacity:.9;animation:leak-jet 1.1s ease-in-out infinite alternate}
@keyframes leak-jet{to{transform:rotate(10deg) scaleY(.8)}}
.city-paused .pipe-leak:after{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.pipe-leak:after{animation:none}}

/* Keep the game shortcut at the right edge of the map header. */
.app-header .game-entry{order:10;margin-left:auto;flex-shrink:0;gap:9px;min-height:44px;padding:9px 15px;border:1px solid #f5cc57;border-radius:14px;background:#ffe08a;color:#16334d;box-shadow:0 3px 0 #b98b2c;transition:transform .15s,background .15s}
.app-header .game-entry .clean-icon{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.app-header .game-entry:hover{background:#ffe9ac;transform:translateY(-2px)}
.app-header .game-entry:active{transform:translateY(1px)}
@media(max-width:760px){.app-header .game-entry{padding:5px 10px;min-height:40px;gap:7px}.app-header .game-entry .clean-icon{width:25px;height:25px}}
@media(prefers-reduced-motion:reduce){.app-header .game-entry{transition:none}.app-header .game-entry:hover{transform:none}}

/* The city continues behind the characters, down to the control panel. */
.city-exhibit-on{--control-panel-height:195px;--control-panel-gap:14px}
.city-exhibit-on #map-root{bottom:calc(var(--control-panel-height) + var(--control-panel-gap))}
.city-exhibit-on .exhibit-bottom{height:var(--control-panel-height)}
.city-exhibit-on .map-companions{bottom:var(--control-panel-height);background:transparent;border-radius:0}
#exhibit-balance-card.mascot-speech,.ansar-speech{border:2px solid #527d94;background:#fffefa;box-shadow:0 5px 18px #16334d30,0 0 0 3px #ffffffaa}
@media(max-width:760px){.city-exhibit-on{--control-panel-height:290px;--control-panel-gap:8px}}
/* Larger map guides; speech stays compact beside them. */
.city-exhibit-on .map-companions{height:155px}
.city-exhibit-on .map-companion{width:130px;height:155px;max-height:155px}
.city-exhibit-on .map-companion.mascot{width:140px}
#exhibit-balance-card.mascot-speech{left:150px;max-width:calc(45% - 150px)}
.city-exhibit-on .ansar-speech{right:140px;max-width:calc(48% - 140px)}
@media(max-width:760px){
 .city-exhibit-on .map-companions{height:110px}
 .city-exhibit-on .map-companion,.city-exhibit-on .map-companion.mascot{width:76px;height:108px;max-height:108px}
 #exhibit-balance-card.mascot-speech,.city-exhibit-on .ansar-speech{left:82px;right:82px;width:auto;max-width:none}
}
@media(min-width:761px){.city-exhibit-on .map-tools{left:170px}}
/* Litres are easier to read; leave room for the correctly converted totals. */
.meter-demand>strong,.capacity-line b{font-size:clamp(21px,2.2vw,29px);white-space:nowrap}
.mascot-speech #exhibit-margin{font-size:21px;white-space:nowrap}
#exhibit-balance-card.mascot-speech .balance-unit{grid-column:1/-1;font-size:10px}
@media(max-width:760px){.meter-demand>strong,.capacity-line b{font-size:19px}.mascot-speech #exhibit-margin{font-size:20px}}
