:root{
  --bg:#f3f4f6;--panel:#fff;--ink:#111827;--ink2:#374151;--muted:#6b7280;--line:#e5e7eb;--line2:#f1f2f4;
  --accent:#2563eb;--ok:#15803d;--warn:#b45309;--bad:#b91c1c;--r:10px;
  --c-rot:#8e97c8;--c-s1:#c99a72;--c-s2:#74b29a;--c-hs:#c27f90;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font:14px/1.45 Inter,system-ui,-apple-system,sans-serif}
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-variant-numeric:tabular-nums}

/* header */
header.top{display:flex;align-items:center;gap:16px;padding:10px 16px;background:#fff;border-bottom:1px solid var(--line);flex-wrap:wrap;position:sticky;top:0;z-index:20}
.brand{display:flex;gap:10px;align-items:center}
.brand svg{flex:none}
.brand b{display:block;font-size:15px;letter-spacing:-.01em}
.brand span{font-size:12px;color:var(--muted)}
.loc{display:flex;gap:8px;align-items:center;flex:1;min-width:220px;font-size:13px}
.loc span{color:var(--muted)}
.dot{width:8px;height:8px;border-radius:50%;background:#9ca3af;flex:none}
.dot.live{background:#16a34a;box-shadow:0 0 0 3px #dcfce7}
.dot.err{background:var(--bad);box-shadow:0 0 0 3px #fee2e2}
.ctrls{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ctrls label{font-size:11.5px;color:var(--muted);font-weight:600}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.seg button{border:0;background:#fff;font:inherit;font-size:12.5px;font-weight:600;color:var(--ink2);padding:6px 10px;cursor:pointer;border-right:1px solid var(--line)}
.seg button:last-child{border-right:0}
.seg button.on{background:var(--ink);color:#fff}
.wind{display:flex;align-items:center;gap:8px}
.wind input{width:150px;accent-color:var(--accent)}
.wind.off input{opacity:.45;pointer-events:none}

/* layout */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:12px;padding:12px;max-width:1760px;margin:0 auto;align-items:start}
.main{display:flex;flex-direction:column;gap:12px;min-width:0}
.viewport{position:relative;height:min(calc(100vh - 250px),760px);min-height:500px;border-radius:var(--r);overflow:hidden;border:1px solid var(--line);background:linear-gradient(#8fb8e3,#b9d4ee 55%,#c9dcec)}
.viewport.night{background:linear-gradient(#1b2436,#2f3a4f 60%,#3a4356)}
.three{position:absolute;inset:0}
.three canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
.partbar{position:absolute;left:10px;top:10px;right:10px;display:flex;gap:6px;flex-wrap:wrap;z-index:3;pointer-events:none}
.partbar button{pointer-events:auto;border:1px solid rgba(17,24,39,.08);background:rgba(255,255,255,.93);backdrop-filter:blur(6px);font:inherit;font-size:12.5px;font-weight:600;color:var(--ink2);padding:6px 10px;border-radius:7px;cursor:pointer}
.partbar button:hover{background:#fff}
.partbar button.on{background:var(--ink);color:#fff}
.hud{position:absolute;left:10px;bottom:10px;right:10px;display:flex;gap:8px;z-index:3;flex-wrap:wrap;pointer-events:none}
.chip{background:rgba(255,255,255,.94);border:1px solid rgba(17,24,39,.08);border-radius:7px;padding:6px 10px;font-size:12.5px;color:var(--ink2)}
.chip b{color:var(--ink);font-weight:700}
.tip{position:absolute;left:0;top:0;display:none;pointer-events:none;background:#111827;color:#fff;border-radius:7px;padding:6px 9px;font-size:12px;transform:translate(14px,14px);z-index:6;max-width:300px}
.tip b{display:block;font-size:12.5px}
.tip span{color:#cbd5e1}
.tags{position:absolute;inset:0;pointer-events:none;z-index:4;overflow:hidden}
.tag{position:absolute;left:0;top:0;display:none;background:#fff;border:1px solid var(--line);border-left:4px solid #9ca3af;border-radius:6px;padding:3px 7px;font:600 11.5px 'JetBrains Mono',monospace;white-space:nowrap;color:var(--ink)}
.tag.c-rot{border-left-color:var(--c-rot)}.tag.c-s1{border-left-color:var(--c-s1)}.tag.c-s2{border-left-color:var(--c-s2)}.tag.c-hs{border-left-color:var(--c-hs)}

/* side */
.side{display:flex;flex-direction:column;gap:12px;min-width:0}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px}
.panel h2{font-size:16px;margin:0;letter-spacing:-.01em}
.panel h3{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin:16px 0 6px;font-weight:700}
.ph{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.ph p{margin:2px 0 0;color:var(--muted);font-size:12.5px}
.big{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}
.big .l{font-size:12px;color:var(--muted);font-weight:600}
.big .v{font:600 30px/1.1 'JetBrains Mono',monospace;letter-spacing:-.02em}
.big .v small{font-size:15px;color:var(--muted)}
.bar{height:6px;background:#eef0f3;border-radius:3px;overflow:hidden;margin-top:8px}
.bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .6s}
.kgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.k{border:1px solid var(--line2);background:#fafbfc;border-radius:8px;padding:8px;min-width:0}
.k .l{font-size:11px;color:var(--muted);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k .v{font:600 13px 'JetBrains Mono',monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k .s{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.status{margin-top:10px;font-size:12.5px;color:var(--ink2);padding:8px 10px;background:#f8fafc;border-radius:8px;border:1px solid var(--line2)}
table.kv{width:100%;border-collapse:collapse;font-size:12.5px}
table.kv td{padding:5px 0;border-bottom:1px solid var(--line2);vertical-align:top}
table.kv td:last-child{text-align:right;font-family:'JetBrains Mono',monospace;font-size:12px;padding-left:8px}
.badge{display:inline-block;font:700 9.5px Inter,sans-serif;padding:1px 5px;border-radius:4px;margin-left:6px;vertical-align:1px;letter-spacing:.02em}
.b-N{background:#e0e7ff;color:#3730a3}.b-H{background:#dcfce7;color:#166534}.b-T{background:#fef3c7;color:#92400e}.b-R{background:#f3f4f6;color:#4b5563}
.srckey{font-size:11px;color:var(--muted);margin-top:8px;display:flex;gap:10px;flex-wrap:wrap}
ul.why{margin:0;padding-left:18px;font-size:13px;color:var(--ink2)}
ul.why li{margin:6px 0}
.btn{border:1px solid var(--ink);background:var(--ink);color:#fff;font:inherit;font-size:12.5px;font-weight:600;padding:7px 11px;border-radius:7px;cursor:pointer;white-space:nowrap}
.btn.ghost{background:#fff;color:var(--ink);border-color:var(--line)}
.search{position:relative;margin-bottom:8px}
.search input{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit;outline:none}
.search input:focus{border-color:var(--accent)}
.results{position:absolute;left:0;right:0;top:100%;margin-top:4px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.08);z-index:1000;display:none;overflow:hidden}
.results button{display:block;width:100%;text-align:left;border:0;background:#fff;padding:8px 10px;font:inherit;font-size:13px;cursor:pointer}
.results button:hover{background:#f5f7fb}
.results small{color:var(--muted)}
#map{height:230px;border-radius:8px;border:1px solid var(--line);z-index:0}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.chips button{border:1px solid var(--line);background:#fff;font:inherit;font-size:12px;padding:4px 8px;border-radius:6px;cursor:pointer;color:var(--ink2)}
.hint{font-size:12px;color:var(--muted);margin-top:6px}

/* forecast */
.fc-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap}
.fc-head .tot{font:600 22px 'JetBrains Mono',monospace}
#chart{width:100%;height:170px;display:block;margin-top:8px}
.eq{display:flex;gap:18px;flex-wrap:wrap;font-size:12.5px;color:var(--ink2);margin-top:6px}
.eq b{font-family:'JetBrains Mono',monospace}
.foot{font-size:11.5px;color:var(--muted);margin-top:10px}
.foot a{color:inherit}

/* drawing modal */
.modal{position:fixed;inset:0;background:rgba(17,24,39,.55);z-index:50;display:flex;align-items:center;justify-content:center;padding:14px}
.modal[hidden]{display:none}
.mwin{background:#fff;border-radius:12px;width:min(1440px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.3)}
.mhead{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);gap:8px;flex-wrap:wrap}
.mhead b{font-size:14px;margin-right:6px}
.mbody{overflow:auto;background:#eef0f3;padding:10px}
.mbody .sheet{min-width:980px;width:100%;height:auto;display:block;box-shadow:0 2px 10px rgba(0,0,0,.08);border-radius:4px}
.mbody.zoom .sheet{min-width:2100px}

/* sheet styles */
.sheet text{font-family:Inter,sans-serif;paint-order:stroke;stroke:#fcfcfd;stroke-width:4px;stroke-linejoin:round}
.sheet .frame{fill:none;stroke:#1f2937;stroke-width:2.4}
.sheet .ln{fill:none;stroke:#1f2937;stroke-width:1.5;stroke-linejoin:round}
.sheet .lnf{fill:#eef1f5;stroke:#1f2937;stroke-width:1.5;stroke-linejoin:round}
.sheet .lnf2{fill:#e2e7ee;stroke:#1f2937;stroke-width:1.5}
.sheet .lnw{fill:#fff;stroke:#1f2937;stroke-width:1.2}
.sheet .thin{fill:none;stroke:#1f2937;stroke-width:.8}
.sheet .hd{fill:none;stroke:#1f2937;stroke-width:1;stroke-dasharray:7 4}
.sheet .cl{fill:none;stroke:#be123c;stroke-width:.9;stroke-dasharray:18 4 3 4}
.sheet .cut{fill:none;stroke:#1f2937;stroke-width:2.4;stroke-dasharray:18 4 3 4}
.sheet .cutk{fill:none;stroke:#1f2937;stroke-width:3}
.sheet .dm{fill:none;stroke:#2563eb;stroke-width:.9}
.sheet .rot{fill:none;stroke:#be123c;stroke-width:2}
.sheet .hatch{fill:url(#hatch);stroke:#1f2937;stroke-width:1.1}
.sheet .soil{fill:url(#hatch);stroke:none;opacity:.5}
.sheet .solid,.sheet .fillk,.sheet .dot,.sheet .dk1{fill:#1f2937;stroke:none}
.sheet .dk2{fill:#be123c;stroke:none}
.sheet .zr{stroke:#1f2937;stroke-width:.7}
.sheet .lep{fill:none;stroke:#be123c;stroke-width:5;stroke-linecap:round;opacity:.65}
.sheet .grid2{stroke:#e5e9ef;stroke-width:.8}
.sheet .pl1{fill:none;stroke:#1f2937;stroke-width:2}
.sheet .pl2{fill:none;stroke:#be123c;stroke-width:2;stroke-dasharray:7 4}
.sheet .pl3{fill:none;stroke:#c99a72;stroke-width:3}.sheet .pl4{fill:none;stroke:#74b29a;stroke-width:3}.sheet .pl5{fill:none;stroke:#c27f90;stroke-width:3}
.sheet .p1{fill:#f1d2b3;stroke:#1f2937;stroke-width:1.1}.sheet .p2{fill:#d9d3ef;stroke:#1f2937;stroke-width:1.1}
.sheet .p3{fill:#d6e4f2;stroke:#1f2937;stroke-width:1.1}.sheet .p4c{fill:#be123c;stroke:#1f2937;stroke-width:1}
.sheet .p5{fill:#e7e3dc;stroke:#1f2937;stroke-width:1.1}.sheet .p6{fill:#cfe6dc;stroke:#1f2937;stroke-width:1.1}
.sheet .p7{fill:#efe2b8;stroke:#1f2937;stroke-width:1.1}
.sheet .pr{fill:#cdd1ec;stroke:#1f2937;stroke-width:1.1}.sheet .pc{fill:#c8ccd3;stroke:#1f2937;stroke-width:1.1}
.sheet .pring{fill:#dfe3e9;stroke:#1f2937;stroke-width:1}.sheet .ppl{fill:#cddbea;stroke:#1f2937;stroke-width:.8}
.sheet .ps1{fill:#ead5c1;stroke:#1f2937;stroke-width:.8}.sheet .ps2{fill:#cfe3da;stroke:#1f2937;stroke-width:.8}
.sheet .phs{fill:#ecd0d7;stroke:#1f2937;stroke-width:.8}.sheet .pgen{fill:#d5d9e2;stroke:#1f2937;stroke-width:1}
.sheet .pwhite{fill:#fcfcfd;stroke:#1f2937;stroke-width:.8}
.sheet .tx{font-size:13px;font-weight:600;fill:#1f2937}
.sheet .dt{font-size:12.5px;font-weight:700;fill:#2563eb}
.sheet .dt2{font-size:12.5px;font-weight:700;fill:#be123c}
.sheet .vt{font-size:15px;font-weight:700;fill:#111827}
.sheet .sm{font-size:11px;font-weight:600;fill:#6b7280}
.sheet .tb{fill:#fff;stroke:none}.sheet .tbh{fill:#f1f4f8;stroke:none}.sheet .tbh2{fill:#fff4e5;stroke:none}
.sheet .tbo{fill:none;stroke:#1f2937;stroke-width:1.1}
.sheet .tl{stroke:#1f2937;stroke-width:.5}
.sheet .th{font-size:11px;font-weight:700;fill:#111827}
.sheet .td{font-size:11px;font-weight:500;fill:#1f2937}
.sheet .tb2{fill:#fff;stroke:#1f2937;stroke-width:2}
.sheet .tk{font-size:9.5px;font-weight:700;fill:#6b7280;letter-spacing:.5px}
.sheet .tn{font-size:15px;font-weight:700;fill:#111827}
.sheet .tv{font-size:12px;font-weight:600;fill:#1f2937}
.sheet .bal{fill:#fff;stroke:#1f2937;stroke-width:1.2}
.sheet .bn{font-size:12px;font-weight:700;fill:#1f2937;text-anchor:middle}

@media print{
  body>*:not(.modal){display:none!important}
  .modal{position:static;background:none;padding:0}
  .mwin{box-shadow:none;border-radius:0}.mhead{display:none}
  .mbody{padding:0;background:none;overflow:visible}.mbody .sheet{min-width:0;box-shadow:none}
}
@media(max-width:1050px){
  .layout{grid-template-columns:1fr}
  .viewport{height:62vh;min-height:420px}
}
@media(max-width:560px){
  header.top{padding:10px 12px}
  .kgrid{grid-template-columns:1fr 1fr}
  .wind input{width:110px}
}

#map .leaflet-tile-pane{filter:grayscale(.7) contrast(.95) brightness(1.03)}
.sheet .pfoam{fill:#f6e7a8;stroke:#1f2937}.sheet .pte{fill:#bfe3cc;stroke:#1f2937}

/* ---- Cem (teknisyen) konuşma balonu ---- */
.cem-bubble{position:absolute;left:0;top:0;z-index:5;pointer-events:none;background:#fff;color:var(--ink);font-weight:700;font-size:14px;padding:8px 13px;border-radius:14px;box-shadow:0 6px 18px rgba(0,0,0,.15);white-space:nowrap;margin-top:-10px}
.cem-bubble:after{content:"";position:absolute;left:50%;bottom:-7px;transform:translateX(-50%);border:7px solid transparent;border-top-color:#fff;border-bottom:0}
.cem-bubble[hidden]{display:none}
