:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; background: radial-gradient(circle at 50% 35%, #171329, #050508 48%, #000); color: #f5f2ff; }
main { width: min(92vw, 440px); text-align: center; padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom)); }
.orb { --level: 0; display: grid; width: 110px; height: 110px; margin: 0 auto 2rem; padding: 0; place-items: center; overflow: visible; border: 0; border-radius: 50%; outline: none; background: radial-gradient(circle at 35% 30%, #fff, #a889ff 10%, #5a20dd 42%, #15072e 72%); box-shadow: 0 0 calc(28px + var(--level) * 50px) rgba(138, 93, 255, calc(.35 + var(--level) * .4)); transform: scale(calc(1 + var(--level) * .12)); transition: transform 80ms linear, box-shadow 120ms ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.orb:focus-visible { outline: 2px solid rgba(125, 222, 255, .82); outline-offset: 4px; }
#holo-orb { display: none; width: 100%; height: 100%; background: transparent; }
[data-phase="thinking"] .orb { animation: breathe 1.2s infinite alternate ease-in-out; }
[data-phase="reconnecting"] .orb { opacity: .45; animation: breathe 1.8s infinite alternate ease-in-out; }
[data-phase="interrupted"] .orb { transform: scale(.86); }
[data-phase="auditioning"] .orb { background: radial-gradient(circle at 35% 30%, #fff, #57e6ff 18%, #2565f4 52%, #071936 76%); animation: breathe .65s infinite alternate ease-in-out; }
.phase { color: #aa8dff; letter-spacing: .18em; text-transform: uppercase; font-size: .72rem; font-weight: 750; }
h1 { margin: .8rem 0; font-size: clamp(1.8rem, 7vw, 2.6rem); }
.detail { min-height: 3rem; color: #aaa4b8; line-height: 1.5; }
.session { color: #d5cced; font-size: .82rem; }
button { border: 0; border-radius: 999px; padding: .9rem 1.35rem; background: #8054f6; color: white; font: inherit; font-weight: 700; cursor: pointer; }
button.secondary { display: block; margin: .75rem auto; background: transparent; color: #8f899d; }
button.interrupt { display: block; margin: .75rem auto; background: #251937; color: #d9caff; }
button[hidden] { display: none; }
details { margin-top: 2rem; color: #716b7d; font-size: .78rem; }
form { display: flex; gap: .4rem; margin-top: .8rem; }
input { min-width: 0; flex: 1; border: 1px solid #302a3c; border-radius: 999px; background: #0c0a11; color: white; padding: .75rem 1rem; font-size: 1rem; }
form button { padding: .7rem 1rem; }
.enrollment-card { display: grid; gap: .65rem; margin-top: 1.5rem; padding: 1.1rem; border: 1px solid #3a3150; border-radius: 1rem; background: rgba(12, 10, 17, .88); text-align: left; }
.enrollment-card[hidden] { display: none; }
.enrollment-card h2 { margin: 0; font-size: 1.05rem; }
.enrollment-card form { margin-top: .2rem; }
.enrollment-card form[hidden], #create-passkey[hidden] { display: none; }
/* Friend invite dialog */
.invite-trigger { position: fixed; z-index: 4; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: .55rem 1rem; border: 1px solid rgba(190, 165, 255, .24); background: rgba(15, 12, 25, .78); color: #e3daf8; font-size: .84rem; box-shadow: 0 8px 30px rgba(0, 0, 0, .24); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.invite-trigger:disabled { opacity: .55; }
.invite-trigger[hidden] { display: none; }
.invite-backdrop { position: fixed; inset: 0; z-index: 9; background: rgba(2, 1, 7, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.invite-backdrop[hidden] { display: none; }
.invite-card { position: fixed; z-index: 10; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; gap: .8rem; width: min(calc(100vw - 2rem), 340px); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: 0; padding: 1.25rem 1.75rem 1.5rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid #29292d; border-radius: 16px; background: #111113; box-shadow: 0 24px 80px rgba(0, 0, 0, .45); text-align: center; outline: none; }
.invite-card[hidden] { display: none; }
.invite-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.invite-card h2 { margin: 0; color: #eeeef0; font-size: .94rem; font-weight: 500; letter-spacing: -.015em; }
.invite-close { flex: none; width: 44px; height: 44px; margin: -.5rem -.75rem -.5rem 0; padding: 0; border: 0; background: transparent; color: #a5a5ac; font-size: 1.4rem; font-weight: 400; line-height: 1; }
.invite-close:hover { color: #fff; }
.invite-body { display: grid; gap: 1.2rem; justify-items: center; }
.invite-guide { margin: 0; color: #c3c3c9; font-size: .82rem; line-height: 1.5; text-align: center; }
.invite-qr-wrap { position: relative; display: grid; place-items: center; width: min(100%, 228px); aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #fff; }
.invite-qr { display: block; width: 100%; height: 100%; padding: .75rem; background: #fff; image-rendering: pixelated; }
.invite-qr[hidden] { display: none; }
.invite-spinner { position: absolute; width: 24px; height: 24px; border: 2px solid #e6e6e8; border-top-color: #626269; border-radius: 50%; animation: invite-spin 800ms linear infinite; }
.invite-body:not([data-state="loading"]) .invite-spinner { display: none; }
.invite-body[data-state="error"] .invite-qr-wrap, .invite-body[data-state="linkonly"] .invite-qr-wrap { display: none; }
.invite-body:not([data-state="ready"]) .invite-guide { display: none; }
.invite-link { width: 100%; padding: .75rem; border: 1px solid #303034; border-radius: 8px; background: #19191c; text-align: left; }
.invite-link[hidden], .invite-url[hidden] { display: none; }
.invite-url { display: block; width: 100%; color: #c3c3c9; overflow-wrap: anywhere; font: .72rem/1.5 ui-monospace, SFMono-Regular, monospace; -webkit-user-select: all; user-select: all; }
.invite-share { justify-self: center; min-height: 44px; margin: 0; padding: .5rem .75rem; border: 0; border-radius: 6px; background: transparent; color: #c3c3c9; font-size: .8rem; font-weight: 400; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #5e5e66; }
.invite-share:hover { color: #fff; text-decoration-color: currentColor; }
.invite-share:disabled { opacity: .4; cursor: default; }
.invite-share[hidden] { display: none; }
.invite-status { margin: -.45rem 0 0; color: #a5a5ac; font-size: .7rem; line-height: 1.5; text-align: center; }
.invite-status:empty { display: none; }
.invite-status[data-tone="error"] { color: #e4adb2; }
.invite-status[data-tone="ok"] { color: #c3c3c9; }
.invite-close:focus-visible, .invite-share:focus-visible { outline: 2px solid #ccc; outline-offset: 2px; }
@keyframes invite-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .invite-spinner { animation: none; } }
@media (max-height: 480px) { .invite-card { gap: .65rem; padding: 1rem 1.5rem; } .invite-qr-wrap { width: min(100%, 160px); } .invite-body { gap: .8rem; } }
@media (max-width: 320px) { .invite-card { padding-inline: 1rem; } }
.setup-kicker { margin: 0; color: #aa8dff; letter-spacing: .14em; text-transform: uppercase; font-size: .68rem; font-weight: 750; }
.setup-copy { margin: 0; color: #aaa4b8; font-size: .82rem; line-height: 1.45; }
.test-link { display: inline-block; margin-top: 1rem; color: #9287af; font-size: .78rem; }
.test-link[hidden] { display: none; }
.operator-body { overflow: auto; display: block; background: #050508; }
.operator-panel { width: min(94vw, 680px); margin: 0 auto; text-align: left; padding: 2rem 1.25rem 4rem; }
.operator-panel h1 { font-size: 1.8rem; }
.operator-panel h2 { margin-top: 2rem; font-size: 1.1rem; }
.operator-panel .detail { min-height: 0; }
.operator-form { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.operator-form label { display: grid; gap: .35rem; color: #b8b0c8; font-size: .82rem; }
.operator-form input, .operator-form select, .operator-form textarea {
  width: 100%; border: 1px solid #302a3c; border-radius: .75rem;
  background: #0c0a11; color: white; padding: .75rem;
}
.operator-form textarea { min-height: 5rem; resize: vertical; }
.operator-form .wide { grid-column: 1 / -1; }
.operator-form .check { display: flex; align-items: center; gap: .55rem; }
.operator-form .check input { width: auto; }
.operator-form button { justify-self: start; }
.operator-report { margin-top: 1rem; padding: 1rem; border: 1px solid #282230; border-radius: .85rem; background: #09080d; white-space: pre-wrap; overflow-wrap: anywhere; color: #c9c1d8; font: .76rem/1.5 ui-monospace, monospace; }
.pair-actions { margin-top: 1.5rem; padding-top: .25rem; border-top: 1px solid #282230; }
.operator-link { display: inline-block; margin-left: .75rem; color: #b8a4ff; font-size: .86rem; }
.operator-link[hidden] { display: none; }
.preflight { display: grid; gap: .35rem; padding-left: 1.15rem; color: #a9a2b6; font-size: .82rem; }
.preflight .ready::marker { color: #58d6a4; }
.preflight .not-ready::marker { color: #f08b9a; }
button:disabled { cursor: not-allowed; opacity: .5; }
.scenario-list { display: grid; gap: .75rem; }
.scenario-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, .5fr); gap: .55rem .75rem; margin: 0; padding: .85rem; border: 1px solid #282230; border-radius: .85rem; background: #09080d; }
.scenario-card strong { align-self: center; font-size: .88rem; }
.scenario-meta { align-self: center; color: #81798f; font-size: .72rem; }
.scenario-card input, .scenario-card select { width: 100%; border: 1px solid #302a3c; border-radius: .65rem; background: #0c0a11; color: white; padding: .65rem; }
.scenario-card button { justify-self: start; padding: .65rem 1rem; }
.launch-panel { width: min(94vw, 860px); }
.launch-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.launch-card { display: grid; gap: .9rem; align-content: start; padding: 1rem; border: 1px solid #282230; border-radius: 1rem; background: #09080d; }
.launch-card h2 { margin: 0; }
.launch-card img { display: block; width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; border-radius: .5rem; background: white; }
.launch-card code { display: block; padding: .75rem; border-radius: .65rem; background: #050508; color: #cfc5e3; overflow-wrap: anywhere; }
.launch-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 640px) { .launch-options { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  main { width: min(100%, 420px); padding-inline: 1.1rem; }
  .orb { width: 88px; height: 88px; margin-bottom: 1.25rem; }
  .detail { min-height: 2.5rem; }
  .enrollment-card form { flex-direction: column; }
  .enrollment-card form button { width: 100%; }
}
@media (max-height: 700px) {
  body { place-items: start center; }
  .orb { width: 76px; height: 76px; margin-bottom: 1rem; }
  h1 { margin: .45rem 0; }
  .detail { margin-block: .55rem; }
}
@media (max-width: 560px) { .operator-form { grid-template-columns: 1fr; } .operator-form .wide { grid-column: 1; } .scenario-card { grid-template-columns: 1fr; } }
@keyframes breathe { to { transform: scale(1.09); filter: brightness(1.2); } }

html.holo-orb-requested,
html.holo-orb-requested body { background: #000; }
html.holo-orb-requested body { display: block; overflow: hidden; }
html.holo-orb-requested main {
  display: grid; width: 100%; min-height: 100svh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); place-items: center;
}
html.holo-orb-requested .orb {
  width: min(92vw, 92svh, 720px); height: auto; aspect-ratio: 1; margin: 0; background: transparent; box-shadow: none; transform: none; animation: none; filter: none; opacity: 1; transition: opacity 180ms ease;
}
/* The live canvas covers the middle 76% of the orb button: the orb and its
   glow never reach the outer part, so it is not drawn. Keep this in step with
   LIVE_FRAME in holo-orb/holo-orb-webgl.js. */
html.holo-orb-requested #holo-orb { display: block; width: 76%; height: 76%; }
html.holo-orb-requested .orb:focus-visible { outline: none; }
html.holo-orb-requested .orb:focus-visible #holo-orb { filter: brightness(1.12); }
html.holo-orb-requested .cloud-status,
html.holo-orb-requested #start,
html.holo-orb-requested #interrupt,
html.holo-orb-requested #stop,
html.holo-orb-requested #push,
html.holo-orb-requested #finish-device-test,
html.holo-orb-requested #developer-fallback {
  position: fixed !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; border: 0 !important; white-space: nowrap !important;
}
html.holo-orb-requested body[data-phase="failed"] .cloud-status,
html.holo-orb-requested body.startup-failed .cloud-status,
html.holo-orb-requested body[data-phase="ended"] .cloud-status {
  position: fixed !important; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); left: 1rem; width: auto !important; height: auto !important; margin: 0 !important; padding: .75rem !important; overflow: visible !important; clip: auto !important; clip-path: none !important; border: 0 !important; white-space: normal !important; z-index: 3;
}
html.holo-orb-requested #startup-retry:not([hidden]) {
  position: fixed; z-index: 4; bottom: max(6rem, calc(env(safe-area-inset-bottom) + 5rem));
  left: 50%; transform: translateX(-50%); min-height: 44px;
}
html.holo-orb-requested body[data-phase="failed"] .cloud-status h1,
html.holo-orb-requested body.startup-failed .cloud-status h1,
html.holo-orb-requested body.startup-failed .cloud-status .session,
html.holo-orb-requested body.startup-failed .cloud-status .phase,
html.holo-orb-requested body[data-phase="failed"] .cloud-status .session,
html.holo-orb-requested body[data-phase="ended"] .cloud-status h1,
html.holo-orb-requested body[data-phase="ended"] .cloud-status .session { display: none; }
html.holo-orb-requested body[data-phase="failed"] .cloud-status .detail,
html.holo-orb-requested body.startup-failed .cloud-status .detail,
html.holo-orb-requested body[data-phase="ended"] .cloud-status .detail { min-height: 0; margin: 0; }
html.holo-orb-requested .enrollment-card:not([hidden]) {
  position: fixed; z-index: 5; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); left: max(1rem, env(safe-area-inset-left)); width: min(calc(100% - 2rem), 420px); max-height: min(70svh, 560px); margin: auto; overflow: auto; box-shadow: 0 1rem 4rem rgba(0, 0, 0, .72);
}
html.holo-orb-requested body:not(.holo-orb-ready) .orb,
html.holo-orb-requested body.holo-orb-fallback .orb {
  background: #000 url('./holo-orb/assets/fallback.png') center / contain no-repeat;
}
html.holo-orb-requested body:not(.holo-orb-ready) #holo-orb,
html.holo-orb-requested body.holo-orb-fallback #holo-orb { display: none; }
html.holo-orb-requested body.motif-security-overlay-active .orb {
  background: #000 url('./holo-orb/assets/fallback.png') center / contain no-repeat;
}
html.holo-orb-requested body.motif-security-overlay-active #holo-orb {
  opacity: .38;
  transition: opacity 280ms ease;
}
@media (prefers-reduced-motion: reduce) {
  html.holo-orb-requested .orb { cursor: default; }
}

/* Download for your DAW */
.daw-download { display: grid; gap: .55rem; margin: 1rem auto 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid #2d2740; border-radius: 1rem; background: rgba(12, 10, 17, .82); text-align: left; }
.daw-download[hidden] { display: none; }
.daw-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.daw-download h2 { margin: 0; font-size: .98rem; }
.daw-trigger { position: fixed; z-index: 4; top: max(1rem, env(safe-area-inset-top)); left: max(1rem, env(safe-area-inset-left)); display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: .55rem 1rem; border: 1px solid rgba(190, 165, 255, .24); background: rgba(15, 12, 25, .78); color: #e3daf8; font-size: .84rem; box-shadow: 0 8px 30px rgba(0, 0, 0, .24); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.daw-trigger[hidden] { display: none; }
.daw-download:not([hidden]) { position: fixed; z-index: 5; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); left: max(1rem, env(safe-area-inset-left)); width: min(calc(100% - 2rem), 420px); max-height: min(70svh, 560px); margin: auto; overflow: auto; box-shadow: 0 1rem 4rem rgba(0, 0, 0, .72); }
.daw-copy { margin: 0; color: #aaa4b8; font-size: .82rem; line-height: 1.45; }
.daw-row { display: flex; gap: .5rem; align-items: center; }
.daw-row select { min-width: 0; flex: 1; border: 1px solid #302a3c; border-radius: 999px; background: #0c0a11; color: white; padding: .7rem 1rem; font: inherit; }
.daw-row button { padding: .7rem 1.1rem; }
.daw-row button:disabled { opacity: .55; cursor: default; }
.daw-status { min-height: 1.2rem; margin: 0; color: #aaa4b8; font-size: .8rem; }
.daw-link { display: inline-block; padding: .7rem 1.1rem; border-radius: 999px; background: #1d1733; color: #d9caff; font-weight: 700; text-decoration: none; }
.daw-link[hidden] { display: none; }
