/* ═══════════════════════════════════════════════════════════════════════════
   ASK2KNOW DESIGN SYSTEM
   OKLCH-based color palette with semantic tokens
   Reference: docs/design/ui/ask2know-design-system.html
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════════════════
   The D2i brand ladders (ask2know#227 §1).

   The step number IS the lightness -- 50 is the lightest in every family, 900
   the darkest -- so a "500" is equally light whichever family it comes from. A
   brand colour is not an anchor the ramp approximates; it SITS ON the step its
   own lightness dictates. That is what removes the drift class: a brand colour
   that IS a step cannot drift from itself.

   These replace a parallel set of hand-derived OKLCH ramps, which were an
   independent re-derivation of the same corporate colours and had drifted from
   them. Every old token name is kept below as an alias, so this is a
   values-only change for the 449 navy, 156 cyan, 80 teal, 73 red and 69 amber
   usages across this file and the templates.

   Source: d2i-design-systems/systems/ask2know.html (rebuilt on the brand
   standard in 20f70d8, refreshed in d99a977). Copy these, do not retype them.
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Typography. Roboto, and only Roboto: the standard names no other family. */
  --font-display: 'Roboto', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', 'Fira Mono', monospace;

  /* donkerblauw · H267 · merk #28324B @ 700 — headings, body text, structure */
  --donkerblauw-50:  #F0F5FF;  --donkerblauw-100: #E1E8F7;
  --donkerblauw-200: #C9D1E4;  --donkerblauw-300: #A9B4CD;
  --donkerblauw-400: #8995B2;  --donkerblauw-500: #687491;
  --donkerblauw-600: #4C5873;  --donkerblauw-700: #28324B;
  --donkerblauw-800: #1F283E;  --donkerblauw-900: #0E1527;

  /* uiblauw · H269 · merk #15215A @ 800 — the on-screen blue: nav, dashboards */
  --uiblauw-50:  #ECF5FF;  --uiblauw-100: #DBE7FF;
  --uiblauw-200: #C1D0FB;  --uiblauw-300: #9FB2EA;
  --uiblauw-400: #7D92D2;  --uiblauw-500: #5C71B1;
  --uiblauw-600: #415491;  --uiblauw-700: #293870;
  --uiblauw-800: #15215A;  --uiblauw-900: #08103B;

  /* lichtblauw · H239 · merk #00B0FF @ 400 — accent, links, focus, primary */
  --lichtblauw-50:  #DEFAFF;  --lichtblauw-100: #C3EEFF;
  --lichtblauw-200: #94DAFF;  --lichtblauw-300: #5ABFFE;
  --lichtblauw-400: #00B0FF;  --lichtblauw-500: #007ABF;
  --lichtblauw-600: #005F98;  --lichtblauw-700: #00426F;
  --lichtblauw-800: #002C50;  --lichtblauw-900: #001833;

  /* greige · H107 · merk #F3F3EF @ 50 — warm neutral: text, borders, chips */
  --greige-50:  #F3F3EF;  --greige-100: #E8E8E5;
  --greige-200: #D1D1CD;  --greige-300: #B5B5AF;
  --greige-400: #96968F;  --greige-500: #75756E;
  --greige-600: #585852;  --greige-700: #3E3D38;
  --greige-800: #292924;  --greige-900: #181818;

  /* groen · H192 · merk #218380 @ 500 — success. A SIGNAL, never a series. */
  --groen-50:  #DFFCFA;  --groen-100: #CBF1EE;
  --groen-200: #ABDCD9;  --groen-300: #7FC3BF;
  --groen-400: #51A5A2;  --groen-500: #218380;
  --groen-600: #006764;  --groen-700: #004A48;
  --groen-800: #003331;  --groen-900: #001D1C;

  /* geel · H86 · merk #F8C12F @ 200 — attention, always dark text on it.
     The merk step is 200, not 400: yellow is intrinsically light and the ladder
     respects that. The renumbering matters as much as the value. */
  --geel-50:  #FFF3CB;  --geel-100: #FDE5B1;
  --geel-200: #F8C12F;  --geel-300: #D8AE48;
  --geel-400: #BE8C00;  --geel-500: #976D00;
  --geel-600: #745200;  --geel-700: #523800;
  --geel-800: #392500;  --geel-900: #221300;

  /* rood · H28 · merk #D60009 @ 500 — destructive, alert. A SIGNAL. */
  --rood-50:  #FFEDE7;  --rood-100: #FFDAD2;
  --rood-200: #FFB9AC;  --rood-300: #FF8878;
  --rood-400: #FD4E41;  --rood-500: #D60009;
  --rood-600: #AF0000;  --rood-700: #7F0000;
  --rood-800: #5A0000;  --rood-900: #380000;

  /* ── Old names, kept as aliases ───────────────────────────────────────────
     `navy` was really TWO brand families doing different jobs: uiblauw carries
     the chrome, donkerblauw the text and structure. --navy-800 was already
     correct -- it IS uiblauw-800 -- and everything else on that line belongs
     to donkerblauw. */
  --navy-900: var(--donkerblauw-900);
  --navy-800: var(--uiblauw-800);      /* #15215A · merk · the nav */
  --navy-700: var(--donkerblauw-700);  /* #28324B · merk · body text */
  --navy-600: var(--donkerblauw-600);
  --navy-500: var(--donkerblauw-500);
  --navy-400: var(--donkerblauw-400);
  --navy-300: var(--donkerblauw-300);
  --navy-200: var(--donkerblauw-200);
  --navy-100: var(--donkerblauw-100);
  --navy-50:  var(--donkerblauw-50);

  /* cyan was built at H222 where the brand is H239 -- those 17 degrees are the
     whole reason #00A3D8 and #00B0FF are different blues. */
  --cyan-700: var(--lichtblauw-700);
  --cyan-600: var(--lichtblauw-600);
  --cyan-500: var(--lichtblauw-500);
  --cyan-400: var(--lichtblauw-400);   /* #00B0FF · merk */
  --cyan-300: var(--lichtblauw-300);
  --cyan-200: var(--lichtblauw-200);
  --cyan-100: var(--lichtblauw-100);
  --cyan-50:  var(--lichtblauw-50);

  --teal-700: var(--groen-700);
  --teal-600: var(--groen-600);
  --teal-500: var(--groen-500);        /* #218380 · merk */
  --teal-400: var(--groen-400);
  --teal-300: var(--groen-300);
  --teal-200: var(--groen-200);
  --teal-100: var(--groen-100);
  --teal-50:  var(--groen-50);

  /* geel is renumbered, so this is a lightness mapping rather than
     number-for-number: the old amber-400 was the bright signal yellow, and the
     brand puts that at geel-200. */
  --amber-700: var(--geel-700);
  --amber-600: var(--geel-600);
  --amber-500: var(--geel-400);
  --amber-400: var(--geel-200);        /* #F8C12F · merk */
  --amber-300: var(--geel-300);
  --amber-200: var(--geel-100);
  --amber-100: var(--geel-100);
  --amber-50:  var(--geel-50);

  --red-700: var(--rood-700);
  --red-600: var(--rood-600);
  --red-500: var(--rood-500);          /* #D60009 · merk */
  --red-400: var(--rood-400);
  --red-300: var(--rood-300);
  --red-200: var(--rood-200);
  --red-100: var(--rood-100);
  --red-50:  var(--rood-50);

  --neutral-200: var(--greige-200);
  --neutral-100: var(--greige-100);
  /* The canvas exception, and the one alias in the system that deliberately
     does NOT sit on a brand step. Chosen after testing near-white candidates
     against the real page's white cards: full-bleed, greige-50's warmth read
     as dated grey rather than warm. greige-50 stays the anchor for everything
     that stayed on the ramp -- borders, chips, sunken panels. */
  --neutral-bg: #FCFCFB;
  --neutral-card: #FFFFFF;

  /* ── Semantic aliases ─────────────────────────────────────────────────────
     Text and borders come from GREIGE, not the blue line: body text is a warm
     near-black rather than a blue-black, and the warmth in the interface comes
     from the canvas behind the cards rather than from tinting the cards. */
  --color-bg: var(--neutral-bg);
  --color-surface: var(--neutral-card);
  --color-surface-sunken: var(--greige-50);
  --color-border: var(--greige-200);
  --color-text: var(--greige-900);
  --color-text-muted: var(--greige-600);
  --color-text-faint: var(--greige-400);

  --color-chrome: var(--uiblauw-800);
  --color-chrome-deep: var(--uiblauw-900);
  --color-nav-bg: var(--uiblauw-800);
  /* Both of these resolved to the old H222 ramp rather than lichtblauw, which
     the design system flags as drift: visibly duller than the brand's own
     accent, across 71 usages. The topbar had started hardcoding #00B0FF to
     route around it -- which is the workaround this removes the need for. */
  --color-nav-active: var(--lichtblauw-400);
  --color-accent: var(--lichtblauw-400);
  --color-primary: var(--lichtblauw-400);
  --color-primary-hover: var(--lichtblauw-500);
  --color-primary-bg: var(--lichtblauw-100);

  --color-success: var(--groen-500);
  --color-success-bg: var(--groen-100);
  --color-warning: var(--geel-200);
  --color-warning-bg: var(--geel-100);
  --color-danger: var(--rood-500);
  --color-danger-bg: var(--rood-100);

  /* ── Chart scales (ask2know#227 §2) ───────────────────────────────────────
     Four scales, because a chart can ask four different questions and one set
     of series colours only answers one of them. Pick the scale by what the
     data IS, not by what looks good.

     One rule cuts across all four: groen, geel and rood are SIGNAL colours --
     good, attention, wrong. Never spend one on a series that merely needs to be
     distinguishable, or the chart implies a judgement it does not mean. */

  /* 1 · Categorical. Exactly eight, in fixed use order, four brand hues each
     dark and light, uiblauw first. Capped at eight because a Power BI theme
     accepts no more. Groen and teal are deliberately absent: they sit too close
     to the success signal to serve as a neutral category.

     MEASURED CAVEAT, and it is not in the standard: as a SET these are
     comfortably colour-vision safe (worst adjacent pair dE 27). But the four
     LIGHT steps sit at 1.5-1.9:1 against white, so none can carry a thin line
     or a small mark without a direct label beside it -- and taking the four
     DARK steps as four categories fails outright: koraal against limoen is
     dE 4.7 for deuteranopia and 14.9 for normal vision, below the floor at
     which full colour vision separates a pair. Use the order as intended,
     alternating dark and light. */
  --chart-cat-1: #15215A;  /* uiblauw  dark  */
  --chart-cat-2: #C1D0FB;  /* uiblauw  light */
  --chart-cat-3: #A64C47;  /* koraal   dark  */
  --chart-cat-4: #EBB0AA;  /* koraal   light */
  --chart-cat-5: #776F00;  /* limoen   dark  */
  --chart-cat-6: #C7C48F;  /* limoen   light */
  --chart-cat-7: #92508C;  /* magenta  dark  */
  --chart-cat-8: #DCB1D7;  /* magenta  light */

  /* 3 · Sequential. One value, low to high: the uiblauw ladder 50 to 800. */
  --chart-seq-1: #ECF5FF;
  --chart-seq-2: #C1D0FB;
  --chart-seq-3: #7D92D2;
  --chart-seq-4: #415491;
  --chart-seq-5: #15215A;

  /* 4 · Good to bad. Deviation around a middle, for anything that can be one or
     the other: retrieval quality, zero-result rate, queue backlog. The ends are
     exactly the success and alert colours, so groen means good and rood means
     wrong, the same as everywhere else in the system. */
  --chart-div-1: #218380;
  --chart-div-2: #7FC3BF;
  --chart-div-3: #EDEDE9;
  --chart-div-4: #FF8878;
  --chart-div-5: #D60009;

  /* Scale 2, comparison, is a METHOD rather than a palette -- density, hue and
     salience, all pointing the same way -- so it has no tokens here. The
     analytics dashboard's four surface colours are one application of it; see
     --an-s-* in analytics.css. */

  /* Border radius */
  --radius-pill: 999px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows (navy-based) */
  --shadow-sm: 0 1px 3px rgba(21, 33, 90, 0.08);
  --shadow-md: 0 4px 12px rgba(21, 33, 90, 0.10);
  --shadow-lg: 0 8px 24px rgba(21, 33, 90, 0.12);

  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Type scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 0.9375rem;  /* 15px — body */
  --text-md: 1rem;         /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.5rem;       /* 24px */

  /* Font weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Motion */
  --duration-fast: 0.15s;
  --duration-med: 0.2s;
  --ease: ease;

  /* Focus ring — single source of truth (was hand-duplicated ~5×) */
  --focus-ring: 0 0 0 3px var(--color-primary-bg);
  --focus-ring-danger: 0 0 0 3px var(--color-danger-bg);

  /* Control heights (buttons + fields align to the same rhythm) */
  --control-height-sm: 32px;
  --control-height-md: 38px;

  /* ─── FIELD THEME ───────────────────────────────────────────────────────────
     Defaults describe the LIGHT / main-app skin (thin border, small radius,
     airy). The .admin-page scope re-points these to the structured skin.
     Two intentional skins share one field rule — no more copy-paste. */
  --field-border-width: 1px;
  --field-border-color: var(--color-border);
  --field-border-hover: var(--navy-200);
  --field-radius: var(--radius-sm);
  --field-bg: var(--color-surface);
  --field-padding-y: 0.5rem;
  --field-padding-x: 0.5rem;
  --field-font-size: var(--text-sm);
  --field-disabled-bg: var(--navy-50);

  /* Legacy aliases for backward compatibility */
  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --primary: var(--color-primary);
  --primary-strong: var(--color-primary-hover);
  --border: var(--color-border);
  --shadow: var(--shadow-md);
}

/* Visible to a screen reader, to nothing else.
 *
 * The clip/1px pattern rather than `display: none` or `visibility: hidden`,
 * both of which remove the element from the accessibility tree as well as the
 * page -- which would defeat the point. `white-space: nowrap` keeps a phrase
 * from wrapping inside the 1px box, where some readers stop at the first line.
 *
 * Added for the chat page's <h1> (see chat.html): that page shows no title by
 * design, and it had no h1 at all -- no top-level heading to navigate to, and a
 * hierarchy starting at h2. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ─── BASE RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* ─── LINKS ──────────────────────────────────────────────────────────────────── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--color-primary-hover);
}

/* ─── NAVIGATION ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
  /* 60px, up from 52: the lockup is 92px wide and hangs below the bar's lower
     edge into the page's top padding, which needs the extra height to sit on. */
  height: 60px;
  background: var(--color-nav-bg);
  /* The accent rule under the chrome. `var(--color-primary)`, not a pinned
     literal: the design branch hardcoded #00B0FF here specifically because
     --color-primary resolved to the old H222 cyan ramp. That token is fixed
     now, so the workaround is unnecessary. */
  border-bottom: 4px solid var(--color-primary);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  /* So the lockup can overhang. The dropdown panels needed this anyway. */
  overflow: visible;
}

/* A reserved slot the lockup is positioned inside, so the mark can overhang the
   bar without the bar's own layout moving. */
.brand {
  position: relative;
  display: flex;
  align-items: center;
  width: 92px;
  height: 60px;
  flex-shrink: 0;
  text-decoration: none;
}

/* The delivered mark on chrome of nearly the same darkness.
 *
 * uiblauw-800 body on a uiblauw-800 bar is the same colour twice: placed with
 * no styling the bubble reads as little more than a flat rectangle. Two stacked
 * `drop-shadow()` filters solve it, and neither alone does -- a depth shadow
 * (offset, blurred, ~38% black) plus a rim-light (almost no offset, minimal
 * blur, a low-opacity tint of the accent hue).
 *
 * `drop-shadow`, not `box-shadow`: box-shadow draws a rectangle, where this
 * follows the mark's own alpha shape. And not a recoloured "on-dark" variant of
 * the asset, which was tried on the design branch and abandoned as its own
 * maintenance burden. The technique came from the marketing site's hero logo
 * (site.css, .a2k-brand-mark) before it was carried into the app. */
.brand-lockup {
  position: absolute;
  left: 0;
  top: 10px;
  width: 92px;
  height: auto;
  /* Decorative, and deliberately overhanging the bar -- so it must not be a
     click target. `.topbar` is `overflow: visible` to let the mark hang below
     the bar's edge, and an <img> that overhangs still RECEIVES pointer events
     there: it sat on top of the page content underneath and swallowed taps,
     measured on /ui/chat at 390px where it intercepted the first button below
     the bar outright. The 92x60 `.brand` anchor around it stays the target for
     home, and that box is inside the bar. */
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(6, 10, 30, 0.38))
          drop-shadow(0 0 1.1px rgba(180, 205, 255, 0.19));
}

.brand-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 24px;

  /* Deliberately NOT a scroll container. An `overflow-x: auto` here looks like
     cheap insurance against the bar overflowing, but it forces `overflow-y` to
     `auto` too, which clips the absolutely-positioned .nav-menu panels to the
     52px bar -- the menus open and paint nothing. The guard against the bar
     growing back to 11 items is tests/api/test_nav_shape.py, which can go red. */
  flex-shrink: 0;
}

/* One shared shape for a plain link and a group trigger, so they cannot drift. */
.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: oklch(0.80 0.02 260);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: white;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.nav-link:focus-visible {
  box-shadow: 0 0 0 2px var(--color-nav-active);
}

/* Active = the section you are in. A group stays lit while any child is current. */
.nav-link.active {
  color: var(--color-nav-active);
  box-shadow: inset 0 -2px 0 var(--color-nav-active);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-caret {
  font-size: 11px;
  opacity: 0.65;
  transition: transform 0.18s ease;
}

.nav-group {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-group.open > .nav-link {
  color: white;
  background: rgba(255, 255, 255, 0.10);
}

.nav-group.open .nav-caret {
  transform: rotate(180deg);
}

/* ── Drop-down panel ─────────────────────────────────────────────────────────── */
.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 306px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 120;

  /* visibility, not display: animates, and leaves no click-catcher when closed. */
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-group.open > .nav-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* Opens inward, from the trigger's right edge.

   The trailing nav group and the avatar both sit near the right of the bar, and
   `.nav-menu`'s default `left: 0` put a 306px panel to the RIGHT of them -- off
   the page. Because the panel is hidden with `visibility` rather than `display`
   (deliberately, see the note above it), it stays laid out while closed and an
   absolutely-positioned box still extends its container's scrollable area. So
   every page in the app scrolled sideways at rest between roughly 700 and
   950px: above the 768px drawer breakpoint the horizontal bar is still
   rendered, below ~1000px there is no room to the right of the last trigger.
   Measured on /ui/search, /ui/documents and /ui/analytics alike.

   Not `overflow-x` on `.nav` -- see the note at :248, that clips the panels to
   the bar and they open painting nothing. */
.nav-menu-right {
  left: auto;
  right: 0;
}

/* A floor under the whole class of bug: whatever a panel is anchored to, it can
   never be wider than the window it has to fit in. */
.nav-menu {
  max-width: calc(100vw - 2rem);
}

/* The 8px window where neither layout fits.
   Measured on /ui/search: the bar needs 777px -- brand 110 + nav 547 +
   user-menu 56 + 56 of padding + 8 of gaps -- while the drawer only takes over
   at 768px. So 769-776px rendered the horizontal bar in a space it did not fit,
   and the whole page scrolled sideways.
   Trimming the padding here rather than moving the 768px breakpoint, which six
   other rules in this file share: 24px back brings the requirement to 753px,
   which clears 768 with room to spare. `.nav` keeps `flex-shrink: 0` -- the
   items themselves must not collapse, which is the point of the note at :248. */
@media (max-width: 900px) {
  .topbar {
    padding: 0 16px;
  }
}

/* The last widths before the drawer takes over at 768. With the bell the bar
   needs 795px (measured in Dutch, 2026-11-12); from 769 to 794 it ate its own
   right padding and then scrolled sideways. Tighter links and a smaller gap
   after the mark give back 48px. */
@media (min-width: 769px) and (max-width: 820px) {
  .nav {
    margin-left: 12px;
  }

  .nav-link {
    padding: 6px 9px;
  }
}

.nav-menu a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.12s;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--navy-50);
  outline: none;
}

.nav-menu a.active {
  background: var(--navy-50);
}

.nav-menu a.active .nav-menu-title {
  color: var(--color-primary-hover);
}

.nav-menu a > i {
  flex-shrink: 0;
  width: 18px;
  margin-top: 1px;
  font-size: 17px;
  color: var(--color-text-muted);
  text-align: center;
}

.nav-menu a:hover > i,
.nav-menu a.active > i {
  color: var(--color-primary-hover);
}

.nav-menu-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-menu-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  white-space: nowrap;
}

.nav-menu-desc {
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.nav-menu-label {
  padding: 9px 10px 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.nav-menu-sep {
  height: 1px;
  margin: 5px 8px;
  border: 0;
  background: var(--color-border);
}

.nav-menu-head {
  padding: 10px 10px 8px;
}

/* Language switcher in the account menu. Two segments rather than a dropdown:
   there are exactly two languages and there always will be until a customer
   asks for a third, and a segmented pair shows the current one without being
   opened. The labels are endonyms (Nederlands / English), never translated --
   somebody looking for their own language scans for its own name. */
.nav-menu-lang {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
}

.nav-menu-lang .lang-option {
  flex: 1;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 12px;
  text-align: center;
  color: var(--color-text-muted);
}

.nav-menu-lang .lang-option.active {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  color: var(--color-text);
  font-weight: 600;
}

.nav-menu-head strong {
  display: block;
  font-size: 13.5px;
  color: var(--color-text);
}

.nav-menu-head span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.nav-menu-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--navy-100);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--navy-500);
}

/* An entry whose page does not exist yet. Rendered as a dead <span>, never an
   <a>, so it cannot be clicked into a 404. */
.nav-menu .nav-soon {
  cursor: default;
}

.nav-menu .nav-soon .nav-menu-title,
.nav-menu .nav-soon .nav-menu-desc,
.nav-menu .nav-soon > i {
  color: var(--color-text-faint);
}

.nav-menu .nav-soon:hover {
  background: transparent;
}

.nav-menu-badge.soon {
  background: transparent;
  border: 1px dashed var(--navy-200);
  color: var(--color-text-faint);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch a {
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--navy-600);
  color: oklch(0.70 0.02 260);
  font-weight: 600;
  font-size: 12px;
}

.lang-switch a.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: var(--color-nav-active);
}

/* User menu in nav. The email used to sit here in full and cost 238px of the
   topbar; it moved into the panel behind the initials. */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.avatar-btn:hover,
.nav-group.open > .avatar-btn {
  background: rgba(255, 255, 255, 0.10);
}

.avatar-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-nav-active);
}

.avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--color-nav-active);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--navy-800);
}

.avatar-btn .nav-caret {
  color: oklch(0.80 0.02 260);
}

.nav-menu .logout-btn {
  width: 100%;
  margin-top: 2px;
  text-align: left;
}

.logout-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--navy-600);
  color: oklch(0.75 0.02 260);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: oklch(0.60 0.04 260);
}

/* ─── MOBILE NAV TOGGLE ─────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* The notifications bell. In the source it sits before the drawer toggle, so a
   phone keeps it in the bar; `order` moves it beside the avatar on a wide
   screen, and the avatar gives up its own `margin-left: auto` to it. */
.topbar-bell {
  position: relative;
  order: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 50%;
  color: white;
  /* 1.25rem: one of the icon sizes the design system lists, not a new one. */
  font-size: 1.25rem;
  text-decoration: none;
  transition: background 0.15s;
}

.topbar-bell:hover,
.topbar-bell.active {
  /* `color` again: the global `a:hover` would turn the bell link-blue on the dark bar. */
  color: white;
  background: rgba(255, 255, 255, 0.10);
}

.topbar-bell:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.topbar-bell ~ .user-menu {
  order: 2;
  margin-left: 0;
}

.bell-count {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  /* geel means "attention" everywhere in the system; the semantic alias says so. */
  background: var(--color-warning);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  color: var(--navy-800);
}

.bell-count[hidden] {
  display: none;
}

/* The notifications page behind the bell. */
.notifications-page {
  max-width: 960px;
  margin: 0 auto;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

/* A 3px left rule, as on `.alert`: inset shadow, so the padding does not shift. */
.notification-item.unread {
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.notification-item.unread .notification-title {
  font-weight: 600;
}

.notification-title {
  margin: 0;
  overflow-wrap: anywhere;
}

.notification-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.notification-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.notification-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

@media (max-width: 640px) {
  .notification-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile user menu inside nav (hidden on desktop) */
.nav-user-mobile {
  display: none;
}

/* ─── PAGE LAYOUT ────────────────────────────────────────────────────────────── */
.page {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 40px 28px 64px;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.page-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 40px;
}

/* ─── HERO SECTION ───────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  margin-bottom: 2rem;
}

.hero.hero-wide {
  display: block;
  text-align: center;
}

.hero.hero-wide .hero-text {
  max-width: 600px;
  margin: 0 auto;
}

.hero.hero-wide .hero-text .lede {
  max-width: 100%;
}

.hero.hero-wide .actions {
  justify-content: center;
}

/* Mobile hero section */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .hero-text h1 {
    font-size: 1.5rem;
  }
}

.hero-text h1 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--navy-800);
}

.hero-text .lede {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 36ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-primary-hover);
  margin: 0;
  font-size: 0.8rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.actions .button {
  min-width: 160px;
}

.hero-card {
  background: var(--color-surface);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.checks {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--color-text-muted);
  display: grid;
  gap: 0.5rem;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  /* Pill, per the brand standard (ask2know#227 §3). The marketing site's own
     .btn has been 999px all along -- this is the app catching up to it. */
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

/* Keyboard focus — previously buttons had NO focus indicator (a11y gap). */
.button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.button:active {
  transform: translateY(1px);
}

/* Disabled — one rule for every variant. */
.button:disabled,
.button[disabled],
.button.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.button.primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.button.primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.button.secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--navy-200);
}

.button.secondary:hover {
  background: var(--navy-50);
  border-color: var(--navy-300);
}

/* Neutral. The standard's fifth tier, for a Cancel or a Back -- an action with
   no consequence, which `secondary` (a real alternative) overstated and `ghost`
   (nearly invisible) understated. */
.button.neutral {
  background: var(--color-surface-sunken);
  color: var(--color-text);
  border-color: var(--color-border);
}
.button.neutral:hover {
  background: var(--greige-200);
}

.button.ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

/* The arrow is the affordance, and it moves. Suffix rather than a separate
   element so any ghost button gets it without markup, and `::after` means it
   cannot be selected or read out twice by a screen reader. */
.button.ghost::after {
  content: '\2192';
  transition: transform var(--duration-fast);
}
.button.ghost:hover::after {
  transform: translateX(3px);
}
@media (prefers-reduced-motion: reduce) {
  .button.ghost:hover::after { transform: none; }
}

.button.ghost:hover {
  background: var(--navy-50);
  color: var(--color-text);
}

.button.danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.button.danger:hover {
  background: var(--red-600);
  border-color: var(--red-600);
}

.button.danger:focus-visible {
  box-shadow: var(--focus-ring-danger);
}

.button.small {
  padding: 5px 12px;
  font-size: var(--text-xs);
}

/* Extra-small — for dense contexts like table action cells, so they stop
   hand-overriding padding. */
.button.xs {
  padding: 3px 8px;
  font-size: var(--text-xs);
  gap: 4px;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── CARDS & TILES ──────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.tile {
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tile-icon {
  width: 40px;
  height: 40px;
  background: var(--cyan-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--cyan-600);
}

.tile-icon.icon-teal {
  background: var(--teal-100);
  color: var(--teal-600);
}

.tile h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
}

.tile p {
  margin-top: 0;
  color: var(--color-text-muted);
  min-height: 3.5rem;
}

.tile.nested {
  box-shadow: none;
  border: 1px dashed var(--color-border);
}

.tile-head {
  margin-bottom: 1rem;
}

.tile-head h2 {
  margin: 0 0 0.25rem 0;
}

.tile-head p {
  margin: 0;
  min-height: auto;
}

/* ─── PILLS & CHIPS ──────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}

.pill.default {
  background: var(--navy-50);
  color: var(--navy-500);
  border-color: var(--navy-100);
}

.pill.success, .pill.green {
  background: oklch(0.90 0.08 155);
  color: oklch(0.35 0.12 155);
  border-color: oklch(0.80 0.10 155);
}

.pill.navy {
  background: oklch(0.90 0.06 263);
  color: oklch(0.35 0.10 263);
  border-color: oklch(0.80 0.08 263);
}

.pill.warn, .pill.amber {
  background: oklch(0.93 0.07 86);
  color: oklch(0.45 0.13 86);
  border-color: oklch(0.85 0.10 86);
}

.pill.danger, .pill.red {
  background: oklch(0.91 0.07 25);
  color: oklch(0.42 0.14 25);
  border-color: oklch(0.82 0.10 25);
}

.pill.teal {
  background: oklch(0.90 0.07 192);
  color: oklch(0.38 0.10 192);
  border-color: oklch(0.80 0.09 192);
}

.pill.cyan {
  background: oklch(0.91 0.07 222);
  color: oklch(0.40 0.12 222);
  border-color: oklch(0.82 0.09 222);
}

.pill.ghost {
  background: var(--cyan-50);
  color: var(--cyan-700);
  border-color: var(--cyan-200);
}

.pill.small {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.chip {
  background: var(--cyan-100);
  color: var(--cyan-700);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  background: var(--navy-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.chip-check input {
  accent-color: var(--color-primary);
}

/* Two-tonal label component */
.label-twotone {
  --label-color: var(--navy-500);
  display: inline-flex;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  overflow: hidden;
}

.label-twotone .label-category,
.label-twotone .label-value {
  padding: 4px 8px;
  line-height: 1.2;
}

.label-twotone .label-category {
  background: color-mix(in srgb, var(--label-color) 25%, white);
  color: var(--label-color);
}

.label-twotone .label-value {
  background: var(--label-color);
  color: white;
  font-weight: 500;
}

.label-twotone.small {
  font-size: 0.75rem;
}

.label-twotone.small .label-category,
.label-twotone.small .label-value {
  padding: 0.2rem 0.4rem;
}

/* ─── LABEL PICKER ──────────────────────────────────────────────────────────── */
.label-picker {
  background: var(--neutral-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.label-picker-header {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--neutral-bg);
  border-bottom: 1px solid var(--border);
}

.label-picker-filter-select {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: white;
  color: var(--text);
}

.label-picker-save-btn.small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.label-picker-body {
  max-height: 350px;
  overflow-y: auto;
}

.label-picker-loading,
.label-picker-empty,
.label-picker-error {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.label-picker-error {
  color: var(--color-danger);
}

/* Category sections */
.label-picker-category {
  border-bottom: 1px solid var(--border);
}

.label-picker-category:last-child {
  border-bottom: none;
}

.label-picker-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  background: var(--neutral-bg);
  user-select: none;
  transition: background 0.15s;
}

.label-picker-category-header:hover {
  background: oklch(0.94 0.01 260);
}

.label-picker-toggle-arrow {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  width: 0.75rem;
}

.label-picker-category.collapsed .label-picker-toggle-arrow {
  transform: rotate(-90deg);
}

.label-picker-category-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.label-picker-category-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.label-picker-select-all-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}

.label-picker-select-all-label input {
  cursor: pointer;
}

/* Label items grid */
.label-picker-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
}

.label-picker-category.collapsed .label-picker-items {
  display: none;
}

.label-picker-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: oklch(0.97 0.005 260);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.label-picker-item:hover {
  background: oklch(0.94 0.02 222);
  border-color: oklch(0.82 0.09 222);
}

.label-picker-item:has(input:checked) {
  background: oklch(0.91 0.07 222);
  border-color: oklch(0.65 0.17 222);
}

.label-picker-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--color-primary);
}

.label-picker-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.label-picker-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.label-picker-label-name {
  color: var(--text);
}

.label-picker-label-count {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ─── LABEL PICKER MODAL (Three-panel) ─────────────────────────────────────────── */
.label-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lpm-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.14 0.09 262 / 0.7);
  backdrop-filter: blur(4px);
}

.lpm-content {
  position: relative;
  width: 85vw;
  max-width: 750px;
  height: 75vh;
  max-height: 650px;
  background: oklch(0.20 0.10 263);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* No header - columns start at top */
.lpm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.lpm-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.lpm-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  line-height: 1;
}

.lpm-close:hover {
  color: var(--color-text);
}

.lpm-body {
  flex: 1;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.lpm-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 100%;
  margin: 0;
  padding: 0;
}

.lpm-column {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Separators between columns */
.lpm-column[data-column="1"] {
  border-left: 1px solid oklch(0.30 0.08 260);
  border-right: 1px solid oklch(0.30 0.08 260);
}

/* Column-specific background colors */
.lpm-column[data-column="0"] {
  background: oklch(0.94 0.005 95);
}
.lpm-column[data-column="1"] {
  background: oklch(0.99 0.003 95);
}
.lpm-column[data-column="2"] {
  background: oklch(0.94 0.005 95);
}

.lpm-column-header {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Column-specific header colors */
.lpm-column[data-column="0"] .lpm-column-header {
  background: oklch(0.20 0.10 263);
  color: white;
}
.lpm-column[data-column="1"] .lpm-column-header {
  background: oklch(0.52 0.05 260);
  color: white;
}
.lpm-column[data-column="2"] .lpm-column-header {
  background: oklch(0.42 0.06 260);
  color: white;
}

.lpm-column-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.lpm-column-search i {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.lpm-column-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
}

.lpm-column-search input::placeholder {
  color: var(--color-text-muted);
}

.lpm-column-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

.lpm-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Category items (left column) */
.lpm-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.lpm-item:hover {
  background: var(--navy-100);
}

.lpm-item.active {
  background: oklch(0.91 0.07 222);
}

.lpm-item.focused {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.lpm-item.selected {
  background: oklch(0.91 0.07 222);
}

.lpm-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lpm-item input[type="checkbox"] {
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.lpm-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.lpm-item-cat-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lpm-item-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text);
}

.lpm-item-note {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.lpm-item-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.lpm-item-arrow {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.lpm-item-arrow-left {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.lpm-item:hover .lpm-item-arrow,
.lpm-item.active .lpm-item-arrow,
.lpm-item:hover .lpm-item-arrow-left,
.lpm-item.active .lpm-item-arrow-left {
  opacity: 1;
}

.lpm-item-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* "Select all" special item */
.lpm-item-all {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.lpm-item-all i {
  color: var(--color-primary);
}

/* Selected items (right column) */
/* Remove button in value items */
.lpm-item-removable {
  justify-content: space-between;
}

.lpm-remove {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.lpm-remove:hover {
  color: var(--color-danger);
  background: oklch(0.95 0.02 25);
}

/* Selected column accordion */
.lpm-selected-group {
  border-bottom: 1px solid oklch(0.85 0.01 260);
}

.lpm-selected-group:last-child {
  border-bottom: none;
}

.lpm-selected-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: oklch(0.94 0.005 95);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  transition: background 0.15s;
}

.lpm-selected-header:hover {
  background: oklch(0.92 0.008 95);
}

.lpm-selected-header i {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.lpm-selected-cat-name {
  flex: 1;
}

.lpm-selected-cat-name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  background: var(--cat-color, var(--navy-400));
}

.lpm-selected-cat-count {
  background: var(--navy-200);
  color: var(--navy-600);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
}

.lpm-selected-items {
  display: none;
  flex-direction: column;
  padding-left: 1.5rem;
  background: oklch(0.97 0.003 95);
}

.lpm-selected-items.expanded {
  display: flex;
}

.lpm-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text);
  border-top: 1px solid oklch(0.90 0.005 95);
}

.lpm-selected-item:first-child {
  border-top: none;
}

.lpm-selected-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer */
.lpm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: oklch(0.94 0.005 95);
  border-top: 1px solid oklch(0.30 0.08 260);
  flex-shrink: 0;
}

/* Add New button (for [+New Category] and [+New Value]) */
.lpm-add-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  background: transparent;
  border: 1px dashed oklch(0.45 0.08 260);
  border-radius: var(--radius-sm);
  color: oklch(0.55 0.08 260);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lpm-add-btn:hover {
  background: oklch(0.25 0.08 260);
  border-color: oklch(0.55 0.08 260);
  color: oklch(0.75 0.08 260);
}

.lpm-add-btn i {
  font-size: 0.875rem;
}

/* Selected labels preview (for form pages) */
.selected-labels-preview {
  min-height: 2rem;
  padding: 0.5rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.selected-labels-preview:empty::before {
  content: 'No labels selected';
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-style: italic;
}

/* ─── LABEL FILTER BUTTONS COMPONENT ─────────────────────────────────────────
   Unified icon button group for label/filter selection
   Used in: API Keys, Users, Document Form
   ─────────────────────────────────────────────────────────────────────────── */

.lfb-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lfb-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lfb-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.lfb-buttons {
  display: inline-flex;
  gap: 2px;
}

.lfb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--navy-300);
  background: var(--navy-50);
  border-radius: var(--radius-sm);
  color: var(--navy-600);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lfb-btn:hover {
  background: var(--cyan-50);
  color: var(--cyan-700);
  border-color: var(--cyan-400);
}

.lfb-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--cyan-200);
  border-color: var(--cyan-500);
}

.lfb-btn i {
  font-size: 16px;
}

.lfb-selected {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lfb-empty {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-style: italic;
  padding: 0.5rem 0;
}

.lfb-group {
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lfb-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--navy-50);
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--navy-600);
}

.lfb-group-header:hover {
  background: var(--navy-100);
}

.lfb-caret {
  font-size: 12px;
  color: var(--navy-400);
  transition: transform 0.15s;
}

.lfb-group.collapsed .lfb-caret {
  transform: rotate(-90deg);
}

.lfb-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lfb-cat-name {
  flex: 1;
}

.lfb-cat-count {
  font-size: 0.6875rem;
  color: var(--navy-500);
  background: var(--navy-200);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

.lfb-group-items {
  padding: 0.25rem 0.5rem 0.5rem 1.75rem;
}

.lfb-group.collapsed .lfb-group-items {
  display: none;
}

.lfb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.lfb-item:hover {
  background: var(--navy-50);
}

.lfb-item-value {
  font-size: 0.8125rem;
  color: var(--navy-600);
}

.lfb-item-wildcard .lfb-item-value {
  font-style: italic;
  color: var(--navy-400);
}

.lfb-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--navy-400);
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.lfb-item:hover .lfb-item-remove {
  opacity: 1;
}

.lfb-item-remove:hover {
  background: var(--red-500);
  color: white;
}

/* ─── COMPACT LABELS (for tables) ────────────────────────────────────────────
   Inline wrapped label display for use in table cells
   ─────────────────────────────────────────────────────────────────────────── */

.labels-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 300px;
}

@media (max-width: 768px) {
  .labels-compact {
    max-width: 120px;
  }

  .labels-compact .label-twotone .label-category {
    display: none; /* Hide category on mobile, show only value */
  }

  .labels-compact .label-twotone .label-value {
    border-radius: var(--radius-sm);
  }
}

.labels-compact .label-twotone {
  font-size: 0.7rem;
}

.labels-compact .label-twotone .label-category,
.labels-compact .label-twotone .label-value {
  padding: 0.125rem 0.35rem;
}

/* Summary pill for many labels (e.g., "+5 more") */
.labels-compact .labels-more {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.4rem;
  font-size: 0.7rem;
  background: var(--navy-100);
  color: var(--navy-500);
  border-radius: var(--radius-sm);
  cursor: help;
}

/* ─── SAVED FILTERS MODAL ────────────────────────────────────────────────────
   Modal for browsing and applying saved label filters
   ─────────────────────────────────────────────────────────────────────────── */

.saved-filters-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sfm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 33, 90, 0.4);
}

.sfm-content {
  position: relative;
  width: 480px;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sfm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--navy-800);
  color: white;
}

.sfm-title {
  font-size: 1rem;
  font-weight: 600;
}

.sfm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.sfm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sfm-body {
  flex: 1;
  overflow-y: auto;
}

.sfm-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--navy-50);
}

.sfm-search i {
  color: var(--color-text-muted);
}

.sfm-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
}

.sfm-search input::placeholder {
  color: var(--color-text-muted);
}

.sfm-list {
  padding: 0.75rem;
}

.sfm-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
}

.sfm-empty i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.sfm-empty p {
  margin: 0;
}

.sfm-empty-hint {
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.sfm-section {
  margin-bottom: 1.25rem;
}

.sfm-section:last-child {
  margin-bottom: 0;
}

.sfm-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.sfm-filter {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sfm-filter:last-child {
  margin-bottom: 0;
}

.sfm-filter:hover {
  border-color: var(--cyan-300);
  background: var(--cyan-50);
}

.sfm-filter.selected {
  border-color: var(--cyan-500);
  background: var(--cyan-100);
}

.sfm-filter-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-100);
  border-radius: var(--radius-sm);
  color: var(--navy-500);
  flex-shrink: 0;
}

.sfm-filter:hover .sfm-filter-icon {
  background: var(--cyan-200);
  color: var(--cyan-700);
}

.sfm-filter-info {
  flex: 1;
  min-width: 0;
}

.sfm-filter-name {
  font-weight: 500;
  color: var(--navy-700);
  margin-bottom: 0.125rem;
}

.sfm-filter-labels {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sfm-filter-apply {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--navy-600);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.sfm-filter-apply:hover {
  background: var(--cyan-500);
  color: white;
  border-color: var(--cyan-500);
}

.sfm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--navy-50);
}

/* Confirmation Dialog */
.sfm-confirm {
  position: absolute;
  inset: 0;
  background: rgba(21, 33, 90, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.sfm-confirm-content {
  width: 380px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sfm-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--navy-700);
  color: white;
}

.sfm-confirm-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.sfm-confirm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.sfm-confirm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sfm-confirm-body {
  padding: 1rem 1.25rem;
}

.sfm-confirm-body p {
  margin: 0 0 0.75rem 0;
  color: var(--color-text);
}

.sfm-confirm-labels {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sfm-confirm-labels li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--navy-600);
}

.sfm-confirm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sfm-confirm-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--navy-50);
  border-top: 1px solid var(--color-border);
}

.sfm-confirm-footer .button {
  flex: 1;
}

/* ─── CREATE LABEL MODAL ─────────────────────────────────────────────────────
   Modal for creating new labels with combobox category selection
   ─────────────────────────────────────────────────────────────────────────── */

.create-label-modal {
  position: fixed;
  inset: 0;
  z-index: 1200; /* Above label picker modal (1100) */
  display: flex;
  align-items: center;
  justify-content: center;
}

.clm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 33, 90, 0.5);
}

.clm-content {
  position: relative;
  width: 420px;
  max-height: 90vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.clm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--navy-800);
  color: white;
}

.clm-title {
  font-size: 1rem;
  font-weight: 600;
}

.clm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.clm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.clm-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.clm-form-group {
  margin-bottom: 1.25rem;
}

.clm-form-group:last-of-type {
  margin-bottom: 0;
}

.clm-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--navy-600);
  margin-bottom: 0.375rem;
}

.clm-optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.clm-input,
.clm-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.clm-input:focus,
.clm-textarea:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 2px var(--cyan-100);
}

.clm-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Combobox */
.clm-combobox {
  position: relative;
}

.clm-combobox-input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: white;
}

.clm-combobox-input:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 2px var(--cyan-100);
}

.clm-combobox-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: transform 0.15s;
}

.clm-combobox.open .clm-combobox-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.clm-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.clm-combobox.open .clm-dropdown {
  display: block;
}

.clm-dropdown-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--navy-600);
}

.clm-dropdown-option:hover,
.clm-dropdown-option.focused {
  background: var(--navy-50);
}

.clm-dropdown-option.clm-create-option {
  border-top: 1px solid var(--navy-100);
  color: var(--cyan-600);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clm-dropdown-option.clm-create-option:hover {
  background: var(--cyan-50);
}

.clm-dropdown-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* Color picker */
.clm-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clm-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  padding: 0;
}

.clm-color-swatch:hover {
  transform: scale(1.15);
}

.clm-color-swatch.selected {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 2px white;
}

/* Preview */
.clm-preview {
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: var(--navy-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.clm-preview-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clm-label-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: white;
  border: 1px solid var(--navy-200);
  border-radius: 20px;
  font-size: 0.8125rem;
  color: var(--navy-600);
}

.clm-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.clm-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--navy-50);
}

/* ─── FILTER LIST COMPONENT ──────────────────────────────────────────────────
   Reusable accordion-style label list with colors
   Used in: Search sidebar, Users preview, API Keys preview
   ─────────────────────────────────────────────────────────────────────────── */

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-list-empty {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-style: italic;
  padding: 0.25rem 0;
}

.filter-list-category {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.filter-list-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.375rem 0.5rem;
  background: transparent;
  border: none;
  border-left: 3px solid var(--cat-color, var(--navy-400));
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  transition: background-color 0.15s;
}

.filter-list-header:hover {
  background: var(--navy-50);
}

.filter-list-header i {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.filter-list-cat-name {
  flex: 1;
}

.filter-list-cat-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--navy-100);
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
}

.filter-list-items {
  display: none;
  flex-direction: column;
  padding-left: 1rem;
  gap: 0.25rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.filter-list-items.expanded {
  display: flex;
}

.filter-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.filter-list-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}

.filter-list-remove:hover {
  opacity: 1;
  color: var(--color-danger);
}

.filter-list-remove i {
  font-size: 0.75rem;
}

/* Legacy filter-accordion classes (deprecated, use filter-list) */
.filter-accordion { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-category-group { border-radius: var(--radius-sm); overflow: hidden; }
.filter-category-header { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.375rem 0.5rem; background: transparent; border: none; border-left: 3px solid var(--cat-color, var(--navy-400)); cursor: pointer; font-size: 0.8125rem; font-weight: 500; color: var(--color-text); text-align: left; }
.filter-category-items { display: none; flex-direction: column; padding-left: 1.25rem; }
.filter-category-items.expanded { display: flex; }

/* Responsive */
@media (max-width: 768px) {
  .lpm-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  /* Reorder: header at top, body in middle, footer at bottom */
  .lpm-header {
    order: -1;
    background: oklch(0.20 0.10 263);
    color: white;
    border-bottom: none;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
  }

  .lpm-title {
    color: white;
    font-size: 1rem;
  }

  .lpm-close {
    color: white;
  }

  .lpm-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .lpm-columns {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100%;
  }

  /* Categories (top-left), Values (top-right), Selected (bottom, full width) */
  .lpm-column[data-column="0"] {
    grid-column: 1;
    grid-row: 1;
  }

  .lpm-column[data-column="1"] {
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid oklch(0.30 0.08 260);
    border-right: none;
  }

  .lpm-column[data-column="2"] {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid oklch(0.30 0.08 260);
  }

  .lpm-column-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
  }

  .lpm-column-search {
    padding: 0.4rem 0.5rem;
  }

  .lpm-column-search input {
    font-size: 0.85rem;
  }

  .lpm-item {
    padding: 0.5rem 0.75rem;
  }

  .lpm-item-label {
    font-size: 0.8rem;
  }

  .lpm-item-count {
    font-size: 0.7rem;
  }

  .lpm-footer {
    order: 1;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
  }
}

/* ─── BADGES ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  background: var(--color-primary);
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.35rem;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
}

.rank-badge.rank-1 {
  background: var(--amber-500);
  box-shadow: 0 2px 6px oklch(0.75 0.17 86 / 0.4);
}

.rank-badge.rank-2 {
  background: var(--navy-400);
  box-shadow: 0 2px 6px oklch(0.52 0.05 260 / 0.4);
}

.rank-badge.rank-3 {
  background: oklch(0.55 0.15 50);
  box-shadow: 0 2px 6px oklch(0.55 0.15 50 / 0.4);
}

.rank-badge.rank-4,
.rank-badge.rank-5 {
  background: var(--cyan-600);
  box-shadow: 0 2px 4px oklch(0.58 0.17 222 / 0.3);
}

/* ─── THE HIDDEN ATTRIBUTE ACTUALLY HIDES ───────────────────────────────────── */
/* `hidden` is only `display: none` in the UA stylesheet, so ANY rule that sets
   display beats it — and `.alert` sets `display: flex`. Every
   `<div class="alert" hidden>` in this app was therefore permanently visible.
   On the folder-sync page that put "The document list could not be read" above a
   list of documents that had loaded perfectly: 200 on every request, a clean
   console, and an error nobody could find because no error had occurred.

   This file already carried `.install-banner[hidden]` and `.prog[hidden]` as
   one-off patches for the same collision. Two ad-hoc fixes for one rule is the
   signal it belongs here once, globally.

   `!important` on purpose: the whole point is to outrank a display declaration
   that some component rule sets without knowing it will be hidden. */
[hidden] {
  display: none !important;
}

/* ─── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  /* Square on the ruled edge, rounded away from it. */
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px;
  margin-bottom: 8px;
  /* A 3px left rule rather than a full border (ask2know#227 §3): a stack of
     these reads as a list, where four full borders read as a pile of boxes.
     `box-shadow` rather than `border-left` so the padding does not shift.
     The colour comes from each modifier below. */
  border: none;
  box-shadow: inset 3px 0 0 currentColor;
  /* display:flex is load-bearing and must not be dropped: base.css's
     `[hidden] { display: none !important }` exists because this rule beat the
     hidden attribute, and tests/ui/tests/sync-panel-states.spec.ts measures
     exactly that. */
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.alert-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: var(--cyan-100);
  color: var(--cyan-700);
}

.alert-success {
  background: var(--teal-100);
  color: var(--teal-700);
}

.alert-warning {
  background: var(--amber-100);
  color: var(--amber-700);
}

.alert-danger {
  background: var(--red-100);
  color: var(--red-700);
}

.callout {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--cyan-50);
}

.callout.warn {
  background: var(--amber-100);
  border-color: var(--amber-200);
}

/* ─── FORMS ──────────────────────────────────────────────────────────────────── */
.label {
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--color-text);
}

.stacked-form {
  display: grid;
  gap: 0.5rem;
}

.stacked-form input,
.stacked-form textarea,
.stacked-form select {
  padding: 9px 14px;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stacked-form input:focus,
.stacked-form textarea:focus,
.stacked-form select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* ─── SEARCH PANEL ───────────────────────────────────────────────────────────── */
.search-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
}

.search-form {
  display: grid;
  gap: 1rem;
}

.search-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.search-input-row input {
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input-row input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.search-input-row select {
  padding: 0.6rem 2rem 0.6rem 0.9rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  /* Custom dropdown arrow */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%237080a0' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 16px;
}

.search-input-row select:hover {
  border-color: var(--navy-300);
}

.search-input-row select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.filters {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.indicator-row {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.search-indicator.htmx-request::after {
  content: " Searching…";
}

/* ─── SEARCH RESULTS ─────────────────────────────────────────────────────────── */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 0.5rem;
  gap: 0.5rem;
}

.selected-types {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.result-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  background: var(--color-surface);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.result-card.expanded {
  border-color: var(--cyan-400);
  box-shadow: var(--shadow-md);
  transform: none;
}

.result-card.top-result {
  border: 2px solid var(--color-success);
  background: linear-gradient(135deg, var(--teal-50), var(--teal-100));
  padding: 1rem;
}

.result-card.top-result.expanded {
  border-color: var(--color-success);
}

.result-card.top-five-result {
  border-color: var(--cyan-400);
  background: linear-gradient(135deg, var(--neutral-card), var(--cyan-50));
}

/* Result card header: rank + title + donut */
.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.result-header-right {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Always-visible open-document button */
.result-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.result-open-btn i { font-size: 0.85rem; }

.result-open-btn:hover {
  background: var(--cyan-50);
  border-color: var(--color-primary);
}

.result-title {
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

/* Match location badge */
.result-location {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--teal-700, #059669);
  background: var(--teal-50, #d1fae5);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  width: fit-content;
  margin-bottom: 0.5rem;
}

.result-location i { font-size: 0.85rem; }

/* Compact label chips — tinted background, colored text (design system aligned) */
.result-label-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--chip-color, var(--greige-500)) 15%, white);
  color: var(--chip-color, var(--greige-500));
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--greige-500)) 30%, white);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.result-label-chip:hover {
  background: color-mix(in srgb, var(--chip-color, var(--greige-500)) 25%, white);
}

/* Compact labels row — hidden when card is expanded */
.result-labels-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.result-card.expanded .result-labels-compact,
.result-card.expanded .result-labels-overflow {
  display: none;
}

.label-overflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-600);
  background: var(--navy-100);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1.3;
}

.label-overflow-badge:hover {
  background: var(--navy-200);
}

/* Overflow labels (hidden by default, toggled via JS) */
.result-labels-overflow {
  display: none;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.result-labels-overflow.show {
  display: flex;
}

/* Content preview with line clamp.
   pre-wrap because search snippets now keep the line breaks of the source
   (SearchService._snippet_with_highlight): a row of a parts table has to render
   as a row, not get folded into the next one by HTML whitespace collapsing. */
.result-desc {
  margin: 0;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  white-space: pre-wrap;
  tab-size: 4;
}

.result-card.expanded .result-desc {
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Expanded section (hidden by default) */
.result-expanded {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.result-card.expanded .result-expanded {
  display: block;
}

/* Grouped labels in expanded view */
.result-labels-grouped {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.result-label-group {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.result-label-group-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 6rem;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.result-label-group-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Action buttons in expanded view */
.result-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

/* Match strength donut chart */
.match-donut {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.match-donut svg {
  transform: rotate(-90deg);
}

.match-donut .donut-bg {
  fill: none;
  stroke: oklch(0.88 0.02 260); /* navy-100 */
  stroke-width: 4;
}

.match-donut .donut-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s;
}

.match-donut .donut-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--color-text);
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Strong match: 70%+ - Vibrant green (same as widget #10b981) */
.match-donut.match-strong .donut-fill {
  stroke: #10b981;
}

/* Medium match: 40-69% - Vibrant amber/orange */
.match-donut.match-medium .donut-fill {
  stroke: #f59e0b;
}

/* Weak match: <40% - Muted coral/salmon */
.match-donut.match-weak .donut-fill {
  stroke: #94a3b8;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  background: var(--navy-50);
}

/* URL Card */
.url-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--cyan-50);
  border: 1px solid var(--cyan-200);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 0.5rem;
}

.url-card:hover {
  background: var(--cyan-100);
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}

.url-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.url-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.url-arrow {
  font-size: 0.85rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.url-card:hover .url-arrow {
  opacity: 1;
}

/* URL document result card styling */
.result-card.url-result {
  border-left: 3px solid var(--color-primary);
}

.url-card.url-primary {
  background: var(--cyan-100);
  border: 2px solid var(--color-primary);
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.url-card.url-primary:hover {
  background: var(--cyan-200);
  transform: translateX(2px);
}

.url-card.url-primary .url-arrow {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── LISTS & TABLES ─────────────────────────────────────────────────────────── */
.list-table {
  display: grid;
  gap: 0.25rem;
}

.list-head,
.list-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.8fr;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
}

.list-head {
  font-weight: 700;
  color: var(--color-text);
}

.list-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.list-row.link-row {
  text-decoration: none;
  transition: all 0.15s;
}

.list-row.link-row:hover {
  border-color: var(--cyan-300);
  box-shadow: var(--shadow-sm);
}

.list-row-group {
  border-bottom: 1px solid var(--color-border);
}

.list-row-group summary {
  list-style: none;
}

.list-row-group[open] {
  background: var(--cyan-50);
}

.list-row-group .list-row {
  border: none;
  border-radius: 0;
}

.muted.small {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ─── ENTITY LIST ────────────────────────────────────────────────────────────── */
.entity-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.entity-item {
  background: var(--navy-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
}

a.entity-item {
  padding: 0.75rem 1rem;
  transition: all 0.15s ease;
}

a.entity-item:hover {
  background: var(--navy-100);
  border-color: var(--color-primary);
  transform: translateX(4px);
}

.entity-item summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  font-weight: 600;
}

.entity-item summary::-webkit-details-marker {
  display: none;
}

.entity-item summary::before {
  content: '▶';
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--color-text-muted);
}

.entity-item[open] summary::before {
  transform: rotate(90deg);
}

.entity-item summary:hover {
  background: var(--navy-100);
}

.entity-name {
  font-weight: 700;
  color: var(--color-text);
}

.entity-detail {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ─── STAT CARDS ─────────────────────────────────────────────────────────────── */
.stat-card {
  padding: 1.25rem;
  background: var(--navy-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: default;
  transition: none;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  line-height: 1;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ─── QUICK ACTIONS CARD ─────────────────────────────────────────────────────── */
.quick-actions-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--cyan-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--cyan-200);
}

.quick-actions-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--color-text);
}

.quick-actions-card p {
  margin: 0 0 1rem 0;
  color: var(--color-text-muted);
}

/* ─── INLINE ACTIONS & DETAIL ────────────────────────────────────────────────── */
.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.ec-detail-slot {
  padding: 0.75rem 1rem 1rem;
  background: var(--navy-50);
  border-top: 1px solid var(--color-border);
}

.inline-link {
  font-weight: 600;
  color: var(--color-primary);
}

/* Button styled as link */
.link-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */
.footer {
  padding: 1rem 1.5rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: var(--color-surface);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer span {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Secondary line: the "A product by Data 2 improve" credit -- smaller and
   fainter than the tagline above it, same relationship as a logo caption.
   Qualified with .footer so it outweighs the `.footer span` rule above on
   specificity; as a bare `.footer-sub` it lost and needed !important. */
.footer .footer-sub {
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

/* ─── PWA INSTALL BANNER ───────────────────────────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy-800);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.install-banner[hidden] {
  display: none;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.install-banner-content i {
  font-size: 1.5rem;
  color: var(--cyan-400);
  flex-shrink: 0;
}

.install-banner-content span {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--navy-300);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 12px;
}

.install-banner-dismiss:hover {
  color: white;
}

.install-banner-install {
  background: var(--cyan-500);
  border: none;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
}

.install-banner-install:hover {
  background: var(--cyan-600);
}

/* Hide on desktop - PWA install is primarily mobile */
@media (min-width: 769px) {
  .install-banner {
    display: none !important;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .badge {
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.7rem;
  }
}

/* ─── SUB-NAV ────────────────────────────────────────────────────────────────── */
/* For a mode of a page rather than a place: "Results | Saved filters" on Search.
   Replaces the never-used `.tabs` component, whose folder-tab shape was welded
   to a `.tab-content` box. */
.subnav {
  display: flex;
  gap: 4px;
  margin: -18px 0 28px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.subnav a {
  padding: 9px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.subnav a:hover {
  color: var(--color-text);
}

.subnav a.active {
  color: var(--color-primary-hover);
  border-bottom-color: var(--color-primary);
}

/* ─── MOBILE RESPONSIVE NAV ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
    height: 52px;
  }

  /* The bar loses 8px here but `.brand` does not, so the anchor itself hung
     over the page below it and took the taps the mark no longer does. The mark
     keeps its size and its overhang -- that is the design -- only the
     clickable box is trimmed back to the bar. */
  .brand {
    height: 52px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    margin-left: 0;
    background: var(--color-nav-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 2px;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 99;
  }

  .nav.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 13px 14px;
    font-size: 15.5px;
    border-radius: var(--radius-sm);
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .nav-link.active {
    background: rgba(0, 180, 216, 0.15);
    box-shadow: none;
    border-left: 3px solid var(--color-nav-active);
    border-radius: 0;
  }

  .nav-group {
    display: block;
  }

  .nav-group > .nav-link {
    width: 100%;
    justify-content: space-between;
  }

  /* On touch a floating panel is the wrong shape, and the drawer's own
     overflow would clip it. Expand inline instead. */
  .nav-menu {
    position: static;
    min-width: 0;
    margin: 2px 0 6px 14px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    display: none;
    visibility: visible;
    opacity: 1;
    transition: none;
  }

  .nav-group.open > .nav-menu {
    display: block;
    pointer-events: auto;
  }

  .nav-menu a {
    padding: 10px 12px;
  }

  .nav-menu a:hover,
  .nav-menu a.active {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-menu-title {
    color: white;
    font-size: 14.5px;
  }

  .nav-menu-desc {
    display: none;
  }

  .nav-menu a > i,
  .nav-menu a:hover > i,
  .nav-menu a.active > i {
    color: oklch(0.80 0.02 260);
  }

  .nav-menu a.active .nav-menu-title {
    color: var(--color-nav-active);
  }

  .nav-menu-label {
    color: oklch(0.62 0.02 260);
  }

  .nav-menu-sep {
    background: rgba(255, 255, 255, 0.12);
  }

  .nav-menu-badge {
    background: rgba(255, 255, 255, 0.14);
    color: white;
  }

  .nav-menu .nav-soon .nav-menu-title,
  .nav-menu .nav-soon > i {
    color: oklch(0.62 0.02 260);
  }

  /* Hide desktop user menu, show mobile version in nav */
  .user-menu {
    display: none;
  }

  .topbar-bell {
    order: 0;
  }

  .topbar-bell ~ .nav-toggle {
    margin-left: 4px;
  }

  .nav-user-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-user-mobile .user-email {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: oklch(0.70 0.02 260);
    overflow-wrap: anywhere;
  }

  .nav-user-mobile .logout-btn {
    width: 100%;
    text-align: center;
  }
}

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

@media (max-width: 640px) {
  .page {
    padding: 1.5rem 1rem 2rem;
  }

  .button-group {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH PAGE COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── ADVANCED TOGGLE ────────────────────────────────────────────────────────── */
.advanced-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-text-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.advanced-toggle:hover {
  color: var(--color-primary);
}

.toggle-arrow {
  font-size: 0.7rem;
  font-style: normal;
  transition: transform 0.2s;
}

.advanced-toggle.open .toggle-arrow {
  transform: rotate(180deg);
}

.advanced-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--navy-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* ─── TOGGLE BUTTON GROUP ────────────────────────────────────────────────────── */
.toggle-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.toggle-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.toggle-btn.active:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

/* ─── FACETED SIDEBAR ────────────────────────────────────────────────────────── */
.search-results-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.faceted-sidebar {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.sidebar-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.sidebar-section h4 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Saved Filters dropdown */
.saved-filters-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
}

.saved-filters-select:hover {
  border-color: var(--color-primary);
}

.saved-filters-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(0.65 0.17 222 / 0.2);
}

.facet-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.facet-category-group {
  margin-bottom: 0.75rem;
}

.facet-category-group h5 {
  margin: 0 0 0.35rem 0;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.facet-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.facet-item:hover {
  background: var(--navy-100);
}

.facet-item.selected {
  background: var(--color-primary);
  color: white;
}

.facet-item.selected:hover {
  background: var(--color-primary-hover);
}

.facet-item.selected .facet-count {
  color: rgba(255, 255, 255, 0.8);
}

.facet-count {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-left: auto;
  font-family: var(--font-mono);
}

.clear-labels-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-danger);
  padding: 0.2rem 0.5rem;
}

.clear-labels-btn:hover {
  text-decoration: underline;
}

/* ─── MODALS ─────────────────────────────────────────────────────────────────── */
/* Generic modal styling for admin pages */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.modal .modal-content {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 8px);
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,0.2));
}

/* ─── DOCUMENT MODAL ─────────────────────────────────────────────────────────── */
.document-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.14 0.09 262 / 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 90vw;
  max-width: 900px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 0 0.5rem;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--color-danger);
}

.modal-meta {
  padding: 0.75rem 1.5rem;
  background: var(--navy-50);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Single expandable labels row */
.modal-labels-row {
  border-bottom: 1px solid var(--color-border);
  background: var(--navy-50);
}

.modal-labels-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
  text-align: left;
}

.modal-labels-trigger:hover {
  background: var(--navy-100);
}

.modal-labels-caret {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.modal-labels-row:not(.collapsed) .modal-labels-caret {
  transform: rotate(90deg);
}

.modal-labels-badge {
  margin-left: auto;
  padding: 0.1rem 0.5rem;
  background: var(--color-primary);
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.modal-labels-panel {
  display: none;
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.modal-labels-row:not(.collapsed) .modal-labels-panel {
  display: block;
}

.modal-labels-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* The passage a document was cited for, above the document itself. The PDF
   viewer takes a page and no highlight, so this is where "why this document"
   is answered. */
.modal-passage {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-primary);
  border-radius: 6px;
  background: var(--navy-50);
}

.modal-passage-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.modal-passage-where {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

.modal-passage-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
}

/* Footer links section */
.modal-footer-links {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--navy-50);
  flex-shrink: 0;
}

.modal-links-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.modal-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.modal-links-list a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.modal-links-list a:hover {
  text-decoration: underline;
}

.modal-open-original {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Collapsible grouped labels in modal (accordion style) */
.modal-labels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-labels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-labels-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.modal-labels-toggle {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.modal-labels-toggle:hover {
  background: var(--navy-100);
  color: var(--color-text);
}

.modal-labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.modal-label-group {
  display: flex;
  flex-direction: column;
}

.modal-label-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.modal-label-header:hover {
  background: var(--navy-100);
}

.modal-label-caret {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.modal-label-group:not(.collapsed) .modal-label-caret {
  transform: rotate(90deg);
}

.modal-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-label-cat {
  font-weight: 600;
  color: var(--color-text);
}

.modal-label-count {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.modal-label-values {
  display: none;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem 0 0.35rem 1.5rem;
}

.modal-label-group:not(.collapsed) .modal-label-values {
  display: flex;
}

.modal-label-value {
  padding: 0.15rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--color-text);
}

.modal-actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.modal-date {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
  font-size: 1rem;
}

.modal-instruction {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Compact modal variant */
.modal-compact .modal-content {
  max-width: 600px;
  height: auto;
  max-height: 80vh;
}

/* ─── SEARCH HIGHLIGHTS ──────────────────────────────────────────────────────── */
mark,
.search-highlight {
  background: linear-gradient(135deg, var(--amber-200) 0%, var(--amber-300) 100%);
  color: inherit;
  padding: 0.1em 0.25em;
  border-radius: 3px;
  font-weight: 500;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.search-highlight {
  animation: highlightPulse 1.5s ease-out;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 4px oklch(0.82 0.16 86 / 0.4); }
  100% { box-shadow: none; }
}

/* ─── DOCUMENT CONTENT FORMATTING ────────────────────────────────────────────── */
.document-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

.document-content .doc-heading {
  color: var(--navy-800);
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  line-height: 1.3;
}

.document-content .doc-h1 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.document-content .doc-h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.document-content .doc-h3 { font-size: 1.2rem; }
.document-content .doc-h4 { font-size: 1.1rem; }
.document-content .doc-h5 { font-size: 1rem; }
.document-content .doc-h6 { font-size: 0.95rem; color: var(--navy-500); }

.document-content .doc-detected {
  font-size: 1.1rem;
  color: var(--cyan-700);
  background: var(--cyan-50);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-primary);
  margin: 1.5rem 0 0.75rem 0;
}

.document-content .doc-para {
  margin: 0.5rem 0;
}

.document-content .doc-list {
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding: 0;
}

.document-content .doc-list li {
  margin: 0.35rem 0;
  padding-left: 0.25rem;
}

.document-content ul.doc-list { list-style-type: disc; }
.document-content ol.doc-list { list-style-type: decimal; }
.document-content .doc-list-alpha { list-style-type: lower-alpha; }

/* Markdown rendered content (marked.js) */
.document-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-800);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin: 1.5rem 0 1rem 0;
}

.document-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy-800);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin: 1.25rem 0 0.75rem 0;
}

.document-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy-700);
  margin: 1rem 0 0.5rem 0;
}

.document-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-700);
  margin: 0.75rem 0 0.5rem 0;
}

.document-content h5, .document-content h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-600);
  margin: 0.5rem 0 0.35rem 0;
}

.document-content p {
  margin: 0.75rem 0;
}

.document-content ul, .document-content ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
  padding: 0;
}

.document-content li {
  margin: 0.35rem 0;
}

.document-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--navy-50);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
}

.document-content blockquote p {
  margin: 0;
}

.document-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--navy-50);
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--cyan-700);
}

.document-content pre {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--navy-900);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.document-content pre code {
  background: transparent;
  padding: 0;
  color: var(--neutral-100);
  font-size: 0.875rem;
  line-height: 1.5;
}

.document-content hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

.document-content a {
  color: var(--color-primary);
  text-decoration: none;
}

.document-content a:hover {
  text-decoration: underline;
}

.document-content table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

.document-content th, .document-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.document-content th {
  background: var(--navy-50);
  font-weight: 600;
}

.document-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

@media (max-width: 768px) {
  .search-results-wrapper {
    grid-template-columns: 1fr;
  }

  .faceted-sidebar {
    position: static;
    max-height: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENT LIST PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── FILTER BAR & BATCH BANNER ──────────────────────────────────────────────── */
.filter-bar {
  margin-bottom: 1.5rem;
}

.batch-banner {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--cyan-50);
  border: 1px solid var(--cyan-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-banner strong {
  color: var(--color-text);
}

.batch-banner code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--cyan-100);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.batch-info {
  flex: 1;
  min-width: 200px;
}

.batch-source {
  margin-left: 0.5rem;
  color: var(--color-text-muted);
}

.batch-stats {
  margin-left: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ─── FILTER TOGGLE ──────────────────────────────────────────────────────────── */
.filter-toggle-wrapper {
  margin-top: 0.5rem;
}

.advanced-toggle .selected-count {
  color: var(--color-primary);
}

/* ─── LABEL PANEL ────────────────────────────────────────────────────────────── */
.label-panel {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--navy-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.label-category-group {
  margin-bottom: 0.75rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.category-header:hover {
  background: var(--navy-100);
}

.category-toggle {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.category-header.open .category-toggle {
  transform: rotate(90deg);
}

.category-name {
  font-weight: 600;
  color: var(--color-text);
}

.category-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.category-values {
  padding: 0.5rem 0 0.5rem 1.5rem;
}

/* ─── LABEL PICKER (bulk labels modal) ───────────────────────────────────────── */
.label-category {
  margin-bottom: 1rem;
}

.label-category h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.label-category > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.label-checkbox {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.label-checkbox:hover {
  filter: brightness(0.95);
}

.label-checkbox input[type="checkbox"] {
  cursor: pointer;
}

.label-checkbox .count {
  opacity: 0.6;
}

/* ─── DOCUMENT CARDS ─────────────────────────────────────────────────────────── */
.document-card.tile {
  padding: 0;
  overflow: hidden;
}

.doc-card-layout {
  display: flex;
}

.doc-card-content {
  flex: 1;
  padding: 1rem;
  min-width: 0;
  cursor: pointer;
}

.doc-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.doc-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.doc-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.doc-preview {
  margin: 0 0 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.doc-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

/* Card actions column */
.doc-card-actions {
  width: 50px;
  background: var(--navy-50);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: width 0.2s ease;
}

.doc-card-actions.expanded {
  width: 90px;
}

.doc-actions-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.doc-card-actions.expanded .toggle-icon {
  transform: rotate(180deg);
}

.doc-card-actions:hover {
  background: var(--navy-100);
}

.doc-actions-panel {
  display: none;
  flex-direction: column;
}

.doc-card-actions.expanded .doc-actions-toggle {
  display: none;
}

.doc-card-actions.expanded .doc-actions-panel {
  display: flex;
  flex: 1;
}

.doc-action-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
}

.doc-action-btn:hover {
  filter: brightness(0.95);
}

.doc-action-btn.view {
  background: var(--color-primary);
  color: white;
}

.doc-action-btn.edit {
  background: var(--color-surface);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.doc-action-btn.delete {
  background: var(--color-danger);
  color: white;
}

/* ─── BULK RESULTS ───────────────────────────────────────────────────────────── */
.bulk-result {
  padding: 1rem;
  border-radius: var(--radius-md);
}

.bulk-result.success {
  background: var(--teal-100);
  border: 1px solid var(--teal-300);
}

.bulk-result.error {
  background: var(--red-100);
  border: 1px solid var(--red-300);
}

.bulk-result.warning {
  background: var(--amber-100);
  border: 1px solid var(--amber-300);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENT TABLE (Gmail-style inbox view)
   ═══════════════════════════════════════════════════════════════════════════ */

.doc-table {
  width: 100%;
}

.doc-table-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--navy-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}

.doc-table-header .select-all-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-table-header .doc-count {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.doc-table-header .pagination-controls {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.doc-table-body {
  border: 1px solid var(--color-border);
  border-top: none;
  overflow: hidden;
}

/* Body gets bottom radius only when there's no footer */
.doc-table-body:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.doc-row {
  display: grid;
  grid-template-columns: 40px 140px 1fr 100px 100px;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.1s;
  background: var(--color-surface);
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-row:hover {
  background: var(--navy-50);
}

.doc-row:hover .doc-row-actions {
  opacity: 1;
}

.doc-row-checkbox {
  justify-self: center;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.doc-row-labels {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
}

.doc-row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--navy-100);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-row-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.doc-row-label-more {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  cursor: help;
  padding: 0.15rem 0.35rem;
  background: var(--navy-100);
  border-radius: 999px;
}

.doc-row-content {
  min-width: 0;
  padding-right: 1rem;
}

.doc-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}

.doc-row-preview {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.doc-row-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.doc-row-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
  justify-content: flex-end;
}

.doc-row-actions .icon-btn {
  padding: 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.doc-row-actions .icon-btn:hover {
  background: var(--navy-100);
  color: var(--color-text);
}

.doc-row-actions .icon-btn.danger:hover {
  color: var(--color-danger);
  background: var(--red-100);
}

/* Bulk actions bar */
.doc-bulk-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--amber-100);
  border: 1px solid var(--amber-300);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.doc-bulk-actions .selected-count {
  font-weight: 600;
}

.doc-bulk-actions .bulk-btns {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* Default: hide mobile fallback on desktop */
.documents-list.mobile-fallback {
  display: none;
}

/* Desktop only - show rows; mobile keeps cards */
@media (max-width: 768px) {
  .doc-table {
    display: none;
  }
  .documents-list.mobile-fallback {
    display: block;
  }
}

@media (min-width: 769px) {
  .doc-table {
    display: block;
  }
  .documents-list.mobile-fallback {
    display: none;
  }
}

/* Empty state for table */
.doc-table-empty {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Bottom pagination footer */
.doc-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--navy-50);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LINK HEALTH PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.link-health-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

/* ─── SIDEBAR ────────────────────────────────────────────────────────────────── */
.link-health-page .sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.link-health-page .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.link-health-page .sidebar-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.link-health-page .sidebar-subtitle {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0 0 1rem 0;
}

.back-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.back-link:hover {
  text-decoration: underline;
  color: var(--color-primary);
}

/* ─── FILTER MENU ────────────────────────────────────────────────────────────── */
.filter-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--navy-50);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.filter-menu li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.filter-menu li a:hover {
  background: var(--color-surface);
}

.filter-menu li a.active {
  background: var(--color-surface);
  font-weight: 500;
}

.filter-menu li a .count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  min-width: 1.5rem;
  text-align: center;
}

.filter-menu li a.active .count {
  background: var(--color-primary);
  color: white;
}

/* Status colors for filter menu */
.filter-menu li a[data-status="broken"] { border-left-color: var(--red-500); }
.filter-menu li a[data-status="blocked"] { border-left-color: var(--navy-400); }
.filter-menu li a[data-status="timeout"] { border-left-color: var(--amber-500); }
.filter-menu li a[data-status="error"] { border-left-color: var(--amber-500); }
.filter-menu li a[data-status="ssl_error"] { border-left-color: oklch(0.55 0.15 290); }
.filter-menu li a[data-status="redirect"] { border-left-color: var(--cyan-500); }
.filter-menu li a[data-status="unchecked"] { border-left-color: var(--navy-300); }
.filter-menu li a[data-status="ok"] { border-left-color: var(--teal-500); }

/* Directly under the page title now, above the status filters — so the two
   actions are the first thing reached rather than the last. Full-width and
   centred here instead of via inline styles on each control. */
.link-health-page .sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.link-health-page .sidebar-actions .button {
  width: 100%;
  text-align: center;
}

/* ─── PROGRESS BAR ──────────────────────────────────────────────────────────
   The companion's treatment (companion/ui/css/companion.css, from the redesign
   mockup) ported to the web app, because that and bulk upload are where people
   actually watch work happen. Structure is the same: a label/count row above a
   thin track, never a bare bar with text under it.

     <div class="prog">
       <div class="prog-row"><span>Checking links</span><span>20 / 50</span></div>
       <div class="prog-track"><div class="prog-fill"></div></div>
     </div>

   Colours resolve to the same values the companion uses — --color-border is
   navy-100 and --color-primary is cyan-500 — so this is the semantic spelling
   of an identical bar, not a second opinion about it. */
.prog {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prog[hidden] {
  display: none;
}

.prog-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.prog-track {
  height: 5px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.prog-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--color-primary);
  transition: width 0.2s ease-out, background 0.3s;
}

/* Amber while work is in flight, primary once it has landed — same signal the
   companion uses. */
.prog-fill.processing {
  background: var(--amber-400, #f59e0b);
}

/* Sits between the button that starts the run and the counts it moves. */
.link-check-progress {
  margin: -0.5rem 0 1.25rem;
}

/* ─── MAIN CONTENT ───────────────────────────────────────────────────────────── */
.link-health-page .main-content {
  min-width: 0;
  /* The table scrolls inside this column rather than taking the document with
     it. `.links-table` cannot shrink below its content minimum (~690px), and a
     horizontal scrollbar on the document moves the nav, the sidebar and the
     footer too -- which is how one dense table became a whole-page defect.
     The stacking below is what normally keeps it from being needed at all;
     this is the guarantee that nothing can push the page sideways again. */
  overflow-x: auto;
}

/* ─── LINKS TABLE ────────────────────────────────────────────────────────────── */
.links-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.links-table th,
.links-table td {
  /* 0.75rem across, not 1rem: five columns pay it twice each, so the last 4px
     cost 40px of table -- enough to decide whether the whole thing fits. */
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.links-table th {
  background: var(--navy-50);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.links-table tr:last-child td {
  border-bottom: none;
}

.links-table tr:hover td {
  background: var(--navy-50);
}

/* ─── STATUS BADGES ──────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.status-badge.broken {
  background: var(--red-100);
  color: var(--red-700);
}

.status-badge.blocked {
  background: var(--navy-100);
  color: var(--navy-600);
}

.status-badge.timeout,
.status-badge.error {
  background: var(--amber-100);
  color: var(--amber-700);
}

.status-badge.redirect {
  background: var(--cyan-100);
  color: var(--cyan-700);
}

.status-badge.ok {
  background: var(--teal-100);
  color: var(--teal-700);
}

.status-badge.ssl_error {
  background: var(--lichtblauw-100);
  color: var(--lichtblauw-700);
}

.status-badge.unchecked {
  background: var(--navy-100);
  color: var(--navy-500);
}

/* ─── TABLE CELLS ────────────────────────────────────────────────────────────── */
.links-table .doc-title {
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.links-table .doc-title:hover {
  text-decoration: underline;
}

.url-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-cell a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.url-cell a:hover {
  text-decoration: underline;
}

.url-detail {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.url-error {
  font-size: 0.7rem;
  color: var(--red-700);
  margin-top: 0.2rem;
}

.last-checked {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.link-health-page .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
  background: var(--navy-50);
  border-radius: var(--radius-md);
}

/* ─── LINK ACTION BUTTONS ────────────────────────────────────────────────────── */
.link-action-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.links-table tr:hover .link-action-btn {
  opacity: 1;
}

.link-action-btn.mark-ok {
  color: var(--color-text);
}

.link-action-btn.mark-ok:hover {
  background: var(--teal-100);
  border-color: var(--teal-500);
  color: var(--teal-700);
}

.link-action-btn.mark-broken {
  color: var(--color-text);
}

.link-action-btn.mark-broken:hover {
  background: var(--red-100);
  border-color: var(--red-500);
  color: var(--red-700);
}

.htmx-request .links-table tbody {
  opacity: 0.5;
}

/* ─── LINK HEALTH PAGE MOBILE ───────────────────────────────────────────────── */
/* Stack the sidebar, and give the table the full width.
 *
 * The 200px filter rail plus its 2rem gap leaves the table 548px at a 900px
 * viewport, and `.links-table` needs ~690px for its five columns -- so between
 * 769px (where the card layout ends) and about 1100px the table ran off the
 * right edge: "Last checked" rendered as "L C", its values as "N", and the
 * action column was entirely off-screen while the whole document scrolled
 * sideways. Stacked, the table gets the full 836px at 900px and every column is
 * on screen.
 *
 * Deliberately a WIDER breakpoint than the card layout further down, not the
 * same one. The card layout hides the per-row action buttons
 * (`.links-table td:last-child`), which is right for a phone and wrong for a
 * tablet -- raising the card breakpoint to fix the width would have taken retry
 * and override away from everyone under 1100px. 1099px matches the jobs table's
 * switch, for one number rather than two.
 */
@media (max-width: 1099px) {
  .link-health-page {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .link-health-page .sidebar {
    position: static;
    width: 100%;
  }

  .filter-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: transparent;
    border-radius: 0;
  }

  .filter-menu li a {
    background: var(--navy-50);
    border-radius: var(--radius-sm);
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .filter-menu li a[data-status="broken"] { border-bottom-color: var(--red-500); }
  .filter-menu li a[data-status="blocked"] { border-bottom-color: var(--navy-400); }
  .filter-menu li a[data-status="timeout"] { border-bottom-color: var(--amber-500); }
  .filter-menu li a[data-status="error"] { border-bottom-color: var(--amber-500); }
  .filter-menu li a[data-status="ssl_error"] { border-bottom-color: oklch(0.55 0.15 290); }
  .filter-menu li a[data-status="redirect"] { border-bottom-color: var(--cyan-500); }
  .filter-menu li a[data-status="unchecked"] { border-bottom-color: var(--navy-300); }
  .filter-menu li a[data-status="ok"] { border-bottom-color: var(--teal-500); }

  .link-health-page .sidebar-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .link-health-page .sidebar-actions .button {
    flex: 1;
    min-width: 140px;
  }

  /* 240px, down from 280. Stacked, the table has 681px at a 769px viewport and
     needs 699 at the wider cap -- 18px short, which clipped the action column
     at that one width (the container's own scrollbar covered it, but a column
     you have to find by scrolling is a column you do not know is there).
     Trimming the cap here rather than globally: above 1100px there is room for
     the longer URL prefix, and it is the more useful view. */
  .url-cell {
    max-width: 240px;
  }
}

@media (max-width: 768px) {
  .link-health-page .sidebar-header h1 {
    font-size: 1.5rem;
  }

  /* Links table mobile - convert to card layout */
  .links-table {
    border: none;
    background: transparent;
  }

  .links-table thead {
    display: none;
  }

  .links-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .links-table tr {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .links-table tr:hover td {
    background: transparent;
  }

  .links-table td {
    display: flex;
    align-items: flex-start;
    padding: 0;
    border: none;
  }

  .links-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-muted);
    min-width: 70px;
    flex-shrink: 0;
  }

  /* Document title cell */
  .links-table td:first-child {
    font-weight: 500;
  }

  .links-table td:first-child::before {
    content: none;
  }

  .links-table .doc-title {
    font-size: 0.9rem;
  }

  /* URL cell */
  .links-table .url-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .links-table .url-cell::before {
    content: none;
  }

  .links-table .url-cell a {
    word-break: break-all;
    font-size: 0.8rem;
  }

  .links-table .url-error,
  .links-table .url-detail {
    font-size: 0.75rem;
  }

  /* Status cell */
  .links-table td:nth-child(3) {
    order: -1;
    margin-bottom: 0.25rem;
  }

  .links-table td:nth-child(3)::before {
    content: none;
  }

  /* Last checked cell */
  .links-table .last-checked {
    font-size: 0.75rem;
    color: var(--color-text-muted);
  }

  .links-table .last-checked::before {
    content: "Checked: ";
  }

  /* Action button cell - hide the cryptic symbol buttons on mobile */
  .links-table td:last-child {
    display: none;
  }

  .links-table tr {
    position: relative;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg);
  margin: 0;
}

.login-container {
  background: var(--color-surface);
  padding: 2.5rem;
  border-radius: var(--radius-xl, 16px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1), 0 0 0 1px var(--navy-100);
  width: 100%;
  max-width: 420px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
  /* .login-logo-bubble pulls the following content up 58px on purpose (the
     mark overlaps onto the card) -- but with no offset here, that overlap
     zone lands right on the "Sign in to your account" text instead of on
     empty card space above it, so the tail visually collides with the
     words. 66px (not just 58px) matches the value already fixed and tested
     on design/logo-header-tiles-refresh -- a touch more than the raw pull,
     for breathing room past the tail's tip, not just its bounding box. */
  padding-top: 66px;
}

.login-header .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
}

.login-header .dot {
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px oklch(0.72 0.16 222 / 0.5);
}

.login-header .brand-logo {
  width: 28px;
  height: 28px;
}

.login-header p {
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Login form inputs */
.login-container .form-group {
  margin-bottom: 1.25rem;
}

.login-container .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy-600);
  margin-bottom: 0.5rem;
}

.login-container .form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--navy-200);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-container .form-group input::placeholder {
  color: var(--navy-300);
}

.login-container .form-group input:hover {
  border-color: var(--navy-300);
}

.login-container .form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(0.72 0.16 222 / 0.15);
}

.btn-login {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-top: 0.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.btn-login:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px oklch(0.72 0.16 222 / 0.3);
}

.btn-login:active {
  transform: translateY(1px);
}

.btn-login:disabled {
  background: var(--navy-300);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.error-message {
  background: var(--red-100);
  border: 1px solid var(--red-200);
  color: var(--red-700);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: none;
}

.error-message.visible {
  display: block;
}

.login-footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.login-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.login-footer a:hover {
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN PAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-header {
  margin-bottom: 2rem;
}

.admin-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.admin-header p {
  color: var(--color-text-muted);
  margin: 0;
}

/* Static content card for admin forms/sections (non-clickable, no hover). */
.admin-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ADMIN SKIN — the structured field look. The input/select/textarea rules now
   live once in .form-group (canonical primitive); admin only re-points the
   --field-* theme tokens, so it stays deliberately heavier (1.5px navy border,
   radius-md, denser padding) without duplicating any declarations. This is the
   intentional counterpart to the lighter main-app skin — keep them distinct. */
.admin-page {
  --field-border-width: 1.5px;
  --field-border-color: var(--navy-200);
  --field-border-hover: var(--navy-300);
  --field-radius: var(--radius-md);
  --field-padding-y: 0.6rem;
  --field-padding-x: 0.75rem;
  --field-font-size: 0.9rem;
}
/* Custom dropdown arrow — not token-expressible; consistent with .jobs-filter-row.
   The canonical rule sets background-color; this adds the arrow image on top. */
.admin-page .form-group select {
  padding-right: 2rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%237080a0' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 14px;
}
/* Keep checkboxes compact — reinforce over the scoped input rule above so the
   width:auto / no-ring treatment always wins regardless of source order. */
.admin-page .form-group .checkbox-label input[type="checkbox"] {
  width: auto;
  padding: 0;
  box-shadow: none;
}
/* Muted help text under admin fields. */
.admin-page .form-group small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* Inline checkbox + label row. The .form-group label.checkbox-label selector is
   needed to beat the base ".form-group label { display:block }" rule; the input
   override stops ".form-group input { width:100% }" from stretching the box. */
.checkbox-label,
.form-group label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  margin-bottom: 0;
}
.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ─── ADMIN DASHBOARD CARDS ──────────────────────────────────────────────────── */
.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.admin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.admin-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.admin-card-icon {
  width: 48px;
  height: 48px;
  background: var(--cyan-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--cyan-600);
}

.admin-card-icon.icon-teal {
  background: var(--teal-100);
  color: var(--teal-600);
}

.admin-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
}

.admin-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.admin-card-stat {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.admin-card-stat strong {
  color: var(--color-text);
}

/* ─── BREADCRUMB ─────────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--color-text-muted);
}

/* ─── PAGE HEADER ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* ─── ADMIN FILTER ROWS ─────────────────────────────────────────────────────── */
.jobs-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.jobs-filter-row select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  /* Custom dropdown arrow */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%237080a0' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 14px;
}

.jobs-filter-row select:hover {
  border-color: var(--navy-300);
}

.jobs-filter-row select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* ─── ADMIN TABLES ───────────────────────────────────────────────────────────── */
.users-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.users-table th,
.users-table td,
.admin-table th,
.admin-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.users-table th,
.admin-table th {
  background: var(--navy-50);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.users-table td,
.admin-table td {
  font-size: 0.85rem;
}

.users-table .actions,
.admin-table .actions {
  white-space: nowrap;
}

.users-table .actions .button,
.admin-table .actions .button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.users-table tbody tr:hover,
.admin-table tbody tr:hover {
  background: var(--navy-50);
}

/* Labels icon button (for compact table display) */
.labels-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--navy-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.labels-icon-btn:hover {
  background: var(--navy-100);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.labels-icon-btn .label-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
}

.labels-icon-btn .label-count-badge.warning {
  color: var(--red-600);
}

/* Mobile: horizontally scrollable tables */
@media (max-width: 768px) {
  .admin-page {
    padding: 1rem;
  }

  .admin-page .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .admin-page .page-header h1 {
    font-size: 1.25rem;
  }

  /* Wrap table in scrollable container */
  .users-table,
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .users-table th,
  .users-table td,
  .admin-table th,
  .admin-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .users-table .actions .button,
  .admin-table .actions .button {
    font-size: 0.65rem;
  }
}

/* Status badge .active/.inactive live once, further down (near .label-badge),
   and share the single .status-badge base. Duplicate set removed here. */

/* ─── BUTTON VARIANTS ────────────────────────────────────────────────────────── */
/* Solid fill, matching .primary / .danger (was an off-model outline). */
/* `.button.success` is deliberately gone (ask2know#227 §3): the brand standard
   has no such tier. A green button states a verdict before anything has
   happened, and groen is a signal colour -- reserved for saying a thing
   succeeded, which is the toast's job, not the trigger's. Its one use, the
   Activate button in admin/users.html, is now `primary`. */

/* ─── LABEL SECTIONS ─────────────────────────────────────────────────────────── */
.label-section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--navy-50);
  border-radius: var(--radius-sm);
}

.label-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.label-section p {
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.label-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.label-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.label-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.label-checkbox-item input[type="checkbox"] {
  flex-shrink: 0;
}

/* ─── FORM ACTIONS ───────────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* ─── PAGINATION ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination a {
  color: var(--color-primary);
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

/* ─── LABEL MANAGEMENT ───────────────────────────────────────────────────────── */
.category-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.category-section .category-header {
  background: var(--navy-50);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-section .category-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.category-stats {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.label-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.label-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.label-card .label-value {
  font-weight: 500;
  flex-grow: 1;
}

.label-description {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.label-usage {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.label-usage span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.label-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ─── FORM ROW ───────────────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ─── COLOR PREVIEW ──────────────────────────────────────────────────────────── */
.color-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.color-preview input[type="color"] {
  width: 40px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.color-preview input[type="text"] {
  flex: 1;
}

/* ─── SHARED COMPONENT CLASSES ──────────────────────────────────────────────── */
/* Extracted from inline styles in users.html, api_keys.html for reuse.
   See CLAUDE.md "CSS Architecture" section for usage guidelines. */

/* ─── PAGE LAYOUT ───────────────────────────────────────────────────────────── */
.admin-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* ─── MODAL OVERLAY & CONTENT (generic, e.g. api_keys, users pages) ─────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Scoped to .modal parent to avoid overriding .document-modal .modal-content */
.modal > .modal-content {
  background: var(--color-surface, #fff);
  padding: 2rem;
  border-radius: var(--radius-lg, 8px);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.2));
}

.modal > .modal-content h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
}

/* ─── STATUS BADGES ─────────────────────────────────────────────────────────── */
/* base .status-badge is defined once in the LINK ACTION BUTTONS section above. */
.status-badge.active {
  background: var(--groen-100);
  color: var(--groen-700);
}

.status-badge.inactive {
  background: var(--rood-100);
  color: var(--rood-700);
}

/* ─── LABEL BADGES ──────────────────────────────────────────────────────────── */
/* Used with inline style="background:...; color:..." for dynamic colors */
.label-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.75rem;
  background: var(--color-bg, #f3f4f6);
  color: var(--color-text-muted, var(--greige-500));
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* ─── FORM GROUPS ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Canonical field primitive. Look is driven entirely by the --field-* theme
   tokens, so the LIGHT main-app skin (token defaults) and the STRUCTURED admin
   skin (.admin-page token overrides) share this single rule. */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--field-padding-y) var(--field-padding-x);
  border: var(--field-border-width) solid var(--field-border-color);
  border-radius: var(--field-radius);
  background: var(--field-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--field-font-size);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--navy-300);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--field-border-hover);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

/* Disabled — inert, muted. Read-only — muted fill but still text-selectable. */
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: var(--field-disabled-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.form-group input:read-only,
.form-group textarea:read-only {
  background: var(--field-disabled-bg);
  color: var(--color-text-muted);
}

/* Error / invalid — red border, red focus ring. Use aria-invalid or .error. */
.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"],
.form-group textarea[aria-invalid="true"],
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--color-danger);
}
.form-group input[aria-invalid="true"]:focus,
.form-group select[aria-invalid="true"]:focus,
.form-group textarea[aria-invalid="true"]:focus,
.form-group input.error:focus,
.form-group select.error:focus,
.form-group textarea.error:focus {
  border-color: var(--color-danger);
  box-shadow: var(--focus-ring-danger);
}

.form-group .help-text {
  font-size: 0.75rem;
  color: var(--color-text-muted, var(--greige-500));
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* ─── DATA TABLES ───────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.data-table th {
  background: var(--color-bg, #f9fafb);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-text-muted, var(--greige-500));
}

.data-table tbody tr:hover {
  background: var(--color-bg, #f9fafb);
}

/* Table scroll wrapper for responsive tables */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
}

/* API Keys table - more compact */
.api-keys-table th,
.api-keys-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.api-keys-table .key-prefix {
  font-size: 0.75rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.api-keys-table .actions {
  gap: 0.25rem;
}

.api-keys-table .button.small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* ─── ACTIONS ROW ───────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 0.5rem;
}

/* ─── EMPTY STATE ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted, var(--greige-500));
}

/* ─── MESSAGE BOXES ─────────────────────────────────────────────────────────── */
.error-message {
  background: oklch(0.95 0.05 25);
  color: oklch(0.50 0.18 25);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
}

.success-message {
  background: oklch(0.95 0.05 145);
  color: var(--groen-700);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
}

.info-message {
  background: var(--cyan-100);
  border: 1px solid var(--cyan-200);
  color: var(--cyan-700);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
}

/* Onto tokens. These hardcoded oklch literals at hues 85 and 250 -- neither of
   which is a brand hue -- are the reason `.admin-notice` was invented in an
   inline <style> to avoid them. Fixing them here removes that reason. */
.warning-box {
  background: var(--geel-100);
  border: none;
  box-shadow: inset 3px 0 0 var(--geel-200);
  color: var(--geel-700);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.info-box {
  background: var(--lichtblauw-100);
  border: none;
  box-shadow: inset 3px 0 0 var(--lichtblauw-400);
  color: var(--lichtblauw-700);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* ─── PAGINATION ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination a {
  color: var(--color-primary);
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPACT LABELS TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

.labels-table-compact {
  width: 100%;
  border-collapse: collapse;
}

.labels-table-compact th,
.labels-table-compact td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

/* Labels tile - no overflow hidden to allow sticky */
.labels-tile {
  overflow: visible;
}

/* Sticky table header */
.labels-table-compact thead {
  position: sticky;
  top: 58px; /* Below sticky filter bar */
  z-index: 10;
}

.labels-table-compact th {
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  background: var(--color-surface);
  text-align: left;
}

.labels-table-compact tbody tr:hover {
  background: var(--navy-50);
}

.labels-table-compact tbody tr:hover .label-row-actions {
  opacity: 1;
}

/* Category subheader row */
.labels-table-compact .category-subheader {
  cursor: pointer;
  user-select: none;
}

.labels-table-compact .category-subheader td {
  background: var(--navy-100);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.labels-table-compact .category-subheader:hover td {
  background: var(--navy-200);
}

.labels-table-compact .category-subheader .toggle-arrow {
  display: inline-block;
  width: 1em;
  transition: transform 0.15s;
  color: var(--color-text-muted);
}

.labels-table-compact .category-subheader.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

/* Compact label pill (single line with colored dot) */
.label-pill-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.5rem 0.15rem 0.35rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--navy-100);
  color: var(--color-text);
}

.label-pill-compact .label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.label-pill-compact .label-category-prefix {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Row actions - hidden until hover */
.label-row-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.label-row-actions .btn-icon {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.label-row-actions .btn-icon:hover {
  background: var(--navy-200);
  color: var(--color-text);
}

.label-row-actions .btn-icon.danger:hover {
  color: var(--color-danger);
}

/* Description indicator tooltip */
.label-desc-indicator {
  color: var(--color-text-muted);
  cursor: help;
  font-size: 0.75rem;
  margin-left: 0.35rem;
}

/* Labels page compact hero */
.hero.compact {
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.hero.compact h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.hero.compact .lede {
  display: none;
}

/* Sticky header wrapper for labels page */
.labels-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-background);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin: -0.5rem 0 0 0;
}

/* Labels filter bar compact */
.filter-bar.compact {
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.filter-bar.compact .filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-bar.compact input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-bar.compact input[type="text"]:hover {
  border-color: var(--navy-300);
}

.filter-bar.compact input[type="text"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.filter-bar.compact input[type="text"]::placeholder {
  color: var(--color-text-muted);
}

.filter-bar.compact select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%237080a0' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 14px;
}

.filter-bar.compact select:hover {
  border-color: var(--navy-300);
}

.filter-bar.compact select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.filter-bar.compact .label-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* Mobile styles for labels page */
@media (max-width: 768px) {
  /* Fix hero section - use flexbox instead of grid to avoid minmax issues */
  .hero.compact {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .hero.compact h1 {
    font-size: 1.25rem;
    flex: 1;
    min-width: 0;
  }

  .hero.compact .actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .hero.compact .actions .button {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Filter bar compact on mobile */
  .filter-bar.compact {
    padding: 0.5rem 0.75rem;
  }

  .filter-bar.compact .filter-row {
    gap: 0.5rem;
  }

  .filter-bar.compact input[type="text"] {
    min-width: 100px;
    flex: 1;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .filter-bar.compact select {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.4rem 1.75rem 0.4rem 0.6rem;
  }

  .filter-bar.compact .button {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .filter-bar.compact .label-count {
    width: 100%;
    text-align: right;
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

  /* Labels table on mobile */
  .labels-table-compact th,
  .labels-table-compact td {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .labels-table-compact th {
    font-size: 0.65rem;
  }

  /* Hide checkbox column header text on mobile */
  .labels-table-compact th:first-child {
    width: 28px;
  }

  .label-pill-compact {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem 0.1rem 0.25rem;
  }

  .label-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
  }

  /* Compact row actions on mobile */
  .label-row-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 1; /* Always visible on mobile since no hover */
  }

  .label-row-actions .btn-icon {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
  }

  /* Category subheader */
  .labels-table-compact .category-subheader td {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  /* Bulk bar on mobile */
  .bulk-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .bulk-bar .bulk-move-group {
    gap: 0.25rem;
  }

  .bulk-bar .bulk-move-group select {
    font-size: 0.7rem;
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
  }

  .bulk-bar .button.small {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* Bulk bar - fixed to bottom when active */
.bulk-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1.5rem;
  background: #fef3c7;
  border-top: 1px solid #fcd34d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.85rem;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.bulk-bar .bulk-move-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-bar .bulk-move-group select {
  padding: 0.4rem 2rem 0.4rem 0.6rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 256 256'%3E%3Cpath fill='%237080a0' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 12px;
}

.bulk-bar .bulk-move-group select:hover {
  border-color: var(--navy-300);
}

.bulk-bar .bulk-move-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* Bulk actions bar (for users page) */
.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1.5rem;
  background: var(--navy-800);
  color: white;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.bulk-actions-bar .bulk-count {
  font-weight: 600;
  white-space: nowrap;
}

.bulk-actions-bar .bulk-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  align-items: center;
}

.bulk-filter-dropdown {
  position: relative;
}

.bulk-filter-dropdown .dropdown-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
}

.bulk-filter-dropdown .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.85rem;
}

.bulk-filter-dropdown .dropdown-item:hover {
  background: var(--navy-50);
}

.bulk-filter-dropdown .dropdown-item.muted {
  cursor: default;
  color: var(--color-text-muted);
}

/* Buttons inside bulk actions bar need special styling for dark bg */
.bulk-actions-bar .button.secondary {
  background: white;
  color: var(--navy-700);
  border-color: white;
}

.bulk-actions-bar .button.secondary:hover {
  background: var(--cyan-50);
  color: var(--cyan-700);
  border-color: var(--cyan-200);
}

/* Checkbox column in tables */
.checkbox-col {
  width: 40px;
  text-align: center;
}

.checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Category header compact (for labels page) */
.category-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--navy-50);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.category-header-compact .category-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-header-compact h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.category-header-compact .toggle-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: var(--color-text-muted);
}

.category-header-compact .category-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--navy-200);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Collapsed category section */
.category-section.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.category-section.collapsed .category-labels {
  display: none;
}

/* Category section tile style */
.category-section.tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

/* ─── RECENT JOBS PANEL ───────────────────────────────────────────────────── */
.recent-jobs-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.recent-jobs-panel .panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
}

.recent-jobs-panel .panel-header:hover {
  background: var(--navy-50);
}

.recent-jobs-panel .panel-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recent-jobs-panel .job-summary {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.recent-jobs-panel .panel-toggle {
  transition: transform 0.2s;
  color: var(--color-text-muted);
}

.recent-jobs-panel .panel-body {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}

/* Job status badges */
.job-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

.job-status.pending {
  background: var(--amber-100);
  color: var(--amber-700);
}

.job-status.processing {
  background: var(--cyan-100);
  color: var(--cyan-700);
}

.job-status.completed {
  background: var(--teal-100);
  color: var(--teal-700);
}

.job-status.failed {
  background: var(--red-100);
  color: var(--red-700);
}

/* Progress bar */
.job-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.job-progress-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.job-progress-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Job cards (used in recent jobs panel) */
.job-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.job-card:last-child {
  margin-bottom: 0;
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.job-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.job-card-progress {
  margin: 0.25rem 0;
}

.job-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.job-card-error {
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: var(--red-50);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--red-700);
  word-break: break-word;
}

.job-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Admin card icon amber variant */
.admin-card-icon.icon-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}

/* SSO login: divider + secondary button */
.sso-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--gray-400, #9ca3af);
  font-size: 0.85rem;
  margin: 1rem 0;
}
.sso-divider::before,
.sso-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.sso-divider span {
  padding: 0 0.75rem;
}
.btn-sso {
  /* Flex rather than block so the Microsoft mark sits beside the label on one
     optical centre line. `text-align` alone cannot centre an icon+text pair. */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: var(--gray-800, #1f2937);
  border: 1px solid var(--gray-300, #d1d5db);
}
.btn-sso-mark {
  /* Never shrink: a squashed Microsoft logo breaks their brand terms, and this
     button sits next to a password field where the icon is the fastest way to
     tell the two routes apart. */
  flex: none;
}
.btn-sso:hover {
  background: var(--gray-50, #f9fafb);
}

/* ═══ Whole-card links, and the home page ══════════════════════════════════
   A tile whose whole job is one destination is marked up as <a class="tile">,
   and the hover is scoped to that tag rather than to a modifier class -- so a
   plain <div class="tile"> stays inert automatically, with no class to
   remember or forget. Deliberate: .document-card.tile and .category-section.tile
   hold their own buttons and checkboxes and must not become links. */
a.tile {
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
a.tile:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  a.tile:hover { transform: none; }
}

/* A group that will only ever hold one or two tiles. `auto-fit` alone stretches
   a lone tile across the whole row. */
.grid.single-col {
  grid-template-columns: minmax(240px, 380px);
}

/* The home header: the hero statement and the primary actions as ONE piece,
   because those two actions are the product's pitch rather than a feature
   listed alongside eight others.

   The blue ground and the two blurred shapes come from the marketing site's
   own canvas (--canvas-blue in site.css), contained inside a rounded, bordered
   panel rather than bled full-bleed -- the app is a card-based UI and a
   full-bleed band would fight that everywhere else. Both colours are
   deliberately off the lichtblauw ladder, a named exception like the page
   canvas itself. */
.home-header {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2.75rem 1.5rem 2.5rem;
  margin-bottom: 2.5rem;
  background: #EEF5FA;
  border: 1px solid #D9EBF8;
  border-radius: var(--radius-xl);
}
.home-header::before,
.home-header::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.home-header::before {
  width: 340px;
  height: 340px;
  top: -120px;
  left: -80px;
  background: rgba(0, 176, 255, 0.10);
}
.home-header::after {
  width: 280px;
  height: 280px;
  bottom: -140px;
  right: -60px;
  background: rgba(21, 33, 90, 0.07);
}
.home-header > * { position: relative; z-index: 1; }
.home-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--navy-800);
  margin: 0 0 0.5rem;
}
.home-header p {
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
}

.home-header-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}
/* Chat off for a tenant means one choice, not an empty slot: the row caps so
   the lone card sits centred rather than stretching across the same 760px. */
.home-header-choices.single {
  grid-template-columns: minmax(0, 380px);
  max-width: 380px;
}
@media (max-width: 640px) {
  .home-header-choices { grid-template-columns: 1fr; }
}

/* Reuses the whole-card-is-the-link behaviour, just smaller. */
.home-choice {
  display: block;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.home-choice:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .home-choice:hover { transform: none; }
}
.home-choice h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-700);
  margin: 0 0 0.25rem;
}
.home-choice p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* Everything below the header is grouped by purpose rather than left as one
   flat grid, with a small mono label before each row. */
.home-section { margin-top: 2.5rem; }
.home-section-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0 0 0.875rem;
}

/* The login header, same mark and the same two-filter technique at its own size. */
.login-brandbar {
  margin: -2.5rem -2.5rem 0;
  padding: 34px 0 30px;
  background: var(--color-nav-bg);
  /* #00B0FF, not var(--color-primary) -- see .topbar comment above. */
  border-bottom: 4px solid #00B0FF;
  border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0;
  text-align: center;
}
.login-logo-bubble {
  position: relative;
  display: inline-flex;
  width: 190px;
  margin-bottom: -58px;
  /* Dark shadow bumped up (was 10px/18px/.38): at the original size it read
     as barely-there against .login-brandbar's own background -- too close
     in the same colour family to separate from it. */
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.55))
          drop-shadow(0 0 1.1px rgba(180, 205, 255, 0.19));
}
.login-logo-bubble img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── AGENTS & AGENT RUNS ────────────────────────────────────────────────────
   Three additions, all from the brand standard's own vocabulary rather than
   invented for this page.

   1. `.admin-card` becomes a flex column so its `.admin-card-stat` footer sits
      on one baseline across a row whatever length the descriptions are. The
      standard already specifies exactly this for `.tile` -- "the description is
      flex:1, not min-height, so the CTA lands on the same baseline across the
      row regardless of how long any one description runs". admin-card has the
      same problem and never had the rule, which is why /admin and the agents
      page both read as ragged.

   2. `.statusstrip` / `.st-card`, the standard's status strip, ported here for
      the first time. It is the standard's component for "anything with a health
      state you keep an eye on ... use this rather than hand-rolling a status box
      per page", and a run's steps are exactly that. `.stacked` is the one
      addition: a run's steps are a sequence, so they read down rather than
      across, and each carries a message that wants the width.

   3. `.stat-card.compact`, because `.stat-number` is 2rem mono and is specified
      for one number. A duration ("4 min 12 s") and a cost ("EUR 0.2451") are the
      same kind of fact and wrap badly at that size.
*/
.admin-card {
  display: flex;
  flex-direction: column;
}

.admin-card > p {
  flex: 1;
}

.statusstrip {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.statusstrip.stacked {
  flex-direction: column;
  flex-wrap: nowrap;
}

.st-card {
  flex: 1;
  min-width: 150px;
  background: var(--color-surface);
  border: 1px solid var(--navy-100);
  border-left: 3px solid var(--groen-500);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
}

.st-card.warn {
  border-left-color: var(--geel-200);
}

.st-card.down {
  border-left-color: var(--rood-500);
}

.st-card.idle {
  border-left-color: var(--navy-100);
}

.st-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.st-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--groen-500);
  flex-shrink: 0;
}

.st-card.warn .st-dot {
  background: var(--geel-200);
}

.st-card.down .st-dot {
  background: var(--rood-500);
}

.st-card.idle .st-dot {
  background: var(--navy-100);
}

.st-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--navy-700);
}

.st-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.st-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--navy-300);
  margin-left: auto;
}

.stat-card.compact .stat-number {
  font-size: 1.35rem;
}

/* The agent card's footer carries three facts (is it on, when does it run, how
   did the last run go), not one number, so its rows need to breathe.

   `.agent-line` is the badge row and is flex; `.agent-fact` is a sentence that
   opens with a badge and must stay in normal inline flow. Flexing the sentence
   too is what left "Mislukt" orphaned on a line of its own with its sentence
   wrapped underneath. */
.agent-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agent-line + .agent-line,
.agent-line + .agent-fact,
.agent-fact + .agent-fact {
  margin-top: 0.5rem;
}

.agent-fact .status-badge {
  margin-right: 0.35rem;
}

.agent-schedule {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text);
}

/* A row of one-number tiles is narrower than a row of content tiles, so `.grid`'s
   240px floor breaks five of them into 4 + 1 orphan. */
.grid.stat-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* A section heading on the run page needs air above it: `h2` inherits no top
   margin here, so it sat flush against the block it follows. */
.run-section {
  margin: 2rem 0 0.75rem;
}

/* An artifact that is not a link still needs the padding `a.entity-item` gets. */
.entity-item.static {
  padding: 0.75rem 1rem;
}

/* ─── AGENT RUN FINDINGS ─────────────────────────────────────────────────────
   What an agent found, grouped by the document it found it in.

   Replaces one `.callout` holding the whole markdown summary as literal text.
   The unit is the finding: severity, what to do, and by when. The filename
   sits above its own group because that is where you go to act on it, not
   something to re-read per row.

   Severity is encoded twice, in the left rule and in the pill, so it survives
   colour-vision deficiency and a greyscale print -- and the pill carries the
   agent's own word, so it is never colour alone. High and medium use rood and
   geel, which is what the brand standard reserves those for: a state someone
   has to act on. Low takes navy, because "noted, no deadline" is not a
   warning and colouring it like one is how a page teaches people to ignore
   its colours. */
.run-summary-intro {
  margin: 0 0 1.25rem;
  color: var(--color-text);
  max-width: 70ch;
}

.findings {
  margin: 0 0 1.75rem;
}

.findings-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.6rem;
}

/* The filename, so it breaks at a sensible point. These run long
   (`BBT_conclusies_oppervlaktebehandeling_met_organische_oplosmiddelen-versie-
   met-markering.pdf`) and must not push the page sideways. */
.findings-source {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  min-width: 0;
}

.findings-count {
  flex: none;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.finding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px; /* A surface gap, so two findings never read as one block. */
}

.finding {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  /* The 3px left rule, as an inset shadow rather than a border-left: it does
     not change the box width, so rows with and without a severity still line
     up. Same technique as `.alert`. */
  box-shadow: inset 3px 0 0 var(--navy-100);
  padding: 0.7rem 0.9rem 0.75rem;
}

.finding.sev-high { box-shadow: inset 3px 0 0 var(--red-500, var(--red-700)); }
.finding.sev-medium { box-shadow: inset 3px 0 0 var(--amber-200, var(--amber-700)); }
.finding.sev-low { box-shadow: inset 3px 0 0 var(--navy-300, var(--navy-100)); }

.finding-top {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.finding-sev {
  flex: none;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill, 9999px);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--navy-100);
  color: var(--navy-600);
}

.sev-high .finding-sev {
  background: var(--red-100);
  color: var(--red-700);
}
.sev-medium .finding-sev {
  background: var(--amber-100);
  color: var(--amber-700);
}

.finding-title {
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.finding-action {
  margin: 0.35rem 0 0;
  max-width: 74ch;
  line-height: 1.5;
}

.finding-deadline {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ══ Page principles (design systems/ask2know-paginaprincipes.html) ══════════
   The building blocks "Wat we voor je draaien" introduced, made shared so every
   page can use them. Letters refer to the principles page.
     A  .page-intro         the header panel of an overview page
        .status-line        its one-sentence summary, coloured by .is-*
     C  .section-head       a section heading with the lichtblauw bar
        .section-lede       the one sentence under it
     *  .is-ok/warn/info/unknown   one status palette: groen werkt, geel let op,
                            blauw ter info, grijs onbekend. Components read --c*.
   Roboto only, 8px rhythm. */
.is-ok      { --c: var(--groen-500);      --c-bg: var(--groen-100);      --c-line: var(--groen-200);      --c-text: var(--groen-700); }
.is-warn    { --c: var(--geel-200);       --c-bg: var(--geel-100);       --c-line: var(--geel-200);       --c-text: var(--geel-700); }
.is-info    { --c: var(--lichtblauw-400); --c-bg: var(--lichtblauw-100); --c-line: var(--lichtblauw-200); --c-text: var(--lichtblauw-700); }
.is-unknown { --c: var(--greige-400);     --c-bg: var(--greige-100);     --c-line: var(--greige-200);     --c-text: var(--greige-600); }

.page-intro {
  position: relative; overflow: hidden;
  padding: 32px 40px; margin-bottom: 24px;
  background: #EEF5FA; border: 1px solid #D9EBF8; border-radius: var(--radius-xl);
}
.page-intro::before { content: ""; position: absolute; left: -10%; top: -70%; width: 44%; height: 240%; background: #D9EBF8; opacity: .7; border-radius: 48% 52% 46% 54% / 42% 47% 53% 58%; transform: rotate(-6deg); pointer-events: none; }
.page-intro::after { content: ""; position: absolute; right: -8%; top: -55%; width: 32%; height: 210%; border: 2px solid rgba(0, 176, 255, .25); border-radius: 50%; transform: rotate(4deg); pointer-events: none; }
.page-intro > * { position: relative; z-index: 1; }
.page-intro h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; color: var(--uiblauw-800); }
.page-intro-lede { margin: 8px 0 0; font-size: 16px; color: var(--donkerblauw-500); max-width: 80ch; }
@media (max-width: 640px) {
  .page-intro { padding: 24px 20px; }
  .page-intro h1 { font-size: 24px; }
  .page-intro-lede { font-size: 15px; }
}

.status-line {
  margin-top: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-left: 4px solid var(--c);
  border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: var(--shadow-sm);
}
.status-line-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--c-bg); flex-shrink: 0; }
.status-line-text { flex: 1; min-width: 12rem; }
.status-line-head { font-weight: 700; font-size: 16px; color: var(--uiblauw-800); }
.status-line-sub { font-size: 14px; color: var(--donkerblauw-500); margin-top: 2px; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 56px 0 0; }
.section-head::before { content: ""; width: 4px; height: 20px; background: var(--lichtblauw-400); border-radius: 2px; flex-shrink: 0; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--uiblauw-800); }
.section-lede { margin: 8px 0 24px 16px; font-size: 15px; color: var(--donkerblauw-500); max-width: 92ch; }

/* ─── AUDIT LOG (admin/audit.html) ──────────────────────────────────────────── */
/* Dense on purpose: it is read as a list of many small facts, one line each
   where they fit, so a screen holds a working day of events. */
.audit-page { max-width: 1280px; }
.audit-header { margin-bottom: 12px; }
.audit-header h1 { margin-bottom: 2px; }
.audit-header p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.audit-filters .form-group { margin: 0; min-width: 0; }
.audit-filters label { display: block; margin-bottom: 2px; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.audit-filters input,
.audit-filters select {
  height: var(--control-height-sm, 32px);
  padding: 0 8px;
  font-size: 13px;
}
.audit-filters #audit-event { width: 210px; }
.audit-filters #audit-who { width: 190px; }
.audit-filters #audit-outcome { width: 130px; }
.audit-filters input[type="date"] { width: 140px; }

.audit-filter-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.audit-filter-actions .button {
  height: var(--control-height-sm, 32px);
  padding: 0 12px;
  font-size: 13px;
}

/* Wide by nature: the table scrolls inside its own box, never the page. */
.audit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}

.audit-table th {
  position: sticky;
  top: 0;
  padding: 6px 10px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--greige-50);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.audit-table td {
  padding: 5px 10px;
  vertical-align: top;
  border-top: 1px solid var(--greige-100);
}

.audit-table tbody tr:first-child td { border-top: 0; }
.audit-table tbody tr:hover td { background: var(--greige-50); }

.audit-when {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.audit-event { white-space: nowrap; }
.audit-who { white-space: nowrap; }
.audit-about { white-space: nowrap; }

.audit-outcome {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}
.audit-outcome-denied { background: var(--geel-100); color: var(--geel-700); }
.audit-outcome-failed { background: var(--rood-100); color: var(--rood-700); }

.audit-id,
.audit-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.audit-details { min-width: 240px; overflow-wrap: anywhere; color: var(--color-text); }
.audit-sep { color: var(--color-text-muted); }

.audit-page .pagination { margin-top: 10px; }

.audit-note {
  margin-top: 8px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ─── WHAT WENT TO THE AI MODEL (chat_sent.html) ─────────────────────────────── */
.sent-page { max-width: 900px; margin: 0 auto; }
.sent-lede { color: var(--color-text-muted); margin: 0 0 24px; }
.sent-block { margin-bottom: 28px; }
.sent-block h2 { font-size: var(--text-lg); margin: 0 0 8px; }
.sent-question {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  white-space: pre-wrap;
}
.sent-meta, .sent-none { color: var(--color-text-muted); font-size: var(--text-sm); }
.sent-call {
  margin-top: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.sent-call > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.sent-tool { font-family: var(--font-mono); font-weight: 600; }
.sent-arg { font-size: var(--text-sm); overflow-wrap: anywhere; }
.sent-arg-key { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); }
.sent-size { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.sent-result {
  margin: 0;
  padding: 12px 14px;
  max-height: 480px;
  overflow: auto;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* An item in a menu with section headings (the Admin menu): one line, no
   description, so a categorised menu stays short. */
.nav-menu a.nav-menu-compact {
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ─── ADMIN OVERVIEW (admin/index.html) ─────────────────────────────────────── */
/* ── Admin overview in the page principles ─────────────────────────────────
   The intro panel and status line, section headings with the stripe
   (.page-intro, .status-line, .section-head above), and per setting a white
   row in one card per section. A setting's state is a label: grey-blue when it
   is simply how it is set, yellow with an icon when it asks for attention. */
.admin-overview { max-width: 960px; }
.admin-overview .section-head { margin-top: 56px; }
.admin-overview .admin-group:first-of-type .section-head { margin-top: 32px; }
.admin-overview .section-lede { margin-bottom: 16px; }
.ao-attention { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; }
.ao-attention a { font-weight: 600; color: var(--geel-700); text-decoration: none; }
.ao-attention a:hover { text-decoration: underline; }
.ao-attention .arr, .admin-row-go { display: inline-block; transition: transform .12s; }
.ao-attention a:hover .arr { transform: translateX(3px); }

.admin-rows {
  border: 1px solid var(--donkerblauw-100);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--donkerblauw-100);
  border-left: 4px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: background .12s;
}
.admin-row:first-child { border-top: 0; }
.admin-row[data-tone="warn"] { border-left-color: var(--geel-200); }
.admin-row:hover { background: var(--donkerblauw-50); color: inherit; }
.admin-row:hover .admin-row-go { transform: translateX(3px); color: var(--lichtblauw-600); }
.admin-row:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--lichtblauw-100); }
.admin-row-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--lichtblauw-100); color: var(--lichtblauw-700);
  font-size: 20px;
}
.admin-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-row-title { font-size: 16px; font-weight: 600; color: var(--uiblauw-800); }
.admin-row-desc { font-size: 14px; color: var(--donkerblauw-500); }
.ao-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px; border-radius: 999px;
  background: var(--donkerblauw-50); border: 1px solid var(--donkerblauw-100);
  font-size: 13px; font-weight: 600; color: var(--donkerblauw-600);
  white-space: nowrap;
}
.ao-pill.is-warn { background: var(--c-bg); border-color: var(--c-line); color: var(--c-text); }
.admin-row-status { font: inherit; color: inherit; }
.admin-row-go { font-size: 18px; color: var(--donkerblauw-300); }
@media (max-width: 640px) {
  .admin-row { grid-template-columns: 32px minmax(0, 1fr) 16px; gap: 12px; padding: 14px 16px; }
  .admin-row-icon { width: 32px; height: 32px; font-size: 17px; }
  .admin-row .ao-pill, .admin-row > .admin-row-status { grid-column: 2; grid-row: 2; justify-self: start; white-space: normal; height: auto; padding: 3px 10px; }
}

/* An Access label whose API keys may show their secret key (labels.html). */
.label-public {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--groen-100);
  color: var(--groen-700);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

/* ── Notifications in the page principles ──────────────────────────────────
   Same building blocks as "What we run for you" and Statistieken: the intro
   panel, white cards with a 4px status stripe and a tinted icon (yellow: you
   notice it, blue: for your information, green: resolved, grey: history),
   days as a reader says them, the clock time only, and one clear link. */
.nt-intro-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.nt-empty { margin-top: 8px; }
.nt-day { margin: 32px 0 12px; display: flex; gap: 12px; align-items: center; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }
.nt-day::before { content: ""; width: 4px; height: 18px; background: var(--lichtblauw-400); border-radius: 2px; }
.nt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.nt-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 20px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-left: 4px solid var(--c, var(--donkerblauw-200)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.nt-card.is-plain { --c: var(--donkerblauw-200); --c-bg: var(--donkerblauw-50); --c-text: var(--donkerblauw-500); }
.nt-card.is-done { --c: var(--donkerblauw-100); --c-bg: var(--donkerblauw-50); --c-text: var(--donkerblauw-400); box-shadow: none; }
.nt-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c-bg); color: var(--c-text); font-size: 20px; }
.nt-card.is-ok .nt-icon { color: var(--groen-500); }
.nt-main { min-width: 0; }
.nt-src { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: 2px; }
.nt-chip { display: inline-flex; gap: 4px; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); color: var(--donkerblauw-500); font-size: 12px; font-weight: 600; }
.nt-chip-ok { color: var(--groen-700); border-color: var(--groen-200); background: var(--groen-100); }
.nt-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--uiblauw-800); line-height: 1.4; overflow-wrap: anywhere; }
.nt-card.is-unread .nt-title { font-weight: 700; }
.nt-card.is-done .nt-title { font-weight: 500; color: var(--donkerblauw-500); }
.nt-new { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-right: 6px; border-radius: 999px; background: var(--uiblauw-800); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.nt-text { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--donkerblauw-700); max-width: 72ch; }
.nt-time { display: block; margin-top: 8px; font-size: 13px; color: var(--donkerblauw-400); }
.nt-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.nt-link { border: 0; background: none; padding: 4px 0; font: 600 14px var(--font-body); color: var(--lichtblauw-600); cursor: pointer; white-space: nowrap; }
.nt-link .arr { display: inline-block; transition: transform .12s; }
.nt-link:hover { text-decoration: underline; }
.nt-link:hover .arr { transform: translateX(3px); }
.nt-btn-quiet { border: 1px solid var(--donkerblauw-100); background: var(--color-surface); border-radius: 999px; padding: 6px 14px; font: 500 13px var(--font-body); color: var(--donkerblauw-500); cursor: pointer; white-space: nowrap; }
.nt-btn-quiet:hover { border-color: var(--lichtblauw-400); color: var(--uiblauw-800); }
.nt-link:focus-visible, .nt-btn-quiet:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lichtblauw-100); border-radius: 999px; }
@media (max-width: 640px) {
  .nt-card { grid-template-columns: 32px minmax(0, 1fr); }
  .nt-icon { width: 32px; height: 32px; font-size: 17px; }
  .nt-actions { grid-column: 2; flex-direction: row; align-items: center; }
}

/* ─── SUPPORT ACCESS (admin/support.html, base.html banner) ─────────────────── */
.support-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--amber-700);
  background: var(--amber-100);
  color: var(--amber-700);
  font-weight: 500;
}
.status-badge.support-active { background: var(--amber-100); color: var(--amber-700); }
.status-badge.support-pending { background: var(--navy-100); color: var(--navy-600); }
.status-badge.support-closed { background: var(--navy-50); color: var(--navy-600); }
.support-section { margin-bottom: 1.5rem; }
.support-as { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.2rem; }
.support-when { font-family: var(--font-mono); font-size: 0.75rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.support-actions .button { white-space: nowrap; }
.support-table-wrap { overflow-x: auto; }
.support-actions form { margin: 0; }

/* ── Page principles: the shared fixes (bouwsteen B, C, H) ──────────────────
   One work-page header everywhere: title 26 navy, one sentence under it, at
   most one link back above it. Until now the title came in three sizes (36,
   24, 22) and two colours, and the lede wrapped at 36 characters. Headings
   and column headers in plain text, not small caps: rule 5. Last in the file
   on purpose, so it wins over the per-page rules above without !important. */
.hero-text h1,
.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--uiblauw-800);
}
.hero-text .lede,
.page-header + .page-lede {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--donkerblauw-500);
  max-width: 80ch;
}
.back-link { display: inline-flex; gap: 6px; margin-bottom: 12px; font-size: 14px; color: var(--donkerblauw-500); }
.back-link:hover { color: var(--uiblauw-800); }
.page-header { margin-bottom: 24px; }
@media (max-width: 640px) {
  .hero-text h1, .page-header h1 { font-size: 22px; }
}

.users-table th,
.admin-table th,
.data-table th,
.links-table th,
.labels-table-compact th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--donkerblauw-500);
}
.sidebar-section h4,
.facet-category-group h5,
.result-label-group-name,
.sfm-section-title,
.stat-label,
.page-eyebrow {
  text-transform: none;
  letter-spacing: 0;
}

/* Dates as a reader says them (rule 8), in the body face with even digits,
   not the typewriter face. */
.doc-row-date { font-family: var(--font-body); font-variant-numeric: tabular-nums; font-size: 13px; }

/* ── Users in the page principles (admin/users.html) ───────────────────────
   Intro panel + status line, the list in one white card with a toolbar on
   top, state as a label, actions as quiet text buttons (red text only for
   the destructive ones; the confirmation is the red button). */
.us-page { max-width: 1044px; }
.us-intro-top, .us-compact { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.us-compact { margin-bottom: 0; }
.us-page .section-head { margin-top: 40px; }
.us-page .section-lede { margin-bottom: 16px; }
.us-card {
  background: var(--color-surface);
  border: 1px solid var(--donkerblauw-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.us-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--donkerblauw-100); display: flex; flex-direction: column; gap: 12px; }
.us-search { display: flex; align-items: center; gap: 8px; position: relative; }
.us-search > .ph { position: absolute; left: 12px; color: var(--donkerblauw-400); font-size: 16px; pointer-events: none; }
.us-search input { flex: 1; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--donkerblauw-100); border-radius: 999px; font: 400 14px var(--font-body); }
.us-search input:focus { outline: none; border-color: var(--lichtblauw-400); box-shadow: 0 0 0 3px var(--lichtblauw-100); }
.us-labels:empty { display: none; }
.us-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
.us-toolbar .us-search { flex: 1 1 420px; }
.us-table { width: 100%; border-collapse: collapse; }
.us-table th { background: var(--donkerblauw-50); padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--donkerblauw-100); }
.us-table td { padding: 14px 16px; border-bottom: 1px solid var(--donkerblauw-100); font-size: 14px; color: var(--donkerblauw-700); vertical-align: middle; }
.us-table tbody tr:last-child td { border-bottom: 0; }
.us-table tbody tr:hover td { background: var(--donkerblauw-50); }
.us-table tr.is-inactive .us-email { color: var(--donkerblauw-400); }
.us-email { font-weight: 600; color: var(--uiblauw-800) !important; overflow-wrap: anywhere; }
.us-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.us-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--donkerblauw-50); border: 1px solid var(--donkerblauw-100); color: var(--donkerblauw-500); white-space: nowrap; }
.us-pill.is-ok { background: var(--c-bg); border-color: var(--c-line); color: var(--c-text); }
.us-labels-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--donkerblauw-100); border-radius: 999px; background: var(--color-surface); font: 600 13px var(--font-body); color: var(--lichtblauw-700); cursor: pointer; white-space: nowrap; }
.us-labels-btn:hover { border-color: var(--lichtblauw-400); background: var(--lichtblauw-50, #F3F9FD); }
.us-actions { text-align: right; white-space: nowrap; }
.us-text-btn { border: 0; background: none; padding: 4px 8px; font: 600 13px var(--font-body); color: var(--donkerblauw-600); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.us-text-btn:hover { background: var(--donkerblauw-50); color: var(--uiblauw-800); }
.us-text-btn.is-danger { color: var(--rood-600, #C62828); }
.us-text-btn.is-danger:hover { background: #FDECEC; color: var(--rood-700, #A31515); }
.us-text-btn:focus-visible, .us-labels-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--lichtblauw-100); }
.us-empty { padding: 48px 24px; text-align: center; color: var(--donkerblauw-500); }
.us-empty > .ph { font-size: 32px; color: var(--lichtblauw-600); }
.us-empty-head { margin: 8px 0 4px; font-weight: 700; color: var(--uiblauw-800); }
@media (max-width: 720px) {
  .us-table th:nth-child(5), .us-table td:nth-child(5) { display: none; }
  .us-actions { white-space: normal; }
}
/* The label filter inside the users toolbar: one quiet line, no "nothing
   applied" sentence (the empty selection says it already). */
.us-labels .lfb-wrapper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.us-labels .lfb-header { display: flex; align-items: center; gap: 8px; margin: 0; }
.us-labels .lfb-title { font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); }
.us-labels .lfb-btn { border-radius: 999px; }
.us-labels .lfb-empty { display: none; }
.us-labels .lfb-selected { margin: 0; }

/* Key figures per role under the users intro: like Statistieken's, and each
   one a link that filters the list (rule 10: clickable looks clickable). */
.us-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.us-stat { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
/* Only a tile that is a link reacts to the mouse: rule 10, clickable looks clickable, and what is not clickable does not. */
a.us-stat:hover { border-color: var(--lichtblauw-400); box-shadow: 0 0 0 3px var(--lichtblauw-100); color: inherit; }
.us-stat.is-current { border-color: var(--lichtblauw-600); box-shadow: inset 0 -3px 0 var(--lichtblauw-400); }
.us-stat-label { font-size: 14px; color: var(--donkerblauw-500); }
.us-stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--uiblauw-800); font-variant-numeric: tabular-nums; }
.us-stat-sub { font-size: 13px; color: var(--donkerblauw-400); }
@media (max-width: 720px) { .us-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Page principles: the work-page building blocks (pp-*) ────────────────
   Shared by the admin pages: one width, white cards with a head (title +
   state label + control), plain text, conditions as labels, a quiet notice
   for "saved" (bouwsteen F, D, G). Users keeps its own us-* list styles. */
.pp-page { max-width: 1044px; }
.pp-page .section-head { margin-top: 40px; }
.pp-page .section-lede { margin-bottom: 16px; }
.pp-card {
  background: var(--color-surface);
  border: 1px solid var(--donkerblauw-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin: 0 0 24px;
}
.pp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pp-card-head > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-card h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }
.pp-card-text { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--donkerblauw-700); max-width: 80ch; }
.pp-label { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); }
.pp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pp-checks li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--donkerblauw-700); }
.pp-checks .pp-pill { min-width: 84px; justify-content: center; }
.pp-hint { margin: 12px 0 0; font-size: 13px; color: var(--donkerblauw-500); }
.pp-card-actions { margin-top: 20px; display: flex; gap: 8px; justify-content: flex-end; }
.pp-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--donkerblauw-50); border: 1px solid var(--donkerblauw-100); color: var(--donkerblauw-500); white-space: nowrap; }
.pp-pill.is-ok, .pp-pill.is-warn, .pp-pill.is-info { background: var(--c-bg); border-color: var(--c-line); color: var(--c-text); }
.pp-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--uiblauw-800); cursor: pointer; }
.pp-switch input { width: 18px; height: 18px; accent-color: var(--lichtblauw-600); }
.pp-switch input:disabled + span { color: var(--donkerblauw-400); cursor: not-allowed; }
.pp-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-text); font-size: 14px; font-weight: 600; }

/* Access page cards (admin/access.html partials): the head of each card, the
   four facts per tool, and the "not split up by label" warning in the quiet
   notice style (bouwsteen G), not a full yellow block. */
.pp-card .page-row-head, .pp-card .tool-row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pp-card .page-row-head h2, .pp-card .tool-row-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }
.pp-card > p { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--donkerblauw-700); max-width: 80ch; }
.pp-card .tool-facts { margin: 16px 0; font-size: 14px; }
.pp-card .tool-facts dt { color: var(--donkerblauw-500); font-weight: 600; }
.pp-card .tool-facts dd { color: var(--donkerblauw-700); }
.pp-card .callout.warn { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--geel-200); border-left: 4px solid var(--geel-200); border-radius: var(--radius-md); background: var(--geel-100); color: var(--donkerblauw-700); font-size: 14px; }
.pp-card .form-group { margin: 16px 0 0; }
.pp-card .callout.warn { background: var(--color-surface); border-color: var(--donkerblauw-100); border-left-color: var(--geel-200); }
/* "Who may use it" on one line: title, picker button, and who it is now. */
.pp-card .lfb-wrapper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pp-card .lfb-header { display: flex; align-items: center; gap: 8px; margin: 0; }
.pp-card .lfb-title { font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); }
.pp-card .lfb-btn { border-radius: 999px; }
.pp-card .lfb-selected { margin: 0; }
.pp-card .lfb-empty { font-style: normal; font-size: 13px; font-weight: 600; color: var(--donkerblauw-700); background: var(--donkerblauw-50); border: 1px solid var(--donkerblauw-100); border-radius: 999px; padding: 2px 10px; }
.pp-card .lfb-wrapper, .us-labels .lfb-wrapper { flex-direction: row; justify-content: flex-start; }
.pp-card .lfb-selected, .us-labels .lfb-selected { flex-direction: row; flex-wrap: wrap; }
.pp-card .form-group { text-align: left; display: block; }
.pp-card .page-labels, .pp-card .tool-labels { width: 100%; }

/* A table inside a card (no inner padding: the table runs to the edges),
   an empty state with an icon (bouwsteen I), and a text link with an arrow. */
.pp-card-table { padding: 0; overflow: hidden; }
.pp-card-table .data-table { width: 100%; border-collapse: collapse; margin: 0; }
.pp-card-table .data-table th { background: var(--donkerblauw-50); padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--donkerblauw-100); }
.pp-card-table .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--donkerblauw-100); font-size: 14px; color: var(--donkerblauw-700); vertical-align: top; }
.pp-card-table .data-table tbody tr:last-child td { border-bottom: 0; }
.pp-empty { text-align: center; padding: 40px 24px; color: var(--donkerblauw-500); }
.pp-empty > .ph { font-size: 32px; color: var(--lichtblauw-600); }
.pp-empty-head { margin: 8px 0 4px; font-weight: 700; color: var(--uiblauw-800); }
.pp-empty p { margin: 4px 0 0; }
.pp-link { font-weight: 600; font-size: 14px; color: var(--lichtblauw-600); text-decoration: none; white-space: nowrap; }
.pp-link:hover { text-decoration: underline; }
.support-page .support-as, .support-page .support-when, .support-page .support-as code { font-family: var(--font-body); font-size: 13px; color: var(--donkerblauw-500); }
.support-page .support-as code { background: none; padding: 0; }
.support-page .pp-pill + .support-dur { white-space: nowrap; }
.pp-empty p { max-width: none; margin-left: auto; margin-right: auto; }

/* Access cards, second pass (2026-11-16): one switch that saves at once, one
   line saying who may use it with "Change who", details behind a disclosure. */
.pp-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--uiblauw-800); }
.pp-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pp-toggle-ui { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--donkerblauw-200); transition: background .15s; flex-shrink: 0; }
.pp-toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.pp-toggle input:checked + .pp-toggle-ui { background: var(--lichtblauw-600); }
.pp-toggle input:checked + .pp-toggle-ui::after { transform: translateX(18px); }
.pp-toggle input:focus-visible + .pp-toggle-ui { box-shadow: 0 0 0 3px var(--lichtblauw-100); }
.pp-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 14px; color: var(--donkerblauw-700); }
.pp-who-label { color: var(--donkerblauw-500); font-weight: 600; }
.pp-who .pp-link { border: 0; background: none; padding: 0; margin-left: 4px; cursor: pointer; font-family: var(--font-body); }
.pp-card .pp-notice { margin: 16px 0 0; }
.pp-more { margin-top: 16px; border-top: 1px solid var(--donkerblauw-100); padding-top: 12px; }
.pp-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--lichtblauw-600); list-style: none; }
.pp-more summary::-webkit-details-marker { display: none; }
.pp-more summary::after { content: " \25BE"; }
.pp-more[open] summary::after { content: " \25B4"; }
.pp-more .tool-facts { margin-top: 12px; }
.pp-card .pp-card-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }

/* A group heading inside a section (bouwsteen C: bold 15, no stripe). */
.pp-group { margin: 24px 0 12px; font-size: 15px; font-weight: 700; color: var(--donkerblauw-600); }
.pp-from { display: block; margin-top: 4px; font-size: 14px; color: var(--donkerblauw-500); }

/* How far a source reaches: always visible on the data not split up by label. */
.pp-scope { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--lichtblauw-50, #EEF8FD); border: 1px solid var(--lichtblauw-100); font-size: 14px; line-height: 1.5; color: var(--donkerblauw-700); max-width: 80ch; }
.pp-scope .ph { margin-top: 3px; color: var(--lichtblauw-700); flex-shrink: 0; }

/* AI provider page: a consent line (the checkbox is a deliberate choice, so it
   stays a checkbox, not a switch), and form fields laid out in the card. */
.pp-consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; font-size: 14px; color: var(--donkerblauw-700); cursor: pointer; max-width: 80ch; }
.pp-consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--lichtblauw-600); flex-shrink: 0; }
.pp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; margin-top: 16px; }
.pp-fields .form-group, .pp-more .form-group { margin-bottom: 12px; }
.pp-card label[for] { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--donkerblauw-600); }
.pp-card select, .pp-card input[type=text], .pp-card input[type=password], .pp-card input[type=url] { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-md); font: 400 14px var(--font-body); background: var(--color-surface); }
.pp-card small { display: block; margin-top: 4px; font-size: 12px; color: var(--donkerblauw-500); }
.pp-hint-inline { font-weight: 400; color: var(--donkerblauw-400); }
.pp-scope > span { display: block; }

/* API keys: two header buttons side by side, a strong name, the key prefix
   still in mono (it is what you match against the key you hold), small notes. */
.pp-intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-strong { color: var(--uiblauw-800); font-weight: 600; }
.pp-page .key-note { margin-top: 2px; font-size: 13px; color: var(--donkerblauw-500); }
.pp-page .key-prefix { font-size: 12px; color: var(--donkerblauw-600); background: var(--donkerblauw-50); padding: 2px 6px; border-radius: 4px; }
.pp-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-card-table .us-actions { text-align: right; white-space: nowrap; }

/* Widget wizards: the info-box class stays on the lede (a browser test reads
   it) but looks like the lede; the cards stack with the card rhythm. */
.page-intro .info-box { background: none; border: 0; border-left: 0; box-shadow: none; padding: 0; margin: 8px 0 0; border-radius: 0; color: var(--donkerblauw-500); font-size: 16px; }
.pp-page .widget-cards { display: flex; flex-direction: column; gap: 0; }
.pp-page .widget-card .questions-list { margin-top: 12px; }

/* Audit log in the page principles: dense on purpose, but the filters and the
   table sit in cards, the time is said (exact second on hover), and a refused
   or failed event carries a yellow label. */
.pp-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.pp-filters .form-group { margin: 0; }
.pp-filters input, .pp-filters select { height: 36px; }
.audit-page .audit-table { width: 100%; border-collapse: collapse; }
.audit-page .audit-table th { background: var(--donkerblauw-50); padding: 8px 12px; text-align: left; font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--donkerblauw-100); }
.audit-page .audit-table td { padding: 8px 12px; border-bottom: 1px solid var(--donkerblauw-100); font-size: 13px; color: var(--donkerblauw-700); }
.audit-page .audit-table tbody tr:last-child td { border-bottom: 0; }
.audit-page .audit-when { font-family: var(--font-body); white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-page .audit-outcome { margin-left: 6px; height: 20px; font-size: 11px; }

/* Users, after the review: a role choice per row (yellow when missing), a
   yellow tile for users without a role, tiles that wrap to five. */
.us-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.us-stat.is-warn { border-color: var(--geel-200); box-shadow: inset 4px 0 0 var(--geel-200); cursor: default; }
.us-role { height: 30px; padding: 0 8px; border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-md); background: var(--color-surface); font: 600 13px var(--font-body); color: var(--uiblauw-800); cursor: pointer; }
.us-role.is-warn { border-color: var(--geel-200); background: var(--geel-100); color: var(--geel-700); }
.us-email .us-pill { margin-left: 6px; }

/* Search in the page principles: the field in the intro panel, white and
   large; "More search options" as a quiet link; filters and results in cards. */
.zs-intro .zs-form { margin-top: 20px; }
.zs-intro .search-input-row { position: relative; display: flex; gap: 12px; align-items: center; }
.zs-intro .zs-icon { position: absolute; left: 16px; font-size: 20px; color: var(--donkerblauw-400); pointer-events: none; }
.zs-intro #q { flex: 1; height: 52px; padding: 0 16px 0 46px; border: 1px solid var(--donkerblauw-100); border-radius: 999px; background: var(--color-surface); font: 400 16px var(--font-body); box-shadow: var(--shadow-sm); }
.zs-intro #q:focus { outline: none; border-color: var(--lichtblauw-400); box-shadow: 0 0 0 4px var(--lichtblauw-100); }
.zs-intro .search-input-row .button { height: 52px; padding: 0 28px; }
.zs-more { margin-top: 10px; }
.zs-more .advanced-toggle { border: 0; background: none; padding: 0; font: 600 14px var(--font-body); font-style: normal; color: var(--lichtblauw-600); cursor: pointer; }
.zs-more .advanced-toggle:hover { text-decoration: underline; }
.zs-more .advanced-toggle.open .toggle-arrow { display: inline-block; transform: rotate(180deg); }
.zs-intro .advanced-panel { margin-top: 12px; padding: 16px 20px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); }
.zs-panel { background: none; border: 0; box-shadow: none; padding: 0; margin-top: 8px; }
.zs-panel .faceted-sidebar { background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 20px; }
.zs-panel .faceted-sidebar h4 { font-size: 15px; font-weight: 700; color: var(--uiblauw-800); text-transform: none; letter-spacing: 0; margin: 0; }
.zs-panel .lfb-empty { font-style: normal; }
.zs-intro .indicator-row { margin: 0 !important; min-height: 0; }
.zs-intro .indicator-row .htmx-indicator { display: none; }
.zs-intro .indicator-row .htmx-indicator.htmx-request { display: inline-block; margin-top: 8px; color: var(--donkerblauw-500); }
.zs-panel .sidebar-section { border: 0; padding: 0; background: none; box-shadow: none; }
/* Search results in the page principles: white cards like every other list,
   the best match marked by a light-blue stripe instead of a teal fill, a quiet
   rank number, and the source link as a plain link row. */
.zs-panel .result-card, .zs-panel .result-card.top-result, .zs-panel .result-card.top-five-result, .zs-panel .result-card.url-result {
  background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.zs-panel .result-card.top-result { border-left: 4px solid var(--lichtblauw-400); }
.zs-panel .result-card:hover { border-color: var(--lichtblauw-400); }
.zs-panel .rank-badge, .zs-panel .rank-badge.rank-1, .zs-panel .rank-badge.rank-2, .zs-panel .rank-badge.rank-3, .zs-panel .rank-badge.rank-4, .zs-panel .rank-badge.rank-5 {
  background: var(--donkerblauw-50); color: var(--donkerblauw-600); border: 1px solid var(--donkerblauw-100); box-shadow: none;
}
.zs-panel .url-card, .zs-panel .url-card.url-primary { background: var(--donkerblauw-50); border: 1px solid var(--donkerblauw-100); color: var(--lichtblauw-700); box-shadow: none; }
.zs-panel .url-card:hover { border-color: var(--lichtblauw-400); background: var(--color-surface); }
.zs-panel .results-head { font-size: 14px; font-weight: 600; color: var(--donkerblauw-500); }

/* Documents in the page principles: intro panel with actions, the search and
   label filter as one card on top of the list (us-toolbar, us-search). */
.dc-actions { align-items: center; }
.dc-bulk { margin-left: 8px; }
.dc-filters { background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; box-shadow: none; padding: 0; margin: 24px 0 0; }
.dc-filters .us-toolbar { border-bottom: 1px solid var(--donkerblauw-100); }
.dc-filters + .content, .dc-filters + .batch-banner { margin-top: 0; }
.dc-filters ~ .content .documents-list { border-top-left-radius: 0; border-top-right-radius: 0; }
/* Documents list: the first label after the title in a column that grows with
   it, so a document without labels leaves no empty gap before its title. */
@media (min-width: 721px) {
  .doc-row { grid-template-columns: 40px minmax(0, 1fr) auto 120px 100px; gap: 0 12px; }
  .doc-row .doc-row-content { order: 2; }
  .doc-row .doc-row-labels { order: 3; }
  .doc-row .doc-row-date { order: 4; }
  .doc-row .doc-row-actions { order: 5; }
}
.doc-row-title { color: var(--uiblauw-800); }
.doc-row-preview { color: var(--donkerblauw-500); }

/* Links in the page principles: intro panel with the action and the progress
   bar, a yellow line only when links do not work, the list in one white card
   with the status filters as chips on top (zero counts hidden). */
.lk-intro .link-check-progress { margin-top: 20px; padding: 12px 16px; background: var(--color-surface); border: 1px solid var(--lichtblauw-200); border-radius: var(--radius-md); }
.lk-intro .pp-intro-actions { align-items: center; }
.lk-intro .pp-intro-actions .pp-link { margin-left: 8px; }
.lk-toolbar .filter-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; background: none; border: 0; box-shadow: none; }
.lk-toolbar .filter-menu li.is-empty { display: none; }
.lk-toolbar .filter-menu li a { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 14px; border: 1px solid var(--donkerblauw-100); border-left-width: 1px; border-radius: 999px; background: var(--color-surface); font: 600 13px var(--font-body); color: var(--donkerblauw-700); text-decoration: none; }
.lk-toolbar .filter-menu li a:hover { border-color: var(--lichtblauw-400); background: var(--lichtblauw-50, #F3F9FD); }
.lk-toolbar .filter-menu li a.active { background: var(--uiblauw-800); border-color: var(--uiblauw-800); color: #fff; }
.lk-toolbar .filter-menu li a .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--donkerblauw-50); color: var(--donkerblauw-600); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.lk-toolbar .filter-menu li a.active .count { background: rgba(255,255,255,.18); color: #fff; }
.lk-toolbar .filter-menu li a[data-status="broken"] .count, .lk-toolbar .filter-menu li a[data-status="timeout"] .count,
.lk-toolbar .filter-menu li a[data-status="error"] .count, .lk-toolbar .filter-menu li a[data-status="ssl_error"] .count,
.lk-toolbar .filter-menu li a[data-status="blocked"] .count { background: var(--geel-100); color: var(--donkerblauw-800, #1b2a4a); }
.lk-card .links-table { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.lk-card .links-table th { font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); text-transform: none; letter-spacing: 0; }
.lk-card .links-table .doc-title { font: 600 14px var(--font-body); color: var(--uiblauw-800); text-decoration: none; }
.lk-card .links-table .doc-title:hover { text-decoration: underline; }
.lk-card .links-table .url-cell a { color: var(--donkerblauw-600); font-size: 13px; overflow-wrap: anywhere; }
.lk-card .links-table .status-badge { white-space: nowrap; }
.lk-card .links-table .last-checked { white-space: nowrap; font-size: 13px; color: var(--donkerblauw-600); }
.lk-card .links-table td:last-child { text-align: right; white-space: nowrap; }

/* Labels in the page principles: intro panel, the list in one white card with
   search and category on top; edit and delete always visible as text buttons. */
.lb-actions { align-items: center; }
.lb-bulk { border: 0; background: none; padding: 0 0 0 8px; cursor: pointer; font-family: var(--font-body); }
.lb-toolbar select { height: 38px; border-radius: 999px; padding: 0 32px 0 14px; border: 1px solid var(--donkerblauw-100); font: 400 14px var(--font-body); }
.lb-toolbar .label-count { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); }
.lb-card .labels-tile { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 0; background: none; }
.lb-card .labels-table-compact { margin: 0; width: 100%; }
.lb-card .labels-table-compact thead th { background: var(--donkerblauw-50); padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--donkerblauw-100); }
.lb-card .labels-table-compact td { padding: 10px 16px; border-bottom: 1px solid var(--donkerblauw-100); font-size: 14px; }
.lb-card .labels-table-compact .category-subheader td { background: var(--color-surface); padding-top: 18px; font-weight: 700; font-size: 14px; color: var(--uiblauw-800); }
.lb-card .labels-table-compact .category-subheader:hover td { background: var(--donkerblauw-50); }
.lb-card .label-row-actions { opacity: 1 !important; visibility: visible !important; display: flex; justify-content: flex-end; gap: 4px; }
.lb-card .label-row-actions .btn-icon { width: auto; height: auto; border: 0; }
.lb-page .bulk-bar { margin-top: 24px; }

/* Processing in the page principles: intro panel with a status line only
   while something runs (blue) or failed this week (yellow), the jobs in one
   white card with the filters on top. */
.jb-card .jobs-filter-row select { height: 38px; border-radius: 999px; padding: 0 32px 0 14px; border: 1px solid var(--donkerblauw-100); font: 400 14px var(--font-body); }
.jb-card .jb-refresh { margin-left: auto; }
.jb-card .jobs-table { border: 0; border-radius: 0; }
.jb-card .jobs-table th { background: var(--donkerblauw-50); font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); text-transform: none; letter-spacing: 0; }
.jb-card .jobs-table tr:last-child td { border-bottom: 0; }
.jb-card #jobs-table-container.hidden + .jobs-cards + .us-empty, .jb-card .us-empty { border: 0; }

/* Bulk upload in the page principles (bu-*): steps inside the intro panel,
   the folder choice and the lists as white cards. */
.bu-page.wizard-container { max-width: 1044px; min-height: 0; }
.bu-page .bu-intro.wizard-header { display: block; margin-bottom: 24px; padding-bottom: 32px; border-bottom: 0; }
.bu-intro .wizard-steps { margin-top: 20px; gap: 12px; flex-wrap: wrap; }
.bu-intro .wizard-step { padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); color: var(--donkerblauw-500); font-size: 14px; }
.bu-intro .wizard-step.active { border-color: var(--lichtblauw-400); color: var(--uiblauw-800); }
.bu-intro .wizard-step.completed { color: var(--donkerblauw-700); }
.bu-intro .wizard-step-num { background: var(--donkerblauw-50); color: var(--donkerblauw-500); }
.bu-intro .wizard-step.active .wizard-step-num { background: var(--lichtblauw-600); }
.bu-intro .wizard-step.completed .wizard-step-num { background: var(--groen-600, #2E7D32); }
.bu-page .folder-picker { padding: 24px; margin-bottom: 16px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.bu-page .folder-picker .button .ph { margin-right: 4px; }
.bu-pick-text { margin: 0 0 14px; font-size: 14px; color: var(--donkerblauw-600); }
.bu-page .file-list { background: var(--color-surface); border-color: var(--donkerblauw-100); border-radius: var(--radius-lg); }
.bu-page #file-list-container { flex: 0 1 auto; }
.bu-page .bu-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 40px 24px; color: var(--donkerblauw-500); font-size: 14px; }
.bu-page .bu-empty .ph { font-size: 32px; color: var(--lichtblauw-600); }
.bu-page .bu-empty p { margin: 0; }
.bu-page .wizard-nav { border-top: 0; }
/* The link cell wraps instead of cutting the reason off; "Mark as OK" is the
   action on a link that does not work, so it is always there; "Mark as
   broken" is rare and shows on hover. */
.lk-card .url-cell { max-width: 300px; white-space: normal; overflow: visible; }
.lk-card .url-cell .url-error, .lk-card .url-cell .url-detail { white-space: normal; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; margin-top: 4px; }
.lk-card .link-action-btn { width: auto; height: auto; border: 0; border-radius: 6px; padding: 4px 8px; display: inline-flex; }
.lk-card .link-action-btn.mark-ok { opacity: 1; color: var(--lichtblauw-700); }
.lk-card .link-action-btn.mark-ok:hover { background: var(--lichtblauw-50, #F3F9FD); border: 0; color: var(--uiblauw-800); }
.lk-card .link-action-btn.mark-broken:hover { background: #FDECEC; border: 0; }
.lb-toolbar select, .jb-card .jobs-filter-row select { appearance: none; -webkit-appearance: none; background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") no-repeat right 12px center; }

/* Pop-ups in the page principles: Cancel/Close is quiet, the destructive
   action is red text, not a big red button; no empty height. */
.jb-modal { max-width: 480px; height: auto !important; min-height: 0 !important; }
.jb-modal .modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.jb-modal .jb-delete { margin-right: auto; }
.zs-hint { margin: 6px 0 0; font-size: 12px; color: var(--donkerblauw-500); }
#url-modal .modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* Saved filters in the page principles (sf-*). */
.sf-page.filters-page { max-width: 1044px; padding: 0; margin: 0 auto; }
.sf-page .subnav { margin-top: 24px; }
.sf-page .filters-section { margin-bottom: 0; }
.sf-page .section-head { margin: 32px 0 12px; }
.sf-page .filter-card { border-color: var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.sf-page .filter-name { color: var(--uiblauw-800); font-weight: 700; }
.sf-page .filter-actions { display: flex; gap: 4px; }
.sf-empty { margin-top: 24px; }

/* Add / edit document in the page principles (df-*). */
.df-page .df-body { margin-top: 24px; }
.df-card { max-width: 760px; padding: 24px 28px; }
.df-card .input-mode-tabs { border-bottom: 1px solid var(--donkerblauw-100); padding-bottom: 0; gap: 4px; margin-bottom: 20px !important; }
.df-card .mode-tab { border-radius: 0; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 600 14px var(--font-body); color: var(--donkerblauw-500); background: none; }
.df-card .mode-tab:hover { background: none; color: var(--uiblauw-800); }
.df-card .mode-tab.active { background: none; color: var(--uiblauw-800); border-bottom-color: var(--lichtblauw-600); }
.df-card .df-file { width: 100%; padding: 18px; border: 1px dashed var(--lichtblauw-400); border-radius: var(--radius-lg); background: var(--lichtblauw-50, #F3F9FD); font: 400 14px var(--font-body); color: var(--donkerblauw-600); cursor: pointer; }
.df-card .df-file::file-selector-button { margin-right: 14px; height: 36px; padding: 0 18px; border: 1px solid var(--donkerblauw-100); border-radius: 999px; background: var(--color-surface); font: 600 14px var(--font-body); color: var(--uiblauw-800); cursor: pointer; }
.df-card .df-file:hover::file-selector-button { border-color: var(--lichtblauw-400); }
.df-card .lfb-title { display: none; }
.df-card .actions { display: flex; align-items: center; gap: 12px; }
.df-more { margin-top: 4px; }
.df-more > summary { margin-bottom: 12px; }

/* Folder sync in the page principles (sy-*): intro panel, tabs, one card. */
.sy-page .subnav { margin-top: 24px; }
.sy-card { margin-top: 16px; }
.sy-card .data-table { margin: 0; border: 0; border-radius: 0; box-shadow: none; width: 100%; }
.sy-card .data-table th { background: var(--donkerblauw-50); font-size: 13px; font-weight: 600; color: var(--donkerblauw-500); text-transform: none; letter-spacing: 0; }
.sy-card .data-table tr:last-child td { border-bottom: 0; }
.sy-card .empty-state { border: 0; background: none; padding: 40px 24px; text-align: center; color: var(--donkerblauw-600); }
.sy-card .alert { margin: 16px; }

/* No all-caps in the customer app (Aukje, 2026-11-17): a status, a label or a
   heading reads as a word with one capital, "Klaar", not "KLAAR". The internal
   Data 2 improve admin (body.admin-layout) keeps its own style. */
body:not(.admin-layout) *,
body:not(.admin-layout) *::before,
body:not(.admin-layout) *::after { text-transform: none !important; }

/* The label picker in the page principles: title on top, white columns with
   quiet headers, the chosen category marked in light blue, Cancel as a text
   button. (Its header used to sit under the columns, dark on dark.) */
.lpm-content { background: var(--color-surface); border-radius: var(--radius-lg); max-width: 860px; border: 1px solid var(--donkerblauw-100); }
.lpm-header { order: -1; background: var(--color-surface); color: var(--uiblauw-800); border-bottom: 1px solid var(--donkerblauw-100); padding: 18px 24px; }
.lpm-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--uiblauw-800); }
.lpm-close { width: 36px; height: 36px; border-radius: 50%; color: var(--donkerblauw-500); }
.lpm-close:hover { background: var(--donkerblauw-50); color: var(--uiblauw-800); }
.lpm-column, .lpm-column[data-column="0"], .lpm-column[data-column="1"], .lpm-column[data-column="2"] { background: var(--color-surface); }
.lpm-column[data-column="1"] { border-left: 1px solid var(--donkerblauw-100); border-right: 1px solid var(--donkerblauw-100); }
.lpm-column-header, .lpm-column[data-column="0"] .lpm-column-header, .lpm-column[data-column="1"] .lpm-column-header, .lpm-column[data-column="2"] .lpm-column-header {
  background: var(--donkerblauw-50); color: var(--donkerblauw-600); font-size: 13px; font-weight: 600; letter-spacing: 0; padding: 10px 16px; border-bottom: 1px solid var(--donkerblauw-100);
}
.lpm-column-search { border-bottom: 1px solid var(--donkerblauw-100); }
.lpm-item { padding: 10px 16px; font-size: 14px; color: var(--donkerblauw-700); border-left: 3px solid transparent; }
.lpm-item:hover { background: var(--donkerblauw-50); }
.lpm-item.active, .lpm-item.selected { background: var(--lichtblauw-50, #F3F9FD); border-left-color: var(--lichtblauw-600); color: var(--uiblauw-800); font-weight: 600; }
.lpm-item.focused { outline: 2px solid var(--lichtblauw-400); }
.lpm-item-count { font-family: var(--font-body); font-size: 12px; color: var(--donkerblauw-500); background: var(--donkerblauw-50); border-radius: 999px; padding: 1px 8px; }
.lpm-add-btn { margin: 8px 12px; width: calc(100% - 24px); border-radius: var(--radius-md); border-color: var(--lichtblauw-200); color: var(--lichtblauw-700); }
.lpm-footer { background: var(--color-surface); border-top: 1px solid var(--donkerblauw-100); padding: 14px 24px; align-items: center; }
.lpm-footer .lpm-cancel { margin-right: auto; }
@media (max-width: 768px) {
  .lpm-content { border-radius: 0; border: 0; }
  .lpm-header { background: var(--color-surface); color: var(--uiblauw-800); }
}
.lpm-selected-header { background: var(--donkerblauw-50); color: var(--uiblauw-800); }
.lpm-selected-header:hover { background: var(--lichtblauw-50, #F3F9FD); }

/* Documents: the empty state closes the search card instead of floating
   under it as a dashed box. */
.dc-empty { background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-sm); margin: 0; }
.dc-empty p { margin: 0; }
.dc-filters ~ .content { margin-top: 0; }

/* Labels: a category is a heading over its labels, not one more row. Light
   band, bigger text, how many labels it holds; the labels sit indented under
   it. */
.lb-card .labels-table-compact .category-subheader td { background: var(--donkerblauw-50); padding-top: 12px; padding-bottom: 12px; font-size: 15px; font-weight: 700; color: var(--uiblauw-800); border-top: 1px solid var(--donkerblauw-100); }
.lb-card .labels-table-compact .category-subheader:hover td { background: var(--lichtblauw-50, #F3F9FD); }
.lb-card .labels-table-compact .category-subheader .toggle-arrow { font-size: 11px; color: var(--donkerblauw-500); margin-right: 6px; }
.lb-card .labels-table-compact .label-row td:nth-child(2) { padding-left: 40px; }
.lb-card .labels-table-compact .label-row td { padding-top: 8px; padding-bottom: 8px; }
.lb-card .labels-table-compact .label-row + .category-subheader td { border-top: 1px solid var(--donkerblauw-100); }
.lb-cat-count { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--donkerblauw-500); }
@media (min-width: 721px) {
  .doc-row .doc-row-labels { overflow: visible; justify-content: flex-end; }
  .doc-row .doc-row-label { flex-shrink: 0; max-width: 220px; }
}
/* Documents: the search card and the list are one card. The list's header
   band continues the card (same border, no corners of its own), the body
   closes it with the card's rounded bottom. */
.dc-filters ~ .content .doc-table-header { border-radius: 0; border-color: var(--donkerblauw-100); border-top: 0; background: var(--donkerblauw-50); padding: 10px 20px; }
.dc-filters ~ .content .doc-table-body { border-color: var(--donkerblauw-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--color-surface); }
.dc-filters ~ .content .doc-table-footer { border-color: var(--donkerblauw-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dc-filters ~ .content .doc-table-body:not(:last-child) { border-radius: 0; }
/* "Cannot be checked" is not a problem: a neutral count, not a yellow one. */
.lk-toolbar .filter-menu li a[data-status="blocked"] .count { background: var(--donkerblauw-50); color: var(--donkerblauw-600); }

/* One place for the header block on every page (review 2026-11-17): the intro
   panel starts at the top of .page and spans its full width. Wrappers that
   added their own padding or a narrower max-width (admin pages, the Beheer
   overview, Notifications) no longer do inside .page. The "Back to admin" link
   sits in the space above the panel instead of pushing it down. */
.page > .admin-page, .page > .admin-page-container, .page > .notifications-page,
.page > .admin-page.admin-overview, .page > .us-page, .page > .pp-page {
  max-width: none; padding: 0; margin: 0;
}
.page > .admin-page, .page > .admin-page-container { position: relative; }
.page > .admin-page > .back-link:first-child,
.page > .admin-page-container > .back-link:first-child {
  position: absolute; top: -30px; left: 0; margin: 0;
}
/* Agent runs in the page principles (ar-*): intro panel with the agent's own
   name, key figures, one card with one row per run. */
.ar-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ar-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ar-stats .us-stat-num.ar-when { font-size: 22px; }
.ar-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ar-card { margin-top: 0; }
.ar-list { list-style: none; margin: 0; padding: 0; }
.ar-list li + li { border-top: 1px solid var(--donkerblauw-100); }
.ar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto auto 16px; gap: 16px; align-items: center; padding: 14px 20px; color: inherit; text-decoration: none; }
.ar-row:hover { background: var(--donkerblauw-50); }
.ar-when-col { display: flex; flex-direction: column; gap: 2px; }
.ar-date { font-weight: 600; color: var(--uiblauw-800); font-size: 14px; }
.ar-trigger { font-size: 12px; color: var(--donkerblauw-500); }
.ar-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ar-head { font-size: 14px; color: var(--donkerblauw-700); }
.ar-error { font-size: 13px; color: var(--rood-700, #A31515); }
.ar-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-facts { display: flex; gap: 14px; font-size: 13px; color: var(--donkerblauw-600); white-space: nowrap; }
.ar-failed { color: var(--rood-700, #A31515); font-weight: 600; }
.ar-status { white-space: nowrap; }
.ar-caret { color: var(--donkerblauw-400); }
.ar-row:hover .ar-caret { color: var(--lichtblauw-600); }
.ar-alert, .ar-empty { margin-top: 24px; }
.ar-summary { font-size: 15px; line-height: 1.6; color: var(--donkerblauw-700); }
.ar-page .section-head { margin-top: 40px; }
.ar-page .section-lede { margin-top: 8px; }
@media (max-width: 860px) {
  .ar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ar-facts, .ar-caret { display: none; }
  .ar-stats, .ar-stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ar-summary { margin-top: 16px; }

/* Home in the page principles: the intro panel like every page (left
   aligned), Chat and Search as two white action cards in it, the groups under
   the shared section heads. */
.page-intro.home-header { text-align: left; padding: 40px; }
.page-intro.home-header h1 { margin: 0; }
.page-intro.home-header .page-intro-lede { margin-left: 0; margin-right: 0; max-width: 70ch; }
.home-header .home-header-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; max-width: none; }
.home-header .home-header-choices.single { grid-template-columns: minmax(0, 520px); }
.home-header .home-choice { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-align: left; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.home-header .home-choice:hover { border-color: var(--lichtblauw-400); box-shadow: 0 0 0 4px var(--lichtblauw-100); }
.home-choice-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--lichtblauw-100); color: var(--lichtblauw-700); font-size: 22px; }
.home-choice-text { flex: 1; min-width: 0; }
.home-header .home-choice h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }
.home-header .home-choice p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--donkerblauw-600); }
.home-choice-arrow { color: var(--donkerblauw-400); font-size: 18px; transition: transform .12s, color .12s; }
.home-choice:hover .home-choice-arrow { color: var(--lichtblauw-600); transform: translateX(3px); }
.home-section .section-head { margin: 40px 0 16px; }
.home-section .tile h2 { font-size: 18px; }
@media (max-width: 720px) {
  .home-header .home-header-choices { grid-template-columns: minmax(0, 1fr); }
  .page-intro.home-header { padding: 24px; }
}
/* The home panel wears the same shapes as every intro panel, not its old
   blurred circles. */
.page-intro.home-header::before { left: -10%; top: -70%; right: auto; bottom: auto; width: 44%; height: 240%; background: #D9EBF8; opacity: .7; filter: none; border-radius: 48% 52% 46% 54% / 42% 47% 53% 58%; transform: rotate(-6deg); }
.page-intro.home-header::after { right: -8%; top: -55%; bottom: auto; left: auto; width: 32%; height: 210%; background: none; filter: none; border: 2px solid rgba(0, 176, 255, .25); border-radius: 50%; transform: rotate(4deg); }
.page-intro.home-header { padding: 32px 40px; margin-bottom: 24px; }
.page-intro.home-header h1 { font-size: 30px; }
.page-intro.home-header .page-intro-lede { margin-top: 8px; font-size: 16px; color: var(--donkerblauw-500); }
/* The reported numbers sit where a section's text sits: under the head, indented like .section-lede. */
.ar-page .agent-line.ar-metrics { margin: 12px 0 0 16px; gap: 8px; }

/* Every home tile the same width, also in a group of one: columns are kept, not stretched. */
.home-section .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Home to-do list (replaces the attention line): a white card in the intro
   panel; "For you to pick up" with an open circle per item, "Good to know" in
   blue below; every row a link. */
.home-todo { margin-top: 20px; background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ht-block { padding: 14px 20px 10px; }
.ht-block + .ht-block { border-top: 1px solid var(--donkerblauw-100); }
.ht-block.is-todo { border-left: 4px solid var(--geel-200); }
.ht-block.is-info { border-left: 4px solid var(--lichtblauw-400); background: var(--lichtblauw-50, #F3F9FD); }
.ht-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--uiblauw-800); margin-bottom: 4px; }
.ht-head .ph { font-size: 18px; }
.is-todo .ht-head .ph { color: var(--geel-500, #976D00); }
.is-info .ht-head .ph { color: var(--lichtblauw-600); }
.ht-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--geel-100); color: var(--donkerblauw-800, #1F283E); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.ht-list { list-style: none; margin: 0; padding: 0; }
.ht-list li + li { border-top: 1px solid var(--donkerblauw-100); }
.ht-list a { display: grid; grid-template-columns: 20px 200px minmax(0, 1fr) 16px; gap: 12px; align-items: center; padding: 9px 8px; margin: 0 -8px; border-radius: 6px; color: inherit; text-decoration: none; }
.ht-list a:hover { background: var(--donkerblauw-50); }
.ht-list a:hover .ht-text { text-decoration: underline; }
.ht-mark { font-size: 18px; color: var(--donkerblauw-400); }
.is-info .ht-mark { color: var(--lichtblauw-600); }
.ht-where { font-weight: 600; color: var(--uiblauw-800); font-size: 14px; }
.ht-text { color: var(--donkerblauw-700); font-size: 14px; }
.ht-caret { color: var(--donkerblauw-400); }
.ht-list a:hover .ht-caret { color: var(--lichtblauw-600); }
@media (max-width: 640px) { .ht-list a { grid-template-columns: 20px minmax(0, 1fr) 16px; } .ht-where { grid-column: 2 / 3; } .ht-text { grid-column: 2 / 3; } }
.is-info .ht-mark { font-size: 22px; }

/* Home tiles: every call to action on one line at the bottom of its tile,
   however long the text above it. The to-do card sits under the intro panel. */
.home-section .tile { display: flex; flex-direction: column; }
.home-section .tile p { flex: 1; min-height: 0; margin-bottom: 12px; }
.home-section .tile .inline-link { margin-top: auto; }
.home-todo { margin: 0 0 8px; }
/* The two kinds apart (review 2026-11-17): two cards side by side, action left,
   good to know right; one alone takes the full width; stacked on a phone. */
.home-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.home-todo .ht-block { background: var(--color-surface); border: 1px solid var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.home-todo .ht-block.is-todo { border-left: 4px solid var(--geel-200); }
.home-todo .ht-block.is-info { border-left: 4px solid var(--lichtblauw-400); background: var(--color-surface); }
.home-todo .ht-block + .ht-block { border-top: 1px solid var(--donkerblauw-100); }
.home-todo .ht-list a { grid-template-columns: 20px minmax(110px, auto) minmax(0, 1fr) 16px; }

/* Home bands, as on www.ask2know.eu: full-bleed white and greige sections and
   one dark-blue block with rounded corners; the tiles inside keep the page's
   width. Home only (review 2026-11-17). */
.home-band { position: relative; padding: 8px 0 48px; }
.home-band::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; }
.home-band.band-white::before { background: #FFFFFF; border-top: 1px solid var(--donkerblauw-100); border-bottom: 1px solid var(--donkerblauw-100); }
.home-band.band-greige::before { background: var(--greige-50, #F3F3EF); }
.home-band .section-head { margin-top: 40px; }
.home-band.band-white { margin-top: 32px; }
.home-band.band-navy { margin: 40px 0 0; padding: 8px 40px 48px; background: var(--uiblauw-800); border-radius: 24px; }
.home-band.band-navy::before { display: none; }
.band-navy .section-head h2 { color: #FFFFFF; }
.band-navy .section-head::before { background: var(--lichtblauw-400); }
.band-navy .tile { border-color: transparent; }
.band-greige .tile, .band-white .tile { box-shadow: 0 8px 24px rgba(21, 33, 90, .06); }
.page:has(.band-navy) { padding-bottom: 72px; }
body:has(.home-band) { overflow-x: hidden; }

/* To-do rows: where on top, what under it; the marks in one column. */
.ht-list a { grid-template-columns: 22px minmax(0, 1fr) 16px !important; align-items: start; padding: 10px 10px; margin: 0 -10px; }
.ht-list a:hover .ht-text { text-decoration: none; }
.ht-body { display: flex; flex-direction: column; gap: 1px; }
.ht-where { font-size: 14px; }
.ht-text { font-size: 14px; color: var(--donkerblauw-600); }
.ht-mark { font-size: 18px; margin-top: 1px; }
.is-info .ht-mark { font-size: 18px; }
.ht-caret { align-self: center; }
.is-info .ht-list a:hover { background: var(--lichtblauw-50, #F3F9FD); }
/* The bands touch: no page background showing between white and greige. */
.home-section.home-band { margin-bottom: 0; }
.home-band.band-white + .home-band.band-greige { margin-top: 0; }
.is-info .ht-mark { font-size: 26px; margin-top: -3px; margin-left: -3px; }
/* Rounded bands, as on www.ask2know.eu: each band has rounded top corners and
   slides over the one above it; the dark block rests on greige down to the
   footer. */
.home-band.band-white::before { border-radius: 40px 40px 0 0; border-bottom: 0; border-left: 1px solid var(--donkerblauw-100); border-right: 1px solid var(--donkerblauw-100); }
.home-band.band-white { padding-bottom: 88px; }
.home-band.band-white + .home-band.band-greige { margin-top: -40px; padding-top: 40px; }
.home-band.band-greige::before { border-radius: 40px 40px 0 0; box-shadow: 0 -1px 0 var(--donkerblauw-100); }
.home-band.band-greige { padding-bottom: 8px; }
.home-band.band-navy { position: relative; }
.home-band.band-navy::before { display: block; content: ""; position: absolute; z-index: -1; top: -48px; bottom: -72px; left: calc(50% - 50vw); right: calc(50% - 50vw); background: var(--greige-50, #F3F3EF); border-radius: 0; }
.page:has(.band-navy) { padding-bottom: 72px; }
/* The same open circle for both lists (review 2026-11-17); blue in "good to know". */
.is-info .ht-mark { font-size: 18px; margin: 1px 0 0; color: var(--lichtblauw-600); }
/* A filled "i" for Good to know: the app ships Phosphor regular only, so it is drawn. */
.ht-info-fill { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--lichtblauw-600); color: #fff; font: 700 12px/1 var(--font-body); }

/* Zones (review 2026-11-17): the background says where you are, as on Home.
   White = your knowledge; greige = what runs underneath; dark blue = insight
   and control (design system: Admin identity, deeper uiblauw). On work pages
   only the intro panel turns dark; the content stays light to work in. */
.zone-dark .page-intro, .zone-dark .ds-head, .page-intro.zone-navy { background: var(--uiblauw-800); border-color: var(--uiblauw-800); }
.zone-dark .page-intro::before, .zone-dark .ds-head::before, .page-intro.zone-navy::before { background: rgba(255, 255, 255, .05); opacity: 1; }
.zone-dark .page-intro::after, .zone-dark .ds-head::after, .page-intro.zone-navy::after { border-color: rgba(0, 176, 255, .35); }
.zone-dark .page-intro h1, .zone-dark .ds-head h1, .page-intro.zone-navy h1 { color: #FFFFFF; }
.zone-dark .page-intro-lede, .zone-dark .ds-lede, .page-intro.zone-navy .page-intro-lede { color: #C9D1E4; }
.zone-dark .page-intro .button.secondary, .page-intro.zone-navy .button.secondary { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, .45); }
.zone-dark .page-intro .pp-link, .page-intro.zone-navy .pp-link { color: #78D8FF; }
/* Home: the dark block follows the white Library band and rests on white down
   to the footer (no greige any more). */
.home-band.band-white { padding-bottom: 24px; }
.home-band.band-navy { margin-top: 16px; }
.home-band.band-navy::before { background: #FFFFFF; top: -24px; }
/* Home: the dark blue over the full page width (review 2026-11-17), sliding
   over the white Library band with rounded top corners and running down to
   the footer; the tiles inside keep the page's grid. */
.home-band.band-navy { margin: -40px 0 0; padding: 48px 0 72px; background: none; border-radius: 0; }
.home-band.band-navy::before { display: block; top: 0; bottom: 0; background: var(--uiblauw-800); border-radius: 40px 40px 0 0; }
.home-band.band-white { padding-bottom: 72px; }
.page:has(.home-band.band-navy) { padding-bottom: 0; }

/* Home in three layers (review 2026-11-17). The light-blue intro runs over the
   full width; the white band (to-do list + Library) slides over it; the
   dark-blue band follows. Insights and Admin share one row of the grid. */
.page-intro.home-header { overflow: visible; background: transparent; border: 0; border-radius: 0; padding: 40px 0 72px; margin: -40px 0 0; }
.page-intro.home-header::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw); left: calc(50% - 50vw); right: calc(50% - 50vw); top: 0; bottom: 0; width: auto; height: auto; background: #EEF5FA; opacity: 1; border-radius: 0; transform: none; filter: none; }
.page-intro.home-header::after { right: 2%; top: -30%; width: 28%; height: 170%; border-color: rgba(0, 176, 255, .22); }
.home-band.band-white { margin-top: -40px; padding-top: 40px; }
.home-band.band-white .home-todo { margin: 0 0 8px; }
.home-band.band-white .home-section:first-child, .home-band.band-white .home-todo + .home-section { margin-top: 40px; }
.home-duo { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 1rem; }
.home-duo .duo-insights { grid-column: span 1; }
.home-duo .duo-admin { grid-column: span 2; }
.home-duo .duo-insights .grid { grid-template-columns: minmax(0, 1fr); }
.home-duo .duo-admin .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-duo .home-section { margin-top: 0; }
@media (max-width: 760px) { .home-duo .duo-insights, .home-duo .duo-admin { grid-column: 1 / -1; } }
/* The arc lies behind the white band, which slides over it with its rounded corners. */
.page-intro.home-header::after { z-index: -1; }
/* Home rhythm (review 2026-11-17): 48px between every band edge and its
   content, above and below, in all three layers. A band slides 40px over the
   one above it, so the visible gap is padding minus 40. */
.page-intro.home-header { padding-bottom: 88px; }
.home-band.band-white { padding-top: 48px; padding-bottom: 88px; }
.home-band.band-white > :first-child, .home-band.band-white > .home-todo { margin-top: 0; }
.home-band.band-white > .home-section:first-child .section-head { margin-top: 0; }
.home-band.band-navy { padding-top: 48px; }
.home-band.band-navy > .home-section:first-child { margin-top: 0; }
.home-band.band-navy > .home-section:first-child .section-head { margin-top: 0; }
.home-band.band-navy .home-duo { margin-top: 48px; }
.home-band.band-navy .home-duo .section-head { margin-top: 0; }
.home-h1-light { font-weight: 400; }
.page-intro.home-header h1 { font-size: 34px; }
/* Home: the header has room, it is the header (review 2026-11-17). */
.page-intro.home-header { padding-top: 64px; padding-bottom: 112px; }
.page-intro.home-header h1 { font-size: 42px; line-height: 1.15; letter-spacing: -.015em; }
.page-intro.home-header .page-intro-lede { margin-top: 14px; font-size: 18px; line-height: 1.55; max-width: 62ch; }
.home-header .home-header-choices { margin-top: 36px; }
/* The dark band in three wider columns with more room between them, so
   Automation and the Insights + Admin row line up exactly. */
.band-navy .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.band-navy .home-duo { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
.band-navy .home-duo .duo-admin .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .band-navy .grid, .band-navy .home-duo { grid-template-columns: minmax(0, 1fr); }
  .band-navy .home-duo .duo-insights, .band-navy .home-duo .duo-admin { grid-column: 1 / -1; }
}
/* Insights and Admin are one row: their tiles share a height, so the calls to action line up. */
.home-duo { align-items: stretch; }
.home-duo .home-section { display: flex; flex-direction: column; }
.home-duo .home-section .grid { flex: 1; }
.home-duo .tile { height: 100%; }
/* Footer in dark blue, like the menu bar above and the footer of
   www.ask2know.eu: the page closes instead of ending in a white strip. On Home
   the dark band runs into it, with a hairline between. */
.footer { background: var(--uiblauw-800); border-top: 1px solid rgba(255, 255, 255, .08); padding: 24px 1.5rem 28px; }
.footer span { color: #C9D1E4; }
.footer .footer-sub { color: #8995B2; }
/* A thinner footer (review 2026-11-17): one line, smaller type, about half the
   height; it closes the page without drawing the eye. */
.footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 12px 1.5rem; }
.footer span { font-size: 13px; }
.footer .footer-sub { font-size: 12px; }
.footer .footer-sub::before { content: "·"; margin-right: 12px; color: #687491; }
@media (max-width: 640px) { .footer { flex-direction: column; } .footer .footer-sub::before { display: none; } }
.footer { flex-direction: row; }
.footer span, .footer .footer-sub { display: inline-block; margin: 0; }
@media (max-width: 640px) { .footer { flex-direction: column; } }
/* The footer slides over the page like the Home bands: rounded top corners
   and a soft shadow upwards. */
.footer { border-top: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 24px rgba(21, 33, 90, .10); position: relative; }
/* On Home the dark band runs straight into the footer: no corners to show light through. */
.page:has(.home-band.band-navy) + .footer { border-radius: 0; box-shadow: none; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE PASS (review 2026-11-17): every page checked at 390px and 360px.
   Nothing may scroll sideways, lists become cards, actions wrap, 16px from
   the edges everywhere.
   ═══════════════════════════════════════════════════════════════════════ */

/* The full-width Home bands may never widen the page. */
html:has(.home-band), body:has(.home-band) { overflow-x: clip; }

@media (max-width: 720px) {
  /* The logo hangs below the menu bar: a back link sits right, under the bar,
     where the logo is not. */
  .page > .admin-page > .back-link:first-child,
  .page > .admin-page-container > .back-link:first-child,
  .page > .back-link:first-child {
    position: static; display: flex; width: fit-content; margin: -12px 0 12px auto;
  }

  /* Home */
  .page-intro.home-header { padding-top: 40px; padding-bottom: 88px; }
  .page-intro.home-header h1 { font-size: 30px; line-height: 1.2; }
  .page-intro.home-header .page-intro-lede { font-size: 16px; }
  .home-header .home-header-choices { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  .band-navy .home-duo .duo-admin .grid { grid-template-columns: minmax(0, 1fr); }
  .band-navy .home-duo { row-gap: 40px; }
  .home-band.band-navy .home-duo { margin-top: 40px; }

  /* Search: the field full width, the button under it. */
  .zs-intro .search-input-row { flex-wrap: wrap; }
  .zs-intro #q { flex: 1 1 100%; }
  .zs-intro .search-input-row .button { flex: 1 1 100%; height: 48px; }

  /* Statistieken: the three tabs fit. */
  .an-tab { font-size: 14px; padding: 10px 8px; }

  /* Users: each user a card -- email on top, role and labels, then actions. */
  .us-table thead { display: none; }
  .us-table, .us-table tbody { display: block; }
  .us-table tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--donkerblauw-100); }
  .us-table tbody tr:last-child { border-bottom: 0; }
  .us-table td { display: block; padding: 0; border: 0; }
  .us-table td:nth-child(1) { grid-row: 1 / span 3; align-self: start; padding-top: 2px; }
  .us-table td:nth-child(2) { grid-column: 2 / 4; }
  .us-table td:nth-child(3) { grid-column: 2; }
  .us-table td:nth-child(4) { grid-column: 3; justify-self: end; }
  .us-table td:nth-child(5) { display: none; }
  .us-table td:nth-child(6) { grid-column: 2 / 4; text-align: left; white-space: normal; }
  .us-table .us-email { overflow-wrap: anywhere; word-break: normal; }
  .us-table tbody tr:hover td { background: none; }

  /* API keys: each key a card. */
  .api-keys-table thead { display: none; }
  .api-keys-table, .api-keys-table tbody, .api-keys-table tr, .api-keys-table td { display: block; width: auto; }
  .api-keys-table tr { padding: 14px 16px; border-bottom: 1px solid var(--donkerblauw-100); }
  .api-keys-table td { padding: 4px 0; border: 0; text-align: left; white-space: normal; }
  .api-keys-table code, .api-keys-table .key-prefix { overflow-wrap: anywhere; }

  /* Audit log: when and what on one line, who and details under it. */
  .audit-table thead { display: none; }
  .audit-table, .audit-table tbody, .audit-table tr { display: block; }
  .audit-table tr { padding: 10px 14px; border-bottom: 1px solid var(--donkerblauw-100); }
  .audit-table td { display: inline; padding: 0; border: 0; white-space: normal; }
  .audit-table td.audit-when { display: block; font-size: 12px; color: var(--donkerblauw-500); }
  .audit-table td.audit-who, .audit-table td.audit-about, .audit-table td.audit-details { display: block; font-size: 13px; color: var(--donkerblauw-600); overflow-wrap: anywhere; }

  /* Labels: the users column goes, the actions stay visible under the name. */
  .lb-card .labels-table-compact th.lb-col-users,
  .lb-card .labels-table-compact td[data-users] { display: none; }
  .lb-card .labels-table-compact .label-row td:nth-child(2) { padding-left: 12px; }
  .lb-card .label-row-actions { flex-direction: column; align-items: flex-end; gap: 0; }
  .lb-toolbar .label-count { margin-left: 0; }

  /* Links: clean cards. */
  .lk-card .links-table tr { background: var(--color-surface) !important; border: 0; border-bottom: 1px solid var(--donkerblauw-100); border-radius: 0; margin: 0; padding: 14px 16px; }
  .lk-card .links-table td { background: none !important; border: 0 !important; padding: 2px 0 !important; }
  .lk-card .links-table .last-checked::before { content: none; }
  .lk-card .links-table td:last-child { text-align: left; }

  /* Notifications: actions wrap instead of running off the card. */
  .nt-actions { flex-wrap: wrap; justify-content: flex-start; }

  /* Documents on a phone: the card in the new style, the date in plain type,
     no heavy grey action column. */
  .documents-list.mobile-fallback .document-card { border-color: var(--donkerblauw-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
  .documents-list.mobile-fallback .doc-meta { font-family: var(--font-body); font-size: 13px; color: var(--donkerblauw-500); }
  .documents-list.mobile-fallback .doc-card-actions { width: 36px; background: none; border-left: 1px solid var(--donkerblauw-100); }
  .documents-list.mobile-fallback .doc-card-actions.expanded { width: 96px; }
  .documents-list.mobile-fallback .doc-title { font-size: 16px; }
  .documents-list.mobile-fallback .label-twotone .label-category { display: none; }
}
@media (max-width: 720px) {
  /* Links: one block per row, title first. */
  .lk-card .links-table, .lk-card .links-table tbody { display: block; }
  .lk-card .links-table thead { display: none; }
  .lk-card .links-table tr { display: flex !important; flex-direction: column; gap: 4px; }
  .lk-card .links-table td { display: block !important; width: auto !important; max-width: none !important; text-align: left; }
  .lk-card .links-table td::before { content: none !important; }
  .lk-card .links-table td:nth-child(1) { order: 1; }
  .lk-card .links-table td:nth-child(3) { order: 0; }
  .lk-card .links-table td:nth-child(2) { order: 2; }
  .lk-card .links-table td:nth-child(4) { order: 3; font-size: 12px; color: var(--donkerblauw-500); }
  .lk-card .links-table td:nth-child(5) { order: 4; }
  /* Search: the magnifier inside the field, also when the button wraps under it. */
  .zs-intro .zs-icon { top: 16px; }
}
@media (max-width: 720px) {
  .lk-card .links-table td, .lk-card .links-table td * { text-align: left !important; }
  .lk-card .links-table .status-badge { align-self: flex-start; }
  /* Home: start the headline below the logo that hangs under the menu bar. */
  .page-intro.home-header { padding-top: 76px; }
}
@media (max-width: 720px) { .api-keys-table td { border: 0 !important; padding: 3px 0 !important; } .api-keys-table td:last-child { padding-top: 8px !important; text-align: left; } }

/* ── Depth and mobile journey (review 2026-11-17, round 2) ─────────────── */

/* Home intro: depth again. The full-width band had lost the light lobe the
   intro panels carry; it comes back as a shape in the band's own background,
   with a soft glow under the arc. */
.page-intro.home-header::before {
  background:
    radial-gradient(38% 115% at 14% 8%, #D9EBF8 98%, transparent 100%),
    radial-gradient(30% 60% at 82% 100%, rgba(0, 176, 255, .10), transparent 70%),
    linear-gradient(180deg, #E7F1FA 0%, #EEF5FA 100%);
}

/* Nothing hides behind hover on a touch screen: what a mouse reveals is
   simply there. */
@media (hover: none) {
  .lk-card .link-action-btn, .link-action-btn { opacity: 1 !important; }
  .chat-feedback:not(.is-latest) .chat-sent { opacity: 1; }
  .doc-row .doc-row-actions, .doc-row-actions { opacity: 1 !important; visibility: visible !important; }
  .labels-table-compact .label-row-actions { opacity: 1 !important; }
  /* A tap leaves :hover behind on a phone; the tile or row should not stay lit. */
  a.tile:hover { border-color: var(--color-border); box-shadow: none; transform: none; }
  .band-navy a.tile:hover { border-color: transparent; }
  .ht-list a:hover, .is-info .ht-list a:hover { background: none; }
  a.tile:active { border-color: var(--color-primary); }
  .ht-list a:active { background: var(--donkerblauw-50); }
  .labels-table-compact .label-row:hover, .labels-table-compact .label-row:hover td { background: none; }
}

@media (max-width: 720px) {
  /* The logo keeps its size and its overhang (that is the design); the page
     starts a little lower instead, so the overhang never sits on the first
     panel or headline. */
  main.page { padding-top: 48px; }

  /* Rounded corners in proportion to the screen. */
  .home-band.band-white::before, .home-band.band-navy::before { border-radius: 24px 24px 0 0; }
  .footer { border-radius: 16px 16px 0 0; }

  /* More room: the intro below the bar, the dark band's first head off its
     corner, and air between sections. */
  .page-intro.home-header { padding-top: 40px; }
  .home-band.band-navy { padding-top: 56px; }
  .home-band.band-white { padding-top: 40px; }
  .section-head { margin-top: 48px; }
  .home-band .section-head { margin-top: 48px; }
  .home-band > .home-section:first-child .section-head, .home-band.band-navy > .home-section:first-child .section-head { margin-top: 0; }

  /* Documents on a phone: a compact card -- checkbox and labels, title, two
     lines of text, the date -- and the actions as a visible row underneath
     instead of a grey column you had to tap open. */
  .documents-list.mobile-fallback .document-card { padding: 0; overflow: hidden; }
  .documents-list.mobile-fallback .doc-card-layout { flex-direction: column; }
  .documents-list.mobile-fallback .doc-card-content { padding: 14px 16px 10px; }
  .documents-list.mobile-fallback .doc-card-top { gap: 8px; margin-bottom: 4px; min-height: 0; }
  .documents-list.mobile-fallback .doc-preview, .documents-list.mobile-fallback .doc-meta { min-height: 0; }
  .documents-list.mobile-fallback .doc-preview:empty { display: none !important; }
  .documents-list.mobile-fallback .doc-preview { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 6px; font-size: 14px; color: var(--donkerblauw-600); }
  .documents-list.mobile-fallback .doc-meta { margin: 0; }
  .documents-list.mobile-fallback .doc-card-actions, .documents-list.mobile-fallback .doc-card-actions.expanded { width: auto; border-left: 0; border-top: 1px solid var(--donkerblauw-100); background: none; cursor: default; }
  .documents-list.mobile-fallback .doc-actions-toggle { display: none; }
  .documents-list.mobile-fallback .doc-actions-panel { display: flex; flex-direction: row; gap: 4px; padding: 6px 10px; }
  .documents-list.mobile-fallback .doc-action-btn { flex: 0 0 auto; padding: 8px 10px; border: 0; border-radius: 6px; background: none; font: 600 13px var(--font-body); color: var(--donkerblauw-700); }
  .documents-list.mobile-fallback .doc-action-btn.delete { color: var(--rood-600, #AF0000); margin-left: auto; }
  .documents-list.mobile-fallback .document-card + .document-card { margin-top: 12px; }
}

@media (max-width: 480px) {
  /* On a phone the intro panel's buttons are full width, one under the other:
     easy to hit with a thumb and no ragged edge. */
  .page-intro .pp-intro-actions { flex-direction: column; align-items: stretch; }
  .page-intro .pp-intro-actions > .button { width: 100%; justify-content: center; }
  .page-intro .pp-intro-actions > .pp-link { align-self: flex-start; }
}

@media (max-width: 720px) {
  /* Labels on a phone: the fixed desktop widths go, so Edit and Delete stay
     inside the card instead of being cut off on the right. */
  .lb-card .labels-table-compact { table-layout: auto; width: 100%; }
  .lb-card .labels-table-compact th { width: auto !important; }
  .lb-card .labels-table-compact th:nth-child(3), .lb-card .labels-table-compact td:nth-child(3) { padding-left: 4px; padding-right: 4px; text-align: center; }
  .lb-card .labels-table-compact .label-row td:last-child { padding-right: 12px; width: 1%; white-space: nowrap; }
  .lb-card .labels-table-compact th, .lb-card .labels-table-compact td { padding-left: 6px; padding-right: 6px; }
  .lb-card .labels-table-compact th:first-child, .lb-card .labels-table-compact td:first-child { padding-left: 14px; }
}
@media (max-width: 480px) {
  .page-intro .us-intro-top > .pp-intro-actions { width: 100%; }
}

/* Mobile round 3 (review 2026-11-17). */
@media (max-width: 768px) {
  /* The open menu slides in behind the logo: the mark stays whole on top, and
     the first menu item starts below its overhang. */
  .brand { z-index: 101; }
  .nav { padding-top: 44px; }
}
@media (max-width: 720px) {
  /* Users: role and labels side by side on the left, the actions under them,
     all on one left edge. */
  .us-table tr { grid-template-columns: 28px auto minmax(0, 1fr); row-gap: 10px; }
  .us-table td:nth-child(3) { grid-column: 2; }
  .us-table td:nth-child(4) { grid-column: 3; justify-self: start; }
  .us-table td:nth-child(6) .us-actions-row, .us-table td:nth-child(6) { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-left: -6px; }

  /* Statistieken: the three tabs share the width and wrap their words, so
     none is cut off and nothing scrolls sideways. */
  div.an-tabs { overflow: visible; gap: 0; }
  div.an-tabs .an-tab { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; font-size: 14px; line-height: 1.25; padding: 10px 6px; }

  /* Search options: one under the other, the choices as a wrapping row. */
  .zs-intro .advanced-panel > div { grid-template-columns: minmax(0, 1fr) !important; gap: 20px !important; }
  .zs-intro .advanced-panel .toggle-group { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .zs-intro .advanced-panel .toggle-btn { width: auto; flex: 0 0 auto; white-space: nowrap; border-radius: 999px; border: 1px solid var(--donkerblauw-200); padding: 7px 14px; font-size: 14px; }
  .zs-intro .advanced-panel .toggle-btn.active { border-color: var(--color-primary); }
  .zs-intro .advanced-panel { padding: 16px; }
  .zs-intro .zs-form, .zs-intro .search-input-row { min-width: 0; max-width: 100%; }
  .zs-intro .search-input-row #q { min-width: 0; width: 100%; }
}

/* An admin looks at a colleague's conversation (admin/user_conversations.html,
   admin/conversation_look.html). */
.ac-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ac-table th { text-align: left; font-weight: 600; color: var(--donkerblauw-500); padding: 6px 8px; border-bottom: 1px solid var(--donkerblauw-100); }
.ac-table td { padding: 8px; border-bottom: 1px solid var(--donkerblauw-50); color: var(--donkerblauw-700); }
.ac-open { text-align: right; white-space: nowrap; }
.ac-warning h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--uiblauw-800); }
.ac-turn { margin-bottom: 12px; }
.ac-turn.is-user { background: var(--donkerblauw-50); }
.ac-text { white-space: pre-wrap; }
.ac-sent { margin: 12px 0 0; font-size: 14px; font-weight: 600; }
