/* Powered sites, the free list (web/templates/powered_sites.html; C-002). An app screen in the site's own tokens:
   a noun title, one control row, the status chips as the strip, one table, the sources line. No colour beyond
   the site's ink, muted grey and link: the list is words and figures, and the chip that is on carries the ink. */

.pw-head { margin-bottom: var(--space-4); }
.pw-head h1 { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.pw-head__tag { font-size: var(--text-1); letter-spacing: 0; }
.pw-head__lede { margin: var(--space-2) 0 0; color: var(--text-muted); font-size: var(--text-2); }
.pw-print-only { display: none; }

/* One control row: state, MW, Show, Reset. On a phone it folds behind "Filters" (site.js), as every list's does. */
.pw-filters { align-items: end; margin-bottom: var(--space-3); }
/* Copy link: at the strip's far end, beside the view it copies. */
.pw-copy {
  margin-left: auto; min-height: 2.25rem; padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: transparent; color: var(--text);
  font: inherit; font-size: var(--text-1); cursor: pointer;
}
.pw-copy:hover, .pw-copy:focus-visible { border-color: var(--text); }
.pw-copy[data-copied] { border-color: var(--text); }

/* The strip: the total, then a chip per status (its count under the other filters; a link that switches it). */
.pw-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.pw-strip__total { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.pw-strip__mw { margin-left: var(--space-2); color: var(--text-muted); font-size: var(--text-2); font-weight: 400; }
.pw-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.pw-chip {
  display: inline-flex; align-items: baseline; gap: var(--space-2); min-height: 2.25rem; box-sizing: border-box;
  padding: var(--space-1) var(--space-3); align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-3); color: var(--text-muted); text-decoration: none;
  font-size: var(--text-1);
}
.pw-chip:hover, .pw-chip:focus-visible { border-color: var(--link); color: var(--link); }
.pw-chip.is-on { border-color: var(--text); color: var(--text); font-weight: 600; }
.pw-chip__n { font-variant-numeric: tabular-nums; }
.pw-about { margin: 0; padding: 0 0 0 var(--space-4); }
.pw-about li { margin: 0 0 var(--space-1); }

/* The table: identity widest; two-line cells (value, then a grey subline). */
.pw-table th[scope="row"] { position: static; background: transparent; color: var(--text); font-size: var(--text-2); font-weight: 400; }
.pw-table td, .pw-table th { vertical-align: top; }
.pw-table thead th:first-child { width: 32%; }
.pw-cell { display: flex; flex-direction: column; gap: 2px; }
.pw-name { font-weight: 600; }
.pw-sub { color: var(--text-muted); font-size: var(--text-1); }
.pw-status { white-space: nowrap; }
.pw-state { text-decoration: none; }
.pw-none { color: var(--text-muted); }
.pw-empty { margin: var(--space-5) 0; color: var(--text-muted); }
.pw-credits { margin: var(--space-6) 0 var(--space-5); }

@media (max-width: 719px) {
  .pw-head h1 { font-size: 1.375rem; }
  .pw-filters { align-items: stretch; }
  .pw-strip__total { font-size: 1.25rem; }
  .pw-chips { order: 3; width: 100%; }
  .record-table.pw-table th[scope="row"] { display: block; width: 100%; padding: var(--space-1) var(--space-2) var(--space-2); border: none; }
  .pw-table td .pw-cell { align-items: flex-end; text-align: right; }
}

/* Print (C-002, "print-safe"): the table and the credits on one page width; no controls; the credits in full,
   with every address written out, and the view's own address at the top so the paper leads back to it. */
@media print {
  @page { margin: 12mm; }
  .site-header, .site-footer, .skip-link, .beta-bar, .filter-toggle, .pw-filters, .pw-chips, .pw-copy, .map-info, .pw-credits, [popover] { display: none !important; }
  .pw-print-only { display: block; }
  .pw-page { font-size: 9pt; color: #000; }
  /* The title band's navy field and its layers stay on screen: paper gets black on white. */
  /* Three classes: the band's `:is(...)` rule counts as two (its `:has()` argument). */
  .pw-page .pw-head.ref-head { --text: #000; --text-muted: #333; margin: 0 0 4mm; padding: 0; color: #000; background: none !important; box-shadow: none !important; } /* taste-skill-ignore: removes the band bleed on paper */
  .pw-page .pw-head.ref-head::before, .pw-page .pw-head.ref-head::after, .pw-head .band-field { display: none !important; }
  .pw-page .pw-head.ref-head h1, .pw-page .pw-head.ref-head p { color: #000; }
  .pw-page .pw-head.ref-head .rc-tag { border-color: #999; color: #000; }
  .pw-head h1 { font-size: 15pt; }
  .pw-head__view { margin: 1mm 0 0; font-size: 8pt; overflow-wrap: anywhere; }
  .pw-strip { margin: 0 0 3mm; }
  .pw-strip__total { font-size: 11pt; }
  .table-scroll { overflow: visible; }
  .pw-table { width: 100%; table-layout: fixed; font-size: 8.5pt; }
  .pw-table thead { display: table-header-group; }
  .pw-table th, .pw-table td { position: static; padding: 1.2mm 1.5mm; border-bottom: 0.5pt solid #999; color: #000; }
  .pw-table thead th:first-child { width: 30%; }
  .pw-table thead th:nth-child(2) { width: 7%; }
  .pw-table thead th:nth-child(3) { width: 8%; }
  .pw-table tr { break-inside: avoid; }
  .pw-table a { color: #000; text-decoration: none; }
  .pw-sub, .pw-none { color: #333; }
  .pw-print-credits { margin-top: 5mm; font-size: 7.5pt; break-inside: avoid; }
  .pw-print-credits h2 { margin: 0 0 1mm; font-size: 9pt; }
  .pw-print-credits ul { margin: 0 0 2mm; padding-left: 4mm; }
  .pw-print-credits li { margin: 0 0 1mm; overflow-wrap: anywhere; }
}
