/* Liquid Glass – Feinschliff-Layer (zuletzt geladen). Dezent, hell, Apple-clean.
   Akzentfarbe kommt vom gewählten Agenten: --agent-rgb (siehe src/server/agent-colors.mjs). */
:root{--agent-rgb:150,114,245;--agent:rgb(var(--agent-rgb));
 --accent:color-mix(in srgb,var(--agent) 80%,#1d1830);
 --soft:color-mix(in srgb,var(--agent) 10%,transparent);
 --lg-fill:linear-gradient(145deg,rgba(255,255,255,.40),rgba(255,255,255,.14) 55%,rgba(255,255,255,.26));
 --lg-edge:rgba(255,255,255,.6);
 --lg-shadow:inset 0 1.5px 0 rgba(255,255,255,.95),inset 0 -1px 0 rgba(255,255,255,.35),inset 1px 0 0 rgba(255,255,255,.4),inset 0 0 22px rgba(255,255,255,.18),0 1px 1px rgba(40,28,90,.04),0 18px 44px -24px rgba(60,40,140,.30);
 --lg-blur:blur(26px) saturate(200%) brightness(1.03);
 --lg-ease:cubic-bezier(.16,1,.3,1);--lg-spring:cubic-bezier(.34,1.56,.64,1)}
:root[data-theme=dark]{--accent:color-mix(in srgb,var(--agent) 70%,#fff);
 --lg-fill:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.03) 55%,rgba(255,255,255,.07));
 --lg-edge:rgba(255,255,255,.12);
 --lg-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 0 22px rgba(255,255,255,.04),0 20px 50px -24px rgba(0,0,0,.7)}

/* Hintergrund: zarte, langsam treibende Nebel in der Agentenfarbe – ohne harte Kanten */
body{background:var(--bg)}
body::before,body::after{display:none}
.lg-mist{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.lg-mist i{position:absolute;border-radius:50%;background:radial-gradient(circle closest-side,color-mix(in srgb,var(--agent) 22%,var(--bg)),transparent);transition:background 1.2s ease}
.lg-mist i:nth-child(1){width:70vmax;height:70vmax;left:18%;top:-28%;opacity:.75;animation:lg-drift 38s ease-in-out infinite alternate}
.lg-mist i:nth-child(2){width:60vmax;height:60vmax;right:-14%;top:22%;opacity:.55;animation:lg-drift2 46s ease-in-out infinite alternate}
.lg-mist i:nth-child(3){width:64vmax;height:64vmax;left:-20%;bottom:-30%;opacity:.5;animation:lg-drift 52s ease-in-out infinite alternate-reverse}
:root[data-theme=dark] .lg-mist i{background:radial-gradient(circle closest-side,color-mix(in srgb,var(--agent) 26%,var(--bg)),transparent)}
@keyframes lg-drift{to{transform:translate(6vw,4vh) scale(1.08)}}
@keyframes lg-drift2{to{transform:translate(-7vw,5vh) scale(.94)}}

/* Liquid Glass für Navigation, Steuerung und Kacheln */
.glass,.surface,.agents-list>li,.secondary-button,.livekit-pilot-history-item,.workspace-picker{
 isolation:isolate;background:var(--lg-fill)!important;border:1px solid var(--lg-edge)!important;
 -webkit-backdrop-filter:var(--lg-blur);backdrop-filter:var(--lg-blur);box-shadow:var(--lg-shadow)!important}
.glass::after,.surface::after,.agents-list>li::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;padding:1px;
 background:linear-gradient(135deg,rgba(255,255,255,.95),rgba(255,255,255,.08) 40%,rgba(255,255,255,.04) 60%,rgba(255,255,255,.65));
 -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
:root[data-theme=dark] .glass::after,:root[data-theme=dark] .surface::after,:root[data-theme=dark] .agents-list>li::after{background:linear-gradient(135deg,rgba(255,255,255,.3),rgba(255,255,255,.02) 40%,rgba(255,255,255,.02) 60%,rgba(255,255,255,.18))}
/* ::after-Lichtkante braucht einen Bezugsrahmen – fixierte/absolute Glas-Elemente (Sidebar, Dialoge) behalten ihre Position */
.surface,.agents-list>li,.secondary-button,.studio-selection,.workspace-picker,.livekit-pilot-history-item,.topbar .icon-button.glass{position:relative}
/* Dialoge bleiben gut lesbar */
dialog.glass{background:color-mix(in srgb,var(--solid) 88%,transparent)!important}
.surface,.agents-list>li{transition:transform .6s var(--lg-ease),box-shadow .6s var(--lg-ease)}
.agents-list>li:hover,.metric:hover{transform:translateY(-3px)}

/* Navigation: aktive Seite als helle Glas-Pille */
.nav-item{transition:background .45s var(--lg-ease),color .3s,box-shadow .45s var(--lg-ease),transform .45s var(--lg-ease)}
.nav-item:hover{background:var(--soft)}
.nav-item.active{color:var(--ink)!important;background:linear-gradient(145deg,rgba(255,255,255,.72),rgba(255,255,255,.26))!important;border-color:rgba(255,255,255,.75)!important;
 box-shadow:inset 0 1px 0 #fff,inset 0 -1px 0 rgba(255,255,255,.4),0 8px 20px -10px rgba(60,40,140,.35)!important}
:root[data-theme=dark] .nav-item.active{background:linear-gradient(145deg,rgba(255,255,255,.16),rgba(255,255,255,.05))!important;border-color:rgba(255,255,255,.14)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 8px 20px -10px rgba(0,0,0,.6)!important}
.nav-item.active svg{color:var(--accent)}

/* Buttons: getöntes Glas, federnd */
.primary-button{background:linear-gradient(145deg,rgba(42,33,64,.94),rgba(42,33,64,.76))!important;color:#fff!important;
 -webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%);
 box-shadow:inset 0 1px 0 rgba(255,255,255,.32),inset 0 -1px 0 rgba(255,255,255,.08),0 14px 32px -16px rgba(30,20,60,.6)!important;
 transition:transform .5s var(--lg-spring),box-shadow .5s var(--lg-ease)!important}
:root[data-theme=dark] .primary-button{background:linear-gradient(145deg,rgba(255,255,255,.24),rgba(255,255,255,.09))!important;color:#f1eef9!important;border:1px solid rgba(255,255,255,.18)!important}
.primary-button:not(:disabled):hover,.secondary-button:not(:disabled):hover{transform:translateY(-1px) scale(1.02)}
.primary-button:not(:disabled):active,.secondary-button:not(:disabled):active,.icon-button:active{transform:scale(.97)}
.icon-button{transition:transform .5s var(--lg-spring)}
.icon-button:hover{transform:rotate(-12deg)}
#studio.call-starting .start-button,#studio[data-livekit-pilot="active"] .start-button{box-shadow:0 0 0 7px var(--soft),0 14px 32px -16px rgba(30,20,60,.6)!important}

/* Seitenwechsel: weich und leicht unscharf herein, Kacheln nacheinander */
[data-view]:not([hidden]){animation:lg-page-in .75s var(--lg-ease) both}
@keyframes lg-page-in{from{opacity:0;transform:translateY(14px) scale(.99);filter:blur(8px)}to{opacity:1;transform:none;filter:none}}
.agents-list>li,.metric,.billing-offers{animation:lg-rise .8s var(--lg-ease) both}
.agents-list>li:nth-child(2),.metric:nth-child(2){animation-delay:.07s}
.agents-list>li:nth-child(3),.billing-offers{animation-delay:.14s}
.agents-list>li:nth-child(4){animation-delay:.21s}.agents-list>li:nth-child(n+5){animation-delay:.26s}
@keyframes lg-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.studio-intro h1 span{color:var(--accent);transition:color 1s ease}

/* Offener Orb: keine Kreislinien, Punktwolke läuft weich aus, reagiert auf den Call */
.orb-orbit,.orb-cloud,.orb-light-flow,.orb-sheen{display:none!important}
.orb-core{background:radial-gradient(circle at 46% 42%,rgba(255,255,255,.9),color-mix(in srgb,var(--agent) 22%,transparent) 32%,transparent 62%)!important;
 border:0!important;box-shadow:none!important;filter:blur(10px);opacity:.9;overflow:visible!important;
 transform:scale(calc(1 + var(--livekit-level,0)*.45));transition:transform .16s ease-out!important}
:root[data-theme=dark] .orb-core{background:radial-gradient(circle at 46% 42%,color-mix(in srgb,var(--agent) 55%,#fff),color-mix(in srgb,var(--agent) 30%,transparent) 36%,transparent 64%)!important}
.orb-core::after{display:none!important}
.orb-halo{background:radial-gradient(circle closest-side,color-mix(in srgb,var(--agent) 34%,transparent),color-mix(in srgb,var(--agent) 10%,transparent) 55%,transparent)!important;
 filter:blur(26px)!important;transform:scale(calc(1.25 + var(--livekit-level,0)*.4))!important;transition:transform .18s ease-out!important;animation:lg-breathe 6s ease-in-out infinite}
.orb-shell canvas{-webkit-mask:radial-gradient(circle closest-side,#000 0%,rgba(0,0,0,.8) 38%,rgba(0,0,0,.3) 70%,transparent 96%);mask:radial-gradient(circle closest-side,#000 0%,rgba(0,0,0,.8) 38%,rgba(0,0,0,.3) 70%,transparent 96%);
 transform:scale(calc(1 + var(--livekit-level,0)*.2));transition:transform .16s ease-out}
.orb-radiance{position:absolute;inset:22%;border-radius:50%;background:conic-gradient(from 0deg,transparent,color-mix(in srgb,var(--agent) 40%,transparent),transparent 35%,rgba(255,255,255,.55),transparent 70%)!important;
 -webkit-mask:radial-gradient(circle closest-side,#000 30%,transparent 95%);mask:radial-gradient(circle closest-side,#000 30%,transparent 95%);filter:blur(16px);opacity:0;transition:opacity .8s ease;animation:lg-turn 3.5s linear infinite}
.stage-orb .orb-shell{animation:lg-float 8s ease-in-out infinite}
#studio[data-livekit-phase="thinking"] .orb-radiance{opacity:1}
#studio[data-livekit-phase="listening"] .orb-halo,.stage-orb.listening .orb-halo{animation-duration:3.2s}
#studio.call-starting .orb-halo{animation-duration:1.6s}
@keyframes lg-breathe{50%{opacity:.75}}
@keyframes lg-float{50%{translate:0 -8px}}
@keyframes lg-turn{to{rotate:360deg}}

/* Farbauswahl im Agenten-Wizard */
.color-picker{display:flex;gap:10px;flex-wrap:wrap}
.color-swatch{width:36px;height:36px;border-radius:50%;border:2px solid transparent;padding:0;background:radial-gradient(circle at 34% 28%,rgba(255,255,255,.75),transparent 46%),var(--swatch);
 box-shadow:inset 0 1px 0 rgba(255,255,255,.6),0 6px 14px -8px var(--swatch);transition:transform .45s var(--lg-spring),box-shadow .3s}
.color-swatch:hover{transform:scale(1.08)}
.color-swatch[aria-checked="true"]{box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--swatch)}

@media (prefers-reduced-motion:reduce){.lg-mist i,[data-view],.agents-list>li,.metric,.billing-offers,.stage-orb .orb-shell,.orb-halo,.orb-radiance{animation:none!important}.orb-core,.orb-halo,.orb-shell canvas{transition:none!important}}
@media (prefers-reduced-transparency:reduce){.glass,.surface,.agents-list>li,.secondary-button{background:var(--solid)!important;-webkit-backdrop-filter:none;backdrop-filter:none}}
