/* ─── RESULTS GRID ─────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

@media (max-width: 540px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.result-item {
  background: var(--lightblue);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 8px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(21, 125, 164, .04);
}

.result-item.highlight {
  background: rgba(21, 125, 164, .08);
  border-color: rgba(21, 125, 164, .24);
}

.result-item.green-hl {
  background: rgba(21, 125, 164, .06);
  border-color: rgba(21, 125, 164, .24);
}

.result-value {
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  font-weight: 800;
  color: var(--submain);
}

.result-item.green-hl .result-value {
  color: var(--submain);
}

.result-label {
  font-size: clamp(.62rem, 2.2vw, .7rem);
  color: var(--dim);
  margin-top: 2px;
  line-height: 1.35;
}

.energy-bar {
  height: 6px;
  background: rgba(255, 255, 255, .08);
  border-radius: 4px;
  overflow: hidden;
  margin: 5px 0 2px;
}

.energy-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--submain), var(--text));
  transition: width 1s ease;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--dim);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 600;
}

.badge-sun {
  background: rgba(21, 125, 164, .12);
  color: var(--submain);
  border: 1px solid rgba(21, 125, 164, .2);
}

.badge-green {
  background: rgba(21, 125, 164, .08);
  color: var(--submain);
  border: 1px solid rgba(21, 125, 164, .18);
}

.tip {
  font-size: .74rem;
  color: var(--text);
  background: rgba(21, 125, 164, .08);
  border-right: 3px solid var(--submain);
  border-radius: 6px;
  padding: 9px 11px;
  margin-top: 10px;
  line-height: 1.65;
}

@media (max-width: 480px) {
  .result-item {
    padding: 10px 8px;
  }

  .tip {
    font-size: .72rem;
    padding: 8px 10px;
  }
}

/* ─── DIAGRAM ──────────────────────────────────── */
.diagram-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 6px 0;
  -webkit-overflow-scrolling: touch;
}

svg.diagram {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  min-width: 0;
}

.flow-line {
  stroke-dasharray: 8 4;
  animation: flowMove 1.5s linear infinite;
}

@keyframes flowMove {
  to {
    stroke-dashoffset: -36
  }
}

.diagram-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: var(--main);
  border: 1px solid var(--border);
}

.diagram {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: var(--main);
}

.diagram text {
  user-select: none;
}

@media (max-width: 640px) {
  .diagram-wrap {
    padding: 2px 0;
  }

  .diagram text {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .diagram text {
    font-size: 8px;
  }
}

.diagram .fa-label {
  direction: rtl;
  unicode-bidi: plaintext;
}

.diagram .legend-label {
  direction: rtl;
  unicode-bidi: plaintext;
  text-anchor: end;
  dominant-baseline: middle;
}