:root{font:100%/1.5 Inter,"Segoe UI",Arial,sans-serif;color:#211d34;background:#fbfafc;--paper:#fbfafc;--ink:#211d34;--muted:#655f73;--accent:#6144c7;--line:#dedbe6;--deep:#211b46;--purple-light:#e4dcff}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input,textarea{font:inherit}
button,a{touch-action:manipulation}
button{cursor:pointer}
button:disabled{cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid #8a71dd;outline-offset:3px}
h1,h2,p{margin:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.auth{display:grid;min-height:100vh;min-height:100svh;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}
.identity{position:relative;isolation:isolate;overflow:hidden;min-height:100%;display:flex;flex-direction:column;justify-content:space-between;padding:clamp(2rem,4vw,4.7rem);color:white;background:radial-gradient(ellipse at 68% 47%,#49348c 0,#30215d 40%,#211936 78%)}
.identity:before{content:"";position:absolute;inset:0;z-index:-1;background-image:linear-gradient(to right,#cbb6ff0b 1px,transparent 1px),linear-gradient(to bottom,#cbb6ff0b 1px,transparent 1px);background-size:2.6rem 2.6rem;mask-image:linear-gradient(to bottom,transparent,#000 20%,#000 85%,transparent)}
.brand{display:flex;align-items:center;gap:.45rem;font-weight:650;font-size:1.55rem;letter-spacing:-.06em;line-height:1.15;z-index:1}
.brand span{color:#d5cceb;font-weight:400}
.brand-icon{position:relative;display:inline-block;width:1.35rem;height:1.35rem;border:.15rem solid currentColor;border-radius:33% 48% 35% 48%;transform:rotate(36deg);margin-right:.25rem;color:#c8b3ff}
.brand-icon:before,.brand-icon:after{content:"";position:absolute;inset:17%;border:.08rem solid currentColor;border-radius:inherit}
.brand-icon:after{inset:38%;background:currentColor}
.identity-copy{position:relative;z-index:1}
.model-ref,.model{font-family:"IBM Plex Mono",Consolas,monospace}
.model-ref{font-size:.77rem;letter-spacing:.13em;color:#d4c6ff;margin-bottom:.6rem}
.statement{font-size:clamp(2rem,3.8vw,4rem);font-weight:550;line-height:1.03;letter-spacing:-.06em}
.art{position:absolute;display:grid;place-items:center;inset:12% -3% 26%;pointer-events:none}
.orbit{width:min(64%,25rem);aspect-ratio:1;position:relative;transform:rotate(-18deg);filter:drop-shadow(0 1.4rem 1.6rem #190c3960)}
.orbit i{position:absolute;inset:8% 18%;border-radius:46% 52% 47% 54%;border:1.5px solid #ddccff;background:linear-gradient(90deg,#6e50c518 30%,#9f83f115 55%,#c7b1ff4f);box-shadow:inset -.17rem -.1rem .24rem #c3adff45;transform:rotate(var(--r))}
.orbit i:nth-child(1){--r:0deg}.orbit i:nth-child(2){--r:20deg}.orbit i:nth-child(3){--r:40deg}.orbit i:nth-child(4){--r:60deg}.orbit i:nth-child(5){--r:80deg}.orbit i:nth-child(6){--r:100deg}.orbit i:nth-child(7){--r:120deg}.orbit i:nth-child(8){--r:140deg}.orbit i:nth-child(9){--r:160deg}
.auth-panel{display:grid;place-items:center;padding:clamp(1.25rem,5vw,5rem)}
.auth-card{width:min(100%,24rem)}
.auth-tabs{display:inline-flex;gap:.15rem;border:1px solid var(--line);border-radius:.7rem;padding:.23rem;background:#efedf3;margin-bottom:clamp(2rem,5vh,4rem)}
.auth-tabs button{border:0;background:transparent;color:var(--muted);padding:.36rem .9rem;border-radius:.47rem;font-size:.9rem;font-weight:550}
.auth-tabs button.active{background:white;color:var(--ink);box-shadow:0 1px 5px #31274c20}
.auth h1,.welcome h1,.files-view h1{font-size:clamp(1.9rem,3vw,2.7rem);line-height:1.13;font-weight:620;letter-spacing:-.055em}
#auth-description,.welcome p,.files-view>p{margin-top:.65rem;color:var(--muted)}
#auth-form{margin-top:2rem;display:grid;gap:.48rem}
label{font-size:.92rem;font-weight:600}
#auth-form label:not(:first-child){margin-top:.62rem}
input{width:100%;color:var(--ink);border:1px solid #cbc6d6;padding:.72rem .88rem;border-radius:.55rem;background:white}
input::placeholder,textarea::placeholder{color:#777182}
input:focus,textarea:focus{border-color:var(--accent)}
.field-hint{color:var(--muted);font-size:.85rem}
.primary,.composer button{background:var(--accent);border:1px solid var(--accent);border-radius:.55rem;color:white;font-weight:600;padding:.75rem 1rem}
.primary{margin-top:1rem}
.primary:hover,.composer button:hover{background:#5337b3}
.primary:disabled,.composer button:disabled{background:#dad5e8;border-color:#dad5e8;color:#565064}
.error{color:#842143;background:#fcebf0;border-radius:.5rem;padding:.65rem .85rem;font-size:.9rem;overflow-wrap:anywhere}
.studio{height:100vh;height:100dvh;display:grid;grid-template-columns:16.5rem minmax(0,1fr);overflow:hidden}
.sidebar{background:#211c35;color:#f5f2fc;padding:1.5rem 1rem 1rem;display:flex;flex-direction:column;min-height:0}
.sidebar-head{display:flex;justify-content:space-between;align-items:center;margin:.15rem .45rem 1.8rem}
.sidebar .brand{font-size:1.35rem}
.new,.files-button,.chats button{display:flex;align-items:center;text-align:left;gap:.65rem;border:0;border-radius:.48rem;padding:.65rem .75rem;min-height:2.65rem;font-size:.94rem}
.new{background:#ddd2ff;color:#2a1c50;font-weight:650}
.new:hover{background:#eee7ff}
.new b{font-size:1.25rem;line-height:1;font-weight:450}
.side-label{font-size:.79rem;color:#c4bed4;font-weight:550;margin:1.6rem .7rem .45rem}
.chats{overflow:auto;min-height:0;flex:1}
.chats button,.files-button{background:transparent;color:#e5e0ed;width:100%;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.files-button{display:flex;margin:.75rem 0 .4rem}
.chats button:hover,.files-button:hover,.chats button.active,.files-button.active{background:#393148;color:white}
.empty-history{font-size:.85rem;color:#c4bed4;margin:.65rem .7rem}
.files-icon{display:inline-block;width:1rem;height:.78rem;border:1.5px solid currentColor;border-radius:.15rem;position:relative}
.files-icon:before{content:"";position:absolute;top:-.26rem;left:-.08rem;width:.44rem;height:.19rem;border:1.5px solid currentColor;border-bottom:0;border-radius:.12rem .12rem 0 0}
.profile{display:flex;align-items:center;gap:.55rem;padding:.9rem .25rem .1rem;border-top:1px solid #4a4158}
.avatar{flex:0 0 2rem;height:2rem;display:grid;place-items:center;border-radius:50%;background:#4b4066;color:#e6dcff;font-weight:650}
#account{max-width:65%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem}
#logout{margin-left:auto;background:transparent;border:0;color:#ddd4eb;font-size:.88rem;padding:.35rem}
.workspace{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0}
.topbar{display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--line);height:4rem;padding:0 clamp(1rem,3vw,2.5rem);flex-shrink:0;background:#ffffffa8}
#view-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.model{display:flex;align-items:center;white-space:nowrap;font-size:.78rem;color:#665a80;margin-left:auto}
.model i{width:.42rem;height:.42rem;background:#7458bc;display:inline-block;transform:rotate(45deg);margin-right:.45rem}
.chat-view,.scroller{display:flex;flex-direction:column;min-height:0;flex:1}
.scroller{overflow-y:auto;scrollbar-gutter:stable}
.welcome{margin:auto;text-align:center;padding:2.4rem 1rem}
.agent-mark{display:grid;place-items:center;width:1.55rem;height:1.55rem;flex-shrink:0;background:#e8e0fb;color:#55369d;font-weight:650;border-radius:.48rem}
.agent-mark.large{font-size:2.2rem;width:4rem;height:4rem;border-radius:1.15rem;margin:0 auto 1.2rem;transform:rotate(-6deg);font-family:Georgia,serif}
.transcript,.composer-wrap{width:min(100%,53rem);margin-inline:auto}
.transcript:empty{display:none}
.transcript{padding:1.5rem clamp(1rem,4vw,3rem) .6rem}
.message{margin-bottom:1.55rem;min-width:0}
.msg-label{display:flex;align-items:center;gap:.5rem;font-size:.87rem;font-weight:650;color:#514960;margin-bottom:.4rem}
.message.user .msg-label{justify-content:flex-end}
.msg-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.63}
.message.user .msg-body{background:#efeaf7;padding:.7rem 1rem;width:fit-content;max-width:92%;margin-left:auto;border-radius:.9rem .9rem .25rem .9rem}
.msg-body pre{white-space:pre-wrap;tab-size:4;padding:1rem;background:#282338;color:#f5efff;border-radius:.6rem;font-size:.87rem;line-height:1.5;margin:.8rem 0;overflow:auto}
.msg-body code{font-family:"IBM Plex Mono",Consolas,monospace}
.waiting{color:var(--muted);font-size:.93rem;margin-bottom:1.1rem}
.composer-wrap{padding:.75rem clamp(1rem,4vw,3rem) max(1.2rem,env(safe-area-inset-bottom))}
.composer{border:1px solid #bdb5ce;background:white;border-radius:1rem;padding:.6rem .8rem;box-shadow:0 .24rem .9rem #30233e0a}
.composer:focus-within{border-color:#8e77bd}
.composer textarea{background:transparent;display:block;width:100%;min-height:3.4rem;max-height:12rem;resize:vertical;outline:none;border:0;color:var(--ink);padding:.3rem .1rem;line-height:1.5}
.composer textarea:focus-visible{outline:none}
.composer-footer{display:flex;justify-content:space-between;gap:.6rem;align-items:center}
.composer-footer span{font-size:.78rem;color:var(--muted)}
.composer button{padding:.4rem .8rem;font-size:.88rem}
.composer .attach-button{display:inline-flex;align-items:center;gap:.45rem;background:transparent;color:#594377;border:1px solid transparent;padding:.38rem .45rem}
.composer .attach-button:hover{background:#f0ebf9}.composer .attach-button:disabled{background:transparent;color:#807a88}
.clip-icon{display:inline-block;width:.58rem;height:1.04rem;position:relative;border:1.6px solid currentColor;border-radius:.28rem;transform:rotate(36deg);flex-shrink:0}
.clip-icon:after{content:"";position:absolute;inset:.09rem .06rem .2rem .08rem;border:1px solid currentColor;border-top:0;border-radius:0 0 .18rem .18rem}
.attachment-hint{margin:.35rem .15rem 0;color:var(--muted);font-size:.77rem;line-height:1.35}
.attachment-tray{margin:0 0 .45rem;background:#f6f3fb;border:1px solid var(--line);border-radius:.63rem}
.attachment-tray summary{cursor:pointer;padding:.4rem .72rem;color:#514168;font-weight:600;font-size:.88rem}
#attachment-list{list-style:none;padding:0 .72rem;margin:0;max-height:min(20vh,11rem);overflow:auto}
.attachment-row{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.38rem 0;border-top:1px solid #e6dfef}
.attachment-meta{min-width:0;flex:1}
.attachment-name{font-size:.86rem;font-weight:600;overflow-wrap:anywhere}
.attachment-status{font-size:.77rem;color:var(--muted);overflow-wrap:anywhere}
.attachment-ops{display:flex;gap:.3rem;flex-wrap:wrap;justify-content:flex-end}
.attachment-ops button,.attachment-ops a{display:inline-block;background:transparent;color:#644593;border:1px solid #d5cbe4;border-radius:.35rem;font-size:.8rem;text-decoration:none;padding:.25rem .4rem}
.attachment-ops button:hover,.attachment-ops a:hover{background:#ede6f5}
.attachment-ops button:disabled{opacity:.55}
.attachment-meta progress{display:block;width:min(100%,14rem);height:.35rem;margin-top:.25rem;accent-color:var(--accent)}
#attachment-error{margin-bottom:.4rem}
.chat-view{position:relative}
.drop-hint{pointer-events:none;position:absolute;inset:.6rem;z-index:3;display:grid;place-items:center;background:#f1eafaee;border:2px dashed #7e60b4;border-radius:.8rem;color:#462a77;font-size:1.15rem;font-weight:600}
@media(max-width:480px){.attachment-row{flex-wrap:wrap}.attachment-hint{font-size:.75rem}.attachment-ops button,.attachment-ops a{padding:.35rem .45rem}}
.studio-error{margin:0 clamp(1rem,4vw,3rem) .6rem}
.files-view{width:min(100%,55rem);margin-inline:auto;padding:clamp(1.2rem,4vw,3rem);overflow:auto}
#file-list{list-style:none;padding:0;margin:1.5rem 0}
#file-list li{border-bottom:1px solid var(--line)}
#file-list a{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem .3rem;color:var(--ink);text-decoration:none}
#file-list a:hover{color:var(--accent)}
#file-list a span:first-child{min-width:0;overflow-wrap:anywhere}
#file-list a span:last-child{font-size:.88rem;color:var(--accent);font-weight:600}
.secondary{padding:.5rem .85rem;border:1px solid var(--line);border-radius:.5rem;background:white;color:var(--ink)}
.mobile,.veil{display:none}
@media(max-width:760px){
  .auth{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .identity{min-height:9rem;padding:1.25rem 1.35rem;justify-content:center;gap:.6rem}
  .identity .brand{font-size:1.5rem}
  .art{inset:-72% -1% -70% 55%}
  .orbit{width:90%}
  .statement{display:none}
  .model-ref{margin:0;font-size:.75rem}
  .auth-panel{padding:2rem 1.35rem 3rem;place-items:start center}
  .auth-tabs{margin-bottom:1.8rem}
  .studio{display:flex}
  .workspace{flex:1}
  .sidebar{position:fixed;inset:0 auto 0 0;width:min(17rem,84vw);z-index:4;transform:translateX(-105%);visibility:hidden}
  .sidebar.open{transform:none;visibility:visible}
  .veil:not([hidden]){display:block;position:fixed;inset:0;border:0;background:#20192c80;z-index:3}
  .icon{display:grid;place-items:center;flex-shrink:0;background:transparent;color:inherit;border:0;border-radius:.45rem;width:2.55rem;height:2.55rem;font-size:1.3rem}
  .topbar{height:3.65rem;padding:0 .7rem 0 .25rem;gap:.35rem}
  .sidebar-head{margin-bottom:1.1rem}
  .transcript{padding-inline:1.1rem}
  .composer-wrap{padding:.55rem .65rem max(.7rem,env(safe-area-inset-bottom))}
}
@media(max-height:650px) and (min-width:761px){.art{inset:10% 12% 26%}.orbit{width:55%}.auth-panel{padding-block:1.5rem}.auth-tabs{margin-bottom:1.3rem}}
