/* Debt Payoff Planner — scoped styles on the site's design tokens
   (site.css :root variables), following the weather app's conventions. */

.dp-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 4rem;
}

.dp-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dp-results { display: flex; flex-direction: column; gap: 1rem; }

.dp-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.dp-h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 0 0 0.35rem; }
.dp-h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }

.dp-muted { color: var(--text-sub); font-size: 0.92rem; line-height: 1.6; margin: 0.35rem 0 0; }
.dp-error { color: #FF8080; font-size: 0.92rem; line-height: 1.6; margin: 0.5rem 0 0; min-height: 1rem; }

.dp-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }

.dp-btn {
    font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
    padding: 0.6rem 1.1rem; border-radius: 9px; cursor: pointer;
    border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dp-btn-sm { padding: 0.45rem 0.8rem; font-size: 0.82rem; }
.dp-btn-blue { background: var(--accent); color: #06122e; border-color: var(--accent); }
.dp-btn-blue:hover { background: #7d99ff; }
.dp-btn-ghost { background: transparent; color: var(--text-sub); border-color: var(--border-lit); }
.dp-btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.dp-input {
    width: 100%;
    font-family: var(--mono); font-size: 0.9rem;
    color: var(--text); background: var(--bg); border: 1px solid var(--border-lit);
    border-radius: 9px; padding: 0.6rem 0.7rem;
}
.dp-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Debt rows: name | balance | APR | minimum | remove */
.dp-debt-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.dp-debt-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.6fr) 1fr 1fr 1fr auto;
    gap: 0.6rem;
    align-items: end;
}
.dp-add-row { margin-top: 0.9rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.dp-cell { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.dp-cell-label {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dp-remove { align-self: end; color: var(--text-faint); }
.dp-remove:hover { color: #FF8080; }

.dp-budget { margin-top: 1.1rem; max-width: 26rem; }
.dp-budget-note { font-size: 0.8rem; }
.dp-totals { margin: 0.9rem 0 0; font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); min-height: 1em; }

/* Strategy comparison */
.dp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 1rem; }
.dp-strategy { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.2rem; }
.dp-tagline { margin: 0.15rem 0 0.9rem; font-size: 0.8rem; color: var(--text-faint); }
.dp-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.3rem 0; }
.dp-stat-label { font-size: 0.8rem; color: var(--text-sub); }
.dp-stat-value { font-family: var(--mono); font-size: 0.88rem; color: var(--text); text-align: right; }
.dp-stat-big { border-bottom: 1px solid var(--border); padding-bottom: 0.55rem; margin-bottom: 0.35rem; }
.dp-stat-big .dp-stat-value { font-family: var(--sans); font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.dp-verdict { margin: 1rem 0 0; font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.55; }

/* Chart */
.dp-chart { margin-top: 0.9rem; }
.dp-chart svg { display: block; width: 100%; height: auto; }
.dp-legend { display: flex; gap: 1.25rem; margin-top: 0.6rem; }
.dp-key { font-size: 0.8rem; color: var(--text-sub); display: inline-flex; align-items: center; gap: 0.45rem; }
.dp-key::before { content: ""; width: 1.1rem; height: 0; border-top: 3px solid; border-radius: 2px; }
.dp-key-snowball::before { border-color: #6c8aff; }
.dp-key-avalanche::before { border-top-style: dashed; border-color: #4ade80; }

/* Payoff order */
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dp-seg { display: inline-flex; border: 1px solid var(--border-lit); border-radius: 8px; overflow: hidden; }
.dp-seg-btn {
    font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
    padding: 0.4rem 0.85rem; background: transparent; color: var(--text-sub);
    border: none; border-right: 1px solid var(--border-lit); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.dp-seg-btn:last-child { border-right: none; }
.dp-seg-btn:hover { color: var(--text); background: var(--bg-hover); }
.dp-seg-btn.is-on { color: #06122e; background: var(--accent); }

.dp-order { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.dp-order-row {
    display: flex; align-items: center; gap: 0.9rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.65rem 0.9rem;
}
.dp-order-num {
    flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
    font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
}
.dp-order-name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--text); font-size: 0.92rem; }
.dp-order-date { flex: none; font-family: var(--mono); font-size: 0.82rem; color: var(--text-sub); }
.dp-order-interest { flex: none; font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); }

.dp-privacy { margin-top: 1rem; font-size: 0.8rem; }

@media (max-width: 700px) {
    .dp-compare { grid-template-columns: 1fr; }
    .dp-debt-row { grid-template-columns: 1fr 1fr; }
    .dp-cell-name { grid-column: 1 / -1; }
    .dp-remove { grid-column: 2; justify-self: end; }
    .dp-add-row .dp-btn { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .dp-card { padding: 1.15rem; }
    .dp-order-row { flex-wrap: wrap; gap: 0.35rem 0.9rem; }
    .dp-order-interest { flex-basis: 100%; padding-left: 2.5rem; }
}
