:root {
  --bg: #f5f7ef;
  --card: #ffffff;
  --ink: #182016;
  --muted: #5f6d5c;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #f59e0b;
  --line: #d9e2d4;
  --danger: #c2410c;
  --ok: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #e7f7f3 0%, transparent 42%),
    radial-gradient(circle at 90% 0%, #ffe8bf 0%, transparent 30%), var(--bg);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
}

.bg-shape-a {
  width: 380px;
  height: 380px;
  background: #9fe6d3;
  top: -120px;
  right: -80px;
}

.bg-shape-b {
  width: 320px;
  height: 320px;
  background: #fcd78a;
  bottom: -120px;
  left: -80px;
}

.app-shell {
  width: min(1200px, 95vw);
  margin: 2rem auto 4rem;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 1.25rem;
}

.enerkom-site-header {
  font-family: "Nunito Flex", "Space Grotesk", "Segoe UI", sans-serif;
  padding: 0.8rem 1rem;
  margin-bottom: 0.95rem;
  background: linear-gradient(120deg, rgba(243, 249, 236, 0.95), rgba(255, 252, 243, 0.95));
}

.enerkom-site-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.enerkom-site-brand {
  display: inline-flex;
  align-items: center;
}

.enerkom-site-brand img {
  display: block;
  width: min(320px, 62vw);
  height: auto;
}

.app-title {
  font-family: "Nunito Flex", "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 2.16rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #446427;
}

.enerkom-site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.enerkom-site-nav a {
  text-decoration: none;
  border: 1px solid #d4e4c6;
  background: rgba(255, 255, 255, 0.78);
  color: #446427;
  border-radius: 999px;
  padding: 0.3rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.enerkom-site-nav a:hover {
  border-color: #9fc77c;
  background: #edf6e5;
}

.kicker {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand-strong);
  margin: 0;
}

h1 {
  margin: 0.2rem 0 0.5rem;
  line-height: 1.1;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.hero-text {
  margin: 0;
  max-width: 75ch;
  color: var(--muted);
}

.hero-panel {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 0.9rem;
  align-items: stretch;
}

.hero-panel-copy,
.hero-panel-badges {
  border: 1px solid color-mix(in srgb, var(--line) 72%, #ffffff);
  border-radius: 24px;
  padding: 1.15rem 1.2rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 36px rgba(24, 32, 22, 0.07);
}

.hero-panel-copy {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(232, 247, 243, 0.9), rgba(255, 255, 255, 0.86));
}

.hero-panel-copy::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -50px;
  bottom: -70px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
}

.hero-panel-lead {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}

.hero-panel-text {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.hero-panel-badges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  background: linear-gradient(160deg, rgba(232, 247, 243, 0.92), rgba(255, 248, 235, 0.96));
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-action:hover {
  transform: translateY(-1px);
}

.hero-action-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.hero-action-secondary {
  border: 1px solid #bddcd5;
  background: rgba(255, 255, 255, 0.74);
  color: #134842;
}

body:not([data-page]) .hero-action-primary {
  background: linear-gradient(135deg, #73ab40, #5d8f32);
  box-shadow: 0 10px 24px rgba(115, 171, 64, 0.22);
}

body:not([data-page]) .hero-action-primary:hover {
  background: linear-gradient(135deg, #7ab642, #6ab036);
}

body:not([data-page]) .hero-action-secondary {
  border-color: #cadec5;
  background: #eef5e8;
  color: #3f6121;
}

body:not([data-page]) .hero-action-secondary:hover {
  background: #e1f0d8;
}

.hero-spotlight-card {
  display: grid;
  gap: 0.26rem;
  padding: 0.9rem 0.95rem;
  border-radius: 18px;
  color: #163531;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.hero-spotlight-sharing {
  background: linear-gradient(145deg, rgba(222, 244, 238, 0.95), rgba(255, 255, 255, 0.8));
}

.hero-spotlight-simulation {
  background: linear-gradient(145deg, rgba(255, 239, 206, 0.95), rgba(255, 255, 255, 0.82));
}

.hero-spotlight-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2e5a54;
}

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

.hero-spotlight-card span:last-child {
  color: #45615d;
  font-size: 0.88rem;
}

.landing-overview {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.landing-metric-card {
  display: grid;
  gap: 0.18rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, #ffffff);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(246, 251, 247, 0.92));
  box-shadow: 0 12px 26px rgba(24, 32, 22, 0.05);
}

.landing-metric-value {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 700;
  color: var(--brand-strong);
}

.landing-metric-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.landing-card {
  padding: 1.35rem;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 28%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.08), transparent 30%),
    color-mix(in srgb, var(--card) 95%, #ffffff);
}

.landing-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.landing-section-kicker {
  margin: 0 0 0.2rem;
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-section-head h2 {
  margin: 0;
}

.landing-section-text {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  text-align: right;
}

.landing-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.landing-link {
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.2rem;
  background: linear-gradient(145deg, rgba(244, 251, 250, 0.96), rgba(255, 248, 235, 0.98));
  box-shadow: 0 10px 30px rgba(19, 31, 23, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.landing-link::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -70px;
  top: -80px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.landing-link:hover {
  transform: translateY(-4px);
  border-color: #8dc7ba;
  box-shadow: 0 16px 36px rgba(19, 31, 23, 0.12);
}

.landing-link h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.landing-link-eyebrow {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.landing-link p {
  position: relative;
  z-index: 1;
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.landing-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.landing-points span {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #dbe8de;
  color: #32524d;
  font-size: 0.79rem;
  font-weight: 600;
}

.landing-chip {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0f4d48;
  background: #d8efea;
  border: 1px solid #b7dcd4;
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
}

.landing-link-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1rem;
}

.landing-link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #d4e5dd;
  color: #17433e;
  font-size: 1rem;
  font-weight: 700;
}

.enerkom-site-footer {
  font-family: "Nunito Flex", "Space Grotesk", "Segoe UI", sans-serif;
  margin-top: 1.1rem;
  background:
    radial-gradient(circle at top right, rgba(104, 159, 56, 0.13), transparent 30%),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.12), transparent 32%),
    color-mix(in srgb, var(--card) 95%, #ffffff);
}

.enerkom-site-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #dbe7d1;
}

.enerkom-site-footer-cta h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  color: #355426;
}

.enerkom-site-footer-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.enerkom-site-footer-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.enerkom-site-footer-grid h3 {
  margin: 0 0 0.45rem;
  font-size: 0.94rem;
  color: #345424;
}

.enerkom-site-footer-grid a,
.enerkom-site-footer-grid p {
  display: block;
  margin: 0 0 0.24rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.enerkom-site-footer-grid a:hover {
  color: #3f6222;
  text-decoration: underline;
}

.enerkom-site-socials {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.enerkom-site-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #c9dcc0;
  background: rgba(255, 255, 255, 0.78);
  color: #3f5f24;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

.enerkom-site-footer-meta {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dbe7d1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.enerkom-site-footer-meta a {
  color: #3f5f24;
  text-decoration: none;
  font-weight: 700;
}

.enerkom-site-footer-meta a:hover {
  text-decoration: underline;
}

.page-nav {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: #17433e;
  border: 1px solid #b9d8d1;
  background: #eef7f5;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
}

.nav-link.is-active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.card {
  background: color-mix(in srgb, var(--card) 92%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--line) 60%, #ffffff);
  border-radius: 20px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 30px rgba(24, 32, 22, 0.05);
  animation: rise 360ms ease;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

h2,
h3 {
  margin-top: 0.2rem;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.32rem;
  font-weight: 600;
  font-size: 0.95rem;
}

input,
button {
  font: inherit;
}

input[type="file"],
input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.52rem 0.62rem;
  background: #fff;
}

input[type="file"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  color: var(--ink);
}

input[type="file"]::file-selector-button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: linear-gradient(135deg, #689f38, #5d8f32);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  margin-right: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, #73ab40, #689f38);
  box-shadow: 0 4px 12px rgba(104, 159, 56, 0.25);
}

.meta-table,
#producerSummary,
#consumerSummary,
#allocationsTable,
#simulationResult {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.55rem;
  text-align: right;
  white-space: nowrap;
}

th {
  background: #edf6f4;
  text-align: left;
}

th.sortable-header {
  cursor: pointer;
  user-select: none;
}

th.sortable-header:hover {
  background: #e3f1ed;
}

.sort-indicator {
  display: inline-block;
  min-width: 1.2rem;
  margin-left: 0.2rem;
  color: var(--muted);
}

td.ean,
th.ean {
  text-align: left;
}

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

#producerSummary tbody > tr.interactive-row:nth-of-type(odd),
#consumerSummary tbody > tr.interactive-row:nth-of-type(odd) {
  background: rgba(255, 255, 255, 0.92);
}

#producerSummary tbody > tr.interactive-row:nth-of-type(even),
#consumerSummary tbody > tr.interactive-row:nth-of-type(even) {
  background: #f7fbf8;
}

#producerSummary tbody > tr.interactive-row td,
#consumerSummary tbody > tr.interactive-row td {
  border-color: #e2e9de;
}

.summary-hint {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.summary-toolbar {
  margin-bottom: 0.55rem;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.summary-search-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.52rem 0.62rem;
  background: #fff;
}

.search-clear-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.search-clear-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.summary-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.summary-filter-status {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.summary-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.interactive-row {
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.interactive-row:hover {
  background: #eef8f5;
}

.interactive-row.is-selected {
  background: #dff3ee;
  box-shadow: inset 3px 0 0 #10b981;
}

.interactive-row.is-selected td {
  border-color: #9ccfc2;
}

.consumer-main-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.producer-main-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.row-toggle {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid #b7dcd4;
  border-radius: 999px;
  background: #eef7f5;
  color: #17433e;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.consumer-detail-row td {
  background: #fbfdfb;
  padding: 0.7rem 0.8rem;
  border-top: 0;
}

.producer-detail-row td {
  background: #fbfdfb;
  padding: 0.7rem 0.8rem;
  border-top: 0;
}

.consumer-breakdown {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e2e9de;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfefd, #f7fbf8);
}

.producer-breakdown {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e2e9de;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfefd, #f7fbf8);
}

.consumer-breakdown-bars {
  display: grid;
  gap: 0.4rem;
}

.producer-breakdown-bars {
  display: grid;
  gap: 0.4rem;
}

.consumer-breakdown-bar-row,
.producer-breakdown-bar-row {
  display: grid;
  grid-template-columns: minmax(240px, 2.2fr) minmax(180px, 2.2fr) minmax(140px, 140px);
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  padding: 0.38rem 0.5rem;
  border-radius: 10px;
}

.consumer-breakdown-bars > .consumer-breakdown-bar-row:nth-child(odd),
.producer-breakdown-bars > .producer-breakdown-bar-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.9);
}

.consumer-breakdown-bars > .consumer-breakdown-bar-row:nth-child(even),
.producer-breakdown-bars > .producer-breakdown-bar-row:nth-child(even) {
  background: #f3f8f5;
}

.consumer-breakdown-bar-row.is-highlighted {
  background: rgba(15, 118, 110, 0.12);
  box-shadow: inset 3px 0 0 #10b981;
}

.consumer-breakdown-bar-label {
  min-width: 0;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.producer-breakdown-bar-label {
  min-width: 0;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.consumer-breakdown-bar-track {
  position: relative;
  height: 0.6rem;
  border-radius: 999px;
  background: #e6efeb;
  overflow: hidden;
}

.producer-breakdown-bar-track {
  position: relative;
  height: 0.6rem;
  border-radius: 999px;
  background: #e6efeb;
  overflow: hidden;
}

.consumer-breakdown-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #34d399);
}

.producer-breakdown-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #34d399);
}

.consumer-breakdown-bar-value,
.producer-breakdown-bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  justify-self: end;
  font-weight: 600;
}

.consumer-breakdown-empty,
.producer-breakdown-empty {
  padding: 0.55rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.consumer-breakdown-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--muted);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #e6ede2;
}

.producer-breakdown-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--muted);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #e6ede2;
}

@media (max-width: 840px) {
  .consumer-breakdown-bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .producer-breakdown-bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.summary-stacked .summary-grid {
  grid-template-columns: 1fr;
}

.action-row {
  display: flex;
  gap: 0.6rem;
  margin: 0.9rem 0;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 0.58rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: var(--accent);
  color: #2a210b;
}

.btn-ghost {
  background: #e8f2ef;
  color: #17433e;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  margin-top: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.value-ok {
  color: var(--ok);
  font-weight: 700;
}

.value-danger {
  color: var(--danger);
  font-weight: 700;
}

#producerConsumerMatrix {
  margin-top: 0.85rem;
}

.charts-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.charts-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem;
  background: #fbfdfb;
}

.chart-wide {
  grid-column: 1 / -1;
}

.pie-charts-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
}

.pie-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pie-chart-container h3 {
  margin: 0.6rem 0 0.3rem 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.pie-chart-canvas {
  width: 100%;
  max-width: 180px;
  min-width: 180px;
  height: 180px;
  margin: 0 auto;
}

.section-description {
  margin: 0 0 0.8rem 0;
  font-size: 13px;
  color: var(--muted);
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.6rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

.chart-canvas,
canvas {
  width: 100%;
  height: 300px;
  display: block;
  background: #ffffff;
  border: 1px solid #e7eee2;
  border-radius: 10px;
}

.chart-canvas-sm {
  height: 300px;
}

.chart-canvas-wide {
  height: 330px;
}

@media (max-width: 840px) {
  .hero-panel,
  .landing-overview {
    grid-template-columns: 1fr;
  }

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

  .landing-section-text {
    max-width: none;
    text-align: left;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .enerkom-site-header {
    padding: 0.75rem;
  }

  .enerkom-site-footer-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }

  .consumer-breakdown-bar-row,
  .producer-breakdown-bar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .consumer-breakdown-bar-value,
  .producer-breakdown-bar-value {
    justify-self: start;
    text-align: left;
  }
}

.chart-canvas,
canvas {
  cursor: crosshair;
}

body[data-page="sharing"] .hero {
  position: relative;
}

body[data-page="sharing"] .enerkom-site-header {
  padding: 0.8rem 1rem;
  margin-bottom: 0.95rem;
}

body[data-page="sharing"] .enerkom-site-brand img {
  width: min(230px, 45vw);
  height: auto;
}

body[data-page="sharing"] {
  font-family: "Nunito Flex", "Space Grotesk", "Segoe UI", sans-serif;
  --bg: #f5f7f0;
  --ink: #1f2a1a;
  --muted: #5a6553;
  --brand: #689f38;
  --brand-strong: #4f7c29;
  --accent: #f59e0b;
  --line: #d9e2cf;
}

body[data-page="sharing"] .bg-shape-a {
  background: #b9d7a2;
}

body[data-page="sharing"] .bg-shape-b {
  background: #f0d188;
}

body[data-page="sharing"] .kicker {
  color: var(--brand-strong);
}

body[data-page="sharing"] .page-nav .nav-link {
  color: #3f5d24;
  border-color: #cadec5;
  background: #eef5e8;
}

body[data-page="sharing"] .page-nav .nav-link.is-active {
  color: #ffffff;
  border-color: var(--brand);
  background: linear-gradient(135deg, #73ab40, #5d8f32);
}

body[data-page="sharing"] .btn-ghost {
  background: #eef5e8;
  color: #3f6121;
  border: 1px solid #d0e1c4;
}

body[data-page="sharing"] input[type="file"]::file-selector-button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: linear-gradient(135deg, #73ab40, #5d8f32);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  margin-right: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

body[data-page="sharing"] input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, #6ab946, #5a8f35);
  box-shadow: 0 4px 12px rgba(115, 171, 64, 0.3);
}

body[data-page="sharing"] .search-clear-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

body[data-page="sharing"] #producerSummary tbody > tr.interactive-row:nth-of-type(even),
body[data-page="sharing"] #consumerSummary tbody > tr.interactive-row:nth-of-type(even) {
  background: #f6faf2;
}

body[data-page="sharing"] .interactive-row:hover {
  background: #edf6e5;
}

body[data-page="sharing"] .interactive-row.is-selected {
  background: #e3f0d8;
  box-shadow: inset 3px 0 0 #73ab40;
}

body[data-page="sharing"] .interactive-row.is-selected td {
  border-color: #c5dcb1;
}

body[data-page="sharing"] .consumer-breakdown-bar-fill,
body[data-page="sharing"] .producer-breakdown-bar-fill {
  background: linear-gradient(90deg, #689f38, #9ec77a);
}

body[data-page="sharing"] .consumer-breakdown-bar-row.is-highlighted {
  background: rgba(104, 159, 56, 0.16);
  box-shadow: inset 3px 0 0 #73ab40;
}

body[data-page="sharing"] .hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -16px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(104, 159, 56, 0), rgba(104, 159, 56, 0.35), rgba(104, 159, 56, 0));
}

body[data-page="sharing"] .sharing-hero-strip {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.8rem;
}

body[data-page="sharing"] .sharing-hero-strip-card {
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, #ffffff);
  padding: 1rem 1.05rem;
  background: linear-gradient(150deg, rgba(238, 247, 232, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 14px 30px rgba(24, 32, 22, 0.07);
}

body[data-page="sharing"] .sharing-hero-strip-card:nth-child(2) {
  background: linear-gradient(150deg, rgba(248, 241, 219, 0.95), rgba(255, 255, 255, 0.92));
}

body[data-page="sharing"] .sharing-hero-strip-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.03rem;
  color: #173733;
}

body[data-page="sharing"] .sharing-hero-strip-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

body[data-page="sharing"] .sharing-hero-strip-label {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #c6dcc0;
  background: rgba(255, 255, 255, 0.72);
  color: #3f6325;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
}

body[data-page="sharing"] .sharing-hero-tags {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

body[data-page="sharing"] .sharing-hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #476236;
  border: 1px solid #d9e7cf;
  background: rgba(255, 255, 255, 0.74);
}

body[data-page="sharing"] .card {
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(24, 32, 22, 0.06);
}

body[data-page="sharing"] #summarySection,
body[data-page="sharing"] #sharingSection,
body[data-page="sharing"] #producerPieChartsSection,
body[data-page="sharing"] #producerConsumerPieChartsSection,
body[data-page="sharing"] #bestDaySection,
body[data-page="sharing"] #averageDaySection {
  background:
    radial-gradient(circle at top right, rgba(104, 159, 56, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 242, 0.95));
}

body[data-page="sharing"] .sharing-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.25rem;
}

body[data-page="sharing"] .sharing-section-head h2 {
  margin: 0;
}

body[data-page="sharing"] .sharing-section-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid #cadec5;
  background: #edf6e8;
  color: #3f6223;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-page="sharing"] .section-description {
  margin-top: 0.35rem;
  font-size: 0.84rem;
}

body[data-page="sharing"] .chart-canvas {
  border-radius: 14px;
  border-color: #d6e3cb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

@media (max-width: 840px) {
  body[data-page="sharing"] .sharing-hero-strip {
    grid-template-columns: 1fr;
  }

  body[data-page="sharing"] .sharing-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
