.dccr-child {
  --child-bg-start: #eff6ff;
  --child-bg-end: #e0e7ff;
  --child-accent: #4f46e5;
  --child-secondary: #6366f1;
  --child-warning: #f59e0b;
  width: 100%;
  max-width: 1312px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
  color: #111827;
  background: linear-gradient(to bottom right, var(--child-bg-start), var(--child-bg-end));
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  box-sizing: border-box;
}

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

.dccr-child-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.dccr-child-header {
  margin: 0 0 32px;
  text-align: center;
}

.dccr-child-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 16px;
}

.dccr-child-heading svg {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  color: var(--child-accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dccr-child-heading h2 {
  margin: 0;
  padding: 0;
  color: #111827;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  line-height: 1;
}

.dccr-child-header p {
  max-width: 672px;
  margin: 0 auto;
  padding: 0 8px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.dccr-child-card {
  margin: 0 0 24px;
  padding: 16px;
  color: #111827;
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

.dccr-child-card h3 {
  margin: 0 0 16px;
  padding: 0;
  color: #111827;
  font-size: 20px;
  font-weight: 600;
  line-height: 20px;
}

.dccr-child-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.dccr-child-title h3 {
  margin: 0;
}

.dccr-child-title button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32.8px;
  margin: 0;
  padding: 8px 12px;
  color: #fff;
  background: var(--child-accent);
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 16.8px;
  cursor: pointer;
  transition: opacity .2s;
}

.dccr-child-title button:hover {
  opacity: .9;
}

.dccr-child-title button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dccr-child-title button[data-expense-add] {
  background: var(--child-secondary);
}

.dccr-child-list,
.dccr-expense-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dccr-child-row,
.dccr-expense-row {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.dccr-child-row-inner,
.dccr-expense-row-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dccr-expense-row-inner {
  align-items: flex-start;
}

.dccr-child-row-icon,
.dccr-expense-row-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--child-accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dccr-expense-row-icon {
  margin-top: 10px;
  color: var(--child-secondary);
}

.dccr-child-row-fields,
.dccr-expense-grid {
  display: grid;
  flex: 1 1 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dccr-expense-fields {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 12px;
}

.dccr-child-row input,
.dccr-expense-row input,
.dccr-expense-row select,
.dccr-child-field input {
  display: block;
  width: 100%;
  height: 33.6px;
  margin: 0;
  padding: 8px 12px;
  color: #111;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
}

.dccr-expense-row input,
.dccr-expense-row select {
  height: 35.2px;
}

.dccr-child-row input::placeholder,
.dccr-expense-row input::placeholder,
.dccr-child-field input::placeholder {
  color: #6b7280;
  opacity: 1;
}

.dccr-row-delete {
  display: flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 4px;
  color: #dc2626;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

.dccr-row-delete svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dccr-parent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 0 0 24px;
}

.dccr-parent-grid .dccr-child-card {
  margin: 0;
}

.dccr-child-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dccr-child-field label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  line-height: 14.4px;
}

.dccr-child-field small {
  display: block;
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
  line-height: 12px;
}

.dccr-child-money {
  position: relative;
}

.dccr-child-money span {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 12px;
  color: #6b7280;
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
}

.dccr-child-money input {
  padding-left: 32px;
}

.dccr-custody {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dccr-custody input[type="range"] {
  width: auto;
  height: auto;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  accent-color: #1684f8;
}

.dccr-custody input[type="number"] {
  width: 64px;
  height: 31.2px;
  flex: 0 0 64px;
  padding: 8px;
  font-size: 12px;
  line-height: 12px;
  text-align: center;
}

.dccr-custody span {
  color: #6b7280;
  font-size: 14px;
}

.dccr-income-share {
  margin: 8px 0 0;
  padding: 12px;
  background: #f3f4f6;
  border-radius: 8px;
}

.dccr-income-share span {
  display: block;
  margin: 0 0 4px;
  color: #6b7280;
  font-size: 14px;
  line-height: 14.4px;
}

.dccr-income-share strong {
  display: block;
  color: var(--child-accent);
  font-size: 24px;
  font-weight: 700;
  line-height: 24px;
}

.dccr-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.dccr-child-empty {
  padding: 32px;
  color: #9ca3af;
  text-align: center;
}

.dccr-child-empty svg {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  opacity: .5;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dccr-child-empty p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 16.8px;
}

.dccr-child-results {
  margin-bottom: 0;
}

.dccr-child-results > h3 {
  margin: 0 0 24px;
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.dccr-child-hero {
  margin: 0 0 24px;
  padding: 24px;
  color: #fff;
  background: var(--child-accent);
  border-radius: 12px;
  text-align: center;
}

.dccr-child-hero span {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 16.8px;
  opacity: .9;
}

.dccr-child-hero strong {
  display: block;
  margin: 0 0 4px;
  font-size: 40px;
  font-weight: 700;
  line-height: 40px;
}

.dccr-child-hero b {
  display: block;
  font-size: 14px;
  font-weight: 400;
  line-height: 12px;
  opacity: .9;
}

.dccr-child-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.dccr-child-summary {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.dccr-child-summary span {
  display: block;
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 14px;
  line-height: 14.4px;
}

.dccr-child-summary strong {
  display: block;
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  line-height: 20px;
}

.dccr-child-summary small {
  display: block;
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 12px;
}

.dccr-child-detail {
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

.dccr-child-detail h4 {
  margin: 0 0 16px;
  padding: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  line-height: 17.6px;
}

.dccr-child-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.dccr-child-breakdown > div {
  min-height: 180px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.dccr-child-breakdown h5 {
  margin: 0 0 12px;
  padding: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
  line-height: 16px;
}

.dccr-breakdown-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 14px;
}

.dccr-breakdown-lines p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
}

.dccr-breakdown-lines p span {
  color: #6b7280;
}

.dccr-breakdown-lines p b {
  font-weight: 500;
}

.dccr-break-basic {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.dccr-break-basic p + p,
.dccr-break-basic > div p:first-child {
  margin-top: 4px;
}

.dccr-break-net {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 2px solid #e5e7eb;
  font-weight: 600;
}

.dccr-break-net strong:last-child {
  color: var(--child-accent);
}

.dccr-child-note {
  display: flex;
  gap: 12px;
  margin: 24px 0 0;
  padding: 16px;
  color: #92400e;
  background: #fffbeb;
  border-left: 4px solid var(--child-warning);
  border-radius: 0 8px 8px 0;
}

.dccr-child-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--child-warning);
  fill: currentColor;
}

.dccr-child-note p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.dccr-child-note strong {
  font-weight: 700;
}

.dccr-child input:focus-visible,
.dccr-child select:focus-visible,
.dccr-child button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .3);
  outline-offset: 2px;
}

.dccr-child-count {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dccr-child-count button {
  min-width: 68px;
  min-height: 40px;
  margin: 0;
  padding: 9px 16px;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.dccr-child-count button:hover {
  border-color: var(--child-secondary);
}

.dccr-child-count button.is-active {
  color: #fff;
  background: var(--child-accent);
  border-color: var(--child-accent);
}

.dccr-arrangement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: center;
}

.dccr-question {
  margin-bottom: 12px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.dccr-payor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.dccr-payor-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.dccr-payor-options input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--child-accent);
}

.dccr-arrangement-info {
  padding: 14px 16px;
  color: #374151;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.dccr-cost-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dccr-section-help {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.dccr-expense-list {
  gap: 12px;
}

.dccr-expense-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.dccr-expense-field label {
  display: block;
  margin: 0 0 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.dccr-expense-remove {
  min-height: 35px;
  margin: 0;
  padding: 8px 12px;
  color: #4b5563;
  background: #f3f4f6;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.dccr-expense-remove:hover {
  color: #b91c1c;
  background: #fee2e2;
}

.dccr-result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dccr-result-metric,
.dccr-result-panel {
  padding: 18px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.dccr-result-metric {
  text-align: center;
}

.dccr-result-metric.is-primary {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.dccr-result-metric > span,
.dccr-result-metric > small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}

.dccr-result-metric > strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--child-accent);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
}

.dccr-cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dccr-result-panel h4 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
}

.dccr-result-panel p,
.dccr-result-panel small {
  display: block;
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.dccr-result-panel p.is-ok {
  color: #15803d;
  font-weight: 700;
}

.dccr-result-panel p.is-warning {
  color: #a16207;
  font-weight: 700;
}

.dccr-combined-income {
  display: block;
  color: var(--child-accent);
  font-size: 26px;
  line-height: 1.1;
}

.dccr-child-detail .dccr-child-breakdown > div {
  min-height: 0;
}

.dccr-child-detail .dccr-child-breakdown h4 {
  margin-bottom: 14px;
}

.dccr-low-income-warning {
  margin-top: 16px;
  padding: 14px 16px;
  color: #92400e;
  background: #fffbeb;
  border-left: 4px solid var(--child-warning);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.dccr-low-income-warning[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .dccr-child-title {
    align-items: flex-start;
    gap: 12px;
  }

  .dccr-child-title button {
    flex: 0 0 auto;
  }

  .dccr-child-note {
    gap: 8px;
  }
}

@media (max-width: 800px) {
  .dccr-arrangement,
  .dccr-cost-grid-three,
  .dccr-result-metrics,
  .dccr-cap-grid {
    grid-template-columns: 1fr;
  }

  .dccr-expense-row {
    grid-template-columns: 1fr;
  }

  .dccr-expense-remove {
    justify-self: start;
  }
}
