/* Aureality floating sidebar, top-bar menus and the sites strip: shared by the globe (aureality.cloud), the maps and the app's 3D space.
   Colours come from the site's tokens when present, with the brand values as fallbacks. */
.au-sb, .au-tb {
  --sb-bg: var(--panel, #151920); --sb-alt: var(--alt, #0E1116); --sb-line: var(--line, #262C36);
  --sb-text: var(--text, #F5F7FB); --sb-muted: var(--muted, #A4ADBA); --sb-on: var(--button, #2563EB); --sb-hi: var(--hi, #8DBBFF);
}
.au-sb {
  --sb-top: calc(var(--ax-top-h, 64px) + 12px + env(safe-area-inset-top, 0px));
  position: fixed; z-index: 15;
  top: var(--sb-top);
  left: max(16px, env(safe-area-inset-left, 0px));
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100% - var(--sb-top) - 16px - env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
  background: var(--ax-glass, rgba(21, 25, 32, .90)); color: var(--sb-text);
  border: 1px solid var(--sb-line); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 400 14px/1.4 var(--font, "Outfit", system-ui, sans-serif);
}
.au-sb[data-collapsed="true"] { width: auto; max-height: none; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.au-sb[data-collapsed="true"] .au-sb-body, .au-sb[data-collapsed="true"] .au-sb-title, .au-sb[data-collapsed="true"] .au-sb-foot { display: none; }
.au-sb-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--sb-line); }
.au-sb[data-collapsed="true"] .au-sb-head { padding: 0; border: 0; }
.au-sb-title { flex: 1; margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .01em; }
.au-sb-fold {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1; color: var(--sb-text); background: var(--sb-alt); border: 1px solid var(--sb-line);
}
.au-sb-fold:hover { border-color: var(--sb-hi); }
.au-sb-fold svg { width: 16px; height: 16px; }
.au-sb[data-collapsed="true"] .au-sb-fold { background: color-mix(in srgb, var(--sb-bg) 85%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.au-sb-body { overflow: auto; padding: 6px 0 10px; overscroll-behavior: contain; }
.au-sb-group { border-bottom: 1px solid var(--sb-line); }
.au-sb-group:last-child { border-bottom: 0; }
.au-sb-group > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer;
  font-weight: 500; font-size: 14px; letter-spacing: .02em;
}
.au-sb-group > summary::-webkit-details-marker { display: none; }
.au-sb-group > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--sb-muted); border-bottom: 1.5px solid var(--sb-muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.au-sb-group[open] > summary::before { transform: rotate(45deg); }
.au-sb-count { margin-left: auto; font: 500 11px/1 var(--mono, ui-monospace, monospace); color: var(--sb-hi); }
.au-sb-items { list-style: none; margin: 0; padding: 0 8px 8px; }
.au-sb-item { padding: 2px 0; }
.au-sb-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px 8px 22px; border-radius: 8px;
  background: none; border: 0; color: var(--sb-text); font: inherit; text-align: left; cursor: pointer;
}
.au-sb-row:hover:not([aria-disabled="true"]) { background: var(--sb-alt); }
.au-sb-row[aria-disabled="true"] { cursor: default; color: var(--sb-muted); }
.au-sb-label { flex: 1; min-width: 0; }
.au-sb-label small { display: block; color: var(--sb-muted); font-size: 12px; }
.au-sb-tag { font: 500 10px/1 var(--mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .08em; color: var(--sb-muted); border: 1px solid var(--sb-line); border-radius: 999px; padding: 4px 7px; }
.au-sb-switch { position: relative; width: 32px; height: 18px; flex: none; border-radius: 999px; background: var(--sb-line); transition: background .15s; }
.au-sb-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--sb-muted); transition: transform .15s, background .15s; }
.au-sb-row[aria-checked="true"] .au-sb-switch { background: var(--sb-on); }
.au-sb-row[aria-checked="true"] .au-sb-switch::after { transform: translateX(14px); background: #fff; }
.au-sb-detail { padding: 2px 6px 8px 22px; color: var(--sb-muted); font-size: 12px; }
.au-sb-detail:empty { display: none; }
.au-sb-foot { padding: 10px 14px 12px; border-top: 1px solid var(--sb-line); color: var(--sb-muted); font-size: 12px; }
.au-sb-foot:empty { display: none; }
.au-sb :focus-visible { outline: 2px solid var(--sb-hi); outline-offset: 2px; }
@media (max-width: 640px) {
  .au-sb:not([data-collapsed="true"]) {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%;
    border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .au-sb[data-collapsed="true"] { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
/* ---------- top bar menus (groups with top: true) ---------- */
.au-tb { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; color: var(--sb-text);
  background: var(--ax-glass, rgba(21, 25, 32, .82)); border: 1px solid var(--sb-line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 400 14px/1.4 var(--font, "Outfit", system-ui, sans-serif); }
.au-tb:empty { display: none; }
.au-tb-menu { position: relative; }
.au-tb-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: none; color: var(--sb-muted); font: 500 14px/1 var(--font, "Outfit", system-ui, sans-serif); white-space: nowrap; }
.au-tb-btn::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.au-tb-btn:hover, .au-tb-btn[aria-expanded="true"] { color: var(--sb-text); background: var(--sb-alt); }
.au-tb-btn .au-sb-count { display: none; }
.au-tb-pop { position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; width: 320px; max-height: min(70vh, 560px); overflow: auto; padding: 6px 0;
  background: var(--sb-bg); border: 1px solid var(--sb-line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); overscroll-behavior: contain; }
.au-tb-pop[hidden] { display: none; }
.au-tb-intro { margin: 6px 14px 8px; color: var(--sb-muted); font-size: 13px; line-height: 1.45; }
.au-tb .au-sb-items { padding: 0 6px; }
.au-tb .au-sb-row { padding-left: 10px; }
.au-tb .au-sb-detail { padding-left: 10px; }
.au-sb-link { text-decoration: none; }
.au-sb-go { color: var(--sb-muted); font-size: 15px; }
.au-sb-row:hover .au-sb-go { color: var(--sb-hi); }
.au-sb-note { padding: 6px 10px 8px; color: var(--sb-muted); font-size: 12px; }
.au-tb :focus-visible { outline: 2px solid var(--sb-hi); outline-offset: 2px; }
@media (max-width: 640px) {
  /* no blur or scrolling here: either would trap the fixed menu sheet inside the bar */
  .au-tb { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(21, 25, 32, .94); justify-content: space-between; gap: 0; }
  .au-tb-btn { padding: 7px 9px; gap: 6px; font-size: 13.5px; }
  .au-tb-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 64vh; }
}

/* ---------- fine strip with all Aureality sites (top edge of every site) ---------- */
.au-sites { position: fixed; z-index: 16; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 2px;
  height: calc(28px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  background: rgba(7, 9, 13, .74); border-bottom: 1px solid rgba(38, 44, 54, .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 400 12px/1 var(--font, "Outfit", system-ui, sans-serif); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.au-sites::-webkit-scrollbar { display: none; }
.au-sites-k { margin-right: 8px; color: var(--muted, #A4ADBA); font: 500 10px/1 var(--mono, ui-monospace, monospace); letter-spacing: .14em; text-transform: uppercase; }
.au-sites a { padding: 5px 9px; border-radius: 999px; color: var(--muted, #A4ADBA); text-decoration: none; }
.au-sites a small { margin-left: 4px; font: 400 10.5px/1 var(--mono, ui-monospace, monospace); opacity: .75; }
.au-sites a:hover { color: var(--text, #F5F7FB); background: rgba(255, 255, 255, .06); }
.au-sites a[aria-current="page"] { color: var(--text, #F5F7FB); background: rgba(141, 187, 255, .13); }
.au-sites a[aria-current="page"] small { color: var(--hi, #8DBBFF); opacity: 1; }
.au-sites a:focus-visible { outline: 2px solid var(--hi, #8DBBFF); outline-offset: -2px; }
.au-sites-sep { width: 1px; height: 12px; margin: 0 4px; background: var(--line, #262C36); flex: none; }

@media (prefers-reduced-motion: reduce) { .au-sb-switch, .au-sb-switch::after, .au-sb-group > summary::before { transition: none; } }
