@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --ink: #0f2c44;
  --muted: #5a7389;
  --blue: #0b7ec9;
  --blue-dark: #0969a8;
  --teal: #0d9b8a;
  --bg: #f4f8fb;
  --bg-soft: #eef5fa;
  --line: #d4e0ea;
  --amber: #fff8e7;
  --shadow: 0 4px 20px rgba(15, 44, 68, 0.08);
  --shadow-hover: 0 8px 30px rgba(15, 44, 68, 0.12);
  --radius: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--blue-dark); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; padding-top: 48px; padding-bottom: 48px; }

/* Header */
.top {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
  box-shadow: 0 1px 0 rgba(15, 44, 68, 0.04);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand img { height: 42px; width: auto; display: block; }
@media (max-width: 640px) { .brand img { height: 32px; } }

nav a {
  margin-left: 20px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  position: relative;
}
nav a[aria-current], nav a:hover {
  color: var(--blue);
}
nav a[aria-current]::after, nav a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  border-radius: 1px;
}

/* Hero */
.hero {
  background: linear-gradient(165deg, var(--bg-soft) 0%, #fff 60%);
  padding: 72px 0 56px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  line-height: 1.15;
  max-width: 860px;
  margin: 0 0 16px;
  font-weight: 700;
}
.lead {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 680px;
  margin-bottom: 28px;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff !important;
  padding: 14px 26px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(11, 126, 201, 0.25);
}
.btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(11, 126, 201, 0.35);
}
.btn.ghost {
  background: #fff;
  color: var(--blue) !important;
  border: 2px solid var(--blue);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--bg);
  transform: translateY(-1px);
}

/* Cards */
.cards {
  display: grid;
  gap: 22px;
  padding-top: 48px;
  padding-bottom: 32px;
}
.cards.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #c5d9e8;
}
.card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.25rem;
  color: var(--ink);
}

/* Sections */
.band { padding-top: 20px; padding-bottom: 20px; }
h2 {
  font-size: 1.75rem;
  margin: 1.6em 0 0.6em;
  font-weight: 650;
}
.research {
  background: linear-gradient(135deg, #fff9ed, #fff4d6);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 32px auto;
  border: 1px solid #f0e4c8;
}
.research h2 { margin-top: 0; font-size: 1.35rem; }

.note {
  background: var(--bg);
  border-left: 4px solid var(--blue);
  padding: 16px 20px;
  border-radius: 8px;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--bg); font-weight: 600; }

/* Forms */
.form label { display: block; margin: 16px 0; font-weight: 600; }
.form input, .form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  transition: var(--transition);
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 126, 201, 0.15);
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  margin-top: 56px;
  padding: 32px 0;
}
.small { font-size: 0.85rem; color: var(--muted); }

/* Diagrams & misc */
.diagram { display: block; width: 100%; height: auto; margin: 12px 0; }
figure { margin: 24px 0; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.tag { background: var(--amber); border-radius: 12px; padding: 2px 10px; font-size: 0.78rem; margin-left: 6px; font-weight: 600; }
.post { border-bottom: 1px solid var(--line); padding: 8px 0 16px; }

/* Mobile */
@media (max-width: 720px) {
  nav a { margin: 0 14px 0 0; font-size: 0.9rem; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 1.9rem; }
  .cards { padding-top: 32px; padding-bottom: 24px; }
  .research { padding: 22px 20px; }
}

/* Diagram colours and lists (carried over) */
.brand{display:flex;align-items:center;gap:8px}
.diagram .th{font:500 14px system-ui,-apple-system,sans-serif;fill:#2c2c2a}
.diagram .ts{font:400 12px system-ui,-apple-system,sans-serif;fill:#5f5e5a}
.diagram .arr{stroke:#5f5e5a;stroke-width:1.5;fill:none}
.diagram .c-gray>rect{fill:#F1EFE8;stroke:#5F5E5A}.diagram .c-gray .th{fill:#444441}.diagram .c-gray .ts{fill:#5F5E5A}
.diagram .c-teal>rect{fill:#E1F5EE;stroke:#0F6E56}.diagram .c-teal .th{fill:#085041}.diagram .c-teal .ts{fill:#0F6E56}
.diagram .c-purple>rect{fill:#EEEDFE;stroke:#534AB7}.diagram .c-purple .th{fill:#3C3489}.diagram .c-purple .ts{fill:#534AB7}
.diagram .c-amber>rect,.diagram circle.c-amber{fill:#FAEEDA;stroke:#854F0B}.diagram .c-amber .th{fill:#633806}.diagram .c-amber .ts{fill:#854F0B}
.papers li{margin:8px 0}

/* Engineering diagrams */
.pidsec h2{margin-top:2em}
.pidwrap{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start;margin:8px 0 12px}
@media(max-width:900px){.pidwrap{grid-template-columns:1fr}}
.pidwrap figure{margin:0}
svg.pid{width:100%;height:auto;display:block;background:#fff;border:1px solid var(--line);border-radius:12px}
.pid .pp{fill:none;stroke:#5a7389;stroke-width:2.2}
.pid .pm{fill:#5a7389}
.pid .pn{font:500 12px 'Inter',system-ui,sans-serif;fill:#5a7389}
.pid .sym,.slotsym .sym,.legend .sym{fill:#fff;stroke:#0f2c44;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.pid .sym .pipe{fill:#fff}
.pid .st,.slotsym .st,.legend .st{font:700 15px 'Outfit','Inter',sans-serif;fill:#0f2c44;stroke:none}
.pid .hit{fill:transparent;stroke:none}
.pid .part{cursor:pointer;outline:none}
.pid .tg{font:700 12px 'Inter',sans-serif;fill:#0b7ec9}
.pid .nm{font:500 12px 'Inter',sans-serif;fill:#0f2c44}
.pid .part:hover .sym,.pid .part:focus .sym,.pid .part.on .sym{stroke:#0b7ec9;fill:#eaf4fb}
.pid .part:hover .hit,.pid .part:focus .hit,.pid .part.on .hit{fill:rgba(11,126,201,.06);stroke:#0b7ec9;stroke-dasharray:4 4}
.pcard{border:1px solid var(--line);border-radius:16px;padding:18px;background:#fff;box-shadow:var(--shadow);position:sticky;top:90px}
.slot{position:relative;border:1px dashed var(--line);border-radius:12px;background:var(--bg);height:200px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.slotsym{width:100%;height:100%}
.slotimg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.slotcap{position:absolute;left:0;right:0;bottom:6px;text-align:center;font-size:.75rem;color:var(--muted)}
.slot.has-photo{cursor:pointer;border-style:solid;border-color:var(--blue)}
.ptag{margin:12px 0 0;font:700 .8rem 'Inter',sans-serif;color:var(--blue);letter-spacing:.06em}
.pname{margin:2px 0 8px;font-size:1.15rem}
.prole{font-size:.95rem;line-height:1.55;margin:0 0 8px}
.pex,.pst{font-size:.85rem;color:var(--muted);margin:4px 0;line-height:1.5}
.legend{list-style:none;padding:0;margin:12px 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.legend li{display:flex;align-items:center;gap:10px;font-size:.9rem}
.ptable{margin:8px 0 24px}
.ptable summary{cursor:pointer;color:var(--blue);font-weight:600}
.ptable table{font-size:.85rem}

/* click-through from diagram to parts list */
.ptable tr.hit td{background:#e6f0fa;transition:background .3s}
.ptable tr[id]{scroll-margin-top:90px}
.backbtn{display:inline-block;white-space:nowrap;padding:6px 12px;border-radius:8px;background:#0f2c44;color:#fff;text-decoration:none;font-weight:600;font-size:.85rem}
.backbtn:hover,.backbtn:focus{background:#1d5c94;color:#fff}
.pidwrap{scroll-margin-top:90px}
.ptable td:first-child{white-space:nowrap;font-weight:600}

/* Interactive estimate */
.est-sticky{position:sticky;top:0;z-index:5;background:#fff;border-bottom:2px solid #0b7ec9;padding:.4rem 0;margin-bottom:.8rem}
.est-top{margin-bottom:1rem}
.est-total{font-size:1.5rem;font-weight:700}
.est-btn{display:inline-block;margin:.2rem .3rem .2rem 0;padding:.35rem .7rem;border:1px solid #0b7ec9;border-radius:8px;background:#fff;color:#0f2c44;cursor:pointer;font:inherit}
.est-btn:hover,.est-btn[aria-pressed=true],.est-btn.on{background:#eaf4fb}
.est-btn.sel{border-color:#12805c}
.est-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:1.2rem;align-items:start}
.est-panel{position:sticky;top:4.2rem;border:1px solid #0b7ec9;border-radius:12px;padding:1rem;background:#f4f9fd;max-height:calc(100vh - 5.5rem);overflow:auto}
.opt{border:1px solid #cfd8dc;background:#fff;border-radius:10px;padding:.6rem .8rem;margin:.6rem 0}
.opt.chosen{border-color:#12805c;box-shadow:0 0 0 2px rgba(18,128,92,.15)}
.opt h3{margin:.1rem 0 .3rem;font-size:1rem}
.badge{display:inline-block;padding:.05rem .5rem;border-radius:999px;font-size:.78rem;background:#e8eef3}
.badge.budget{background:#fdf0d5}.badge.residential{background:#dff1ea}.badge.commercial{background:#dde8fa}
.pid .part.noest{opacity:.5}
.pid .part.sel .sym{stroke:#12805c}
.pid .part.need .hit{stroke:#c98a00;stroke-dasharray:3 5;fill:rgba(201,138,0,.05)}
.pid .chk circle{fill:#12805c;stroke:#fff;stroke-width:2}
.pid .chk path{fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:800px){.est-grid{grid-template-columns:1fr}.est-panel{position:static;max-height:none}.est-sticky{position:static}}

/* Forms */
.wrap form input[type=text],.wrap form input[type=email],.wrap form input[type=password]{width:100%;max-width:28rem;padding:.5rem .7rem;border:1px solid #b9c7d1;border-radius:8px;font:inherit;background:#fff}
.wrap form input:focus{outline:2px solid #0b7ec9;outline-offset:1px}
.wrap form label{font-size:.95rem}
[hidden]{display:none!important}

/* sizing + cards (v27) */
.sizer{border:1px solid #cfd8dc;border-radius:12px;padding:1rem;margin:0 0 1rem;background:#f9fbfc}
.sz-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(11rem,1fr));gap:.5rem .8rem;margin:.6rem 0}
.szf{display:flex;flex-direction:column;gap:.15rem}
.szf input,.fcard input{padding:.3rem .45rem;border:1px solid #cfd8dc;border-radius:8px;font:inherit;width:100%;box-sizing:border-box}
.cardflow{display:grid;grid-template-columns:repeat(auto-fill,minmax(12.5rem,1fr));gap:.8rem;margin:.6rem 0 1.2rem}
.fcard{border:1px solid #cfd8dc;border-radius:12px;padding:.7rem;background:#fff;position:relative}
.fcard.has{border-color:#12805c;box-shadow:0 0 0 2px rgba(18,128,92,.12)}
.fcard.on{border-color:#0b7ec9}
.fcard h3{font-size:1rem;margin:.4rem 0 .2rem}
.ftile{background:#eaf4fb;border-radius:8px;height:3.4rem;display:flex;align-items:center;justify-content:center;font-weight:700;color:#0b4f7a;letter-spacing:.04em}
.ftile.u{background:#f0f3f5;color:#5b6b76;font-weight:600}
.frow{display:flex;align-items:center;justify-content:space-between;gap:.4rem;margin:.3rem 0;flex-wrap:wrap}
.stepper{display:inline-flex;align-items:center;gap:.2rem}
.stepper .est-btn{margin:0;padding:.15rem .55rem}
.qv{min-width:1.6rem;text-align:center;font-weight:700}
.tag{display:inline-block;font-size:.8rem;padding:.1rem .45rem;border-radius:999px;border:1px solid #cfd8dc}
.tag.fit{background:#e6f4ee;border-color:#12805c;color:#0d5f44}
.tag.bad{background:#fdecea;border-color:#c0392b;color:#8e2418}
.tag.warn{background:#fff6e0;border-color:#c98a00;color:#7a5400}
.tag.unk{background:#f0f3f5;color:#5b6b76}
.pid .chk circle{fill:#12805c;stroke:#fff;stroke-width:1.5}
.pid .chk text{fill:#fff;font:700 13px sans-serif;stroke:none}
.sumbox{display:grid;grid-template-columns:minmax(0,2fr) minmax(12rem,1fr);gap:1rem;border:1px solid #0b7ec9;border-radius:12px;padding:1rem;background:#f4f9fd;margin:1rem 0;align-items:start}
.runtot{border:1px solid #0b7ec9;border-radius:12px;padding:.8rem;background:#fff}
.sumtable{width:100%;border-collapse:collapse;font-size:.95rem}
.sumtable th,.sumtable td{border-bottom:1px solid #dde5ea;padding:.3rem .4rem;text-align:left}
.sumtable td.num,.sumtable th:nth-child(n+3){text-align:right}
@media(max-width:800px){.sumbox{grid-template-columns:1fr}}
@media print{
  body>header,body>footer,header.site,footer.site,nav,.est-sticky,.sizer details,.est-top,.est-grid,.cardflow,.sizer .est-btn,#show-all,.est-btn,#panel,h2+p.small+.cardflow,.cta{display:none!important}
  .sizer{border:0;background:#fff;padding:0}.sizer .sz-grid{display:none}.sumbox{border:0;background:#fff;display:block}.runtot{margin-top:.6rem}
  .ptable,noscript{display:none!important}
}

/* slide-over brand picker with carousel */
.est-grid{display:block}
.est-panel{position:fixed;top:0;right:0;height:100vh;max-height:none;width:min(27rem,94vw);border-radius:12px 0 0 12px;transform:translateX(105%);transition:transform .28s ease;z-index:1000;box-shadow:-8px 0 24px rgba(0,0,0,.18);overflow:auto;box-sizing:border-box}
.est-panel.open{transform:none}
.est-panel .ph{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem}
.est-panel .ph h2{margin:.1rem 0}
.cnav{display:flex;align-items:center;justify-content:space-between;margin:.4rem 0}
.carousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:.6rem;scrollbar-width:thin}
.carousel .opt{flex:0 0 100%;scroll-snap-align:start;box-sizing:border-box;margin:.2rem 0}
.dots{display:flex;gap:.35rem;justify-content:center;margin:.5rem 0}
.dots button{width:.7rem;height:.7rem;border-radius:50%;border:1px solid #0b7ec9;background:#fff;padding:0;cursor:pointer}
.dots button.on{background:#0b7ec9}
.est-btn:disabled{opacity:.4;cursor:default}
@media(prefers-reduced-motion:reduce){.est-panel{transition:none}}
@media(max-width:800px){.est-panel{top:auto;bottom:0;width:100%;height:78vh;border-radius:14px 14px 0 0;transform:translateY(105%)}.est-panel.open{transform:none}}

/* inline sign-up under the estimate */
#save-gate form { display: grid; gap: .25rem; max-width: 26rem; margin: .5rem 0; }
#save-gate input { width: 100%; }
#save-gate [hidden] { display: none; }

/* tabs (progressive: without JS all sections show) */
.tablist{display:flex;flex-wrap:wrap;gap:.35rem;margin:1.2rem 0 1.4rem;border-bottom:2px solid #d3e3ee;padding-bottom:.5rem}
.tab{padding:.5rem .95rem;border:1px solid #b9d3e4;border-radius:8px 8px 0 0;background:#f4f9fc;color:#0f2c44;font:inherit;font-weight:600;cursor:pointer}
.tab:hover{background:#eaf4fb}
.tab[aria-selected=true]{background:#0b7ec9;border-color:#0b7ec9;color:#fff}
.tab:focus-visible{outline:3px solid #12805c;outline-offset:2px}
.tabpanel[hidden]{display:none}
@media print{.tablist{display:none}.tabpanel[hidden]{display:block!important}}

/* landing-page pair of pictures, enlarge on hover */
.uses{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1rem 0}
.uses figure{margin:0;cursor:zoom-in;border:1px solid #d3e3ee;border-radius:12px;overflow:hidden;background:#fff}
.uses figure img{display:block;width:100%;height:auto}
.uses figcaption{padding:.5rem .7rem;font-size:.9rem;color:#4a5f73}
.uses figure:focus-visible{outline:3px solid #12805c;outline-offset:2px}
.zoom-ov{position:fixed;inset:0;z-index:100;background:rgba(10,25,40,.82);display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .7s ease,visibility 0s linear .7s}
.zoom-ov.show{opacity:1;visibility:visible;transition:opacity .7s ease}
.zoom-ov.pin{pointer-events:auto;cursor:zoom-out}
.zoom-ov img{max-width:96vw;max-height:94vh;width:auto;height:auto;border-radius:10px;box-shadow:0 10px 40px rgba(0,0,0,.5);background:#fff;transform:scale(.55);opacity:0;transition:transform .9s cubic-bezier(.2,.7,.2,1),opacity .7s ease}
.zoom-ov.show img{transform:scale(1);opacity:1}
@media (prefers-reduced-motion:reduce){.zoom-ov,.zoom-ov.show,.zoom-ov img{transition-duration:.01s}.zoom-ov img{transform:none}}
@media (max-width:640px){.uses{grid-template-columns:1fr}}

/* Account menu in the header (v27) */
.bar{position:relative}
.acct{position:relative;margin-left:8px}
.acct-btn{display:block;line-height:1.15;text-align:left;color:var(--ink);padding:5px 12px;border:1px solid transparent;border-radius:8px;font-size:.74rem}
.acct-btn b{display:block;font-size:.92rem;font-weight:600;white-space:nowrap}
.acct-btn b::after{content:" \25BE";font-size:.7rem;color:var(--blue)}
.acct:hover .acct-btn,.acct.open .acct-btn,.acct-btn:focus-visible{border-color:var(--line);background:#fff}
.acct-menu{display:none;position:absolute;right:0;top:100%;min-width:270px;max-width:86vw;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(15,44,68,.16);padding:16px;z-index:130}
.acct-menu::before{content:"";position:absolute;left:0;right:0;top:-10px;height:10px}
.acct.open .acct-menu{display:block}
.acct-head{display:grid;gap:2px;padding-bottom:10px;margin-bottom:8px;border-bottom:1px solid var(--line);word-break:break-word}
.acct-links{display:grid;gap:2px;margin-bottom:12px}
.acct-links a{padding:6px 4px;color:var(--ink);font-size:.93rem;border-radius:6px}
.acct-links a:hover{background:var(--bg-soft);color:var(--blue)}
.acct-menu .est-btn{display:inline-block;text-align:center}
.acct-menu p{margin:10px 0 0}
.acct[hidden]{display:none}
@media (max-width:640px){.acct{margin-left:0}.acct-menu{right:auto;left:0}}
@media print{.acct{display:none!important}}

/* Your Account page: card grid (v27) */
.acctgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px;margin:20px 0}
.acctcard{display:block;border:1px solid var(--line);border-radius:12px;padding:18px 20px;color:var(--ink);background:#fff}
.acctcard:hover{border-color:var(--blue);box-shadow:0 6px 18px rgba(15,44,68,.1)}
.acctcard h3{margin:0 0 6px;font-size:1.05rem;color:var(--blue)}
.acctcard p{margin:0;font-size:.9rem;color:#4a5b6b}
.acctback{display:inline-block;margin:0 0 12px;font-size:.92rem}
.acctrow{display:grid;grid-template-columns:140px 1fr;gap:8px 16px;padding:8px 0;border-bottom:1px solid var(--line)}
@media (max-width:560px){.acctrow{grid-template-columns:1fr}}
