﻿/* Glowy teal theme tweaks for MkDocs Material */
:root {
  --teal-glow: #00f0c2;
  --teal-dark: #00796b;
  --hr-sep: rgba(255,255,255,0.12);
  --muted-text: rgb(137, 139, 148);
  /* Marquee controls: pixels per second, and pause at ends (ms) */
  --ub-marquee-speed: 30;
  --ub-marquee-pause-ms: 1300;
}

/* 
   FONT SIZE TOGGLE
   Provides an accessibility option to increase content font size.
   */

/* Large font mode - applies scaling to content areas only.
   Material's .md-typeset uses 0.8rem by default (16px scaled relative to root 20px).
   By setting it to 1rem, we effectively apply a 1.25x (125%) multiplier smoothly
   across all typest components without compounding. */
[data-ub-font="large"] .md-typeset {
  font-size: 1rem;
}

/* Heading overrides - explicit sizes for large mode (headings may use
   rem in some Material versions, so we pin them explicitly) */
[data-ub-font="large"] .md-content h1 { font-size: 2.125rem; }
[data-ub-font="large"] .md-content h2 { font-size: 1.5625rem; }
[data-ub-font="large"] .md-content h3 { font-size: 1.25rem; }
[data-ub-font="large"] .md-content h4 { font-size: 1.0625rem; }

/* Also scale the sidebar navigation and ToC text for readability */
[data-ub-font="large"] .md-nav__link,
[data-ub-font="large"] .md-nav__title,
[data-ub-font="large"] .md-toc {
  font-size: 112.5%;
}


/* Tab labels — default size for plain tabs (no # marks).
   data-ub-level (injected by method_meta hook) is only set when
   tab-toc-headings are present, scaling labels to match the
   explicit heading level chosen by the author. */
.md-typeset .tabbed-labels label {
  font-size: 1rem;
  font-weight: normal;
  font-family: 'New Rocker', 'Texturina', Georgia, serif !important;
}
.md-typeset .tabbed-set[data-ub-level="2"] > .tabbed-labels label { font-size: 1.1rem; }
.md-typeset .tabbed-set[data-ub-level="4"] > .tabbed-labels label { font-size: 0.9rem; }
.md-typeset .tabbed-set[data-ub-level="5"] > .tabbed-labels label { font-size: 0.825rem; }
.md-typeset .tabbed-set[data-ub-level="6"] > .tabbed-labels label { font-size: 0.75rem; }

/* Version range badge group � wraps all <code> badges for a heading or tab
   label. inline-block + text-decoration-line:none stops the parent element's
   underline / strikethrough from bleeding onto the badge area (CSS Text
   Decoration L4: parent decoration is not painted on atomic inline-blocks
   whose own text-decoration-line differs from the parent's).
   margin-left replaces the space character that was between heading text and
   the first badge (no text node ? nothing to decorate).
   code+code margin replaces the space character between consecutive badges. */
.md-typeset .ub-vr {
  display: inline-block;
  margin-left: 0.3em;
  text-decoration-line: none !important;
  white-space: nowrap;
}
.md-typeset .ub-vr code + code {
  margin-left: 0.2em;
}

/* Inline code (version badges) in tab labels: inherit text color and
   scale down to match the heading badge treatment (0.7em). */
.md-typeset .tabbed-labels label code {
  font-size: 0.7em;
  vertical-align: 0.1em;
  /* Always default code color/background � never inherit teal from selected/highlighted label.
     display:inline-block breaks text-decoration propagation in all label states.
     Background is pinned to stop Material's link-hover rule from tinting it. */
  display: inline-block;
  color: var(--md-code-fg-color) !important;
  background-color: var(--md-code-bg-color) !important;
  text-shadow: none !important;
}
/* .ub-vr code in tab labels: version range badges should match the heading
   code size (Material typeset uses ~0.85em code-in-heading), so they appear
   the same height as the label text � not the 0.7em shrink for author badges. */
.md-typeset .tabbed-labels label .ub-vr code {
  font-size: 0.85em;
  vertical-align: 0;
}
/* Suppress Material's hover/focus backdrop on tab labels entirely.
   In linked-label mode the interactive element is the <a> inside the label.
   Material renders the hover tint via background-color AND ::before/::after
   pseudo-elements � kill all three. Do NOT set color here (causes transitions). */
.md-typeset .tabbed-labels label:hover,
.md-typeset .tabbed-labels label:focus,
.md-typeset .tabbed-labels label:active,
.md-typeset .tabbed-labels label a,
.md-typeset .tabbed-labels label a:hover,
.md-typeset .tabbed-labels label a:focus,
.md-typeset .tabbed-labels label a:active {
  background-color: transparent !important;
}
.md-typeset .tabbed-labels label a::before,
.md-typeset .tabbed-labels label a::after {
  display: none !important;
}

/* Large font mode */
[data-ub-font="large"] .md-typeset .tabbed-labels label {
  font-size: 1.25rem;
  font-weight: normal;
  font-family: 'New Rocker', 'Texturina', Georgia, serif !important;
}
[data-ub-font="large"] .md-typeset .tabbed-set[data-ub-level="2"] > .tabbed-labels label { font-size: 1.375rem; }
[data-ub-font="large"] .md-typeset .tabbed-set[data-ub-level="4"] > .tabbed-labels label { font-size: 1.125rem; }
[data-ub-font="large"] .md-typeset .tabbed-set[data-ub-level="5"] > .tabbed-labels label { font-size: 1rem; }
[data-ub-font="large"] .md-typeset .tabbed-set[data-ub-level="6"] > .tabbed-labels label { font-size: 0.9rem; }

/* Hidden companion heading injected by tab_headings hook.
   Zero-height in-flow: stays at the correct scroll anchor position
   (top of tab content, just below labels bar) while being invisible. */
.tab-toc-heading {
  display: block !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

/* Share icon on tab labels — same hover reveal as headings */
label[data-heading-id]:hover > .ub-heading-share {
  opacity: 0.4;
}

/* Fix alignment of tab scroll arrows to match enlarged tab labels.
   Default Material height is 1.9rem for 0.8rem font labels.
   We scale proportionally for our larger font sizes. */
.md-typeset .tabbed-control {
  height: 2.375rem;  /* scaled for 1rem font */
}
.md-typeset .tabbed-control .tabbed-button {
  margin-top: 0;
  align-self: center;
  /* Use scroll-icon.svg for both, rotate left one */
  background-image: url('/ultrabroken-documentation/assets/images/icons/scroll-icon.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  color: transparent !important;
  overflow: hidden;
}
/* Hide default Material icon text content */
.md-typeset .tabbed-control .tabbed-button::before,
.md-typeset .tabbed-control .tabbed-button::after {
  display: none !important;
}

/* 
   The SVG icon (scroll-icon.svg) points to the RIGHT by default.
   We flip the left (PREV) button to point left (scaleX(-1)).
   We keep the right (NEXT) button as-is (scaleX(1)).
   We use the parent wrapper class (.tabbed-control--prev/--next) 
   because :first-child targets the button inside its own container, affecting both.
*/
.md-typeset .tabbed-control--prev .tabbed-button {
  transform: scaleX(-1);
}
.md-typeset .tabbed-control--next .tabbed-button {
  transform: scaleX(1);
}

/* Suppress Material's hover/focus/active states on tab scroll buttons */
.md-typeset .tabbed-button:hover,
.md-typeset .tabbed-button:focus,
.md-typeset .tabbed-button:active {
  background-color: transparent !important;
  filter: none !important;
  opacity: 1 !important;
}

[data-ub-font="large"] .md-typeset .tabbed-control {
  height: 2.97rem;  /* scaled for 1.25rem font */
}

/* Mermaid diagram theming: override Material's accent-derived defaults to match
   the project's brighter teal. Material resolves --md-mermaid-* from palette
   variables (--md-accent-fg-color etc.); we push them to --teal-glow instead.
   Sequence-diagram variables cascade from the base ones automatically. */
:root {
  --md-mermaid-node-bg-color: rgba(0, 240, 194, 0.12);
  --md-mermaid-node-fg-color: var(--teal-glow);
  --md-mermaid-edge-color: var(--teal-glow);
  --md-mermaid-label-fg-color: var(--teal-glow);
}

/* Pannable diagram container with zoom controls */
.diagram-pan {
  position: relative;
  overflow: scroll;
  scrollbar-width: none;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0, 240, 194, 0.18);
  border-radius: 8px;
  background: rgba(0, 121, 107, 0.08);
  margin: 1.5em 0;
  cursor: grab;
  isolation: isolate;
}
.diagram-pan.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.diagram-pan::-webkit-scrollbar {
  display: none;
}
.diagram-pan .diagram-inner {
  transform-origin: 0 0;
  overflow: visible;
  padding: 1.5em;
  box-sizing: border-box;
}
.diagram-pan .diagram-zoom {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 50, 43, 0.92);
  border-bottom: 1px solid rgba(0, 240, 194, 0.18);
  border-radius: 8px 8px 0 0;
  width: 100%;
  box-sizing: border-box;
}
.diagram-pan .diagram-zoom input[type=range] {
  flex: 1;
  max-width: 220px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--hr-sep);
  border-radius: 11px;
  outline: none;
  cursor: pointer;
  padding: 0;
  touch-action: none;
}
.diagram-pan .diagram-zoom input[type=range]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-glow);
  cursor: pointer;
}
.diagram-pan .diagram-zoom input[type=range]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-glow);
  border: none;
  cursor: pointer;
}
.diagram-pan .diagram-zoom button {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 194, 0.3);
  background: transparent;
  color: var(--teal-glow);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.diagram-pan .diagram-zoom button:hover {
  color: var(--teal-glow);
  border-color: var(--teal-glow);
}
.diagram-pan .diagram-zoom .diagram-level {
  color: var(--teal-glow);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  min-width: 3.5em;
  text-align: right;
}

/* Fix tab overflow on mobile: ensure the entire tab component respects viewport bounds */
.md-typeset .tabbed-set {
  max-width: 100%;
  overflow-x: clip;  /* clip overflow but allow absolute children (controls) to show */
}

/* Fix code block overflow on mobile: neutralise the negative horizontal margins
   Material applies to create full-bleed code blocks. Without this, blocks spill
   past the left content edge on mobile portrait. overflow-x: auto preserves
   horizontal scrolling for long lines. */
.md-typeset .highlight,
.md-typeset pre {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100%;
  overflow-x: auto;
}

/* Tab label visual segmentation � override Material's palette variables
   within the tab row so labels act as section dividers matching headings.
   Active + hover = teal-glow; inactive = muted.
   Also replaces Material's faint box-shadow with a proper separator line. */
.md-typeset .tabbed-labels {
  overscroll-behavior-x: contain;
  --md-default-fg-color: var(--teal-glow);
  --md-default-fg-color--light: var(--muted-text);
  --md-accent-fg-color: var(--teal-glow);
  box-shadow: none;
  border-bottom: 1px solid var(--hr-sep);
}
/* Keep sliding indicator bar at default foreground color, not teal */
.md-typeset .tabbed-labels::before {
  background: hsla(0, 0%, 100%, 0.87) !important;
}

/* -- Shared header / sidebar toggle buttons -- */
.ub-motion-toggle,
.ub-storage-toggle,
.ub-font-toggle,
.ub-editor-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--teal-glow) !important;
  vertical-align: middle;
  line-height: 1;
  transition: none;
}
.ub-motion-toggle:hover, .ub-motion-toggle:focus, .ub-motion-toggle:active,
.ub-storage-toggle:hover, .ub-storage-toggle:focus, .ub-storage-toggle:active,
.ub-font-toggle:hover, .ub-font-toggle:focus, .ub-font-toggle:active,
.ub-editor-toggle:hover, .ub-editor-toggle:focus, .ub-editor-toggle:active {
  color: var(--teal-glow) !important;
}
.ub-motion-toggle svg,
.ub-storage-toggle svg,
.ub-font-toggle svg,
.ub-editor-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Override default text selection (blue) to use project teal */
::selection {
  background-color: var(--teal-dark) !important;
  /*color: #ffffff !important;*/
}
::-moz-selection {
  background-color: var(--teal-dark) !important;
  /*color: #ffffff !important;*/
}
/* Apply fonts: Texturina for body, New Rocker for headings/navigation/title */
html, body {
  font-family: 'Texturina', Georgia, 'Times New Roman', serif !important;
}
.md-content h1, .md-content h2, .md-content h3, .md-content h4, .md-content h5, .md-content h6,
.md-nav__title, .md-header__title, .md-tabs__link {
  font-family: 'New Rocker', 'Texturina', Georgia, serif !important;
}

/* Header background - solid backdrop for better visibility */
.md-header {
  background: linear-gradient(180deg, #00796b, #00695c) !important;
  /* box-shadow intentionally removed to keep header subtle */
}
.md-header__source, .md-nav__source { display: none; }

.md-header__title {
  color: var(--teal-glow) !important;
  text-shadow: none !important;
  font-weight: 400;
  font-family: 'New Rocker', 'Texturina', Georgia, 'Times New Roman', serif !important;
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important; /* allow title to take available space */
  min-width: 0 !important; /* allow child to shrink for ellipsis */
}
.md-header__topic {
  font-weight: 400 !important;
}
.md-header__button.md-logo {
  color: var(--teal-glow) !important;
  text-shadow: none !important;
  font-weight: 400;
  font-family: 'New Rocker', 'Texturina', Georgia, 'Times New Roman', serif !important;
  overflow: visible !important;
}

.md-header__title .md-ellipsis {
  display: block !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    padding: 0 0.5rem !important;
    margin: 0 !important;
    /* JS (header-reserve.js) sets --header-available-width at runtime.
       Fallback: 100% lets the flex parent naturally constrain the title,
       producing near-identical width to the JS-measured value and avoiding
       a visible shrink on first paint. */
       max-width: var(--header-available-width, 100%) !important;
}

/* Scrolling indicator for clipped header titles (scrollLeft-based marquee) */
.md-header__title .md-ellipsis.is-marquee {
  text-overflow: clip !important;
  cursor: default;
}

/* Lighten navigation tabs (global header navigation) */
.md-tabs__link {
  color: rgba(0,240,194,0.6) !important;
  opacity: 1 !important;
  transition: color .18s ease, text-shadow .18s ease;
}
/* Active tabs - bright teal with glow (override ellipsis clipping) */
.md-tabs__item--active .md-tabs__link {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9) !important;
}
.md-tabs__item--active .md-ellipsis {
  overflow: visible !important;
  text-overflow: clip !important;
}
/* Hover state */
.md-tabs__link:hover {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9);
}

/* Nav link glow on hover and active (sidebar) */
.md-nav__link {
  transition: color .18s ease, text-shadow .18s ease;
}
.md-nav__link:hover,
.md-nav__link--active {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9);
}
/* Override ellipsis clipping on sidebar links */
.md-nav__link .md-ellipsis {
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Mobile sidebar: prevent scroll chaining from ANY sidebar nav list
   to the page body when the user reaches the top/bottom boundary.
   Material gives .md-nav__title ~ .md-nav__list overflow-y:auto on
   mobile but no overscroll containment. */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title ~ .md-nav__list {
    overscroll-behavior: contain;
  }
}

/* Header icons (burger menu, toggle) - bright teal, no glow */
.md-header__button .md-icon {
  color: var(--teal-glow) !important;
}

/* Header logo SVG glow - target common logo selectors so the rendered
   SVG shapes receive a teal drop-shadow glow only on press (:active). */
.md-header .md-logo svg,
.md-header__title .md-logo svg,
.md-header__logo svg,
.md-logo svg {
  color: var(--teal-glow) !important;
  fill: currentColor !important;
  stroke: none !important;
  filter: none;
  transition: filter .2s ease, transform .2s ease;
}

/* Suppress any hover effects on the logo button itself */
.md-header__button.md-logo,
.md-header__button.md-logo:hover,
.md-header__button.md-logo:active,
.md-header__button.md-logo:focus {
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
}


/* Burger menu, search, and palette toggle buttons - bright teal with hover lightup */
label.md-header__button[for="__drawer"],
label.md-header__button[for="__search"],
label.md-header__button[for^="__palette_"] {
  color: var(--teal-glow) !important;
  transition: opacity .18s ease, filter .18s ease;
}

label.md-header__button[for="__drawer"]:hover,
label.md-header__button[for="__search"]:hover,
label.md-header__button[for^="__palette_"]:hover {
  /* Subtle darken on hover to match default return-arrow behavior */
  filter: brightness(0.9);
}

/* (motion-toggle & storage-toggle styles consolidated above) */

/* Header toggle container */
.ub-header-toggles {
  display: flex;
  align-items: center;
  gap: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}


/* Sidebar toggle containers (mobile/compact view) �
   Positioned inside .md-sidebar--primary, above the sliding nav panels.
   Needs its own stacking context (via translateZ) to beat the nested nav
   panels which get transform:translateX(0) when checked.
   Vertically aligned with the back-arrow icon (top: .4rem + .2rem margin). */
.ub-sidebar-toggles {
  display: none;
}
@media (max-width: 76.1875em) {
  .ub-sidebar-toggles {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1rem;
    position: absolute;
    top: 0.6rem;     /* match back-arrow: top .4rem + margin .2rem */
    right: 0.8rem;   /* match .md-nav__title horizontal padding */
    z-index: 10;     /* above nav panels & their sticky titles */
    transform: translateZ(0); /* force own stacking context */
  }

  /* Suppress sliding transitions only during nav-position reset
     (class toggled by mobile-toc.js) */
  .ub-nav-resetting .md-nav {
    transition: none !important;
  }
}
/* Search bar and input styling - bright teal, no glow */
.md-search__input {
  color: var(--teal-glow) !important;
  caret-color: var(--teal-glow) !important;
  border-color: rgba(0,240,194,0.5) !important;
  /* Use Texturina for search input to match header/title styling */
  font-family: 'Texturina', Georgia, 'Times New Roman', serif !important;
  /*font-size: 1.25rem !important;
  line-height: 1.2 !important;*/
}
.md-search__input::placeholder {
  /*color: rgba(0,240,194,0.5) !important;*/
  color: var(--hr-sep) !important;
  /* Slightly darker placeholder derived from current color when supported */
  color: color-mix(in srgb, currentColor 80%, black 20%) !important;
  font-family: 'Texturina', Georgia, 'Times New Roman', serif !important;
}
.md-search__input:focus {
  border-color: var(--teal-glow) !important;
}

/* Search icon - bright teal, no glow */
.md-search__icon {
  color: var(--teal-glow) !important;
}

/* Disable Material theme search & mobile-nav overlay effects (blur + darkening) */
[data-md-toggle="search"]:checked ~ .md-header .md-search__overlay {
  opacity: 0 !important;
}
[data-md-toggle="search"]:checked ~ .md-container {
  filter: none !important;
  -webkit-filter: none !important;
}
.md-search__overlay {
  background: transparent !important;
  opacity: 0 !important;
}
/* Mobile drawer overlay */
.md-overlay {
  opacity: 0 !important;
  background: transparent !important;
}

/* Accent headings and links */
a {
  color: var(--teal-dark);
}
a:hover {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9);
}

/* Support editor-friendly `search:` links written as Markdown `[Label](search:Term)`.
   Intercepted by `search-link.js`. Styled to match other inline links but without
   an underline in idle state to match the search-link button style. */
a[href^="search:"] {
  color: #00ccb8; /* match Resources link color (0,204,184) */
  text-decoration: none;
  transition: color .18s ease, text-shadow .18s ease;
}
a[href^="search:"]:hover {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9);
}
a[href^="search:"]:focus {
  outline: 2px solid var(--teal-glow);
  outline-offset: 2px;
}

/* Make editor search-link buttons look and behave visually like anchors.
   Keep them as buttons (accessible semantics) but remove button chrome so
   they match regular `a` links used across the site. */
button.search-link,
.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #00ccb8; /* match Resources link color (0,204,184) */
  text-decoration: none; /* no underline in idle state */
  cursor: pointer;
  font: inherit;
  transition: color .18s ease, text-shadow .18s ease;
}
button.search-link:hover,
.link-button:hover {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 10px rgba(0,240,194,0.9);
}
button.search-link:focus,
.link-button:focus {
  outline: 2px solid var(--teal-glow);
  outline-offset: 2px;
}

.md-content h1, .md-content h2, .md-content h3 {
  text-shadow: 0 0 6px rgba(0,240,194,0.06);
}

/* Use teal accent for all content headings */
.md-content :is(h1, h2, h3, h4, h5, h6) {
  color: var(--teal-glow) !important;
}

/* Auto section separators � thin line below H2-H4 headings */
.md-typeset :is(h2, h3, h4) {
  border-bottom: 1px solid var(--hr-sep);
  padding-bottom: 0.4em;
}
/* No separator on the very first heading after H1 (tight spacing) */
.md-typeset h1 + h2 {
  border-bottom: 1px solid var(--hr-sep);
  padding-bottom: 0.4em;
}

/* Using default MkDocs Material permalink styles (no custom permalink overrides) */

/* Sidebar section headers - override ellipsis clipping */
.md-nav__title {
  overflow: visible !important;
}
.md-nav__title .md-ellipsis {
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Ensure nav titles also use Texturina for consistency */
.md-nav__title {
  font-family: 'Texturina', Georgia, 'Times New Roman', serif !important;
}

/* Hide redundant sidebar header on mobile (drawer already has sticky page header) */
/* Only hide the PRIMARY nav title, not nested ones (which contain back buttons) */
@media (max-width: 76.25em) {
  .ub-header-toggles {
    display: none !important;
  }
  
  .md-nav--primary > .md-nav__title {
    font-size: 0; /* Hide original text content */
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .md-nav--primary > .md-nav__title::before {
    content: "Navigation";
    font-size: 1rem; /* Restore readable font size */
    display: inline-block;
    color: var(--teal-glow) !important;
  }
}

/* Sidebar logo - no state effects */
/* Background rune, floating particles, and bottom glow are rendered via
   the unified canvas in particles-constellations.js */


/* Ensure footer sits above the decorative rune */
/* Note: .md-header must NOT have position: relative to keep it sticky */
/* Note: .md-main must NOT have z-index or drawer will be blocked */
.md-footer {
  position: relative;
  z-index: 1;
}

/* Back-to-top button styling (navigation.top) */
/* Back-to-top button styling (custom script) */
.ub-back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3; /* below header (4), same as .md-top */
  width: 1.5rem !important;
  height: 1.5rem !important;
  background: url('/ultrabroken-documentation/assets/images/icons/vector-icon.svg') no-repeat center center !important;
  background-size: 1rem 1.25rem !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
  color: transparent !important;
  font-size: 0 !important;
}

/* Hide any child elements */
.ub-back-to-top svg,
.ub-back-to-top span,
.ub-back-to-top::before,
.ub-back-to-top::after {
  display: none !important;
  visibility: hidden !important;
}

/* No hover state to prevent mobile stickiness */
.ub-back-to-top:hover {
  opacity: 1 !important;
  filter: none !important;
}

/* Press state: active click/tap with teal glow */
.ub-back-to-top:active {
  filter: drop-shadow(0 0 12px rgba(0, 240, 194, 0.9)) !important;
  opacity: 0.9 !important;
}

.ub-back-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

.ub-back-to-top.ub-no-transition {
  transition: none !important;
}

/* Nudge above footer: footer-anchored variant � instant, no fade */
.ub-back-to-top--footer {
  position: absolute !important;
  bottom: 100% !important;
  right: 1.5rem !important;
  margin-bottom: 0.75rem !important;
  transition: none !important;
}

/* Obsolete markers � strikethrough shown only when toggle is ON */
html:not(.ub-hide-deprecated) .md-typeset .tabbed-labels label.ub-obsolete {
  text-decoration: line-through 2px currentColor;
}
html:not(.ub-hide-deprecated) .md-typeset .tabbed-labels label.ub-obsolete code {
  display: inline-block;
}
html:not(.ub-hide-deprecated) .md-typeset h1.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h2.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h3.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h4.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h5.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h6.ub-obsolete {
  text-decoration: line-through 2px currentColor;
}

/* Version badges (code spans) inside headings:
   Material default 0.85em is slightly too large inside headings �
   0.7em keeps proportional scaling while tightening the badge.
   A small vertical-align nudge lifts the backdrop to sit centred. */
.md-typeset h1 > code,
.md-typeset h2 > code,
.md-typeset h3 > code,
.md-typeset h4 > code,
.md-typeset h5 > code,
.md-typeset h6 > code {
  font-size: 0.7em;
  vertical-align: 0.1em;
}

/* Version badges inside obsolete headings should not be struck through.
   text-decoration propagates to inline children and cannot be cancelled
   with text-decoration:none � display:inline-block breaks the chain.
   Scoped to toggle-ON so badges render normally when markers are off. */
/* Unconditionally pin code badge appearance in grimoire links: color, background
   and text-shadow must never change on hover/focus regardless of link state. */
.grim-li a code {
  display: inline-block;
  color: var(--md-code-fg-color) !important;
  background-color: var(--md-code-bg-color) !important;
  text-shadow: none !important;
}
html:not(.ub-hide-deprecated) .grim-li a.ub-obsolete {
  text-decoration: line-through 2px currentColor;
}
html:not(.ub-hide-deprecated) .grim-li a.ub-obsolete code {
  display: inline-block;
}
html:not(.ub-hide-deprecated) .md-typeset h1.ub-obsolete code,
html:not(.ub-hide-deprecated) .md-typeset h2.ub-obsolete code,
html:not(.ub-hide-deprecated) .md-typeset h3.ub-obsolete code,
html:not(.ub-hide-deprecated) .md-typeset h4.ub-obsolete code,
html:not(.ub-hide-deprecated) .md-typeset h5.ub-obsolete code,
html:not(.ub-hide-deprecated) .md-typeset h6.ub-obsolete code {
  display: inline-block;
}

/* -- Settings gear button ----------------------------------- */
.ub-settings-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--teal-glow) !important;
  vertical-align: middle;
  line-height: 1;
  transition: none;
}
.ub-settings-gear:hover,
.ub-settings-gear:focus,
.ub-settings-gear:active {
  color: var(--teal-glow) !important;
}
.ub-settings-gear svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* -- Settings modal ----------------------------------------- */
.ub-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.ub-settings-backdrop.ub-visible {
  opacity: 1;
  visibility: visible;
}

.ub-settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 101;
  background: var(--md-default-bg-color, #1e1e1e);
  border: 1px solid rgba(0, 240, 194, 0.18);
  border-radius: 10px;
  width: min(340px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.ub-settings-modal.ub-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.ub-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid rgba(0, 240, 194, 0.12);
}
.ub-settings-title {
  font-family: 'New Rocker', 'Texturina', Georgia, serif;
  font-size: 1rem;
  color: var(--teal-glow);
  letter-spacing: 0.02em;
}
.ub-settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--teal-glow);
  padding: 4px;
  border-radius: 4px;
  opacity: 0.7;
}
.ub-settings-close:hover {
  opacity: 1;
}

/* Shared body � used by modal and sidebar */
.ub-settings-body {
  padding: 0.5rem 1rem 1rem;
}
.ub-sidebar-settings-body {
  padding: 0.5rem 0.8rem 2rem;
}

.ub-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
}
.ub-settings-label {
  color: var(--md-default-fg-color, #ccc);
  font-size: 0.82rem;
}

.ub-settings-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  color: var(--teal-glow);
  font-size: 0.78rem;
  font-family: 'Texturina', Georgia, serif;
  transition: border-color 0.15s ease;
}
.ub-settings-control:hover {
  border-color: rgba(0, 240, 194, 0.35);
}
.ub-settings-control svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.ub-settings-mode {
  white-space: nowrap;
}

.ub-settings-divider {
  margin: 0.6rem 0 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(0, 240, 194, 0.1);
  font-size: 0.68rem;
  color: rgba(0, 240, 194, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* -- Version filter chips ---------------------------------- */
.ub-vf-wrapper {
  margin-top: 0.15rem;
}
.ub-vf-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.35rem 0;
}
.ub-vf-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--md-default-fg-color, #ccc);
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ub-vf-chip:hover {
  border-color: rgba(0, 240, 194, 0.35);
}
.ub-vf-chip[data-state="include"] {
  border-color: var(--teal-glow);
  color: var(--teal-glow);
  background: rgba(0, 240, 194, 0.08);
}
.ub-vf-reset {
  display: inline-flex;
  align-items: center;
  margin-top: 0.25rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: transparent;
  color: var(--muted-text);
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ub-vf-reset:hover {
  border-color: var(--teal-glow);
  color: var(--teal-glow);
}

/* -- Version highlight / mute (additive, color-based) -----
   These compose with strikethrough from ub-obsolete and
   work on both regular-colored and teal-colored elements. */

/* Match: teal glow + underline accent � applied uniformly to all match targets.
   Uses longhands (not the shorthand) so the obsolete strikethrough rule can't
   clobber text-decoration-line when both classes are present. */
.grim-li a.ub-version-match,
.md-typeset .tabbed-labels label.ub-version-match,
.md-typeset h1.ub-version-match,
.md-typeset h2.ub-version-match,
.md-typeset h3.ub-version-match,
.md-typeset h4.ub-version-match,
.md-typeset h5.ub-version-match,
.md-typeset h6.ub-version-match {
  color: var(--teal-glow);
  text-shadow: 0 0 10px rgba(0, 240, 194, 0.6);
  text-decoration-line: underline;
  text-decoration-color: var(--teal-glow);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
/* Intensify glow on hover for grimoire match entries (Material's link hover
   would otherwise override color and flatten text-shadow). */
.grim-li a.ub-version-match:hover,
.grim-li a.ub-version-match:focus {
  color: var(--teal-glow) !important;
  text-shadow: 0 0 16px rgba(0, 240, 194, 0.9) !important;
}
/* Don't underline code badges inside matched headings/grimoire entries.
   display:inline-block breaks text-decoration propagation.
   Tab label code is already handled unconditionally by the base rule above. */
.grim-li a.ub-version-match code,
.md-typeset h1.ub-version-match code,
.md-typeset h2.ub-version-match code,
.md-typeset h3.ub-version-match code,
.md-typeset h4.ub-version-match code,
.md-typeset h5.ub-version-match code,
.md-typeset h6.ub-version-match code {
  display: inline-block;
  color: var(--md-code-fg-color) !important;
  text-shadow: none !important;
}
/* When a match element is also obsolete (version-filtered AND deprecated),
   show both underline and strikethrough simultaneously.
   html:not() + two classes beats either individual rule in specificity. */
html:not(.ub-hide-deprecated) .grim-li a.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset .tabbed-labels label.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h1.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h2.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h3.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h4.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h5.ub-version-match.ub-obsolete,
html:not(.ub-hide-deprecated) .md-typeset h6.ub-version-match.ub-obsolete {
  text-decoration-line: underline line-through;
  text-decoration-color: var(--teal-glow);
  text-decoration-thickness: 2px;
}

/* Mismatch: muted color (not opacity � preserves strikethrough visibility) */
.grim-li a.ub-version-mismatch,
.md-typeset .tabbed-labels label.ub-version-mismatch,
.md-typeset h1.ub-version-mismatch,
.md-typeset h2.ub-version-mismatch,
.md-typeset h3.ub-version-mismatch,
.md-typeset h4.ub-version-mismatch,
.md-typeset h5.ub-version-mismatch,
.md-typeset h6.ub-version-mismatch {
  color: var(--muted-text);
}

/* Mobile: bottom sheet style */
@media (max-width: 76.1875em) {
  .ub-settings-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
    width: 100%;
    max-height: 70vh;
  }
  .ub-settings-modal.ub-visible {
    transform: translateY(0);
  }
}

/* -- Sidebar settings slide-in panel -------------------------
   The inner nav uses Material's own checkbox-driven slide UX
   (same as the TOC panel). z-index ensures it covers all other
   nav panels (TOC etc.) when open.                           */
.ub-settings-sidebar-wrapper .md-nav {
  z-index: 3;
  overflow-y: auto;
  /* Material sets its own scrollbar-color on .md-nav � override to match site teal */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent !important;
}

@media (max-width: 76.1875em) {
  /* Center social icons row on mobile (Material defaults to margin-left: auto ? right-aligned) */
  /*.md-social {
    width: 100%;
    margin: 0;
    justify-content: center;
  }*/
}

/* Explicitly keep header sticky */
.md-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
}

/* (Blanket heading cursor:pointer removed � now scoped to .ub-collapsible) */
/* Tasklist checkbox styling - match project teal theme */
.task-list-item input[type="checkbox"],
.md-typeset li.task-list input[type="checkbox"],
.md-content .task-list-item input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.6rem;
  vertical-align: middle;
  accent-color: #00ccb8; /* modern browsers: sets check color */
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  box-shadow: none;
}
.task-list-item input[type="checkbox"]:hover,
.md-typeset li.task-list input[type="checkbox"]:hover {
  filter: brightness(1.05);
}
.task-list-item input[type="checkbox"]:checked {
  background-color: #00ccb8;
  border-color: #00ccb8;
  box-shadow: 0 0 10px rgba(0,204,184,0.28);
}


/* -- Collapsible sections ({ .collapse } headings) ------------------- */

/* h4 headings are always non-bold (Material makes them bold by default).
   Also increase top margin � Material's default 1em is noticeably tighter
   than the 1.6em gap above H2/H3. */
.md-typeset h4 {
  font-weight: 400;
  margin-top: 1.6em;
}

.md-typeset .ub-collapsible {
  cursor: pointer;
  /* Reserve space so heading text wraps before reaching the chevron */
  padding-right: 1.2em;
  position: relative;
}

.ub-collapsible .ub-collapse-chevron {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  height: 1.2em;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.15s ease;
  transform: rotate(180deg);   /* default (expanded): pointing down */
}

.ub-collapse-chevron img {
  width: 0.55em;
  height: 0.55em;
  display: block;
}

.ub-collapsed .ub-collapse-chevron {
  transform: rotate(90deg);   /* collapsed: pointing right */
}

.ub-collapsible:hover .ub-collapse-chevron {
  opacity: 1;
}


/* -- Heading share icon (permalink copy) ----------------------------- */

.ub-heading-share {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35em;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
  vertical-align: 0.01em;
}

.ub-heading-share img {
  width: 0.85em;
  height: 0.85em;
  display: block;
}

/* Desktop hover reveal */
:is(h1, h2, h3, h4, h5, h6):hover > .ub-heading-share {
  opacity: 0.4;
}

.ub-heading-share:hover {
  opacity: 0.8 !important;
}

/* Touch-primary: show faintly so users know it's tappable */
@media (hover: none) {
  .ub-heading-share {
    opacity: 0.25;
  }
}

/* Flash state after successful copy */
.ub-heading-share--flash {
  opacity: 1 !important;
  animation: ub-share-flash 1.4s ease-out forwards;
}

@keyframes ub-share-flash {
  0%   { opacity: 1; transform: scale(1.25); }
  20%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}


/* -- Zonai rain (static grid + JS opacity raindrops) --------------- */

.ub-rain-bg {
  --rain-font-px: 18;
  --rain-line-h: 2.4;
  --rain-col-gap: 38;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Tablet / narrow desktop */
@media (max-width: 76.25em) {
  .ub-rain-bg { --rain-font-px: 14; --rain-col-gap: 28; }
}
/* Mobile */
@media (max-width: 45em) {
  .ub-rain-bg { --rain-font-px: 11; --rain-line-h: 2.0; --rain-col-gap: 20; }
}

.ub-rain-col {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Zonai', sans-serif;
  font-size: calc(var(--rain-font-px) * 1px);
  line-height: var(--rain-line-h);
  color: var(--teal-glow);
}

.ub-rain-col > span {
  display: block;
  user-select: none;
}

/* Hidden mode: remove entirely */
[data-ub-bg="hidden"] .ub-rain-bg {
  display: none !important;
}

/* Keep content above the rune without forcing layout changes on core
   layout elements.  The header already has a higher z-index. */

/* Search highlighting - clean teal background without spacing */
mark {
  background-color: rgba(0, 240, 194, 0.3) !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-weight: inherit !important;
}

mark:hover {
  background-color: rgba(0, 240, 194, 0.5) !important;
}

/* Always use exact bright teal for all scrollbar thumbs */
:root {
  --scrollbar-thumb: rgba(0,240,194,1);
  --scrollbar-track: rgba(0,0,0,0.04);
}

/* Firefox */
html, body, .md-content, .md-nav, .md-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* WebKit-based browsers: force thumb color to exact teal */
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb) !important;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: none !important;
  opacity: 1 !important;
}

/* Ensure hovered/active/focused thumb stays the same exact teal */
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active,
::-webkit-scrollbar-thumb:focus {
  background-color: var(--scrollbar-thumb) !important;
  border-color: var(--scrollbar-thumb) !important;
  box-shadow: 0 0 8px rgba(0,240,194,0.18) !important;
  opacity: 1 !important;
}

/* Keep track transparent for consistent look */
::-webkit-scrollbar-track {
  background: transparent;
}

/* (.ub-copy-check styles removed � replaced by .ub-heading-share in collapsible section) */

/* (editor-toggle styles consolidated above) */

/* -- Page-actions row: compact left-aligned bar above the h1 -- */
.ub-page-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}
.ub-page-actions .md-content__button {
  float: none;
  margin: 0;
  position: static;
}
[data-ub-editor="off"] .ub-page-actions .md-content__button,
[data-ub-editor="off"] .ub-page-actions .ub-card-copy,
[data-ub-editor="off"] .ub-page-actions .ub-page-uid {
  display: none;
}
[data-ub-editor="off"] .ub-heading-share {
  display: none;
}

/* UID badge: ensure Material's inline code styling applies in flex context */
.ub-page-uid {
  background-color: var(--md-code-bg-color);
  border-radius: .1rem;
  font-size: .85em;
  padding: 0 .2941176471em;
  font-family: var(--md-code-font-family);
  user-select: all;
}

/* Social-card copy button in the page-actions row */
button.ub-card-copy {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
}
.ub-card-copy--ok {
  color: var(--teal-glow);
}

/* Remove focus outline on code-block copy button (mobile tap leaves stuck blue ring) */
.md-clipboard:focus,
.md-clipboard:focus-visible,
.md-code__button:focus,
.md-code__button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Show pointing cursor when hovering tasklist items so they feel clickable */
li.task-list-item, li.task-list {
  cursor: pointer;
}

/* Ensure links inside tasklist keep pointer cursor (explicit) */
li.task-list-item a, li.task-list a {
  cursor: pointer;
}

/* Reduce vertical spacing for horizontal rules inside page content and make
   them subtly visible on dark backgrounds */
.md-content hr {
  margin: 0.25rem 0;
  border: none;
  border-top: 1px solid var(--hr-sep);
}

/* Asset publish trigger: do not remove - used to trigger asset-only workflow */
/* timestamp: 2026-02-13T00:00:00Z */

/* ── Leaderboard table ────────────────────────────────────────────────────── */
#leaderboard-root .leaderboard-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}
#leaderboard-root .leaderboard-table thead tr {
  border-bottom: 1px solid rgba(0, 240, 194, 0.4);
}
#leaderboard-root .leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(0, 240, 194, 0.25);
}
#leaderboard-root .leaderboard-table tbody tr:last-child {
  border-bottom: none;
}
#leaderboard-root .leaderboard-table th:first-child,
#leaderboard-root .leaderboard-table td.cell-rank {
  width: 5em;
  text-align: center;
  white-space: nowrap;
}
#leaderboard-root .leaderboard-table th:nth-child(2),
#leaderboard-root .leaderboard-table td.cell-name {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#leaderboard-root .leaderboard-table th:last-child,
#leaderboard-root .leaderboard-table td.cell-count {
  width: 5em;
  text-align: center;
}

/* Align AI widget with main content (measured delta: 16px)
   Adjusts the AI input container and its overlay so the textarea and
   fake placeholder visually align with `.md-content`. If this needs
   tweaking, change the `-16px` value. 
.ub-ai-root,
.ub-ai-input-wrap {
  transform: translateX(-16px);
}*/


/* Graph View */
#graph-view-root {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,240,194,0.18);
}
#graph-view-root canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.graph-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.graph-reset-btn {
  background: rgba(0,121,107,0.7);
  color: var(--teal-glow);
  border: 1px solid rgba(0,240,194,0.3);
  border-radius: 4px;
  padding: 4px 12px;
  font: 12px 'Texturina', Georgia, serif;
  cursor: pointer;
  transition: background 0.2s;
}
.graph-reset-btn:hover {
  background: rgba(0,240,194,0.25);
}
/* Map Embed Responsive */
.ub-map-embed {
  margin: 1rem 0;
}

.ub-map-embed iframe {
  max-height: 500px;
}

/* Mobile iframe hidden by default (desktop shows desktop iframe) */
.ub-map-mobile {
  display: none;
}

/* Tablet: slightly reduce height */
@media (max-width: 76.25em) {
  .ub-map-embed iframe {
    height: 400px !important;
  }
}

/* Mobile portrait: switch to mobile iframe (zoomed out -2), reduce height */
@media (max-width: 600px) {
  .ub-map-desktop {
    display: none;
  }
  .ub-map-mobile {
    display: block;
  }
  .ub-map-embed iframe {
    height: 300px !important;
  }
}

/* Mobile landscape: switch to mobile iframe (zoomed out -2), constrain to viewport */
@media (max-width: 900px) and (orientation: landscape) {
  .ub-map-desktop {
    display: none;
  }
  .ub-map-mobile {
    display: block;
  }
  .ub-map-embed iframe {
    height: 55vh !important;
    max-height: 350px;
  }
}

/* Event Viewer Embed Responsive */
.ub-event-embed {
  margin: 1rem 0;
}

.ub-event-embed iframe {
  max-height: 600px;
}

@media (max-width: 76.25em) {
  .ub-event-embed iframe {
    height: 450px !important;
  }
}

@media (max-width: 600px) {
  .ub-event-embed iframe {
    height: 350px !important;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .ub-event-embed iframe {
    height: 55vh !important;
    max-height: 400px;
  }
}

/* -------------------------------------------------------------------------------
   MOBILE TOC IN NAV DRAWER
   Collapsible "Table of contents" section injected into the nav drawer.
   ------------------------------------------------------------------------------- */

/* -- TOC header widget --------------------------------------------------------
   Injected between each nav panel's title and scrollable list so it lives
   OUTSIDE the scroll container � always visible, no sticky tricks needed.
   Tapping the label opens Material's native slide-in panel (full TOC + back).
   --------------------------------------------------------------------------- */

/* Indent levels for flattened TOC sub-items � matches Material's native values */
.ub-toc-indent-1 > .md-nav__link { padding-left: 1.4rem; }
.ub-toc-indent-2 > .md-nav__link { padding-left: 2rem; }
.ub-toc-indent-3 > .md-nav__link { padding-left: 2.6rem; }
.ub-toc-indent-4 > .md-nav__link { padding-left: 3.2rem; }

@media (max-width: 76.1875em) {
  /* Wrapper: non-scrolling flex child between title and list */
  .ub-toc-header {
    flex-shrink: 0;
  }

  /* Label: mimics a .md-nav--primary .md-nav__link entry */
  .ub-toc-header__label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--md-default-fg-color);
    cursor: pointer;
    border-top: 0.05rem solid var(--md-default-fg-color--lightest);
    transition: none;
    -webkit-tap-highlight-color: transparent;
  }
  .ub-toc-header__label:hover {
    color: var(--md-default-fg-color);
  }

  /* -- Kill hover/active on mobile sidebar links --------------
     pointer-events:none prevents :hover and :active from firing
     during swipe-scrolling.  Taps are restored via JS delegation
     on the parent <li> (see nav-delegation.js / mobile-toc.js). */
  .md-nav--primary .md-nav__link {
    pointer-events: none;
  }

  /* JS-driven press state for sidebar links (touch-scroll-fix.js) */
  .md-nav--primary .md-nav__link.ub-nav-pressed {
    color: var(--teal-glow) !important;
    text-shadow: 0 0 10px rgba(0,240,194,0.9) !important;
  }

  /* JS-driven press state for TOC links (mobile-toc.js) */
  .ub-toc-header .md-nav__link.ub-toc-pressed {
    color: var(--teal-glow) !important;
    text-shadow: 0 0 10px rgba(0,240,194,0.9) !important;
  }

  /* While a TOC panel is closed, its hidden slide-in nav sits
     position:absolute; height:100%; z-index:1 and Material never
     disables its pointer-events.  This lets the invisible overlay
     swallow taps on sidebar entries underneath it.
     Applies to BOTH our custom TOC panels AND Material's native
     __toc panel inside the active page's <li>. */
  .ub-toc-header .md-nav__toggle:not(:checked) ~ .md-nav,
  .md-nav--primary #__toc:not(:checked) ~ .md-nav {
    pointer-events: none;
  }

  /* TOC icon (instead of the default nav chevron) */
  .ub-toc-header__label .md-nav__icon {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: -0.2rem;
    font-size: 1.2rem;
    height: 1.2rem;
    width: 1.2rem;
  }
  .ub-toc-header__label .md-nav__icon::after {
    background-color: currentcolor;
    content: "";
    display: block;
    height: 100%;
    mask-image: var(--md-toc-icon);
    -webkit-mask-image: var(--md-toc-icon);
    mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    width: 100%;
  }

  /* On mobile, Material replaces the <a> link with a non-navigating
     <label for="__toc"> (TOC toggle + chevron icon) and hides the <a>.
     Our custom TOC button replaces this toggle, so swap them back:
     hide the label, restore the <a> as the visible/clickable entry. */
  .md-nav--primary .md-nav__link[for="__toc"] {
    display: none !important;
  }
  .md-nav--primary .md-nav__link[for="__toc"] + .md-nav__link {
    display: flex !important;
  }
}
