/* COS Electricians guide styles (from the approved mockup). System fonts only: no third-party font requests. */
:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --text: #1C2321;
  --muted: #4F5B57;
  --primary: #1F5F4A;
  --accent: #B8860B;
  --ok: #2E7D4F;
  --danger: #9B2C2C;
  --notice-bg: #FFF7E0;
  --border: #DAD6CC;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --radius: 10px;
  --pill: 999px;
  --tap: 48px;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 18px; line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 var(--sp-3); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: var(--sp-6); }
h3 { font-size: 1.2rem; margin-top: var(--sp-5); }
p { margin: 0 0 var(--sp-4); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img, svg { max-width: 100%; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--sp-4); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: var(--sp-3); z-index: 100; }
.skip:focus { left: var(--sp-3); top: var(--sp-3); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.brand { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.brand .wn { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-2); font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--text); text-decoration-thickness: 3px; }

main { padding: var(--sp-5) 0 var(--sp-7); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); }
.grid { display: grid; gap: var(--sp-4); }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: 1fr 1fr; } }
.tool-card { position: relative; }
.tool-card h3 { margin-top: 0; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
#pc-form { counter-reset: q; }
#pc-form fieldset:not([hidden]) > legend::before { counter-increment: q; content: counter(q) ". "; }
.facts dt { font-weight: 700; margin-top: var(--sp-3); }
.facts dd { margin: 0; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5); border-radius: var(--radius); border: 2px solid var(--primary);
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.secondary { background: var(--surface); color: var(--primary); }
label, legend { font-weight: 700; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4) var(--sp-4); margin: 0 0 var(--sp-4); background: var(--surface); }
legend { padding: 0 var(--sp-2); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.95rem; margin: var(--sp-1) 0 var(--sp-2); }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--tap); padding: var(--sp-2) var(--sp-3); font: inherit; color: var(--text);
  border: 1px solid #8C877C; border-radius: 8px; background: #fff;
}
textarea { min-height: 96px; }
.field { margin-bottom: var(--sp-4); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-4);
  border: 2px solid var(--border); border-radius: var(--pill); background: #fff; font-weight: 600; cursor: pointer;
}
.chip input:checked + span { border-color: var(--primary); background: #E6F0EC; }
.chip input:checked + span::before { content: "\2713\00a0"; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: var(--sp-3); align-items: center; min-height: 44px; font-weight: 400; }
.check input { width: 24px; height: 24px; flex: none; }

/* Status pills (icon + word) */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--pill); padding: 2px 12px; font-size: 0.9rem; font-weight: 700; border: 1px solid var(--border); background: #F2F0EA; }

.separator { border: 0; border-top: 3px double var(--border); margin: var(--sp-5) 0; }

/* Safety box */
.safety { border: 2px solid var(--danger); background: #FDF3F3; border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0; }
.safety strong { color: var(--danger); }

/* Results */
.result { border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-5); }
.result.band-fits { border-color: var(--ok); }
.result.band-borderline { border-color: var(--accent); }
.result.band-needs, .result.band-cant { border-color: var(--danger); }
.band-head { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; }
.meter { position: relative; height: 28px; border-radius: var(--pill); background: #EEE9DE; overflow: hidden; margin: var(--sp-3) 0; border: 1px solid var(--border); }
.meter .fill { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, #C9A23D 0 8px, #B8860B 8px 16px); }
.meter .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.95rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* Directory */
.filters { display: grid; gap: var(--sp-3); }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(4, 1fr); align-items: end; } }
.listing { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3); }
.listing h3 { margin: 0 0 var(--sp-2); }
.listing .flags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.listing ul { margin: var(--sp-2) 0; padding-left: 1.2em; }
.svc-yes::before { content: "\2714\00a0"; color: var(--ok); }
.svc-no::before { content: "\2716\00a0"; color: var(--danger); }
.svc-ns::before { content: "\2014\00a0"; color: var(--muted); }
.quote-src { color: var(--muted); font-size: 0.95rem; }
.verify-tag { background: #FFF1C2; border: 1px dashed #8A6A00; border-radius: 4px; padding: 0 4px; font-size: 0.85rem; font-weight: 700; color: #5C4300; }

/* Footer */
.site-footer { background: #1C2321; color: #EDEBE6; padding: var(--sp-6) 0; font-size: 0.95rem; }
.site-footer a { color: #BFE3D3; }
.site-footer .disclosure { max-width: 75ch; }
.site-footer .small { color: #C9C5BC; }

/* Contact link: identical on every listing (D16) */
.contact-row { margin: var(--sp-3) 0; }
.contact-link { min-height: var(--tap); }


/* Safety strip (every page) */
.safety-strip { background: #FDF3F3; border-bottom: 2px solid var(--danger); color: var(--text); font-size: 0.95rem; padding: var(--sp-2) 0; }
.safety-strip strong { color: var(--danger); }
.contact-h { margin: 0 0 var(--sp-2); }
.contact-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.crumbs { font-size: 0.95rem; margin-bottom: var(--sp-3); }
.town-list { columns: 2; padding-left: 1.2em; }
@media (min-width: 720px) { .town-list { columns: 3; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.listing[hidden] { display: none; }
