/* ==========================================================================
   EU Tech Compass — stylesheet
   Plain CSS, system fonts, no external dependencies.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --eu-blue: #003399;
  --eu-blue-600: #0a2f86;
  --eu-yellow: #ffcc00;
  --navy: #0b1530;
  --navy-2: #13204a;
  --muted-blue: #4a5f8f;
  --muted-blue-soft: #dfe6f5;
  --grey-50: #f6f7fa;
  --grey-100: #eef1f6;
  --grey-200: #dde2ec;
  --grey-500: #5b6478;
  --white: #ffffff;

  --bg: var(--white);
  --bg-alt: var(--grey-50);
  --surface: var(--white);
  --text: #141a2b;
  --text-muted: #4b5468;
  --border: var(--grey-200);
  --link: var(--eu-blue);
  --accent: var(--eu-blue);
  --accent-contrast: var(--white);
  --focus: #b38600;
  --fill: #003399;

  --ok: #1f6f43;
  --ok-bg: #e5f3ea;
  --warn: #7a5200;
  --warn-bg: #fff4d1;
  --risk: #8a1c1c;
  --risk-bg: #fbe7e7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 21, 48, .06), 0 6px 20px rgba(11, 21, 48, .06);
  --container: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1126;
    --bg-alt: #0f1833;
    --surface: #121d3d;
    --text: #e8ecf6;
    --text-muted: #b3bcd3;
    --border: #26345f;
    --link: #9db6ff;
    --accent: #7f9cff;
    --accent-contrast: #0a1126;
    --muted-blue-soft: #1b2a57;
    --grey-100: #16224a;
    --focus: var(--eu-yellow);
    --fill: #7f9cff;
    --ok: #8fd6aa;
    --ok-bg: #12351f;
    --warn: #ffd866;
    --warn-bg: #3a2f0a;
    --risk: #ffaaaa;
    --risk-bg: #3d1515;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p, ul, ol, dl { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
small { font-size: .875rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--grey-100); padding: .1em .35em; border-radius: 4px; }
abbr[title] { text-decoration: underline dotted; cursor: help; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  background: var(--eu-yellow); color: var(--navy); padding: .6rem 1rem;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 780px; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--navy); color: #e8ecf6; }
.section-dark a { color: #c6d4ff; }
.section-dark .lead, .section-dark .text-muted, .section-dark .note { color: #c3cbe0; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.section-dark .eyebrow { color: var(--eu-yellow); }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--text-muted); max-width: 46em; }
.text-muted { color: var(--text-muted); }
.section-head { max-width: 48em; margin-bottom: 2.5rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Header & navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) { .site-header { background: rgba(10, 17, 38, .94); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 750; letter-spacing: -.01em; font-size: 1.1rem; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-muted); letter-spacing: .02em; }

.nav-toggle { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem; }
.site-nav a {
  display: block; padding: .5rem .6rem; border-radius: 8px; text-decoration: none;
  color: var(--text); font-size: .95rem; font-weight: 550;
}
.site-nav a:hover { background: var(--grey-100); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--muted-blue-soft); }

@media (max-width: 1240px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    background: transparent; border: 1px solid var(--border); color: var(--text);
    padding: .5rem .8rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
  }
  .nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .2s;
  }
  .nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-icon::before { top: -6px; }
  .nav-toggle-icon::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; padding-bottom: .75rem; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: .7rem .8rem; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn-primary { background: var(--eu-yellow); color: var(--navy); }
.btn-primary:hover { background: #ffd83d; }
.btn-secondary { background: transparent; color: inherit; border-color: currentColor; }
.btn-secondary:hover { background: rgba(255, 255, 255, .08); }
.btn-blue { background: var(--eu-blue); color: #fff; }
.btn-blue:hover { background: var(--eu-blue-600); }
.btn-ghost { background: var(--grey-100); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: .5rem .85rem; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255, 204, 0, .14), transparent 60%),
    radial-gradient(900px 600px at -10% 120%, rgba(90, 130, 255, .25), transparent 60%),
    linear-gradient(160deg, var(--eu-blue) 0%, #0b2470 45%, var(--navy) 100%);
  padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}
.hero h1 { max-width: 15em; }
.hero h1 em { font-style: normal; color: var(--eu-yellow); }
.hero .lead { color: #d7def2; }
.hero-ring { position: absolute; right: -120px; top: 50%; transform: translateY(-50%); width: 560px; opacity: .22; pointer-events: none; }
@media (max-width: 760px) { .hero-ring { width: 380px; right: -170px; opacity: .14; } }
.hero .eyebrow { color: var(--eu-yellow); }

.page-hero {
  background: linear-gradient(160deg, var(--eu-blue) 0%, #0b2470 55%, var(--navy) 100%);
  color: #fff; padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 3.75rem);
}
.page-hero .lead { color: #d7def2; }
.page-hero .eyebrow { color: var(--eu-yellow); }
.page-hero a { color: #fff; }

.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: .4rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); color: #fff; text-decoration: none;
}
.toc a:hover { background: rgba(255, 255, 255, .2); }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card-accent { border-top: 4px solid var(--eu-blue); }
.card-yellow { border-top: 4px solid var(--eu-yellow); }
.section-dark .card { background: var(--navy-2); border-color: #2a3a6c; color: #e8ecf6; box-shadow: none; }
.icon-badge {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  background: var(--muted-blue-soft); color: var(--accent); margin-bottom: .8rem;
}
.icon-badge svg { width: 22px; height: 22px; }

.callout {
  border-left: 4px solid var(--eu-blue); background: var(--muted-blue-soft); padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0;
}
.callout-yellow { border-left-color: var(--eu-yellow); background: var(--warn-bg); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; display: block; margin-bottom: .25rem; }

.pull-quote {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 650; line-height: 1.35;
  border-left: 5px solid var(--eu-yellow); padding: .25rem 0 .25rem 1.25rem; margin: 2rem 0; max-width: 34em;
}

.split { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 1fr; } }

.check-list, .cross-list { list-style: none; padding: 0; }
.check-list li, .cross-list li { position: relative; padding-left: 1.8rem; margin-bottom: .55rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.cross-list li::before { content: "–"; position: absolute; left: .2rem; color: var(--text-muted); font-weight: 800; }

/* ---------- Euro flow diagram ---------- */
.flow { display: grid; gap: 0; justify-items: center; margin: 0 auto; max-width: 980px; }
.flow-node {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1.3rem; text-align: center; font-weight: 650; box-shadow: var(--shadow); min-width: min(100%, 320px);
}
.flow-node small { display: block; font-weight: 500; color: var(--text-muted); }
.flow-node.is-primary { background: var(--eu-blue); color: #fff; border-color: var(--eu-blue); }
.flow-node.is-primary small { color: #d7def2; }
.flow-node.is-goal { background: var(--navy); color: #fff; border: 2px solid var(--eu-yellow); }
.flow-node.is-goal small { color: #d7def2; }
.flow-arrow { width: 2px; height: 34px; background: linear-gradient(var(--border), var(--accent)); position: relative; margin: 2px 0; }
.flow-arrow::after {
  content: ""; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--accent); border-bottom: 0;
}
.flow-fan { display: grid; gap: .75rem; width: 100%; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 1rem; border: 1px dashed var(--border); border-radius: calc(var(--radius) + 6px); background: var(--bg-alt); }
.flow-fan .flow-node { min-width: 0; font-size: .95rem; padding: .8rem; box-shadow: none; }
.flow-fan .flow-node svg { width: 22px; height: 22px; display: block; margin: 0 auto .35rem; color: var(--accent); }
.flow-caption { margin-top: 1.25rem; font-size: .92rem; color: var(--text-muted); max-width: 52em; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .flow-arrow { background-size: 100% 200%; animation: flowpulse 2.4s linear infinite; background-image: linear-gradient(var(--border) 0%, var(--accent) 50%, var(--border) 100%); }
  @keyframes flowpulse { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
}

/* ---------- €100 explorer ---------- */
.explorer { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .explorer { grid-template-columns: 330px 1fr; } }
.explorer fieldset { border: 0; padding: 0; margin: 0; }
.explorer legend { font-weight: 700; margin-bottom: .75rem; }
.profile-option { display: block; position: relative; margin-bottom: .6rem; }
.profile-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.profile-option span {
  display: block; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 2px solid var(--border);
  background: var(--surface); font-weight: 600; line-height: 1.35;
}
.profile-option span small { display: block; font-weight: 450; color: var(--text-muted); margin-top: .2rem; }
.profile-option input:checked + span { border-color: var(--eu-blue); background: var(--muted-blue-soft); }
.profile-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.explorer-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.dim-row { display: grid; grid-template-columns: 1fr; gap: .35rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.dim-row:last-child { border-bottom: 0; }
@media (min-width: 640px) { .dim-row { grid-template-columns: 200px 180px 1fr; align-items: center; gap: 1rem; } }
.dim-name { font-weight: 650; }
.dim-note { font-size: .92rem; color: var(--text-muted); }
.scale { display: flex; gap: 4px; align-items: center; }
.scale i { display: block; height: 12px; flex: 1; border-radius: 3px; background: var(--grey-200); }
@media (prefers-color-scheme: dark) { .scale i { background: #26345f; } }
.scale[data-level="eu"] i:nth-child(-n+3) { background: var(--fill); }
.scale[data-level="mixed"] i:nth-child(-n+2) { background: var(--muted-blue); }
.scale[data-level="non-eu"] i:nth-child(1) { background: #9aa3b8; }
.scale[data-level="depends"] i { background: repeating-linear-gradient(45deg, var(--grey-200), var(--grey-200) 4px, var(--muted-blue-soft) 4px, var(--muted-blue-soft) 8px); }
.scale-label { font-size: .82rem; font-weight: 650; margin-top: .2rem; display: block; color: var(--text-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--text-muted); margin-top: 1rem; }
.legend .scale { width: 64px; }

/* ---------- Stack diagram ---------- */
.stack { display: grid; gap: .5rem; }
.stack-layer {
  display: grid; grid-template-columns: 1fr; gap: .4rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1.1rem;
}
@media (min-width: 760px) { .stack-layer { grid-template-columns: 240px 150px 1fr; gap: 1.25rem; } }
.stack-layer h3 { font-size: 1rem; margin: 0; }
.stack-layer p { margin: 0; font-size: .93rem; color: var(--text-muted); }
.pill {
  display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px;
  letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent;
}
.pill-strong { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.pill-present { background: var(--muted-blue-soft); color: var(--accent); border-color: currentColor; }
.pill-limited { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }

/* ---------- Sovereignty types ---------- */
.sov-type h3 { display: flex; align-items: center; gap: .6rem; }
.sov-type .q { font-style: italic; color: var(--text-muted); }

/* ---------- Dependency map (jurisdiction) ---------- */
.dep-map { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); counter-reset: dep; }
.dep-step { position: relative; padding: 1rem 1rem 1rem 3rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.dep-step::before {
  counter-increment: dep; content: counter(dep); position: absolute; left: .9rem; top: 1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--eu-blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.dep-step strong { display: block; }
.dep-step span { font-size: .92rem; color: var(--text-muted); }

/* ---------- Myths / accordions ---------- */
.accordion details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .75rem;
}
.accordion summary {
  cursor: pointer; padding: 1rem 3rem 1rem 1.2rem; font-weight: 650; list-style: none; position: relative;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 500; color: var(--accent);
}
.accordion details[open] summary::after { content: "−"; }
.accordion .acc-body { padding: 0 1.2rem 1.1rem; }
.verdict { display: inline-block; font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 4px; margin-bottom: .5rem; }
.verdict-false { background: var(--risk-bg); color: var(--risk); }
.verdict-partly { background: var(--warn-bg); color: var(--warn); }
.verdict-context { background: var(--muted-blue-soft); color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Regulation vs choice ---------- */
.reg-compare { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.reg-box { border-radius: var(--radius); padding: 1.3rem 1.4rem; border: 2px solid; }
.reg-box h3 { display: flex; gap: .5rem; align-items: center; }
.reg-box.req { border-color: var(--eu-blue); background: var(--muted-blue-soft); }
.reg-box.choice { border-color: var(--eu-yellow); background: var(--warn-bg); }
.law { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .law { grid-template-columns: 1fr 1fr; } }
.law-tag { font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: .3rem; }
.law-tag.req { color: var(--accent); }
.law-tag.choice { color: var(--warn); }

/* ---------- Citations ---------- */
.cite {
  font-size: .72em; vertical-align: super; line-height: 0; text-decoration: none; font-weight: 700;
  padding: 0 .15em; white-space: nowrap;
}
.cite::before { content: "["; }
.cite::after { content: "]"; }

/* ---------- Alternatives database ---------- */
.filters {
  display: grid; gap: 1rem; grid-template-columns: 1fr; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.field label, .field .field-label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: .35rem; }
.field input[type="search"], .field select {
  width: 100%; font: inherit; font-size: 1rem; padding: .6rem .75rem; border-radius: 8px;
  border: 1px solid #8792aa; background: var(--bg); color: var(--text);
}
.filter-toggles { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; grid-column: 1 / -1; }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; font-weight: 550; cursor: pointer; }
.checkbox input { width: 1.15rem; height: 1.15rem; accent-color: var(--eu-blue); }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.chip {
  font: inherit; font-size: .88rem; font-weight: 600; padding: .4rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--eu-blue); border-color: var(--eu-blue); color: #fff; }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.results-count { font-weight: 650; }

.company-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.company { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.3rem; min-width: 0; overflow-wrap: anywhere; }
.company details a { word-break: break-all; }
.company[hidden] { display: none; }
.company-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; flex-wrap: wrap; }
.company h3 { margin: 0; font-size: 1.15rem; }
.company .hq { font-size: .9rem; color: var(--text-muted); margin: 0; }
.company .desc { font-size: .95rem; margin: 0; }
.class-badge { font-size: .72rem; font-weight: 750; padding: .25rem .55rem; border-radius: 6px; border: 1px solid; max-width: 100%; }
.class-eu-hq { color: var(--accent); background: var(--muted-blue-soft); }
.class-european-hq { color: var(--accent); background: transparent; }
.class-european-subsidiary { color: var(--ok); background: var(--ok-bg); }
.class-european-open-source { color: var(--ok); background: transparent; }
.class-mixed { color: var(--warn); background: var(--warn-bg); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: .75rem; font-weight: 650; padding: .15rem .5rem; border-radius: 4px; background: var(--grey-100); color: var(--text-muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; font-size: .88rem; margin: 0; }
.facts dt { color: var(--text-muted); font-weight: 600; }
.facts dd { margin: 0; }
.company details { font-size: .88rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.company details summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.company details ul { padding-left: 1.1rem; margin: .4rem 0 0; }
.company-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: .6rem; }
.company-foot a { font-weight: 650; font-size: .9rem; }
.empty-state { padding: 2rem; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; counter-reset: chk; }
.checklist-group { margin-bottom: 2rem; }
.checklist-group h3 { border-bottom: 2px solid var(--eu-blue); padding-bottom: .4rem; }
.checklist li { counter-increment: chk; border-bottom: 1px solid var(--border); }
.checklist label { display: flex; gap: .85rem; align-items: flex-start; padding: .7rem .25rem; cursor: pointer; }
.checklist input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; flex: none; accent-color: var(--eu-blue); }
.checklist .why { display: block; font-size: .88rem; color: var(--text-muted); }
.checklist-progress { font-weight: 650; }
.print-only { display: none; }

/* ---------- Assessment ---------- */
.assess-q { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 0 0 .9rem; background: var(--surface); }
.assess-q legend { font-weight: 650; padding: 0 .35rem; margin-left: -.35rem; }
.assess-q .hint { font-size: .88rem; color: var(--text-muted); margin: .1rem 0 .6rem; }
.assess-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.assess-options label { position: relative; }
.assess-options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.assess-options span { display: inline-block; padding: .45rem .9rem; border: 1px solid #8792aa; border-radius: 999px; font-size: .93rem; font-weight: 600; background: var(--bg); }
.assess-options input:checked + span { background: var(--eu-blue); border-color: var(--eu-blue); color: #fff; }
.assess-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.assess-group-title { margin-top: 2rem; }
.result { border-radius: var(--radius); padding: 1.5rem; border: 2px solid var(--border); background: var(--surface); margin-top: 1.5rem; }
.result:focus { outline: none; }
.result-level { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: .02em; margin: .25rem 0 .75rem; }
.result[data-level="low"] { border-color: var(--ok); }
.result[data-level="low"] .result-level { color: var(--ok); }
.result[data-level="medium"] { border-color: var(--muted-blue); }
.result[data-level="medium"] .result-level { color: var(--accent); }
.result[data-level="high"] { border-color: #c48a00; }
.result[data-level="high"] .result-level { color: var(--warn); }
.result[data-level="strategic"] { border-color: var(--risk); }
.result[data-level="strategic"] .result-level { color: var(--risk); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: .5rem 0 1rem; max-width: 420px; }
.meter span { height: 10px; border-radius: 3px; background: var(--grey-200); }
.meter-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 420px; font-size: .72rem; color: var(--text-muted); font-weight: 650; }
.result[data-level="low"] .meter span:nth-child(-n+1),
.result[data-level="medium"] .meter span:nth-child(-n+2),
.result[data-level="high"] .meter span:nth-child(-n+3),
.result[data-level="strategic"] .meter span:nth-child(-n+4) { background: var(--fill); }
.reasons li { margin-bottom: .35rem; }

/* ---------- Sources ---------- */
.source-list { list-style: none; padding: 0; margin: 0; }
.source { padding: 1rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 90px; }
.source:target { background: var(--warn-bg); outline: 2px solid var(--eu-yellow); outline-offset: 4px; border-radius: 4px; }
.source h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.source p { margin: .15rem 0; font-size: .92rem; }
.source .meta { color: var(--text-muted); font-size: .85rem; }
.source .src-url { word-break: break-all; font-size: .85rem; }

/* ---------- Numbered question cards ---------- */
.ot-questions { list-style: none; padding: 0; counter-reset: otq; }
.ot-questions li { counter-increment: otq; display: flex; gap: .75rem; align-items: baseline; font-weight: 550; padding: 1rem 1.2rem; }
.ot-questions li::before { content: counter(otq); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--eu-yellow); color: var(--navy); font-weight: 800; font-size: .9rem; }

/* ---------- Misc ---------- */
a.card { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card h3 { color: var(--link); }
a.card:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { a.card:hover { transform: translateY(-2px); } }
.h3 { font-size: 1.2rem; }
.mt-2 { margin-top: 2rem; }
.mt-1 { margin-top: 1rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.note { font-size: .9rem; color: var(--text-muted); }
.kbd-list { columns: 2 260px; }
.stat-free {
  border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .9rem; color: var(--text-muted);
}
noscript .callout, .noscript { display: block; }
[hidden] { display: none !important; }
.anchor-target { scroll-margin-top: 90px; }
section[id], h2[id], h3[id] { scroll-margin-top: 90px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c3cbe0; padding: 3rem 0 2rem; font-size: .95rem; }
.site-footer a { color: #e8ecf6; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.footer-bottom { border-top: 1px solid #26345f; margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-brand { display: flex; gap: .6rem; align-items: center; color: #fff; font-weight: 750; margin-bottom: .75rem; }
.footer-brand svg { width: 30px; height: 30px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 16mm; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .site-header, .site-footer, .skip-link, .btn-row, .no-print, .nav-toggle, .chip-row, .filters, .hero-ring { display: none !important; }
  .print-only { display: block; }
  .page-hero, .hero, .section-dark { background: #fff !important; color: #000 !important; padding: 0 0 1rem; }
  .page-hero .lead, .hero .lead { color: #333 !important; }
  .section { padding: 1rem 0; }
  .section-alt { background: #fff; }
  .card, .explorer-panel, .result { box-shadow: none; border-color: #999; }
  a { color: #000; }
  .checklist li { break-inside: avoid; }
  .checklist input { appearance: none; -webkit-appearance: none; width: 12pt; height: 12pt; border: 1.5pt solid #000; border-radius: 2pt; }
  .checklist input:checked { background: #000; }
  .company, .source, .assess-q { break-inside: avoid; }
  details > *:not(summary) { display: block !important; }
}

/* ---------- Language switcher ---------- */
.lang-bar { background: var(--navy); color: #dfe6f5; font-size: .8125rem; line-height: 1; }
.lang-switch { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; min-height: 34px; }
.lang-icon { width: 16px; height: 16px; flex: none; opacity: .85; }
.lang-switch ul { display: flex; flex-wrap: wrap; gap: .1rem; margin: 0; padding: 0; list-style: none; }
.lang-switch a { display: inline-block; padding: .4rem .5rem; border-radius: 6px; color: #dfe6f5; text-decoration: none; }
.lang-switch a:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: underline; }
.lang-switch a:focus-visible { outline: 2px solid var(--eu-yellow); outline-offset: 1px; }
.lang-switch a[aria-current] { color: #fff; background: rgba(255, 255, 255, .16); font-weight: 650; }
.lang-switch .lang-code { display: none; }
@media (max-width: 640px) {
  .lang-switch .lang-code { display: inline; }
  .lang-switch .lang-name {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .lang-switch li { position: relative; }
}
@media print { .lang-bar { display: none !important; } }

/* Long compound words (German, Polish, …) must not push headings off small screens. */
h1, h2, h3, h4 { overflow-wrap: break-word; }
html:not([lang="en"]) h1, html:not([lang="en"]) h2 { hyphens: auto; }

/* ---------- Worked example: firewall cost of ownership ---------- */
.tco { margin: 1rem 0 0; }
.tco-shared { max-width: 26rem; margin-bottom: 1rem; }
.tco-shared input[type="range"] { width: 100%; accent-color: var(--accent); }
.tco-shared output { font-weight: 700; }
.tco-offers { display: grid; gap: 1rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tco-offer { margin: 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.tco-offer legend { font-weight: 700; padding: 0 .35rem; }
.tco-offer .field { margin-bottom: .75rem; }
.tco-offer label { display: block; font-size: .9rem; margin-bottom: .25rem; }
.tco-offer input { width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.tco-result .num, .per100 .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tco-result tfoot th, .tco-result tfoot td, .per100 tfoot th, .per100 tfoot td { font-weight: 700; }
.per100 caption { caption-side: top; text-align: left; font-weight: 700; padding: .75rem 1rem .25rem; }
.scenario h3 { margin-bottom: .5rem; }
.scenario p { margin-bottom: .6rem; }

/* ---------- Worked example: what comes back to Europe ---------- */
.stat-card .stat-label { font-weight: 650; margin-bottom: .25rem; }
.stat-card .stat-value { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; color: var(--accent); margin: 0 0 .35rem; font-variant-numeric: tabular-nums; }
.stat-card .stat-note { font-size: .9rem; color: var(--text-muted); margin: 0; }
.europe-table td { min-width: 16rem; }
.europe-table td strong { display: block; font-size: 1.05rem; }
.europe-table .where { display: flex; align-items: center; gap: .5rem; margin: .35rem 0 .4rem; }
.europe-table .where .scale-label { font-size: .85rem; font-weight: 600; }
.europe-table .where .scale { width: 64px; flex: none; }
.europe-table .where .scale-label { margin-top: 0; }
