:root {
  --ax-night: #090817;
  --ax-ink: #f9f7ff;
  --ax-muted: #bcb7d4;
  --ax-line: rgba(255, 255, 255, .14);
  --ax-violet: #9a7bff;
  --ax-cyan: #65e5ff;
  --ax-pink: #ff75ba;
  --ax-gold: #ffd37a;
}

.ax-launcher {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 2147482000;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(27, 21, 60, .96), rgba(74, 38, 115, .96));
  box-shadow: 0 14px 42px rgba(8, 3, 30, .4), inset 0 1px rgba(255, 255, 255, .2);
  font: 800 14px/1.1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .03em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ax-launcher::before {
  content: "◌";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ax-cyan);
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 18px rgba(101, 229, 255, .48);
  font-size: 19px;
}

.ax-launcher:hover { transform: translateY(-2px); }
.ax-launcher:focus-visible,
.ax-shell button:focus-visible,
.ax-shell select:focus-visible,
.ax-shell textarea:focus-visible {
  outline: 3px solid var(--ax-cyan);
  outline-offset: 3px;
}

.ax-shell {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  color: var(--ax-ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(105, 72, 187, .35), transparent 32%),
    radial-gradient(circle at 90% 85%, rgba(31, 164, 182, .2), transparent 34%),
    linear-gradient(145deg, #090817, #12102b 52%, #080f1f);
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
}

.ax-shell[data-open="true"] { display: grid; grid-template-rows: auto 1fr; }
.ax-shell * { box-sizing: border-box; }
.ax-shell button, .ax-shell select, .ax-shell textarea { font: inherit; }

.ax-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: max(13px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--ax-line);
  background: rgba(9, 8, 23, .82);
  backdrop-filter: blur(20px);
}

.ax-wordmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ax-wordmark-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: conic-gradient(from 40deg, #805cff, #64e3ff, #ff73b7, #805cff);
  box-shadow: 0 0 25px rgba(128, 92, 255, .38);
  color: #080716;
  font-weight: 950;
}
.ax-wordmark small { display: block; color: var(--ax-muted); font-size: .72rem; letter-spacing: .14em; }
.ax-wordmark strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(1rem, 2.5vw, 1.35rem); }
.ax-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ax-line);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font-size: 1.5rem !important;
}

.ax-stage {
  min-height: 0;
  overflow: auto;
  padding: 16px max(18px, env(safe-area-inset-right)) max(28px, calc(env(safe-area-inset-bottom) + 18px)) max(18px, env(safe-area-inset-left));
}
.ax-layout { width: min(1260px, 100%); margin: 0 auto; }
.ax-intro { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 3px 0 14px; }
.ax-intro h2 { margin: 0; font: 760 clamp(1.65rem, 5vw, 3.3rem)/1.02 ui-serif, Georgia, serif; letter-spacing: -.03em; }
.ax-intro p { max-width: 560px; margin: 0; color: var(--ax-muted); }

.ax-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px 1px 13px;
  scrollbar-width: thin;
}
.ax-tab {
  flex: 0 0 auto;
  border: 1px solid var(--ax-line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ax-muted);
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
  font-weight: 750;
}
.ax-tab[aria-selected="true"] { color: #0a0917; background: linear-gradient(135deg, var(--ax-cyan), #d0b8ff); border-color: transparent; }
.ax-view { display: none; }
.ax-view[data-active="true"] { display: block; animation: ax-in .35s ease both; }
@keyframes ax-in { from { opacity: 0; transform: translateY(9px); } }

.ax-card {
  border: 1px solid var(--ax-line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
  box-shadow: 0 22px 55px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
}
.ax-map-layout { display: grid; grid-template-columns: minmax(360px, 1.35fr) minmax(280px, .65fr); gap: 14px; }
.ax-map-card { position: relative; min-height: min(66vh, 690px); overflow: hidden; }
.ax-map-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(7, 7, 20, .7); }
#ax-map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ax-nodes { position: absolute; inset: 38px; }
.ax-node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(26px, 3.2vw, 39px);
  height: clamp(26px, 3.2vw, 39px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  color: var(--node-ink, #fff);
  background: var(--node-color, #805cff);
  box-shadow: 0 0 18px color-mix(in srgb, var(--node-color, #805cff) 68%, transparent);
  cursor: pointer;
  font-weight: 850;
  font-size: clamp(.62rem, 1.5vw, .78rem);
  transition: transform .2s ease, filter .2s ease;
}
.ax-node:hover { transform: translate(-50%, -50%) scale(1.2); filter: brightness(1.25); }
.ax-node[aria-current="true"] { transform: translate(-50%, -50%) scale(1.25); outline: 3px solid #fff; outline-offset: 4px; }
.ax-node[data-visited="true"]::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.ax-map-legend { position: absolute; left: 14px; bottom: 12px; z-index: 4; display: flex; flex-wrap: wrap; gap: 5px; max-width: calc(100% - 28px); pointer-events: none; }
.ax-map-legend span { padding: 4px 8px; border-radius: 999px; color: #e9e5f7; background: rgba(7, 7, 20, .72); font-size: .72rem; }

.ax-side { display: grid; gap: 12px; align-content: start; }
.ax-detail { padding: 19px; }
.ax-kicker { margin: 0 0 5px; color: var(--ax-cyan); font-weight: 850; font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; }
.ax-detail h3 { margin: 0; font: 740 clamp(1.45rem, 3vw, 2.15rem)/1.08 ui-serif, Georgia, serif; }
.ax-detail p { color: var(--ax-muted); }
.ax-signature { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 16px 0; }
.ax-signature div { padding: 9px 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); text-align: center; }
.ax-signature b { display: block; font-size: 1.1rem; }
.ax-signature small { color: var(--ax-muted); font-size: .66rem; text-transform: uppercase; }
.ax-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-action {
  min-height: 44px;
  border: 1px solid var(--ax-line);
  border-radius: 14px;
  padding: 9px 13px;
  color: #fff;
  background: rgba(255, 255, 255, .075);
  cursor: pointer;
  font-weight: 780;
}
.ax-action--primary { color: #090817; border-color: transparent; background: linear-gradient(135deg, var(--ax-gold), var(--ax-pink)); }
.ax-found { padding: 19px; text-align: center; }
.ax-found-orbit { position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto 13px; }
.ax-found-orbit::before, .ax-found-orbit::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; animation: ax-orbit 7s linear infinite; }
.ax-found-orbit::after { inset: 23px; border-color: rgba(101, 229, 255, .48); animation-direction: reverse; animation-duration: 4s; }
.ax-found-orbit b { font: 700 2rem ui-serif, Georgia, serif; }
@keyframes ax-orbit { to { transform: rotate(360deg); } }

.ax-reperto-grid, .ax-compare-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr); gap: 14px; }
.ax-reperto-card, .ax-note-card, .ax-compare-card, .ax-spectrum-card { padding: clamp(17px, 3vw, 27px); }
.ax-miniature { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 22px; background: #16122d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.ax-miniature canvas { width: 100%; height: 100%; display: block; }
.ax-miniature-label { position: absolute; inset: auto 17px 16px; color: #fff; text-shadow: 0 2px 12px #000; }
.ax-miniature-label small { display: block; opacity: .72; letter-spacing: .14em; }
.ax-miniature-label strong { font: 730 1.45rem ui-serif, Georgia, serif; }
.ax-note-card label, .ax-compare-card label { display: block; margin: 0 0 7px; color: var(--ax-muted); font-size: .82rem; font-weight: 760; }
.ax-note-card textarea, .ax-compare-card select {
  width: 100%;
  border: 1px solid var(--ax-line);
  border-radius: 15px;
  color: #fff;
  background: rgba(6, 6, 18, .58);
}
.ax-note-card textarea { min-height: 170px; resize: vertical; padding: 13px; line-height: 1.55; }
.ax-compare-card select { min-height: 46px; padding: 9px 12px; }
.ax-local-note { color: var(--ax-muted); font-size: .78rem; }
.ax-compare-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ax-versus { display: grid; gap: 10px; margin-top: 20px; }
.ax-metric { display: grid; grid-template-columns: 95px 1fr 1fr; gap: 8px; align-items: center; }
.ax-metric > span { color: var(--ax-muted); font-size: .78rem; }
.ax-meter { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.ax-meter i { display: block; width: var(--meter, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ax-violet), var(--ax-cyan)); transition: width .45s ease; }
.ax-meter--b i { background: linear-gradient(90deg, var(--ax-pink), var(--ax-gold)); }
.ax-bridge { margin-top: 18px; padding: 15px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; color: #eae6fb; background: rgba(255,255,255,.045); }

.ax-spectrum-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.ax-spectrum-card { min-height: 480px; padding: 0; overflow: hidden; position: relative; }
#ax-spectrum { width: 100%; height: 100%; min-height: 480px; display: block; background: #060614; }
.ax-spectrum-caption { position: absolute; inset: auto 18px 16px; max-width: 620px; color: #fff; pointer-events: none; text-shadow: 0 2px 13px #000; }
.ax-spectrum-caption b { display: block; font: 730 clamp(1.2rem, 3vw, 2rem) ui-serif, Georgia, serif; }
.ax-audio-console { padding: 20px; }
.ax-audio-light { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--ax-muted); font-size: .78rem; }
.ax-audio-light::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ffd37a; box-shadow: 0 0 10px #ffd37a; }
.ax-audio-light[data-state="active"]::before { background: #66ffc2; box-shadow: 0 0 10px #66ffc2; }
.ax-audio-light[data-state="visual"]::before { background: #9a7bff; box-shadow: 0 0 10px #9a7bff; }
.ax-volume { width: 100%; accent-color: var(--ax-cyan); }
.ax-fallback { margin-top: 15px; padding: 11px; border-radius: 14px; color: var(--ax-muted); background: rgba(255,255,255,.055); font-size: .8rem; }

.ax-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body.ax-lock { overflow: hidden !important; }

@media (max-width: 880px) {
  .ax-intro { display: block; }
  .ax-intro p { margin-top: 8px; }
  .ax-map-layout, .ax-reperto-grid, .ax-compare-grid, .ax-spectrum-layout { grid-template-columns: 1fr; }
  .ax-map-card { min-height: min(72vw, 560px); }
  .ax-side { grid-template-columns: 1fr 1fr; }
  .ax-spectrum-card, #ax-spectrum { min-height: 390px; }
}

@media (max-width: 560px) {
  .ax-launcher { right: max(10px,env(safe-area-inset-right,0px)); bottom:calc(116px + env(safe-area-inset-bottom,0px)); padding: 9px 12px; }
  .ax-launcher span { display: none; }
  .ax-topbar { padding-inline: 12px; }
  .ax-stage { padding-inline: 10px; }
  .ax-side { grid-template-columns: 1fr; }
  .ax-map-card { min-height: 76dvh; }
  .ax-nodes { inset: 24px 18px 58px; }
  .ax-signature { grid-template-columns: repeat(2, 1fr); }
  .ax-compare-pickers { grid-template-columns: 1fr; }
  .ax-metric { grid-template-columns: 76px 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ax-shell *, .ax-shell *::before, .ax-shell *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .ax-launcher:hover { transform: none; }
}
