/* ============================================================
   msl-book-table — data-table primitive for cast book chapters
   (accounting / finance books that are tables-heavy).
   STATUS: candidate, VERIFIED in 390px same-origin iframe on draft 133266
   (2026-05-30). NOT yet deployed to the live theme — see handoff
   handoff-accounting-tables-pilot-2026-05-30.md.

   Why it exists: the live theme does NOT currently carry the
   .msl-compare-table rule, so cast book tables fell back to faint
   cream-on-cream defaults AND — critically — had no mobile transform,
   so every wide accounting table overflowed horizontally at 390px
   (risk #1). This class fixes both: visible Kit styling on desktop +
   card-collapse on mobile using each cell's data-label.

   Tokens mirror msl-kit.css :root. When folding into the canonical
   kit, swap the hard-coded hex for the var(--msl-*) tokens.
   ============================================================ */

.msl-book-table{
  width:100%;
  border-collapse:collapse;
  margin:1.5rem 0;
  font-size:.95rem;
  background:#fff;                 /* var(--msl-card, #fff) */
}
.msl-book-table caption{
  caption-side:top;
  text-align:right;
  font-weight:700;
  color:#06142b;                   /* var(--msl-navy) */
  padding:0 0 .5rem;
}
.msl-book-table th,
.msl-book-table td{
  border:1px solid rgba(6,20,43,.18);   /* var(--msl-line) */
  padding:10px 12px;
  text-align:right;
  vertical-align:top;
}
.msl-book-table thead th{
  background:#06142b;              /* var(--msl-navy) */
  color:#f6efe2;                   /* var(--msl-cream) */
  font-weight:700;
}
.msl-book-table tbody tr:nth-child(even){ background:#faf6ec; }   /* zebra */

/* numbering / index sub-row: the book's "(1) (2) (3)…" column keys,
   kept so prose references like "עמודה (3)" still resolve. */
.msl-book-table .msl-book-table__idx td{
  background:#f4e0b3;             /* var(--msl-amber-soft) */
  color:#06142b;                  /* var(--msl-navy) */
  font-weight:600;
  text-align:center;
  font-size:.85rem;
}

/* ---- Mobile: collapse each row to a card (no horizontal scroll) ---- */
@media (max-width:600px){
  .msl-book-table thead{ display:none; }
  .msl-book-table,
  .msl-book-table tbody,
  .msl-book-table tr,
  .msl-book-table td{ display:block; width:100%; }
  .msl-book-table tr{
    margin-bottom:14px;
    border:1px solid rgba(6,20,43,.18);
    border-radius:8px;
    overflow:hidden;
  }
  .msl-book-table td{
    border:0;
    border-bottom:1px solid rgba(6,20,43,.08);
    display:flex;
    justify-content:space-between;
    gap:12px;
  }
  .msl-book-table td:last-child{ border-bottom:0; }
  .msl-book-table td::before{
    content:attr(data-label);
    font-weight:700;
    color:#06142b;                /* var(--msl-navy) */
  }
  .msl-book-table td[data-label=""]::before{ content:""; }
}
