/* design: v2 */
/* fridgebatterybackup.com: design v2 board A, "the fridge that kept humming" (design/home-v2-A.png, picked by James on
   2 Dec 2026). A picture-book kitchen on a storm night: storm violet (the header, the hero and the kitchen), the fridge
   light's ice blue, candle amber, tomato red, mint, and a dark ink for text on light panels. The board's own fonts were
   taken by other sites, so headings are Zen Maru Gothic (rounded, friendly) and text Be Vietnam Pro (both OFL,
   self-hosted). The illustrations are ours, flat SVG in /img/art/. Dark mode: the reading surfaces go dark, while the
   kitchen (the tool on its fridge-door panel and the answer) keeps its own fixed colours, as a lit kitchen at night.
   Every text/background pair is checked for contrast in both modes by tests/design.test.ts. */

@font-face { font-family: "Zen Maru Gothic"; src: url("/fonts/zen-maru-gothic-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("/fonts/zen-maru-gothic-900.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/be-vietnam-pro-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/be-vietnam-pro-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/be-vietnam-pro-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --brand: #352e86;       /* storm violet: header, hero, the runtime page's head */
  --brand-deep: #2a1f57;
  --on-brand: #ffffff;
  --on-brand-muted: #ddd6fa;
  --kitchen: #4b3d8f;     /* the cabinets the tool sits on */
  --bg: #e6dcfa;          /* the reading surface: pale lavender, the colour of the storm sky through the window */
  --card: #ffffff;
  --text: #1f1a3d;
  --muted: #514a70;
  --line: #d9d3ee;
  --link: #4632a0;
  --btn: #c63b3b;         /* tomato, deep enough for white text */
  --btn-hover: #a82f2f;
  --btn-text: #ffffff;
  --np: #8a2459;          /* "not published" */
  --np-bg: #fbe3ef;
  --bar: #2f8f6b;
  --head-bg: #ffe8c7;     /* the inner page head: candlelight */
  --head-text: #1f1a3d;
  --th-bg: #d8edff;       /* table heads: the fridge light */
  --th-text: #1f1a3d;
  --quote-bg: #fff1d6;
  --spark: #e9a23b;
  /* fixed: the kitchen and its panels look the same by day and by night */
  --ink: #1f1a3d;
  --ink-muted: #4a4366;
  --door: #e3f1ff;
  --door-edge: #a9c8ec;
  --panel: #fbfaff;
  --panel-line: #d6d0ec;
  --panel-link: #4632a0;
  --mint: #a8e6cf;
  --amber: #ffc66e;
  --pill: #ffe3a6;
  --footer-bg: #2a1f57;
  --on-footer: #f4f1fb;
  --footer-muted: #d3cbf2;
  --footer-head: #ffc66e;
  --display: "Zen Maru Gothic", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17132b;
    --card: #221c3f;
    --text: #f1eeff;
    --muted: #c6bfe6;
    --line: #3b3366;
    --link: #c3b6ff;
    --np: #ffb3d6;
    --np-bg: #3d1b31;
    --bar: #6fd3a8;
    --head-bg: #2e2558;
    --head-text: #f1eeff;
    --th-bg: #2b3a5c;
    --th-text: #f1eeff;
    --quote-bg: #3a2f22;
    --spark: #ffc66e;
    color-scheme: dark;
  }
}

body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; }
h1, h2, h3, .wordmark, .panel-title { font-family: var(--display); font-weight: 900; letter-spacing: -0.005em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
a { color: var(--link); }
::selection { background: #ffc66e; color: #1f1a3d; }
.wrap.wide { max-width: 1240px; padding: 0 clamp(16px, 3vw, 32px); }

/* ---------- header: on the storm wall ---------- */
.site-header { background: var(--brand); border-bottom: 0; }
.header-row { padding-top: 12px; padding-bottom: 12px; max-width: 1240px; }
.brand { color: var(--ink); }
.logo-pill { display: inline-flex; align-items: center; gap: 8px; background: #ffffff; color: #1f1a3d; border-radius: 999px; padding: 5px 16px 5px 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.logo-mark { width: 36px; height: 30px; display: block; }
.wordmark { font-size: 1.12rem; color: #1f1a3d; }
.main-nav { gap: 6px 8px; }
.main-nav a { color: var(--on-brand); font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.main-nav a:hover { color: var(--on-brand); background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.main-nav a[aria-current="page"] { background: var(--mint); color: #1f1a3d; text-decoration: none; }
.menu-btn { background: #ffffff; color: #1f1a3d; border: 0; border-radius: 999px; padding: 7px 16px; font: 600 0.95rem var(--sans); }
@media (max-width: 760px) {
  .has-menu.js-menu.menu-open .main-nav { background: var(--brand-deep); border-radius: 14px; padding: 8px; }
  .has-menu.menu-open .main-nav a { color: var(--on-brand); }
  .has-menu.menu-open .main-nav a[aria-current="page"] { color: #1f1a3d; }
}

/* ---------- the hero: the kitchen on a storm night ---------- */
.page-home main, .page-runtime main { min-height: 0; }
.hero { position: relative; background: var(--brand); color: var(--on-brand); overflow: hidden; }
.hero-text { position: relative; z-index: 1; padding: 28px clamp(16px, 4vw, 48px) 8px; max-width: 640px; }
.hero h1 { font-size: clamp(2.1rem, 3.7vw, 3.5rem); line-height: 1.08; margin: 0 0 0.4em; color: var(--on-brand); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.hero .lede { color: var(--on-brand-muted); font-size: clamp(1.05rem, 1.25vw, 1.2rem); line-height: 1.55; margin: 0; max-width: 34em; }
.hero-scene { display: block; width: 100%; height: clamp(240px, 62vw, 460px); object-fit: cover; object-position: 97% 100%; margin-top: 12px; }
@media (min-width: 1080px) {
  .hero { aspect-ratio: 1440 / 680; }
  .hero-scene { position: absolute; inset: 0; height: 100%; margin: 0; object-fit: cover; object-position: 50% 100%; }
  .hero-text { position: absolute; top: 0; left: 0; width: 41%; max-width: none; padding: clamp(28px, 3.2vw, 56px) 0 0 clamp(32px, 4.4vw, 72px); }
}
.hero-short { background: var(--brand); }
.hero-short .hero-text { position: static; width: auto; max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 24px; }
.hero-short h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.page-runtime .hero { aspect-ratio: auto; }

/* ---------- the kitchen: the tool on its fridge door, the answer beside it ---------- */
.kitchen {
  --text: var(--ink); --muted: var(--ink-muted); --line: var(--panel-line); --link: var(--panel-link); --card: #ffffff; --bg: #ffffff;
  --np: #8a2459; --np-bg: #fbe3ef; --bar: #2f8f6b; --th-bg: #d8edff; --th-text: #1f1a3d;
  background: var(--kitchen); color: var(--ink); padding: 0 0 40px;
}
.kitchen-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
@media (min-width: 1080px) {
  .kitchen-grid { grid-template-columns: minmax(0, 4.3fr) minmax(0, 7.7fr); align-items: start; margin-top: -5.2vw; position: relative; z-index: 2; }
}
.door-panel {
  position: relative; background: linear-gradient(100deg, #d6e9fd 0%, var(--door) 40%, #f1f8ff 100%); border: 3px solid var(--door-edge);
  border-radius: 28px; padding: 22px 22px 22px 58px; box-shadow: 0 10px 0 rgba(20, 12, 60, 0.35);
}
.door-panel::before {
  content: ""; position: absolute; left: 18px; top: 22%; width: 14px; height: 46%; border-radius: 8px;
  background: linear-gradient(90deg, #8fa0c8, #f4f7fe 45%, #9aabd2); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.runtime-form.tool { background: none; border: 0; padding: 0; margin: 0; color: var(--ink); }
.panel-title { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.35rem; margin: 0 0 14px; color: var(--ink); text-align: center; }
.spark { flex: none; width: 22px; height: 20px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 20'%3E%3Cg stroke='%23e9a23b' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M16 3L19 1M17 10H21M16 17L19 19M3 10h8'/%3E%3C/g%3E%3C/svg%3E"); transform: scaleX(-1); }
.spark-r { transform: none; }
.runtime-form fieldset { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.runtime-form legend { font-family: var(--display); font-weight: 900; font-size: 1rem; margin-bottom: 6px; color: var(--ink); }
.runtime-form label { font-weight: 600; font-size: 0.95rem; color: var(--ink); margin-top: 4px; }
.runtime-form select, .runtime-form input[type="number"] {
  font: inherit; font-size: 1rem; width: 100%; padding: 9px 12px; border: 2px solid #b9cbe6; border-radius: 12px;
  background: #ffffff; color: #1f1a3d; margin: 0;
}
.runtime-form input[type="number"] { max-width: 11rem; }
.runtime-form select:focus, .runtime-form input:focus { outline: 3px solid #ffc66e; outline-offset: 1px; }
.runtime-form .hint { color: var(--ink-muted); font-size: 0.9rem; font-weight: 400; }
.runtime-form details { font-size: 0.92rem; color: var(--ink-muted); margin: 6px 0 4px; }
.runtime-form summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.btn { background: var(--btn); color: var(--btn-text); border-radius: 999px; font-family: var(--sans); font-weight: 700; padding: 12px 22px; box-shadow: 0 4px 0 #7f2323; }
.btn:hover { background: var(--btn-hover); color: var(--btn-text); }
.runtime-form button[type="submit"] { width: 100%; font-size: 1.08rem; }

.answer-panel { background: var(--panel); border: 3px solid #cfc8ec; border-radius: 26px; padding: 18px 20px 14px; box-shadow: 0 10px 0 rgba(20, 12, 60, 0.35); min-width: 0; }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.answer-head h2 { margin: 0; font-size: 1.28rem; color: var(--ink); }
.answer-head .share-btn { background: var(--mint); color: #1f1a3d; box-shadow: 0 3px 0 #6fae95; padding: 7px 16px; font-size: 0.95rem; }
.answer-head .share-btn:hover { background: #91dbbf; color: #1f1a3d; }
.basis { color: var(--ink-muted); font-size: 0.92rem; margin: 4px 0 6px; }
.answers-title { font-size: 1rem; margin: 10px 0 4px; color: var(--ink-muted); }
.answers { display: grid; gap: 0; }
.answer { display: grid; gap: 4px 16px; grid-template-columns: minmax(0, 1fr); padding: 12px 0; border-top: 2px dashed var(--panel-line); }
.answer h3 { margin: 0; font-size: 1.08rem; line-height: 1.2; }
.answer h3 a { color: var(--ink); text-decoration: none; }
.answer h3 a:hover { text-decoration: underline; }
.answer p { margin: 2px 0; }
@media (min-width: 720px) { .answer { grid-template-columns: 9.5rem minmax(0, 1fr) 12rem; } }
.a-side { font-size: 0.88rem; color: var(--ink-muted); }
.a-side .uk-line { font-size: 0.88rem; }
.a-side .shop { margin-top: 6px; }
.answer table.steps { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin: 0; }
.answer table.steps th, .answer table.steps td { border: 0; padding: 3px 6px 3px 0; background: none; }
.answer table.steps thead th { font-size: 0.78rem; color: var(--ink-muted); font-weight: 600; }
.answer table.steps td:nth-child(3) { width: 44%; }
.answer table.steps td:nth-child(1), .answer table.steps td:nth-child(2), .answer table.steps td:nth-child(4) { white-space: nowrap; }
.answer table.steps strong { font-weight: 700; white-space: nowrap; }
.bar { display: block; height: 10px; border-radius: 6px; background: var(--bar); margin: 3px 0 2px; max-width: 100%; }
.np { color: var(--np); background: var(--np-bg); font-weight: 600; padding: 0 8px; border-radius: 999px; white-space: nowrap; }
.note, .source, .status, .typical, .hint, .uk-line { color: var(--muted); font-size: 0.9rem; }
.status { font-weight: 600; color: var(--text); }
.a-side .status { font-size: 0.86rem; background: #eeeaff; border-radius: 10px; padding: 6px 9px; margin: 0 0 8px; }
.fit-no { color: #6b2222; background: #f8e6e6; padding: 6px 10px; border-radius: 10px; font-size: 0.92rem; }
.how { font-size: 0.9rem; color: var(--ink-muted); margin: 12px 0 6px; }
.food-line { background: var(--pill); color: #1f1a3d; border-radius: 16px; padding: 8px 14px 8px 40px; font-size: 0.95rem; position: relative; margin: 8px 0; }
.food-line::before { content: "i"; position: absolute; left: 12px; top: 9px; width: 20px; height: 20px; border-radius: 50%; background: #1f1a3d; color: #ffe3a6; font: 700 0.8rem/20px var(--sans); text-align: center; }
.food-line a { color: #4632a0; }
.not-sold { font-size: 0.92rem; color: var(--ink-muted); }
.share { margin-top: 1.1rem; }
.share-link { margin-right: 0.75rem; }
.share-box { display: block; width: 100%; margin-top: 0.4rem; font: inherit; }
.runtime-answer .typical-table { font-size: 0.93rem; margin: 6px 0; }

/* ---------- the comparison table and the notes under it ---------- */
.compare { padding: 44px 0 8px; }
.sparked, .page-body h2 { display: flex; align-items: center; gap: 10px; }
.sparked::before, .sparked::after, .page-body h2::before { content: ""; flex: none; width: 22px; height: 20px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 20'%3E%3Cg stroke='%23e9a23b' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M16 3L19 1M17 10H21M16 17L19 19M3 10h8'/%3E%3C/g%3E%3C/svg%3E"); }
.sparked::before, .page-body h2::before { transform: scaleX(-1); }
.table-scroll { overflow-x: auto; }
table.models, table.specs, table.prices, table.typical-table, table.steps.wide, .page-body table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--card); border: 2px solid var(--line); border-radius: 16px; }
.table-scroll > table { min-width: 34rem; }
table.models thead th:first-child, .page-body table thead th:first-child { border-top-left-radius: 14px; }
table.models thead th:last-child, .page-body table thead th:last-child { border-top-right-radius: 14px; }
table.models th, table.models td, .page-body table th, .page-body table td { border-bottom: 1px solid var(--line); padding: 9px 12px; }
table.models thead th, .page-body table thead th, .runtime-answer .typical-table thead th { background: var(--th-bg); color: var(--th-text); font-weight: 700; font-size: 0.92rem; }
table.models tbody th, .page-body table tbody th { background: none; color: var(--text); }
table.models tr:last-child > *, .page-body table tr:last-child > * { border-bottom: 0; }
.more { padding: 24px 0 56px; }
.more-grid { display: grid; gap: 28px 36px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .more-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.more-item .spot { display: block; width: 120px; height: auto; margin-bottom: -6px; }
.more-item h2 { margin-top: 0.4em; font-size: 1.4rem; }

/* ---------- inner pages: a candlelit head with its spot illustration ---------- */
.page-head { background: var(--head-bg); color: var(--head-text); border-radius: 26px; padding: 22px clamp(18px, 3vw, 32px) 14px; margin-bottom: 22px; max-width: none; }
.page-head h1 { color: var(--head-text); font-size: clamp(1.9rem, 4vw, 2.6rem); }
.page-head .lede, .page-head .byline, .page-head .byline a { color: var(--head-text); }
.page-head .byline { opacity: 0.85; }
.page-head-art { width: clamp(110px, 20vw, 200px); }
.page-body { max-width: 760px; }
.page-body h2 { font-size: 1.45rem; }
blockquote { margin: 0.9rem 0; padding: 14px 18px; background: var(--quote-bg); border: 0; border-radius: 16px; color: var(--text); font-size: 1.05rem; }
blockquote p { margin: 0.3em 0; }
.page-body .share { text-align: center; }
.page-body .share .share-btn { min-width: 14rem; }
.crumbs, .crumbs a { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-muted); border-top: 0; margin-top: 0; }
.site-footer a { color: var(--on-footer); }
.footer-brand .brand { color: #1f1a3d; }
.footer-brand p, .footer-legal p { color: var(--footer-muted); }
.footer-col h2 { color: var(--footer-head); font-family: var(--display); }
.footer-legal::before { background: rgba(255, 255, 255, 0.18); }
.footer-note { color: var(--on-footer) !important; }

/* the headline hours in each answer row */
.a-name .hours { margin: 2px 0 0; font-size: 0.92rem; color: var(--ink-muted); }
.a-name .hours strong { display: block; font-family: var(--display); font-weight: 900; font-size: 1.7rem; line-height: 1.1; color: #2a1f57; }
@media (max-width: 600px) {
  .door-panel { padding: 18px 14px 18px 38px; border-radius: 22px; }
  .door-panel::before { left: 11px; width: 11px; }
  .answer-panel { padding: 16px 14px 12px; border-radius: 22px; }
}
