:root {
  --bg: rgba(16, 28, 24, 0.82);
  --fg: #f3f6f2;
  --muted: #b9c7bf;
  --accent: #f2b33d;
  --line: rgba(255, 255, 255, 0.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe3ee; font-family: "Segoe UI", system-ui, sans-serif; color: var(--fg); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #14251f; z-index: 10; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
.load-title { font-size: 34px; font-weight: 700; }
.load-sub { color: var(--muted); margin: 6px 0 18px; }
.bar { width: min(360px, 70vw); height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#load-pct { margin-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }

#panel { position: fixed; top: 16px; left: 16px; bottom: 16px; width: 300px; padding: 18px; overflow-y: auto;
  background: var(--bg); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; gap: 12px; transition: transform .35s; z-index: 5; }
#panel.hide { transform: translateX(-340px); }
h1 { margin: 0; font-size: 22px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  border-radius: 8px; padding: 8px 10px; text-align: left; }
button:hover { background: rgba(255,255,255,.14); }
button.primary { background: var(--accent); color: #1d1a10; font-weight: 700; border: none; text-align: center; }
button.primary:hover { filter: brightness(1.08); }
#stops { display: flex; flex-direction: column; gap: 6px; }
#stops button { display: flex; gap: 10px; align-items: center; }
#stops button .n { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid;
  place-items: center; font-size: 12px; flex: none; }
#stops button.active { border-color: var(--accent); background: rgba(242,179,61,.16); }
#stops button.active .n { background: var(--accent); color: #1d1a10; }
details { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
summary { cursor: pointer; font-weight: 600; }
details ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--muted); }
details b { color: var(--fg); font-weight: 600; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.toggles { display: flex; gap: 14px; font-size: 13px; }
.help, .note { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }
.note { border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }

/* centred in the space right of the 300 px side panel (16 + 300 + 16 gap) */
#caption { position: fixed; bottom: 28px; --capw: min(760px, calc(100vw - 364px));
  left: calc(332px + (100vw - 348px - var(--capw)) / 2); width: var(--capw);
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; background: var(--bg);
  backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; transition: opacity .4s; z-index: 4; }
#caption.hidden { opacity: 0; pointer-events: none; }
#panel.hide ~ #caption { left: calc((100vw - var(--capw)) / 2); --capw: min(760px, calc(100vw - 64px)); }
#cap-num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1d1a10; font-weight: 700;
  display: grid; place-items: center; flex: none; }
#cap-title { font-size: 20px; font-weight: 700; }
#cap-text { color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.45; }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#labels.hidden { display: none; }
.plabel { position: absolute; left: 0; top: 0; padding: 5px 8px; border-radius: 7px; background: var(--bg);
  border: 1px solid var(--line); font-size: 12px; line-height: 1.3; white-space: nowrap; max-width: 260px; }
.plabel b { display: block; font-size: 13px; }
.plabel small { display: block; color: var(--muted); white-space: normal; min-width: 170px; }
.plabel .dot { float: left; width: 10px; height: 10px; border-radius: 50%; margin: 3px 6px 0 0; border: 1px solid rgba(0,0,0,.3); }
.plabel.tree::after { content: ""; position: absolute; left: 50%; bottom: -7px; border: 6px solid transparent;
  border-top-color: var(--bg); border-bottom: 0; transform: translateX(-50%); }
.plabel.zone { background: rgba(242,179,61,.88); color: #1d1a10; border: none; }
.plabel.zone small { color: #3a3220; }
.toggles { flex-wrap: wrap; }

#show-panel { position: fixed; top: 16px; left: 16px; z-index: 6; font-size: 18px; background: var(--bg); }
#show-panel.hidden { display: none; }

/* ------------------------------------------------------------ tabs */
#tabs { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 4px;
  padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(8px); }
#tabs button { border: none; border-radius: 999px; padding: 7px 18px; background: transparent; text-align: center; }
#tabs button.on { background: var(--accent); color: #1d1a10; font-weight: 700; }
body:not(.mode-model) #panel, body:not(.mode-model) #caption, body:not(.mode-model) #show-panel,
body:not(.mode-model) #labels, body:not(.mode-model) #loading { display: none !important; }
body:not(.mode-intro) #intro { display: none; }
body:not(.mode-facts) #facts { display: none; }

/* ------------------------------------------------------------ benefits & costs */
#facts { position: fixed; inset: 0; z-index: 8; background: #12211c; overflow-y: auto; scroll-behavior: smooth; }
#facts-band { position: fixed; top: 0; left: 0; right: 14px; height: 116px; z-index: 1; pointer-events: none;
  background: linear-gradient(#12211c 78%, rgba(18,33,28,0)); }
#facts-nav { position: sticky; top: 62px; z-index: 2; display: flex; gap: 4px; width: max-content; max-width: calc(100vw - 32px);
  margin: 62px auto 0; padding: 4px; overflow-x: auto; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; backdrop-filter: blur(8px); }
#facts-nav { scrollbar-width: none; }
#facts-nav::-webkit-scrollbar { display: none; }
#facts-nav a { color: var(--muted); text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
#facts-nav a:hover { color: var(--fg); background: rgba(255,255,255,.08); }
#facts-nav a.on { color: #1d1a10; background: var(--accent); font-weight: 700; }
#facts-nav .short { display: none; }
.fwrap { max-width: 1240px; margin: 0 auto; padding: 10px 32px 80px; }
.fhead { padding-top: 64px; scroll-margin-top: 70px; }
.fhead h2 { margin: 0; font-size: clamp(26px, 3vw, 40px); }
.fhead .lede { max-width: 860px; }
.bgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.bgrid.four { grid-template-columns: repeat(4, 1fr); }
.bgrid article { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.bgrid h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent); }
.bgrid ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; line-height: 1.45; font-size: 15px; }
.bgrid p { margin: 0; color: #dfe8e2; line-height: 1.5; font-size: 15px; }
.warn { background: rgba(242,179,61,.12); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 4px;
  line-height: 1.5; max-width: 900px; }
.bcontrols { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 18px 0; font-size: 14px; }
.bcontrols input, .bcontrols select, .btable input { font: inherit; color: var(--fg); background: rgba(255,255,255,.07);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.bcontrols input { width: 80px; }
.bcontrols select option { color: #111; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.tile { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile span { color: var(--muted); font-size: 13px; }
.tile b { display: block; font-size: clamp(20px, 2vw, 28px); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 12px; }
.btable { margin-bottom: 26px; overflow-x: auto; scroll-margin-top: 120px; }
.btable table { width: 100%; border-collapse: collapse; font-size: 14px; }
.btable caption { text-align: left; font-size: 19px; font-weight: 700; padding: 6px 0 10px; }
.btable th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 7px 8px; }
.btable td { border-bottom: 1px solid rgba(255,255,255,.06); padding: 5px 8px; }
.btable .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.btable input { width: 110px; text-align: right; }
.btable tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: none; padding-top: 9px; }
.addons { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; max-width: 520px; margin: 10px 0 0 auto;
  font-size: 14px; text-align: right; }
.addons input { width: 70px; }
.addons b { font-size: 17px; }
.note-small { color: var(--muted); font-size: 13px; }
@media print {
  :root { --fg: #000; --muted: #444; --accent: #000; --line: #ccc; }
  #tabs, #facts-nav, .bcontrols button, #intro, #panel, #caption, #scene { display: none !important; }
  #facts { position: static; overflow: visible; background: #fff; color: #000; }
  body, html { overflow: visible; height: auto; background: #fff; color: #000; }
  .bgrid article, .tile { border-color: #ccc; background: none; }
  .btable input { border: none; background: none; color: #000; }
  .bgrid h3, .facts b { color: #000; }
}

/* ------------------------------------------------------------ introduction slides */
#intro { position: fixed; inset: 0; z-index: 8; background: #12211c; }
#topics { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 9; display: flex; gap: 4px;
  max-width: calc(100vw - 32px); overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(8px); }
#topics::-webkit-scrollbar { display: none; }
#topics button { flex: none; border: none; border-radius: 999px; padding: 5px 12px 5px 6px; background: transparent;
  font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#topics button span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: rgba(255,255,255,.1); }
#topics button:hover { color: var(--fg); background: rgba(255,255,255,.08); }
#topics button.on { color: #1d1a10; background: var(--accent); font-weight: 700; }
#topics button.on span { background: rgba(0,0,0,.15); }
.slide { position: absolute; inset: 0; padding: 118px 6vw 70px; display: none; flex-direction: column; gap: 14px; overflow: auto; }
.slide.on { display: flex; animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.slide h2 { margin: 0; font-size: clamp(24px, 3.2vw, 40px); }
.slide .hint { margin: -6px 0 0; color: var(--muted); }
.slide img { display: block; width: 100%; border-radius: 10px; object-fit: cover; }
.slide figure { margin: 0; }
.slide figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.cover { justify-content: flex-end; background: linear-gradient(180deg, rgba(10,20,16,.1) 30%, rgba(10,20,16,.85)), var(--img) center/cover; }
.cover-text { max-width: 760px; }
.cover h1 { font-size: clamp(36px, 6vw, 72px); margin: 0; line-height: 1.05; }
.kicker { color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
.lede { font-size: clamp(16px, 1.6vw, 21px); color: #dfe8e2; line-height: 1.45; }
.small-note { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row button { padding: 11px 22px; font-size: 16px; text-align: center; }
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: start; min-height: 0; }
.split .big img { max-height: 68vh; object-fit: contain; background: #0c1713; }
.facts { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.45; }
.facts b { color: var(--accent); }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.thumbs img { aspect-ratio: 4/3; cursor: zoom-in; }
.stack { display: grid; gap: 10px; }
.stack img { aspect-ratio: 16/7; max-height: calc((100vh - 230px) / 3); }
.plan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.plan img { flex: 1; min-height: 0; object-fit: contain; background: #fff; cursor: zoom-in; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.grid img { aspect-ratio: 4/3; cursor: zoom-in; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ba img { aspect-ratio: 4/3; cursor: zoom-in; }
.slide video { width: 100%; max-height: 66vh; border-radius: 10px; background: #000; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; border-radius: 12px; }
.card img { aspect-ratio: 4/3; border-radius: 0; }
.card .cb { padding: 10px 12px 12px; }
.card b { display: block; font-size: 16px; }
.card i { color: var(--muted); font-size: 13px; }
.card span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
#slide-nav { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9; display: flex; gap: 10px;
  align-items: center; padding: 4px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
#slide-nav button { border: none; background: transparent; font-size: 22px; padding: 2px 12px; }
#slide-count { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
#lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.88); display: grid; place-items: center; cursor: zoom-out; }
#lightbox.hidden { display: none; }
#lightbox img { max-width: 96vw; max-height: 94vh; background: #fff; }

/* ------------------------------------------------------------ plant popup */
#plant-pop { position: fixed; top: 70px; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); z-index: 25;
  background: rgba(16, 28, 24, 0.95); border: 1px solid var(--line); border-radius: 14px; overflow: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.4); transition: transform .3s, opacity .3s; }
#plant-pop.hidden { transform: translateX(30px); opacity: 0; pointer-events: none; }
#plant-pop > img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
#plant-pop .close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; padding: 0;
  text-align: center; font-size: 20px; background: rgba(0,0,0,.55); border: none; }
.pop-body { padding: 14px 18px 18px; }
.pop-kicker { margin: 0; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pop-body h3 { margin: 4px 0 0; font-size: 24px; }
.latin { margin: 2px 0 10px; color: var(--muted); font-style: italic; }
.pop-body dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 14px; }
.pop-body dt { color: var(--muted); }
.pop-body dd { margin: 0; }
.pop-body h4 { margin: 12px 0 6px; }
.why { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; }
.care { font-size: 13px; background: rgba(242,179,61,.12); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 4px; line-height: 1.45; }
.ai { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
/* Introduction: big centred card; click anywhere or change slide to close */
#pop-backdrop { position: fixed; inset: 0; z-index: 24; background: rgba(5, 12, 9, 0.72); backdrop-filter: blur(3px);
  transition: opacity .3s; cursor: pointer; }
#pop-backdrop.hidden { opacity: 0; pointer-events: none; }
#plant-pop.center { top: 50%; left: 50%; right: auto; bottom: auto; width: min(1180px, 92vw); max-height: 88vh;
  transform: translate(-50%, -50%); display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; cursor: pointer; }
#plant-pop.center.hidden { transform: translate(-50%, -48%) scale(.97); }
#plant-pop.center > img { aspect-ratio: auto; height: 100%; max-height: 88vh; }
#plant-pop.center .pop-body { overflow: auto; max-height: 88vh; padding: 26px 30px 24px; }
#plant-pop.center h3 { font-size: clamp(26px, 2.6vw, 38px); }
#plant-pop.center .latin { font-size: 18px; }
#plant-pop.center dl, #plant-pop.center .why { font-size: clamp(15px, 1.2vw, 18px); }
#plant-pop.center h4 { font-size: 19px; margin-top: 18px; }
#plant-pop.center .care { font-size: 15px; }
#plant-pop.center .close-hint { display: block; }
.close-hint { display: none; color: var(--muted); font-size: 12px; margin-top: 10px; }
@media (max-width: 760px) { #plant-pop.center { grid-template-columns: 1fr; overflow: auto; } #plant-pop.center > img { height: auto; width: 100%; object-fit: cover; } }
.plabel.tree { pointer-events: auto; cursor: pointer; }
#panel { top: 70px; }

/* ------------------------------------------------------------ bottom bar, topic sheet, credit */
#slide-nav #slide-pick { border: none; background: transparent; padding: 6px 10px; display: flex; align-items: center; gap: 8px;
  font-size: 15px; white-space: nowrap; min-width: 0; }
#slide-nav #slide-pick:hover { background: rgba(255,255,255,.08); }
#slide-nav #prev, #slide-nav #next { flex: none; }
#slide-name, #slide-pick .caret { display: none; }
#slide-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
.caret { font-size: 11px; color: var(--muted); }
#facts-jump { display: none; }
#sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5,12,9,.6); display: flex; align-items: flex-end;
  justify-content: center; transition: opacity .25s; }
#sheet.hidden { opacity: 0; pointer-events: none; }
.sheet-card { width: min(520px, 100vw); max-height: 72vh; overflow: auto; background: #172a23; border: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 14px 14px 22px; transform: translateY(0); transition: transform .25s; }
#sheet.hidden .sheet-card { transform: translateY(30px); }
.sheet-title { margin: 2px 6px 10px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.sheet-list { display: grid; gap: 6px; }
.sheet-list button { display: flex; align-items: center; gap: 12px; padding: 12px; font-size: 16px; text-align: left; }
.sheet-list button span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: rgba(255,255,255,.1); flex: none; }
.sheet-list button.on { border-color: var(--accent); background: rgba(242,179,61,.16); }
.sheet-list button.on span { background: var(--accent); color: #1d1a10; }
#credit { position: fixed; right: 16px; bottom: 14px; z-index: 9; margin: 0; font-size: 12px; color: var(--muted);
  pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#credit b, .ffoot b, .panel-credit b, .load-credit b { color: var(--fg); letter-spacing: .04em; }
body.mode-model #credit, body.mode-model #facts-jump { display: none !important; }
body:not(.mode-facts) #facts-jump { display: none !important; }
.ffoot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.panel-credit { margin: 0; font-size: 11.5px; color: var(--muted); }
.load-credit { position: absolute; bottom: 22px; color: var(--muted); font-size: 12px; }

/* Tablets and phones: one row of tabs at the top; topics are picked from the bottom bar instead */
@media (max-width: 1100px) {
  #topics, #facts-nav { display: none; }
  .slide { padding-top: 76px; }
  #slide-name { display: inline; font-weight: 600; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #slide-pick .caret { display: inline; }
  #slide-pick { gap: 6px; }
  #facts-jump { display: flex; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 9; gap: 8px;
    align-items: center; padding: 10px 18px; border-radius: 999px; background: var(--bg); backdrop-filter: blur(8px);
    font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
  #facts-band { height: 66px; }
  .fwrap { padding-top: 56px; }
  .fhead { scroll-margin-top: 66px; }
  .fwrap { padding-bottom: 90px; }
}

/* ------------------------------------------------------------ responsive */
#tabs .short { display: none; }
#tabs button { white-space: nowrap; }

/* Tablet: side panel and caption must not overlap, slides go single-column */
@media (max-width: 1100px) {
  #caption { left: 332px; right: 16px; width: auto; max-width: none; }
  #panel.hide ~ #caption { left: 16px; }
  .split { grid-template-columns: 1fr; gap: 16px; }
  .split .big img { max-height: 38vh; }
  .thumbs img { aspect-ratio: 16/9; }
  .stack { grid-template-columns: repeat(3, 1fr); }
  .stack img { aspect-ratio: 4/3; max-height: none; }
  .facts { gap: 7px; }
  .cards.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cards.small .card img { aspect-ratio: 16/10; }
}
/* Short wide screens (iPad landscape, 1366×768 laptops): slimmer photos so every slide fits */
@media (min-width: 761px) and (max-height: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
  .grid img { aspect-ratio: 16/10; }
  .grid figcaption { margin-top: 3px; font-size: 12px; }
  .cards.small { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
  .cards.small .card img { aspect-ratio: 16/9; }
  .cards.small .card .cb { padding: 7px 10px 9px; }
  .cards.small .card b { font-size: 14px; line-height: 1.25; }
  .cards.small .card span { margin-top: 2px; }
  .cards:not(.small) .card img { aspect-ratio: 16/10; }
  .slide .hint { font-size: 14px; }
}

/* Benefits & costs: tablets and iPads */
@media (max-width: 1100px) {
  .bgrid.four { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .fwrap { padding-left: 24px; padding-right: 24px; }
  .fhead { padding-top: 48px; }
}

/* Landscape tablet: wide but short, so keep photos beside the text */
@media (min-width: 900px) and (max-width: 1100px) and (orientation: landscape) {
  .split { grid-template-columns: 1.2fr 1fr; }
  .split .big img { max-height: 62vh; }
  .stack { grid-template-columns: 1fr; }
  .stack img { aspect-ratio: 16/7; max-height: calc((100vh - 230px) / 3); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
}
@media (max-width: 1100px) and (max-height: 900px) {
  #plant-pop:not(.center) { top: auto; height: min(70vh, 640px); }
}

/* Phone */
@media (max-width: 760px) {
  #tabs { top: 8px; padding: 3px; max-width: calc(100vw - 72px); }
  #tabs button { padding: 6px 12px; font-size: 13px; }
  #tabs .long { display: none; }
  #tabs .short { display: inline; }
  #topics { top: 52px; left: 12px; right: 12px; transform: none; max-width: none; }
  #topics button { font-size: 12px; padding: 4px 10px 4px 4px; }
  .slide { padding: 60px 16px 100px; gap: 10px; }
  .slide > *:not(.plan) { flex-shrink: 0; }  /* let tall slides scroll instead of squeezing photos under the bottom bar */
  #credit { right: 0; left: 0; bottom: 64px; text-align: center; font-size: 10.5px; }
  #intro::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 104px; z-index: 8; pointer-events: none;
    background: linear-gradient(rgba(18,33,28,0), rgba(18,33,28,.94) 55%); }
  body.mode-facts #credit { display: none; }
  #slide-nav { max-width: calc(100vw - 24px); }
  #slide-name { max-width: 52vw; }
  #facts-band { height: 52px; }
  .fwrap { padding-top: 44px; }
  .fhead { scroll-margin-top: 56px; }
  .slide h2 { font-size: 24px; }
  .cover { padding-bottom: 100px; }
  .cover h1 { font-size: 34px; }
  .lede { font-size: 15px; }
  .row button { padding: 9px 16px; font-size: 15px; }
  .split, .ba { grid-template-columns: 1fr; gap: 14px; }
  .split .big img { max-height: 40vh; }
  .facts { font-size: 14px; gap: 7px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid figcaption { font-size: 12px; }
  .cards, .cards.small { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card b { font-size: 14px; }
  .card .cb { padding: 8px 9px 10px; }
  .stack { grid-template-columns: 1fr; }
  .stack img { max-height: none; aspect-ratio: 16/9; }
  #slide-nav { bottom: 12px; }

  /* 3D model: panel starts collapsed (see app.js); open with the ☰ button */
  #show-panel { top: 52px; left: 12px; padding: 6px 10px; }
  #panel { top: 52px; left: 12px; right: 12px; width: auto; bottom: auto; max-height: calc(100vh - 170px); padding: 14px; }
  #panel.hide { transform: translateY(calc(-100% - 70px)); }
  #panel .help { display: none; }
  #caption { left: 12px !important; right: 12px; width: auto; bottom: 12px; padding: 10px 12px; gap: 10px; }
  #cap-num { width: 28px; height: 28px; font-size: 13px; }
  #cap-title { font-size: 16px; }
  #cap-text { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  #caption.expanded #cap-text { -webkit-line-clamp: unset; }
  .plabel { font-size: 11px; padding: 3px 6px; }
  .plabel b { font-size: 11.5px; }
  .plabel small { display: none; }
  #plant-pop:not(.center) { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; height: 72vh; }
  #plant-pop.center { width: calc(100vw - 24px); max-height: 86vh; }
  #plant-pop.center > img { max-height: 34vh; }
  #plant-pop.center .pop-body { max-height: none; padding: 16px 18px; }

  /* Benefits & costs */
  #facts-nav { top: 52px; margin: 52px 12px 0; width: auto; max-width: none; justify-content: space-between; }
  #facts-nav a { padding: 6px 10px; font-size: 12.5px; }
  #facts-nav .long { display: none; }
  #facts-nav .short { display: inline; }
  #facts-band { right: 0; }
  .fwrap { padding-left: 16px; padding-right: 16px; }
  .fhead { padding-top: 36px; }
  .fhead .kicker { font-size: 12px; }
  .fhead h2 { font-size: 24px; line-height: 1.2; }
  .fhead .lede { font-size: 15px; margin: 10px 0 0; }
  .bgrid, .bgrid.four { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
  .bgrid article { padding: 14px 15px; }
  .bgrid h3 { font-size: 16px; }
  .bgrid ul, .bgrid p { font-size: 14px; }
  .warn { font-size: 14px; padding: 10px 12px; }
  .bcontrols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .bcontrols label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
  .bcontrols label input, .bcontrols label select { width: 100%; }
  .bcontrols label:nth-child(3) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .bcontrols label:nth-child(3) input { width: 80px; }
  .bcontrols button { text-align: center; font-size: 13px; padding: 8px; }
  .bcontrols button:last-child { grid-column: 1 / -1; }
  .tiles { gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile b { font-size: 17px; }
  .btable { overflow: visible; }
  .btable caption { font-size: 17px; }
  /* cost tables become one card per item: name on top, Qty / Rate / Amount underneath */
  .btable table:not(.proj) thead { display: none; }
  .btable table:not(.proj) tbody tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 10px; align-items: end;
    padding: 10px 0; border-bottom: 1px solid var(--line); }
  .btable table:not(.proj) td { border: none; padding: 0; }
  .btable table:not(.proj) td.item { grid-column: 1 / -1; font-size: 14px; line-height: 1.35; }
  .btable table:not(.proj) td.unit { display: none; }
  .btable table:not(.proj) td[data-l]::before { content: attr(data-l); display: block; text-align: left; color: var(--muted);
    font-size: 11px; margin-bottom: 3px; }
  .btable table:not(.proj) td.amt { align-self: end; padding-bottom: 5px; font-weight: 600; }
  .btable input { width: 100%; padding: 6px 7px; font-size: 14px; }
  .btable table:not(.proj) tfoot tr { display: flex; justify-content: space-between; }
  .btable table:not(.proj) tfoot td { padding: 10px 0 0; }
  .addons { max-width: none; grid-template-columns: 1fr auto; text-align: left; }
  .addons label { display: flex; align-items: center; gap: 6px; }
  .addons span, .addons b:nth-of-type(2) { text-align: right; }
  .btable table.proj { font-size: 12.5px; table-layout: fixed; width: 100%; }
  .btable table.proj caption { font-size: 16px; line-height: 1.3; }
  .btable table.proj .cum { display: none; }
  .btable table.proj td, .btable table.proj th { padding: 6px 4px; }
  .btable table.proj td:first-child, .btable table.proj th:first-child { width: 34%; }
}
