:root{--bg:#fff;--fg:#1a1a1a;--muted:#5c5c5c;--line:#d0d0d0;--accent:#b3121f;--bad:#a3000f;--panel:#f6f6f6;--terrain:#c9b48f;--pressure:#1f5fd1;--pump:#b3121f}
@media (prefers-color-scheme:dark){:root{--bg:#121212;--fg:#ececec;--muted:#b0b0b0;--line:#3a3a3a;--accent:#ff5c66;--bad:#ff7b84;--panel:#1d1d1d;--terrain:#7a6a4d;--pressure:#7fa8ff;--pump:#ff5c66}}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0}
body{font:16px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--fg)}
a{color:inherit}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.bar{display:flex;align-items:center;gap:12px;padding:8px max(12px,env(safe-area-inset-left));background:var(--accent);color:#fff}
.brand{font-weight:700;text-decoration:none;color:#fff;font-size:17px}
.bar-title{flex:1;font-size:17px}
.bar-btn{height:40px;border:0;border-radius:8px;padding:0 14px;font:inherit;background:rgba(255,255,255,.18);color:#fff;cursor:pointer}
.bar-btn:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #ffd23f;outline-offset:2px}
.planungshilfe{margin:0;padding:6px 12px;background:#fff3cd;color:#3d2e00;border-bottom:1px solid #c79a00;font-size:14px;text-align:center}
main{max-width:1200px;margin:0 auto;padding:12px;display:grid;gap:16px;grid-template-columns:1fr}
@media (min-width:960px){main{grid-template-columns:minmax(0,1fr) 340px}.mapbox{grid-column:1;grid-row:1}.inputs{grid-column:2;grid-row:1 / span 2}.result,.vertices,.hinweis,.modell,.quellen{grid-column:1}}
h2{font-size:19px;margin:4px 0 10px}
#map{height:58vh;min-height:320px;border-radius:10px;border:1px solid var(--line)}
.map-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
button{min-height:44px;border:1px solid var(--line);border-radius:8px;padding:0 14px;font:inherit;background:var(--panel);color:var(--fg);cursor:pointer}
.small{font-size:14px;color:var(--muted)}
.inputs{background:var(--panel);border-radius:10px;padding:12px 14px;align-self:start}
fieldset{border:0;margin:0 0 8px;padding:0}
legend{font-weight:600;padding:0 0 4px}
fieldset label,.check{display:flex;gap:10px;align-items:center;min-height:44px;cursor:pointer}
input[type=radio],input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}
.row{display:flex;flex-direction:column;gap:4px;margin:10px 0 0;font-weight:600;font-size:15px}
.row input,.row select,td input{height:44px;border:1px solid var(--line);border-radius:8px;padding:0 10px;font:inherit;font-weight:400;background:var(--bg);color:var(--fg)}
td input{width:7.5em;height:40px}
.status{font-weight:600}
.status.bad{color:var(--bad)}
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:0 0 12px}
.facts div{background:var(--panel);border-radius:8px;padding:8px 10px}
.facts dt{font-size:13px;color:var(--muted)}
.facts dd{margin:2px 0 0;font-size:20px;font-weight:700}
.facts dd small{display:block;font-size:13px;font-weight:400;color:var(--muted)}
.warn{background:#fff3cd;color:#3d2e00;border:1px solid #c79a00;border-radius:8px;padding:8px 12px;margin:0 0 10px}
.profile svg{width:100%;height:auto;display:block}
.profile .terrain{fill:var(--terrain);stroke:none;opacity:.8}
.profile .pressure{fill:none;stroke:var(--pressure);stroke-width:2}
.profile .pe{stroke:var(--pressure);stroke-dasharray:4 4;stroke-width:1;opacity:.7}
.profile .pump{stroke:var(--pump);stroke-width:2}
.profile .axis{stroke:var(--line);stroke-width:1}
.profile text{fill:var(--muted);font-size:11px}
.profile .ptext{fill:var(--pump);font-weight:700;font-size:12px}
.profile .ltext{fill:var(--pressure)}
figure{margin:0 0 12px}
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;font-size:15px}
caption{text-align:left;font-weight:600;padding:6px 0}
th,td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line);white-space:nowrap}
td.num,th.num{text-align:right}
details{margin:12px 0}
summary{cursor:pointer;font-weight:600;min-height:32px}
#calc-body p{margin:6px 0;font-family:ui-monospace,Menlo,monospace;font-size:14px;white-space:normal}
.hinweis{background:#fff3cd;color:#3d2e00;border:1px solid #c79a00;border-radius:10px;padding:4px 16px}
.modell ul,.quellen ul{padding-left:20px}
.modell li,.quellen li{margin:4px 0}
.pin{background:var(--pump);color:#fff;border:2px solid #fff;border-radius:50%;width:26px;height:26px;display:grid;place-items:center;font:700 13px/1 system-ui,sans-serif;box-shadow:0 0 0 1px rgba(0,0,0,.4)}
.pin.vertex{background:#333;width:16px;height:16px;font-size:0}
.pin.start{background:#18794e;width:22px;height:22px;font-size:11px}
.pin.end{background:#1f5fd1;width:22px;height:22px;font-size:11px}
.leaflet-container{font:inherit}
.print-only{display:none}
.noscript{padding:16px}
@media print{
  .bar,.planungshilfe,.map-tools,.inputs form,#draw-hint,.vertices p.small,noscript,.quellen .links,.leaflet-control-zoom{display:none}
  h1.print-only{font-size:18px;margin:0 0 6px}
  .print-only{display:block}
  body{font-size:12px;color:#000;background:#fff}
  main{display:block;max-width:none;padding:0}
  #map{height:90mm;border:1px solid #999;break-inside:avoid}
  .inputs{background:none;padding:0}
  .inputs::after{content:attr(data-summary);display:block;margin:6px 0 10px;font-size:12px}
  .hinweis{background:none;border:2px solid #000;color:#000;break-inside:avoid}
  .facts div{background:none;border:1px solid #999}
  section{break-inside:avoid-page}
  td input{border:0;height:auto;padding:0}
  a{text-decoration:none}
}
