:root {
  --bg: #f6f5f0;
  --card: #ffffff;
  --ink: #1f2a24;
  --muted: #5d6b63;
  --line: #dfe3dc;
  --brand: #1d6b4f;
  --brand-dark: #14513b;
  --accent: #f2a516;
  --warn-bg: #fff4e0;
  --warn-line: #f0c46b;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--brand); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header / footer */
.site-header { background: var(--brand); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.sun { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(242,165,22,.3); }
.site-header nav a { color: #e6f2ec; text-decoration: none; margin-left: 18px; font-size: .95rem; }
.site-header nav a:hover { color: #fff; }
.site-footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* Hero */
.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 720px; margin: 0 0 18px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets span { color: var(--muted); font-size: .9rem; margin-right: 4px; }
.chip { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--ink); font-size: .9rem; }
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand); background: #eaf4ef; }

/* Cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.calc { margin-top: 24px; }
.calc h2 { font-size: 1.2rem; margin: 0 0 14px; }
.calc h2:not(:first-child) { margin-top: 28px; }
input, select, button { font: inherit; }
input[type=text], input[type=number], select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.picker { display: flex; gap: 10px; margin-bottom: 14px; }
.picker select { flex: 1; }
.btn-primary, .btn-secondary {
  display: inline-block; padding: 10px 18px; border-radius: 8px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); white-space: nowrap; }
.btn-secondary:hover { background: #eaf4ef; }
.calc > .btn-primary { margin-top: 24px; font-size: 1.05rem; padding: 12px 26px; }

.devices { width: 100%; border-collapse: collapse; }
.devices th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.devices td { padding: 6px; vertical-align: middle; }
.devices td:first-child { width: 34%; }
.devices .num { max-width: 100px; }
.devices .wh { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.remove { border: 0; background: none; font-size: 1.4rem; color: #a33; cursor: pointer; line-height: 1; padding: 4px 8px; }
.empty-hint { color: var(--muted); font-style: italic; }
.live-total { margin: 12px 0 0; color: var(--muted); }
.live-total strong { color: var(--ink); }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }

/* Results */
.results { margin-top: 36px; scroll-margin-top: 20px; }
.results h2 { font-size: 1.6rem; margin: 0 0 16px; }
.results h3 { font-size: 1.2rem; margin: 32px 0 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.stat.highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.stat .label { font-size: .85rem; color: var(--muted); }
.stat .value { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.stat .sub { font-size: .85rem; color: var(--muted); }

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.pick { position: relative; display: flex; flex-direction: column; }
.pick h4 { font-size: 1.2rem; margin: 10px 0 8px; }
.badge { align-self: flex-start; background: #eaf4ef; color: var(--brand); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; }
.pick:first-child .badge { background: var(--accent); color: #3a2800; }
.specs { list-style: none; padding: 0; margin: 0 0 12px; font-size: .95rem; }
.specs li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.runtime { font-size: 1.05rem; margin: 6px 0; }
.solar-note { font-size: .9rem; background: #fffaf0; border-left: 3px solid var(--accent); padding: 8px 10px; margin: 8px 0; }
.note { font-size: .9rem; color: var(--muted); }
.buy { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.buy .link { font-size: .9rem; text-align: center; }

.notice { border-radius: var(--radius); padding: 4px 18px; margin: 16px 0; }
.notice.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }

.breakdown { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.breakdown th, .breakdown td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: .95rem; }
.breakdown th { background: #f1f3ee; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.breakdown td small { color: var(--muted); }
.bar { display: inline-block; width: 80px; height: 8px; background: #e8ebe5; border-radius: 4px; vertical-align: middle; position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--brand); }

.tips { padding-left: 20px; }
.tips li { margin-bottom: 8px; }

.share { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.share label { font-weight: 600; font-size: .95rem; }
.share input { flex: 1; min-width: 200px; font-size: .85rem; color: var(--muted); }

.faq { margin-top: 48px; }
.faq h2 { font-size: 1.4rem; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: #33403a; }
.method { color: var(--muted); margin-top: 18px; }

/* Simple content pages */
.page { max-width: 760px; padding-top: 30px; }

/* Mobile */
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .settings { grid-template-columns: 1fr; }
  .picker { flex-direction: column; }
  .devices thead { display: none; }
  .devices, .devices tbody, .devices tr, .devices td { display: block; width: 100%; }
  .devices tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; position: relative; }
  .devices td { padding: 0; }
  .devices td:first-child { grid-column: 1 / -1; width: auto; padding-right: 36px; }
  .devices td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
  .devices td:last-child { position: absolute; top: 8px; right: 6px; width: auto; }
  .devices .num { max-width: none; }
  .breakdown th:nth-child(2), .breakdown td:nth-child(2), .breakdown th:nth-child(3), .breakdown td:nth-child(3) { display: none; }
}
