/* Owner Zähler design-drafts – shared shell & widgets (v1–v5)
 * Standalone: body.mp-body · Embedded: #page-mieter[data-owner-zaehler]
 */

body.mp-body.theme-light,
[data-owner-zaehler],
[data-owner-zaehler].theme-light {
  --mp-bg: #f4f7f6;
  --mp-card: #ffffff;
  --mp-text: #17241f;
  --mp-muted: #5b6b66;
  --mp-faint: #93a29d;
  --mp-border: #e4ece9;
  --mp-soft: #e7efee;
  --mp-highlight: #1eb97a;
  --mp-highlight-10: rgba(30,185,122,0.1);
  --mp-highlight-20: rgba(30,185,122,0.2);
  --mp-green: #244941;
  --mp-green-600: #1a3630;
  --mp-pv-color: #1eb97a;
  --mp-grid-color: #cbd5e1;
  --mp-axis-color: #94a3b8;
  --mp-viz-track: #e8efec;
  --mp-yellow: #eea54e;
  --oa-topbar-bg: rgba(255,255,255,0.85);
  --oa-btn-fg: #ffffff;
  --oz-hero-grad: linear-gradient(135deg, #10241d 0%, #0f3d30 55%, #0b5a3f 100%);
  --oz-hero-stream: #6ff0c0;
}

body.mp-body.theme-dark,
[data-owner-zaehler].theme-dark {
  --mp-bg: #0b1220;
  --mp-card: #111c2e;
  --mp-text: #e6edf5;
  --mp-muted: #93a4bd;
  --mp-faint: #61728c;
  --mp-border: #1e2b40;
  --mp-soft: #16233a;
  --mp-highlight: #22e39a;
  --mp-highlight-10: rgba(34,227,154,0.12);
  --mp-highlight-20: rgba(34,227,154,0.24);
  --mp-green: #22e39a;
  --mp-green-600: #16b87c;
  --mp-pv-color: #22e39a;
  --mp-grid-color: #3a4a63;
  --mp-axis-color: #61728c;
  --mp-viz-track: #1e2b40;
  --mp-yellow: #f0b35a;
  --oa-topbar-bg: rgba(11,18,32,0.88);
  --oa-btn-fg: #08131f;
  --oz-hero-grad: linear-gradient(135deg, #0f2238 0%, #0b2d24 55%, #091e18 100%);
  --oz-hero-stream: #6ff0c0;
}

body.mp-body,
[data-owner-zaehler],
[data-owner-zaehler] .oa-topbar,
[data-owner-zaehler] .oz-hero,
[data-owner-zaehler] .mp-card,
[data-owner-zaehler] .mp-btn {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

[data-owner-zaehler] { padding: 4px 0 40px; }

.mp-btn { color: var(--oa-btn-fg); }
.mp-btn--ghost { color: var(--mp-highlight); border-color: var(--mp-highlight-20); background: transparent; }
.mp-btn--ghost:hover { background: var(--mp-highlight-10); }

main { padding: 18px 0 60px; }
@media (min-width: 900px) { main { padding: 22px 0 60px; } }

.oa-topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--oa-topbar-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--mp-border);
}
.oa-topbar__inner { display: flex; align-items: center; gap: 14px; height: 62px; }
.oa-logo { height: 24px; }
.oa-addr { display: flex; flex-direction: column; line-height: 1.15; margin-left: 4px; min-width: 0; }
.oa-addr small { font-size: .6875rem; color: var(--mp-faint); text-transform: uppercase; letter-spacing: .06em; }
.oa-addr span { font-size: .8125rem; font-weight: 600; color: var(--mp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-topbar__spacer { margin-left: auto; }
.oa-theme-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--mp-soft); border: 1px solid var(--mp-border);
  border-radius: 999px; cursor: pointer; font-family: inherit;
}
.oa-theme-toggle button {
  display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent;
  cursor: pointer; font-family: inherit; font-size: .75rem; font-weight: 600; color: var(--mp-muted);
  padding: 6px 11px; border-radius: 999px; transition: all .2s ease;
}
.oa-theme-toggle button .material-icons { font-size: 16px; }
.oa-theme-toggle button.is-active { background: var(--mp-highlight); color: var(--oa-btn-fg); }
.oa-theme-toggle button.is-active .material-icons { color: var(--oa-btn-fg); }
.oa-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--mp-highlight-10);
  border: 1.5px solid var(--mp-highlight-20); color: var(--mp-highlight);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8125rem;
  flex-shrink: 0;
}

.oa-subnav { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 2px; scrollbar-width: none; }
.oa-subnav::-webkit-scrollbar { display: none; }
.oa-subnav button {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  border: 1px solid var(--mp-border); background: var(--mp-card); cursor: pointer; font-family: inherit;
  font-size: .8125rem; font-weight: 600; color: var(--mp-muted);
  padding: 9px 15px; border-radius: 999px; transition: all .2s ease;
}
.oa-subnav button .material-icons { font-size: 18px; }
.oa-subnav button:hover { border-color: var(--mp-highlight-20); color: var(--mp-text); }
.oa-subnav button.is-active {
  background: var(--mp-highlight); border-color: var(--mp-highlight); color: var(--oa-btn-fg);
}
.oa-subnav button.is-active .material-icons { color: var(--oa-btn-fg); }

/* Section nav: scoped so dashboard sticky (Anlage) is not overridden */
body.mp-body .oa-section-nav,
[data-owner-zaehler] .oa-section-nav {
  position: sticky;
  top: calc(var(--header-float-top, 14px) + var(--header-bar-inner-height, 50px) + 8px);
  z-index: 25;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 4px 14px; margin: 8px 0 10px;
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  scrollbar-width: none;
}
body.mp-body .oa-section-nav { top: 62px; background: var(--mp-bg); }
body.mp-body .oa-section-nav::-webkit-scrollbar,
[data-owner-zaehler] .oa-section-nav::-webkit-scrollbar { display: none; }
[data-owner-zaehler] .oa-section-nav button,
body.mp-body .oa-section-nav button {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  border: 1px solid var(--mp-border); background: var(--mp-card); cursor: pointer; font-family: inherit;
  font-size: .8125rem; font-weight: 600; color: var(--mp-muted);
  padding: 9px 15px; border-radius: 999px; transition: all .2s ease;
}
[data-owner-zaehler] .oa-section-nav button .material-icons,
body.mp-body .oa-section-nav button .material-icons { font-size: 18px; }
[data-owner-zaehler] .oa-section-nav button:hover,
body.mp-body .oa-section-nav button:hover { border-color: var(--mp-highlight-20); color: var(--mp-text); }
[data-owner-zaehler] .oa-section-nav button.is-active,
body.mp-body .oa-section-nav button.is-active {
  background: var(--mp-soft); border-color: var(--mp-highlight-20); color: var(--mp-green);
  box-shadow: inset 0 0 0 1px var(--mp-highlight-10);
}
[data-owner-zaehler] .oa-section-nav button.is-active .material-icons,
body.mp-body .oa-section-nav button.is-active .material-icons { color: var(--mp-green); }
body.theme-dark .oa-section-nav button.is-active,
[data-owner-zaehler].theme-dark .oa-section-nav button.is-active {
  background: var(--mp-soft); border-color: var(--mp-border); color: var(--mp-highlight);
}
[data-owner-zaehler] .oa-section-panel,
body.mp-body .oa-section-panel { display: none; }
[data-owner-zaehler] .oa-section-panel.is-active,
body.mp-body .oa-section-panel.is-active { display: block; animation: mpFade 0.28s ease; }
[data-owner-zaehler] .oa-section-panel .mp-section-title,
body.mp-body .oa-section-panel .mp-section-title { margin-top: 8px; }

.oa-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 4px 4px; }
.oa-pagehead h1 { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--mp-text); }
.oa-pagehead p { margin: 4px 0 0; color: var(--mp-muted); font-size: .9375rem; }
.oa-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; background: var(--mp-highlight-10); color: var(--mp-highlight);
}
.oa-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mp-highlight); }

[data-owner-zaehler] .oa-section-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--mp-border, #e4ece9);
}
[data-owner-zaehler] .oa-section-nav-row .oa-section-nav {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-bottom: none;
}
[data-owner-zaehler] .oa-status--nav {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

.oa-ribbon {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 2px;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mp-faint);
}
.oa-ribbon .material-icons { font-size: 14px; }
.oa-ribbon a { color: var(--mp-highlight); text-decoration: none; font-weight: 700; }
.oa-ribbon a:hover { text-decoration: underline; }

.oa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.oa-card-head .mp-h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.oa-card-head .material-icons { font-size: 20px; color: var(--mp-highlight); }
.oa-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: .8125rem; color: var(--mp-faint); }
.oa-note .material-icons { font-size: 16px; margin-top: 1px; }
.oa-2col { display: grid; gap: 14px; }
@media (min-width: 900px) { .oa-2col { grid-template-columns: 1fr 1.2fr; } }

.oz-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 4px 0 14px;
}
.oz-toolbar__search {
  flex: 1 1 200px; min-width: 160px; max-width: 320px;
  display: flex; align-items: center; gap: 8px;
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: 999px; padding: 8px 14px;
}
.oz-toolbar__search .material-icons { font-size: 18px; color: var(--mp-faint); }
.oz-toolbar__search input {
  border: none; outline: none; background: transparent; width: 100%;
  font-family: inherit; font-size: .875rem; color: var(--mp-text);
}
.oz-toolbar select {
  border: 1px solid var(--mp-border); background: var(--mp-card); color: var(--mp-text);
  border-radius: 999px; padding: 9px 14px; font-family: inherit; font-size: .8125rem; font-weight: 600;
}
.oz-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--mp-border); background: var(--mp-card); color: var(--mp-muted);
  border-radius: 999px; padding: 9px 14px; font-family: inherit; font-size: .8125rem; font-weight: 600;
  cursor: pointer;
}
.oz-filter-btn.is-active { background: var(--mp-highlight-10); border-color: var(--mp-highlight-20); color: var(--mp-green); }
.oz-unit-count { margin-left: auto; font-size: .8125rem; color: var(--mp-faint); font-weight: 600; }

.oz-pill {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .02em;
}
.oz-pill--on { background: var(--mp-highlight-10); color: var(--mp-highlight); }
.oz-pill--off { background: var(--mp-soft); color: var(--mp-faint); }

.oz-splitbar {
  display: flex; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--mp-viz-track); margin-top: 8px;
}
.oz-splitbar__solar { background: var(--mp-highlight); }
.oz-splitbar__grid { background: var(--mp-grid-color); }

.oz-spark { width: 100%; height: 36px; display: block; }
.oz-empty { color: var(--mp-muted); font-size: .9375rem; padding: 24px 8px; }
.oz-muted { color: var(--mp-muted); font-size: .8125rem; margin: 0 0 6px; }

/* ─── Hero: Verteilungsfluss (SOTA) ─── */
.oz-hero {
  background: var(--oz-hero-grad);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px 22px 18px;
  margin: 10px 0 16px;
  position: relative;
  overflow: hidden;
}
.oz-hero::before {
  content: '';
  position: absolute; top: -80px; right: -40px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(111,240,192,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.oz-hero::after {
  content: '';
  position: absolute; bottom: -60px; left: -30px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(238,165,78,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.oz-hero__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 4px; position: relative; z-index: 1;
}
.oz-hero__title {
  display: flex; align-items: center; gap: 9px;
  color: #fff; font-weight: 700; font-size: 1.05rem;
}
.oz-hero__title .material-icons { color: #6ff0c0; font-size: 22px; }
.oz-hero__meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 600; color: #cfeee0;
}
.oz-hero__meta .oa-status__dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6ff0c0;
  box-shadow: 0 0 0 0 rgba(111,240,192,0.45);
  animation: ozPulse 2s infinite;
}
@keyframes ozPulse {
  0% { box-shadow: 0 0 0 0 rgba(111,240,192,0.45); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.oz-hero__grid {
  display: grid; gap: 14px; position: relative; z-index: 1;
}
@media (min-width: 960px) {
  .oz-hero__grid { grid-template-columns: 1.35fr 1fr; align-items: stretch; }
}
.oz-hero__mosaic-wrap {
  background: rgba(8, 34, 26, 0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 12px 12px 10px;
  backdrop-filter: blur(6px);
}
.oz-hero__mosaic-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 10px; color: rgba(255,255,255,0.75);
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.oz-hero__mosaic-head span:last-child { color: #6ff0c0; text-transform: none; letter-spacing: 0; }

.oz-flow { position: relative; width: 100%; min-height: 320px; }
@media (max-width: 640px) {
  .oz-flow { min-height: 360px; }
  .oz-flow__node { width: 104px; }
  .oz-flow__node-value { font-size: .9rem; }
}
.oz-flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.oz-flow__stream { stroke-dasharray: 3 11; animation: ozFlow 0.9s linear infinite; }
@keyframes ozFlow { to { stroke-dashoffset: -14; } }
@media (prefers-reduced-motion: reduce) {
  .oz-flow__stream { animation: none; }
  .oz-flow__dot { display: none; }
  .oz-hero__meta .oa-status__dot { animation: none; }
  .oz-mosaic__cell.is-hot .oz-mosaic__fill { animation: none; }
}
.oz-flow__node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; width: 124px; z-index: 2;
}
.oz-flow__node-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; backdrop-filter: blur(6px); margin-bottom: 3px;
}
.oz-flow__node-icon .material-icons { font-size: 26px; }
.oz-flow__node--pv .oz-flow__node-icon {
  background: rgba(111,240,192,0.22); border-color: rgba(111,240,192,0.5); color: #6ff0c0;
  box-shadow: 0 0 28px rgba(111,240,192,0.4);
  margin-bottom: 0;
}
.oz-flow__node--solar .oz-flow__node-icon {
  background: rgba(111,240,192,0.16); border-color: rgba(111,240,192,0.38); color: #6ff0c0;
}
.oz-flow__node--haus .oz-flow__node-icon {
  background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.28); color: #fff;
  box-shadow: 0 0 20px rgba(255,255,255,0.12);
}
.oz-flow__node--grid .oz-flow__node-icon {
  background: rgba(203,213,225,0.14); border-color: rgba(203,213,225,0.35); color: #e2e8f0;
}
.oz-flow__node--open .oz-flow__node-icon {
  background: rgba(238,165,78,0.18); border-color: rgba(238,165,78,0.45); color: #f0b35a;
}
.oz-flow__node--above { gap: 6px; }
.oz-flow__node-copy {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 10px; border-radius: 10px;
  background: rgba(8, 34, 26, 0.62); backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}
.oz-flow__node-title {
  font-size: .7rem; font-weight: 600; color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: .04em;
}
.oz-flow__node-value { font-size: 1.02rem; font-weight: 700; color: #fff; line-height: 1.1; }
.oz-flow__edge {
  position: absolute; transform: translate(-50%, -50%); z-index: 3;
  font-size: .7rem; font-weight: 700; color: #08221a;
  background: #6ff0c0; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.oz-flow__edge--grid { background: #cbd5e1; color: #1e293b; }
.oz-flow__edge--open { background: #eea54e; color: #1a1206; }

/* Living unit mosaic */
.oz-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (min-width: 480px) {
  .oz-mosaic { grid-template-columns: repeat(6, 1fr); }
}
.oz-mosaic__cell {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.oz-mosaic__cell:hover, .oz-mosaic__cell:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(111,240,192,0.55);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  outline: none;
  z-index: 2;
}
.oz-mosaic__fill {
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    rgba(111,240,192, calc(0.15 + var(--oz-solar) * 0.007)) 0%,
    rgba(30,185,122, calc(0.2 + var(--oz-intensity) * 0.005)) 100%
  );
  opacity: 0.9;
}
.oz-mosaic__cell.is-off .oz-mosaic__fill {
  background: rgba(148,163,184,0.18);
}
.oz-mosaic__cell.is-hot .oz-mosaic__fill {
  animation: ozGlow 2.4s ease-in-out infinite;
}
@keyframes ozGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.oz-mosaic__cell.is-cool .oz-mosaic__fill {
  background: linear-gradient(160deg, rgba(238,165,78,0.35), rgba(148,163,184,0.25));
}
.oz-mosaic__label {
  position: relative; z-index: 1;
  display: block; margin-top: 22%;
  font-size: .65rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}
.oz-mosaic__meta {
  position: relative; z-index: 1;
  display: block;
  font-size: .6rem; font-weight: 600; color: rgba(255,255,255,0.72);
}
.oz-hero__legend {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  margin-top: 12px; position: relative; z-index: 1;
  font-size: .75rem; font-weight: 600; color: rgba(255,255,255,0.7);
}
.oz-hero__legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px;
}

/* KPI polish */
body.theme-light .mp-card.mp-kpi,
[data-owner-zaehler] .mp-card.mp-kpi { position: relative; overflow: hidden; }
body.theme-light .mp-card.mp-kpi::before,
[data-owner-zaehler] .mp-card.mp-kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--mp-highlight), #7be0b6);
}
.mp-kpi .mp-kpi__icon { color: var(--mp-highlight); background: var(--mp-highlight-10); }
.oz-kpi-spark { width: 100%; margin-top: 4px; min-height: 36px; }
.oz-kpi-spark .oz-spark { height: 36px; }

.oz-donut { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.oz-donut--row {
  width: auto; height: auto; margin: 0;
  display: flex; align-items: center; gap: 22px;
}
@media (max-width: 420px) {
  .oz-donut--row { flex-direction: column; gap: 14px; }
}
.oz-donut__chart { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.oz-donut svg { width: 100%; height: 100%; display: block; }
.oz-donut__arc { transition: stroke-dasharray .4s ease; }
.oz-donut__center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.oz-donut__top { font-size: 1.35rem; font-weight: 700; color: var(--mp-text); }
.oz-donut__sub { font-size: .75rem; color: var(--mp-muted); }
.oz-donut__legend {
  flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  font-size: .875rem;
}
.oz-donut__legend-row {
  display: flex; align-items: center; gap: 9px; color: var(--mp-muted);
}
.oz-donut__legend-row i {
  width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0;
}
.oz-donut__legend-row strong {
  margin-left: auto; color: var(--mp-text); font-weight: 700;
}
.oz-donut-legend {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 12px; font-size: .8125rem; color: var(--mp-muted);
}
.oz-donut-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
}

.oz-trend { width: 100%; height: 240px; }
.oz-trend--tall { height: 280px; }
.oz-trend--compare { height: 340px; }
.oz-trend--compare-sm { height: 260px; }
@media (max-width: 640px) {
  .oz-trend { height: 200px; }
  .oz-trend--tall { height: 230px; }
  .oz-trend--compare { height: 280px; }
  .oz-trend--compare-sm { height: 220px; }
}
.oz-trend-svg { width: 100%; height: 100%; display: block; }

.oz-compare-card .oa-card-head { margin-bottom: 12px; }
.oz-compare-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
}
.oz-compare-chip {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 45%, var(--mp-border));
  background: color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 10%, var(--mp-soft));
  border-radius: 14px; padding: 8px 12px 8px 10px;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.oz-compare-chip:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 16%, var(--mp-card));
}
.oz-compare-chip__swatch {
  width: 10px; height: 34px; border-radius: 999px;
  background: var(--oz-compare-color, var(--mp-highlight));
  flex: 0 0 auto;
}
.oz-compare-chip__body {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.oz-compare-chip__body strong {
  font-size: .875rem; color: var(--mp-text); line-height: 1.2;
}
.oz-compare-chip__body span {
  font-size: .6875rem; font-weight: 600; color: var(--mp-muted);
}
.oz-compare-chip__peak {
  font-size: .6875rem; font-weight: 700;
  color: var(--oz-compare-color, var(--mp-highlight));
  margin-left: 4px; white-space: nowrap;
}

.oz-compare-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: oz-draw-line .9s ease forwards;
}
.oz-compare-area {
  opacity: 0;
  animation: oz-fade-area .7s ease forwards;
}
@keyframes oz-draw-line {
  to { stroke-dashoffset: 0; }
}
@keyframes oz-fade-area {
  to { opacity: 1; }
}
.oz-compare-hit { cursor: crosshair; }

.oz-chart-tip {
  position: fixed; z-index: 9999; pointer-events: none;
  min-width: 160px; max-width: 280px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(15, 23, 42, 0.92); color: #e8eef7;
  font-size: 12px; line-height: 1.35;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  opacity: 0; visibility: hidden;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.oz-chart-tip.is-visible {
  opacity: 1; visibility: visible; transform: none;
}
.oz-chart-tip__title {
  font-weight: 700; margin-bottom: 6px; color: #fff;
}
.oz-chart-tip__row {
  display: flex; align-items: center; gap: 6px;
  justify-content: space-between; margin-top: 3px;
}
.oz-chart-tip__row span { color: #c5d0de; flex: 1; min-width: 0; }
.oz-chart-tip__row strong { color: #fff; font-weight: 600; white-space: nowrap; }
.oz-chart-tip__swatch {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
}

/* Verlauf: einheitenbezogen */
.oz-verlauf-picker {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
}
.oz-chip-pick {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--mp-border); background: var(--mp-card);
  border-radius: 12px; padding: 8px 12px; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.oz-chip-pick strong { font-size: .8125rem; color: var(--mp-text); }
.oz-chip-pick span { font-size: .6875rem; color: var(--mp-faint); font-weight: 600; }
.oz-chip-pick:hover { border-color: var(--mp-highlight-20); transform: translateY(-1px); }
.oz-chip-pick.is-active {
  border-color: var(--mp-highlight);
  background: var(--mp-highlight-10);
  box-shadow: inset 0 0 0 1px var(--mp-highlight-20);
}
.oz-chip-pick.is-off { opacity: 0.72; }
.oz-verlauf-kpis { margin-bottom: 2px; }

.oz-spark-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.oz-spark-tile {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--mp-border); background: var(--mp-soft);
  border-radius: 14px; padding: 10px 12px; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.oz-spark-tile:hover {
  border-color: var(--mp-highlight-20);
  background: var(--mp-card);
  transform: translateY(-1px);
}
.oz-spark-tile.is-compare {
  border-color: var(--oz-compare-color, var(--mp-highlight));
  background: color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 12%, var(--mp-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 35%, transparent);
}
.oz-spark-tile.is-active {
  border-color: var(--oz-compare-color, var(--mp-highlight));
  background: color-mix(in srgb, var(--oz-compare-color, var(--mp-highlight)) 18%, var(--mp-card));
}
.oz-spark-tile.is-off { opacity: 0.7; }
.oz-spark-tile__dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--oz-compare-color, var(--mp-highlight));
  margin-right: 6px; vertical-align: middle;
}
.oz-spark-tile__head {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
}
.oz-spark-tile__head strong { font-size: .8125rem; color: var(--mp-text); }
.oz-spark-tile__head span { font-size: .6875rem; font-weight: 700; color: var(--mp-highlight); }
.oz-spark-tile .oz-spark { height: 32px; }
.oz-spark-tile__foot {
  font-size: .6875rem; font-weight: 600; color: var(--mp-muted);
}

/* Cards (v1) */
.oz-cards {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .oz-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .oz-cards { grid-template-columns: 1fr 1fr 1fr; } }
.oz-card {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: 16px; padding: 16px; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.oz-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--mp-highlight), transparent);
  opacity: 0.85;
}
.oz-card.is-off::after { background: var(--mp-grid-color); opacity: 0.5; }
.oz-card:hover, .oz-card:focus-visible {
  border-color: var(--mp-highlight-20);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px); outline: none;
}
.oz-splitbar__solar {
  transition: width .35s ease;
}
.oz-card.is-off { opacity: 0.78; }
.oz-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.oz-card__head strong { display: block; font-size: .9375rem; color: var(--mp-text); }
.oz-card__sub { display: block; font-size: .75rem; color: var(--mp-faint); margin-top: 2px; }
.oz-card__value { font-size: 1.35rem; font-weight: 700; margin: 10px 0 4px; color: var(--mp-text); }
.oz-card__spark { margin: 4px 0 2px; }
.oz-card__foot {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; font-size: .75rem; color: var(--mp-muted); font-weight: 600;
}

/* Table (v2) */
.oz-table-wrap { overflow-x: auto; border: 1px solid var(--mp-border); border-radius: 16px; background: var(--mp-card); }
.oz-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.oz-table th {
  text-align: left; padding: 12px 14px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--mp-faint);
  border-bottom: 1px solid var(--mp-border); background: var(--mp-soft);
}
.oz-table td { padding: 14px; border-bottom: 1px solid var(--mp-border); color: var(--mp-text); vertical-align: middle; }
.oz-table tr { cursor: pointer; transition: background .15s; }
.oz-table tbody tr:hover { background: var(--mp-highlight-10); }
.oz-table tr.is-off { opacity: 0.75; }
.oz-td-sub { font-size: .75rem; color: var(--mp-faint); margin-top: 2px; }
.oz-td-muted { color: var(--mp-muted); white-space: nowrap; }
.oz-td-solar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.oz-td-solar .oz-splitbar { flex: 1; margin: 0; }
.oz-td-solar span { font-weight: 700; font-size: .8125rem; min-width: 36px; }

.oz-drawer {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
}
.oz-drawer.is-open { pointer-events: auto; }
.oz-drawer__backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35);
  opacity: 0; transition: opacity .2s;
}
.oz-drawer.is-open .oz-drawer__backdrop { opacity: 1; }
.oz-drawer__panel {
  position: absolute; top: 0; right: 0; width: min(420px, 100%); height: 100%;
  background: var(--mp-card); border-left: 1px solid var(--mp-border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.oz-drawer.is-open .oz-drawer__panel { transform: translateX(0); }
.oz-drawer__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--mp-border);
}
.oz-drawer__bar h2 { margin: 0; font-size: 1rem; }
.oz-drawer__close {
  border: none; background: var(--mp-soft); color: var(--mp-muted);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.oz-drawer__body { padding: 16px 18px 40px; overflow-y: auto; flex: 1; }

/* Split (v3) */
.oz-split {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
  min-height: 420px;
}
@media (min-width: 900px) {
  .oz-split { grid-template-columns: 280px 1fr; align-items: start; }
}
.oz-split-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 70vh; overflow-y: auto;
  padding-right: 4px;
}
.oz-split-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  text-align: left; border: 1px solid var(--mp-border); background: var(--mp-card);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.oz-split-item__title { font-weight: 700; font-size: .875rem; color: var(--mp-text); }
.oz-split-item__meta { font-size: .75rem; color: var(--mp-faint); grid-column: 1; }
.oz-split-item .oz-pill { grid-column: 2; grid-row: 1 / span 2; }
.oz-split-item:hover { border-color: var(--mp-highlight-20); }
.oz-split-item.is-active {
  border-color: var(--mp-highlight); background: var(--mp-highlight-10);
  box-shadow: inset 0 0 0 1px var(--mp-highlight-20);
}
.oz-split-item.is-off { opacity: 0.75; }
.oz-split-detail {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: 16px; padding: 18px 20px;
}

.oz-detail__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.oz-detail__sub { margin: 4px 0 0; color: var(--mp-muted); font-size: .875rem; }
.oz-detail__kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
@media (min-width: 600px) { .oz-detail__kpis { grid-template-columns: repeat(4, 1fr); } }
.oz-detail__kpi {
  background: var(--mp-soft); border-radius: 12px; padding: 10px 12px;
}
.oz-detail__kpi span { display: block; font-size: .75rem; color: var(--mp-muted); }
.oz-detail__kpi strong { font-size: 1.05rem; color: var(--mp-text); }
.oz-detail__spark-wrap { margin: 14px 0; }
.oz-detail__spark-wrap .oz-spark { height: 48px; }
.oz-detail__meta { margin-top: 12px; }

/* Ranking (v4) */
.oz-insight-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .oz-insight-grid { grid-template-columns: 1fr 1fr; } }
.oz-insight__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.oz-insight__list li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--mp-soft); cursor: pointer;
}
.oz-insight__list li:hover { background: var(--mp-highlight-10); }
.oz-insight__list strong { display: block; font-size: .875rem; }
.oz-insight__list span { font-size: .75rem; color: var(--mp-faint); }
.oz-insight__list em { font-style: normal; font-weight: 700; font-size: .875rem; color: var(--mp-highlight); }
.oz-insight__rank {
  width: 28px; height: 28px; border-radius: 8px; background: var(--mp-card);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem; color: var(--mp-green);
}
.oz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.oz-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--mp-border); background: var(--mp-soft);
  border-radius: 999px; padding: 8px 12px; font-family: inherit;
  font-size: .8125rem; font-weight: 600; color: var(--mp-text); cursor: pointer;
}
.oz-chip .material-icons { font-size: 16px; color: var(--mp-yellow); }
.oz-chip--soft { cursor: default; color: var(--mp-muted); }
.oz-chip--soft .material-icons { color: var(--mp-highlight); }

/* Floors (v5) */
.oz-floor {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
}
.oz-floor__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.oz-floor__head h3 { margin: 0; font-size: 1rem; color: var(--mp-text); }
.oz-floor__head span { font-size: .8125rem; color: var(--mp-faint); font-weight: 600; }
.oz-floor-row {
  display: grid; grid-template-columns: 110px 1fr 88px; gap: 10px; align-items: center;
  padding: 8px 4px; border-radius: 10px; cursor: pointer;
}
.oz-floor-row:hover, .oz-floor-row:focus-visible { background: var(--mp-highlight-10); outline: none; }
.oz-floor-row.is-off { opacity: 0.72; }
.oz-floor-row__label strong { display: block; font-size: .8125rem; }
.oz-floor-row__label span { font-size: .6875rem; color: var(--mp-faint); }
.oz-floor-row__track {
  height: 14px; border-radius: 999px; background: var(--mp-viz-track); overflow: hidden;
}
.oz-floor-row__fill {
  height: 100%; border-radius: 999px; background: var(--mp-grid-color);
  position: relative; min-width: 2px; transition: width .25s ease;
}
.oz-floor-row__solar {
  display: block; height: 100%; background: var(--mp-highlight); border-radius: 999px;
}
.oz-floor-row__val { text-align: right; font-size: .8125rem; font-weight: 700; color: var(--mp-text); }
.oz-floor-row__val small { display: block; font-weight: 600; color: var(--mp-faint); font-size: .6875rem; }
@media (max-width: 560px) {
  .oz-floor-row { grid-template-columns: 1fr; gap: 4px; }
  .oz-floor-row__val { text-align: left; }
}

/* Compare bars */
.oz-rank-row {
  display: grid; grid-template-columns: 28px minmax(100px, 140px) 1fr auto;
  gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--mp-border); cursor: pointer;
}
.oz-rank-row:hover { background: var(--mp-highlight-10); }
.oz-rank-row.is-off { opacity: 0.7; }
.oz-rank-row__pos {
  width: 28px; height: 28px; border-radius: 8px; background: var(--mp-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--mp-green);
}
.oz-rank-row__meta strong { display: block; font-size: .8125rem; }
.oz-rank-row__meta span { font-size: .6875rem; color: var(--mp-faint); }
.oz-rank-row__bar-wrap { height: 10px; background: var(--mp-viz-track); border-radius: 999px; overflow: hidden; }
.oz-rank-row__bar { height: 100%; background: var(--mp-highlight); border-radius: 999px; }
.oz-rank-row__val { font-size: .8125rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
  .oz-rank-row { grid-template-columns: 28px 1fr auto; }
  .oz-rank-row__bar-wrap { grid-column: 2 / -1; }
}

/* Erkenntnisse & Empfehlungen */
.oz-rec-panel {
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: 16px;
  padding: 16px 18px 18px;
}
.oz-rec-lead {
  margin: 0 0 14px;
  font-size: .875rem;
  color: var(--mp-muted);
  line-height: 1.45;
  max-width: 62ch;
}
.oz-rec-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--mp-highlight);
  background: var(--mp-highlight-10);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.oz-insight-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .oz-insight-cards:not(.oz-insight-cards--teaser) {
    grid-template-columns: 1fr 1fr;
  }
}
.oz-rec {
  border: 1px solid var(--mp-border);
  border-radius: 16px;
  padding: 16px 16px 14px;
  background: var(--mp-bg);
  border-left: 4px solid var(--mp-faint);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: mpFade 0.28s ease;
}
.oz-rec--opportunity { border-left-color: var(--mp-highlight); }
.oz-rec--attention { border-left-color: var(--mp-yellow); }
.oz-rec--positive { border-left-color: #3aa0d8; }
body.theme-dark .oz-rec--positive { border-left-color: #6fd3ff; }
.oz-rec__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.oz-rec__icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mp-soft); color: var(--mp-green);
}
.oz-rec--opportunity .oz-rec__icon { background: var(--mp-highlight-10); color: var(--mp-highlight); }
.oz-rec--attention .oz-rec__icon { background: rgba(238,165,78,0.15); color: #c47a1a; }
.oz-rec--positive .oz-rec__icon { background: rgba(58,160,216,0.14); color: #2a7fb0; }
.oz-rec__icon .material-icons { font-size: 18px; }
.oz-rec__badge {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--mp-muted);
}
.oz-rec__impact {
  margin-left: auto;
  font-size: .75rem; font-weight: 700;
  color: var(--mp-highlight);
  background: var(--mp-highlight-10);
  padding: 3px 9px; border-radius: 999px;
}
.oz-rec__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mp-text);
  line-height: 1.3;
}
.oz-rec__finding,
.oz-rec__reco {
  margin: 0;
  font-size: .8125rem;
  color: var(--mp-muted);
  line-height: 1.5;
}
.oz-rec__finding strong,
.oz-rec__reco strong {
  color: var(--mp-text);
  font-weight: 700;
}
.oz-rec__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.oz-rec__actions .mp-btn {
  font-size: .8125rem;
  padding: 8px 14px;
}
.oz-rec-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  border: none;
  background: transparent;
  color: var(--mp-highlight);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.oz-rec-more .material-icons { font-size: 18px; }
.oz-rec-more:hover { text-decoration: underline; }

.oz-faq { display: flex; flex-direction: column; gap: 10px; }
.oz-faq details {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: 14px; padding: 12px 16px;
}
.oz-faq summary {
  cursor: pointer; font-weight: 700; font-size: .9375rem; color: var(--mp-text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.oz-faq summary::-webkit-details-marker { display: none; }
.oz-faq summary .material-icons { color: var(--mp-faint); transition: transform .2s; }
.oz-faq details[open] summary .material-icons { transform: rotate(180deg); }
.oz-faq p { margin: 10px 0 2px; font-size: .875rem; color: var(--mp-muted); line-height: 1.5; }

body.oz-popup-open { overflow: hidden; }

[data-owner-zaehler].is-loading {
  pointer-events: none;
}
[data-owner-zaehler].is-hydrating [data-oz-dist],
[data-owner-zaehler].is-hydrating [data-oz-donut],
[data-owner-zaehler].is-hydrating [data-oz-verlauf],
[data-owner-zaehler].is-hydrating [data-oz-spark-wall],
[data-owner-zaehler].is-hydrating .oz-spark {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}
[data-owner-zaehler].is-empty .mp-kpi__value,
[data-owner-zaehler].is-api-error .mp-kpi__value {
  color: var(--mp-faint);
}

/* Unit detail popup */
.oz-unit-popup {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none;
}
.oz-unit-popup.is-open { pointer-events: auto; }
.oz-unit-popup__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0; transition: opacity .2s ease;
}
.oz-unit-popup.is-open .oz-unit-popup__backdrop { opacity: 1; }
.oz-unit-popup__dialog {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  padding: 20px 20px 18px;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.oz-unit-popup.is-open .oz-unit-popup__dialog {
  transform: none; opacity: 1;
}
.oz-unit-popup__close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--mp-border); background: var(--mp-soft);
  color: var(--mp-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.oz-unit-popup__close:hover { color: var(--mp-text); border-color: var(--mp-highlight-20); }
.oz-unit-popup__close .material-icons { font-size: 20px; }

.oz-popup__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding-right: 40px; margin-bottom: 14px;
}
.oz-popup__identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.oz-popup__badge {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--mp-highlight) 16%, var(--mp-soft));
  color: var(--mp-highlight);
}
.oz-popup__badge .material-icons { font-size: 22px; }
.oz-popup__title {
  margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--mp-text); line-height: 1.2;
}
.oz-popup__sub {
  margin: 4px 0 0; font-size: .8125rem; color: var(--mp-muted); font-weight: 600;
}

.oz-popup__insight {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
  font-size: .875rem; line-height: 1.45; color: var(--mp-text);
}
.oz-popup__insight .material-icons { font-size: 20px; margin-top: 1px; flex: 0 0 auto; }
.oz-popup__insight p { margin: 0; }
.oz-popup__insight--good {
  background: color-mix(in srgb, var(--mp-highlight) 14%, var(--mp-soft));
  color: var(--mp-text);
}
.oz-popup__insight--good .material-icons { color: var(--mp-highlight); }
.oz-popup__insight--warn {
  background: color-mix(in srgb, #eea54e 18%, var(--mp-soft));
}
.oz-popup__insight--warn .material-icons { color: #d8892f; }
.oz-popup__insight--info {
  background: var(--mp-soft);
}
.oz-popup__insight--info .material-icons { color: var(--mp-muted); }

.oz-popup__kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 14px;
}
.oz-popup__kpi {
  border: 1px solid var(--mp-border); background: var(--mp-soft);
  border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.oz-popup__kpi span {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--mp-faint);
}
.oz-popup__kpi strong {
  font-size: 1.2rem; font-weight: 700; color: var(--mp-text); line-height: 1.2;
}
.oz-popup__kpi small {
  font-size: .75rem; font-weight: 600; color: var(--mp-muted);
}

.oz-popup__viz {
  display: grid; gap: 12px; margin-bottom: 14px;
}
@media (min-width: 520px) {
  .oz-popup__viz { grid-template-columns: 1.2fr 1fr; align-items: end; }
}
.oz-popup__viz-label {
  margin: 0 0 8px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--mp-faint);
}
.oz-popup__split-track {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--mp-grid-color) 55%, var(--mp-soft));
}
.oz-popup__split-solar {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--mp-highlight), color-mix(in srgb, var(--mp-highlight) 70%, #fff));
  border-radius: 999px;
}
.oz-popup__split-labels {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; font-size: .75rem; font-weight: 600; color: var(--mp-muted);
}
.oz-popup__split-labels i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.oz-popup__viz-spark .oz-spark { height: 56px; }
.oz-popup__note { margin: 0; }

.oz-popup__meta {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  margin: 0 0 16px; padding: 0;
}
@media (min-width: 480px) {
  .oz-popup__meta { grid-template-columns: 1fr 1fr 1fr; }
}
.oz-popup__meta > div {
  border: 1px solid var(--mp-border); border-radius: 12px;
  padding: 10px 12px; background: var(--mp-card);
}
.oz-popup__meta dt {
  margin: 0; font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--mp-faint);
}
.oz-popup__meta dd {
  margin: 4px 0 0; font-size: .875rem; font-weight: 700; color: var(--mp-text);
  word-break: break-all;
}

.oz-popup__actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.oz-popup__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--mp-border); background: var(--mp-soft);
  color: var(--mp-text); border-radius: 12px;
  padding: 10px 14px; font-family: inherit; font-size: .875rem; font-weight: 700;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.oz-popup__btn .material-icons { font-size: 18px; }
.oz-popup__btn:hover { border-color: var(--mp-highlight-20); background: var(--mp-card); }
.oz-popup__btn--primary {
  background: var(--mp-highlight); border-color: var(--mp-highlight); color: #fff;
}
.oz-popup__btn--primary:hover {
  filter: brightness(1.05);
  background: var(--mp-highlight); border-color: var(--mp-highlight);
}

@media (max-width: 520px) {
  .oz-popup__kpis { grid-template-columns: 1fr 1fr; }
  .oz-popup__kpi strong { font-size: 1.05rem; }
}
