:root {
  --bg: #f3efe7;
  --bg-soft: #f7f4ee;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #fffdf9;
  --surface-muted: rgba(255, 255, 255, 0.64);
  --ink: #18231f;
  --ink-soft: #52605a;
  --muted: #74817a;
  --line: rgba(24, 35, 31, 0.1);
  --line-strong: rgba(24, 35, 31, 0.16);
  --brand: #173f2f;
  --brand-soft: #ebf1ed;
  --danger: #8d4a39;
  --danger-soft: #f9ece6;
  --shadow: 0 16px 40px rgba(24, 35, 31, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.demo-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(156, 121, 77, 0.12), transparent 22%),
    linear-gradient(180deg, #f5f2eb 0%, #edf1ec 100%);
  font-family: "Manrope", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#cf-app {
  min-height: 100vh;
}

button,
textarea {
  font: inherit;
}

.cf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cf-demo-shell,
.cf-results-shell {
  width: 100%;
  padding: 28px 0 80px;
}

.cf-topbar,
.cf-entry-wrap,
.cf-result-hero,
.cf-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.cf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cf-topbar--results {
  margin-bottom: 28px;
}

.cf-wordmark {
  color: var(--brand);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.cf-wordmark span {
  color: var(--muted);
  font-weight: 500;
}

.cf-wordmark-btn,
.cf-ghost-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.cf-wordmark-btn {
  padding: 0;
}

.cf-ghost-btn {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.cf-entry-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.96fr);
  gap: 64px;
  align-items: center;
  padding-top: 64px;
}

.cf-entry-copy {
  padding-top: 0;
}

.cf-entry-copy h1,
.cf-result-copy h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(3.3rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.cf-intro,
.cf-hero-text,
.cf-panel-note,
.cf-summary-card p,
.cf-fit-card p,
.cf-action-item p,
.cf-rung-note,
.cf-money-row,
.cf-preview-item p,
.cf-feedback {
  color: var(--ink-soft);
  line-height: 1.65;
}

.cf-intro {
  max-width: 30rem;
  margin: 20px 0 0;
  font-size: 19px;
}

.cf-entry-card,
.cf-result-main,
.cf-panel {
  border-radius: var(--radius-xl);
}

.cf-entry-card,
.cf-result-main {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.cf-entry-card {
  padding: 28px;
}

.cf-form {
  display: grid;
  gap: 14px;
}

.cf-input,
.cf-live-input {
  width: 100%;
  resize: vertical;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  line-height: 1.65;
}

.cf-input {
  min-height: 232px;
}

.cf-live-input {
  min-height: 136px;
}

.cf-input:focus,
.cf-live-input:focus {
  outline: 2px solid rgba(23, 63, 47, 0.14);
  border-color: rgba(23, 63, 47, 0.28);
}

.cf-actions,
.cf-live-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cf-search-btn,
.cf-secondary-btn {
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.cf-search-btn {
  border: 0;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(23, 63, 47, 0.18);
}

.cf-search-btn:hover,
.cf-secondary-btn:hover,
.cf-ghost-btn:hover {
  transform: translateY(-1px);
}

.cf-secondary-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.cf-feedback {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  border: 1px solid rgba(141, 74, 57, 0.14);
  color: var(--danger);
}

.cf-summary-label,
.cf-fit-label,
.cf-grounding-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cf-summary-grid,
.cf-fit-grid {
  display: grid;
  gap: 14px;
}

.cf-fit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cf-fit-card,
.cf-summary-card,
.cf-rung,
.cf-money-row,
.cf-action-item {
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.cf-fit-card {
  padding: 16px;
  border-radius: 18px;
}

.cf-fit-card h3,
.cf-summary-card h2,
.cf-panel-head h2,
.cf-rung-title,
.cf-action-item h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.cf-result-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  padding: 28px;
}

.cf-result-copy h1 {
  font-size: clamp(2.8rem, 5vw, 4.6rem);
}

.cf-result-edit {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.cf-live-form {
  margin-top: 12px;
}

.cf-live-input--compact {
  min-height: 116px;
}

.cf-section {
  margin-top: 22px;
}

.cf-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cf-summary-card {
  padding: 20px;
  border-radius: 20px;
}

.cf-summary-card h2 {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.12;
}

.cf-summary-card p {
  margin: 10px 0 0;
  font-size: 14px;
}

.cf-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.cf-panel-head,
.cf-panel-body {
  padding-left: 28px;
  padding-right: 28px;
}

.cf-panel-head {
  padding-top: 28px;
}

.cf-panel-head h2 {
  margin-top: 0;
  font-size: 34px;
  line-height: 1.02;
  max-width: 14ch;
}

.cf-panel-note {
  margin: 10px 0 0;
  max-width: 44rem;
}

.cf-panel-body {
  padding-top: 24px;
  padding-bottom: 28px;
}

.cf-fit-card h3 {
  font-size: 24px;
  line-height: 1.12;
}

.cf-fit-card p {
  margin: 10px 0 0;
}

.cf-action-list {
  display: grid;
  gap: 14px;
}

.cf-action-item {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 20px;
}

.cf-action-item h3 {
  font-size: 22px;
  line-height: 1.15;
}

.cf-action-item p {
  margin: 0;
}

.cf-ladder {
  display: grid;
  gap: 14px;
}

.cf-rung {
  position: relative;
  padding: 22px 22px 22px 76px;
  border-radius: 22px;
}

.cf-rung--optional {
  background: rgba(246, 240, 230, 0.84);
}

.cf-rung-num {
  position: absolute;
  top: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.cf-rung-head,
.cf-money-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cf-rung-title {
  font-size: 22px;
  line-height: 1.15;
}

.cf-rung-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cf-tag,
.cf-money-status,
.cf-prov {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}

.cf-tag {
  padding: 7px 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.cf-tag--amber {
  background: #f4eadc;
  color: #7d5832;
}

.cf-rung-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.cf-rung-funded,
.cf-rung-unlock {
  margin-top: 12px;
}

.cf-rung-funded,
.cf-rung-unlock {
  color: var(--brand);
  font-weight: 700;
}

.cf-rung-note {
  margin: 12px 0 0;
}

.cf-money-rows {
  display: grid;
  gap: 12px;
}

.cf-money-row {
  padding: 18px 20px;
  border-radius: 18px;
}

.cf-money-label {
  flex: 1;
}

.cf-money-cost {
  color: var(--ink);
  font-weight: 800;
}

.cf-money-status {
  padding: 8px 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.cf-money-status--warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.cf-prov {
  margin-left: 6px;
  padding: 6px 10px;
  background: rgba(24, 35, 31, 0.06);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .cf-entry-wrap,
  .cf-result-main,
  .cf-summary-grid,
  .cf-fit-grid {
    grid-template-columns: 1fr;
  }

  .cf-entry-wrap {
    gap: 28px;
    padding-top: 40px;
  }

  .cf-panel-head h2 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .cf-topbar,
  .cf-entry-wrap,
  .cf-result-hero,
  .cf-section {
    width: min(100% - 24px, 1120px);
  }

  .cf-demo-shell,
  .cf-results-shell {
    padding-top: 22px;
    padding-bottom: 56px;
  }

  .cf-entry-copy h1,
  .cf-result-copy h1 {
    font-size: clamp(2.5rem, 13vw, 3.8rem);
    max-width: none;
  }

  .cf-topbar,
  .cf-rung-head,
  .cf-money-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .cf-input {
    min-height: 200px;
  }

}
