/* ============================================================
   ATLAS GLOBE — test page energle.org/globe/ (globe/globe.js)
   ============================================================ */
.at-view { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #ecebe8; border-radius: 999px; background: #fff; }
.at-vbtn { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: #777; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.at-vbtn[aria-pressed="true"] { background: #1a1a1a; color: #fff; }

.gl-layout { display: none; }
body.at-globe .gl-layout { display: block; position: relative; margin-top: 14px; }
body.at-globe #at-list, body.at-globe .at-head, body.at-globe .at-sort, body.at-globe #at-empty { display: none !important; }

/* the map */
.gl-wrap { position: relative; height: min(68vh, 640px); min-height: 420px; border-radius: 12px; overflow: hidden; background: #dfe8f1; border: 1px solid #ecebe8; }
.gl-canvas, .gl-canvas.maplibregl-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.gl-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #888; font-size: .9rem; pointer-events: none; }
.gl-canvas .maplibregl-ctrl-attrib { font-size: 10px; }

/* The panel holds the daily puzzle's own cards (balance card, charts, legend). On phones and tablets it
   sits under the map; on laptops it is a column beside it, wide enough for the cards' desktop layout. */
.gl-side { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.gl-side[hidden] { display: none; }
.gl-p-head { display: flex; align-items: center; gap: 10px; }
.gl-p-head > div { flex: 1; min-width: 0; }
.gl-p-head h3 { margin: 0; font-size: 1.2rem; }
.gl-p-head span { font-size: .78rem; color: #888; }
.gl-flag { width: 32px; height: 23px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.gl-x { width: 32px; height: 32px; border: 1px solid #e0e0e0; border-radius: 50%; background: #fff; font-size: 18px; line-height: 1; color: #777; cursor: pointer; flex-shrink: 0; }
.gl-x:hover { border-color: #1a1a1a; color: #1a1a1a; }
.gl-side #legend-shared { margin: 0; }
.gl-open { align-self: stretch; min-height: 40px; border: 0; border-radius: 6px; background: #1a1a1a; color: #fff; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.gl-open:hover { background: #333; }
.gl-empty { margin: auto 0; padding: 24px; text-align: center; font-size: .88rem; line-height: 1.5; color: #8a8984; }
.gl-empty b { display: block; margin-bottom: 4px; font-size: 1rem; color: #1a1a1a; }
.gl-layout.has-sel .gl-wrap { height: 52vh; min-height: 320px; }      /* phones and tablets: room for the cards below */

/* laptops: the atlas widens while the map is open; the cards sit in a column beside the map */
@media (min-width: 1100px) {
  body.at-globe #app { max-width: min(1520px, calc(100vw - 64px)); }
  body.at-globe .gl-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(560px, 53%, 860px); gap: 20px; align-items: start; }
  body.at-globe .gl-wrap, .gl-layout.has-sel .gl-wrap { position: sticky; top: 12px; height: calc(100vh - 230px); min-height: 520px; max-height: 900px; }
  .gl-side { margin-top: 0; }
  .gl-side[hidden] { display: flex; }
  .gl-empty { border: 1px dashed #e0e0e0; border-radius: 8px; }
}
@media (max-width: 600px) {
  .gl-wrap { height: 70vh; min-height: 380px; }
  .gl-layout.has-sel .gl-wrap { height: 46vh; }
}

/* ---------- guess map: the Map button in the guess bar shows the globe inside the page ---------- */
.gm-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border: 1.5px solid #1a1a1a; border-radius: 6px;
  background: #fff; color: #1a1a1a; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.gm-btn:hover { background: #f4f3ef; }
.gm-btn[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
#input-area > .gm-btn { height: 44px; }
#submit-btn.gm-ready { animation: gmReady 1.1s ease-out; }
@keyframes gmReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); } 30% { box-shadow: 0 0 0 4px rgba(245,166,35,.6); } }
.gm-card[hidden] { display: none; }
.gm-wrap { position: relative; height: clamp(300px, 42vh, 520px); border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; background: #dfe8f1; }
.gm-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.95);
  box-shadow: 0 1px 4px rgba(0,0,0,.15); font-size: 19px; line-height: 1; color: #555; cursor: pointer; }
.gm-x:hover { color: #1a1a1a; }
@media (max-width: 600px) {
  .gm-btn { height: 40px; padding: 0 9px; }
  #input-area > .gm-btn { height: 40px; }
  .gm-lbl { display: none; }
  .gm-wrap { height: clamp(260px, 84vw, 360px); }   /* the globe nearly fills the phone's width, big enough to tap a country */
}

/* ---------- layout (globe.js gwLayout): one information block, the guess bar always below it ---------- */
.gw-cols, .gw-main, .gw-info, .gw-map { display: contents; }
/* laptops and wider: the blocks become real boxes */
@media (min-width: 1100px) {
  body.gl-page .gw-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  body.gl-page .gw-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; container-type: inline-size; }
  body.gl-page .gw-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.gl-page .gw-map { display: none; }
  body.gl-page #legend-shared { grid-column: 1 / -1; }
}

/* Explore panel: the clue cards in one column, under the profile */
.gl-side .ic-slot { grid-template-columns: minmax(0, 1fr); }
.gl-side .ic-cols { display: flex; flex-direction: column; gap: 12px; grid-column: 1 / -1; }
.gl-side .ic-card.is-half { grid-column: 1 / -1; }
.gl-side #clue-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.gl-side #clue-cards .ic-sechead { margin-bottom: 0; }

/* Explore on laptops: the page stops scrolling; the header, tools and map stay put and only the panel scrolls */
@media (min-width: 1100px) {
  body.at-globe { height: 100vh; overflow: hidden; padding-bottom: 1.25rem; }
  body.at-globe #app { height: 100%; min-height: 0; }
  body.at-globe .gl-layout { flex: 1 1 auto; min-height: 0; }
  body.at-globe .gl-wrap, .gl-layout.has-sel .gl-wrap { position: relative; top: auto; height: 100%; min-height: 0; max-height: none; }
  body.at-globe .gl-layout { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  body.at-globe .gl-side { height: 100%; min-height: 0; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
  /* the panel scrolls without a visible bar; a thin one appears only while the pointer is over a panel that has more below */
  body.at-globe .gl-side.gl-overflows:hover { scrollbar-color: #cfccc4 transparent; }
  body.at-globe #app > footer { display: none; }
  .gl-side footer { margin-top: 8px; }
}
.gl-reg-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #fdf3e1; color: #c98410; flex-shrink: 0; }
.gl-reg-ico .hd-ico { width: 18px; height: 18px; }
.gl-hint { margin: 2px 0 0; padding: 12px 14px; border: 1px dashed #e0dcd2; border-radius: 6px; font-size: .85rem; color: #777; text-align: center; }

/* Explore tools: a short search box, so the group chips fit on one line */
.gl-chip-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: #e0ded8; }
body.at-globe .at-tools { flex-wrap: nowrap; }
/* laptops: the search box takes all the free width; the chips keep their size and sit on the right */
body.at-globe #browse-search { flex: 1 1 0; min-width: 0; }
body.at-globe .gl-chips { flex: none; margin-left: 0; flex-wrap: nowrap; position: relative; }
.gl-chip-sep[hidden], .gl-more[hidden], .gl-more-menu[hidden] { display: none; }
.gl-more { position: relative; display: inline-flex; }
.gl-more-btn[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.gl-more-menu { position: fixed; z-index: 50; display: flex; flex-direction: column; gap: 2px; min-width: 150px; max-height: min(70vh, 560px); overflow-y: auto; padding: 4px;
  border: 1px solid #ecebe8; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.gl-more-menu .at-chip { text-align: left; border-radius: 6px; }
.gl-more-menu .at-chip:hover { background: #f4f3ef; }
.gl-more-menu .at-chip[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
body.at-globe .gl-chips .at-chip { white-space: nowrap; flex-shrink: 0; padding: 0 11px; }
@media (max-width: 1099px) { body.at-globe .at-tools { flex-wrap: wrap; } body.at-globe #browse-search { flex: 1 1 200px; } body.at-globe .gl-chips { flex: 1 1 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; } }
/* the panel: a little more air between the cards */
@media (min-width: 1100px) { body.at-globe .gl-side { gap: 16px; padding: 2px 10px 0 2px; } }
/* the group panel's way into Practice */
.gl-practice { flex-shrink: 0; white-space: nowrap; min-height: 34px; padding: 0 14px; border: 1.5px solid #1a1a1a; border-radius: 999px; background: #fff; color: #1a1a1a;
  font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.gl-practice:hover { background: #1a1a1a; color: #fff; }
.gl-menu-sep { height: 1px; margin: 3px 6px; background: #ecebe8; }
/* the By trait folder: profiles and trends, each with its rule */
.gl-traits .gl-more-menu { width: 270px; }
.gl-menu-h { padding: 8px 10px 2px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #a3a19b; }
body.at-globe .gl-more-menu .gl-trait, .gl-more-menu .gl-trait { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 0; padding: 7px 10px; white-space: normal; }
.gl-trait-name { color: #1a1a1a; font-weight: 600; }
.gl-trait-rule { font-size: .74rem; font-weight: 400; color: #8a8984; }
.gl-more-menu .gl-trait[aria-pressed="true"] .gl-trait-name, .gl-more-menu .gl-trait[aria-pressed="true"] .gl-trait-rule { color: #fff; }
/* the map key: what the highlight shows and how the group is defined */
.gl-key { position: absolute; top: 12px; left: 12px; z-index: 2; max-width: min(340px, calc(100% - 24px)); padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,.95); box-shadow: 0 1px 6px rgba(0,0,0,.14); font-size: .82rem; line-height: 1.4; color: #333; }
.gl-key[hidden] { display: none; }
.gl-key-top { display: flex; align-items: center; gap: 8px; }
.gl-key-top b { color: #1a1a1a; }
.gl-key-sw { width: 14px; height: 14px; flex-shrink: 0; border-radius: 3px; background: rgba(245,166,35,.45); box-shadow: inset 0 0 0 1.5px #c97d0a; }
.gl-key-n { margin-left: auto; padding-left: 8px; color: #8a8984; white-space: nowrap; }
.gl-key-def { margin: 6px 0 0; color: #555; }
.gl-key-tag { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #c98410; }
@media (max-width: 600px) { .gl-key { top: 8px; left: 8px; font-size: .76rem; padding: 8px 10px; } }
.gl-key--low { top: auto; bottom: 30px; }
@media (max-width: 600px) { .gl-key--low { bottom: 26px; } }
.gl-key summary { list-style: none; cursor: pointer; }
.gl-key summary::-webkit-details-marker { display: none; }
.gl-key-i { display: none; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 1px solid #c9c6be; font-size: .66rem; font-weight: 700; font-style: italic; line-height: 14px; text-align: center; color: #8a8984; }
@media (max-width: 600px) { .gl-key-i { display: inline-block; } .gl-key details[open] .gl-key-i { background: #1a1a1a; border-color: #1a1a1a; color: #fff; } }

/* ---------- What's new, wide: one screen on laptops, the newest update first with its demo ---------- */
.nt-box.nt-wide { max-width: min(1000px, calc(100vw - 48px)); padding: 22px 26px 20px; gap: 16px; }
.nx-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.nx-feature { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: center; padding: 14px; border-radius: 12px; background: #fbf6ea; box-shadow: inset 0 0 0 1px #f0e2bd; }
.nx-text { display: flex; flex-direction: column; gap: 8px; }
.nx-new { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: #1a1a1a; color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.nx-text h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.nx-text p { margin: 0; font-size: .9rem; line-height: 1.5; color: #444; }
.nx-cta { align-self: flex-start; min-height: 40px; padding: 0 18px; border: 0; border-radius: 6px; background: #1a1a1a; color: #fff; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.nx-cta:hover { background: #333; }
.nx-lock { font-size: .84rem !important; color: #7a6a3c !important; }
/* the demo: a flat world, the group lit up, the group's card on top */
.nx-demo { position: relative; display: flex; flex-direction: column; border-radius: 9px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #ecdfc0; }
.nx-mapbox { aspect-ratio: 640 / 300; background: #dfe8f1; }
.nx-map { width: 100%; height: 100%; display: block; }
.nx-map path { fill: #f2efe9; stroke: #c9c4b8; stroke-width: .4; transition: fill .45s ease, stroke .45s ease; }
.nx-map .nx-sea { fill: #cfdeeb; stroke: none; }
.nx-map path.lit { fill: #f6e3bb; }
.nx-map path.on { fill: #f5c070; stroke: #c97d0a; stroke-width: .6; }
.nx-map path.pick { fill: #f5a623; stroke: #8a5208; stroke-width: 1; }
/* the group's numbers sit under the map, so they never hide a country */
.nx-card { padding: 8px 12px 7px; font-size: .74rem; color: #555; }
.nx-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 14px; }
.nx-card-h { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; line-height: 1.3; min-width: 0; flex: 0 1 auto; }
.nx-card-h b { color: #1a1a1a; font-size: .86rem; }
.nx-card-h span { flex-basis: 100%; color: #8a8984; white-space: nowrap; }
.nx-flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.nx-big { flex-shrink: 0; font-size: 1.05rem; font-weight: 700; color: #1a1a1a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nx-big small { margin-left: 5px; font-size: .68rem; font-weight: 500; color: #8a8984; }
.nx-mix { flex: 1 1 100%; height: 8px; }
.nx-def { margin: 4px 0 0 !important; font-size: .72rem !important; line-height: 1.35 !important; color: #666 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-def .gl-key-tag { font-size: .6rem; }
.nx-cap { position: relative; height: 30px; flex-shrink: 0; display: flex; align-items: center; padding: 0 12px; background: #1a1a1a; color: #fff; font-size: .78rem; font-weight: 600; }
.nx-dots { position: absolute; right: 10px; bottom: 11px; display: flex; gap: 6px; }
.nx-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; }
.nx-dot[aria-selected="true"] { background: #f5c842; }
/* below the feature: earlier updates in three columns, then what's coming and the buttons on one line */
.nx-log { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 22px !important; margin-top: 8px !important; }
.nx-log li { grid-template-columns: 1fr !important; gap: 2px !important; font-size: .82rem !important; line-height: 1.4 !important; }
.nx-log .nt-date { padding-top: 0; font-size: .72rem; }
.nx-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 28px; padding-top: 14px; border-top: 1px solid #eeede9; }
.nx-foot .nt-soon { margin: 0; padding: 0; border: 0; }
.nx-soon-row { display: flex; gap: 24px; }
.nx-foot-end { display: flex; align-items: center; gap: 16px; }
.nx-foot-end .nt-fb { font-size: .84rem; }
.nx-foot .nt-btn { margin-top: 0; }
@media (max-width: 820px) {
  .nx-feature { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .nx-log { grid-template-columns: minmax(0, 1fr); }
  .nx-foot, .nx-foot-end, .nx-soon-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .nx-foot .nt-btn { align-self: flex-end; }
}
@media (max-width: 600px) {
  .nt-box.nt-wide { padding: 16px 16px 14px; }
  .nx-feature { padding: 10px; }
  .nx-row { flex-wrap: wrap; gap: 4px 12px; }
  .nx-mix { flex-basis: 100%; }
}
.nx-log li { align-content: start; }
/* short laptop screens: earlier updates show their titles only (the full text is in their tooltip) */
@media (min-width: 821px) and (max-height: 860px) {
  .nt-box.nt-wide { gap: 12px; padding-top: 18px; padding-bottom: 16px; }
  .nx-feature { padding: 10px 14px; }
  .nx-log .nx-x { display: none; }
  .nx-log { gap: 8px 22px !important; }
}
@media (min-width: 821px) and (max-height: 700px) {
  .nx-demo { width: min(100%, calc((100vh - 400px) * 2.13)); justify-self: center; }
}


/* Explore, globe view: no subtitle row (the tab already says Explore, and the panel holds the practice button),
   so the map and the panel start right under the tools; the charts get real height in the scrolling panel */
body.at-globe .subtitle-row { display: none; }
body.at-globe .at-tools { margin-top: 14px; }
@media (min-width: 1100px) {
  /* the charts card ends where the panel does on most laptops (the legend is one scroll away) */
  body.at-globe .gl-side #charts-section { grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); }
}

/* ---------- Explore, laptops: everything fits the window; nothing scrolls ----------
   The panel is sized to the space under the tools: the charts take what is left after the totals and the legend.
   A country's clue cards sit behind tabs (one card at a time) instead of below the profile. */
.gl-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.gl-tabs::-webkit-scrollbar { display: none; }
.gl-tab { flex-shrink: 0; min-height: 30px; padding: 0 12px; border: 1px solid #e3e1db; border-radius: 999px; background: #fff; color: #555; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gl-tab:hover { border-color: #1a1a1a; color: #1a1a1a; }
.gl-tab[aria-selected="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.gl-tab--card[aria-selected="true"] { background: #f5a623; border-color: #e09410; color: #1a1a1a; }
.gl-tabs-sep { flex-shrink: 0; width: 1px; height: 20px; margin: 0 4px; background: #dedcd5; }
.gl-tabs-hint { margin-left: 10px; font-size: .8rem; color: #8a8984; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-pane[hidden] { display: none !important; }
#gl-pane-profile { display: flex; flex-direction: column; gap: 12px; }
.gl-side #clue-cards .ic-sechead { display: none; }
.gl-side #clue-cards { margin-top: 0; }
.gl-side #clue-cards .ic-card[hidden] { display: none; }

@media (min-width: 1100px) {
  body.at-globe { padding-top: 14px; }
  body.at-globe .at-tools { margin-top: 10px; }
  body.at-globe .gl-layout { margin-top: 10px; grid-template-rows: minmax(0, 1fr) auto; row-gap: 8px; }
  body.at-globe .gl-wrap { grid-column: 1; grid-row: 1; }
  body.at-globe .gl-side { grid-column: 2; grid-row: 1 / 3; overflow: hidden; gap: 12px; padding: 0 2px 2px; }
  body.at-globe .gl-layout > footer { grid-column: 1; grid-row: 2; margin: 0; padding: 0; font-size: .7rem; line-height: 1.4; }
  #gl-pane-profile { flex: 1 1 0; min-height: 0; }
  /* the charts fill the height left over */
  body.at-globe .gl-side #charts-section { flex: 1 1 auto; grid-template-rows: minmax(0, 1fr); }
  body.at-globe .gl-side #chart-left, body.at-globe .gl-side #chart-right { display: flex; flex-direction: column; min-height: 0; padding: .8rem .9rem .7rem; }
  /* the charts never go under the daily's 300px: if the window is too short, the page grows and scrolls instead */
  body.at-globe .gl-side #line-wrapper { flex: 1 0 300px; height: auto; min-height: 300px; }
  body.at-globe .gl-side #bar-wrapper { flex: 1 0 300px; min-height: 300px; }
  /* tighter totals and legend */
  body.at-globe .gl-side .bc-stats { padding: 12px 12px; gap: 10px; }
  body.at-globe .gl-side #balance-card .stat-value { font-size: 1.45rem; }
  body.at-globe .gl-side #legend-shared { flex-shrink: 0; padding: .55rem .85rem .6rem; }
  body.at-globe .gl-side .lg-head { margin-bottom: .35rem; }
  body.at-globe .gl-side #legend-shared .legend-item { padding: 2px 8px 2px 6px; font-size: .76rem; }
  body.at-globe .gl-side #balance-card { flex-shrink: 0; }
  /* one clue card at a time fills the panel; a very tall one can still be wheeled through, with no bar showing */
  body.at-globe .gl-side #clue-cards { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: none; }
  body.at-globe .gl-side #clue-cards::-webkit-scrollbar { display: none; }
}

/* the tabs share the header row with the country's name */
.gl-p-head > div { flex: 0 1 auto; min-width: 0; }
.gl-p-head .gl-tabs { flex: 1 1 auto; min-width: 0; margin-left: 8px; }
.gl-p-head .gl-tabs > :first-child { margin-left: auto; }   /* right-aligned, yet every tab stays reachable when they overflow */
.gl-p-head .gl-tab { min-height: 28px; padding: 0 10px; font-size: .76rem; }
.gl-p-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a hint on the map until a country is picked */
.gl-maphint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 46px; z-index: 2; white-space: nowrap; margin: 0; padding: 6px 11px; border-radius: 999px; background: rgba(26,26,26,.82); color: #fff; font-size: .76rem; font-weight: 600; pointer-events: none; }
.gl-maphint[hidden] { display: none; }
@media (max-width: 600px) { .gl-maphint { bottom: 40px; font-size: .7rem; } .gl-p-head { flex-wrap: wrap; } .gl-p-head .gl-tabs { order: 3; flex-basis: 100%; margin-left: 0; justify-content: flex-start; } }
@media (min-width: 1100px) {
  /* the legend on one line: the toggle, the sources (sliding sideways when they don't fit: arrows at the ends, the mouse
     wheel, a swipe; see globeLegendScroll), the (i) */
  body.at-globe .gl-side #legend-shared { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: .45rem .7rem; }
  body.at-globe .gl-side .lg-head { display: contents; }
  body.at-globe .gl-side #legend-shared .view-toggle { grid-column: 1; grid-row: 1; }
  body.at-globe .gl-side #legend-shared .lg-items { grid-column: 2; grid-row: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
    padding: 7px 6px; margin: -7px -6px; }   /* room for the glow, which a sliding row would clip */
  body.at-globe .gl-side #legend-shared .lg-items::-webkit-scrollbar { display: none; }
  body.at-globe .gl-side #legend-shared.can-r .lg-items { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 46px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 46px), transparent); }
  body.at-globe .gl-side #legend-shared.can-l .lg-items { -webkit-mask-image: linear-gradient(90deg, transparent, #000 46px); mask-image: linear-gradient(90deg, transparent, #000 46px); }
  body.at-globe .gl-side #legend-shared.can-l.can-r .lg-items { -webkit-mask-image: linear-gradient(90deg, transparent, #000 46px, #000 calc(100% - 46px), transparent); mask-image: linear-gradient(90deg, transparent, #000 46px, #000 calc(100% - 46px), transparent); }
  body.at-globe .gl-side #legend-shared .lg-arr { grid-column: 2; grid-row: 1; z-index: 2; display: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
    align-items: center; justify-content: center; background: #fff; color: #1a1a1a; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
  body.at-globe .gl-side #legend-shared .lg-arr svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
  body.at-globe .gl-side #legend-shared .lg-arr:hover { background: #f4f3ef; }
  body.at-globe .gl-side #legend-shared .lg-arr:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }
  body.at-globe .gl-side #legend-shared .lg-arr-l { justify-self: start; }
  body.at-globe .gl-side #legend-shared .lg-arr-r { justify-self: end; }
  body.at-globe .gl-side #legend-shared.can-l .lg-arr-l, body.at-globe .gl-side #legend-shared.can-r .lg-arr-r { display: flex; }
  body.at-globe .gl-side #legend-shared .legend-item { flex-shrink: 0; }
  body.at-globe .gl-side #legend-shared .glossary-btn { grid-column: 3; grid-row: 1; }
  body.at-globe .gl-side #legend-shared .gb-long, body.at-globe .gl-side #legend-shared .gb-short { display: none; }
  body.at-globe .gl-side #legend-shared .og-src { display: none; }
  body.at-globe .gl-side #legend-shared .legend-members { display: none; }
}
.gl-p-head .gl-practice { margin-left: auto; }

/* Explore on wide windows: the header on one line (logo · modes … Stats & Leaderboard · podium), giving the page
   ~50px back. Every item is centred on the "Energle" wordmark's line. (The daily keeps its two rows: its column is too narrow.) */
@media (min-width: 1240px) {
  body.ex-hdr .hd-grid { grid-template-columns: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "title modes . lb podium"; column-gap: 22px; row-gap: 0; align-items: center; }
  body.ex-hdr .hd-brand { flex-wrap: nowrap; align-self: center; }
  body.ex-hdr .hd-grid #mode-nav, body.ex-hdr .hd-grid .lb-split, body.ex-hdr .hd-grid .podium { width: auto; align-self: center; margin: 0; }
  body.ex-hdr .hd-grid .podium { top: 0; }          /* centred like the rest (the two-row header nudges it down) */
}
/* the map's hint only while no group key is on the map */
.gl-key:not([hidden]) ~ .gl-maphint { display: none; }

/* ---------- search suggestions under the box (map view) ---------- */
.at-tools { position: relative; }
.gl-sugg { position: absolute; z-index: 30; top: calc(100% + 6px); width: min(360px, calc(100vw - 32px)); padding: 4px; border: 1px solid #ecebe8; border-radius: 12px; background: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.gl-sugg[hidden] { display: none; }
.gl-sugg-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: .9rem; color: #1a1a1a; text-align: left; cursor: pointer; }
.gl-sugg-row:hover, .gl-sugg-row:focus-visible { background: #f4f3ef; }
.gl-sugg-row span { flex: 1; }
.gl-sugg-row small { color: #8a8984; font-size: .76rem; }
.gl-sugg-flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.gl-sugg-none { margin: 0; padding: 10px 12px; font-size: .85rem; color: #8a8984; }
.gph-logo, .gph-list, .gph-nav, .gl-grab { display: none; }

/* ---------- phones: Energle's own header and tools stay; the map takes the rest of the screen and the panel is a
   sheet that slides up over the map's lower part (peek → half → full) ---------- */
@media (max-width: 700px) {
  body.at-globe { height: 100dvh; overflow: hidden; }
  body.at-globe #app { height: calc(100dvh - 24px); display: flex; flex-direction: column; min-height: 0; }
  body.at-globe #app > footer, body.at-globe .gl-layout > footer { display: none !important; }
  body.at-globe .gl-layout { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 10px; overflow: hidden; border-radius: 12px; }
  body.at-globe .gl-wrap, body.at-globe .gl-layout.has-sel .gl-wrap { position: absolute; inset: 0; height: auto; min-height: 0; border-radius: 12px; }
  body.at-globe .gl-maphint { bottom: calc(var(--gph-sheet, 90px) + 40px); }
  body.at-globe .gl-canvas .maplibregl-ctrl-bottom-right { bottom: var(--gph-sheet, 90px); }
  /* the sheet */
  body.at-globe .gl-side { position: absolute; z-index: 15; left: 0; right: 0; bottom: 0; margin: 0; height: 90px;
    padding: 0 12px 14px; border-radius: 14px 14px 12px 12px; background: #fff; box-shadow: 0 -3px 16px rgba(0,0,0,.12);
    overflow-y: auto; overscroll-behavior: contain; transition: height .25s ease; }
  body.at-globe .gl-side.is-dragging { transition: none; }
  body.at-globe .gl-side[data-sheet="peek"] { overflow: hidden; }
  body.at-globe .gl-grab { display: block; flex: none; position: sticky; top: 0; z-index: 3; width: calc(100% + 24px); height: 20px; margin: 0 -12px -8px;
    background: linear-gradient(#d6d3cc, #d6d3cc) center 7px / 36px 5px no-repeat, #fff; touch-action: none; cursor: grab; }
  body.at-globe .gl-p-head { touch-action: none; padding-bottom: 4px; }
}
@media (max-width: 700px) {
  body.at-globe .gl-p-head { flex-wrap: nowrap; }
  body.at-globe .gl-pr-n { display: none; }
  body.at-globe .gl-p-head .gl-practice { padding: 0 12px; }
  body.at-globe .gl-p-head:has(.gl-tabs) { flex-wrap: wrap; }
}
.gl-p-head .gl-x { margin-left: auto; }

/* phones: the tools on one line — Globe/List, search, and one button that holds every group */
@media (max-width: 700px) {
  body.at-globe .at-tools { flex-wrap: nowrap !important; gap: 6px; }
  body.at-globe .at-view .at-vbtn { min-height: 34px; padding: 0 10px; font-size: .76rem; }
  body.at-globe #browse-search { flex: 1 1 0 !important; min-width: 0; height: 40px; }
  body.at-globe .gl-chips { flex: none !important; margin: 0; padding: 0; border: 0; background: none; overflow: visible; }
  body.at-globe .gl-chips .gl-more-btn { min-height: 40px; max-width: 132px; padding: 0 12px; border: 1px solid #1a1a1a; border-radius: 999px; background: #1a1a1a; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.at-globe .gl-overflow .gl-more-menu { width: min(290px, calc(100vw - 24px)); max-height: 70dvh; }
  /* the sheet's header in one tight line: name · count · year, Practice, close */
  body.at-globe .gl-p-head { gap: 8px; align-items: center; }
  body.at-globe .gl-reg-ico { display: none; }
  body.at-globe .gl-flag { width: 24px; height: 17px; }
  body.at-globe .gl-p-head > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; }
  body.at-globe .gl-p-head h3 { flex-shrink: 0; font-size: 1.02rem; }
  body.at-globe .gl-p-head > div > span { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.at-globe .gl-p-head .gl-practice { min-height: 30px; padding: 0 10px; font-size: .76rem; }
  body.at-globe .gl-p-head .gl-x { width: 28px; height: 28px; font-size: 16px; margin-left: 0; }
  body.at-globe .gl-p-head .gl-tabs { margin-top: 2px; }
  body.at-globe .gl-p-head .gl-tab { min-height: 28px; padding: 0 10px; font-size: .74rem; }
  body.at-globe .gl-side { gap: 8px; }
}
@media (max-width: 700px) { body.at-globe .gl-sub-x { display: none; } }

/* ---------- Explore on laptops: the groups fold into two buttons by the search box, and the panel's title row moves up
   into the tools row, over the panel; the page is as tall as the window, or taller when the panel needs it ---------- */
#gl-head-slot { display: none; }
@media (min-width: 1100px) {
  body.at-globe { height: auto; overflow: visible; }
  body.at-globe #app { height: auto; }
  body.at-globe .gl-layout { flex: none; }
  body.at-globe .at-tools { display: grid; grid-template-columns: auto minmax(0, 1fr) auto clamp(560px, 53%, 860px); column-gap: 8px; align-items: center; }
  body.at-globe .at-tools .gl-chips { grid-column: 3; margin: 0; }
  body.at-globe #gl-head-slot { display: block; grid-column: 4; grid-row: 1; margin-left: 12px; min-width: 0; }
  body.at-globe #gl-head-slot:empty { display: none; }
  body.at-globe #gl-head-slot .gl-p-head { min-height: 44px; }
  body.at-globe #gl-head-slot .gl-p-head h3 { font-size: 1.12rem; line-height: 1.2; }
  body.at-globe #gl-head-slot .gl-p-head > div > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.at-globe .gl-chips .gl-more-btn { min-height: 38px; padding: 0 14px; border: 1px solid #e3e1db; border-radius: 999px; background: #fff; white-space: nowrap; }
  body.at-globe .gl-chips .gl-more-btn[aria-pressed="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
  body.at-globe .gl-chips { border: 0; background: none; padding: 0; gap: 6px; }
  body.at-globe .gl-chips .gl-sep-traits { display: none; }
}
@media (min-width: 1100px) {
  body.at-globe .gl-layout { height: auto; min-height: calc(100vh - var(--gl-top, 170px) - 22px); }
  body.at-globe .gl-side { overflow: visible; height: auto; }
  body.at-globe .gl-wrap, body.at-globe .gl-layout.has-sel .gl-wrap { height: auto; min-height: 420px; align-self: stretch; }
}
@media (min-width: 1100px) {
  body.at-globe #gl-pane-profile { flex: 1 1 auto; min-height: auto; }
  body.at-globe .gl-side #clue-cards { flex: 1 1 auto; min-height: auto; overflow: visible; }
}

/* phones: the tools float on the map's top edge, sized like the header's buttons, so the map and the sheet get their row */
@media (max-width: 700px) {
  body.at-globe .at-tools { position: relative; z-index: 20; margin: 0 8px calc(-1 * (var(--gph-hb, 32px) + 18px)); padding-top: 8px; gap: 6px; }
  body.at-globe .gl-layout { margin-top: 0; }
  body.at-globe .at-view { padding: 2px; box-shadow: 0 1px 5px rgba(0,0,0,.16); border: 0; }
  body.at-globe .at-view .at-vbtn { min-height: calc(var(--gph-hb, 32px) - 4px); height: calc(var(--gph-hb, 32px) - 4px); padding: 0 10px; font-size: .74rem; }
  body.at-globe #browse-search { height: var(--gph-hb, 32px) !important; min-height: 0; padding: 0 12px; border: 0; border-radius: 999px; font-size: .82rem; box-shadow: 0 1px 5px rgba(0,0,0,.16); }
  body.at-globe .gl-chips .gl-more-btn { min-height: 0; height: var(--gph-hb, 32px); max-width: 120px; padding: 0 12px; font-size: .78rem; box-shadow: 0 1px 5px rgba(0,0,0,.2); }
  body.at-globe .gl-sugg { top: calc(var(--gph-hb, 32px) + 6px); }
  /* the group key sits under the floating tools */
  body.at-globe .gl-key, body.at-globe .gl-key--low { top: calc(var(--gph-hb, 32px) + 16px); bottom: auto; }
}
/* no key on the map (the group button and the panel's title already say what's highlighted); a group's definition
   sits in the panel, right under its title */
.gl-key { display: none !important; }
.gl-def { margin: -4px 0 0; font-size: .78rem; line-height: 1.45; color: #666; }
.gl-def .gl-key-tag { font-size: .62rem; }
@media (max-width: 700px) { .gl-def { margin: -2px 0 2px; font-size: .76rem; } }

/* ---------- laptops: the tools float on the map's top edge, sized like the header's buttons, as on phones; the map and
   the panel start right under the header, and the panel's title sits at the top of the panel, aligned with its cards ---------- */
@media (min-width: 1100px) {
  body.at-globe .at-tools { display: flex; align-items: center; gap: 6px; position: relative; z-index: 20;
    width: calc(100% - clamp(560px, 53%, 860px) - 20px); margin: 14px 0 0; padding: 10px 10px 0; margin-bottom: calc(-1 * (var(--gph-hb, 32px) + 10px) - 12px); }
  body.at-globe .gl-layout { margin-top: 0; }   /* the tools sit 10px inside the map's top edge */
  body.at-globe #gl-head-slot { display: none !important; }
  body.at-globe .at-view { flex: none; padding: 2px; border: 0; box-shadow: 0 1px 5px rgba(0,0,0,.16); }
  body.at-globe .at-view .at-vbtn { min-height: 0; height: calc(var(--gph-hb, 32px) - 4px); padding: 0 12px; font-size: .78rem; }
  body.at-globe #browse-search { flex: 1 1 0; min-width: 0; height: var(--gph-hb, 32px); min-height: 0; padding: 0 14px; border: 0; border-radius: 999px; font-size: .84rem; box-shadow: 0 1px 5px rgba(0,0,0,.16); }
  body.at-globe .gl-chips { flex: none; }
  body.at-globe .gl-chips .gl-more-btn { min-height: 0; height: var(--gph-hb, 32px); padding: 0 13px; font-size: .8rem; box-shadow: 0 1px 5px rgba(0,0,0,.16); border: 0; }
  body.at-globe .gl-sugg { top: calc(100% + 6px); left: auto; }
  /* the title row lines up with the cards under it */
  body.at-globe .gl-side > .gl-p-head { padding: 0; margin: 0; min-height: var(--gph-hb, 32px); }
}


/* ---------- Explore, list view: the same tools as the map view, header-button sized, on one row ---------- */
.gl-tools-practice { display: none; }
body.gl-page:not(.at-globe) .subtitle-row:has(+ .at-tools), body.gl-page:not(.at-globe) .subtitle-row:has(~ .at-tools) { display: none; }
body.gl-page:not(.at-globe) .at-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 14px; }
body.gl-page:not(.at-globe) .at-tools .at-view { flex: none; padding: 2px; border: 1px solid #e3e1db; }
body.gl-page:not(.at-globe) .at-tools .at-vbtn { min-height: 0; height: calc(var(--gph-hb, 30px) - 6px); padding: 0 12px; font-size: .78rem; }
body.gl-page:not(.at-globe) #browse-search { flex: 1 1 0; min-width: 0; height: var(--gph-hb, 30px); min-height: 0; padding: 0 14px; border: 1px solid #e3e1db; border-radius: 999px; font-size: .84rem; }
body.gl-page:not(.at-globe) .at-tools .gl-chips { flex: none; margin: 0; padding: 0; border: 0; background: none; gap: 6px; }
body.gl-page:not(.at-globe) .at-tools .gl-more-btn { min-height: 0; height: var(--gph-hb, 30px); padding: 0 13px; border: 1px solid #e3e1db; border-radius: 999px; background: #fff; font-size: .8rem; white-space: nowrap; }
body.gl-page:not(.at-globe) .at-tools .gl-more-btn[aria-pressed="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
body.gl-page:not(.at-globe) .at-tools .gl-chip-sep { display: none; }
body.gl-page:not(.at-globe) .at-tools .at-sort { flex: none; margin: 0; }
body.gl-page:not(.at-globe) .at-tools .at-sort select { height: var(--gph-hb, 30px); min-height: 0; padding: 0 28px 0 12px; border-radius: 999px; font-size: .8rem; }
body.gl-page:not(.at-globe) .gl-tools-practice { display: inline-block; flex: none; height: var(--gph-hb, 30px); line-height: calc(var(--gph-hb, 30px) - 3px); padding: 0 13px; border: 1.5px solid #1a1a1a; border-radius: 999px;
  background: #fff; color: #1a1a1a; font: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
body.gl-page:not(.at-globe) .gl-tools-practice:hover { background: #1a1a1a; color: #fff; }
@media (max-width: 700px) {
  /* phones: Globe/List, search and the group button on the first line; sort and practice on the second */
  body.gl-page:not(.at-globe) .at-tools { flex-wrap: wrap; row-gap: 8px; }
  body.gl-page:not(.at-globe) #browse-search { flex: 1 1 120px; font-size: 16px; }
  body.gl-page:not(.at-globe) .at-tools .at-sort { order: 5; }
  body.gl-page:not(.at-globe) .gl-tools-practice { order: 6; margin-left: auto; }
  body.gl-page:not(.at-globe) .at-tools .at-sort .at-sort-l, body.gl-page:not(.at-globe) .at-tools .at-sort > span { display: none; }
}
body.gl-page:not(.at-globe) .at-tools .at-sort > span { display: none; }
body.gl-page:not(.at-globe) .at-tools .at-sort select { width: auto; }
body.gl-page:not(.at-globe) .at-tools .at-sort select { min-width: 0 !important; width: 118px !important; }
/* group clue cards */
.ug-chip.is-share, .ug-chip.is-held { background: #fdf0d5; color: #8a5208; }
.gl-agg-note { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed #e6e3dc; font-size: .72rem; line-height: 1.4; color: #8a8984; }
/* group clue cards */
.ug-chip.is-share, .ug-chip.is-held { background: #fdf0d5; color: #8a5208; }
.gl-agg-note { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed #e6e3dc; font-size: .72rem; line-height: 1.4; color: #8a8984; }

/* the group menu scrolls on its own, without moving the page or the map */
.gl-more-menu { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

/* practice picker: back to the map, at the top */
.pc-back-map { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: #1a1a1a; color: #fff; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pc-back-map:hover { background: #333; }
.pc-back-map .hd-ico, .pc-back-map svg { width: 15px; height: 15px; }

/* ---------- phones (test page): a compact header — logo, the leader, Stats & Leaderboard as icons; the modes underneath ---------- */
@media (max-width: 600px) {
  body.gl-page .hd-grid, body.gl-page .hd-grid.hd-stack { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "title podium lb" "modes modes modes"; column-gap: 10px; row-gap: 8px; align-items: center; }
  body.gl-page .hd-by { display: none; }
  body.gl-page .hd-brand .logo-word, body.gl-page .hd-brand h1 { font-size: 1.7rem; }
  body.gl-page .hd-grid .podium { justify-self: end; padding: 2px 4px; }
  body.gl-page .podium-slot:not(:first-child) { display: none; }
  body.gl-page .podium-slot:first-child { flex-direction: row; width: auto; gap: 4px; }
  body.gl-page .podium-slot:first-child .podium-name { font-size: .78rem; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.gl-page .hd-grid .lb-split { justify-self: end; }
  body.gl-page .lb-split .mode-btn { font-size: 0; padding: 0 9px; min-height: 30px; }
  body.gl-page .lb-split .mode-btn svg, body.gl-page .lb-split .mode-btn .hd-ico { width: 17px; height: 17px; margin: 0; }
  body.gl-page .lb-split .lb-amp { display: none; }
  body.gl-page .hd-grid #mode-nav { width: 100%; display: flex; }
  body.gl-page .hd-grid #mode-nav .mode-btn { flex: 1; justify-content: center; }
  .pc-back-map { height: 30px; padding: 0 12px; font-size: .78rem; }
}
@media (max-width: 700px) { body.at-globe .gl-p-head .gl-tabs > :first-child { margin-left: 0; } }

/* the source map's key: one slim line on the map */
.gl-shade { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; max-width: calc(100% - 70px);
  padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(255,255,255,.96); box-shadow: 0 1px 6px rgba(0,0,0,.16); font-size: .76rem; color: #555; }
.gl-shade[hidden] { display: none; }
.gl-shade-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #1a1a1a; }
.gl-shade-sw { width: 10px; height: 10px; border-radius: 2px; }
.gl-shade-scale { display: inline-flex; align-items: center; gap: 5px; }
.gl-shade-scale small { font-size: .68rem; color: #8a8984; }
.gl-shade-bar { width: 70px; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.gl-shade-x { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #f1efea; color: #555; font-size: 14px; line-height: 1; cursor: pointer; }
.gl-shade-x:hover { background: #1a1a1a; color: #fff; }
.gl-shade:not([hidden]) ~ .gl-maphint, .gl-shade:not([hidden]) + .gl-maphint { display: none; }
@media (max-width: 700px) {
  body.at-globe .gl-shade { bottom: calc(var(--gph-sheet, 90px) + 10px); left: 8px; max-width: calc(100% - 16px); border-radius: 12px; }
  body.at-globe .gl-shade-txt { display: none; }
}
/* the legend's sources say they can colour the map */
body.at-globe #legend-shared .legend-item { cursor: pointer; }

/* ---------- phones (test page): the header on ONE line — logo · modes (icons; the current one named) · gold · Stats & Leaderboard ---------- */
@media (max-width: 600px) {
  body.gl-page .hd-grid, body.gl-page .hd-grid.hd-stack { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "title modes podium lb"; column-gap: 6px; row-gap: 0; align-items: center; }
  body.gl-page .hd-brand .logo-word, body.gl-page .hd-brand h1 { font-size: 1.32rem; }
  body.gl-page .hd-grid #mode-nav { width: auto; justify-self: center; display: inline-flex; padding: 2px; }
  body.gl-page .hd-grid #mode-nav .mode-btn { flex: none; min-height: 28px; padding: 0 8px; }
  body.gl-page .hd-grid #mode-nav .mode-btn:not(.active) { font-size: 0; gap: 0; }
  body.gl-page .hd-grid #mode-nav .mode-btn:not(.active) .hd-lockemo { font-size: .62rem; margin-left: 1px; }
  body.gl-page .hd-grid #mode-nav .mode-btn.active { font-size: .72rem; }
  body.gl-page .hd-grid #mode-nav .mode-btn svg, body.gl-page .hd-grid #mode-nav .mode-btn .hd-ico { width: 15px; height: 15px; }
  body.gl-page .podium-slot:first-child .podium-name { display: none; }
  body.gl-page .hd-grid .podium { padding: 0 2px; }
  body.gl-page .lb-split .mode-btn { min-height: 28px; padding: 0 7px; }
  body.gl-page .lb-split .mode-btn svg, body.gl-page .lb-split .mode-btn .hd-ico { width: 15px; height: 15px; }
}
@media (max-width: 360px) { body.gl-page .hd-grid #mode-nav .mode-btn.active { font-size: 0; } }
@media (max-width: 600px) {
  /* everything on the header line centred on the same axis */
  body.gl-page .hd-grid > * { align-self: center !important; margin-top: 0 !important; margin-bottom: 0 !important; top: 0 !important; }
  body.gl-page .hd-brand h1 { line-height: 1; margin: 0; }
  body.gl-page .hd-grid .podium { display: flex; align-items: center; min-height: 0; }
  body.gl-page .podium-slot:first-child { align-items: center; }
  body.gl-page .podium-medal { font-size: 1.2rem; line-height: 1; }
}
@media (max-width: 600px) {
  /* the leader's name back next to the gold medal, on the same line */
  body.gl-page .hd-brand .logo-word, body.gl-page .hd-brand h1 { font-size: 1.22rem; }
  body.gl-page .hd-grid { column-gap: 5px; }
  body.gl-page .hd-grid #mode-nav .mode-btn { padding: 0 7px; }
  body.gl-page .podium-slot:first-child .podium-name { display: block; font-size: .68rem; font-weight: 600; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
  body.gl-page .podium-slot:first-child { flex-direction: row; align-items: center; gap: 3px; width: auto; }
  body.gl-page .podium-medal { font-size: 1.05rem; }
  body.gl-page .lb-split .mode-btn { padding: 0 6px; }
  /* the line under the header: one line — "Puzzle #164" and the date, centred on the same axis (the explanation drops on phones) */
  body.gl-page .subtitle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 6px; flex-wrap: nowrap; }
  body.gl-page .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 16px; line-height: 1.2; margin: 0; }
  body.gl-page .subtitle .sub-sep, body.gl-page .subtitle .sub-rest { display: none; }
  body.gl-page .subtitle-row .sub-date { flex-shrink: 0; font-size: 14px; line-height: 1.2; align-self: center; }
}
/* phones: a past puzzle's row keeps its two lines (arrows and title, then status and "← Archive"); the one-line rule
   above had squeezed the title under the next arrow */
@media (max-width: 600px) {
  body.gl-page .subtitle-row.ar-row { flex-wrap: wrap; gap: 8px; }
  body.gl-page .subtitle-row.ar-row .ar-nav { flex: 1 1 100%; justify-content: space-between; }
}
/* phones (test page), final: the header items keep their natural size and share the line evenly,
   each centred on the wordmark; the current mode keeps its name while there is room (≥ 380px) */
@media (max-width: 600px) {
  body.gl-page .hd-grid, body.gl-page .hd-grid.hd-stack { grid-template-columns: auto auto auto auto; justify-content: space-between; column-gap: 4px; }
  body.gl-page .hd-grid #mode-nav { justify-self: auto; }
  body.gl-page .hd-grid #mode-nav .mode-btn { padding: 0 6px; gap: 4px; min-height: 28px; }
  body.gl-page header .hd-modes .mode-btn .hd-ico, body.gl-page .lb-split .hd-ico { display: block !important; width: 15px !important; height: 15px !important; }
  body.gl-page .lb-split .mode-btn, body.gl-page .lb-split .mode-btn:first-child, body.gl-page .lb-split .mode-btn:last-child { padding: 0 6px; min-height: 28px; font-size: 0; }
}
@media (max-width: 379px) {
  body.gl-page .hd-grid #mode-nav .mode-btn.active { font-size: 0; gap: 0; }
  body.gl-page .podium-slot:first-child .podium-name { max-width: 46px; }
  body.gl-page .hd-brand .logo-word, body.gl-page .hd-brand h1 { font-size: 1.1rem; }
}
@media (max-width: 340px) {
  body.gl-page .podium-slot:first-child .podium-name { max-width: 40px; }
  body.gl-page .lb-split .mode-btn, body.gl-page .lb-split .mode-btn:first-child, body.gl-page .lb-split .mode-btn:last-child { padding: 0 5px; }
  body.gl-page .hd-grid #mode-nav .mode-btn { padding: 0 6px; }
}
@media (max-width: 340px) {
  body.gl-page .hd-grid #mode-nav .mode-btn { padding: 0 4px; }
  body.gl-page .lb-split .mode-btn, body.gl-page .lb-split .mode-btn:first-child, body.gl-page .lb-split .mode-btn:last-child { padding: 0 4px; }
  body.gl-page .hd-grid { column-gap: 3px; }
}
@media (max-width: 340px) { body.gl-page .hd-brand .logo-word, body.gl-page .hd-brand h1 { font-size: 1rem; } }
/* phones (test page): the leader's name under the medal, the pair exactly as tall as the boxes beside it (the medal's ribbon
   trimmed at the top); the mode switch takes the room that frees, with the current mode named again */
@media (max-width: 600px) {
  body.gl-page .hd-grid, body.gl-page .hd-grid.hd-stack { grid-template-columns: auto minmax(0, 1fr) auto auto; justify-content: stretch; column-gap: 8px; }
  body.gl-page .hd-grid #mode-nav { width: 100%; display: flex; }
  body.gl-page .hd-grid #mode-nav .mode-btn { flex: 1 1 0; justify-content: center; min-width: 0; }
  body.gl-page .hd-grid #mode-nav .mode-btn.active { flex-grow: 2; font-size: .72rem; gap: 4px; padding: 0 9px; }
  body.gl-page .podium-slot:first-child { flex-direction: column; justify-content: space-between; gap: 0; height: var(--hd-box, 32px); width: auto; }
  body.gl-page .podium-slot:first-child .podium-medal { display: block; height: calc(var(--hd-box, 32px) - 11px); overflow: hidden; font-size: calc(var(--hd-box, 32px) - 9px); line-height: 1;
    display: flex; align-items: flex-end; justify-content: center; }
  body.gl-page .podium-slot:first-child .podium-name { font-size: 9px; line-height: 10px; height: 10px; max-width: 54px; }
  body.gl-page .hd-grid .podium { padding: 0; }
}
@media (max-width: 379px) {
  body.gl-page .hd-grid #mode-nav .mode-btn.active { font-size: 0; gap: 0; flex-grow: 1; }
  body.gl-page .podium-slot:first-child .podium-name { max-width: 44px; }
}
@media (max-width: 600px) {
  body.gl-page .hd-grid .lb-split { height: var(--hd-box, 32px); box-sizing: border-box; display: inline-flex; align-items: stretch; }
  body.gl-page .hd-grid .lb-split .mode-btn { min-height: 0; height: auto; align-items: center; }
}
/* Explore on wide windows: the mode switch is wider, centred in the free space, and its bottom edge sits on the
   "Energle" wordmark's baseline (globe.js hdAlignNav sets the exact offset) */
@media (min-width: 1240px) {
  body.ex-hdr .hd-grid { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "title modes lb podium"; }
  body.ex-hdr .hd-grid #mode-nav { justify-self: center; align-self: start; position: relative; padding: 3px; }
  body.ex-hdr .hd-grid #mode-nav .mode-btn { min-height: 36px; padding: 0 22px; font-size: .92rem; gap: 7px; }
  body.ex-hdr .hd-grid #mode-nav .mode-btn .hd-ico { width: 16px; height: 16px; }
}
@media (min-width: 1240px) { body.ex-hdr .hd-grid .lb-split { position: relative; align-self: start; } }
/* Explore, wide windows: every header control is as tall as the mode switch and rests on the wordmark's baseline —
   Stats & Leaderboard, and the three medals with their names under them (ribbons trimmed to fit) */
@media (min-width: 1240px) {
  body.ex-hdr .hd-grid .lb-split { height: var(--hd-box, 42px); box-sizing: border-box; display: inline-flex; align-items: stretch; }
  body.ex-hdr .hd-grid .lb-split .mode-btn { min-height: 0; height: auto; align-items: center; padding: 0 10px; font-size: .92rem; }
  body.ex-hdr .hd-grid .lb-split .mode-btn:first-child { padding-left: 16px; } body.ex-hdr .hd-grid .lb-split .mode-btn:last-child { padding-right: 16px; }
  body.ex-hdr .hd-grid .podium { position: relative; align-self: start; display: flex; align-items: stretch; gap: 14px; height: var(--hd-box, 42px); padding: 0; }
  body.ex-hdr .hd-grid .podium-slot { height: var(--hd-box, 42px); width: auto; min-width: 46px; justify-content: space-between; gap: 0; }
  body.ex-hdr .hd-grid .podium-medal { height: calc(var(--hd-box, 42px) - 14px); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; font-size: calc(var(--hd-box, 42px) - 12px); line-height: 1; }
  body.ex-hdr .hd-grid .podium-name { font-size: 11px; line-height: 13px; height: 13px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* the map's hint: small, in the bottom-left corner, out of the way */
.gl-maphint { left: 12px !important; right: auto; bottom: 12px !important; transform: none !important; max-width: calc(100% - 64px); white-space: normal;
  padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.92); color: #555; font-size: .74rem; font-weight: 400; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.gl-maphint b { color: #1a1a1a; font-weight: 600; }
@media (max-width: 700px) { body.at-globe .gl-maphint { bottom: calc(var(--gph-sheet, 90px) + 8px) !important; left: 8px !important; font-size: .7rem; } }
/* the legend's sources say they colour the map: a small globe on hover, and one shimmer on a first visit */
body.at-globe #legend-shared .legend-item { position: relative; }
body.at-globe #legend-shared .legend-item::after { content: ""; width: 11px; height: 11px; margin-left: 4px; opacity: 0; transition: opacity .15s;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E"); }
body.at-globe #legend-shared .legend-item:hover::after, body.at-globe #legend-shared .legend-item.is-on::after { opacity: 1; }
body.at-globe.gl-srcnudge #legend-shared .lg-items .legend-item { animation: glNudge 2.4s ease-in-out 1.2s 2; }
@keyframes glNudge { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px rgba(245,166,35,.45); } }
@media (prefers-reduced-motion: reduce) { body.at-globe.gl-srcnudge #legend-shared .lg-items .legend-item { animation: none; } }
/* What's new demo: the group-cards and practice steps */
.nx-ug { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.nx-ug-row { display: inline-flex; align-items: baseline; gap: 5px; font-size: .78rem; color: #333; }
.nx-ug-row b { color: #1a1a1a; }
.nx-ug-row em { font-style: normal; padding: 0 6px; border-radius: 999px; background: #fdf0d5; color: #8a5208; font-size: .7rem; }
.nx-pill { flex-shrink: 0; padding: 4px 12px; border: 1.5px solid #1a1a1a; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #1a1a1a; }
.nx-map path { transition: fill .45s ease, stroke .45s ease; }
/* every demo step keeps the same height, so the window never jumps */
.nx-card { box-sizing: border-box; }   /* its height is set by the demo to fit its tallest step (nxDemoStart) */

/* Practice picker, part of the Explore tab: same header and width as the map, one row per section when it fits */
.pc-onmap { display: flex; align-items: center; gap: 6px; }
.pc-onmap svg { width: 13px; height: 13px; flex-shrink: 0; }
.pc-onmap span { margin-left: auto; }
@media (min-width: 1100px) {
  body.ex-picker #app { max-width: min(1520px, calc(100vw - 64px)); }
  body.ex-picker .pc-grid { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
}

/* the daily map, once the game is over: the Map button (in the guess bar) is gone, so this brings the map back */
.gm-reopen { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 40px; margin: 4px 0 2px; padding: 0 14px; border: 1.5px solid #1a1a1a; border-radius: 6px;
  background: #fff; color: #1a1a1a; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.gm-reopen:hover { background: #f4f3ef; }
.gm-reopen:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }

/* phones: the short date stays on the puzzle line whether or not there's news; only the red dot comes and goes */
@media (max-width: 600px) {
  body.gl-page .sub-date--btn { display: inline-flex; flex-shrink: 0; margin-right: 0; }   /* flush with the line's right edge */
  body.gl-page .sub-date--btn .sd-txt { display: none; }
  body.gl-page .sub-date--btn .sd-short { display: inline; font-size: 12px; }
}

/* the map's hint folds into a ? bubble in the bottom-left corner (level with the credits' (i)), and opens again from it */
.gl-maphint { pointer-events: auto; cursor: pointer; border: 0; font: inherit; text-align: left; line-height: 1.35; }
.gl-maphint .gl-mh-q { display: none; }
.gl-maphint.is-mini { left: 10px !important; right: auto; bottom: 10px !important; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: #fff; box-shadow: none; }   /* the same white disc as the credits' (i) */
.gl-maphint.is-mini[hidden] { display: none; }
.gl-maphint.is-mini .gl-mh-txt { display: none; }
.gl-maphint.is-mini .gl-mh-q { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #1a1a1a; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.gl-maphint:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }
@media (max-width: 700px) { body.at-globe .gl-maphint.is-mini { left: 10px !important; bottom: calc(var(--gph-sheet, 90px) + 10px) !important; } }

/* Explore's map view has no title line on any screen: the tools and the panel say it all (the phone header rules re-showed it) */
body.at-globe .subtitle-row { display: none !important; }

/* What's new on phones: iPhones count 100vh with the browser bars hidden, so the window ran past the visible screen and
   both ends (the × and Got it) were cut off. The window now fits the visible screen (dvh) and its top row, with the ×,
   stays pinned while the rest scrolls. */
#notice-modal, #feedback-modal, #shop-intro { height: 100vh; height: 100dvh; }
#notice-modal .nt-box--log, #shop-intro .nt-box, #feedback-modal .nt-box { max-height: calc(100vh - 32px); max-height: calc(var(--vvh, 100dvh) - 32px); overflow-y: auto; overscroll-behavior: contain; }
.nt-wide .nx-top { position: sticky; top: -22px; z-index: 3; margin: -22px -26px 0; padding: 22px 26px 8px; background: #fff; }   /* sticky counts from inside the box's padding: -22px pins it to the edge */
@media (max-width: 600px) {
  #notice-modal { padding: 12px; }
  #notice-modal .nt-box--log { max-height: calc(100vh - 24px); max-height: calc(var(--vvh, 100dvh) - 24px); }
  .nt-wide .nx-top { top: -16px; margin: -16px -16px 0; padding: 14px 16px 8px; border-bottom: 1px solid #f0efeb; }
  .nt-wide .nx-top .nt-title { font-size: 1.15rem; }
}

/* while a window is open the page behind stays put (Safari would otherwise move its bars under the window) */
html.mdl-open, html.mdl-open body { overflow: hidden; overscroll-behavior: none; }

/* pull to refresh (phone Explore): an arrow that drops from the top and turns as you pull; dark once letting go reloads */
.ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; z-index: 2000; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #fff; color: #8a8984; box-shadow: 0 2px 10px rgba(0,0,0,.18); pointer-events: none; }
.ptr.is-ready { background: #1a1a1a; color: #fff; }
.ptr.is-going svg { animation: ptrSpin .8s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* the reserves table in the Explore panel: column heads may wrap, so the chips size to their numbers and the fuel names
   keep their room (on phones "Oil" ran under "1,725 bn barrels") */
.gl-side .fs-table { grid-template-columns: minmax(min-content, 1fr) auto auto auto; }
.gl-side .fs-h { white-space: normal; line-height: 1.2; }
.gl-side .fs-table .ug-val { white-space: nowrap; }
@media (max-width: 600px) {
  .gl-side .fs-table { gap: 7px 8px; }
  .gl-side .fs-table .ug-chip { padding: 1px 6px; }
}
@media (max-width: 380px) {   /* small phones: the unit drops under the number, everything a touch tighter */
  .gl-side .fs-table { gap: 6px 6px; }
  .gl-side .fs-table .ug-val { white-space: normal; line-height: 1.15; font-size: 12px; }
  .gl-side .fs-table .ug-name { font-size: 12px; gap: 5px; }
  .gl-side .fs-table .ug-chip { padding: 1px 5px; font-size: 10.5px; }
  .gl-side .fs-h { font-size: 10px; }
}

/* the folded ? hops every few seconds until it's been opened once (translate, since the tip's transform is pinned) */
.gl-maphint.is-mini.is-hop { animation: glHop 5s ease-in-out 1.5s infinite; }
@keyframes glHop { 0%, 78%, 100% { translate: 0 0; } 83% { translate: 0 -8px; } 88% { translate: 0 0; } 92% { translate: 0 -3px; } 96% { translate: 0 0; } }
/* while the tip is open, the sources under the charts glow one after another */
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item { animation: glGlow 3.2s ease-in-out infinite; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(2) { animation-delay: .25s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(3) { animation-delay: .5s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(4) { animation-delay: .75s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(5) { animation-delay: 1s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(6) { animation-delay: 1.25s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(7) { animation-delay: 1.5s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(8) { animation-delay: 1.75s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(9) { animation-delay: 2s; }
body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item:nth-child(n+10) { animation-delay: 2.25s; }
@keyframes glGlow {   /* a clear amber ring, a warm fill and a halo at its peak */
  0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); background-color: transparent; }
  25%, 40% { box-shadow: 0 0 0 2.5px #f5a623, 0 0 18px 4px rgba(245,166,35,.65); background-color: #fff1d6; }
}
@media (prefers-reduced-motion: reduce) {
  .gl-maphint.is-mini.is-hop, body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item { animation: none; }
  body.at-globe.gl-hint-open #legend-shared .lg-items .legend-item { box-shadow: 0 0 0 2.5px #f5a623; background-color: #fff1d6; }
}

/* stats & leaderboard (and the other windows): sized to the visible screen, not 100vh, so the × at the top can't end up
   under Safari's bars; scrolling a list never drags the page behind */
#stats-modal .sx-box.hub-box, #lb-modal .st-box.lb-box.hub-box, #lb-modal .st-box.lb-box { height: min(780px, calc(100vh - 24px)); height: min(780px, calc(var(--vvh, 100dvh) - 24px)); }
#glossary-modal .st-box, #cl-modal .st-box { max-height: calc(100vh - 24px); max-height: calc(var(--vvh, 100dvh) - 24px); }
.hub-scroll, #lb-modal .lb-body, #shop-modal { overscroll-behavior: contain; }

/* the whole Explore tab (map, list and picker) is one width, so its one-line header sits in the same place on every view */
@media (min-width: 1100px) { body.ex-hdr #app { max-width: min(1520px, calc(100vw - 64px)); } body.ex-hdr { padding-top: 14px; } }

/* ---------- the demo's arrows: round buttons on the map's edges ---------- */
.nx-stage { position: relative; }
.nx-arr { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.92); color: #1a1a1a; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: background .15s, transform .15s; }
.nx-arr svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nx-arr:hover { background: #fff; transform: scale(1.08); }
.nx-arr:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }
.nx-arr:disabled { opacity: .35; cursor: default; transform: none; }
.nx-prev { left: 8px; } .nx-next { right: 8px; }
.nx-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.nx-tour { min-height: 40px; padding: 0; border: 0; background: none; font: inherit; font-size: .88rem; font-weight: 600; color: #1a1a1a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nx-tour:hover { color: #8a5208; }

/* ---------- the Explore tour: one feature per step ---------- */
#tour-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; height: 100vh; height: 100dvh; }
#tour-modal .st-backdrop { position: absolute; inset: 0; }
.tr-box { width: min(560px, 100%); max-width: none; max-height: calc(100vh - 32px); max-height: calc(var(--vvh, 100dvh) - 32px); overflow-y: auto; overscroll-behavior: contain; gap: 12px; }
.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-n { color: #b0a58a; letter-spacing: .04em; }
.tr-main { display: flex; flex-direction: column; gap: 14px; }
.tr-box .nx-cap, .tr-box .nx-dots { display: none; }       /* the step's title says it, bigger; the dots sit by Next */
.tr-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-title { margin: 0; font-size: 1.2rem; line-height: 1.25; text-wrap: balance; }
.tr-say { margin: 0; font-size: .92rem !important; line-height: 1.5; color: #444 !important; min-height: 4.5em; }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tr-back, .tr-next { min-height: 42px; padding: 0 16px; border-radius: 6px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.tr-back { border: 1.5px solid #dcdad3; background: #fff; color: #1a1a1a; }
.tr-back:disabled { opacity: .4; cursor: default; }
.tr-next { border: 0; background: #1a1a1a; color: #fff; }
.tr-next:hover { background: #333; }
.tr-next.is-last { background: #f5c842; color: #1a1a1a; }
.tr-back:focus-visible, .tr-next:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }
.tr-dots { display: flex; gap: 5px; }
.tr-dots i { width: 6px; height: 6px; border-radius: 50%; background: #dcd6c6; }
.tr-dots i.on { width: 16px; border-radius: 3px; background: #1a1a1a; }
/* wide screens: the demo on the left, the words on the right */
@media (min-width: 900px) {
  .tr-box { width: min(900px, 100%); padding: 22px 26px 22px; }
  .tr-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: center; }
  .tr-title { font-size: 1.35rem; }
  .tr-say { min-height: 6em; }
}
/* phones: tighter, buttons share the width */
@media (max-width: 600px) {
  #tour-modal { padding: 12px; }
  .tr-box { padding: 16px 16px 14px; max-height: calc(var(--vvh, 100dvh) - 24px); }
  .tr-title { font-size: 1.08rem; }
  .tr-say { font-size: .88rem !important; min-height: 6em; }
  .tr-back, .tr-next { padding: 0 12px; }
  .nx-arr { width: 28px; height: 28px; }
}
@media (max-height: 620px) and (max-width: 600px) { .tr-box .nx-mapbox { aspect-ratio: 640 / 230; } .tr-say { min-height: 0; } }
/* in the tour the card is the demo's last line (no caption bar under it): a little more room at the bottom */
.tr-box .nx-card { padding-bottom: 12px; display: flex; flex-direction: column; justify-content: flex-start; }
/* the legend's slide arrows exist only on laptops (the phone's legend wraps) */
#legend-shared .lg-arr { display: none; }

/* Renewables Potential · Water: like Elevation, each line is its name and value on top, the bar under it at full width,
   so it fits however narrow the card gets (in the Explore panel the bar had shrunk to nothing) */
body.gl-page .dd-row.wt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; row-gap: 4px; column-gap: 8px; align-items: baseline; }
body.gl-page .wt-row .dd-l { grid-area: l; min-width: 0; line-height: 1.25; }
body.gl-page .wt-row .dd-v { grid-area: v; text-align: right; }
body.gl-page .wt-row .dd-track { grid-area: t; align-self: center; }
body.gl-page .wt-rows { gap: 10px; }

/* Resource rents: the bar's scale, written under it (0 to 60% of GDP, square-root spaced) */
.rn-axis { position: relative; display: block; height: 12px; margin-top: 2px; }
.rn-tk { position: absolute; top: 0; transform: translateX(-50%); font-size: 9.5px; line-height: 12px; color: #9a9a96; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rn-tk::before { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 3px; background: #cfcdc6; }
.rn-tk:first-child::before { left: 0; } .rn-tk:last-child::before { left: auto; right: 0; }
.ug-rents .rn-key { margin-top: 4px; }

/* the daily map's height, on laptops: a grip on its bottom edge (drag, or arrow keys; double-click toggles) and a
   tall / normal button under the × */
.gm-size, .gm-grip { display: none; }
@media (min-width: 900px) {
  .gm-size { position: absolute; top: 46px; right: 8px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.95); box-shadow: 0 1px 4px rgba(0,0,0,.15); color: #555; cursor: pointer; }
  .gm-size:hover { color: #1a1a1a; }
  .gm-size svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .gm-size .gm-sz-shrink, .gm-size.is-tall .gm-sz-grow { display: none; }
  .gm-size.is-tall .gm-sz-shrink { display: inline; }
  .gm-grip { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: center; align-items: flex-end; height: 18px; padding-bottom: 5px; cursor: ns-resize; touch-action: none; }
  .gm-grip span { width: 46px; height: 5px; border-radius: 3px; background: rgba(26,26,26,.28); box-shadow: 0 0 0 2px rgba(255,255,255,.7); transition: background .15s, width .15s; }
  .gm-grip:hover span, .gm-wrap.is-drag .gm-grip span, .gm-grip:focus-visible span { width: 64px; background: #1a1a1a; }
  .gm-grip:focus-visible { outline: none; }
  .gm-wrap.is-anim { transition: height .26s ease; }
  .gm-wrap.is-drag { user-select: none; }
  .gm-wrap .maplibregl-ctrl-bottom-right, .gm-wrap .maplibregl-ctrl-bottom-left { bottom: 10px; }
}
/* once the game is over and the map is closed, the button to bring it back sits in the middle */
.gm-reopen { align-self: center; margin-left: auto; margin-right: auto; display: flex; width: max-content; }

/* laptops: the charts keep the daily's size whatever the screen height (never stretched); extra height goes to the clue
   cards, stacked under the profile (body.gl-stack, see globeStackFit), while the map stays put beside them */
@media (min-width: 1100px) {
  body.at-globe .gl-side #charts-section { flex: 0 0 auto; grid-template-rows: auto; }
  body.at-globe .gl-side #line-wrapper, body.at-globe .gl-side #bar-wrapper { flex: 0 0 auto; height: clamp(300px, 34vh, 380px); min-height: 300px; }
  body.at-globe #gl-pane-profile { flex: 0 0 auto; }
  body.at-globe .gl-side { align-self: start; }
  body.gl-stack.at-globe .gl-wrap, body.gl-stack.at-globe .gl-layout.has-sel .gl-wrap {
    position: sticky; top: 12px; align-self: start; height: calc(100vh - var(--gl-top, 170px) - 22px); min-height: 420px; }
  body.gl-stack.at-globe .gl-side #clue-cards { display: flex; flex-direction: column; gap: 14px; }
  body.gl-stack.at-globe .gl-side #clue-cards .ic-card { scroll-margin-top: 12px; }
}

/* Explore, laptops: the map is never much taller than it is wide (--gl-map-max, set from its width) */
@media (min-width: 1100px) {
  body.at-globe .gl-wrap, body.at-globe .gl-layout.has-sel .gl-wrap { max-height: var(--gl-map-max, none); }
  body.gl-stack.at-globe .gl-wrap, body.gl-stack.at-globe .gl-layout.has-sel .gl-wrap { height: min(calc(100vh - var(--gl-top, 170px) - 22px), var(--gl-map-max, 9999px)); }
  /* very tall screens: cards under the globe too (globeColumns) */
  body.gl-stack.at-globe .gl-layout.gl-cols { grid-template-rows: auto auto 1fr; align-items: start; }
  body.gl-stack.at-globe .gl-layout.gl-cols .gl-wrap { position: relative; top: auto; grid-row: 1; }
  body.gl-stack.at-globe .gl-layout.gl-cols .gl-side { grid-row: 1 / 4; }
  body.gl-stack.at-globe .gl-layout.gl-cols > footer { grid-row: 3; }
  .gl-cards-left { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .gl-cards-left .ic-card { scroll-margin-top: 12px; }
}
/* the daily map, made tall: it widens into the page's margins too, centred on the column */
@media (min-width: 900px) {
  .gm-card.is-wide { position: relative; width: min(calc(100vw - 64px), 1400px); margin-left: calc(50% - min(calc(50vw - 32px), 700px)); }
}

/* very wide screens: Explore takes more of the width (up to 1,880 px), so the globe gets the room, not the margins */
@media (min-width: 2000px) {
  body.ex-hdr #app, body.at-globe #app, body.ex-picker #app { max-width: min(1880px, calc(100vw - 64px)); }
}
/* cards shared out over two columns sit one under the other in each */
body.gl-stack.at-globe .ic-slot.gl-flat { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
body.gl-stack.at-globe .ic-slot.gl-flat > .ic-cols:empty, body.gl-stack.at-globe .ic-slot.gl-flat .ic-col:empty { display: none; }
.gl-cards-left { align-items: stretch; }
body.gl-stack.at-globe #clue-cards .ic-slot.gl-flat { align-items: stretch; }
/* with cards in both columns, the map's bottom lines up with the end of the profile (set in globeColumns) */
@media (min-width: 1100px) {
  body.gl-stack.at-globe .gl-layout.gl-cols .gl-wrap { height: var(--gl-map-h, 600px); max-height: none; }
}

/* ONE HEADER ON EVERY TAB: Daily, Archive and Explore share Explore's one-line header at the same width, so the logo, the
   tabs, Stats & Leaderboard and the podium never move. Under it, the puzzle and the archive keep a narrower column
   (1,100 px, centred): a puzzle reads better narrow. Explore uses the full width for its map. */
@media (min-width: 1100px) {
  body.ex-hdr.pz-col #app { max-width: min(1100px, calc(100vw - 64px)); }   /* the header is as wide as the puzzle under it */
}
/* switching tab: the width changes at once and the move is played with transforms (globeFrame); the header's rule is
   drawn by a stand-in while it stretches */
header.hd-moving { border-bottom-color: transparent; }
header .hd-rule { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #1a1a1a; pointer-events: none; transform-origin: 50% 50%; }
/* the puzzle's narrower header (1,100 px): the same one-line header, a touch tighter so it fits on one line */
@media (min-width: 1240px) {
  body.ex-hdr .hd-grid #mode-nav { flex-wrap: nowrap; white-space: nowrap; }
  body.ex-hdr.pz-col .hd-grid { column-gap: 16px; }
  body.ex-hdr.pz-col .hd-grid #mode-nav .mode-btn { padding: 0 15px; }
  body.ex-hdr.pz-col .hd-grid .lb-split .mode-btn { padding: 0 8px; }
  body.ex-hdr.pz-col .hd-grid .lb-split .mode-btn:first-child { padding-left: 12px; }
  body.ex-hdr.pz-col .hd-grid .lb-split .mode-btn:last-child { padding-right: 12px; }
  body.ex-hdr.pz-col .hd-grid .podium { gap: 8px; }
  body.ex-hdr.pz-col .hd-grid .podium-name { max-width: 60px; }
}

/* ---- the puzzle's four top cards, rebalanced for the 1,100 px column: the two narrow cards (headline stats, latest
   mix) keep the share of the width they had in the 900 px layout (220 of 888 px ≈ 24.8%), a little more (29%), instead of a fixed 220 px,
   so all four grow together and the two narrow ones stay the same width as each other */
@media (min-width: 601px) {
  body.pz-col:not(.at-globe) #balance-card { grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); }
  body.pz-col:not(.at-globe) #charts-section { grid-template-columns: minmax(0, 1fr) minmax(220px, 29%); }
  /* the flow: no wider than it needs, centred in its card (both ways), its title centred above it */
  body.pz-col:not(.at-globe) .bc-flow > .stat-label { text-align: center; }
  body.pz-col:not(.at-globe) #flow-chart { width: 100%; margin: auto 0; }
}

/* ---- How to play (test page) */
#howto-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
#howto-modal .st-backdrop { position: absolute; inset: 0; }
.ht-box { max-width: 540px; max-height: calc(100vh - 32px); overflow-y: auto; gap: 12px; }
.ht-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 1px solid #e6e4de; border-radius: 50%; background: #fff; color: #555; font-size: 18px; line-height: 1; cursor: pointer; }
.ht-x:hover { color: #1a1a1a; border-color: #ccc; }
.ht-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ht-steps li { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 16px; align-items: center; }
.ht-pic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 58px; padding: 8px; border-radius: 10px; background: #f7f6f2; }
.ht-txt { font-size: .88rem; line-height: 1.45; color: #444; }
.ht-txt strong { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; font-size: .95rem; color: #1a1a1a; }
.ht-txt strong b { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #1a1a1a; color: #fff; font-size: 11px; }
.ht-mix { display: flex; width: 100%; height: 26px; border-radius: 4px; overflow: hidden; gap: 1px; }
.ht-mix span { display: block; height: 100%; }
.ht-guess { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 12px; white-space: nowrap; }
.ht-gname { flex: 1; font-weight: 600; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; }
.ht-arrow { flex: none; }
.ht-gkm { padding: 1px 5px; border-radius: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ht-batt { display: flex; gap: 3px; padding: 3px; border: 2px solid #1a1a1a; border-radius: 5px; position: relative; }
.ht-batt::after { content: ""; position: absolute; right: -6px; top: 50%; width: 3px; height: 8px; margin-top: -4px; border-radius: 0 2px 2px 0; background: #1a1a1a; }
.ht-batt i { width: 12px; height: 18px; border-radius: 2px; background: #e7e5df; }
.ht-batt i.is-on { background: #54a070; }
.ht-map { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid #1a1a1a; border-radius: 8px; background: #fff; }
.ht-map svg { width: 22px; height: 22px; }
.ht-foot { padding-top: 10px; border-top: 1px solid #eeece6; font-size: .85rem !important; color: #555 !important; }
/* the link on the puzzle line */
.ht-q { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 8px; padding: 0; vertical-align: 2px; border: 1px solid #cfccc4; border-radius: 50%; background: #fff; color: #666; font: 600 12px/1 inherit; cursor: pointer; }
.ht-q.is-text { width: auto; height: auto; padding: 3px 10px; border-radius: 999px; border-color: #e3c56a; background: #fff8e3; color: #8a6510; font-size: 13px; vertical-align: 1px; }
.ht-q:hover { border-color: #999; color: #1a1a1a; }
.ht-q.is-text:hover { border-color: #c9a33c; color: #6b4d08; }
@media (max-width: 600px) {
  .ht-box { padding: 18px 16px 16px; }
  .ht-steps { gap: 12px; }
  .ht-steps li { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .ht-pic { min-height: 50px; padding: 6px; }
  .ht-guess { font-size: 10.5px; gap: 4px; justify-content: center; }
  .ht-gname { display: none; }
  .ht-txt { font-size: .84rem; }
  .ht-q.is-text { font-size: 12px; padding: 2px 9px; }
}

/* ---- Welcome (test page): the walkthrough, on the Explore tour's frame (.tr-*). Its heights are measured in
   showWelcome (the tallest picture, the tallest text), so nothing here fixes them */
#welcome-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 12px; height: 100vh; height: 100dvh; }
#welcome-modal .st-backdrop { position: absolute; inset: 0; }
.wl-box { width: min(880px, 100%); }
.wl-box .tr-say { min-height: 0; }
.wl-copy { display: flex; flex-direction: column; gap: 8px; }
.wl-box .tr-back, .wl-box .tr-next { white-space: nowrap; }
.wl-stage { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 12px; background: #f7f6f2; border: 1px solid #eeebe3; overflow: hidden; touch-action: pan-y; }
.wl-pic { width: 100%; max-width: 360px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: scale(var(--wl-k, 1)); transform-origin: 50% 50%; }
.wl-pic.is-in { animation: wlIn .35s ease both; }
@keyframes wlIn { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .wl-pic.is-in { animation: none; } }
.wl-skip { align-self: center; margin-top: 2px; padding: 4px 8px; border: 0; background: none; color: #888; font: inherit; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wl-skip:hover { color: #1a1a1a; }
.wl-mix { display: flex; width: 100%; gap: 1px; border-radius: 4px; overflow: hidden; }
.wl-mix i { display: block; min-width: 2px; }
.wl-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 10px; font-size: 11.5px; color: #444; }
.wl-chips span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wl-chips i { width: 8px; height: 8px; border-radius: 2px; }
.wl-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.wl-q { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #1a1a1a; color: #f5c842; font-size: 28px; font-weight: 700; }
.wl-prof { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.wl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; }
.wl-stats > div { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; text-align: center; }
.wl-stats .stat-label { font-size: 9.5px; }
.wl-stats b { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wl-stats .bc-world { font-size: 10px; padding: 2px 7px; }
.wl-trade { align-self: center; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); font-size: 11px; font-weight: 600; }
.wl-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; }
.wl-line { display: block; width: 100%; height: 56px; }
.wl-ax { display: flex; justify-content: space-between; font-size: 10px; color: #9a9a96; }
.wl-guess { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 300px; }
.wl-grow { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #fff; border: 1px solid #e6e4de; border-radius: 6px; font-size: 13px; }
.wl-grow.is-win { border-color: #9fd0b0; }
.wl-gn { width: 16px; color: #999; font-size: 11px; font-variant-numeric: tabular-nums; }
.wl-gname { flex: 1; font-weight: 600; }
.wl-gfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding: 0 6px 0 2px; }
.wl-gfoot .ht-map { width: 36px; height: 36px; }
.wl-map { width: 100%; aspect-ratio: 640 / 336; }
.wl-map svg { display: block; width: 100%; height: 100%; }
.wl-maptag { display: inline-flex; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid #ecd9ac; font-size: 11.5px; color: #6b5a2c; }
.wl-shop { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.wl-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.wl-cards span { padding: 6px 10px; border: 1px dashed #c9c3b2; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 600; color: #444; }
.wl-after { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.wl-after span { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: #fff; border: 1px solid #e6e4de; border-radius: 8px; font-size: 12px; color: #666; }
.wl-after b { font-size: .95rem; color: #1a1a1a; }
.ht-full { margin-left: 4px; font-size: inherit !important; }
@media (max-width: 600px) {
  .wl-stage { padding: 10px; }
  .wl-after span { padding: 9px; }
}

/* ---- leaderboard rank column: sized to its longest rank (lbRankFit sets --lb-rank-n, the characters in it); without
   it, the widths are as before */
.lb-list .lb-rank { width: max(var(--lb-rank-min, 32px), calc(var(--lb-rank-n, 0) * 0.52rem + 8px)); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { #lb-modal .lb-list { --lb-rank-min: 26px; } #lb-modal .lb-list .lb-rank { width: max(var(--lb-rank-min, 26px), calc(var(--lb-rank-n, 0) * 0.52rem + 6px)); } }

/* ---- Change name (test page) */
#rename-modal { position: fixed; inset: 0; z-index: 720; display: flex; align-items: center; justify-content: center; padding: 16px; }
#rename-modal .st-backdrop { position: absolute; inset: 0; }
.rn-box { position: relative; width: 100%; max-width: 360px; }
.rn-box .st-header { display: flex; align-items: center; justify-content: space-between; }
.rn-x { width: 30px; height: 30px; border: 0; background: none; color: #777; font-size: 20px; line-height: 1; cursor: pointer; }
.rn-x:hover { color: #1a1a1a; }
.rn-body { padding: 1.1rem 1.2rem 1.2rem; }
.rn-note { margin: 0 0 .7rem; font-size: .82rem; color: #666; }
#rn-input { width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid #d0d0d0; border-radius: 3px; font: inherit; font-size: .95rem; outline: none; }
#rn-input:focus { border-color: #1a1a1a; }
.rn-msg { min-height: 18px; margin: 5px 0 0; font-size: .78rem; color: #dc2626; }
.rn-msg.is-ok { color: #2f8a52; }
.rn-go { width: 100%; margin-top: .5rem; padding: 9px; border: 0; border-radius: 3px; background: #1a1a1a; color: #fff; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.rn-go:disabled { background: #c9c9c6; cursor: default; }
.rn-link { align-self: flex-start; padding: 0; border: 0; background: none; color: #888; font: inherit; font-size: .78rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.rn-link:hover { color: #1a1a1a; }


/* Explore: the link from a country's panel to its page */
.gl-more-row { margin: 10px 0 2px; font-size: .82rem; color: #777; text-align: right; }
.gl-cpage { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: #c9c6bd; white-space: nowrap; }
.gl-cpage:hover { color: #1a1a1a; text-decoration-color: currentColor; }

/* ---- Country pages: the words, and the locked profile */
.cp-words { max-width: 720px; margin: 16px auto; padding: 0 20px; color: #444; }
.cp-words h1 { font-size: 1.4rem; margin: 0 0 8px; color: #1a1a1a; }
body.cp-ready #cp-words { display: none; }                     /* once the page runs, the words live in the panel */
.cp-words-in { margin: 10px 0 4px; padding: 12px 14px; background: #fff; border: 1px solid #e6e4de; border-radius: 8px; font-size: .9rem; line-height: 1.55; color: #3a3a37; }
.cp-words-in p { margin: 0 0 6px; }
.cp-words-in p:last-child { margin-bottom: 0; }
.cp-lock { position: relative; margin-top: 10px; }
.cp-skel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; filter: blur(3px); opacity: .7; }
.cp-skel i { display: block; height: 70px; border-radius: 8px; background: linear-gradient(90deg, #ecebe6, #f4f3ef 50%, #ecebe6); }
.cp-skel i.bar { grid-column: 1 / -1; height: 36px; background: linear-gradient(90deg, #e8925a 0 30%, #4a4a4a 30% 58%, #f5c842 58% 70%, #9b6dbd 70% 80%, #4a90c4 80% 90%, #5ab88a 90%); opacity: .45; }
.cp-skel i.chart { grid-column: 1 / -1; height: 180px; }
.cp-skel i.w3 { height: 54px; }
.cp-lock-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; text-align: center; }
.cp-lock-msg b { font-size: 1.05rem; color: #1a1a1a; }
.cp-lock-msg span { max-width: 34ch; font-size: .88rem; color: #555; }
.cp-play { margin-top: 8px; padding: 9px 16px; border-radius: 6px; background: #1a1a1a; color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; }
.cp-play:hover { background: #333; }
body.cp-locked .at-tools, body.cp-locked .gl-maphint, body.cp-locked .gl-x, body.cp-locked #back-to-cats, body.cp-locked .gl-practice { display: none !important; }
.cp-words-in h2 { margin: 14px 0 6px; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: #77776f; }
.cp-words-in .az { columns: 2 150px; column-gap: 18px; margin: 0; padding: 0; list-style: none; }
.cp-words-in .az li { break-inside: avoid; padding: 2px 0; }
.cp-words-in .az a { color: #1a1a1a; text-decoration: none; }
.cp-words-in .az a:hover { text-decoration: underline; }

/* What's new: the Clue Shop as the featured update */
.nx-shop { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 16px; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px #ecdfc0; }
.nx-shop-sign { width: 64px; height: 64px; display: block; }
.nx-shop-bat { display: flex; align-items: center; gap: 44px; }
.nx-shop-bat .si-bat { transform: scale(1.4); transform-origin: 100% 50%; }
.nx-shop-bat em { font-style: normal; font-size: .82rem; color: #6b5a2c; }
.nx-shop .si-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: 100%; }
@media (max-width: 600px) { .nx-shop .si-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .nx-shop-bat { gap: 30px; } }
.nx-shop .si-tile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid #ecebe6; border-radius: 6px; background: #fdfcf9; }
.nx-shop .si-art svg { display: block; width: 100%; height: 44px; }
.nx-shop .si-name { font-size: .72rem; font-weight: 600; color: #444; }

/* ---- All energy view (test page): the switch above the base cards, and what the energy view hides */
.ev-toggle { display: inline-flex; flex: none; width: max-content; max-width: 100%; align-self: flex-start; justify-self: start; margin: 0 0 10px; padding: 3px; gap: 2px; border-radius: 999px; background: #ecebe6; }
.ev-toggle button { padding: 5px 14px; border: 0; border-radius: 999px; background: none; color: #555; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.ev-toggle button[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.ev-toggle button:not([aria-pressed="true"]):hover { color: #1a1a1a; }
body.view-energy .co2-col, body.view-energy .co2-note, body.view-energy .co2-smoke, body.view-energy .co2-figure, body.view-energy .co2-box { display: none !important; }
.ev-note { margin: 6px 0 0; font-size: .74rem; color: #8a6a1c; }

/* ---- Final energy use (test page): a card under the charts */
#use-card { container-type: inline-size; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; min-width: 0; margin-top: 14px; }
.uc-box { background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; box-sizing: border-box; padding: .9rem 1.1rem .7rem; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.uc-head { display: flex; align-items: center; gap: 10px 8px; flex-wrap: wrap; }
.uc-title { margin-right: auto; }
.uc-ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uc-unit { position: relative; display: inline-flex; align-items: center; }
.uc-unit select { appearance: none; -webkit-appearance: none; padding: 5px 26px 5px 12px; border: 1px solid #dcdcd6; border-radius: 999px; background: #fff; color: #333; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; transition: border-color .15s; }
.uc-unit select:hover, .uc-unit select:focus-visible { border-color: #1a1a1a; outline: none; }
.uc-unit svg { position: absolute; right: 10px; pointer-events: none; color: #666; }
.uc-unit .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the title opens the definition of final energy */
.uc-title { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; color: #888; cursor: pointer; }
.uc-title .sec-t { transition: opacity .15s; }
.uc-title:hover .sec-t { opacity: .75; }
.uc-title { color: #1a1a1a; }
.uc-chev { transition: transform .3s ease; }
.uc-title[aria-expanded="true"] .uc-chev { transform: rotate(180deg); color: #1a1a1a; }
.uc-fe { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -12px; transition: grid-template-rows .35s ease, opacity .3s ease, margin-top .35s ease; }
.uc-fe.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.uc-fe-in { overflow: hidden; min-height: 0; }
.uc-fe-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 22px; padding: 10px 14px; border-left: 3px solid #1a1a1a; background: #f6f5f1; border-radius: 0 6px 6px 0; }
.uc-fe-box p { margin: 0; font-size: .78rem; line-height: 1.45; color: #555; }
.uc-fe-box b { display: block; margin-bottom: 1px; font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: #1a1a1a; }
@container (max-width: 760px) { .uc-fe-box { grid-template-columns: minmax(0, 1fr); } }

/* the groups' definitions: a panel sliding in from the left over the flow */
.uc-defs { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid #dcdcd6; border-radius: 999px; background: #fff; color: #555; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.uc-defs:hover { border-color: #1a1a1a; color: #1a1a1a; }
.uc-defs[aria-expanded="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.uc-left { position: relative; overflow: hidden; transition: min-height .3s ease; }
.uc-panel { position: absolute; inset: 0; z-index: 2; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 2px 18px 0 0; background: #fff; border-right: 1px solid #ececea;
  transform: translateX(-102%); opacity: 0; pointer-events: none; transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.uc-panel.is-open { transform: none; opacity: 1; pointer-events: auto; }
.uc-ph { display: flex; align-items: center; justify-content: space-between; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1a1a1a; }
.uc-px { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: #888; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.uc-px:hover { background: #f1f0eb; color: #1a1a1a; }
.uc-hl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.uc-hl li { display: flex; gap: 10px; align-items: center; font-size: .8rem; line-height: 1.35; color: #555; }
.uc-hl li b { display: block; color: #1a1a1a; font-size: .8rem; }
.uc-hi { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); }
.uc-hi svg { width: 16px !important; height: 16px !important; }
.uc-hn { margin: auto 0 0; padding-top: 4px; font-size: .72rem; color: #999; }
.uc-panel .uc-hl li { opacity: 0; transform: translateX(-10px); transition: opacity .3s ease, transform .3s ease; }
.uc-panel.is-open .uc-hl li { opacity: 1; transform: none; }
.uc-panel.is-open .uc-hl li:nth-child(1) { transition-delay: 0.12s; }
.uc-panel.is-open .uc-hl li:nth-child(2) { transition-delay: 0.16s; }
.uc-panel.is-open .uc-hl li:nth-child(3) { transition-delay: 0.20s; }
.uc-panel.is-open .uc-hl li:nth-child(4) { transition-delay: 0.24s; }
.uc-panel.is-open .uc-hl li:nth-child(5) { transition-delay: 0.28s; }
.uc-panel.is-open .uc-hl li:nth-child(6) { transition-delay: 0.32s; }
.uc-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #ecebe6; }
.uc-switch button { padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: #555; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.uc-switch button[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.uc-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.uc-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.uc-stats { display: flex; justify-content: center; gap: 12px 44px; flex-wrap: wrap; text-align: center; }
.uc-stats .bc-stat { gap: 4px; }
.uc-stats .stat-label { margin: 0; }
.uc-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.uc-big { font-size: 1.5rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; color: #1a1a1a; }
.uc-sub { font-size: .74rem; color: #888; }
/* the flow: sources -> applications */
.uc-flow { position: relative; width: 100%; min-width: 0; flex: 1 1 auto; min-height: 260px; }
.uc-flow > .uf-svg { position: absolute; inset: 0; }
.uf-svg { display: block; max-width: 100%; overflow: visible; }
.uf-l { opacity: .42; transition: opacity .15s; cursor: default; }
.uf-l:hover { opacity: .8; }
#use-card.uf-on .uf-l { opacity: .1; }
#use-card.uf-on .uf-l.is-hi { opacity: .82; }
.uf-t { font-size: 11.5px; fill: #555; }
.uf-t .uf-n { font-weight: 600; fill: #333; }
.uf-t .uf-p { font-weight: 700; fill: #1a1a1a; font-variant-numeric: tabular-nums; }
.uc-note { margin: -4px 0 0; font-size: .72rem; color: #8a6a1c; }
/* tiles, in groups */
.uc-tgs { display: flex; gap: 12px; }
.uc-tg { flex: var(--n) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.uc-tgl { font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #aaa; white-space: nowrap; }
.uc-tiles { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.uc-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 3px 9px; border: 1px solid #ececea; border-radius: 8px; background: #fff; transition: border-color .15s, background .15s; cursor: default; min-width: 0; }
.uc-tile:hover { border-color: var(--c); }
.uc-tile.is-top { background: color-mix(in srgb, var(--c) 9%, #fff); border-color: color-mix(in srgb, var(--c) 45%, #fff); }
.uc-ic { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.uc-ic svg { width: 24px !important; height: 24px !important; flex: none; }
.uc-pc { font-size: 1.15rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: #1a1a1a; }
.uc-nm { font-size: .74rem; font-weight: 600; color: #444; line-height: 1.2; }
.uc-wd { font-size: .66rem; line-height: 1.25; color: #999; font-variant-numeric: tabular-nums; }
.uc-wd > span { white-space: nowrap; }
.uc-wd b { font-size: .56rem; margin-left: 1px; }
.uc-wd b.up { color: #2f8a52; } .uc-wd b.dn { color: #b4533a; }
.uc-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.uc-right .chart-label { margin: 2px 0 -6px; }
.uc-chart { position: relative; flex: 1; min-height: 220px; }
.uc-src { margin: 0; text-align: right; }
/* the card adapts to its own width: Explore's panel and phones get one column, the flow full width */
@container (max-width: 980px) {
  .uc-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .uc-chart { flex: none; height: 250px; min-height: 0; }
  .uc-flow { flex: none; height: 300px; min-height: 0; }
}
@container (max-width: 560px) {
  /* two rows: sources 4 | 2, applications 2 + 1 | 2; every row full width */
  .uc-tgs { flex-direction: row; flex-wrap: wrap; gap: 10px 10px; }
  .uc-tg.is-f, .uc-tg.is-d, .uc-tg.is-b { flex-basis: 100%; }
  .uc-tiles { gap: 5px; }
  .uc-tile { padding: 8px 2px 7px; border-radius: 6px; }
  .uc-ic { width: 32px; height: 32px; margin-bottom: 2px; }
  .uc-ic svg { width: 20px !important; height: 20px !important; }
  .uc-pc { font-size: .98rem; }
  .uc-nm { font-size: .62rem; }
  .uc-wd { font-size: .56rem; }
  .uc-wd b { display: none; }
  .uc-big { font-size: 1.25rem; }
  .uc-stats { gap: 20px; }
  .uf-t { font-size: 10.5px; }
  .uc-chart { height: 220px; }
  .uc-flow { height: 260px; }
  .uc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 8px; }
  .uc-head .uc-unit { grid-column: 2; grid-row: 1; }
  .uc-head .uc-ctrls { grid-column: 1 / -1; gap: 6px; }
  .uc-switch button { padding: 4px 10px; }
  .uc-defs { padding: 5px 9px; }
}
@media (max-width: 600px) { .uc-box { padding: .9rem .9rem .7rem; } }
.rn-held { display: block; margin-top: 4px; font-size: .72rem; color: #b45309; }
/* ---- Play on another device (test page) */
.dv-box .rn-body { display: flex; flex-direction: column; }
.dv-h { margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #555; }
.dv-code { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 3px; background: #f7f7f4; }
.dv-code code { flex: 1; min-width: 0; font-size: .8rem; letter-spacing: .02em; word-break: normal; overflow-wrap: break-word; line-height: 1.5; color: #1a1a1a; }
.dv-copy { flex: none; padding: 4px 10px; border: 1px solid #1a1a1a; border-radius: 3px; background: #fff; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.dv-rule { border: 0; border-top: 1px solid #ececea; margin: 1rem 0 .9rem; }
.dv-in { width: 100%; box-sizing: border-box; margin-bottom: 6px; padding: 8px 12px; border: 1px solid #d0d0d0; border-radius: 3px; font: inherit; font-size: .9rem; outline: none; }
.dv-in:focus { border-color: #1a1a1a; }
#dv-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.rn-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.rn-links .rn-link { align-self: auto; }
.dv-in-prompt { display: block; margin: 10px auto 0; }
#device-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; }
/* electricity, from generation to use (inside the definition of final energy) */
.uc-eb { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 2px; padding-top: 8px; border-top: 1px solid #e6e5df; }
.uc-eb p { margin: 0; font-size: .78rem; line-height: 1.45; color: #555; }
.uc-eb-h b { display: inline; margin-right: 6px; font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: #1a1a1a; }
.uc-eb-in { display: flex; gap: 12px; flex-wrap: wrap; }
.uc-eb-in strong { color: #1a1a1a; font-variant-numeric: tabular-nums; }
.uc-eb-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; gap: 1px; background: #fff; }
.uc-eb-bar span { min-width: 2px; }
.uc-eb-k { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .74rem; color: #555; }
.uc-eb-k li { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.uc-eb-k i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.uc-eb-k strong { color: #1a1a1a; font-weight: 600; font-variant-numeric: tabular-nums; }
.uc-eb-k em { font-style: normal; color: #999; }
.uc-eb-n { font-size: .72rem !important; color: #8a6a1c !important; }
.uc-eb-cmp { margin-left: auto; color: #999; font-size: .72rem; }

.uc-fe-def b, .uc-eb-t { display: inline !important; margin: 0 6px 0 0 !important; font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: #1a1a1a; }
/* card dates: bold; matte dark red with a ! when not the electricity data's year (test page) */
.cd-yr, .uc-fe-box .cd-yr { display: inline !important; margin: 0 !important; font: inherit; font-weight: 800; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.cd-yr.is-off, .uc-fe-box .cd-yr.is-off { color: #9b3b36; cursor: help; }
.cd-bang { margin-left: 1px; letter-spacing: 0; font-weight: 800; color: #9b3b36; }
.uc-ast { color: #c0392b; font-weight: 700; margin-left: 2px; }
.uc-eb-d { font-size: .72rem !important; color: #777 !important; }
/* What's new: the final energy demo (five steps from the data). A white panel: a bar (step, dots, arrows), the picture
   with room around it, and the caption on its own band below; nothing sits on top of anything */
.fe-demo { display: flex; flex-direction: column; min-width: 0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #ecdfc0; }
.fe-bar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-bottom: 1px solid #f1ead8; }
.fe-step { flex: 1; min-width: 0; font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: #6b5a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fe-step b { margin-right: 6px; font-variant-numeric: tabular-nums; color: #b0a58a; font-weight: 700; }
.fe-arr { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #f4efe2; color: #1a1a1a; cursor: pointer; transition: background .15s; }
.fe-arr svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fe-arr:hover { background: #ebe3cd; }
.fe-arr:focus-visible { outline: 2px solid #f5c842; outline-offset: 2px; }
.fe-vis { position: relative; height: 260px; margin: 16px 18px; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; }
.fe-vis.is-in { opacity: 1; transform: none; }
.fe-vis > .uf-svg, .fe-vis > .fe-chart { position: absolute; inset: 0; }
.fe-vis .nx-map { width: 100%; height: 100%; }
.fe-vis .nx-map path[data-i] { fill: #e8e2d4; stroke: #fff; stroke-width: .4; }
.fe-cap { margin: 0; padding: 11px 16px 12px; border-top: 1px solid #f1ead8; background: #fcfaf4; font-size: .84rem; line-height: 1.45; color: #444; }
.fe-dots { display: flex; gap: 6px; margin-right: 4px; }
.fe-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #d9d3c2; cursor: pointer; }
.fe-dot[aria-selected="true"] { background: #1a1a1a; }
.fe-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.fe-tile { padding: 12px 4px 10px; }
.fe-chart .fe-ax { font-size: 10px; fill: #9a9a96; }
.fe-chart .fe-lb { font-size: 12px; font-weight: 700; }
.fe-grp { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.fe-grow { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); align-items: center; gap: 10px; }
.fe-gn { font-size: .8rem; font-weight: 600; color: #333; }
.fe-gbar { display: flex; height: 26px; gap: 2px; border-radius: 4px; overflow: hidden; }
.fe-gbar span { display: flex; align-items: center; justify-content: center; min-width: 2px; font-size: .7rem; font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.fe-gkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: calc(4.6rem + 10px); font-size: .72rem; color: #666; }
.fe-gkey i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 600px) {
  .fe-vis { height: 240px; margin: 12px 12px; }
  .fe-bar { padding-left: 12px; }
  .fe-tiles { gap: 6px; }
  .fe-tile { padding: 7px 2px 6px; }
}
/* Explore, laptops (test page) */
@media (min-width: 1100px) {
  /* default: the map beside the electricity cards and exactly as tall as they are; final energy the full width below */
  body.ex-test.at-globe:not(.ex-bigmap) .gl-layout { grid-template-rows: auto auto auto; align-items: stretch; row-gap: 14px; }
  body.ex-test.at-globe:not(.ex-bigmap) .gl-wrap, body.ex-test.at-globe:not(.ex-bigmap) .gl-layout.has-sel .gl-wrap,
  body.ex-test.gl-stack.at-globe:not(.ex-bigmap) .gl-wrap, body.ex-test.gl-stack.at-globe:not(.ex-bigmap) .gl-layout.has-sel .gl-wrap {
    grid-column: 1; grid-row: 1; position: relative; top: auto; align-self: stretch; height: auto !important; max-height: none !important; min-height: 420px; }
  body.ex-test.at-globe:not(.ex-bigmap) .gl-side { grid-column: 2; grid-row: 1; align-self: start; }
  body.ex-test.at-globe:not(.ex-bigmap) #use-card.uc-wide { grid-column: 1 / -1; grid-row: 2; }
  body.ex-test.at-globe:not(.ex-bigmap) .gl-layout > footer { grid-column: 1 / -1; grid-row: 3; }
  /* enlarged: the cards get more room beside a tall map that stays in view, final energy in their column */
  body.ex-test.ex-bigmap.at-globe .gl-layout { grid-template-columns: minmax(0, 1fr) clamp(640px, 62%, 1000px); }
  body.ex-test.ex-bigmap.at-globe .gl-wrap, body.ex-test.ex-bigmap.at-globe .gl-layout.has-sel .gl-wrap,
  body.ex-test.ex-bigmap.gl-stack.at-globe .gl-wrap, body.ex-test.ex-bigmap.gl-stack.at-globe .gl-layout.has-sel .gl-wrap {
    position: sticky; top: 12px; align-self: start; height: calc(100vh - 110px) !important; max-height: none !important; min-height: 420px; }
  /* the map's tools span exactly the map */
  body.ex-test.at-globe .at-tools { grid-template-columns: auto minmax(0, 1fr) auto; width: var(--ex-map-w, 40%); max-width: var(--ex-map-w, 40%); }
  .ex-big { position: absolute; right: 10px; top: 62px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 999px;
    background: #fff; color: #333; font: inherit; font-size: .76rem; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; }
  .ex-big:hover { color: #1a1a1a; box-shadow: 0 1px 6px rgba(0,0,0,.26); }
}
.ex-big { display: none; }
@media (min-width: 1100px) { body.ex-test.at-globe .ex-big { display: inline-flex; } }
/* the final energy card: two columns from 760px; its right column arranges its own tiles */
@container (min-width: 700px) and (max-width: 980px) {
  .uc-body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; }
  .uc-chart { flex: 1; height: auto; min-height: 200px; }
  .uc-flow { flex: 1 1 auto; height: auto; min-height: 260px; }
  /* two rows: sources 4 | 2, applications 2 + 1 | 2; every row full width */
  .uc-tgs { flex-direction: row; flex-wrap: wrap; gap: 8px 10px; }
  .uc-tg.is-f, .uc-tg.is-d, .uc-tg.is-b { flex-basis: 100%; }
  .uc-tiles { gap: 6px; }
  .uc-tile { padding: 7px 2px 6px; }
  .uc-ic { width: 30px; height: 30px; margin-bottom: 2px; }
  .uc-ic svg { width: 18px !important; height: 18px !important; }
  .uc-pc { font-size: 1rem; }
  .uc-nm { font-size: .64rem; }
  .uc-wd { font-size: .58rem; }
  .uc-wd b { display: none; }
}
/* Explore: tiles colour the map */
body.at-globe.ex-test #use-card .uc-tile { cursor: pointer; }
body.at-globe.ex-test #use-card .uc-tile.is-map { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
/* the page's two sections, electricity and final energy: one slim heading each, a rule running to its right */
.sec-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 0; border: 0; }
.sec-t { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #1a1a1a; line-height: 1.2; white-space: nowrap; }
.sec-d { font-size: .76rem; color: #8a8a85; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.sec-line { flex: 1 1 40px; min-width: 24px; height: 0; border-top: 2px solid #1a1a1a; }
.uc-title { gap: 8px; }
#sec-elec { margin: -8px 0 -10px; min-height: 16px; }          /* sits in the gap that was already above the cards */
#use-card .sec-h { min-height: 30px; }
@media (max-width: 600px) {
  .sec-d { display: none; }
  #sec-elec { margin: -6px 0 -8px; }
  #use-card .uc-ctrls { flex: 0 1 auto; flex-wrap: nowrap; gap: 6px; }
  #use-card .uc-defs-t { display: none; }
  #use-card .uc-defs { padding: 6px 9px; }
  #use-card .uc-head { display: flex; }
  #use-card .uc-head .uc-unit { margin-left: auto; grid-column: auto; grid-row: auto; }
}

/* test: the panel's head in two rows on laptops and tablets. Row 1: flag or icon, name over one line of detail, Practice,
   close. Row 2: the tabs, sharing the panel's full width evenly. A group's rule moves out of the subtitle (its definition
   says it, just below), and the definition keeps clear of the Electricity heading. */
@media (min-width: 701px) {
  body.ex-test.at-globe .gl-side > .gl-p-head { flex-wrap: wrap; row-gap: 10px; column-gap: 10px; }
  body.ex-test.at-globe .gl-p-head > div:not(.gl-tabs) { flex: 1 1 0; min-width: 0; }
  body.ex-test.at-globe .gl-p-head h3 { overflow: visible; text-overflow: clip; }
  body.ex-test.at-globe .gl-p-head > div:not(.gl-tabs) > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.ex-test.at-globe .gl-sub-rule { display: none; }
  body.ex-test.at-globe .gl-p-head .gl-practice { margin-left: 0; }
  body.ex-test.at-globe .gl-p-head .gl-x { margin-left: 0; }
  /* the tabs as one segmented bar: equal parts at any count, so the row is always full */
  body.ex-test.at-globe .gl-p-head .gl-tabs { order: 3; flex: 1 1 100%; margin: 0; gap: 2px; padding: 3px; border-radius: 999px; background: #f1efe9; }
  body.ex-test.at-globe .gl-p-head .gl-tabs > :first-child { margin-left: 0; }
  body.ex-test.at-globe .gl-p-head .gl-tabs-sep { margin: 0 3px; height: 16px; background: #d9d6cd; }
  body.ex-test.at-globe .gl-p-head .gl-tab { flex: 1 0 auto; min-height: 28px; border: 0; background: transparent; text-align: center; }
  body.ex-test.at-globe .gl-p-head .gl-tab:hover { background: #fff; }
  body.ex-test.at-globe .gl-p-head .gl-tab[aria-selected="true"] { background: #1a1a1a; color: #fff; }
  body.ex-test.at-globe .gl-p-head .gl-tab--card[aria-selected="true"] { background: #f5a623; color: #1a1a1a; }
  body.ex-test.at-globe .gl-def { margin: -2px 0 4px; }
  body.ex-test.at-globe #sec-elec { margin-top: 0; }
}

/* test: the map's row keeps one height (exRowLock); the panel's pane stretches to it, and a clue card fills it */
@media (min-width: 1100px) {
  body.ex-rowlock.at-globe .gl-side { display: flex; flex-direction: column; }
  body.ex-rowlock.at-globe .gl-side > .gl-pane:not([hidden]), body.ex-rowlock.at-globe .gl-side > #clue-cards:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column; }
  /* the visible card sits in #clue-cards > .ic-slot > .ic-cols > .ic-col: each level passes the height down */
  body.ex-rowlock.at-globe .gl-side #clue-cards :is(.ic-slot, .ic-cols, .ic-col):has(.ic-card:not([hidden])) { flex: 1 1 auto; display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-col:not(:has(> .ic-card:not([hidden]))) { display: none; }
  /* the card's body takes the extra height; its boxes share it, each with its content centred */
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > :not(.ic-head):not(.ic-src) { flex: 1 1 auto; }
  /* power trade: the rows share the height (up to a point), the bars a little thicker; no trade: the note fills it */
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .et-body { display: flex; flex-direction: column; justify-content: center; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .et-body .nb-row:not(.nb-tots) { flex: 1 1 0; height: auto; min-height: 22px; max-height: 90px; align-items: stretch; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .et-body .nb-row:not(.nb-tots) > * { display: flex; align-items: center; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .et-body .nb-bar { height: 44%; min-height: 12px; max-height: 30px; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .et-body .et-none { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
  /* fuel trade: the flow is drawn to any height (its SVG stretches), so it takes all of it */
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .ft-wrap { display: flex; flex-direction: column; }
  html:not(.ft-boe) body.ex-rowlock.at-globe .gl-side #clue-cards .ft-view--usd, html.ft-boe body.ex-rowlock.at-globe .gl-side #clue-cards .ft-view--boe { flex: 1 1 auto; display: flex; flex-direction: column; gap: inherit; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .ft-stage { flex: 1 1 auto; aspect-ratio: auto; min-height: 220px; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .ug-grid, body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .nv-grid,
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .pp-grid { align-content: stretch; }
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .ug-grid > *, body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .nv-grid > *,
  body.ex-rowlock.at-globe .gl-side #clue-cards .ic-card > .pp-grid > * { display: flex; flex-direction: column; justify-content: center; }
}

/* the tiles fill the height the card keeps for them (see UC_TGS_H) */
#use-card .uc-tgs { align-content: stretch; }
#use-card .uc-tg > .uc-tiles { flex: 1 1 auto; }

/* final energy: entrance animations (ucPlay; the What's new demo too). Transforms and opacity only. */
@keyframes ufGrowY { from { transform: scaleY(0); } to { transform: none; } }
@keyframes ufSweep { from { transform: scaleX(0); } to { transform: none; } }
@keyframes ufFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ucRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes feDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.uc-play .uf-node { transform-box: fill-box; transform-origin: center; animation: ufGrowY .45s cubic-bezier(.2,.8,.2,1) both; }
.uc-play .uf-l { transform-box: fill-box; transform-origin: left center; animation: ufSweep .75s cubic-bezier(.3,.7,.2,1) both; }
.uc-play .uf-t { animation: ufFade .4s ease both; }
.uc-play .uc-tile, .uc-play .fe-tile { animation: ucRise .45s cubic-bezier(.2,.8,.2,1) both; }
.uc-play .uc-tgl { animation: ufFade .4s ease .2s both; }
.uc-play .fe-ln { stroke-dasharray: 1; animation: feDraw 1.3s ease-in-out .25s both; }
.uc-play .fe-lb { animation: ufFade .4s ease 1.4s both; }
.uc-play .fe-gbar > span { transform-origin: left center; animation: ufSweep .6s cubic-bezier(.3,.7,.2,1) both; }
.uc-play .fe-gkey { animation: ufFade .4s ease .9s both; }
.fe-vis .nx-map path[data-i] { transition: fill .9s ease; }
.uc-play .uf-node[data-l="0"] { animation-delay: 0.00s; } .uc-play .uf-t[data-l="0"] { animation-delay: 0.55s; }
.uc-play .uf-l[data-s="0"] { animation-delay: 0.25s; }
.uc-play .uc-tile[data-si="0"] { animation-delay: 0.30s; } .uc-play .fe-tile:nth-child(1) { animation-delay: 0.20s; }
.uc-play .uf-node[data-l="1"] { animation-delay: 0.05s; } .uc-play .uf-t[data-l="1"] { animation-delay: 0.60s; }
.uc-play .uf-l[data-s="1"] { animation-delay: 0.34s; }
.uc-play .uc-tile[data-si="1"] { animation-delay: 0.37s; } .uc-play .fe-tile:nth-child(2) { animation-delay: 0.27s; }
.uc-play .uf-node[data-l="2"] { animation-delay: 0.10s; } .uc-play .uf-t[data-l="2"] { animation-delay: 0.65s; }
.uc-play .uf-l[data-s="2"] { animation-delay: 0.43s; }
.uc-play .uc-tile[data-si="2"] { animation-delay: 0.44s; } .uc-play .fe-tile:nth-child(3) { animation-delay: 0.34s; }
.uc-play .uf-node[data-l="3"] { animation-delay: 0.15s; } .uc-play .uf-t[data-l="3"] { animation-delay: 0.70s; }
.uc-play .uf-l[data-s="3"] { animation-delay: 0.52s; }
.uc-play .uc-tile[data-si="3"] { animation-delay: 0.51s; } .uc-play .fe-tile:nth-child(4) { animation-delay: 0.41s; }
.uc-play .uf-node[data-l="4"] { animation-delay: 0.20s; } .uc-play .uf-t[data-l="4"] { animation-delay: 0.75s; }
.uc-play .uf-l[data-s="4"] { animation-delay: 0.61s; }
.uc-play .uc-tile[data-si="4"] { animation-delay: 0.58s; } .uc-play .fe-tile:nth-child(5) { animation-delay: 0.48s; }
.uc-play .uf-node[data-l="5"] { animation-delay: 0.25s; } .uc-play .uf-t[data-l="5"] { animation-delay: 0.80s; }
.uc-play .uf-l[data-s="5"] { animation-delay: 0.70s; }
.uc-play .uc-tile[data-si="5"] { animation-delay: 0.65s; } .uc-play .fe-tile:nth-child(6) { animation-delay: 0.55s; }
.uc-play .uf-node[data-r="0"] { animation-delay: 0.70s; } .uc-play .uf-t[data-r="0"] { animation-delay: 1.00s; }
.uc-play .uf-node[data-r="1"] { animation-delay: 0.75s; } .uc-play .uf-t[data-r="1"] { animation-delay: 1.05s; }
.uc-play .uf-node[data-r="2"] { animation-delay: 0.80s; } .uc-play .uf-t[data-r="2"] { animation-delay: 1.10s; }
.uc-play .uf-node[data-r="3"] { animation-delay: 0.85s; } .uc-play .uf-t[data-r="3"] { animation-delay: 1.15s; }
.uc-play .uf-node[data-r="4"] { animation-delay: 0.90s; } .uc-play .uf-t[data-r="4"] { animation-delay: 1.20s; }
.uc-play .fe-grow:nth-child(1) .fe-gbar > span { animation-delay: 0.10s; }
.uc-play .fe-grow:nth-child(2) .fe-gbar > span { animation-delay: 0.22s; }
.uc-play .fe-grow:nth-child(3) .fe-gbar > span { animation-delay: 0.34s; }
.uc-play .fe-grow:nth-child(4) .fe-gbar > span { animation-delay: 0.46s; }
.uc-play .fe-grow:nth-child(5) .fe-gbar > span { animation-delay: 0.58s; }
@media (prefers-reduced-motion: reduce) { .uc-play *, .fe-vis .nx-map path[data-i] { animation: none !important; transition: none !important; } }

/* "On 2 devices: this Mac, iPhone · Safari · today" under the name (Stats) and atop the device window */
.dv-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: .74rem; line-height: 1.4; color: #555; text-align: left; }
.dv-line svg { flex: none; margin-top: 2px; color: #2f8a52; }
.dv-line b { font-weight: 600; color: #1a1a1a; }
.dv-line .dv-seen { color: #999; }
#device-modal .rn-body > .dv-line { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: #f3f7f4; }

/* fuel trade: "Others" opens a list of its members on hover */
body.ex-test .ft-lab[data-top]:not([data-top=""]) { cursor: default; }
body.ex-test .ft-lab[data-top]:not([data-top=""]) .ft-name { text-decoration: underline dotted #aaa; text-underline-offset: 3px; }
.ft-tt { display: flex; justify-content: space-between; gap: 18px; padding: 1px 0; }
.ft-tt b { font-variant-numeric: tabular-nums; }
.ft-tt--more { color: #999; }

/* fuel trade: the middle bar shows the country's flag once it is known (ftHubSolve) */
.ft-hub.is-known { display: flex; line-height: 0; }
.ft-hub-flag { width: 30px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1.5px #fff, 0 1px 4px rgba(0,0,0,.35); }
.ft-hub.is-known + .ft-hubl { color: #1a1a1a; font-weight: 600; }
@media (max-width: 600px) { .ft-hub-flag { width: 22px; } }

/* final energy gets more room than the electricity charts above it: a taller flow and chart, so the bigger layer
   reads as the bigger one (wide card / stacked card / phone) */
#use-card .uc-flow { min-height: 400px; }
#use-card .uc-chart { min-height: 300px; }
@container (max-width: 699px) { #use-card .uc-flow { height: 360px; min-height: 0; } #use-card .uc-chart { height: 290px; min-height: 0; } }
@container (max-width: 559px) { #use-card .uc-flow { height: 330px; } #use-card .uc-chart { height: 260px; } }
/* wide card: one body height whatever the mode (sources 483-497px, applications up to 491px natural), so a first
   switch doesn't nudge the page either; the flow and the chart stretch into it */
@container (min-width: 981px) { #use-card .uc-body { min-height: 510px; } }
/* the chart's canvas sits over its box (in the flow it fed its own size back: the box grew a few px each redraw) */
#use-card .uc-chart > canvas { position: absolute; inset: 0; }

/* What's new: the "Also new" strip under the featured update (names and devices) */
.nx-also { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #ece6d6; }
.nx-also-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #eef5f0; color: #2f8a52; }
.nx-also-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nx-also-t h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.nx-also-t p { margin: 0; font-size: .88rem; line-height: 1.5; color: #444; }
.nx-new--also { background: #2f8a52; }
@media (max-width: 600px) { .nx-also { padding: 12px; gap: 12px; } .nx-also-ico { width: 36px; height: 36px; border-radius: 10px; } }

/* footer: "Listed on" the directories, under the data sources */
.ft-listed { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ececec; }
.ft-listed-l { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #aaa; }
.ft-badge { display: inline-flex; line-height: 0; }
.ft-badge img { width: 133px; height: 32px; }
footer .ft-dir { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid #e4e2dc; background: #fff; color: #555; font-size: .72rem; font-weight: 600; }
footer .ft-dir:hover { border-color: #cfcabd; text-decoration: none; color: #1a1a1a; }
.ft-rate { display: inline-flex; align-items: center; gap: 3px; padding-left: 6px; border-left: 1px solid #e4e2dc; color: #c58a00; font-weight: 600; }
@media (max-width: 600px) { .ft-listed { gap: 6px; } .ft-listed-l { flex-basis: 100%; text-align: center; } }
.ft-ico { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
footer .ft-dir { padding-left: 8px; }
.ft-rn { color: #b9a46a; font-weight: 500; }

/* the directory links match Nestdle's badge beside them: white cards, the same border and corners, the same height */
.ft-listed { gap: 8px 10px; }
.ft-badge img { width: 150px; height: 36px; }
footer .ft-dir { height: 36px; padding: 0 12px 0 8px; gap: 8px; border-radius: 10px; border-color: #d9dee8; color: #111827; font-size: .78rem; font-weight: 700; }
footer .ft-dir:hover { border-color: #b8c0d0; box-shadow: 0 1px 4px rgba(17,24,39,.08); }
.ft-ico { width: 22px; height: 22px; border-radius: 6px; }
.ft-rate { font-size: .74rem; }
@media (max-width: 600px) { .ft-badge img { width: 133px; height: 32px; } footer .ft-dir { height: 32px; font-size: .74rem; } .ft-ico { width: 18px; height: 18px; } }

/* header medals: trimmed at the top only. The emoji's round bottom reaches below a 1-line box, so the line is a little
   taller (its bottom half-leading holds the curve) and the clip keeps only the ribbon's top off */
@media (max-width: 600px) {
  body.gl-page .podium-slot:first-child .podium-medal { line-height: 1.22; }
}
@media (min-width: 1240px) {
  body.ex-hdr .hd-grid .podium-medal { line-height: 1.22; }
}

/* fuel trade on the globe (test): the switch beside "Enlarge map", and the key in the map's corner */
.tr-legend { position: absolute; left: 12px; bottom: 44px; z-index: 3; width: min(330px, calc(100% - 24px)); padding: 10px 12px 11px; border-radius: 12px;
  background: rgba(255,255,255,.96); box-shadow: 0 2px 10px rgba(0,0,0,.16); font-size: .76rem; color: #333; display: flex; flex-direction: column; gap: 7px; }
.tr-h { display: flex; align-items: baseline; gap: 8px; }
.tr-h b { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.tr-h span { flex: 1; min-width: 0; font-weight: 600; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-x { border: 0; background: none; font-size: 1.1rem; line-height: 1; color: #888; cursor: pointer; padding: 0 2px; }
.tr-sub { color: #666; line-height: 1.35; }
.tr-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tr-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; background: #f1efe9; }
.tr-seg button { border: 0; background: transparent; border-radius: 999px; padding: 3px 10px; font: inherit; font-weight: 600; color: #555; cursor: pointer; }
.tr-seg button[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.tr-key { display: flex; flex-wrap: wrap; gap: 3px 12px; color: #555; }
.tr-key i, .tr-sw { display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: 2px; }
.ft-tt.tr-on span { font-weight: 700; color: #1a1a1a; }
body.tr-on.at-globe .gl-maphint { display: none; }
.tr-h .tr-kind { flex: none; }
.tr-h .tr-kind button { padding: 3px 9px; font-size: .72rem; }
.tr-unit { align-self: center; color: #777; }

/* trade flows: its switch on the map at every width (beside "Enlarge map" on wide screens, alone at the top right
   elsewhere), and on phones the key sits above the sheet, where the map's hint was */
.ex-trade { display: none; position: absolute; right: 10px; top: 62px; z-index: 3; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 999px;
  background: #fff; color: #333; font: inherit; font-size: .76rem; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; }
.ex-trade:hover { color: #1a1a1a; box-shadow: 0 1px 6px rgba(0,0,0,.26); }
.ex-trade[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
body.ex-test.at-globe .ex-trade { display: inline-flex; }
@media (min-width: 1100px) { body.ex-test.at-globe .ex-trade { right: 156px; } }
@media (max-width: 700px) {
  body.ex-test.at-globe .ex-trade { top: 58px; right: 8px; padding: 6px 10px; }
  body.at-globe .tr-legend { left: 8px; right: 8px; width: auto; bottom: calc(var(--gph-sheet, 90px) + 10px); padding: 8px 10px 9px; gap: 5px; font-size: .72rem; }
  body.at-globe .tr-legend .tr-key, body.at-globe .tr-legend .tr-sub { display: none; }   /* two rows on a phone: the map stays in view; the arcs' boxes give the rest */
  body.at-globe .tr-seg button { padding: 3px 8px; }
}
/* phones: the trade key small, as wide as its contents */
@media (max-width: 700px) {
  body.at-globe .tr-legend { right: auto; width: max-content; max-width: calc(100% - 16px); padding: 5px 7px 6px; gap: 4px; border-radius: 9px; font-size: .62rem; }
  body.at-globe .tr-legend .tr-h { gap: 6px; }
  body.at-globe .tr-legend .tr-h > span:not(.tr-seg) { font-size: .66rem; }
  body.at-globe .tr-legend .tr-seg { padding: 1px; }
  body.at-globe .tr-legend .tr-seg button, body.at-globe .tr-h .tr-kind button { padding: 2px 6px; font-size: .62rem; }
  body.at-globe .tr-legend .tr-ctl { gap: 5px; }
  body.at-globe .tr-legend .tr-x { font-size: .95rem; }
}
.tr-taphint { margin-top: 5px; color: #9a9a96; font-size: .9em; }
.tr-key .tr-grad-sw { width: 22px; background: linear-gradient(90deg, #3f3cbb, #e0218a); }
/* the Trade flows button's picture: the hub takes the button's text colour; when the layer is on, its dashes run */
.ex-trade .tr-ico { flex: none; margin: -2px 0; }
@keyframes trIcoRun { to { stroke-dashoffset: -7.6; } }
.ex-trade[aria-pressed="true"] .tr-ico-run { animation: trIcoRun 1.1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ex-trade .tr-ico-run { animation: none; } }

/* the trade key: centred along the bottom of the map (above its credits line), as wide as its text */
.tr-legend { left: 50%; right: auto; bottom: 34px; transform: translateX(-50%); width: max-content; max-width: min(440px, calc(100% - 24px)); }
.tr-legend .tr-sub { max-width: 400px; }
@media (max-width: 700px) {
  body.at-globe .tr-legend { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 16px); bottom: calc(var(--gph-sheet, 90px) + 46px); }   /* above the map credits */
}
/* the key's fold: phones only. Folded it is one row (Fuels | Electricity, the place, ⌄, ×); the chevron opens the rest */
.tr-more { display: none; border: 0; background: #f1efe9; border-radius: 50%; width: 20px; height: 20px; padding: 0; color: #555; cursor: pointer; align-items: center; justify-content: center; flex: none; }
.tr-more svg { transition: transform .2s; }
.tr-legend.is-open .tr-more svg { transform: rotate(180deg); }
@media (max-width: 700px) {
  body.at-globe .tr-more { display: inline-flex; }
  body.at-globe .tr-legend:not(.is-open) .tr-ctl { display: none; }
  body.at-globe .tr-legend:not(.is-open) { gap: 0; }
}

/* map buttons: "Enlarge map" under the Globe | List switch (left), "Trade flows" under "By trait" (right) */
@media (min-width: 1100px) {
  body.ex-test.at-globe .gl-wrap .ex-big { left: 10px; right: auto; }
  body.ex-test.at-globe .ex-trade { right: 10px; }
}
/* the trade key: bottom left of the map, fitted to its text */
.tr-legend { left: 12px; transform: none; }
@media (max-width: 700px) { body.at-globe .tr-legend { left: 8px; transform: none; } }
/* its fuels are switches: hover shows only that fuel, a click keeps it (again to undo) */
.tr-key .tr-fk { display: inline-flex; align-items: center; gap: 0; border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.tr-key .tr-fk:hover { background: #f1efe9; }
.tr-key .tr-fk[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.tr-key .tr-fk.is-off { opacity: .45; }

/* the map's colour key (a source picked on the Final energy or Electricity card): bottom right, beside the credits'
   (i), in two short lines: "■ Oil of final energy ×", then the scale */
body.ex-test .gl-shade { left: auto; right: 8px; bottom: 36px; width: max-content; max-width: 200px; padding: 6px 28px 7px 10px; gap: 3px 6px; flex-wrap: wrap; font-size: .72rem; }
body.ex-test .gl-shade-name { gap: 5px; }
body.ex-test .gl-shade-txt { color: #777; white-space: nowrap; }
body.ex-test .gl-shade-scale { flex-basis: 100%; }
body.ex-test .gl-shade-bar { flex: 1; width: auto; min-width: 70px; height: 7px; }
body.ex-test .gl-shade-x { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; font-size: 12px; }
@media (max-width: 700px) {
  body.ex-test.at-globe .gl-shade { left: auto; right: 8px; bottom: calc(var(--gph-sheet, 90px) + 46px); max-width: 180px; border-radius: 10px; }
  body.ex-test.at-globe .gl-shade-txt { display: inline; }
}
/* the trade key: smaller and tucked into the bottom-left corner */
.tr-legend { left: 8px; bottom: 9px; padding: 7px 9px 8px; gap: 5px; border-radius: 10px; font-size: .7rem; max-width: min(400px, calc(100% - 16px)); }
.tr-legend .tr-seg button { padding: 2px 8px; }
.tr-legend .tr-sub { max-width: 360px; }
/* both keys at once: the trade key leaves room for the colour key on its right */
@media (min-width: 701px) { body.ex-test .gl-wrap:has(.gl-shade:not([hidden])) .tr-legend { max-width: calc(100% - 230px); } }   /* phones stack the two */

/* new until 15 Dec: the Trade flows button and Final energy's sources glow; then the sources glow with the
   electricity sources while the map's tip is open */
@keyframes fxGlow { 0%, 70%, 100% { box-shadow: 0 1px 4px rgba(0,0,0,.18); } 25%, 40% { box-shadow: 0 0 0 2.5px #f5a623, 0 0 16px 4px rgba(245,166,35,.6); } }
@keyframes fxTile { 0%, 72%, 100% { box-shadow: none; } 22%, 36% { box-shadow: 0 0 0 2px #f5a623, 0 0 14px 3px rgba(245,166,35,.5); } }
body.fx-new.at-globe .ex-trade:not([aria-pressed="true"]) { animation: fxGlow 3.2s ease-in-out infinite; }
/* one pulse for both sets of sources (Final energy's tiles, the electricity legend), fired together by fxPulse() in
   globe.js: every 12 s until 15 Dec, then every 30 s; never while a source already colours the map */
@keyframes fxPulse { 0%, 100% { box-shadow: none; } 30%, 55% { box-shadow: 0 0 0 2px #f5a623, 0 0 14px 3px rgba(245,166,35,.5); } }
body.ex-test.at-globe #legend-shared .lg-items .legend-item, body.ex-test.at-globe #use-card .uc-tile.is-src { animation: none; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item, body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src { animation: fxPulse 2.2s ease-in-out both; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item:nth-child(2), body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src[data-si="1"] { animation-delay: .12s; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item:nth-child(3), body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src[data-si="2"] { animation-delay: .24s; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item:nth-child(4), body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src[data-si="3"] { animation-delay: .36s; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item:nth-child(5), body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src[data-si="4"] { animation-delay: .48s; }
body.ex-test.at-globe.fx-pulse #legend-shared .lg-items .legend-item:nth-child(n+6), body.ex-test.at-globe.fx-pulse #use-card .uc-tile.is-src[data-si="5"] { animation-delay: .6s; }
/* "Show on map" on the daily page's Fuel trade and Final energy cards, once the puzzle is over */
.fx-map { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 4px 10px; border: 1px solid #e3ddcc; border-radius: 999px; background: #fff;
  color: #1a1a1a; font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fx-map:hover { border-color: #f5a623; background: #fff7e6; }
.ic-head .fx-map { margin-left: auto; margin-right: 8px; }
body.fx-new .fx-map { animation: fxHop 4.5s ease-in-out 1.2s infinite, fxGlow 4.5s ease-in-out 1.2s infinite; }
@keyframes fxHop { 0%, 76%, 100% { translate: 0 0; } 81% { translate: 0 -5px; } 86% { translate: 0 0; } 90% { translate: 0 -2px; } 94% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { body.fx-new .ex-trade, body #use-card .uc-tile, body #legend-shared .legend-item, body.fx-new .fx-map { animation: none !important; } }
#use-card .uc-head > .fx-map { margin-left: 8px; align-self: center; flex: none; }
@media (max-width: 640px) { #use-card .uc-head:has(> .fx-map) > .sec-line { flex: 1 1 0; min-width: 12px; } }
/* the daily map (test): trade flows or Final energy's colours, opened from the cards' "Show on map" */
#gm-card .tr-legend { left: 8px; right: auto; bottom: 14px; width: max-content; max-width: min(390px, calc(100% - 16px)); padding: 7px 10px 8px; gap: 5px; border-radius: 10px; font-size: .68rem; }
#gm-card .tr-legend .tr-seg button, #gm-card .tr-h .tr-kind button { padding: 2px 8px; font-size: .66rem; }
#gm-card .tr-legend .tr-more { display: none; }
body.ex-test #gm-card .gm-shade { left: 8px; right: auto; bottom: 14px; max-width: min(330px, calc(100% - 16px)); padding: 7px 28px 8px 10px; gap: 5px 10px; font-size: .68rem; border-radius: 10px; }
.gm-shade-pick { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
.gm-shade-pick button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid #e3ddcc; border-radius: 999px; background: #fff; font: inherit; font-size: .64rem; font-weight: 600; color: #555; cursor: pointer; }
.gm-shade-pick button i { width: 8px; height: 8px; border-radius: 2px; }
.gm-shade-pick button[aria-pressed="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.fx-map[aria-pressed="true"] { background: #1a1a1a; border-color: #1a1a1a; color: #fff; animation: none !important; }
@media (max-width: 640px) {
  #gm-card .tr-legend .tr-sub, #gm-card .tr-legend .tr-key { display: none; }   /* as in Explore on phones: the arcs' boxes give the rest */
  #gm-card .tr-legend { bottom: 10px; font-size: .62rem; padding: 5px 8px 6px; }
  body.ex-test #gm-card .gm-shade { bottom: 10px; font-size: .62rem; padding: 5px 26px 6px 8px; }
}

/* Explore, wide screens: the profile pane fills the map's height; the charts take what is left, so nothing is left
   empty under the source legend */
@media (min-width: 1100px) {
  body.ex-test.ex-rowlock.at-globe #gl-pane-profile:not([hidden]) { flex: 1 1 auto; }
  body.ex-test.ex-rowlock.at-globe .gl-side #gl-pane-profile > #charts-section { flex: 1 0 auto; }
  body.ex-test.ex-rowlock.at-globe .gl-side #charts-section > #chart-left, body.ex-test.ex-rowlock.at-globe .gl-side #charts-section > #chart-right { display: flex; flex-direction: column; }
  body.ex-test.ex-rowlock.at-globe .gl-side #line-wrapper, body.ex-test.ex-rowlock.at-globe .gl-side #bar-wrapper { flex: 1 0 auto; }
}
/* the trade key: the data's year flagged as elsewhere; why boe/d and $ differ; which countries an electricity source keeps */
.tr-legend .tr-yr { font-weight: 800; }
.tr-legend .tr-yr.is-off { color: #9b3b36; cursor: help; }
.tr-q { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; border: 1px solid #d6d0c0; border-radius: 50%;
  font-size: .62rem; font-weight: 700; color: #777; background: #fff; cursor: help; flex: none; }
.tr-q:hover, .tr-q:focus { color: #1a1a1a; border-color: #1a1a1a; outline: none; }
.tr-qt { display: none; position: absolute; left: 0; bottom: calc(100% + 6px); white-space: nowrap; padding: 5px 9px; border-radius: 7px;
  background: #1a1a1a; color: #fff; font-size: .62rem; font-weight: 500; line-height: 1.3; z-index: 5; pointer-events: none; }
.tr-q:hover .tr-qt, .tr-q:focus .tr-qt { display: block; }
.tr-src { display: flex; align-items: center; gap: 6px; font-size: .92em; font-weight: 600; color: #1a1a1a; }
.tr-src i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
/* Explore (test): the map credits (i) move up under the Trade flows button, so the keys sit on the map's bottom edge
   (phone: right on the sheet). On a phone the two keys stack, the colour key above the trade key (--tr-h: its height) */
body.ex-test.at-globe .gl-canvas .maplibregl-ctrl-bottom-right { top: 98px; bottom: auto !important; }
body.ex-test .gl-shade { bottom: 9px; }
@media (max-width: 700px) {
  body.ex-test.at-globe .gl-canvas .maplibregl-ctrl-bottom-right { top: 94px; }
  body.ex-test.at-globe .tr-legend { bottom: calc(var(--gph-sheet, 90px) + 8px); }
  body.ex-test.at-globe .gl-shade { bottom: calc(var(--gph-sheet, 90px) + 8px); }
  body.ex-test.at-globe .gl-wrap:has(.tr-legend) .gl-shade { bottom: calc(var(--gph-sheet, 90px) + 14px + var(--tr-h, 34px)); }
}
