/*!
 * NEXTLOGIC Data Catalogue theme for CKAN 2.12 (Bootstrap 5.3 markup, shadcn/ui look).
 * Design language and tokens: ckanext-nextlogic/DESIGN.md.
 *
 * Cascade layers (lowest first for normal declarations):
 *   nlfix   - ONLY !important fixes. For !important the order flips, so this
 *             layer beats `ckan`'s own !important rules and the unlayered
 *             vendor sheets (select2, geoview, scheming) that load after us.
 *   ckan    - CKAN's compiled main.css (no layers of its own).
 *   nl.tokens, nl.base, nl.ckan, nl.components, nl.utilities - this theme.
 */
@layer nlfix, ckan, nl.tokens, nl.base, nl.ckan, nl.components, nl.utilities;
@import url("/base/css/main.css?v=2.12.1") layer(ckan);

/* Reddit Sans, variable weight, self-hosted (OFL: /nextlogic/fonts/OFL.txt) */
@font-face {
  font-family: "Reddit Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/nextlogic/fonts/reddit-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("/nextlogic/fonts/reddit-sans-latin-wght-normal.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: "Reddit Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/nextlogic/fonts/reddit-sans-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("/nextlogic/fonts/reddit-sans-latin-ext-wght-normal.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: "Reddit Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("/nextlogic/fonts/reddit-sans-latin-wght-italic.woff2") format("woff2-variations"),
       url("/nextlogic/fonts/reddit-sans-latin-wght-italic.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: "Reddit Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("/nextlogic/fonts/reddit-sans-latin-ext-wght-italic.woff2") format("woff2-variations"),
       url("/nextlogic/fonts/reddit-sans-latin-ext-wght-italic.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;
}

/* ==========================================================================
   nlfix: !important overrides only (a top-level layer: dotted names nest) (see header comment)
   ========================================================================== */
@layer nlfix {
  /* ckan: .btn-secondary:hover { background-color: #dee2e6 !important } */
  .btn-secondary:hover, .btn-light:hover { background-color: var(--nl-sky-200) !important; border-color: var(--nl-sky-200) !important; }

  /* geoview and core colour format badges per format; ours are outline style */
  .badge[data-format], .badge-default[data-format] {
    background-color: var(--background) !important;
    color: var(--foreground) !important;
  }

  /* select2 (vendor sheet loads unlayered after this file) */
  .select2-container .select2-choice,
  .select2-container-multi .select2-choices {
    min-height: var(--control-h) !important;
    border: 1px solid var(--input) !important;
    border-radius: var(--radius-md) !important;
    background: var(--background) !important;
    box-shadow: none !important;
    font-size: 1rem !important;
  }
  .select2-container .select2-choice { display: flex !important; align-items: center !important; height: var(--control-h) !important; line-height: 1.3 !important; padding: 0 .75rem !important; }
  .select2-container .select2-choice .select2-arrow { background: transparent !important; border: 0 !important; }
  .select2-container-multi .select2-choices { padding: .25rem .5rem !important; }
  .select2-container-multi .select2-choices .select2-search-choice {
    background: var(--secondary) !important; color: var(--secondary-foreground) !important;
    border: 0 !important; border-radius: var(--radius-pill) !important; box-shadow: none !important;
    padding: .25rem .75rem .25rem 1.5rem !important; margin: .25rem .25rem .25rem 0 !important; font-size: .875rem !important;
  }
  .select2-container-multi .select2-choices .select2-search-field input { min-height: 34px !important; font-size: 1rem !important; font-family: inherit !important; }
  .select2-container-active .select2-choice,
  .select2-container-active .select2-choices,
  .select2-dropdown-open .select2-choice { border-color: var(--ring) !important; box-shadow: 0 0 0 3px var(--ring-halo) !important; }
  .select2-drop { border-color: var(--border) !important; border-radius: var(--radius-md) !important; box-shadow: var(--shadow-md) !important; font-family: var(--font-sans) !important; }
  .select2-results .select2-highlighted { background: var(--accent) !important; color: var(--accent-foreground) !important; }

  /* Font Awesome 6.7 is unlayered and draws glyphs from --fa: swap copy -> check */
  .is-copied .fa-copy, .fa-copy.is-copied { --fa: "\f00c" !important; }

  /* DESIGN.md: no uppercase labels inside our cards (feature templates use Bootstrap utilities) */
  .nl-card .text-uppercase { text-transform: none !important; }

  /* Upstream hides the dataset filters below 768px with display:none in a
     body.filters-modal pattern; our offcanvas wrapper handles that now. */
  .nl-filters .filters { display: block !important; }
}

/* ==========================================================================
   nl.tokens
   ========================================================================== */
@layer nl.tokens {
  :root {
    /* brand scales (DESIGN.md §2) */
    --nl-navy-950: #00243a; --nl-navy-900: #003956; --nl-navy-800: #0a4a6e; --nl-navy-700: #14597f;
    --nl-sky-50: #f0f7fb; --nl-sky-100: #dcedf7; --nl-sky-200: #bfdff0; --nl-sky-300: #7cc0e3;
    --nl-sky-400: #5aabd4; --nl-sky-500: #3292c3; --nl-sky-600: #227fae; --nl-sky-700: #1d6f99;
    --nl-lime-50: #f5faea; --nl-lime-100: #e8f3cf; --nl-lime-200: #d4e9a6; --nl-lime-400: #a6ce54;
    --nl-lime-500: #8db83a; --nl-lime-600: #6f9628; --nl-lime-800: #43591d;
    --nl-gradient: linear-gradient(313deg, var(--nl-sky-500) 0%, var(--nl-lime-400) 100%);

    /* shadcn semantic tokens */
    --background: #ffffff;
    --foreground: #0b2536;
    --card: #ffffff; --card-foreground: var(--foreground);
    --popover: #ffffff; --popover-foreground: var(--foreground);
    --primary: var(--nl-navy-900); --primary-foreground: #ffffff;
    --secondary: var(--nl-sky-100); --secondary-foreground: var(--nl-navy-900);
    --muted: var(--nl-sky-50); --muted-foreground: #4a6272;
    --accent: var(--nl-sky-50); --accent-foreground: var(--nl-navy-900);
    --destructive: #b42318; --destructive-foreground: #ffffff;
    --border: #dbe6ee;
    --input: #738ba0;
    --ring: var(--nl-sky-600);
    --ring-halo: rgb(34 127 174 / .35);
    --ring-on-navy: var(--nl-lime-400);
    --cta: var(--nl-lime-400); --cta-foreground: var(--nl-navy-900); --cta-border: var(--nl-lime-600); --cta-hover: var(--nl-lime-500);
    --link: var(--nl-sky-700);
    --chart-1: #14597f; --chart-2: #3292c3; --chart-3: #6f9628; --chart-4: #0f766e; --chart-5: #d97706;

    /* status */
    --success: #2f7a35; --success-bg: #e9f5ea; --success-border: #bfe0c2;
    --warning: #8a4b00; --warning-bg: #fdecc8; --warning-border: #f6d39a;
    --info: var(--nl-sky-700); --info-bg: var(--nl-sky-50); --info-border: var(--nl-sky-200);
    --error: #912018; --error-bg: #fdecec; --error-border: #f5b5b0;

    /* type */
    --font-sans: "Reddit Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --text-xs: .8125rem; --text-sm: .875rem; --text-base: 1rem;
    --text-lg: clamp(1.0625rem, 1rem + .25vw, 1.125rem);
    --text-xl: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
    --text-2xl: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
    --text-3xl: clamp(1.625rem, 1.35rem + 1.3vw, 2.25rem);
    --text-4xl: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);

    /* space, radius, shadow */
    --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
    --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;
    --gutter: clamp(1rem, .5rem + 2.5vw, 2rem);
    --section: clamp(2.5rem, 2rem + 3vw, 5rem);
    --radius: .625rem;
    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px; --radius-pill: 999px;
    --shadow-xs: 0 1px 2px oklch(.25 .05 240 / .06);
    --shadow-sm: 0 1px 3px oklch(.25 .05 240 / .08), 0 1px 2px -1px oklch(.25 .05 240 / .08);
    --shadow-md: 0 6px 16px -4px oklch(.25 .05 240 / .12);
    --shadow-lg: 0 16px 40px -8px oklch(.25 .05 240 / .22);

    /* layout */
    --header-h: 56px;
    --control-h: 44px;
    --target: 44px;
    --icon-sm: 14px; --icon-md: 16px; --icon-lg: 20px;

    /* motion */
    --dur-press: 100ms; --dur-fast: 150ms; --dur-base: 200ms; --dur-enter: 300ms; --dur-exit: 200ms;
    --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-std: cubic-bezier(.2, 0, 0, 1);

    /* Bootstrap globals */
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.55;
    --bs-body-color: var(--foreground);
    --bs-body-bg: var(--background);
    --bs-emphasis-color: var(--foreground);
    --bs-secondary-color: var(--muted-foreground);
    --bs-tertiary-bg: var(--muted);
    --bs-primary: var(--nl-navy-900);
    --bs-primary-rgb: 0, 57, 86;
    --bs-link-color: var(--link);
    --bs-link-color-rgb: 29, 111, 153;
    --bs-link-hover-color: var(--nl-navy-900);
    --bs-link-hover-color-rgb: 0, 57, 86;
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius-md);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-focus-ring-color: var(--ring-halo);
    --bs-heading-color: var(--foreground);
    --bs-code-color: var(--nl-navy-800);
  }
  @media (min-width: 992px) {
    :root { --header-h: 64px; --control-h: 40px; --target: 40px; }
  }

  /* Dark mode: tokens prepared but not enabled by default (plan §3a).
     Opt in with <html data-theme="dark">. */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --background: #071d2b; --foreground: #e6eff5;
    --card: #0c2838; --popover: #0c2838;
    --primary: #7cc0e3; --primary-foreground: #00243a;
    --secondary: #123447; --secondary-foreground: #e6eff5;
    --muted: #123447; --muted-foreground: #9db3c1;
    --accent: #1d4458; --accent-foreground: #e6eff5;
    --destructive: #f59f97;
    --border: oklch(1 0 0 / 12%); --input: #738ba0; --ring: #5aabd4;
    --link: #7cc0e3;
  }

  @media (prefers-reduced-motion: reduce) {
    :root { --dur-press: 0ms; --dur-fast: 0ms; --dur-base: 0ms; --dur-enter: 0ms; --dur-exit: 0ms; }
  }
}

/* ==========================================================================
   nl.base
   ========================================================================== */
@layer nl.base {
  html { scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
  body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--foreground);
    background: var(--background);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
  }
  h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4 {
    font-family: var(--font-sans);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.015em;
    color: var(--foreground);
    text-wrap: balance;
    margin: 0 0 .5em;
  }
  h1, .h1 { font-size: var(--text-3xl); }
  h2, .h2 { font-size: var(--text-2xl); }
  h3, .h3 { font-size: var(--text-xl); }
  h4, .h4 { font-size: var(--text-lg); }
  h5, h6, .h5 { font-size: 1rem; }
  .h6 { font-size: var(--text-sm); letter-spacing: 0; }
  p { margin: 0 0 1em; }
  /* Link colour comes from --bs-link-color-rgb (tokens). Setting `a { color }`
     here would beat every Bootstrap component colour in the lower ckan layer. */
  a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
  small, .small { font-size: var(--text-sm); }
  strong, b { font-weight: 650; }
  code, kbd, pre, samp { font-family: var(--font-mono); font-size: .875em; }
  kbd { background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 4px; padding: 0 .35em; box-shadow: none; }
  hr { border-color: var(--border); opacity: 1; }
  ::selection { background: var(--nl-sky-200); color: var(--nl-navy-950); }
  img, svg, video { max-width: 100%; }
  table { font-variant-numeric: tabular-nums; }

  :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
  :focus:not(:focus-visible) { outline: none; }

  /* skip link (page.html: .visually-hidden-focusable > a) */
  .visually-hidden-focusable:focus-within {
    position: fixed !important; top: .5rem; left: .5rem; z-index: 1100; width: auto !important; height: auto !important; clip: auto !important;
  }
  .visually-hidden-focusable a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    background: var(--primary); color: var(--primary-foreground); border-radius: var(--radius-md);
    font-weight: 600; text-decoration: none; box-shadow: var(--shadow-lg);
  }
  .visually-hidden-focusable a:focus-visible { outline-color: var(--ring-on-navy); }
}

/* ==========================================================================
   nl.ckan: CKAN / Bootstrap components re-skinned
   ========================================================================== */
@layer nl.ckan {
  /* ---- Page frame --------------------------------------------------- */
  .container, .container-lg, .container-xl, .container-xxl {
    max-width: min(1280px, 100%);
    padding-inline: var(--gutter);
  }
  .main, .homepage .module-feeds { background: var(--background); padding: 0 0 var(--section); }
  [role=main]::after, .main::after { content: none; }

  .toolbar { padding: 1.25rem 0 .75rem; margin: 0; }
  .toolbar .breadcrumb { font-size: var(--text-sm); display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; float: none; }
  .toolbar .breadcrumb li { padding: 0; display: inline-flex; align-items: center; min-height: 24px; }
  .toolbar .breadcrumb li:not(:first-child)::before {
    content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .625rem;
    color: var(--muted-foreground); padding: 0 .5rem 0 .25rem; float: none;
  }
  .toolbar .breadcrumb a { color: var(--muted-foreground); text-decoration: none; }
  .toolbar .breadcrumb a:hover { color: var(--foreground); text-decoration: underline; }
  .toolbar .breadcrumb .active a, .toolbar .breadcrumb a.active { color: var(--foreground); font-weight: 500; }
  .toolbar .home span { display: none; }
  .toolbar .home a { display: inline-flex; align-items: center; gap: .375rem; }
  @media (max-width: 767.98px) {
    .toolbar { padding: .5rem 0 .25rem; }
    /* phone: only "‹ Parent" */
    .toolbar .breadcrumb li { display: none; }
    .toolbar .breadcrumb li:nth-last-child(2) { display: inline-flex; }
    .toolbar .breadcrumb li:nth-last-child(2)::before { content: "\f053"; padding-left: 0; }
    .toolbar .breadcrumb li.home:nth-last-child(2) span { display: inline; }
    .toolbar .breadcrumb li:nth-last-child(2) a { min-height: 44px; display: inline-flex; align-items: center; }
  }

  /* .row.wrapper becomes a grid: sidebar 16rem from 992, 18rem from 1200 */
  .wrapper, .wrapper.row {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem;
    margin: 0; min-height: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0;
  }
  .wrapper::before, .wrapper::after { content: none; display: none; }
  .wrapper > * { width: auto; max-width: none; padding-inline: 0; margin: 0; float: none; }
  .main .primary { float: none; order: 1; min-width: 0; }
  /* z-index:auto: CKAN's z-index:1 would trap the Filters sheet under the sticky bar */
  .main .secondary { order: 2; padding: 0; min-width: 0; z-index: auto; position: static; }
  .main .primary { z-index: auto; }
  @media (min-width: 992px) {
    .wrapper:not(.no-nav) { grid-template-columns: 16rem minmax(0, 1fr); gap: 2.5rem; }
    .main .secondary { order: 0; }
  }
  @media (min-width: 1200px) {
    .wrapper:not(.no-nav) { grid-template-columns: 18rem minmax(0, 1fr); gap: 3rem; }
  }

  /* modules lose the old box look */
  .module { margin: 0 0 2rem; background: none; border: 0; box-shadow: none; }
  .module-content { padding: 0; }
  .module > .module-content:nth-child(2n) { padding-top: 0; }
  .module-content p a:link { text-decoration: underline; }
  .module-heading {
    padding: 1rem 0 .5rem; margin: 0; background: none; border: 0; border-top: 1px solid var(--border);
    font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; line-height: 1.3;
  }
  .module-heading .fa { color: var(--muted-foreground); margin-right: .375rem; }
  .module:first-child .module-heading { border-top-width: 1px; border-radius: 0; }
  .module-narrow .module-heading, .module-narrow .module-content, .module-narrow .module-footer { padding-inline: 0; }
  .module-shallow .module-content { padding: .5rem 0; }
  .module-footer { padding: .25rem 0 0; border: 0; margin: 0; background: none; }
  .module .empty, p.empty { color: var(--muted-foreground); }
  .hide-heading { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  /* sidebar modules (organisation info, help) as quiet cards */
  .secondary > .module, .secondary .context-info {
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; background: var(--card);
  }
  .secondary > .module .module-heading { border-top: 0; padding-top: 0; }
  .secondary .context-info .image img { border-radius: var(--radius-md); max-width: 100%; height: auto; }
  .secondary .nums { display: flex; gap: 1.5rem; margin: 1rem 0 .5rem; }
  .secondary .nums dl { margin: 0; }
  .secondary .nums dt { font-size: var(--text-xs); color: var(--muted-foreground); font-weight: 500; }
  .secondary .nums dd { font-size: var(--text-xl); font-weight: 650; margin: 0; font-variant-numeric: tabular-nums; }

  /* page header with tabs + action */
  .page-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    margin: 0 0 1.5rem; padding: 0; border: 0; background: none;
  }
  .page-header.module-content { padding: 0; }
  .page-header .content_action { order: 2; float: none; display: flex; gap: .5rem; flex-wrap: wrap; }
  .page_primary_action { margin-bottom: 1.25rem; }
  .content_action .btn, .page_primary_action .btn { margin: 0; }

  /* ---- Tabs: segmented control ------------------------------------- */
  .nav-tabs {
    --bs-nav-tabs-border-width: 0;
    display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 4px; margin: 0;
    background: var(--muted); border: 1px solid var(--border); border-radius: calc(var(--radius-md) + 4px);
    max-width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs li, .nav-tabs .nav-item { flex: 0 0 auto; scroll-snap-align: start; margin: 0; }
  .nav-tabs .nav-link, .page-header .nav-tabs li a, .nav-tabs li > a {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 36px; padding: 0 .875rem; margin: 0;
    border: 0; border-radius: var(--radius-md); color: var(--muted-foreground); font-size: var(--text-sm); font-weight: 500;
    background: transparent; white-space: nowrap; text-decoration: none;
    transition: background-color var(--dur-fast) var(--ease-std), color var(--dur-fast) var(--ease-std);
  }
  .nav-tabs .nav-link:hover, .nav-tabs li > a:hover { color: var(--foreground); background: rgb(255 255 255 / .6); }
  .nav-tabs .nav-link.active, .nav-tabs li.active > a, .nav-tabs .active > a, .page-header .nav-tabs li.active a {
    background: var(--background); color: var(--foreground); box-shadow: var(--shadow-xs); border: 0;
  }
  @media (max-width: 991.98px) {
    .nav-tabs .nav-link, .nav-tabs li > a { min-height: 40px; }
  }

  /* ---- Buttons ------------------------------------------------------ */
  .btn {
    --bs-btn-padding-x: 1rem; --bs-btn-padding-y: 0; --bs-btn-font-family: var(--font-sans);
    --bs-btn-font-size: .9375rem; --bs-btn-font-weight: 500; --bs-btn-line-height: 1.2;
    --bs-btn-border-radius: var(--radius-md); --bs-btn-box-shadow: none; --bs-btn-focus-box-shadow: none;
    --bs-btn-disabled-opacity: .5;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 44px; text-decoration: none; white-space: nowrap; text-shadow: none;
    transition: color var(--dur-fast) var(--ease-std), background-color var(--dur-fast) var(--ease-std), border-color var(--dur-fast) var(--ease-std), transform var(--dur-press) var(--ease-std);
  }
  .btn:active { transform: translateY(1px); }
  .btn:disabled, .btn.disabled { cursor: not-allowed; pointer-events: auto; }
  .btn .fa, .btn [class*="fa-"] { font-size: var(--icon-sm); }
  .btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-font-size: var(--text-sm); min-height: 40px; }
  .btn-lg { --bs-btn-padding-x: 1.25rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: var(--radius-md); min-height: 48px; }
  @media (min-width: 992px) {
    .btn { min-height: 40px; }
    .btn-sm { min-height: 32px; }
    .btn-lg { min-height: 48px; }
  }
  .btn-primary {
    --bs-btn-color: #fff; --bs-btn-bg: var(--nl-navy-900); --bs-btn-border-color: var(--nl-navy-900);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--nl-navy-800); --bs-btn-hover-border-color: var(--nl-navy-800);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--nl-navy-950); --bs-btn-active-border-color: var(--nl-navy-950);
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--nl-navy-900); --bs-btn-disabled-border-color: var(--nl-navy-900);
  }
  .btn-secondary, .btn-light {
    --bs-btn-color: var(--nl-navy-900); --bs-btn-bg: var(--nl-sky-100); --bs-btn-border-color: var(--nl-sky-100);
    --bs-btn-hover-color: var(--nl-navy-900); --bs-btn-hover-bg: var(--nl-sky-200); --bs-btn-hover-border-color: var(--nl-sky-200);
    --bs-btn-active-color: var(--nl-navy-900); --bs-btn-active-bg: var(--nl-sky-200); --bs-btn-active-border-color: var(--nl-sky-200);
    --bs-btn-disabled-color: var(--nl-navy-900); --bs-btn-disabled-bg: var(--nl-sky-100); --bs-btn-disabled-border-color: var(--nl-sky-100);
  }
  .btn-default, .btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .btn-warning {
    --bs-btn-color: var(--foreground); --bs-btn-bg: var(--background); --bs-btn-border-color: var(--border);
    --bs-btn-hover-color: var(--foreground); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--nl-sky-200);
    --bs-btn-active-color: var(--foreground); --bs-btn-active-bg: var(--nl-sky-100); --bs-btn-active-border-color: var(--nl-sky-200);
    --bs-btn-disabled-color: var(--foreground); --bs-btn-disabled-bg: var(--background); --bs-btn-disabled-border-color: var(--border);
    box-shadow: var(--shadow-xs);
  }
  .btn-warning { --bs-btn-color: var(--warning); --bs-btn-hover-color: var(--warning); --bs-btn-hover-bg: var(--warning-bg); --bs-btn-hover-border-color: var(--warning-border); }
  .btn-danger, .btn-outline-danger {
    --bs-btn-color: #fff; --bs-btn-bg: var(--destructive); --bs-btn-border-color: var(--destructive);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #912018; --bs-btn-hover-border-color: #912018;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #7a1b14; --bs-btn-active-border-color: #7a1b14;
  }
  .btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #256329; --bs-btn-hover-border-color: #256329;
  }
  .btn-link {
    --bs-btn-color: var(--link); --bs-btn-hover-color: var(--nl-navy-900); --bs-btn-active-color: var(--nl-navy-900);
    --bs-btn-padding-x: .25rem; text-decoration: underline; text-underline-offset: 3px; box-shadow: none;
  }
  .btn-close { width: 44px; height: 44px; padding: 0; background-size: 14px; opacity: .7; border-radius: var(--radius-md); }
  .btn-close:hover { opacity: 1; background-color: var(--accent); }
  .btn-close:focus { box-shadow: none; }

  /* ---- Forms -------------------------------------------------------- */
  .form-group, .control-group { margin-bottom: 1.25rem; }
  .form-label, .control-label, .form-group > label {
    display: block; margin: 0 0 .375rem; font-size: var(--text-sm); font-weight: 600; color: var(--foreground);
  }
  .form-label::after, .control-label::after { content: none; }
  .control-required { color: var(--destructive); font-weight: 600; margin-right: .125rem; }
  .form-control, .form-select, select.form-control,
  input[type=text], input[type=email], input[type=url], input[type=password], input[type=search], input[type=number], input[type=date], input[type=tel], select, textarea {
    font-family: var(--font-sans); font-size: 1rem; color: var(--foreground); background-color: var(--background);
    border: 1px solid var(--input); border-radius: var(--radius-md); box-shadow: none;
    transition: border-color var(--dur-fast) var(--ease-std), box-shadow var(--dur-fast) var(--ease-std);
  }
  .form-control, .form-select, select.form-control,
  input[type=text], input[type=email], input[type=url], input[type=password], input[type=search], input[type=number], input[type=date], input[type=tel], select {
    min-height: var(--control-h); padding: .5rem .75rem; line-height: 1.4;
  }
  textarea, textarea.form-control { min-height: 7rem; padding: .625rem .75rem; line-height: 1.55; }
  .form-select, select.form-control { padding-right: 2.25rem; }
  .form-control::placeholder { color: #6b8394; opacity: 1; }
  .form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-halo); outline: none;
  }
  .form-control:disabled, .form-control[readonly] { background: var(--muted); color: var(--muted-foreground); }
  .form-check-input { width: 1.125rem; height: 1.125rem; border-color: var(--input); margin-top: .2rem; }
  .form-check-input:checked { background-color: var(--nl-navy-900); border-color: var(--nl-navy-900); }
  .form-check-input:focus { box-shadow: 0 0 0 3px var(--ring-halo); border-color: var(--ring); }
  .checkbox, .radio, .form-check { min-height: 32px; display: flex; align-items: flex-start; gap: .5rem; }
  .checkbox input, .radio input { width: 1.125rem; height: 1.125rem; margin-top: .2rem; accent-color: var(--nl-navy-900); flex: 0 0 auto; }
  .radio-group label, .checkbox-group label { font-weight: 400; }
  .controls .checkbox, .controls .radio { font-weight: 400; font-size: 1rem; }

  .error .form-control, .error .form-select, .error input, .error select, .error textarea,
  .form-control[aria-invalid=true], [aria-invalid=true] { border-color: var(--destructive); }
  .error .form-label, .error .control-label { color: var(--error); }
  .error-block, .error .error-block, span.error-block {
    display: flex; align-items: flex-start; gap: .375rem; margin-top: .375rem; padding: 0; background: none; border: 0;
    color: var(--error); font-size: var(--text-xs); font-weight: 500; line-height: 1.4;
  }
  .error-block::before { content: "\f06a"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .8125rem; }
  .info-block, .info-inline, .form-text {
    display: flex; gap: .5rem; align-items: flex-start; margin-top: .375rem; padding: 0; background: none;
    color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.45;
  }
  .info-block .fa { margin-top: .2rem; font-size: .8125rem; }
  .info-block a { color: var(--link); }
  .control-medium .form-control, .control-medium input, .control-medium select { max-width: 100%; }
  .control-full .form-control, .control-large .form-control { width: 100%; }
  .input-group > .form-control { min-width: 0; }
  .input-group-text { background: var(--muted); border-color: var(--input); color: var(--muted-foreground); font-size: var(--text-sm); }
  .slug-preview { font-size: var(--text-sm); color: var(--muted-foreground); }
  .editor-info-block {
    display: block; margin-top: -1px; padding: .375rem .75rem; font-size: var(--text-xs); color: var(--muted-foreground);
    background: var(--muted); border: 1px solid var(--input); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  .controls:has(.editor-info-block) textarea { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .nl-form-title { font-size: var(--text-3xl); margin: 0 0 1.25rem; }
  .slug-preview .btn { min-height: 32px; }
  .image-upload .btn, .resource-upload-field .btn { min-height: var(--control-h); }

  .error-explanation, .alert.error-explanation { border-radius: var(--radius-lg); }
  .error-explanation ul { margin: .25rem 0 0; padding-left: 1.25rem; }

  .form-actions {
    display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; justify-content: flex-end; gap: .75rem;
    margin: 2rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--border); background: none; text-align: left;
  }
  .form-actions .action-info { flex: 1 1 100%; margin: 0; color: var(--muted-foreground); font-size: var(--text-xs); line-height: 1.5; order: -1; }
  .form-actions .btn { margin: 0; flex: 0 0 auto; }
  .form-actions .btn-danger { margin-right: auto; }
  @media (max-width: 575.98px) { .form-actions .btn { flex: 1 1 auto; } }

  /* ---- Badges ------------------------------------------------------- */
  .badge {
    display: inline-flex; align-items: center; gap: .25rem; min-height: 22px; padding: 0 .5rem;
    border-radius: var(--radius-sm); font-size: .78125rem; font-weight: 600; line-height: 1; letter-spacing: 0;
  }
  .badge-default, .badge[data-format] {
    border: 1px solid var(--border); text-transform: uppercase; font-size: .71875rem; letter-spacing: .02em; text-decoration: none;
  }
  .bg-secondary, .badge.bg-secondary { background-color: var(--muted) !important; color: var(--muted-foreground) !important; }
  .bg-info { background-color: var(--info-bg) !important; color: var(--info) !important; }
  .bg-danger { background-color: var(--error-bg) !important; color: var(--error) !important; }
  .item-count, .badge.item-count {
    min-height: 20px; padding: 0 .4rem; border-radius: var(--radius-pill); background: var(--muted); color: var(--muted-foreground);
    font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums;
  }

  /* ---- Alerts ------------------------------------------------------- */
  .alert {
    --bs-alert-border-radius: var(--radius-lg); --bs-alert-padding-x: 1rem; --bs-alert-padding-y: .875rem;
    border: 1px solid var(--info-border); background: var(--info-bg); color: var(--foreground);
    font-size: var(--text-sm); line-height: 1.5; box-shadow: none; text-shadow: none;
  }
  .alert a { color: inherit; font-weight: 600; text-decoration: underline; }
  .alert-success { background: var(--success-bg); border-color: var(--success-border); }
  .alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
  .alert-danger, .alert-error { background: var(--error-bg); border-color: var(--error-border); color: var(--error); }
  .alert-info { background: var(--info-bg); border-color: var(--info-border); }
  .alert-dismissible { padding-right: 3.5rem; }
  .alert-dismissible .btn-close { top: 50%; transform: translateY(-50%); padding: 0; right: .25rem; }
  .flash-messages { margin-top: 1rem; }
  .flash-messages:empty { display: none; }
  .flash-messages .alert { margin-bottom: .75rem; }

  /* ---- Dropdown, modal, popover, toast ------------------------------ */
  .dropdown-menu {
    --bs-dropdown-border-color: var(--border); --bs-dropdown-border-radius: var(--radius-md);
    --bs-dropdown-link-hover-bg: var(--accent); --bs-dropdown-link-active-bg: var(--nl-sky-100); --bs-dropdown-link-active-color: var(--foreground);
    --bs-dropdown-padding-y: .25rem; --bs-dropdown-font-size: var(--text-sm); --bs-dropdown-zindex: 1000;
    padding: .25rem; box-shadow: var(--shadow-md); min-width: 13rem;
  }
  .dropdown-item {
    display: flex; align-items: center; gap: .625rem; min-height: 36px; padding: 0 .625rem; border-radius: calc(var(--radius-md) - 2px);
    color: var(--foreground); font-weight: 500; white-space: nowrap; text-decoration: none;
  }
  .dropdown-item .fa, .dropdown-item [class*="fa-"] { width: 1rem; text-align: center; color: var(--muted-foreground); }
  .dropdown-header { font-size: var(--text-xs); color: var(--muted-foreground); padding: .5rem .625rem .375rem; white-space: normal; }
  .dropdown-divider { margin: .25rem -.25rem; border-color: var(--border); }
  .modal { --bs-modal-zindex: 1055; }
  .modal-content { border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
  .modal-header, .modal-footer { border-color: var(--border); }
  .modal-backdrop { --bs-backdrop-bg: var(--nl-navy-950); --bs-backdrop-opacity: .5; }
  .offcanvas-backdrop { --bs-backdrop-bg: var(--nl-navy-950); --bs-backdrop-opacity: .5; }
  .popover { --bs-popover-border-color: var(--border); --bs-popover-border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-family: var(--font-sans); }
  .tooltip { --bs-tooltip-bg: var(--nl-navy-950); --bs-tooltip-border-radius: var(--radius-sm); --bs-tooltip-font-size: var(--text-xs); --bs-tooltip-max-width: 18rem; font-family: var(--font-sans); }
  .toast-container { z-index: 1090; padding: 1rem !important; }
  .toast {
    --bs-toast-bg: var(--popover); --bs-toast-border-color: var(--border); --bs-toast-border-radius: var(--radius-lg);
    --bs-toast-box-shadow: var(--shadow-lg); --bs-toast-max-width: 24rem; --bs-toast-font-size: var(--text-sm);
    --bs-toast-header-bg: transparent; --bs-toast-header-color: var(--foreground); --bs-toast-header-border-color: transparent;
  }
  .toast-header { font-weight: 600; padding: .75rem 1rem .25rem; }
  .toast-body { padding: .25rem 1rem .875rem; }
  @media (max-width: 575.98px) {
    .toast-container { left: 0 !important; right: 0 !important; width: 100%; padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important; }
    .toast { width: 100%; }
  }

  /* ---- Pagination --------------------------------------------------- */
  .pagination-wrapper, .pagination { margin: 2rem 0 0; }
  .pagination {
    --bs-pagination-color: var(--foreground); --bs-pagination-bg: transparent; --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: transparent; --bs-pagination-border-radius: var(--radius-md);
    --bs-pagination-hover-color: var(--foreground); --bs-pagination-hover-bg: var(--accent); --bs-pagination-hover-border-color: transparent;
    --bs-pagination-focus-box-shadow: none; --bs-pagination-focus-bg: var(--accent);
    --bs-pagination-active-color: var(--foreground); --bs-pagination-active-bg: var(--background); --bs-pagination-active-border-color: var(--border);
    --bs-pagination-disabled-color: var(--muted-foreground); --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-border-color: transparent;
    display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem;
  }
  .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md) !important; font-weight: 500; font-variant-numeric: tabular-nums; }
  .page-item.active .page-link { box-shadow: var(--shadow-xs); }
  .page-item:not(:first-child) .page-link { margin-left: 0; }
  @media (max-width: 575.98px) {
    .pagination .page-item:not(.active):not(:first-child):not(:last-child) { display: none; }
    .page-link { min-width: 44px; min-height: 44px; }
  }

  /* ---- Tables ------------------------------------------------------- */
  .table {
    --bs-table-bg: transparent; --bs-table-border-color: var(--border); --bs-table-striped-bg: var(--muted);
    --bs-table-hover-bg: var(--muted); --bs-table-color: var(--foreground);
    margin: 0; font-size: var(--text-sm);
  }
  .table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: var(--border); }
  .table thead th, .table > thead > tr > th {
    background: var(--muted); color: var(--muted-foreground); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; border-bottom-width: 1px;
  }
  .table-chunky td, .table-chunky th { padding: .75rem 1rem; }
  .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
  .additional-info, .table-condensed { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; border-collapse: separate; border-spacing: 0; width: 100%; }
  .additional-info th, .table th.dataset-label { width: 34%; font-weight: 600; color: var(--muted-foreground); background: transparent; }
  .additional-info tr:last-child > * { border-bottom: 0; }
  .additional-info td, .additional-info th { overflow-wrap: anywhere; }
  @media (max-width: 575.98px) {
    .additional-info table, .additional-info tbody, .additional-info tr, .additional-info th, .additional-info td,
    table.additional-info, table.additional-info tbody, table.additional-info tr, table.additional-info th, table.additional-info td { display: block; width: auto; }
    .additional-info thead { display: none; }
    .additional-info th { padding-bottom: 0 !important; border-bottom: 0 !important; font-size: var(--text-xs); }
    .additional-info td { padding-top: .125rem !important; }
  }

  /* ---- Search page -------------------------------------------------- */
  .search-form {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
    margin: 0 0 1rem; padding: 0; border: 0; background: none;
  }
  .search-form .search-input-group, .search-form .input-group { order: 1; flex: 1 1 100%; margin: 0; }
  .search-form h1, .search-form h2 { order: 2; flex: 1 1 auto; margin: .5rem 0 0; font-size: var(--text-2xl); }
  .search-form .control-order-by { order: 3; display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; float: none; }
  .search-form .control-order-by label { margin: 0; font-size: var(--text-sm); color: var(--muted-foreground); font-weight: 500; white-space: nowrap; }
  .search-form .control-order-by select { width: auto; min-width: 11rem; }
  .search-form .nl-search-tools { order: 4; flex: 1 1 100%; }
  .search-form > span { order: 5; }
  .search-form .search-input-group .form-control, .search-form #field-giant-search {
    min-height: 48px; font-size: 1rem; padding-left: 1rem; border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: 0;
  }
  .search-form .search-input-group .btn {
    --bs-btn-bg: var(--nl-navy-900); --bs-btn-border-color: var(--nl-navy-900); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--nl-navy-800); --bs-btn-hover-border-color: var(--nl-navy-800); --bs-btn-hover-color: #fff;
    min-width: 52px; min-height: 48px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }
  .search-form.no-bottom-border { border: 0; }
  .search-form .filter-list { margin: 0; }
  #search-results { transition: opacity var(--dur-base) var(--ease-std); }
  html.nl-loading #search-results { opacity: .6; }
  .nl-api-note { display: flex; gap: .5rem; align-items: baseline; color: var(--muted-foreground); font-size: var(--text-sm); margin: 0; }
  .nl-api-note .fa { color: var(--nl-sky-500); }

  /* Active-filter chips */
  .nl-search-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
  @media (max-width: 991.98px) {
    .nl-search-tools {
      position: sticky; top: var(--header-h); z-index: 20; margin-inline: calc(-1 * var(--gutter)); padding: .5rem var(--gutter);
      background: rgb(255 255 255 / .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
    }
  }
  @media (min-width: 992px) {
    .nl-filters-btn { display: none; }
    .nl-search-tools:not(:has(.nl-chips)) { display: none; }
  }
  .nl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; padding: 0; list-style: none; }
  .nl-chips .pill, .filter-list .pill {
    display: inline-flex; align-items: center; gap: .375rem; min-height: 32px; padding: 0 .25rem 0 .75rem; margin: 0;
    background: var(--secondary); color: var(--secondary-foreground); border-radius: var(--radius-pill);
    font-size: var(--text-sm); font-weight: 500; line-height: 1.2;
  }
  .nl-chips .pill .facet { color: var(--muted-foreground); font-weight: 500; }
  .nl-chips .pill a.remove, .filter-list .pill a.remove {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
    color: var(--nl-navy-900); font-size: .75rem; text-decoration: none; position: relative;
  }
  .nl-chips .pill a.remove::after { content: ""; position: absolute; inset: -10px; }
  .nl-chips .pill a.remove:hover { background: var(--nl-sky-200); }
  .nl-chips__clear .btn { min-height: 32px; }

  /* Facets */
  .filters { background: none; padding: 0; position: static; }
  .filters > div { background: none; border-radius: 0; overflow: visible; }
  .filters .module-footer { display: block; }
  .filters .hide-filters, .hide-filters { display: none !important; }
  .nav-facet { display: flex; flex-direction: column; gap: 1px; margin: 0 0 .25rem; padding: 0; }
  .nav-facet .nav-item, .nav-simple > li { margin: 0; padding: 0; border: 0; }
  .nav-facet .nav-item > a {
    display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: .625rem;
    min-height: 40px; padding: .375rem .5rem; margin: 0 -.5rem; border-radius: var(--radius-md);
    color: var(--foreground); font-size: var(--text-sm); line-height: 1.35; text-decoration: none; background: none;
  }
  .nav-facet .nav-item > a:hover { background: var(--accent); color: var(--foreground); }
  .nav-facet .item-label { overflow-wrap: anywhere; white-space: normal; }
  .nav-facet .item-count { justify-self: end; background: none; color: var(--muted-foreground); padding: 0; font-weight: 500; }
  .nl-facet__box {
    width: 16px; height: 16px; border: 1px solid var(--input); border-radius: 4px; background: var(--background);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .nav-facet .nav-item.active > a { background: var(--nl-sky-50); font-weight: 600; }
  .nav-facet .nav-item.active .nl-facet__box { background: var(--nl-navy-900); border-color: var(--nl-navy-900); }
  .nav-facet .nav-item.active .nl-facet__box::after {
    content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px);
  }
  .nav-facet .facet-close, .nav-facet .separator { display: none; }
  .filters .read-more, .module-footer .read-more { font-size: var(--text-sm); font-weight: 500; color: var(--link); text-decoration: underline; display: inline-flex; min-height: 32px; align-items: center; }
  .filters .module { margin-bottom: 1rem; }
  .filters .module-content.empty { font-size: var(--text-sm); }
  @media (max-width: 991.98px) {
    .nav-facet .nav-item > a { min-height: 44px; }
  }

  /* ---- Dataset list rows ------------------------------------------- */
  .dataset-list { display: flex; flex-direction: column; gap: .75rem; margin: 0; padding: 0; }
  .dataset-item {
    position: relative; display: flex; flex-direction: column; gap: .5rem;
    padding: 1rem; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
    transition: border-color var(--dur-fast) var(--ease-std);
  }
  .dataset-item:last-of-type { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin: 0; }
  .dataset-item:hover { border-color: var(--nl-sky-200); }
  .dataset-item:has(.nl-stretched:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
  @media (min-width: 768px) { .dataset-item, .dataset-item:last-of-type { padding: 1.25rem; } }
  .dataset-item .dataset-content { display: flex; flex-direction: column; gap: .5rem; }
  .dataset-heading { margin: 0; font-size: var(--text-xl); font-weight: 600; line-height: 1.3; }
  .dataset-heading a { color: var(--foreground); text-decoration: none; }
  .dataset-heading a:hover { color: var(--nl-navy-900); text-decoration: underline; text-decoration-color: var(--nl-sky-300); }
  .dataset-item .nl-stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .dataset-item .nl-stretched:focus-visible { outline: none; }
  .dataset-item .dataset-notes { margin: 0; color: var(--muted-foreground); font-size: .9375rem; }
  .dataset-item p.empty { margin: 0; font-size: var(--text-sm); font-style: italic; }
  .dataset-resources { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0; padding: 0; }
  .dataset-resources li { display: inline-flex; }
  .dataset-resources li a { background: none; }
  .dataset-private { display: none; }

  /* ---- Resource pages ---------------------------------------------- */
  .resource-list { padding: 0; margin: 0; }
  .resource-item { padding: .75rem .75rem .75rem 3.5rem; border-radius: var(--radius-md); }
  .resource-item:hover { background: var(--muted); }
  .resource-item .heading { color: var(--foreground); font-size: var(--text-base); font-weight: 600; }
  .format-label { border-radius: var(--radius-sm); }
  .resource-view, .resource-view-container { border-radius: var(--radius-lg); }
  .module-resource .actions ul { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
  .resource-view iframe, .module-resource iframe { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--muted); aspect-ratio: 16 / 10; height: auto; min-height: 320px; }
  .prose, .notes, .embedded-content { overflow-wrap: anywhere; }

  /* ---- Tags --------------------------------------------------------- */
  .tag-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
  .tag-list li { margin: 0; }
  .tag, .tag-list .tag {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 .75rem; border-radius: var(--radius-pill);
    background: var(--background); color: var(--foreground); border: 1px solid var(--border); font-size: var(--text-sm);
    font-weight: 500; text-decoration: none; box-shadow: none; text-shadow: none;
  }
  .tag:hover { background: var(--accent); border-color: var(--nl-sky-200); color: var(--foreground); }

  /* ---- Groups / organisations listing ------------------------------ */
  /* Fallback for any core list still using media-grid: no patterned background */
  .media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; background: none; border: 0; }
  .media-grid .media-item {
    position: relative; float: none; width: auto; margin: 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--card); display: flex; flex-direction: column; gap: .5rem; min-height: 0; transition: border-color var(--dur-fast) var(--ease-std);
  }
  .media-grid .media-item:hover { border-color: var(--nl-sky-200); }
  .media-grid .media-image { border-radius: var(--radius-md); max-height: 72px; width: auto; object-fit: contain; align-self: flex-start; }
  .media-grid .media-heading { font-size: var(--text-lg); font-weight: 600; margin: 0; }
  .media-grid .media-view { position: absolute; inset: 0; border: 0; border-radius: inherit; }
  .media-grid .media-view span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .media-grid .media-view:hover { border: 0; box-shadow: none; }
  .media-grid .count { color: var(--muted-foreground); font-size: var(--text-sm); }
  .media-grid .media-description { color: var(--muted-foreground); font-size: var(--text-sm); }

  /* ---- Stages (core 2-step, used outside the wizard) -------------- */
  .stages { display: none; }

  /* ---- Activity / user pages -------------------------------------- */
  .activity .item .date { color: var(--muted-foreground); }
  .user-image, img.user-image, .gravatar { border-radius: 50%; }
  .context-info .nums { display: flex; gap: 1rem; }

  /* ---- Admin ------------------------------------------------------- */
  .ckan-admin .module-content, .admin .module-content { padding: 0; }

  /* ---- Footer (CKAN shell) ----------------------------------------- */
  .site-footer {
    background: var(--nl-navy-900); color: #fff; padding: var(--section) 0 1.5rem; margin-top: 0;
    font-size: var(--text-sm); line-height: 1.6;
    --ring: var(--ring-on-navy);
  }
  .site-footer a { color: var(--nl-sky-200); }
  .site-footer a:hover { color: #fff; }
  .site-footer :focus-visible { outline-color: var(--ring-on-navy); }
}

/* ==========================================================================
   nl.components: NEXTLOGIC components
   ========================================================================== */
@layer nl.components {
  /* Preview disclaimer (templates/page.html, h.nl_preview_banner).
     Orange #f28c1e with near-black text: 8.6:1 contrast (AA/AAA). */
  .nl-preview-banner {
    background: #f28c1e;
    color: #1f1300;
    border-bottom: 1px solid #c86b0a;
    font-size: var(--text-sm, .875rem);
    line-height: 1.4;
  }
  .nl-preview-banner__inner {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding-block: .5rem;
  }
  .nl-preview-banner__inner .fa { margin-top: .15em; flex: none; }
  .nl-preview-banner__text { margin: 0; text-wrap: pretty; }
  .nl-preview-banner__text strong { font-weight: 700; }

  /* ---- Header ------------------------------------------------------- */
  .nl-header {
    position: sticky; top: 0; z-index: 1020;
    /* solid: a backdrop-filter here would become the containing block of the
       fixed menu sheet inside the header and clip it to 56px */
    background: var(--background);
    border-bottom: 1px solid var(--border);
  }
  .nl-header__inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
  .nl-brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--foreground); min-height: 44px; flex: 0 0 auto; }
  .nl-brand__logo { display: block; height: 24px; width: auto; }
  .nl-brand__product {
    font-size: var(--text-sm); font-weight: 600; color: var(--muted-foreground); line-height: 1.1;
    padding-left: .75rem; border-left: 1px solid var(--border); white-space: nowrap;
  }
  @media (min-width: 992px) { .nl-brand__logo { height: 26px; } }
  @media (max-width: 575.98px) { .nl-brand__product { display: none; } }
  .nl-header__toggle { margin-left: auto; padding-inline: .75rem; }
  .btn-ghost {
    --bs-btn-color: var(--foreground); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--foreground); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--foreground); --bs-btn-active-bg: var(--nl-sky-100); --bs-btn-active-border-color: transparent;
  }
  .btn-cta {
    --bs-btn-color: var(--cta-foreground); --bs-btn-bg: var(--cta); --bs-btn-border-color: var(--cta-border);
    --bs-btn-hover-color: var(--cta-foreground); --bs-btn-hover-bg: var(--cta-hover); --bs-btn-hover-border-color: var(--cta-border);
    --bs-btn-active-color: var(--cta-foreground); --bs-btn-active-bg: var(--cta-hover); --bs-btn-active-border-color: var(--nl-lime-800);
    --bs-btn-disabled-color: var(--cta-foreground); --bs-btn-disabled-bg: var(--cta); --bs-btn-disabled-border-color: var(--cta-border);
    font-weight: 600;
  }

  /* Navigation: sheet below 992px, inline from 992px */
  .nl-nav { --bs-offcanvas-width: min(22rem, 88vw); --bs-offcanvas-border-color: var(--border); --bs-offcanvas-zindex: 1045; }
  .nl-nav .offcanvas-header { min-height: var(--header-h); padding: .5rem .5rem .5rem 1.25rem; border-bottom: 1px solid var(--border); }
  .nl-nav .offcanvas-title { font-size: var(--text-lg); margin: 0; }
  .nl-nav__body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); }
  .nl-nav__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .nl-nav__link {
    display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 44px; padding: 0 .75rem;
    border: 0; background: none; border-radius: var(--radius-md); color: var(--foreground); font: inherit;
    font-size: 1rem; font-weight: 500; text-decoration: none; text-align: left; position: relative; white-space: nowrap;
  }
  .nl-nav__link:hover { background: var(--accent); color: var(--foreground); }
  .nl-nav__link.is-active { color: var(--nl-navy-900); background: var(--nl-sky-50); font-weight: 600; }
  .nl-nav__link .fa, .nl-nav__link [class*="fa-"] { width: 1.125rem; text-align: center; color: var(--muted-foreground); }
  .nl-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 .375rem;
    border-radius: var(--radius-pill); background: var(--nl-navy-900); color: #fff; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .nl-header-search { position: relative; order: -1; }
  .nl-header-search > .fa, .nl-header-search > [class*="fa-"] { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); font-size: var(--icon-sm); pointer-events: none; }
  .nl-header-search .form-control { padding-left: 2.5rem; padding-right: 2.5rem; background: var(--muted); border-color: var(--border); }
  .nl-header-search .form-control:focus { background: var(--background); }
  .nl-header-search__key { position: absolute; right: .625rem; top: 50%; transform: translateY(-50%); font-size: .75rem; pointer-events: none; }
  .nl-account { display: flex; flex-direction: column; gap: .5rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
  .nl-account__list { display: flex; flex-direction: column; gap: 2px; padding: 0; margin: 0; list-style: none; }
  .nl-account__list form { margin: 0; }
  .nl-account__who { display: flex; align-items: center; gap: .75rem; padding: .25rem .75rem .75rem; }
  .nl-account__who img { border-radius: 50%; }
  .nl-account__who span { display: flex; flex-direction: column; line-height: 1.25; }
  .nl-account__who small { color: var(--muted-foreground); }
  .nl-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto;
    border-radius: 50%; background: var(--nl-sky-100); color: var(--nl-navy-900); font-size: .6875rem; font-weight: 700; letter-spacing: .02em;
  }
  .nl-avatar--lg { width: 36px; height: 36px; font-size: .8125rem; }
  .nl-account__trigger { gap: .5rem; padding-inline: .375rem .625rem; max-width: 12rem; }
  .nl-account__name { overflow: hidden; text-overflow: ellipsis; }
  .nl-account .btn { width: 100%; }

  @media (min-width: 992px) {
    .nl-nav { flex: 1 1 auto; min-width: 0; }
    .nl-nav__body { flex-direction: row; align-items: center; gap: .75rem; padding: 0; width: 100%; }
    .nl-nav__main { order: 1; flex: 0 1 auto; }
    .nl-nav__list { flex-direction: row; gap: 0; }
    .nl-nav__link { width: auto; min-height: 40px; font-size: .9375rem; padding: 0 .625rem; }
    .nl-nav__link.is-active { background: none; }
    .nl-nav__link.is-active::after {
      content: ""; position: absolute; left: .625rem; right: .625rem; bottom: calc((var(--header-h) - 40px) / -2);
      height: 2px; background: var(--nl-navy-900); border-radius: 2px 2px 0 0;
    }
    .nl-header-search { order: 2; margin-left: auto; width: clamp(10rem, 14vw, 13.5rem); flex: 0 0 auto; }
    .nl-nav__main { flex-shrink: 0; }
    .nl-header-search--quiet { visibility: hidden; }
    .nl-account { order: 3; flex-direction: row; align-items: center; margin: 0; padding: 0; border: 0; gap: .5rem; }
    .nl-account .btn { width: auto; }
  }
  @media (min-width: 992px) and (max-width: 1499.98px) { .nl-brand__product { display: none; } }
  @media (min-width: 992px) and (max-width: 1599.98px) { .nl-header:has(.nl-nav__item:nth-child(6)) .nl-brand__product { display: none; } }
  @media (min-width: 992px) and (max-width: 1199.98px) {
    .nl-header__inner { gap: .75rem; }
    .nl-brand__logo { height: 22px; }
    .nl-nav__link { padding: 0 .5rem; }
    .nl-account__name { display: none; }
    .nl-header-search { width: 2.75rem; }
    .nl-header-search:focus-within { width: 14rem; }
    .nl-header-search .form-control { padding-right: .5rem; }
    .nl-header-search__key { display: none !important; }
    .nl-account__register { display: none; }
  }

  /* Hidden sheets leave the layout entirely: a fixed element parked with
     translateX(100%) still widens the scrollable area (390px viewport -> 733px). */
  @media (max-width: 991.98px) {
    .nl-nav.offcanvas-lg:not(.show):not(.showing):not(.hiding),
    .nl-filters.offcanvas-lg:not(.show):not(.showing):not(.hiding) { display: none; }
    .nl-nav.offcanvas-lg { display: flex; }
    @starting-style {
      .nl-nav.offcanvas-lg.showing { transform: translateX(100%); }
      .nl-filters.offcanvas-lg.showing { transform: translateY(100%); }
    }
  }

  /* htmx progress: 2px gradient bar under the header */
  .nl-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
  .nl-progress::before {
    content: ""; position: absolute; inset: 0; background: var(--nl-gradient); transform: scaleX(0); transform-origin: left; opacity: 0;
  }
  html.nl-loading .nl-progress::before { opacity: 1; transform: scaleX(.85); transition: transform 2s var(--ease-out), opacity var(--dur-fast); }
  html.nl-loaded .nl-progress::before { opacity: 0; transform: scaleX(1); transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-base) var(--dur-fast); }

  /* ---- Filters sheet ----------------------------------------------- */
  .nl-filters { --bs-offcanvas-height: min(85dvh, 44rem); --bs-offcanvas-zindex: 1045; --bs-offcanvas-border-color: var(--border); }
  @media (max-width: 991.98px) {
    .nl-filters { border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
    .nl-filters .offcanvas-header { padding: .5rem .5rem .5rem 1.25rem; border-bottom: 1px solid var(--border); }
    .nl-filters .offcanvas-header::before {
      content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--border);
    }
    .nl-filters .offcanvas-title { font-size: var(--text-lg); margin: 0; }
    .nl-filters .offcanvas-body { padding: .5rem 1.25rem 1rem; overflow-y: auto; flex: 1 1 auto; }
    .nl-filters__footer { padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--background); }
  }
  @media (min-width: 992px) {
    .nl-filters { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100dvh - var(--header-h) - 2rem); overflow-y: auto; scrollbar-width: thin; padding-right: .25rem; }
    .nl-filters .offcanvas-body { display: block; }
    .nl-filters__heading { font-size: var(--text-lg); margin: .25rem 0 .25rem; }
  }

  /* ---- Home -------------------------------------------------------- */
  .homepage > #content:not(:has(.alert)) { display: none; }
  .nl-hero {
    position: relative; overflow: hidden; color: #fff; background: var(--nl-navy-900);
    padding: clamp(2rem, 1.5rem + 3vw, 4.5rem) 0 clamp(2rem, 1.5rem + 2.5vw, 4rem);
    --ring: var(--ring-on-navy);
  }
  .nl-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(60rem 30rem at 85% 20%, rgb(50 146 195 / .28), transparent 60%),
      radial-gradient(40rem 24rem at 10% 110%, rgb(166 206 84 / .12), transparent 60%);
  }
  .nl-hero :focus-visible { outline-color: var(--ring-on-navy); }
  .nl-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; align-items: center; }
  @media (min-width: 992px) { .nl-hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 3rem; } }
  .nl-hero__title { color: #fff; font-size: var(--text-4xl); font-weight: 680; line-height: 1.06; letter-spacing: -.025em; max-width: 20ch; margin: 0 0 1rem; }
  .nl-hero__lead { color: #d4e7f3; font-size: var(--text-lg); max-width: 52ch; margin: 0 0 1.5rem; }
  .nl-hero-search { max-width: 40rem; margin: 0 0 1rem; }
  .nl-hero-search__frame {
    position: relative; display: flex; align-items: center; gap: .5rem; padding: .375rem .375rem .375rem 2.75rem;
    background: #fff; border-radius: var(--radius-xl);
    box-shadow: 0 0 0 2px transparent, var(--shadow-lg);
    border: 2px solid transparent;
    background-image: linear-gradient(#fff, #fff), var(--nl-gradient);
    background-origin: border-box; background-clip: padding-box, border-box;
  }
  .nl-hero-search__frame > .fa, .nl-hero-search__frame > [class*="fa-"] { position: absolute; left: 1rem; color: var(--muted-foreground); }
  .nl-hero-search .form-control { border: 0; box-shadow: none; padding: 0; min-height: 44px; font-size: 1.0625rem; background: transparent; flex: 1 1 auto; min-width: 0; }
  .nl-hero-search .form-control:focus { box-shadow: none; }
  .nl-hero-search__frame:focus-within { box-shadow: 0 0 0 3px rgb(166 206 84 / .55), var(--shadow-lg); }
  .nl-hero-search .btn-cta { min-height: 44px; padding-inline: 1.25rem; border-radius: calc(var(--radius-xl) - 6px); flex: 0 0 auto; }
  .nl-hero__chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1.25rem; list-style: none; }
  .nl-chip {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 .875rem; border-radius: var(--radius-pill);
    font-size: var(--text-sm); font-weight: 500; text-decoration: none; transition: background-color var(--dur-fast) var(--ease-std);
  }
  .nl-chip--on-navy { background: rgb(255 255 255 / .10); color: #fff; border: 1px solid rgb(255 255 255 / .14); }
  .nl-chip--on-navy:hover { background: rgb(255 255 255 / .18); color: #fff; }
  .nl-hero__stats { margin: 0; color: #bfdff0; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

  /* Signature: the route line linking the pilot cities */
  .nl-route { position: relative; height: 11rem; margin: .25rem 0 0; }
  @media (min-width: 576px) { .nl-route { height: 13rem; } }
  @media (min-width: 992px) { .nl-route { height: auto; aspect-ratio: 5 / 4; max-height: 24rem; } }
  .nl-route__line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .nl-route__shadow { fill: none; stroke: rgb(255 255 255 / .12); stroke-width: 10; stroke-linecap: round; vector-effect: non-scaling-stroke; }
  .nl-route__path { fill: none; stroke: url(#nl-route-grad); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
  /* The line draws in once, left to right (a wipe: dash offsets break with non-scaling strokes) */
  @media (prefers-reduced-motion: no-preference) {
    .nl-route__line { animation: nl-draw 1.4s var(--ease-out) .2s both; }
    .nl-pin { animation: nl-pin-in var(--dur-enter) var(--ease-out) .3s both; }
    .nl-pin--hag { animation-delay: .6s; } .nl-pin--aar { animation-delay: .9s; } .nl-pin--wro { animation-delay: 1.2s; }
    @keyframes nl-draw { from { clip-path: inset(-10% 100% -10% -10%); } to { clip-path: inset(-10% -10% -10% -10%); } }
    @keyframes nl-pin-in { from { opacity: 0; } to { opacity: 1; } }
  }
  .nl-route__pins { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
  .nl-pin { position: absolute; left: var(--x); top: var(--y); }
  .nl-pin a {
    position: absolute; left: 0; top: 0; transform: translate(-9px, -50%);
    display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding-right: .5rem;
    color: #fff; text-decoration: none; white-space: nowrap; border-radius: var(--radius-md);
  }
  .nl-pin__dot {
    width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; background: var(--nl-navy-900);
    border: 3px solid var(--nl-lime-400); box-shadow: 0 0 0 5px rgb(166 206 84 / .18);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  }
  .nl-pin__label { font-weight: 600; font-size: var(--text-sm); line-height: 1.1; }
  .nl-pin__count { font-size: var(--text-xs); color: #bfdff0; }
  .nl-pin a:hover .nl-pin__dot, .nl-pin a:focus-visible .nl-pin__dot { transform: scale(1.15); box-shadow: 0 0 0 8px rgb(166 206 84 / .25); }
  .nl-pin a:hover .nl-pin__label { text-decoration: underline; text-underline-offset: 3px; }
  @media (min-width: 992px) { .nl-pin__label { font-size: var(--text-base); } }
  .nl-pin.nl-pin--wro a { transform: translate(calc(-100% + 9px), -50%); flex-direction: row-reverse; padding: 0 0 0 .5rem; }
  @media (max-width: 575.98px) { .nl-pin__count { display: none; } }

  /* Sections */
  .nl-section { padding: var(--section) 0 0; }
  .nl-section--muted { margin-top: var(--section); padding-bottom: var(--section); background: var(--muted); border-top: 1px solid var(--border); }
  .nl-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 1.25rem; }
  .nl-section__head h2 { margin: 0; font-size: var(--text-2xl); }
  .nl-link-quiet { font-size: var(--text-sm); font-weight: 500; color: var(--link); display: inline-flex; align-items: center; min-height: 32px; }
  .home .main, .nl-home ~ * { background: none; }
  .homepage .module-feeds { display: none; }

  /* Solution tiles: a different anatomy from dataset rows */
  .nl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
  @media (min-width: 768px) { .nl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (min-width: 1200px) { .nl-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; } }
  .nl-tile__link {
    position: relative; display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1rem 1rem 1.125rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--foreground); text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease-std), background-color var(--dur-fast) var(--ease-std);
  }
  .nl-tile__link:hover { border-color: var(--nl-sky-300); background: var(--nl-sky-50); color: var(--foreground); }
  .nl-tile__code {
    font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); font-weight: 750; letter-spacing: -.03em; line-height: 1; color: var(--nl-navy-900);
    margin-bottom: .5rem;
  }
  /* One colour per solution (h.nl_solution_tone): same on home tiles, the Solutions list and solution pages */
  .nl-tone-1 { --tone-fg: var(--nl-navy-900); --tone-bg: var(--nl-sky-50);  --tone-border: var(--nl-sky-100); }
  .nl-tone-2 { --tone-fg: var(--nl-sky-700);  --tone-bg: var(--nl-sky-50);  --tone-border: var(--nl-sky-200); }
  .nl-tone-3 { --tone-fg: var(--nl-lime-800); --tone-bg: var(--nl-lime-50); --tone-border: var(--nl-lime-100); }
  .nl-tone-4 { --tone-fg: #0f766e;            --tone-bg: #ecf7f5;           --tone-border: #c9ebe5; }
  .nl-tone-5 { --tone-fg: var(--nl-navy-700); --tone-bg: var(--nl-sky-50);  --tone-border: var(--nl-sky-100); }
  .nl-tile__code[class*="nl-tone-"] { color: var(--tone-fg); }
  .nl-tile__label { font-weight: 600; font-size: .9375rem; line-height: 1.3; }
  .nl-tile__count { margin-top: auto; padding-top: .375rem; font-size: var(--text-sm); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

  /* ---- Organisation / solution lists and page headers ------------- */
  .nl-page-head { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 1.5rem; }
  .nl-page-head h1 { margin: 0; }
  .nl-page-head__lead { margin: 0; color: var(--muted-foreground); font-size: var(--text-lg); line-height: 1.5; max-width: 64ch; text-wrap: pretty; }
  .nl-page-head__text .nl-page-head__lead { margin-top: .375rem; }
  /* Mark beside the title on every width; Manage drops under it on phone */
  .nl-page-head__row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .75rem 1rem; }
  .nl-page-head__text { min-width: 0; align-self: center; }
  .nl-page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: 1 / -1; }
  .nl-page-head__row--plain { grid-template-columns: minmax(0, 1fr); }
  .nl-page-head__row--plain .nl-page-head__text { align-self: start; }
  @media (min-width: 768px) {
    .nl-page-head__row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .nl-page-head__row--plain { grid-template-columns: minmax(0, 1fr) auto; }
    .nl-page-head__actions { grid-column: auto; }
  }
  .nl-page-head--entity { gap: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
  /* Organisation / solution pages: the header sits in `pre_primary` and spans sidebar + content */
  .wrapper > .nl-page-head--entity { grid-column: 1 / -1; order: -1; margin: 0; }
  .wrapper:has(> .nl-page-head--entity) { row-gap: 1.75rem; }
  .nl-page-head--entity .nav-tabs { align-self: flex-start; }

  .nl-entity-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; }
  @media (min-width: 768px) { .nl-entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1200px) { .nl-entity-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .nl-entity-grid > .clearfix { display: none; }
  .nl-entity-grid__item { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
  .nl-entity {
    position: relative; flex: 1 1 auto; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr;
    column-gap: 1rem; row-gap: .25rem; align-items: start;
    padding: 1.125rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
    transition: border-color var(--dur-fast) var(--ease-std), background-color var(--dur-fast) var(--ease-std);
  }
  .nl-entity:hover { border-color: var(--nl-sky-300); background: var(--nl-sky-50); }
  .nl-entity:has(.nl-stretched:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
  .nl-entity .nl-stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .nl-entity .nl-stretched:focus-visible { outline: none; }
  .nl-entity > :first-child { grid-row: 1 / span 3; }
  .nl-entity__title { margin: .125rem 0 0; font-size: var(--text-lg); font-weight: 650; line-height: 1.3; }
  .nl-entity__title a { color: var(--foreground); text-decoration: none; }
  .nl-entity:hover .nl-entity__title a { text-decoration: underline; text-decoration-color: var(--nl-sky-300); }
  .nl-entity__desc { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.5; }
  .nl-entity__count { margin: .375rem 0 0; align-self: end; font-size: var(--text-sm); font-weight: 500; color: var(--foreground); font-variant-numeric: tabular-nums; }
  .nl-entity__role { margin: 0; }
  .nl-entity__remove { align-self: flex-start; }
  .nl-entity__code, .nl-entity__initials, .nl-entity__logo {
    width: 3.25rem; height: 3.25rem; border-radius: var(--radius-md); flex: 0 0 auto;
  }
  .nl-entity__code {
    display: inline-flex; align-items: center; justify-content: center; background: var(--nl-sky-50); border: 1px solid var(--nl-sky-100);
    color: var(--nl-navy-900); font-weight: 750; font-size: 1.0625rem; letter-spacing: -.02em; line-height: 1;
  }
  .nl-entity__code[class*="nl-tone-"] { color: var(--tone-fg); background: var(--tone-bg); border-color: var(--tone-border); }
  .nl-entity__initials {
    display: inline-flex; align-items: center; justify-content: center; background: var(--muted); border: 1px solid var(--border);
    color: var(--muted-foreground); font-weight: 650; font-size: .9375rem;
  }
  .nl-entity__logo { object-fit: contain; background: #fff; border: 1px solid var(--border); padding: .25rem; }
  .nl-entity__code--lg, .nl-entity__initials--lg, .nl-entity__logo--lg { width: 3.5rem; height: 3.5rem; font-size: 1.1875rem; border-radius: var(--radius-lg); }
  @media (min-width: 768px) {
    .nl-entity__code--lg, .nl-entity__initials--lg, .nl-entity__logo--lg { width: 4rem; height: 4rem; font-size: 1.375rem; }
  }

  .nl-search-count { order: 2; flex: 1 1 auto; margin: .5rem 0 0; font-size: var(--text-lg); font-weight: 600; color: var(--muted-foreground); }

  .nl-home__split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  @media (min-width: 1200px) { .nl-home__split { grid-template-columns: minmax(0, 1fr) 22rem; gap: 3rem; align-items: start; } }
  .nl-home__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
  .nl-home__recent { min-width: 0; }
  @media (min-width: 768px) and (max-width: 1199.98px) { .nl-home__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .nl-home__cards .nl-card { display: flex; flex-direction: column; align-items: flex-start; }
  .nl-home__cards .nl-card .btn { margin-top: auto; }

  /* ---- Cards, stack, empty, prose (feature-template classes) ------- */
  .nl-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 1.25rem; box-shadow: var(--shadow-xs); }
  .nl-card > :last-child { margin-bottom: 0; }
  .nl-card p { color: var(--muted-foreground); font-size: .9375rem; }
  .nl-card--compact { padding: 1rem 1.125rem; }
  a.nl-card { color: var(--foreground); text-decoration: none; transition: border-color var(--dur-fast) var(--ease-std), background-color var(--dur-fast) var(--ease-std); }
  a.nl-card:hover { border-color: var(--nl-sky-300); background: var(--nl-sky-50); color: var(--foreground); }
  .nav-pills { --bs-nav-pills-border-radius: var(--radius-pill); --bs-nav-pills-link-active-bg: var(--nl-navy-900); --bs-nav-pills-link-active-color: #fff; gap: .25rem; flex-wrap: wrap; }
  .nav-pills .nav-link { min-height: 36px; display: inline-flex; align-items: center; color: var(--foreground); font-size: var(--text-sm); font-weight: 500; }
  .nav-pills .nav-link:not(.active):hover { background: var(--accent); }
  .nl-card .nav.flex-column .nav-link { min-height: 36px; padding-block: .375rem; color: var(--link); }
  .nl-card .nav.flex-column .nav-link.active { color: var(--foreground); }
  .nl-card__title { font-size: var(--text-lg); font-weight: 650; margin: 0 0 .375rem; }
  .nl-card__icon {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .875rem;
    border-radius: var(--radius-md); background: var(--nl-sky-50); color: var(--nl-navy-900); border: 1px solid var(--nl-sky-100);
  }
  .nl-stack { display: flex; flex-direction: column; gap: 1rem; }
  .nl-stack--sm { gap: .625rem; }
  .nl-stack > * { margin: 0; }
  .nl-muted { color: var(--muted-foreground); font-size: var(--text-sm); }

  .nl-empty, .module .empty-state {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem;
    padding: 2.5rem 1.25rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--background);
  }
  .nl-empty__icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--nl-sky-50); color: var(--nl-navy-900);
    display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: .5rem;
  }
  .nl-empty__title, .nl-empty h3 { font-size: var(--text-xl); margin: 0; }
  .nl-empty__text, .nl-empty p { color: var(--muted-foreground); margin: 0; max-width: 46ch; }
  .nl-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .75rem; }

  .nl-prose { max-width: 68ch; font-size: 1rem; line-height: 1.65; }
  .nl-prose > * + * { margin-top: 1em; }
  .nl-prose > :first-child { margin-top: 0; }
  .nl-prose p, .nl-prose ul, .nl-prose ol, .nl-prose blockquote, .nl-prose table, .nl-prose pre { margin-bottom: 0; }
  .nl-prose h2 { font-size: var(--text-2xl); margin-top: 2em; margin-bottom: .5em; scroll-margin-top: calc(var(--header-h) + 1rem); }
  .nl-prose h3 { font-size: var(--text-xl); margin-top: 1.6em; margin-bottom: .4em; scroll-margin-top: calc(var(--header-h) + 1rem); }
  .nl-prose h4 { font-size: var(--text-lg); margin-top: 1.4em; margin-bottom: .3em; }
  .nl-prose ul, .nl-prose ol { padding-left: 1.375rem; }
  .nl-prose li + li { margin-top: .375em; }
  .nl-prose li::marker { color: var(--nl-sky-600); }
  .nl-prose a { color: var(--link); text-decoration: underline; }
  .nl-prose strong { color: var(--foreground); }
  .nl-prose blockquote { padding: .75rem 1rem; border-left: 3px solid var(--nl-sky-300); background: var(--muted); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--foreground); }
  .nl-prose blockquote > :last-child { margin-bottom: 0; }
  .nl-prose hr { margin: 2em 0; }
  .nl-prose :not(pre) > code { background: var(--muted); border: 1px solid var(--border); color: var(--nl-navy-800); border-radius: 4px; padding: .1em .35em; font-size: .875em; overflow-wrap: anywhere; }
  .nl-prose pre, .nl-code {
    background: var(--nl-navy-950); color: #dcedf7; border-radius: var(--radius-lg); padding: 1rem 1.125rem;
    font-size: .8125rem; line-height: 1.6; overflow-x: auto; white-space: pre; tab-size: 2; border: 0;
  }
  .nl-prose pre code, .nl-code code { color: inherit; background: none; border: 0; padding: 0; font-size: inherit; }
  .nl-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: var(--text-sm); }
  .nl-prose th, .nl-prose td { padding: .625rem .875rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
  .nl-prose th { background: var(--muted); color: var(--muted-foreground); font-weight: 600; font-size: var(--text-xs); white-space: nowrap; }
  .nl-prose tr:last-child td { border-bottom: 0; }
  .nl-prose img { border-radius: var(--radius-lg); height: auto; }
  .nl-code--inline { white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; max-width: 100%; font-size: .75rem; padding: .625rem .75rem; margin: .25rem 0 1rem; align-self: stretch; }

  /* ---- Badges (access) --------------------------------------------- */
  .nl-badges { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0; padding: 0; list-style: none; }
  .nl-badge {
    display: inline-flex; align-items: center; gap: .375rem; min-height: 22px; padding: 0 .5rem;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: .78125rem; font-weight: 600; line-height: 1.1; white-space: nowrap;
  }
  .nl-badge .fa, .nl-badge [class*="fa-"] { font-size: 12px; }
  .nl-badge--open { background: #e8f3cf; color: #43591d; border-color: #d4e9a6; }
  .nl-badge--controlled { background: #fdecc8; color: #8a4b00; border-color: #f6d39a; }
  .nl-badge--sensitive { background: #fbdcda; color: #912018; border-color: #f5b5b0; }
  .nl-badge--tbd, .nl-badge--mds-planned, .nl-badge--private { background: #f1f4f7; color: #465866; border: 1px dashed #b8c4ce; }
  .nl-badge--private { border-style: solid; }
  .nl-badge--mds { background: var(--nl-sky-50); color: var(--nl-navy-900); border-color: var(--nl-sky-200); }
  .nl-badge--demo { background: transparent; color: var(--nl-navy-700); border: 1px dashed var(--nl-navy-700); }
  .nl-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nl-gradient); flex: 0 0 auto; box-shadow: 0 0 0 2px rgb(50 146 195 / .15); }
  [data-bs-toggle="tooltip"].nl-badge { cursor: help; }

  /* labelled pairs on result rows */
  .nl-pairs { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; font-size: var(--text-sm); }
  .nl-pairs > div { display: flex; gap: .375rem; min-width: 0; }
  .nl-pairs dt { font-weight: 500; color: var(--muted-foreground); }
  .nl-pairs dd { margin: 0; font-weight: 500; color: var(--foreground); }
  .nl-item-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: .25rem; }
  .nl-item-foot__date { margin: 0 0 0 auto; font-size: var(--text-xs); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

  /* ---- Dataset page ------------------------------------------------ */
  .nl-dataset { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  @media (min-width: 1200px) { .nl-dataset { grid-template-columns: minmax(0, 1fr) 23rem; gap: 3rem; align-items: start; } }
  .nl-dataset__main { display: flex; flex-direction: column; gap: 2.5rem; min-width: 0; }
  .nl-dataset__main > * { margin: 0; }
  .nl-dataset__head { display: flex; flex-direction: column; gap: 1rem; }
  .nl-dataset__title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; }
  .nl-dataset__title { margin: 0; font-size: var(--text-3xl); flex: 1 1 24rem; min-width: 0; overflow-wrap: anywhere; }
  .nl-dataset__manage { display: flex; flex-wrap: wrap; gap: .5rem; flex: 0 0 auto; }
  .nl-btn-destructive { --bs-btn-color: var(--destructive); --bs-btn-hover-color: #912018; --bs-btn-hover-bg: var(--error-bg); --bs-btn-hover-border-color: var(--error-border); --bs-btn-active-color: #912018; --bs-btn-active-bg: var(--error-bg); }
  .nl-dataset__tabs { margin-top: -1rem; }
  .nl-dataset__aside { min-width: 0; align-self: stretch; }
  .nl-dataset__sticky { display: flex; flex-direction: column; gap: 1rem; }
  @media (min-width: 1200px) {
    .nl-dataset__sticky { position: sticky; top: calc(var(--header-h) + 1.5rem); max-height: calc(100dvh - var(--header-h) - 3rem); overflow-y: auto; scrollbar-width: thin; padding: 2px; margin: -2px; }
  }
  .nl-banner { display: flex; gap: .75rem; align-items: flex-start; margin: 0; }
  .nl-banner > .fa { margin-top: .2rem; }

  .nl-meta {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; margin: 0;
    padding: 1rem 0; border-block: 1px solid var(--border);
  }
  @media (min-width: 768px) { .nl-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .nl-meta__item { min-width: 0; }
  @media (max-width: 575.98px) { .nl-meta__item:nth-child(n+5) { display: none; } }
  .nl-meta dt { font-size: var(--text-xs); font-weight: 500; color: var(--muted-foreground); margin: 0 0 .125rem; }
  .nl-meta dd { margin: 0; font-size: .9375rem; font-weight: 500; overflow-wrap: anywhere; }
  .nl-meta dd a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--nl-sky-300); }
  .nl-id { font-size: .8125rem; color: var(--nl-navy-800); background: var(--muted); border-radius: 4px; padding: .05em .3em; }

  .nl-access { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
  .nl-access__btn { flex: 0 1 auto; }
  @media (max-width: 575.98px) { .nl-access__btn { flex: 1 1 100%; } }
  .nl-access__note { margin: 0; font-size: var(--text-sm); color: var(--muted-foreground); flex: 1 1 16rem; }

  .nl-about h2, .nl-resources h2, .nl-offers h2, .additional-info-heading, .nl-dataset__main section > h2, .nl-dataset__main .module-heading {
    font-size: var(--text-xl); margin: 0 0 .875rem;
  }
  .nl-dataset__main .additional-info h2, .nl-dataset__main section.additional-info > h3 { font-size: var(--text-xl); }
  .nl-collapsible__body { position: relative; }
  .nl-collapsible.is-collapsed .nl-collapsible__body { max-height: calc(1.65em * 6); overflow: hidden; }
  .nl-collapsible.is-collapsed .nl-collapsible__body::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(transparent, var(--background));
  }
  .nl-collapsible__toggle { padding-left: 0; margin-top: .25rem; }

  /* resources: table on desktop, cards below 768 */
  .nl-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }
  .nl-table td { vertical-align: middle; }
  .nl-table tbody tr:last-child > * { border-bottom: 0; }
  .nl-table__name a { font-weight: 600; color: var(--foreground); text-decoration: none; }
  .nl-table__name a:hover { text-decoration: underline; }
  .nl-table__name { width: 42%; min-width: 13rem; }
  .nl-table__name small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted-foreground); font-size: var(--text-xs); margin-top: .125rem; max-width: 48ch; }
  .nl-table__actions { text-align: right; white-space: nowrap; }
  .nl-table__actions .btn + .btn { margin-left: .25rem; }
  .nl-tabular { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .nl-route-tag { display: inline-flex; align-items: center; gap: .375rem; font-weight: 500; white-space: nowrap; }
  .nl-route-tag .fa { color: var(--muted-foreground); font-size: 12px; }
  .nl-table-wrap { overflow-x: auto; }
  @media (max-width: 991.98px) {
    .nl-table-wrap { border: 0; background: none; overflow: visible; }
    .nl-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .nl-table--cards, .nl-table--cards tbody { display: block; }
    .nl-table--cards tr {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem 1rem; padding: 1rem; margin-bottom: .75rem;
      border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
    }
    .nl-table--cards td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
    .nl-table--cards td::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--muted-foreground); font-weight: 500; margin-bottom: .125rem; }
    .nl-table--cards td.nl-table__name { grid-column: 1 / -1; }
    .nl-table--cards td.nl-table__name::before { display: none; }
    .nl-table--cards td.nl-table__name a { font-size: 1rem; }
    .nl-table--cards td.nl-table__actions { grid-column: 1 / -1; text-align: left; display: flex; flex-wrap: wrap; gap: .5rem; white-space: normal; }
    .nl-table--cards td.nl-table__actions::before { display: none; }
    .nl-table--cards td.nl-table__actions .btn { flex: 1 1 auto; margin: 0; }
    .nl-table--cards td.nl-table__actions .btn-ghost:only-child, .nl-table--cards td.nl-table__actions .btn[aria-label] { flex: 0 0 auto; }
  }

  /* MDS offer */
  .nl-mds { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.125rem 1.25rem; background: var(--card); display: flex; flex-direction: column; gap: .875rem; }
  .nl-mds__head { display: flex; gap: .875rem; align-items: flex-start; }
  .nl-mds__mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--radius-md); background: var(--nl-gradient); position: relative; }
  .nl-mds__mark::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
  .nl-mds__title { font-size: var(--text-lg); margin: 0 0 .25rem; }
  .nl-mds__status { margin: 0; }
  .nl-mds__req { margin: 0; font-size: var(--text-sm); color: var(--foreground); }
  .nl-mds__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

  /* Disclosure (<details>) */
  .nl-disclosure { border-top: 1px solid var(--border); }
  .nl-disclosure > summary {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; cursor: pointer;
    list-style: none; font-weight: 600; font-size: var(--text-sm); color: var(--foreground); border-radius: var(--radius-sm);
  }
  .nl-disclosure > summary::-webkit-details-marker { display: none; }
  .nl-disclosure > summary::after {
    content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .6875rem; color: var(--muted-foreground);
    transition: transform var(--dur-base) var(--ease-std); flex: 0 0 auto;
  }
  .nl-disclosure[open] > summary::after { transform: rotate(180deg); }
  .nl-disclosure > :not(summary) { margin-bottom: .875rem; }
  .nl-steps { margin: 0 0 .5rem; padding-left: 1.25rem; font-size: var(--text-sm); }
  .nl-steps li + li { margin-top: .25rem; }

  .nl-disclosure--panel { border: 0; }
  .nl-disclosure--panel > summary { min-height: 0; padding: 0; }
  .nl-disclosure--panel > summary h2 { margin: 0; font-size: var(--text-lg); display: inline-flex; align-items: center; gap: .5rem; }
  .nl-disclosure--panel > summary h2 .fa { color: var(--nl-sky-600); font-size: var(--icon-md); }

  /* copy field */
  .nl-copy__label { display: block; font-size: var(--text-xs); color: var(--muted-foreground); font-weight: 500; margin-bottom: .25rem; }
  .nl-copy__row { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); }
  .nl-copy__value { flex: 1 1 auto; min-width: 0; padding: .5rem .75rem; font-size: .75rem; word-break: break-all; color: var(--foreground); overflow-wrap: anywhere; background: none; align-self: center; }
  .nl-copy__btn { border-left: 1px solid var(--border); border-radius: 0 var(--radius-md) var(--radius-md) 0; flex: 0 0 auto; }

  /* API panel */
  .nl-api, .nl-readiness { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.125rem; background: var(--card); box-shadow: var(--shadow-xs); }
  .nl-api__body { display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }
  .nl-api__body > p { margin: 0; }
  .nl-api .nl-segmented { align-self: flex-start; }
  .nl-api .nl-segmented .nav-link { min-height: 32px; font-family: var(--font-mono); font-size: .8125rem; }
  .nl-code-block { position: relative; }
  .nl-code-block .nl-code { margin: 0; padding-right: 4.5rem; font-size: .75rem; max-height: 16rem; }
  .nl-code-block__copy {
    position: absolute; top: .375rem; right: .375rem; --bs-btn-color: #dcedf7; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgb(255 255 255 / .12);
    --bs-btn-active-bg: rgb(255 255 255 / .18); --bs-btn-active-color: #fff; min-height: 32px; font-size: .75rem;
  }
  .nl-code-block__copy:focus-visible { outline-color: var(--ring-on-navy); }
  .nl-api__formats { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .875rem; font-size: var(--text-sm); color: var(--muted-foreground); margin: 0; }
  .nl-api__formats a { font-weight: 500; display: inline-flex; min-height: 32px; align-items: center; }

  /* readiness */
  .nl-readiness summary { flex-wrap: wrap; }
  .nl-readiness__score { font-size: var(--text-xs); color: var(--muted-foreground); font-weight: 500; font-variant-numeric: tabular-nums; }
  .nl-readiness__bar { height: 6px; border-radius: 6px; background: var(--muted); overflow: hidden; margin: .75rem 0; }
  .nl-readiness__bar span { display: block; height: 100%; background: var(--nl-lime-500); border-radius: inherit; }
  .nl-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: var(--text-sm); }
  .nl-checklist li { display: flex; gap: .5rem; align-items: flex-start; }
  .nl-checklist .fa { margin-top: .2rem; }
  .nl-checklist .is-ok .fa { color: var(--success); }
  .nl-checklist .is-todo .fa { color: var(--warning); }
  .nl-checklist small { display: block; color: var(--muted-foreground); }

  /* ---- Publish wizard ---------------------------------------------- */
  .nl-stepper { margin: 0 0 1.5rem; }
  .nl-stepper__now { margin: 0 0 .5rem; font-size: var(--text-sm); color: var(--muted-foreground); }
  .nl-stepper__now strong { color: var(--foreground); }
  .nl-stepper__bar { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
  .nl-stepper__bar span { display: block; height: 100%; width: var(--nl-progress, 20%); background: var(--nl-gradient); border-radius: inherit; transition: width var(--dur-enter) var(--ease-out); }
  .nl-stepper__list { display: none; list-style: none; margin: 0; padding: 0; }
  .nl-step { position: relative; display: flex; gap: .75rem; align-items: flex-start; padding-bottom: 1.25rem; }
  .nl-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); border-radius: 2px; }
  .nl-step.is-done:not(:last-child)::before { background: linear-gradient(var(--nl-lime-400), var(--nl-sky-500)); }
  .nl-step__dot {
    width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--input); background: var(--background); color: var(--muted-foreground); font-size: var(--text-xs); font-weight: 650; font-variant-numeric: tabular-nums;
  }
  /* Font Awesome loads unlayered (.fa { display: var(--fa-display, inline-block) }), so toggle its variable */
  .nl-step__dot .fa { --fa-display: none; font-size: 12px; }
  .nl-step.is-current .nl-step__dot { background: var(--nl-navy-900); border-color: var(--nl-navy-900); color: #fff; }
  .nl-step.is-done .nl-step__dot { background: var(--nl-lime-400); border-color: var(--nl-lime-600); color: var(--nl-navy-900); }
  .nl-step.is-done .nl-step__n { display: none; }
  .nl-step.is-done .nl-step__dot .fa { --fa-display: inline-block; }
  .nl-step__text { display: flex; flex-direction: column; gap: .125rem; padding-top: .2rem; font-size: var(--text-sm); line-height: 1.3; }
  .nl-step__title, .nl-step__text a { font-weight: 600; color: var(--muted-foreground); }
  .nl-step.is-current .nl-step__title { color: var(--foreground); }
  .nl-step.is-done .nl-step__text a, .nl-step.is-done .nl-step__title { color: var(--foreground); }
  .nl-step__text small { color: var(--muted-foreground); font-size: var(--text-xs); }
  .nl-step[data-nl-clickable] { cursor: pointer; }
  .nl-step[data-nl-clickable]:hover .nl-step__title { text-decoration: underline; }

  @media (max-width: 991.98px) {
    .nl-stepper { position: sticky; top: var(--header-h); z-index: 20; margin-inline: calc(-1 * var(--gutter)); padding: .625rem var(--gutter) .75rem; background: rgb(255 255 255 / .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
  }
  @media (min-width: 992px) {
    #dataset-edit:has(> .nl-stepper), #resource-edit:has(> .nl-stepper) {
      display: grid; grid-template-columns: 15rem minmax(0, 44rem); column-gap: 3rem; align-items: start;
    }
    #dataset-edit:has(> .nl-stepper) > :not(.nl-stepper), #resource-edit:has(> .nl-stepper) > :not(.nl-stepper) { grid-column: 2; }
    #dataset-edit > .nl-stepper, #resource-edit > .nl-stepper { grid-column: 1; grid-row: 1 / span 40; position: sticky; top: calc(var(--header-h) + 1.5rem); }
    .nl-stepper__now, .nl-stepper__bar { display: none; }
    .nl-stepper__list { display: block; }
  }
  /* Paged scheming form (form_pages): the real Next/Save row sticks to the bottom on phones */
  @media (max-width: 991.98px) {
    #dataset-edit:has(> .nl-stepper) .form-actions {
      position: sticky; bottom: 0; z-index: 20; margin-inline: calc(-1 * var(--gutter)); padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
      background: rgb(255 255 255 / .96); backdrop-filter: blur(6px); border-top: 1px solid var(--border);
    }
    #dataset-edit:has(> .nl-stepper) .form-actions .action-info { display: none; }
  }
  .nl-step-panel { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
  .nl-step-panel + .nl-step-panel { padding-top: 1.5rem; border-top: 1px solid var(--border); }
  .nl-step-panel__legend { float: none; width: auto; font-size: var(--text-2xl); font-weight: 650; letter-spacing: -.015em; margin: 0 0 1.25rem; padding: 0; line-height: 1.2; }
  .nl-step-panel__legend small { display: block; font-size: var(--text-sm); font-weight: 400; color: var(--muted-foreground); letter-spacing: 0; margin-top: .25rem; }
  .nl-wizard .nl-step-panel:not(.is-active) { display: none; }
  .nl-wizard .nl-step-panel + .nl-step-panel { padding-top: 0; border-top: 0; }
  .nl-wizard-nav { display: flex; gap: .75rem; justify-content: space-between; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
  .nl-wizard-nav [data-nl-prev][disabled] { visibility: hidden; }
  .nl-wizard.is-last-step .nl-wizard-nav [data-nl-next] { display: none; }
  .nl-wizard:not(.is-last-step) .form-actions { display: none; }
  .nl-wizard.is-last-step .nl-wizard-nav { border-top: 0; padding-top: 0; margin-top: 1rem; }
  @media (max-width: 991.98px) {
    .nl-wizard .nl-wizard-nav, .nl-wizard.is-last-step .form-actions {
      position: sticky; bottom: 0; z-index: 20; margin-inline: calc(-1 * var(--gutter)); padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
      background: rgb(255 255 255 / .96); backdrop-filter: blur(6px); border-top: 1px solid var(--border);
    }
    .nl-wizard.is-last-step .nl-wizard-nav { position: static; margin-inline: 0; padding: 0; background: none; border: 0; backdrop-filter: none; }
    .nl-wizard-nav .btn { flex: 1 1 0; }
  }

  /* ---- Footer ------------------------------------------------------ */
  .nl-footer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  @media (min-width: 768px) { .nl-footer { grid-template-columns: 1fr 1fr; } .nl-footer__eu { grid-column: 1 / -1; } }
  @media (min-width: 1200px) { .nl-footer { grid-template-columns: 1.1fr .7fr 1.5fr; gap: 3rem; } .nl-footer__eu { grid-column: auto; } }
  .nl-wordmark { font-size: 1.5rem; font-weight: 750; letter-spacing: -.01em; color: #fff; margin: 0 0 .75rem; line-height: 1.1; }
  .nl-wordmark span { display: block; font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; color: var(--nl-sky-200); margin-top: .25rem; }
  .nl-footer p { color: #e6eff5; margin: 0 0 .75rem; max-width: 52ch; }
  .nl-footer__heading { font-size: var(--text-sm); font-weight: 650; color: #fff; margin: 0 0 .5rem; letter-spacing: 0; }
  .nl-footer__links ul { margin: 0; padding: 0; }
  .nl-footer__links li a { display: inline-flex; align-items: center; gap: .375rem; min-height: 32px; }
  .nl-footer__links li a .fa, .nl-footer__links li a [class*="fa-"] { font-size: 11px; }
  .nl-footer__emblem { display: block; height: 48px; width: auto; margin: 0 0 1rem; }
  .nl-footer__eu p { font-size: var(--text-xs); color: #dcedf7; }
  .nl-footer__base {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 2.5rem; padding-top: 1.25rem;
    border-top: 1px solid rgb(255 255 255 / .14); font-size: var(--text-xs); color: var(--nl-sky-200);
  }
  .nl-footer__base p { margin: 0; color: inherit; }

  /* ---- Skeleton ---------------------------------------------------- */
  .nl-skeleton { background: var(--muted); border-radius: var(--radius-md); }
  @media (prefers-reduced-motion: no-preference) {
    .nl-skeleton { animation: nl-pulse 1.5s ease-in-out infinite; }
    @keyframes nl-pulse { 50% { opacity: .55; } }
  }
}

/* ==========================================================================
   nl.utilities
   ========================================================================== */
@layer nl.utilities {
  .nl-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .nl-cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
  .nl-measure { max-width: 68ch; }
  .visually-hidden, .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
  .js-hide { display: none; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .btn:active { transform: none; }
  }
}
