/* ============================================================
 * Utilities Bunker — Loan Payment Calculator (v2.1)
 * File: /assets/css/modules/calculators/financialcalculators/loan-payment-calculator.v2.1.css
 * Purpose:
 *  - Tool-only styling (layout polish, amortization table, work box)
 *  - Mobile-first, accessible, 44x44 targets
 * Notes:
 *  - DO NOT modify /assets/css/ub-toolkit.v2.1.css
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --loan-radius: 16px;
  --loan-gap: 14px;
}

/* ============================== Outputs / work formatting ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Make sure collapsible summaries feel clickable + accessible */
.ub-collapsible summary{
  cursor: pointer;
  font-weight: 950;
  min-height: 44px;
  display:flex;
  align-items:center;
}
.ub-collapsible summary:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ub-focus);
  border-radius: 12px;
}

/* ============================== Rail block buttons helper ============================== */
.ub-btn--block{ width: 100%; }

/* ============================== Inputs: keep stacked input + select (tool-safe) ============================== */
/* Some tools want input and select to stay stacked (like your Ohm's page).
   Toolkit may already enforce this; we keep it here as a harmless reinforcement. */
.ub-field .ub-inputrow{
  display:block !important;
}
.ub-field .ub-inputrow > input,
.ub-field .ub-inputrow > select{
  display:block !important;
  width:100% !important;
}
.ub-field .ub-inputrow > select{
  margin-top:6px;
}

/* Slightly tighter hint spacing for this tool */
.ub-field .hint{
  margin-top: 6px;
  font-size: 12px;
  color: var(--ub-muted);
}

/* ============================== Amortization preview ============================== */
.ub-amort{
  border: 1px solid var(--ub-border);
  border-radius: var(--loan-radius);
  background: var(--ub-surface-2);
  padding: 12px;
}

/* Table baseline: keep readable and scrollable on small screens */
.ub-amort-table{
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 640px; /* enables horizontal scroll on mobile */
}

.ub-amort-table th,
.ub-amort-table td{
  padding: 10px 8px;
  border-bottom: 1px solid var(--ub-border);
}

.ub-amort-table th{
  text-align: left;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ub-muted);
  font-weight: 950;
  background: var(--ub-card-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ub-amort-table td{
  font-family: var(--ub-mono);
  font-size: 13px;
}

.ub-amort-table td:nth-child(n+2),
.ub-amort-table th:nth-child(n+2){
  text-align: right;
}

.ub-amort-wrap{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
}

/* Row hover for scanning */
.ub-amort-table tbody tr:hover td{
  background: var(--ub-surface-2);
}

/* ============================== Small screens polish ============================== */
@media (max-width: 520px){
  .ub-amort{
    padding: 10px;
  }
}

/* ============================== Optional: rail section cosmetics (tool-only) ============================== */
/* If your toolkit already styles ub-common/ub-related, this simply reinforces neat edges. */
.ub-card.ub-common,
.ub-card.ub-related{
  overflow: hidden;
}