/* Tile-grid cartogram map — shared by the EU and ASEAN AI Governance Trackers.
 * Colours follow the page's variables where the viewer defines them. */
.map-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 0.75rem; }
.map-total { font-size: 0.95rem; }
.map-metrics { display: flex; gap: 0.35rem; flex-wrap: wrap; }
/* The component is shared by two trackers whose pages define different
 * variable names (EU: --text/--border/--accent; ASEAN: --ink/--line, no
 * --accent), so each colour falls back through both names. The active
 * metric uses explicit colours so it reads the same on both. */
.metric { border: 1px solid var(--border, var(--line, #c9d4cf)); background: var(--surface, #fff); color: var(--text, var(--ink, #1c2b26)); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.85rem; cursor: pointer; }
.metric.active { background: #1b5e4f; border-color: #1b5e4f; color: #fff; }
html[data-theme="dark"] .metric.active { background: #7cc4a8; border-color: #7cc4a8; color: #14201c; }
.map-regional { margin: 0 0 0.6rem; }
.map-regional .tile { max-width: 220px; }
.map-grid { display: grid; gap: 0.45rem; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem; min-height: 64px; padding: 0.4rem 0.2rem; border: 1px solid var(--border, var(--line, #c9d4cf)); border-radius: 8px; background: var(--surface, #fff); color: var(--text, var(--ink, #1c2b26)); cursor: pointer; font: inherit; text-align: center; }
.tile:hover, .tile:focus-visible { outline: 2px solid var(--accent, #1b5e4f); outline-offset: 1px; }
.tile.selected { outline: 3px solid var(--accent, #1b5e4f); outline-offset: 1px; }
html[data-theme="dark"] .tile:hover, html[data-theme="dark"] .tile:focus-visible, html[data-theme="dark"] .tile.selected { outline-color: #7cc4a8; }
.tile-code { font-weight: 700; font-size: 0.95rem; line-height: 1.1; }
.tile-name { font-size: 0.68rem; line-height: 1.15; opacity: 0.85; }
.tile-value { font-weight: 700; font-size: 0.85rem; line-height: 1.1; }
.tile.regional .tile-name { font-size: 0.75rem; }
/* Colour bins: 0 = no rows (grey), 1-4 = quartiles of the busiest place.
 * Bins 1-2 have light backgrounds, so they need an explicit dark text colour:
 * in dark mode the page text is near-white, which is unreadable on them. */
.tile.bin-0, .swatch.bin-0 { background: #eceff0; color: #5a6b65; }
.tile.bin-1, .swatch.bin-1 { background: #d6e9e1; }
.tile.bin-2, .swatch.bin-2 { background: #a8d2bf; }
.tile.bin-1, .tile.bin-2 { color: #1c2b26; }
.tile.bin-3, .swatch.bin-3 { background: #5fae8d; color: #1c2b26; }
.tile.bin-4, .swatch.bin-4 { background: #1b5e4f; color: #fff; }
.tile.bin-3 .tile-name, .tile.bin-4 .tile-name { opacity: 0.9; }
/* Tooltip: shown on hover / keyboard focus / tap (tap also selects). */
.tile-tip { display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 20; width: max-content; max-width: 240px; background: #1c2b26; color: #fff; font-size: 0.8rem; font-weight: 400; line-height: 1.4; text-align: left; padding: 0.5rem 0.65rem; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); pointer-events: none; }
.tile:hover .tile-tip, .tile:focus-visible .tile-tip, .tile.selected .tile-tip { display: block; }
/* Edge tiles: align the tooltip to the tile's edge instead of centring it,
 * so it never hangs off the side of the screen on a phone. */
.tile.tip-left .tile-tip { left: 0; transform: none; }
.tile.tip-right .tile-tip { left: auto; right: 0; transform: none; }
/* Top-row and regional tiles: show the tooltip below the tile, so it never
 * hangs off the top of the viewport when the map is at the top of the
 * screen. */
.tile.tip-below .tile-tip { bottom: auto; top: calc(100% + 6px); }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; }
.legend-title { font-weight: 600; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border, var(--line, #c9d4cf)); }
.map-note { font-size: 0.85rem; opacity: 0.85; margin: 0.5rem 0 0; }
@media (max-width: 640px) {
  .tile { min-height: 64px; padding: 0.35rem 0.05rem; }
  .tile-code { font-size: 0.85rem; }
  /* Country names stay visible on mobile: smaller type that wraps, never hidden.
   * overflow-wrap:anywhere (not break-word) so a long name's minimum width is
   * one character — otherwise the grid track grows past its container. */
  .tile-name { display: block; font-size: 0.55rem; line-height: 1.15; overflow-wrap: anywhere; }
  .tile-value { font-size: 0.8rem; }
  .metric { padding: 0.45rem 0.8rem; min-height: 40px; }
  .map-grid { gap: 0.35rem; }
  .tile-tip { max-width: 70vw; }
}

/* Empty tiles: full-strength name text so it meets 4.5:1 contrast */
.tile.bin-0 .tile-name { opacity: 1; }

/* ---------- chart builder (chart-builder.js), shared by both trackers ----------
 * Uses each tracker's own colours: ASEAN names them --line/--ink, the EU --border/--text. */
.cb{display:grid;gap:.9rem}
.cb [hidden]{display:none!important} /* the layout rules below must not override hiding */
.cb-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.7rem 1rem;align-items:start}
.cb-f{display:grid;gap:.3rem;font-size:.88rem;font-weight:600;margin:0;padding:0;border:0;min-width:0}
.cb-f legend{font-weight:600;padding:0;margin-bottom:.3rem}
.cb-wide{grid-column:1/-1}
.cb-f select,.cb-f input[type=text]{font:inherit;font-weight:400;padding:.4rem .55rem;border:1px solid var(--line,var(--border));border-radius:6px;background:var(--surface);color:var(--ink,var(--text));width:100%;min-width:0}
.cb-r,.cb-chk{display:inline-flex;gap:.35rem;align-items:center;font-weight:400;margin-right:.8rem;cursor:pointer}
.cb-places{display:flex;flex-wrap:wrap;gap:.2rem .4rem}
.cb-figure{background:#fff;border:1px solid var(--line,var(--border));border-radius:8px;overflow:hidden}
.cb-figure svg{display:block;width:100%;height:auto}
.cb-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.cb-btn{font:inherit;font-size:.88rem;font-weight:600;border:1px solid var(--line,var(--border));background:var(--surface);color:var(--ink,var(--text));border-radius:6px;padding:.4rem .8rem;cursor:pointer}
.cb-btn:hover{border-color:currentColor}
.cb-msg{font-size:.85rem;color:var(--muted)}
.cb-empty{color:var(--muted);margin:.4rem 0}
.cb-tablewrap{overflow-x:auto}
.cb-tbl{border-collapse:collapse;width:100%;font-size:.88rem;margin-top:.5rem}
.cb-tbl th,.cb-tbl td{text-align:left;padding:.4rem .5rem;border-bottom:1px solid var(--line,var(--border));vertical-align:top}
.cb-r input,.cb-chk input{accent-color:#0d5e57}

/* Compute tab (0.2), shared look with the ASEAN tracker */
.cp{max-width:1100px}.cp h3{margin:2rem 0 .5rem}.cp h4{margin:1.2rem 0 .4rem}.cp section{scroll-margin-top:5rem}
.cp-head h2{margin:.2rem 0 .4rem}.cp-head p{max-width:75ch}.cp-toc{font-size:.92rem;margin:.6rem 0 0}.cp-toc a{color:var(--accent)}
.cp-fig{margin:.6rem 0 1rem}.cp-fig svg{width:100%;height:auto;max-width:900px}.cp-fig figcaption{font-size:.88rem;color:var(--muted);max-width:75ch}
.cp-lab{font-size:13px;fill:var(--text)}.cp-val{font-size:12px;fill:var(--muted)}
.cp-t{width:100%;border-collapse:collapse;font-size:.9rem}.cp-t th,.cp-t td{border-bottom:1px solid var(--border);padding:.5rem .55rem;vertical-align:top;text-align:left}
.cp-t thead th{background:var(--soft);font-size:.82rem}.cp-t details summary{cursor:pointer;color:var(--accent);font-size:.82rem}.cp-t details p{margin:.3rem 0 0;font-size:.85rem}
.cp-st{display:inline-block;padding:.05rem .45rem;border-radius:99px;border:1px solid var(--border);font-size:.78rem}
.cp-st.s-operational{border-color:#0d5e57}.cp-st.s-under_construction{border-color:#4f9a8f}
.cp-conf{display:inline-block;padding:0 .4rem;border-radius:4px;font-size:.75rem;border:1px solid var(--border);color:var(--muted)}
.cp-caution{border-left:4px solid var(--warn);background:var(--soft);padding:.6rem .8rem;border-radius:6px;max-width:80ch}
.cp-filter{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0}
.cp-filter button{font:inherit;font-size:.85rem;padding:.25rem .7rem;border-radius:99px;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer}
.cp-filter button[aria-pressed=true]{background:var(--sel);color:var(--sel-ink);border-color:var(--sel)}
.cp-ml{list-style:none;padding:0;margin:0}.cp-m{border:1px solid var(--border);border-radius:10px;padding:.7rem .9rem;margin:0 0 .7rem;background:var(--surface)}
.cp-mh{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;font-size:.85rem}.cp-mh time{font-weight:700}
.cp-k{padding:.05rem .45rem;border-radius:4px;background:var(--soft);font-size:.78rem}
.cp-m h4{margin:.35rem 0 .2rem;font-size:1rem}.cp-m p{margin:.2rem 0}
.cp-read li{margin:.25rem 0}.cp-dl{display:flex;flex-wrap:wrap;gap:.5rem}
.cp-layers td:last-child{background:var(--soft)}
@media (max-width:700px){.cp-t{font-size:.85rem}.cp-lab{font-size:15px}}
.cp section{border-top:1px solid var(--border);padding-top:.4rem;margin-top:1.6rem}.cp section:first-of-type{border-top:0}
.cp-glance{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.7rem;margin:1rem 0 .6rem}
.cp-card{display:flex;flex-direction:column;gap:.25rem;padding:.85rem 1rem;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);text-decoration:none;box-shadow:var(--sh-btn,none);transition:border-color .15s}
.cp-card:hover,.cp-card:focus-visible{border-color:var(--accent)}.cp-card:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.cp-n{font-size:1.55rem;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}.cp-l{font-size:.85rem;color:var(--muted);line-height:1.35}
.cp-toc{display:flex;flex-wrap:wrap;gap:.35rem;margin:.4rem 0 .2rem}
.cp-toc a{font-size:.85rem;padding:.25rem .65rem;border:1px solid var(--border);border-radius:99px;color:var(--text);text-decoration:none;background:var(--surface)}
.cp-toc a:hover,.cp-toc a:focus-visible{border-color:var(--accent);color:var(--accent)}
.cp-big{font-size:14px;font-weight:700;fill:var(--text)}
.cp-two{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:1.2rem;align-items:start}
.cp-story{margin:.4rem 0;padding-left:1.1rem;font-size:.92rem;line-height:1.5}.cp-story li{margin:0 0 .5rem}
.pf-legend{display:flex;flex-wrap:wrap;gap:.45rem;margin:.4rem 0 .7rem}
.pf-chip{display:inline-flex;align-items:center;gap:.3rem;padding:.12rem .55rem;border-radius:99px;font-size:.8rem;border:1px solid var(--border);white-space:nowrap;color:var(--text)}
.pf-chip.pf-yes{background:rgba(13,94,87,.14);border-color:rgba(13,94,87,.55)}
.pf-chip.pf-partly{background:rgba(184,110,0,.13);border-color:rgba(184,110,0,.55)}
.pf-chip.pf-checked_not_found{background:transparent;border-style:dashed}
.pf-chip.pf-none{background:transparent;color:var(--muted);border-color:transparent}
.pf{border-collapse:separate;border-spacing:0;width:100%;font-size:.88rem;min-width:640px}
.pf th,.pf td{padding:.45rem .5rem;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}
.pf thead th{background:var(--soft);font-size:.8rem;position:sticky;top:0}.pf thead th span[title]{text-decoration:underline dotted;text-underline-offset:3px;cursor:help}
.pf tbody th{position:sticky;left:0;background:var(--surface);z-index:1;font-weight:600}
.pf thead th:first-child{position:sticky;left:0;z-index:2}
.pf tbody tr:hover td,.pf tbody tr:hover th{background:var(--soft)}
.pf-link{text-decoration:none;border-radius:99px}.pf-link:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.pf-link .pf-chip{cursor:pointer}.pf-link:hover .pf-chip{border-color:var(--accent)}
.pf-q{margin:.6rem 0;padding-left:1.2rem;color:var(--muted)}.pf-q li{margin:.15rem 0}
.pf-cover{background:var(--soft);border-radius:8px;padding:.55rem .8rem;max-width:80ch}
.pf-h{margin-top:1rem}.pf-notes{list-style:none;padding:0;margin:0;display:grid;gap:.8rem}.pf-notes>li>h4{margin:.2rem 0 .3rem}
.pf-notes ul{list-style:none;padding:0;margin:0;display:grid;gap:.45rem}
.pf-note{padding:.55rem .7rem;border:1px solid var(--border);border-radius:10px;background:var(--surface);line-height:1.5}
.pf-note:target,.pf-note:focus{outline:2px solid var(--accent);outline-offset:2px}.pf-note .small{display:block;margin-top:.2rem}
.cp-t tbody tr:nth-child(even) td,.cp-t tbody tr:nth-child(even) th{background:color-mix(in srgb,var(--soft) 45%,transparent)}
@media (max-width:860px){.cp-two{grid-template-columns:1fr}}
@media (max-width:560px){.cp-n{font-size:1.3rem}.cp-glance{grid-template-columns:1fr 1fr}.cp-toc a{font-size:.8rem}}
@media (prefers-reduced-motion:reduce){.cp-card{transition:none}}
.pf td{text-align:center}.pf thead th:not(:first-child){text-align:center}
.pf-dash{color:var(--muted);opacity:.7;font-size:1rem}
.pf-legend .pf-chip.pf-none{border:0;padding-left:.2rem}
.pf-swipe{display:none;margin:.2rem 0 .3rem}@media (max-width:700px){.pf-swipe{display:block}}
/* EU additions */
.cp-key{border:1px solid var(--border);border-radius:12px;padding:.8rem 1rem;margin:.6rem 0 1rem;background:var(--surface)}
.cp-big{font-size:2rem;font-weight:800;margin:0 0 .3rem;line-height:1.1}.cp-big span{font-size:1rem;font-weight:600;color:var(--muted)}
.cp-more{margin:.5rem 0}.cp-more>summary{cursor:pointer;font-weight:700;color:var(--accent)}.cp-more>summary:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.cp-ml{padding-left:0;list-style:none}.cp-m{border-top:1px solid var(--border);padding:.7rem 0}.cp-m p{margin:.3rem 0}
.cp-mh{display:flex;flex-wrap:wrap;gap:.4rem .6rem;align-items:center;font-size:.88rem}.cp-date{font-weight:700}
.cp-kind,.cp-bind{border:1px solid var(--border);border-radius:999px;padding:.05rem .55rem;font-size:.8rem}.cp-bind{background:var(--accent);color:#fff;border-color:var(--accent)}
.cp-note{border-left:4px solid var(--accent);padding:.4rem .9rem;margin:1rem 0;background:var(--surface);border-radius:0 10px 10px 0}
.cp-btn{display:inline-block;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:999px;padding:.4rem .9rem;margin:.2rem .3rem .2rem 0;cursor:pointer;font:inherit;font-size:.9rem;text-decoration:none}
.cp-btn:focus-visible,.cp-filter button:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.cp section{scroll-margin-top:1rem}.cp section:focus{outline:none}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.cp .tablewrap{position:relative}   /* keeps hidden screen-reader labels inside the scrolling table, so the page never scrolls sideways */

/* the tracker name and logo lead back to its starting view */
.title-home{color:inherit;text-decoration:none}.title-home:hover{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.15em}
a.emblem,a.mark{display:inline-flex;text-decoration:none}

/* ---------- abbreviations, organisations and country codes, explained ---------- */
abbr[title]{text-decoration:underline dotted;text-underline-offset:3px;text-decoration-thickness:1px;cursor:help;position:relative}
abbr.open::after{content:attr(title);position:absolute;left:0;top:calc(100% + 6px);z-index:30;width:max-content;max-width:min(280px,80vw);
  padding:.45rem .6rem;border-radius:8px;background:var(--text);color:var(--surface);font-size:.82rem;font-weight:400;line-height:1.4;white-space:normal;box-shadow:0 6px 18px rgba(0,0,0,.18)}
@media (hover:hover){abbr.open::after{display:none}}
.abbr-tip{margin:.45rem 0 0;font-size:.85rem;color:var(--muted)}.abbr-tip a{color:var(--accent)}
.abbr-demo{text-decoration:underline dotted;text-underline-offset:3px}
.gloss{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:.5rem 0 1rem}.gloss dt{font-weight:700}.gloss dd{margin:0}
.gl-role{display:block;color:var(--muted);font-size:.9rem;line-height:1.45;margin-top:.1rem}
@media (max-width:560px){.gloss{grid-template-columns:1fr}.gloss dd{margin:0 0 .5rem}}

/* archived copies of sources */
.arch{font-size:.85em;opacity:.85}.arch:hover{opacity:1}.arch-sep{opacity:.6}
