/* The funnel page. Leads are water, forms are pipes, systems are the floors they pass
   through. Blue is a lead, gray is a lead leaving by design, red is a leak and nothing else.
   Same type family as the sieve page (Archivo, Archivo Narrow for stamped numbers). */
:root {
  color-scheme: light;
  --ground: #eef0ec; --panel: #f8f9f6; --floor: #e3e7e2; --ink: #17222b; --muted: #4d5a64; --line: #cdd3d0;
  --steel: #9ea8ae; --water: #2a6fd1; --leak: #c4342b; --drain: #565f67; --focus: #2a5bd7; --banner: #e2e6e0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0e1316; --panel: #161e23; --floor: #131a1f; --ink: #e3e9ec; --muted: #a0adb7; --line: #2a353c;
    --steel: #4b5861; --water: #4a8ff0; --leak: #ee5146; --drain: #9aa5ae; --focus: #7aa2ff; --banner: #161e23;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0e1316; --panel: #161e23; --floor: #131a1f; --ink: #e3e9ec; --muted: #a0adb7; --line: #2a353c;
  --steel: #4b5861; --water: #4a8ff0; --leak: #ee5146; --drain: #9aa5ae; --focus: #7aa2ff; --banner: #161e23;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.6 Archivo, system-ui, sans-serif; font-stretch: 104%; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.banner { background: var(--banner); color: var(--muted); font-size: 14px; padding: 9px 16px; text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 72px; }
nav.top { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 18px 0 0; font-size: 15px; }
nav.top a { color: var(--muted); text-decoration: none; }
nav.top a[aria-current] { color: var(--ink); font-weight: 600; }
header.intro { max-width: 700px; margin: 34px 0 22px; }
h1 { font: 800 clamp(40px, 7vw, 72px)/0.95 "Archivo Narrow", Archivo, sans-serif; letter-spacing: -0.01em; margin: 0 0 16px; }
.lede { font-size: 19px; color: var(--muted); margin: 0; }
h2 { font: 700 30px/1.1 "Archivo Narrow", Archivo, sans-serif; margin: 56px 0 12px; }
h3 { font-size: 18px; margin: 0 0 4px; }
p { margin: 0 0 14px; max-width: 68ch; }
.num-big { font: 700 24px "Archivo Narrow", Archivo, sans-serif; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border: 2px solid var(--ink); background: var(--ink); color: var(--ground); font: 600 15px Archivo, sans-serif; cursor: pointer; border-radius: 3px; position: relative; }
.btn.quiet { background: transparent; color: var(--ink); }
.btn input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.btn:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.toolbar .spacer { flex: 1; }
.toolbar a { font-size: 15px; }
.privacy { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
#status { font-size: 15px; margin: 6px 0 0; min-height: 1.6em; }
.shape { font-size: 14px; color: var(--muted); }

.scrub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 22px 0 6px; }
.scrub label { font-size: 14px; color: var(--muted); }
.scrub input[type=range] { flex: 1 1 220px; accent-color: var(--ink); min-width: 0; }
#week-label { font: 700 20px "Archivo Narrow", Archivo, sans-serif; min-width: 12ch; }
.play { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: 15px; cursor: pointer; }

figure.plumb.chart { position: relative; margin: 6px 0 0; max-width: none; }
figure.plumb figcaption { font-size: 15px; color: var(--muted); margin: 0 0 8px; max-width: 76ch; }
svg#pipes { display: block; width: 100%; height: auto; overflow: visible; }
#pipes .floor { fill: var(--floor); }
#pipes .floor-label { fill: var(--ink); font-size: 13px; font-weight: 600; }
#pipes .floor-sub { fill: var(--muted); font-size: 12px; }
#pipes .col-label { fill: var(--ink); font-size: 13px; font-weight: 700; }
#pipes .col-label.sel { text-decoration: underline; text-underline-offset: 3px; }
#pipes .sel-box { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 4; }
svg#pipes { cursor: pointer; }
#pipes .halo { paint-order: stroke; stroke: var(--floor); stroke-width: 4px; stroke-linejoin: round; }
#pipes .wall { fill: var(--steel); }
#pipes .water { fill: var(--water); }
#pipes .flange { fill: var(--steel); }
#pipes .count { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
#pipes .drain { fill: var(--drain); }
#pipes .leak { fill: var(--leak); }
#pipes .lost { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
#pipes .drip { fill: var(--leak); animation: drip 1.3s linear infinite; }
#pipes .drip.d2 { animation-delay: .43s; } #pipes .drip.d3 { animation-delay: .86s; }
@keyframes drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(22px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #pipes .drip { animation: none; } }
#tip { position: absolute; z-index: 2; max-width: 290px; background: var(--ink); color: var(--ground); font-size: 13.5px; line-height: 1.45; padding: 8px 10px; border-radius: 3px; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 22px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend .k-water { background: var(--water); } .legend .k-drain { background: var(--drain); } .legend .k-leak { background: var(--leak); }

.pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pick button { font: 14px Archivo, sans-serif; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 5px 12px; border-radius: 3px; cursor: pointer; }
.pick button[aria-pressed="true"] { border-color: var(--ink); font-weight: 700; }

#leaks { list-style: none; padding: 0; margin: 0; }
#leaks li { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; align-items: baseline; }
#leaks li p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 15px; }
#leaks .amt { font: 700 22px "Archivo Narrow", Archivo, sans-serif; white-space: nowrap; }
#leaks .amt::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--leak); margin-right: 8px; vertical-align: 2px; }
#leaks button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
th, td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; white-space: nowrap; }
td.gap { color: var(--leak); font-weight: 700; }
tr.first td:first-child::after { content: " first week"; color: var(--leak); font-weight: 700; font-size: 12px; }
thead tr.usual th { font-weight: 400; font-size: 12.5px; padding-top: 0; }

.finding { padding: 16px 0; border-top: 1px solid var(--line); }
.finding .meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; color: var(--muted); margin: 2px 0 8px; }
.finding .meta b { color: var(--ink); }
.finding p { font-size: 15.5px; margin: 0 0 6px; }
.finding .tag { font-weight: 700; margin-right: 6px; }

figure.chart { margin: 18px 0 8px; max-width: 640px; }
figure.chart figcaption { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
figure.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .note { fill: var(--muted); font-size: 12px; }
.chart .brk { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ln { fill: none; stroke-width: 2; }
.chart .ln.s1 { stroke: var(--ink); } .chart .ln.s2 { stroke: var(--water); }
.chart .dot.s1 { fill: var(--ink); } .chart .dot.s2 { fill: var(--water); }
.chart .legend { margin-top: 4px; }
.key { display: inline-block; width: 14px; height: 3px; margin: 0 6px 3px 0; vertical-align: middle; }
.key.s1 { background: var(--ink); } .key.s2 { background: var(--water); }

.claims { margin: 8px 0 0; }
.claim { padding: 14px 0; border-top: 1px solid var(--line); }
.claim h3 { font-size: 17px; }
.claim .vs { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; color: var(--muted); margin: 0 0 4px; }
.claim .vs b { color: var(--ink); font-size: 17px; }
.claim .verdict { color: var(--ink); font-weight: 700; }
.claim p:last-child { font-size: 15.5px; margin: 0; }
.scroll table.wide { min-width: 640px; }
.buckets td.bar { width: 45%; }
.buckets .b { display: block; height: 12px; border-radius: 2px; background: var(--drain); min-width: 2px; }
.buckets .b.red { background: var(--leak); }
.buckets tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
pre { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; border-radius: 3px; }
ul.plain { padding-left: 20px; } ul.plain li { margin: 0 0 6px; }
.hire { margin-top: 56px; padding: 22px 0 0; border-top: 2px solid var(--ink); }
.hire p { font-size: 18px; }
footer { margin-top: 48px; font-size: 14px; color: var(--muted); }
@media (max-width: 560px) {
  #leaks li { grid-template-columns: 1fr; }
  .chart .tick, .chart .note { font-size: 19px; }
}
