:root{
  --ink:#16202B; --ink-2:#223040; --cyan:#0AA5C0; --cyan-dk:#07859C; --cyan-soft:#E3F5F8;
  --text:#2B3845; --muted:#5E6B78; --bg:#FFFFFF; --bg-2:#F4F6F8; --rule:#DDE3E8; --maxw:1220px;
  --ok:#1E7B46; --warn:#9A6200; --bad:#B42318;
  --head:"Barlow Semi Condensed","Arial Narrow",Arial,sans-serif;
  --body:"Barlow","Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:var(--body);color:var(--text);background:var(--bg);font-size:17px;line-height:1.6;-webkit-font-smoothing:antialiased}
img{display:block;max-width:100%}
a{color:var(--cyan-dk)}
:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 28px}
h1,h2,h3,h4{font-family:var(--head);color:var(--ink);line-height:1.1;font-weight:700}
h1{font-size:clamp(2.1rem,4.4vw,3.2rem);letter-spacing:-.01em}
h2{font-size:1.5rem}
p{margin:0 0 .8rem}
.lede{font-size:1.14rem;color:var(--muted);max-width:62ch}
.eyebrow{font-family:var(--head);font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--cyan-dk);font-size:.9rem;margin-bottom:.5rem}
[hidden]{display:none !important}
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--head);font-weight:600;font-size:1.05rem;letter-spacing:.01em;padding:.75rem 1.4rem;border-radius:3px;text-decoration:none;border:2px solid transparent;cursor:pointer;background:none;color:var(--ink)}
.btn-cyan{background:var(--cyan);color:#fff}
.btn-cyan:hover{background:var(--cyan-dk)}
.btn-quiet{border-color:var(--rule);background:#fff}

/* Header */
header.site{position:sticky;top:0;z-index:60;background:#fff;box-shadow:0 1px 0 var(--rule)}
header.site .wrap{display:flex;align-items:center;justify-content:space-between;height:76px;gap:1rem}
.logo{display:flex;align-items:center;gap:.6rem;text-decoration:none}
.logo img{height:46px;width:auto}
.wordmark{display:flex;flex-direction:column;line-height:1}
.wordmark b{font-family:"Michroma","Eurostile","Arial Black",sans-serif;font-weight:400;font-size:1.12rem;letter-spacing:.12em;color:#231F20;white-space:nowrap}
.wordmark small{font-family:var(--head);font-weight:700;font-size:.72rem;letter-spacing:.32em;color:var(--cyan-dk);margin-top:.4rem}
nav.main{display:flex;align-items:center;gap:1.6rem}
nav.main a{font-family:var(--head);font-weight:600;font-size:1.05rem;color:var(--ink);text-decoration:none}
nav.main a:hover{color:var(--cyan-dk)}
nav.main a.btn-cyan{color:#fff}
.page{padding-top:2.4rem;padding-bottom:4rem}

/* Calculators list (same boxes as the Circuits home page) */
.hub-hero{max-width:760px;margin-bottom:1.6rem}
.hub-hero h1{margin-bottom:.8rem}
.hub-search{margin-top:1rem;width:100%;max-width:420px;font:inherit;padding:.75rem 1rem;border:1px solid #c9d2da;border-radius:3px;background:#fff}
.hub-search:focus{outline:none;border-color:var(--cyan);box-shadow:0 0 0 3px rgba(10,165,192,.18)}
.tgroup{margin-top:2.2rem}
.tgroup h2{font-size:.92rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin-bottom:.9rem}
.tgrid{list-style:none;display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}
.tgrid a{display:flex;gap:.9rem;align-items:flex-start;height:100%;background:#fff;border:1px solid var(--rule);border-top:3px solid var(--rule);padding:1.1rem 1.1rem 1.2rem;text-decoration:none;transition:border-color .15s}
.tgrid a:hover{border-top-color:var(--cyan)}
.ic{flex:0 0 44px;height:44px;display:grid;place-items:center;background:var(--cyan-soft);color:var(--cyan-dk);font-family:var(--head);font-weight:700;font-size:.95rem}
.tgrid b{display:block;font-family:var(--head);font-size:1.12rem;color:var(--ink);line-height:1.2}
.tgrid small{display:block;font-size:.9rem;color:var(--muted);line-height:1.45;margin-top:.25rem}
.no-match{color:var(--muted);margin-top:1rem}
.cta-band{margin-top:3.5rem;background:var(--ink);color:#C9D3DC;padding:2rem 2.2rem;display:flex;flex-wrap:wrap;gap:1.2rem 2rem;align-items:center;justify-content:space-between}
.cta-band h2{color:#fff;font-size:1.8rem;margin-bottom:.3rem}
.cta-band p{margin:0}

/* Footer */
footer{background:#0E161E;color:#98A7B4;padding:2.4rem 0 1.6rem;font-size:.94rem}
footer a{color:#C9D3DC;text-decoration:none}
footer a:hover{color:#7FDCEC}
.foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1rem;align-items:center;padding-bottom:1.4rem;border-bottom:1px solid rgba(255,255,255,.1)}
.foot-logo{display:flex;align-items:center;gap:.7rem}
.foot-logo b{color:#fff;font-family:var(--head);letter-spacing:.06em}
.foot-bottom{padding-top:1.2rem;font-size:.85rem}

@media (max-width:980px){.tgrid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:640px){
  .wrap{padding:0 18px}
  .tgrid{grid-template-columns:1fr}
  .hide-sm{display:none}
  nav.main{gap:1rem}
  nav.main .btn{padding:.55rem .9rem;font-size:.95rem}
  .wordmark b{font-size:.9rem}
  .wordmark small{font-size:.6rem;letter-spacing:.2em}
  header.site .wrap{height:64px}
  .logo img{height:36px}
}
@media (max-width:420px){ nav.main a:not(.btn){display:none} }

/* ---------- Calculators ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.ec-title { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.ec-title .ic { flex-basis: 60px; height: 60px; font-size: 1.05rem; }
.ec-title h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin-bottom: 4px; }
.ec-title p { color: var(--muted); margin: 0; }

.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calc .card { padding: 20px; }
.calc-in { position: relative; }
.calc-out { position: sticky; top: 12px; background: #fbfaf9; }
.h-sub { font-size: .95rem; margin: 18px 0 10px; }
.calc-in > .h-sub:first-child, .calc-out > .h-sub:first-child { margin-top: 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; }
.f { display: grid; gap: 4px; align-content: start; margin-bottom: 0; }
.calc-in > .f, .calc-in > div > .f { margin-bottom: 12px; }
.f.wide { grid-column: 1 / -1; }
.f .l { font-weight: 600; font-size: .9rem; }
.f small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.f .in { display: flex; align-items: stretch; border: 1px solid #cfc8c3; border-radius: 8px; background: #fff; overflow: hidden; }
.f .in:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(10, 165, 192, .18); }
.f input, .f select { flex: 1; min-width: 0; font: inherit; border: 0; padding: 10px 12px; background: transparent; min-height: 44px; outline: none; }
.f em { font-style: normal; color: var(--muted); padding: 0 12px; display: grid; place-items: center; background: #f6f3f1; border-left: 1px solid var(--rule); font-size: .92rem; white-space: nowrap; }
.f.used .in { border-color: var(--cyan); }
.in.sw select { padding-left: 38px; background: linear-gradient(90deg, var(--sw, transparent) 0 26px, transparent 26px) no-repeat; background-size: 26px 100%; }
.in.sw { position: relative; }
.btn-clear { position: absolute; top: 10px; right: 10px; min-height: 32px; padding: 4px 12px; font-size: .86rem; color: var(--muted); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 999px; margin: 0 60px 16px 0; }
.seg button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); min-height: 38px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.res-main { padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--rule); }
.res-main span { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.res-main output { display: block; font-family: var(--head); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; word-break: break-word; color: var(--ink); }
.res { margin: 0; display: grid; gap: 0; }
.res > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.res > div:last-child { border-bottom: 0; }
.res dt { color: var(--muted); font-size: .92rem; }
.res dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.calc-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.calc-note.warn { background: #fff8e8; border: 1px solid #e7c27a; color: #6b4b00; }
.calc-note.bad { background: #fdeeec; border: 1px solid #e3a59d; color: #8c1d1d; }
.calc-note.info { background: #f2f6fb; border: 1px solid #d4e3f5; color: #183b63; }
.small { font-size: .9rem; }
.muted { color: var(--muted); }

.strip { display: flex; align-items: center; gap: 7px; height: 54px; margin: 6px 0 14px; padding: 0 28px; border-radius: 26px; background: #e9d7b7; position: relative; max-width: 360px; }
.strip:empty { display: none; }
.strip::before, .strip::after { content: ""; position: absolute; top: 50%; width: 28px; height: 3px; background: #9aa0a6; }
.strip::before { right: 100%; }
.strip::after { left: 100%; }
.strip i { width: 14px; height: 100%; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.strip i.gap { margin-left: auto; }

.etable { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .92rem; }
.etable th, .etable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.etable thead th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.etable tr.hl td, .etable tr.hl th { background: var(--cyan-soft); }
.etable small { color: var(--muted); }

.calc-how { margin-top: 16px; padding: 20px; }
.calc-how h2 { font-size: 1.05rem; }
.calc-how p, .calc-how li { color: #3b3735; }
.calc-how ul { padding-left: 20px; margin: 0; }
.calc-how li + li { margin-top: 6px; }
.ec-related { margin-top: 26px; }
.ec-related h2 { font-size: 1rem; }
.ec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ec-chips a { border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px; text-decoration: none; color: var(--ink); font-size: .92rem; background: #fff; }
.ec-chips a:hover { border-color: var(--cyan); color: var(--cyan); }
.ec-chips a.all { border-color: transparent; color: var(--cyan-dk); font-weight: 600; }

@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; }
  .calc-out { position: static; }
}
.card { background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--rule); }
.calc-out.card { border-top-color: var(--cyan); background: #fbfcfd; }
.calc-how h2, .ec-related h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.res-main output { font-family: var(--head); }
