@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("vendor/fonts/montserrat-latin-700-normal.woff2") format("woff2");
}
:root {
  /* Interreg / EU corporate colours (Communication Guide §2.2, §5.2.2, §5.4) */
  --reflex: #003399;     /* Pantone Reflex Blue: programme name, separator line */
  --po1: #18baa8;        /* Policy Objective 1 "A smarter Europe": project name */
  /* Height of the programme logo file; the EU flag is 33.6 % of it. Partner logos may not be taller
     than the flag (Annex IX §7), so their cap is derived from the same variable. */
  --brand-h: 96px;
  --emblem-h: calc(var(--brand-h) * 0.336);
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #637087;
  --line: #e3e7ee;
  --accent: #003399;
  --accent-soft: #e6ecf8;
  --gr: #1f5fbf;
  --it: #138a4b;
  --other: #9aa3b2;
  --warn: #b26a00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.lockup { display: flex; align-items: center; gap: 14px; padding: 6px 0; color: inherit; }
.lockup:hover { text-decoration: none; }
.programme-logo { height: var(--brand-h); width: auto; display: block; margin: -10px 0; }
.lockup-rule { width: 1px; align-self: stretch; background: var(--reflex); margin: 4px 0; }
.project-name { font-family: "Montserrat", Arial, sans-serif; font-weight: 700; color: var(--po1);
  font-size: 1.35rem; line-height: 1.05; letter-spacing: .01em; display: flex; flex-direction: column; }
.project-name small { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--reflex); margin-top: 3px; }
.logo-missing { display: inline-flex; align-items: center; height: calc(var(--brand-h) * .6); padding: 0 .8rem; border: 1px dashed var(--reflex);
  border-radius: 6px; color: var(--reflex); font-size: .75rem; max-width: 220px; }
.reflex { color: var(--reflex); font-weight: 600; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav a { padding: .45rem .75rem; border-radius: 8px; color: var(--ink); font-weight: 500; }
nav a:hover { background: var(--bg); text-decoration: none; }
nav a.active { background: var(--accent-soft); color: var(--accent); }

.page { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 176px; width: 100%; }
main { padding: 1.25rem; min-width: 0; }
.partners { background: var(--panel); border-left: 1px solid var(--line); padding: 1rem .9rem;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  position: sticky; top: var(--header-h, 88px); align-self: start; max-height: calc(100vh - var(--header-h, 88px)); overflow-y: auto; }
.partners-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--reflex); font-weight: 700; text-align: center; }
.partners-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: .3rem;
  width: 100%; text-align: center; border-top: 1px solid var(--line); padding-top: .5rem; }
.partner { display: flex; justify-content: center; width: 100%; padding: .2rem 0; }
.partner img { max-height: calc(var(--emblem-h) - 1px); max-width: 140px; width: auto; height: auto; display: block; }
.partner:hover img { opacity: .8; }
@media (max-width: 900px) {
  :root { --brand-h: 72px; }
  .page { grid-template-columns: 1fr; }
  .partners { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; justify-content: center;
    border-left: 0; border-top: 1px solid var(--line); }
  .partner { width: auto; }
  .partners-title, .partners-role { width: 100%; }
}
.foot { color: var(--muted); font-size: .82rem; padding: 1rem 1.25rem; border-top: 3px solid var(--reflex); background: var(--panel); }
.foot .funding { max-width: 1100px; color: var(--ink); }
.foot .funding p { margin: 0 0 .4rem; }
.foot-links { margin-top: .4rem; }
.about-hero { border-left: 4px solid var(--po1); }
.facts-wide { grid-template-columns: max-content 1fr; }
.partner-list { margin: 0; padding-left: 1.1rem; }
.partner-list li { margin: .2rem 0; }
.loading { color: var(--muted); padding: 2rem; }

.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); min-width: 0; }
.kpi .v { font-size: 1.6rem; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.lead { color: var(--muted); max-width: 70ch; margin: 0 0 1rem; }

.bars { display: grid; gap: .35rem; }
.bar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: .5rem; align-items: center; font-size: .88rem; }
.bar .track { background: var(--bg); border-radius: 4px; height: 14px; display: flex; overflow: hidden; }
.bar .seg { height: 100%; }
.bar .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .4rem 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }

.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.stage { border: 1px dashed var(--line); border-radius: 8px; padding: .6rem; font-size: .85rem; background: var(--bg); }
.stage b { display: block; margin-bottom: .2rem; }

.split { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
#map, #cy { height: 68vh; min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); background: #eef2f5; }
#map { background: #dce8f0; }
.controls { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.controls select { max-width: 300px; }
select, input[type=search], input[type=text] { font: inherit; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
label.chk { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; }
button, .btn { font: inherit; padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: .08rem .45rem; border-radius: 999px; font-size: .75rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.gr { color: var(--gr); border-color: #c9daf5; background: #eef4fd; }
.badge.it { color: var(--it); border-color: #c6e8d5; background: #edf8f2; }
.badge.src { color: var(--accent); border-color: #c4e2ec; background: var(--accent-soft); }
.badge.warn { color: var(--warn); border-color: #f0d9b5; background: #fdf6ea; }
.badge.focus { color: #7a3fb0; border-color: #e1cff2; background: #f6effc; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.claims { display: grid; gap: .5rem; }
.claim-row { display: grid; grid-template-columns: 210px 1fr; gap: .6rem; font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
@media (max-width: 600px) { .claim-row { grid-template-columns: 1fr; } }
.claim-row .k { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .45rem; font-size: .82rem; }
.quote { font-style: italic; color: var(--ink); background: var(--bg); border-left: 3px solid var(--line); padding: .3rem .6rem; border-radius: 4px; }

.opp { display: grid; gap: .3rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.opp .pair { font-weight: 600; }
.opp .why { display: flex; flex-wrap: wrap; gap: .3rem; }
.score { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.panel-empty { color: var(--muted); font-size: .9rem; }
.leaflet-popup-content { font-family: inherit; }
.region-label { font-size: .8rem; }

.legal { max-width: 860px; }
.legal h2 { margin-top: 1.4rem; }
.legal p, .legal li { line-height: 1.55; }
.draft-banner { border-color: #f0d9b5; background: #fdf6ea; color: #7a4a00; margin-bottom: .8rem; }
.project-name { white-space: nowrap; }
@media (max-width: 480px) { .project-name { font-size: 1.1rem; } }

/* About: partnership tiles. Section logo is larger than the header logo; tile logos are capped at its
   EU-flag height (33.6 % of the logo file height), keeping the emblem the largest logo (Annex IX §7). */
.partnership { --about-brand-h: 170px; }
.partnership-brand { height: var(--about-brand-h); width: auto; display: block; margin: -24px 0 -8px -14px; max-width: 100%; object-fit: contain; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: var(--panel); }
.tile.lead { border-color: var(--po1); box-shadow: 0 0 0 1px var(--po1) inset; }
.tile-logo { height: calc(var(--about-brand-h) * .336 + 36px); display: flex; align-items: center; justify-content: center;
  padding: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.tile-logo img { max-height: calc(var(--about-brand-h) * .336 - 1px); max-width: 100%; width: auto; height: auto; }
.tile-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.tile-title { font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; font-weight: 600; }
.tile-links { margin-top: auto; display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }

/* Map: persistent, interactive type legend above the details panel */
.side-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.legend-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.legend-head h2 { margin: 0; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-size: .85rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.legend-list { display: flex; flex-direction: column; gap: 2px; margin-top: .4rem; }
.legend-item { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: .5rem; width: 100%;
  text-align: left; border: 1px solid transparent; border-radius: 6px; background: none; padding: .3rem .45rem;
  font-size: .86rem; color: var(--ink); cursor: pointer; transition: opacity .15s, background .15s; }
.legend-item .dot { margin: 0; }
.legend-item:hover { background: var(--bg); }
.legend-item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.legend-item.dimmed { opacity: .5; }
.legend-n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }

.legend-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .7rem 0 .1rem .45rem; }
.line-swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }

/* Network: "how to read" key */
.howto summary { cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary h2 { display: inline; }
.howto summary::after { content: "▾"; color: var(--muted); margin-left: .4rem; }
.howto:not([open]) summary::after { content: "▸"; }
.key { display: grid; grid-template-columns: 46px 1fr; gap: .55rem .6rem; margin: .7rem 0; font-size: .86rem; align-items: start; }
.key dt { display: flex; align-items: center; justify-content: center; min-height: 20px; margin: 0; }
.key dd { margin: 0; line-height: 1.4; }
.key-sw { display: inline-flex; align-items: center; gap: 4px; }
.key-sw .line-swatch { width: 26px; }
.key-sw.sizes i { display: inline-block; border-radius: 50%; background: #9aa3b2; }
.key-sw.sizes i:nth-child(1) { width: 6px; height: 6px; }
.key-sw.sizes i:nth-child(2) { width: 11px; height: 11px; }
.key-sw.sizes i:nth-child(3) { width: 17px; height: 17px; }
