/* Heizung – Dashboard-Stil nach Vorlage: helles Shell-Layout, Indigo + Orange, weiche Karten */
:root {
  color-scheme: light;
  --page: #C9D3EA; --shell: #FFFFFF; --side: #FBFBFE; --surface: #FFFFFF; --raised: #F6F7FC;
  --ink: #1F2A44; --muted: #8A90A6; --line: #ECEEF5;
  --brand: #FF7A00; --brand-soft: #FFF1E3; --indigo: #4B3F9E; --indigo-soft: #EEEDFB;
  --coral: #F2647A; --coral-soft: #FDE9EC; --green: #22A06B; --green-soft: #E3F5EC;
  --cold: #4F7CF3; --cold-soft: #E8EFFE;
  /* Aliase für Diagramm und Zustände */
  --hot: var(--brand); --amber: var(--brand); --amber-soft: var(--brand-soft); --chip: var(--indigo-soft);
  --ok: var(--green); --ok-soft: var(--green-soft); --bad: #D64545; --bad-soft: #FCE8E8;
  --shadow: 0 10px 30px rgb(31 42 68 / .07);
  --font: "Poppins", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --r-xl: 28px; --r-lg: 18px; --r-md: 12px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0E1018; --shell: #161925; --side: #131620; --surface: #1D2131; --raised: #232839;
  --ink: #EEF0F8; --muted: #9096AE; --line: #2A2F42;
  --brand: #FF8A1F; --brand-soft: #3A2A1C; --indigo: #9A8CFF; --indigo-soft: #2A2847;
  --coral: #FF7D91; --coral-soft: #3D2229; --green: #3CC487; --green-soft: #19352A;
  --cold: #7FA2FF; --cold-soft: #1F2A47; --bad: #FF7B7B; --bad-soft: #3E2024;
  --shadow: 0 10px 30px rgb(0 0 0 / .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 15px/1.5 var(--font); padding: clamp(0px, 2.5vw, 36px); min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.app { max-width: 1600px; margin: 0 auto; background: var(--shell); border-radius: var(--r-xl); box-shadow: 0 30px 80px rgb(31 42 68 / .14);
  display: grid; grid-template-columns: 330px minmax(0, 1fr) 360px; min-height: calc(100vh - 2 * clamp(0px, 2.5vw, 36px)); overflow: hidden; }
@media (max-width: 1320px) { .app { grid-template-columns: 300px minmax(0, 1fr); } .aside { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 880px) { .app { grid-template-columns: 1fr; border-radius: 0; } .aside { grid-column: 1; } body { padding: 0; } }

/* ---------- Seitenleiste ---------- */
.side { background: var(--side); border-right: 1px solid var(--line); padding: 28px 22px; display: flex; flex-direction: column; gap: 26px; }
.brand { display: grid; gap: 8px; }
.brand img { display: block; width: 100%; max-width: 380px; max-height: 128px; object-fit: contain; object-position: left center; }
:root[data-theme="dark"] .brand img { background: #fff; border-radius: 10px; padding: 6px 8px; }
.brand .wordmark { font-weight: 700; font-size: 44px; line-height: 1.1; letter-spacing: -.02em; display: flex; align-items: center; gap: 16px; }
.brand .wordmark span { width: 72px; height: 72px; border-radius: 22px; background: var(--brand); display: grid; place-items: center; color: #fff; flex: none; }
.brand .wordmark span svg { width: 40px; height: 40px; }
.brand .made { color: var(--muted); font-size: 13.5px; }
.brand .made b { color: var(--brand); font-weight: 600; }
.side h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.devicebox { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.devicebox b { display: block; font-size: 14px; }
.devicebox span#device { color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; margin-top: 6px; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.nav { display: grid; gap: 4px; }
.nav button, .nav a { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; text-align: left; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.nav button:hover, .nav a:hover { background: var(--raised); }
.nav button[aria-current="page"] { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.addbox { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 18px 14px; text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; background: none; }
.addbox:hover { border-color: var(--brand); }
.addbox .plus { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; font-size: 22px; box-shadow: 0 8px 18px rgb(255 122 0 / .35); }
.addbox b { color: var(--ink); display: block; font-weight: 600; }
.theme { margin-top: auto; display: flex; background: var(--raised); border-radius: var(--r-md); padding: 4px; }
.theme button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
@media (max-width: 880px) {
  .side { border-right: 0; border-bottom: 1px solid var(--line); gap: 16px; padding: 18px; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .nav button { justify-content: center; flex-direction: column; gap: 4px; font-size: 12.5px; }
  .addbox, .side .tools-h, .side .tools { display: none; }
}

/* ---------- Hauptbereich ---------- */
.main { padding: 28px clamp(16px, 2.4vw, 34px) 40px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; }
.clock { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin: 0; }
.clock time { font-size: 38px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.clock .date { font-size: 18px; font-weight: 500; color: var(--indigo); }
.top p { margin: 4px 0 0; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; background: var(--raised); border-radius: var(--r-md); padding: 10px 14px; width: min(250px, 100%); color: var(--muted); flex: none; }
.top > div:first-child { flex: 1 1 360px; min-width: 0; }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); }
.notice { margin-top: 18px; padding: 14px 18px; border-radius: var(--r-md); background: var(--bad-soft); }
.scan { margin-top: 14px; color: var(--muted); font-size: 14px; }
.scanbar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; max-width: 420px; }
.scanbar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--indigo), var(--brand)); border-radius: 99px; transition: width .4s; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow); }
.card h2, .sec-h h2 { margin: 0; font-size: 17px; font-weight: 600; }
.card .lead { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }

/* ---------- Kennzahl-Karten (anpassbar) ---------- */
.glance { border-radius: var(--r-lg); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 18px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 14px; box-shadow: var(--shadow); cursor: grab; min-height: 140px; display: flex; flex-direction: column; }
.tile:hover { border-color: color-mix(in srgb, var(--indigo) 30%, var(--line)); }
.t-head { display: flex; gap: 14px; align-items: center; }
.t-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--indigo); }
.t-ico svg { width: 22px; height: 22px; }
.tile[data-c="1"] .t-ico { background: var(--coral); } .tile[data-c="2"] .t-ico { background: var(--green); }
.tile[data-c="3"] .t-ico { background: var(--brand); } .tile[data-c="4"] .t-ico { background: var(--cold); }
.t-label { color: var(--muted); font-size: 13px; line-height: 1.3; hyphens: auto; overflow-wrap: anywhere; padding-right: 4px; }
.t-val { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.t-val small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.tile.txt .t-val { font-size: 16px; font-weight: 600; }
.tile.warm .t-val { color: var(--brand); } .tile.cold .t-val { color: var(--cold); }
.t-bar { height: 6px; border-radius: 99px; background: var(--line); margin: 16px 0 10px; overflow: hidden; }
.t-bar i { display: block; height: 100%; border-radius: 99px; background: var(--indigo); }
.tile.warm .t-bar i { background: var(--brand); } .tile.cold .t-bar i { background: var(--cold); }
.t-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-foot b { color: var(--indigo); font-weight: 600; }
.t-foot .spark-mini { display: block; }
.tile-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-tools, .tile:focus-within .tile-tools { opacity: 1; }
@media (hover: none) { .tile-tools { opacity: 1; } }
.tool { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--raised); color: var(--muted); cursor: pointer; font-size: 14px; display: grid; place-items: center; }
.tool:hover { color: var(--brand); }
.tile.add { border: 1.5px dashed var(--line); box-shadow: none; background: transparent; color: var(--muted); font-size: 13px; place-items: center; justify-content: center; text-align: center; cursor: default; }
.tile.add .plus { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 8px; font-size: 20px; }
.tile.drop-before { box-shadow: -7px 0 0 -2px var(--brand), var(--shadow); }
.tile.drop-after { box-shadow: 7px 0 0 -2px var(--brand), var(--shadow); }
.tile.add.drop-here, body.dragging .tile.add { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }
body.dragging .glance { outline: 2px dashed var(--brand); outline-offset: 8px; }
.tile.lifted { opacity: .4; }
.tile.fresh { animation: fresh 1.2s ease-out; }
@keyframes fresh { from { background: var(--brand-soft); transform: scale(.97); } to { transform: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--indigo-soft); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; border: 0; }
.chip.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.chip.ok { background: var(--green-soft); } .chip.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.chip.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.chip .k { color: var(--muted); }

/* ---------- Heizkurve ---------- */
.chartrow { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; margin-top: 22px; align-items: start; }
@media (max-width: 1100px) { .chartrow { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 12px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ref { fill: none; stroke: var(--line); stroke-width: 1.5; }
.chart .ref-l { font-size: 11px; }
.chart .band { fill: var(--green-soft); }
.chart .band-l { fill: var(--green); font-size: 12px; }
.chart .curve { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; }
.chart .eco { fill: none; stroke: var(--indigo); stroke-width: 2.2; stroke-dasharray: 7 6; }
.chart .fit { fill: none; stroke: var(--coral); stroke-width: 2.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.chart .sample { fill: var(--indigo); opacity: .3; }
.chart .now-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; opacity: .5; }
.chart .soll { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }
.chart .ist { fill: var(--indigo); }
.chart .now-l { fill: var(--ink); font-weight: 700; font-size: 13px; }
.chart .norm-l { fill: var(--muted); font-size: 11px; }
.chart .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.chart .pulse { fill: none; stroke: var(--brand); stroke-width: 2; opacity: .5; }
@media (prefers-reduced-motion: no-preference) { .chart .pulse { animation: pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; } }
@keyframes pulse { from { transform: scale(.6); opacity: .6; } to { transform: scale(2.2); opacity: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--brand); vertical-align: middle; margin-right: 6px; }
.legend i.eco { border-top: 2px dashed var(--indigo); } .legend i.fit { border-top: 2px dotted var(--coral); }
.legend i.dot { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--indigo); }
.legend i.ring { width: 9px; height: 9px; border: 2.5px solid var(--brand); border-radius: 50%; }
.legend i.smp { width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--indigo); opacity: .4; }
.nowline { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-soft); font-size: 14px; }
.params { display: grid; gap: 14px; }
@media (max-width: 1100px) { .params { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.param { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow); }
.param .k { color: var(--muted); font-size: 12.5px; }
.param .v { font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- Untere Reihe: Registerprüfung + Effizienz ---------- */
.bottomrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 22px; }
@media (max-width: 1100px) { .bottomrow { grid-template-columns: 1fr; } }
.check { display: grid; gap: 10px; margin-top: 12px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--raised); border: 0; border-radius: var(--r-md); padding: 12px 14px; text-align: left; cursor: pointer; width: 100%; }
.stat:hover { background: var(--indigo-soft); }
.stat .n { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; font-variant-numeric: tabular-nums; }
.stat.found .n { background: var(--green-soft); color: var(--green); }
.stat.unknown .n { background: var(--brand-soft); color: var(--brand); }
.stat.missing .n { background: var(--indigo-soft); color: var(--indigo); }
.stat .t { font-weight: 600; font-size: 14px; } .stat .d { color: var(--muted); font-size: 12px; }
.stat .go { margin-left: auto; color: var(--muted); }
.checknote { color: var(--muted); font-size: 12px; margin: 10px 2px 0; }
.energy { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-top: 12px; }
.energy .k { color: var(--muted); font-size: 13px; }
.energy .v { font-weight: 600; font-size: 15px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.ring text { font-family: var(--font); }
.banner { margin-top: 18px; border-radius: var(--r-md); background: var(--brand-soft); padding: 14px 18px; display: flex; gap: 12px; align-items: center; color: var(--brand); font-size: 14px; }
.banner span { color: var(--ink); }

/* ---------- Werte-Ansicht (Gruppen) ---------- */
.groups { columns: 2 380px; column-gap: 18px; }
.group { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 8px; margin-bottom: 18px; box-shadow: var(--shadow); }
.group h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.group.unknown { border: 1.5px dashed var(--brand); box-shadow: none; }
.group .hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: grab; }
.row:first-of-type { border-top: 0; }
.row:hover .nm { color: var(--brand); }
.row .nm { font-weight: 500; font-size: 14px; }
.row .meta { color: var(--muted); font-size: 12px; grid-column: 1; }
.row .meta code { font-family: var(--mono); font-size: 11.5px; }
.row .val { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; max-width: 24ch; }
.row .val small { font-weight: 400; color: var(--muted); margin-left: 3px; }
.row .val.txt { font-weight: 600; font-size: 14px; }
.row .val.flag { color: var(--brand); }
.row .spk { display: block; margin: 4px 0 0 auto; }
.row .pin { grid-row: 1 / span 2; grid-column: 3; align-self: center; }
.badge2 { display: inline-block; font-size: 11px; border-radius: 999px; padding: 1px 8px; background: var(--brand-soft); color: var(--brand); margin-left: 6px; vertical-align: 1px; }
.pin { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.pin:hover { color: var(--brand); border-color: var(--brand); }
.pin.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pin svg { width: 15px; height: 15px; }
.spk polyline { fill: none; stroke: url(#thermal); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spk.flat polyline { stroke: var(--line); }

/* ---------- Tabelle ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.seg { display: flex; background: var(--raised); border-radius: var(--r-md); padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg small { margin-left: 4px; font-variant-numeric: tabular-nums; }
.toolbar input[type=search], .toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 7px 12px; }
label.field { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: grab; } tbody tr:hover { background: var(--raised); } tbody tr:last-child td { border-bottom: 0; }
td.ref b { font-weight: 600; } td.ref span { color: var(--muted); font-size: 12px; display: block; }
td.nm .o { color: var(--muted); font-size: 12px; display: block; } td.nm .none { color: var(--muted); font-style: italic; }
td.v { text-align: right; font-weight: 600; white-space: nowrap; } td.v.na { color: var(--muted); font-weight: 400; } td.v small { color: var(--muted); font-weight: 400; margin-left: 3px; }
td.raw { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.state { font-size: 12px; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.state.found { background: var(--green-soft); color: var(--green); } .state.unknown { background: var(--brand-soft); color: var(--brand); }
.state.missing { background: var(--raised); color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.foot { margin-top: 18px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .col-hide { display: none; } .clock time { font-size: 30px; } .clock .date { font-size: 16px; } .brand .wordmark { font-size: 34px; } .brand .wordmark span { width: 56px; height: 56px; } }

/* ---------- Rechte Spalte: Anlage + Analyse ---------- */
.aside { background: var(--shell); border-left: 1px solid var(--line); padding: 28px 24px 34px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.a-top { display: flex; justify-content: space-between; gap: 10px; }
.a-top .grp { display: flex; gap: 10px; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; color: var(--ink); text-decoration: none; }
.iconbtn:hover { color: var(--brand); }
.iconbtn[disabled] { opacity: .5; cursor: default; }
.profile { text-align: center; }
.avatar { width: 112px; height: 112px; margin: 0 auto; position: relative; }
.avatar svg.ringsvg { position: absolute; inset: 0; }
.avatar .face { position: absolute; inset: 14px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; color: #fff; }
.avatar .face svg { width: 40px; height: 40px; stroke-width: 1.6; }
.profile h2 { margin: 12px 0 0; font-size: 19px; color: var(--indigo); }
.profile p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 20px; }
.pstats b { display: block; font-size: 19px; color: var(--indigo); font-variant-numeric: tabular-nums; }
.pstats span { color: var(--muted); font-size: 12.5px; }
.an-card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.an-row { display: flex; align-items: center; gap: 14px; }
.an-row .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center; flex: none; }
.an-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.btn { border: 0; border-radius: var(--r-md); padding: 11px 18px; cursor: pointer; font-weight: 600; background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgb(255 122 0 / .28); width: 100%; margin-top: 14px; }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.gauge { display: block; margin: 18px auto 0; width: 240px; max-width: 100%; height: auto; }
.gauge text { font-family: var(--font); }
.verdict { text-align: center; margin-top: 4px; }
.verdict b { display: block; font-size: 16px; }
.verdict .lage { color: var(--muted); font-size: 13px; margin-top: 2px; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.counts span { font-size: 12px; border-radius: 999px; padding: 3px 10px; background: var(--raised); }
.findings { margin-top: 14px; }
.finding { border-top: 1px solid var(--line); padding: 12px 0; }
.f-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.f-top .pill { flex: none; }
.f-title { font-weight: 600; font-size: 14px; }
.f-title small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.pill { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill.gut { background: var(--green-soft); color: var(--green); } .pill.hinweis { background: var(--brand-soft); color: var(--brand); }
.pill.pruefen { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--raised); color: var(--muted); }
.f-val { font-variant-numeric: tabular-nums; margin-top: 3px; font-size: 14px; }
.f-val span { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.f-text { color: var(--muted); font-size: 13px; margin-top: 4px; }
.an-empty { color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }
.an-foot { color: var(--muted); font-size: 11.5px; margin-top: 10px; }

/* ---------- Ziehen: Ablage-Leiste ---------- */
.dropbar { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); z-index: 50; width: min(560px, calc(100vw - 24px));
  background: var(--surface); border: 2px dashed var(--brand); border-radius: var(--r-lg); padding: 16px 20px; text-align: center;
  box-shadow: 0 14px 40px rgb(31 42 68 / .22); transition: transform .2s ease-out, visibility 0s .2s; font-weight: 600; visibility: hidden; }
.dropbar small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
body.dragging-add .dropbar { transform: translate(-50%, 0); visibility: visible; transition: transform .2s ease-out; }
.dropbar.drop-here { background: var(--brand-soft); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(500px, calc(100vw - 28px)); box-shadow: 0 30px 80px rgb(31 42 68 / .3); }
dialog::backdrop { background: rgb(31 42 68 / .4); }
dialog form { padding: 22px 24px; display: grid; gap: 14px; }
dialog h2 { margin: 0; font-size: 19px; }
dialog .facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13.5px; background: var(--raised); border-radius: var(--r-md); padding: 12px 14px; }
dialog .facts dt { color: var(--muted); } dialog .facts dd { margin: 0; }
dialog .note { font-size: 13.5px; background: var(--brand-soft); border-radius: var(--r-md); padding: 10px 14px; }
dialog label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
dialog input, dialog select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--raised); border-radius: 10px; padding: 8px 10px; }
dialog .two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
dialog .btns { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
dialog .btns span { display: flex; gap: 8px; }
dialog .btns .btn { width: auto; margin-top: 0; }
dialog .preview { font-size: 13.5px; color: var(--muted); } dialog .preview b { color: var(--ink); font-size: 15px; }

@media (prefers-reduced-motion: reduce) { .scanbar > i, .dropbar, .tile-tools { transition: none; } .tile.fresh { animation: none; } }

/* Handy: Karten kompakt in zwei Spalten */
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px 12px 12px; min-height: 0; }
  .t-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .t-ico { width: 34px; height: 34px; } .t-ico svg { width: 18px; height: 18px; }
  .t-val { font-size: 20px; }
  .t-foot .spk { display: none; }
  .tile.add { grid-column: 1 / -1; min-height: 90px; }
}

/* ---------- Wetter ---------- */
.weather { margin-top: 22px; }
.w-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.w-loc { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--raised); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; }
.w-loc svg { width: 16px; height: 16px; color: var(--brand); }
.w-loc small { color: var(--muted); margin-left: 4px; }
.w-loc:hover small { color: var(--brand); }
.w-head .w-days { margin-left: auto; }
.w-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; margin-top: 16px; }
@media (max-width: 1180px) { .w-grid { grid-template-columns: 1fr; } }
.w-now { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.w-now .w-big { display: flex; align-items: center; gap: 12px; }
.w-now .w-big svg { width: 76px; height: 76px; }
.w-now .w-t { font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.w-now .w-t small { font-size: 20px; color: var(--muted); font-weight: 500; }
.w-now .w-desc { font-weight: 600; } .w-now .w-feel { color: var(--muted); font-size: 13px; }
.w-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--muted); flex: 1 1 200px; }
.w-facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.w-hours { margin-top: 14px; }
.w-hours svg { width: 100%; height: auto; display: block; }
.w-hours text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.w-fc { margin-top: 8px; }
.w-day { display: grid; grid-template-columns: 92px 34px 58px 40px minmax(60px, 1fr) 40px; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.w-day:first-child { border-top: 0; }
.w-day .d b { display: block; font-weight: 600; } .w-day .d span { color: var(--muted); font-size: 12px; }
.w-day svg { width: 30px; height: 30px; }
.w-day .rain { color: var(--cold); font-size: 12.5px; } .w-day .rain small { display: block; color: var(--muted); font-size: 11px; }
.w-day .lo { color: var(--muted); text-align: right; } .w-day .hi { font-weight: 600; }
.w-range { position: relative; height: 6px; border-radius: 99px; background: var(--line); }
.w-range i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--cold), var(--brand)); }
.w-right { min-width: 0; }
.w-layers { margin-bottom: 10px; width: fit-content; }
.w-map { height: 380px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--raised); z-index: 0; }
.leaflet-container { font-family: var(--font); background: var(--raised); }
.leaflet-control-attribution { font-size: 10px; }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgb(22 25 37 / .8); color: var(--muted); }
:root[data-theme="dark"] .leaflet-control-attribution a { color: var(--indigo); }
:root[data-theme="dark"] .leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.wx-mark { background: var(--surface); border-radius: 999px; box-shadow: 0 4px 14px rgb(31 42 68 / .2); display: flex; align-items: center; gap: 2px; padding: 2px 8px 2px 2px; font: 600 13px var(--font); color: var(--ink); white-space: nowrap; width: max-content !important; height: auto !important; }
.wx-mark svg { width: 26px; height: 26px; }
.wx-mark.home { background: var(--brand); color: #fff; padding-right: 10px; }
.wx-mark.home .nm { font-weight: 500; opacity: .9; margin-left: 4px; }
.w-radar { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.w-radar input { flex: 1 1 140px; accent-color: var(--brand); }
.w-radar #wTime { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; min-width: 44px; }
.w-scale { display: inline-flex; align-items: center; gap: 6px; }
.w-scale i { width: 70px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #b4e6ff, #3c9dff, #2fd25b, #f5e400, #ff8c00, #e60000, #b400b4); }
.w-src { color: var(--muted); font-size: 11.5px; margin: 8px 0 0; }
.w-err { color: var(--muted); font-size: 13.5px; }
#locDlg form { gap: 12px; }
.loc-results { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.loc-results button { text-align: left; border: 0; background: var(--raised); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.loc-results button:hover { background: var(--brand-soft); }
.loc-results small { color: var(--muted); margin-left: 6px; }
.loc-msg { margin: 0; color: var(--muted); font-size: 13px; min-height: 1em; }
#locGeo { display: inline-flex; align-items: center; gap: 8px; justify-content: center; margin-top: 0; }
@media (max-width: 600px) { .w-day { grid-template-columns: 70px 30px 50px 34px minmax(40px, 1fr) 34px; font-size: 13px; } .w-map { height: 300px; } .w-now .w-t { font-size: 38px; } }

.keyrow { display: flex; gap: 8px; align-items: center; }
.keyrow input { flex: 1; font-family: var(--mono); }
.w-keyhint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

/* ---------- Analyse: anklickbare Punkte, Detailfenster, KI ---------- */
.finding[data-finding] { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.finding[data-finding]:hover, .finding[data-finding]:focus-visible { background: var(--raised); }
.finding[data-finding] .f-title::after { content: "›"; color: var(--muted); margin-left: 6px; }
dialog.wide { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.fd { padding: 24px 28px 26px; display: grid; gap: 18px; }
.fd-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.fd-head h2 { margin: 4px 0 0; font-size: 22px; }
.fd-head .sub { color: var(--muted); font-size: 13px; }
.fd-vals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fd-vals > div { background: var(--raised); border-radius: var(--r-md); padding: 12px 14px; }
.fd-vals .k { color: var(--muted); font-size: 12.5px; } .fd-vals .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.fd h3 { margin: 0 0 6px; font-size: 15px; }
.fd p { margin: 0; }
.fd ul { margin: 0; padding-left: 20px; } .fd li { margin: 3px 0; }
.fd-regs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fd-regs td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.fd-regs td.r { text-align: right; font-weight: 600; white-space: nowrap; }
.fd-regs .m { color: var(--muted); font-size: 12px; }
.ki-box { border: 1.5px solid var(--indigo-soft); border-radius: var(--r-lg); padding: 16px 18px; background: linear-gradient(180deg, var(--indigo-soft), transparent 120px); }
.ki-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ki-top h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.ki-top h3 svg { color: var(--indigo); }
.ki-top .btn { width: auto; margin: 0; }
.ki-state { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ki-state.bad { color: var(--bad); }
.ki-steps { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.ki-steps li::before { content: "•"; color: var(--indigo); margin-right: 8px; }
.ki-steps li:last-child { color: var(--ink); }
.ki-run { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--indigo-soft); border-top-color: var(--indigo); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ki-run { animation: none; } }
.ki-report { margin-top: 14px; font-size: 14.5px; line-height: 1.6; }
.ki-report h3 { font-size: 16px; margin: 18px 0 6px; color: var(--indigo); }
.ki-report h4 { font-size: 14.5px; margin: 14px 0 4px; }
.ki-report p { margin: 0 0 10px; } .ki-report ul, .ki-report ol { margin: 0 0 10px; padding-left: 22px; }
.ki-report a.cite { font-size: 11.5px; font-weight: 700; color: var(--indigo); text-decoration: none; vertical-align: super; margin: 0 1px; }
.ki-sources { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ki-sources h3 { display: flex; align-items: center; gap: 8px; }
.ki-sources ol { margin: 0; padding-left: 22px; font-size: 13px; display: grid; gap: 6px; }
.ki-sources li:target { background: var(--brand-soft); border-radius: 6px; }
.ki-sources a { color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.ki-sources a:hover { color: var(--brand); text-decoration: underline; }
.ki-sources .dom { color: var(--muted); font-size: 12px; margin-left: 6px; }
.ki-sources .tag { font-size: 11px; border-radius: 999px; padding: 0 7px; background: var(--raised); color: var(--muted); margin-left: 6px; }
.ki-hist { display: grid; gap: 6px; margin-top: 10px; }
.ki-hist button, .report-row { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: var(--raised); border-radius: 10px; padding: 9px 12px; cursor: pointer; width: 100%; font-size: 13.5px; }
.ki-hist button:hover, .report-row:hover { background: var(--indigo-soft); }
.ki-hist small, .report-row small { color: var(--muted); margin-left: auto; white-space: nowrap; }
.reports { display: grid; gap: 10px; }
.report-row { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.report-row b { font-size: 14.5px; }
.report-row .pill { margin-left: 4px; }
.set-h { margin: 8px 0 0; font-size: 15px; border-top: 1px solid var(--line); padding-top: 14px; }
#kiTest { margin-top: 0; }

/* ---------- Anmeldung, Benutzer, Gast-Modus ---------- */
.userbox { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.userbox b { color: var(--ink); }
.userlist { display: grid; gap: 6px; }
.urow { display: flex; align-items: center; gap: 10px; background: var(--raised); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.urow small, .urow .linkbtn { margin-left: auto; }
/* Gäste sehen alles, ändern aber nichts */
body[data-role="gast"] [data-settings], body[data-role="gast"] #scanBtn, body[data-role="gast"] .pin,
body[data-role="gast"] .tile-tools, body[data-role="gast"] #layoutReset, body[data-role="gast"] .tile.add,
body[data-role="gast"] .addbox, body[data-role="gast"] #kiStart, body[data-role="gast"] #resetBtn,
body[data-role="gast"] #editForm button[type=submit], body[data-role="gast"] [data-delreport],
body[data-role="gast"] .banner, body[data-role="gast"] #wLocBtn small { display: none !important; }
body[data-role="gast"] #wLocBtn { pointer-events: none; }
body[data-role="gast"] .tile, body[data-role="gast"] .row, body[data-role="gast"] tbody tr { cursor: pointer; }
body[data-role="gast"] #editForm input, body[data-role="gast"] #editForm select { pointer-events: none; opacity: .7; }
