/* ============================================================
   HearthLoan — Refinance Approval Calculator (page-specific)
   Loaded after styles.css and calc-page.css.
   ============================================================ */

/* A denial rate is not good or bad news by itself: neutral ink */
.results-hero .figure.ap-figure { color: var(--ink-900); }

.ap-flag {
  margin: 0 20px 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-700);
  background: var(--accent-tint);
  border-radius: var(--radius);
  text-align: left;
}
.ap-flag[hidden] { display: none; }
.ap-flags { padding-top: 16px; border-bottom: 1px solid var(--border); }
.ap-flags.is-empty { display: none; }

/* either/or input rows */
.ap-or {
  display: block;
  margin: 4px 0 12px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-500);
}

/* ---- denial rate by DTI band ---------------------------------- */
.ap-bars-wrap { padding: 20px; border-bottom: 1px solid var(--border); }
.ap-bars-wrap h3 {
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 12px;
}
.ap-bar {
  display: grid;
  grid-template-columns: 64px 1fr 76px;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  margin: 0 -6px;
  font-size: 13px;
  line-height: 18px;
  border-radius: var(--radius);
}
.ap-bar.is-current { background: var(--accent-tint); font-weight: 600; }
.ap-bar-label { color: var(--ink-600); font-variant-numeric: tabular-nums; }
.ap-bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.ap-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}
.ap-bar.is-current .ap-bar-fill { background: var(--accent-hover); }
.ap-bar-value {
  text-align: right;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.ap-bar-value em { font-style: normal; font-size: 11px; color: var(--ink-500); }

/* ---- denial reasons ------------------------------------------- */
.ap-reasons-wrap { padding: 20px; border-bottom: 1px solid var(--border); }
.ap-reasons-wrap h3 {
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 8px;
}
.ap-reasons { list-style: none; margin: 0; padding: 0; }
.ap-reasons li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-600);
  border-bottom: 1px solid var(--border-light);
}
.ap-reasons li:last-child { border-bottom: 0; }
.ap-reasons .value { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.ap-small {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-500);
}

/* ---- agency vs lender panel ----------------------------------- */
.ap-agency { padding: 20px; }
.ap-agency[hidden] { display: none; }
.ap-agency h3 {
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 10px;
}
.ap-agency dl { margin: 0; }
.ap-agency dt {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  margin: 12px 0 4px;
}
.ap-agency dt:first-child { margin-top: 0; }
.ap-agency dd {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-700);
}

/* ---- state block ---------------------------------------------- */
.ap-state-box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 0 24px;
  background: var(--surface);
}
.ap-state-box h2 { margin-top: 0; }
.ap-state-box ul { margin-bottom: 0; }

/* ---- data tables in prose ------------------------------------- */
.ap-table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  -webkit-overflow-scrolling: touch;
}
.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 21px;
  font-variant-numeric: tabular-nums;
}
.ap-table caption {
  caption-side: bottom;
  text-align: left;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-500);
  padding-top: 8px;
}
.ap-table th,
.ap-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.ap-table th:first-child,
.ap-table td:first-child { text-align: left; }
.ap-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-600);
  border-bottom: 2px solid var(--border-strong);
}
.ap-table tr.is-us td { font-weight: 600; background: var(--surface-2); }
.ap-table tbody tr:hover td { background: var(--surface-hover); }

.ap-formula {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 24px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 16px;
  max-width: 70ch;
  overflow-x: auto;
}

@media (max-width: 560px) {
  .ap-bar { grid-template-columns: 56px 1fr 68px; gap: 8px; }
  .ap-state-box { padding: 16px; }
  .ap-table { font-size: 14px; }
  .ap-table th, .ap-table td { padding: 7px 8px; }
}
