/* =====================================================================
   watercalculator.us — shared stylesheet
   Load on every page:  <link rel="stylesheet" href="/css/site.css?v=20261017">
   Bump ?v= whenever this file changes so browsers fetch the new copy.
   Section 1 = original page template (unchanged, so existing pages render
   exactly as before). Section 2 = additive components; nothing in it
   overrides Section 1 except where noted as a sitewide improvement.
   ===================================================================== */

/* ===================== SECTION 1: BASE TEMPLATE ===================== */
/* ===================== TOKENS ===================== */
  :root{
    --deep:      #0f2a3a;   /* deep-water ink (primary text) */
    --deep-2:    #14384c;
    --teal:      #0e7c86;   /* primary interactive accent */
    --teal-deep: #0a5d64;
    --teal-tint: #e3f1f2;   /* accent wash for surfaces */
    --paper:     #f5f8f9;   /* cool off-white page */
    --surface:   #ffffff;
    --line:      #d8e2e5;   /* hairline on cool paper */
    --line-soft: #e7eef0;
    --muted:     #4d6570;   /* secondary text */
    --honey:     #b9781f;   /* single warm data emphasis, used sparingly */
    --ok:        #0e7c86;
    --focus:     #1a9aa6;

    --maxw: 1120px;
    --measure: 68ch;
    --radius: 14px;
    --radius-sm: 9px;

    --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Spectral", Georgia, "Times New Roman", serif;

    --shadow: 0 1px 2px rgba(15,42,58,.05), 0 12px 34px -12px rgba(15,42,58,.18);
  }

  *,*::before,*::after{ box-sizing:border-box; }
  html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
  @media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }

  body{
    margin:0;
    background:var(--paper);
    color:var(--deep);
    font-family:var(--sans);
    font-size:17px;
    line-height:1.65;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
  }

  .wrap{ width:100%; max-width:var(--maxw); margin-inline:auto; padding-inline:22px; }

  a{ color:var(--teal-deep); text-underline-offset:2px; text-decoration-thickness:1px; }
  a:hover{ color:var(--teal); }

  h1,h2,h3{ font-family:var(--serif); color:var(--deep); font-weight:600; line-height:1.15; letter-spacing:-.01em; }
  h1{ font-size:clamp(2rem, 4.4vw, 3rem); margin:.2em 0 .35em; font-weight:600; }
  h2{ font-size:clamp(1.5rem, 3vw, 2rem); margin:0 0 .5em; }
  h3{ font-size:1.22rem; margin:0 0 .3em; }
  p{ margin:0 0 1.05em; }
  .prose{ max-width:var(--measure); }
  .prose p, .prose li{ color:#26424f; }

  .skip{ position:absolute; left:-999px; top:0; background:var(--deep); color:#fff; padding:.7em 1.1em; z-index:200; border-radius:0 0 8px 0; }
  .skip:focus{ left:0; color:#fff; }

  :focus-visible{ outline:3px solid var(--focus); outline-offset:2px; border-radius:4px; }

  /* ===================== HEADER ===================== */
  .site-head{ position:sticky; top:0; z-index:60; background:rgba(245,248,249,.86); backdrop-filter:saturate(1.4) blur(10px); border-bottom:1px solid var(--line); }
  .site-head .wrap{ display:flex; align-items:center; justify-content:space-between; min-height:64px; gap:16px; }
  .brand{ display:inline-flex; align-items:center; gap:10px; font-family:var(--serif); font-weight:600; font-size:1.2rem; color:var(--deep); text-decoration:none; }
  .brand svg{ display:block; }
  .brand b{ font-weight:600; }
  .brand span{ color:var(--teal); }
  .nav{ display:flex; align-items:center; gap:6px; }
  .nav a{ color:var(--deep); text-decoration:none; padding:.5em .7em; border-radius:8px; font-weight:500; font-size:.97rem; }
  .nav a:hover{ background:var(--teal-tint); color:var(--teal-deep); }
  .nav a.nav-section{ color:var(--teal-deep); box-shadow:inset 0 -2px 0 var(--teal); border-radius:0; }
  .nav-toggle{ display:none; border:1px solid var(--line); background:var(--surface); border-radius:9px; width:42px; height:42px; align-items:center; justify-content:center; cursor:pointer; }
  .nav-toggle svg{ display:block; }

  @media (max-width:760px){
    .nav-toggle{ display:inline-flex; }
    .nav{ position:absolute; top:64px; left:0; right:0; flex-direction:column; align-items:stretch; gap:2px; background:var(--surface); border-bottom:1px solid var(--line); padding:10px 14px 16px; box-shadow:var(--shadow); transform:translateY(-8px); opacity:0; pointer-events:none; transition:opacity .16s ease, transform .16s ease; }
    .nav.open{ opacity:1; transform:none; pointer-events:auto; }
    .nav a{ padding:.75em .6em; }
  }
  @media (prefers-reduced-motion: reduce){ .nav{ transition:none; } }

  /* ===================== BREADCRUMB ===================== */
  .crumbs{ padding-top:22px; font-size:.9rem; color:var(--muted); }
  .crumbs ol{ list-style:none; display:flex; flex-wrap:wrap; gap:.4em; margin:0; padding:0; }
  .crumbs a{ color:var(--muted); text-decoration:none; }
  .crumbs a:hover{ color:var(--teal-deep); text-decoration:underline; }
  .crumbs li+li::before{ content:"/"; margin-right:.4em; color:var(--line); }
  .crumbs [aria-current]{ color:var(--deep); }

  /* ===================== INTRO ===================== */
  .intro{ padding-top:14px; }
  .intro .lead{ font-size:1.16rem; color:#33505c; max-width:60ch; }
  .byline{ display:flex; align-items:center; gap:10px; margin-top:14px; font-size:.9rem; color:var(--muted); }
  .byline-av{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; object-fit:cover; border:1px solid #cfe6e8; background:var(--teal-tint); }
  .byline-text a{ color:var(--deep-2); font-weight:600; text-decoration:none; }
  .byline-text a:hover{ color:var(--teal-deep); text-decoration:underline; }
  .byline-sep{ margin:0 .3em; color:var(--line); }

  /* ===================== CALCULATOR INSTRUMENT ===================== */
  .tool{ margin:26px 0 8px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
  .tool-grid{ display:grid; grid-template-columns:1.05fr .95fr; }
  @media (max-width:820px){ .tool-grid{ grid-template-columns:1fr; } }

  .panel-inputs{ padding:26px 26px 24px; border-right:1px solid var(--line-soft); }
  @media (max-width:820px){ .panel-inputs{ border-right:0; border-bottom:1px solid var(--line-soft); } }
  .panel-title{ font-family:var(--serif); font-size:1.15rem; margin:0 0 2px; }
  .panel-note{ font-size:.88rem; color:var(--muted); margin:0 0 18px; }

  .field{ margin-bottom:16px; }
  .field > label{ display:block; font-weight:600; font-size:.92rem; margin-bottom:6px; color:var(--deep-2); }
  .combo{ display:flex; gap:8px; }
  .combo > input, .combo > .stepper{ flex:1 1 auto; min-width:0; }
  .combo select{ flex:0 0 auto; width:auto; }

  /* stepper (minus / input / plus) */
  .stepper{ display:flex; align-items:stretch; border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; background:var(--surface); }
  .stepper input[type="number"]{ border:0; border-radius:0; text-align:center; padding-left:.4em; padding-right:.4em; }
  .stepper input[type="number"]:focus{ box-shadow:none; }
  .stepper:focus-within{ border-color:var(--focus); box-shadow:0 0 0 3px rgba(26,154,166,.18); }
  .step-btn{ flex:0 0 auto; width:44px; border:0; background:var(--paper); color:var(--deep-2); font-size:1.35rem; line-height:1; cursor:pointer; font-family:var(--sans); user-select:none; }
  .step-btn:hover{ background:var(--teal-tint); color:var(--teal-deep); }
  .step-btn:active{ background:#cfe6e8; }
  .step-btn:first-child{ border-right:1px solid var(--line); }
  .step-btn:last-child{ border-left:1px solid var(--line); }

  input[type="number"], select{
    font-family:var(--sans); font-size:1rem; color:var(--deep);
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm);
    padding:.72em .8em; width:100%; line-height:1.2; -moz-appearance:textfield;
  }
  input[type="number"]{ font-variant-numeric:tabular-nums; }
  input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
  select{ cursor:pointer; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234d6570' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right .7em center; padding-right:2.2em; -webkit-appearance:none; appearance:none; }
  input:focus, select:focus{ border-color:var(--focus); box-shadow:0 0 0 3px rgba(26,154,166,.18); outline:none; }
  input:invalid{ border-color:#c25a4a; }

  /* temperature slider */
  .slider{ -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:999px; background:var(--line); margin:14px 0 10px; cursor:pointer; }
  .slider::-webkit-slider-runnable-track{ height:6px; border-radius:999px; background:transparent; }
  .slider::-moz-range-track{ height:6px; border-radius:999px; background:var(--line); }
  .slider::-moz-range-progress{ height:6px; border-radius:999px; background:var(--teal); }
  .slider::-webkit-slider-thumb{ -webkit-appearance:none; width:20px; height:20px; margin-top:-7px; border-radius:50%; background:var(--teal); border:3px solid #fff; box-shadow:0 1px 4px rgba(15,42,58,.35); cursor:pointer; }
  .slider::-moz-range-thumb{ width:20px; height:20px; border-radius:50%; background:var(--teal); border:3px solid #fff; box-shadow:0 1px 4px rgba(15,42,58,.35); cursor:pointer; }
  .slider:focus-visible{ outline:3px solid var(--focus); outline-offset:4px; }

  .temp-row{ display:grid; grid-template-columns:1fr auto; gap:8px; align-items:end; }
  .presets{ display:flex; flex-wrap:wrap; gap:6px; margin-top:2px; }
  .preset{ font:inherit; font-size:.82rem; padding:.34em .7em; border:1px solid var(--line); background:var(--paper); color:var(--deep-2); border-radius:999px; cursor:pointer; }
  .preset:hover{ border-color:var(--teal); color:var(--teal-deep); background:var(--teal-tint); }
  .preset[aria-pressed="true"]{ background:var(--teal); border-color:var(--teal); color:#fff; }

  .advanced{ margin-top:6px; border-top:1px dashed var(--line); padding-top:12px; }
  .advanced summary{ cursor:pointer; font-weight:600; font-size:.9rem; color:var(--teal-deep); list-style:none; display:inline-flex; align-items:center; gap:.4em; }
  .advanced summary::-webkit-details-marker{ display:none; }
  .advanced summary::before{ content:""; width:8px; height:8px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); transition:transform .15s ease; }
  .advanced[open] summary::before{ transform:rotate(45deg); }
  @media (prefers-reduced-motion: reduce){ .advanced summary::before{ transition:none; } }
  .advanced .field{ margin-top:14px; margin-bottom:4px; }

  /* ---- result panel ---- */
  .panel-result{ padding:26px; background:linear-gradient(180deg,#0f2a3a 0%,#14415a 100%); color:#eaf5f6; display:flex; flex-direction:column; gap:16px; position:relative; }
  .result-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
  .result-head h2{ color:#cfe6e9; font-size:1rem; font-family:var(--sans); font-weight:600; margin:0; letter-spacing:.01em; }
  .result-eq{ font-size:.82rem; color:#8fb6bd; }

  .hero{ display:flex; align-items:center; gap:20px; }
  .beaker{ flex:0 0 auto; }
  .readout{ display:flex; align-items:flex-end; gap:10px; flex:1 1 auto; min-width:0; }
  .readout .value{ font-family:var(--sans); font-weight:700; font-size:clamp(2.7rem,7.5vw,4.1rem); line-height:.95; font-variant-numeric:tabular-nums; letter-spacing:-.02em; color:#fff; }
  .readout .unit{ font-size:1.4rem; font-weight:600; color:#7fd3da; padding-bottom:.35em; }

  .unit-hint{ font-size:.78rem; color:#8fb6bd; margin:2px 0 0; }
  .unit-toggle{ display:flex; flex-wrap:wrap; gap:7px; }
  .unit-chip{ font:inherit; font-size:.9rem; display:flex; align-items:baseline; gap:6px; padding:.42em .7em; border-radius:999px; cursor:pointer; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.05); color:#dcecef; }
  .unit-chip:hover{ background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.3); }
  .unit-chip[aria-pressed="true"]{ background:#7fd3da; border-color:#7fd3da; color:#0b2e40; font-weight:700; }
  .unit-chip .cv{ font-variant-numeric:tabular-nums; font-weight:600; }
  .unit-chip .cu{ font-size:.8em; opacity:.85; }

  .actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
  .btn{ font:inherit; font-size:.9rem; font-weight:600; display:inline-flex; align-items:center; gap:.5em; padding:.6em .95em; border-radius:var(--radius-sm); cursor:pointer; border:1px solid transparent; background:rgba(255,255,255,.12); color:#fff; }
  .btn:hover{ background:rgba(255,255,255,.2); }
  .btn svg{ width:16px; height:16px; }
  .btn-reset{ background:transparent; border-color:rgba(255,255,255,.28); }
  .toast{ position:absolute; bottom:14px; left:50%; transform:translateX(-50%) translateY(8px); background:#fff; color:var(--deep); font-size:.85rem; font-weight:600; padding:.5em .9em; border-radius:8px; box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; }
  .toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
  @media (prefers-reduced-motion: reduce){ .toast{ transition:none; } }

  /* ===================== CONTENT ===================== */
  .content{ padding:36px 0 10px; }
  section.block{ margin-bottom:44px; scroll-margin-top:82px; }
  .content h2{ position:relative; padding-bottom:.25em; }
  .content h2::after{ content:""; display:block; width:52px; height:3px; background:var(--teal); border-radius:2px; margin-top:.4em; }

  .answer-box{ background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--teal); border-radius:12px; padding:18px 22px; margin-bottom:40px; }
  .answer-box p{ margin:0; color:#26424f; }
  .answer-box strong{ color:var(--deep); }
  .answer-box .disclaimer{ font-size:.86rem; color:var(--muted); margin-top:10px; }

  .callout{ background:var(--teal-tint); border:1px solid #cfe6e8; border-left:4px solid var(--teal); border-radius:10px; padding:16px 18px; max-width:var(--measure); }
  .callout p:last-child{ margin-bottom:0; }

  .formula{ font-family:var(--serif); font-size:1.18rem; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:18px 20px; max-width:var(--measure); overflow-x:auto; }
  .formula .term{ color:var(--teal-deep); font-style:italic; }
  .formula small{ display:block; font-family:var(--sans); font-size:.85rem; color:var(--muted); margin-top:.6em; }

  /* tables */
  .table-scroll{ overflow-x:auto; border:1px solid var(--line); border-radius:12px; }
  table{ border-collapse:collapse; width:100%; font-size:.96rem; background:var(--surface); }
  caption{ text-align:left; font-size:.86rem; color:var(--muted); padding:10px 14px; }
  th,td{ padding:.7em .9em; text-align:right; border-bottom:1px solid var(--line-soft); font-variant-numeric:tabular-nums; white-space:nowrap; }
  th:first-child, td:first-child{ text-align:left; font-variant-numeric:normal; }
  thead th{ background:var(--paper); color:var(--deep); font-weight:600; border-bottom:1px solid var(--line); position:sticky; }
  tbody tr:hover{ background:#f2f8f8; }
  tbody tr:last-child td{ border-bottom:0; }
  td .em{ color:var(--honey); font-weight:600; }

  /* related links */
  .related{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
  .related a{ display:block; text-decoration:none; color:var(--deep); background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:15px 16px; transition:border-color .15s ease, transform .15s ease; }
  .related a:hover{ border-color:var(--teal); transform:translateY(-2px); }
  .related a strong{ display:block; font-family:var(--serif); font-weight:600; font-size:1.04rem; margin-bottom:2px; }
  .related a span{ font-size:.88rem; color:var(--muted); }
  @media (prefers-reduced-motion: reduce){ .related a{ transition:none; } }

  /* examples */
  .examples{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; }
  .example{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:18px 20px; }
  .example h3{ font-size:1.05rem; }
  .example .big{ font-size:1.5rem; font-weight:700; color:var(--teal-deep); font-variant-numeric:tabular-nums; }
  .example p{ font-size:.94rem; color:var(--muted); margin:.2em 0 0; }

  /* FAQ */
  .faq details{ border-bottom:1px solid var(--line); }
  .faq details summary{ cursor:pointer; list-style:none; padding:16px 40px 16px 2px; font-family:var(--serif); font-size:1.1rem; font-weight:600; color:var(--deep); position:relative; }
  .faq summary::-webkit-details-marker{ display:none; }
  .faq summary::after{ content:"+"; position:absolute; right:6px; top:50%; transform:translateY(-50%); font-family:var(--sans); font-weight:400; font-size:1.5rem; color:var(--teal); transition:transform .15s ease; }
  .faq details[open] summary::after{ content:"\2013"; }
  .faq details .a{ padding:0 6px 18px 2px; max-width:var(--measure); color:#33505c; }
  .faq details .a p:last-child{ margin-bottom:0; }
  @media (prefers-reduced-motion: reduce){ .faq summary::after{ transition:none; } }

  /* sources */
  .sources{ font-size:.92rem; color:var(--muted); }
  .sources ol{ padding-left:1.2em; }
  .sources li{ margin-bottom:.5em; }

  /* ===================== AUTHOR / EEAT ===================== */
  .author-box{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:22px 24px; display:grid; grid-template-columns:auto 1fr; gap:18px; align-items:start; box-shadow:var(--shadow); }
  @media (max-width:560px){ .author-box{ grid-template-columns:1fr; } }
  .avatar{ width:66px; height:66px; border-radius:50%; object-fit:cover; background:var(--teal-tint); border:1px solid #cfe6e8; }
  .author-box .author-name{ color:var(--deep); text-decoration:none; }
  .author-box .author-name:hover{ color:var(--teal-deep); text-decoration:underline; }
  .author-box .role{ font-size:.9rem; color:var(--muted); margin:0 0 8px; }
  .author-box .bio{ font-size:.95rem; color:#33505c; margin:0 0 10px; max-width:60ch; }
  .author-box .creds-line{ margin:0 0 10px; font-size:.88rem; color:var(--muted); }
  .review-line{ font-size:.86rem; color:var(--muted); display:flex; flex-wrap:wrap; gap:6px 16px; padding-top:10px; border-top:1px solid var(--line-soft); }
  .review-line b{ color:var(--deep-2); font-weight:600; }
  .review-line a{ color:var(--teal-deep); }

  /* ===================== FOOTER ===================== */
  .site-foot{ background:var(--deep); color:#c3d6dc; margin-top:52px; }
  .site-foot .wrap{ padding-top:44px; padding-bottom:30px; }
  .foot-grid{ display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:28px; }
  @media (max-width:760px){ .foot-grid{ grid-template-columns:1fr 1fr; gap:22px; } }
  @media (max-width:420px){ .foot-grid{ grid-template-columns:1fr; } }
  .foot-brand{ font-family:var(--serif); font-size:1.3rem; color:#fff; display:flex; align-items:center; gap:9px; margin-bottom:10px; }
  .foot-about{ font-size:.92rem; color:#9db8c0; max-width:34ch; }
  .foot-col h3{ color:#fff; font-family:var(--sans); font-size:.82rem; letter-spacing:.06em; text-transform:none; font-weight:700; margin:0 0 12px; }
  .foot-col ul{ list-style:none; margin:0; padding:0; }
  .foot-col li{ margin-bottom:8px; }
  .foot-col a{ color:#bcd2d9; text-decoration:none; font-size:.93rem; }
  .foot-col a:hover{ color:#fff; text-decoration:underline; }
  .foot-bottom{ border-top:1px solid rgba(255,255,255,.12); margin-top:32px; padding-top:18px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; font-size:.86rem; color:#8faab2; }
  .foot-bottom nav{ display:flex; flex-wrap:wrap; gap:16px; }
  .foot-bottom a{ color:#8faab2; text-decoration:none; }
  .foot-bottom a:hover{ color:#fff; }

  /* ===================== PRINT ===================== */
  @media print{
    .site-head, .site-foot, .actions, .presets, .nav-toggle, .advanced summary, .related, .toast, .unit-hint{ display:none !important; }
    body{ background:#fff; color:#000; font-size:12pt; }
    .tool{ box-shadow:none; border:1px solid #999; break-inside:avoid; }
    .panel-result{ background:#fff !important; color:#000 !important; }
    .readout .value, .readout .unit, .result-head h2, .unit-chip .cv{ color:#000 !important; }
    .unit-hint, .result-eq, .unit-chip{ color:#333 !important; }
    .unit-chip{ border-color:#999 !important; background:#fff !important; }
    .unit-chip[aria-pressed="true"]{ background:#eee !important; }
    a{ color:#000; text-decoration:underline; }
    .content h2::after{ background:#000; }
  }

  /* ===================== TREATMENT-SPECIFIC (additive) ===================== */
  .field-group{ margin-bottom:18px; padding-bottom:18px; border-bottom:1px solid var(--line-soft); }
  .field-group:last-child{ border-bottom:0; padding-bottom:0; margin-bottom:0; }
  .field-group > .grp-title{ font-family:var(--sans); font-weight:700; font-size:.82rem; color:var(--teal-deep); margin:0 0 10px; }
  .row2{ display:grid; grid-template-columns:1fr 1fr; gap:12px 14px; }
  .mini label{ display:block; font-weight:600; font-size:.86rem; margin-bottom:5px; color:var(--deep-2); }
  .mini input, .mini select{ padding:.55em .7em; font-size:.95rem; }
  .mini .combo{ gap:6px; }
  .field-note{ font-size:.82rem; color:var(--muted); margin:6px 0 0; }
  .compare{ font-size:.9rem; color:#cfe6e9; margin-top:6px; padding-top:12px; border-top:1px solid rgba(255,255,255,.12); }
  .compare b{ color:#fff; }
  /* result tiles (multi-output rows) */
  .result-tiles{ display:flex; flex-direction:column; }
  .result-tile{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.12); }
  .result-tile:last-child{ border-bottom:0; }
  .result-tile .rt-label{ font-size:.9rem; color:#cfe6e9; }
  .result-tile .rt-val{ font-size:.98rem; font-weight:700; color:#fff; font-variant-numeric:tabular-nums; text-align:right; }
  .result-tile .rt-note{ display:block; font-size:.78rem; font-weight:500; color:#8fb6bd; margin-top:2px; }
  .result-tile .rt-note.warn{ color:#ffd7a6; }
  .result-tile .rt-note.ok{ color:#a6ffce; }

  /* ---- MOBILE CALCULATOR OVERFLOW FIX (base) ---- */
  .tool, .panel-inputs, .field, .combo, .temp-row, .stepper{ min-width:0; }
  .combo > .stepper, .combo > input[type="number"]{ min-width:0; }
  .stepper input[type="number"]{ min-width:0; width:100%; }

  @media (max-width: 560px){
    .combo{ flex-wrap:wrap; row-gap:8px; }
    .combo > .stepper,
    .combo > input[type="number"]{ flex:1 1 100%; min-width:0; }
    .combo > select{ flex:1 1 100%; width:100%; min-width:0; }
    .temp-row{ grid-template-columns:1fr; }
  }


  /* ---- RESULT-PANEL WIDTH FIX (base) ----
     Input + result panels share one grid column on phones; let the
     result panel and its rows shrink so a wide readout or long stat
     labels can't push the whole card off-screen. */
  .panel-result{ min-width:0; }
  .panel-result > *{ min-width:0; }
  .result-row{ min-width:0; }

/* ===================== SECTION 2: SHARED COMPONENTS (additive) ===================== */
:root{
  --warn:#a4462f;
  --c-a:#7fd3da;   /* result-panel data colour 1 */
  --c-b:#e9b765;   /* result-panel data colour 2 */
  --c-c:#f2907e;   /* result-panel data colour 3 / alert */
}
[hidden]{ display:none !important; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* sitewide improvements: phone gutters, list styling in prose, h3 spacing in articles */
@media (max-width:560px){ .wrap{ padding-inline:16px; } .panel-inputs, .panel-result{ padding:20px 16px; } }
@media (max-width:420px){ .row2{ grid-template-columns:1fr; } }
.prose ul{ padding-left:1.2em; margin:0 0 1.05em; }
.prose li{ margin-bottom:.35em; }
.content .prose h3, .content .block h3.sub{ margin:1.2em 0 .35em; }
.combo > select{ max-width:58%; }
@media (max-width:560px){ .combo > select{ max-width:none; } }
.readout{ flex-wrap:wrap; }
.readout .value{ overflow-wrap:anywhere; }
hr.rule{ border:0; border-top:1px solid var(--line); margin:44px 0; }
.author-box h3{ margin:0 0 2px; }
caption{ caption-side:top; }
td.wrap-cell{ white-space:normal; text-align:left; min-width:220px; }

/* ---- mode tabs on top of a .tool card ---- */
.tabs{ display:grid; grid-auto-flow:column; grid-auto-columns:1fr; border-bottom:1px solid var(--line); background:var(--paper); }
.tab{ font:inherit; font-size:.95rem; font-weight:600; color:var(--muted); background:transparent; border:0; border-bottom:3px solid transparent; padding:.9em .6em .75em; cursor:pointer; line-height:1.25; }
.tab small{ display:block; font-weight:400; font-size:.78rem; color:var(--muted); margin-top:2px; }
.tab:hover{ color:var(--teal-deep); background:var(--teal-tint); }
.tab[aria-selected="true"]{ color:var(--deep); background:var(--surface); border-bottom-color:var(--teal); }
@media (max-width:560px){ .tab{ font-size:.86rem; padding:.8em .3em .65em; } .tab small{ display:none; } }

/* ---- form helpers ---- */
.stack > * + *{ margin-top:12px; }
.mini label .u{ font-weight:400; color:var(--muted); }
input.bad{ border-color:#c25a4a; }
.check{ display:flex; gap:.55em; align-items:flex-start; font-size:.9rem; font-weight:600; color:var(--deep-2); cursor:pointer; }
.check input{ margin-top:.3em; accent-color:var(--teal); width:16px; height:16px; flex:0 0 auto; }
.check span small{ display:block; font-weight:400; color:var(--muted); font-size:.82rem; }
.advanced .adv-body{ margin-top:4px; }

/* ---- result panel extras ---- */
.result-eq.badge{ color:#0b2e40; background:var(--c-a); border-radius:999px; padding:.15em .65em; font-weight:700; }
.result-eq.badge.warnish{ background:var(--c-b); }
.result-eq.badge.alert{ background:var(--c-c); }
.result-head{ flex-wrap:wrap; }
.tips{ margin:0; padding:0; list-style:none; display:grid; gap:6px; font-size:.84rem; color:#b9d4da; }
.tips li{ padding-left:1.1em; position:relative; }
.tips li::before{ content:""; position:absolute; left:0; top:.55em; width:6px; height:6px; border-radius:50%; background:var(--c-a); }
.tips li.w::before{ background:var(--c-c); }
.tips b{ color:#fff; }

/* stacked share bar + legend rows (e.g. alkalinity speciation) */
.spec{ border-top:1px solid rgba(255,255,255,.12); padding-top:12px; }
.spec h3{ font-family:var(--sans); font-size:.86rem; color:#cfe6e9; margin:0 0 8px; font-weight:600; }
.spec-bar{ display:flex; height:12px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.1); }
.seg{ height:100%; transition:width .2s ease; }
@media (prefers-reduced-motion: reduce){ .seg{ transition:none; } }
.seg-a{ background:var(--c-a); } .seg-b{ background:var(--c-b); } .seg-c{ background:var(--c-c); }
.spec-list{ margin:10px 0 0; display:grid; gap:6px; }
.spec-row{ display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:baseline; font-size:.88rem; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; transform:translateY(1px); }
.spec-row .nm{ color:#dcecef; }
.spec-row .vl{ font-variant-numeric:tabular-nums; color:#fff; font-weight:600; text-align:right; }
.spec-row .vl small{ display:block; font-weight:400; color:#8fb6bd; font-size:.78rem; }

/* ---- article extras ---- */
.toc{ font-size:.92rem; margin:-18px 0 40px; max-width:var(--measure); }
.toc ol{ columns:2; column-gap:28px; padding-left:1.2em; margin:6px 0 0; }
@media (max-width:560px){ .toc ol{ columns:1; } }
.toc li{ margin-bottom:4px; break-inside:avoid; }
.toc strong{ font-size:.82rem; color:var(--teal-deep); }
.callout{ margin-bottom:1.05em; }
.callout.warn{ background:#fbf1ec; border-color:#f0d6ca; border-left-color:var(--warn); }
.formula-note{ font-size:.9rem; color:var(--muted); }
.table-scroll{ margin-bottom:1.05em; }

@media print{
  .tabs, .toc{ display:none !important; }
  .compare, .compare b, .spec-row .nm, .spec-row .vl, .spec h3, .tips, .tips b, .rt-label, .rt-val{ color:#000 !important; }
  .result-eq.badge{ background:#eee !important; color:#000 !important; }
}

/* ===================== SECTION 3: COMPONENTS FROM CATEGORY PAGES (additive) ===================== */
/* comparison colouring inside .compare */
.compare .over{ color:#ffd7a6; } .compare .under{ color:#a6ffce; }
/* disabled (computed) inputs and inline unit tags */
input:disabled{ background:var(--paper); color:var(--muted); cursor:not-allowed; border-style:dashed; }
.field-unit{ font-weight:400; color:var(--muted); }
/* date inputs share the number-input look */
input[type="date"], input[type="text"]{ font-family:var(--sans); font-size:.97rem; color:var(--deep); background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm); padding:.55em .7em; width:100%; line-height:1.2; min-width:0; }
input[type="date"]:focus, input[type="text"]:focus{ border-color:var(--focus); box-shadow:0 0 0 3px rgba(26,154,166,.18); outline:none; }
/* labelled stepper row */
.people-row{ display:flex; align-items:center; gap:12px; margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--line-soft); }
.people-row label{ font-weight:600; color:var(--deep-2); font-size:.95rem; }
.people-row .stepper{ max-width:150px; }
/* breakdown bars in result panel */
.breakdown{ margin-top:4px; }
.bd-row{ display:grid; grid-template-columns:1fr auto; gap:4px 10px; align-items:center; margin-bottom:9px; }
.bd-row .bd-label{ font-size:.9rem; color:#cfe6e9; }
.bd-row .bd-val{ font-size:.9rem; font-weight:600; color:#fff; font-variant-numeric:tabular-nums; }
.bd-row .bd-track{ grid-column:1 / -1; height:7px; border-radius:999px; background:rgba(255,255,255,.12); overflow:hidden; }
.bd-row .bd-fill{ height:100%; border-radius:999px; background:var(--c-a); width:0; transition:width .25s ease; }
@media (prefers-reduced-motion: reduce){ .bd-row .bd-fill{ transition:none; } }
/* classification line under a readout */
.classify-line{ font-size:.9rem; color:#cfe6e9; margin-top:6px; padding-top:12px; border-top:1px solid rgba(255,255,255,.12); }
.classify-line b{ color:#fff; }
/* chart wrapper in result panel */
.chart-box{ width:100%; }
.chart-box svg{ display:block; width:100%; height:auto; }
/* small table inside result panel */
.mini-table{ width:100%; border-collapse:collapse; font-size:.86rem; background:transparent; }
.mini-table th, .mini-table td{ padding:.4em .3em; border-bottom:1px solid rgba(255,255,255,.12); color:#dcecef; text-align:right; white-space:nowrap; }
.mini-table th:first-child, .mini-table td:first-child{ text-align:left; }
.mini-table thead th{ background:transparent; color:#8fb6bd; font-weight:600; border-bottom:1px solid rgba(255,255,255,.2); }
.mini-table tbody tr:hover{ background:rgba(255,255,255,.04); }
.mini-table tbody tr:last-child td{ border-bottom:0; }
.mini-wrap{ max-height:260px; overflow:auto; }

/* ---- category hub pages ---- */
.lead2{ font-size:1.16rem; color:#33505c; max-width:64ch; }
.expert-note{ display:flex; align-items:center; gap:10px; margin-top:16px; font-size:.92rem; color:var(--muted); }
.expert-note img{ width:32px; height:32px; border-radius:50%; object-fit:cover; border:1px solid #cfe6e8; flex:0 0 auto; }
.expert-note a{ color:var(--deep-2); font-weight:600; text-decoration:none; }
.expert-note a:hover{ color:var(--teal-deep); text-decoration:underline; }
.hub-group{ margin-bottom:34px; scroll-margin-top:82px; }
.hub-group h2{ font-size:1.3rem; margin:0 0 .3em; padding-bottom:.25em; position:relative; }
.hub-group h2::after{ content:""; display:block; width:44px; height:3px; background:var(--teal); border-radius:2px; margin-top:.35em; }
.hub-group > p{ max-width:var(--measure); color:#33505c; font-size:.97rem; margin:0 0 .9em; }
.hub-cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(252px,1fr)); gap:12px; }
.tool-card{ display:block; text-decoration:none; color:var(--deep); background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:15px 16px; transition:border-color .15s ease, transform .15s ease; }
.tool-card:hover{ border-color:var(--teal); transform:translateY(-2px); }
.tool-card strong{ display:block; font-family:var(--serif); font-weight:600; font-size:1.02rem; margin-bottom:3px; }
.tool-card span{ font-size:.87rem; color:var(--muted); line-height:1.4; }
.other-cats{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px; margin-top:8px; }
.other-cats a{ display:block; text-decoration:none; color:var(--deep); background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:14px 16px; transition:border-color .15s ease, transform .15s ease; }
.other-cats a:hover{ border-color:var(--teal); transform:translateY(-2px); }
.other-cats strong{ display:block; font-family:var(--serif); font-weight:600; margin-bottom:1px; }
.other-cats span{ font-size:.85rem; color:var(--muted); }
@media (prefers-reduced-motion: reduce){ .tool-card, .other-cats a{ transition:none; } }
/* "start here" problem finder and treatment train on hubs */
.finder{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; }
.finder-item{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; }
.finder-item h3{ font-size:1.05rem; margin:0 0 .35em; }
.finder-item p{ font-size:.92rem; color:var(--muted); margin:0 0 .5em; }
.finder-item ul{ margin:0; padding-left:1.1em; font-size:.93rem; }
.finder-item li{ margin-bottom:.2em; }
.train{ list-style:none; margin:0 0 1.05em; padding:0; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.train li{ display:flex; align-items:center; gap:8px; }
.train a, .train span.step{ display:inline-block; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:.4em .85em; font-size:.92rem; font-weight:600; text-decoration:none; color:var(--deep); }
.train a:hover{ border-color:var(--teal); color:var(--teal-deep); }
.train li + li::before{ content:"\2192"; color:var(--muted); }
/* keep the divider after the last group inside a tab panel when more groups follow */
[role="tabpanel"]:not(:last-child) > .field-group:last-child{ border-bottom:1px solid var(--line-soft); padding-bottom:18px; margin-bottom:18px; }

/* ---- field helpers restored from the original calculators ---- */
.temp-echo{ font-size:.85rem; color:var(--muted); align-self:center; white-space:nowrap; }
.temp-row > .combo{ min-width:0; }
.field .presets{ margin-top:8px; }
.field .slider{ margin:12px 0 4px; }
.slider, .slider:focus{ border:0; box-shadow:none; padding:0; }
.combo > select[data-fill]{ max-width:46%; }
.combo > select:not([data-fill]){ min-width:4.6em; }
@media (max-width:520px){ .temp-row{ grid-template-columns:1fr; } .temp-echo{ padding:0; } .combo > select[data-fill]{ max-width:none; } }
@media (max-width:820px){ .combo:has(> select:not([data-fill])) { flex-wrap:nowrap; } .combo:has(> select:not([data-fill])) > input[type="number"]{ flex:1 1 0; } .combo > select:not([data-fill]){ flex:0 0 auto; width:auto; } }
.panel-result a{ color:#7fd3da; text-decoration-color:rgba(127,211,218,.5); }
.panel-result a:hover{ color:#fff; }
.bd-title{ font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; color:#9fc3c9; margin:6px 0 10px; font-weight:600; }


/* ---- cost category: tiered rate rows (from the original cost calculators) ---- */
.tier-list{ margin-top:4px; }
.tier-row{ display:grid; grid-template-columns:64px 1fr 1fr 32px; gap:10px; align-items:end; padding:10px 0; border-bottom:1px dashed var(--line-soft); }
.tier-row:last-child{ border-bottom:0; }
.tier-row[hidden]{ display:none; }
.tier-num{ font-weight:700; font-size:.82rem; color:var(--teal-deep); padding-bottom:.8em; }
.tier-andabove{ display:flex; align-items:center; height:2.6em; color:var(--muted); font-size:.92rem; font-style:italic; }
.tier-remove{ width:30px; height:30px; align-self:end; margin-bottom:.35em; border-radius:50%; border:1px solid var(--line); background:var(--paper); color:var(--muted); cursor:pointer; font-size:1.05rem; line-height:1; font-family:var(--sans); }
.tier-remove:hover{ border-color:#c25a4a; color:#c25a4a; background:#fbecea; }
.tier-remove[hidden]{ visibility:hidden; display:block; }
.add-tier{ margin-top:10px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.btn-add{ font:inherit; font-size:.85rem; font-weight:600; padding:.5em .9em; border-radius:999px; border:1px dashed var(--teal); background:var(--teal-tint); color:var(--teal-deep); cursor:pointer; }
.btn-add:hover{ background:#d3ecec; }
.btn-add[hidden]{ display:none; }
@media (max-width:560px){
  .tier-row{ grid-template-columns:1fr 1fr; row-gap:6px; }
  .tier-num{ grid-column:1 / -1; padding-bottom:0; }
  .tier-remove{ grid-column:1 / -1; justify-self:end; margin:0; }
  .tier-remove[hidden]{ display:none; }
}

.bd-row .bd-fill{ display:block; }
.row2 + .field-group{ margin-top:18px; }
.row2 .combo{ flex-wrap:wrap; } .row2 .combo > input[type="number"], .row2 .combo > select[data-fill]{ flex:1 1 100%; max-width:none; width:100%; }
.tier-row.item-row{ grid-template-columns:2fr 1fr; }
.combo .unit-suffix{ display:flex; align-items:center; padding:0 .7em; color:var(--muted); font-weight:600; white-space:nowrap; }
.combo > .stepper{ min-width:150px; flex-basis:150px; }
@media (max-width:420px){ .combo{ flex-wrap:wrap; row-gap:8px; } .combo > .stepper{ flex:1 1 100%; } .combo > .stepper + select{ flex:1 1 100%; max-width:none; width:100%; } }
/* range explorer (chart + table above the calculator) */
.tool-explorer{ padding:26px 26px 8px; border-bottom:1px solid var(--line-soft); }
.explorer-head{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:4px; }
.explorer-head h2{ font-size:1.15rem; margin:0; }
.explorer-note{ font-size:.88rem; color:var(--muted); margin:0 0 16px; }
.chart-wrap{ background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:14px 10px 6px; margin-bottom:16px; }
.chart-svg{ width:100%; height:auto; display:block; }
.chart-svg text{ font-family:var(--sans); fill:var(--muted); }
.chart-grid line{ stroke:var(--line); stroke-width:1; }
.chart-line{ fill:none; stroke:var(--teal); stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round; }
.chart-marker circle{ fill:var(--honey); stroke:#fff; stroke-width:2; }
.chart-marker line{ stroke:var(--honey); stroke-width:1.4; stroke-dasharray:3 3; }
.chart-marker text{ fill:var(--deep); font-weight:700; }
.range-controls{ display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:14px; }
.range-controls .field{ margin-bottom:0; min-width:110px; flex:1 1 110px; }
.range-controls .field label{ font-size:.82rem; }
.range-note{ font-size:.82rem; color:var(--muted); margin:-4px 0 14px; }
@media (max-width:560px){ .tool-explorer{ padding:18px 16px 4px; } }
@media print{ .range-controls{ display:none !important; } .chart-wrap{ border:1px solid #999; } }
.combo > .stepper:has(+ .unit-suffix){ flex:1 1 150px; }
.combo > .unit-suffix{ flex:0 0 auto; }
/* WQI gauge and rating badge */
.gauge-wrap{ width:100%; }
.gauge-labels{ display:flex; justify-content:space-between; font-size:.68rem; color:#8fb6bd; margin-top:3px; padding:0 6px; }
.wqi-badge{ display:inline-flex; align-items:center; gap:.4em; padding:.32em .85em; border-radius:999px; font-weight:700; font-size:.92rem; color:#0b2e40; background:#7fd3da; white-space:nowrap; }
.wqi-badge.band-excellent{ background:#7fe0c9; }
.wqi-badge.band-good{ background:#7fd3da; }
.wqi-badge.band-medium{ background:#f0c987; color:#3a2708; }
.wqi-badge.band-bad{ background:#f0a894; color:#3a1208; }
.wqi-badge.band-verybad{ background:#e28b7a; color:#fff; }
.table-note{ font-size:.86rem; color:var(--muted); margin-top:10px; }
.beaker.gauge-wide{ width:110px; height:auto; }
.panel-result .field-note{color:rgba(255,255,255,.66)}
.panel-result .chart-wrap{ background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.12); }
.chart-legend{ display:flex; flex-wrap:wrap; gap:6px 14px; font-size:.78rem; color:#cfe3e6; margin:8px 4px 2px; }
.chart-legend i{ display:inline-block; width:14px; height:3px; border-radius:2px; margin-right:6px; vertical-align:middle; }
.pipe-flow{ stroke-dasharray:5 9; animation:wcflow 1.1s linear infinite; }
@keyframes wcflow{ to{ stroke-dashoffset:-14; } }
@media (prefers-reduced-motion:reduce){ .pipe-flow{ animation:none; } }
