/* The ZIP code stats page (/tools/zip-code-stats/). Loaded only there, after site.css. Phone first: one column,
   numbers right-aligned, nothing scrolls sideways at 360 px. From 960 px the results sit side by side and Each area
   becomes a full table. The last block is the printout. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.stats-print { display: none; }
/* The print frame (a table, so its footer row repeats on every printed page) is plain blocks on screen. */
.print-frame, .print-frame > tbody, .print-frame > tbody > tr, .print-frame > tbody > tr > td { display: block; padding: 0; }
.print-frame > tfoot { display: none; }
.stats-intro { max-width: 68ch; }

/* The form */
.stats-form { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 18px 6px; margin-top: 22px;
  max-width: 44rem; }
.stats-choice { border: 0; padding: 0; margin: 0 0 16px; }
.stats-choice legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.stats-options { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-options label { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--input);
  border-radius: var(--radius); padding: 8px 12px; min-height: 44px; cursor: pointer; }
.stats-options label:has(input:checked) { border-color: var(--ink); background: var(--tint); font-weight: 700; }
.stats-field { margin-bottom: 16px; position: relative; }
.stats-field > label { display: block; font-weight: 700; margin-bottom: 6px; }
.stats-field input[type="text"], .stats-field select, .stats-email-row input, .each-pick select {
  font: inherit; color: var(--ink); background: var(--sheet); width: 100%; min-height: 48px;
  border: 1.5px solid var(--input); border-radius: var(--radius); padding: 10px 13px; }
.stats-field input:focus, .stats-field select:focus, .stats-email-row input:focus, .each-pick select:focus {
  outline: 3px solid var(--marker); outline-offset: 0; border-color: var(--ink); }
.stats-hint { display: block; font-size: 0.85rem; color: var(--muted); line-height: 1.35; margin-top: 4px; }
.stats-form .button { min-height: 48px; }
/* With JavaScript only the chosen kind's field shows; without it, all three do and the radio decides. */
.stats-js .stats-form[data-kind="zip"] .stats-field:not([data-for="zip"]),
.stats-js .stats-form[data-kind="county"] .stats-field:not([data-for="county"]),
.stats-js .stats-form[data-kind="state"] .stats-field:not([data-for="state"]) { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--tint); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 4px 2px 12px; font-variant-numeric: tabular-nums; }
.chip button { font: inherit; border: 0; background: none; cursor: pointer; min-width: 32px; min-height: 32px;
  border-radius: 999px; color: var(--ink); }
.chip button:focus { outline: 3px solid var(--marker); }
.suggest { list-style: none; margin: 4px 0 0; padding: 0; border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--sheet); position: absolute; left: 0; right: 0; z-index: 5; max-height: 18rem; overflow-y: auto; }
.suggest li { padding: 10px 13px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--tint); }

/* Results */
.stats-results { padding-top: 32px; }
.stats-head h2 { margin: 0; }
.stats-areas { margin: 2px 0 12px; font-weight: 600; }
.stats-notes { margin: 0 0 14px; padding: 10px 14px 10px 30px; border-left: 4px solid var(--ink); background: var(--tint); }
.stats-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 22px 0 10px; }
.stats-actions .button { min-height: 48px; }
#stats-email-form { flex: 1; min-width: 15rem; margin: 0; }
#stats-email-form label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.stats-email-row { display: flex; gap: 8px; }
.stats-email-row input { flex: 1; min-width: 0; }
.stats-status { margin: 0 0 10px; padding: 10px 14px; border-left: 4px solid var(--ink); background: var(--tint); font-weight: 700; }
.stats-status-error { border-color: var(--error); background: #FBEFEF; color: var(--error); }
.stats-key { font-size: 0.9rem; color: var(--muted); margin: 8px 0 18px; }

/* The results tabs (Rene, 2026-12-04): Homes, Households and Pay, side by side even on a 360 px phone. Without
   JavaScript, and on paper, every tab's contents show one after the other. */
.stats-tabs { display: flex; gap: 6px; margin: 0 0 16px; border-bottom: 1.5px solid var(--line); }
.stats-tabs button { flex: 1 1 0; min-height: 48px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
  border: 1.5px solid var(--input); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--sheet);
  padding: 8px 6px; margin-bottom: -1.5px; }
.stats-tabs button[aria-selected="true"] { background: var(--tint); border-color: var(--ink); font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--ink); }
.stats-tabs button:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.stats-panel > .stats-pay { margin-top: 0; }
.stats-card, .stats-pay, .stats-each, .stats-labor { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; }
.stats-pay, .stats-each, .stats-labor { margin-top: 22px; }
.stats-card h3, .stats-pay h3, .stats-each h3, .stats-labor h3 { margin: 0 0 6px; }
/* Cost on top of pay (claude/Requirements_LaborCost_StatsPage_20261204.md) */
.labor-total { font-size: 1.15rem; margin: 8px 0 6px; }
.labor-hour { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.labor-size { font-size: 0.95rem; }
.labor-band, .labor-note { margin: 6px 0 0; }
.stats-rows { margin: 0; }
.stats-row { display: grid; grid-template-columns: 1fr auto; gap: 0 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stats-row dt { font-weight: 400; }
.stats-row dd { margin: 0; }
.stats-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-row .stats-sub { grid-column: 1 / -1; }
.stats-sub { font-size: 0.85rem; color: var(--muted); margin: 2px 0 0; }
.stats-row-missing .stats-value { font-weight: 400; color: var(--muted); white-space: normal; }
.stats-how { margin: 12px 0 4px; }
.stats-how summary { cursor: pointer; font-weight: 700; }
.stats-how p, .stats-how ul { font-size: 0.95rem; }
.stats-source { font-size: 0.85rem; color: var(--muted); margin: 6px 0 8px; }

/* Confidence marks (S16, as changed 2026-12-04): a small footnote number after each figure, 1 High, 2 Medium,
   3 Low, explained once under the results. Tapping it (hovering in the desktop table) shows the details. */
sup.fn { font-size: 0.68em; color: var(--muted); font-weight: 600; vertical-align: super; line-height: 0;
  margin-left: 2px; }
.conf { display: inline-block; position: relative; vertical-align: baseline; font-weight: 400; }
.conf summary { list-style: none; cursor: pointer; padding: 0 2px 0 0; border-radius: 4px; display: inline-block;
  min-width: 1.5em; text-align: left; }
.conf summary::-webkit-details-marker { display: none; }
.conf summary:focus { outline: 3px solid var(--marker); }
.conf-panel { position: absolute; right: 0; top: 1.6em; z-index: 6; width: min(18rem, 80vw); background: var(--sheet);
  border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 10px 12px; font-size: 0.85rem; line-height: 1.4;
  text-align: left; white-space: normal; font-weight: 400; display: block; }
.conf-detail { display: block; margin-top: 6px; color: var(--muted); }
.fn-legend { margin: 22px 0 0; border-top: 1.5px solid var(--line); padding-top: 12px; font-size: 0.9rem; }
.fn-legend p { margin: 0 0 6px; }
.each-table sup.fn { cursor: help; }

/* Pay */
.pay-cards { display: grid; gap: 14px; margin-top: 12px; }
.pay-card { border-top: 2px solid var(--ink); padding-top: 8px; }
.pay-card h4 { margin: 0; font-size: 1.05rem; }
.pay-title { font-size: 0.8rem; color: var(--muted); margin: 0 0 4px; }

/* Each area: one figure per area on a phone, the full tables on a desktop */
.each-pick { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.each-pick label { font-weight: 700; }
.each-phone, .each-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.each-phone th, .each-phone td, .each-table th, .each-table td { padding: 8px 6px; border-bottom: 1px solid var(--line);
  text-align: right; white-space: nowrap; }
.each-phone th, .each-table th[scope="row"], .each-table thead th:first-child { text-align: left; }
.each-total th, .each-total td { font-weight: 700; }
.each-desktop { display: none; }
.each-wrap { overflow-x: auto; margin-top: 10px; }
.each-table caption { text-align: left; font-weight: 700; padding-bottom: 4px; }
.each-table thead th { position: sticky; top: 0; background: var(--sheet); }
.each-sort { font: inherit; font-weight: 700; border: 0; background: none; cursor: pointer; padding: 0; color: var(--ink); }
th[aria-sort="ascending"] .each-sort::after { content: ' ▲'; }
th[aria-sort="descending"] .each-sort::after { content: ' ▼'; }

@media (min-width: 640px) {
  .pay-cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  /* One row across the top: kind and trade on the left, the areas in the middle, the button on the right. */
  .stats-js .stats-form { max-width: none; display: grid; grid-template-columns: auto 1fr auto; gap: 0 22px;
    align-items: start; }
  .stats-js .stats-form > .stats-choice:first-of-type { grid-column: 1; grid-row: 1; }
  .stats-js .stats-form .stats-field { grid-column: 2; grid-row: 1 / span 2; }
  .stats-js .stats-form > .stats-choice:last-of-type { grid-column: 1; grid-row: 2; }
  .stats-js .stats-form > .button { grid-column: 3; grid-row: 1; align-self: end; margin-bottom: 16px; }
  .stats-js .stats-form > .form-note { grid-column: 1 / -1; }
  /* Every box ends where the tabs end; a box's rows split into two columns so each number stays near its label
     (Rene, 2026-12-04). */
  .stats-panel > .stats-card .stats-rows, .stats-labor .stats-rows { columns: 2; column-gap: 32px; }
  .stats-panel > .stats-card .stats-row, .stats-labor .stats-row { break-inside: avoid; }
  .pay-cards { grid-template-columns: repeat(4, 1fr); }
  .each-pick, .each-phone { display: none; }
  .each-desktop { display: block; }
}

@media (prefers-contrast: more) {
  .stats-card, .stats-pay, .stats-each, .stats-labor, .stats-form, .stats-row { border-width: 2px; }
}

/* The printout: a WellPriced header, every section with its method opened, the full Each area tables, and on every
   page a footer with getwellpriced.com, the link back to this lookup and the sources. */
@media print {
  @page { size: portrait; margin: 0.6in 0.6in 0.9in; }     /* US Letter or A4, whichever the printer has */
  html { font-size: 11pt; }
  .skip, .site-header, .site-footer, .flash, .stats-screen, .js-only, noscript, .each-pick, .each-phone, .conf-panel { display: none !important; }
  .stats-panel[hidden] { display: block !important; }
  .stats-print { display: block; }
  .stats-print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt;
    border-bottom: 1.5pt solid #000; padding-bottom: 6pt; margin-bottom: 12pt; }
  .stats-print-head .wordmark { font-size: 18pt; }
  .stats-print-foot { position: fixed; bottom: 0; left: 0; right: 0; font-size: 8.5pt; border-top: 1pt solid #000;
    padding-top: 4pt; background: #fff; }
  /* The frame's footer row repeats on every page and keeps the fixed footer clear of the last line. */
  .print-frame { display: table; width: 100%; border-collapse: collapse; }
  .print-frame > tbody { display: table-row-group; }
  .print-frame > tbody > tr { display: table-row; }
  .print-frame > tbody > tr > td { display: table-cell; padding: 0; }
  .print-frame > tfoot { display: table-footer-group; }
  .print-space { height: 0.4in; }
  .section, .page-top, .stats-results { border: 0; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .stats-card, .stats-pay, .stats-each, .stats-labor { border: 0; padding: 0; margin: 0 0 14pt; break-inside: auto; max-width: none; }
  .stats-labor { break-inside: avoid; }     /* under a page long: keeps its heading with its lines */
  .stats-row { break-inside: avoid; border-bottom: 0.75pt solid #777; padding: 4pt 0; }
  .pay-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; }
  .pay-card { break-inside: avoid; }
  .each-desktop { display: block; }
  .each-wrap { overflow: visible; }
  .each-table { font-size: 8.5pt; }
  .each-table th, .each-table td { padding: 3pt 4pt; border-bottom: 0.5pt solid #777; }
  .each-table thead th { position: static; }
  .each-table tr { break-inside: avoid; }
  .stats-how { break-inside: auto; }
  .conf summary { padding: 0; }
  .wordmark, sup.fn { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #000; }
}
