/* BizCalcs comparisons (F4) and results matrices (H1), loaded after bizcalc.css only on those pages (H5). Same tokens. */
/* The layout follows the calculator's own width (container bc): a comparison wrap (G2), or the matrix block itself. */
.bizcalc-wrap.is-compare { container: bc / inline-size; }
.bizcalc-matrices { container: bcm / inline-size; }
/* F4 inputs: cards, two per row from 560 px, one grid from 940 px. */
.bizcalc-compare-keys, .bizcalc-compare-gap { display: none; }
.bizcalc-item { margin: 0 0 12px; padding: 14px 16px 0; border: 1px solid var(--bc-line); border-radius: 12px; background: var(--bc-soft); }
.bizcalc-compare-head { margin: 0 0 10px; font-weight: 700; color: var(--bc-ink); }
.bizcalc-item .bizcalc-options { display: flex; flex-wrap: nowrap; }
.bizcalc-item .bizcalc-options label { flex: 1 1 0; min-width: 0; padding: 0 8px; }
@container bc (min-width: 560px) and (max-width: 939px) { .bizcalc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } }
@container bc (min-width: 940px) {
  @supports (grid-template-rows: subgrid) {
    .bizcalc-compare { display: grid; grid-template-columns: minmax(7em, max-content) repeat(var(--bc-items), minmax(0, 1fr)); gap: 0 12px; }
    .bizcalc-compare > * { display: grid; grid-row: span var(--bc-rows); grid-template-rows: subgrid; margin: 0; padding: 0; border: 0; background: none; }
    .bizcalc-compare-keys > span, .bizcalc-compare-gap { display: flex; align-items: center; min-height: 48px; margin: 0 0 16px; font-size: .95em; font-weight: 600; line-height: 1.25; color: var(--bc-ink); }
    .bizcalc-item .bizcalc-field:not(.bizcalc-check) > :is(label, legend), .bizcalc-check-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .bizcalc-item .bizcalc-field { align-self: start; }
    .bizcalc-item .bizcalc-check > label { min-width: 44px; }
    .bizcalc-compare .bizcalc-compare-head { min-height: 0; margin: 0 0 10px; }
  }
}
/* Results table (rows = metric, columns = loans or matrix columns); headings wrap, never clip (H5). */
.bizcalc-compare-out td { color: var(--bc-ink); font-weight: 600; }
.bizcalc-compare-out th { white-space: normal; overflow-wrap: break-word; }
.bizcalc-compare-out tbody th { font-weight: 500; color: var(--bc-text); background: #fff; }
.bizcalc-compare-out thead td { background: var(--bc-soft); }
.bizcalc-matrices { margin: 0 0 12px; }
/* Tiles: up to a 760 px calculator a comparison's rows, and up to the same 666 px results block (the results panel is
   about 94 px narrower than the calculator) a matrix's rows, each become a tile listing the columns. A column label keeps
   its longest word whole; the value drops under it only when both cannot share the line. */
@container bc (max-width: 760px) {
  .bizcalc-compare-out { background: none; }
  .bizcalc-compare-out thead { display: none; }
  .bizcalc-compare-out table, .bizcalc-compare-out tbody, .bizcalc-compare-out tr, .bizcalc-compare-out th { display: block; }
  .bizcalc-compare-out tr { margin: 0 0 10px; padding: 10px 14px; background: #fff; border-radius: 10px; }
  .bizcalc-compare-out tbody th { padding: 0 0 4px; border: 0; font-weight: 700; color: var(--bc-ink); }
  .bizcalc-compare-out td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0; border: 0; white-space: normal; text-align: right; }
  .bizcalc-compare-out td::before { content: attr(data-item); flex: 1 1 0; min-width: min-content; font-weight: 500; text-align: left; color: var(--bc-muted); }
  .bizcalc-compare-out td > * { flex: none; margin-left: auto; white-space: nowrap; }
}
@container bcm (max-width: 666px) {
  .bizcalc-matrix { background: none; }
  .bizcalc-matrix thead { display: none; }
  .bizcalc-matrix table, .bizcalc-matrix caption, .bizcalc-matrix tbody, .bizcalc-matrix tr, .bizcalc-matrix th { display: block; }
  .bizcalc-matrix caption { padding: 0 0 8px; }
  .bizcalc-matrix tr { margin: 0 0 10px; padding: 10px 14px; background: #fff; border-radius: 10px; }
  .bizcalc-matrix tbody th { padding: 0 0 4px; border: 0; font-weight: 700; color: var(--bc-ink); }
  .bizcalc-matrix td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0; border: 0; white-space: normal; text-align: right; }
  .bizcalc-matrix td::before { content: attr(data-item); flex: 1 1 0; min-width: min-content; font-weight: 500; text-align: left; color: var(--bc-muted); }
  .bizcalc-matrix td > * { flex: none; margin-left: auto; white-space: nowrap; }
  .bizcalc-matrix td.is-empty { display: none; }
}
