/*
  Kilosend: transactional email pricing (Screenery template)
  The page is a utility meter board: a painted green board, a bakelite meter with a glass cover and an enamel nameplate,
  rolling register drums (the last one red), an aluminium disc seen edge-on, and cream tariff paper for everything below.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Components: buttons, segmented switch, select, stepper, checkbox, alerts
   4. Header
   5. Hero: board, copy, dials
   6. The meter: case, glass, plate, registers and drums, disc, cover and tariff card
   7. Tariffs
   8. Comparison
   9. Sample bill
  10. Schedule of charges
  11. Billing questions
  12. Connect a supply
  13. Footer
  14. Motion
  15. Responsive
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette: the meter cupboard */
  --board: #2f3f36;        /* painted meter board, the hero ground */
  --board-deep: #25332b;
  --board-line: #46584d;
  --bakelite: #221d19;     /* meter case, footer */
  --bakelite-2: #362e28;
  --enamel: #eee7d8;       /* nameplate and page paper */
  --enamel-2: #e3dac7;     /* rules, wells, alternate rows */
  --enamel-3: #d4c9b2;
  --ink: #1f1b17;
  --ink-2: #4b433b;        /* secondary text on enamel (8:1) */
  --alu: #c7c9c4;          /* disc, screws */
  --red: #c4361f;          /* the tenths drum and the disc mark */
  --red-ink: #a32a16;      /* red as text on enamel (5.6:1) */
  --brass: #b08a42;        /* seal and terminal screws, decoration only */
  --on-board: #ece5d4;
  --on-board-2: #bfc7bd;   /* secondary text on the board (7:1) */

  /* Type */
  --sans: "Encode Sans Expanded", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fira Mono", ui-monospace, Menlo, monospace;  /* readings, prices, units */
  --fs-s: 0.8125rem;    /* 13: labels, table meta */
  --fs-b: 0.96875rem;   /* 15.5: body */
  --fs-m: 1.25rem;      /* 20: card titles, plan names */
  --fs-h2: clamp(1.75rem, 1.1rem + 2.2vw, 2.75rem);
  --fs-h1: clamp(2.35rem, 1.2rem + 4vw, 4.25rem);

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 104px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --wrap: 1240px;

  /* Shape and depth */
  --r1: 3px; --r2: 6px; --r3: 12px;
  --hair: 1px solid var(--enamel-3);
  --lift: 0 1px 0 rgb(31 27 23 / 0.12), 0 18px 30px -18px rgb(31 27 23 / 0.45);
  --lift-dark: 0 2px 0 rgb(0 0 0 / 0.25), 0 28px 50px -24px rgb(0 0 0 / 0.7);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t1: 140ms; --t2: 320ms; --t3: 700ms;

  color-scheme: light;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--enamel); color: var(--ink);
  font: 400 var(--fs-b)/1.6 var(--sans); font-stretch: 100%;
  caret-color: var(--red);
  accent-color: var(--red);
  scrollbar-color: var(--ink-2) var(--enamel-2);
}
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--red); color: var(--enamel); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.hero :focus-visible, .foot :focus-visible { outline-color: #f2b9a8; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
.mono, td, .card__lines, .drums { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -60px; z-index: 30; background: var(--ink); color: var(--enamel); padding: var(--s2) var(--s4); border-radius: var(--r1); }
.skip:focus { top: var(--s3); }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* ---------- 3. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5); border: 1.5px solid var(--ink); border-radius: var(--r2);
  background: var(--ink); color: var(--enamel); font-weight: 600; font-size: var(--fs-s); letter-spacing: 0.01em;
  text-decoration: none; transition: background var(--t1), color var(--t1), transform var(--t1) var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--red-ink); border-color: var(--red-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--enamel); border-color: var(--ink); }
.btn--small { min-height: 38px; padding: 0 var(--s4); }
.btn--big { min-height: 52px; padding: 0 var(--s6); font-size: var(--fs-b); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Segmented switch (cycle, currency) */
.seg, .cur { display: inline-flex; padding: 3px; border-radius: var(--r2); background: var(--board-deep); border: 1px solid var(--board-line); }
.seg button, .cur button {
  min-height: 38px; padding: 0 var(--s4); border: 0; border-radius: 4px; background: transparent; color: var(--on-board-2);
  font-size: var(--fs-s); font-weight: 600; transition: background var(--t1), color var(--t1);
}
.seg button[aria-checked="true"], .cur button[aria-checked="true"] { background: var(--enamel); color: var(--ink); }
.seg button:hover:not([aria-checked="true"]) { color: var(--on-board); }
.seg--light { background: var(--enamel-2); border-color: var(--enamel-3); }
.seg--light button { color: var(--ink-2); }
.seg--light button[aria-checked="true"] { background: var(--ink); color: var(--enamel); }
.seg--light button:hover:not([aria-checked="true"]) { color: var(--ink); }

/* Select with drawn chevron */
.sel { position: relative; }
.sel select {
  appearance: none; width: 100%; min-height: 44px; padding: 0 40px 0 var(--s3);
  border: 1.5px solid var(--enamel-3); border-radius: var(--r2); background: #f7f2e7; color: var(--ink);
}
.sel svg { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; translate: 0 -50%; pointer-events: none; }

/* Stepper */
.step { display: flex; align-items: stretch; height: 44px; border-radius: var(--r2); overflow: hidden; }
.step input { width: 100%; min-width: 0; text-align: center; border: 0; font-family: var(--mono); font-size: 1.05rem; }
.step__b { width: 44px; flex: none; border: 0; display: grid; place-items: center; }
.step__b svg { width: 16px; height: 16px; }

/* Checkbox */
.check { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s5); cursor: pointer; max-width: 62ch; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { flex: none; width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: var(--r1); display: grid; place-items: center; background: #f7f2e7; margin-top: 1px; }
.check__box svg { width: 16px; height: 16px; stroke-width: 2.2; opacity: 0; color: var(--enamel); }
.check input:checked + .check__box { background: var(--ink); }
.check input:checked + .check__box svg { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- 4. Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bakelite); color: var(--on-board); border-bottom: 1px solid #000; }
.top__in { display: flex; align-items: center; gap: var(--s5); width: min(100% - 2 * var(--gutter), 1380px); margin-inline: auto; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; letter-spacing: -0.01em; text-decoration: none; font-size: 1.05rem; color: var(--enamel); }
.brand__mark { width: 30px; height: 30px; stroke: none; color: #3b332c; }
.nav { display: flex; gap: var(--s5); margin-right: auto; margin-left: var(--s5); }
.nav a { font-size: var(--fs-s); color: var(--on-board-2); text-decoration: none; padding: var(--s2) 0; }
.nav a:hover { color: var(--enamel); text-decoration: underline; }
.top .cur { background: #15120f; border-color: #3a322b; }
.top .cur button { min-height: 32px; padding: 0 var(--s3); font-family: var(--mono); font-weight: 500; color: #c9c1b3; }
.top .cur button[aria-checked="true"] { color: var(--ink); }
.top .btn { background: var(--enamel); color: var(--ink); border-color: var(--enamel); }
.top .btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- 5. Hero ---------- */
.hero {
  background:
    radial-gradient(120% 80% at 70% 30%, rgb(255 255 255 / 0.05), transparent 60%),
    var(--board);
  color: var(--on-board);
  border-bottom: 6px solid var(--board-deep);
}
.hero__in {
  width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto;
  display: grid; column-gap: clamp(32px, 5vw, 88px);
  grid-template-columns: minmax(0, 1fr) 460px;
  grid-template-areas: "copy case" "dials case" "dials cover" "key cover";
  grid-template-rows: auto auto auto 1fr;
  padding: clamp(28px, 4vw, 52px) 0 clamp(36px, 5vw, 64px);
}
.hero__copy { grid-area: copy; align-self: end; padding-bottom: var(--s6); }
.hero h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.035em; max-width: 11ch; }
.lede { margin-top: var(--s4); max-width: 46ch; color: var(--on-board-2); font-size: 1.0625rem; }

.dials { grid-area: dials; display: grid; gap: var(--s5); align-content: start; max-width: 560px; }
.dial { border: 0; margin: 0; padding: 0; min-width: 0; }
.dial legend, .dial__head label { font-size: var(--fs-s); font-weight: 600; color: var(--on-board); padding: 0; }
.dial legend { margin-bottom: var(--s2); }
.dial__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); flex-wrap: wrap; }
.dial__unit { font-size: var(--fs-s); color: var(--on-board-2); }
.dial__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--s4); align-items: center; }
.dial__num, .dials .step input {
  min-height: 44px; padding: 0 var(--s3); border: 1px solid #0f0c0a; border-radius: var(--r2);
  background: #15120f; color: #f4efe4; font-family: var(--mono); font-size: 1.1rem; letter-spacing: 0.02em;
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.5);
}
.dial__num[aria-invalid="true"] { border-color: #f2b9a8; }
.dials .step { border: 1px solid #0f0c0a; }
.dials .step input { border: 0; border-radius: 0; box-shadow: none; }
.dials .step__b { background: var(--bakelite-2); color: var(--on-board); }
.dials .step__b:hover { background: #4a4038; }
.dials .step__b[disabled] { opacity: 0.4; cursor: not-allowed; }
.dials .sel select { background: #15120f; color: #f4efe4; border-color: #0f0c0a; }
.dials .sel svg { color: var(--on-board-2); }
.dial--pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.dial--pair .dial__msg { grid-column: 1 / -1; }
.dial__msg { font-size: var(--fs-s); color: #f2c7b9; min-height: 0; }
.dial__msg:empty { display: none; }
.dial--cycle .seg { width: 100%; }
.dial--cycle .seg button { flex: 1; }

/* How to read the meter: a key under the dials */
.key { grid-area: key; align-self: start; margin: var(--s7) 0 0; max-width: 560px; padding-top: var(--s5); border-top: 1px solid var(--board-line); display: grid; gap: var(--s4); }
.key div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.key dt { padding-top: 2px; }
.key dd { margin: 0; font-size: var(--fs-s); color: var(--on-board-2); }
.key dd b { color: var(--on-board); font-weight: 600; }
.key__drum { display: inline-grid; place-items: center; width: 20px; height: 28px; border-radius: 2px; background: var(--red); color: #fff; font: 500 15px/1 var(--mono); }
.key__disc { width: 40px; height: 14px; stroke: none; }
.key__seal { width: 26px; height: 26px; color: var(--brass); }

/* Range: a brass-knurled slider on a black track */
.dial__range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; }
.dial__range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red) var(--fill, 50%), #15120f var(--fill, 50%)); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.6); }
.dial__range::-moz-range-track { height: 6px; border-radius: 3px; background: #15120f; }
.dial__range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--red); }
.dial__range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; border: 2px solid #15120f; background: repeating-conic-gradient(#d9dbd6 0 10deg, #9fa29d 10deg 20deg); box-shadow: 0 2px 4px rgb(0 0 0 / 0.5); }
.dial__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #15120f; background: repeating-conic-gradient(#d9dbd6 0 10deg, #9fa29d 10deg 20deg); }
.dial__range:focus-visible { outline-offset: 0; }

/* ---------- 6. The meter ---------- */
.meter { display: contents; }
.meter__case {
  grid-area: case; position: relative; container-type: inline-size;
  padding: 22px 22px 18px; border-radius: 34px 34px 10px 10px;
  background:
    radial-gradient(90% 50% at 30% 8%, rgb(255 255 255 / 0.10), transparent 60%),
    linear-gradient(180deg, #3a322b, var(--bakelite) 40%, #191512);
  box-shadow: var(--lift-dark), inset 0 1px 0 rgb(255 255 255 / 0.08);
}
/* The glass cover: a lighter bevel and one diagonal highlight, above the plate */
.meter__glass {
  position: absolute; inset: 12px; border-radius: 26px 26px 6px 6px; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.09), inset 0 10px 24px rgb(255 255 255 / 0.05);
  background: linear-gradient(118deg, transparent 0 22%, rgb(255 255 255 / 0.10) 24%, rgb(255 255 255 / 0.03) 31%, transparent 33%, transparent 70%, rgb(255 255 255 / 0.05) 71%, transparent 75%);
}
.plate {
  position: relative; z-index: 1; padding: 5cqi 5cqi 4cqi; border-radius: 18px 18px 4px 4px;
  background: linear-gradient(180deg, #f3ede1, var(--enamel) 60%, #e6dece);
  color: var(--ink); box-shadow: inset 0 0 0 1px rgb(31 27 23 / 0.25), inset 0 0 0 5px var(--enamel), inset 0 0 0 6px rgb(31 27 23 / 0.35);
}
.plate__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; padding-bottom: 3cqi; }
.plate__make { font-weight: 800; letter-spacing: 0.18em; font-size: clamp(0.9rem, 4cqi, 1.1rem); }
.plate__type { font-size: 11px; font-weight: 500; color: var(--ink-2); }

/* Register: drums in a black window */
.reg { display: flex; align-items: center; gap: 3cqi; }
.reg--main { justify-content: center; }
.reg__window {
  display: inline-flex; gap: 2px; padding: 5px; border-radius: 4px; background: #0d0b09;
  box-shadow: inset 0 3px 8px rgb(0 0 0 / 0.9), 0 0 0 2px #8f857a, 0 0 0 3px #1f1b17;
}
.reg--main .reg__window { --dh: clamp(38px, 13.2cqi, 58px); }
.reg--small .reg__window { --dh: clamp(28px, 8.4cqi, 36px); }
.reg__unit { font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.reg__unit small { font-weight: 500; font-size: 11px; color: var(--ink-2); letter-spacing: 0; }

.drum {
  position: relative; width: calc(var(--dh) * 0.62); height: var(--dh); overflow: hidden; border-radius: 2px;
  background: #171412; color: #f4efe4; font-family: var(--mono); font-weight: 500; font-size: calc(var(--dh) * 0.62);
}
.drum--red { background: var(--red); color: #fff; }
/* the decimal point painted between the last black drum and the red one */
.drum--red::before { content: ""; position: absolute; left: 1px; bottom: 18%; width: 3px; height: 3px; border-radius: 50%; background: #fff; z-index: 2; }
.drum__strip { display: flex; flex-direction: column; transition: transform var(--t3) var(--ease); }
.drum__strip span { height: var(--dh); display: grid; place-items: center; line-height: 1; }
/* cylinder shading over each drum */
.drum::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0.7), rgb(0 0 0 / 0) 30%, rgb(255 255 255 / 0.08) 50%, rgb(0 0 0 / 0) 70%, rgb(0 0 0 / 0.7)); pointer-events: none; }

/* Static drums on the sample bill */
.drums { display: inline-flex; gap: 2px; padding: 3px; border-radius: 3px; background: #0d0b09; }
.drums--sm { --dh: 26px; }
.drums--sm .drum { font-size: 15px; }

/* Disc: seen edge-on through a slot */
.disc { margin: 4cqi 0 3cqi; padding: 2.4cqi; border-radius: 6px; background: #0f0d0b; box-shadow: inset 0 2px 8px rgb(0 0 0 / 0.8); }
.disc__svg { display: block; width: 100%; height: auto; stroke: none; }
.disc__svg #disc-ticks line { stroke-width: 1; }
.disc__legend { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: #cfc6b6; }

.plate__regs { display: flex; justify-content: space-between; gap: 4cqi; flex-wrap: wrap; }
.plate__spec { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: var(--s2) var(--s3); margin: 4cqi 0 0; padding-top: 3cqi; border-top: 1px solid rgb(31 27 23 / 0.3); }
.plate__spec div { min-width: 0; }
.plate__spec dt { font-size: 11px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.plate__spec dd { margin: 0; font-family: var(--mono); font-size: 12px; white-space: nowrap; }

.screw { position: absolute; bottom: -9px; width: 16px; height: 16px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 35%, #e8d6a8, var(--brass) 55%, #6d5424); box-shadow: 0 1px 2px rgb(0 0 0 / 0.6); }
.screw::after { content: ""; position: absolute; inset: 7px 3px; background: #5b451c; border-radius: 1px; transform: rotate(35deg); }
.screw--l { left: 34px; } .screw--r { right: 34px; }

/* Terminal cover with the card holder */
.cover {
  grid-area: cover; position: relative; align-self: start; container-type: inline-size;
  margin: 0 18px; padding: 26px 18px 20px; border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #15120f, #2a241f 18%, var(--bakelite));
  box-shadow: var(--lift-dark);
}
.seal { position: absolute; top: 4px; left: 50%; translate: -50% 0; width: 22px; height: 22px; color: #8f857a; }
.seal svg { width: 22px; height: 22px; }
.card {
  position: relative; padding: var(--s4) var(--s4) var(--s4); border-radius: 3px;
  background: #f8f4ea; color: var(--ink);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 6px 12px -6px rgb(0 0 0 / 0.6);
  background-image: linear-gradient(var(--red) 0 0); background-size: 100% 4px; background-repeat: no-repeat;
}
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s3); flex-wrap: wrap; padding-top: 4px; margin-bottom: var(--s3); }
.card__title { font-weight: 700; font-size: 1rem; }
.card__cycle { font-weight: 500; font-size: var(--fs-s); color: var(--ink-2); }
.card__rec { font-size: 11px; font-weight: 700; color: var(--red-ink); letter-spacing: 0.04em; text-transform: uppercase; }
.card__rec[data-kind="pick"] { color: var(--ink-2); }
.card__lines th, .card__lines td { padding: 5px 0; border-bottom: 1px dotted rgb(31 27 23 / 0.35); vertical-align: top; text-align: left; font-size: var(--fs-s); }
.card__lines th { font-weight: 600; padding-right: var(--s3); }
.card__lines th small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.card__lines td { font-family: var(--mono); text-align: right; white-space: nowrap; }
.card__lines tr.is-tax th, .card__lines tr.is-tax td { color: var(--ink-2); }
.card__total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s3) 0 var(--s2); border-bottom: 2px solid var(--ink); }
.card__total span { font-weight: 700; font-size: var(--fs-s); }
.card__total strong { font-family: var(--mono); font-size: clamp(1.4rem, 7cqi, 1.9rem); font-weight: 700; letter-spacing: -0.02em; }
.card__alt { margin-top: var(--s3); font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.card__alt b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.card__warn { display: flex; gap: var(--s2); align-items: flex-start; margin-top: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r1); background: #f7e1d8; color: #7c1f10; font-size: 12.5px; line-height: 1.45; border: 1px solid #e5b4a3; }
.card__warn svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.btn--card { width: 100%; margin-top: var(--s4); }
.card.is-tick { animation: tick 500ms var(--ease); }

/* ---------- Shared section head ---------- */
.sec { padding: clamp(56px, 8vw, var(--s9)) 0; }
.sec + .sec { border-top: 1px solid var(--enamel-3); }
.sec__head { max-width: 64ch; margin-bottom: clamp(28px, 4vw, var(--s7)); }
.sec__head h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
.sec__head p { margin-top: var(--s4); color: var(--ink-2); }
.sec__head .seg { margin-top: var(--s5); }

/* ---------- 7. Tariffs ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; padding: var(--s6) var(--s5) var(--s5);
  background: #f7f2e7; border: 1.5px solid var(--ink); border-radius: var(--r1);
  /* a printed tariff card: double rule inside the edge */
  box-shadow: inset 0 0 0 4px #f7f2e7, inset 0 0 0 5px var(--enamel-3);
}
.plan--rec { background: #fffaf0; border-width: 2px; box-shadow: inset 0 0 0 4px #fffaf0, inset 0 0 0 5px var(--red), var(--lift); }
.plan__flag {
  display: flex; align-items: center; gap: var(--s2); margin: calc(-1 * var(--s6)) calc(-1 * var(--s5)) var(--s5);
  padding: var(--s2) var(--s5); background: var(--red); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.35;
}
.plan__flag svg { flex: none; width: 16px; height: 16px; }
.plan h3 { font-size: var(--fs-m); letter-spacing: 0.02em; text-transform: uppercase; }
.plan__for { margin-top: var(--s2); color: var(--ink-2); font-size: var(--fs-s); min-height: 3.2em; }
.plan__price { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s5); }
.plan__amt { font-family: var(--mono); font-size: clamp(2.1rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.plan__per { font-size: var(--fs-s); color: var(--ink-2); }
.plan__year { margin-top: var(--s2); font-size: 12.5px; color: var(--ink-2); min-height: 2.8em; }
.plan__year b { color: var(--red-ink); font-weight: 600; }
.plan__list { list-style: none; margin: var(--s5) 0; padding: 0; border-top: 1px solid var(--enamel-3); flex: 1; }
.plan__list li { padding: 9px 0; border-bottom: 1px solid var(--enamel-3); font-size: var(--fs-s); }
.plan__list b { font-family: var(--mono); font-weight: 500; }
.plan__cta { width: 100%; }

.hv {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: center; margin-top: var(--s5);
  padding: var(--s4) var(--s5); border: 1.5px dashed var(--ink-2); border-radius: var(--r1);
}
.hv__icon { width: 24px; height: 24px; color: var(--red-ink); }
.hv p { font-size: var(--fs-s); color: var(--ink-2); max-width: 80ch; }
.hv b { color: var(--ink); }

/* ---------- 8. Comparison ---------- */
.cmp-switch { display: none; }
.cmp { border: 1.5px solid var(--ink); background: #f7f2e7; }
.cmp table { table-layout: fixed; }
.cmp col.c0 { width: 31%; }
.cmp col.c-rec { background: #fffaf0; }
.cmp thead th { position: sticky; top: 64px; z-index: 2; background: var(--ink); color: var(--enamel); text-align: left; padding: var(--s3) var(--s4); font-size: var(--fs-s); letter-spacing: 0.04em; text-transform: uppercase; }
.cmp thead th:nth-child(3) { background: var(--red); color: #fff; }
.cmp th[scope="row"], .cmp td { padding: 10px var(--s4); border-top: 1px solid var(--enamel-3); text-align: left; font-size: var(--fs-s); vertical-align: top; }
.cmp th[scope="row"] { font-weight: 500; color: var(--ink); }
.cmp td { font-family: var(--mono); font-size: 13px; }
.cmp tr.grp th { padding: var(--s5) var(--s4) var(--s2); text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red-ink); border-top: 1.5px solid var(--ink); background: var(--enamel); }
.cmp tbody tr:first-child th { border-top: 0; }
.cmp svg { width: 16px; height: 16px; vertical-align: -3px; }
.cmp svg.yes { color: var(--ink); stroke-width: 2; }
.cmp svg.no { color: var(--ink-2); }

/* ---------- 9. Sample bill ---------- */
.bill { background: var(--enamel-2); }
.bill__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.notes { margin: var(--s5) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s4); counter-reset: n; }
.notes li { position: relative; padding-left: 36px; font-size: var(--fs-s); color: var(--ink-2); counter-increment: n; }
.notes li::before { content: counter(n); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--ink); }
.notes b { color: var(--ink); }
.invoice { background: #fbf8f1; padding: clamp(20px, 3vw, 36px); box-shadow: var(--lift); border-top: 6px solid var(--ink); }
.invoice__head { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); border-bottom: 1px solid var(--enamel-3); }
.invoice__from { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.invoice__meta, .invoice__to p + p { font-size: 12.5px; color: var(--ink-2); font-family: var(--mono); }
.invoice__to { text-align: right; }
.invoice__to p:first-child { font-weight: 600; }
.readings { margin: var(--s4) 0; display: grid; gap: var(--s2); }
.readings__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: var(--fs-s); }
.readings__row--used { padding-top: var(--s2); border-top: 1px dashed var(--enamel-3); font-weight: 600; }
.readings__row--used b { font-size: 1.05rem; }
.invoice__lines th, .invoice__lines td { padding: 9px 0; border-bottom: 1px solid var(--enamel-3); text-align: left; font-size: var(--fs-s); vertical-align: top; }
.invoice__lines thead th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.invoice__lines td { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding-right: var(--s3); }
.invoice__lines td:last-child, .invoice__lines th:last-child { text-align: right; color: var(--ink); padding-right: 0; white-space: nowrap; }
.invoice__lines tbody th { font-weight: 500; padding-right: var(--s3); }
.invoice__lines tfoot th { font-weight: 500; text-align: right; padding-right: var(--s4); }
.invoice__total th, .invoice__total td { font-weight: 700 !important; font-size: 1.05rem !important; border-bottom: 2px solid var(--ink) !important; }
.invoice__foot { margin-top: var(--s4); font-size: 12px; color: var(--ink-2); }

/* ---------- 10. Schedule of charges ---------- */
.sched__t { border: 1.5px solid var(--ink); background: #f7f2e7; }
.sched__t th, .sched__t td { padding: 12px var(--s4); text-align: left; border-top: 1px solid var(--enamel-3); font-size: var(--fs-s); vertical-align: top; }
.sched__t thead th { background: var(--ink); color: var(--enamel); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; border: 0; }
.sched__t tbody th { font-weight: 600; }
.sched__t td { font-family: var(--mono); font-size: 13px; }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); margin-top: var(--s7); }
.terms__b { padding-top: var(--s4); border-top: 2px solid var(--ink); }
.terms__b h3 { font-size: 1rem; }
.terms__b p { margin-top: var(--s3); font-size: var(--fs-s); color: var(--ink-2); }
.terms__b b { color: var(--ink); font-weight: 500; }

/* ---------- 11. Billing questions ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.faq__list details { border-top: 1.5px solid var(--ink); }
.faq__list details:last-child { border-bottom: 1.5px solid var(--ink); }
.faq__list summary { display: flex; justify-content: space-between; gap: var(--s4); align-items: center; padding: var(--s4) 0; font-weight: 600; cursor: pointer; list-style: none; min-height: 44px; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary svg { flex: none; width: 18px; height: 18px; transition: transform var(--t2) var(--ease); }
.faq__list details[open] summary svg { transform: rotate(180deg); }
.faq__list details p { padding: 0 0 var(--s5); color: var(--ink-2); max-width: 66ch; }

/* ---------- 12. Connect a supply ---------- */
.connect { background: var(--enamel-2); }
.connect__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.form__set { border: 0; padding: 0; margin: 0; min-width: 0; }
.form__set legend { font-size: var(--fs-s); font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.pick__o { position: relative; display: grid; gap: 2px; padding: var(--s3); border: 1.5px solid var(--enamel-3); border-radius: var(--r2); background: #f7f2e7; cursor: pointer; transition: border-color var(--t1), background var(--t1); }
.pick__o input { position: absolute; opacity: 0; }
.pick__o span { font-weight: 700; font-size: var(--fs-s); }
.pick__o small { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.pick__o:has(input:checked) { border-color: var(--ink); background: #fffaf0; box-shadow: inset 0 0 0 1px var(--ink); }
.pick__o:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); margin-top: var(--s5); }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: var(--fs-s); font-weight: 600; }
.opt { font-weight: 400; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; min-height: 44px; padding: 10px var(--s3); border: 1.5px solid var(--enamel-3); border-radius: var(--r2); background: #f7f2e7;
  transition: border-color var(--t1);
}
.field textarea { resize: vertical; min-height: 88px; }
.field input::placeholder, .field textarea::placeholder { color: #6e655a; }
.field input:hover, .field textarea:hover, .sel select:hover { border-color: var(--ink-2); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgb(196 54 31 / 0.25); }
.field [aria-invalid="true"] { border-color: var(--red-ink); background: #fbeee8; }
.err { font-size: 12.5px; color: var(--red-ink); font-weight: 500; }
.err:empty { display: none; }
.form__foot { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.form__note { font-size: var(--fs-s); color: var(--ink-2); }
.btn__spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(238 231 216 / 0.35); border-top-color: var(--enamel); animation: spin 800ms linear infinite; }
.is-loading .btn__spin { display: inline-block; }
.alert { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1.5px solid var(--red-ink); border-radius: var(--r2); background: #fbeee8; color: #6d1b0e; font-size: var(--fs-s); max-width: 64ch; }
.alert b { display: block; margin-bottom: 2px; }
.done { padding: var(--s6); background: #fbf8f1; border-top: 6px solid var(--red); box-shadow: var(--lift); max-width: 640px; }
.done:focus { outline: none; }
.done__seal { width: 56px; height: 56px; stroke: none; }
.done h3 { margin-top: var(--s3); font-size: var(--fs-m); }
.done p { margin-top: var(--s3); color: var(--ink-2); }
.done .btn { margin-top: var(--s5); }

.due { position: sticky; top: 88px; padding: var(--s5); background: var(--bakelite); color: var(--on-board); border-radius: var(--r3); box-shadow: var(--lift-dark); }
.due h3 { font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.due__t { margin-top: var(--s4); }
.due__t th, .due__t td { padding: 8px 0; border-bottom: 1px solid #4a4038; text-align: left; vertical-align: top; font-size: var(--fs-s); }
.due__t th { font-weight: 500; padding-right: var(--s3); }
.due__t th small { display: block; font-family: var(--mono); font-size: 11.5px; color: #c9c1b3; font-weight: 400; }
.due__t td { font-family: var(--mono); text-align: right; white-space: nowrap; }
.due__t tr.is-total th, .due__t tr.is-total td { font-weight: 700; font-size: 1.05rem; border-bottom: 0; padding-top: var(--s3); color: #fff; }
.due__next { margin-top: var(--s3); font-size: 12.5px; color: #c9c1b3; line-height: 1.55; }

/* ---------- 13. Footer ---------- */
.foot { background: var(--bakelite); color: #d6cfc2; padding: var(--s8) 0 var(--s6); }
.foot__in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s6); }
.foot__name { font-weight: 800; color: var(--enamel); letter-spacing: 0.08em; text-transform: uppercase; }
.foot__brand p + p { margin-top: var(--s2); font-size: var(--fs-s); }
.foot__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s5); align-content: start; }
.foot__nav a { font-size: var(--fs-s); padding: 6px 0; color: #e7e0d3; }
.foot__small { grid-column: 1 / -1; padding-top: var(--s5); border-top: 1px solid #3a322b; font-size: 12px; color: #b8b0a2; }

/* ---------- 14. Motion ---------- */
@keyframes tick { 0% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- 15. Responsive ---------- */
@media (max-width: 1180px) {
  .nav { display: none; }
  .top .cur { margin-left: auto; }
}
@media (max-width: 1060px) {
  .hero__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "copy copy" "dials case" "dials cover" "key cover"; grid-template-rows: auto auto auto 1fr; }
  .hero__copy { padding-bottom: var(--s6); }
  .hero h1 { max-width: 16ch; }
  .dial__row { grid-template-columns: 1fr; gap: var(--s1); }
  .plans { grid-template-columns: 1fr 1fr; }
  .plan--rec { order: -1; grid-column: 1 / -1; }
  .terms { grid-template-columns: 1fr; gap: var(--s5); }
  .connect__grid { grid-template-columns: minmax(0, 1fr); }
  .due { position: static; max-width: 560px; }
  .pick { grid-template-columns: 1fr 1fr; }
  .bill__grid, .faq__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .top__in { gap: var(--s3); }
  .top .btn { display: none; }
  .hero__in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "case" "dials" "cover" "key"; grid-template-rows: none; row-gap: 0; }
  .key { margin-top: var(--s6); }
  .meter__case { margin-bottom: var(--s6); }
  .dials { margin-bottom: var(--s6); max-width: none; }
  .cover { margin: 0; border-radius: var(--r3); padding-top: 30px; }
  .dial__row { grid-template-columns: 130px minmax(0, 1fr); gap: var(--s3); }
  .seg button { padding: 0 var(--s2); }
  .plans { grid-template-columns: 1fr; }
  .hv { grid-template-columns: 1fr; }
  .hv__icon { display: none; }
  /* comparison: feature column plus the one tariff chosen in the switch */
  .cmp-switch { display: flex; gap: var(--s1); margin-bottom: var(--s3); padding: 3px; background: var(--enamel-2); border: 1px solid var(--enamel-3); border-radius: var(--r2); position: sticky; top: 70px; z-index: 3; }
  .cmp-switch button { flex: 1; min-height: 40px; border: 0; border-radius: 4px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .cmp-switch button[aria-selected="true"] { background: var(--ink); color: var(--enamel); }
  .cmp col.c0 { width: 50%; }
  .cmp thead th { top: 0; position: static; }
  .cmp[data-col="1"] :is(th, td):is(:nth-child(3), :nth-child(4)):not([colspan]),
  .cmp[data-col="2"] :is(th, td):is(:nth-child(2), :nth-child(4)):not([colspan]),
  .cmp[data-col="3"] :is(th, td):is(:nth-child(2), :nth-child(3)):not([colspan]) { display: none; }
  .cmp table { table-layout: auto; }
  .sched__t thead { display: none; }
  .sched__t, .sched__t tbody, .sched__t tr, .sched__t th, .sched__t td { display: block; }
  .sched__t tr { padding: var(--s3) var(--s4); border-top: 1px solid var(--enamel-3); }
  .sched__t tr:first-child { border-top: 0; }
  .sched__t th, .sched__t td { padding: 3px 0; border: 0; }
  .sched__t th { font-size: 1rem; margin-bottom: var(--s1); }
  .sched__t td::before { content: attr(data-label) ": "; font-family: var(--sans); font-weight: 600; color: var(--ink-2); font-size: 12px; }
  .invoice__lines thead { display: none; }
  .invoice__lines, .invoice__lines tbody, .invoice__lines tfoot { display: block; }
  .invoice__lines tfoot tr { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); border-bottom: 1px solid var(--enamel-3); padding: 8px 0; }
  .invoice__lines tfoot th, .invoice__lines tfoot td { border: 0 !important; padding: 0; text-align: left; }
  .invoice__lines tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s3); border-bottom: 1px solid var(--enamel-3); padding: 8px 0; }
  .invoice__lines tbody th, .invoice__lines tbody td { border: 0; padding: 0; }
  .invoice__lines tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 11.5px; margin-top: 2px; }
  .invoice__lines tbody td:last-child { grid-row: 1; grid-column: 2; }
  .invoice__to { text-align: left; }
  .form__grid { grid-template-columns: 1fr; }
  .foot__in { grid-template-columns: 1fr; }
}
@container (max-width: 400px) {
  .plate__spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plate__spec dd { white-space: normal; }
}
@media (max-width: 420px) {
  .dial--pair { grid-template-columns: 1fr; }
  .top .cur button { padding: 0 var(--s2); }
}
