/* Watts I Need — light by default, dark via [data-theme="dark"] */
:root {
  --bg: #fffdf7;
  --bg-elev: #ffffff;
  --bg-soft: #fff6d6;
  --text: #17202e;
  --text-muted: #55606f;
  --line: #e7e2d3;
  --brand: #f5b400;
  --brand-ink: #b97d00;
  --brand-deep: #0b1220;
  --accent: #0b5fff;
  --accent-ink: #0a47b8;
  --ok: #157347;
  --shadow: 0 1px 2px rgba(23, 32, 46, 0.06), 0 8px 24px rgba(23, 32, 46, 0.06);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #121b2e;
  --bg-soft: #1a2338;
  --text: #e8ecf3;
  --text-muted: #a5afc0;
  --line: #26314a;
  --brand: #ffc72c;
  --brand-ink: #ffd867;
  --accent: #7aa7ff;
  --accent-ink: #a9c4ff;
  --ok: #4cd08a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 2.4vw + 1rem, 2.6rem); }
h2 { font-size: clamp(1.4rem, 1.2vw + 1rem, 1.75rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
small { color: var(--text-muted); font-size: 0.875rem; }
table { border-collapse: collapse; width: 100%; margin: 1em 0 1.5em; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55em 0.7em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1em 0 1.5em; }
.table-wrap table { margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--bg-soft); padding: 0.1em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.container { width: min(100% - 2rem, 1100px); margin-inline: auto; }
.prose { max-width: 74ch; }
.prose img { border-radius: var(--radius); }
.prose li { margin-bottom: 0.35em; }
.lead { font-size: 1.15rem; color: var(--text-muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg-elev); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.2rem; }
.brand-name span { color: var(--brand-ink); }
.nav-menu { margin-left: auto; }
.nav-menu summary { list-style: none; cursor: pointer; padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.nav-menu summary::-webkit-details-marker { display: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.2rem; }
.site-nav a { text-decoration: none; color: var(--text); padding: 0.4rem 0.6rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { background: var(--bg-soft); color: var(--text); }
.theme-toggle { border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (max-width: 899px) {
  .nav-menu[open] .site-nav { position: absolute; left: 0; right: 0; top: 60px; background: var(--bg-elev); border-bottom: 1px solid var(--line); padding: 0.75rem 1rem 1rem; flex-direction: column; box-shadow: var(--shadow); }
}
@media (min-width: 900px) {
  .nav-menu summary { display: none; }
  .nav-menu { display: contents; }
  .site-nav { margin-left: auto; }
}

/* Hero */
.hero { padding: 2.25rem 0 1rem; }
.hero h1 { max-width: 20ch; }
.hero .lead { max-width: 62ch; }
.crumbs { font-size: 0.9rem; color: var(--text-muted); margin: 1rem 0 0; }
.crumbs a { color: inherit; }
.crumbs span::before { content: "›"; margin: 0 0.4em; }

/* Calculator */
.calc { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin: 1rem 0 2rem; }
.calc-title { margin: 0 0 1rem; font-size: 1.25rem; }
.calc-grid { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .calc-grid { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 650; margin-bottom: 0.3rem; font-size: 0.95rem; }
.field small { display: block; margin-top: 0.3rem; }
.field-row { display: flex; gap: 0.5rem; }
.field-row > * { flex: 1 1 0; min-width: 0; }
.field-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
input[type="number"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; min-height: 46px;
}
input[type="number"]:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 1px; border-color: var(--brand-ink); }
.mode-switch { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mode-switch label { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer; font-size: 0.95rem; }
.mode-switch label:has(input:checked) { background: var(--bg-soft); border-color: var(--brand-ink); font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.chips button, .btn-secondary { font: inherit; font-size: 0.85rem; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.chips button:hover, .btn-secondary:hover { border-color: var(--brand-ink); background: var(--bg-soft); }
.calc-more summary { cursor: pointer; font-weight: 650; margin-bottom: 0.75rem; }
.calc-results { background: var(--bg-soft); border-radius: var(--radius); padding: 1.25rem; min-height: 340px; }
.result-label { margin: 0; font-size: 0.9rem; color: var(--text-muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.result-big { font-size: clamp(2.4rem, 4vw + 1rem, 3.4rem); font-weight: 800; margin: 0 0 0.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 1rem; margin: 0 0 0.9rem; }
.result-grid div { background: var(--bg-elev); border-radius: 10px; padding: 0.55rem 0.75rem; }
.result-grid dt { font-size: 0.8rem; color: var(--text-muted); }
.result-grid dd { margin: 0; font-weight: 750; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.result-grid.energy dd { font-size: 1rem; }
.result-grid.energy { grid-template-columns: repeat(3, 1fr); }
.calc[data-variant="ev"] .result-grid.energy { grid-template-columns: repeat(2, 1fr); }
.result-summary { font-weight: 550; margin: 0.5rem 0; min-height: 3.2em; }
.result-compare { background: var(--bg-elev); border-radius: 10px; padding: 0.75rem 0.9rem; margin: 0.5rem 0; }
.result-compare p { margin: 0; }
.result-fine { font-size: 0.82rem; color: var(--text-muted); margin: 0.5rem 0 0.75rem; }
.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Content blocks */
.section { margin: 2.5rem 0; }
.grid-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 1rem 0 2rem; padding: 0; list-style: none; }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.35rem; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }
.card .meta { font-size: 0.8rem; color: var(--text-muted); margin-top: auto; }
.callout { background: var(--bg-soft); border-left: 4px solid var(--brand); border-radius: 8px; padding: 0.9rem 1.1rem; margin: 1.25rem 0; }
.callout p:last-child { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; }
.stat .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 0.85rem; color: var(--text-muted); }

/* FAQ */
.faq { margin: 2.5rem 0; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.6rem; background: var(--bg-elev); }
.faq-item summary { cursor: pointer; padding: 0.9rem 1.1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 1.05rem; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--text-muted); flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 1.1rem 1rem; color: var(--text); }
.faq-answer p:last-child { margin-bottom: 0; }

/* Ads: reserved space so nothing jumps when a unit loads */
.ad-slot { margin: 1.5rem 0; min-height: 280px; display: flex; align-items: center; justify-content: center; }
.ad-slot--toolBelow { min-height: 250px; }
.ad-slot .adsbygoogle { width: 100%; }
/* AdSense marks a unit it could not fill; collapse the whole reserved box so no blank space is left */
.ad-slot:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* Article */
.article-header { padding: 2rem 0 0.5rem; }
.article-meta { color: var(--text-muted); font-size: 0.9rem; }
.article-body { max-width: 74ch; }
.article-body h2 { scroll-margin-top: 80px; }
.related { margin: 2.5rem 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; background: var(--bg-elev); font-size: 0.93rem; }
.footer-grid { display: grid; gap: 1.5rem; padding: 2rem 0 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.footer-grid h2 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.5rem; color: var(--text-muted); }
.footer-grid nav a { display: block; text-decoration: none; color: var(--text); padding: 0.2rem 0; }
.footer-grid nav a:hover { text-decoration: underline; }
.footer-brand .brand-name { font-weight: 800; font-size: 1.15rem; margin-bottom: 0.3rem; }
.footer-note { color: var(--text-muted); font-size: 0.85rem; }
.footer-bottom { border-top: 1px solid var(--line); padding: 1rem 0 1.5rem; color: var(--text-muted); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* 404 */
.notfound { text-align: center; padding: 4rem 0; }
.notfound .big { font-size: 5rem; font-weight: 800; color: var(--brand-ink); line-height: 1; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .site-header, .site-footer, .ad-slot, .theme-toggle, .result-actions { display: none !important; } }

/* ---------------------------------------------------------------------------
   Sizing tool
   --------------------------------------------------------------------------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.calc__heading { margin: 0 0 1rem; font-size: 1.25rem; }
.calc__modes { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .calc__modes { grid-template-columns: repeat(3, 1fr); } }
.calc__mode { font: inherit; text-align: left; cursor: pointer; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; display: grid; gap: 0.15rem; }
.calc__mode strong { font-size: 1rem; }
.calc__mode span { font-size: 0.85rem; color: var(--text-muted); }
.calc__mode[aria-selected="true"] { background: var(--bg-soft); border-color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-ink); }
.calc__block { border: 0; padding: 0; margin: 0 0 1.25rem; }
.calc__block legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 0.5rem; }
.calc__add { display: flex; gap: 0.5rem; align-items: stretch; }
.calc__add select { flex: 1 1 auto; min-width: 0; }
.btn { font: inherit; font-weight: 650; cursor: pointer; border: 1px solid var(--brand-ink); background: var(--brand); color: #1a1400; border-radius: 10px; padding: 0.6rem 1rem; min-height: 46px; }
.btn:hover { filter: brightness(1.05); }
.btn--ghost { background: var(--bg); color: var(--text); border-color: var(--line); }
.btn--add { flex: 0 0 auto; }
.btn--icon { min-height: 36px; padding: 0.2rem 0.6rem; background: var(--bg); color: var(--text-muted); border-color: var(--line); font-size: 1.1rem; line-height: 1; }
.btn--icon:hover { color: var(--text); border-color: var(--brand-ink); }
.calc__items { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 0.75rem; }
.calc__table { margin: 0; font-size: 0.92rem; min-width: 520px; }
.calc__table th, .calc__table td { padding: 0.45em 0.5em; vertical-align: middle; }
.calc__table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); background: transparent; }
.calc__table input[type="number"] { min-height: 40px; padding: 0.35rem 0.5rem; width: 5.5rem; }
.calc__table select { min-height: 40px; padding: 0.35rem 0.5rem; width: auto; }
.calc__name { font-weight: 650; min-width: 14rem; }
.calc__spec { display: block; font-weight: 450; font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.calc__note { margin-top: 0.2rem; }
.calc__note summary { cursor: pointer; font-size: 0.78rem; color: var(--accent-ink); font-weight: 600; }
.calc__note p { margin: 0.35rem 0 0; font-size: 0.85rem; font-weight: 400; color: var(--text-muted); max-width: 52ch; }
.calc__hint { font-size: 0.85rem; color: var(--text-muted); margin: 0.6rem 0 0; }
.calc__row { display: grid; gap: 0.3rem; margin-bottom: 0.75rem; }
.calc__row label { font-weight: 650; font-size: 0.9rem; }
@media (min-width: 620px) { .calc__row { grid-template-columns: 12rem 1fr; align-items: center; gap: 0.75rem; } }
.calc__custom { background: var(--bg-soft); border-radius: 10px; padding: 0.85rem 1rem 0.35rem; margin-bottom: 0.75rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; margin-bottom: 0.75rem; cursor: pointer; }
.check input { width: 20px; height: 20px; }

.calc__results { background: var(--bg-soft); border-radius: var(--radius); padding: 1.25rem; min-height: 420px; }
.result__stats { display: grid; gap: 0.6rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 620px) { .result__stats { grid-template-columns: repeat(3, 1fr); } }
.result__stats .stat { display: grid; gap: 0.1rem; }
.stat__label { font-size: 0.8rem; color: var(--text-muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; }
.stat__value { font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.stat__note { font-size: 0.8rem; color: var(--text-muted); }
.result__picks { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 620px) { .result__picks { grid-template-columns: 1fr 1fr; } }
.pick { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.pick h3 { margin: 0 0 0.25rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.pick__answer { font-size: 1.35rem; font-weight: 800; margin: 0 0 0.35rem; line-height: 1.15; }
.pick__why { margin: 0 0 0.35rem; font-size: 0.9rem; }
.pick__extra { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.result__summary { margin: 0.75rem 0 0; font-weight: 550; min-height: 3em; }
.result--empty { color: var(--text-muted); }
.result__drops { background: var(--bg-elev); border-radius: 12px; padding: 0.9rem 1rem; margin: 1rem 0; }
.result__drops h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.result__drops ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.alert { border-radius: 10px; padding: 0.75rem 1rem; margin: 0 0 1rem; font-size: 0.95rem; border-left: 4px solid var(--line); background: var(--bg-elev); }
.alert--good { border-left-color: var(--ok); }
.alert--warn { border-left-color: var(--brand); }
.alert--bad { border-left-color: #d64545; }
.breakdown { margin-top: 1rem; background: var(--bg-elev); border-radius: 12px; padding: 0.75rem 1rem; }
.breakdown > summary { cursor: pointer; font-weight: 650; }
.breakdown__table { font-size: 0.88rem; margin: 0.75rem 0 0.5rem; }
.breakdown__table td, .breakdown__table th { font-variant-numeric: tabular-nums; }
.breakdown__table tbody th { background: transparent; font-weight: 600; }
.breakdown__table tfoot th, .breakdown__table tfoot td { font-weight: 800; border-top: 2px solid var(--line); background: transparent; }
.breakdown { overflow-x: auto; }
.calc__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.calc__flash { font-size: 0.9rem; color: var(--ok); font-weight: 650; }
.calc__assumptions { margin-top: 1rem; font-size: 0.9rem; }
.calc__assumptions summary { cursor: pointer; font-weight: 650; }
.calc__assumptions ul { margin: 0.75rem 0 0; padding-left: 1.2rem; color: var(--text-muted); max-width: 74ch; }
.chip { font: inherit; font-size: 0.85rem; padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--brand-ink); background: var(--bg-soft); }
.chip--on { background: var(--bg-soft); border-color: var(--brand-ink); font-weight: 700; }

/* Custom appliance entry */
.calc__customitem { background: var(--bg-soft); border: 1px solid var(--brand-ink); border-radius: 12px; padding: 1rem 1.1rem 0.85rem; margin-top: 0.75rem; }
.calc__customitem-intro { margin: 0 0 0.85rem; font-size: 0.92rem; }
.calc__customitem-grid { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .calc__customitem-grid { grid-template-columns: 1fr 1fr; } }
.calc__customitem-grid .calc__row { grid-template-columns: 1fr; gap: 0.3rem; }
@media (min-width: 620px) { .calc__customitem-grid .calc__row { grid-template-columns: 9.5rem 1fr; align-items: center; gap: 0.75rem; } }
.calc__customitem input[type="text"] { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; min-height: 46px; }
.calc__optional { font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }
.calc__customitem-hint { font-size: 0.85rem; color: var(--text-muted); margin: 0.5rem 0 0.85rem; max-width: 70ch; }
.calc__customitem-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.calc__error { color: #d64545; font-size: 0.88rem; font-weight: 650; }
.calc__badge { display: inline-block; margin-left: 0.4rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--brand-ink); border: 1px solid var(--brand-ink); border-radius: 999px; padding: 0.05rem 0.4rem; vertical-align: 1px; }
.calc__row--custom .calc__name { border-left: 3px solid var(--brand); padding-left: 0.55rem; }
.calc__wattscell { white-space: nowrap; }
.calc__wattscell input.is-edited { border-color: var(--brand-ink); background: var(--bg-soft); font-weight: 700; }
.calc__reset { display: block; margin-top: 0.2rem; font: inherit; font-size: 0.72rem; background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.calc__row--hours { margin: 0 0 0.85rem; }
.calc__hoursfield { display: flex; align-items: center; gap: 0.5rem; }
.calc__hoursfield input { width: 7rem; flex: 0 0 auto; }
.calc__unit { color: var(--text-muted); font-size: 0.95rem; }

/* ---------------------------------------------------------------------------
   Phones: the equipment list becomes stacked cards.
   A five-column table pinned at 520px meant the tool's main input had to be
   scrolled sideways on a phone, which is the one thing it must never do.
   --------------------------------------------------------------------------- */
.result__emptylead { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--text); }
.result--empty p:last-child { margin-bottom: 0; max-width: 56ch; }

@media (max-width: 619px) {
  .calc { padding: 1rem 0.85rem; }
  .calc__items { overflow-x: visible; }
  .calc__table { min-width: 0; }
  .calc__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .calc__table, .calc__table tbody, .calc__table tr, .calc__table td { display: block; width: auto; }
  .calc__table tr {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.85rem 0.5rem;
    margin-bottom: 0.6rem;
    background: var(--bg);
  }
  .calc__table td { border: 0; padding: 0.25rem 0; }
  /* Name spans the full width; the remove button tucks into the top-right corner. */
  .calc__table td.calc__name { padding-right: 2.5rem; min-width: 0; margin-bottom: 0.35rem; }
  .calc__table td.calc__removecell { position: absolute; top: 0.5rem; right: 0.6rem; padding: 0; }
  /* Every other cell becomes a labelled row, so no header is needed. */
  .calc__table td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
  .calc__table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--text-muted);
    flex: 0 0 auto;
  }
  .calc__table td[data-label] input[type="number"],
  .calc__table td[data-label] select { width: auto; min-width: 7rem; max-width: 60%; }
  .calc__wattscell { display: flex; align-items: center; }
  .calc__reset { display: inline; margin: 0 0 0 0.5rem; }

  /* Mode tabs read as a stacked list rather than three tall cards. */
  .calc__mode { padding: 0.6rem 0.75rem; }
  .calc__mode span { font-size: 0.8rem; }

  /* An empty results box should not reserve half a screen of nothing. */
  .calc__results { min-height: 0; padding: 1rem; }
  .stat__value { font-size: 1.6rem; }

  /* Long headings and figures must not force the page sideways. */
  .pick__answer { font-size: 1.2rem; }
  .calc__heading { font-size: 1.15rem; }
  .breakdown { padding: 0.6rem 0.7rem; }
  .breakdown__table { font-size: 0.82rem; }
}
