.pde-root {
  color: #172018;
}

.pde-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  border: 1px solid #d8e3d2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 246, 231, 0.9), rgba(250, 252, 248, 0.96)),
    repeating-linear-gradient(90deg, rgba(42, 86, 59, 0.06) 0 1px, transparent 1px 18px);
  box-shadow: 0 18px 44px rgba(34, 54, 38, 0.12);
}

.pde-controls,
.pde-results {
  display: grid;
  gap: 0.8rem;
}

.pde-unit-toggle,
.pde-field,
.pde-range,
.pde-hero,
.pde-cards article,
.pde-breakdown,
.pde-scenarios {
  border: 1px solid rgba(54, 88, 58, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.pde-unit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem;
  font-weight: 800;
}

.pde-unit-toggle div {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: #e2eadb;
}

.pde-unit-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: transparent;
  color: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pde-unit-toggle button.is-active {
  background: #2f6f4e;
  color: white;
}

.pde-field,
.pde-range {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
}

.pde-field span,
.pde-range > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 850;
}

.pde-field small,
.pde-range small {
  color: #5a6a5d;
  font-size: 0.76rem;
  line-height: 1.35;
}

.pde-field div {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid #cddbc8;
  border-radius: 7px;
  background: white;
}

.pde-field input {
  min-width: 0;
  border: 0;
  padding: 0.68rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
}

.pde-field b {
  display: grid;
  place-items: center;
  min-width: 4.4rem;
  padding: 0 0.55rem;
  background: #edf4e8;
  color: #35523b;
  font-size: 0.78rem;
}

.pde-range input {
  width: 100%;
  accent-color: #2f6f4e;
}

.pde-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.pde-hero {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #173b2f, #2f6f4e 58%, #f0b24a);
  color: white;
}

.pde-hero span,
.pde-cards span,
.pde-breakdown span {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pde-hero strong {
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.pde-hero p {
  max-width: 58rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.pde-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.pde-cards article {
  display: grid;
  gap: 0.35rem;
  min-height: 6rem;
  padding: 0.8rem;
}

.pde-cards strong {
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pde-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.8rem;
}

.pde-breakdown div {
  display: grid;
  gap: 0.2rem;
}

.pde-scenarios {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
}

.pde-scenarios h3 {
  margin: 0;
  font-size: 1rem;
}

.pde-scenario {
  display: grid;
  grid-template-columns: 5.8rem 1fr 7rem;
  align-items: center;
  gap: 0.6rem;
}

.pde-scenario i {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2eadb;
}

.pde-scenario em {
  display: block;
  width: var(--bar, 40%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6f4e, #f0b24a);
}

.theme-dark .pde-root {
  color: #edf5ea;
}

.theme-dark .pde-panel {
  border-color: #334332;
  background:
    linear-gradient(135deg, rgba(24, 36, 29, 0.95), rgba(16, 22, 19, 0.96)),
    repeating-linear-gradient(90deg, rgba(174, 220, 157, 0.08) 0 1px, transparent 1px 18px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

.theme-dark .pde-unit-toggle,
.theme-dark .pde-field,
.theme-dark .pde-range,
.theme-dark .pde-cards article,
.theme-dark .pde-breakdown,
.theme-dark .pde-scenarios {
  border-color: rgba(190, 220, 176, 0.14);
  background: rgba(25, 34, 29, 0.78);
}

.theme-dark .pde-field div,
.theme-dark .pde-unit-toggle div {
  border-color: #3e503d;
  background: #111814;
}

.theme-dark .pde-field b {
  background: #223027;
  color: #c9e8c4;
}

.theme-dark .pde-field small,
.theme-dark .pde-range small {
  color: #aab8a8;
}

@media (max-width: 820px) {
  .pde-panel,
  .pde-cards,
  .pde-breakdown {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .pde-panel {
    padding: 0.7rem;
  }

  .pde-two {
    grid-template-columns: 1fr;
  }

  .pde-scenario {
    grid-template-columns: 4.8rem 1fr;
  }

  .pde-scenario strong {
    grid-column: 1 / -1;
  }
}
