/*
 * Lane L3's form tools (site/pages/free-tools/business-tool.php), after ft-base.css, ft-calc.css (the fields and the
 * result card) and ft-lookup.css (the tables of facts, the save box). Tokens only; 44 px targets.
 *
 *   .ft-field.is-computed     a markup field the calculator worked out (its label also says "(calculated)")
 *   .ft-biz__rule             the state's rule and its source, under the sales tax result
 *   .ft-biz__actions          the result's buttons
 *   .ft-tiers                 the parts chart's tier editor: rows of cost from, multiplier and Remove
 *   .ft-biz__test / __chart   the parts chart's tested cost and live chart, in the result card (Print prints the chart)
 *   .ft-biz__tables           the worked example's tables, side by side only when every column fits
 */
.ft-field.is-computed .input {
    background: var(--c-surface-2);
    border-style: dashed;
}

.ft-field__computed {
    font-weight: var(--fw-regular, 400);
    color: var(--c-text-2);
}

.ft-biz__rule {
    display: grid;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    padding: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--c-text);
    background: var(--c-surface);
    border-left: 3px solid var(--c-line-strong);
}

.ft-biz__rule p {
    margin: 0;
}

.ft-biz__source a {
    display: inline-block;
    padding: var(--sp-1) 0;
    color: var(--c-brand);
}

.ft-biz__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.ft-biz__actions .btn {
    min-height: 44px;
}

.ft-tiers {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.ft-tiers__head,
.ft-tiers__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--sp-2);
    align-items: center;
}

.ft-tiers__head {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--c-text-2);
}

.ft-tiers__list {
    display: grid;
    gap: var(--sp-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-tiers__row .input {
    min-height: 44px;
    font-size: 16px;
}

.ft-tiers__row .btn,
.ft-tiers__add {
    min-height: 44px;
}

.ft-tiers__add {
    justify-self: start;
}

.ft-tiers__empty,
.ft-tiers__problems {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-tiers__empty[hidden],
.ft-tiers__problems:empty {
    display: none;
}

.ft-tiers__problems {
    padding: var(--sp-2) var(--sp-3);
    color: var(--c-text);
    background: var(--c-surface-2);
    border-left: 3px solid var(--c-line-strong);
}

/* the part cost tested, at the top of the result card, right over its price */
.ft-biz__test {
    padding: var(--sp-3) 0 var(--sp-2);
}

.ft-biz__test .field {
    margin: 0;
}

/* the chart the tiers make, in the result card */
.ft-biz__chart {
    margin: var(--sp-4) 0 var(--sp-3);
}

.ft-biz__chart[hidden] {
    display: none;
}

/* five number columns fit a 390 px phone's result card without a sideways scroll */
.ft-biz__chart .ft-table th,
.ft-biz__chart .ft-table td {
    padding-inline: var(--sp-2);
}

.ft-biz__chart .ft-table thead th {
    white-space: normal;
}

@media (max-width: 479px) {
    .ft-biz__chart .ft-table th,
    .ft-biz__chart .ft-table td {
        padding-inline: var(--sp-1);
    }
}

/* the worked example's two tables: side by side only when every column fits, else one under the other */
.ft-biz__tables {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 27rem), 1fr));
}

@media print {
    .ft-biz__actions,
    .ft-tiers__row .btn,
    .ft-tiers__add,
    .ft-lookup__save {
        display: none;
    }

    /* Print on the parts chart prints the chart, not the editor */
    .ft-biz[data-ft-biz="parts"] .ft-calc__inputs,
    .ft-biz[data-ft-biz="parts"] .ft-biz__test,
    .ft-biz[data-ft-biz="parts"] .ft-out,
    .ft-biz[data-ft-biz="parts"] .ft-work,
    .ft-biz[data-ft-biz="parts"] .ft-calc__status,
    .ft-biz[data-ft-biz="parts"] > .ft-calc__result > .ft-calc__title {
        display: none !important;
    }

    .ft-biz[data-ft-biz="parts"] .ft-calc__result {
        padding: 0;
        border: 0;
    }

    .ft-biz__chart {
        overflow: visible;
        font-size: 12pt;
    }
}
