/* design: v2 */
/* wholehomebackupbattery.com, design v2 B (James's pick, 2 Dec 2026): "the garage wall at night" (design/home-v2-B.png).
   A rendered garage wall under a work lamp (renders/garage.py); the home sits on the charcoal of the garage at night, the
   tool is an umber band of switches, each battery's answer is a paper receipt with dotted leaders. Inner pages are paper.
   Fonts: Schibsted Grotesk (headings) and Libre Franklin (text). Colours from the board: charcoal #252628, umber #6b5548,
   lamp amber #c89242, paper #eee5d6, receipt red #a53b35. */

@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/schibsted-grotesk-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/schibsted-grotesk-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url(/fonts/libre-franklin-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url(/fonts/libre-franklin-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url(/fonts/libre-franklin-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --brand: #6b5548;
  --charcoal: #252628;
  --charcoal-deep: #1b1c1e;
  --umber: #6b5548;
  --umber-deep: #54423a;
  --amber: #c89242;
  --amber-light: #e3ab5a;
  --paper: #efe1ca;
  --receipt: #f4ecdf;
  --red: #a53b35;
  --bg: #efe1ca;
  --text: #29241f;
  --muted: #5d534b;
  --line: #cbbca6;
  --card: #f6f0e6;
  --link: #6b3f22;
  --on-dark: #eee5d6;
  --on-dark-muted: #cdc2b1;
  --np: #a53b35;
  --ink: #29241f;
  --ink-muted: #5d534b;
  --ink-link: #6b3f22;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2022;
    --text: #eee5d6;
    --muted: #c5baa9;
    --line: #48433d;
    --card: #2b2c2e;
    --link: #e3ab5a;
    --np: #f0958b;
  }
}

body { background: var(--bg); color: var(--text); font-family: "Libre Franklin", system-ui, sans-serif; }
h1, h2, h3, .wordmark { font-family: "Schibsted Grotesk", "Libre Franklin", sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h1 { line-height: 1.08; }
strong { font-weight: 700; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header and footer: the garage ---------- */
.site-header { background: var(--charcoal); border-bottom: 3px solid var(--amber); color: var(--on-dark); }
.site-header .brand { color: var(--on-dark); gap: 10px; }
.brand svg.logo-mark { height: 34px; width: auto; }
.wordmark { font-size: 1.3rem; line-height: 1.1; color: var(--on-dark); }
.main-nav a { color: var(--on-dark); font-weight: 600; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.menu-btn { color: var(--on-dark) !important; border-color: rgba(238, 229, 214, 0.5) !important; }
.has-menu.menu-open .main-nav a { border-top-color: rgba(238, 229, 214, 0.18); }
.site-header .wrap, .site-footer .wrap { max-width: 1240px; }
.site-footer { background: var(--charcoal-deep); color: var(--on-dark-muted); border-top: 0; margin-top: 0; }
.site-footer a, .site-footer .footer-note, .site-footer p, .site-footer h2, .site-footer h3 { color: var(--on-dark-muted); }
.site-footer a:hover { color: var(--amber-light); }

/* ---------- home: the garage at night ---------- */
.garage { background: var(--charcoal); color: var(--on-dark); padding-bottom: 56px; }
.garage a { color: var(--amber-light); }
.hero { position: relative; }
.hero-render img { display: block; width: 100%; height: clamp(260px, 30vw, 430px); object-fit: cover; object-position: 50% 34%; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none;
  background: linear-gradient(180deg, rgba(37, 38, 40, 0) 0%, rgba(37, 38, 40, 0.78) 55%, var(--charcoal) 100%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1; text-align: center; padding: 0 20px; }
.hero h1 { color: #f7efe2; font-size: clamp(1.9rem, 3vw, 2.7rem); margin: 0 auto 0.3em; max-width: 26em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55); }
.hero .lede { color: var(--on-dark); font-size: 1.08rem; max-width: 48em; margin: 0 auto; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }

.tool-band, .answer-panel, .lower, .spot-row { max-width: 1240px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
.tool-band { margin-top: 18px; }

/* ---------- the tool: an umber band of switches ---------- */
.cost-form {
  display: grid; grid-template-columns: 262px minmax(0, 1fr) 190px; gap: 16px 20px; align-items: start;
  background: rgba(107, 85, 72, 0.9); color: var(--on-dark); border: 1px solid rgba(238, 229, 214, 0.12); border-radius: 12px;
  padding: 18px 20px; margin: 0; box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}
.cost-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cost-form .row { display: grid; gap: 6px; padding-right: 20px; border-right: 1px solid rgba(238, 229, 214, 0.22); }
.cost-form .row label { font-weight: 600; font-size: 0.92rem; }
.cost-form .row label + select, .cost-form .row label + input { margin-bottom: 8px; }
.cost-form select, .cost-form .row input { font: inherit; padding: 8px 10px; margin: 0; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); max-width: 100%; }
.cost-form .row input { width: 6rem; }
.cost-form select { font-size: 0.92rem; padding-left: 8px; padding-right: 4px; }
.cost-form input::placeholder { color: #9b8d7d; opacity: 1; }
.cost-form .loads legend { font-family: "Schibsted Grotesk", sans-serif; font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: 8px; color: var(--on-dark); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 7px; align-items: start; }
/* A load's watts and hours open only while it is switched on: the strip stays one tidy row of switches, as on the board */
.chip:has(.toggle:not(:checked)) .chip-fields, .chip:has(.toggle:not(:checked)) .chip-qty { display: none; }
.chip { background: var(--paper); color: var(--ink); border-radius: 8px; padding: 8px 6px 7px; text-align: center; display: grid; gap: 5px; align-content: start; }
.cost-form .chip-switch { display: grid; justify-items: center; gap: 2px; cursor: pointer; margin: 0; font-weight: 400; }
.chip-name, .chip-watts { display: block; }
.chip-name { font-weight: 700; font-size: 0.88rem; line-height: 1.15; }
.chip-watts { font-size: 0.78rem; color: var(--ink-muted); }
.cost-form .toggle { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; padding: 0; border: 0; flex: none; border-radius: 999px; background: #a89a88; position: relative; margin: 4px 0 0; cursor: pointer; transition: background 0.15s; }
.cost-form .toggle::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.cost-form .toggle:checked { background: #2f6b3f; }
.cost-form .toggle:checked::before { transform: translateX(18px); }
.cost-form .toggle:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.chip-fields { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.cost-form .chip-field input::-webkit-inner-spin-button, .cost-form .chip-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cost-form .chip-field { display: inline-flex; margin: 0; font-weight: 400; align-items: center; gap: 3px; font-size: 0.72rem; color: var(--ink-muted); }
.cost-form .chip-field input { font: inherit; font-size: 0.8rem; width: 2.6rem; padding: 3px 3px; -moz-appearance: textfield; appearance: textfield; margin: 0; border: 1px solid #cbbca6; border-radius: 4px; background: #fffaf2; color: var(--ink); }
.cost-form .chip-qty { justify-content: center; }
.cost-form .chip-qty input { width: 3rem; }
.cost-form .hint { font-size: 0.85rem; color: var(--on-dark-muted); margin: 8px 0 0; opacity: 1; }
.go-col { padding-left: 20px; border-left: 1px solid rgba(238, 229, 214, 0.22); align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.go { margin: 0; }
.go-btn { width: 100%; background: var(--amber); color: #221810; font-family: "Schibsted Grotesk", sans-serif; font-size: 1.05rem; font-weight: 800; padding: 14px 12px; border-radius: 8px; box-shadow: 0 3px 0 #9a6c2a; }
.go-btn:hover { background: var(--amber-light); color: #221810; }
.loss { font-size: 0.85rem; }
.loss summary { cursor: pointer; font-weight: 600; color: var(--on-dark); }
.loss p { color: var(--on-dark-muted); }
.cost-form .loss input { width: 4rem; font: inherit; padding: 4px 6px; margin: 0; border: 0; border-radius: 4px; background: var(--paper); color: var(--ink); }

/* ---------- the answer: receipts ---------- */
.answer-panel { margin-top: 18px; }
.cost-answer { color: var(--on-dark); }
.answer-head { display: flex; gap: 10px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 4px; }
.answer-head .need-line { margin: 0; font-family: "Schibsted Grotesk", sans-serif; font-weight: 700; font-size: clamp(1.1rem, 1.8vw, 1.4rem); flex: 1 1 24rem; color: #f7efe2; }
.answer-head .share { margin: 0; }
.share-btn { background: transparent; color: var(--on-dark); border: 1.5px solid rgba(238, 229, 214, 0.7); font-weight: 600; }
.share-btn::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; background: currentColor;
  -webkit-mask: radial-gradient(circle at 80% 20%, #000 2.4px, #0000 2.6px), radial-gradient(circle at 20% 50%, #000 2.4px, #0000 2.6px), radial-gradient(circle at 80% 80%, #000 2.4px, #0000 2.6px), linear-gradient(150deg, #0000 47%, #000 47% 53%, #0000 53%) 0 0 / 100% 50% no-repeat, linear-gradient(30deg, #0000 47%, #000 47% 53%, #0000 53%) 0 100% / 100% 50% no-repeat;
  mask: radial-gradient(circle at 80% 20%, #000 2.4px, #0000 2.6px), radial-gradient(circle at 20% 50%, #000 2.4px, #0000 2.6px), radial-gradient(circle at 80% 80%, #000 2.4px, #0000 2.6px), linear-gradient(150deg, #0000 47%, #000 47% 53%, #0000 53%) 0 0 / 100% 50% no-repeat, linear-gradient(30deg, #0000 47%, #000 47% 53%, #0000 53%) 0 100% / 100% 50% no-repeat; }
.share-btn:hover { background: rgba(238, 229, 214, 0.12); color: #fff; }
.share-status { color: var(--on-dark-muted); }
.answers-title { font-size: 1.05rem; font-weight: 700; color: var(--on-dark-muted); margin: 14px 0 10px; }
.receipts { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 16px; align-items: start; }
.receipt {
  --z: 7px;
  background: var(--receipt); color: var(--ink); padding: 16px 18px calc(18px + var(--z)); font-size: 0.92rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
}
.receipt h3 { margin: 0 0 6px; font-size: 1.2rem; line-height: 1.15; }
.receipt h3 a { color: var(--ink); text-decoration: none; }
.receipt h3 a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.receipt p { margin: 0 0 6px; }
.receipt a { color: var(--ink-link); }
.fit-no { color: var(--red); font-weight: 600; }
.kit { color: #5d534b; font-size: 0.86rem; }
.status { color: var(--red); font-weight: 700; font-size: 0.85rem; }
.lines { list-style: none; margin: 8px 0; padding: 0; }
.lines li { display: flex; align-items: flex-end; gap: 6px; margin: 0 0 4px; line-height: 1.35; }
.lines .l { flex: 0 1 auto; }
.lines .dots { flex: 1 0 14px; border-bottom: 2px dotted #9d8d7b; margin-bottom: 0.32em; }
.lines .v { flex: none; text-align: right; white-space: nowrap; }
.lines .total-line { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #9d8d7b; font-size: 1.02rem; }
.lines .elec-line { font-size: 0.85rem; }
.receipt .np { color: var(--red); font-weight: 700; }
.sold-out { color: var(--red); font-size: 0.85rem; }
.np-why { font-size: 0.84rem; color: #5d534b; }
.answer-src, .shop { font-size: 0.82rem; color: #5d534b; }
.shop a { font-weight: 700; }
.receipt .uk-line { color: var(--red); font-size: 0.84rem; font-weight: 600; margin: 8px 0 0; }
.receipt .uk-line a { color: var(--red); }
.np { color: var(--np); font-weight: 700; }
.uncounted { background: rgba(165, 59, 53, 0.18); color: #f6d4cf; border-radius: 8px; padding: 8px 12px; }
.not-sold { font-size: 0.92rem; color: var(--on-dark-muted); margin-top: 14px; }
.workings { margin-top: 14px; }
.workings summary { cursor: pointer; font-weight: 600; color: var(--amber-light); }
.workings p { font-size: 0.92rem; color: var(--on-dark-muted); }
.guess { font-style: italic; font-size: 0.85rem; opacity: 0.8; }
.electrician { border-left: 4px solid var(--amber); padding: 6px 0 6px 12px; font-weight: 600; font-size: 0.95rem; }
.answer-link { font-size: 0.9rem; }

/* ---------- home: below the answer ---------- */
.lower { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 24px; align-items: start; margin-top: 40px; border-top: 1px solid rgba(201, 146, 66, 0.55); padding-top: 28px; }
.models-panel h2, .sticker h2, .spot-card h2 { margin: 0 0 12px; color: #f7efe2; }
.models-panel h2 { font-size: 1.6rem; }
.models-panel .source { color: var(--on-dark-muted); }
.garage table.models { background: var(--receipt); color: var(--ink); }
.garage table.models a { color: var(--ink-link); }
.garage table.models .np, .garage table.models .note { color: var(--red); }
.garage table.models .note { color: var(--ink-muted); }
.sticker { background: var(--umber); color: var(--on-dark); border-radius: 10px; padding: 20px 22px; }
.sticker h2 { font-size: 1.45rem; }
.sticker a { color: #fff; }
.sticker-foot { font-size: 0.88rem; color: var(--on-dark-muted); border-top: 1px solid rgba(238, 229, 214, 0.25); padding-top: 10px; margin-bottom: 0; }
.spot-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; align-items: start; }
.spot-card { background: #2f3033; border-radius: 10px; overflow: hidden; padding-bottom: 14px; }
.spot-card img { display: block; width: 100%; height: 190px; object-fit: cover; }
.spot-card h2 { font-size: 1.2rem; margin: 14px 16px 6px; }
.spot-card p, .spot-card ul { margin: 0 16px; color: var(--on-dark-muted); font-size: 0.93rem; }
.spot-card ul { padding-left: 1.1rem; }
.spot-card li { margin-bottom: 5px; }

/* ---------- tables ---------- */
table.models, table.need-table, table.prices, table.specs, table.kits { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 0.92rem; }
table.models th, table.models td, table.need-table th, table.need-table td, table.prices th, table.prices td,
table.specs th, table.specs td, table.kits th, table.kits td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.models thead th, table.need-table thead th, table.prices thead th, table.specs thead th, table.kits thead th {
  background: var(--umber); color: var(--paper); font-weight: 600; border-bottom: 0;
}
table.models tbody th, table.specs tbody th, table.need-table tfoot th { background: transparent; font-weight: 700; }
table.specs tbody th { white-space: nowrap; }
.garage table.models th, .garage table.models td { border-bottom-color: #d6c8b3; }
.cost-answer table.need-table { background: var(--receipt); color: var(--ink); }
.source, .note { color: var(--muted); font-size: 0.86rem; }

/* ---------- inner pages: paper ---------- */
.article-wrap { max-width: 1100px; }
.page-head.has-art { gap: 28px; }
.page-head-art { width: clamp(170px, 28vw, 320px); }
.head-spot { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 10px 24px rgba(37, 38, 40, 0.25); }
.page-head h1 { color: var(--text); }
.byline { color: var(--muted); }
.page-body h2 { font-size: 1.55rem; }
.page-body h3 { font-size: 1.15rem; }
.market { margin: 26px 0; }
.market-uk { background: var(--card); border-left: 4px solid var(--amber); border-radius: 0 10px 10px 0; padding: 4px 18px 14px; }
.callout { background: var(--card); border-left: 4px solid var(--red); color: var(--text); }
.share { margin-top: 1.25rem; }
.page-body .share-btn { background: var(--umber); color: var(--paper); border-color: var(--umber); }
.page-body .share-btn:hover { background: var(--umber-deep); color: #fff; }
.page-body .electrician { margin: 18px 0; }
.share-box { display: block; width: 100%; margin-top: 0.4rem; font: inherit; }

/* /cost: the same garage band and receipts, with a plain head */
.cost-head { max-width: 1240px; margin: 0 auto; padding: 30px 20px 4px; }
.cost-head h1 { color: #f7efe2; font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0 0 6px; }
.cost-head p { color: var(--on-dark-muted); margin: 0; }

@media (prefers-color-scheme: dark) {
  .head-spot { box-shadow: none; }
  table.models thead th, table.prices thead th, table.specs thead th, table.kits thead th { background: var(--umber-deep); }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1060px) {
  .cost-form { grid-template-columns: minmax(0, 1fr); }
  .cost-form .row { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-right: 0; border-right: 0; padding-bottom: 14px; border-bottom: 1px solid rgba(238, 229, 214, 0.22); }
  .cost-form .row label + select, .cost-form .row label + input { margin-bottom: 0; }
  .go-col { padding-left: 0; border-left: 0; }
  .lower { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hero-render img { height: auto; aspect-ratio: 1200 / 760; }
  .hero::after { height: 40%; }
  .hero-text { position: relative; bottom: auto; margin-top: -48px; }
  .hero h1 { font-size: 1.9rem; }
  .hero .lede { font-size: 1rem; }
  .spot-row { grid-template-columns: minmax(0, 1fr); }
  .spot-card img { height: 170px; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 1.02rem; }
  .brand svg.logo-mark { height: 28px; }
  .tool-band, .answer-panel, .lower, .spot-row { padding-left: 12px; padding-right: 12px; }
  .cost-form { padding: 14px 12px; }
  .cost-form .row { grid-template-columns: minmax(0, 1fr); }
  .cost-form select { width: 100%; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip-field input { width: 3rem; }
  .page-head.has-art .page-head-art { width: 100%; order: 2; }
  .page-head-art .head-spot { height: 140px; width: 100%; object-fit: cover; object-position: 50% 45%; }
  .cost-head { padding-left: 12px; padding-right: 12px; }
}
