/* TL-14 Business storage calculator (was "business stock space estimator"). Loaded only where [wt_tool id="business-storage-calculator"] renders.
 * Isolation contract (wt-tools.css): every selector starts .wt-, no Bootstrap names, no !important. */

.wt-bs-site { max-width: 380px; margin: 4px 0 6px; }
.wt-bs-h { margin: 20px 0 10px; }
/* three tabs fit one row on phones (the shared rule sizes four) */
@media (max-width: 520px) { .wt-bs .wt-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wt-bs-grid3 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0 0 10px; }
@media (min-width: 620px) { .wt-bs-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; } }
.wt-bs-line { margin: 0 0 12px; padding: 12px 14px 4px; border: 1px solid var(--wg-line); border-radius: var(--wg-radius-s); min-width: 0; }
.wt-bs-legend { padding: 0 6px; color: var(--wg-blue); font-size: 14px; font-weight: 600; }
.wt-bs-rm { margin: 0 0 8px; color: var(--wg-coral-text); }
.wt-bs-addl { margin: 0 0 6px; }
.wt-bs-checkl { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; cursor: pointer; }
.wt-bs-checkl input { width: 22px; height: 22px; flex: 0 0 auto; }
.wt-bs-adv { margin: 10px 0 0; }
.wt-bs-sum, .wt-bs-method summary { display: flex; align-items: center; min-height: 44px; color: var(--wg-blue); font-weight: 600; cursor: pointer; }
.wt-bs-errl { margin: 10px 0 0; padding: 0; list-style: none; }

/* result table: a real table that stacks as label/value pairs on narrow screens */
.wt-bs-res { width: 100%; margin: 0 0 12px; border-collapse: collapse; font-size: 15px; }
.wt-bs-res th, .wt-bs-res td { padding: 8px 10px; border-top: 1px solid var(--wg-line); text-align: left; vertical-align: top; }
.wt-bs-res thead th { background: var(--wg-band); color: var(--wg-blue); font-weight: 600; border-top: 0; }
.wt-bs-res tbody th { color: var(--wg-mute); font-weight: 500; }
.wt-bs-res td { font-weight: 600; }
@media (max-width: 459.98px) {
  .wt-bs-res thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wt-bs-res, .wt-bs-res tbody, .wt-bs-res tr, .wt-bs-res th, .wt-bs-res td { display: block; }
  .wt-bs-res tr { padding: 6px 0; border-top: 1px solid var(--wg-line); }
  .wt-bs-res th, .wt-bs-res td { padding: 2px 0; border: 0; }
  .wt-bs-res td::before { content: attr(data-label) ": "; color: var(--wg-mute); font-weight: 400; font-size: 13.5px; }
}
.wt-bs-statement { margin: 0 0 12px; padding-left: 1.1em; font-size: 14.5px; }
.wt-bs-statement li { margin: 0 0 6px; }
.wt-bs-statement .wt-gate { font-style: normal; color: var(--wg-ink); }
.wt-bs-sth { margin-top: 16px; }
.wt-bs-terms { margin: 8px 0 0; padding-left: 1.1em; color: var(--wg-mute); font-size: 13.5px; }
.wt-bs-note { margin: 0 0 6px; }
.wt-bs-m2 { color: var(--wg-mute); font-weight: 400; font-size: 13.5px; white-space: nowrap; }
/* (r1 Minor 9: the old nowrap rule made this table 1,160 px wide inside a 982 px wrap at 1024) */

/* ---- round 1 fixes (reviews/tl14-r1.md) ---- */
/* Major 1: a field in error has a coral border and its message directly under it. From 620 px the three-column rows
   use subgrid (label / input / message tracks) so a message under one field never knocks its row's inputs out of line. */
.wt-bs .wt-input[aria-invalid="true"] { border-color: var(--wg-coral-text); box-shadow: inset 0 0 0 1px var(--wg-coral-text); }
.wt-bs .wt-bs-ferr { margin: 0; }
.wt-bs-line > .wt-bs-ferr { margin: -4px 0 10px; }
@media (min-width: 620px) {
  .wt-bs-grid3 { row-gap: 0; column-gap: 12px; align-items: stretch; }
  .wt-bs-grid3 > .wt-field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
  .wt-bs-grid3 > .wt-field > .wt-label { align-self: end; margin: 0 0 6px; }
  .wt-bs-grid3 > .wt-field > .wt-bs-ferr { margin: 6px 0 0; }
  .wt-bs-grid3 > .wt-field:nth-child(n+4) { padding-top: 12px; }
}
.wt-bs-errl a { color: var(--wg-coral-text); font-weight: 600; text-decoration: underline; }
.wt-bs-errl li { margin: 0 0 4px; }

/* Minor 12: returning visitor prompt, shown before first paint (rule 13); never with the module failed */
.wt-bs-back { margin: 0 0 14px; }
.wt-bs-back-t { margin: 0 0 8px; }
.wt-bs-back .wt-actions { margin: 0; }
.wt-tool.wt-is-static .wt-bs-back { display: none; }

/* Minor 7: no-JS (and failed-module) form = three short sections */
.wt-bs-nojs { margin: 16px 0 0; }
.wt-bs-nojs-s { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--wg-line); border-radius: var(--wg-radius-s); background: #fff; }
.wt-bs-nojs-s p { margin: 0; font-size: 15px; }

/* Minor 9: "How much stock fits" fits without sideways scroll from 620 px (m² under the size, headers wrap, tighter
   cells below 1,200 px) and stacks as one card per size on phones. */
.wt-table.wt-bs-fits tbody th { white-space: nowrap; }
.wt-table.wt-bs-fits .wt-bs-m2 { display: block; }
.wt-table.wt-bs-fits thead th { white-space: normal; }
@media (max-width: 1199.98px) {
  .wt-table.wt-bs-fits th, .wt-table.wt-bs-fits td { padding: 8px 8px; font-size: 14.5px; }
}
@media (max-width: 619.98px) {
  .wt-table.wt-bs-fits thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wt-table.wt-bs-fits, .wt-table.wt-bs-fits tbody { display: block; }
  .wt-table.wt-bs-fits caption { display: block; }
  .wt-table.wt-bs-fits tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--wg-line); }
  .wt-table.wt-bs-fits tbody th { grid-column: 1 / -1; padding: 0; border: 0; font-size: 16px; }
  .wt-table.wt-bs-fits .wt-bs-m2 { display: inline; }
  .wt-table.wt-bs-fits td { display: block; padding: 0; border: 0; text-align: left; font-weight: 600; white-space: normal; }
  .wt-table.wt-bs-fits td::before { content: attr(data-label); display: block; color: var(--wg-mute); font-size: 13px; font-weight: 400; }
}

/* ---- UX round (reviews/ux/tl14-ux.md, UX-STANDARD.md) ---- */
.wt-bs-h1st { margin-top: 0; }
.wt-bs .wt-controls > .wt-panel-h { margin-bottom: 8px; }
/* tab counts: inline from 521 px; their own line on phones so a growing number never wraps a label */
.wt-bs-tc { font-weight: 400; }
@media (max-width: 520px) { .wt-bs .wt-tab { padding-top: 7px; padding-bottom: 7px; line-height: 1.25; } .wt-bs-tc { display: block; font-size: 13px; } }
/* Minor 5: the box name in the select, its dimensions under the line (never cut off) */
.wt-bs-line > .wt-bs-dimh { margin: -4px 0 10px; }
.wt-bs-trades { margin: 4px 0 14px; font-size: 15px; }
.wt-bs-trades a { font-weight: 600; }
.wt-bs-remember { margin: 8px 0 0; }
.wt-bs-acts { align-items: center; }
.wt-bs-undo { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 600; }
.wt-bs-privacy { margin: 10px 0 0; }
.wt-errors:focus { outline: 2px solid var(--wg-coral-text); outline-offset: 4px; }
.wt-bs-errh { margin: 10px 0 4px; color: var(--wg-coral-text); font-weight: 700; }
/* §4.1: the answer heading; "For 30 medium cartons and 2 UK pallets:" on its own line above the answer */
.wt-bs-ans { font-size: clamp(20px, 2vw, 24px); }
.wt-bs-for { display: block; margin: 0 0 4px; color: var(--wg-mute); font-size: 15px; font-weight: 500; }
.wt-bs-pick { margin: 8px 0 0; }
.wt-bs-store { margin-top: 16px; }
.wt-bs-next { margin: 14px 0 0; padding: 0; list-style: none; }
.wt-bs-next li { margin: 0 0 6px; }
.wt-bs-next .wg-arrowlink { display: inline-block; padding: 10px 0; }
.wt-bs-next .wg-arrowlink .wg-ico { margin-left: 4px; vertical-align: -3px; }
.wt-bs-keep { margin-top: 6px; }
.wt-bs-gtk .wt-bs-sth { font-size: 16px; }

/* r2 Minor 3: "What business space costs per sq ft, by store" as one card per store on phones (no sideways scroll) */
@media (max-width: 619.98px) {
  .wt-table.wt-bs-costs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wt-table.wt-bs-costs, .wt-table.wt-bs-costs tbody { display: block; }
  .wt-table.wt-bs-costs caption { display: block; }
  .wt-table.wt-bs-costs tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--wg-line); }
  .wt-table.wt-bs-costs tbody th { grid-column: 1 / -1; padding: 0; border: 0; font-size: 16px; text-align: left; }
  .wt-table.wt-bs-costs td { display: block; padding: 0; border: 0; text-align: left; font-weight: 600; white-space: normal; }
  .wt-table.wt-bs-costs td::before { content: attr(data-label); display: block; color: var(--wg-mute); font-size: 13px; font-weight: 400; }
}
/* phones: the figures as one line per column instead of the stacked table */
.wt-bs-resm { display: none; margin: 0 0 12px; padding: 0; list-style: none; font-size: 15px; }
.wt-bs-resm li { margin: 0; padding: 8px 0; border-top: 1px solid var(--wg-line); }
.wt-bs-resm li:last-child { border-bottom: 1px solid var(--wg-line); }
@media (max-width: 459.98px) { .wt-bs-resm { display: block; } .wt-bs .wt-bs-res { display: none; } }
