.pf-calc {
  --pf-border: #d9e2ec;
  --pf-ink: #17202a;
  --pf-muted: #5d6d7e;
  --pf-accent: #1663c7;
  --pf-surface: #ffffff;
  --pf-band: #f5f8fb;
  --pf-input: #fbfac4;
  --pf-output: #d4f3d9;
  color: var(--pf-ink);
  background: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  padding: 20px;
  max-width: 1100px;
}

.pf-calc * {
  box-sizing: border-box;
}

.pf-calc__header {
  border-bottom: 1px solid var(--pf-border);
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.pf-calc__header h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.pf-calc__header p {
  color: var(--pf-muted);
  margin: 0;
}

.pf-calc__form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pf-calc__section {
  background: var(--pf-band);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.pf-calc__section--wide,
.pf-calc__actions {
  grid-column: 1 / -1;
}

.pf-calc__section h3 {
  font-size: 16px;
  margin: 0;
}

.pf-calc label {
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}

.pf-calc input,
.pf-calc select {
  background: var(--pf-input);
  border: 1px solid #b9c7d5;
  border-radius: 6px;
  color: var(--pf-ink);
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.pf-calc__split {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 120px;
}

.pf-calc__fittings {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pf-calc__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.pf-calc button {
  border: 1px solid var(--pf-accent);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 9px 16px;
}

.pf-calc button[type='submit'] {
  background: var(--pf-accent);
  color: #fff;
}

.pf-calc button[type='button'] {
  background: #fff;
  color: var(--pf-accent);
}

.pf-calc__message {
  color: #9a3412;
  font-weight: 700;
  margin-top: 14px;
}

.pf-calc__results {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.pf-calc--stale .pf-calc__results {
  filter: grayscale(0.8);
  opacity: 0.42;
}

.pf-result {
  background: var(--pf-output);
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.pf-result span {
  color: var(--pf-muted);
  font-size: 13px;
}

.pf-result strong {
  font-size: 18px;
}

.pf-comparison {
  border-top: 1px solid var(--pf-border);
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 16px;
}

.pf-comparison h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.pf-comparison__scroll {
  overflow-x: auto;
}

.pf-comparison table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.pf-comparison th,
.pf-comparison td {
  border: 1px solid var(--pf-border);
  font-size: 13px;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

.pf-comparison th {
  background: var(--pf-band);
  font-weight: 700;
}

.pf-comparison tbody tr:nth-child(even) {
  background: #f9fbfd;
}

@media (max-width: 800px) {
  .pf-calc {
    padding: 14px;
  }

  .pf-calc__form,
  .pf-calc__fittings,
  .pf-calc__results {
    grid-template-columns: 1fr;
  }

  .pf-calc__split {
    grid-template-columns: 1fr;
  }
}
