:root {
  --ink: #292824;
  --muted: #77736d;
  --paper: #fffdf8;
  --paper-deep: #faf7ef;
  --line: rgba(45, 43, 38, .11);
  --shadow: 0 18px 55px rgba(71, 65, 53, .10), inset 0 1px 1px rgba(255,255,255,.72);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-width: 0; min-height: 100%; color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; overflow-x: hidden; overscroll-behavior-y: none; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 220, 200, .24), transparent 25%),
    radial-gradient(circle at 84% 14%, rgba(207, 233, 255, .28), transparent 26%),
    var(--paper);
  isolation: isolate;
}
.app:not(.colliding):not(.final) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app:not(.colliding):not(.final) > .topbar,
.app:not(.colliding):not(.final) > .intro,
.app:not(.colliding):not(.final) > .composer { flex: 0 0 auto; }
.app:not(.colliding):not(.final) > .playground { flex: 1 1 auto; height: auto; min-height: 0; }
.app::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .19; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }

.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 8px clamp(20px,4vw,64px) 0; padding: max(8px,env(safe-area-inset-top)) max(20px,calc(env(safe-area-inset-right) + 20px)) 0 max(20px,calc(env(safe-area-inset-left) + 20px)); position: relative; z-index: 12; }
.brand { text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.055em; font-size: 1.45rem; }
.brand span { color: #9d8af1; display: inline-block; margin-left: 2px; transform: translateY(-7px); font-size: 1.05rem; }
.quiet-action { min-height: 44px; display: none; place-items: center; border: 0; background: none; padding: 8px 3px; cursor: pointer; color: var(--muted); font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .35s, color .2s; }
.quiet-action.visible { display: inline-grid; opacity: 1; pointer-events: auto; }
.quiet-action:hover { color: var(--ink); }

.intro { text-align: center; padding: 30px 18px 15px; transition: opacity .55s, transform .55s; position: relative; z-index: 4; }
.eyebrow { margin: 0 0 12px; color: #8877d4; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.intro h1 { margin: 0; font-size: clamp(2.15rem, 5.2vw, 4.8rem); line-height: .98; letter-spacing: -.065em; font-weight: 600; }
.intro > p:last-child { margin: 20px auto 0; max-width: 670px; font-size: clamp(.98rem, 1.3vw, 1.12rem); line-height: 1.55; color: var(--muted); }
.app.colliding .intro, .app.final .intro { transform: translateY(-8px); }
.app.colliding .intro { opacity: .22; }
.app.final .eyebrow, .app.final #support { display: none; }
.app.final .intro { padding-bottom: 4px; }
.app.final .intro h1 { font-size: clamp(2rem, 4.2vw, 3.8rem); }

.composer { max-width: 850px; margin: 20px auto 14px; padding: 0 18px; position: relative; z-index: 11; transition: opacity .4s, transform .4s; }
.composer-row { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.composer form { flex: 1 1 610px; display: flex; align-items: center; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 999px; padding: 6px 7px 6px 22px; box-shadow: 0 11px 35px rgba(80,72,58,.08); backdrop-filter: blur(12px); transition: transform .22s, box-shadow .22s; }
.composer form:focus-within { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(80,72,58,.12); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.composer input::placeholder { color: #9c9891; }
.composer form button { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg,#8d7be2,#e49ab5 55%,#f1bc72); box-shadow: 0 7px 18px rgba(126,99,193,.26), inset 0 1px 1px rgba(255,255,255,.52); color: white; font-size: 1.45rem; line-height: 1; transition: transform .22s, box-shadow .22s; }
.composer form button:hover { transform: rotate(8deg) scale(1.08); box-shadow: 0 10px 22px rgba(126,99,193,.32), inset 0 1px 1px rgba(255,255,255,.58); }
.composer.bounce form { animation: composer-pop .34s ease; }
.suggestions { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; width: min(100%,790px); margin: 12px auto 0; color: #99948d; font-size: .77rem; }
.suggestion-label { padding-left: 3px; font-size: .8rem; }
.suggestion-controls { position: relative; min-width: 0; }
.suggestion-marquee { min-width: 0; overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: none; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; mask-image: linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent); -webkit-mask-image: linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent); }
.suggestion-marquee::-webkit-scrollbar { display: none; }
.suggestion-marquee.dragging { cursor: grabbing; }
.suggestion-track { display: flex; width: max-content; gap: 8px; padding: 3px 26px; }
.suggestion-arrow { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 32px; height: 32px; padding: 0 0 3px; border: 1px solid rgba(101,88,142,.13); border-radius: 50%; background: rgba(255,255,255,.72); color: #7568a1; box-shadow: 0 6px 18px rgba(92,76,132,.12), inset 0 1px 1px rgba(255,255,255,.85); backdrop-filter: blur(10px); cursor: pointer; font-family: Georgia,serif; font-size: 1.48rem; line-height: 1; transform: translateY(-50%); transition: transform .2s cubic-bezier(.2,.8,.3,1), box-shadow .2s, background .2s, opacity .2s; }
.suggestion-arrow.previous { left: -5px; }
.suggestion-arrow.next { right: -5px; }
.suggestion-arrow:hover, .suggestion-arrow:focus-visible { outline: none; background: rgba(250,247,255,.94); transform: translateY(calc(-50% - 2px)) scale(1.05); box-shadow: 0 10px 24px rgba(126,99,193,.2), 0 0 0 4px rgba(220,213,255,.35), inset 0 1px 1px rgba(255,255,255,.9); }
.suggestion-arrow:active { transform: translateY(-50%) scale(.93); }
.suggestion-group { display: flex; align-items: center; gap: 8px; }
.suggestion-chip { min-height: 36px; flex: 0 0 auto; border: 1px solid rgba(76,70,65,.08); border-radius: 999px; padding: 7px 13px; color: #514d48; cursor: pointer; font-size: .79rem; font-weight: 600; white-space: nowrap; box-shadow: 0 5px 14px rgba(73,65,53,.055), inset 0 1px 1px rgba(255,255,255,.58); transition: transform .2s, box-shadow .2s, filter .2s; }
.suggestion-chip.technology { background: #d9d2ff; }
.suggestion-chip.field { background: #c9eafa; }
.suggestion-chip.human { background: #ffddc9; }
.suggestion-chip.principle { background: #fff0ad; }
.suggestion-chip.creative { background: #d5f1df; }
.suggestion-chip:hover, .suggestion-chip:focus-visible { color: #39353f; transform: translateY(-2px) rotate(-1deg); filter: saturate(1.08); outline: none; box-shadow: 0 8px 18px rgba(92,76,132,.13), 0 0 0 3px rgba(255,255,255,.8), inset 0 1px 1px rgba(255,255,255,.68); }
.app.colliding .composer, .app.final .composer { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.app.final .composer { height: 0; margin-block: 0; padding-block: 0; overflow: hidden; }

.playground { --active-bubble-color: #dcd5ff; --drag-x: 50%; --drag-y: 50%; height: max(510px, calc(100vh - 360px)); height: max(510px, calc(100dvh - 360px)); min-height: 510px; position: relative; overflow: hidden; z-index: 2; }
.playground::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle 210px at var(--drag-x) var(--drag-y), color-mix(in srgb,var(--active-bubble-color) 28%,transparent), transparent 72%); transition: opacity .45s ease; }
.playground.drag-active::before { opacity: .68; transition-duration: .18s; }
.app.final .playground { height: max(560px, calc(100vh - 210px)); height: max(560px, calc(100dvh - 210px)); }
.collision-stage-open { overflow: hidden; }
.app.collision-stage .topbar { position: fixed; inset: 0 0 auto; z-index: 29; background: rgba(255,253,248,.84); box-shadow: 0 1px 0 rgba(86,76,102,.07); backdrop-filter: blur(18px); }
.app.collision-stage .intro,.app.collision-stage .composer { visibility: hidden; pointer-events: none; }
.app.collision-stage .playground { position: fixed; inset: var(--collision-stage-top,60px) 0 0; z-index: 20; width: 100%; height: auto !important; min-height: 0; max-height: none; border-radius: 30px 30px 0 0; background: radial-gradient(circle at 50% 48%,rgba(232,224,255,.35),transparent 28%),radial-gradient(circle at 18% 20%,rgba(207,233,255,.24),transparent 34%),radial-gradient(circle at 83% 75%,rgba(255,222,201,.26),transparent 36%),rgba(255,253,249,.985); box-shadow: 0 -24px 70px rgba(83,65,113,.16),inset 0 1px 0 rgba(255,255,255,.92); isolation: isolate; }
.app.collision-stage .playground::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 18px 42px rgba(255,255,255,.5); }
.zone-label { position: absolute; left: clamp(18px, 5vw, 72px); z-index: 1; color: rgba(62,59,53,.35); font-size: .69rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; transition: opacity .4s; }
.raw-label { top: 18px; }
.discovery-label { bottom: 24px; opacity: 0; }
.app.colliding .discovery-label, .app.final .discovery-label { opacity: 1; }
.app.final .raw-label { opacity: 0; }
.play-hint { position: absolute; right: clamp(18px,5vw,72px); bottom: 22px; z-index: 8; color: rgba(83,73,103,.55); font-size: .74rem; letter-spacing: .025em; opacity: 0; transform: translateY(5px); transition: opacity .4s, transform .4s; pointer-events: none; }
.app.final .play-hint { opacity: 1; transform: translateY(0); }
.sound-toggle { position: absolute; z-index: 9; right: clamp(18px,5vw,72px); bottom: 47px; min-height: 34px; padding: 6px 10px; border: 1px solid rgba(99,82,133,.1); border-radius: 999px; background: rgba(255,255,255,.58); color: rgba(83,73,103,.62); opacity: 0; pointer-events: none; cursor: pointer; font-size: .66rem; font-weight: 700; backdrop-filter: blur(10px); transition: opacity .3s, transform .2s, background .2s; }
.app.final .sound-toggle { opacity: 1; pointer-events: auto; }
.sound-toggle:hover, .sound-toggle:focus-visible, .sound-toggle.active { outline: none; background: rgba(239,233,255,.92); color: #65518e; transform: translateY(-1px); }
.ambient-bubbles { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; transition: opacity .3s; }
.ambient-bubbles.gone { opacity: 0; }
.ambient-bubbles i { --size: 104px; --x: 12%; --y: 22%; --tint: rgba(220,213,255,.31); position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); border-radius: 50%; border: 1px solid rgba(86,80,100,.09); background: radial-gradient(circle at 32% 25%, rgba(255,255,255,.88) 0 7%, var(--tint) 38%, rgba(255,255,255,.12) 74%); box-shadow: inset 8px 10px 24px rgba(255,255,255,.42), 0 18px 45px rgba(86,77,65,.055); opacity: .72; animation: ambient-float 5.6s ease-in-out infinite alternate; transform-origin: center; }
.ambient-bubbles i::after { content: ""; position: absolute; left: 21%; top: 15%; width: 35%; height: 18%; border-radius: 50%; background: rgba(255,255,255,.48); filter: blur(4px); transform: rotate(-18deg); }
.ambient-bubbles i:nth-child(2) { --size: 68px; --x: 29%; --y: 8%; --tint: rgba(207,233,255,.35); animation-delay: -.9s; animation-duration: 4.8s; }
.ambient-bubbles i:nth-child(3) { --size: 138px; --x: 41%; --y: 30%; --tint: rgba(212,244,226,.29); animation-delay: -2.2s; animation-duration: 6.4s; }
.ambient-bubbles i:nth-child(4) { --size: 82px; --x: 61%; --y: 12%; --tint: rgba(255,222,201,.34); animation-delay: -1.4s; animation-duration: 5.2s; }
.ambient-bubbles i:nth-child(5) { --size: 116px; --x: 76%; --y: 28%; --tint: rgba(255,240,184,.31); animation-delay: -3.1s; animation-duration: 6.1s; }
.ambient-bubbles i:nth-child(6) { --size: 52px; --x: 89%; --y: 7%; --tint: rgba(255,217,229,.38); animation-delay: -1.8s; animation-duration: 4.5s; }
.ambient-bubbles i:nth-child(7) { --size: 64px; --x: 7%; --y: 48%; --tint: rgba(212,243,241,.34); animation-delay: -2.8s; animation-duration: 5s; }
.ambient-bubbles i:nth-child(8) { --size: 46px; --x: 68%; --y: 48%; --tint: rgba(235,217,255,.38); animation-delay: -.4s; animation-duration: 4.3s; }
.ambient-bubbles i:nth-child(9) { --size: 84px; --x: 18%; --y: 62%; --tint: rgba(255,222,201,.3); animation-delay: -1.2s; animation-duration: 5.7s; }
.ambient-bubbles i:nth-child(10) { --size: 56px; --x: 33%; --y: 56%; --tint: rgba(207,233,255,.34); animation-delay: -3.4s; animation-duration: 4.6s; }
.ambient-bubbles i:nth-child(11) { --size: 120px; --x: 45%; --y: 68%; --tint: rgba(255,217,229,.29); animation-delay: -2.1s; animation-duration: 6.5s; }
.ambient-bubbles i:nth-child(12) { --size: 74px; --x: 58%; --y: 58%; --tint: rgba(255,240,184,.3); animation-delay: -.7s; animation-duration: 5.1s; }
.ambient-bubbles i:nth-child(13) { --size: 96px; --x: 82%; --y: 61%; --tint: rgba(212,244,226,.29); animation-delay: -2.9s; animation-duration: 6.2s; }
.ambient-bubbles i:nth-child(14) { --size: 44px; --x: 94%; --y: 52%; --tint: rgba(235,217,255,.4); animation-delay: -1.6s; animation-duration: 4.4s; }
.ambient-bubbles i:nth-child(15) { --size: 60px; --x: 4%; --y: 76%; --tint: rgba(255,240,184,.32); animation-delay: -2.4s; animation-duration: 5.4s; }
.ambient-bubbles i:nth-child(16) { --size: 150px; --x: 23%; --y: 80%; --tint: rgba(212,244,226,.25); animation-delay: -3.8s; animation-duration: 7s; }
.ambient-bubbles i:nth-child(17) { --size: 50px; --x: 39%; --y: 87%; --tint: rgba(255,217,229,.36); animation-delay: -.3s; animation-duration: 4.7s; }
.ambient-bubbles i:nth-child(18) { --size: 92px; --x: 53%; --y: 82%; --tint: rgba(207,233,255,.3); animation-delay: -2.7s; animation-duration: 6s; }
.ambient-bubbles i:nth-child(19) { --size: 62px; --x: 67%; --y: 73%; --tint: rgba(255,222,201,.34); animation-delay: -1.1s; animation-duration: 5s; }
.ambient-bubbles i:nth-child(20) { --size: 132px; --x: 78%; --y: 82%; --tint: rgba(235,217,255,.27); animation-delay: -4.1s; animation-duration: 6.8s; }
.ambient-bubbles i:nth-child(21) { --size: 48px; --x: 91%; --y: 76%; --tint: rgba(212,243,241,.36); animation-delay: -.9s; animation-duration: 4.5s; }
.ambient-bubbles i:nth-child(22) { --size: 76px; --x: 11%; --y: 91%; --tint: rgba(255,217,229,.3); animation-delay: -3.2s; animation-duration: 5.8s; }
.ambient-bubbles i:nth-child(23) { --size: 58px; --x: 62%; --y: 92%; --tint: rgba(255,240,184,.32); animation-delay: -1.9s; animation-duration: 5.2s; }
.ambient-bubbles i:nth-child(24) { --size: 88px; --x: 88%; --y: 93%; --tint: rgba(207,233,255,.29); animation-delay: -3.6s; animation-duration: 6.3s; }
.ambient-bubbles.popping i { animation: ambient-pop .54s cubic-bezier(.3,.8,.5,1) forwards; }
.ambient-bubbles.popping i:nth-child(2) { animation-delay: .045s; }
.ambient-bubbles.popping i:nth-child(3) { animation-delay: .09s; }
.ambient-bubbles.popping i:nth-child(4) { animation-delay: .135s; }
.ambient-bubbles.popping i:nth-child(5) { animation-delay: .18s; }
.ambient-bubbles.popping i:nth-child(6) { animation-delay: .225s; }
.ambient-bubbles.popping i:nth-child(7) { animation-delay: .27s; }
.ambient-bubbles.popping i:nth-child(8) { animation-delay: .315s; }
.ambient-bubbles.popping i:nth-child(n+9) { animation-delay: .34s; }
.trails, .particle-layer, .bubble-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bubble-layer { z-index: 3; }
.particle-layer, .trails { z-index: 4; }
.trails { overflow: visible; }
.trail { fill: none; stroke: rgba(157,138,241,.34); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 3 8; animation: trail-flow .65s linear infinite, trail-arrive .42s ease-out both; }
.bubble { position: absolute; display: grid; place-items: center; min-width: 92px; min-height: 66px; max-width: 180px; padding: 18px 24px; border: 1px solid rgba(72,68,62,.08); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; pointer-events: auto; user-select: none; will-change: transform; transform-origin: center; color: #35332f; text-align: center; font-size: .94rem; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; overflow: hidden; transition: box-shadow .25s, filter .25s, opacity .35s; }
.bubble::before { content: ""; position: absolute; width: 58%; height: 28%; left: 16%; top: 9%; border-radius: 50%; background: rgba(255,255,255,.38); filter: blur(7px); transform: rotate(-12deg); }
.bubble span { position: relative; z-index: 1; }
.bubble:hover, .bubble:focus-visible { box-shadow: 0 24px 58px rgba(62,57,47,.16), inset 0 1px 1px rgba(255,255,255,.8); filter: saturate(1.05); outline: none; }
.bubble.generated { min-width: 150px; min-height: 96px; max-width: 210px; padding: 26px 30px; font-size: 1.08rem; box-shadow: 0 21px 62px rgba(72,65,53,.14), inset 0 1px 1px rgba(255,255,255,.85); cursor: grab; touch-action: none; }
.bubble.generated span::after { content: " ✦"; color: rgba(83,69,139,.72); font-size: .72em; }
.bubble.generated.dragging { z-index: 14; cursor: grabbing; filter: saturate(1.12) brightness(1.035); box-shadow: 0 32px 76px rgba(82,66,112,.24), 0 0 0 6px rgba(255,255,255,.28), inset 0 1px 1px rgba(255,255,255,.9); transition: none; }
.bubble.generated.pressing { filter: saturate(1.08) brightness(1.025); box-shadow: 0 15px 42px rgba(82,66,112,.18), inset 0 2px 3px rgba(255,255,255,.86); }
.app.final .bubble.generated:not(.dragging):not(.selected):not(.considering) span { animation: idle-breathe var(--breath-duration,7s) ease-in-out infinite; }
.bubble.generated.settling span { animation: label-settle .62s cubic-bezier(.2,.9,.35,1) both !important; }
.bubble.generated.settling::before { animation: highlight-settle .7s cubic-bezier(.2,.9,.35,1) both; }
.bubble.newborn { animation: birth .72s cubic-bezier(.18,1.5,.38,1); }
.bubble.squish { animation: squish .58s ease-in-out; z-index: 3; }
.bubble.wobble { animation: wobble .48s ease-in-out; }
.bubble.considering { filter: saturate(1.1) brightness(1.025); box-shadow: 0 26px 62px rgba(91,76,128,.17), inset 0 1px 1px rgba(255,255,255,.86); }
.bubble.considering span { animation: label-breathe 1.15s ease-in-out infinite; }
.bubble.confirmed { filter: saturate(1.16) brightness(1.035); box-shadow: 0 28px 68px rgba(104,82,155,.22), inset 0 1px 1px rgba(255,255,255,.9); }
.bubble.popping { animation: pop .42s cubic-bezier(.3,.8,.5,1) forwards; pointer-events: none; }
.particle { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--particle, #dcd5ff); animation: particle-out .7s ease-out forwards; }
.collision-ripple { position: absolute; width: 20px; height: 20px; margin: -10px; border: 2px solid color-mix(in srgb,var(--ripple-color) 70%,white); border-radius: 50%; box-shadow: 0 0 20px color-mix(in srgb,var(--ripple-color) 60%,transparent); animation: contact-ripple .68s cubic-bezier(.18,.8,.3,1) forwards; }
.spark { position: absolute; color: #aa90d8; font-size: 13px; animation: sparkle .62s ease-out forwards; }
.insight-particle { position: absolute; z-index: 6; width: 6px; height: 6px; border-radius: 50%; background: var(--particle, #dcd5ff); box-shadow: 0 0 14px color-mix(in srgb, var(--particle) 75%, white); animation: insight-travel 1.05s cubic-bezier(.45,.02,.3,1) forwards; }
.idea-nucleus { position: absolute; z-index: 6; left: 50%; top: 47%; width: 34px; height: 34px; transform: translate(-50%,-50%) scale(.18); opacity: 0; pointer-events: none; transition: opacity .55s, transform .7s cubic-bezier(.18,1.45,.38,1), filter .35s; }
.idea-nucleus.visible { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.idea-nucleus span { position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff 0 13%, #eadfff 38%, #cceef0 72%, #ffdccc 100%); box-shadow: 0 0 24px rgba(148,124,211,.34), inset 0 1px 3px rgba(255,255,255,.9); animation: nucleus-breathe 1.65s ease-in-out infinite; }
.idea-nucleus i { position: absolute; inset: 0; border: 1px solid rgba(149,125,207,.24); border-radius: 50%; animation: nucleus-orbit 3.4s linear infinite; }
.idea-nucleus i:nth-child(2) { inset: -7px; border-color: rgba(113,183,190,.2); animation-duration: 4.6s; animation-direction: reverse; }
.idea-nucleus i:nth-child(3) { inset: -14px; border-style: dashed; border-color: rgba(220,154,172,.17); animation-duration: 6.2s; }
.idea-nucleus.receiving span { animation: nucleus-receive .48s cubic-bezier(.18,1.5,.38,1); }
.idea-nucleus.resolved { filter: brightness(1.08) saturate(1.2); transform: translate(-50%,-50%) scale(1.22); }
.idea-nucleus.impact { transform: translate(-50%,-50%) scale(1.5); filter: brightness(1.18) saturate(1.25); }
.collision-copy { position: absolute; left: 50%; top: calc(47% + 52px); width: min(90vw,420px); transform: translate(-50%,5px); color: #746a8f; font-size: .9rem; letter-spacing: .02em; text-align: center; opacity: 0; transition: opacity .24s, transform .24s; z-index: 7; }
.collision-copy.visible { opacity: 1; transform: translate(-50%,0); }
.empty-message { position: absolute; left: 50%; bottom: 82px; bottom: max(82px,calc(env(safe-area-inset-bottom) + 54px)); width: min(90vw,520px); transform: translateX(-50%) translateY(8px); opacity: 0; color: #7a6c91; font-size: .88rem; text-align: center; transition: opacity .25s, transform .25s; }
.empty-message.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.collide-button { position: relative; flex: 0 0 auto; max-width: 0; min-width: 0; padding: 0; overflow: hidden; border: 0 solid rgba(92,68,139,.14); border-radius: 999px; background: linear-gradient(120deg,#7e6ad1 0%,#aa7ed7 42%,#e999b2 72%,#f1bb78 100%); background-size: 180% 180%; box-shadow: 0 14px 34px rgba(111,82,165,.22), inset 0 1px 1px rgba(255,255,255,.42); color: white; cursor: pointer; font-size: .91rem; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-8px) scale(.9); transition: max-width .38s cubic-bezier(.18,1,.36,1), padding .38s, opacity .25s, transform .38s cubic-bezier(.18,1.3,.36,1), box-shadow .2s; }
.collide-button::before { content: ""; position: absolute; top: -40%; bottom: -40%; left: -42%; width: 30%; background: rgba(255,255,255,.36); filter: blur(5px); transform: rotate(18deg); transition: left .55s ease; }
.collide-button.visible { max-width: 190px; min-width: 142px; padding: 0 20px; border-width: 1px; opacity: 1; pointer-events: auto; transform: translateX(0) scale(1); animation: collide-breathe 2.8s ease-in-out infinite; }
.collide-button.visible::before { left: 115%; }
.collide-button:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 19px 42px rgba(111,82,165,.31), inset 0 1px 1px rgba(255,255,255,.5); }
.collide-button span { display: inline-block; margin-right: 5px; color: #fff4bd; animation: sparkle-turn 2.2s ease-in-out infinite; }
.app.colliding .collide-button, .app.final .collide-button { opacity: 0; pointer-events: none; }

.detail-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(255,253,248,.5); backdrop-filter: blur(7px); opacity: 0; pointer-events: none; transition: opacity .4s; }
.detail-backdrop.open { opacity: 1; pointer-events: auto; }
.idea-detail { --detail-color: #dcd5ff; position: fixed; z-index: 31; left: 50%; top: 50%; width: min(680px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); max-height: min(760px, calc(100dvh - 28px)); border: 1px solid rgba(60,56,50,.08); border-radius: 44px 54px 48px 42px; background: color-mix(in srgb, var(--detail-color) 72%, white); box-shadow: 0 35px 100px rgba(60,53,43,.22), inset 0 2px 2px rgba(255,255,255,.7); transform: translate(-50%,-44%) scale(.72); opacity: 0; pointer-events: none; transition: transform .52s cubic-bezier(.18,1.15,.34,1), opacity .28s; overflow: hidden; }
.idea-detail.open { transform: translate(-50%,-50%) scale(1); opacity: 1; pointer-events: auto; }
.detail-scroll { padding: clamp(30px, 5vw, 54px); padding-bottom: max(clamp(30px,5vw,54px),env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; max-height: min(760px, calc(100vh - 28px)); max-height: min(760px, calc(100dvh - 28px)); }
.detail-close { position: absolute; right: 16px; right: max(16px,env(safe-area-inset-right)); top: 14px; top: max(14px,env(safe-area-inset-top)); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(53,49,44,.1); background: rgba(255,255,255,.55); cursor: pointer; font-size: 1.35rem; }
.detail-kicker { margin: 0 0 7px; color: rgba(47,44,40,.58); font-size: .72rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.lineage { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 21px; font-size: .82rem; color: rgba(48,44,39,.74); }
.lineage span:not(:last-child)::after { content: " ×"; margin-left: 6px; opacity: .45; }
.idea-detail h2 { margin: 0; font-size: clamp(2.1rem, 6vw, 4.2rem); line-height: .95; letter-spacing: -.065em; }
.detail-tagline { margin: 13px 0 24px; font-weight: 600; font-size: 1.08rem; }
.detail-description { margin: 0; max-width: 590px; font-size: 1rem; line-height: 1.55; color: rgba(42,39,35,.8); }
.detail-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 26px; margin-top: 30px; padding-top: 25px; border-top: 1px solid rgba(55,51,46,.11); }
.detail-grid h3 { margin: 0 0 9px; font-size: .79rem; letter-spacing: .08em; text-transform: uppercase; }
.detail-grid p, .detail-grid ol { margin: 0; font-size: .9rem; line-height: 1.55; color: rgba(42,39,35,.76); }
.detail-grid ol { padding-left: 20px; }
.scores { display: flex; gap: 22px; margin-top: 26px; color: rgba(44,40,36,.66); font-size: .75rem; }
.scores strong { color: var(--ink); font-size: .9rem; margin-left: 3px; }
.detail-actions { display: flex; gap: 9px; margin-top: 28px; flex-wrap: wrap; }
.detail-actions button { min-height: 44px; border: 1px solid rgba(53,49,44,.12); background: rgba(255,255,255,.48); border-radius: 999px; padding: 10px 15px; cursor: pointer; font-size: .86rem; font-weight: 600; transition: transform .2s, background .2s; }
.detail-actions button:hover { transform: translateY(-2px); background: rgba(255,255,255,.68); }
#exportButton { background: rgba(255,255,255,.72); border-color: rgba(102,83,151,.18); color: #514271; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; bottom: max(24px,calc(env(safe-area-inset-bottom) + 12px)); max-width: calc(100vw - 28px); display: flex; align-items: center; gap: 12px; transform: translate(-50%, 15px); background: #312f2b; color: white; padding: 8px 9px 8px 16px; border-radius: 999px; font-size: .82rem; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%,0); pointer-events: auto; }
.toast button { min-height: 36px; padding: 6px 13px; border: 0; border-radius: 999px; background: #fff; color: #4f4264; cursor: pointer; font-size: .76rem; font-weight: 800; }

.edge-feedback { --edge-color: #dcd5ff; position: absolute; z-index: 8; pointer-events: none; opacity: 0; filter: blur(7px); transition: opacity .16s ease; }
.edge-feedback.active { opacity: .55; }
.edge-feedback.top, .edge-feedback.bottom { left: 5%; width: 90%; height: 18px; background: radial-gradient(ellipse at center,var(--edge-color),transparent 72%); }
.edge-feedback.left, .edge-feedback.right { top: 5%; height: 90%; width: 18px; background: radial-gradient(ellipse at center,var(--edge-color),transparent 72%); }
.edge-feedback.top { top: -9px; }
.edge-feedback.right { right: -9px; }
.edge-feedback.bottom { bottom: -9px; }
.edge-feedback.left { left: -9px; }

.lineage-pulses { position: fixed; inset: 0; z-index: 30; width: 100vw; height: 100vh; pointer-events: none; overflow: visible; }
.lineage-pulses path { fill: none; stroke: color-mix(in srgb,var(--lineage-color) 75%,white); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 14; filter: drop-shadow(0 0 8px var(--lineage-color)); animation: lineage-light .88s cubic-bezier(.2,.7,.3,1) forwards; }
.idea-detail.morphing { transition: none !important; will-change: transform, opacity, border-radius; }
.save-flight { position: fixed; z-index: 70; width: 42px; height: 30px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 30% 25%,#fff 0 11%,var(--save-color) 52%,color-mix(in srgb,var(--save-color) 72%,white)); border: 1px solid rgba(68,59,82,.08); box-shadow: 0 8px 25px color-mix(in srgb,var(--save-color) 76%,transparent), inset 0 1px 2px rgba(255,255,255,.9); }
.saved-trigger.received-save { animation: receive-save .54s cubic-bezier(.18,1.4,.34,1); }

@keyframes composer-pop { 50% { transform: scale(.98); } }
@keyframes ambient-float { from { transform: translate3d(-4px,-7px,0) scale(.97); } to { transform: translate3d(7px,9px,0) scale(1.035); } }
@keyframes ambient-pop { 0% { transform: scale(1); opacity: .72; } 38% { transform: scale(1.13,.88); opacity: .92; } 100% { transform: scale(.08); opacity: 0; filter: blur(4px); } }
@keyframes breathe { 0%,100% { box-shadow: 0 14px 38px rgba(67,61,49,.13); } 50% { box-shadow: 0 17px 45px rgba(127,102,181,.2); } }
@keyframes collide-breathe { 0%,100% { background-position: 0% 50%; box-shadow: 0 14px 34px rgba(111,82,165,.22), inset 0 1px 1px rgba(255,255,255,.42); } 50% { background-position: 100% 50%; box-shadow: 0 18px 42px rgba(198,105,153,.31), 0 0 0 5px rgba(176,137,225,.07), inset 0 1px 1px rgba(255,255,255,.48); } }
@keyframes sparkle-turn { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(22deg) scale(1.22); } }
@keyframes birth { 0% { opacity: 0; filter: blur(7px); } 45% { opacity: 1; filter: blur(0); } 65% { scale: 1.12 .9; } 100% { scale: 1; } }
@keyframes squish { 45% { scale: 1.17 .8; filter: saturate(1.14) brightness(1.04); } 70% { scale: .94 1.08; } 100% { scale: 1; } }
@keyframes wobble { 20% { rotate: -4deg; } 45% { rotate: 5deg; } 70% { rotate: -3deg; } }
@keyframes idle-breathe { 0%,100% { transform: translateY(0) scale(1); opacity: .94; } 50% { transform: translateY(-1px) scale(1.018); opacity: 1; } }
@keyframes label-settle { 0% { transform: translateX(3px) rotate(1deg); } 42% { transform: translateX(-2px) rotate(-.7deg); } 72% { transform: translateX(1px) rotate(.25deg); } 100% { transform: none; } }
@keyframes highlight-settle { 0% { transform: translateX(-8px) rotate(-12deg); } 55% { transform: translateX(4px) rotate(-10deg); } 100% { transform: translateX(0) rotate(-12deg); } }
@keyframes contact-ripple { 0% { transform: scale(.25); opacity: .92; } 70% { opacity: .45; } 100% { transform: scale(3.5); opacity: 0; } }
@keyframes lineage-light { 0% { stroke-dashoffset: 90; opacity: 0; } 18% { opacity: .92; } 100% { stroke-dashoffset: -120; opacity: 0; } }
@keyframes receive-save { 0%,100% { transform: scale(1); } 45% { transform: scale(1.09); box-shadow: 0 0 0 8px rgba(157,138,241,.1); } }
@keyframes pop { 0% { scale: 1; opacity: 1; } 55% { scale: 1.18; opacity: .68; filter: brightness(1.08); } 100% { scale: .12; opacity: 0; filter: blur(3px); } }
@keyframes particle-out { from { transform: translate(0,0) scale(1); opacity: .9; } to { transform: translate(var(--tx),var(--ty)) scale(.1); opacity: 0; } }
@keyframes sparkle { from { transform: translate(0,0) scale(.4) rotate(0); opacity: 0; } 30% { opacity: 1; } to { transform: translate(var(--tx),var(--ty)) scale(1) rotate(110deg); opacity: 0; } }
@keyframes trail-flow { to { stroke-dashoffset: -11; } }
@keyframes trail-arrive { from { opacity: 0; stroke-dashoffset: 28; } to { opacity: 1; } }
@keyframes label-breathe { 0%,100% { opacity: .82; } 50% { opacity: 1; } }
@keyframes nucleus-breathe { 0%,100% { transform: scale(.82); opacity: .78; } 50% { transform: scale(1.13); opacity: 1; } }
@keyframes nucleus-receive { 0% { transform: scale(.82); } 45% { transform: scale(1.55); } 100% { transform: scale(1); } }
@keyframes nucleus-orbit { to { transform: rotate(360deg); } }
@keyframes insight-travel { 0% { transform: translate3d(0,0,0) scale(.55); opacity: 0; } 15% { opacity: 1; } 82% { opacity: .9; } 100% { transform: translate3d(var(--tx),var(--ty),0) scale(.18); opacity: 0; } }

@media (max-width: 900px) {
  .composer { max-width: 720px; }
  .detail-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 720px) {
  .topbar { min-height: 58px; }
  .intro { padding: 16px 16px 10px; }
  .intro h1 br { display: none; }
  .desktop-break { display: none; }
  .intro > p:last-child { margin-top: 14px; }
  .composer { margin-top: 10px; padding-inline: 12px; padding-inline: max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right)); }
  .composer-row { flex-wrap: wrap; }
  .composer form { flex-basis: 100%; }
  .collide-button.visible { min-height: 46px; min-width: min(190px,100%); }
  .suggestions { width: 100%; margin-top: 9px; }
  .suggestion-track { padding-inline: 18px; }
  .playground { height: max(500px,calc(100dvh - 330px)); min-height: 500px; }
  .app.final .playground { height: max(560px,calc(100dvh - 150px)); }
  .ambient-bubbles i:nth-child(3) { --size: 104px; --x: 34%; }
  .ambient-bubbles i:nth-child(5) { --size: 88px; --x: 73%; }
  .ambient-bubbles i:nth-child(6), .ambient-bubbles i:nth-child(8), .ambient-bubbles i:nth-child(16), .ambient-bubbles i:nth-child(20), .ambient-bubbles i:nth-child(24) { display: none; }
  .bubble { max-width: 145px; min-width: 82px; min-height: 60px; padding: 16px 18px; font-size: .82rem; }
  .bubble.generated { min-width: 130px; max-width: 165px; min-height: 86px; padding: 22px; font-size: .94rem; }
  .idea-nucleus { top: 49%; }
  .collision-copy { top: calc(49% + 48px); font-size: .82rem; }
  .zone-label { left: 18px; }
  .play-hint { right: 18px; font-size: .68rem; }
  .scores { gap: 12px; flex-wrap: wrap; }
  .detail-scroll { padding: max(34px,env(safe-area-inset-top)) 22px max(26px,env(safe-area-inset-bottom)); }
  .idea-detail { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 30px; }
  .idea-detail h2 { padding-right: 30px; }
  .detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-actions button { width: 100%; padding-inline: 10px; }
}

@media (max-width: 420px) {
  .topbar { padding-inline: 16px; }
  .brand { font-size: 1.3rem; }
  .intro h1 { font-size: clamp(2rem,11vw,2.75rem); }
  .eyebrow { margin-bottom: 9px; }
  .composer form { padding-left: 16px; }
  .suggestion-label { padding-left: 1px; }
  .suggestion-chip { min-height: 34px; padding: 6px 11px; font-size: .76rem; }
  .suggestion-arrow { width: 27px; height: 27px; font-size: 1.22rem; opacity: .56; }
  .suggestion-arrow.previous { left: -3px; }
  .suggestion-arrow.next { right: -3px; }
  .bubble { max-width: 43vw; min-width: 76px; min-height: 58px; padding: 14px 15px; }
  .bubble.generated { min-width: 118px; max-width: 42vw; min-height: 80px; padding: 18px 16px; font-size: .88rem; }
  .play-hint { max-width: 58vw; text-align: right; line-height: 1.25; }
  .detail-actions { grid-template-columns: 1fr; }
  .scores span { flex: 1 1 28%; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .topbar { min-height: 50px; padding-top: max(4px,env(safe-area-inset-top)); }
  .intro { padding-block: 5px 4px; }
  .eyebrow, .intro > p:last-child, .suggestions { display: none; }
  .intro h1 { font-size: clamp(1.7rem,5.8vh,2.65rem); line-height: 1; }
  .composer { margin-block: 8px 4px; }
  .playground { height: max(360px,calc(100dvh - 130px)); min-height: 360px; }
  .app.final .playground { height: max(390px,calc(100dvh - 92px)); }
  .idea-detail { width: min(760px,calc(100vw - 24px)); max-height: calc(100dvh - 12px); border-radius: 26px; }
  .detail-scroll { max-height: calc(100dvh - 12px); padding: 24px 32px; }
  .detail-grid { grid-template-columns: .9fr 1.1fr; gap: 20px; margin-top: 18px; padding-top: 16px; }
  .detail-tagline { margin-bottom: 14px; }
  .detail-actions { margin-top: 18px; }
}

@media (min-width: 1600px) {
  .composer { max-width: 920px; }
  .playground { max-height: 920px; }
  .bubble.generated { min-width: 170px; max-width: 230px; min-height: 104px; }
}

@media (hover: none) {
  .bubble:hover { filter: none; }
  .suggestions button:hover, .collide-button:hover, .detail-actions button:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
  .playground::before, .edge-feedback, .lineage-pulses, .save-flight, .orbit-spark { display: none !important; }
  .suggestion-marquee { overflow-x: auto; }
}


/* Recursive collisions, local garden, and build handoff */
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-left: auto; }
.saved-trigger, .history-trigger { min-height: 40px; padding: 7px 12px; border: 1px solid rgba(88,75,115,.1); border-radius: 999px; background: rgba(255,255,255,.56); color: #655a78; cursor: pointer; font-size: .8rem; font-weight: 600; backdrop-filter: blur(10px); }
.saved-trigger span, .history-trigger span { display: inline-grid; place-items: center; }
.history-trigger { background: rgba(233,246,255,.66); color: #4f6478; }
.history-trigger span { color: #45647f; }
.bubble.generated.selected { z-index: 13; overflow: visible; filter: saturate(1.16) brightness(1.04); box-shadow: 0 0 0 4px rgba(255,255,255,.82), 0 0 0 8px rgba(143,119,218,.25), 0 25px 72px rgba(92,67,154,.27), inset 0 1px 1px rgba(255,255,255,.9); animation: selected-pulse 1.7s ease-in-out infinite; }
.bubble.generated.selected span::after { content: " ✓"; color: #6651aa; }
.orbit-spark { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; display: grid; place-items: center; color: #8d78d6; font-size: .7rem; font-style: normal; pointer-events: none; filter: drop-shadow(0 0 7px rgba(141,120,214,.7)); animation: selection-orbit 3.8s linear infinite; }
.orbit-spark:nth-of-type(2) { color: #dda0ba; animation-duration: 5.2s; animation-direction: reverse; animation-delay: -1.4s; }
.bubble.generated.second-generation { border-color: rgba(113,84,181,.24); box-shadow: 0 24px 70px rgba(111,80,178,.24), inset 0 1px 1px rgba(255,255,255,.9); }

.detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 48px 7px 0; }
.detail-meta .detail-kicker { margin: 0; }
.generation-mark { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.54); color: #695b88; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ancestry { margin: -12px 0 18px; color: rgba(69,59,82,.58); font-size: .76rem; line-height: 1.45; }
.detail-actions button.active, #saveButton.active { background: rgba(104,79,165,.14); border-color: rgba(94,67,159,.24); color: #554078; }

.selection-dock { position: fixed; z-index: 25; left: 50%; bottom: 22px; bottom: max(22px,calc(env(safe-area-inset-bottom) + 12px)); width: min(900px,calc(100vw - 28px)); display: grid; grid-template-columns: minmax(170px,.8fr) minmax(250px,1.2fr) auto; align-items: center; gap: 9px 12px; padding: 12px 13px 12px 18px; border: 1px solid rgba(89,69,132,.14); border-radius: 26px; background: rgba(255,253,249,.9); box-shadow: 0 24px 70px rgba(66,50,92,.2); backdrop-filter: blur(20px); transform: translate(-50%,calc(100% + 50px)) scale(.95); opacity: 0; pointer-events: none; transition: transform .42s cubic-bezier(.18,1.2,.34,1), opacity .25s; }
.selection-dock.open { transform: translate(-50%,0) scale(1); opacity: 1; pointer-events: auto; }
.selection-summary { min-width: 0; display: grid; gap: 2px; }
.selection-dock strong { font-size: .78rem; color: #57466f; }
.selection-summary > span { overflow: hidden; color: #80768d; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.selection-dock button { min-height: 42px; border-radius: 999px; cursor: pointer; font-size: .8rem; font-weight: 700; }
.selection-composer { min-height: 43px; display: flex; align-items: center; gap: 7px; padding: 4px 5px 4px 14px; border: 1px solid rgba(94,72,139,.13); border-radius: 999px; background: rgba(255,255,255,.72); }
.selection-composer input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #4f4658; font: inherit; font-size: .82rem; }
.selection-composer button { width: 35px; min-height: 35px; border: 0; background: linear-gradient(135deg,#8b74d7,#ee9bad); color: white; font-size: 1.1rem; }
.selection-chips { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.selection-chips:empty { display: none; }
.selection-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 29px !important; padding: 4px 5px 4px 10px; border: 1px solid rgba(91,72,129,.1); background: #efeaff; color: #5b4c78; font-size: .69rem !important; }
.selection-chip button, .selection-chip-remove { width: 24px; min-height: 24px !important; padding: 0; border: 0; background: rgba(255,255,255,.62); color: #746683; }
.selection-actions { display: flex; align-items: center; gap: 4px; }
.selection-clear { border: 0; background: transparent; color: #80768d; padding: 8px; }
.selection-collide { padding: 9px 16px; border: 1px solid rgba(98,68,157,.13); background: linear-gradient(120deg,#7e6ad1,#b77ed2 58%,#e99aac); color: #fff; box-shadow: 0 10px 25px rgba(104,76,163,.23); }
.selection-collide:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.selection-dock.busy { pointer-events: none; }
.selection-dock.busy .selection-collide { animation: collide-breathe 1.2s ease-in-out infinite; }
.selection-dock.launching .selection-chip { animation: mixer-ingredient-launch .32s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--ingredient-index) * 34ms); }
.app.recolliding .selection-dock { transform: translate(-50%,calc(100% + 50px)) scale(.96); opacity: 0; pointer-events: none; }
.app.recolliding .play-hint { opacity: 0; }

.panel-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(255,253,248,.55); backdrop-filter: blur(9px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.panel-backdrop.open { opacity: 1; pointer-events: auto; }
.saved-panel, .history-panel, .build-panel, .cloud-panel { position: fixed; z-index: 51; top: 12px; right: 12px; bottom: 12px; width: min(470px,calc(100vw - 24px)); padding: 28px; border: 1px solid rgba(66,59,52,.09); border-radius: 34px; background: rgba(255,253,248,.96); box-shadow: 0 35px 110px rgba(55,45,68,.23); transform: translateX(calc(100% + 30px)) scale(.97); opacity: 0; pointer-events: none; transition: transform .48s cubic-bezier(.18,1.05,.34,1), opacity .25s; overflow: hidden; }
.saved-panel.open, .history-panel.open, .build-panel.open, .cloud-panel.open { transform: translateX(0) scale(1); opacity: 1; pointer-events: auto; }
.build-panel { width: min(760px,calc(100vw - 24px)); display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head p { margin: 0 0 5px; color: #8877d4; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.panel-head h2 { margin: 0; font-size: clamp(1.75rem,5vw,2.7rem); letter-spacing: -.055em; line-height: 1; }
.panel-head > button { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid rgba(53,49,44,.1); border-radius: 50%; background: #fff; cursor: pointer; font-size: 1.3rem; }
.panel-support { margin: 12px 0 22px; color: var(--muted); font-size: .86rem; }
.saved-list, .history-list { display: grid; gap: 10px; max-height: calc(100dvh - 160px); padding: 2px 4px 30px 0; overflow-y: auto; }
.saved-card { position: relative; border-radius: 24px; background: color-mix(in srgb,var(--saved-color) 66%,white); box-shadow: inset 0 1px 1px rgba(255,255,255,.7); }
.saved-open { width: 100%; display: grid; gap: 5px; padding: 18px 48px 18px 20px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.saved-open small { color: rgba(65,54,79,.56); font-size: .64rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.saved-open strong { font-size: 1rem; }
.saved-open span { color: rgba(49,44,55,.7); font-size: .78rem; line-height: 1.35; }
.saved-remove { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.46); cursor: pointer; color: #756c7c; }
.saved-empty { min-height: 280px; display: grid; place-content: center; gap: 7px; text-align: center; color: #766d80; }
.saved-empty > span { font-size: 3rem; color: #c8bae9; }
.saved-empty strong { color: #51495c; }
.saved-empty p { max-width: 250px; margin: 0; font-size: .82rem; line-height: 1.45; }
.history-card { position: relative; display: grid; border-radius: 24px; background: linear-gradient(135deg,#edf6ff,#f2edff 58%,#fff1e8); overflow: hidden; }
.history-open { display: grid; gap: 6px; width: 100%; padding: 18px 52px 18px 20px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.history-open small { color: #786c87; font-size: .65rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.history-open strong { color: #40394a; font-size: 1rem; }
.history-open span { color: #746a7d; font-size: .78rem; line-height: 1.4; }
.history-remove { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); color: #756c7c; cursor: pointer; }
.bubble-remove { position: absolute; z-index: 4; top: 4px; right: 7px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.7); color: rgba(73,65,77,.68); cursor: pointer; font: 700 .9rem/1 inherit; opacity: 0; transform: scale(.82); transition: opacity .16s, transform .16s, background .16s; }
.bubble:hover .bubble-remove, .bubble:focus-within .bubble-remove { opacity: .82; transform: scale(1); }
.bubble-remove:hover, .bubble-remove:focus-visible { opacity: 1; background: rgba(255,255,255,.86); outline: 2px solid rgba(121,98,179,.25); }
.cloud-trigger { min-height: 40px; padding: 7px 11px; border: 1px solid rgba(102,87,154,.14); border-radius: 999px; background: rgba(236,231,255,.66); color: #5e4d86; cursor: pointer; font-size: .78rem; font-weight: 700; backdrop-filter: blur(10px); }
.cloud-trigger span:first-child { font-size: 1rem; }
.cloud-trigger.synced { background: rgba(215,244,226,.78); color: #416c57; }
.cloud-signed-out, .cloud-signed-in { margin-top: 26px; color: #71687b; font-size: .9rem; line-height: 1.55; }
.cloud-signed-out p, .cloud-signed-in p { margin: 0 0 18px; }
.google-sign-in { width: 100%; min-height: 50px; display: grid; place-items: center; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(70,57,93,.07); }
.google-sign-in > div { max-width: 100%; }
.google-sign-in iframe { max-width: 100%; }
.google-sign-in-loading { color: #706878; font-size: .82rem; font-weight: 650; }
.cloud-divider { display: flex; align-items: center; gap: 11px; margin: 15px 0; color: #99909f; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cloud-divider::before, .cloud-divider::after { content: ""; height: 1px; flex: 1; background: rgba(74,65,86,.1); }
.cloud-signed-out form { display: grid; gap: 10px; }
.cloud-signed-out input { min-height: 50px; width: 100%; box-sizing: border-box; padding: 0 16px; border: 1px solid rgba(91,75,134,.15); border-radius: 16px; outline: none; background: #fff; color: #4b4252; font: inherit; }
.cloud-signed-out input:focus { border-color: #a38adb; box-shadow: 0 0 0 4px rgba(163,138,219,.13); }
.cloud-signed-out button, .cloud-signed-in > button { min-height: 48px; border: 1px solid rgba(92,68,139,.14); border-radius: 999px; background: linear-gradient(120deg,#7e6ad1,#ad7fd4,#e99aac); color: #fff; cursor: pointer; font-weight: 700; }
.cloud-signed-out button:disabled { opacity: .58; cursor: wait; }
.cloud-signed-out small { display: block; margin-top: 12px; color: #8a828f; font-size: .76rem; }
.cloud-account { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg,#e3f3e9,#e6e0ff); }
.cloud-account > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.7); color: #5a6385; font-size: 1.1rem; }
.cloud-account div { display: grid; min-width: 0; }
.cloud-account strong { overflow: hidden; color: #50465a; font-size: .87rem; text-overflow: ellipsis; white-space: nowrap; }
.cloud-account small { color: #6a7871; font-size: .72rem; }
.cloud-signed-in { display: grid; gap: 11px; }
.cloud-sign-out { background: transparent !important; color: #766d80 !important; }

.build-content { flex: 1; display: grid; gap: 24px; margin-top: 24px; padding: 0 8px 110px 0; overflow-y: auto; overscroll-behavior: contain; }
.build-content section { padding-top: 20px; border-top: 1px solid rgba(55,51,46,.1); }
.build-content section:first-child { border-top: 0; }
.build-content h3 { margin: 0 0 10px; color: #695b7d; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.build-content p, .build-content li { color: rgba(42,39,35,.78); font-size: .88rem; line-height: 1.55; }
.build-content ol, .build-content ul { margin: 0; padding-left: 21px; }
.build-hero { padding: 20px !important; border: 0 !important; border-radius: 24px; background: linear-gradient(135deg,#e5ddff,#d7eff8 55%,#ffe0d3); }
.build-hero span { color: #66568b; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.build-hero p { margin: 8px 0 0; color: #40374f; font-size: 1.05rem; font-weight: 600; }
.stack-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.stack-pills span { padding: 7px 10px; border-radius: 999px; background: #f0ebff; color: #564775; font-size: .76rem; font-weight: 600; }
.milestone-list { display: grid; gap: 12px; }
.milestone-list article { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 16px; border-radius: 20px; background: #faf7ff; }
.milestone-list article > b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ded4ff; color: #594a80; font-size: .76rem; }
.milestone-list strong { font-size: .9rem; }
.milestone-list p { margin: 3px 0 8px; }
.risk-list { display: grid; gap: 8px; }
.risk-list article { display: grid; gap: 4px; padding: 13px 15px; border-radius: 16px; background: #fff4e9; }
.risk-list strong { font-size: .82rem; }
.risk-list span { color: #756a60; font-size: .78rem; line-height: 1.4; }
.next-action { padding: 18px !important; border: 0 !important; border-radius: 20px; background: #e3f3e9; }
.next-action p { margin: 0; font-weight: 600; color: #395344; }
.build-actions { position: absolute; left: 28px; right: 28px; bottom: 22px; padding-top: 18px; background: linear-gradient(transparent,rgba(255,253,248,.98) 30%); }
.build-actions button, .build-error button { width: 100%; min-height: 48px; border: 1px solid rgba(92,68,139,.14); border-radius: 999px; background: linear-gradient(120deg,#7e6ad1,#ad7fd4,#e99aac); color: white; cursor: pointer; font-weight: 700; }
.build-actions button:disabled { opacity: .42; }
.build-loading, .build-error { min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: #6d6178; }
.build-loading i { width: 72px; height: 72px; border: 2px solid rgba(126,106,209,.16); border-top-color: #8d79db; border-radius: 50%; animation: nucleus-orbit 1s linear infinite; }
.build-loading strong { color: #50465a; }
.build-loading span, .build-error p { color: #8a828f; font-size: .78rem; }
.build-error button { width: auto; padding: 8px 18px; }
.sheet-handle { display: none; }

@keyframes selected-pulse { 0%,100% { filter: saturate(1.08); } 50% { filter: saturate(1.2) brightness(1.04); } }
@keyframes selection-orbit { from { transform: rotate(0deg) translateX(clamp(62px,8vw,96px)) rotate(0deg) scale(.75); } 50% { opacity: 1; } to { transform: rotate(360deg) translateX(clamp(62px,8vw,96px)) rotate(-360deg) scale(1.05); } }

@media (max-width: 720px) {
  .topbar-actions { gap: 8px; }
  .saved-trigger, .history-trigger { padding-inline: 9px; font-size: .74rem; }
  .selection-dock { grid-template-columns: minmax(0,1fr) auto; border-radius: 22px; }
  .selection-summary, .selection-composer, .selection-chips { grid-column: 1 / -1; }
  .selection-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .selection-collide { padding-inline: 13px; }
  .saved-panel, .history-panel, .build-panel, .cloud-panel { inset: 8px; width: auto; padding: 22px; border-radius: 28px; }
  .build-actions { left: 22px; right: 22px; bottom: 16px; }
}

@media (max-width: 430px) {
  .selection-dock { gap: 8px; padding-left: 14px; }
  .selection-summary > span { max-width: 140px; }
  .selection-collide { font-size: .74rem; }
  .saved-trigger, .history-trigger { padding-inline: 7px; font-size: .68rem; }
}

/* Touch-first responsive experience */
@media (max-width: 720px) {
  html, body { overscroll-behavior-x: none; }
  .app { min-height: var(--app-height,100dvh); }
  .topbar {
    min-height: 54px;
    padding: max(7px,env(safe-area-inset-top)) max(12px,calc(env(safe-area-inset-right) + 12px)) 0 max(12px,calc(env(safe-area-inset-left) + 12px));
  }
  .topbar-actions { gap: 4px; }
  .brand { font-size: 1.25rem; }
  .quiet-action, .saved-trigger, .history-trigger, .cloud-trigger { min-height: 44px; }
  .quiet-action { padding-inline: 8px; font-size: .76rem; }
  .saved-trigger, .history-trigger, .cloud-trigger { min-width: 44px; }

  .intro { padding: 9px 14px 5px; }
  .eyebrow { margin-bottom: 7px; font-size: .65rem; }
  .intro h1 { font-size: clamp(1.9rem,10vw,3rem); line-height: .98; }
  .intro > p:last-child { margin-top: 10px; font-size: .87rem; line-height: 1.42; }
  .app.final .intro { padding: 4px 12px 1px; }
  .app.final .intro h1 { font-size: clamp(1.85rem,9.5vw,2.8rem); }

  .composer { margin: 8px auto 8px; padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right)); }
  .composer-row { gap: 8px; }
  .composer form { min-height: 56px; padding: 5px 6px 5px 17px; }
  .composer input { font-size: 16px; }
  .composer form button { flex-basis: 46px; width: 46px; height: 46px; }
  .collide-button.visible { width: 100%; max-width: none; min-height: 48px; }

  .suggestions { grid-template-columns: 24px minmax(0,1fr); gap: 2px; margin-top: 5px; }
  .suggestion-label { padding: 0; text-align: center; font-size: .72rem; }
  .suggestion-track { gap: 7px; padding: 3px 33px; }
  .suggestion-group { gap: 7px; }
  .suggestion-chip { min-height: 44px; padding: 9px 14px; font-size: .78rem; touch-action: manipulation; }
  .suggestion-arrow {
    width: 44px; height: 44px; padding: 0 0 3px; border: 0; background: transparent; box-shadow: none;
    opacity: .68; font-size: 1.32rem; isolation: isolate;
  }
  .suggestion-arrow::before {
    content: ""; position: absolute; inset: 8px; z-index: -1; border: 1px solid rgba(101,88,142,.13); border-radius: 50%;
    background: rgba(255,255,255,.75); box-shadow: 0 5px 14px rgba(92,76,132,.11), inset 0 1px 1px rgba(255,255,255,.86);
  }
  .suggestion-arrow.previous { left: -5px; }
  .suggestion-arrow.next { right: -5px; }

  .playground { height: max(520px,calc(var(--app-height,100dvh) - 286px)); min-height: 520px; }
  .app.final .playground { height: max(620px,calc(var(--app-height,100dvh) - 88px)); min-height: 620px; }
  .bubble { min-width: 78px; max-width: 43vw; min-height: 58px; padding: 14px 16px; font-size: .82rem; }
  .bubble.generated { min-width: 116px; max-width: 42vw; min-height: 80px; padding: 18px 16px; font-size: .88rem; }
  .play-hint { right: max(14px,env(safe-area-inset-right)); bottom: max(17px,env(safe-area-inset-bottom)); max-width: 67vw; font-size: .64rem; line-height: 1.25; text-align: right; }
  .zone-label { left: max(14px,env(safe-area-inset-left)); }
  .discovery-label { bottom: max(18px,env(safe-area-inset-bottom)); }

  .sheet-handle { display: block; position: absolute; z-index: 4; top: 9px; left: 50%; width: 42px; height: 5px; border-radius: 999px; background: rgba(73,65,82,.2); transform: translateX(-50%); }
  .idea-detail {
    left: 0; top: auto; right: 0; bottom: 0; width: 100%; max-height: min(94vh,var(--app-height,94dvh));
    border-width: 1px 0 0; border-radius: 28px 28px 0 0;
    transform: translateY(104%); transition: transform .42s cubic-bezier(.18,1,.34,1),opacity .24s;
  }
  .idea-detail.open { transform: translateY(0); }
  .detail-scroll { max-height: min(94vh,var(--app-height,94dvh)); padding: 38px 18px max(12px,env(safe-area-inset-bottom)); }
  .detail-close { top: 14px; right: max(14px,env(safe-area-inset-right)); }
  .detail-meta { margin-right: 48px; }
  .idea-detail h2 { padding-right: 0; font-size: clamp(2rem,12vw,3.3rem); }
  .detail-tagline { margin: 10px 0 17px; }
  .detail-description { font-size: .93rem; }
  .detail-grid { gap: 17px; margin-top: 21px; padding-top: 18px; }
  .scores { margin-top: 20px; }
  .detail-actions {
    position: sticky; z-index: 3; bottom: calc(-1 * max(12px,env(safe-area-inset-bottom))); display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 22px -18px 0; padding: 18px 18px max(14px,env(safe-area-inset-bottom));
    background: linear-gradient(transparent,color-mix(in srgb,var(--detail-color) 90%,white) 20%);
  }
  .detail-actions button { min-height: 46px; font-size: .76rem; }
  #exploreButton { grid-column: 1 / -1; }

  .selection-dock {
    bottom: max(8px,env(safe-area-inset-bottom)); width: calc(100vw - 16px); grid-template-columns: minmax(0,1fr) auto;
    gap: 7px; padding: 10px; border-radius: 21px;
  }
  .selection-summary { padding-left: 4px; }
  .selection-summary > span { max-width: none; }
  .selection-clear { display: block; min-width: 44px; min-height: 44px; padding: 6px; }
  .selection-collide { flex: 1; width: 100%; min-height: 46px; }
  .selection-dock.open ~ .toast { bottom: calc(max(8px,env(safe-area-inset-bottom)) + 190px); }

  .saved-panel, .history-panel, .build-panel {
    inset: auto 0 0; width: 100%; height: min(96vh,var(--app-height,96dvh)); padding: 38px 18px max(14px,env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: 28px 28px 0 0; transform: translateY(104%); opacity: 1;
    transition: transform .44s cubic-bezier(.18,1,.34,1);
  }
  .saved-panel.open, .history-panel.open, .build-panel.open { transform: translateY(0); }
  .panel-head h2 { font-size: clamp(1.8rem,9vw,2.55rem); }
  .panel-head > button { margin-top: -8px; }
  .panel-support { margin: 10px 0 16px; }
  .saved-list, .history-list { max-height: calc(var(--app-height,100dvh) - 170px); padding-bottom: max(30px,env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .saved-card { border-radius: 20px; }
  .saved-open { min-height: 76px; padding: 16px 50px 16px 17px; }
  .saved-remove { width: 44px; height: 44px; top: 7px; right: 7px; }
  .build-content { margin-top: 17px; padding: 0 2px 94px 0; gap: 19px; }
  .build-content p, .build-content li { font-size: .84rem; }
  .build-actions { left: 18px; right: 18px; bottom: max(12px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .build-actions button { min-width: 0; padding-inline: 9px; font-size: .76rem; }
}

@media (max-width: 360px) {
  .topbar { padding-inline: 9px; }
  .topbar-actions { gap: 0; }
  #cloudButtonLabel { display: none; }
  .quiet-action { font-size: .7rem; }
  .intro h1 { font-size: 1.9rem; }
  .intro > p:last-child { font-size: .81rem; }
  .suggestions { grid-template-columns: 20px minmax(0,1fr); }
  .suggestion-chip { padding-inline: 12px; }
  .bubble.generated { min-width: 108px; max-width: 44vw; padding-inline: 13px; font-size: .82rem; }
  .detail-scroll, .saved-panel, .history-panel, .build-panel, .cloud-panel { padding-inline: 14px; }
  .detail-actions { margin-inline: -14px; padding-inline: 14px; }
}

@media (hover: none) and (pointer: coarse) {
  .bubble-remove { width: 34px; height: 34px; opacity: .7; transform: scale(1); }
  button, .bubble, .suggestion-chip { touch-action: manipulation; }
  .bubble.generated { touch-action: none; }
  .suggestion-marquee { touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
  .suggestion-arrow:hover, .suggestion-chip:hover, .detail-actions button:hover { transform: none; }
}

@media (hover: none) and (pointer: coarse) and (max-height: 650px) and (orientation: landscape) {
  .saved-panel, .history-panel, .build-panel, .cloud-panel { height: var(--app-height,100dvh); border-radius: 0; }
  .idea-detail { max-height: var(--app-height,100dvh); border-radius: 22px 22px 0 0; }
  .detail-scroll { max-height: var(--app-height,100dvh); }
  .selection-dock { width: min(620px,calc(100vw - 20px)); }
}

/* Visual, resumable collision history */
.history-card { overflow: visible; border: 1px solid rgba(93,75,124,.09); box-shadow: 0 10px 28px rgba(74,59,96,.065); }
.history-open { grid-template-columns: 96px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px 17px; border-radius: 24px 24px 0 0; }
.history-open:hover, .history-open:focus-visible { outline: none; background: rgba(255,255,255,.35); }
.history-copy { min-width: 0; display: grid; gap: 5px; text-align: left; }
.history-copy small { text-transform: none; letter-spacing: .015em; }
.history-copy strong, .history-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-continue { color: #6e5a9c !important; font-size: .73rem !important; font-weight: 800; white-space: nowrap; }
.history-thumbnail { width: 96px; height: 66px; display: block; border: 1px solid rgba(95,80,126,.08); border-radius: 18px; background: rgba(255,255,255,.46); box-shadow: inset 0 1px 1px rgba(255,255,255,.88),0 7px 18px rgba(76,60,100,.06); }
.history-actions { display: flex; gap: 5px; padding: 0 14px 13px 122px; }
.history-actions button { min-height: 36px; padding: 7px 10px; border: 0; border-radius: 999px; background: rgba(255,255,255,.56); color: #6f6479; cursor: pointer; font-size: .69rem; font-weight: 700; }
.history-actions button:hover, .history-actions button:focus-visible { outline: none; background: #fff; color: #554369; }
.history-actions .history-remove { position: static; width: auto; height: auto; margin-left: auto; color: #946777; }
.history-rename-form { grid-column: 2 / -1; display: flex; gap: 5px; }
.history-rename-form input { min-width: 0; flex: 1; padding: 8px 10px; border: 1px solid rgba(111,89,159,.2); border-radius: 12px; outline: 0; background: rgba(255,255,255,.86); color: #40394a; font: inherit; }
.history-rename-form input:focus { box-shadow: 0 0 0 3px rgba(157,138,241,.14); }
.history-rename-form button { border: 0; border-radius: 10px; background: rgba(255,255,255,.76); color: #5e4b7c; cursor: pointer; font-size: .68rem; font-weight: 800; }

@media (max-width: 430px) {
  .history-open { grid-template-columns: 72px minmax(0,1fr); gap: 10px; }
  .history-thumbnail { width: 72px; height: 58px; border-radius: 16px; }
  .history-continue { display: none; }
  .history-actions { padding-left: 99px; overflow-x: auto; }
}

/* Generation feedback and calmer motion preferences */
.idea-skeleton { position: absolute; z-index: 2; width: 156px; height: 94px; display: grid; place-content: center; gap: 9px; border: 1px solid rgba(108,89,146,.1); border-radius: 50%; background: linear-gradient(110deg,rgba(235,229,251,.38) 22%,rgba(255,255,255,.88) 42%,rgba(225,240,246,.5) 62%); background-size: 250% 100%; box-shadow: 0 18px 45px rgba(79,65,103,.08); pointer-events: none; animation: skeleton-drift 2.4s ease-in-out infinite, skeleton-shimmer 1.5s linear infinite; transition: opacity .25s, scale .25s; }
.idea-skeleton i { display: block; width: 82px; height: 8px; border-radius: 999px; background: rgba(107,92,130,.12); }
.idea-skeleton i:last-child { width: 55px; justify-self: center; opacity: .7; }
.idea-skeleton.leaving { opacity: 0; scale: .86; }
.bubble.generated.newborn { box-shadow: 0 0 0 7px rgba(255,255,255,.58), 0 0 52px color-mix(in srgb,var(--bubble-color,#dcd5ff) 70%,transparent), 0 24px 70px rgba(71,58,94,.2); }
.trail { transition: opacity .28s; }

@keyframes skeleton-shimmer { to { background-position: -250% 0; } }
@keyframes skeleton-drift { 0%,100% { transform: translateY(0) scale(.98); } 50% { transform: translateY(-5px) scale(1.015); } }

@media (prefers-reduced-motion: reduce) {
  .idea-skeleton { animation: none !important; background: rgba(239,235,248,.72); }
  .bubble.generated.newborn { box-shadow: 0 0 0 4px rgba(157,138,241,.14), 0 20px 56px rgba(71,58,94,.14); }
}

/* First-run guide and instant sample */
.welcome-card { position: fixed; z-index: 32; left: max(18px,env(safe-area-inset-left)); bottom: max(18px,env(safe-area-inset-bottom)); width: min(390px,calc(100vw - 36px)); padding: 22px; border: 1px solid rgba(92,74,124,.12); border-radius: 28px; background: rgba(255,253,249,.96); box-shadow: 0 28px 90px rgba(63,48,86,.22); backdrop-filter: blur(22px); opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .24s, transform .32s cubic-bezier(.18,1,.34,1); }
.welcome-card.visible { opacity: 1; transform: translateY(0) scale(1); }
.welcome-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(245,241,249,.85); color: #6c6273; cursor: pointer; font-size: 1.2rem; }
.welcome-kicker { margin: 0 44px 5px 0; color: #8877d4; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.welcome-card h2 { max-width: 300px; margin: 0; font-size: 1.45rem; line-height: 1.06; letter-spacing: -.04em; }
.welcome-card ol { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 18px 0; padding: 0; list-style: none; }
.welcome-card li { min-width: 0; display: grid; gap: 6px; padding: 10px 8px; border-radius: 16px; background: linear-gradient(145deg,rgba(238,233,255,.72),rgba(255,244,237,.62)); color: #5e5568; font-size: .68rem; line-height: 1.2; }
.welcome-card li span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.75); color: #7864ad; font-weight: 800; }
.welcome-sample { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border: 0; border-radius: 999px; background: #312d39; color: white; cursor: pointer; font-weight: 750; }
.welcome-sample span { font-size: 1.1rem; }
.panel-support strong { color: #55496a; }

@media (max-width: 720px) {
  .welcome-card { left: 6px; right: 6px; bottom: max(6px,env(safe-area-inset-bottom)); width: auto; padding: 20px 16px 16px; border-radius: 25px; }
  .welcome-card h2 { font-size: 1.28rem; }
  .welcome-card ol { margin: 14px 0; }
}

/* Polished hierarchy and compact workspace navigation */
.topbar { padding-top: max(10px,env(safe-area-inset-top)); }
.topbar-actions { gap: 7px; }
.utility-trigger {
  position: relative; width: 46px; min-width: 46px; height: 46px; min-height: 46px; display: inline-grid; place-items: center;
  padding: 0; border: 1px solid rgba(78,68,92,.1); border-radius: 50%; background: rgba(255,255,255,.66);
  color: #5f5868; box-shadow: 0 7px 22px rgba(67,56,84,.055); backdrop-filter: blur(14px); cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.utility-trigger:hover, .utility-trigger:focus-visible { z-index: 2; outline: none; transform: translateY(-2px); background: rgba(255,255,255,.92); box-shadow: 0 10px 26px rgba(67,56,84,.1); }
.utility-icon { display: grid; place-items: center; font-size: 1.12rem; line-height: 1; }
.utility-trigger[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; top: calc(100% + 7px); left: 50%; padding: 5px 8px; border-radius: 8px;
  background: #302d34; color: white; font-size: .67rem; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none;
  transform: translate(-50%,-3px); transition: opacity .16s, transform .16s;
}
.utility-trigger[data-tooltip]:hover::after, .utility-trigger[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%,0); }
.cloud-trigger, .history-trigger, .saved-trigger { background: rgba(255,255,255,.66); color: #5f5868; }
.cloud-trigger.synced { border-color: rgba(75,146,105,.2); background: rgba(207,242,220,.92); color: #2f7650; box-shadow: 0 8px 24px rgba(72,143,103,.14); }
.cloud-trigger.syncing .utility-icon { animation: cloud-breathe 1.1s ease-in-out infinite alternate; }
.cloud-trigger.sync-error { border-color: rgba(194,128,55,.2); background: rgba(255,237,205,.92); color: #9a642a; }
@keyframes cloud-breathe { to { opacity: .48; transform: scale(.88); } }

.intro { padding-top: clamp(18px,3vh,34px); }
.intro h1 { max-width: 1120px; margin-inline: auto; font-size: clamp(2.1rem,4.65vw,4.25rem); line-height: 1; }
.intro > p:last-child { max-width: 610px; margin-top: 16px; }
.composer { margin-top: 16px; }
.composer form { border-color: rgba(105,83,155,.17); box-shadow: 0 14px 42px rgba(80,65,111,.11), inset 0 1px 1px rgba(255,255,255,.82); }
.collide-button.visible { box-shadow: 0 14px 32px rgba(111,82,165,.26); }

.playground-zone { position: absolute; z-index: 0; pointer-events: none; border: 1px solid rgba(87,76,102,.055); opacity: .78; transition: opacity .45s, transform .45s; }
.raw-zone { inset: 8px clamp(12px,3vw,42px) 12px; border-radius: 42px 42px 18px 18px; background: linear-gradient(180deg,rgba(239,246,255,.38),rgba(255,253,248,.08) 62%); }
.discovery-zone { inset: 8px clamp(12px,3vw,42px) 12px; border-radius: 42px 42px 18px 18px; background: linear-gradient(180deg,rgba(247,242,255,.2),rgba(255,240,232,.32)); opacity: 0; }
.app:not(.colliding):not(.final) .playground-zone { border-color: transparent; }
.app:not(.colliding):not(.final) .raw-zone { background: transparent; }
.app.final .raw-zone { opacity: 0; transform: scale(.985); }
.app.final .discovery-zone, .app.colliding .discovery-zone { opacity: .82; }
.zone-label { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.55); backdrop-filter: blur(8px); }

@media (max-width: 720px) {
  .utility-trigger { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .topbar-actions { gap: 3px; }
  .intro h1 { font-size: clamp(1.85rem,8.8vw,2.65rem); }
  .intro > p:last-child { max-width: 350px; }
  .playground-zone { inset-inline: 7px; border-radius: 28px 28px 14px 14px; }
  .sound-toggle { right: max(14px,env(safe-area-inset-right)); bottom: calc(max(17px,env(safe-area-inset-bottom)) + 32px); min-height: 40px; }
}

@media (max-height: 700px) {
  .intro { padding-top: 6px; }
  .intro h1 { font-size: clamp(1.8rem,7vh,2.8rem); white-space: nowrap; }
  .intro > p:last-child { margin-top: 8px; }
}

/* Collision mixing bowl */
.selection-dock {
  grid-template-columns: minmax(180px,.75fr) minmax(280px,1.25fr) auto;
  isolation: isolate; overflow: hidden; padding: 14px 15px 13px 20px; border-color: rgba(113,81,171,.16); border-radius: 34px;
  background:
    radial-gradient(circle at 12% 20%,rgba(220,213,255,.38),transparent 36%),
    radial-gradient(circle at 88% 80%,rgba(255,218,205,.34),transparent 34%),
    rgba(255,253,249,.94);
}
.selection-dock::before { content: ""; position: absolute; inset: 5px; z-index: 0; border: 1px solid rgba(255,255,255,.72); border-radius: 29px; pointer-events: none; }
.selection-dock > :not(.selection-ambience) { position: relative; z-index: 2; }
.selection-ambience { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.selection-ambience i { --mini-size: 18px; --mini-x: 8%; --mini-y: 18%; --mini-color: #dcd5ff; position: absolute; left: var(--mini-x); top: var(--mini-y); width: var(--mini-size); height: var(--mini-size); border: 1px solid color-mix(in srgb,var(--mini-color) 68%,white); border-radius: 50%; background: radial-gradient(circle at 30% 24%,rgba(255,255,255,.96) 0 12%,color-mix(in srgb,var(--mini-color) 72%,white) 42%,color-mix(in srgb,var(--mini-color) 56%,transparent) 100%); box-shadow: inset 3px 3px 7px rgba(255,255,255,.72),0 7px 14px color-mix(in srgb,var(--mini-color) 35%,transparent); opacity: .58; animation: mixer-mini-float 4.8s ease-in-out infinite alternate; }
.selection-ambience i:nth-child(2) { --mini-size: 11px; --mini-x: 29%; --mini-y: 67%; --mini-color: #cfe9ff; animation-delay: -1.4s; }
.selection-ambience i:nth-child(3) { --mini-size: 24px; --mini-x: 63%; --mini-y: 12%; --mini-color: #d4f4e2; animation-delay: -2.7s; }
.selection-ambience i:nth-child(4) { --mini-size: 14px; --mini-x: 82%; --mini-y: 64%; --mini-color: #ffd9e5; animation-delay: -.8s; }
.selection-ambience i:nth-child(5) { --mini-size: 9px; --mini-x: 94%; --mini-y: 18%; --mini-color: #fff0b8; animation-delay: -3.3s; }
.selection-kicker { color: #8a75ca !important; font-size: .61rem !important; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.selection-summary strong { font-size: .84rem; }
.selection-composer { min-height: 48px; border-color: rgba(112,88,167,.18); background: rgba(255,255,255,.82); box-shadow: inset 0 1px 1px rgba(255,255,255,.9); }
.selection-composer button { width: 38px; min-height: 38px; }
.selection-chips { min-height: 56px; align-items: center; gap: 9px; padding: 4px 5px 3px; }
.selection-chip { position: relative; min-height: 48px !important; max-width: 220px; padding: 9px 30px 9px 15px; border-color: color-mix(in srgb,var(--ingredient-color) 72%,#756590); border-radius: 52% 48% 46% 54% / 58% 48% 52% 42%; background: radial-gradient(circle at 28% 18%,rgba(255,255,255,.92) 0 8%,color-mix(in srgb,var(--ingredient-color) 72%,white) 45%,var(--ingredient-color) 100%); color: #554b62; box-shadow: inset 5px 6px 13px rgba(255,255,255,.5),0 9px 20px color-mix(in srgb,var(--ingredient-color) 42%,transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: mixer-ingredient-float 3.2s ease-in-out infinite alternate; animation-delay: calc(var(--ingredient-index) * -430ms); }
.selection-chip::before { content: ""; position: absolute; left: 16%; top: 12%; width: 32%; height: 16%; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(2px); transform: rotate(-11deg); pointer-events: none; }
.selection-chip.discovery-ingredient,.selection-chip.thought-ingredient { background-color: var(--ingredient-color); color: #554b62; }
.selection-chip button,.selection-chip-remove { position: absolute; right: 4px; top: 4px; width: 24px; min-height: 24px !important; background: rgba(255,255,255,.72); box-shadow: 0 3px 9px rgba(83,69,103,.09); }
.selection-actions { justify-content: flex-end; }
.selection-help { max-width: 116px; color: #877e8f; font-size: .66rem; line-height: 1.2; text-align: right; }
.selection-collide { min-height: 46px !important; padding-inline: 18px; white-space: nowrap; }

@keyframes mixer-mini-float { to { transform: translate3d(6px,-8px,0) scale(1.08); opacity: .78; } }
@keyframes mixer-ingredient-float { to { transform: translateY(-3px) rotate(.6deg); } }
@keyframes mixer-ingredient-launch { 55% { transform: translateY(-13px) scale(1.04); opacity: 1; } 100% { transform: translateY(-30px) scale(.82); opacity: 0; } }

@media (max-width: 720px) {
  .selection-dock { bottom: calc(max(8px,env(safe-area-inset-bottom)) + var(--keyboard-offset,0px)); grid-template-columns: 1fr; width: calc(100vw - 12px); padding: 14px 12px 11px; border-radius: 28px; }
  .selection-summary, .selection-composer, .selection-chips, .selection-actions { grid-column: 1; }
  .selection-chips { min-height: 51px; }
  .selection-chip { min-height: 44px !important; max-width: 190px; }
  .selection-actions { display: grid; grid-template-columns: 1fr auto auto; width: 100%; }
  .selection-help { justify-self: start; max-width: 120px; text-align: left; }
  .selection-clear { min-width: 44px; }
  .selection-collide { min-height: 48px !important; }

  .cloud-panel {
    inset: auto 0 0; width: 100%; height: min(96vh,var(--app-height,96dvh)); padding: 38px 18px max(14px,env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: 28px 28px 0 0; transform: translateY(104%); opacity: 1;
    transition: transform .44s cubic-bezier(.18,1,.34,1);
  }
  .cloud-panel.open { transform: translateY(0); }
  .history-actions button { min-width: 44px; min-height: 44px; }
}

@media (max-width: 720px) and (max-height: 700px) {
  .intro h1 { white-space: normal; font-size: clamp(1.7rem,7.7vw,2.35rem); }
  .intro > p:last-child { display: none; }
  .composer { margin-top: 8px; }
}

body.keyboard-open .suggestions { display: none; }
body.keyboard-open .composer { margin-top: 4px; }
body.keyboard-open .selection-dock.open ~ .toast { bottom: calc(var(--keyboard-offset,0px) + 190px); }

@media (hover: none) and (pointer: coarse) {
  .bubble-remove { top: -4px; right: -2px; width: 44px; height: 44px; opacity: .76; transform: scale(1); }
}

/* Keep the homepage workspace inside one visible browser window. */
.app:not(.collision-stage) {
  height: var(--app-height,100dvh);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app:not(.collision-stage) > .topbar,
.app:not(.collision-stage) > .intro,
.app:not(.collision-stage) > .composer { flex: 0 0 auto; }
.app:not(.collision-stage) > .playground {
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
}
.app.colliding:not(.collision-stage) .composer {
  height: 0;
  margin-block: 0;
  padding-block: 0;
  overflow: hidden;
}
.app.colliding:not(.collision-stage) .intro { padding-block: 7px 5px; }
.app.colliding:not(.collision-stage) .eyebrow,
.app.colliding:not(.collision-stage) #support { display: none; }
.app.colliding:not(.collision-stage) .intro h1 { font-size: clamp(1.9rem,4.4vh,3.15rem); }

@media (max-height: 800px) {
  .app:not(.collision-stage):not(.final):not(.colliding) .intro { padding-top: 8px; padding-bottom: 6px; }
  .app:not(.collision-stage):not(.final):not(.colliding) .intro h1 { font-size: clamp(2rem,6.4vh,3.35rem); }
  .app:not(.collision-stage):not(.final):not(.colliding) .intro > p:last-child { margin-top: 9px; }
  .app:not(.collision-stage):not(.final):not(.colliding) .composer { margin-top: 8px; margin-bottom: 7px; }
}
