.pscf-root,
.pscf-root * {
  box-sizing: border-box;
}

.pscf-root {
  --pscf-bg: #f6f7f9;
  --pscf-panel: #ffffff;
  --pscf-text: #101828;
  --pscf-muted: #667085;
  --pscf-line: #d9dee7;
  --pscf-soft-line: #e8ecf2;
  --pscf-primary: #1f6f43;
  --pscf-primary-dark: #185a35;
  --pscf-button: #334155;
  --pscf-danger: #b42318;
  --pscf-focus: #2563eb;
  --pscf-shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  color: var(--pscf-text);
  background: transparent;
  font-family: inherit;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.pscf-root.pscf-dark {
  --pscf-bg: #0f172a;
  --pscf-panel: #111827;
  --pscf-text: #f8fafc;
  --pscf-muted: #cbd5e1;
  --pscf-line: #475569;
  --pscf-soft-line: #334155;
  --pscf-primary: #5ad18a;
  --pscf-primary-dark: #7ee6a5;
  --pscf-button: #1e293b;
  --pscf-danger: #fda29b;
  --pscf-focus: #93c5fd;
  --pscf-shadow: 0 18px 52px rgba(0, 0, 0, 0.35);
}

.pscf-shell {
  width: min(100%, 860px);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 24px);
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.pscf-topbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 18px;
}

.pscf-title {
  margin: 0 0 6px;
  color: var(--pscf-text);
  font-size: clamp(1.55rem, 5.4vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-transform: none;
}

.pscf-subtitle {
  margin: 0;
  color: var(--pscf-muted);
  font-size: clamp(0.95rem, 3.2vw, 1.06rem);
}

.pscf-theme-toggle,
.pscf-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 48px;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pscf-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 15px;
  color: var(--pscf-text);
  background: var(--pscf-panel);
  border: 1px solid var(--pscf-soft-line);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.pscf-theme-toggle:hover,
.pscf-btn:hover {
  transform: translateY(-1px);
}

.pscf-theme-toggle:focus-visible,
.pscf-btn:focus-visible,
.pscf-root input:focus-visible,
.pscf-details summary:focus-visible {
  outline: 3px solid var(--pscf-focus);
  outline-offset: 3px;
}

.pscf-form {
  width: 100%;
  max-width: 100%;
  padding: clamp(16px, 4vw, 24px);
  background: var(--pscf-panel);
  border: 1px solid var(--pscf-soft-line);
  border-radius: 20px;
  box-shadow: var(--pscf-shadow);
}

.pscf-field {
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
}

.pscf-root label,
.pscf-details summary {
  display: block;
  margin: 0 0 7px;
  color: var(--pscf-text);
  font-size: 0.98rem;
  font-weight: 850;
}

.pscf-root input[type="number"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--pscf-text);
  background: var(--pscf-panel);
  border: 1px solid var(--pscf-line);
  border-radius: 14px;
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.pscf-root input::placeholder {
  color: var(--pscf-muted);
}

.pscf-help,
.pscf-error,
.pscf-status {
  margin: 7px 0 0;
  font-size: 0.9rem;
}

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

.pscf-error {
  min-height: 1.25em;
  color: var(--pscf-danger);
  font-weight: 800;
}

.pscf-details {
  width: 100%;
  max-width: 100%;
  margin: 6px 0 18px;
  padding: 0;
  border: 0;
}

.pscf-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 12px 14px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--pscf-soft-line);
  border-radius: 14px;
  cursor: pointer;
  list-style-position: inside;
}

.pscf-details[open] summary {
  margin-bottom: 14px;
}

.pscf-checkbox-field {
  padding: 13px 14px;
  border: 1px solid var(--pscf-soft-line);
  border-radius: 14px;
}

.pscf-check-label {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  margin: 0 !important;
  cursor: pointer;
}

.pscf-check-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--pscf-primary);
}

.pscf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
}

.pscf-btn {
  flex: 1 1 100%;
  padding: 13px 18px;
  text-align: center;
}

.pscf-btn-primary,
.pscf-btn-secondary {
  color: #ffffff;
  background: var(--pscf-button);
  box-shadow: 0 10px 24px rgba(51, 65, 85, 0.18);
}

.pscf-btn-primary {
  background: var(--pscf-primary);
  box-shadow: 0 10px 24px rgba(31, 111, 67, 0.22);
}

.pscf-root.pscf-dark .pscf-btn-primary {
  color: #052e16;
}

.pscf-btn-primary:hover {
  background: var(--pscf-primary-dark);
}

.pscf-status {
  min-height: 1.35em;
  color: var(--pscf-primary);
  font-weight: 850;
}

.pscf-output {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: clamp(26px, 6vw, 42px);
  padding: 0;
  color: var(--pscf-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.pscf-output-rule {
  width: 100%;
  height: 4px;
  margin: 0 0 14px;
  background: var(--pscf-text);
  border-radius: 999px;
}


/* Remove old/mobile intro note paragraphs from previous builds. */
.pscf-output > p,
.pscf-output-note,
.pscf-output-intro,
.pscf-mobile-note,
.pscf-report-note {
  display: none !important;
}

.pscf-report-title {
  margin: 0 0 clamp(20px, 5vw, 30px);
  color: var(--pscf-text);
  font-size: clamp(1.55rem, 6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.pscf-main-result {
  width: 100%;
  max-width: 100%;
  padding: 0 0 clamp(20px, 5vw, 28px);
  border-bottom: 1px solid var(--pscf-line);
}

.pscf-main-label,
.pscf-report-section h4 {
  margin: 0 0 8px;
  color: var(--pscf-muted);
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pscf-main-value {
  max-width: 100%;
  margin: 0;
  color: var(--pscf-primary);
  font-size: clamp(2rem, 10vw, 3.25rem);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.pscf-main-note {
  margin-top: 8px;
  color: var(--pscf-muted);
  font-size: 0.98rem;
  font-weight: 650;
}

.pscf-report-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: clamp(20px, 5vw, 30px) 0 0;
}

.pscf-report-section + .pscf-report-section {
  margin-top: clamp(8px, 2.5vw, 16px);
  border-top: 1px solid var(--pscf-line);
}

.pscf-report-section h4 {
  color: var(--pscf-text);
  font-size: clamp(1.25rem, 5vw, 1.75rem);
}

.pscf-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 42%);
  align-items: flex-start;
  gap: clamp(12px, 4vw, 26px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--pscf-line);
}

.pscf-report-row[hidden] {
  display: none !important;
}

.pscf-report-row span,
.pscf-report-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.pscf-report-row span {
  color: var(--pscf-muted);
  font-size: clamp(1rem, 4.1vw, 1.25rem);
  font-weight: 850;
  line-height: 1.25;
}

.pscf-report-row strong {
  color: var(--pscf-text);
  font-size: clamp(1rem, 4.4vw, 1.25rem);
  font-weight: 950;
  line-height: 1.25;
  text-align: right;
}

.pscf-explanation,
.pscf-disclaimer p {
  max-width: 100%;
  margin: 0;
  color: var(--pscf-text);
  font-size: clamp(0.98rem, 3.6vw, 1.08rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.pscf-disclaimer p {
  color: var(--pscf-muted);
}

@media (min-width: 520px) {
  .pscf-btn {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (min-width: 720px) {
  .pscf-topbar {
    flex-direction: row;
    align-items: flex-start;
  }

  .pscf-theme-toggle {
    width: auto;
    flex: 0 0 auto;
  }

  .pscf-btn {
    flex: 0 1 auto;
  }
}

@media (max-width: 380px) {
  .pscf-shell {
    padding: 10px;
  }

  .pscf-form {
    padding: 14px;
    border-radius: 16px;
  }

  .pscf-report-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pscf-report-row strong {
    text-align: left;
  }
}

@media print {
  .pscf-root {
    --pscf-bg: #ffffff;
    --pscf-panel: #ffffff;
    --pscf-text: #000000;
    --pscf-muted: #333333;
    --pscf-line: #cccccc;
    color: #000000;
  }

  .pscf-shell {
    width: 100%;
    padding: 0;
    background: #ffffff;
    border-radius: 0;
  }

  .pscf-topbar,
  .pscf-form {
    display: none !important;
  }

  .pscf-output {
    margin: 0;
  }

  .pscf-output-rule {
    background: #000000;
  }
}
