/* The Nebula: onboarding, the live build graph and the hand-off (public/js/nebula.js, nebulagl.js, nebulagraph.js,
   nebulatour.js), the floating Nebula and the agent chip at the top of the sidebar (nebulafloat.js).
   Colors are theme tokens only: the CSS vars from theme.js, plus --neb-dust/gas/glow/core, which nebula.js sets from
   theme.js's nebula tokens. The WebGL sky sits behind; the CSS sky (.neb-sky-css) shows without WebGL. */
html.neb-open, html.neb-open body { overflow: hidden; }
.neb { position: fixed; inset: 0; z-index: 9000; display: grid; grid-template-rows: auto 1fr; background: var(--bg); color: var(--text); opacity: 0; transition: opacity .45s var(--ease); overflow: hidden; }
.neb.in { opacity: 1; }
.neb.out { opacity: 0; transition: opacity .38s var(--ease); pointer-events: none; }
.neb-sky, .neb-sky-css { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.neb-sky { image-rendering: auto; }
.neb-sky-css { background:
  radial-gradient(40% 32% at 46% 46%, color-mix(in srgb, var(--neb-core) 70%, transparent), transparent 70%),
  radial-gradient(55% 45% at 40% 50%, color-mix(in srgb, var(--neb-glow) 45%, transparent), transparent 72%),
  radial-gradient(70% 60% at 60% 40%, color-mix(in srgb, var(--neb-gas) 55%, transparent), transparent 75%),
  radial-gradient(90% 80% at 50% 50%, color-mix(in srgb, var(--neb-dust) 80%, transparent), var(--bg)); opacity: .9; }
.neb:not(.no-gl) .neb-sky-css { opacity: 0; transition: opacity 1s; }
.neb-top { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s6); min-width: 0; }
.neb-brand { display: inline-flex; align-items: center; gap: var(--s2); font: 450 19px/1 var(--serif); letter-spacing: -.02em; white-space: nowrap; }
.neb-brand .mark svg { width: 22px; height: 22px; display: block; }
.neb-steps { display: flex; gap: var(--s4); margin: 0 0 0 var(--s6); padding: 0; list-style: none; min-width: 0; }
.neb-step { display: inline-flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--text3); white-space: nowrap; }
.neb-step .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line2); transition: background .3s, box-shadow .3s; }
.neb-step.done .dot { background: var(--text2); }
.neb-step.on { color: var(--text); }
.neb-step.on .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.neb-agent { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--pill); background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; backdrop-filter: blur(10px); }
.neb-agent > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.neb-agent .live { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: neb-live 2.4s infinite; }
@keyframes neb-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.neb-exit { white-space: nowrap; color: var(--text2); background: color-mix(in srgb, var(--panel) 60%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.neb-center .neb-eyebrow { text-shadow: 0 1px 10px var(--bg); color: var(--text2); }
.neb-stage { position: relative; z-index: 1; min-height: 0; overflow: auto; display: grid; }
.neb-screen { min-height: 100%; display: grid; place-items: center; padding: var(--s6); opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.neb-screen.in { opacity: 1; transform: none; }
.neb-screen.leaving { opacity: 0; transform: translateY(-8px) scale(.99); transition-duration: .22s; }

/* cards float over the sky as frosted glass */
.neb-card { width: 100%; display: grid; gap: var(--s5); padding: var(--s8); border-radius: calc(var(--r-lg) + 6px); background: color-mix(in srgb, var(--panel) 78%, transparent); border: 1px solid color-mix(in srgb, var(--line2) 70%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); }
.neb-narrow { max-width: 720px; }
.neb-wide { max-width: 860px; }
.neb-head { display: grid; gap: var(--s2); }
.neb-head h1 { margin: 0; font: 380 clamp(30px, 4.4vw, 46px)/1.05 var(--serif); letter-spacing: -.03em; text-wrap: balance; }
.neb-head p { margin: 0; color: var(--text2); font-size: 15.5px; max-width: 38em; text-wrap: pretty; }
.neb-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
.neb-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.neb-actions.center { justify-content: center; }
.neb .btn.lg { height: var(--h-lg); padding: 0 var(--s5); font-size: 15px; }
.neb .btn span .ico, .neb .btn > span:has(.ico) { display: inline-grid; place-items: center; }

/* use */
.neb-uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.neb-use { position: relative; display: grid; gap: var(--s1); justify-items: start; text-align: left; padding: var(--s4); border-radius: var(--r-lg); background: var(--raised); border: 1px solid var(--line); color: var(--text); transition: border-color var(--t-fast), transform var(--t-base) var(--ease), box-shadow var(--t-base); cursor: pointer; }
.neb-use:hover { border-color: var(--line2); transform: translateY(-1px); }
.neb-use .ic { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r); background: var(--panel2); color: var(--text2); margin-bottom: var(--s2); }
.neb-use .muted { font-size: 12.5px; }
.neb-use .tick { position: absolute; top: var(--s3); right: var(--s3); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); }
.neb-use.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.neb-use.on .ic { background: var(--accent-bg); color: var(--accent); }
.neb-use.on .tick { opacity: 1; transform: none; }
.neb-other { max-width: 420px; }

/* connect */
.neb-codebox { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--raised); border: 1px solid var(--line); flex-wrap: wrap; }
.neb-codebox .lbl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.neb-code { flex: 1; min-width: 0; font: 500 13.5px/1.4 var(--code); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.neb-setup { display: grid; gap: var(--s3); }
.neb-tabs { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.neb-tab { height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--pill); border: 1px solid var(--line); background: transparent; color: var(--text2); font-size: 13px; white-space: nowrap; cursor: pointer; }
.neb-tab:hover { color: var(--text); border-color: var(--line2); }
.neb-tab.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.neb-snips { display: grid; gap: var(--s3); }
.neb-snip { display: grid; gap: var(--s2); }
.neb-snip-h { display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--text2); }
.neb-snip-h > span { flex: 1; min-width: 0; }
.neb-snip pre { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); font: 12.5px/1.55 var(--code); color: var(--text); white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }
.neb-snip.prompt pre { background: var(--accent-bg); border-color: transparent; font-family: var(--font); font-size: 14px; word-break: normal; }
.neb-copy.ok { color: var(--good); }
.neb-prompt { display: grid; gap: var(--s3); }
.neb-prompt pre { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--accent-bg); font: 12.5px/1.55 var(--code); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; }
.neb-prompt-go { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: 13px; }
.neb-copy.lg.ok { color: var(--bg); }
.neb-more { border-top: 1px solid var(--line); padding-top: var(--s3); }
.neb-more > summary { cursor: pointer; font-size: 13.5px; color: var(--text2); width: fit-content; }
.neb-more > summary:hover { color: var(--text); }
.neb-more[open] { display: grid; gap: var(--s3); }
.neb-how { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s2); font-size: 13.5px; color: var(--text2); }
.neb-how b { display: block; color: var(--text); font-weight: 600; }
.neb-newcode { margin: 0; font-size: 12.5px; display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.neb-wait { display: inline-flex; align-items: center; gap: var(--s3); color: var(--text2); font-size: 14px; }
.neb-wait .orbit { position: relative; width: 22px; height: 22px; }
.neb-wait .orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--accent); animation: neb-spin 1.4s linear infinite; }
.neb-wait .orbit i:nth-child(2) { inset: 4px; border-top-color: var(--text3); animation-duration: 2.1s; animation-direction: reverse; }
.neb-wait .orbit i:nth-child(3) { inset: 9px; background: var(--accent); border: 0; animation: neb-breathe 1.6s ease-in-out infinite; }
@keyframes neb-spin { to { transform: rotate(360deg); } }
@keyframes neb-breathe { 50% { transform: scale(.55); opacity: .5; } }
.neb-arrived { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s8) 0; }
.neb-arrived h1 { margin: 0; font: 380 clamp(32px, 5vw, 52px)/1 var(--serif); letter-spacing: -.03em; }
.neb-arrived p { margin: 0; color: var(--text2); }
.neb-ring { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 10px var(--accent-bg), 0 0 60px var(--glow); animation: neb-pop .7s var(--ease); }
.neb-ring .ico { width: 30px; height: 30px; }
@keyframes neb-pop { from { transform: scale(.4); opacity: 0; } }

/* the Nebula itself */
.nebs-nebula { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: var(--s6); align-items: stretch; place-items: stretch; padding: 0 var(--s6) var(--s6); }
.neb-center { position: relative; display: grid; align-content: center; justify-items: center; gap: var(--s5); text-align: center; padding: var(--s6) 0; min-width: 0; }
.neb-center .neb-head { justify-items: center; }
.neb-center .neb-head h1 { font-size: clamp(32px, 4.8vw, 58px); text-shadow: 0 2px 30px var(--bg); }
.neb-center .neb-head p { text-shadow: 0 1px 12px var(--bg); }
.neb-core { position: relative; width: clamp(130px, 18vw, 200px); aspect-ratio: 1; display: grid; place-items: center; }
.neb-core .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--neb-core) 55%, transparent); animation: neb-ring 6s ease-in-out infinite; }
.neb-core .r2 { inset: 14%; animation-delay: -2s; border-style: dashed; border-color: color-mix(in srgb, var(--neb-glow) 45%, transparent); animation-name: neb-ring-turn; animation-duration: 40s; animation-timing-function: linear; }
.neb-core .r3 { inset: 32%; background: radial-gradient(circle, color-mix(in srgb, var(--neb-core) 55%, transparent), transparent 70%); border: 0; animation-delay: -4s; }
@keyframes neb-ring { 50% { transform: scale(1.06); opacity: .6; } }
@keyframes neb-ring-turn { to { transform: rotate(360deg); } }
.neb.dragging .neb-core .ring { border-color: var(--accent); animation-duration: 1.4s; }
.neb.dragging .neb-core .r3 { background: radial-gradient(circle, var(--glow), transparent 70%); }
.neb.dragging .neb-center .neb-head h1::after { content: ''; }
.neb.dragging::after { content: 'Let go to drop it in'; position: absolute; left: 50%; bottom: var(--s8); transform: translateX(-50%); z-index: 5; padding: var(--s2) var(--s4); border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 500; pointer-events: none; }
.neb.sealing .neb-center { transition: transform .9s var(--ease), opacity .9s; transform: scale(.85); opacity: 0; }
.neb-fly { position: fixed; z-index: 20; display: inline-flex; align-items: center; gap: var(--s2); max-width: 260px; height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--pill); background: var(--panel); border: 1px solid var(--line2); box-shadow: 0 10px 40px -10px var(--glow); font-size: 13px; pointer-events: none; white-space: nowrap; transform: translate(-50%, -50%); }
.neb-fly span { overflow: hidden; text-overflow: ellipsis; }
.neb-conns { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.neb-conn { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-md); padding: 0 var(--s3); border-radius: var(--pill); background: color-mix(in srgb, var(--panel) 75%, transparent); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; backdrop-filter: blur(10px); cursor: pointer; transition: border-color var(--t-fast), transform var(--t-base) var(--ease); }
.neb-conn:hover:not(:disabled) { border-color: var(--line2); transform: translateY(-1px); }
.neb-conn .tag { font-size: 11px; padding: 1px var(--s2); border-radius: var(--pill); background: var(--panel2); color: var(--text3); }
.neb-conn .tag.ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.neb-conn.soon { opacity: .6; cursor: default; }
.neb-conn.busy { opacity: .6; pointer-events: none; }
.neb-panel { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; max-height: calc(100svh - 96px); align-self: center; border-radius: calc(var(--r-lg) + 4px); background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid color-mix(in srgb, var(--line2) 70%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); overflow: hidden; }
.neb-panel-h { padding: var(--s4); border-bottom: 1px solid var(--line); }
.neb-count { font-weight: 600; font-size: 14px; }
.neb-items { list-style: none; margin: 0; padding: var(--s2); overflow: auto; min-height: 120px; display: grid; align-content: start; gap: 2px; }
.neb-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); padding: var(--s2); border-radius: var(--r); animation: neb-item-in .5s var(--ease); }
.neb-item.seen { animation: none; } /* a row redrawn in place (new progress, read): no entry animation again */
.neb-item:hover { background: var(--hover); }
@keyframes neb-item-in { from { opacity: 0; transform: translateX(10px); } }
.neb-item .ic { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--panel2); color: var(--text2); }
.neb-item.busy .ic .ico { animation: neb-spin 1s linear infinite; }
.neb-item.bad .ic { color: var(--bad); }
.neb-item .nm { display: grid; min-width: 0; }
.neb-item .nm b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neb-item .nm .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neb-item.bad .nm .muted { color: var(--bad); white-space: normal; }
.neb-empty { padding: var(--s6) var(--s4); text-align: center; font-size: 13px; }
.neb-panel-f { display: grid; gap: var(--s2); padding: var(--s4); border-top: 1px solid var(--line); }
.neb-close { width: 100%; }
.neb-hint { margin: 0; font-size: 12px; }
.neb-sheet { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: var(--s4); background: var(--overlay); animation: neb-fade .2s; }
@keyframes neb-fade { from { opacity: 0; } }
.neb-sheet-card { width: min(720px, 100%); max-height: calc(100svh - 32px); overflow: auto; display: grid; gap: var(--s3); padding: var(--s6); border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.neb-sheet-card h2 { margin: 0; font: 600 18px/1.3 var(--font-display); letter-spacing: -.01em; }
.neb-paste { min-height: 46svh; padding: var(--s3); resize: vertical; font: 14px/1.55 var(--font); }

/* build: the graph builds itself over the sky; the stages run along the bottom */
.neb-graph { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .6s var(--ease); }
.neb[data-screen="build"] .neb-graph, .neb[data-screen="handoff"] .neb-graph { opacity: 1; }
.neb[data-screen="build"] .neb-steps, .neb[data-screen="handoff"] .neb-steps { visibility: hidden; }
.nebs-build { place-items: end center; align-content: end; padding: var(--s4) var(--s4) var(--s5); gap: var(--s3); }
.neb-bar { width: min(820px, 100%); display: grid; gap: var(--s2); padding: var(--s3) var(--s5); border-radius: calc(var(--r-lg) + 6px); background: color-mix(in srgb, var(--panel) 72%, transparent); border: 1px solid color-mix(in srgb, var(--line2) 60%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.neb-bar-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.neb-bstep { position: relative; display: grid; justify-items: center; gap: var(--s1); font-size: 12px; color: var(--text3); text-align: center; white-space: nowrap; }
.neb-bstep::before { content: ''; position: absolute; top: 5px; left: calc(-50% + 9px); right: calc(50% + 9px); height: 1px; background: var(--line2); transition: background .4s; }
.neb-bstep:first-child::before { display: none; }
.neb-bstep .dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--line2); background: var(--raised); transition: background .4s, border-color .4s, box-shadow .4s; }
.neb-bstep.done { color: var(--text2); }
.neb-bstep.done .dot { background: var(--text); border-color: var(--text); }
.neb-bstep.done::before, .neb-bstep.on::before { background: var(--text2); }
.neb-bstep.on { color: var(--text); font-weight: 500; }
/* the stage being worked on pulses: its name breathes and a soft ring spreads from its dot */
.neb-bstep.on .l { animation: neb-step-l 1.6s ease-in-out infinite; }
.neb-bstep.on .dot::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--accent); animation: neb-step-ring 1.6s ease-out infinite; }
.neb-bstep .dot { position: relative; }
@keyframes neb-step-l { 50% { opacity: .55; } }
@keyframes neb-step-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }
.neb-bstep.on .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); animation: neb-breathe-dot 1.6s ease-in-out infinite; }
@keyframes neb-breathe-dot { 50% { box-shadow: 0 0 0 7px transparent; } }
.neb-bar-meta { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: var(--h-sm); }
.neb-bar-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text2); }
.neb-bar-help { flex: none; }
.neb-bar-help.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.neb-help { width: min(720px, 100%); max-height: min(60svh, 560px); overflow: auto; display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: neb-fade .2s; }
.neb-help p { margin: 0; }
/* handoff: the sky fades away, the graph flies onto the app's Graph view */
.nebs-handoff { place-items: end center; padding-bottom: var(--s10); }
.neb-live { display: inline-flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4) var(--s2) var(--s2); border-radius: var(--pill); background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.neb-live .neb-ring { width: 28px; height: 28px; box-shadow: 0 0 0 5px var(--accent-bg); }
.neb-live .neb-ring .ico { width: 16px; height: 16px; }
/* the app's Graph view during the hand-off: hidden while the onboarding graph flies onto it, then faded in */
#graph.handoff-hidden { opacity: 0; }
#graph.handoff-in { animation: neb-graph-in .6s var(--ease) both; }
@keyframes neb-graph-in { from { opacity: 0; } to { opacity: 1; } }
/* onboarding: nothing of the app shows (between screens, during fades, at boot) until the hand-off reveals it */
html.neb-cover #app { visibility: hidden; }
.neb.reveal { background: transparent; pointer-events: none; transition: background .9s var(--ease); }
.neb.reveal .neb-sky, .neb.reveal .neb-sky-css, .neb.reveal .neb-top, .neb.reveal .neb-stage { opacity: 0; transition: opacity .9s var(--ease); }

/* the tutorial's tooltips (Driver.js), in the app's look */
.driver-popover.neb-tour { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s4); max-width: 340px; font-family: var(--font); }
.driver-popover.neb-tour .driver-popover-title { font: 600 16px/1.3 var(--font-display); letter-spacing: -.01em; }
.driver-popover.neb-tour .driver-popover-description { color: var(--text2); font-size: 14px; line-height: 1.5; }
.driver-popover.neb-tour .driver-popover-footer button { height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--pill); border: 1px solid var(--line2); background: var(--raised); color: var(--text); text-shadow: none; font: 500 13px var(--font); }
.driver-popover.neb-tour .driver-popover-footer .driver-popover-next-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.driver-popover.neb-tour .driver-popover-close-btn { color: var(--text3); }
.driver-popover.neb-tour .driver-popover-arrow { border-color: var(--panel); }
.neb-tour-prompt { margin-top: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--accent-bg); color: var(--text); }
.neb-tour-n { margin-top: var(--s2); font-size: 12px; color: var(--text3); }

/* tablet and phone */
@media (max-width: 1100px) { .neb-steps { display: none; } }
@media (max-width: 900px) {
  .nebs-nebula { grid-template-columns: minmax(0, 1fr); padding: 0 var(--s4) var(--s4); gap: var(--s4); align-content: start; }
  .neb-panel { max-height: none; align-self: start; }
  .neb-items { max-height: 40svh; }
  .neb-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .neb-top { padding: var(--s3) var(--s4); gap: var(--s2); }
  .neb-brand span:last-child { display: none; }
  .neb-agent { max-width: 46vw; overflow: hidden; }
  .neb-screen { padding: var(--s4); }
  .neb-card { padding: var(--s5) var(--s4); gap: var(--s4); }
  .neb-uses { grid-template-columns: minmax(0, 1fr); }
  .neb-use { grid-template-columns: 36px minmax(0, 1fr); column-gap: var(--s3); }
  .neb-use .ic { grid-row: span 2; margin: 0; }
  .neb-bar { padding: var(--s3); }
  .neb-bstep:not(.on) .l { visibility: hidden; } /* dots for every stage, the name of the current one */
  .neb-bar-meta { justify-content: space-between; }
  .neb-center { padding: var(--s4) 0 0; gap: var(--s4); }
  .neb-core { width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .neb, .neb-screen, .neb-item, .neb-ring, .neb-graph, .neb.reveal *, .nebo { transition: none; animation: none; }
  .neb-core .ring, .neb-wait .orbit i, .neb-agent .live, .neb-bstep.on .dot, .neb-bstep.on .l, .neb-bstep.on .dot::after, .agent-chip .ac-dot, .orb-gas, .orb-core { animation: none; }
}

/* the overlay sits above the app; its toasts must too */
html.neb-open #toast { z-index: 9500; }

/* ── the agent chip and the Nebula launcher, at the top of the sidebar (nebulafloat.js) ── */
.nav-agent { display: flex; align-items: center; gap: var(--s1); margin: 0 0 var(--s2); }
.agent-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); height: var(--h-lg); padding: 0 var(--s2); border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.agent-chip:hover { border-color: var(--line2); }
.agent-chip .ac-ic { position: relative; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--panel2); color: var(--text2); }
.agent-chip .ac-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--panel); background: var(--line2); }
.agent-chip .ac-text { display: grid; min-width: 0; line-height: 1.25; }
.agent-chip .ac-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-chip .ac-sub { font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-chip[data-state="idle"] .ac-dot { background: var(--good); }
.agent-chip[data-state="building"] .ac-dot { background: var(--accent); animation: ac-live 1.8s infinite; }
.agent-chip[data-state="building"] .ac-ic { color: var(--accent); background: var(--accent-bg); }
.agent-chip[data-state="quiet"] .ac-dot, .agent-chip[data-state="waiting"] .ac-dot { background: var(--warn); }
.agent-chip[data-state="waiting"] .ac-sub { color: var(--warn); }
/* a shooting star just landed: the chip flares */
.agent-chip.ac-flare { animation: ac-flare 1.1s var(--ease); }
@keyframes ac-flare { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); } 100% { box-shadow: 0 0 0 14px transparent; } }
/* the shooting star from the Nebula to the agent chip (nebulafloat.js starToAgent): a bright head and a fading tail */
.neb-star { position: fixed; z-index: 9100; width: 0; height: 0; pointer-events: none; }
.neb-star .head { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--neb-core, var(--accent)); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 24px 8px color-mix(in srgb, var(--neb-glow, var(--accent)) 45%, transparent); }
.neb-star .tail { position: absolute; right: 2px; top: -1.5px; width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent)); filter: blur(.6px); }
.agent-chip[data-state="none"] .ac-name { color: var(--text2); font-weight: 500; }
@keyframes ac-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.nav-collapsed .nav-agent { flex-direction: column; gap: var(--s2); }
.nav-collapsed .agent-chip { flex: none; width: var(--h-lg); justify-content: center; padding: 0; }
.nav-collapsed .agent-chip .ac-text { display: none; }

/* ── the Nebula's orb (top right corner, always) and the Nebula over the screen (nebulafloat.js) ── */
/* the corner orb: a small night sky in the top right corner (where the voice assistant's button was), clear of the
   page's scrollbar and its header, dark enough to find at a glance on any screen */
.neb-orb { position: fixed; z-index: 8700; top: var(--s3); right: var(--s5); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--neb-gas) 55%, var(--neb-deep)), var(--neb-deep) 70%); box-shadow: 0 0 0 1px color-mix(in srgb, var(--neb-glow) 55%, transparent), 0 0 0 4px color-mix(in srgb, var(--neb-deep) 10%, transparent), 0 6px 18px -6px color-mix(in srgb, var(--neb-deep) 80%, transparent); transition: transform var(--t-base) var(--ease), box-shadow var(--t-base); }
/* page headers keep their right edge clear of it */
body.has-orb :is(.lv-head, .ph) { padding-right: calc(34px + var(--s3)); }
.neb-orb:hover { transform: scale(1.08); box-shadow: 0 0 0 1px var(--neb-glow), 0 0 0 4px color-mix(in srgb, var(--neb-glow) 18%, transparent), 0 8px 24px -6px var(--neb-glow); }
.neb-orb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.orb-gas { position: absolute; inset: -30%; border-radius: 50%; background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--neb-gas) 85%, transparent), transparent 40%, color-mix(in srgb, var(--neb-glow) 70%, transparent), transparent 75%); filter: blur(3px); animation: orb-turn 9s linear infinite; }
.orb-gas.g2 { inset: -10%; opacity: .7; animation-duration: 14s; animation-direction: reverse; background: conic-gradient(from 120deg, transparent, color-mix(in srgb, var(--neb-core) 80%, transparent) 20%, transparent 45%, color-mix(in srgb, var(--neb-gas) 70%, transparent) 70%, transparent); }
.orb-core { position: absolute; inset: 34%; border-radius: 50%; background: var(--neb-core); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--neb-core) 80%, transparent); animation: orb-breathe 3.2s ease-in-out infinite; }
.orb-x { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); opacity: 0; transform: rotate(-90deg) scale(.5); transition: opacity .25s, transform .3s var(--ease); }
.neb-orb.on { transform: scale(1.15); background: color-mix(in srgb, var(--panel) 85%, transparent); box-shadow: 0 0 0 1px var(--line2), var(--shadow); }
.neb-orb.on .orb-gas, .neb-orb.on .orb-core { opacity: 0; transition: opacity .2s; }
.neb-orb.on .orb-x { opacity: 1; transform: none; }
@keyframes orb-turn { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 50% { transform: scale(.7); opacity: .75; } }
html.neb-open .neb-orb, html.neb-open .nebo, html.neb-cover .neb-orb, html.ob-open .neb-orb { display: none; }

.nebo { position: fixed; z-index: 8600; display: grid; grid-template-rows: 1fr auto; place-items: center; color: var(--text); clip-path: circle(0 at var(--ox, 100%) var(--oy, 0)); transition: clip-path .7s cubic-bezier(.6, 0, .2, 1); }
.nebo.in { clip-path: circle(150% at var(--ox, 100%) var(--oy, 0)); }
.nebo.out { clip-path: circle(0 at var(--ox, 100%) var(--oy, 0)); transition-duration: .42s; pointer-events: none; }
.nebo-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nebo.no-gl::before { content: ''; position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(30% 34% at 50% 45%, color-mix(in srgb, var(--neb-core) 75%, transparent), transparent 70%),
  radial-gradient(50% 50% at 46% 48%, color-mix(in srgb, var(--neb-glow) 40%, transparent), transparent 72%),
  radial-gradient(70% 65% at 56% 44%, color-mix(in srgb, var(--neb-gas) 55%, transparent), transparent 76%); }
.nebo-center { position: relative; display: grid; justify-items: center; gap: var(--s5); padding: var(--s6) var(--s4); text-align: center; }
.nebo-foot { position: relative; width: 100%; display: grid; justify-items: center; gap: var(--s4); padding: 0 var(--s4) var(--s6); }
/* the bottom row: files and paste first, then the accounts */
.nebo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s2); max-width: 100%; padding: var(--s1) var(--s6); }
.nebo-row .nebo-conns { display: contents; }
.nebo-row .neb-conn { flex: none; height: var(--h-lg); padding: 0 var(--s4); font-size: 14px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.nebo-row .nebo-pick.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nebo-row .nebo-pick.primary:hover { border-color: var(--accent); }
/* things are waiting and the agent isn't checking in */
.nebo-wake { display: grid; justify-items: center; gap: var(--s2); max-width: 460px; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 86%, transparent); border: 1px solid var(--line2); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nebo-wake .muted { font-size: 13px; }

.nebo.dragging::after { content: 'Let go to drop it in'; position: absolute; left: 50%; top: var(--s8); transform: translateX(-50%); padding: var(--s2) var(--s4); border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 500; pointer-events: none; }
.neb-sheet.nebf-sheet { position: fixed; z-index: 8800; }
body:has(.nebo) #toast { z-index: 8800; }
@media (max-width: 600px) {
  .nebo-foot { padding: 0 var(--s2) var(--s5); }
  .nebo-row { padding: var(--s1) 0; gap: var(--s1); }
  .nebo-row .neb-conn { height: var(--h-md); padding: 0 var(--s3); font-size: 13px; }
}

/* hold to talk (holdtalk.js): the mic, the two modes (Instructions / Notes) and what it heard */
.ht { position: relative; display: grid; justify-items: center; gap: var(--s2); }
.ht-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s4) var(--s1) var(--s1); border-radius: var(--pill); background: color-mix(in srgb, var(--panel) 82%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.ht-mic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .12s, background .12s; }
.ht-mic:hover { transform: scale(1.05); }
.ht-mic:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ht.on .ht-mic { background: var(--bad); transform: scale(1.1); animation: ht-ring 1.2s ease-out infinite; }
.ht.busy .ht-mic { opacity: .6; cursor: progress; }
@keyframes ht-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.ht-side { display: grid; gap: 3px; justify-items: start; text-align: left; }
.ht-label { font-size: 12.5px; color: var(--text2); }
.ht-modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--pill); background: var(--panel2); }
.ht-mode { font-size: 12px; padding: 2px var(--s3); border: 0; border-radius: var(--pill); background: transparent; color: var(--text2); cursor: pointer; }
.ht-mode.on { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line2); }
.ht-live { max-width: min(520px, calc(100vw - 2 * var(--s4))); padding: var(--s2) var(--s3); border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; text-align: left; overflow-wrap: anywhere; }
.ht-live.muted { color: var(--text3); }
.ht-live.bad { color: var(--bad); }
/* in the build bar: compact, what it heard floats above */
.neb-bar .ht { justify-items: end; }
.neb-bar .ht-row { padding: 2px var(--s3) 2px 2px; background: transparent; border-color: transparent; backdrop-filter: none; }
.neb-bar .ht-mic { width: 36px; height: 36px; }
.neb-bar .ht-label { display: none; }
.neb-bar-more { font-size: 12.5px; white-space: nowrap; }

/* onboarding: how far back imported tasks stay open */
.neb-window { display: grid; gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 70%, transparent); text-align: left; }
.neb-window-h { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; font-size: 14px; }
.neb-window-v { font-weight: 600; }
.neb-window-rec { font-size: 11px; padding: 1px var(--s2); border-radius: var(--pill); background: var(--accent-bg); color: var(--accent); }
.neb-range { width: 100%; accent-color: var(--accent); }
.neb-window-ends { display: flex; justify-content: space-between; font-size: 12px; }
.neb-window p { margin: 0; font-size: 12.5px; }
@media (max-width: 600px) {
  .neb-orb { top: var(--s2); right: var(--s3); width: 30px; height: 30px; }
  body.has-orb :is(.lv-head, .ph) { padding-right: calc(30px + var(--s2)); }
  .ht-row { padding-right: var(--s3); }
  .neb-bar-more { display: none; }
  .neb-bar-meta { flex-wrap: wrap; }
  .neb-bar .ht { flex: 1 0 100%; justify-items: center; }
}

/* what hold-to-talk hears, floating over the Nebula (never over the controls) until it's sucked into the core */
.ht-live.ht-float { position: absolute; z-index: 5; left: 50%; top: 30%; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 2 * var(--s5))); font-size: 15px; line-height: 1.45; padding: var(--s3) var(--s4); pointer-events: none; transform-origin: center; }
.ht-kind { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ht-live.bad .ht-kind, .ht-live.muted .ht-kind { display: none; }
.nebo-talk .ht-label { color: var(--text2); }
