/* Net Zero Cost Benefit, main page (Nov 3, 2026). One layout for every width:
   wide screens put the result in a sidebar beside the map; narrower screens put it under the map. */
:root {
  --ink: #1f2328; --ink2: #5f6670; --line: #e4e6ea; --bg: #ffffff; --soft: #f5f7f9;
  --land: #dde3ea; --land-hover: #c4cdd8; --land-edge: #ffffff; --pick: #2f6db5;
  --cost: #c0392b; --benefit: #3c8d5a; --base: #7a838c; --action: #2f6db5;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { position: relative; margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Calibri, Helvetica, Arial, sans-serif; }
a { color: var(--pick); }

.layout { max-width: 1240px; margin: 0 auto; display: grid; gap: 0 32px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main" "panel" "more";
  padding: clamp(18px, 3vw, 40px) max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.main { grid-area: main; min-width: 0; display: grid; gap: clamp(12px, 1.8vw, 20px); align-content: start; }

/* header */
.head { display: grid; gap: 8px; justify-items: center; text-align: center; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 54px); line-height: 1.05; letter-spacing: -.015em; text-wrap: balance; }
.prompt { margin: 0; color: var(--ink2); font-size: clamp(15px, 1.5vw, 18px); }
.finder { position: relative; width: min(100%, 320px); }
.finder input { width: 100%; font: inherit; font-size: 16px; padding: 8px 12px; border: 1px solid #cfd5dc; border-radius: 8px; }
.matches { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #cfd5dc;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(20,30,40,.12); max-height: 320px; overflow: auto; text-align: left; }
.matches button { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; padding: 8px 12px; border: 0; background: none; cursor: pointer; }
.matches button:hover, .matches button:focus { background: var(--soft); outline: none; }
.matches small { color: var(--ink2); }
.matches p { margin: 0; padding: 8px 12px; color: var(--ink2); font-size: 14px; }

/* map: one quiet colour; the chosen country or group in blue */
.map { margin: 0; }
@media (max-width: 600px) { .map { margin: 4px -16px 0; } }   /* Nov 6 (Bjorn): edge to edge on phones (the page gutter is 16px) */
.map svg { display: block; width: 100%; height: auto; }
.map path { fill: var(--land); stroke: var(--land-edge); stroke-width: .5; cursor: pointer; transition: fill .15s; }
.map path:hover { fill: var(--land-hover); }
.map path.on { fill: var(--pick); }
/* Nov 6 (Bjorn): no box around a clicked or tapped country; keyboard focus outlines the country's own shape */
.map path { outline: none; -webkit-tap-highlight-color: transparent; }
.map path:focus-visible { stroke: var(--pick); stroke-width: 2; }

/* groups: buttons under the map; a compact list only on the smallest phones */
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.groups button { font: inherit; font-size: 15px; padding: 7px 14px; border: 1px solid #cfd5dc; border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; }
.groups button:hover { border-color: var(--pick); color: var(--pick); }
.groups button[aria-pressed="true"] { background: var(--pick); border-color: var(--pick); color: #fff; }
.group-list { display: none; font: inherit; font-size: 16px; padding: 9px 12px; width: 100%; border: 1px solid #cfd5dc; border-radius: 8px; background: #fff; }

/* settings: two switches top right; on small screens behind a Settings button */
.settings { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 30; }
.gear { display: none; font: inherit; font-size: 15px; border: 1px solid #cfd5dc; border-radius: 8px; background: #fff; padding: 6px 10px; cursor: pointer; color: var(--ink); }
.settings-menu { display: flex; gap: 8px; }
@media (max-width: 999px) {
  .gear { display: block; }
  .gear span { display: none; }
  .settings-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); flex-direction: column; align-items: flex-end;
    background: #fff; border: 1px solid #cfd5dc; border-radius: 10px; padding: 10px; box-shadow: 0 8px 24px rgba(20,30,40,.14); }
  .settings.show .settings-menu { display: flex; }
}

/* result panel */
.panel[hidden] { display: none !important; }
.panel { grid-area: panel; min-width: 0; }
.panel-body { display: grid; gap: 16px; }
.p-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.kicker { font-size: 13px; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; }
.p-head h2 { margin: 2px 0 0; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.close { font: inherit; font-size: 26px; line-height: 1; border: 0; background: none; color: var(--ink2); cursor: pointer; padding: 2px 6px; }
.headline { margin: 0; font-size: 19px; font-weight: 600; }
.headline .num { color: var(--action); }
.headline .num.neg { color: var(--cost); }
.sub { margin: -8px 0 0; color: var(--ink2); font-size: 15px; }
.warn { margin: 0; padding: 8px 12px; background: #fff6e5; border-radius: 8px; font-size: 14px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.kpi .k { font-size: 13px; color: var(--ink2); }
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi .v.cost { color: var(--cost); } .kpi .v.benefit { color: var(--benefit); }
.kpi .s { font-size: 12.5px; color: var(--ink2); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tabs a { display: block; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 15.5px; text-align: center; }
.tabs a:hover { border-color: var(--pick); color: var(--pick); }
.block h3 { margin: 0 0 6px; font-size: 16px; }
.block svg { display: block; width: 100%; height: auto; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.meta { margin: 4px 0 0; font-size: 12.5px; color: var(--ink2); }
.seg { display: inline-flex; border: 1px solid #cfd5dc; border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; border: 0; background: #fff; padding: 5px 10px; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.facts { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.facts th { text-align: left; font-weight: 400; color: var(--ink2); padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); }
.facts td { text-align: right; padding: 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.members summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.members p { font-size: 14px; color: var(--ink2); }
.sources { font-size: 12.5px; color: var(--ink2); }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #fff; border: 1px solid #cfd5dc; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(20,30,40,.14); padding: 6px 10px; font-size: 13px; display: grid; max-width: 260px; }
.tip .tv { font-weight: 700; }

/* wide screens: result in a sidebar beside the map once something is chosen */
@media (min-width: 1000px) {
  .layout.open { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "main panel" "more panel"; max-width: 1500px; }
  .layout.open .panel { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto;
    border-left: 1px solid var(--line); padding-left: 24px; }
}
/* narrower screens: result under the map */
@media (max-width: 999px) {
  .panel { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
}
@media (max-width: 379px) { .groups { display: none; } .group-list { display: block; } .kpis { grid-template-columns: 1fr; } }
.tip[hidden] { display: none; }
.seg button { white-space: nowrap; }
@media (max-width: 999px) { .head { padding: 0 44px; } }                  /* keep the centred title clear of the settings button */

/* "Want to know more?": the four buttons at the bottom of the main page, shown once something has been chosen */
.more[hidden] { display: none; }
.more { grid-area: more; align-self: start; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; border-radius: 10px; }
.more h2 { margin: 0 0 10px; font-size: 20px; text-align: center; }
/* Nov 7 (Bjorn): all five buttons on one row, smaller, wherever they fit (two columns only on narrow phones) */
.more .tabs { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.more .tabs a { padding: 8px 4px; font-size: 14px; }
@media (max-width: 479px) { .more .tabs { grid-template-columns: repeat(3, 1fr); } }
.more.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #e8f0fa; } 100% { background: transparent; } }
.more-link { margin: 4px 0 0; font-weight: 600; }
.more-link a { text-decoration: none; }
@media (max-width: 999px) { .more-link { display: none; } }   /* on narrow screens the buttons follow straight after the result */

/* compact header (Nov 3): on wide screens the two switches flank the title, and the search sits beside the prompt */
.head { gap: 10px; }
/* Nov 5 (Bjorn): what the name means, in small italics just under it */
.tagline { margin: -6px 0 0; font-size: 14.5px; font-style: italic; color: var(--ink2); }
.tagline span { display: block; text-wrap: balance; }             /* Nov 5 (Bjorn): one line each, so the benefits stay together */
@media (max-width: 480px) { .tagline { font-size: 13px; } }        /* phones: the benefits line still fits from 414 px; on 360 it splits evenly */
.title-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: 100%; }
.title-row h1 { grid-column: 2; }
.title-row .side:first-child { justify-self: start; }
.title-row .side:last-child { justify-self: end; }
.find-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; }
.find-row .finder { width: 260px; }
@media (min-width: 1000px) { .settings { display: none; } }        /* wide screens use the switches beside the title */
@media (max-width: 999px) {
  .title-row { grid-template-columns: 1fr; }
  .title-row .side { display: none; }                               /* narrower screens: the ⚙ button instead */
  .title-row h1 { grid-column: 1; }
  .find-row .finder { width: min(100%, 320px); }
}
/* with the sidebar open the left column is too narrow to flank the title: the switches go in a slim row above it */
@media (min-width: 1000px) {
  .layout.open .title-row { grid-template-columns: 1fr 1fr; grid-template-areas: "u c" "t t"; gap: 6px 16px; }
  .layout.open .title-row .side:first-child { grid-area: u; }
  .layout.open .title-row .side:last-child { grid-area: c; }
  .layout.open .title-row h1 { grid-area: t; }
}
@media (max-width: 480px) { .prompt { font-size: 14.5px; } }
@media (min-width: 1000px) { .layout.open .title-row h1 { justify-self: center; text-align: center; } }
/* quieter switches (Nov 3): light blue for the chosen option, no black */
.seg { border-color: #dde3ea; }
.seg button { font-size: 13.5px; padding: 4px 9px; color: var(--ink2); background: #fff; }
.seg button[aria-pressed="true"] { background: #e8f0fa; color: var(--pick); font-weight: 600; }
/* Nov 3: the map is the main thing — ChatGPT's blue-teal map colours (land #91bdc4, hover #2c8da7, chosen #087596) */
:root { --land: #91bdc4; --land-hover: #2c8da7; --land-edge: #eef6f5; --pick: #087596; }
.seg button[aria-pressed="true"] { background: #e3eff2; color: var(--pick); }
/* "Want to know more?" in quiet light blue-grey, so it no longer competes with the map */
.more { border-top-color: #e6ebef; }
.more h2 { font-size: 16px; font-weight: 600; color: #8796a1; }
.more .tabs a { background: #eef2f5; border-color: #eef2f5; color: #6b7f8a; font-weight: 500; }
.more .tabs a:hover { background: #e3eff2; border-color: #e3eff2; color: var(--pick); }
:root { --action: #087596; }   /* result highlights and the net-zero line in the same teal as the map */
/* result head and key figures (Nov 3): the sentence is the heading; four big numbers */
.p-head .headline { margin: 0; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.35; font-weight: 500; }
.p-head .headline b { font-weight: 700; }
.p-head .headline .num { font-weight: 700; }
.kpi { display: grid; align-content: center; gap: 2px; padding: 12px 14px; }
.kpi .k { font-size: 12.5px; line-height: 1.3; }
.kpi .v { font-size: clamp(28px, 3vw, 36px); line-height: 1.1; letter-spacing: -.01em; }
.kpi-bill { justify-items: center; text-align: center; padding: 8px; }
.kpi-bill .bill { width: 100%; max-width: 170px; height: auto; }
.kpi-bill .s { font-size: 12.5px; color: var(--ink2); }
.block svg { max-width: 560px; }   /* charts stop growing on wide single-column screens (iPad portrait) */
.local-back span { white-space: nowrap; }   /* "= 7 øre per krone" on one line; "(93 øre lost)" may go to the next */
.kpi .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* labels on one line */
.kpi .v .cur { font-size: .45em; font-weight: 600; letter-spacing: 0; }
.kpi .v { white-space: nowrap; }
.kpi-note { margin: -8px 0 0; }
.yr-hit, [data-year] { cursor: pointer; }
.close0 { font-size: 16px; font-weight: 700; color: var(--ink2); line-height: 1.25; text-align: center; }
.special { margin: -6px 0 0; padding: 8px 12px; background: #f3f6f8; border-left: 3px solid #b7c3cc; border-radius: 4px; font-size: 13.5px; color: var(--ink2); }
/* big numbers shrink to fit their tile, so a long value (<0.0001°C, ₹13,000tr) can't push the sidebar off-screen */
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { min-width: 0; container-type: inline-size; }
.kpi .v { font-size: clamp(18px, 16cqi, 36px); }
.panel, .panel-body { min-width: 0; overflow-x: hidden; }
.kpis-two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.groups .chip-break { flex-basis: 100%; height: 0; }
