/* TL-04 price table: rules added by the r1 and r2 fixes. Loaded only where the tool renders, after wt-tools.css (the
   base TL-04 rules stay there unchanged). Isolation contract: every selector starts .wt-, no !important.
   Every rule here is scoped `.wt-tool .wt-pt` so it also wins inside the town price posts (see the block below). */

/* ---- Inside rich-text posts (TL-04 r2 Majors 1 and 2, DECISIONS #41) ----------------------------------------------
   The 16 town price posts render the tool inside `.wigwam-richtext .entry-content`, where the theme's
   post-content-styling.css styles every table, link and h4 at (0,2,1) to (0,2,2): the table becomes display:block with
   overflow-x:auto (crushed caption, dead sticky header), thead and tbody become separate display:table boxes (columns
   misalign), the header row turns blue with uppercase 13 px text (blue-on-blue sort buttons), cells get its padding and
   zebra rows, every link turns bold blue (the kit's white "See {store} store" button text loses), and h4s go uppercase.
   These rules put the tool's own look back at (0,3,1) or higher. They are identical to wt-tools.css values, so the
   national page (no theme rules there) looks exactly as before. */
.wt-tool .wt-pt table.wt-pt-table { display: table; width: 100%; overflow: visible; margin: 0; border-collapse: collapse; border-radius: 0; box-shadow: none; table-layout: auto; }
.wt-tool .wt-pt .wt-pt-table thead { display: table-header-group; width: auto; }
.wt-tool .wt-pt .wt-pt-table tbody { display: table-row-group; width: auto; }
.wt-tool .wt-pt .wt-pt-table th, .wt-tool .wt-pt .wt-pt-table td { padding: 10px 14px; border-top: 1px solid var(--wg-line); border-bottom: 0; text-align: left; vertical-align: top; }
.wt-tool .wt-pt .wt-pt-table .wt-num { text-align: right; }
.wt-tool .wt-pt .wt-pt-table thead th { border-top: 0; background: var(--wg-band); color: var(--wg-blue); font-size: inherit; font-weight: 600; letter-spacing: normal; text-transform: none; }
.wt-tool .wt-pt .wt-pt-table tbody tr:nth-child(even) { background: transparent; }
.wt-tool .wt-pt .wt-pt-table tr[hidden] { display: none; }
.wt-tool .wt-pt .wt-pt-table caption { padding: 12px 14px; color: var(--wg-mute); font-size: 13.5px; text-align: left; caption-side: top; }
.wt-tool .wt-pt .wt-pt-q { margin: 14px 0 4px; color: var(--wg-blue); font-size: 16px; font-weight: 600; letter-spacing: normal; text-transform: none; }
/* Kit buttons and arrow links keep the kit's colours (white on teal: axe color-contrast was 1.47:1 on every post). */
.wt-tool .wt-pt a.wg-b { font-weight: 600; text-decoration: none; }
.wt-tool .wt-pt a.wg-b--primary, .wt-tool .wt-pt a.wg-b--primary:visited, .wt-tool .wt-pt a.wg-b--primary:hover, .wt-tool .wt-pt a.wg-b--primary:focus { color: #fff; }
.wt-tool .wt-pt a.wg-b--ghost, .wt-tool .wt-pt a.wg-b--ghost:visited { color: var(--wg-blue); }
.wt-tool .wt-pt a.wg-b--ghost:hover { color: #fff; }
.wt-tool .wt-pt a.wg-b--plain, .wt-tool .wt-pt a.wg-b--plain:visited, .wt-tool .wt-pt a.wg-b--plain:hover { color: var(--wg-blue); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.wt-tool .wt-pt a.wg-arrowlink, .wt-tool .wt-pt a.wg-arrowlink:hover { color: var(--wg-blue); font-weight: 500; }

/* Landing on #price-by-size-h: never under the fixed site header (106 px phones/tablet, 136 px desktop). */
.wt-tool .wt-pt .wt-pt-h { scroll-margin-top: 150px; }
.wt-tool .wt-pt .wt-pt-h:focus { outline: none; }
.wt-tool .wt-pt .wt-pt-h:focus-visible { outline: 2px solid var(--wg-teal); outline-offset: 2px; }

/* The remembered-store line is filled before first paint by tool.php's inline script (rule 14), so it takes space only
   when it has something to offer (UX Minor 6: an empty 44 px gap above the store links). */
.wt-tool .wt-pt .wt-pt-remember { min-height: 0; margin: 0; }
.wt-tool .wt-pt .wt-pt-remember.wt-pt-remember--on { min-height: 44px; margin: 0 0 6px; }
/* UX round: the live status under the choices, the "Which tool?" line, the store-guide label, the placeholder button,
   and a quiet "loading" state while another store's table is fetched (the old one stays readable until it is replaced). */
/* Final review Major 1: the status line is always there with its height reserved (one line; two under 600 px, where
   the longest message wraps), so "Loading prices for ..." never pushes the content below it. On the national page the
   heading reserves the height of its longest store name too (3 lines under 340 px, 2 under 700 px, else 1). */
.wt-tool .wt-pt .wt-pt-statusrow { display: flex; align-items: flex-start; gap: 4px 14px; margin: 0 0 12px; }
.wt-tool .wt-pt .wt-pt-status { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 500; }
/* Final r2 Minor 5: the reserve is for the store switch, so national page only (the town posts never switch). */
.wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-status { min-height: 1lh; }
.wt-tool .wt-pt .wt-pt-statusrow .wt-pt-clear { flex: none; min-height: 44px; margin: -10px 0 0; }
@media (max-width: 599.98px) { .wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-status { min-height: 2lh; } }
/* Town posts under 600 px: nothing is reserved. Until the visitor filters or sorts, the empty status row (and the hidden "Start again")
   takes no space; the empty status paragraph stays in the page, so it still announces. */
@media (max-width: 599.98px) {
  .wt-tool .wt-pt--fixed:not(.wt-pt--touched) .wt-pt-statusrow:has(> .wt-pt-status:empty) { margin: 0; }
  .wt-tool .wt-pt--fixed:not(.wt-pt--touched) .wt-pt-statusrow:has(> .wt-pt-status:empty) > .wt-pt-clear--off { display: none; }
  /* Polish Minor 4: the row opens on the first tap or focus on a control (inside the input window, script adds
     wt-pt--touched), with the national page's two-line reserve, so the first filter or sort pushes nothing down. */
  .wt-tool .wt-pt--fixed.wt-pt--touched .wt-pt-status { min-height: 2lh; }
}
/* The theme hides an empty paragraph inside posts; once touched, the status line keeps its box (and its reserve). */
.wt-tool .wt-pt--fixed.wt-pt--touched .wt-pt-status { display: block; }
@media (min-width: 600px) { .wt-tool .wt-pt--fixed.wt-pt--touched .wt-pt-status { min-height: 1lh; } }
/* Under 360 px a filter message beside "Start again" can take three lines ("Showing 6 prices for all sizes, the upper
   floor."), so the reserve is three lines there (national page, and town posts once touched). */
@media (max-width: 359.98px) {
  .wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-status, .wt-tool .wt-pt--fixed.wt-pt--touched .wt-pt-status { min-height: 3lh; }
}
/* Final r2 Minors 2-3 (replaces the D-F04-4 shrink hold): on the national page the swapped part is never shorter than
   the screen. While the store select is on screen, the page below the tool is then always below the fold, so a taller
   or shorter store moves nothing in view (1440x2000 shifted 0.10-0.23 before). lvh: the largest viewport, so a phone
   with its toolbar hidden shows no sliver either. Server CSS: in place from first paint. Less what always sits above it
   while the select is in view (measured: fixed header 106/136 px + select top to [data-swap] 346 px under 768, 139 px
   from 768), with 20-25 px to spare, so tall screens get no more blank space than they need. */
.wt-tool .wt-pt:not(.wt-pt--fixed) [data-swap] { min-height: calc(100vh - 410px); min-height: calc(100lvh - 410px); }
@media (min-width: 768px) { .wt-tool .wt-pt:not(.wt-pt--fixed) [data-swap] { min-height: calc(100vh - 220px); min-height: calc(100lvh - 220px); } }
@media (min-width: 992px) { .wt-tool .wt-pt:not(.wt-pt--fixed) [data-swap] { min-height: calc(100vh - 250px); min-height: calc(100lvh - 250px); } }
.wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-h { min-height: 1lh; }
@media (max-width: 699.98px) { .wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-h { min-height: 2lh; } }
@media (max-width: 339.98px) { .wt-tool .wt-pt:not(.wt-pt--fixed) .wt-pt-h { min-height: 3lh; } }
.wt-tool .wt-pt .wt-pt-intro { max-width: 75ch; margin: 0 0 14px; font-size: 16.5px; }
/* "Start again" with nothing to reset: hidden, its space kept (showing it later moves nothing). */
.wt-tool .wt-pt .wt-pt-clear--off { visibility: hidden; }
.wt-tool .wt-pt .wt-pt-filters .wt-select:disabled { opacity: .6; cursor: not-allowed; }
.wt-tool .wt-pt .wt-pt-privacy { margin: 10px 0 0; }
.wt-tool .wt-pt .wt-pt-which { max-width: 75ch; margin: -6px 0 14px; color: var(--wg-mute); }
.wt-tool .wt-pt .wt-pt-guides { margin: 6px 0 0; font-weight: 600; }
.wt-tool .wt-pt .wt-pt-choose { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--wg-blue); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wt-tool .wt-pt .wt-pt-body--loading { opacity: .5; }
@media (prefers-reduced-motion: no-preference) { .wt-tool .wt-pt [data-swap] { transition: opacity .15s; } }
.wt-tool .wt-pt .wt-pt-remember .wg-arrowlink { display: inline-flex; align-items: center; min-height: 44px; }

/* Store links are navigation, not an "included" checklist: no tick bullets. */
.wt-tool .wt-pt .wt-pt-stores li { margin: 0; padding: 0; list-style: none; background: none; }
.wt-tool .wt-pt .wt-pt-stores li::before { content: none; display: none; }
.wt-tool .wt-pt .wt-pt-stores .wg-arrowlink { display: inline-flex; align-items: center; min-height: 44px; }

/* 44 px targets: size links and the CSV link (r1 Minor 10). */
.wt-tool .wt-pt .wt-pt-table tbody th { padding-top: 0; padding-bottom: 0; font-weight: 500; white-space: nowrap; }
.wt-tool .wt-pt .wt-pt-table tbody th a { display: inline-flex; align-items: center; min-height: 44px; }
/* Final r2 Minor 5: Chipping Norton quote row: "All sizes" is plain text (no 44 px link), so it keeps the normal cell padding
   and lines up with "Chipping Norton" and "Price at quote". */
.wt-tool .wt-pt .wt-pt-table--quote tbody th { padding-top: 10px; padding-bottom: 10px; }
.wt-tool .wt-pt .wt-pt-csv { margin: 12px 0 0; font-size: 15px; }
.wt-tool .wt-pt .wt-pt-csv a { display: inline-flex; align-items: center; min-height: 44px; }

/* Visible FAQ block (brief §8; no FAQPage markup). */
.wt-tool .wt-pt .wt-pt-faq { margin-top: 18px; }
.wt-tool .wt-pt .wt-pt-a { max-width: 75ch; margin: 0; font-size: 15.5px; }
.wt-tool .wt-pt .wt-pt-a a { padding: 10px 0; } /* inline link in a sentence: padding widens the hit area, line height unchanged */

/* Phones: a visible "Sort by" select drives the same sort as the column buttons (r2 Major 5). A plain block, shown
   from first paint with JS (class wt-js: hidden with no JS and in the static fallback), hidden from 600 px where the
   column buttons are visible. Never given a display value here, so the wt-js rules keep control of it. */
.wt-tool .wt-pt .wt-pt-sortsel { max-width: 340px; margin: 0 0 12px; }
.wt-tool .wt-pt .wt-pt-sortsel .wt-label { display: block; margin: 0 0 6px; }
.wt-tool .wt-pt .wt-pt-sortsel .wt-select { width: 100%; }
@media (min-width: 600px) {
  .wt-tool .wt-pt .wt-pt-sortsel { display: none; }
}

/* 600 to 768 px: the sideways-scroll region (spec), tighter so the £/sq ft column fits more often (r1 Minor 13). */
@media (min-width: 600px) and (max-width: 768.98px) {
  .wt-tool .wt-pt .wt-pt-table th, .wt-tool .wt-pt .wt-pt-table td { padding-left: 9px; padding-right: 9px; }
  .wt-tool .wt-pt .wt-pt-table { font-size: 14.5px; }
}

/* Tablet/desktop: sticky column headers under the fixed site header (r1 Minor 12). Sticky cannot work inside an
   overflow container, so the wrap stops scrolling from 769 px (the table fits there). A focused size link scrolls
   clear of the header AND the sticky column headers (r2 Minor 7). */
@media (min-width: 769px) {
  .wt-tool .wt-pt .wt-pt-wrap { overflow: visible; }
  .wt-tool .wt-pt .wt-pt-table thead th { position: sticky; top: 106px; z-index: 2; }
  .wt-tool .wt-pt .wt-pt-table tbody th a { scroll-margin-top: 64px; } /* the loader's scroll-padding clears the header and a stuck thead */
}
@media (min-width: 992px) {
  .wt-tool .wt-pt .wt-pt-table thead th { top: 136px; }
}

/* Town price posts, 992 to 1199 px (TL-04 r3 Major 1): the sidebar takes a third of the row and the post column is
   609 to 747 px, narrower than the table's min-content (nowrap "Locker (10 sq ft)", one-line header labels, 14 px
   cells), so Bath, Leatherhead and Cheltenham spilled over the sidebar. Tighter cells, header labels and the size
   cell may wrap. Number-column labels stay right-aligned when they wrap. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .wt-tool .wt-pt--fixed .wt-pt-table { font-size: 14.5px; }
  .wt-tool .wt-pt--fixed .wt-pt-table th, .wt-tool .wt-pt--fixed .wt-pt-table td { padding-left: 8px; padding-right: 8px; }
  .wt-tool .wt-pt--fixed .wt-pt-table thead .wt-sort { white-space: normal; text-align: left; }
  .wt-tool .wt-pt--fixed .wt-pt-table thead th.wt-num .wt-sort { justify-content: flex-end; text-align: right; }
  .wt-tool .wt-pt--fixed .wt-pt-table tbody th { white-space: normal; }
}

/* Safety net (r3 Major 1): if a table still cannot fit its frame at some width, the script adds .wt-pt-wrap--scroll
   while (and only while) scrollWidth > clientWidth: the frame scrolls sideways and the header stops sticking there
   (sticky cannot work inside a scroll container), rather than the table overlapping the sidebar. */
.wt-tool .wt-pt .wt-pt-wrap.wt-pt-wrap--scroll { overflow-x: auto; }
.wt-tool .wt-pt .wt-pt-wrap--scroll .wt-pt-table thead th { position: static; }

/* Phones: cards. Re-stated at this file's specificity so the post rules above (and the theme) never win.
   Labels only where a cell has one (no orphaned ": " on the Chipping Norton card, r1 Minor 8). The column headers are
   visually hidden here, so their sort buttons leave the tab order (r2 Major 5: five invisible tab stops); the header
   cells keep their plain names for assistive tech, and the "Sort by" select above takes over. */
@media (max-width: 599.98px) {
  .wt-tool .wt-pt table.wt-pt-table, .wt-tool .wt-pt .wt-pt-table tbody, .wt-tool .wt-pt .wt-pt-table tr, .wt-tool .wt-pt .wt-pt-table th, .wt-tool .wt-pt .wt-pt-table td { display: block; }
  .wt-tool .wt-pt .wt-pt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wt-tool .wt-pt .wt-pt-table tr[hidden] { display: none; }
  .wt-tool .wt-pt .wt-pt-table th, .wt-tool .wt-pt .wt-pt-table td { padding: 3px 0; border: 0; text-align: left; }
  .wt-tool .wt-pt .wt-pt-table tbody th { padding: 0; }
  .wt-tool .wt-pt .wt-pt-table--quote tbody th { padding: 3px 0; }
  .wt-tool .wt-pt .wt-pt-table .wt-num { text-align: left; }
  .wt-tool .wt-pt .wt-pt-table caption { display: block; width: 100%; padding: 0 0 10px; }
  .wt-tool .wt-pt .wt-pt-table td:not([data-label])::before { content: none; }
  .wt-tool .wt-pt .wt-pt-table thead .wt-sort { display: none; }
  .wt-tool .wt-pt .wt-pt-table thead .wt-nojs { display: inline; }
  .wt-tool .wt-pt .wt-pt-wrap--quote { border: 0; overflow: visible; }
  .wt-tool .wt-pt .wt-pt-table--quote tr { margin: 0; }
  /* UX Major 3: one card per size, a row per floor. Each priced row is a small grid (size / floor + rate / prices);
     a row that continues the size above (wt-pt-cont, set by tool.php and re-set by the script after a filter or sort)
     joins the card above it, its size heading kept for assistive tech only. */
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size]:not([hidden]) { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "size size size" "floor floor floor" "pw p4 p4" "psf psf psf"; align-items: baseline; gap: 0 8px; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > th { grid-area: size; font-size: 17px; font-weight: 600; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td::before { content: none; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Floor"] { grid-area: floor; font-weight: 600; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td.wt-pt-rate { grid-area: psf; justify-self: start; min-width: 0; white-space: normal; color: var(--wg-mute); font-size: 13.5px; } /* may wrap at 320 px (research round: the m B2  rate is longer) */
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td.wt-pt-rate .wt-pt-m2::after { content: " per m B2  a week"; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per week"] { grid-area: pw; white-space: nowrap; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per week"]::after { content: " a week"; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per four weeks"] { grid-area: p4; min-width: 0; white-space: normal; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per four weeks"]::before { content: "· "; color: var(--wg-mute); }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per four weeks"]::after { content: " every four weeks"; }
  .wt-tool .wt-pt .wt-pt-table tbody tr.wt-pt-more { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .wt-tool .wt-pt .wt-pt-table tbody tr.wt-pt-cont { margin-top: -11px; padding-top: 8px; border-top-left-radius: 0; border-top-right-radius: 0; }
  .wt-tool .wt-pt .wt-pt-table tbody tr.wt-pt-cont > th { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* 320 px (final review Minor 6): "£82 every four weeks" ran under the card edge. Below 360 px the four-weekly price
   takes its own line under the weekly one, without the separator dot. */
@media (max-width: 359.98px) {
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size]:not([hidden]) { grid-template-areas: "size size size" "floor floor psf" "pw pw pw" "p4 p4 p4"; }
  .wt-tool .wt-pt .wt-pt-table tbody tr[data-size] > td[data-label="Per four weeks"]::before { content: none; }
}

/* Research round (FC-4, DECISIONS #92; research, not legal advice): a price per unit of area leads with square metres; the sq ft
   rate beside it is the supplementary indication, never more prominent (smaller and muted, after the metric rate). */
.wt-tool .wt-pt .wt-pt-table .wt-pt-imp { font-size: 0.86em; color: var(--wg-mute); white-space: nowrap; }
