:root {
  --page: #f5efe6;
  --page-alt: #fffaf3;
  --page-ink: #232936;
  --page-muted: #6c7484;
  --line-soft: rgba(31, 36, 48, 0.08);
  --line-strong: rgba(31, 36, 48, 0.16);

  --bg: #0f1622;
  --bg-alt: #161f2e;
  --bg-high: #202a3d;
  --border: #2d3a51;
  --text: #edf2fb;
  --text-dim: #98a6bf;
  --accent: #4d79f6;
  --yellow: #e0a43a;
  --green: #5cc489;
  --red: #d15d72;
  --orange: #f08a3e;
  --purple: #8b6cff;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Manrope', 'Segoe UI', sans-serif;
  --shadow: 0 16px 40px rgba(16, 21, 31, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--sans);
  background:
    radial-gradient(circle at top right, rgba(77, 121, 246, 0.08), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(224, 164, 58, 0.08), transparent 22%),
    linear-gradient(180deg, #fbf7f0 0%, var(--page) 100%);
  color: var(--page-ink);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.25;
  mix-blend-mode: soft-light;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(49, 60, 81, 0.85) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(49, 60, 81, 0.85);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.page-shell {
  width: min(1520px, calc(100% - 28px));
  margin: 22px auto 36px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 22px 26px;
  margin-bottom: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: rgba(255, 250, 243, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.header-copy {
  max-width: 780px;
}

.eyebrow,
.panel-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a6655;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  margin-top: 8px;
}

.hero-lead {
  margin-top: 14px;
  max-width: 72ch;
  font-size: 1.02rem;
  color: var(--page-muted);
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 12px;
  flex: 0 0 min(390px, 100%);
  min-width: 320px;
  margin-left: auto;
}

.header-summary {
  width: min(390px, 100%);
  text-align: right;
}

.header-summary .panel-kicker {
  display: block;
  margin-bottom: 8px;
}

.header-scenario-card {
  padding: 12px;
  background: rgba(255,255,255,0.7);
}

.header-scenario-values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.header-scenario-values .scenario-chip {
  min-width: 0;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 4px;
  padding: 10px 11px;
}

.header-scenario-values .scenario-chip strong {
  text-align: left;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, #26324a, #131b27);
  color: #f7f3ed;
  border-color: rgba(255,255,255,0.1);
}

.ghost-btn,
.icon-btn {
  background: rgba(255,255,255,0.72);
  color: var(--page-ink);
  border-color: var(--line-strong);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.toggle-pill:hover {
  transform: translateY(-1px);
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.72);
  font-weight: 700;
}

.toggle-pill input {
  accent-color: var(--accent);
}

.mobile-only {
  display: none;
}

.page-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  position: relative;
  min-width: 0;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 34, 0.45);
  backdrop-filter: blur(4px);
  z-index: 19;
}

.controls-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px 16px 24px 20px;
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,250,243,0.92)),
    var(--page-alt);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(134, 118, 96, 0.56) transparent;
  scrollbar-gutter: stable;
}

@supports selector(::-webkit-scrollbar) {
  .controls-panel {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  .controls-panel::-webkit-scrollbar {
    width: 12px;
  }

  .controls-panel::-webkit-scrollbar-button,
  .controls-panel::-webkit-scrollbar-button:single-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
  }

  .controls-panel::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(192, 174, 148, 0.12));
    border-radius: 999px;
    margin: 8px 2px 8px 0;
  }

  .controls-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 188, 150, 0.9), rgba(139, 121, 99, 0.92));
    border-radius: 999px;
    border: 2px solid rgba(255, 250, 243, 0.94);
    background-clip: padding-box;
  }

  .controls-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(220, 196, 156, 0.96), rgba(132, 114, 93, 0.96));
  }

  .controls-panel::-webkit-scrollbar-corner {
    background: transparent;
  }
}

.controls-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.controls-head h2 {
  margin-top: 6px;
  font-size: 1.5rem;
  line-height: 1.05;
}

.scenario-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.scenario-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--line-soft);
}

.scenario-card.emphasis {
  background: linear-gradient(135deg, rgba(224,164,58,0.1), rgba(77,121,246,0.08));
}

.scenario-card-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #826e5d;
  margin-bottom: 8px;
}

.scenario-card-values {
  display: grid;
  gap: 6px;
  color: var(--page-muted);
}

.scenario-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(35, 41, 54, 0.05);
  font-size: 12px;
}

.scenario-chip span {
  flex: 1 1 auto;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scenario-chip strong {
  color: var(--page-ink);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.control-section + .control-section {
  margin-top: 18px;
}

.control-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a6655;
}

.control-group + .control-group {
  margin-top: 14px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--page-ink);
}

.value {
  color: #9a6a16;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, rgba(77,121,246,0.24), rgba(224,164,58,0.18));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fdf8f1;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(77,121,246,0.16);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fdf8f1;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(77,121,246,0.16);
}

.fixed-prices {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fixed-prices td {
  padding: 7px 0;
  border-bottom: 1px dashed rgba(35, 41, 54, 0.1);
}

.pricing-link {
  color: inherit;
  text-decoration-color: rgba(77, 121, 246, 0.36);
  text-underline-offset: 3px;
  font-weight: 700;
}

.pricing-link:hover {
  color: #1d53d7;
  text-decoration-color: currentColor;
}

.fixed-prices td.num {
  text-align: right;
  font-family: var(--mono);
  font-weight: 600;
  color: #9a6a16;
}

.report {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 250, 243, 0.84);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.hero-card h2 {
  margin-top: 8px;
  font-size: clamp(1.7rem, 2.1vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-card p:not(.panel-kicker) {
  margin-top: 14px;
  max-width: 68ch;
  color: var(--page-muted);
}

.hero-meta-grid {
  display: grid;
  gap: 12px;
}

.hero-meta {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.38));
  border: 1px solid var(--line-soft);
}

.hero-meta-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #826e5d;
}

.hero-meta strong {
  font-size: 1rem;
}

.hero-meta span:last-child {
  color: var(--page-muted);
}

.section-block {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: clamp(1.3rem, 1.55vw, 1.9rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.kpis,
.server-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kpi,
.server-kpi,
.card {
  color: var(--text);
  background: linear-gradient(180deg, rgba(23,31,46,0.95), rgba(15,22,34,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 16px 30px rgba(12, 16, 24, 0.22);
}

.kpi,
.server-kpi {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  display: block;
  min-height: 22px;
  padding-left: 16px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-dim);
}

.kpi-label i,
.kpi-label .kpi-mark {
  position: absolute;
  left: -26px;
  top: -18px;
  display: block;
  min-width: 0;
  font-size: clamp(7.6rem, 11vw, 10.4rem);
  line-height: 0.85;
  color: inherit;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.kpi.cost .kpi-mark {
  left: -12px;
  top: -22px;
  font-size: clamp(8.2rem, 12vw, 11rem);
}

.kpi.payback .kpi-label i {
  left: -12px;
  top: -26px;
  font-size: clamp(8.4rem, 13vw, 11.8rem);
  opacity: 0.17;
  transform: rotate(-4deg);
}

.kpi-label .kpi-title {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.kpi-label .euro-mark {
  font-family: var(--mono);
  font-weight: 700;
}

.kpi-value {
  margin-top: 14px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 1.9vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  text-align: right;
  position: relative;
  z-index: 1;
}

.report > section.kpis .kpi-value {
  font-size: clamp(2rem, 2.45vw, 2.95rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.kpi-value .kpi-unit,
.kpi-value small {
  font-size: 0.52em;
  letter-spacing: 0;
  color: var(--text-dim);
}

.kpi-value .kpi-unit {
  margin-left: 0.28em;
}

.kpi-value small {
  margin-left: 0.42em;
  font-weight: 600;
  text-transform: lowercase;
}

.kpi-sub {
  margin-top: 4px;
  margin-left: auto;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.32;
  text-align: right;
  position: relative;
  z-index: 1;
}

.kpi-sub-split {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.kpi-sub-split > span {
  display: block;
  white-space: nowrap;
}

.kpi-sub-amount {
  color: var(--green);
  font-weight: 700;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--text-dim);
}

.kpi.gen .kpi-value { color: var(--yellow); }
.kpi.store .kpi-value { color: var(--purple); }
.kpi.self .kpi-value { color: var(--green); }
.kpi.cost .kpi-value { color: var(--orange); }
.kpi.savings .kpi-value { color: var(--green); }
.kpi.payback .kpi-value { color: var(--accent); }
.server-kpi .kpi-value { color: #f7f2ea; }

.card {
  padding: 20px;
}

.card-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.chart-card {
  overflow: hidden;
}

.overview-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.35fr);
  align-items: stretch;
  min-width: 0;
}

.overview-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.overview-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-kpis .kpi-value {
  font-size: clamp(2.15rem, 3vw, 3rem);
}

.overview-kpis .kpi.gen .kpi-value {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0.1em;
  min-height: 64px;
  font-size: clamp(2.14rem, 2.92vw, 2.94rem);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-top: 14px;
  padding-top: 8px;
}

.overview-kpis .kpi.gen .kpi-value small {
  font-size: 0.34em;
  margin-left: 0.12em;
  margin-bottom: 0.22em;
  letter-spacing: 0;
}

.overview-kpis .kpi-sub {
  font-size: 13.5px;
}

.overview-stack > .chart-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.overview-stack .monthly-chart {
  flex: 1 1 auto;
  height: 198px;
  min-height: 198px;
}

.grid-net-cost {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
  align-items: start;
  min-width: 0;
}

.grid-net-cost > :only-child {
  grid-column: 1 / -1;
}

.grid-server {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  align-items: start;
  min-width: 0;
}

.grid-server > :only-child {
  grid-column: 1 / -1;
}

.overview-layout > *,
.grid-net-cost > *,
.grid-server > * {
  min-width: 0;
}

.flow-card .flow-detail-wrap {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.flow-detail-wrap > table {
  flex: 1 1 48%;
  max-width: none;
  min-width: 0;
}

.roof-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  align-items: center;
  min-width: 0;
  min-height: 362px;
}

.roof-svg {
  width: min(100%, 424px);
  height: auto;
  margin-inline: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 16px 22px rgba(0,0,0,0.24));
}

.roof-legend {
  justify-content: center;
  row-gap: 10px;
  margin-top: 12px;
}

.roof-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: var(--text-dim);
}

.roof-legend-item strong {
  color: var(--text);
  font-weight: 700;
}

.roof-legend-item .roof-count {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.roof-legend-item .roof-az {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
}

.monthly-chart {
  display: block;
  width: 100%;
  height: 220px;
}

.heatmap-section .totals-strip {
  margin-top: 0;
  margin-bottom: 0;
}

.monthly-footer,
.net-legend,
.monthly-legend,
.tm-legend,
.night-strip-meta,
.night-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.monthly-footer {
  justify-content: space-between;
  margin-top: 10px;
}

.net-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.net-note {
  margin-top: 0;
  margin-left: auto;
  text-align: right;
}

.monthly-legend,
.net-legend,
.tm-legend,
.night-legend {
  font-size: 11px;
  color: var(--text-dim);
}

.night-strip-meta {
  justify-content: space-between;
  margin-top: 12px;
  row-gap: 8px;
}

.server-overview-card .server-night-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.leg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.leg-line {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px dashed rgba(247, 242, 234, 0.82);
  margin-right: 6px;
  vertical-align: middle;
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap {
  display: grid;
  grid-template-columns: 44px repeat(12, minmax(52px, 1fr));
  gap: 1px;
  font-family: var(--mono);
}

.hm-header {
  background: var(--bg-high);
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
}

.hm-corner {
  background: transparent;
}

.hm-row-label {
  background: var(--bg-high);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  border-right: 1px solid var(--border);
}

.hm-cell {
  padding: 4px 2px;
  text-align: center;
  color: var(--text);
  font-size: 10px;
  text-shadow: 0 0 3px rgba(0,0,0,0.6);
  font-weight: 500;
}

.hm-row-label.tot {
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hm-row-label.tot-start,
.hm-total-cell.tot-start {
  border-top: 2px solid rgba(255,255,255,0.14);
}

.hm-total-cell {
  padding: 6px 2px;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: var(--mono);
}

.hm-total-cell .primary {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow:
     0 0 2px rgba(0,0,0,0.85),
     0 0 3px rgba(0,0,0,0.7);
}

.hm-total-cell .secondary {
  font-size: 8px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 2px rgba(0,0,0,0.85);
  margin-top: 1px;
}

.totals-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.total-card {
  padding: 12px 13px;
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(23,31,46,0.95), rgba(15,22,34,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 30px rgba(12, 16, 24, 0.22);
  display: flex;
  flex-direction: column;
  text-align: right;
}

.total-card .lbl {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.total-card .main-val {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
}

.total-card .eur-val {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.total-card .delta {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
}

.total-card.gen .main-val { color: var(--yellow); }
.total-card.stored .main-val { color: var(--purple); }
.total-card.exp .main-val { color: var(--green); }
.total-card.imp .main-val { color: var(--red); }

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cost-table th,
.cost-table td {
  padding: 8px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cost-table th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cost-table td.num,
.cost-table th.num {
  text-align: right;
  font-family: var(--mono);
}

.cost-table td.lbl {
  color: var(--text);
}

.cost-table td.dim {
  color: var(--text-dim);
  font-size: inherit;
}

.cost-table tr.total td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-weight: 700;
  padding-top: 12px;
}

.cost-table td.eur,
.cost-table td.income {
  color: var(--green);
}

.cost-table td.cost {
  color: var(--red);
}

.cost-table td.saved {
  color: var(--yellow);
}

.cost-table tr.parent td {
  font-weight: 600;
}

.cost-table tr.sub td,
.cost-table tr.dim td {
  color: var(--text-dim);
}

.cost-table tr.child td:first-child {
  padding-left: 8px;
}

.cost-table tr.grand td:first-child {
  padding-left: 8px;
}

.flow-indent {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 18px;
  min-width: 18px;
  vertical-align: middle;
}

.flow-indent.level-2 {
  width: 34px;
  min-width: 34px;
}

.flow-branch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-left: 1.5px solid rgba(152,166,191,0.5);
  border-bottom: 1.5px solid rgba(152,166,191,0.5);
  border-radius: 0 0 0 6px;
  transform: translateY(-1px);
}

svg.treemap {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: block;
}

.treemap-inline {
  flex: 0 0 clamp(340px, 36vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.tm-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid;
  margin-right: 4px;
  vertical-align: middle;
}

.tm-legend .eurswatch {
  font-family: var(--mono);
  font-weight: 700;
  margin-right: 2px;
}

.hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
}

.hint.compact,
.hint.inline {
  color: var(--page-muted);
}

.insights-list {
  display: grid;
  gap: 12px;
}

.insight-headline {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(92, 196, 137, 0.1);
  border: 1px solid rgba(92, 196, 137, 0.16);
  color: var(--text);
}

.insight-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-dim);
}

.insight-item i {
  color: var(--yellow);
  font-size: 14px;
  margin-top: 2px;
}

.chart-tip {
  position: absolute;
  display: none;
  pointer-events: none;
  background: rgba(11, 16, 26, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text);
  font-family: var(--mono);
  z-index: 12;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.chart-tip .tip-table {
  border-collapse: collapse;
  margin-top: 4px;
}

.chart-tip .tip-table td {
  padding: 2px 0;
}

.chart-tip .tip-lbl {
  color: var(--text-dim);
  padding-right: 14px;
  text-align: left;
}

.chart-tip .tip-val {
  text-align: right;
  font-weight: 700;
}

.flow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 5px;
}

.server-bar-label {
  font-family: var(--mono);
  font-size: 10px;
}

.legend-note {
  font-size: 11px;
  color: var(--text-dim);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.icon-btn:focus-visible,
.toggle-pill:focus-within,
input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 1260px) {
  .overview-layout,
  .grid-net-cost,
  .grid-server,
  .hero-card {
    grid-template-columns: 1fr;
  }

  .page-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100%, calc(100% - 18px));
    margin: 10px auto 22px;
  }

  .page-header {
    padding: 18px;
    border-radius: 22px;
    flex-direction: column;
  }

  .header-side,
  .header-summary {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
    text-align: left;
  }

  .header-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .mobile-only {
    display: inline-flex;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: fixed;
    inset: 12px auto 12px 12px;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    z-index: 20;
    transform: translateX(calc(-100% - 20px));
    transition: transform 220ms ease;
  }

  body.controls-open .controls-panel {
    transform: translateX(0);
  }

  body.controls-open {
    overflow: hidden;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .overview-kpis,
  .totals-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roof-wrap {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .flow-card .flow-detail-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-detail-wrap > table {
    max-width: none;
  }

  .treemap-inline {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 2.35rem;
  }

  .hero-card,
  .card,
  .controls-panel,
  .page-header,
  .kpi,
  .server-kpi {
    border-radius: 20px;
  }

  .kpi-label {
    padding-left: 24px;
  }

  .kpi-label i,
  .kpi-label .kpi-mark {
    left: -14px;
    top: -10px;
    font-size: 6rem;
  }

  .header-scenario-values {
    grid-template-columns: 1fr;
  }

  .kpis,
  .server-kpis,
  .totals-strip {
    grid-template-columns: 1fr;
  }

  .monthly-footer {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
