/* Amortization table (js/v2/amort-table.js), shared by mortgage, loan and debt payoff. Ink on paper.
   On a phone the box scrolls sideways inside itself and the first column (year / month) stays put. */
.am-scroll { position: relative; max-height: min(72vh, 760px); overflow: auto; border: 1px solid var(--hair); border-radius: var(--r-chip); background: var(--paper-2); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.am-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.am-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font: 400 15px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.am-table th, .am-table td { padding: 12px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--hair); }
.am-table thead th { position: sticky; top: 0; z-index: 2; background: var(--paper); font: 500 13px/1.3 var(--font-sans); color: var(--ink-2); }
.am-table .am-first { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--paper-2); box-shadow: 1px 0 0 var(--hair); }
.am-table thead .am-first { z-index: 3; background: var(--paper); }
.am-year th, .am-year td { font-weight: 400; }
.am-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: -12px 0; padding: 0; border: 0; background: none; cursor: pointer; font: 500 15px/1.2 var(--font-sans); color: var(--ink); text-align: left; }
.am-toggle svg { width: 16px; height: 16px; flex: none; transition: transform .25s var(--ease-out); }
.am-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.am-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.am-first small { display: block; margin-top: 2px; font: 400 12px/1.2 var(--font-sans); color: var(--ink-2); }
.am-group.is-open .am-year > * { background: var(--paper); }
.am-month th, .am-month td { padding-top: 9px; padding-bottom: 9px; font-size: 14px; color: var(--ink-2); background: var(--paper-2); }
.am-month .am-first { padding-left: 42px; font-weight: 400; color: var(--ink); }
.am-months[hidden] { display: none; }
.am-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 18px; }
.am-tools .ks-seg button { white-space: nowrap; }
.am-note { margin: 14px 0 0; font: 400 13px/1.5 var(--font-sans); color: var(--ink-2); max-width: 60em; }
@media (max-width: 600px) {
  .am-table { min-width: 500px; font-size: 14px; }
  .am-table th, .am-table td { padding: 10px 10px; }
  .am-table .am-first { width: 108px; min-width: 108px; max-width: 108px; white-space: normal; }
  .am-first small { font-size: 11.5px; }
  .am-toggle { gap: 6px; font-size: 14px; }
  .am-month .am-first { padding-left: 32px; }
  .am-tools .ks-seg { width: 100%; }
  .am-tools .ks-seg button { flex: 1; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { .am-toggle svg { transition: none; } }
@media print { .am-scroll { max-height: none; overflow: visible; border: 0; } .am-table { min-width: 0; } .am-table thead th, .am-table .am-first { position: static; } }
