/* Section navigation; page backgrounds, headings and spacing stay in their original stylesheets. */
.chapters-enabled .desktop-nav,
.chapters-enabled .menu-button,
.chapters-enabled .mobile-nav,
.chapters-enabled .menu-backdrop { display: none !important; }
.chapters-enabled .header { gap: 20px; }
/* Header glass and its fading edge remain owned by appsola.css. */
.chapter-nav { margin-left: auto; min-width: 0; }
.chapter-links { display: flex; gap: 3px; padding: 5px; border-radius: 100px; background: #ffffff94; }
.chapter-links a {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 12px 13px; border-radius: 100px;
  color: #5b657d; font-size: 12px; line-height: 1.3; font-weight: 600;
  white-space: nowrap; text-decoration: none;
  transition: background-color 240ms ease, color 240ms ease;
}
.chapter-links .chapter-link-number, .chapter-links .chapter-link-arrow { display: none; }
.chapter-links a:hover { color: #091a43; background: #eaeefd; }
.chapter-links a[aria-current="location"] { background: #17264b; color: #fff; }
.chapter-links a[aria-current="location"]::after {
  content: ""; position: absolute; bottom: 5px; left: 17px; right: 17px; height: 2px;
  border-radius: 3px; background: #b7c5ff;
  transform: scaleX(var(--chapter-progress, 0)); transform-origin: left;
}
.chapter-links a:focus-visible,
.chapter-mobile-toggle:focus-visible,
.chapter-mobile-list a:focus-visible { outline: 2px solid #4665ff; outline-offset: 4px; }
.chapters-enabled section.chapter-pointer-focus:focus { outline: none; }
.chapter-mobile-toggle, .chapter-mobile-list { display: none; }

@media (min-width: 1100px) and (max-width: 1250px) {
  .chapters-enabled .header { gap: 12px; }
  .chapter-links a { padding-inline: 10px; font-size: 11px; }
  .chapters-enabled .header-contact { padding-inline: 20px; gap: 14px; font-size: 12px; }
}
@media (max-width: 1099px) {
  .chapter-nav { position: static; margin-left: 0; flex-shrink: 0; }
  .chapter-links { display: none; }
  .chapter-mobile-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border-radius: 50%; border: 1px solid #cdd5ec;
    color: var(--blue); background: #fffdf9b3; cursor: pointer;
    transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  }
  .chapter-mobile-toggle[aria-expanded="true"] {
    color: #fff; background: var(--blue); border-color: var(--blue);
    box-shadow: 0 5px 18px #4665ff26;
  }
  .chapter-menu-glyph { position: relative; width: 19px; height: 16px; }
  .chapter-menu-glyph span {
    position: absolute; top: 7px; left: 0; width: 19px; height: 2px;
    border-radius: 2px; background: currentColor;
    transition: transform 340ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease;
  }
  .chapter-menu-glyph span:nth-child(1) { transform: translateY(-6px); }
  .chapter-menu-glyph span:nth-child(2) { width: 13px; }
  .chapter-menu-glyph span:nth-child(3) { transform: translateY(6px); }
  [aria-expanded="true"] .chapter-menu-glyph span:nth-child(1) { transform: rotate(45deg); }
  [aria-expanded="true"] .chapter-menu-glyph span:nth-child(2) { opacity: 0; transform: translateX(5px); }
  [aria-expanded="true"] .chapter-menu-glyph span:nth-child(3) { transform: rotate(-45deg); }
  .chapter-mobile-list {
    --menu-ease: cubic-bezier(.22, 1, .36, 1);
    display: block; position: absolute; top: calc(100% + 8px); right: 0;
    width: min(380px, 100%); padding: 12px;
    border: 1px solid #ffffffd9; border-radius: 24px;
    background: radial-gradient(ellipse at 100% 100%, #ff96591a, transparent 65%),
      radial-gradient(ellipse at 0 0, #4665ff0d, transparent 60%), #fffdf9f5;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 24px 60px -20px #172c6552, 0 6px 18px -8px #4665ff24;
    max-height: calc(100dvh - 124px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto; overscroll-behavior: contain;
    transform-origin: calc(100% - 22px) -30px;
    transform: translateY(-10px) scale(.96);
    clip-path: inset(0 0 100% 72% round 24px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: clip-path 240ms var(--menu-ease), transform 240ms var(--menu-ease), opacity 180ms ease, visibility 0s 240ms;
  }
  .chapter-nav.is-open .chapter-mobile-list {
    transform: translateY(0) scale(1); clip-path: inset(-60px -80px -100px -80px round 24px);
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: clip-path 440ms var(--menu-ease), transform 440ms var(--menu-ease), opacity 180ms ease, visibility 0s;
  }
  .chapter-menu-heading {
    display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px 18px;
    color: #69758d; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  }
  .chapter-mobile-list a {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; align-items: center;
    gap: 12px; min-height: 60px; padding: 12px; border-radius: 14px;
    color: var(--ink); text-decoration: none;
    opacity: 0; transform: translateY(10px);
    transition: opacity 140ms ease, transform 180ms ease, background-color 180ms ease, color 180ms ease;
  }
  .chapter-nav.is-open .chapter-mobile-list a {
    opacity: 1; transform: translateY(0);
    transition: opacity 280ms ease, transform 360ms var(--menu-ease), background-color 180ms ease, color 180ms ease;
    transition-delay: calc(55ms + var(--chapter-order) * 30ms), calc(55ms + var(--chapter-order) * 30ms), 0s, 0s;
  }
  .chapter-mobile-list a + a { border-top: 1px solid #091a4309; }
  .chapter-mobile-list .chapter-link-number { color: #7180a4; font-size: 11px; }
  .chapter-mobile-list .chapter-link-label { font-size: clamp(17px, 4.8vw, 20px); font-weight: 600; letter-spacing: -.4px; }
  .chapter-link-arrow {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid #4665ff1c; color: var(--blue); font-size: 19px; line-height: 1;
    transition: color 180ms ease, background-color 180ms ease, transform 220ms ease;
  }
  .chapter-mobile-list a[aria-current="location"] { color: #243fba; background: #edf0ff; }
  .chapter-mobile-list a[aria-current="location"] .chapter-link-arrow { color: #fff; background: var(--blue); border-color: var(--blue); }
  .chapter-mobile-list a:hover, .chapter-mobile-list a:focus-visible { color: var(--blue); background: #edf0ff; }
  .chapter-mobile-list a:hover .chapter-link-arrow, .chapter-mobile-list a:focus-visible .chapter-link-arrow { transform: rotate(45deg); }
}
@media (max-width: 800px) {
  html:has(body.chapters-enabled) { scroll-padding-top: calc(102px + env(safe-area-inset-top, 0px)); }
  .chapters-enabled .header { height: 86px; gap: 8px; border: 0; }
  .chapter-mobile-list { max-height: calc(100dvh - 110px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }

}
@media (prefers-reduced-motion: reduce) {
  html:has(body.chapters-enabled) { scroll-behavior: auto; }
  .chapter-links a, .chapter-mobile-toggle, .chapter-menu-glyph span,
  .chapter-mobile-list, .chapter-nav.is-open .chapter-mobile-list,
  .chapter-mobile-list a, .chapter-nav.is-open .chapter-mobile-list a, .chapter-link-arrow { transition: none; }
  .chapter-mobile-list, .chapter-mobile-list a { transform: none; }
}
@media print {
  .chapter-nav { display: none; }
}
