/* ============================================================
 * Utilities Bunker — Canadian Mortgage Calculator (v2.1)
 * File: /assets/css/modules/calculators/financialcalculators/canadian-mortgage-calculator.v2.1.css
 * Purpose:
 * - Tool-only layout + summary lab + schedule table + work formatting
 * - Mobile-first, 44x44 targets, clamp typography
 * Notes:
 * - Do NOT modify /assets/css/ub-toolkit.v2.1.css
 * ============================================================ */

/* ============================== Local tokens (tool-scoped) ============================== */
:root{
  --cmc-radius: 16px;
  --cmc-gap: 14px;
}

/* ============================== Header row polish ============================== */
.ub-headrow{
  display:flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.ub-h1fix{
  margin:0;
  font-size: var(--ub-fs-5);
  letter-spacing: -0.02em;
}

.ub-subfix{
  margin: 6px 0 0;
}

/* ============================== Hero layout (summary left, inputs right) ============================== */
.ub-hero{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--cmc-gap);
}

@media (max-width: 980px){
  .ub-hero{
    grid-template-columns: 1fr;
  }
}

/* ============================== Summary "lab" ============================== */
.ub-lab{
  background: var(--ub-surface-2);
  border: 1px solid var(--ub-border);
  border-radius: var(--cmc-radius);
  padding: 12px;
}

.ub-lab-top{
  display:flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ub-lab-title{
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 950;
  letter-spacing: .01em;
}

.ub-lab-sub{
  font-size: 12px;
  color: var(--ub-muted);
  margin-top: 2px;
}

/* ============================== KPI tiles ============================== */
.ub-kpis{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ub-kpi{
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
}

.ub-kpi .k{
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ub-muted);
}

.ub-kpi .v{
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: 14px;
  margin-top: 2px;
}

@media (max-width: 520px){
  .ub-kpi{ min-width: 112px; }
}

/* ============================== Mini breakdown ============================== */
.ub-mini{
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
  overflow: hidden;
}

.ub-mini-row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--ub-border);
}

.ub-mini-row:first-child{ border-top: none; }

.ub-mini-row .k{
  font-size: 12px;
  font-weight: 900;
  color: var(--ub-muted);
  letter-spacing: .02em;
}

.ub-mini-row .v{
  font-family: var(--ub-mono);
  font-weight: 950;
  font-size: 13px;
}

/* ============================== Lists / small helpers ============================== */
.ub-ol,
.ub-ul{
  margin: 0;
  padding-left: 18px;
}

.ub-hr{
  border: none;
  border-top: 1px solid var(--ub-border);
  margin: 14px 0;
}

/* Checkbox chip alignment */
.ub-chip--check{
  display:inline-flex;
  gap: 10px;
  align-items: center;
}

/* Ensure touch target for selects in compact cards */
.ub-card--tight select,
.ub-card--tight input{
  min-height: var(--ub-hit);
}

/* ============================== Work output ============================== */
.ub-work{
  font-family: var(--ub-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ============================== Schedule table ============================== */
.ub-tablewrap{
  overflow:auto;
  border: 1px solid var(--ub-border);
  border-radius: var(--ub-radius-2);
  background: var(--ub-card-bg);
}

.ub-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.ub-table th,
.ub-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--ub-border);
  text-align: left;
  font-size: var(--ub-fs-1);
}

.ub-table thead th{
  position: sticky;
  top: 0;
  background: var(--ub-surface-2);
  z-index: 1;
  font-weight: 950;
  letter-spacing: .02em;
}

.ub-table tbody tr:hover{
  background: var(--ub-surface-2);
}

.ub-table td:last-child{
  font-family: var(--ub-mono);
  font-weight: 900;
}

@media (max-width: 520px){
  .ub-table{ min-width: 560px; }
}

/* ============================== Rail helper ============================== */
.ub-btn--block{
  width: 100%;
}

/* ============================== Reduce motion friendly (extra-safe) ============================== */
@media (prefers-reduced-motion: reduce){
  .ub-table thead th{ scroll-margin-top: 0; }
}