/* ============================================
   ODS Shared Navigation
   ============================================ */

/* Skip link — first focusable element of every shared-chrome page. Visually hidden until it
   receives keyboard focus, then revealed at the top-left. Native anchor to #main-content; no
   JavaScript required. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 10000;
  padding: 0.55rem 0.9rem;
  background: var(--theme-surface-overlay);
  color: var(--theme-ink-primary);
  border: 1px solid var(--theme-rule-focus);
  border-radius: 6px;
  font-family: var(--mono, var(--sans));
  font-size: var(--type-metadata-size);
  font-weight: 500;
  letter-spacing: var(--type-metadata-ls);
  text-decoration: none;
  transition: top 0.16s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--theme-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--theme-focus-ring-outer);
}

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--theme-surface-page);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 var(--theme-rule-subtle);
}
.nav-inner {
  /* The shared navigation is the top of the page spine, so it takes the primary page measure and
     the shared gutter rather than the private --nav-max-w, which was never defined anywhere and
     always fell through to its own 1200px. */
  width: 100%; max-width: var(--layout-box-page); margin: 0 auto;
  padding: 0 var(--layout-gutter); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--layout-nav-h);
  gap: 1.25rem;
}
.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-brand { display: flex; align-items: center; text-decoration: none; gap: 11px; }
.nav-brand { min-width: 44px; min-height: 44px; }
.assay-mark {
  display: block;
  flex: 0 0 auto;
  color: var(--theme-ink-primary);
  overflow: visible;
}
/*
 * One size rule for every nav geometry. The master and dark-ground cuts share the same 20x29 box,
 * so sizing them together means the theme swap moves no pixels and a page-level override has a
 * single declaration to beat rather than one per variant.
 *
 * 26px tall, the published homepage's figure. It used to be 15.2x22 here and 17.93x26 on the
 * homepage alone, so the wordmark changed size on every crossing out of the benchmark. The width is
 * stated rather than left to auto because the mark is an inline SVG carrying its own width
 * attribute, and auto resolves to that attribute rather than to the viewBox ratio.
 */
.nav-brand .assay-mark {
  width: 17.93px;
  height: 26px;
  transform: translateY(-0.5px);
}
.nav-brand .assay-mark--small { display: none; }

/*
 * Dark-ground optical cut. This is a GEOMETRY compensation, not a colour variant: a reversed mark
 * blooms and reads heavier than the same shape in ink, so the punch and chamfers are cut back a few
 * per cent rather than the master simply being recoloured. Colour itself needs no rule at all, as
 * the paths fill with currentColor and .assay-mark inherits --theme-ink-primary.
 */
.nav-brand .assay-mark--dark { display: none; }

/*
 * The swap is confined to the width band where the master cut is the one on screen. Below 768px the
 * nav drops to the hand-cut small geometry, and the brand system is explicit that the small cut is
 * used unchanged on dark grounds: sub-pixel compensation is meaningless at that size. Scoping the
 * rule here rather than hiding the dark cut again inside the mobile block also keeps it immune to
 * source order, since a theme-attribute selector outweighs a plain class selector and a media query
 * adds no specificity of its own.
 */
@media (min-width: 768px) {
  :root[data-theme="dark"] .nav-brand .assay-mark--master,
  :root[data-theme-lock="dark"] .nav-brand .assay-mark--master { display: none; }

  :root[data-theme="dark"] .nav-brand .assay-mark--dark,
  :root[data-theme-lock="dark"] .nav-brand .assay-mark--dark { display: block; }
}
.nav-brand svg:not(.assay-mark) { width: 34px; height: 34px; display: block; flex-shrink: 0; transform: translateY(-1px); }
.nav-brand img {
  width: auto;
  height: 30px;
  display: block;
  flex-shrink: 0;
  transform: translateY(-1px);
  border-radius: 0;
}
/* The wordmark, at the published homepage's rank: it names the publication, so it is set in the
   primary ink at reading size rather than as a piece of secondary metadata beside the mark. */
.nav-brand span {
  font-family: var(--mono, var(--sans)); font-size: 15px; font-weight: 400;
  color: var(--theme-ink-primary); letter-spacing: 0.045em;
  white-space: nowrap;
}
.nav-back { font-size: 0.85rem; color: var(--theme-ink-secondary); transition: color 0.2s; }
.nav-back:hover { color: var(--theme-ink-link-hover); }

.nav-primary,
.dt-primary-nav {
  display: none;
  align-items: center;
  gap: 30px;
  min-height: var(--layout-nav-h);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-primary > li,
.dt-primary-nav > li {
  display: flex;
  align-items: center;
  min-height: var(--layout-nav-h);
}

/* Destination type, at the published homepage's figures. 12.5px with 0.13em of tracking rather than
   the compact label role: the bar is the one piece of chrome present on every route, so it takes the
   reference's own values instead of a near-neighbour, and the homepage no longer needs a private
   copy of them. */
.nav-primary a,
.dt-primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--layout-nav-h);
  min-height: 44px;
  color: var(--theme-ink-secondary);
  font-family: var(--mono, var(--sans));
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, opacity 0.18s ease;
}
/* The current-destination mark, at the reference's weight: a 2px ink rule, not a hairline in the
   focus colour. In dark it is the one piece of the bar that has to survive a low-contrast ground,
   and a 1px focus-tinted line did not. */
.nav-primary > li > a::after,
.dt-primary-nav > li > a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11px;
  height: 2px;
  background: var(--theme-ink-primary);
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-primary a:hover,
.dt-primary-nav a:hover,
.nav-primary a[aria-current="page"],
.dt-primary-nav a[aria-current="page"] {
  color: var(--theme-ink-primary);
}
.nav-primary > li > a[aria-current="page"]::after,
.dt-primary-nav > li > a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Language dropdown */
.lang-dropdown { position: relative; }
.lang-toggle {
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
  color: var(--theme-ink-secondary); background: none;
  border: 1px solid var(--theme-rule-standard); cursor: pointer;
  padding: 0.3rem 0.6rem; border-radius: 4px; transition: all 0.2s;
  display: flex; align-items: center; gap: 0.3rem; letter-spacing: 0.04em;
}
.lang-toggle:hover { color: var(--theme-ink-primary); border-color: var(--theme-rule-interactive); }
.lang-toggle::after {
  content: ''; border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor; margin-top: 1px;
}
/* Language indicator — clean, minimal */
.nav-lang {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  color: var(--theme-ink-muted); letter-spacing: 0.08em;
  min-height: 48px;
  padding: 0.25rem 0.5rem; cursor: default; user-select: none;
  white-space: nowrap;
}
.lang-menu {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  background: var(--theme-surface-overlay); backdrop-filter: blur(8px);
  text-transform: uppercase; padding: 0.4rem 0;
  border-radius: 8px; padding: 0.35rem; min-width: 200px;
  z-index: 200; grid-template-columns: 1fr 1fr;
}
.lang-menu.open { display: grid; animation: fadeUp 0.15s ease; }
.lang-pick {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
  color: var(--theme-ink-muted); background: none; border: none;
  cursor: pointer; padding: 0.4rem 0.75rem; border-radius: 4px;
  transition: all 0.15s; display: block; width: 100%;
  text-align: left; min-height: 44px;
}
.lang-pick:hover { background: var(--theme-surface-hover); color: var(--theme-ink-primary); }
.lang-pick.active { color: var(--theme-ink-link); }

nav, section, footer { position: relative; z-index: 20; }

/* Scroll offset for anchors — accounts for fixed nav (48px) */
/* Fragment landings clear the fixed bar with a little air beneath it. Derived from the bar rather
   than stated as a number, so the two cannot drift apart again. */
html { scroll-padding-top: calc(var(--layout-nav-h) + 8px); }

body.nav-open { overflow: hidden; }

/* ---- Theme selection ----------------------------------------------------
   Native select keeps the three-state System / Light / Dark interaction keyboard- and
   touch-native. Desktop and mobile instances are synchronised by js/theme.js; only one is visible
   at a time. All colours resolve through semantic roles. */
.theme-control {
  min-height: 44px;
  align-items: center;
  gap: 0.4rem;
  color: var(--theme-ink-secondary);
  font-family: var(--mono, var(--sans));
  flex-shrink: 0;
}
.theme-control--desktop,
.theme-control--mobile {
  display: none;
}
.theme-control--standalone {
  display: inline-flex;
}
.theme-control__label {
  font-size: var(--type-label-compact-size);
  font-weight: 500;
  letter-spacing: var(--type-label-compact-ls);
  text-transform: uppercase;
  white-space: nowrap;
}
.theme-control__select {
  min-width: 78px;
  min-height: 44px;
  padding: 0.35rem 1.65rem 0.35rem 0.5rem;
  color: var(--theme-ink-primary);
  background-color: var(--theme-surface-raised);
  border: 1px solid var(--theme-rule-standard);
  border-radius: 4px;
  font: 500 0.7rem/1 var(--mono, var(--sans));
  letter-spacing: 0.02em;
  cursor: pointer;
}
.theme-control__select:hover {
  border-color: var(--theme-rule-interactive);
  background-color: var(--theme-surface-hover);
}
.theme-control__route-note {
  max-width: 7.5rem;
  color: var(--theme-ink-muted);
  font-size: 0.61rem;
  line-height: 1.2;
}
.theme-control__route-note[hidden] {
  display: none;
}
.theme-control__announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Menu trigger ---- */
.menu-trigger {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  color: var(--theme-ink-link); letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.4rem 0;
  min-height: 44px;
  min-width: 44px;
  transition: color 0.2s;
}
.menu-trigger:hover { color: var(--theme-ink-link-hover); }

/* ---- Full-screen nav overlay ---- */
.nav-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  z-index: 9999; background: var(--theme-surface-page);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 5rem 1rem 1.5rem;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.nav-overlay.open {
  opacity: 1; pointer-events: auto;
}
/* Closed overlay is fully removed from layout, tab order and the accessibility tree. Shared here
   (not only in each page's inline <style>) so pages that lack the inline rule — e.g. the legacy
   in-practice page — do not leave a screen of focusable, screen-reader-browsable links behind the
   page. js/nav-overlay.js toggles the .open class and aria-hidden together. */
.nav-overlay:not(.open) { display: none; }
.nav-overlay-logo img {
  width: auto;
  height: 32px;
  display: block;
  border-radius: 0;
}
.nav-overlay-close {
  position: absolute; top: 0.9rem; right: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-rule-standard); border-radius: 999px;
  cursor: pointer;
  font-size: 1.15rem; color: var(--theme-ink-secondary);
  line-height: 1; padding: 0; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-overlay-close:hover {
  color: var(--theme-ink-primary);
  border-color: var(--theme-rule-focus);
  background: var(--theme-surface-hover);
}
.nav-overlay-links {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; text-align: center; width: 90%; max-width: 400px;
  margin-top: 0;
}
.nav-overlay-link {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; text-decoration: none; padding: 1.05rem 0;
  border-bottom: 1px solid var(--theme-rule-subtle);
  width: 100%;
  transition: background 0.15s ease;
}
.nav-overlay-link:first-child { border-top: 1px solid var(--theme-rule-subtle); }
.nav-overlay-link:hover,
.nav-overlay-link:focus-visible {
  background: var(--theme-surface-hover);
}
.nav-overlay-label {
  font-family: var(--sans); font-size: 1.05rem; font-weight: 500;
  color: var(--theme-ink-secondary); letter-spacing: 0.06em;
  text-transform: uppercase; transition: color 0.15s;
}
.nav-overlay-link:hover .nav-overlay-label,
.nav-overlay-link:focus-visible .nav-overlay-label { color: var(--theme-ink-primary); }
.nav-overlay-link[aria-current="page"] .nav-overlay-label {
  color: var(--theme-ink-link);
}
.nav-overlay-link[aria-current="page"] {
  border-color: var(--theme-rule-focus);
}
.nav-overlay-desc {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 300;
  color: var(--theme-ink-secondary); line-height: 1.4;
}
/* Board sub-items (Currencies/Chains/Issuers) — indented, visually secondary */
.nav-overlay-link--board {
  padding: 0.65rem 0 0.65rem 1.25rem;
  border-bottom-color: var(--theme-rule-subtle);
}
.nav-overlay-link--board .nav-overlay-label {
  font-size: 0.9rem;
  color: var(--theme-ink-muted);
}
.nav-overlay-link--board .nav-overlay-desc {
  color: var(--theme-ink-secondary);
}

@media (max-width: 767px) {
  .nav-brand { gap: 12px; }
  .nav-brand .assay-mark--master { display: none; }
  .nav-brand .assay-mark--small {
    display: block;
    width: 20px;
    height: 20px;
    transform: none;
  }
  .nav-brand svg:not(.assay-mark) { width: 30px; height: 30px; }
  .nav-brand img { width: auto; height: 28px; border-radius: 0; }
  .nav-overlay-logo img { width: auto; height: 30px; border-radius: 0; }
  /* "Stable Tape" is short enough to keep visible on mobile. */

  .nav-overlay {
    align-items: stretch;
    justify-content: flex-start;
    padding: 3.5rem 1.15rem 1.6rem;
  }

  .nav-overlay-close {
    top: 0.7rem;
    right: 0.85rem;
  }

  .nav-overlay-links {
    width: 100%;
    max-width: none;
    align-items: stretch;
    text-align: left;
  }

  .nav-overlay-link {
    align-items: flex-start;
    gap: 0;
    padding: 0.62rem 0.15rem;
  }

  .nav-overlay-label {
    font-size: 0.86rem;
    letter-spacing: 0.05em;
  }

  .nav-overlay-link--board {
    padding: 0.52rem 0.15rem 0.52rem 1.1rem;
  }

  .nav-overlay-link--board .nav-overlay-label {
    font-size: 0.78rem;
  }

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

  .theme-control--mobile {
    display: flex;
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.65rem 0.15rem 0;
    border-top: 1px solid var(--theme-rule-subtle);
  }

  .theme-control--mobile .theme-control__select {
    flex: 1;
  }

  .theme-control--standalone {
    margin-left: auto;
  }

  .theme-control--standalone .theme-control__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (min-width: 768px) {
  .nav-primary,
  .dt-primary-nav {
    display: flex;
  }

  .nav-primary {
    margin-left: auto;
  }

  .menu-trigger,
  .dt-menu {
    display: none;
  }

  .theme-control--desktop {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .dt-live {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1050px) {
  .nav-brand span,
  .dt-brand-tail {
    display: none;
  }

  .nav-primary,
  .dt-primary-nav {
    gap: 0.85rem;
  }

  /* Was 0.64rem (10.24px), below the constitution's 11px floor for essential text. The compact
     label role is the tightest size a meaningful nav label may take. */
  .nav-primary a,
  .dt-primary-nav a {
    font-size: var(--type-label-compact-size);
    letter-spacing: 0.08em;
  }
}

/* Six destinations (The Close leads) run about 76px past the gutter at 768px with the compact band's
   spacing, so the narrowest part of the band tightens spacing and tracking only. No label changes,
   no hidden items, and the 11px size floor and the 44px theme targets hold. */
@media (min-width: 768px) and (max-width: 879px) {
  .nav-inner { gap: 0.5rem; }
  .nav-primary { gap: 0.75rem; }
  .nav-primary a { letter-spacing: 0.04em; }
  .nav-inner .theme-control--header { margin-left: 0.5rem; }
  .nav-inner .theme-control--header .theme-control__options { gap: 0.25rem; }
}

/* Above the compact band the six full-size labels reach the wordmark until about 1130px, so the
   wordmark text stays hidden, as it already is in the compact band, until 1180px. The mark is
   always shown and the brand link keeps its accessible name. */
@media (min-width: 1051px) and (max-width: 1179px) {
  .nav-brand span { display: none; }
}

/* ---- Legacy hamburger (hidden) ---- */
.nav-hamburger { display: none; }

/* ═══════════════════════════════════════════════
   Metrics dropdown (desktop)
   ═══════════════════════════════════════════════ */

.nav-has-dropdown {
  position: relative;
  isolation: isolate;
}

.nav-dropdown-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  height: var(--layout-nav-h);
  min-height: 44px;
  line-height: 1;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--theme-ink-secondary);
  font-family: var(--mono, var(--sans));
  font-size: 12.5px; font-weight: 400;
  letter-spacing: 0.13em; text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.18s ease;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.is-current {
  color: var(--theme-ink-primary);
}
.nav-dropdown-trigger::after {
  content: '';
  position: absolute; left: 0; right: 1.15em; bottom: 11px;
  height: 2px; background: var(--theme-ink-primary);
  opacity: 0; transform: scaleX(0.45);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-dropdown-trigger.is-current::after { opacity: 1; transform: scaleX(1); }

.nav-dropdown-caret {
  display: inline-block; font-size: 0.6em; color: var(--theme-ink-primary); opacity: 0.5; line-height: 1;
  margin-top: 1px;
  transform-origin: 50% 45%;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
/* Open state is driven only by the .open class (set by js/nav-overlay.js on click, keyboard and
   pointer-enter), never by :hover alone — a CSS-only hover reveal would show the panel while its
   aria-expanded stayed false and its descendants stayed inert. */
.nav-has-dropdown.open .nav-dropdown-caret { transform: rotate(180deg); opacity: 0.8; }

.nav-dropdown {
  position: absolute; top: 100%; right: 0;
  width: min(320px, calc(100vw - 32px));
  min-width: 234px; list-style: none; margin: 0; padding: 0.3rem;
  background: var(--theme-surface-overlay);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--theme-rule-standard); border-radius: 9px;
  box-shadow: none;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.17s ease, transform 0.17s ease;
  z-index: 200;
}
.nav-has-dropdown.open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 2px;
  padding: 0.5rem 0.72rem; border-radius: 5px;
  text-decoration: none; outline-offset: -2px;
  text-align: center;
  transition: background 0.13s ease;
}
.nav-dropdown-item:hover { background: var(--theme-surface-hover); }
.nav-dropdown-item[aria-current="page"] { background: var(--theme-surface-active); }

.nav-dropdown-item-label {
  display: block;
  font-family: var(--mono, var(--sans)); font-size: var(--type-label-compact-size); font-weight: 500;
  letter-spacing: var(--type-label-compact-ls); text-transform: uppercase;
  color: var(--theme-ink-primary);
  transition: color 0.13s ease;
}
.nav-dropdown-item:hover .nav-dropdown-item-label,
.nav-dropdown-item[aria-current="page"] .nav-dropdown-item-label {
  color: var(--theme-ink-primary);
}
/* Weight 300 at this size read as faint rather than subordinate; the reference sets all
   interface prose at 400 and lets scale carry the hierarchy. Size is unchanged. */
.nav-dropdown-item-desc {
  display: block; font-family: var(--sans);
  font-size: 0.67rem; font-weight: 400;
  color: var(--theme-ink-secondary); letter-spacing: 0.01em;
}

/* Shared focus grammar: a semantic ring with a contrasting outer keyline. Inset offsets on
   edge-aligned rows keep the indicator inside the viewport and open panels without changing
   geometry or introducing overflow. */
:is(
  .nav-brand,
  .nav-back,
  .lang-toggle,
  .lang-pick,
  .menu-trigger,
  .nav-primary a,
  .dt-primary-nav a,
  .nav-dropdown-trigger,
  .nav-dropdown-item,
  .nav-overlay-close,
  .nav-overlay-link,
  .nav-overlay-accordion-trigger,
  .nav-overlay-link--sub,
  .theme-control__select
):focus-visible {
  outline: 2px solid var(--theme-focus-ring);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 4px var(--theme-focus-ring-outer);
}

@media (min-width: 768px) and (max-width: 1050px) {
  .nav-dropdown-trigger { font-size: var(--type-label-compact-size); letter-spacing: 0.08em; }
  .nav-dropdown { min-width: 210px; }
}

/* ═══════════════════════════════════════════════
   Metrics accordion (mobile overlay)
   ═══════════════════════════════════════════════ */

.nav-overlay-accordion {
  width: 100%;
  border-bottom: 1px solid var(--theme-rule-subtle);
}

.nav-overlay-accordion-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 1.05rem 0; text-align: left; gap: 0.5rem;
}
.nav-overlay-accordion-trigger .nav-overlay-label { transition: color 0.15s; }
.nav-overlay-accordion-trigger.is-current .nav-overlay-label { color: var(--theme-ink-link); }

.nav-overlay-accordion-caret {
  font-size: 0.65rem; color: var(--theme-ink-muted); flex-shrink: 0; line-height: 1;
  transition: transform 0.2s ease, color 0.15s;
}
.nav-overlay-accordion.open .nav-overlay-accordion-caret {
  transform: rotate(180deg); color: var(--theme-ink-secondary);
}

.nav-overlay-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.nav-overlay-accordion.open .nav-overlay-accordion-body { max-height: 320px; }
.nav-overlay-accordion-body-inner { padding-bottom: 0.45rem; }

.nav-overlay-link--sub {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 3px;
  padding: 0.68rem 0 0.68rem 1.1rem;
  border-top: 1px solid var(--theme-rule-subtle);
  text-decoration: none;
}
.nav-overlay-link--sub:first-child { border-top-color: var(--theme-rule-standard); }
.nav-overlay-link--sub .nav-overlay-label {
  font-size: 0.9rem; color: var(--theme-ink-muted);
  transition: color 0.15s;
}
.nav-overlay-link--sub:hover .nav-overlay-label,
.nav-overlay-link--sub[aria-current="page"] .nav-overlay-label { color: var(--theme-ink-link); }
.nav-overlay-link--sub .nav-overlay-desc { color: var(--theme-ink-secondary); font-size: 0.72rem; }

@media (max-width: 767px) {
  .nav-overlay-accordion-trigger { padding: 0.95rem 0; }
  .nav-overlay-link--sub .nav-overlay-desc { display: none; }
  .nav-overlay-link--sub { padding: 0.62rem 0 0.62rem 1rem; }
}

/* ═══════════════════════════════════════════════
   Mobile menu More group (navigation contract, 7 October 2026)
   The five primary links keep their descriptions; a divider and a quiet
   "More" label introduce the secondary destinations, which are label-only.
   ═══════════════════════════════════════════════ */

.nav-overlay-more {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--theme-rule-standard);
}
.nav-overlay-more__label {
  margin: 0 0 0.35rem;
  font-family: var(--mono, var(--sans)); font-size: 0.7rem; font-weight: 500;
  color: var(--theme-ink-secondary); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-overlay-link--more {
  min-height: 44px;
  justify-content: center;
  padding: 0.55rem 0;
}
.nav-overlay-link--more:first-of-type { border-top: 1px solid var(--theme-rule-subtle); }
.nav-overlay-link--more .nav-overlay-label {
  font-size: 0.9rem;
}

@media (max-width: 767px) {
  /* The contract keeps the descriptions on the five primary links at phone width. */
  .nav-overlay-links > .nav-overlay-link .nav-overlay-desc {
    display: block;
    margin-top: 2px;
  }
  .nav-overlay-more { margin-top: 0.8rem; padding-top: 0.6rem; }
  .nav-overlay-link--more { padding: 0.5rem 0.15rem; }
  .nav-overlay-link--more .nav-overlay-label { font-size: 0.8rem; }
}

/* Respect reduced-motion for every shared navigation open/close transition, including the desktop
   dropdown panel, the full-screen overlay fade, the caret rotations and the skip-link reveal. */
@media (prefers-reduced-motion: reduce) {
  .nav-overlay,
  .nav-overlay-accordion-body,
  .nav-overlay-accordion-caret,
  .nav-dropdown,
  .nav-dropdown-caret,
  .skip-link { transition: none; }
}

@media (forced-colors: active) {
  .theme-control__select {
    border-color: CanvasText;
  }
}

/* ═══════════════════════════════════════════════
   Live snapshot sync — toast + value flash
   ═══════════════════════════════════════════════ */

.ddd-sync-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 9000;
  padding: 0.45rem 0.85rem;
  background: var(--theme-surface-overlay);
  border: 1px solid var(--theme-rule-focus);
  border-radius: 6px;
  color: var(--theme-ink-link);
  font-size: 0.76rem;
  letter-spacing: 0.035em;
  font-family: var(--dt-mono, 'JetBrains Mono', 'Fira Mono', 'Courier New', monospace);
  backdrop-filter: blur(10px);
  box-shadow: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  user-select: none;
}
.ddd-sync-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ddd-value-flash {
  0%   { background-color: transparent; }
  18%  { background-color: var(--theme-selection-surface); }
  100% { background-color: transparent; }
}
.ddd-value-flash {
  animation: ddd-value-flash 1.8s ease-out;
  border-radius: 3px;
}

/* ---- Theme control in the shared chrome ----------------------------------
   V2 requires Light / Dark / Auto without reaching the footer. The same
   renderThemeControl() output is emitted three times: in the desktop header, in
   the mobile overlay, and (unchanged) in the footer. js/theme.js already binds
   every [data-theme-control], so all three stay in sync with no extra script.
   Each instance carries its own id so aria-labelledby resolves uniquely. */
.theme-control--header,
.theme-control--overlay {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--theme-ink-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.theme-control--header .theme-control__options,
.theme-control--overlay .theme-control__options {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-control--header .theme-control__options button,
.theme-control--overlay .theme-control__options button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.15rem;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--theme-ink-muted);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.2s;
}
.theme-control--header .theme-control__options button:hover,
.theme-control--overlay .theme-control__options button:hover {
  color: var(--theme-ink-link);
}
.theme-control--header .theme-control__options button[aria-pressed="true"],
.theme-control--overlay .theme-control__options button[aria-pressed="true"] {
  color: var(--theme-ink-primary);
  border-bottom-color: var(--theme-object-identity-ink, var(--theme-rule-strong));
}
/* The label is redundant beside three self-describing buttons in a tight bar,
   but it is the accessible name, so it is hidden visually rather than removed. */
.theme-control--header .theme-control__label,
.theme-control--overlay .theme-control__label {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.theme-control--overlay {
  margin-top: 1.75rem;
  justify-content: center;
}
/* Below the nav breakpoint the header collapses to the menu trigger, so the
   header instance would crowd it; the overlay instance is the mobile control. */
@media (max-width: 767px) {
  .theme-control--header { display: none; }
}
@media (min-width: 768px) {
  .theme-control--header { margin-left: 22px; }
  .theme-control--overlay { display: none; }
}
