
/* ===== map rebuild: MapLibre host, static layout (no scroll reveal), click card, layer list ===== */
.reveal{height:auto!important}
.stage{position:relative!important;height:100vh;height:100svh;min-height:640px;overflow:hidden}
.mapwrap{transition:none!important;-webkit-mask:linear-gradient(180deg,transparent 0,#000 40px);mask:linear-gradient(180deg,transparent 0,#000 40px)}
.mapwrap .gl{position:absolute;inset:0}
.mapwrap .gl .maplibregl-canvas{outline:none}
.maplibregl-ctrl-attrib{background:rgba(27,31,37,.78)!important;color:var(--soft)!important;font-family:var(--mono);font-size:10px!important;line-height:1.4;max-width:min(720px,94vw);white-space:nowrap}
.maplibregl-ctrl-attrib a{color:var(--blue-1)!important}
.maplibregl-ctrl-bottom-left{left:50%;bottom:0;transform:translateX(-50%)}
.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0}
.maplibregl-cooperative-gesture-screen{font-family:var(--mono)}
.maperr{position:absolute;inset:40% 10% auto;text-align:center;color:var(--soft)}
.zoom{z-index:5;bottom:36px}
.js .rise,.js .shown .rise{opacity:1!important;transform:none!important;transition:none!important}
.take .ch,.ty .ch{visibility:visible}
.take{pointer-events:none}
/* right column: layer list scrolls if it grows, legend stays at the bottom */
.right{min-height:0;overflow:hidden}
.ovl{flex:0 1 auto;min-height:0;overflow:auto;scrollbar-width:thin;pointer-events:auto;align-content:start}
.ovl button{height:auto;min-height:28px;padding:3px 0;line-height:1.25}
.ovl button small{display:block;font-size:10px;color:var(--dim)}
.ovl button.mr{color:var(--blue-1);justify-content:flex-start;margin-top:4px;border:1px solid var(--line);padding:6px 8px}
.ovl button.mr:focus-visible{outline:2px solid var(--blue-1);outline-offset:2px}
.ovl button.mr .icon{margin-left:auto;transition:none}
.ovl button.mr[aria-expanded="true"] .icon{transform:rotate(180deg)}
.ovm{display:grid;gap:0;padding-left:0;border-left:1px solid var(--line);margin-left:4px}
.ovm button{padding-left:8px}
.ovt{display:grid;gap:0;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.ovt button i{border-radius:2px}
.legend{pointer-events:auto;flex:none;max-height:58%;overflow:auto;scrollbar-width:thin}
.legend a{color:var(--blue-1)}
.lg-n{font-size:10px;line-height:1.35;color:var(--dim)}
.lg-k i.fl{border-radius:1px;width:9px;height:9px;background:#E8483E}
.lg-k i.ft{border-radius:0;width:10px;height:0;border-top:1px solid #EAF8FF;background:none;margin:5px 0}
.lg-k i.dt{width:7px;height:7px;background:#B8CCE1}
.pmix{display:grid;gap:6px;margin-top:4px}
.pmix .pm-h{font-size:11px;line-height:1.3}
.pmix svg{width:100%;height:12px;display:block}
.pmix ul{list-style:none;display:flex;flex-wrap:wrap;gap:4px 16px;font-size:11px}
.pmix li{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.pmix li i{width:8px;height:8px;border-radius:50%}
.pmix li b{font-weight:500}
/* country card: click only, wider, sections open, "Read more" pinned at the bottom */
.hcard{width:392px!important;max-height:calc(100% - 88px)!important;overflow:auto!important;scrollbar-width:thin!important;animation:none!important;transition:none!important}
.hcard .pmix{padding:0 16px 16px;margin:0;color:#33404F}
.hcard .pmix ul{font-size:12px}
.hc-n{padding:8px 16px 16px;font-size:12px;color:#33404F}
details.sec-c summary{height:44px}
details.sec-c ul{font-size:13px;padding-bottom:16px}
.hc-f{position:sticky;bottom:0;padding:12px 16px;background:var(--paper);border-top:1px solid rgba(22,32,44,.14)}
.hc-f .rm{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:40px;background:var(--dark);color:#fff;font-family:var(--head);font-weight:700;font-size:14px}
.hc-f .rm:hover{background:#25364A}
.hc-f .rm:focus-visible{outline-color:var(--accent)}
.figs b.sm{font-size:20px}
@media (max-width:980px){
  .stage{height:auto!important;min-height:0}
  .mapwrap{height:68svh;min-height:420px;max-height:640px;aspect-ratio:auto!important}
  .hcard{position:absolute!important;left:8px!important;right:8px;width:auto!important}
  .right{overflow:visible}.ovl{overflow:visible}.legend{max-height:none}
  .zoom{bottom:44px}
}
@media (prefers-reduced-motion:reduce){.maplibregl-canvas{transition:none}}

/* legend: calculation notes hidden until the info button is pressed */
#legend{position:relative}#legend .lg-n{display:none}#legend.info .lg-n,#legend .lg-n.keep{display:block}
#legend .lg-n.keep{font-size:11px;color:#E8907F}
.lg-i{position:absolute;top:12px;right:12px;width:24px;height:24px;display:grid;place-items:center;color:var(--dim)}.lg-i:hover,.lg-i[aria-expanded="true"]{color:#fff}
#legend>span:first-of-type{padding-right:32px}

/* layout: framed map (legend inside) on the left, controls on the right, layers under the map; one 24px grid */
.mapbox{position:relative;border:1px solid var(--line);overflow:hidden}
.hcard{max-height:calc(100% - 32px)!important}
@media (min-width:981px){
  .stage{overflow:visible;display:grid;grid-template-columns:minmax(0,1fr) var(--col);
    grid-template-areas:"take take" "map ctl" "below ctl";gap:24px;align-items:start;padding:calc(var(--hdr) + 24px) 32px 48px;max-width:1600px;margin:0 auto}
  .ui{display:contents}
  .tk-box{grid-area:take;display:flex;align-items:flex-end;min-height:calc(var(--tk) * 2.5)}
  .take{max-width:none;min-height:0;margin:0;width:fit-content}
  .mapbox{grid-area:map;align-self:stretch;min-height:0}
  .mapbox .mapwrap{position:absolute;inset:0;-webkit-mask:none;mask:none}
  .left{grid-area:ctl;align-self:stretch;gap:16px;overflow:hidden}
  .left .kcard{flex:1 1 auto;overflow:auto;scrollbar-width:thin}
  .right{grid-area:below;display:block;overflow:visible}
  /* the whole map page fits one window: map takes what the header, headline and the layers row leave */
  .stage{height:100vh;min-height:600px;grid-template-rows:auto minmax(0,1fr) auto;padding:calc(var(--hdr) + 16px) 32px 24px}
  .tk-box{min-height:0}
  /* layers: one row under the map */
  .ovl{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;padding:12px 16px;overflow:visible}
  .ovl .ovl-s{width:280px;margin:0}
  .ovt{display:flex;flex-wrap:wrap;gap:0 16px;margin:0;padding:0;border:0}
  .ovt button{width:auto}
  /* legend: small see-through card inside the map */
  #legend{position:absolute;left:16px;bottom:16px;z-index:4;width:320px;grid-template-columns:minmax(0,1fr);max-height:calc(100% - 32px);overflow:auto;padding:12px;background:rgba(27,31,37,.72);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:1px solid var(--line)}
  .zoom{bottom:12px}
}
/* layer dropdown */
.ovl-s{width:100%;height:32px;margin-top:6px;padding:0 32px 0 8px;font:inherit;font-size:12px;color:#fff;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23B8CCE1' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center/12px;border:1px solid var(--line);border-radius:0;appearance:none;cursor:pointer}
.ovl-s:hover{border-color:rgba(255,255,255,.35)}
.ovl-s:focus-visible{outline:2px solid var(--blue-1);outline-offset:2px}
.ovl-s option,.ovl-s optgroup{background:var(--card);color:#fff}
@media (max-width:980px){.mapbox{order:2}.tk-box{order:1}}
/* farms-flagged card: pressure shares, overlap, chart; equal 16px rhythm, chart + its caption kept together */
.kc-b{justify-content:flex-start;gap:16px}
.kc-b>.pmix{margin:0;padding-bottom:16px;border-bottom:1px solid var(--line)}
.kc-g{display:grid;gap:8px;flex:0 1 auto;min-height:0}
.kc-g .kchart svg{max-height:120px}
/* commodity / indicator pickers: click-to-open search dropdowns */
.lr{cursor:pointer;padding-right:36px}
.lr .ar{right:12px;top:0;bottom:0;justify-content:center;pointer-events:none;color:var(--soft)}
.lr .ar svg{width:12px;height:8px}
.lr:hover{background:rgba(255,255,255,.05)}
.lr:focus-within .ar{transform:rotate(180deg)}
.lr .li{cursor:pointer}.lr .li:focus{cursor:text}
/* tutorial pointer: readable on the orange map */
#tour-dot{box-shadow:0 0 0 2px #fff,0 0 0 6px rgba(0,0,0,.35)}
#tour-line line{stroke:#fff;stroke-width:1.5}
/* commodity / indicator pickers: same outlined button as the cover's view picker; label centred, even padding */
.ledger.card{background:none;padding:0;gap:16px}
.ledger .lr{height:48px;padding:0 36px;border:1px solid rgba(255,255,255,.25);background:rgba(0,0,0,.35);transition:border-color .25s,background .25s}
.ledger .lr+.lr{border-left:1px solid rgba(255,255,255,.25)}
.ledger .lr:hover,.ledger .lr:focus-within{background:rgba(0,0,0,.55);border-color:#fff;box-shadow:none}
.ledger .li{text-align:center;font-family:inherit;font-weight:300;font-size:15px}
.ledger .lr .ar{right:14px}
.ledger .sug{width:calc(50% - 8px);top:calc(100% + 4px)}
.ledger .s-ind{left:auto;right:0}
.ledger.card{grid-template-columns:1fr;gap:12px}
.ledger .lr+.lr{border-left:1px solid rgba(255,255,255,.25)}
.ledger .sug{width:100%;left:0;right:auto}
.ledger .s-com{top:52px}
.ledger .s-ind{top:calc(100% + 4px)}
/* farms-flagged card fits beside the map at 1279x707: tighter header, one 12px rhythm */
@media (min-width:981px){
  .kc-h{padding:12px 16px}
  .kc-h b{min-width:48px;height:48px;font-size:20px}
  .kc-b{padding:12px 16px;gap:12px}
  .kc-b>.pmix{padding-bottom:12px}
  .kc-g{flex:1 1 72px;grid-template-rows:minmax(48px,1fr) auto}
  .kc-g .kchart{min-height:0}
  .kc-g .kchart svg{height:100%;max-height:120px}
}
/* country page: one window; ranking wheel on the left, country sheet on the right */
.rail{display:none}
@media (min-width:981px){
  .rank-st{height:100vh;display:grid;grid-template-rows:auto minmax(0,1fr)}
  .rank-b{display:grid;grid-template-columns:224px minmax(0,1fr);min-height:0}
  .rail{display:block;position:relative;overflow:hidden;cursor:pointer;border-right:1px solid var(--line);-webkit-mask:linear-gradient(180deg,transparent,#000 18%,#000 82%,transparent);mask:linear-gradient(180deg,transparent,#000 18%,#000 82%,transparent)}
  .ri{position:absolute;left:16px;right:16px;top:50%;display:grid;justify-items:center;gap:8px;transition:transform .35s var(--ease),opacity .35s var(--ease)}
  /* only the silhouettes shrink down the wheel; labels stay 12px, and only the current and next-door names show */
  .ri svg{width:132px;height:88px;overflow:visible;transform:scale(var(--s,1));transform-origin:50% 100%;transition:transform .35s var(--ease)}
  .ri:not(.cur):not(.nb) span{visibility:hidden}
  .ri path{fill:var(--blue-2)}
  .ri.cur path{fill:var(--blue-1)}
  .ri span{font-size:12px;line-height:1.3;color:var(--soft);text-align:center;text-wrap:balance}
  .ri.cur span{color:#fff;font-size:13px}
  .sheet{min-height:0;overflow:auto;padding:24px 32px}
}
@media (prefers-reduced-motion:reduce){.ri{transition:none}}
@media (min-width:981px){
  .sheet-in{gap:16px}
  .sh-n{font-size:clamp(36px,6.5vh,64px)}
  .tabp{gap:24px}
  .win{row-gap:20px}
  .hl{font-size:clamp(18px,min(1.9vw,3.4vh),28px)}
  .blk{padding-top:16px;gap:12px}
  .donut{width:clamp(120px,min(11vw,21vh),170px);gap:8px}
  #tab-industry .lg{display:grid;grid-template-columns:1fr 1fr;column-gap:24px;row-gap:2px;width:100%}
  #tab-industry .lg li{min-height:24px}
}
@media (min-width:981px){
  /* policy tab: support/punish on the left, traps on the right, side by side */
  #tab-policy:not([hidden]){display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:32px;align-items:start}
  #tab-policy>.win{grid-template-columns:minmax(0,1fr);gap:16px}
  #tab-policy>.win>*{grid-column:1/-1}
  #tab-policy .tr-g{grid-template-columns:1fr;gap:8px}
  #tab-policy .spw{grid-template-columns:1fr;row-gap:12px}
}
@media (min-width:981px){
  #tab-policy>.win{gap:12px}
  #tab-policy .hl{font-size:clamp(16px,min(1.5vw,2.8vh),24px)}
  #tab-policy #sp-insight{font-size:14px;line-height:1.45}
  #tab-policy #sp-def{font-size:12px}
  #tab-policy .mchart svg{height:clamp(64px,10vh,180px)}
  .donut{width:clamp(110px,min(10vw,18vh),160px)}
}
@media (min-width:981px){
  /* name and tabs share one row so both tabs fit the window */
  .sheet{padding:16px 32px}
  .sheet-in{grid-template-columns:auto 1fr;align-items:end;column-gap:32px}
  .sheet-in>.wins{grid-column:1/-1}
  .sheet-in>#cp-tabs{justify-self:end;border-bottom:0}
}
@media (min-width:981px){
  /* donut pair and crop list share two equal columns, so each list column sits under a donut */
  .pair{display:grid;grid-template-columns:1fr 1fr;column-gap:24px;justify-items:center}
  .donut{width:clamp(120px,min(100%,21vh),240px)}
  .dcap{white-space:nowrap}
  .ioc .lg{max-width:none}
  #tab-industry .lg li{min-height:20px;font-size:12px}#tab-industry .lg button{padding:2px 8px}
  .sheet-in{row-gap:12px}
}
@media (min-width:981px){
  .sheet{padding:20px 32px 12px}
  .sheet-in{grid-template-columns:minmax(0,1fr) auto}
  .sh-n{font-size:clamp(28px,min(6.5vh,3.2vw),64px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tabp{gap:16px}
  .win{row-gap:14px}
}
/* layer row joined to the map frame; label centred, in capitals */
@media (min-width:981px){
  .right{margin-top:-24px}
  .ovl{border:1px solid var(--line);border-top:0}
}
.ovl .ovl-h{margin:0;align-self:center;text-transform:uppercase;letter-spacing:.08em;font-size:12px;line-height:1}
/* country card: header and close button stay at the top while the card scrolls */
.hc-h{position:sticky;top:0;z-index:2;background:var(--grain-dark),var(--paper)}
@media (min-width:981px){
  .kc-b .pmix .pm-h{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .kc-g{grid-template-rows:minmax(40px,1fr) auto;flex-basis:56px}
}
/* ---- country page redesign (25 Nov) ---- */
/* no top bar: search sits above the ranking wheel */
.rcol{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0}
.rcol .inp{width:auto;margin:24px 16px 8px}
@media (min-width:981px){
  .rank-st{grid-template-rows:minmax(0,1fr)}
  .rcol{border-right:1px solid var(--line)}
  .rcol .rail{border-right:0}
  .sheet-in{align-items:center}
}
/* Industry / Policy: two-tone switch */
#cp-tabs{display:inline-flex;gap:0;border:1px solid var(--line);justify-self:end}
#cp-tabs button{margin:0;border:0;padding:8px 20px;background:rgba(255,255,255,.04);color:var(--soft);font-size:13px}
#cp-tabs button:hover{color:#fff}
#cp-tabs button[aria-selected=true]{background:#2759B8;color:#fff}
/* crop lists: one card, two columns in two tones, filled column by column */
.ioc .lg{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(var(--r),auto);grid-auto-flow:column;gap:0;padding:6px 0;border:1px solid var(--line);background:linear-gradient(90deg,rgba(255,255,255,.07) 50%,rgba(255,255,255,.03) 50%)}
.ioc .lg button{padding:5px 16px;border-radius:0}
.ioc .lg button[aria-pressed=true]{box-shadow:inset 2px 0 0 var(--blue-1);background:rgba(184,204,225,.16)}
/* prose keeps three lines of room so hovering never shifts the charts */
#ind-prose{min-height:3.45em}
/* country card docked above the legend: same width, 16px margins */
@media (min-width:981px){.hcard{width:320px!important}}
/* legend: info icon level with the layer title; notes open in their own card beside the legend */
.lg-i{top:9px;right:10px}
.lg-pop{position:absolute;left:352px;bottom:16px;z-index:6;width:280px;padding:12px;display:grid;gap:6px;background:rgba(27,31,37,.92);border:1px solid var(--line);font-size:11px;line-height:1.45;color:var(--soft)}
.lg-pop[hidden]{display:none}
.lg-pop .lg-n{display:block;font-size:11px;color:var(--soft)}
.lg-pop a{color:var(--blue-1)}
@media (max-width:980px){.lg-pop{left:16px;right:16px;width:auto;bottom:auto;top:16px}}
/* farms-flagged card: overlap block and an HTML 1-5 histogram with real-size labels */
.kc-b .ko{font-size:15px}
.kc-g{display:grid;grid-template-rows:auto minmax(72px,1fr);gap:8px;flex:1 1 auto;min-height:0}
.kbars{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;min-height:0;height:100%;max-height:180px}
.kb{display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;gap:4px;min-height:0;cursor:default}
.kb i{align-self:end;width:56%;min-height:2px;background:#2759B8}
.kb:hover i{background:#3A6FD0}
.kv{font-size:11px;color:var(--soft);font-variant-numeric:tabular-nums}
.kx{font-size:12px;color:#fff}
/* crop list: one row per crop, name | US$ | share; name column in one tone, figures in another; the lists fill the page height */
#tab-industry .ioc .lg{display:grid;grid-template-columns:1fr;grid-template-rows:none;grid-auto-flow:row;grid-auto-rows:minmax(21px,1fr);gap:0;padding:0;border:1px solid var(--line);background:linear-gradient(90deg,rgba(255,255,255,.075) 0 52%,rgba(255,255,255,.025) 52% 100%)}
#tab-industry .ioc .lg li{min-height:0}
#tab-industry .ioc .lg button{display:grid;grid-template-columns:52% 28% 20%;gap:0;height:100%;padding:0;align-items:center}
#tab-industry .ioc .lg .c{display:flex;align-items:center;gap:8px;padding:0 16px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tab-industry .ioc .lg .v,#tab-industry .ioc .lg .p{text-align:right;padding:0 16px;font-variant-numeric:tabular-nums;min-width:0}
.ioc .lg .p{color:var(--soft)}
@media (min-width:981px){
  .sheet-in{height:100%;grid-template-rows:auto minmax(0,1fr)}
  .wins,#tab-industry:not([hidden]),#tab-industry>.win{height:100%;min-height:0}
  #tab-industry>.win{display:grid;grid-template-rows:auto minmax(0,1fr)}
  #tab-industry .ioc{min-height:0;align-items:stretch}
  #tab-industry .blk{grid-template-rows:auto auto minmax(0,1fr);min-height:0}
}
/* ranking wheel: own background; the selected country is a filled shape, the others outlines */
@media (min-width:981px){.rcol{background:#15191F}}
.rail.live .ri{transition:none}
.ri path{fill:none;stroke:#698EBF;stroke-width:1.2;vector-effect:non-scaling-stroke}
.ri.cur path{fill:#DCE9F6;stroke:none}
/* industry prose: a card on its own tone, upright text, figures bold and blue */
#ind-prose{font-style:normal;background:rgba(255,255,255,.05);border:1px solid var(--line);padding:14px 20px;min-height:calc(4.2em + 30px);line-height:1.4;font-size:clamp(16px,min(1.5vw,2.8vh),22px)}
#ind-prose b{font-weight:700;color:var(--num,#8FC3F2)}
.kb{grid-template-rows:minmax(0,1fr) auto}
#ind-prose{font-size:clamp(18px,min(1.9vw,3.3vh),28px)}
@media (min-width:981px){.rail{-webkit-mask:linear-gradient(180deg,#000 0,#000 85%,transparent);mask:linear-gradient(180deg,#000 0,#000 85%,transparent)}}
/* industry: Benefits and Costs each in an outlined frame like the map; no rule above them */
#tab-industry .blk{border-top:0;border:1px solid var(--line);padding:12px 16px 16px}
#tab-industry .ioc .lg{border:0}
@media (min-width:981px){.sheet{padding-bottom:20px}}
/* frame holds the title and donuts; the crop list sits below it, outside the outline */
#tab-industry .blk{border:0;padding:0;gap:12px}
#tab-industry .frm{display:grid;gap:12px;border:1px solid var(--line);padding:12px 16px 16px}
@media (min-width:981px){#tab-industry .blk{grid-template-rows:auto minmax(0,1fr)}}
/* crop list: fixed figure columns, the same 16px padding in every cell; name column in its own tone */
#tab-industry .ioc .lg{background:rgba(255,255,255,.025)}
#tab-industry .ioc .lg button{grid-template-columns:minmax(0,1fr) 11ch 7ch}
#tab-industry .ioc .lg .c{background:rgba(255,255,255,.06);height:100%;padding:0 16px}
#tab-industry .ioc .lg .v,#tab-industry .ioc .lg .p{padding:0 16px}
#tab-industry .ioc .lg .nd{color:var(--dim);cursor:default}
#tab-industry .ioc .lg .nd i{background:none!important;border:1px solid var(--dim)}
#tab-industry .ioc .lg button.nd:hover{background:none}
@media (min-width:981px){#tab-industry .ioc .lg{grid-auto-rows:minmax(19px,1fr)}#tab-industry .blk{gap:8px}}
/* industry prose: always two lines, sized to the box width (container units) so the two lines fill it */
#tab-industry>.win{container-type:inline-size}
#ind-prose{font-size:clamp(17px,2.3cqw,40px);line-height:1.35;min-height:calc(2.7em + 32px);padding:16px 20px}
/* name row: country name | bottom-X% slider | Industry/Policy switch, all on one centre line */
@media (min-width:981px){
  .sheet-in{grid-template-columns:minmax(0,1fr) auto auto;column-gap:24px;align-items:center}
  .sh-n{line-height:1}
  .cp-thr{width:240px}
}
@media (max-width:980px){.cp-thr{grid-column:1/-1}}
/* adversarial-pass fixes (25 Nov) */
@media (max-width:980px){#cp-tabs{margin:16px 0}.cp-thr{margin-top:16px}}
.lg-a::before{background:rgba(255,255,255,.35);outline:1px solid rgba(255,255,255,.6);outline-offset:-1px}
.zoom{background:rgba(27,31,37,.72);border:1px solid var(--line)}
#tab-industry .ioc .lg button[aria-pressed=true]{box-shadow:inset 0 0 0 1px var(--blue-1);background:rgba(184,204,225,.16)}
.dcap .ikey{display:flex;justify-content:center;flex-wrap:wrap;gap:2px 10px;margin-top:4px;font-size:11px;white-space:nowrap}
.dcap .ikey span{display:inline-flex;align-items:center;gap:4px}
.dcap .ikey i{width:8px;height:8px;border-radius:50%}
@media (min-width:981px){
  #tab-policy:not([hidden]){height:100%;min-height:0;align-items:stretch}
  #tab-policy>.win{min-height:0;align-content:start}
  #tab-policy>.win:last-child{overflow:auto;scrollbar-width:thin;padding-right:4px}
}
/* industry: crop list joined to the bottom of its chart frame */
#tab-industry .blk{gap:0}
#tab-industry .ioc .lg{border:1px solid var(--line);border-top:0}

/* ---- Policy tab (edits doc, 25 Nov) ---- */
/* headline in a box like the Industry prose */
#tab-policy>.win:first-child{container-type:inline-size}
#tab-policy .mhl{font-style:normal;background:rgba(255,255,255,.05);border:1px solid var(--line);padding:14px 20px;line-height:1.35;font-size:clamp(16px,3.3cqw,30px);margin:0}
#tab-policy .mhl b{font-weight:700;color:var(--num,#8FC3F2)}
/* switch with a ? that explains support and punish */
#tab-policy .spw{display:flex;align-items:center;gap:12px;position:relative}
.sp-q{width:28px;height:28px;border-radius:50%;border:1px solid var(--blue-2);background:none;color:var(--blue-1);font:700 14px var(--mono);cursor:pointer;flex:none}
.sp-q:hover,.sp-q[aria-expanded=true]{color:#fff;border-color:#fff}
.sp-q:focus-visible{outline:2px solid var(--blue-1);outline-offset:2px}
#sp-def{position:absolute;left:0;top:calc(100% + 8px);z-index:6;width:min(420px,100%);margin:0;padding:12px 14px;display:grid;gap:6px;background:rgba(27,31,37,.96);border:1px solid var(--line);font-size:12px;line-height:1.5;color:var(--soft)}
#sp-def[hidden]{display:none}
#sp-def b{color:#fff;font-weight:700}
/* figures, a larger chart, and the legend under it: indicators on one line, the two reference keys on the next */
@media (min-width:981px){
  #tab-policy>.win:first-child{display:flex;flex-direction:column;height:100%;min-height:0}
  #tab-policy .money{flex:1 1 auto;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px}
  #tab-policy .mchart{min-height:0;grid-template-rows:minmax(0,1fr) auto}
  #tab-policy .mchart svg{height:100%;min-height:120px}
  #tab-policy .ax-y{margin:-7px 0 0}
}
#tab-policy .mbar{display:grid;gap:8px;border:0;padding:0}
#tab-policy .mbar .lg2{display:flex;gap:24px;font-size:12px;color:var(--soft)}
#tab-policy .mbar .lg2 span{display:inline-flex;align-items:center;gap:6px}
/* traps: five cards fill the column; each has a toned title band over its description. Ones that apply are solid with a red ! whose tooltip says why.
   Opened, a card fills the area of all five: title band, a toned "why" band, the description, then the case study as a ledger */
#tab-policy .trap.card{position:relative;opacity:1;display:grid;gap:0;padding:0;align-content:start;border:1px solid var(--line);transition:border-color .2s}
#tab-policy .trap.card:not(.hit){background:none}
#tab-policy .trap:not(.open):hover{border-color:rgba(255,255,255,.35)}
.tp-h{position:relative;display:flex;align-items:center;gap:12px;padding:12px 16px;background:rgba(0,0,0,.24);border-bottom:1px solid var(--line)}
.trap:not(.hit) .tp-h{background:rgba(255,255,255,.05)}
.tp-t{all:unset;flex:1;min-width:0;font-family:var(--head);font-weight:700;font-style:italic;font-size:15px;line-height:20px;color:#fff;cursor:pointer}
.trap:not(.hit) .tp-t{color:var(--soft)}
.tp-x{all:unset;box-sizing:border-box;flex:none;width:20px;height:20px;border-radius:50%;background:var(--alert);color:#fff;font:700 13px/20px var(--head);font-style:normal;text-align:center;cursor:help}
.tp-c{all:unset;box-sizing:border-box;flex:none;display:grid;place-items:center;width:24px;height:24px;margin:-2px -4px -2px 0;color:var(--soft);cursor:pointer}
.tp-c:hover{color:#fff}.tp-c[hidden]{display:none}
:is(.tp-t,.tp-x,.tp-c):focus-visible{outline:2px solid var(--blue-1);outline-offset:2px}
/* why: a tooltip on the ! (hover or focus); the transparent ::before bridges the gap so the pointer can move onto it */
.tp-tip{display:none;position:absolute;z-index:5;right:8px;top:calc(100% - 4px);width:max-content;max-width:min(320px,calc(100% - 16px));padding:8px 12px;background:rgba(27,31,37,.97);border:1px solid var(--line);box-shadow:0 8px 20px rgba(0,0,0,.45);font-size:12px;line-height:1.5;color:#fff;text-wrap:pretty}
.tp-tip::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:16px}
.tp-x:is(:hover,:focus)+.tp-tip,.tp-tip:hover{display:block}
#tab-policy .trap .tp-p{margin:0;padding:12px 16px;font-size:12px;line-height:1.6;color:var(--soft)}
.tp-w{display:none;margin:0;grid-template-columns:20px minmax(0,1fr);gap:12px;padding:12px 16px;background:rgba(198,78,78,.14);border-bottom:1px solid var(--line);font-size:13px;line-height:20px;color:#fff;text-wrap:pretty}
.tp-w .tp-x{cursor:default}
/* opened */
.trap.open .tp-h>.tp-x,.trap.open .tp-tip{display:none}
.trap.open .tp-w{display:grid}
#tab-policy .tr-g:has(.trap.open)>.trap:not(.open){display:none}
#tab-policy .trap.open{align-self:stretch;overflow:auto;scrollbar-width:thin}
#tab-policy .trap-case{display:grid;gap:12px;margin:0;padding:4px 16px 16px;border:0;font-size:12px;line-height:20px}
#tab-policy .trap-case[hidden]{display:none}
.tc-h{margin:0;font-family:var(--head);font-weight:700;font-style:italic;font-size:14px;color:#fff}
.trap-case dl{margin:0;display:grid;grid-template-columns:max-content minmax(0,1fr);border:1px solid var(--line)}
.trap-case :is(dt,dd){margin:0;padding:12px 16px;border-top:1px solid var(--line)}
.trap-case :is(dt,dd):nth-child(-n+2){border-top:0}
.trap-case dt{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--blue-1);background:rgba(255,255,255,.04);border-right:1px solid var(--line)}
.trap-case dd{color:var(--soft);text-wrap:pretty}
.trap-case dd::first-letter{text-transform:uppercase}
@media (min-width:981px){
  #tab-policy>.win:last-child{display:flex;flex-direction:column;overflow:visible;padding-right:0}
  #tab-policy .traps{flex:1 1 auto;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);border:0;padding:0}
  /* all five share the column; the description clips rather than spill when the window is very short */
  #tab-policy .tr-g{display:flex;flex-direction:column;height:100%;min-height:0}
  #tab-policy .trap.card{flex:1 1 0;min-height:0;grid-template-rows:auto minmax(0,1fr)}
  #tab-policy .trap:not(.open) .tp-p{overflow:hidden}
  #tab-policy .trap.open{flex:1 1 auto;grid-template-rows:none}
}
@media (min-width:981px){
  #tab-policy:not([hidden]){grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}
}
/* commodity cards: a header row (column names, or the indicator key while a crop is chosen), then fixed, even rows; scrolls when they don't fit */
/* five rows fill each list exactly (the indicator list has five); longer commodity lists scroll */
#tab-industry .ioc .lg{grid-auto-rows:max(24px,20%);grid-template-rows:none;align-content:start;overflow-y:auto;scrollbar-width:thin;min-height:0}
#tab-industry .ioc .lg li{height:auto}
#tab-industry .ioc .lg .lg-h{display:grid;grid-template-columns:minmax(0,1fr) 11ch 7ch;align-items:center;font-size:11px;color:var(--soft);text-transform:uppercase;letter-spacing:.06em;position:sticky;top:0;z-index:1;background:#22272E;border-bottom:1px solid var(--line)}
#tab-industry .ioc .lg .lg-h .c{background:none}
#tab-industry .ioc .lg .lg-h.key{display:flex;gap:16px;padding:0 16px;text-transform:none;letter-spacing:0;white-space:nowrap;overflow:hidden}
#tab-industry .ioc .lg .lg-h.key span{display:inline-flex;align-items:center;gap:6px}
#tab-industry .ioc .lg .lg-h.key i{width:8px;height:8px;border-radius:50%}
#tab-industry .dcap{white-space:nowrap}
#tab-industry .ioc .lg{overflow-x:hidden}
#tab-industry .ioc .lg button,#tab-industry .ioc .lg .lg-h{grid-template-columns:minmax(0,1fr) 11ch 8ch}
#tab-industry .ioc .lg .lg-h{letter-spacing:.03em}
#tab-industry .ioc .lg .lg-h .v,#tab-industry .ioc .lg .lg-h .p{text-align:right;padding:0 16px;white-space:nowrap}
/* policy: three stacked bars (20-year totals) in a card, indicator selectors attached underneath */
#tab-policy .money{grid-template-rows:auto minmax(0,1fr)}
.mcard{display:grid;grid-template-rows:minmax(0,1fr) auto;border:1px solid var(--line);min-height:200px}
.mbars{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:16px 16px 8px;min-height:0}
.mb{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:8px;min-height:0}
.mb-a{position:relative;min-height:0}
.mb-a i{position:absolute;left:18%;right:18%;display:block;min-height:1px;cursor:default}
.mb-a i:hover{filter:brightness(1.12)}
.mb-z{position:absolute;left:0;right:0;height:0;border-top:1px solid rgba(255,255,255,.35)}
.mb-l{text-align:center;font-size:11px;color:var(--soft);text-transform:uppercase;letter-spacing:.06em}
.mind{display:flex;flex-wrap:wrap;gap:6px 20px;padding:10px 16px;border-top:1px solid var(--line);background:rgba(255,255,255,.03);font-size:12px}
.mind button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;padding:2px 0;cursor:pointer;color:var(--dim)}
.mind button[aria-pressed=true]{color:#fff}
.mind button i{width:10px;height:10px}
.mind button[aria-pressed=false] i{opacity:.25}
.mind button:focus-visible{outline:2px solid var(--blue-1);outline-offset:2px}
@media (min-width:981px){#tab-policy .mcard{min-height:0}}
/* header ? : smaller, on the nav line */
#tour-btn{width:20px;height:20px;font-size:11px;line-height:1;display:inline-grid;place-items:center;padding:0;vertical-align:middle;align-self:center}
#tab-industry .ioc .lg .lg-h[hidden]{display:none}
#tour-line line+line{stroke:#fff;stroke-width:1.5}
.tour-dot2{position:fixed;z-index:92;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;background:var(--alert);box-shadow:0 0 0 2px #fff,0 0 0 6px rgba(0,0,0,.35);pointer-events:none}
.tour-dot2[hidden]{display:none}
/* "All" rows at the top of each list */
#tab-industry .ioc .lg i.all{background:none;border:1px solid var(--soft)}
#tab-industry .ioc .lg button[aria-pressed=true]{box-shadow:inset 0 0 0 1px var(--blue-1);background:rgba(184,204,225,.16)}
/* second picker: its left edge was held dim by the old column divider, breaking the open/hover outline */
.ledger .lr+.lr:is(:hover,:focus-within){border-left-color:#fff}
/* cover: three equal-width view buttons, equal gaps, centred under the title */
@media (min-width:981px){
  .cv-who{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px;width:min(900px,100%);margin-left:auto;margin-right:auto;justify-content:center}
  .cv-who li{justify-content:stretch}
  .cv-who{margin-top:0}
  .cv-who a{padding:0}
  .cv-who a span{display:block;width:100%;text-align:center;white-space:nowrap}
}
/* cover: title and view buttons centred together on the whole window (the header is transparent over the photo) */
.cv-in{position:absolute;inset:0;align-content:center;padding:0 16px}
/* trap cards, round 2: cards keep their content height so the prose is never clipped; the description sits centred
   in its card with even padding; the open card puts the case study in its own ruled section, larger text, and its
   ledger rows share the free height so the card has no dead space */
#tab-policy .traps>h3{font-style:normal}
#tab-policy .trap .tp-p{padding:12px 16px}
@media (min-width:981px){
  #tab-policy .tr-g{overflow-y:auto;scrollbar-width:thin}
  #tab-policy .trap.card{flex:1 0 auto;grid-template-rows:auto 1fr}
  #tab-policy .trap:not(.open) .tp-p{display:flex;align-items:center;overflow:visible}
}
#tab-policy .trap.open{display:flex;flex-direction:column}
#tab-policy .trap.open .tp-p{flex:none;font-size:14px;line-height:1.6;padding:16px}
#tab-policy .trap.open .tp-w{flex:none;font-size:14px;line-height:22px;padding:14px 16px}
#tab-policy .trap.open .trap-case{flex:1 0 auto;display:flex;flex-direction:column;gap:14px;padding:16px;border-top:1px solid var(--line);font-size:14px;line-height:1.55}
#tab-policy .trap.open .tc-h{margin:0;font-size:15px}
#tab-policy .trap.open .trap-case dl{flex:1 0 auto;grid-auto-rows:1fr}
#tab-policy .trap.open .trap-case :is(dt,dd){display:flex;align-items:center;padding:16px 20px}
#tab-policy .trap.open .trap-case dt{font-size:12px}
#tab-policy .trap.open .tp-p{font-size:15px}
#tab-policy .trap.open .tc-h{font-size:16px}
#tab-policy .trap.open .trap-case dd{font-size:16px;line-height:1.5}
#tab-policy .trap.open .trap-case dt{font-size:13px}
/* estimated output value (FAOSTAT has none: production x world unit value) */
#tab-industry .ioc .lg .v .est{font-size:9px;font-weight:400;letter-spacing:.08em;color:var(--dim);margin-right:6px;vertical-align:1px}
/* cover: one-line definition under the title (WWF Markets Institute preread, Sept 2026); hidden, not removed, while a
   view's question replaces the title, so the group does not jump */
.cv-def{margin:-16px 0 0;max-width:44ch;text-align:center;font-size:clamp(14px,1.3vw,17px);line-height:1.5;color:var(--soft);text-wrap:balance}
#cv-title.q+.cv-def{visibility:hidden}
@media (max-width:980px){.cv-in h1{height:auto}.cv-def{margin-top:-8px}}   /* the title wraps on phones: size it to its lines */
/* the definition spans from the middle of the left view button to the middle of the right one: row width W
   (min(900px,100%), as .cv-who) minus one column, (W-48)/3, so (2W+48)/3 */
@media (min-width:981px){.cv-def{max-width:none;width:calc((2 * min(900px, 100%) + 48px) / 3);font-size:16px}}
.lg-k i.dt.fl{background:#C64E4E}   /* flagged farm dots, as the map's dots-fail layer */
.ovl button[data-t="fields"][aria-pressed="true"] i{background:#9FE3FF;border-color:#9FE3FF}   /* red stays reserved for the bottom areas */
.mb-a i{transition:top .55s cubic-bezier(.2,.7,.2,1),height .55s cubic-bezier(.2,.7,.2,1)}   /* glideBars */
@media (prefers-reduced-motion:reduce){.mb-a i{transition:none}}
/* policy legend: what the grey cost segments are (not toggles) */
.mck{display:contents;color:var(--soft)}
.mck span{display:inline-flex;align-items:center;gap:6px;padding:2px 0;color:var(--soft)}
.mck i{width:10px;height:10px;display:inline-block}
/* policy bars: the total sits just past the end of each bar */
.mbars{padding-top:30px}
.mb-v{position:absolute;left:0;right:0;text-align:center;font:600 12px/1 var(--mono,inherit);font-style:normal;color:#fff;white-space:nowrap;transform:translateY(calc(-100% - 6px));pointer-events:none;animation:mbv .5s ease both}
.mb-v.dn{transform:translateY(calc(-100% - 6px))}  /* inside the end of a bar that runs down to the floor */
@keyframes mbv{from{opacity:0}}
@media (prefers-reduced-motion:reduce){.mb-v{animation:none}}
/* policy figures: hover or focus a figure for its formula and sources */
.mfig>div{position:relative;cursor:help;outline:none}
.mfig>div>b{text-decoration:underline dotted transparent;text-underline-offset:6px;text-decoration-thickness:2px;transition:text-decoration-color .2s}
.mfig>div:is(:hover,:focus-visible)>b{text-decoration-color:rgba(255,255,255,.45)}
.mfig>div:focus-visible{outline:2px solid var(--blue-1);outline-offset:4px}
.mfx{display:none;position:absolute;z-index:7;top:calc(100% + 10px);left:0;width:min(320px,calc(100vw - 32px));padding:14px 16px;background:rgba(27,31,37,.98);border:1px solid var(--line);box-shadow:0 10px 28px rgba(0,0,0,.5);font-size:12px;line-height:1.5;color:#fff;text-transform:none;letter-spacing:0;cursor:default}
.mfx::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:12px}   /* keeps the card open while the pointer crosses the gap */
.mfig>div:last-child .mfx{left:auto;right:0}
.mfig>div:nth-child(2) .mfx{left:50%;transform:translateX(-50%)}   /* middle card centred on its figure, so all three stay inside the window */
.mfig>div:is(:hover,:focus-within) .mfx{display:grid;gap:10px;animation:mbv .15s ease both}
.mfx-f{margin:0;font-family:var(--mono);font-size:12px;color:#fff}
.mfx-f sup{font-size:9px}
.mfx-s{margin:0;padding-top:10px;border-top:1px solid var(--line);font-size:11px;color:var(--dim)}
.mfx-s a{color:var(--soft);white-space:nowrap}.mfx-s a:hover{color:#fff}
@media (prefers-reduced-motion:reduce){.mfig>div:is(:hover,:focus-within) .mfx{animation:none}}
/* traps: smaller headers and one even padding (same on every side of header and prose) that tightens on short
   screens, so all five closed cards fit the column without scrolling */
#tab-policy .traps{--tp:clamp(8px,1.4vh,12px)}
#tab-policy .tp-h{padding:var(--tp);gap:8px}
#tab-policy .tp-t{font-size:clamp(12.5px,1.6vh,14px);line-height:1.3}
#tab-policy .trap:not(.open) .tp-p{padding:var(--tp);font-size:clamp(11.5px,1.5vh,12px);line-height:1.5}
@media (min-width:981px){#tab-policy .tr-g{gap:clamp(6px,1vh,8px)}}
/* phones: the policy bars get real height, and the case-study rows stack label over text instead of squeezing the text */
@media (max-width:980px){
  #tab-policy .mbars{min-height:240px}
  .trap-case dl{grid-template-columns:minmax(0,1fr)}
  .trap-case dt{border-right:0;border-bottom:1px solid var(--line)}
  #tab-policy .trap.open .trap-case :is(dt,dd){padding:10px 14px}
  #tab-policy .trap.open .trap-case dl{grid-auto-rows:auto}
}
/* bar labels reserve two lines, so a label that wraps never lifts its bar off the shared zero line */
.mb-l{min-height:2.4em;line-height:1.2}
/* the map headline wraps evenly rather than leaving one word on its last line */
.take{text-wrap:balance}
/* phones: impact toggles and cost keys meet the 24px tap-target minimum */
@media (max-width:980px){.mind button,.mck span{min-height:24px}}
/* traps column: no visible scrollbar; on very short screens it still scrolls with the wheel or a swipe */
@media (min-width:981px){#tab-policy .tr-g{scrollbar-width:none}#tab-policy .tr-g::-webkit-scrollbar{display:none}}
