/*
 * VFT Table — STRUCTURE + default sizing.
 * Colours, border colour, radius, padding and typography all come from the
 * widget's Style tab (control defaults) so the Style section stays the single
 * source of truth. This file only carries layout + the border WIDTH/STYLE that
 * a control-set colour needs to render against, plus the VFT default text size.
 */
.vft-table__wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-width: 1px;          /* colour + radius come from the Style tab */
    border-style: solid;
    padding: 6px 0;             /* white gutter above/below so the header clears the rounded corner (bg from Style tab) */
}
.vft-table__table {
    width: 100%;
    border-collapse: collapse;
}
/* Width mode (Style ▸ Table ▸ Table width). Default = full width (base rules
   above). "Fit content" shrinks the card AND the table together so the border
   hugs the columns instead of stretching across the row. */
.vft-table--w-auto .vft-table__wrap {
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
}
.vft-table--w-auto .vft-table__table {
    width: auto;
}
.vft-table__table th,
.vft-table__table td {
    vertical-align: middle;
    text-align: left;
    font-size: 1.125rem;        /* text-lg — VFT default; override via Style ▸ Typography */
    line-height: 1.75rem;
    /* Keep columns readable on narrow screens: the table stays wide and the
       wrap scrolls horizontally instead of squeezing text to one letter/line. */
    min-width: 120px;
    overflow-wrap: break-word;
}
.vft-table__table thead th {
    font-weight: 700;
    white-space: nowrap;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}
.vft-table__table tbody td {
    border-top-width: 1px;
    border-top-style: solid;
}
.vft-table__table tbody tr:first-child td { border-top: 0; }
/* Soft inner vertical dividers between columns (not the outer edges). */
.vft-table__table thead th:not(:first-child),
.vft-table__table tbody td:not(:first-child) {
    border-left-width: 1px;
    border-left-style: solid;
}

/* Inline-editing wrappers fill the cell so the whole cell is clickable, and
   stray margins from rich-text content collapse. */
.vft-table__hcell,
.vft-table__cell { display: block; }
.vft-table__cell > *:first-child { margin-top: 0; }
.vft-table__cell > *:last-child  { margin-bottom: 0; }

@media (max-width: 640px) {
    .vft-table__table th,
    .vft-table__table td { font-size: 1rem; }
}
