/* debt.css - debt payoff helper. Layers on top of budget.css. */

.debt-hero .calc-hub-head h1 { max-width: 14ch; }
.debt-hero .lede { max-width: 470px; }

/* ── strategy switch ─────────────────────────────────────── */
.seg3 { display: flex; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg3 button { flex: 1; border: 0; background: transparent; cursor: pointer; font-family: "Manrope", sans-serif; font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 8px 14px; border-radius: 999px; letter-spacing: .01em; white-space: nowrap; transition: background .15s, color .15s; }
.seg3 button:hover { color: var(--ink); }
.seg3 button.on { background: var(--teal-deep); color: #fff; }
.dt-strategy { margin-top: 16px; }
.dt-strategy-note { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; background: var(--cream); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.dt-strategy-note strong { color: var(--ink); }

/* ── debt table ──────────────────────────────────────────── */
.dt-table { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.dt-row { display: grid; grid-template-columns: 24px minmax(96px, 1fr) 112px 108px 74px 96px 28px; gap: 8px; align-items: center; }
.dt-table.is-custom .dt-row { grid-template-columns: 24px minmax(80px, 1fr) 112px 104px 72px 92px 92px; }
.dt-ord-tools { display: flex; gap: 2px; justify-content: flex-end; }
.dt-ord-tools .b-remove { width: 26px; height: 26px; }
.dt-head { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.dt-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-head .num { text-align: right; }
.dt-ord { font-family: "Instrument Serif", serif; font-size: 16px; color: var(--ink-3); text-align: center; }
.dt-name { font-family: "Manrope", sans-serif; font-size: 14.5px; font-weight: 600; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 6px 2px; min-width: 0; width: 100%; }
.dt-name:hover { border-bottom-color: var(--line); }
.dt-name:focus { outline: none; border-bottom-color: var(--teal); }
.dt-type { font-family: "Manrope", sans-serif; font-size: 12.5px; color: var(--ink-2); background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 7px 6px; width: 100%; min-width: 0; cursor: pointer; }
.dt-type:focus { outline: none; border-color: var(--teal); }
.dt-field { display: flex; align-items: center; gap: 3px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.dt-field:focus-within { border-color: var(--teal); background: var(--white); }
.dt-field input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-family: "Manrope", sans-serif; font-size: 14px; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dt-field input:focus { outline: none; }
.dt-field .cur, .dt-field .suf { font-size: 11.5px; color: var(--ink-3); flex: none; }

/* ── budget bar ──────────────────────────────────────────── */
.dt-budget { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.dt-budget-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dt-budget-label { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.dt-budget-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; max-width: 46ch; }
.dt-budget-input { display: flex; align-items: center; gap: 6px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; flex: none; }
.dt-budget-input:focus-within { border-color: var(--teal); background: var(--white); }
.dt-budget-input .cur { font-size: 13px; color: var(--ink-3); }
.dt-budget-input input { width: 88px; border: 0; background: transparent; font-family: "Instrument Serif", serif; font-size: 24px; color: var(--ink); text-align: right; }
.dt-budget-input input:focus { outline: none; }
.dt-budget-input .per { font-size: 11px; font-style: italic; color: var(--ink-3); }
.dt-split { display: flex; gap: 8px; margin-top: 14px; }
.dt-split-seg { flex: 1; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.dt-split-seg .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.dt-split-seg .v { font-family: "Instrument Serif", serif; font-size: 23px; color: var(--ink); margin-top: 2px; }
.dt-split-seg.extra { background: #f1f7f6; border-color: var(--teal-soft); }
.dt-split-seg.extra .v { color: var(--teal-deep); }
.dt-warn { margin-top: 12px; font-size: 13px; font-weight: 600; color: #b54343; background: #fbf0ec; border: 1px solid #eccfc8; border-radius: 12px; padding: 11px 14px; line-height: 1.5; }

/* ── payoff plan ─────────────────────────────────────────── */
.dt-plan { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.dt-plan-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 92px 92px 90px; gap: 10px; align-items: center; }
.dt-plan-head { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dt-plan-head .num { text-align: right; }
.dt-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--teal-deep); flex: none; }
.dt-badge.done { background: var(--ink-3); }
.dt-plan-name { min-width: 0; }
.dt-plan-name .n { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-plan-name .m { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.dt-plan-row .v { text-align: right; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-plan-row .v.soft { color: var(--ink-2); font-weight: 500; }
.dt-plan-row .v.date { font-weight: 600; color: var(--teal-deep); }
.dt-bars { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.dt-bars-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.dt-bars-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dt-bar-row { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr); gap: 12px; align-items: center; }
.dt-bar-row + .dt-bar-row { margin-top: 9px; }
.dt-bar-name { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-bar-track { height: 22px; border-radius: 7px; background: var(--cream-2); position: relative; overflow: hidden; }
.dt-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 11px; font-weight: 700; color: #fff; min-width: 42px; }
.dt-bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 8px; }

/* ── comparison strip in the summary ─────────────────────── */
.dt-compare { display: flex; flex-direction: column; gap: 2px; }
.dt-comp-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: baseline; padding: 8px 0; font-size: 13px; }
.dt-comp-row .k { color: rgba(250,245,236,.62); white-space: nowrap; }
.dt-comp-row.on .k { color: var(--cream); font-weight: 700; }
.dt-comp-row .mo { font-size: 11.5px; color: rgba(250,245,236,.45); font-variant-numeric: tabular-nums; }
.dt-comp-row .v { font-family: "Instrument Serif", serif; font-size: 17px; color: var(--cream); }
.dt-comp-row.best .v { color: #8fd1b6; }
.dt-comp-hint { font-size: 11.5px; color: rgba(250,245,236,.5); line-height: 1.5; margin-top: 8px; }
.dt-free { font-family: "Instrument Serif", serif; font-size: 44px; line-height: 1.05; letter-spacing: -.01em; margin: 8px 0 2px; color: var(--cream); }
.dt-free.never { font-size: 30px; color: #f0907f; }
.dt-note { font-size: 12.5px; color: rgba(250,245,236,.6); line-height: 1.5; }
.dt-note.pos { color: #8fd1b6; }
.dt-saved { margin-top: 18px; background: rgba(250,245,236,.06); border: 1px solid rgba(250,245,236,.13); border-radius: 13px; padding: 14px 16px; }
.dt-saved .k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.dt-saved .v { font-family: "Instrument Serif", serif; font-size: 27px; color: var(--cream); margin-top: 3px; }
.dt-saved .s { font-size: 12px; color: rgba(250,245,236,.55); line-height: 1.45; margin-top: 4px; }

.dt-empty { font-size: 14px; color: var(--ink-2); line-height: 1.55; background: var(--cream); border: 1px dashed var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 14px; }

@media (max-width: 1080px) {
  .dt-row { grid-template-columns: 22px minmax(80px, 1fr) 104px 96px 68px 88px 26px; gap: 6px; }
  .dt-table.is-custom .dt-row { grid-template-columns: 20px minmax(64px, 1fr) 100px 92px 62px 82px 84px; gap: 5px; }
}
@media (max-width: 900px) {
  .dt-row, .dt-head, .dt-table.is-custom .dt-row { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .dt-head { display: none; }
  .dt-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--white); }
  .dt-row .dt-ord { display: none; }
  .dt-row .dt-name { grid-column: 1 / -1; font-size: 16px; }
  .dt-row .dt-type { grid-column: 1 / -1; }
  .dt-row .dt-remove-cell { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .dt-field::before { content: attr(data-l); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: auto; }
  .dt-plan-row { grid-template-columns: 26px minmax(0,1fr) 88px; row-gap: 4px; }
  .dt-plan-row .v.hide-sm { display: none; }
  .dt-plan-head { display: none; }
  .dt-split { flex-wrap: wrap; }
}

@media print {
  .dt-plan, .dt-bars, .dt-strategy, .dt-budget { display: none; }
}

/* ── phones ───────────────────────────────────────────────── */
@media (max-width: 560px) {
  .debt-hero { padding: 40px 0 24px; }
  .seg3 button { font-size: 11.5px; padding: 8px 6px; letter-spacing: 0; }
  .dt-strategy-note { font-size: 12px; padding: 11px 12px; }
  .dt-row { padding: 12px 12px 10px; }
  .dt-budget-head { gap: 12px; }
  .dt-budget-input { flex: 1 1 100%; justify-content: flex-end; }
  .dt-budget-input input { width: auto; flex: 1; }
  .dt-split-seg { flex: 1 1 140px; padding: 10px 12px; }
  .dt-split-seg .v { font-size: 21px; }
  .dt-bar-row { grid-template-columns: 1fr; gap: 4px; }
  .dt-bar-name { font-size: 12px; }
  .dt-bar-track { height: 20px; }
  .dt-comp-row { font-size: 12.5px; gap: 8px; }
  .dt-free { font-size: 38px; }
}
