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

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

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

.sfdc-shell {
  width: min(100%, 860px);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
  background: var(--sfdc-bg);
  border-radius: 22px;
  overflow: hidden;
}

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

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

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

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

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

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

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

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

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

.sfdc-field[hidden],
.sfdc-custom-grid[hidden] {
  display: none !important;
}

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

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

.sfdc-root select {
  text-overflow: ellipsis;
}

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

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

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

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

.sfdc-custom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

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

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

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

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

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

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

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

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

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

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

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

.sfdc-btn-secondary {
  color: var(--sfdc-text);
  background: transparent;
  border: 1px solid var(--sfdc-line);
}

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

/* Flat, screenshot-style report output: no boxed card around the result. */
.sfdc-output {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: clamp(22px, 5vw, 36px);
  padding: 0;
  color: var(--sfdc-text);
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

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

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

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

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

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

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

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

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

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

.sfdc-report-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(12px, 4vw, 26px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--sfdc-line);
}

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

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

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

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

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

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

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

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

  .sfdc-custom-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
  }

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

@media (max-width: 360px) {
  .sfdc-shell {
    padding: 12px;
    border-radius: 16px;
  }

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

  .sfdc-report-row {
    gap: 10px;
  }

  .sfdc-report-row strong {
    flex-basis: 48%;
  }
}

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

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

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

  .sfdc-output {
    margin: 0;
  }

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