/* Continuous navigation, contained light effects and a distinct workspace rail. */
body.af-workspace-shell:not(.rail-labels-visible) { --rail-w: 86px !important; }
body.af-refresh .app-rail {
  left: 0 !important; top: var(--header-h) !important; bottom: 0 !important;
  width: var(--rail-w) !important; padding: 22px 16px 16px !important;
  border: 0; border-right: 1px solid #ad98da12; border-radius: 0 !important;
  background: linear-gradient(180deg, #080b14, #090c16); box-shadow: inset -1px 0 #02040b;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.af-refresh .app-rail .rail-main {
  display: flex; flex-direction: column; flex: 1; gap: 8px; min-height: 0;
  padding: 4px; overflow-y: auto; overflow-x: hidden;
}
.af-refresh .app-rail .rail-footer { flex: 0 0 auto; padding: 16px 4px 0; border-top: 1px solid #ad98da12; }
body.af-refresh .app-rail .rail-footer button { font-size: 12px !important; gap: 8px !important; }
body.af-refresh .app-rail :is(a, button) {
  flex-shrink: 0; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  border: 0; border-radius: 13px; isolation: isolate; transform: none !important;
  transition: color .38s ease, background-color .38s ease, box-shadow .38s ease !important;
}
.af-refresh .app-main { transition: none !important; }
.af-refresh.rail-is-transitioning .app-main { transition: padding-left .48s cubic-bezier(.16,.82,.2,1) !important; }
body.af-refresh .app-rail :is(a, button)::before { display: none !important; }
body.af-refresh .app-rail :is(a, button).active {
  background: #a38adb19; color: #e2d4fb; box-shadow: inset 0 1px #d1b9ff0b, inset 0 -1px #977dc70b;
}
body.af-refresh .app-rail :is(a, button):hover { background: #8774b50e; }
body.af-refresh .app-rail :is(a, button).active:hover { background: #a38adb22; }
.af-refresh .app-rail :is(a, button) .rail-icon { position: relative; z-index: 1; flex-shrink: 0; box-shadow: none !important; transform: none !important; }
.af-refresh .app-rail .rail-icon svg { transition: transform .6s cubic-bezier(.2,.8,.2,1), color .4s ease !important; }
.af-refresh .app-rail :is(a, button):is(:hover, :focus-visible) .rail-icon svg { transform: rotate(-8deg) scale(1.12); color: #dac5ff; }
.af-refresh .app-rail [data-af-group="dynamics"]:is(:hover, :focus-visible) .rail-icon svg { transform: translateY(-2px) rotate(5deg) scale(1.1); }
.af-refresh .app-rail [data-af-group="comparison"]:is(:hover, :focus-visible) .rail-icon svg { transform: rotate(12deg) scale(1.14); }
.af-refresh .app-rail [data-af-group="analysis"]:is(:hover, :focus-visible) .rail-icon svg { transform: rotate(-6deg) scale(1.12); }
.af-refresh .app-rail [data-af-group="tools"]:is(:hover, :focus-visible) .rail-icon svg { transform: rotate(28deg) scale(1.08); }
.af-refresh .app-rail a > span:not(.rail-icon) { position: relative; z-index: 1; }
.af-refresh .app-rail [data-tooltip]::after { display: none !important; }
.af-nav-tooltip { position: fixed; z-index: 1100; max-width: 190px; padding: 9px 13px; border: 1px solid #b49bd62a; border-radius: 10px; color: #e0d5f1; background: #111321; font: inherit; font-size: 13px; pointer-events: none; opacity: 0; transform: translate(4px, -50%); transition: opacity .2s ease, transform .3s ease; }
.af-nav-tooltip.is-visible { opacity: 1; transform: translate(0, -50%); }
.af-refresh .af-nav-light {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit;
  pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(110px circle at var(--af-light-x, 50%) var(--af-light-y, 50%), #bda1f52a, #93c7ed08 55%, transparent 80%);
}
.af-refresh .af-nav-light::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px #dac5ff20, inset 0 -1px #94d7ef14;
}
.af-refresh .af-nav-light::after {
  content: ''; position: absolute; inset: -40% -60%;
  background: linear-gradient(110deg, transparent 42%, #d4c0f918 50%, transparent 58%);
  transform: translateX(-45%); transition: transform .95s cubic-bezier(.2,.7,.2,1);
}
.af-refresh .af-feedback { position: relative; isolation: isolate; }
.af-refresh .af-feedback:is(:hover, :focus-visible) > .af-nav-light { opacity: 1; }
.af-refresh .af-feedback.af-activating > .af-nav-light { opacity: 1; }
.af-refresh .af-feedback:is(:hover, :focus-visible) > .af-nav-light::after { transform: translateX(35%); }
.af-refresh .af-nav-wave {
  position: absolute; left: var(--af-wave-x, 50%); top: var(--af-wave-y, 50%);
  width: 10px; height: 10px; margin: -5px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #ece0ff52, #b99cf52e 35%, #8fceec24 58%, transparent 72%);
  pointer-events: none; transform: scale(0);
}
.af-refresh .af-nav-wave::after { content: ''; position: absolute; inset: 0; border: .4px solid #d9c8ff4d; border-radius: 50%; }
.af-refresh .af-section-tabs { position: relative; isolation: isolate; padding: 4px; border: 0; gap: 4px; }
.af-refresh .af-section-tabs a { min-height: 42px; padding: 10px 16px; border-radius: 10px; transition: color .4s ease !important; }
.af-refresh .af-section-tabs a::after { display: none; }
.af-tab-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; z-index: -1; border-radius: 10px;
  background: linear-gradient(120deg, #b39be818, #8cbae807); box-shadow: inset 0 1px #c8abef18;
  transition: transform .55s cubic-bezier(.22,.75,.2,1), width .5s cubic-bezier(.22,.75,.2,1); pointer-events: none;
}
.af-tab-indicator::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, #c4a2ee9c, #91c0dd75, transparent); }
.af-refresh .mobile-bottom-nav :is(a, button), .af-refresh .af-phase-tabs button { isolation: isolate; }
.af-refresh .mobile-bottom-nav .af-nav-light { border-radius: 15px; }
.af-refresh .app-header > .brand {
  position: relative; isolation: isolate; padding: 6px 12px; height: 60px;
  border: 1px solid #ad92db19; border-radius: 16px;
  background: linear-gradient(115deg, #a991e011, #87bfd207 70%, transparent);
  box-shadow: inset 0 1px #e6d7ff06; transition: border-color .45s ease, background-color .45s ease;
}
.af-refresh .app-header > .brand::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(ellipse at 22% 50%, #b38aed1b, transparent 70%); opacity: .45; transition: opacity .6s ease; }
.af-refresh .app-header > .brand:is(:hover, :focus-visible) { border-color: #bca0ef3a; }
.af-refresh .app-header > .brand:is(:hover, :focus-visible)::before { opacity: 1; }
.af-refresh .app-header .brand-artwork::before {
  content: ''; display: block !important; position: absolute; inset: -5px -3px; z-index: -1;
  border: 1px solid #b296e72b; border-top-color: #a9d5e55c; border-bottom-color: transparent;
  border-radius: 50%; background: none; transform: rotate(-32deg); transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.af-refresh .app-header .brand:is(:hover, :focus-visible) .brand-artwork::before { transform: rotate(34deg); }
@media (min-width: 981px) {
  body.af-refresh.af-workspace-shell .app-header > .brand { width: 182px !important; min-width: 182px !important; flex-basis: 182px !important; gap: 12px; }
  body.af-refresh.af-workspace-shell .app-header .brand-artwork { width: 44px !important; height: 44px !important; flex-basis: 44px !important; }
  body.af-refresh.af-workspace-shell .app-header .brand-logo-symbol { width: 44px !important; }
}
@media (max-width: 980px) { .af-refresh .app-header > .brand { padding: 0; height: 44px; border: 0; background: none; box-shadow: none; } }

/* The shell stays visible while the native module downloads. */
html:has(body.af-refresh) { view-transition-name: none; }
.af-refresh #app-main { view-transition-name: none; }
.af-refresh #view-root { view-transition-name: none; }
.af-refresh #parameters-layer { view-transition-name: none; }
.af-refresh #view-root.route-enter > :first-child { animation: none !important; }
/* SPA sections animate their live surfaces. Document transitions participate
   only after page-journey verifies that the destination content is ready. */
@media (prefers-reduced-motion: reduce) {
  .af-refresh .af-nav-light, .af-refresh .af-nav-wave { display: none; }
  .af-refresh .app-rail .rail-icon svg { transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html[data-motion-paused="true"] .af-refresh :is(.af-nav-light, .af-nav-wave) { display: none; }
html[data-motion-paused="true"] .af-refresh .app-rail .rail-icon svg { transform: none !important; }
@media print { .af-tab-indicator, .af-nav-light, .af-nav-wave, .af-nav-tooltip { display: none !important; } }
