.debt-page {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 18px 48px;
  width: 100%;
}

body:has(.debt-page) {
  overflow-x: clip;
}

body:has(.debt-page) .breadcrumb {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: auto;
}

.debt-intro {
  color: #26364a;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 850px;
}

.debt-privacy {
  background: #edf8f4;
  border-left: 4px solid #087f5b;
  border-radius: 8px;
  color: #174c3c;
  padding: 12px 16px;
}

.debt-calculator {
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(32, 55, 80, .09);
  margin: 24px 0;
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
}

.debt-calculator #entry {
  min-width: 0;
  padding: 0;
  width: auto;
}

.debt-basic-fields,
.debt-advanced-fields,
.debt-row,
#debtSummary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.debt-field {
  min-width: 0;
}

.debt-field label {
  color: #1c2c3e;
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
}

.debt-field input,
.debt-field select,
#debtPaste {
  background: #fff;
  border: 1px solid #9eafc1;
  border-radius: 9px;
  box-sizing: border-box;
  color: #152536;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.debt-input-wrap {
  align-items: center;
  border: 1px solid #9eafc1;
  border-radius: 9px;
  display: flex;
  min-width: 0;
  padding: 0 11px;
}

.debt-input-wrap input {
  border: 0;
  min-width: 0;
  outline: 0;
}

.debt-field [aria-invalid="true"] {
  border-color: #b42318;
}

.field-error {
  color: #b42318;
  font-size: .88rem;
  margin: 5px 0 0;
  min-height: 1.2em;
}

.debt-advanced,
#debtEditor {
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  margin-top: 20px;
  padding: 16px;
}

.debt-advanced summary {
  cursor: pointer;
  font-weight: 750;
  min-height: 44px;
}

.debt-row {
  align-items: end;
  border-bottom: 1px solid #e5ebf2;
  grid-template-columns: 1.25fr repeat(3, 1fr) auto;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

button {
  min-height: 44px;
}

.debt-editor-actions,
.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.debt-editor-actions button,
.remove-debt,
.schedule-actions button,
#applyPaste {
  background: #0d5ea6;
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 18px;
}

.remove-debt {
  background: #f4f6f8;
  color: #8b1e1e;
}

#pastePanel {
  margin-top: 14px;
}

#debtResult {
  color: #0b4f83;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 800;
  margin: 10px 0;
}

#debtSummary > div {
  background: #f5f8fb;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 14px;
}

#debtSummary h3,
#debtSummary p {
  margin: 0;
}

#debtSummary p {
  font-size: 1.12rem;
  font-weight: 750;
  margin-top: 6px;
}

#debtChart {
  margin: 22px 0 0;
  max-width: 100%;
}

#debtChart svg {
  height: auto;
  max-width: 100%;
  width: 100%;
}

#debtChart line {
  stroke: #9eafc1;
}

#debtChart polyline {
  fill: none;
  stroke: #0d76c6;
  stroke-width: 4;
}

.debt-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.debt-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.debt-table caption {
  font-weight: 750;
  padding: 12px;
  text-align: left;
}

.debt-table th,
.debt-table td {
  border-bottom: 1px solid #dbe4ee;
  padding: 10px 12px;
  text-align: right;
  white-space: nowrap;
}

.debt-table th:first-child,
.debt-table td:first-child {
  text-align: left;
}

.debt-table thead th {
  background: #eef4f9;
  position: sticky;
  top: 0;
}

.debt-formula,
.debt-how-to,
.debt-assumptions,
.debt-example,
.debt-faq {
  line-height: 1.65;
  margin: 34px 0;
}

:focus-visible {
  outline: 3px solid #ffb000;
  outline-offset: 3px;
}

.print-report-header,
.print-only {
  display: none;
}

@media (max-width: 720px) {
  .debt-page {
    padding-inline: 12px;
  }

  .debt-basic-fields,
  .debt-advanced-fields,
  .debt-row,
  #debtSummary {
    grid-template-columns: 1fr;
  }

  .debt-calculator {
    border-radius: 12px;
    padding: 16px;
  }

  .schedule-actions button,
  .debt-editor-actions button {
    flex: 1 1 145px;
  }
}

@media print {
  header,
  footer,
  .breadcrumb,
  #entry,
  .schedule-actions,
  .table-scroll-help,
  .debt-formula,
  .debt-how-to,
  .debt-assumptions,
  .debt-example,
  .debt-faq,
  .tool-related,
  .debt-privacy {
    display: none !important;
  }

  .print-report-header,
  .print-only {
    display: block;
  }

  .debt-calculator {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .debt-table thead {
    display: table-header-group;
  }
}
