/* =========================================================
   AI Jobs Observatory — estilo editorial (papel + tinta, Source Serif 4), claro/escuro
   ========================================================= */
:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece4;
  --border: #e3ded2;
  --border-strong: #cbc4b4;
  --text: #191712;
  --text-2: #4a463c;
  --muted: #655f53;

  --accent: #3446d4;
  --accent-soft: #e8eafc;
  --risk: #b53808;
  --risk-soft: #fbe9e0;
  --growth: #0f766e;
  --growth-soft: #dff2ee;
  --transform: #3446d4;
  --transform-soft: #e8eafc;
  --chart-muted: #d3cdbf;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(25, 23, 18, 0.04), 0 8px 24px rgba(25, 23, 18, 0.05);
  --shadow-lg: 0 24px 60px rgba(25, 23, 18, 0.18);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e;
    --surface: #1b1a16;
    --surface-2: #25231e;
    --border: #322f28;
    --border-strong: #4a463c;
    --text: #f3f0e8;
    --text-2: #cbc6ba;
    --muted: #9a9486;
    --accent: #8f9cff;
    --accent-soft: #23264a;
    --risk: #fb8b5c;
    --risk-soft: #3a2218;
    --growth: #3cc4b2;
    --growth-soft: #15302c;
    --transform: #8f9cff;
    --transform-soft: #23264a;
    --chart-muted: #3d3a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12110e;
  --surface: #1b1a16;
  --surface-2: #25231e;
  --border: #322f28;
  --border-strong: #4a463c;
  --text: #f3f0e8;
  --text-2: #cbc6ba;
  --muted: #9a9486;
  --accent: #8f9cff;
  --accent-soft: #23264a;
  --risk: #fb8b5c;
  --risk-soft: #3a2218;
  --growth: #3cc4b2;
  --growth-soft: #15302c;
  --transform: #8f9cff;
  --transform-soft: #23264a;
  --chart-muted: #3d3a32;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 200; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.overline {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  color: var(--text); text-decoration: none; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600;
}
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
}
.brand em { font-style: italic; color: var(--accent); }
/* Menu principal: 5 entradas, submenus (Países, Dados) e botão Comparar; painel ☰ abaixo de 960px */
.site-nav-slot { display: contents; }
.main-nav { display: flex; align-items: center; gap: 12px; min-width: 0; margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-list a,
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 0; border-radius: 999px; background: none;
  white-space: nowrap; color: var(--text-2); text-decoration: none; font: 500 0.88rem var(--font-sans); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-list a:hover,
.nav-group-btn:hover,
.nav-list a[aria-current="page"],
.nav-list a.is-current,
.nav-group.is-current > .nav-group-btn { background: var(--surface-2); color: var(--text); }
.nav-list a[aria-current="page"],
.nav-list a.is-current,
.nav-group.is-current > .nav-group-btn { font-weight: 600; }
.nav-chevron { width: 12px; height: 12px; transition: transform 0.15s; }
.nav-group { position: relative; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 230px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; } /* mantém o hover entre o botão e o submenu */
.nav-sub a { display: flex; width: 100%; border-radius: 8px; padding: 9px 12px; }
.nav-group.open > .nav-sub { display: block; }
:root:not(.js) .nav-group:focus-within > .nav-sub { display: block; }
@media (hover: hover) and (min-width: 961px) { .nav-group:hover > .nav-sub { display: block; } }
.nav-cta {
  padding: 7px 16px; border-radius: 999px; white-space: nowrap;
  background: var(--accent); color: var(--bg); text-decoration: none; font: 600 0.85rem var(--font-sans);
}
.nav-cta:hover { filter: brightness(1.08); }
.nav-toggle {
  display: none; flex-shrink: 0; place-items: center; width: 40px; height: 40px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
}
.nav-toggle svg { width: 18px; height: 18px; }

/* Índice "Nesta página" (páginas de país e início) */
.page-toc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.page-toc-title { margin-right: 6px; color: var(--muted); font: 600 0.72rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.page-toc a {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: 0.85rem;
}
.page-toc a:hover { color: var(--text); border-color: var(--border-strong); }
.header-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.lang-btn {
  border: 0; background: none; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  color: var(--muted); font: 600 0.75rem var(--font-sans); text-decoration: none;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--text); color: var(--bg); }
.theme-toggle {
  display: grid; flex-shrink: 0; place-items: center; width: 34px; height: 34px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--border); }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--growth); box-shadow: 0 0 0 4px var(--growth-soft); }
.hero-title { margin: 0 0 18px; font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; text-wrap: balance; }
.hero-accent { display: block; margin-top: 4px; font-style: italic; font-weight: 500; color: var(--accent); }
.hero-subtitle { margin: 0; max-width: 620px; font-size: 1.06rem; color: var(--text-2); }

.balance-card:empty { display: none; }
.balance-card {
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.balance-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.balance-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.balance-pill.positive { background: var(--growth-soft); color: var(--growth); }
.balance-pill.caution { background: var(--risk-soft); color: var(--risk); }
.balance-figures { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.balance-fig span { display: block; font-size: 2.3rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.balance-fig small { font-size: 0.8rem; color: var(--muted); }
.balance-fig.risk span { color: var(--risk); }
.balance-fig.growth { text-align: right; }
.balance-fig.growth span { color: var(--growth); }
.balance-ratio-bar { display: flex; gap: 3px; height: 10px; margin-bottom: 16px; }
.ratio-risk, .ratio-growth { border-radius: 999px; transition: width 0.4s ease; }
.ratio-risk { background: var(--risk); }
.ratio-growth { background: var(--growth); }
.balance-footnote { margin: 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.84rem; color: var(--text-2); }

/* Seletor de país: pesquisa + destaques */
.country-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 36px 0 20px; }
.country-picker { flex: 0 1 300px; min-width: 220px; }
.country-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: min(320px, 50vh); overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  margin: 0; padding: 6px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.country-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 0.9rem; cursor: pointer; }
.country-option:hover, .country-option.is-active { background: var(--surface-2); color: var(--text); }
.country-option[aria-selected="true"] { font-weight: 600; color: var(--text); }
.country-option.is-empty { cursor: default; color: var(--muted); }
.opt-rank { min-width: 2.2em; color: var(--muted); font-size: 0.78rem; text-align: right; }
.opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-jobs { color: var(--muted); font-size: 0.78rem; }
.country-pills { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; order: 3; }
.country-pill-all { border-style: dashed; color: var(--accent); }
nav.country-pills + .country-pill-all { order: 4; }
.pill-you { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.country-pill.active .pill-you { background: var(--bg); }
.balance-figures .balance-fig:last-child:not(:first-child) { text-align: right; }
.sectors-note { grid-column: 1 / -1; margin: 12px 0 4px; font-size: 0.84rem; color: var(--muted); }
/* Tabela de ranking */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ranking-table th, .ranking-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.ranking-table th:nth-child(2) { text-align: left; font-weight: 500; }
.ranking-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ranking-table tbody tr:last-child > * { border-bottom: 0; }
.ranking-table tbody tr:hover { background: var(--surface-2); }
.ranking-table a { color: var(--text); text-decoration: none; }
.ranking-table a:hover { color: var(--accent); text-decoration: underline; }
.country-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: 500 0.88rem var(--font-sans); text-decoration: none; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.country-pill:hover { border-color: var(--border-strong); color: var(--text); }
.country-pill.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card {
  display: flex; flex-direction: column; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.kpi-label { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; font-weight: 500; color: var(--text-2); }
.dot { width: 8px; height: 8px; margin-top: 0.45em; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.tone-risk .dot { background: var(--risk); }
.tone-growth .dot { background: var(--growth); }
.tone-transform .dot { background: var(--transform); }
.tone-neutral .dot { background: var(--text); }
.kpi-value { margin: 14px 0 6px; font-size: 2.1rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.tone-risk .kpi-value { color: var(--risk); }
.tone-growth .kpi-value { color: var(--growth); }
.tone-transform .kpi-value { color: var(--transform); }
.kpi-note { flex: 1; margin: 0 0 16px; font-size: 0.83rem; color: var(--muted); line-height: 1.45; }
.kpi-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.74rem; }
.data-type-tag { padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.data-type-tag.official { background: var(--growth-soft); color: var(--growth); }
.data-type-tag.projection { background: var(--transform-soft); color: var(--transform); }
.data-type-tag.estimate { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.source-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.source-link:hover { text-decoration: underline; }

.data-meta-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.source-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.source-pill {
  padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 0.78rem; text-decoration: none;
}
.source-pill:hover { border-color: var(--accent); color: var(--accent); }
.meta-badge { font-size: 0.78rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-kicker { display: block; margin-bottom: 8px; }
.section-header h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 500; }
.section-desc { margin: 0; max-width: 640px; color: var(--text-2); }
.legend, .chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.82rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 4px; border-radius: 2px; }
.swatch-pt { background: var(--accent); }
.swatch-eu { background: var(--text); }
.swatch-muted { background: var(--chart-muted); }

/* ---------- Adoption chart ---------- */
.adoption-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.chart-card { margin: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.chart-caption { margin-bottom: 14px; font-weight: 600; font-size: 0.92rem; }
.line-chart { display: block; width: 100%; height: auto; margin-bottom: 12px; overflow: visible; }
.line-chart .grid { stroke: var(--border); stroke-width: 1; }
.line-chart .axis { fill: var(--muted); font: 11px var(--font-mono); }
.line-chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .series.muted { stroke: var(--chart-muted); stroke-width: 1.5; }
.line-chart .series.eu { stroke: var(--text); stroke-width: 2.5; stroke-dasharray: 5 4; }
.line-chart .series.pt { stroke: var(--accent); stroke-width: 3; }
.line-chart .pt { fill: var(--surface); stroke-width: 2; }
.line-chart circle.pt { stroke: var(--accent); }
.line-chart circle.eu { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.line-chart .end-label { font: 600 12px var(--font-sans); }
.line-chart .end-label.pt { fill: var(--accent); }
.line-chart .end-label.eu { fill: var(--text); }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rank-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-2); }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 999px; background: var(--chart-muted); }
.rank-val { text-align: right; font-size: 0.78rem; }
.rank-row.is-pt, .rank-row.is-eu { color: var(--text); font-weight: 600; }
.rank-row.is-pt .rank-fill { background: var(--accent); }
.rank-row.is-eu .rank-fill { background: var(--text); }
.chart-note { margin: 14px 0 0; font-size: 0.82rem; color: var(--muted); }

/* ---------- Sectors ---------- */
.sectors-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; padding: 8px 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sector-row { padding: 18px 0; border-bottom: 1px solid var(--border); }
.sector-row:nth-last-child(-n + 2) { border-bottom: 0; }
.sector-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sector-name { font-weight: 600; font-size: 0.95rem; }
.sector-tag { font-size: 0.74rem; color: var(--muted); white-space: nowrap; }

/* ---------- Professions ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search-icon { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input {
  width: 100%; padding: 12px 14px 12px 42px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: 0.94rem var(--font-sans);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tab {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: 500 0.85rem var(--font-sans); cursor: pointer;
}
.filter-tab:hover { border-color: var(--border-strong); color: var(--text); }
.filter-tab.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.results-count { margin-bottom: 18px; font-size: 0.85rem; color: var(--muted); }
.professions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prof-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: inherit; font: inherit; text-decoration: none; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.prof-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.prof-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.prof-name { margin: 0; font-size: 1.25rem; }
.prof-sector { font-size: 0.8rem; color: var(--muted); }
.prof-summary { flex: 1; margin: 6px 0 12px; font-size: 0.88rem; color: var(--text-2); }
.ilo-mini { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; font-size: 0.77rem; color: var(--muted); }
.ilo-mini strong { color: var(--text); font-weight: 600; }
.ilo-mini .ilo-meter { grid-column: 1 / -1; }
.ilo-meter { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.ilo-meter i { height: 6px; border-radius: 999px; background: var(--surface-2); }
.ilo-meter.lvl-none i.on, .ilo-meter.lvl-minimal i.on { background: var(--growth); }
.ilo-meter.lvl-g1 i.on, .ilo-meter.lvl-g2 i.on { background: var(--transform); }
.ilo-meter.lvl-g3 i.on, .ilo-meter.lvl-g4 i.on { background: var(--risk); }
.ilo-box { max-width: 560px; margin: 20px 0 24px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.86rem; color: var(--text-2); }
.ilo-box .ilo-meter i { background: var(--border); }
.ilo-box p { margin: 10px 0 0; }
.ilo-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); }
.ilo-head strong { color: var(--text); }
.ilo-note { font-size: 0.78rem; color: var(--muted); }
.ilo-empty { color: var(--muted); }
.prof-link { margin-top: 14px; font-size: 0.84rem; font-weight: 600; color: var(--accent); }

.badge { display: inline-flex; align-items: center; width: fit-content; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.badge-alto-risco, .badge-displaced { background: var(--risk-soft); color: var(--risk); }
.badge-em-crescimento, .badge-created { background: var(--growth-soft); color: var(--growth); }
.badge-em-transformacao, .badge-transformed { background: var(--transform-soft); color: var(--transform); }

/* ---------- Cases ---------- */
.cases-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-card {
  display: flex; flex-direction: column; padding: 22px 22px 18px;
  border: 1px solid var(--border); border-left: 4px solid var(--transform); border-radius: var(--radius); background: var(--surface);
}
.case-card.type-displaced { border-left-color: var(--risk); }
.case-card.type-created { border-left-color: var(--growth); }
.case-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.case-date { font-size: 0.75rem; color: var(--muted); }
.case-org { margin: 14px 0 4px; font-size: 1.3rem; }
.case-impact { margin: 0 0 10px; font-size: 0.95rem; font-weight: 600; }
.case-summary { flex: 1; margin: 0 0 16px; font-size: 0.9rem; color: var(--text-2); }
.case-source { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); }

/* ---------- Methodology ---------- */
.methodology-box { padding: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.methodology-box > h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; }
.methodology-box > p { margin: 0 0 28px; max-width: 780px; color: var(--text-2); }
.methodology-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.methodology-grid h3 { margin: 0 0 6px; font-size: 1.08rem; }
.methodology-grid p { margin: 0; font-size: 0.88rem; color: var(--text-2); }
.sources-directory { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--border); }
.sources-directory h3 { margin: 0 0 14px; font-size: 1.1rem; }
.sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.source-dir-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
  color: inherit; text-decoration: none; transition: border-color 0.15s;
}
.source-dir-card:hover { border-color: var(--accent); }
.source-dir-name { font-size: 0.86rem; font-weight: 600; color: var(--accent); }
.source-dir-scope { font-size: 0.8rem; color: var(--text-2); }

/* ---------- Ads (só renderizados quando ativos) ---------- */
.ad-section { padding: 20px 0; }
.ad-slot { min-height: 110px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ad-label { display: block; margin-bottom: 6px; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Static pages ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-size: 0.84rem; color: var(--muted); }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.detail-card { padding: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.detail-title { margin: 14px 0 4px; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 500; }
.detail-sector { margin-bottom: 14px; color: var(--muted); }
.detail-summary { margin: 0; max-width: 760px; font-size: 1.04rem; color: var(--text-2); }
.detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-box { padding: 18px; border: 1px solid var(--border); border-top: 3px solid var(--transform); border-radius: var(--radius-sm); }
.detail-box.tone-risk { border-top-color: var(--risk); }
.detail-box.tone-growth { border-top-color: var(--growth); }
.detail-box h3 { margin: 0 0 10px; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; letter-spacing: 0; }
.detail-box ul { margin: 0; padding-left: 18px; font-size: 0.88rem; color: var(--text-2); }
.detail-box li + li { margin-top: 6px; }
.detail-subtitle { margin: 24px 0 0; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; letter-spacing: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 0.8rem; }
.detail-disclaimer { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }
.legal-content h2 { margin: 28px 0 8px; font-size: 1.3rem; }
.legal-content p, .legal-content li { color: var(--text-2); }
.legal-content ul, .legal-content ol { padding-left: 20px; }
.legal-content .table-wrap { margin: 12px 0 8px; }
.data-fields.method-table th:first-child { white-space: normal; width: 40%; }
.method-table td { font-size: 0.84rem; }
.method-table td.mono { width: 22%; overflow-wrap: anywhere; }
.method-version { font-size: 0.86rem; color: var(--muted); }
.methodology-more { margin: 24px 0 0; font-weight: 600; }
.cl-filters { margin: 12px 0 4px; }
.cl-filters[hidden], .cl-item[hidden] { display: none; }
.cl-list { list-style: none; padding-left: 0 !important; margin: 8px 0 0; }
.cl-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.cl-item:last-child { border-bottom: 0; }
.cl-item time { font-size: 0.82rem; color: var(--muted); }
.cl-item p { margin: 6px 0 0; }
.cl-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: var(--text-2); }
.cl-correction { border-color: var(--risk); color: var(--risk); }
.cl-methodology { border-color: var(--accent); color: var(--accent); }
.cl-data { border-color: var(--growth); color: var(--growth); }
.back-link { font-weight: 600; text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--text-2); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px; }
.footer-inner p { margin: 0; }
.footer-note, .footer-updated { color: var(--muted); }
.footer-updated { margin-top: 6px !important; font-size: 0.8rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(18, 17, 14, 0.55); backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal-dialog {
  position: relative; width: 100%; max-width: 700px; max-height: 88vh; overflow-y: auto;
  padding: 36px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 1.3rem; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.empty-state { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .main-nav { margin-left: 0; }
  .header-controls { margin-left: auto; }
  :root.js .nav-toggle { display: grid; order: 3; }
  :root.js .main-nav { display: none; }
  :root.js .site-header.nav-open .main-nav {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 10px;
    max-height: calc(100vh - 64px); overflow-y: auto; padding: 12px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  :root.js .nav-list { flex-direction: column; align-items: stretch; }
  :root.js .nav-list a { padding: 11px 12px; }
  :root.js .nav-sub { display: block; position: static; min-width: 0; padding: 0 0 6px 10px; border: 0; background: none; box-shadow: none; }
  :root.js .nav-group-btn { pointer-events: none; padding: 12px 12px 4px; background: none; color: var(--muted); font: 600 0.72rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
  :root.js .nav-chevron { display: none; }
  :root.js .nav-cta { align-self: flex-start; padding: 10px 18px; }
  /* Sem JS: o menu fica visível numa segunda linha */
  :root:not(.js) .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
  :root:not(.js) .main-nav { order: 4; width: 100%; flex-wrap: wrap; }
  :root:not(.js) .nav-list { flex-wrap: wrap; }
  :root:not(.js) .nav-sub { display: block; position: static; min-width: 0; padding: 0 0 0 10px; border: 0; background: none; box-shadow: none; }
}
/* Entre 961 e 1080px o menu completo cabe com menos espaço entre entradas */
@media (min-width: 961px) and (max-width: 1080px) {
  .header-inner { gap: 12px; }
  .main-nav { gap: 8px; }
  .nav-list a, .nav-group-btn { padding: 6px 9px; }
}
@media (max-width: 1000px) {
  .hero-layout, .adoption-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .professions-grid, .sources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .methodology-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .header-inner { gap: 8px; }
  .lang-btn { padding: 7px 12px; }
  .theme-toggle { width: 40px; height: 40px; }
  .hero { padding: 36px 0; }
  .section { padding: 52px 0; }
  .kpi-grid, .professions-grid, .sources-grid, .cases-grid, .sectors-card, .detail-columns { grid-template-columns: minmax(0, 1fr); }
  .sector-row:nth-last-child(2) { border-bottom: 1px solid var(--border); }
  .sectors-card { padding: 4px 18px; }
  .detail-card, .methodology-box { padding: 24px 20px; }
  .modal-dialog { padding: 28px 20px; }
  .rank-row { grid-template-columns: 96px minmax(0, 1fr) 48px; }
  .country-picker { flex: 1 1 100%; scroll-margin-top: 40px; }
  .country-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; margin: 0 -16px; padding: 0 16px 4px; }
  .country-bar > .country-pill-all { margin-left: 0; }
  .ranking-table th, .ranking-table td { padding: 9px 10px; }
}

/* ---------- National context (editorial) ---------- */
.context-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.context-text p { margin: 0 0 18px; max-width: 720px; font-size: 1.02rem; line-height: 1.7; color: var(--text-2); }
.context-text p:first-child::first-line { color: var(--text); }
.context-facts .chart-caption { margin: 0 0 12px; }
.context-kpis { display: grid; gap: 12px; }
.context-kpis .kpi-value { font-size: 1.6rem; }
@media (max-width: 1000px) { .context-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } .context-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .context-kpis { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Labour market profile ---------- */
.labour-desc { margin: -16px 0 24px; }
.labour-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.labour-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.labour-kpis .kpi-value { font-size: 1.7rem; }
.labour-kpis .kpi-note { margin-bottom: 0; }
.labour-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 52px; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.82rem; color: var(--text-2); }
.labour-row-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labour-row:first-of-type .labour-row-label { font-weight: 600; color: var(--text); }
.labour-row-val { text-align: right; font-size: 0.78rem; }
.labour-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.labour-structure .swatch { height: 8px; }
.seg-agr { background: var(--growth); }
.seg-ind { background: var(--chart-muted); }
.seg-srv { background: var(--accent); }
.labour-text { max-width: 760px; margin: 24px 0; font-size: 1.02rem; line-height: 1.65; color: var(--text-2); }
.labour-peers-desc { font-weight: 400; color: var(--muted); }
.labour-peers .table-wrap { border: 0; }
@media (max-width: 1000px) {
  .labour-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .labour-row { grid-template-columns: 112px minmax(0, 1fr) 46px; }
}
@media (max-width: 480px) {
  .labour-kpis { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Open data page ---------- */
.data-downloads { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.data-btn {
  display: inline-flex; align-items: center; padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.data-btn:hover { border-color: var(--accent); color: var(--accent); }
.data-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.data-btn.primary:hover { opacity: 0.9; color: var(--bg); }
.data-fields th, .data-fields td { text-align: left; white-space: normal; }
.data-fields th:first-child { white-space: nowrap; }

/* Estudos */
.research-list { display: grid; gap: 20px; }
.research-card h2 { margin: 4px 0 12px; font-size: 1.3rem; }
.research-card h3 { margin: 18px 0 8px; font-size: 1rem; }
.research-card ul { margin: 0; padding-left: 20px; }
.research-card li { margin-bottom: 8px; line-height: 1.6; }
.research-meta { margin: 0; font-size: 0.9rem; color: var(--muted); }
.research-ref, .research-limits, .research-countries { color: var(--text-2); }
.research-ref { font-size: 0.85rem; }
.sources-more { margin: -6px 0 14px; }

/* Artigos académicos recentes (OpenAlex) */
.recent-research-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.recent-paper-card {
  display: flex; flex-direction: column; padding: 20px 22px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.recent-paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); }
.recent-paper-title { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.3; }
.recent-paper-authors { flex: 1; margin: 0 0 14px; font-size: 0.84rem; color: var(--text-2); }
.recent-paper-link { margin: 0; font-size: 0.84rem; }
.recent-paper-card[hidden] { display: none; }

/* Incorporar (botão e páginas /embed/) */
.embed-box { margin: 16px 0 0; font-size: 0.86rem; }
.embed-box summary { display: inline-block; cursor: pointer; font-weight: 600; color: var(--text-2); }
.embed-box[open] summary { margin-bottom: 8px; }
.embed-box p { margin: 0 0 8px; color: var(--muted); }
.embed-box textarea { display: block; width: 100%; max-width: 720px; margin: 0 0 8px; padding: 8px 10px; font: 0.78rem/1.4 var(--font-mono, monospace); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
body.embed { margin: 0; background: var(--bg); }
.embed-main { padding: 16px; }
.embed-title { margin: 0 0 12px; font-weight: 700; }
.embed-title a { color: var(--text); text-decoration: none; }
.embed-credit { margin: 12px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Números-chave */
.kf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kf-card { display: flex; flex-direction: column; align-items: flex-start; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.kf-value { margin: 12px 0 6px; font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kf-text { flex: 1; margin: 0 0 12px; color: var(--text-2); }
.kf-source { margin: 0 0 14px; font-size: 0.8rem; color: var(--muted); }
.kf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; font-size: 0.86rem; }

.rp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 20px; }
.rp-filters[hidden] { display: none; }
.rp-oa { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--text-2); cursor: pointer; }
.rp-count { margin: 0; }
.page-crosslink { margin: 28px 0 0; font-weight: 600; }
/* Pesquisa de países (páginas estáticas) e filtro da lista */
form.country-picker { margin: 0; }
.rank-filter { margin: 0 0 8px; }
.rank-filter[hidden], .ranking-table tr[hidden] { display: none; }
.rank-count { min-height: 1.2em; margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.kpi-more { margin: 12px 0 0; font-size: 0.9rem; font-weight: 600; }
@media (max-width: 760px) {
  .recent-research-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Country Comparator ---------- */
.compare-controls {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  margin-bottom: 16px;
}
.compare-field { display: flex; flex-direction: column; gap: 6px; }
.compare-field label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.compare-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.94rem;
}
.compare-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.compare-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.compare-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--muted); }
.compare-preset-btn {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.82rem; cursor: pointer;
}
.compare-preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.compare-table th:first-child { text-align: left; white-space: normal; min-width: 210px; }
.compare-table td { text-align: left; vertical-align: top; min-width: 150px; }
.compare-col-head { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.compare-profile-link { font-size: 0.76rem; font-weight: 500; color: var(--accent); text-decoration: none; }
.compare-profile-link:hover { text-decoration: underline; }
.compare-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 6px; max-width: 140px; }
.compare-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.compare-bar-fill.tone-risk { background: var(--risk); }
.compare-bar-fill.tone-growth { background: var(--growth); }
.compare-bar-fill.tone-muted { background: var(--chart-muted); }
.compare-status { margin: 0 0 14px; font-size: 0.9rem; color: var(--muted); }
.section-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) {
  .compare-controls { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Citation Box ---------- */
.cite-box {
  margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 16px;
}
.cite-summary {
  cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.cite-summary::-webkit-details-marker { display: none; }
.cite-summary::before { content: "+"; font-family: "JetBrains Mono", monospace; color: var(--accent); font-weight: 700; }
.cite-box[open] .cite-summary::before { content: "−"; }
.cite-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cite-text { margin: 0 0 12px; font-size: 0.82rem; line-height: 1.5; color: var(--text-2); word-break: break-word; }
.cite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cite-btn {
  padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.cite-btn:hover { border-color: var(--accent); color: var(--accent); }
.cite-note { margin: 0; font-size: 0.78rem; color: var(--muted); }


/* Cabeçalho em ecrãs muito estreitos (≤ 420px): marca, idioma, tema e ☰ cabem numa linha */
@media (max-width: 420px) {
  .header-inner { gap: 6px; }
  .brand { gap: 8px; font-size: 1.02rem; }
  .header-controls { gap: 6px; }
  .lang-btn { padding: 7px 9px; }
  .theme-toggle, :root.js .nav-toggle { width: 38px; height: 38px; }
}
@media (max-width: 360px) {
  .brand { font-size: 0.92rem; }
  .brand-mark { width: 24px; height: 24px; }
  .lang-btn { padding: 6px 7px; }
}
@media (max-width: 340px) {
  .header-inner { padding-left: 12px; padding-right: 12px; gap: 4px; }
  .brand { gap: 6px; font-size: 0.86rem; }
  .header-controls { gap: 4px; }
  .lang-btn { padding: 6px; }
}
