/* ============================================================
   AI Act Browser
   Type    : Open Sans + IBM Plex — serif is the law, sans is the tool,
             mono is the citation machinery.
   Colour  : EU institutional blue anchors the interface; the four
             node types use a categorical palette validated for
             colour-vision deficiency at all pairs, in both modes.
   ============================================================ */

/* Open Sans is hosted with the application: the reader makes no runtime
   request to a third-party font service. The Latin-extended face covers the
   German text and the Latin face keeps the everyday UI payload compact. */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/open-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-serif-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-serif-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-serif-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-600.woff2") format("woff2");
}

:root {
  /* surfaces & ink */
  --paper:      #FBFBF9;
  --panel:      #FFFFFF;
  --sunk:       #F2F2EE;
  --ink:        #14161C;
  --ink-2:      #464C5A;
  --ink-3:      #656B78;
  --rule:       #E4E4DD;
  --rule-2:     #EFEFE9;
  --line:       var(--rule);

  /* node types — validated, all pairs, light surface */
  --c-article:    #1F4FCC;
  --c-recital:    #A65300;
  --c-annex:      #007A69;
  --c-definition: #A30877;
  --c-guidance:   #6A40D8;
  --c-kimig:      #7D5800;
  --c-gdpr:       #17412C;
  --c-module:     #8A3D15;
  --c-external:   #767C8A;

  --c-article-bg:    #1F4FCC14;
  --c-recital-bg:    #CC6F0014;
  --c-annex-bg:      #00A38C14;
  --c-definition-bg: #A3087714;
  --c-guidance-bg:   #6A40D814;
  --c-kimig-bg:      #7D580014;
  --c-gdpr-bg:       #17412C14;
  --c-module-bg:     #8A3D1514;
  --c-external-bg:   #767C8A14;

  /* instruments — colour says which regulation a provision belongs to;
     shape says what kind of provision it is. The four DORA documents share
     one hue because they are one body of law, and so do the two BaFin texts. */
  --c-act-aia:   #1F4FCC;
  --c-act-gdpr:  #00806B;
  --c-act-dora:  #A65300;
  --c-act-bafin: #A30877;
  --c-act-kimig: #6A40D8;
  --c-act-ext:   #767C8A;

  --c-act-aia-bg:   #1F4FCC14;
  --c-act-gdpr-bg:  #00806B14;
  --c-act-dora-bg:  #A6530014;
  --c-act-bafin-bg: #A3087714;
  --c-act-kimig-bg: #6A40D814;
  --c-act-ext-bg:   #767C8A14;

  --accent:     var(--c-article);
  --focus:      #1F4FCC;

  /* type */
  --sans:  "Open Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail-l: 286px;
  --rail-r: 384px;
  --top: 58px;

  --shadow: 0 1px 2px #14161c0d, 0 8px 24px -12px #14161c24;
  --shadow-lg: 0 2px 8px #14161c14, 0 24px 64px -24px #14161c3d;
}

[data-theme="dark"] {
  --paper:  #16171A;
  --panel:  #1D1E22;
  --sunk:   #232429;
  --ink:    #EDEDE8;
  --ink-2:  #A9ADB6;
  --ink-3:  #7B808B;
  --rule:   #2E3036;
  --rule-2: #26282D;

  /* validated against the dark surface — not a flip of the light steps */
  --c-article:    #718BFF;
  --c-recital:    #AF8600;
  --c-annex:      #00AD7F;
  --c-definition: #DD70B4;
  --c-guidance:   #9678EC;
  --c-kimig:      #FEC748;
  --c-gdpr:       #A7D8C1;
  --c-module:      #F59E72;
  --c-external:    #A5AAB4;

  --c-act-aia:   #718BFF;
  --c-act-gdpr:  #2FBD9A;
  --c-act-dora:  #E0A040;
  --c-act-bafin: #DD70B4;
  --c-act-kimig: #9678EC;
  --c-act-ext:   #A5AAB4;

  --c-act-aia-bg:   #718BFF24;
  --c-act-gdpr-bg:  #2FBD9A24;
  --c-act-dora-bg:  #E0A04024;
  --c-act-bafin-bg: #DD70B424;
  --c-act-kimig-bg: #9678EC24;
  --c-act-ext-bg:   #A5AAB424;

  --c-article-bg:    #4D68DC24;
  --c-recital-bg:    #AF860024;
  --c-annex-bg:      #00AD7F24;
  --c-definition-bg: #B93C8C24;
  --c-guidance-bg:   #9678EC24;
  --c-kimig-bg:      #FEC74824;
  --c-gdpr-bg:       #A7D8C124;
  --c-module-bg:      #F59E7224;
  --c-external-bg:    #A5AAB424;

  --focus: #7B93F0;
  --shadow: 0 1px 2px #0006, 0 8px 24px -12px #0009;
  --shadow-lg: 0 2px 8px #0007, 0 24px 64px -24px #000b;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

button { font: inherit; color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px;
}
.skip:focus { left: 8px; top: 8px; }

/* ── top bar ───────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top);
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: none;
}
.brand-mark {
  width: 26px; height: 26px; flex: none;
  fill: none; stroke: var(--accent); stroke-width: 1.6;
}
.brand-mark circle { fill: var(--paper); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text i {
  font-family: var(--mono); font-style: normal;
  font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.01em;
}

/* search ------------------------------------------------------ */

.search { position: relative; flex: 1; max-width: 620px; }

.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; pointer-events: none;
  fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round;
}

#q {
  width: 100%; height: 36px;
  padding: 0 40px 0 34px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--sunk);
  border: 1px solid transparent;
  border-radius: 8px;
}
#q::placeholder { color: var(--ink-3); }
#q:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}
#q::-webkit-search-cancel-button { display: none; }

.hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 1px 5px; pointer-events: none;
}
#q:focus ~ .hint { display: none; }

.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: min(62vh, 540px); overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 50;
}
.res {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: 8px 10px; border-radius: 7px;
}
.res:hover, .res.is-cursor { background: var(--sunk); }
.res-top { display: flex; align-items: baseline; gap: 8px; }
.res-id {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  flex: none; letter-spacing: -0.01em;
}
.res-title {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.res-snip {
  font-family: var(--serif); font-size: 12.5px; color: var(--ink-2);
  margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.res-snip mark, .doc mark {
  background: color-mix(in srgb, var(--c-recital) 26%, transparent);
  color: inherit; border-radius: 2px; padding: 0 1px;
}
.res-empty { padding: 18px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* buttons ----------------------------------------------------- */

.topbar-actions { display: flex; gap: 8px; flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.btn:hover { background: var(--sunk); border-color: var(--ink-3); }
.btn.is-current { background: var(--c-article-bg); border-color: var(--accent); color: var(--accent); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.btn svg circle { fill: currentColor; stroke: none; }
.btn-icon { width: 34px; padding: 0; justify-content: center; }
.btn-icon svg circle { fill: none; }

.icon-btn {
  width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── layout ────────────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  align-items: start;
}

.rail {
  position: sticky; top: var(--top);
  height: calc(100vh - var(--top));
  display: flex; flex-direction: column;
  min-width: 0;
}
.rail-left  { border-right: 1px solid var(--rule); }
.rail-right { border-left: 1px solid var(--rule); }

/* ── contents rail ─────────────────────────────────────────── */

/* which document the rail shows: the Act, or one attached to it */
.doc-pick { position: relative; flex: none; padding: 8px 8px 2px; }
.doc-pick.is-alone { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.doc-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; text-align: left;
}
.doc-btn:hover, .doc-btn[aria-expanded="true"] { background: var(--sunk); }
.doc-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.doc-face { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; line-height: 1.3; }
.doc-face b { font-size: 13px; font-weight: 600; }
/* the badge drops to its own line rather than cut the subtitle short */
.doc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; min-width: 0; }
.doc-sub i {
  font-family: var(--mono); font-style: normal;
  font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.01em;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-sub .gdoc-badge { flex: none; }
.doc-dot { flex: none; align-self: flex-start; margin-top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.doc-caret {
  flex: none; width: 12px; height: 12px; transform: rotate(90deg);
  fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .15s ease;
}
.doc-btn[aria-expanded="true"] .doc-caret { transform: rotate(-90deg); }

.doc-menu {
  position: absolute; top: calc(100% + 2px); left: 8px; right: 8px;
  max-height: 70vh; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 50;
}
.doc-group {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3);
  padding: 9px 8px 4px;
}
.doc-menu > :first-child > .doc-group { padding-top: 4px; }
.doc-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
}
.doc-opt:hover, .doc-opt:focus { background: var(--sunk); outline: none; }
.doc-opt:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.doc-opt[aria-selected="true"] .doc-face b { color: var(--accent); }

.rail-tabs {
  display: flex; flex: none;
  padding: 0 8px;
  border-bottom: 1px solid var(--rule);
  gap: 2px;
}
.rail-tab {
  flex: 1;
  background: none; border: 0; cursor: pointer;
  padding: 11px 2px 9px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.rail-tabs[hidden] { display: none; }
.rail-tab:hover { color: var(--ink); }
.rail-tab.is-on { color: var(--ink); border-bottom-color: var(--accent); }

.rail-body { flex: 1; overflow-y: auto; padding: 10px 8px 40px; }

.chap { margin-bottom: 2px; }
.chap-btn {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  background: none; border: 0; cursor: pointer;
  padding: 7px 8px; border-radius: 7px;
  text-align: left;
}
.chap-btn:hover { background: var(--sunk); }
.chap-num {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  color: var(--ink-3); padding-top: 2px; flex: none; width: 26px;
}
.chap-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.chap-caret {
  margin-left: auto; flex: none; width: 12px; height: 12px; margin-top: 4px;
  fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round;
  transition: transform .16s;
}
.chap.is-open .chap-caret { transform: rotate(90deg); }
.chap-list { display: none; padding: 2px 0 8px 8px; }
.chap.is-open .chap-list { display: block; }

.sec-name {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3);
  padding: 10px 8px 4px 12px;
}

.tl {
  display: flex; gap: 8px; width: 100%;
  background: none; border: 0; cursor: pointer;
  padding: 5px 8px 5px 12px; border-radius: 6px;
  text-align: left; color: var(--ink-2);
  border-left: 2px solid transparent;
}
.tl:hover { background: var(--sunk); color: var(--ink); }
.tl.is-on {
  background: var(--c-article-bg);
  color: var(--ink); font-weight: 500;
  border-left-color: var(--accent);
}
.tl-num {
  font-family: var(--mono); font-size: 11px; flex: none;
  min-width: 26px; color: var(--ink-3);
}
.tl.is-on .tl-num { color: var(--accent); }
.tl-name { font-size: 12.5px; line-height: 1.35; }

/* ── reader ────────────────────────────────────────────────── */

.reader { min-width: 0; }

/* Portal-wide views compare several instruments, so document-specific rails
   yield the canvas to the comparison instead of competing with it. */
.portal-wide .layout { grid-template-columns: minmax(0, 1fr); }
.portal-wide .rail-left, .portal-wide .rail-right { display: none; }
.portal-wide .doc { max-width: 1440px; }
.changes-wide .doc { max-width: 74ch; }
.timeline-wide .doc { max-width: 78ch; }
.portal-wide .rail-toggle, .portal-wide .links-toggle { display: none; }

.doc {
  max-width: 74ch;
  margin: 0 auto;
  padding: 40px 40px 30vh;
}

.boot { padding: 80px 0; text-align: center; color: var(--ink-3); }
.boot-bar {
  height: 2px; background: var(--rule); border-radius: 2px;
  overflow: hidden; margin-bottom: 16px;
}
.boot-bar span {
  display: block; height: 100%; width: 30%;
  background: var(--accent);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* breadcrumb + title ------------------------------------------ */

.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3);
  margin-bottom: 18px;
}
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb i { font-style: normal; opacity: .5; }

.kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  margin-bottom: 14px;
}
.kicker::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

h1.doc-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.doc-num {
  font-family: var(--mono);
  font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  margin: 0 0 20px;
}

/* a document home: its name in the other language, then the key facts */
.doc-alt {
  font-family: var(--serif); font-style: italic;
  font-size: 15px; color: var(--ink-2); line-height: 1.45;
  margin: -12px 0 16px;
}
.doc-facts {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  list-style: none; margin: 0 0 8px; padding: 0;
  font-size: 12.5px; color: var(--ink-3);
}
.doc-facts b { color: var(--ink); font-weight: 600; }
.doc-facts a { color: var(--c); }

/* part numbers take their document's colour */
.chapgrid[data-type] .chapcard-n { color: var(--c); }

.meta {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--panel);
  margin-bottom: 32px; overflow: hidden;
}
.meta-cell {
  flex: 1 1 0; min-width: 110px;
  padding: 10px 14px;
  border-right: 1px solid var(--rule-2);
}
.meta-cell:last-child { border-right: 0; }
.meta-k {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 3px;
}
.meta-v { font-family: var(--mono); font-size: 14px; font-weight: 500; }

/* the law itself ---------------------------------------------- */

.lawtext { font-family: var(--serif); font-size: 17px; line-height: 1.66; }
.lawtext .doc-p { margin: 0 0 1em; }
.lawtext .doc-h {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-2);
  margin: 2em 0 .8em;
}

.para { position: relative; scroll-margin-top: calc(var(--top) + 16px); }
.para::before {
  content: attr(data-para);
  position: absolute; left: -34px; top: 3px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--ink-3);
  opacity: 0; transition: opacity .15s;
}
.para:hover::before { opacity: 1; }
.para.is-hit, .point.is-hit {
  background: color-mix(in srgb, var(--c-recital) 13%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c-recital) 13%, transparent);
  border-radius: 2px;
}

.point { display: flex; gap: 10px; margin: 0 0 .75em; }
.point-nested { margin-left: 26px; }
.point-marker {
  flex: none; min-width: 26px;
  font-family: var(--mono); font-size: 13.5px;
  color: var(--ink-3); padding-top: 3px;
}
.point-body { min-width: 0; flex: 1; }
.point-body > .doc-p:last-child { margin-bottom: 0; }

/* inline citation links inserted by the app */
.xref {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  white-space: nowrap;
}
.xref:hover { border-bottom-color: currentColor; background: var(--c-article-bg); }
.xref[data-type="annex"] { color: var(--c-annex); border-bottom-color: color-mix(in srgb, var(--c-annex) 35%, transparent); }
.xref[data-type="annex"]:hover { background: var(--c-annex-bg); }
.xref[data-type="recital"] { color: var(--c-recital); border-bottom-color: color-mix(in srgb, var(--c-recital) 35%, transparent); }
.xref[data-type="recital"]:hover { background: var(--c-recital-bg); }
.xref[data-type="guidance"] { color: var(--c-guidance); border-bottom-color: color-mix(in srgb, var(--c-guidance) 35%, transparent); }
.xref[data-type="guidance"]:hover { background: var(--c-guidance-bg); }
.xref[data-type="kimig"] { color: var(--c-kimig); border-bottom-color: color-mix(in srgb, var(--c-kimig) 35%, transparent); }
.xref[data-type="kimig"]:hover { background: var(--c-kimig-bg); }
.xref[data-type="gdpr"] { color: var(--c-gdpr); border-bottom-color: color-mix(in srgb, var(--c-gdpr) 35%, transparent); }
.xref[data-type="gdpr"]:hover { background: var(--c-gdpr-bg); }
.xref[data-type="definition"] { color: var(--c-definition); border-bottom-color: color-mix(in srgb, var(--c-definition) 35%, transparent); }
.xref[data-type="definition"]:hover { background: var(--c-definition-bg); }

.term {
  color: var(--c-definition);
  border-bottom: 1px dotted color-mix(in srgb, var(--c-definition) 60%, transparent);
  cursor: help;
}
.term:hover { background: var(--c-definition-bg); }

sup.fn {
  font-family: var(--sans); font-size: 9.5px; font-weight: 600;
  color: var(--ink-3); cursor: help;
  padding: 0 1px; vertical-align: super; line-height: 0;
}
sup.fn::before { content: "("; }
sup.fn::after { content: ")"; }
sup.fn:hover { color: var(--accent); }

/* ── sections below the text ───────────────────────────────── */

.block { margin-top: 40px; }

.block-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.block-head h2 {
  font-size: 12px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; margin: 0;
}
.block-count {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--ink-3);
  background: var(--sunk); border-radius: 999px; padding: 1px 7px;
}
.block-note {
  font-size: 11.5px; color: var(--ink-3); margin-left: auto;
}

/* recitals — the layer both source sites leave out */

.rec {
  border-bottom: 1px solid var(--rule-2);
}
.rec-btn {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 13px 4px;
}
.rec-btn:hover { background: var(--sunk); }
.rec-n {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--c-recital); flex: none; padding-top: 2px;
  min-width: 34px;
}
.rec-lede {
  font-family: var(--serif); font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2); min-width: 0;
}
.rec:not(.is-open) .rec-lede {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec.is-open .rec-lede { display: none; }
.rec-full { display: none; padding: 0 4px 18px 50px; }
.rec.is-open .rec-full { display: block; }
.rec-full .doc-p, .rec-full .point-body {
  font-family: var(--serif); font-size: 15.5px; line-height: 1.62;
}
.rec-open {
  margin-left: auto; flex: none; align-self: center;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}
.rec-why {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; flex: none; align-self: center;
  border: 1px solid var(--rule);
  color: var(--ink-3);
}
.rec-why[data-k="explains"] {
  color: var(--c-recital);
  border-color: color-mix(in srgb, var(--c-recital) 40%, transparent);
  background: var(--c-recital-bg);
}
.rec-goto {
  display: inline-block; margin-top: 4px;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  text-decoration: none;
}
.rec-goto:hover { text-decoration: underline; }

/* connection lists */

.links { display: flex; flex-direction: column; }
.link {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 6px; border-radius: 7px;
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
  border-bottom: 1px solid var(--rule-2);
}
.link:hover { background: var(--sunk); }
/* An id chip says both things the graph says: its glyph is the kind of
   provision, its colour the instrument. Learn the shapes here and the graph
   needs no legend. */
.link-id {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  flex: none; min-width: 78px;
  display: inline-flex; align-items: center; gap: 5px;
}
.link-id .lg-glyph, .res-id .lg-glyph { width: 9px; height: 9px; fill: currentColor; }
.res-id { display: inline-flex; align-items: center; gap: 5px; }
.link-title {
  font-size: 13px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-kind {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}

.empty {
  font-size: 13px; color: var(--ink-3);
  padding: 16px 4px; font-style: italic;
}

/* type colours applied by data-type */
[data-type="article"]    { --c: var(--c-article); }
[data-type="recital"]    { --c: var(--c-recital); }
[data-type="annex"]      { --c: var(--c-annex); }
[data-type="definition"] { --c: var(--c-definition); }
[data-type="guidance"]   { --c: var(--c-guidance); }
[data-type="kimig"]      { --c: var(--c-kimig); }
[data-type="gdpr"]       { --c: var(--c-gdpr); }
[data-type="module"]     { --c: var(--c-module); }
[data-type="external"]   { --c: var(--c-external); }
/* instrument colours override the type fallback above — same specificity,
   later rule wins, so a chip carrying both reads as its regulation. */
[data-corpus="aia"]   { --c: var(--c-act-aia); }
[data-corpus="gdpr"]  { --c: var(--c-act-gdpr); }
[data-corpus="dora"]  { --c: var(--c-act-dora); }
[data-corpus="bafin"] { --c: var(--c-act-bafin); }
[data-corpus="kimig"] { --c: var(--c-act-kimig); }
[data-corpus="ext"]   { --c: var(--c-act-ext); }

.kicker[data-type], .link-id[data-type], .res-id[data-type] { color: var(--c); }
.kicker[data-corpus], .link-id[data-corpus], .res-id[data-corpus] { color: var(--c); }
.kicker[data-type="article"]    { background: var(--c-article-bg); }
.kicker[data-type="recital"]    { background: var(--c-recital-bg); }
.kicker[data-type="annex"]      { background: var(--c-annex-bg); }
.kicker[data-type="definition"] { background: var(--c-definition-bg); }
.kicker[data-type="guidance"]   { background: var(--c-guidance-bg); }
.kicker[data-type="kimig"]      { background: var(--c-kimig-bg); }
.kicker[data-type="gdpr"]       { background: var(--c-gdpr-bg); }
.kicker[data-type="module"]      { background: var(--c-module-bg); }
.kicker[data-type="external"]    { background: var(--c-external-bg); }
.kicker[data-corpus="aia"]   { background: var(--c-act-aia-bg); }
.kicker[data-corpus="gdpr"]  { background: var(--c-act-gdpr-bg); }
.kicker[data-corpus="dora"]  { background: var(--c-act-dora-bg); }
.kicker[data-corpus="bafin"] { background: var(--c-act-bafin-bg); }
.kicker[data-corpus="kimig"] { background: var(--c-act-kimig-bg); }
.kicker[data-corpus="ext"]   { background: var(--c-act-ext-bg); }

/* ── graph rail ────────────────────────────────────────────── */

.gpanel {
  flex: none;
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column;
}
.gpanel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px;
}
.gpanel-head h2 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; margin: 0; color: var(--ink-2);
}
.gpanel-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.seg { display: flex; background: var(--sunk); border-radius: 6px; padding: 2px; }
.seg-btn {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  padding: 3px 7px; border-radius: 4px;
}
.seg-btn.is-on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

.gcanvas-wrap {
  position: relative;
  height: 52vh; min-height: 320px;
  margin: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
#gmini { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#gmini:active { cursor: grabbing; }
.gempty {
  position: absolute; inset: 0; display: grid; place-items: center;
  margin: 0; font-size: 12.5px; color: var(--ink-3);
  pointer-events: none;
}
.gempty[hidden] { display: none; }

.legend {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 12px 12px;
}
.lg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2);
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 2px 8px 2px 5px; cursor: pointer;
}
.lg:hover { border-color: var(--rule); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
/* Kind chips carry the silhouette, not a colour: shape is the channel they
   stand for, and tinting them would claim a second meaning they do not have. */
.lg-glyph { width: 11px; height: 11px; flex: none; fill: var(--ink-2); }
.lg-axis {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 0 2px 0 4px;
}
.lg-axis:not(:first-child) { margin-left: 6px; }
.lg-glyph-act { fill: none; stroke: var(--c); stroke-width: 2.6px; }
.lg.is-off .lg-glyph-act { stroke: var(--c); opacity: 0.45; }
.lg-n { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

/* Switched off is a hollow dot, not a faded chip: washing the whole control out
   reads as broken or disabled rather than as a toggle the reader can flip. */
.lg.is-off { color: var(--ink-3); }
.lg.is-off .lg-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.lg.is-off .lg-glyph { fill: none; stroke: var(--ink-3); stroke-width: 1.6px; }

.conn { flex: 1; overflow-y: auto; padding: 14px 12px 40px; }
.conn .block { margin-top: 0; }
.conn .block + .block { margin-top: 26px; }

/* ── overlay graph ─────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: var(--paper);
  display: flex; flex-direction: column;
}
.overlay[hidden] { display: none; }

.overlay-bar {
  flex: none;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}
.overlay-title h2 {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  margin: 0; letter-spacing: -0.01em;
}
.overlay-title p { margin: 1px 0 0; font-size: 12px; color: var(--ink-3); }
.overlay-tools {
  margin-left: auto;
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  justify-content: flex-end;
}
.overlay-stage { flex: 1; min-height: 0; position: relative; display: flex; }
.overlay-stage[hidden] { display: none; }
#gfull { flex: 1; display: block; width: 100%; cursor: grab; min-height: 0; touch-action: none; }
#gfull[hidden] { display: none; }
#gfull:active { cursor: grabbing; }

/* Selecting a node in the expanded graph describes it here rather than
   navigating away: the panel is the bridge from a node to the provisions it
   connects to. */
.ov-inspect {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: 320px;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.ov-inspect[hidden] { display: none; }
.ov-inspect-head {
  flex: none; position: relative;
  padding: 12px 40px 10px 12px; border-bottom: 1px solid var(--rule);
}
.ov-inspect .kicker { margin: 0; padding: 0; }
.ov-inspect-head h3 {
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  margin: 2px 0 0; line-height: 1.3;
}
.ov-inspect-close { position: absolute; top: 8px; right: 8px; }
.ov-inspect-open {
  flex: none; margin: 10px 12px 0;
  font: inherit; font-size: 12px;
  padding: 7px 10px; cursor: pointer;
  background: var(--sunk); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 7px;
}
.ov-inspect-open:hover { border-color: var(--ink-3); }
.ov-inspect-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; }
.ov-inspect-label {
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); margin: 14px 0 4px;
  display: flex; align-items: center; gap: 6px;
}

.graph-list {
  flex: 1; min-height: 0; overflow: auto;
  padding: 22px clamp(16px, 4vw, 56px) 48px;
}
.graph-list[hidden] { display: none; }
.graph-list-intro { max-width: 68ch; margin: 0 0 18px; color: var(--ink-2); }
.graph-list-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--rule);
}
.graph-list-node {
  display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
  align-items: baseline; gap: 10px; min-height: 44px;
  padding: 10px 12px; border: 0; background: var(--panel);
  text-align: left; cursor: pointer;
}
.graph-list-node:hover { background: var(--sunk); }

.ov-hint {
  position: absolute; left: 16px; bottom: 14px;
  font-size: 11px; color: var(--ink-3);
  display: flex; gap: 8px; align-items: center;
  pointer-events: none;
}
.ov-hint[hidden] { display: none; }
.ov-hint kbd {
  font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px;
  background: var(--panel);
}

/* tooltip */
.tip {
  position: fixed; z-index: 90; pointer-events: none;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 9px 12px;
}
.tip[hidden] { display: none; }
.tip-id {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  margin-bottom: 2px;
}
.tip-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.tip-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* the definition preview shown when hovering a defined term */
.tip-def {
  font-family: var(--serif);
  font-size: 13.5px; line-height: 1.5;
  color: var(--ink);
  margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tip-def + .tip-sub {
  border-top: 1px solid var(--rule-2);
  padding-top: 5px; margin-top: 7px;
}

/* ── home ──────────────────────────────────────────────────── */

.home-hero { margin-bottom: 40px; }
.home-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px;
}
.data-checked {
  font-family: var(--sans) !important;
  font-size: 12px !important; line-height: 1.45 !important;
  color: var(--ink-3) !important; margin-top: 18px !important;
}
.data-checked time { font-weight: 600; color: var(--ink-2); }
.home-hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 600; line-height: 1.06; letter-spacing: -0.025em;
  margin: 0 0 16px; text-wrap: balance;
}
.home-hero p {
  font-family: var(--serif); font-size: 17.5px; line-height: 1.6;
  color: var(--ink-2); margin: 0; max-width: 58ch;
}

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 12px;
  overflow: hidden; margin: 28px 0 40px;
}
.stat {
  background: var(--panel); padding: 14px 16px;
  border: 0; cursor: pointer; text-align: left;
}
.stat:hover { background: var(--sunk); }
.stat-n {
  font-family: var(--mono); font-size: 26px; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1; color: var(--c, var(--ink));
}
.stat-k {
  font-size: 11px; color: var(--ink-3); margin-top: 5px;
  letter-spacing: 0.03em;
}

.chapgrid { display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.chapcard {
  display: flex; align-items: baseline; gap: 14px;
  background: var(--panel); border: 0; cursor: pointer; text-align: left;
  padding: 13px 16px;
}
.chapcard:hover { background: var(--sunk); }
.chapcard-n {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--accent); flex: none; min-width: 30px;
}
.chapcard-t { font-size: 14px; font-weight: 500; min-width: 0; }
.chapcard-c {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}

/* ── responsive ────────────────────────────────────────────── */

.rail-toggle, .links-toggle { display: none; }

.scrim {
  position: fixed; inset: var(--top) 0 0; z-index: 44;
  background: #14161c4d;
}
.scrim[hidden] { display: none; }

@media (max-width: 1280px) {
  :root { --rail-l: 250px; --rail-r: 330px; }
  .doc { padding: 32px 28px 30vh; }
}

@media (min-width: 1081px) {
  .scrim { display: none; }
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: var(--rail-l) minmax(0, 1fr); }
  .links-toggle { display: inline-flex; }
  .rail-right {
    position: fixed; top: var(--top); right: 0; bottom: 0;
    width: min(400px, 92vw);
    background: var(--paper);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 45;
  }
  body.show-graph .rail-right { transform: none; }
}

@media (max-width: 820px) {
  :root { --top: 60px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail-left {
    position: fixed; top: var(--top); left: 0; bottom: 0;
    width: min(320px, 88vw);
    background: var(--paper);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 45;
  }
  body.show-toc .rail-left { transform: none; }
  .rail-toggle { display: inline-flex; }
  .brand-text i { display: none; }
  .doc { padding: 24px 18px 30vh; }
  .lawtext { font-size: 16.5px; }
  .para::before { display: none; }
  .hint { display: none; }
  .topbar { gap: 10px; padding: 0 10px; }
  .btn span { display: none; }
  .btn { padding: 0 10px; }
  #q { height: 40px; }
  .icon-btn, .btn, .btn-icon { min-width: 40px; min-height: 40px; }
  .gnum { width: 32px; }
  .gpara { gap: 6px; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .topbar-actions { gap: 4px; }
  .graph-list { padding: 16px 12px 36px; }
  .graph-list-grid { grid-template-columns: 1fr; }
  /* No room beside the canvas on a phone: the panel becomes a bottom sheet. */
  .ov-inspect {
    top: auto; left: 10px; right: 10px; bottom: 10px; width: auto;
    max-height: 56%;
  }
}

@media (max-width: 420px) {
  .brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .topbar, .rail, .overlay, .tip { display: none !important; }
  .layout { display: block; }
  .doc { max-width: none; padding: 0; }
}

.seg[hidden] { display: none; }

/* ============================================================
   Amendments — the 2026 Digital Omnibus layer
   Change state is an editorial annotation, not a fifth category,
   so it never borrows one of the four node hues. It reads as a
   neutral slate mark, always paired with a word.
   ============================================================ */

:root {
  --chg-rule:  #8A6A2F;
  --chg-bg:    #CC6F000f;
  --ins-ink:   #14603F;
  --ins-bg:    #00A38C24;
  --del-ink:   #8C2141;
  --del-bg:    #A308770f;
}
[data-theme="dark"] {
  --chg-rule:  #C9A24A;
  --chg-bg:    #AF860020;
  --ins-ink:   #5FD3AE;
  --ins-bg:    #00AD7F26;
  --del-ink:   #F08CBE;
  --del-bg:    #B93C8C26;
}

/* Changed blocks, marked inside the running text. A marked paragraph carries
   the mark on its section and again on every block inside it, so only the
   outermost mark is drawn. */
.lawtext [data-chg]:not([data-chg] [data-chg]) {
  border-left: 2px solid var(--chg-rule);
  padding-left: 14px;
  margin-left: -16px;
  background: var(--chg-bg);
  border-radius: 0 3px 3px 0;
}
.lawtext .para[data-chg]:not([data-chg] [data-chg]) { padding-top: 2px; padding-bottom: 2px; }
.lawtext [data-chg]:not([data-chg] [data-chg])::after {
  content: "changed 2026";
  display: block;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--chg-rule);
  margin-top: 4px;
}
/* the consolidated text carries the wording as it stands after the amendment,
   so "replaced" means rewritten in 2026, not taken out */
.lawtext [data-op="replaced"]:not([data-chg] [data-chg])::after { content: "rewritten 2026"; }
.lawtext [data-op="inserted"]:not([data-chg] [data-chg])::after { content: "new in 2026"; }
.lawtext [data-op="deleted"]:not([data-chg] [data-chg])::after { content: "removed 2026"; }
.doc-deleted {
  font-family: var(--sans); font-size: 12.5px;
  color: var(--ink-3); font-style: italic;
  margin: 0 0 1em;
}
.para-n { font-weight: 600; }

/* badges */
.kicker-chg {
  text-decoration: none;
  background: var(--chg-bg);
  color: var(--chg-rule);
  margin-left: 6px;
}
.kicker-chg:hover { background: color-mix(in srgb, var(--chg-rule) 18%, transparent); }

.tl-chg {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--chg-rule);
  border: 1px solid color-mix(in srgb, var(--chg-rule) 40%, transparent);
  border-radius: 3px; padding: 0 3px; align-self: center;
}

/* home banner */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--chg-rule);
  border-radius: 10px;
  background: var(--panel);
  padding: 13px 16px;
  margin: 0 0 32px;
}
.banner:hover { background: var(--sunk); }
.banner-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--chg-rule);
  background: var(--chg-bg);
  border-radius: 999px; padding: 3px 9px; flex: none;
}
.banner-text { font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.banner-text b { color: var(--ink); font-weight: 600; }
.banner-go {
  margin-left: auto; flex: none;
  font-size: 12.5px; font-weight: 500; color: var(--accent);
}

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
  font-size: 12.5px;
}
.chip:hover { border-color: var(--ink-3); }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-n { font-family: var(--mono); font-size: 10.5px; opacity: .65; }

.stat[data-status] .stat-n { color: var(--chg-rule); }

/* change cards */
.chg-list { display: flex; flex-direction: column; }
.chg { border-bottom: 1px solid var(--rule-2); }
.chg.is-focus { background: var(--chg-bg); }
.chg-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 12px 4px;
}
.chg-head:hover { background: var(--sunk); }
.chg-badge {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 4px; padding: 2px 6px; flex: none;
  color: var(--chg-rule);
  border: 1px solid color-mix(in srgb, var(--chg-rule) 40%, transparent);
}
.chg-badge[data-status="inserted"] {
  color: var(--ins-ink); background: var(--ins-bg);
  border-color: color-mix(in srgb, var(--ins-ink) 35%, transparent);
}
.chg-id {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  flex: none; min-width: 84px; color: var(--c-article);
}
.chg-title {
  font-size: 13.5px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chg-delta {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 11px;
}
.chg-delta ins { color: var(--ins-ink); background: none; text-decoration: none; }
.chg-delta del { color: var(--del-ink); background: none; text-decoration: none; }
.chg-caret {
  flex: none; width: 13px; height: 13px;
  fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round;
  transition: transform .16s;
}
.chg.is-open .chg-caret { transform: rotate(90deg); }
.chg-body { display: none; padding: 2px 4px 22px 6px; }
.chg.is-open .chg-body { display: block; }
.chg-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; font-style: italic; }
.chg-preview {
  font-family: var(--serif); font-size: 15px; line-height: 1.6;
  color: var(--ink-2); margin: 10px 0 0;
}
.chg-actions { margin-top: 14px; }

/* the redline */
.redline {
  font-family: var(--serif); font-size: 15px; line-height: 1.75;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--panel);
  padding: 14px 16px;
}
.redline ins {
  background: var(--ins-bg); color: var(--ins-ink);
  text-decoration: none; border-radius: 3px;
  padding: 1px 2px; box-decoration-break: clone;
}
.redline ins::before { content: "+ "; font-family: var(--mono); font-size: 11px; opacity: .8; }
.redline del {
  background: var(--del-bg); color: var(--del-ink);
  text-decoration: line-through; text-decoration-thickness: 1px;
  border-radius: 3px; padding: 1px 2px; box-decoration-break: clone;
}
.redline del::before { content: "− "; font-family: var(--mono); font-size: 11px; opacity: .8; text-decoration: none; }
.redline span { color: var(--ink-2); }

.chg-why {
  margin-top: 16px; padding: 12px 14px;
  border-left: 2px solid var(--c-recital);
  background: var(--c-recital-bg);
  border-radius: 0 8px 8px 0;
}
.chg-why h4 {
  margin: 0 0 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--c-recital);
}
.chg-rec {
  font-family: var(--serif); font-size: 14px; line-height: 1.55;
  color: var(--ink-2); margin: 0 0 8px;
}
.chg-rec:last-child { margin-bottom: 0; }
.chg-rec b { font-family: var(--sans); font-size: 11.5px; color: var(--ink); }

.fineprint {
  font-size: 11.5px; line-height: 1.6; color: var(--ink-3);
  border-top: 1px solid var(--rule);
  margin-top: 40px; padding-top: 14px;
}
.fineprint a { color: var(--accent); }

/* connections tabs — so backlinks are never below the fold */
.conn-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin: -14px -12px 12px; padding: 0 12px;
  position: sticky; top: 0; z-index: 2;
  background: var(--paper);
}
.conn-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  padding: 11px 4px 9px; margin-bottom: -1px;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent;
}
.conn-tab:hover { color: var(--ink); }
.conn-tab.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.conn-n {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--sunk); border-radius: 999px; padding: 1px 6px;
}
.conn-tab.is-on .conn-n { background: var(--c-article-bg); color: var(--accent); }

/* expanded-graph controls */
.overlay-controls {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin-left: 20px;
}
.overlay-controls .seg-btn { padding: 4px 10px; font-size: 11px; }
.overlay-controls .seg-btn:disabled { opacity: .4; cursor: not-allowed; }
.overlay-title h2 {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 34ch;
}
.overlay-bar { gap: 12px; }
.overlay-tools { margin-left: auto; }

/* Narrow screens wrap the bar instead of dropping its controls: the hop and
   scope toggles are the point of the expanded view, and the type filters are
   how a dense graph is made readable. Each row scrolls sideways if it must. */
@media (max-width: 980px) {
  .overlay-bar { flex-wrap: wrap; row-gap: 8px; padding: 10px 12px; }
  .overlay-title { flex: 1 1 auto; min-width: 0; order: 1; }
  .overlay-bar > #btn-close { order: 2; margin-left: auto; }
  .overlay-controls,
  .overlay-tools {
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .overlay-controls::-webkit-scrollbar,
  .overlay-tools::-webkit-scrollbar { display: none; }
  .overlay-controls .seg, .overlay-tools .lg { flex: none; }
  .overlay-title h2 { max-width: none; font-size: 17px; }
  .ov-hint { display: none; }
}

@media (max-width: 980px) {
  .overlay-tools .lg { padding: 2px 7px 2px 4px; font-size: 10.5px; }
  .overlay-title p { font-size: 11.5px; }
}

/* ============================================================
   Commission guidance
   ============================================================ */

/* the adopted / draft status of a guidance document */
.gdoc-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  color: var(--c-annex); background: var(--c-annex-bg);
}
.gdoc-badge[data-draft="1"] { color: var(--c-recital); background: var(--c-recital-bg); }

/* a document divider inside the guidance block on a provision page */
.gdoc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin: 10px 2px 4px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.gdoc-row:first-child { margin-top: 0; }

/* adopted-or-draft note at the top of a guidance section */
.gl-note {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.55;
  color: var(--ink-2);
  background: var(--c-guidance-bg);
  border-left: 2px solid var(--c-guidance);
  border-radius: 0 4px 4px 0;
  padding: 9px 12px;
  margin: 0 0 22px;
}
.gl-note b { color: var(--ink); }
.gl-note[data-kind="kimig"] { background: var(--c-kimig-bg); border-left-color: var(--c-kimig); }
.gl-note a { color: inherit; }

/* numbered guideline paragraphs — the number is how the Commission cites them */
.gpara { display: flex; gap: 10px; margin: 0 0 1em; }
.gnum {
  flex: none; width: 44px; text-align: right;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  padding-top: 3px;
}
.gbody { min-width: 0; flex: 1; }
.gbody > .doc-p:last-child { margin-bottom: 0; }
.gpara.is-hit .gbody { background: var(--c-guidance-bg); border-radius: 4px; }

/* worked examples, set off from the reasoning */
.gl-ex {
  margin: 10px 0 12px;
  padding: 10px 14px;
  background: var(--sunk);
  border-left: 2px solid var(--c-guidance);
  border-radius: 0 4px 4px 0;
}
.gl-ex::before {
  content: "example";
  display: block;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--c-guidance);
  margin-bottom: 4px;
}
.gl-ex .doc-p { margin: 0; font-size: 15px; }

/* a provision quoted beside the text, as BaFin sets DORA's articles */
.gl-box {
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: var(--sunk);
  border-left: 2px solid var(--ink-3);
  border-radius: 0 4px 4px 0;
}
.gl-box-ref { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin: 0 0 2px; }
.gl-box-title { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.gl-box .doc-p { margin: 0; font-size: 15px; }

/* a figure from a PDF, drawn on white as printed, in either theme */
.gl-fig { margin: 16px 0 20px; }
.gl-fig img {
  display: block; max-width: 100%; height: auto;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 8px;
}
.gl-fig figcaption { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* an editorial link, and the reason for it */
.concord .concord-why { margin: -2px 0 10px 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* sub-headings inside a section: "a) Narrow procedural task" */
.gl-h3 {
  font-family: var(--sans); font-size: 18px; line-height: 1.35; font-weight: 700;
  color: var(--ink); margin: 22px 0 10px;
}

/* practical-example lists */
.gl-list { margin: 8px 0 14px; padding-left: 22px; }
.gl-list li { margin-bottom: 8px; }
.gl-list li::marker { color: var(--c-guidance); }
.gl-roman { margin: 12px 0 18px; padding-left: 30px; list-style-type: lower-roman; }
.gl-roman li { padding-left: 8px; margin-bottom: 12px; }
.gl-roman li::marker { color: var(--ink-3); }

/* Tables and endnotes found in Commission guidance PDFs.  Keeping the table
   structure here, rather than flattening it into paragraph text, makes the
   Article 50 obligations comparable across their four columns. */
.gl-table-wrap {
  overflow-x: auto;
  margin: 14px 0 20px;
  border: 1px solid var(--rule);
}
.gl-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
}
.gl-table th,
.gl-table td {
  padding: 10px 12px;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.gl-table th {
  background: var(--sunk);
  color: var(--ink);
  font-weight: 700;
}
.gl-table td:first-child {
  width: 11%;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
}
.gl-footnotes {
  margin: 24px 0 0;
  padding: 12px 0 0 28px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.55;
}
.gl-footnotes li { padding-left: 4px; margin: 0 0 7px; }
.gl-footnotes li::marker { font-family: var(--mono); color: var(--ink-3); }

/* previous / next section, so a document reads through */
.gl-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--rule-2);
}
.gl-nav-a {
  font-family: var(--mono); font-size: 12px;
  color: var(--c-guidance); text-decoration: none;
  max-width: 48%;
}
.gl-nav-a span { color: var(--ink-3); font-family: var(--sans); }
.gl-nav-a:hover span { color: var(--ink); }
.gl-nav-next { text-align: right; margin-left: auto; }

/* home page: one card per guidance document */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.gcard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 8px; padding: 14px 16px;
}
.gcard:hover { border-color: var(--c-guidance); }
.gcard[data-kind="kimig"]:hover { border-color: var(--c-kimig); }
.gcard[data-kind="kimig"] .gcard-name { color: var(--c-kimig); }
.gcard[data-kind="gdpr"]:hover { border-color: var(--c-gdpr); }
.gcard[data-kind="gdpr"] .gcard-name { color: var(--c-gdpr); }

/* ── multi-instrument portal ─────────────────────────────── */
.portal-actions { display:grid; grid-template-columns:minmax(0,520px); gap:12px; margin:28px 0; }
.portal-card { display:flex; flex-direction:column; gap:7px; padding:18px; border:1px solid var(--line); border-radius:10px; color:var(--ink); text-decoration:none; background:var(--panel); }
.portal-card:hover { border-color:var(--accent); box-shadow:0 6px 22px color-mix(in srgb,var(--accent) 10%,transparent); }
.portal-card b { font:600 17px var(--sans); }
.portal-card span { color:var(--ink-2); font-size:13px; }
.marisk-note { border-left:2px solid var(--c-module); margin:12px 0; padding:2px 0 2px 16px; color:var(--ink-2); background:var(--c-module-bg); }
.dora-ai-scope { max-width:76ch; color:var(--ink-2); font:400 20px/1.55 var(--serif); }
.dora-ai-caveat { display:flex; flex-direction:column; gap:5px; max-width:82ch; margin:24px 0 34px; padding:14px 16px; border-left:3px solid var(--c-module); border-radius:0 8px 8px 0; background:var(--c-module-bg); color:var(--ink-2); font-size:13px; line-height:1.5; }
.dora-ai-caveat b { color:var(--ink); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.dora-ai-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:12px; }
.dora-ai-cards article { display:flex; flex-direction:column; gap:10px; min-height:220px; padding:18px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.dora-ai-cards h3 { margin:0; font-size:17px; line-height:1.25; }.dora-ai-cards p { margin:0; color:var(--ink-2); font-size:13px; line-height:1.5; }
.dora-ai-cards .dora-ai-when { color:var(--ink); }.dora-ai-when b { display:block; margin-bottom:3px; color:var(--c-module); font-size:10px; text-transform:uppercase; letter-spacing:.07em; }
.dora-ai-cards .relation-basis { margin-top:auto; }
.dora-ai-browse { margin:18px 0 0; color:var(--ink-3); font-size:12px; }

.portal-wide .doc { padding-top:18px; }
.portal-wide .portal-hero { max-width:64rem; margin-bottom:12px; }
.portal-wide .portal-hero .home-eyebrow { margin-bottom:5px; }
.portal-wide .portal-hero h1 { max-width:none; margin-bottom:5px; font-size:clamp(30px,2.8vw,40px); line-height:1.08; }
.portal-wide .portal-hero p { max-width:none; font-size:15px; line-height:1.4; }
.portal-wide .map-network-block { margin-top:20px; }
.map-network-block > .block-head { margin-bottom:6px; }
.map-key { display:flex; flex-wrap:wrap; gap:8px 20px; color:var(--ink-2); font-size:12px; margin:0 0 10px; }
.map-key span { display:flex; align-items:center; gap:7px; }
.key-line { display:inline-block; width:32px; height:0; border-top:1px solid var(--ink-3); }
.key-line.legal { border-top:3px solid var(--accent); }
.imap-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.imap { width:100%; height:min(55vh,420px); min-width:1000px; display:block; }
.imap-band { fill:color-mix(in srgb,var(--paper) 68%,var(--panel)); stroke:var(--rule); stroke-width:1; }
.imap-band-eu { fill:color-mix(in srgb,var(--c-article-bg) 45%,var(--panel)); }
.imap-band-finance { fill:color-mix(in srgb,var(--c-module-bg) 32%,var(--panel)); }
.imap-band-label { fill:var(--ink-2); font:600 12px var(--mono); text-transform:uppercase; letter-spacing:.08em; }
.imap-edge { fill:none; stroke:var(--ink-3); opacity:.62; stroke-linecap:round; stroke-linejoin:round; transition:stroke-width .14s, opacity .14s, stroke .14s; }
.imap-legal { stroke:var(--accent); stroke-width:2.4; }
.imap-edge-hit { fill:none; stroke:var(--paper); stroke-opacity:.01; stroke-width:24; pointer-events:stroke; }
.imap-relation { cursor:pointer; outline:none; }
.imap-relation:hover .imap-edge,.imap-relation:focus .imap-edge,.imap-relation.is-active .imap-edge { stroke:var(--c-guidance); stroke-width:5; opacity:1; }
.imap-relation:focus-visible .imap-edge { stroke:var(--focus); stroke-width:5; opacity:1; }
.imap marker path { fill:var(--accent); }
.imap-node { cursor:pointer; }.imap-node.is-static { cursor:default; opacity:.76; }.imap-node rect { fill:var(--panel); stroke:var(--accent); stroke-width:1.4; }
.imap-node text { fill:var(--ink); font:600 13px var(--sans); pointer-events:none; }
.imap-node .imap-sub { fill:var(--ink-2); font-size:10px; font-weight:400; }
.imap-node.is-root rect { fill:var(--c-article-bg); stroke-width:3; }
.imap-node.is-root text { font-size:16px; }.imap-node.is-hub rect { stroke-width:2.5; }
.imap-node.is-stub rect { stroke:var(--ink-3); stroke-dasharray:4 3; fill:var(--paper); }
.imap-node.is-authority rect { rx:28px; stroke:var(--c-module); }
.imap-node:focus rect,.imap-node:hover rect { stroke-width:3; }
.relation-basis { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding-top:10px; border-top:1px solid var(--rule-2); font-size:11px; }
.relation-basis b { color:var(--ink-3); text-transform:uppercase; letter-spacing:.05em; margin-right:2px; }
.relation-basis a { color:var(--accent); background:var(--c-article-bg); border-radius:5px; padding:3px 6px; text-decoration:none; }
.relation-basis a:hover { text-decoration:underline; }
.map-detail { min-height:110px; margin-top:14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); padding:18px; }
.map-detail-prompt { margin:0; color:var(--ink-3); }
.map-detail-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:9px; }
.map-detail-head p { margin:0; padding:3px 7px; border-radius:999px; background:var(--c-guidance-bg); color:var(--c-guidance); font-size:11px; font-weight:600; }
.map-detail-head h3 { margin:0; font-size:18px; }.map-detail-head h3 span { color:var(--accent); }
.map-detail-copy { max-width:74ch; margin:8px 0 14px; color:var(--ink-2); }
.map-detail-mechanisms { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:10px; margin-top:18px; }
.map-detail-mechanisms > h4 { grid-column:1 / -1; margin:0; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); }
.map-detail-mechanisms article { padding:12px; border:1px solid var(--rule); border-radius:8px; background:var(--paper); }
.map-detail-mechanisms h5 { display:inline; margin:0; font-size:13px; }
.map-detail-mechanisms article > span { margin-left:6px; color:var(--c-guidance); font-size:11px; }
.map-detail-mechanisms article > p { margin:7px 0 12px; color:var(--ink-2); font-size:12px; line-height:1.45; }
.map-detail-state { margin:14px 0 0; color:var(--ink-3); font-size:11px; }
.map-rel-list { display:none; }
.map-rel-btn {
  width:100%; min-height:52px; display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:11px 12px; border:0; border-bottom:1px solid var(--rule-2);
  background:var(--panel); color:var(--ink); text-align:left; cursor:pointer;
}
.map-rel-btn:last-child { border-bottom:0; }
.map-rel-btn small { flex:none; color:var(--ink-3); text-transform:uppercase; letter-spacing:.04em; }
.map-rel-btn.is-active { background:var(--c-guidance-bg); box-shadow:inset 3px 0 var(--c-guidance); }

.legal-effect article { border-left:2px solid var(--accent); padding:8px 12px; background:var(--c-article-bg); }
.legal-effect article p { color:var(--ink-2); margin:6px 0; }
.topic-badges { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.topic-badges span { padding:5px 9px; border-radius:999px; background:var(--c-article-bg); color:var(--accent); font-size:12px; }
.ov-family-label { align-self:center; margin-left:8px; color:var(--ink-2); font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.edge-filter { border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--ink); padding:5px 9px; font:500 11px var(--sans); cursor:pointer; }
.edge-filter.is-off { opacity:.42; text-decoration:line-through; }

@media (max-width: 900px) {
  .nav-wide { display:none; }
  .portal-actions { grid-template-columns:1fr; }
  .portal-wide .doc { padding:20px 24px 30vh; }
  .portal-wide .portal-hero h1 { font-size:clamp(30px,7vw,42px); }
  .imap-wrap, .map-key { display:none; }
  .map-rel-list { display:block; overflow:hidden; border:1px solid var(--rule); border-radius:10px; }
  .map-rel-btn { flex-direction:column; align-items:flex-start; gap:3px; }
  .map-rel-btn small { white-space:normal; }
  .map-detail-prompt::after { content:" Choose a relationship above to see its legal basis."; }
}

@media (max-width: 560px) {
  .map-detail { padding:14px; }
}
.gcard-top { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }
.gcard-name {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--c-guidance);
}
.gcard-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.gcard-sub { font-size: 11.5px; color: var(--ink-3); }


/* guidance grouped by part on a heavily-interpreted provision */
.gl-group { border-bottom: 1px solid var(--rule-2); }
.gl-group:last-child { border-bottom: 0; }
.gl-group-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; cursor: pointer;
  padding: 8px 4px; text-align: left;
}
.gl-group-btn:hover .gl-group-name { color: var(--ink); }
.gl-group-name { font-size: 13px; font-weight: 500; color: var(--ink-2); flex: 1; }
.gl-group-n { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.gl-group .chap-caret { width: 12px; height: 12px; fill: none; stroke: var(--ink-3); stroke-width: 2; transition: transform .15s; }
.gl-group.is-open .chap-caret { transform: rotate(90deg); }
.gl-group-list { display: none; padding: 0 0 8px 6px; }
.gl-group.is-open .gl-group-list { display: block; }

/* KI-MIG: English translation or the German original */
.lang-seg { display: inline-flex; margin: 0 0 16px; }
.lang-seg .seg-btn { font-family: var(--sans); font-size: 12px; padding: 4px 11px; }
.lang-seg .seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ── editorial refit: an annotated legal publication, not a dashboard ── */

.topbar {
  gap: 16px;
  background: var(--paper);
  backdrop-filter: none;
}

#q {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}
#q:focus {
  background: transparent;
  border-bottom-color: var(--focus);
  box-shadow: inset 0 -1px var(--focus);
}

.topbar-actions { gap: 3px; }
.btn {
  background: transparent;
  border-color: transparent;
  border-radius: 2px;
  text-decoration: none;
}
.btn:hover { background: var(--sunk); border-color: transparent; }
.links-toggle { display: inline-flex; }
.btn.is-current {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 -2px var(--accent);
}

/* The document is the working surface. Connections remain available, but do
   not permanently take a third of the reading width. */
.layout { grid-template-columns: var(--rail-l) minmax(0, 1fr); }
.rail-right {
  position: fixed;
  top: var(--top);
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .2s ease;
  z-index: 45;
}
body.show-graph .rail-right { transform: none; }
@media (min-width: 1081px) {
  .scrim:not([hidden]) { display: block; }
}

.doc-pick { padding: 0; border-bottom: 1px solid var(--rule); }
.doc-pick.is-alone { padding-bottom: 0; }
.doc-btn {
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
}
.doc-menu { border-radius: 2px; }
.doc-opt, .chap-btn, .tl { border-radius: 1px; }
.rail-body { padding-left: 6px; padding-right: 6px; }
.chap-btn { padding-top: 6px; padding-bottom: 6px; }
.tl { padding-top: 4px; padding-bottom: 4px; }
.tl.is-on { background: transparent; box-shadow: inset 2px 0 var(--accent); border-left-color: transparent; }

.kicker {
  gap: 0;
  padding: 1px 0 1px 9px;
  border-left: 2px solid currentColor;
  border-radius: 0;
  background: transparent !important;
}
.kicker::before { display: none; }
h1.doc-title { font-size: clamp(27px, 3vw, 38px); }

.meta {
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.block-head h2 {
  font-size: 13px;
  letter-spacing: .025em;
  text-transform: none;
}
.block-count { border-radius: 2px; }

.home-hero { margin-bottom: 30px; }
.home-eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .055em;
}
.home-hero h1 { font-size: clamp(34px, 4vw, 44px); }

.banner {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: 0 0 13px;
  margin-bottom: 32px;
}
.banner:hover { background: transparent; }
.banner-tag {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.banner-text { font-size: 13px; }
.banner-go {
  margin-left: 2px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-actions { margin: 20px 0 32px; }
.portal-card {
  padding: 13px 4px;
  border-width: 1px 0;
  border-color: var(--rule);
  border-radius: 0;
  background: transparent;
}
.portal-card:hover {
  border-color: var(--rule);
  background: var(--sunk);
  box-shadow: none;
}
.portal-card b { font-size: 15px; }

.home-browse {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 24px;
  font-size: 12px;
}
.home-browse span { color: var(--ink-3); }
.home-browse a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Implementation timeline: deliberately restrained so it reads as a useful
   reference page, not a dashboard competing with the regulation itself. */
.timeline-hero { margin-bottom: 22px; }
.timeline-hero p { max-width: 62ch; }
.timeline-key {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3); font-size: 12px;
}
.timeline-key span { display: inline-flex; align-items: center; gap: 7px; }
.timeline-dot, .timeline-marker {
  display: inline-block; width: 8px; height: 8px;
  border: 1.5px solid var(--c-article); border-radius: 50%; background: var(--paper);
}
.timeline-dot[data-kind="deadline"] { border-color: var(--c-recital); }
.timeline-list {
  list-style: none; margin: 0; padding: 12px 0 0;
}
.timeline-item {
  position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 22px; padding: 0 0 24px;
}
.timeline-item::before {
  content: ""; position: absolute; left: 3px; top: 10px; bottom: -2px;
  width: 1px; background: var(--rule);
}
.timeline-item:last-child::before { bottom: calc(100% - 10px); }
.timeline-marker { position: absolute; left: 0; top: 5px; z-index: 1; }
.timeline-item.is-past .timeline-marker { background: var(--c-article); }
.timeline-item.is-next .timeline-marker {
  width: 10px; height: 10px; left: -1px; top: 4px;
  border-color: var(--c-recital); box-shadow: 0 0 0 4px var(--c-recital-bg);
}
.timeline-date {
  grid-column: 1; padding-left: 20px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.35; color: var(--ink-3);
}
.timeline-date time { color: var(--ink-2); }
.timeline-next {
  display: block; width: max-content; margin-top: 4px;
  color: var(--c-recital); font-family: var(--sans); font-size: 10.5px; font-weight: 600;
}
.timeline-entry { grid-column: 2; margin-top: -3px; }
.timeline-kind {
  display: inline-block; color: var(--c-article);
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
}
.timeline-kind[data-kind="deadline"] { color: var(--c-recital); }
.timeline-kind[data-kind="milestone"] { color: var(--ink-3); }
.timeline-entry h2 {
  margin: 2px 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 600;
  line-height: 1.25; letter-spacing: -.01em;
}
.timeline-entry p { margin: 0; color: var(--ink-2); font-family: var(--serif); font-size: 14px; line-height: 1.55; }
.timeline-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.timeline-refs a {
  color: var(--accent); font-family: var(--mono); font-size: 10.5px;
  text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.timeline-refs a:hover { border-bottom-color: currentColor; }

@media (max-width: 560px) {
  .timeline-item { grid-template-columns: 1fr; padding-left: 22px; column-gap: 0; }
  .timeline-date, .timeline-entry { grid-column: 1; padding-left: 0; }
  .timeline-date { margin-bottom: 5px; }
  .timeline-entry { margin-top: 0; }
  .timeline-item::before { left: 3px; }
  .timeline-marker { left: 0; }
  .timeline-item.is-next .timeline-marker { left: -1px; }
}

.stats {
  gap: 0;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
  margin: 24px 0 34px;
}
.stat {
  padding: 12px 4px;
  border-right: 1px solid var(--rule);
  background: transparent;
}
.stat:last-child { border-right: 0; }
.stat-n { font-size: 22px; }

.chapgrid {
  gap: 0;
  border-width: 0;
  border-radius: 0;
  background: transparent;
}
.chapcard {
  padding: 11px 4px;
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.gcards {
  display: block;
  border: 0;
}
.gcard {
  width: 100%;
  gap: 5px;
  padding: 15px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  border-color: var(--rule);
  background: transparent;
}
.gcard:last-child { border-bottom: 0; }
.gcard:hover,
.gcard[data-kind="kimig"]:hover,
.gcard[data-kind="gdpr"]:hover {
  border-color: var(--rule);
  background: var(--sunk);
}
.gcard-name,
.gcard[data-kind="kimig"] .gcard-name,
.gcard[data-kind="gdpr"] .gcard-name {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.gcard-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.gcard-sub { font-size: 12px; }
.gdoc-badge,
.gdoc-badge[data-draft="1"] {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.chips {
  gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.chip {
  padding: 6px 1px;
  border-width: 0 0 2px;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
}
.chip:hover { border-color: var(--ink-3); }
.chip.is-on {
  color: var(--ink);
  border-color: var(--accent);
  background: transparent;
}

.gl-note,
.gl-ex,
.gl-box,
.marisk-note,
.dora-ai-caveat,
.legal-effect article {
  border-radius: 0;
  background: transparent;
}

/* Document pages use the same quiet hierarchy as the home page. Provision
   type and publication status are context, not a visual identity system. */
.crumb { gap: 7px; font-size: 12px; margin-bottom: 20px; }
.crumb i { font-size: 0; opacity: 1; }
.crumb i::after { content: "/"; font-size: 12px; color: var(--ink-3); }
.kicker,
.kicker[data-type] {
  display: block;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}
h1.doc-title {
  font-size: clamp(25px, 2.7vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.doc-num {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 18px;
}
.gl-note {
  max-width: 70ch;
  padding: 0;
  margin: 0 0 24px;
  border: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.58;
}
.gl-note[data-kind="kimig"] { border: 0; }
.gl-ex,
.gl-box {
  padding: 8px 0;
  border-left: 0;
}
.gl-ex::before {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.gpara.is-hit .gbody { background: transparent; border-radius: 0; }

.seg { border: 1px solid var(--rule); border-radius: 2px; background: transparent; padding: 1px; }
.seg-btn { border-radius: 1px; }
.seg-btn.is-on { box-shadow: none; background: var(--sunk); }

.gcanvas-wrap { border-radius: 2px; }
.lg { padding-left: 2px; border-radius: 1px; }
.graph-list-grid { border-radius: 2px; }

.portal-wide .portal-hero h1 { font-size: clamp(28px, 2.6vw, 38px); }
.imap-wrap {
  border-color: var(--rule);
  border-radius: 2px;
  background: transparent;
}
.imap { height: min(52vh, 390px); }
.imap-node rect { rx: 2px; }
.imap-node.is-root rect { fill: var(--paper); }
.imap-node.is-authority rect { rx: 28px; }

.map-detail {
  min-height: 96px;
  padding: 17px 0;
  border-width: 1px 0 0;
  border-color: var(--rule);
  border-radius: 0;
  background: transparent;
}
.map-detail-head p {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.map-detail-mechanisms { gap: 0; border-top: 1px solid var(--rule); }
.map-detail-mechanisms > h4 { padding: 12px 0 7px; }
.map-detail-mechanisms article {
  padding: 12px 12px 12px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
.relation-basis a {
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.map-rel-list { border-radius: 2px; }
.map-rel-btn { background: transparent; }
.map-rel-btn.is-active { background: transparent; }

.topic-badges {
  gap: 0;
  border-top: 1px solid var(--rule);
}
.topic-badges span {
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}
.edge-filter { border-radius: 2px; background: transparent; }

.dora-ai-cards { gap: 0; border-top: 1px solid var(--rule); }
.dora-ai-cards article {
  min-height: 0;
  padding: 16px 14px 16px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 900px) {
  .map-rel-list { border-radius: 2px; }
  .map-detail { padding-left: 0; padding-right: 0; }
}

@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .map-detail { padding: 14px 0; }
}

/* Colour is reserved for a document's provenance, not for container chrome. */
.kicker[data-type] { color: var(--c, var(--ink-2)); }
.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}
h1.doc-title {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.022em;
}
.doc-num { font-size: 14.5px; }
.gl-note {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.52;
}
.gl-note b {
  color: var(--c-guidance);
  font-family: var(--sans);
  font-size: .86em;
  letter-spacing: .015em;
}
.gnum { color: var(--c-guidance); }

/* The Act's entry page is an introduction, not a marketing hero. */
.home-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .015em;
  text-transform: none;
  color: var(--ink-3);
}
.home-hero h1 { margin-bottom: 12px; }
.home-hero > p:not(.data-checked) { max-width: 48ch; }

@media (max-width: 820px) {
  .doc {
    max-width: none;
    margin: 0;
    padding: 28px 28px 24vh;
  }
  .home-hero > p:not(.data-checked) { max-width: none; }
  .home-hero { margin-bottom: 24px; }
}

@media (max-width: 560px) {
  .doc { padding: 24px 20px 22vh; }
  .home-hero h1 { font-size: clamp(31px, 10vw, 39px); }
  .home-hero > p:not(.data-checked) { font-size: 17px; line-height: 1.52; }
}

/* A wider home canvas lets the introduction carry useful editorial context
   instead of leaving an accidental blank margin beside the reader. */
.doc.is-home { max-width: 1060px; }
.home-act {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr);
  gap: clamp(32px, 6vw, 76px);
  align-items: end;
}
.home-act .home-intro > p { max-width: 54ch; }
.home-apparatus {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 2px clamp(22px, 3vw, 38px);
  border-left: 1px solid var(--rule);
}
.home-map-launch {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}
.home-map-label {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.home-map-copy {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.42;
}
.home-map-go {
  margin-top: 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-map-launch:hover .home-map-label,
.home-map-launch:hover .home-map-go { text-decoration: underline; text-underline-offset: 3px; }
.home-apparatus .data-checked {
  margin: 24px 0 0 !important;
  max-width: 24ch;
}

/* At tablet widths the rails are overlays, so the reader must take the canvas
   rather than retain the desktop measure used beside persistent sidebars. */
@media (max-width: 900px) {
  .doc {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .doc.is-home { max-width: none; }
  .home-act {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .home-act .home-intro > p { max-width: none; }
  .home-apparatus {
    display: block;
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .home-map-launch { max-width: 420px; }
  .home-apparatus .data-checked { max-width: none; }
}

/* Source citations are references, not primary actions. */
.source-line { margin: 16px 0 0; }
/* On reader pages the source belongs to the document apparatus, not to the
   opening sentence of the law. */
.doc > .source-line { margin-bottom: 28px; }
.source-link {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}
.source-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.doc-facts .source-link { font-size: inherit; }

/* The connection rail is now on demand, so large screens can give the legal
   text a broader working measure without turning it into a full-width wall. */
@media (min-width: 1281px) {
  .doc { max-width: 96ch; }
}
