/* ═══════════════════════════════════════
   WOBAZI — The mega-nav panel (public/js/launcher.js) + the glowing product orbs (.wz-orb)
   A wide dropdown under the 3×3 button on desktop (four columns), a bottom sheet on phones.
   Loaded on every page (views/partials/head.ejs, app/index.html), so .wz-orb works everywhere.
═══════════════════════════════════════ */

/* ── The orb: the mobile nav's Oracle button (#bn-oracle, app/style.css) for every product.
   A conic disc that turns slowly, a soft halo that breathes, a white glyph. --orb is the gradient
   (config/suite.js ORBS), --orb-size the diameter. Only transform/opacity animate. ── */
.wz-orb {
  position: relative; isolation: isolate; flex: none; display: inline-grid; place-items: center;
  width: var(--orb-size, 52px); height: var(--orb-size, 52px); border-radius: 28%; color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
/* A rounded square (app-icon shape): the shape stays still and the colours turn inside it
   (--orb-a, registered below so it can animate). --orb is the list of colour stops. */
.wz-orb::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--orb-a, 0deg), var(--orb)); animation: wzOrbTurn 9s linear infinite;
}
.wz-orb::after {
  content: ''; position: absolute; inset: calc(var(--orb-size, 52px) * -0.2); z-index: -2; border-radius: 32%;
  background: conic-gradient(var(--orb)); filter: blur(calc(var(--orb-size, 52px) * 0.22)); opacity: 0.45; pointer-events: none;
  animation: wzOrbHalo 3.6s ease-in-out infinite;
}
.wz-orb svg { width: 52%; height: 52%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.wz-orb-oracle::after { background: radial-gradient(closest-side, rgba(168, 85, 247, 0.85) 60%, rgba(236, 72, 153, 0.35) 85%, transparent); filter: none; }
@property --orb-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes wzOrbTurn { to { --orb-a: 360deg; } }
/* In the mega-nav the orbs sit close together: a smaller, fainter halo and a lighter shadow. */
/* The same soft look on the home screens: the members' hub and the landing's suite cards. */
.mn-panel .wz-orb, .hub-grid .wz-orb, .splash-suite .wz-orb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.mn-panel .wz-orb::after, .hub-grid .wz-orb::after, .splash-suite .wz-orb::after { inset: calc(var(--orb-size, 52px) * -0.1); animation-name: wzOrbHaloSoft; }
@keyframes wzOrbHaloSoft { 0%, 100% { opacity: 0.1; transform: scale(0.92); } 50% { opacity: 0.22; transform: scale(1.02); } }
@keyframes wzOrbHalo { 0%, 100% { opacity: 0.3; transform: scale(0.9); } 50% { opacity: 0.6; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .wz-orb::before, .wz-orb::after { animation: none; } }

/* ── Panel ── */
.ln-overlay { position: fixed; inset: 0; z-index: 3500; }
.ln-overlay[hidden] { display: none; }
.ln-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.ln-panel {
  position: fixed; top: 64px; right: 12px; width: min(1120px, calc(100vw - 24px)); max-height: min(86vh, 760px); overflow-y: auto;
  padding: 26px 28px 0; outline: none; /* corners, and the dim on phones: "Sheets" in public/css/system.css */
  background: var(--bg-panel); /* solid: --bg-card is translucent on some pages */ border: 1px solid var(--w08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(-6px) scale(0.985); transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease;
  overscroll-behavior: contain;
}
.ln-overlay.is-open .ln-panel { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ln-panel { transition: none; } }
.ln-close {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border-radius: 99px; border: 1px solid var(--w1); background: transparent;
  color: var(--text); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.mn-close { position: absolute; top: 14px; right: 14px; z-index: 1; }

.mn-cols { display: grid; grid-template-columns: 1.2fr 2fr 0.8fr 0.9fr; gap: 0; }
.mn-cols.no-shop { grid-template-columns: 1.2fr 2.1fr 0.9fr; }
.mn-col { min-width: 0; padding: 0 22px 22px; border-left: 1px solid var(--w07); }
.mn-col:first-child { padding-left: 0; border-left: 0; }
.mn-col:last-child { padding-right: 0; }
.mn-h {
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--w08);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

/* Quick actions: a list of tools, each with its product's small orb. */
.mn-quick { display: grid; gap: 2px; }
.mn-q {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 6px; margin: 0 -10px 0 -6px; border-radius: 14px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.mn-q-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); transition: color 0.15s; }
.mn-q-ico .suite-ico { width: 20px; height: 20px; }
.mn-q:focus-visible .mn-q-ico { color: var(--ln-accent, var(--gold)); }
@media (hover: hover) { .mn-q:hover .mn-q-ico { color: var(--ln-accent, var(--gold)); } }
.mn-q-txt { flex: 1; min-width: 0; }
.mn-arrow { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity 0.15s, transform 0.15s; }
.mn-q:focus-visible { background: var(--w05); outline: none; }
@media (hover: hover) { .mn-q:hover { background: var(--w05); outline: none; } }
.mn-q:focus-visible .mn-arrow { opacity: 1; transform: none; }
@media (hover: hover) { .mn-q:hover .mn-arrow { opacity: 1; transform: none; } }

/* Apps: orb + name + one line, two per row on desktop. */
.mn-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.mn-app {
  display: flex; align-items: center; gap: 14px; padding: 10px 10px; border-radius: 16px;
  color: var(--text); text-decoration: none;
}
.mn-app:focus-visible { background: var(--w05); outline: none; }
@media (hover: hover) { .mn-app:hover { background: var(--w05); outline: none; } }
.mn-app-orb { position: relative; flex: none; display: inline-flex; }
@media (min-width: 641px) { .mn-app .wz-orb { --orb-size: 46px !important; } }
.mn-app-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mn-app-txt b { font-size: 14.5px; font-weight: 700; }
.mn-app-txt small { font-size: 12px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ln-lock {
  position: absolute; right: -3px; top: -3px; z-index: 2; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
  color: var(--on-gold); background: var(--gold); box-shadow: 0 0 0 2px var(--bg-panel);
}

/* Learn / Shop: plain links. */
.mn-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mn-links a { display: block; padding: 8px 0; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.mn-links a:focus-visible { color: var(--gold); outline: none; }
@media (hover: hover) { .mn-links a:hover { color: var(--gold); outline: none; } }

.mn-premium {
  margin: 14px 0 0; padding: 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.14), rgba(224, 128, 32, 0.07));
  border: 1px solid rgba(240, 192, 64, 0.35);
}
.mn-premium p { margin: 0; }
.mn-premium-h { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.mn-premium-line { margin: 6px 0 4px !important; font-size: 13px; line-height: 1.45; color: var(--text); }
.mn-premium-price { font-size: 13px; color: var(--muted); }
.mn-premium-price b { color: var(--text); font-size: 15px; }
.mn-premium .ln-btn { margin-top: 10px; width: 100%; }
.ln-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 99px; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.ln-btn-gold { color: var(--on-gold); background: linear-gradient(135deg, #f0c040, #e08020); border: none; }

/* Focus: a bar under the columns (like a mega-menu footer). Option colours: app/style.css .focus-opt. */
.mn-focus {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 -28px; padding: 14px 28px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--surface-2); border-top: 1px solid var(--w07);
}
.mn-focus-h { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mn-focus-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-focus .focus-opt { text-decoration: none; }

/* Mid widths: Quick + Apps on top, Learn + Shop below. */
@media (max-width: 980px) {
  .mn-cols, .mn-cols.no-shop { grid-template-columns: 1fr 1.5fr; }
  .mn-col-learn { padding-left: 0; border-left: 0; }
  .mn-col-learn, .mn-col-shop { padding-top: 6px; }
}

/* Phones: a bottom sheet, one column; apps as a 3-across orb grid. */
@media (max-width: 640px) {
  .ln-panel {
    top: auto !important; right: 0 !important; left: 0; bottom: 0; width: auto; max-height: 88vh;
    padding: 22px 16px 0;
    transform: translateY(24px); transform-origin: bottom center;
  }
  .mn-close { top: 12px; right: 12px; }
  .mn-cols, .mn-cols.no-shop { grid-template-columns: 1fr 1fr; }
  .mn-col { padding: 0 0 18px; border-left: 0; }
  .mn-col-quick, .mn-col-apps { grid-column: 1 / -1; }
  .mn-col-apps { order: -1; }   /* phones: the apps first, then the quick actions (2026-11-24) */
  .mn-col-learn { padding-right: 10px; }
  .mn-col-shop { padding-left: 10px; }
  .mn-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mn-q { margin: 0; padding: 8px; gap: 10px; font-size: 13px; line-height: 1.25; background: var(--w04); }
  .mn-q .mn-arrow { display: none; }
  .mn-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .mn-app { flex-direction: column; text-align: center; gap: 8px; padding: 10px 2px 8px; }
  .mn-app-txt b { font-size: 12.5px; font-weight: 600; }
  .mn-app-txt small { display: none; }
  .mn-focus { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

/* "Account menu" under Shop (members): opens the avatar's account menu. */
.mn-acct { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border, rgba(255, 255, 255, 0.1)); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; }
.mn-acct:focus-visible { border-color: rgba(240, 192, 64, 0.5); color: var(--gold); outline: none; }
@media (hover: hover) { .mn-acct:hover { border-color: rgba(240, 192, 64, 0.5); color: var(--gold); outline: none; } }
.mn-acct span:first-of-type { flex: 1; }
.mn-acct-chev { color: var(--muted); font-size: 18px; line-height: 1; }

/* ── 2026-11-21: search at the top; quick actions as small wrapping chips so the apps show without scrolling ── */
.mn-search { margin: 0 44px 16px 0; }
.mn-search .ss { max-width: none; }
.mn-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-quick .mn-q {
  flex: 0 1 auto; margin: 0; gap: 6px; padding: 5px 10px 5px 7px; min-height: 0; border-radius: 99px;
  font-size: 12.5px; font-weight: 500; line-height: 1.2; white-space: nowrap;
  background: var(--w04); border: 1px solid var(--w09);
}
.mn-quick .mn-q-ico { width: 18px; height: 18px; color: var(--ln-accent, var(--gold)); }
.mn-quick .mn-q-ico .suite-ico { width: 15px; height: 15px; }
.mn-quick .mn-q-txt { flex: none; }
.mn-quick .mn-q:focus-visible { border-color: color-mix(in srgb, var(--ln-accent, #f0c040) 55%, transparent); }
@media (hover: hover) { .mn-quick .mn-q:hover { border-color: color-mix(in srgb, var(--ln-accent, #f0c040) 55%, transparent); } }
@media (max-width: 640px) {
  .mn-search { margin: 0 40px 12px 0; }
  .mn-quick { display: flex; gap: 5px; }
  .mn-quick .mn-q { padding: 4px 9px 4px 6px; font-size: 12px; background: var(--w04); }
  .mn-col-quick { padding-bottom: 12px !important; }
  .mn-h { margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .mn-apps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .mn-app { padding: 6px 1px 4px; gap: 5px; }
  .mn-app .wz-orb { --orb-size: 42px !important; }
  .mn-app-txt b { font-size: 11px; line-height: 1.15; }
  .mn-col-apps { padding-bottom: 10px !important; }
}
@media (max-width: 640px) {
  .mn-apps { row-gap: 14px; }
  .mn-app { gap: 7px; }
}

/* ── Phones, 2026-11-21 (later): large app icons again, a clear divider before Learn / Shop, softer
   white type, quick actions as two text-only columns. Overrides the denser rules above. ── */
@media (max-width: 640px) {
  .mn-panel { --mn-text: var(--ink-soft); color: var(--mn-text); }
  .mn-quick { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mn-quick .mn-q { justify-content: flex-start; padding: 8px 10px; border-radius: 12px; white-space: normal; font-size: 12.5px; line-height: 1.25; color: var(--mn-text); }
  .mn-quick .mn-q-ico { display: none; }
  .mn-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; column-gap: 6px; }
  .mn-app { padding: 6px 2px 4px; gap: 8px; }
  .mn-app .wz-orb { --orb-size: 54px !important; }
  .mn-app-txt b { font-size: 12.5px; font-weight: 600; color: var(--mn-text); }
  .mn-col-apps { padding-bottom: 22px !important; margin-bottom: 18px; border-bottom: 1px solid var(--w14); }
  .mn-links a, .mn-acct, .mn-premium-line { color: var(--mn-text); }
  .mn-links a:focus-visible { color: var(--gold); }
  @media (hover: hover) { .mn-links a:hover { color: var(--gold); } }
}

/* Site pages: the overlay covers exactly the visible area (public/js/app-dock.js --pvv-*), and on phones the
   sheet sits at the overlay's bottom, so a stale layout viewport after an app switch can't leave a blank band. */
body:not(.app-shell) .ln-overlay { inset: auto; left: 0; right: 0; top: var(--pvv-top, 0px); height: var(--pvv-h, 100dvh); }
@media (max-width: 640px) {
  body:not(.app-shell) .ln-panel { position: absolute; max-height: calc(var(--pvv-h, 100dvh) * 0.88); }
}

