/* ============================================================================
   Fly Away Simulation — Site navigation v5.2.0  (fxnav.css)
   Self-contained. Everything the header needs lives here; the only things it
   touches outside #fxn are the page offset (#wrap margin) and html scroll-
   padding, both of which belong to the header anyway.
   Prefix: .fxn-   Root: #fxn   Breakpoint: 1024px (desktop bar vs drawer)
   Every component rule is scoped under #fxn so the element resets at the top
   (which must beat the legacy global CSS) can never out-rank them.
   No jQuery, no custom elements, no @import. Dark is the site default.
   ========================================================================= */

/* ---------- Tokens ------------------------------------------------------ */
:root {
  --fxn-h: 56px;
  --fxn-float-inset: 12px;
  --fxn-float-top: 10px;
  --fxn-max: 1600px;
  --fxn-gutter: 16px;
  --fxn-z: 20000;
  --fxn-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fxn-ease: cubic-bezier(.2, .7, .2, 1);

  /* light */
  --fxn-bg: rgba(250, 250, 251, .86);
  --fxn-bg-float: rgba(255, 255, 255, .72);
  --fxn-surface: #ffffff;
  --fxn-surface-2: #f3f4f6;
  --fxn-bdr: rgba(15, 23, 42, .10);
  --fxn-bdr-strong: rgba(15, 23, 42, .18);
  --fxn-hi: rgba(255, 255, 255, .9);
  --fxn-fg: #0f172a;
  --fxn-fg-2: #475569;
  --fxn-fg-3: #64748b;
  --fxn-hover: rgba(15, 23, 42, .06);
  --fxn-active: rgba(15, 23, 42, .10);
  --fxn-accent: #ffc914;
  --fxn-accent-2: #ffd43b;
  --fxn-accent-ink: #0b0f14;
  --fxn-focus: #2563eb;
  --fxn-shadow: 0 24px 56px -16px rgba(15, 23, 42, .28), 0 2px 8px rgba(15, 23, 42, .08);
  --fxn-shadow-float: 0 18px 40px -18px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08);
  --fxn-scrim: rgba(15, 23, 42, .42);
  --fxn-otto-a: #0284c7;
  --fxn-otto-b: #4f46e5;
  --fxn-logo-filter: invert(.5) saturate(1.1) contrast(1.03);

  /* simulator accents */
  --fxn-c-msfs: #0ea5e9;
  --fxn-c-fsx: #f59e0b;
  --fxn-c-xp: #10b981;
  --fxn-c-p3d: #8b5cf6;
  --fxn-c-charts: #f43f5e;
  --fxn-c-news: #6366f1;
  --fxn-c-creators: #ec4899;
  --fxn-c-fs9: #0d9488;
  --fxn-c-dcs: #65a30d;
  --fxn-c-fg: #0891b2;
  --fxn-c-train: #d97706;
  --fxn-c-avn: #2563eb;
  --fxn-c-gen: #64748b;
}
html[data-theme="dark"] {
  --fxn-bg: rgba(11, 16, 22, .84);
  --fxn-bg-float: rgba(14, 19, 27, .74);
  --fxn-surface: #0f141b;
  --fxn-surface-2: #161c25;
  --fxn-bdr: rgba(255, 255, 255, .10);
  --fxn-bdr-strong: rgba(255, 255, 255, .18);
  --fxn-hi: rgba(255, 255, 255, .10);
  --fxn-fg: #e7ecf7;
  --fxn-fg-2: #b7c0d0;
  --fxn-fg-3: #8b96a8;
  --fxn-hover: rgba(255, 255, 255, .08);
  --fxn-active: rgba(255, 255, 255, .13);
  --fxn-accent: #ffcf33;
  --fxn-accent-2: #ffe066;
  --fxn-focus: #60a5fa;
  --fxn-shadow: 0 28px 64px -16px rgba(0, 0, 0, .7), 0 2px 10px rgba(0, 0, 0, .4);
  --fxn-shadow-float: 0 20px 48px -18px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .45);
  --fxn-scrim: rgba(0, 0, 0, .6);
  --fxn-otto-a: #0ea5e9;
  --fxn-otto-b: #6366f1;
  --fxn-logo-filter: brightness(0) invert(88%);
  --fxn-c-msfs: #38bdf8;
  --fxn-c-fsx: #fbbf24;
  --fxn-c-xp: #34d399;
  --fxn-c-p3d: #a78bfa;
  --fxn-c-charts: #fb7185;
  --fxn-c-news: #818cf8;
  --fxn-c-creators: #f472b6;
  --fxn-c-fs9: #2dd4bf;
  --fxn-c-dcs: #a3e635;
  --fxn-c-fg: #22d3ee;
  --fxn-c-train: #fbbf24;
  --fxn-c-avn: #60a5fa;
  --fxn-c-gen: #94a3b8;
}

/* ---------- Page offset (the header is fixed) --------------------------- */
html { scroll-padding-top: calc(var(--fxn-h) + var(--fxn-float-top) + 14px); }
#wrap { margin-top: var(--fxn-h); }
html.fxn-lock { overflow: hidden; }

/* ---------- Reset inside the header (beats legacy global rules) -------- */
#fxn, #fxn *, #fxn *::before, #fxn *::after { box-sizing: border-box; }
#fxn ul, #fxn ol { list-style: none; margin: 0; padding: 0; }
#fxn p { margin: 0; }
#fxn a, #fxn a:link, #fxn a:visited { color: inherit; text-decoration: none; font-weight: inherit; }
#fxn button {
  appearance: none; -webkit-appearance: none;
  font: inherit; color: inherit; background: transparent; background-image: none;
  border: 0; border-radius: 0; padding: 0; margin: 0; text-shadow: none; text-transform: none;
  box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#fxn button:hover, #fxn button:active { background-image: none; box-shadow: none; }
#fxn img { max-width: none; width: auto; height: auto; border: 0; }
#fxn svg { display: block; }
#fxn .fxn-ic { width: 18px; height: 18px; flex: 0 0 auto; }
#fxn :focus { outline: none; }
#fxn :focus-visible { outline: 2px solid var(--fxn-focus); outline-offset: 2px; border-radius: 8px; }
#fxn .fxn-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Simulator accent per column / link / chip */
#fxn .fxn-c-msfs { --c: var(--fxn-c-msfs); }
#fxn .fxn-c-fsx { --c: var(--fxn-c-fsx); }
#fxn .fxn-c-xp { --c: var(--fxn-c-xp); }
#fxn .fxn-c-p3d { --c: var(--fxn-c-p3d); }
#fxn .fxn-c-charts { --c: var(--fxn-c-charts); }
#fxn .fxn-c-news { --c: var(--fxn-c-news); }
#fxn .fxn-c-fs9 { --c: var(--fxn-c-fs9); }
#fxn .fxn-c-dcs { --c: var(--fxn-c-dcs); }
#fxn .fxn-c-fg { --c: var(--fxn-c-fg); }
#fxn .fxn-c-train { --c: var(--fxn-c-train); }
#fxn .fxn-c-avn { --c: var(--fxn-c-avn); }
#fxn .fxn-c-gen { --c: var(--fxn-c-gen); }

/* Simulator monogram tile */
#fxn .fxn-mono {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-width: 36px; height: 20px; padding: 0 5px; border-radius: 6px;
  font: 900 9.5px/1 var(--fxn-font); letter-spacing: .5px;
  color: var(--c, var(--fxn-fg-2)); background: color-mix(in srgb, var(--c, var(--fxn-fg-3)) 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--fxn-fg-3)) 30%, transparent);
}
#fxn .fxn-mono--img { width: 20px; height: 20px; min-width: 0; padding: 0; border-radius: 5px; box-shadow: none; background: none; }

/* ---------- Skip link --------------------------------------------------- */
.fxn-skip {
  position: fixed; top: 8px; left: 8px; z-index: calc(var(--fxn-z) + 10);
  padding: 10px 14px; border-radius: 10px; background: var(--fxn-fg); color: var(--fxn-surface) !important;
  font: 700 14px/1 var(--fxn-font); transform: translateY(-200%); transition: transform .15s;
}
.fxn-skip:focus { transform: none; outline: 2px solid var(--fxn-focus); }

/* ---------- Header shell ------------------------------------------------ */
#fxn {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--fxn-z);
  height: var(--fxn-h);
  color: var(--fxn-fg);
  font: 500 14px/1.2 var(--fxn-font);
  border: 1px solid transparent; border-bottom-color: var(--fxn-bdr);
  border-radius: 0;
  transition: top .3s var(--fxn-ease), left .3s var(--fxn-ease), right .3s var(--fxn-ease),
              height .3s var(--fxn-ease), border-radius .3s var(--fxn-ease), box-shadow .3s, border-color .3s;
  isolation: isolate;
}
/* Glass lives on a pseudo so the header itself never becomes a containing
   block for the fixed drawer/scrim inside it. */
#fxn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--fxn-bg);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
  transition: background .3s, box-shadow .3s;
}
/* Floating glass pill once the page scrolls */
#fxn.is-scrolled {
  top: var(--fxn-float-top);
  left: var(--fxn-float-inset);
  right: var(--fxn-float-inset);
  border-radius: 999px;
  border-color: var(--fxn-bdr);
  box-shadow: var(--fxn-shadow-float);
}
#fxn.is-scrolled::before {
  background: var(--fxn-bg-float);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: inset 0 1px 0 var(--fxn-hi);
}
#fxn.is-hidden { top: calc(-1 * var(--fxn-h) - 16px); }

#fxn .fxn-shell {
  position: relative; height: 100%; max-width: var(--fxn-max); margin: 0 auto;
  padding: 0 var(--fxn-gutter); display: flex; align-items: center; gap: 6px;
}
#fxn.is-scrolled .fxn-shell { padding: 0 12px 0 22px; }

/* ---------- Brand ------------------------------------------------------- */
#fxn .fxn-brand { display: flex; align-items: center; flex: 0 0 auto; margin-right: 6px; border-radius: 8px; }
#fxn .fxn-logo { height: 32px; width: auto; display: block; filter: var(--fxn-logo-filter); }

/* ---------- Primary nav (desktop inline / mobile drawer) --------------- */
#fxn .fxn-primary { display: none; flex: 1 1 auto; min-width: 0; }
#fxn .fxn-list { display: flex; align-items: center; gap: 2px; }
#fxn .fxn-item { position: relative; }
#fxn .fxn-item--mega { position: static; }

/* Split trigger: link navigates, chevron button discloses */
#fxn .fxn-trigger { display: inline-flex; align-items: stretch; border-radius: 10px; }
#fxn .fxn-top {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px;
  border-radius: 10px; font-weight: 700; font-size: 14px; letter-spacing: .1px;
  white-space: nowrap; position: relative; transition: background .15s;
}
#fxn .fxn-trigger .fxn-top { padding-right: 4px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
#fxn .fxn-disc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 38px; border-radius: 0 10px 10px 0; color: var(--fxn-fg-2);
  transition: background .15s, color .15s;
}
#fxn .fxn-disc .fxn-ic { width: 14px; height: 14px; transition: transform .18s var(--fxn-ease); }
#fxn .fxn-item.is-open > .fxn-trigger .fxn-disc .fxn-ic { transform: rotate(180deg); }
#fxn .fxn-top:hover, #fxn .fxn-disc:hover,
#fxn .fxn-item.is-open > .fxn-trigger .fxn-top, #fxn .fxn-item.is-open > .fxn-trigger .fxn-disc,
#fxn .fxn-trigger:hover .fxn-top, #fxn .fxn-trigger:hover .fxn-disc { background: var(--fxn-hover); color: var(--fxn-fg); }

/* Current-section marker */
#fxn .fxn-top[aria-current]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--fxn-accent);
}
#fxn .fxn-trigger .fxn-top[aria-current]::after { right: 4px; }

/* Ask Fly Away pill */
#fxn .fxn-otto {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 11px; margin-left: 6px;
  border-radius: 999px; font-weight: 800; font-size: 13.5px; letter-spacing: .1px; white-space: nowrap;
  color: #fff !important;
  background: linear-gradient(135deg, var(--fxn-otto-a), var(--fxn-otto-b));
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 6px 16px -6px rgba(2, 132, 199, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .15s var(--fxn-ease), box-shadow .15s, filter .15s;
}
#fxn .fxn-otto:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 22px -8px rgba(2, 132, 199, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
#fxn .fxn-otto .fxn-ic { width: 16px; height: 16px; position: relative; z-index: 1; }
#fxn .fxn-otto span { position: relative; z-index: 1; }
#fxn .fxn-otto::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-18deg); pointer-events: none; animation: fxn-shine 7s ease-in-out infinite;
}
@keyframes fxn-shine { 0%, 14% { left: -70%; } 40%, 100% { left: 140%; } }
#fxn .fxn-otto[aria-current] { box-shadow: 0 0 0 2px var(--fxn-surface), 0 0 0 4px var(--fxn-otto-b); }

/* ---------- Panels (dropdown + mega) ------------------------------------ */
#fxn .fxn-panel {
  position: absolute; top: 100%; left: 0; margin-top: 10px; display: none;
  background: var(--fxn-surface); border: 1px solid var(--fxn-bdr); border-radius: 16px;
  box-shadow: var(--fxn-shadow); padding: 8px; z-index: 3; color: var(--fxn-fg);
}
#fxn .fxn-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 14px; } /* hover bridge */
#fxn .fxn-item.is-open > .fxn-panel { display: block; animation: fxn-in .16s var(--fxn-ease); }
@keyframes fxn-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

#fxn .fxn-panel--menu { min-width: 262px; width: max-content; max-width: calc(100vw - 32px); }
#fxn .fxn-panel--menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--fxn-fg-2); line-height: 1.25;
}
#fxn .fxn-panel--menu a .fxn-ic { width: 18px; height: 18px; color: var(--c, var(--fxn-fg-3)); }
#fxn .fxn-panel--menu a:hover { background: var(--fxn-hover); color: var(--fxn-fg); }
#fxn .fxn-panel--menu a[aria-current] { color: var(--fxn-fg); background: var(--fxn-active); }
#fxn .fxn-panel--menu .fxn-lead { font-weight: 800; color: var(--fxn-fg); }
#fxn .fxn-panel--menu .fxn-lead .fxn-ic { color: var(--c, var(--fxn-fg)); }
#fxn .fxn-hr { height: 1px; background: var(--fxn-bdr); margin: 6px 4px; }
#fxn .fxn-sub { padding: 6px 10px 2px; font: 800 11px/1 var(--fxn-font); color: var(--fxn-fg-3); text-transform: uppercase; letter-spacing: .8px; }
#fxn .fxn-note { padding: 0 10px 6px; font-size: 12.5px; color: var(--fxn-fg-3); }

/* Mega (spans the shell) */
#fxn .fxn-panel--mega { left: var(--fxn-gutter); right: var(--fxn-gutter); padding: 14px; }
#fxn.is-scrolled .fxn-panel--mega { left: 8px; right: 8px; }
#fxn .fxn-panel--wide { width: max-content; max-width: calc(100vw - 32px); padding: 12px; }
#fxn .fxn-mega { display: grid; gap: 6px 14px; }
#fxn .fxn-mega--mods { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(250px, 290px); }
#fxn .fxn-mega--answers { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(250px, 290px); }
#fxn .fxn-col { min-width: 0; }
#fxn .fxn-col__h {
  display: flex; align-items: center; gap: 9px; white-space: nowrap; min-width: 0; padding: 6px 8px; border-radius: 10px;
  font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--fxn-fg);
}
#fxn .fxn-col__ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
#fxn .fxn-col__ico .fxn-ic { width: 16px; height: 16px; }
#fxn .fxn-col__arrow { width: 14px; height: 14px; opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s var(--fxn-ease); color: var(--c); }
#fxn .fxn-col__h:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
#fxn .fxn-col__h:hover .fxn-col__arrow { opacity: 1; transform: none; }
#fxn .fxn-col__h .fxn-mono { min-width: 40px; height: 24px; font-size: 10.5px; border-radius: 7px; }
#fxn .fxn-col li a .fxn-mono { min-width: 34px; height: 19px; }
#fxn .fxn-col ul { margin-top: 4px; }
#fxn .fxn-col li a {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--fxn-fg-2); line-height: 1.25;
}
#fxn .fxn-col li a .fxn-ic { width: 16px; height: 16px; color: var(--fxn-fg-3); opacity: .75; transition: color .15s, opacity .15s; }
#fxn .fxn-col li a:hover { background: var(--fxn-hover); color: var(--fxn-fg); }
#fxn .fxn-col li a:hover .fxn-ic { color: var(--c); opacity: 1; }
#fxn .fxn-col li a[aria-current] { color: var(--fxn-fg); font-weight: 700; background: color-mix(in srgb, var(--c) 12%, transparent); }
#fxn .fxn-col li a[aria-current] .fxn-ic { color: var(--c); opacity: 1; }

/* Chips (search panel) */
#fxn .fxn-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 7px; border-radius: 999px;
  border: 1px solid var(--fxn-bdr); background: var(--fxn-surface-2); font-size: 12.5px; font-weight: 700; color: var(--fxn-fg-2);
  transition: border-color .15s, color .15s, background .15s;
}
#fxn .fxn-chip .fxn-mono { min-width: 32px; height: 18px; font-size: 9px; }
#fxn .fxn-chip:hover { border-color: var(--fxn-bdr-strong); color: var(--fxn-fg); }

/* Feature cards (right column of the Mods mega, and the Answers panel) */
#fxn .fxn-feat { display: flex; flex-direction: column; gap: 8px; padding-left: 14px; border-left: 1px solid var(--fxn-bdr); }
#fxn .fxn-card {
  --cc: var(--fxn-fg-3);
  display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 14px;
  background: var(--fxn-surface-2); border: 1px solid var(--fxn-bdr);
  transition: transform .15s var(--fxn-ease), border-color .15s, box-shadow .15s;
}
#fxn .fxn-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--cc) 45%, var(--fxn-bdr)); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--cc) 60%, transparent); }
#fxn .fxn-card__ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 26%, transparent);
}
#fxn .fxn-card__ico .fxn-ic { width: 20px; height: 20px; }
#fxn .fxn-card > span:last-child { min-width: 0; }
#fxn .fxn-card b { display: block; font-size: 13.5px; font-weight: 800; color: var(--fxn-fg); }
#fxn .fxn-card small { display: block; font-size: 12px; color: var(--fxn-fg-3); margin-top: 2px; line-height: 1.35; }
#fxn .fxn-card em { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--cc); }
#fxn .fxn-card em .fxn-ic { width: 13px; height: 13px; transition: transform .15s var(--fxn-ease); }
#fxn .fxn-card:hover em .fxn-ic { transform: translateX(3px); }
#fxn .fxn-card--lib { --cc: var(--fxn-c-msfs); }
#fxn .fxn-card--creators { --cc: var(--fxn-c-creators); }
#fxn .fxn-card--answers { --cc: var(--fxn-c-news); }
#fxn .fxn-card--otto { --cc: var(--fxn-otto-b); }
#fxn .fxn-card--tall { align-items: flex-start; padding: 14px; }
#fxn .fxn-card--tall .fxn-card__ico { width: 42px; height: 42px; flex-basis: 42px; }
#fxn .fxn-card--tall b { font-size: 14.5px; }
#fxn .fxn-card--tall small { font-size: 12.5px; margin-top: 4px; }

/* PRO card: dark slab, gold accents — the wings logo sits on a dark tile so
   it never fights a yellow background */
#fxn .fxn-card--pro {
  --cc: #b8860b;
  background: linear-gradient(135deg, #fff9e3, #fff3c4);
  border-color: rgba(184, 134, 11, .35);
  box-shadow: 0 10px 26px -14px rgba(255, 201, 20, .5), inset 0 1px 0 rgba(255, 255, 255, .8);
}
#fxn .fxn-card--pro:hover { border-color: #d4a017; box-shadow: 0 14px 30px -14px rgba(255, 201, 20, .7), inset 0 1px 0 rgba(255, 255, 255, .8); }
#fxn .fxn-card--pro .fxn-card__ico { background: #0b0f16; box-shadow: inset 0 0 0 1px rgba(255, 201, 20, .45), 0 0 0 4px rgba(255, 201, 20, .14); }
#fxn .fxn-card--pro .fxn-card__ico img { width: 26px; height: 26px; display: block; }
#fxn .fxn-card--pro b { color: #1a1508; }
#fxn .fxn-card--pro small { color: #5c4a12; }
#fxn .fxn-card--pro em { color: #8a6508; }
html[data-theme="dark"] #fxn .fxn-card--pro {
  --cc: var(--fxn-accent);
  background: linear-gradient(135deg, #141a26, #0b0f16);
  border-color: color-mix(in srgb, var(--fxn-accent) 45%, transparent);
  box-shadow: 0 10px 26px -14px rgba(255, 201, 20, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="dark"] #fxn .fxn-card--pro:hover { border-color: var(--fxn-accent); }
html[data-theme="dark"] #fxn .fxn-card--pro .fxn-card__ico { background: #05070b; box-shadow: inset 0 0 0 1px rgba(255, 201, 20, .35), 0 0 0 4px rgba(255, 201, 20, .08); }
html[data-theme="dark"] #fxn .fxn-card--pro b { color: #fff; }
html[data-theme="dark"] #fxn .fxn-card--pro small { color: #b7c0d0; }
html[data-theme="dark"] #fxn .fxn-card--pro em { color: var(--fxn-accent); }

/* ---------- Right cluster ----------------------------------------------- */
#fxn .fxn-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; position: relative; z-index: 2; }
#fxn .fxn-brand { position: relative; z-index: 2; }
#fxn .fxn-ibtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: var(--fxn-fg); transition: background .15s;
}
#fxn .fxn-ibtn:hover, #fxn .fxn-ibtn[aria-expanded="true"] { background: var(--fxn-hover); }
#fxn .fxn-ibtn .fxn-ic { width: 20px; height: 20px; }

/* Search trigger: a real-looking field on wide screens (CRO — visible search
   out-performs a hidden icon), an icon button on narrower ones */
#fxn .fxn-search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; width: 38px; border-radius: 10px;
  justify-content: center; color: var(--fxn-fg); transition: background .15s, border-color .15s, width .2s var(--fxn-ease);
}
#fxn .fxn-search-btn .fxn-ic { width: 20px; height: 20px; flex: 0 0 auto; }
#fxn .fxn-search-btn__txt { display: none; }
#fxn .fxn-search-btn:hover, #fxn .fxn-search-btn[aria-expanded="true"] { background: var(--fxn-hover); }
@media (min-width: 1200px) {
  #fxn .fxn-search-btn {
    width: 236px; justify-content: flex-start; padding: 0 12px; margin-right: 4px; border-radius: 999px;
    border: 1px solid var(--fxn-bdr-strong); background: var(--fxn-surface-2); color: var(--fxn-fg-3);
    font-weight: 600; font-size: 13.5px;
  }
  #fxn .fxn-search-btn .fxn-ic { width: 18px; height: 18px; }
  #fxn .fxn-search-btn__txt { display: inline; white-space: nowrap; }
  #fxn .fxn-search-btn:hover { background: var(--fxn-surface); border-color: var(--fxn-fg-3); color: var(--fxn-fg-2); }
  #fxn .fxn-search-btn[aria-expanded="true"] { background: var(--fxn-surface); border-color: var(--fxn-focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
  #fxn.is-scrolled .fxn-search-btn { width: 210px; }
}

/* Theme control */
#fxn .fxn-theme { position: relative; }
#fxn .fxn-theme .fxn-i-sun, #fxn .fxn-theme .fxn-i-moon { position: absolute; transition: opacity .22s, transform .35s var(--fxn-ease); }
html[data-theme="dark"] #fxn .fxn-theme .fxn-i-sun { opacity: 0; transform: rotate(90deg) scale(.6); }
html[data-theme="dark"] #fxn .fxn-theme .fxn-i-moon { opacity: 1; transform: none; }
html:not([data-theme="dark"]) #fxn .fxn-theme .fxn-i-sun { opacity: 1; transform: none; }
html:not([data-theme="dark"]) #fxn .fxn-theme .fxn-i-moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
#fxn .fxn-theme .fxn-panel { left: auto; right: 0; min-width: 236px; }
#fxn .fxn-theme.is-open > .fxn-panel { display: block; animation: fxn-in .16s var(--fxn-ease); }
#fxn .fxn-radio { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
#fxn .fxn-radio:hover { background: var(--fxn-hover); }
#fxn .fxn-radio input { position: absolute; opacity: 0; pointer-events: none; }
#fxn .fxn-radio > .fxn-ic { color: var(--fxn-fg-2); }
#fxn .fxn-radio b { display: block; font-size: 13.5px; font-weight: 700; }
#fxn .fxn-radio small { display: block; font-size: 11.5px; color: var(--fxn-fg-3); margin-top: 1px; }
#fxn .fxn-radio .fxn-chk { margin-left: auto; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--fxn-bdr-strong); display: grid; place-items: center; color: var(--fxn-surface); }
#fxn .fxn-radio .fxn-chk .fxn-ic { width: 10px; height: 10px; opacity: 0; }
#fxn .fxn-radio input:checked ~ .fxn-chk { background: var(--fxn-fg); border-color: transparent; }
#fxn .fxn-radio input:checked ~ .fxn-chk .fxn-ic { opacity: 1; }
#fxn .fxn-radio input:focus-visible ~ .fxn-chk { outline: 2px solid var(--fxn-focus); outline-offset: 2px; }

/* Account */
#fxn .fxn-acct { position: relative; }
#fxn .fxn-avatar-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; position: relative; }
#fxn .fxn-avatar-btn:hover, #fxn .fxn-avatar-btn[aria-expanded="true"] { background: var(--fxn-hover); }
#fxn .fxn-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--fxn-bdr-strong); }
#fxn .fxn-acct--pro .fxn-avatar { box-shadow: 0 0 0 2px var(--fxn-accent); border-color: transparent; }
#fxn .fxn-acct--pro .fxn-avatar-btn::after {
  content: "PRO"; position: absolute; right: -2px; bottom: -3px; padding: 1px 4px; border-radius: 5px;
  background: var(--fxn-accent); color: var(--fxn-accent-ink); font: 900 8.5px/1.2 var(--fxn-font); letter-spacing: .3px;
}
#fxn .fxn-acct .fxn-panel { left: auto; right: 0; min-width: 244px; }
#fxn .fxn-acct.is-open > .fxn-panel { display: block; animation: fxn-in .16s var(--fxn-ease); }
#fxn .fxn-acct__who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
#fxn .fxn-acct__who img { width: 36px; height: 36px; border-radius: 50%; }
#fxn .fxn-acct__who b { display: block; font-size: 14px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fxn .fxn-acct__who small { display: block; font-size: 12px; color: var(--fxn-fg-3); }
#fxn .fxn-acct__who small.is-pro { color: #b8860b; font-weight: 800; }
html[data-theme="dark"] #fxn .fxn-acct__who small.is-pro { color: var(--fxn-accent); }
#fxn .fxn-panel--menu a.fxn-upgrade { background: linear-gradient(135deg, var(--fxn-accent-2), var(--fxn-accent)); color: var(--fxn-accent-ink); font-weight: 800; }
#fxn .fxn-panel--menu a.fxn-upgrade:hover { filter: brightness(1.03); color: var(--fxn-accent-ink); }
#fxn .fxn-panel--menu a.fxn-upgrade img { width: 18px; height: 18px; }

/* Go PRO CTA */
#fxn .fxn-pro {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 9px; margin-left: 4px;
  border-radius: 999px; white-space: nowrap; font-weight: 900; font-size: 13.5px; letter-spacing: .1px;
  color: var(--fxn-accent-ink) !important;
  background: linear-gradient(180deg, var(--fxn-accent-2), var(--fxn-accent));
  box-shadow: 0 8px 18px -8px rgba(255, 201, 20, .75), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .06);
  position: relative; transition: transform .15s var(--fxn-ease), filter .15s, box-shadow .15s;
}
#fxn .fxn-pro:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 12px 24px -8px rgba(255, 201, 20, .85), inset 0 1px 0 rgba(255, 255, 255, .55); }
#fxn .fxn-pro:active { transform: none; }
#fxn .fxn-pro img { width: 24px; height: 24px; display: block; }
#fxn .fxn-pro.is-ping::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; pointer-events: none; animation: fxn-ping 1.8s ease-out .6s 1 forwards; }
@keyframes fxn-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 20, .55); } 100% { box-shadow: 0 0 0 22px rgba(255, 201, 20, 0); } }

/* Burger */
#fxn .fxn-burger { display: none; }
#fxn .fxn-burger span, #fxn .fxn-burger span::before, #fxn .fxn-burger span::after {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; position: relative; transition: transform .2s var(--fxn-ease), opacity .2s;
}
#fxn .fxn-burger span::before, #fxn .fxn-burger span::after { content: ""; position: absolute; left: 0; }
#fxn .fxn-burger span::before { top: -6px; }
#fxn .fxn-burger span::after { top: 6px; }

/* ---------- Mod search panel ------------------------------------------ */
#fxn .fxn-search {
  position: absolute; top: 100%; left: var(--fxn-gutter); right: var(--fxn-gutter); margin-top: 10px; display: none;
  background: var(--fxn-surface); border: 1px solid var(--fxn-bdr); border-radius: 18px; box-shadow: var(--fxn-shadow); padding: 14px; z-index: 4;
}
#fxn.is-scrolled .fxn-search { left: 8px; right: 8px; }
#fxn.is-search .fxn-search { display: block; animation: fxn-in .16s var(--fxn-ease); }
#fxn .fxn-search form { display: flex; gap: 8px; align-items: stretch; margin: 0; }
#fxn .fxn-search__field { position: relative; flex: 1 1 auto; min-width: 0; }
#fxn .fxn-search__field > .fxn-ic { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--fxn-fg-3); pointer-events: none; }
#fxn .fxn-search input[type="search"] {
  width: 100%; height: 52px; padding: 0 44px 0 46px; border-radius: 13px; margin: 0;
  border: 1px solid var(--fxn-bdr-strong); background: var(--fxn-surface-2); color: var(--fxn-fg);
  font: 500 17px/1 var(--fxn-font); text-shadow: none; box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
}
#fxn .fxn-search input[type="search"]::placeholder { color: var(--fxn-fg-3); }
#fxn .fxn-search input[type="search"]:focus { border-color: var(--fxn-focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .22); }
#fxn .fxn-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
#fxn .fxn-search__clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; display: none; align-items: center; justify-content: center; color: var(--fxn-fg-3); }
#fxn .fxn-search__clear .fxn-ic { width: 16px; height: 16px; }
#fxn .fxn-search.has-value .fxn-search__clear { display: inline-flex; }
#fxn .fxn-search__clear:hover { background: var(--fxn-hover); color: var(--fxn-fg); }
#fxn .fxn-search__go {
  flex: 0 0 auto; height: 52px; padding: 0 20px; border-radius: 13px; font-weight: 800; font-size: 15px;
  background: var(--fxn-fg); color: var(--fxn-surface); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
#fxn .fxn-search__go .fxn-ic { width: 20px; height: 20px; }
#fxn .fxn-search__go:hover { filter: brightness(1.15); }
#fxn .fxn-search__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
#fxn .fxn-search__foot .fxn-sub { padding: 0 2px; }
#fxn .fxn-search__otto { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--fxn-fg-2); padding: 6px 10px; border-radius: 10px; }
#fxn .fxn-search__otto:hover { background: var(--fxn-hover); color: var(--fxn-fg); }
#fxn .fxn-search__otto .fxn-ic { width: 16px; height: 16px; color: var(--fxn-otto-b); }

/* ---------- Scrim -------------------------------------------------------- */
#fxn .fxn-scrim {
  position: fixed; inset: 0; z-index: 1; background: var(--fxn-scrim);
  opacity: 0; visibility: hidden; transition: opacity .22s, visibility 0s linear .22s; pointer-events: none;
}
#fxn.is-drawer .fxn-scrim, #fxn.is-search .fxn-scrim { opacity: 1; visibility: visible; transition-delay: 0s; pointer-events: auto; }
#fxn.is-search .fxn-scrim { z-index: 0; }
#fxn.is-drawer .fxn-brand, #fxn.is-drawer .fxn-right { z-index: 0; }

/* Drawer-only chrome (hidden on desktop) */
#fxn .fxn-drawer__head, #fxn .fxn-drawer__foot, #fxn .fxn-drawer__sec { display: none; }

/* ---------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #fxn, #fxn *, #fxn *::before, #fxn *::after { animation: none !important; transition: none !important; }
}

/* =========================================================================
   DESKTOP  (>= 1024px)
   ========================================================================= */
@media (min-width: 1024px) {
  #fxn .fxn-primary { display: flex; align-items: center; }
  #fxn .fxn-burger { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  #fxn .fxn-top { padding: 0 9px; font-size: 13.5px; }
  #fxn .fxn-otto { padding: 0 12px 0 10px; }
  #fxn .fxn-mega--mods { grid-template-columns: repeat(4, minmax(0, 1fr)) 230px; }
  #fxn .fxn-col li a { font-size: 13px; padding: 5px 8px; }
}

/* =========================================================================
   MOBILE / TABLET  (< 1024px) — primary nav becomes a right-hand drawer;
   the bar floats as a rounded glass card once scrolled.
   ========================================================================= */
@media (max-width: 1023px) {
  #fxn.is-scrolled { left: 8px; right: 8px; top: 8px; border-radius: 18px; }
  #fxn.is-scrolled .fxn-shell { padding: 0 6px 0 12px; }
  #fxn .fxn-logo { height: 30px; }
  #fxn .fxn-burger { display: inline-flex; }
  #fxn.is-drawer .fxn-burger span { background: transparent; }
  #fxn.is-drawer .fxn-burger span::before { transform: translateY(6px) rotate(45deg); }
  #fxn.is-drawer .fxn-burger span::after { transform: translateY(-6px) rotate(-45deg); }
  #fxn .fxn-right > .fxn-theme, #fxn .fxn-right > .fxn-acct, #fxn .fxn-right > .fxn-login { display: none; }

  #fxn .fxn-primary {
    display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; z-index: 2;
    width: min(400px, 88vw); background: var(--fxn-surface); color: var(--fxn-fg);
    box-shadow: var(--fxn-shadow); border-left: 1px solid var(--fxn-bdr);
    transform: translateX(104%); visibility: hidden;
    transition: transform .28s var(--fxn-ease), visibility 0s linear .28s;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #fxn.is-drawer .fxn-primary { transform: none; visibility: visible; transition-delay: 0s; }

  #fxn .fxn-drawer__head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    height: var(--fxn-h); padding: 0 8px 0 16px; border-bottom: 1px solid var(--fxn-bdr); flex: 0 0 auto;
  }
  #fxn .fxn-drawer__head .fxn-logo { height: 26px; }
  #fxn .fxn-drawer__sec { display: block; padding: 14px 16px 6px; font: 800 11px/1 var(--fxn-font); color: var(--fxn-fg-3); text-transform: uppercase; letter-spacing: .9px; }
  #fxn .fxn-drawer__sec--flush { padding-left: 0; }

  #fxn .fxn-list { display: block; padding: 6px 8px; }
  #fxn .fxn-item, #fxn .fxn-item--mega { position: static; }
  #fxn .fxn-trigger { display: flex; width: 100%; }
  #fxn .fxn-top { display: flex; width: 100%; height: 48px; padding: 0 12px; font-size: 16px; border-radius: 10px; }
  #fxn .fxn-trigger .fxn-top { flex: 1 1 auto; border-radius: 10px 0 0 10px; }
  #fxn .fxn-disc { width: 52px; height: 48px; border-radius: 0 10px 10px 0; }
  #fxn .fxn-disc .fxn-ic { width: 18px; height: 18px; }
  #fxn .fxn-top[aria-current]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; border-radius: 3px; }
  #fxn .fxn-otto { margin: 8px 12px 4px; height: 44px; justify-content: center; font-size: 15px; border-radius: 12px; }
  #fxn .fxn-otto::after { display: none; }

  /* Panels become inline accordions */
  #fxn .fxn-panel, #fxn .fxn-panel--mega, #fxn .fxn-panel--wide, #fxn .fxn-panel--menu {
    position: static; margin: 0 0 6px; padding: 2px 4px 8px 12px; width: auto; max-width: none; min-width: 0;
    border: 0; box-shadow: none; background: transparent; animation: none !important;
  }
  #fxn .fxn-panel::before { display: none; }
  #fxn .fxn-mega, #fxn .fxn-mega--mods, #fxn .fxn-mega--answers { display: block; }
  #fxn .fxn-col { margin-bottom: 6px; }
  #fxn .fxn-col__h { padding: 8px 8px; font-size: 12px; }
  #fxn .fxn-col__arrow { opacity: .7; transform: none; }
  #fxn .fxn-col ul { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px 4px; }
  #fxn .fxn-col li a { padding: 6px 11px 6px 9px; font-size: 13.5px; border: 1px solid var(--fxn-bdr); border-radius: 999px; background: var(--fxn-surface-2); gap: 6px; }
  #fxn .fxn-col li a .fxn-ic { width: 14px; height: 14px; }
  #fxn .fxn-feat { padding: 4px 4px 0; border-left: 0; }
  #fxn .fxn-mega--answers .fxn-card { margin-bottom: 8px; }
  #fxn .fxn-panel--menu a { font-size: 15px; padding: 11px 10px; }

  /* Drawer footer: account + theme */
  #fxn .fxn-drawer__foot { display: block; margin-top: auto; padding: 8px 16px 16px; border-top: 1px solid var(--fxn-bdr); }
  #fxn .fxn-drawer__acct { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
  #fxn .fxn-drawer__acct img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--fxn-bdr-strong); }
  #fxn .fxn-drawer__acct.is-pro img { box-shadow: 0 0 0 2px var(--fxn-accent); border-color: transparent; }
  #fxn .fxn-drawer__acct b { display: block; font-size: 15px; }
  #fxn .fxn-drawer__acct small { display: block; font-size: 12.5px; color: var(--fxn-fg-3); }
  #fxn .fxn-drawer__acct small.is-pro { color: var(--fxn-accent); font-weight: 800; }
  html:not([data-theme="dark"]) #fxn .fxn-drawer__acct small.is-pro { color: #b8860b; }
  #fxn .fxn-btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 0 10px; }
  #fxn .fxn-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px;
    font-weight: 800; font-size: 15px; border: 1px solid var(--fxn-bdr-strong); color: var(--fxn-fg);
  }
  #fxn .fxn-btn:hover { background: var(--fxn-hover); }
  #fxn .fxn-btn--full { width: 100%; }
  #fxn .fxn-btn--pro { background: linear-gradient(180deg, var(--fxn-accent-2), var(--fxn-accent)); color: var(--fxn-accent-ink) !important; border-color: transparent; }
  #fxn .fxn-btn--pro img { width: 22px; height: 22px; }
  #fxn .fxn-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--fxn-surface-2); border: 1px solid var(--fxn-bdr); margin-top: 6px; }
  #fxn .fxn-seg label { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--fxn-fg-2); cursor: pointer; }
  #fxn .fxn-seg label .fxn-ic { width: 16px; height: 16px; position: relative; z-index: 1; }
  #fxn .fxn-seg input { position: absolute; opacity: 0; pointer-events: none; }
  #fxn .fxn-seg input:checked ~ span { position: absolute; inset: 0; border-radius: 9px; background: var(--fxn-surface); box-shadow: 0 1px 3px rgba(0,0,0,.18); z-index: 0; }
  #fxn .fxn-seg label b { position: relative; z-index: 1; font-weight: inherit; }
  #fxn .fxn-seg input:checked ~ b, #fxn .fxn-seg input:checked ~ .fxn-ic { color: var(--fxn-fg); }
  #fxn .fxn-seg input:focus-visible ~ span { outline: 2px solid var(--fxn-focus); }

  /* Search panel on small screens */
  #fxn .fxn-search { left: 8px; right: 8px; padding: 10px; border-radius: 16px; }
  #fxn.is-scrolled .fxn-search { left: 0; right: 0; }
  #fxn .fxn-search input[type="search"] { height: 48px; font-size: 16px; padding-left: 42px; }
  #fxn .fxn-search__field > .fxn-ic { left: 14px; }
  #fxn .fxn-search__go { height: 48px; padding: 0 14px; }
  #fxn .fxn-search__go span { display: none; }
  #fxn .fxn-search__otto { margin-left: 0; width: 100%; }
}
@media (max-width: 420px) {
  #fxn .fxn-shell { padding: 0 10px; gap: 2px; }
  #fxn .fxn-logo { height: 26px; }
  #fxn .fxn-pro { padding: 0 11px 0 8px; height: 34px; font-size: 13px; gap: 5px; }
  #fxn .fxn-pro img { width: 22px; height: 22px; }
}
@media (max-width: 350px) {
  #fxn .fxn-pro span { display: none; }
  #fxn .fxn-pro { padding: 0 7px; }
}