/* Демо-город: карта, обзор, чат */
.kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:0 0 22px}
.kpis div{padding:10px 14px 10px 0;border-right:1px solid var(--line-soft)}
.kpis div:last-child{border-right:0}
.kpis span{display:block;font-size:11px;color:var(--ink-3);line-height:15px}
.kpis b{display:block;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.kpis small{color:var(--ink-3);font-size:11px}

.map-wrap{position:relative;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0 6px;margin:0 0 6px}
.map-wrap svg{display:block;width:100%;height:auto}
.map-wrap .map-cap{display:flex;gap:18px;flex-wrap:wrap;font-size:11.5px;color:var(--ink-3);padding:6px 0 0}
.map-wrap .legend{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-left:auto}
.map-wrap .legend i{display:inline-block;width:18px;height:3px;margin-right:4px;vertical-align:middle}
.map-wrap .legend b{font-weight:500;color:var(--ink-2)}
.map-wrap .src{font-size:10.5px;fill:var(--ink-2)}
.map-wrap .src-dot{fill:var(--ink)}
.seg{stroke-linecap:round;cursor:pointer;transition:opacity 120ms var(--ease)}
.seg:hover{stroke:#17191B!important}
.seg.dim{opacity:.10}
.overview-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.45fr);gap:44px;align-items:start}
.risk-list{border-top:1px solid var(--line)}
.risk-row{display:grid;grid-template-columns:36px 1fr auto;gap:10px;padding:8px 0;border-bottom:1px solid var(--line-soft);align-items:baseline}
.risk-row b{font-weight:600}
.risk-row .bar{height:3px;background:var(--line-soft);margin-top:5px;position:relative}
.risk-row .bar i{position:absolute;left:0;top:0;bottom:0;background:var(--accent)}
.risk-row .val{font-variant-numeric:tabular-nums;color:var(--ink-2);font-size:12px}
.summary-line{display:flex;gap:24px;flex-wrap:wrap;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0;font-size:12.5px;color:var(--ink-2)}
.summary-line b{color:var(--ink);font-weight:600}
.hbar{display:grid;grid-template-columns:130px 1fr 54px;gap:10px;align-items:center;padding:5px 0;font-size:12px}
.hbar .track{height:8px;background:#EDEDE8;position:relative}
.hbar .track i{position:absolute;left:0;top:0;bottom:0;background:var(--accent)}
.hbar .n{text-align:right;color:var(--ink-2);font-variant-numeric:tabular-nums}
.rank{width:26px;height:18px;border:1px solid var(--line);display:inline-grid;place-items:center;font-size:10.5px;color:var(--ink-2)}

/* Чат */
.chat{position:fixed;top:0;right:0;bottom:0;width:430px;background:var(--surface);border-left:1px solid var(--line);z-index:55;display:flex;flex-direction:column;transform:translateX(102%);transition:transform 180ms var(--ease)}
.chat.open{transform:none}
.chat-head{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line)}
.chat-head>div{display:flex;flex-direction:column;line-height:16px}
.chat-head .fine{font-size:11px}
.chat-head .inspector-close{margin-left:0}
.chat-head .btn{margin-left:auto}
.chat-log{flex:1;overflow:auto;padding:14px}
.msg{margin:0 0 14px;max-width:100%}
.msg.user{text-align:right}
.msg.user .bubble{background:#ECE9E2;color:var(--ink);display:inline-block;padding:7px 10px;border-radius:2px;text-align:left;max-width:85%}
.msg.bot .bubble{border-top:1px solid var(--line);padding-top:10px;font-size:13px;line-height:19px}
.msg.bot .bubble p{margin:0 0 8px}
.msg .tbl{overflow:auto;max-width:100%;margin:8px 0 4px;border-top:1px solid var(--line)}
.msg table{font-size:11.5px;line-height:15px;width:100%}
.msg th,.msg td{padding:4px 5px;border-bottom:1px solid var(--line-soft);white-space:nowrap}
.msg th{background:var(--surface);position:static;font-size:11px}
.msg .linkbtn{font-size:12px;margin-top:2px}
.chat-hints{display:flex;gap:6px;flex-wrap:wrap;padding:8px 14px;border-top:1px solid var(--line-soft)}
.chat-hints button{font-size:11px;border:0;border-bottom:1px solid var(--line);background:none;padding:4px 0;border-radius:0;cursor:pointer;color:var(--ink-2)}
.chat-hints button:hover{border-color:var(--ink-3);color:var(--ink)}
.chat-form{display:flex;gap:6px;padding:10px 14px 14px;border-top:1px solid var(--line)}
.chat-form input{flex:1;height:34px;font-size:16px}
.chat-form .btn{height:34px}
.typing{color:var(--ink-3);font-size:12px}
@media (max-width:1100px){.overview-grid{grid-template-columns:1fr;gap:28px}.chat{width:390px}}
@media (max-width:900px){.kpis{grid-template-columns:repeat(2,1fr)}.kpis div{border-bottom:1px solid var(--line-soft)}}
@media (max-width:620px){
  .kpis{grid-template-columns:1fr 1fr}
  .kpis b{font-size:18px}
  .chat{width:100%;top:0}
  .overview-grid{gap:22px}
  .map-wrap .legend{margin-left:0}
}

.lossline{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;padding:2px 0 12px;border-bottom:1px solid var(--line);margin-bottom:16px}
.lossline span:first-child{font-size:12px;color:var(--ink-3)}
.lossline b{font-size:32px;line-height:34px;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.lossline span{font-size:12.5px;color:var(--ink-2)}
.lossline .lossmoney{margin-left:auto;color:var(--ink-3);font-size:12px}
.map-progress{display:flex;align-items:center;gap:12px;padding:8px 0 2px;font-size:11.5px;color:var(--ink-2)}
.map-progress .track{flex:1;height:5px;background:#E7E4DC;max-width:300px}
.map-progress .track i{display:block;height:5px;background:var(--accent)}
@media (max-width:620px){.lossline b{font-size:26px;line-height:30px}.lossline .lossmoney{margin-left:0;width:100%}}

.decision{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:10px 0 12px;border-bottom:1px solid var(--line);margin:0 0 6px;font-size:12.5px;color:var(--ink-2)}
.decision span:first-child{font-size:11px;color:var(--ink-3)}
.decision b{font-size:15px;color:var(--ink);font-weight:600}
.decision .btn{margin-left:auto}
.map-wrap svg{max-height:560px}
@media (max-width:620px){.decision .btn{margin-left:0}.map-wrap svg{max-height:420px}}

.pager{display:flex;align-items:center;gap:10px;justify-content:flex-end;padding:10px 0;font-size:11.5px;color:var(--ink-3)}
.pager button{width:28px;height:26px;border:1px solid var(--line);background:var(--surface);cursor:pointer}
.pager button:disabled{opacity:.35;cursor:default}


@media (min-width:1200px){
  body.chat-open .shell{margin-right:430px}
  body.chat-open .topbar{padding-right:450px}
}

/* ---------- городская карта ---------- */
.cmap-frame{position:relative;background:#F3F0E8;border:1px solid var(--line);overflow:hidden}
.cmap-frame svg{display:block;width:100%;height:auto;max-height:560px;cursor:grab;touch-action:none;user-select:none}
.cmap-frame svg:active{cursor:grabbing}
#citymap.full .cmap-frame svg{max-height:640px}
.cm-blocks rect{fill:#EDE9DF;opacity:.55}
.cm-grid line{stroke:#E3DED2;stroke-width:1;stroke-dasharray:2 7;opacity:.8}
.cm-water{font:italic 9px "Golos Text",sans-serif;fill:#7E9BA6;letter-spacing:.5px}
.cm-park{font:8px "Golos Text",sans-serif;fill:#9CAF87;letter-spacing:2px;text-transform:uppercase}
.cm-ind{font:8px "Golos Text",sans-serif;fill:#B0A896;letter-spacing:2px}
.cm-street{font:7px "Golos Text",sans-serif;fill:#8E8779;letter-spacing:.6px;paint-order:stroke;stroke:#F3F0E8;stroke-width:2.4px}
.cm-districts text{font:9px "Golos Text",sans-serif;fill:#A39B8B;letter-spacing:2.6px;opacity:.85}
.cm-home{cursor:pointer}
.cm-home rect{transition:fill 120ms var(--ease)}
.cm-home:hover rect{fill:#CFC6B4}
.cm-pipeg{cursor:pointer}
.cm-pipeg .cm-pipe{transition:filter 120ms var(--ease)}
.cm-pipeg:hover .cm-pipe{filter:brightness(.55)}
.cm-pipeg.sel .cm-pipe{stroke:#17191B!important;stroke-width:5px;stroke-linecap:round}
.cm-src-name{font:7px "Golos Text",sans-serif;fill:#4A463D;font-weight:600}
.cm-src-cap{font:6.4px "Golos Text",sans-serif;fill:#8A8375}
.cmap-ui{position:absolute;inset:0;pointer-events:none}
.cmap-ui button{pointer-events:auto;font:11px "Golos Text",sans-serif;color:var(--ink);background:rgba(255,254,250,.92);border:1px solid var(--line);cursor:pointer}
.cmap-zoom{position:absolute;right:12px;top:12px;display:flex;flex-direction:column;gap:0}
.cmap-zoom button{width:30px;height:30px;border-bottom:0;font-size:15px}
.cmap-zoom button:last-child{border-bottom:1px solid var(--line);font-size:12px}
.cmap-zoom button:hover{background:#fff}
.cmap-layers{position:absolute;left:12px;top:12px;display:flex;gap:4px;flex-wrap:wrap}
.cmap-layers button{height:26px;padding:0 9px;border-radius:13px;color:var(--ink-3)}
.cmap-layers button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.cmap-legend{position:absolute;left:12px;bottom:12px;display:flex;align-items:center;gap:9px;font:10px "Golos Text",sans-serif;color:var(--ink-2);background:rgba(255,254,250,.92);border:1px solid var(--line);padding:6px 9px}
.cmap-legend b{font-weight:600;color:var(--ink)}
.cmap-legend i{display:inline-block;width:12px;height:3px;margin-right:4px;vertical-align:middle}
.cmap-legend .sep{width:1px;height:12px;background:var(--line)}
.cmap-legend .line{background:var(--ink-2);height:2px}
.cmap-scale{position:absolute;right:12px;bottom:12px;display:flex;align-items:center;gap:6px;font:10px "Golos Text",sans-serif;color:var(--ink-3);background:rgba(255,254,250,.86);padding:4px 7px}
.cmap-scale span{font-weight:600;color:var(--ink-2)}
.cmap-scale i{display:block;width:48px;height:7px;border:1px solid var(--ink-3);border-top:0}
.cmap-tip{position:absolute;z-index:4;background:#FFFEFA;border:1px solid var(--line);padding:7px 9px;font:10.5px/15px "Golos Text",sans-serif;color:var(--ink-2);pointer-events:none;max-width:190px;box-shadow:0 6px 18px rgba(23,25,27,.08)}
.cmap-tip b{display:block;color:var(--ink);font-size:11.5px;margin-bottom:2px}
.cmap-tip span{display:block}

/* ---------- инспектор участка ---------- */
.inspect{position:fixed;top:0;right:0;bottom:0;width:404px;background:var(--surface);border-left:1px solid var(--line);z-index:58;transform:translateX(102%);transition:transform 200ms var(--ease);display:flex;flex-direction:column}
.inspect.open{transform:none}
.inspect-head{display:flex;justify-content:space-between;align-items:flex-start;padding:14px 16px 10px;border-bottom:1px solid var(--line)}
.inspect-head .kick{font-size:10.5px;color:var(--ink-3);letter-spacing:.04em;text-transform:uppercase}
.inspect-head h2{font-size:24px;line-height:28px;margin-top:2px;letter-spacing:-.02em}
.inspect-head .close{width:28px;height:28px;border:1px solid var(--line);background:none;font-size:16px;cursor:pointer;color:var(--ink-2)}
.inspect-body{overflow:auto;padding:12px 16px 28px}
.ins-addr{font-size:12.5px;color:var(--ink-2)}
.ins-badges{display:flex;gap:6px;margin:8px 0 14px;flex-wrap:wrap}
.ins-badges span{font-size:10.5px;padding:3px 7px;border:1px solid var(--line);color:var(--ink-2)}
.ins-badges .hot{border-color:#B4472E;color:#8E2E19;background:#F7EDE8}
.ins-grid{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--line);border-left:1px solid var(--line)}
.ins-grid div{padding:7px 9px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.ins-grid span{display:block;font-size:10px;color:var(--ink-3)}
.ins-grid b{font-size:13px;font-weight:600}
.inspect h3{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);margin:18px 0 8px;font-weight:500}
.ins-bars{display:grid;gap:6px}
.ins-bars div{display:grid;grid-template-columns:78px 1fr 34px;gap:8px;align-items:center;font-size:11px;color:var(--ink-2)}
.ins-bars .tr{height:5px;background:#EDEAE2;position:relative}
.ins-bars .tr i{position:absolute;left:0;top:0;bottom:0;background:#B4472E}
.ins-bars .n{text-align:right;font-variant-numeric:tabular-nums}
.ins-list{border-top:1px solid var(--line-soft)}
.ins-list div{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-bottom:1px solid var(--line-soft);font-size:11.5px;color:var(--ink-2)}
.ins-list b{font-weight:500;color:var(--ink)}
.ins-note{font-size:11px;line-height:17px;color:var(--ink-3);margin:8px 0 0}
.ins-actions{display:flex;gap:8px;margin-top:18px}
.ins-actions button{flex:1;height:34px;border:1px solid var(--ink);background:var(--ink);color:#fff;font-size:12px;cursor:pointer}
.ins-actions button.ghost{background:none;color:var(--ink)}
@media (min-width:1200px){
  body.inspect-open .shell{margin-right:404px}
  body.inspect-open .topbar{padding-right:424px}
}
@media (max-width:760px){
  .inspect{width:100%;border-left:0}
  .cmap-frame svg{max-height:420px}
  .cmap-layers{top:auto;bottom:44px;left:8px;right:8px}
  .cmap-legend{display:none}
  .cmap-scale{display:none}
  .cmap-zoom{right:8px;top:8px}
}
.cm-home.dim{opacity:.22}
.cm-pipeg.dim .cm-pipe{opacity:.10}
.cm-pipeg.dim .cm-hit{pointer-events:none}
.inspector{top:46px;width:404px;padding:14px 16px 32px}
.inspect-head .kick{font-size:10.5px;color:var(--ink-3);letter-spacing:.05em;text-transform:uppercase}
.inspect-head h2{font-size:23px;line-height:27px;letter-spacing:-.02em;margin:2px 0 0}
.inspect-head .close{width:28px;height:28px;border:1px solid var(--line);background:none;font-size:16px;cursor:pointer;color:var(--ink-2);margin-left:auto}
.inspect-body{padding-bottom:10px}
.cm-avenues line{stroke:#F7F5EE;stroke-width:7}
.cm-pipeg.minor .cm-pipe{opacity:.20}
.cm-pipeg.minor:hover .cm-pipe{opacity:1}
.cm-trees circle{pointer-events:none}
.cm-pipeg.minor .cm-pipe{opacity:.07}
.cm-roadnames text{font:6.5px "Golos Text",sans-serif;fill:#B0A997;letter-spacing:1.6px;paint-order:stroke;stroke:#F3F0E8;stroke-width:2.4px}
svg[data-zoom="out"] .cm-pipeg.minor .cm-pipe{opacity:0}
svg[data-zoom="out"] .cm-pipeg.minor:hover .cm-pipe{opacity:.8}
.cm-mass{fill:#DCD6C7;stroke:#F7F5EE;stroke-width:1;pointer-events:none}
.cm-mass{fill:#D7D1C1;stroke:none}
/* Map-only cartographic visual system. */
.cmap-frame{background:#eeefe9;border-color:#d9ded8;border-radius:12px;isolation:isolate}
.cmap-frame svg{aspect-ratio:1000/520;background:#eeefe9}
.cm-road-edge path{fill:none;stroke:#d9dcd4;stroke-width:11;stroke-linejoin:round}
.cm-road-fill path{fill:none;stroke:#fffefa;stroke-width:8;stroke-linejoin:round}
.cm-roadnames text{font:7.5px "Golos Text",sans-serif;fill:#777f7b;letter-spacing:.15px;paint-order:stroke;stroke:#fffefa;stroke-width:2.5px;pointer-events:none}
.cm-water{fill:#588d9f;font-size:12px}
.cm-park{font-size:8px;letter-spacing:.2px;fill:#658750;paint-order:stroke;stroke:#c9dfb4;stroke-width:2px}
.cm-building-shadow{fill:#aeb3a4;opacity:.3;stroke:none}
.cm-roof{stroke:#b9b7ac;stroke-width:.35}
.cm-roof-detail{stroke:#f6f3eb;stroke-width:.65;fill:none;pointer-events:none}
.cm-home:hover .cm-roof{fill:#f4c77c;stroke:#ac7d3b;stroke-width:1}
.cm-home:hover .cm-building-shadow{fill:#aeb3a4}
.cm-districts text{font-size:8px;letter-spacing:1.6px;fill:#7b8782;opacity:.8;paint-order:stroke;stroke:#eeefe9;stroke-width:2px;pointer-events:none}
.cm-sources{filter:drop-shadow(1px 2px 1px #75776b26);pointer-events:none}
.cm-pipe{paint-order:stroke;filter:drop-shadow(0 1px 0 #fff8)}
svg[data-zoom="in"] .cm-pipeg.minor .cm-pipe{opacity:.68}
.cm-hit{pointer-events:stroke}
.cm-pipeg.dim .cm-hit{pointer-events:stroke}
.cmap-ui button{background:#fff;border:0;box-shadow:0 2px 7px #26362c19}
.cmap-ui button:focus-visible{outline:2px solid #b4472e;outline-offset:3px}
.cmap-layers{gap:5px;left:14px;top:14px}
.cmap-layers button{height:32px;padding:0 13px;border-radius:18px;color:#58635f;font-size:11px}
.cmap-layers button.on{background:#263e36}
.cmap-zoom{border-radius:10px;overflow:hidden;box-shadow:0 3px 14px #26362c20;right:14px;top:14px}
.cmap-zoom button{height:36px;width:36px;box-shadow:none;border-bottom:1px solid #edf0ea}
.cmap-legend{border:0;border-radius:6px;box-shadow:0 2px 10px #26362c12;background:#fffffff2}
.cmap-scale{border-radius:4px;color:#5c6e64}
.cmap-tip{border:0;border-radius:8px;box-shadow:0 4px 20px #26362c26}
@media(max-width:760px){
 .cmap-frame svg,#citymap.full .cmap-frame svg{height:410px;max-height:none;aspect-ratio:auto}
 .cmap-layers{top:12px;bottom:auto;left:10px;right:52px;gap:4px}
 .cmap-layers button{height:36px;padding:0 9px;font-size:10px}
 .cmap-zoom{top:62px;right:10px}
 .cmap-zoom button{width:40px;height:40px}
 .cmap-scale{display:flex;bottom:10px;right:10px}
}
@media(prefers-reduced-motion:reduce){.cmap-frame *{transition:none!important}}
.ins-bars div{grid-template-columns:104px 1fr 34px}
.ins-bars div>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
svg[data-zoom="out"] .cm-stub{display:none}

/* реальная карта OSM */
.cmap-frame svg{max-height:680px;background:#F1EEE5}
#citymap.full .cmap-frame svg{max-height:780px}
.cm-buildings path{pointer-events:none}
.cm-boundary path{stroke:#7E8C74;stroke-width:1.5;stroke-dasharray:9 5;opacity:.9}
.cm-roadnames text{font-size:6.2px;fill:#9A9282;stroke-width:2.6px}
.cm-districts text{font:9px "Golos Text",sans-serif;fill:#9E9584;letter-spacing:2.4px;opacity:.8}
.cm-buildings path{fill:#D6CFBE;stroke:#F6F3EA;stroke-width:.45}
.cm-boundary path{stroke:#8A7F6B;stroke-width:1.1;stroke-dasharray:7 6;opacity:.55}
.cm-roadnames text{fill:#7A7264;font-size:7px;stroke-width:2.2px}
.cmap-frame svg{background:#EFEBE1}
.cm-buildings path{fill:#D3CCBA;stroke:#F3F0E6;stroke-width:.5}
.cm-boundary path{stroke:#6F7F60;stroke-width:1.7;stroke-dasharray:8 5;opacity:.85}
.cm-boundary-label{font:7px "Golos Text",sans-serif;fill:#7D8A6E;letter-spacing:2px;text-transform:uppercase}
.cm-roadnames text{fill:#6E6658;font-size:6.8px}
.cm-districts text{fill:#8B8170;opacity:.75}
.cm-hull{stroke:#6F7F60;stroke-width:2;stroke-dasharray:2 6;opacity:.9}
.cm-boundary path{opacity:.25}
.cm-hull{stroke:#6C7C5C;stroke-width:1.6;stroke-dasharray:1 5;opacity:.8}
.cm-halo{pointer-events:none}
.cm-secondary path{stroke:#A45B43;stroke-width:.9;opacity:.38;fill:none;stroke-linecap:round}
.cm-buildings{filter:drop-shadow(0 0.7px 0 rgba(120,110,90,.20))}
.cm-buildings path{fill:#CEC6B3;stroke:#F4F1E7;stroke-width:.55}
.cm-zones path{fill:#B4472E;fill-opacity:.045;stroke:#9C5138;stroke-width:.8;stroke-dasharray:4 4;stroke-opacity:.45}
.cm-secondary path{stroke:#8E4A36;stroke-width:1.2;opacity:.55}
.cmap-attrib{position:absolute;right:10px;bottom:4px;font:9px "Golos Text",sans-serif;color:#8C8475;background:rgba(255,254,250,.75);padding:1px 4px}
@media (max-width:760px){.cmap-attrib{display:none}}
@media (max-width:760px){.cmap-frame svg{height:330px;max-height:330px}}
.cmap-city{position:absolute;left:50%;top:10px;transform:translateX(-50%);text-align:center;pointer-events:none;background:rgba(255,254,250,.82);border:1px solid rgba(221,215,201,.8);padding:3px 10px 4px}
.cmap-city b{display:block;font:600 10.5px "Golos Text",sans-serif;letter-spacing:2.6px;color:#4E4A41}
.cmap-city span{display:block;font:8px "Golos Text",sans-serif;color:#98907F;letter-spacing:.6px;margin-top:1px}
.cmap-frame:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 55px rgba(80,70,50,.07)}
@media (max-width:760px){.cmap-city{display:none}}
.cm-hull{stroke:#6C7C5C;stroke-width:1.5;stroke-dasharray:6 5;opacity:.75}
.cm-boundary-label{font:6.5px "Golos Text",sans-serif;fill:#6C7C5C;letter-spacing:1.6px;text-transform:uppercase}

/* --- знаки «Чертёж»: rail, KPI, легенда карты --- */
.rail button{display:flex;align-items:center;gap:10px}
.rail button .rail-i{color:var(--ink-3);flex:0 0 18px}
.rail button[aria-current="true"] .rail-i{color:var(--accent)}
.kpis span{display:flex;align-items:center;gap:6px}
.kpis .kpi-i{color:var(--ink-3);flex:0 0 16px}
.cmap-legend .lg-i{color:var(--ink-2);vertical-align:-2px;margin-right:4px}
.sec-i{color:var(--ink-3);vertical-align:-3px;margin-right:7px}
.lossline .loss-i{color:var(--accent);vertical-align:-5px;margin-right:8px}
.lossline span:first-child{display:inline-flex;align-items:center}
.rail button .rail-i{--sw:1.5}
.sec-i{--sw:1.45}
.cmap-legend .lg-i{--sw:1.6}
.lossline .loss-i{--sw:1.45}

.rail-i,.sec-i,.lg-i,.loss-i{stroke-width:var(--sw,1.35)}
.rail-i,.sec-i,.lg-i,.loss-i{display:inline-block;flex:none;stroke-width:var(--sw,1.35)}
.rail-i{width:18px;height:18px}
.sec-i{width:16px;height:16px;vertical-align:-3px;margin-right:7px}
.lg-i{width:14px;height:14px;vertical-align:-2px;margin-right:4px}
.loss-i{width:22px;height:22px;vertical-align:-6px;margin-right:8px;color:var(--accent)}
.chart svg.sec-i,.chart svg.lg-i,.chart svg.rail-i,.chart svg.loss-i{width:16px;height:16px;display:inline-block}
.chart svg.lg-i{width:14px;height:14px}
.loss-i{color:var(--ink-2)}
.cmap-legend .lg-i{--sw:1.7}
/* в служебной графике акцент не краснеет: только у активного пункта */
.rail-i,.lg-i{--acc:currentColor}
.rail button[aria-current="true"] .rail-i{--acc:#B0431F}
.rail-i{--sw:1.45}
.sec-i{--sw:1.4}
.lg-i{--sw:1.55}
.loss-i{--sw:1.4}

/* --- v10: карта и мобильный в бумажной системе --- */
.cmap-frame{border-radius:2px}
.cmap-ui button{border-radius:2px;box-shadow:none;border:1px solid #DCDCD6;color:#17191B}
.cmap-layers button{border-radius:2px;border:1px solid #DCDCD6;background:#fff;color:#17191B;height:34px}
.cmap-layers button.on{background:#17191B;color:#fff}
.cmap-zoom{border-radius:2px;box-shadow:none;border:1px solid #DCDCD6}
.cmap-zoom button{border-bottom:1px solid #EDEDE8}
.cmap-legend{border-radius:2px;box-shadow:none;border:1px solid #DCDCD6;background:#fffefa}
.cmap-tip{border-radius:2px;box-shadow:0 6px 18px #17191b1a;border:1px solid #DCDCD6}
.cmap-scale{border-radius:2px}
.cm-sources{filter:none}
.cm-pipe{filter:none}
.cm-home:hover .cm-roof{fill:#F0E2DA;stroke:#B0431F;stroke-width:.8}
.rail-i,.sec-i,.lg-i,.loss-i{stroke-width:1.4}
.cmap-legend .lg-i{stroke-width:1.5}
#heat{max-width:760px}
.rail button{min-height:38px}
@media (max-width:900px){
  .kpis div:last-child{grid-column:1/-1;border-right:0}
  .rail{overflow-x:auto;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .rail button{min-height:44px;padding-right:14px}
  .rail::-webkit-scrollbar{height:3px}
  .rail::-webkit-scrollbar-thumb{background:#c9cfc9}
  .cmap-legend{display:flex;flex-wrap:wrap;font-size:9.5px;padding:5px 7px;gap:6px;max-width:calc(100% - 24px)}
  .cmap-legend .sep{display:none}
}

/* --- карта: расширенные фильтры и панели --- */
.fbar2{margin-top:-8px}
.fbar2 label{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--ink-2)}
.fbar2 input[type=number]{width:64px;height:30px;border:1px solid var(--line);background:#fff;padding:0 6px;font:inherit;font-size:12px;border-radius:0}
.fbar2 label.chk{gap:7px}
.fbar2 input[type=checkbox]{width:15px;height:15px;accent-color:#B0431F}
.panel-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;margin:18px 0 0}
.panel{border:1px solid var(--line);background:#fffefa;padding:14px 16px}
.panel h2{font-size:13px;margin:0 0 10px;font-weight:600;display:flex;align-items:center;gap:8px}
.prow{display:grid;grid-template-columns:96px 46px 1fr auto;gap:8px;align-items:baseline;padding:5px 0;border-bottom:1px solid var(--line-soft);font-size:12px;color:var(--ink-2)}
.prow b{font-size:13px;color:var(--ink);font-variant-numeric:tabular-nums}
.pbar{display:flex;height:8px;margin:10px 0 6px;background:var(--line-soft)}
.pbar i{display:block;height:100%;background:#B0431F}
.wx{display:flex;align-items:flex-end;gap:4px;height:76px;margin:6px 0 10px}
.wx-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px}
.wx-col i{width:100%;display:block}
.wx-col b{font-size:9px;color:var(--ink-2);font-weight:500}
.wx-col span{font-size:8.5px;color:var(--ink-3)}
.cm-density rect{pointer-events:none}
@media(max-width:900px){.panel-grid{grid-template-columns:1fr}.fbar2{gap:8px}}
.cmap-legend{bottom:42px}
.cm-heatlabels text{font:9px "Golos Text",sans-serif;letter-spacing:.06em;fill:#4C5B55;text-transform:uppercase}
.cm-density{pointer-events:none}

/* ===== v11: обзор, распределение вероятностей, ячейки, отчёты ===== */
.rail-group{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);padding:14px 10px 6px}
.rail-group:first-child{padding-top:2px}
.ov-grid{display:grid;grid-template-columns:minmax(0,1fr) 272px;gap:34px;align-items:start;margin-top:22px}
.ov-side{display:flex;flex-direction:column;gap:14px}
.side-card{border:1px solid var(--line);background:var(--surface);padding:14px 15px 16px}
.side-card .kick{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.side-code{font-size:22px;font-weight:600;letter-spacing:-.01em;margin:4px 0 2px}
.side-prob{font-size:30px;line-height:34px;font-weight:600;color:var(--accent);letter-spacing:-.02em}
.side-prob span{display:block;font-size:11px;line-height:15px;font-weight:400;color:var(--ink-3);letter-spacing:0;margin-top:1px}
.side-card dl{margin:10px 0 12px;border-top:1px solid var(--line-soft)}
.side-card dl div{display:flex;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px solid var(--line-soft);font-size:12px}
.side-card dt{color:var(--ink-3);margin:0}
.side-card dd{margin:0;text-align:right}

.chart.prob .chart-top{align-items:flex-start;gap:16px}
.chart.prob .chart-top .sub{margin:3px 0 0}
.prob-legend{display:flex;gap:14px;align-items:center;font-size:11px;color:var(--ink-2);white-space:nowrap;padding-top:4px}
.prob-legend .sw{display:inline-block;width:10px;height:10px;margin-right:5px;vertical-align:-1px}
.prob-legend .sw.all{background:#C9C4B8}
.prob-legend .sw.prog{background:var(--accent)}
.chart.prob svg{margin-top:6px;overflow:visible}
.chart .pbar{cursor:pointer}
.chart .pbar.all{fill:#C9C4B8}
.chart .pbar.prog{fill:var(--accent)}
.chart .pbar:hover{fill:var(--ink)}
.chart .blabel{font-size:9.5px;fill:var(--ink-2)}
.chart .xlab{font-size:10px}
.prob-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;border-top:1px solid var(--line);margin-top:8px;padding-top:12px}
.prob-stats span{display:block;font-size:11px;color:var(--ink-3)}
.prob-stats b{display:block;font-size:19px;line-height:24px;font-weight:600;margin:2px 0}
.prob-stats small{display:block;font-size:10.5px;line-height:14px;color:var(--ink-3)}

.cols.three{grid-template-columns:1fr 1fr 1fr;gap:26px;margin-top:20px}
.mini-panel h2{margin:0 0 10px}
.mini-panel .kv div{grid-template-columns:96px 1fr}
.mini-panel .kv dd small{display:block;color:var(--ink-3);font-size:11px}
.climate{display:grid;grid-template-columns:repeat(12,1fr);gap:3px;align-items:end;height:96px;margin:2px 0 8px}
.cl-col{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;min-width:0}
.cl-col i{display:block;width:100%;max-width:14px}
.cl-col i.neg{background:#426F84}
.cl-col i.pos{background:#B0431F}
.cl-v{font-size:8.5px;line-height:11px;color:var(--ink-3);height:11px;white-space:nowrap}
.cl-m{font-size:9px;color:var(--ink-3);margin-top:4px}
.cl-foot{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:10.5px;color:var(--ink-3);border-top:1px solid var(--line-soft);padding-top:7px}
.cl-foot b{color:var(--ink);font-weight:600}

.filterbar.slim{padding:0 0 12px}
.filterbar.slim label{font-size:10.5px}
.filterbar.slim select,.filterbar.slim input{height:28px}

.cmap-gridctl{position:absolute;left:14px;bottom:52px;background:rgba(255,255,255,.95);border-radius:8px;box-shadow:0 2px 10px #26362c1a;padding:7px 9px;pointer-events:auto;display:flex;flex-direction:column;gap:5px;max-width:calc(100% - 28px)}
.cmap-gridctl .row{display:flex;align-items:center;gap:5px;flex-wrap:wrap;font:10px "Golos Text",sans-serif;color:#5c6e64}
.cmap-gridctl .row>span{margin-right:3px;color:#7d8a84}
.cmap-gridctl button{height:22px;padding:0 8px;border-radius:11px;border:1px solid #e2e6df;background:#fff;color:#58635f;font:10px "Golos Text",sans-serif;cursor:pointer}
.cmap-gridctl button.on{background:#263e36;border-color:#263e36;color:#fff}
.cmap-gridctl label{display:flex;align-items:center;gap:3px;cursor:pointer;white-space:nowrap}
.cmap-gridctl input{margin:0;width:11px;height:11px;accent-color:#B0431F}
.cm-cell{cursor:pointer;transition:fill-opacity .12s linear}
.cm-cell:hover{fill-opacity:.72!important;stroke:#8E2E19;stroke-width:1.2}
.cm-cell.sel{stroke:#17191B;stroke-width:1.6;fill-opacity:.66!important}
.cm-gridline{stroke:#8E2E19;stroke-opacity:.14;stroke-width:.7;pointer-events:none}
.cm-celllabels text{font:8.5px "Golos Text",sans-serif;fill:#3c4a44;paint-order:stroke;stroke:#FFFEFA;stroke-width:2.4px;stroke-linejoin:round;pointer-events:none;opacity:.9}

.ins-prob{display:flex;justify-content:space-between;gap:14px;align-items:flex-end;border:1px solid var(--line-soft);background:#FBFAF7;padding:10px 12px;margin:10px 0 2px}
.ins-prob b{display:block;font-size:28px;line-height:32px;font-weight:600;color:var(--accent);letter-spacing:-.02em}
.ins-prob span{display:block;font-size:10.5px;color:var(--ink-3)}
.ins-prob small{font-size:10.5px;line-height:15px;color:var(--ink-3);text-align:right}

.report-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.report-card{border:1px solid var(--line);background:var(--surface);padding:14px 15px 16px;display:flex;flex-direction:column;gap:6px}
.report-card b{font-size:14px}
.report-card p{margin:0;font-size:12px;line-height:17px;color:var(--ink-2);flex:1}
.report-card .btn{align-self:flex-start}
.report-body:empty{display:none}
.report-toolbar{display:flex;align-items:center;gap:8px;border-top:1px solid var(--line);padding-top:14px;margin-bottom:12px}
.report-toolbar span{font-size:12px;color:var(--ink-3);margin-right:auto}
.report-sheet{background:#fff;border:1px solid var(--line);padding:28px 30px 30px;max-width:980px}
.report-sheet .r-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:8px}
.report-sheet .r-brand{font-weight:600}
.report-sheet .r-meta{font-size:10.5px;line-height:15px;color:var(--ink-3);text-align:right}
.report-sheet h1{font-size:21px;line-height:27px;margin:14px 0 2px;letter-spacing:-.01em}
.report-sheet .r-sub{margin:0 0 10px;color:var(--ink-2);font-size:12.5px}
.report-sheet .r-kpi{display:flex;gap:34px;margin:12px 0 16px}
.report-sheet .r-kpi span{display:block;font-size:10.5px;color:var(--ink-3)}
.report-sheet .r-kpi b{font-size:17px;font-weight:600}
.report-sheet table{width:100%;border-collapse:collapse;font-size:11px}
.report-sheet th,.report-sheet td{text-align:left;padding:5px 7px;border-bottom:1px solid var(--line-soft);font-variant-numeric:tabular-nums}
.report-sheet th{background:#F6F5F1;font-weight:500;color:var(--ink-2)}
.report-sheet .r-note{font-size:10.5px;color:var(--ink-3);margin-top:10px}

@media (max-width:1100px){.ov-grid{grid-template-columns:1fr;gap:24px}.ov-side{flex-direction:row;flex-wrap:wrap}.side-card{flex:1 1 240px}.cols.three{grid-template-columns:1fr 1fr}.report-grid{grid-template-columns:1fr 1fr}}
@media (max-width:760px){.prob-stats{grid-template-columns:1fr 1fr}.cols.three{grid-template-columns:1fr}.report-grid{grid-template-columns:1fr}.cmap-gridctl{bottom:8px;left:8px;right:8px;max-width:none}.cm-celllabels text{opacity:0}}
@media print{.rail,.topbar,.banner,.report-grid,.report-toolbar{display:none!important}main{padding:0}.report-sheet{border:0;padding:0;max-width:none}}

/* карта v11: высота задаётся контейнером, viewBox подгоняется под пропорции */
.map-wrap .cmap-frame{height:560px}
#citymap.full .cmap-frame{height:640px}
.cmap-frame svg,#citymap.full .cmap-frame svg{width:100%;height:100%;max-height:none;aspect-ratio:auto}
.cm-gridline{stroke:#5A4A42;stroke-opacity:.30;stroke-width:1.1}
.cm-celllabels text{font-size:10.5px;stroke-width:0}
.cm-celllab rect{fill:#FFFEFA;fill-opacity:.72}
.cmap-gridleg{position:absolute;right:14px;bottom:44px;display:flex;align-items:center;gap:6px;font:10px "Golos Text",sans-serif;color:#5c6e64;background:#fffffff0;border-radius:6px;padding:5px 8px;box-shadow:0 2px 10px #26362c12}
.cmap-gridleg i{display:block;width:54px;height:7px;background:linear-gradient(90deg,#F6EFEA,#C08A72,#8E2E19);border-radius:2px}
.cmap-gridleg b{font-weight:500;color:#263e36}
@media(max-width:760px){.map-wrap .cmap-frame,#citymap.full .cmap-frame{height:380px}.cmap-gridleg{display:none}}

/* обзор: карта слева, распределение справа */
.ov-top{display:grid;grid-template-columns:minmax(0,1fr) 392px;gap:30px;align-items:start}
.ov-map .map-wrap{margin-top:0}
.ov-side{display:flex;flex-direction:column;gap:16px}
.ov-side .chart.prob-h{border:1px solid var(--line);background:var(--surface);padding:14px 16px 12px;margin:0}
.ov-side .map-wrap .cmap-frame{height:604px}
.ph-head{display:grid;grid-template-columns:44px 1fr 40px 40px;gap:8px;font-size:9.5px;color:var(--ink-3);border-bottom:1px solid var(--line-soft);padding-bottom:4px;margin-bottom:6px}
.ph-head .ph-scale{text-align:right}
.ph-row{display:grid;grid-template-columns:44px 1fr 40px 40px;gap:8px;align-items:center;padding:3px 0;cursor:pointer}
.ph-row:hover .ph-bars i.all{background:var(--ink-2)}
.ph-lab{font-size:10.5px;color:var(--ink-2);font-variant-numeric:tabular-nums}
.ph-bars{display:flex;flex-direction:column;gap:2px;min-width:0}
.ph-bars i{display:block;height:7px;background:#D5CFC1;min-width:1px}
.ph-bars i.prog{height:4px;background:var(--accent)}
.ph-n{font-size:10.5px;text-align:right;color:var(--ink-2);font-variant-numeric:tabular-nums}
.ph-n.prog{color:var(--accent)}
.chart.prob-h .prob-legend{margin-top:10px;padding-top:8px;border-top:1px solid var(--line-soft)}
.prob-stats.two{grid-template-columns:1fr 1fr;margin-top:10px}
.chart.prob-h .fine{margin-top:8px}
@media (max-width:1240px){.ov-top{grid-template-columns:minmax(0,1fr) 340px}.ov-side .map-wrap .cmap-frame{height:560px}}
@media (max-width:1000px){.ov-top{grid-template-columns:1fr}.ov-side .map-wrap .cmap-frame{height:520px}}

.dragging .cm-buildings,.dragging .cm-grid,.dragging .cm-celllabels,.dragging .cm-roadnames,.dragging .cm-districts{display:none}

.map-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:9px 0;margin:0 0 6px}
.mt-legend{display:flex;align-items:center;gap:12px;font-size:10.5px;color:var(--ink-3);flex-wrap:wrap}
.mt-legend b{font-weight:500;color:var(--ink-2)}
.mt-legend i{display:inline-block;width:16px;height:3px;margin-right:4px;vertical-align:middle}
.mt-legend .sep{width:1px;height:11px;background:var(--line)}
.mt-controls{display:flex;align-items:center;gap:14px;margin-left:auto;flex-wrap:wrap}
.mt-chk{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--ink-2);cursor:pointer;white-space:nowrap}
.mt-chk input,.mt-labels input{width:12px;height:12px;margin:0;accent-color:B0431F;accent-color:#B0431F}
.mt-seg{display:flex;gap:0;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.mt-seg button{height:25px;padding:0 10px;border:0;background:none;font-size:10.5px;color:var(--ink-3);cursor:pointer;border-right:1px solid var(--line)}
.mt-seg button:last-child{border-right:0}
.mt-seg button.on{background:var(--ink);color:#fff}
.mt-labels{display:flex;align-items:center;gap:10px;font-size:10.5px;color:var(--ink-2);flex-wrap:wrap}
.mt-labels label{display:flex;align-items:center;gap:4px;cursor:pointer;white-space:nowrap}
.mt-cap{color:var(--ink-3)}
@media (max-width:900px){.mt-controls{margin-left:0}.mt-legend{display:none}}
.ph-bars i.all{position:relative;height:12px;background:#DDD8CB}
.ph-bars i.all b.prog{position:absolute;left:0;top:0;bottom:0;background:var(--accent);display:block}
.ph-row:hover .ph-bars i.all{background:#CFC9BA}
.chat-form{display:flex;align-items:center;gap:6px}
.chat-form input{flex:1}
.mic{width:30px;height:30px;border:1px solid var(--line);background:var(--surface);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink-2);cursor:pointer;flex:0 0 auto}
.mic:hover{border-color:var(--accent);color:var(--accent)}
.mic.rec{background:var(--accent);border-color:var(--accent);color:#fff;animation:micpulse 1.2s infinite}
.mic.off{opacity:.45}
@keyframes micpulse{0%{box-shadow:0 0 0 0 rgba(176,67,31,.35)}70%{box-shadow:0 0 0 8px rgba(176,67,31,0)}100%{box-shadow:0 0 0 0 rgba(176,67,31,0)}}
#citymap{height:560px}
#citymap.full{height:640px}
#citymap .cmap-frame{height:100%}
@media(max-width:760px){#citymap,#citymap.full{height:380px}}

.cm-cell{stroke:#B3ADA0;stroke-width:.7;stroke-opacity:.55}
.cm-cell.sel{stroke:#17191B;stroke-width:2;stroke-opacity:1}

/* итерация 2 */
.ov-top{grid-template-columns:minmax(0,1fr) 366px;gap:24px}
.ov-side .map-wrap .cmap-frame{height:auto}
.ov-map #citymap{height:500px}
.ph-toggle{display:flex;border:1px solid var(--line);border-radius:13px;overflow:hidden;flex:0 0 auto}
.ph-toggle button{height:24px;padding:0 9px;border:0;background:none;font-size:10px;color:var(--ink-3);cursor:pointer}
.ph-toggle button.on{background:var(--ink);color:#fff}
.ph-head{position:relative}
.ph-scale{position:relative;height:14px;display:block}
.ph-scale i{position:absolute;top:2px;transform:translateX(-50%);font-style:normal;font-size:9px;color:var(--ink-3);white-space:nowrap}
.ph-scale i:first-child{transform:none}
.ph-scale i:last-child{transform:translateX(-100%)}
.ph-bars.share{gap:3px}
.ph-bars.share i.all{background:#CFC9BA;height:7px}
.ph-bars.share i.prog{background:var(--accent);height:5px}
.prob-method{margin-top:8px;font-size:10.5px;color:var(--ink-3)}
.prob-method summary{cursor:pointer;color:var(--ink-2)}
.prob-method p{margin:6px 0 0;line-height:15px}
.mt-fill{display:flex;align-items:center;gap:6px}
.mt-fill .grad{display:inline-block;width:46px;height:6px;background:linear-gradient(90deg,#F6EFEA,#C08A72,#8E2E19);border-radius:2px}
.mt-legend .mt-fill b{font-weight:500;color:var(--ink-2)}
@media (max-width:1240px){.ov-top{grid-template-columns:minmax(0,1fr) 330px}}
.report-tabs{display:flex;gap:0;border-bottom:1px solid var(--line);margin:0 0 16px;flex-wrap:wrap}
.report-tabs button{border:0;background:none;padding:8px 14px;font-size:12.5px;color:var(--ink-3);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.report-tabs button.on{color:var(--ink);border-bottom-color:var(--accent);font-weight:600}
.ins-method{margin-top:14px;border-top:1px solid var(--line-soft);padding-top:10px}
.ins-method summary{cursor:pointer;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3)}
.ins-method .ins-bars{margin-top:10px}
.chart.prob-h h2{font-size:15px;line-height:20px}
.chart.prob-h .chart-top{gap:10px}
.ov-side .side-card dl{margin-bottom:10px}
.cm-cell{pointer-events:all}
.cm-source{pointer-events:none}
