/* "hidden" must always win over display rules (.gate is display:grid, .btn inline-flex) */
[hidden] { display: none !important; }

  :root {
    --bg: #f5f3ec; --panel: #fffdf7; --text: #1f2a1f; --muted: #5f6b5c; --line: #e2ded0;
    --accent: #3d7a3a; --accent-ink: #ffffff; --soft: #e7efdf; --warn: #a3520f; --warn-soft: #fbeadb;
    --shadow: 0 1px 2px rgba(30,40,25,.06), 0 6px 20px rgba(30,40,25,.06);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #121612; --panel: #1a201a; --text: #ecf0e6; --muted: #a2ad9d; --line: #2b332a;
      --accent: #7fbf6f; --accent-ink: #0f1a0d; --soft: #233023; --warn: #f0a868; --warn-soft: #3a2a1b;
      --shadow: none;
    }
  }
  :root[data-theme="dark"] {
    --bg: #121612; --panel: #1a201a; --text: #ecf0e6; --muted: #a2ad9d; --line: #2b332a;
    --accent: #7fbf6f; --accent-ink: #0f1a0d; --soft: #233023; --warn: #f0a868; --warn-soft: #3a2a1b;
    --shadow: none;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  a { color: var(--accent); }
  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
  h1, h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
  h2 { font-size: 26px; margin: 0 0 4px; }
  .sub { color: var(--muted); margin: 0 0 20px; }
  section { padding: 40px 0; }

  /* nav */
  nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
  .brand { display: flex; align-items: center; gap: 8px; font-family: Fraunces, Georgia, serif; font-size: 20px; text-decoration: none; color: var(--text); }
  .links { display: flex; gap: 18px; margin-left: auto; }
  .links a { color: var(--muted); text-decoration: none; font-size: 15px; }
  .links a:hover { color: var(--text); }
  @media (max-width: 560px) { .links { gap: 12px; } .links a { font-size: 14px; } .links .opt { display: none; } }

  /* hero */
  .hero { padding-top: 36px; padding-bottom: 8px; }
  .hero h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 8px; line-height: 1.1; }
  .hero p { color: var(--muted); max-width: 620px; margin: 0; font-size: 17px; }
  .top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 24px; align-items: start; }
  .top > .col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }   /* each column stacks on its own: no stretched cards */
  @media (max-width: 880px) { .top { grid-template-columns: 1fr; } }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }

  /* live camera */
  .cam { overflow: hidden; }
  .cam-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .cam-head strong { font-weight: 600; }
  .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
  .pill.live { background: #c62828; color: #fff; }
  .pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
  @keyframes blink { 50% { opacity: .3; } }
  .cam-head .spacer { flex: 1; }
  .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
  .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 6px 12px; font-size: 14px; font-weight: 500; }
  .btn:disabled { opacity: .6; cursor: default; }
  .frame { position: relative; width: 100%; aspect-ratio: 2176 / 1616; overflow: hidden; background: #0d120d; }
  .frame video { position: absolute; left: 0; top: 0; display: block; }
  .gate { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #eef3e8; padding: 20px;
          background: radial-gradient(ellipse at center, rgba(20,30,18,.55), rgba(10,14,9,.9)), url("/poster.jpg") center/cover; }
  .gate p { margin: 10px 0 0; font-size: 14px; color: #c7d2c0; max-width: 360px; }
  .gate .play { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; padding: 14px 24px; border-radius: 99px; }
  .cam-note { padding: 10px 16px; font-size: 13px; color: var(--muted); }

  /* weather */
  .wx { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
  .sensors { padding: 16px 18px; display: grid; gap: 10px; }
  .sec-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .sec-h .age { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .dot.stale { background: var(--muted); }
  .sens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sens .stat b { font-size: 20px; }
  .spark { width: 100%; height: 44px; display: block; }
  .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
  /* the three compost thermometers: one tile each, with board, age and battery underneath */
  .ctile span { display: block; }
  .sens .ctile b { font-size: 18px; }
  .ctile small { color: var(--muted); font-size: 11px; }
  .ctile .cmeta { margin-top: 2px; font-size: 11px; }
  .ctile b .ctrend { display: inline-block; margin-right: 6px; font-size: 12px; font-weight: 600; color: var(--muted); vertical-align: 2px; }
  .ctile b .ctrend.up { color: #e5534b; }
  .ctile b .ctrend.down { color: #4c9be8; }
  .cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
  .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
  .wx-now { display: flex; align-items: center; gap: 14px; }
  .wx-icon { font-size: 46px; line-height: 1; }
  .wx-temp { font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
  .wx-desc { color: var(--muted); font-size: 14px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
  .stat b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
  .stat span { font-size: 12px; color: var(--muted); }
  .alert { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 500; }
  .tip { background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
  .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
  .day { font-size: 12px; color: var(--muted); padding: 6px 0; border-radius: 8px; }
  .day .i { font-size: 20px; display: block; margin: 2px 0; }
  .day b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
  .wx-foot { font-size: 12px; color: var(--muted); }

  /* projects */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .proj { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
  .proj h3 { margin: 0; font-size: 18px; }
  .proj p { margin: 0; color: var(--muted); font-size: 15px; }
  .proj .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
  .status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--accent); }
  .status.planned { color: var(--muted); }
  .proj .more { margin-top: auto; font-weight: 600; color: var(--accent); text-decoration: none; }
  .proj .more:hover { text-decoration: underline; }
  .status.rebuilding, .status.paused { background: var(--warn-soft); color: var(--warn); }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tags span { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; color: var(--muted); }
  .next { font-size: 14px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: auto; }
  .next b { font-weight: 600; }

  /* contact */
  .contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
  @media (max-width: 800px) { .contact { grid-template-columns: 1fr; } }
  form { padding: 20px; display: grid; gap: 14px; }
  .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
  label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
  input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
  input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  textarea { min-height: 130px; resize: vertical; }
  .hp { position: absolute; left: -9999px; }
  .form-msg { font-size: 14px; min-height: 20px; }
  .form-msg.ok { color: var(--accent); } .form-msg.err { color: var(--warn); }
  footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
  .skel { color: var(--muted); font-size: 14px; }

/* ---------- videos, share, contact CTA, footer socials ---------- */
.sec-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-row .sub { margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.yt-btn { background: #c4302b; color: #fff; }
.yt-btn svg, .socials svg { width: 18px; height: 18px; fill: currentColor; }
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.vid { all: unset; cursor: pointer; display: grid; gap: 6px; }
.vid .thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #0d120d center / cover no-repeat; }
.vid .play { width: 54px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(196,48,43,.92); color: #fff; font-size: 18px; }
.vid .vt { font-weight: 600; font-size: 15px; }
.vid .vd { color: var(--muted); font-size: 13px; }
.yt-empty { display: block; padding: 18px; color: var(--text); text-decoration: none; }
.share-sec { padding-top: 0; }
.share-card, .cta { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.share-card .sub, .cta .sub { margin: 0; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; cursor: pointer; }
.sh:hover { border-color: var(--accent); color: var(--accent); }
.sh.native { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.socials { display: flex; gap: 16px; }
.socials a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.socials a:hover { color: var(--text); }
.page { padding-top: 32px; min-height: 70vh; }
.page-h { font-size: clamp(30px, 5vw, 40px); margin: 0 0 6px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.qa { padding: 14px 18px; }
.qa summary { cursor: pointer; font-weight: 600; }
.qa p { margin: 10px 0 0; color: var(--muted); }

.batt { font-variant-numeric: tabular-nums; margin-right: 6px; }
.batt.low { color: var(--warn); font-weight: 600; }

/* daily timelapse */
.tl { overflow: hidden; }
.tl-frame { position: relative; }
.tl video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0d120d; cursor: pointer; }
.tl-ov { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  padding: 7px 12px; border-radius: 10px; background: rgba(10, 16, 10, .72); color: #eef3e8; font-size: 14px;
  font-variant-numeric: tabular-nums; pointer-events: none; backdrop-filter: blur(4px); }
.tl-ov b { font-weight: 700; }
@media (max-width: 560px) { .tl-ov { left: 8px; bottom: 8px; font-size: 12px; padding: 5px 9px; } }
.tl-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.tl-bar .btn { min-width: 40px; padding-left: 10px; padding-right: 10px; }
.tl-bar input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.tl-clock { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; text-align: right; }
.tl-days { display: flex; align-items: center; gap: 6px; }
#tlDay { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }

/* Reddit post about the sensor */
.reddit-wrap { max-width: 640px; }
.reddit-wrap .reddit-embed-bq { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.reddit-wrap iframe { border-radius: 12px; }

/* ---------- compost pile telemetry ---------- */
/* series colours (validated for colour-blind separation on the panel, light + dark); one colour per measurement, everywhere */
:root { --c-compost: #eb6834; --c-air: #2a78d6; --c-rh: #1baf7a; --c-uv: #eda100; --c-water: #0b8fa3; --c-bed: #8a5cd6; --c-bed2: #2f9e8f; --c-bed3: #c2447a; --c-compost2: #9c5a1c; --c-compost3: #b8860b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-compost: #d95926; --c-air: #3987e5; --c-rh: #199e70; --c-uv: #c98500; --c-water: #19aec2; --c-bed: #a07ae8; --c-bed2: #3dbcaa; --c-bed3: #e0679a; --c-compost2: #d9a05b; --c-compost3: #e8c25a; } }
:root[data-theme="dark"] { --c-compost: #d95926; --c-air: #3987e5; --c-rh: #199e70; --c-uv: #c98500; --c-water: #19aec2; --c-bed: #a07ae8; --c-bed2: #3dbcaa; --c-bed3: #e0679a; --c-compost2: #d9a05b; --c-compost3: #e8c25a; }

.tel-range { display: flex; flex-wrap: wrap; gap: 6px; }
.tel-range .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tel-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .tel-stats { grid-template-columns: 1fr 1fr; gap: 8px; } .tel-stat b { font-size: 18px; } }
.tel-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tel-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.tel-stat span { font-size: 13px; color: var(--text); }
.tel-stat small { font-size: 12px; color: var(--muted); }
.tel-charts { position: relative; display: grid; gap: 12px; }
.tel-card { padding: 12px 14px 8px; }
.tel-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-size: 14px; }
.tel-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.tel-leg i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.tel-svg { display: block; width: 100%; height: 220px; touch-action: pan-y; }
.tel-svg.small { height: 130px; }
.tel-grid { stroke: var(--line); stroke-width: 1; }
.tel-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tel-ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.tel-reflabel { font-size: 10.5px; }
.tel-cross { stroke: var(--muted); stroke-width: 1; }
.tel-dot { stroke: var(--panel); stroke-width: 2; }
.tel-src { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.tel-tip { position: absolute; top: 40px; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px; min-width: 170px; }
.tel-tip-h { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tel-tip-r { display: flex; align-items: center; gap: 8px; }
.tel-tip-r i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.tel-tip-r b { font-variant-numeric: tabular-nums; min-width: 52px; }
.tel-tip-r span { color: var(--muted); }
.tel-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
#telemetry.loading .tel-charts, #telemetry.loading .tel-stats { opacity: .55; transition: opacity .2s; }
.tel-table { margin-top: 12px; }
.tel-table summary { cursor: pointer; font-size: 14px; color: var(--accent); }
.tel-table .btn { margin: 10px 0; }
.tel-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.tel-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tel-table th, .tel-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tel-table th:first-child, .tel-table td:first-child { text-align: left; }
.tel-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; }
.sens-src { margin: 6px 0 2px; font-size: 12px; color: var(--muted); }

/* long sensor labels must wrap instead of widening the top row on phones */
.top > * { min-width: 0; }
.sens { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sens .stat span { display: block; overflow-wrap: break-word; line-height: 1.25; }
@media (max-width: 560px) { .sens { gap: 6px; } .sens .stat { padding: 8px 8px; } .sens .stat span { font-size: 11px; } }

/* ---------- now vs. normal (KMEV hourly normals) ---------- */
.normals { display: grid; gap: 8px; }
.sec-sub { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.sec-sub .age { margin-left: auto; font-weight: 500; }
.stat .diff, .wx-norm .diff { display: inline-block; margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--bg); }
.diff.warm { color: #c2410c; } .diff.cold { color: #2563eb; }
.diff.wet { color: #0f766e; } .diff.dry { color: #a16207; } .diff.same { color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff.warm { color: #fb923c; } :root:not([data-theme="light"]) .diff.cold { color: #60a5fa; }
  :root:not([data-theme="light"]) .diff.wet { color: #2dd4bf; } :root:not([data-theme="light"]) .diff.dry { color: #facc15; } }
:root[data-theme="dark"] .diff.warm { color: #fb923c; } :root[data-theme="dark"] .diff.cold { color: #60a5fa; }
:root[data-theme="dark"] .diff.wet { color: #2dd4bf; } :root[data-theme="dark"] .diff.dry { color: #facc15; }

.tel-why { margin-top: 6px; font-size: 13px; color: var(--muted); }
.tel-why summary { cursor: pointer; font-weight: 600; }
.tel-why p { margin: 6px 0 0; line-height: 1.55; }

.tel-why ul { margin: 6px 0 0; padding-left: 18px; }
.tel-why li { margin: 3px 0; }

/* ---------- daily stills ---------- */
.still-days { display: flex; flex-wrap: wrap; gap: 6px; }
.still-days .sh[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.still-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.still { margin: 0; overflow: hidden; }
.still img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #0d120d; }
.still figcaption { padding: 10px 14px 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.still figcaption b { color: var(--text); }
.still.empty .still-ph { aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; color: var(--muted); }

/* compost phase bands */
.tel-band { stroke: none; }
.tel-band.hot { fill: rgba(234, 88, 12, .13); }
.tel-band.build { fill: rgba(22, 163, 74, .12); }
.tel-bandlabel { font-size: 11px; font-weight: 600; }
.tel-bandlabel.hot { fill: #c2410c; } .tel-bandlabel.build { fill: #15803d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tel-bandlabel.hot { fill: #fb923c; } :root:not([data-theme="light"]) .tel-bandlabel.build { fill: #4ade80; } }
:root[data-theme="dark"] .tel-bandlabel.hot { fill: #fb923c; } :root[data-theme="dark"] .tel-bandlabel.build { fill: #4ade80; }
.band-key { display: inline-block; width: 12px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
.band-key.hot { background: rgba(234, 88, 12, .45); } .band-key.build { background: rgba(22, 163, 74, .45); }

/* ---------- area weather under the camera (KMEV now vs. normal) + forecast module ---------- */
.area-row { display: grid; gap: 14px; }
.area-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.area-stats .stat .norm, .wx-norm .norm { display: block; margin: 3px 0 0; }
.wx-norm .norm { display: inline; margin-left: 6px; }
.diff i { font-style: normal; font-weight: 500; opacity: .7; font-size: 10px; }
.diff.rise { color: #0f766e; } .diff.fall { color: #a16207; }
.wx-norm { margin-top: 6px; }
.stat .norm, .wx-norm .norm { margin-left: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.fc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 880px) { .fc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .area-stats, .fc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff.rise { color: #2dd4bf; } :root:not([data-theme="light"]) .diff.fall { color: #facc15; } }
:root[data-theme="dark"] .diff.rise { color: #2dd4bf; } :root[data-theme="dark"] .diff.fall { color: #facc15; }
.out-note { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 500; }
.sens .air-missing { grid-column: span 2; }
.sens .air-missing b { color: var(--warn); font-size: 16px; }

/* °C shown next to °F for our own sensors */
small.cel { display: inline-block; font-size: .62em; font-weight: 500; opacity: .7; margin-left: .35em; white-space: nowrap; }   /* inline-block: wraps under the °F when the tile is narrow */

/* soil probes card */
.probe { padding: .4rem 0 .6rem; border-top: 1px solid var(--line, rgba(127,127,127,.2)); }
.probe:first-of-type { border-top: 0; }
.probe-h { display: flex; align-items: center; gap: .45rem; font-weight: 600; margin: .2rem 0 .4rem; }
.probe-h .age { margin-left: auto; font-weight: 400; opacity: .7; font-size: .85em; }
svg.pspark { width: 100%; height: 46px; display: block; }
.pspark-wrap { position: relative; margin-top: .35rem; touch-action: pan-y; cursor: crosshair; }
.pspark-wrap .pcur { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pspark-wrap .pmark { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 2px solid var(--bg, #111); pointer-events: none; }
.pspark-wrap .pmark.t { background: var(--c-compost); } .pspark-wrap .pmark.m { background: var(--c-rh); }
.pspark-wrap .pmark[hidden], .pspark-tip[hidden] { display: none; }
.pspark-tip { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 2px; }
.pspark-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.pspark-ax { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; }
svg.pspark path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }

.tel-group-h { grid-column: 1 / -1; font-weight: 600; margin: 1rem 0 .1rem; font-size: 1.05rem; }
.tel-group-h small { font-weight: 400; opacity: .7; margin-left: .4rem; }
.probe-h small.cal { font-weight: 400; font-size: .72em; opacity: .7; border: 1px solid currentColor; border-radius: 99px; padding: 0 .45em; }

/* temporary site-wide notice */
.site-notice { position: sticky; top: 0; z-index: 50; padding: .7rem 1rem; text-align: center; font-size: .95rem;
  background: #f0b429; color: #2b1d00; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.site-notice b { margin-right: .4em; }

/* compost chart: one toggle per thermometer (+ average) */
.tel-toggles { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tel-tog { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line, rgba(127,127,127,.35)); background: var(--soft); color: var(--text); cursor: pointer; }
.tel-tog i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.tel-tog[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.tel-tog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-next { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.tl-mode { display: inline-flex; gap: 4px; margin-right: 6px; }
.tl-mode .btn[aria-pressed="true"] { background: var(--accent); color: #0d120d; border-color: var(--accent); }

/* ---------- /compost: the three compost thermometers, photos and the water-loop diagram ---------- */
:root { --cp-pile: #8a6a4a; --cp-pile-edge: #6b4f35; --cp-coil: #2b2b2b; --cp-bin: #3a3f3a; --cp-bin-edge: #2a2e2a; --cp-pump: #1f9e9a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cp-pile: #6b5238; --cp-pile-edge: #8a6a4a; --cp-coil: #0d0f0d; --cp-bin: #2c312c; --cp-bin-edge: #4a514a; --cp-pump: #2bb8b3; } }
:root[data-theme="dark"] { --cp-pile: #6b5238; --cp-pile-edge: #8a6a4a; --cp-coil: #0d0f0d; --cp-bin: #2c312c; --cp-bin-edge: #4a514a; --cp-pump: #2bb8b3; }
.cpage { padding: 32px 0 48px; }
.cpage .page-h { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; margin: 0 0 10px; }
.cpage .sub { max-width: 720px; font-size: 17px; }
.cp-h { margin: 36px 0 12px; }
.cp-now { padding: 16px 18px; display: grid; gap: 12px; }
.cp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cp-tile { position: relative; padding: 12px 12px 10px 48px; }
.cp-tile b { font-size: 24px; }
.cp-tile span:not(.cp-num) { display: block; font-size: 13px; }
.cp-tile small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cp-num { position: absolute; left: 12px; top: 14px; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.cp-num.cp-air { background: var(--c-air); font-size: 10px; }
.cp-read { margin: 0; color: var(--muted); font-size: 14px; }
.cp-diagram { margin: 0; padding: 16px; }
.cp-diagram svg { width: 100%; max-width: 760px; height: auto; display: block; margin: 0 auto; }
.cp-diagram figcaption { max-width: 760px; margin: 0 auto; }
.cp-t { fill: var(--text); font: 600 15px Inter, sans-serif; }
.cp-small { font-size: 13px; fill: var(--muted); font-weight: 500; }
.cp-n { fill: #fff; font: 700 15px Inter, sans-serif; text-anchor: middle; }
.cp-key { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.cp-key li { display: flex; gap: 10px; align-items: baseline; }
.cp-key i { flex: none; width: 22px; height: 22px; border-radius: 50%; color: #fff; font: normal 700 12px/22px Inter, sans-serif; text-align: center; }
.cp-steps, .cp-tips { max-width: 760px; padding-left: 22px; display: grid; gap: 8px; }
.cp-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cp-photos figure { margin: 0; overflow: hidden; }
.cp-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.cp-photos figcaption { padding: 10px 12px 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 880px) { .cp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cp-photos { grid-template-columns: 1fr; } }
.cp-dark { color: #1d1608 !important; } text.cp-dark { fill: #1d1608; }
.cp-log { list-style: none; margin: 0; padding: 6px 16px; }
.cp-log li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cp-log li:last-child { border-bottom: 0; }
.cp-log time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .cp-log li { grid-template-columns: 1fr; gap: 2px; } }
.heat-now { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--soft); }
.heat-now b { font-size: 16px; }
.heat-now span { color: var(--muted); font-size: 13px; }
.heat-now.on { background: var(--warn-soft); }
.heat-now.on b { color: var(--warn); }
.cp-note { color: var(--muted); margin: 0 0 10px; max-width: 760px; }
.cp-rates-wrap { max-height: 460px; overflow: auto; padding: 0; }
.cp-rates { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.cp-rates th, .cp-rates td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cp-rates thead th { position: sticky; top: 0; background: var(--panel); font-size: 12px; color: var(--muted); font-weight: 600; }
.cp-rates tbody th { text-align: left; font-weight: 500; color: var(--muted); }
.cp-rates td.up { color: var(--c-compost); font-weight: 600; } .cp-rates td.down { color: var(--c-air); font-weight: 600; }

/* "Where the thermometers are now" list on /compost */
.cp-now-key { margin: 0; padding: 16px 18px; }
/* blog */
.blog-index { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; max-width: 760px; }
.blog-index li { padding: 18px 20px; }
.blog-index time, .blog-crumb { color: var(--muted); font-size: 14px; }
.blog-index h2 { font-size: 21px; line-height: 1.25; margin: 4px 0 6px; }
.blog-index h2 a { color: inherit; text-decoration: none; }
.blog-index h2 a:hover { text-decoration: underline; }
.blog-index p { margin: 0; }
.blog-post .wrap > p, .blog-post .blog-list { max-width: 720px; font-size: 17px; line-height: 1.6; }
.blog-crumb { margin: 0 0 8px; }
.blog-fig { margin: 22px 0; max-width: 760px; overflow: hidden; }
.blog-fig img { display: block; width: 100%; height: auto; }
.blog-fig figcaption { padding: 10px 16px; color: var(--muted); font-size: 14px; }
.blog-list { padding-left: 20px; }
.blog-list li { margin: 6px 0; }
.blog-more { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* Pile log events as markers on the telemetry charts */
.tel-markline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
.tel-marklabel { fill: var(--text); font-weight: 600; }
.tel-mark { cursor: help; }

/* archived-page banner (/compost since Oct 25, 2026) */
.cp-archived { max-width: 760px; margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }

/* two-word menu items ("Raised bed") stay on one line */
nav .links a { white-space: nowrap; }

/* Soil probes group inside the telemetry charts (2026-10-28) */
.tel-group { display: grid; gap: 12px; }
.tel-group[hidden] { display: none; }
.tel-group-h { margin-top: 12px; }
.tel-group-h h3 { margin: 0 0 4px; font-size: 1.15rem; }
.tel-group-h .sub { margin: 0; }
.tel-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; }
.tel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tel-legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
/* hourly change above each soil probe stat (same colours as the compost tiles' .ctrend) */
.sens .stat .ptop { display: flex; align-items: center; gap: 6px; min-height: 16px; margin-bottom: 2px; }
.sens .stat .ptrend { font-size: 12px; font-weight: 600; color: var(--muted); }
.sens .stat .ptrend.up { color: #e5534b; }
.sens .stat .ptrend.down { color: #4c9be8; }
/* soil stat range dots: good / fair / poor */
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pdot.g { background: #3fb950; } .pdot.y { background: #d4a72c; } .pdot.r { background: #e5534b; }
.pkey { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* key under the soil card: the dot ranges and the hourly-change chips */
.soil-key { border-top: 1px solid var(--line, rgba(127,127,127,.2)); margin-top: 12px; padding-top: 10px; font-size: 14px; }
.soil-key h3 { margin: 0 0 6px; font-size: 1rem; }
.soil-key p { margin: 6px 0; line-height: 1.45; }
.soil-key p.soil-key-note { text-align: center; font-size: 12px; color: var(--muted); max-width: 760px; margin: 8px auto; }
.soil-key-wrap { overflow-x: auto; }
.soil-key table { width: 100%; border-collapse: collapse; font-size: 13px; }
.soil-key th, .soil-key td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); vertical-align: top; }
.soil-key thead th { font-weight: 600; white-space: nowrap; }
.soil-key tbody th { font-weight: 600; }
.soil-key .pdot { margin-right: 5px; vertical-align: -1px; }
.soil-key .ptrend { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.soil-key .ptrend.up { color: #e5534b; } .soil-key .ptrend.down { color: #4c9be8; }
/* soil probes module (2026-10-28): full width under the two top columns, one card per probe: 2 x 2 on a laptop,
   4 across on a very wide screen, stacked on a phone; the intro and the colour key span the whole row */
.soil-mod { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
@media (min-width: 760px) { .soil-mod { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1800px) { .soil-mod { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.soil-mod > .soil-wide { grid-column: 1 / -1; }
.soil-mod .probe { border-top: 0; padding: 16px 18px; }
.soil-mod .probe .probe-h { margin-top: 0; }
.soil-mod .soil-key { border-top: 0; margin-top: 0; padding-top: 0; }
