/* Zenith look for the map. Loaded last; overrides the app's theme
   variables (which the app writes inline on <html>, hence !important) and hard-coded colours. */
:root, :root[data-theme] {
  color-scheme: light !important;
  --zen-black: #000000;
  --zen-grey-1: #3a3a3c;
  --zen-grey-2: #6b6b6b;
  --zen-grey-3: #8e8e93;
  --zen-grey-4: #aeaeb2;
  --zen-grey-5: #d1d1d6;
  --zen-hair: #e0e0e0;
  --zen-fill: #f5f5f5;
  --zen-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --zen-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --color-root: #ffffff !important;
  --color-surface: #ffffff !important;
  --color-elevated: #ffffff !important;
  --color-panel: #ffffff !important;
  --color-text-primary: #000000 !important;
  --color-text-secondary: #6b6b6b !important;
  --color-text-muted: #8e8e93 !important;
  --color-accent: #000000 !important;
  --color-accent-dim: #3a3a3c !important;
  --color-accent-bright: #000000 !important;
  --color-gold: #000000 !important;
  --color-gold-dim: #3a3a3c !important;
  --color-border-subtle: #e0e0e0 !important;
  --color-border-medium: #d1d1d6 !important;

  /* Node types: greys only, different shades to tell types apart */
  --color-node-file: #000000 !important;
  --color-node-function: #3a3a3c !important;
  --color-node-class: #48484a !important;
  --color-node-module: #636366 !important;
  --color-node-concept: #6b6b6b !important;
  --color-node-config: #7c7c80 !important;
  --color-node-document: #8e8e93 !important;
  --color-node-service: #545456 !important;
  --color-node-table: #9a9a9e !important;
  --color-node-endpoint: #2c2c2e !important;
  --color-node-pipeline: #5a5a5e !important;
  --color-node-schema: #a5a5aa !important;
  --color-node-resource: #747478 !important;
  --color-node-article: #000000 !important;
  --color-node-entity: #48484a !important;
  --color-node-topic: #6b6b6b !important;
  --color-node-claim: #3a3a3c !important;
  --color-node-source: #8e8e93 !important;

  --color-diff-changed: #000000 !important;
  --color-diff-affected: #6b6b6b !important;
  --color-diff-changed-dim: rgba(0, 0, 0, 0.08) !important;
  --color-diff-affected-dim: rgba(0, 0, 0, 0.05) !important;

  --glass-bg: #ffffff !important;
  --glass-bg-heavy: #ffffff !important;
  --glass-border: #e0e0e0 !important;
  --glass-border-heavy: #e0e0e0 !important;
  --scrollbar-thumb: #d1d1d6 !important;
  --scrollbar-thumb-hover: #aeaeb2 !important;
  --glow-accent: transparent !important;
  --glow-accent-strong: transparent !important;
  --glow-accent-pulse: transparent !important;
  --color-edge: #aeaeb2 !important;
  --color-edge-dim: #e0e0e0 !important;
  --color-edge-dot: #d1d1d6 !important;
  --color-accent-overlay-bg: #f5f5f5 !important;
  --color-accent-overlay-border: #d1d1d6 !important;
  --kbd-bg: #ffffff !important;

  --font-serif: var(--zen-sans) !important;
  --font-sans: var(--zen-sans) !important;
  --font-heading: var(--zen-sans) !important;
  --font-mono: var(--zen-mono) !important;
  --default-font-family: var(--zen-sans) !important;

  /* React Flow's own variables */
  --xy-background-color: #ffffff !important;
  --xy-background-pattern-color: #e0e0e0 !important;
  --xy-edge-stroke: #aeaeb2 !important;
  --xy-edge-stroke-selected: #000000 !important;
  --xy-minimap-background-color: #ffffff !important;
  --xy-minimap-mask-background-color: rgba(0, 0, 0, 0.04) !important;
  --xy-minimap-mask-stroke-color: #000000 !important;
  --xy-minimap-node-background-color: #d1d1d6 !important;
  --xy-controls-button-background-color: #ffffff !important;
  --xy-controls-button-background-color-hover: #f5f5f5 !important;
  --xy-controls-button-color: #000000 !important;
  --xy-controls-button-border-color: #e0e0e0 !important;
  --xy-attribution-background-color: #ffffff !important;
  --xy-node-boxshadow-selected: none !important;
  --xy-selection-background-color: rgba(0, 0, 0, 0.04) !important;
  --xy-selection-border: 1px dotted #8e8e93 !important;
}

html, body, #root { background: #ffffff !important; color: #000000; }
body, button, input, select, textarea { font-family: var(--zen-sans) !important; }
.font-heading, h1, h2, h3, h4 { font-family: var(--zen-sans) !important; }
code, pre, kbd, .font-mono { font-family: var(--zen-mono) !important; }

/* No shadows, glow, blur, texture or gradients */
*, *::before, *::after {
  box-shadow: none !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.noise-overlay::before { display: none !important; }
.animate-accent-pulse { animation: none !important; }
[class*="bg-gradient"], [class*="bg-linear"], [class*="bg-radial"], [style*="gradient"] { background-image: none !important; }
.glass, .glass-heavy { background: #ffffff !important; border: 1px solid #e0e0e0 !important; }
.kbd { color: #000 !important; background: #fff !important; border: 1px solid #d1d1d6 !important; }

/* Hairline borders */
[class*="border"] { border-color: #e0e0e0; }
.border-accent, .border-accent\/20, .border-accent\/30, .border-accent\/40, .border-accent-dim\/30,
.focus\:border-accent:focus, .focus\:border-accent\/50:focus,
.hover\:border-accent\/20:hover, .hover\:border-accent\/40:hover, .hover\:border-accent\/50:hover,
.hover\:border-accent\/60:hover, .hover\:border-accent\/70:hover { border-color: #000000 !important; }
[class*="border-node-"] { border-color: #d1d1d6 !important; }
[class*="ring-"] { --tw-ring-color: #000000 !important; }
input[type=checkbox], input[type=radio], input[type=range], progress { accent-color: #000000 !important; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline-color: #000000 !important; }

/* Selected state: black fill, white text. Hover: light grey. */
[class].bg-accent, [class].bg-accent\/20, [class].bg-accent\/15, [class].bg-accent\/50 { background-color: #000000 !important; color: #ffffff !important; }
[class].bg-accent *, [class].bg-accent\/20 *, [class].bg-accent\/15 *, [class].bg-accent\/50 * { color: #ffffff !important; }
.bg-accent\/10, .bg-accent\/5, .bg-accent-dim\/10 { background-color: #ffffff !important; }
[class*="bg-node-"] { background-color: #f5f5f5 !important; }
.bg-node-function { background-color: #3a3a3c !important; }
.hover\:bg-accent\/10:hover, .hover\:bg-accent\/5:hover, .hover\:bg-accent\/20:hover { background-color: #f5f5f5 !important; color: #000 !important; }
.hover\:text-accent:hover, .hover\:text-accent-bright:hover, .hover\:text-accent\/80:hover { color: #000000 !important; }
.text-accent, .text-accent\/60, .text-accent\/70 { color: #000000 !important; }
.text-accent-dim { color: #3a3a3c !important; }
.bg-elevated, .bg-surface, .bg-panel, .bg-root { background-color: #ffffff !important; }
.hover\:bg-surface:hover, .hover\:bg-elevated:hover { background-color: #f5f5f5 !important; }
/* Plain buttons on white get a hairline; dots and progress tracks a light grey */
button.bg-elevated:not(.rounded-full), button.bg-surface:not(.rounded-full) { border: 1px solid #e0e0e0 !important; }
.rounded-full.bg-elevated:empty, .rounded-full.bg-surface:empty, .rounded-full.bg-border-medium:empty { background-color: #d1d1d6 !important; }
.h-1.bg-elevated, .h-0\.5.bg-elevated, .h-1\.5.bg-elevated, .h-2.bg-elevated { background-color: #e0e0e0 !important; }
/* Grouped controls (persona, detail level) sit in a hairline box */
.bg-elevated.rounded-lg.p-0\.5 { border: 1px solid #e0e0e0 !important; }

/* Hard-coded Tailwind colours (warnings, errors, staleness, diff) become black and greys */
[class*="text-red-"], [class*="text-amber-"], [class*="text-orange-"], [class*="text-yellow-"], [class*="text-green-"],
[class*="text-\[#"], .text-\[var\(--color-diff-changed\)\] { color: #3a3a3c !important; }
[class*="bg-red-"], [class*="bg-amber-"], [class*="bg-\[var\(--color-diff"] { background-color: #f5f5f5 !important; }
[class*="border-red-"], [class*="border-amber-"] { border-color: #d1d1d6 !important; }
.warning-banner, [data-theme] .warning-banner { background: #f5f5f5 !important; border-color: #d1d1d6 !important; color: #000 !important; }

/* Graph canvas: white, every inline colour (layer palettes, edges, cluster outlines) drawn in grey */
.react-flow, .react-flow__renderer, .react-flow__pane, .react-flow__background { background: #ffffff !important; background-color: #ffffff !important; }
.react-flow__viewport, .react-flow__minimap, .react-flow__edgelabel-renderer { filter: grayscale(1); }
.react-flow__edge-path { stroke-opacity: 1; }
.react-flow__edge-text { fill: #6b6b6b !important; }
.react-flow__edge-textbg { fill: #ffffff !important; }
.react-flow__handle { background: #8e8e93 !important; border-color: #ffffff !important; }
.react-flow__minimap { background: #ffffff !important; border: 1px solid #e0e0e0 !important; }
.react-flow__minimap svg { background: #ffffff !important; }
.react-flow__minimap-node { fill: #c7c7cc !important; stroke: none !important; }
.react-flow__minimap-mask { fill: rgba(0, 0, 0, 0.05) !important; stroke: #000000 !important; stroke-width: 1px; }
.react-flow__controls { border: 1px solid #e0e0e0 !important; border-radius: 6px; overflow: hidden; }
.react-flow__controls-button { background: #ffffff !important; color: #000 !important; fill: #000 !important; border-bottom: 1px solid #e0e0e0 !important; }
.react-flow__controls-button svg { fill: #000 !important; }
.react-flow__controls-button:hover { background: #f5f5f5 !important; }
.react-flow__attribution { background: #ffffff !important; }
.react-flow__attribution a { color: #8e8e93 !important; }
.react-flow__node { color: #000; }
.react-flow__node.selected > div, .react-flow__node:focus-visible > div { outline: 1.5px solid #000 !important; outline-offset: 1px; }

/* Anything else that carries inline colour: chips' dots, swatches, code highlighting, charts */
svg:not(.react-flow__minimap svg), pre, code, [class*="token"], [style*="background-color: rgb"], [style*="background: rgb"],
[style*="background:#"], [style*="background: #"], [style*="background-color: #"] { filter: grayscale(1); }
img { filter: grayscale(1); }

/* Scrollbars */
::-webkit-scrollbar-thumb { background: #d1d1d6 !important; }
::-webkit-scrollbar-track { background: transparent !important; }

/* Dialogs and overlays: white sheets with hairlines; the dim behind them is plain grey */
[role="dialog"] { background: #ffffff; color: #000; }
.bg-black\/50, .bg-black\/60, .bg-black\/70, .bg-black\/80 { background-color: rgba(0, 0, 0, 0.25) !important; }

/* Theme button and its dialog are hidden: the look is fixed. Matched by title and, for other
   languages, by the palette icon's path. */
div.relative:has(> button[title="Change theme"]),
div.relative:has(> button path[d^="M12 2a7 7 0 0 0 0 14"]) { display: none !important; }

/* Category chip row: tighter so every chip fits at 1440px without scrolling */
.overflow-x-auto .w-max { gap: 10px !important; }
.overflow-x-auto .w-max > .flex.items-center.gap-1 { gap: 3px !important; }
.overflow-x-auto button.uppercase.tracking-wider.whitespace-nowrap {
  padding: 3px 6px !important; gap: 4px !important; font-size: 9.5px !important; letter-spacing: 0.03em !important;
}
.overflow-x-auto button.uppercase.tracking-wider.whitespace-nowrap > span.rounded-full { width: 6px !important; height: 6px !important; }

/* Phone menu: the Filter panel opens from its button's left edge (right-anchored it ran off the screen) */
@media (max-width: 767px) {
  .relative > .absolute.right-0.top-full.w-72 { left: 0 !important; right: auto !important; max-width: calc(100vw - 48px); max-height: 60vh; overflow-y: auto !important; }
}
