/* Energie-Cockpit im Stil von kurt-kaelin.ch: helles Grau, weisse Karten, Grün als Leitfarbe, Gelb als Akzent.
   Layout: Kopfkarte mit Reitern, grüne Einstiegskarte, Kacheln, Karten im Raster, dunkle Fusszeile. Bewusst nur ein (helles) Erscheinungsbild. */
#dash-root { --dash-gutter: 0; }
.ec {
  --green: #009f4e; --green-dark: #00803f; --green-soft: #eaf5ee; --yellow: #ffed00; --ink: #262d33; --text: #4b5157;
  --muted: #6b7178; --bg: #f5f5f5; --panel: #ffffff; --line: #e6e6e6; --grid: #eceeef; --axis: #b9bdc1; --ref: #7a8086;
  --bad: #c62828; --warn: #b26a00; --ok: #00803f;
  --f-body: 'Roboto', Arial, Helvetica, sans-serif; --f-head: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  --r: 12px;
  /* Tokens fuer die Diagrammbibliothek */
  --color-fg: var(--ink); --color-fg-muted: var(--muted); --color-panel: var(--panel); --color-bg: var(--bg); --color-border-line: var(--line);
  --cds-chart-grid: var(--grid); --cds-chart-axis: var(--axis); --cds-chart-reference: var(--ref); --cds-chart-muted: #c9cdd2;
  --cds-chart-status-critical: var(--bad); --cds-surface-popover: #fff; --cds-border: var(--line); --cds-text-secondary: var(--muted);
  --cds-shadow-popover: 0 6px 18px rgba(38, 45, 51, .14); --cds-radius: 8px; --font-anthropic-sans: var(--f-body);
  color-scheme: light;
  font-family: var(--f-body); font-size: 15px; color: var(--text); background: var(--bg);
  display: grid; gap: 20px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  border-radius: 0;
}
.ec, .ec *, .ec *::before, .ec *::after { box-sizing: border-box; }
.ec > * { max-width: 1320px; width: 100%; margin-inline: auto; min-width: 0; }
.ec [hidden] { display: none !important; }
.ec h1, .ec h2, .ec h3 { font-family: var(--f-head); font-weight: 700; color: var(--ink); margin: 0; text-wrap: balance; line-height: 1.15; }
.ec h2 { font-size: 21px; }
.ec h3 { font-size: 17px; margin-top: 4px; }
.ec p { margin: 0; }
.ec b { font-weight: 700; }

/* Kopfkarte */
.ec-top { background: var(--panel); border-radius: var(--r); box-shadow: 0 1px 3px rgba(38, 45, 51, .08); padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.ec-brand { display: flex; align-items: center; gap: 12px; }
.ec-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--green); color: #fff; font-family: var(--f-head); font-weight: 800; font-style: italic; font-size: 24px; display: grid; place-items: center; }
.ec-brand-name { font-family: var(--f-head); font-weight: 700; font-size: 19px; color: var(--ink); line-height: 1.1; }
.ec-brand-sub { font-size: 12.5px; color: var(--muted); }
.ec-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.ec-tabs button { font: 500 15px var(--f-body); color: var(--ink); background: transparent; border: 0; border-radius: 999px; padding: 8px 13px; cursor: pointer; }
.ec-tabs button:hover { color: var(--green); }
.ec-tabs button[aria-selected="true"] { background: var(--green); color: #fff; font-weight: 700; }
.ec button:focus-visible, .ec select:focus-visible, .ec input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Filterleiste */
.ec-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; font-size: 13px; color: var(--muted); }
.ec-filter-lab { margin-right: auto; }
.ec select, .ec input[type="search"] { font: 15px var(--f-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.ec input[type="search"] { width: min(100%, 22rem); }
.ec-seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.ec-seg button { font: 500 14px var(--f-body); color: var(--ink); background: transparent; border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.ec-seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.ec-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ec-filterline { display: flex; gap: 8px; }

/* Seiten */
.ec-page { display: grid; gap: 20px; }
.ec-hero { background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); color: #fff; border-radius: var(--r); padding: clamp(22px, 4vw, 44px); display: grid; gap: 16px; }
.ec-kicker { font: 700 13px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .92); }
.ec-hero h1 { color: #fff; font-size: clamp(34px, 5.5vw, 60px); }
.ec-hl { display: inline-block; background: var(--yellow); color: var(--ink); font-style: italic; font-weight: 800; text-transform: uppercase; padding: 0 .18em; transform: rotate(-2deg); margin-left: .1em; }
.ec-hero-text { font-size: 17px; line-height: 1.6; max-width: 68ch; color: #fff; }
.ec-hero-text b { color: var(--yellow); font-variant-numeric: tabular-nums; }
.ec-hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ec-btn { font: 700 15px var(--f-body); border-radius: 999px; padding: 10px 20px; cursor: pointer; border: 2px solid #fff; }
.ec-btn.light { background: #fff; color: var(--green-dark); }
.ec-btn.ghost { background: transparent; color: #fff; }
.ec-intro { background: var(--panel); border-radius: var(--r); padding: 22px 24px; display: grid; gap: 10px; border-left: 6px solid var(--green); }
.ec-intro p { line-height: 1.6; max-width: 90ch; }
.ec-intro b { color: var(--green-dark); font-variant-numeric: tabular-nums; }
.ec-h { font-size: clamp(24px, 3vw, 32px) !important; }

/* Kacheln */
.ec-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 14px; }
.ec-kpi { background: var(--panel); border-radius: var(--r); box-shadow: 0 1px 3px rgba(38, 45, 51, .06); padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.ec-kpi .num { font-family: var(--f-head); font-weight: 700; font-size: 34px; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1.05; }
.ec-kpi .num small { font-family: var(--f-body); font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 5px; }
.ec-kpi .lab { font-weight: 500; color: var(--ink); font-size: 14px; }
.ec-kpi .chg { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ec-kpi .chg b.down { color: var(--bad); }

/* Karten */
.ec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 31rem), 1fr)); gap: 20px; }
.ec-card { background: var(--panel); border-radius: var(--r); box-shadow: 0 1px 3px rgba(38, 45, 51, .06); padding: 20px 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.ec-card .note { font-size: 13.5px; color: var(--muted); line-height: 1.5; max-width: 95ch; }
.ec-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text); }
.ec-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ec-sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; background: var(--axis); }
.ec-sw.line { height: 3px; width: 16px; border-radius: 2px; }
.ec-sw.band { opacity: .35; }
.ec-sw.dash { height: 0; border-top: 2px dashed var(--ref); background: transparent; width: 16px; border-radius: 0; }
.ec-chart { position: relative; min-height: 300px; }
.ec-chart.tall { min-height: 360px; }
.ec-chart.short { min-height: 200px; }
.ec-chart svg { display: block; overflow: visible; font-family: var(--f-body); }
.ec-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(38, 45, 51, .14); padding: 6px 10px; font-size: 12.5px; line-height: 1.5; white-space: nowrap; z-index: 4; font-variant-numeric: tabular-nums; color: var(--ink); max-width: 340px; }
.ec-tip .t { color: var(--muted); font-weight: 500; white-space: normal; }
.ec-tip .r { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.ec-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ec-tip .r span:last-child { margin-left: 12px; }
.ec-fail { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: inherit; color: var(--muted); font-size: 13px; }
.ec-fail::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: var(--bad); }
.ec-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 14px; }
.ec-stat div { display: grid; gap: 2px; }
.ec-stat .num { font-family: var(--f-head); font-weight: 700; font-size: 26px; color: var(--green); font-variant-numeric: tabular-nums; }
.ec-stat .lab { font-size: 13px; color: var(--muted); }

/* Phasen */
.ec-phasen { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; line-height: 1.55; }
.ec-phasen b { color: var(--ink); }
.ec-phasen li::marker { color: var(--green); font-weight: 700; font-family: var(--f-head); }

/* Tabellen */
.ec-tablewrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 8px; }
.ec-tablewrap.tall { max-height: 560px; }
.ec-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ec-table th { position: sticky; top: 0; background: var(--green-soft); color: var(--ink); text-align: left; font: 700 13px var(--f-body); padding: 8px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.ec-table td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.ec-table .r { text-align: right; }
.ec-table tr:last-child td { border-bottom: 0; }
.ec-table.clickable tbody tr { cursor: pointer; }
.ec-table.clickable tbody tr:hover td { background: var(--green-soft); }
.ec-table tbody tr[aria-selected="true"] td { background: #fff9c4; }
.ec-pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.ec-pill.ok { background: var(--green-soft); color: var(--ok); }
.ec-pill.no { background: #f0f1f2; color: var(--muted); }
.ec-pill.aus { background: #fff9c4; color: #6b5d00; }

/* Deep-Dive */
.ec-deep-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ec-deep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 20px; }
.ec-deep-facts { display: grid; gap: 10px; align-content: start; }
.ec-deep-facts .portrait { line-height: 1.6; }
.ec-deep-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.ec-deep-facts dt { color: var(--muted); }
.ec-deep-facts dd { margin: 0; color: var(--ink); font-weight: 500; }
.ec-deep-facts a { color: var(--green-dark); }

[data-dash-source-state=refreshing] { opacity: .5; transition: opacity .3s; }
[data-dash-source-state=empty] { color: transparent; }

/* Fusszeile */
.ec-foot { background: var(--ink); color: #b9bdc1; border-radius: var(--r) var(--r) 0 0; padding: 22px 24px; font-size: 13.5px; line-height: 1.6; display: grid; gap: 8px; }
.ec-foot b { color: #fff; }
@media (prefers-reduced-motion: no-preference) { .ec-tabs button, .ec-seg button { transition: background .15s, color .15s; } }

/* ---- Anpassungen fuer kurt-kaelin.ch ---- */
.ec { padding: 0 0 8px; background: transparent; }
.ec-top { position: static; }
.ec-brand { display: none; }
.ec-top { justify-content: center; }
.ec-foot { background: var(--panel); color: var(--muted); border-radius: var(--r); box-shadow: 0 1px 3px rgba(38, 45, 51, .06); }
.ec-foot b { color: var(--ink); }
.dash-skeleton { background: linear-gradient(90deg, #eceeef 25%, #f6f7f8 50%, #eceeef 75%); background-size: 200% 100%; border-radius: 8px; }
@media (prefers-reduced-motion: no-preference) { .dash-skeleton { animation: ec-shimmer 1.4s linear infinite; } }
@keyframes ec-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.energie-main { padding-bottom: 40px; }
