:root{color-scheme:dark;--bg:#080e1b;--surface:#111b2c;--line:#253147;--text:#f5f4f7;--muted:#9baabd;--accent:#a6f2d1;--violet:#b5acfa;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:15px;line-height:1.5}button,input,textarea,select{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;border:0;background:none}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button,a{touch-action:manipulation}a{color:var(--accent)}svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}h1,h2,h3,p{margin:0}h1{font-size:32px;font-weight:570;letter-spacing:-1.1px;line-height:1.2}h2{font-size:18px;letter-spacing:-.3px}h3{font-size:15px}p{margin:10px 0}.muted,small{color:var(--muted)}.small{font-size:12px}.hidden{display:none!important}.eyebrow{font-size:10px;font-weight:650;letter-spacing:1.8px;color:var(--muted)}#app{max-width:640px;margin:auto;min-height:100dvh;padding-bottom:calc(84px + env(safe-area-inset-bottom))}.topbar{height:calc(70px + env(safe-area-inset-top));padding:calc(15px + env(safe-area-inset-top)) 22px 15px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--text);font-size:18px;font-weight:700;letter-spacing:2px}.brand span{font-size:8px;letter-spacing:1.4px;background:#192437;padding:3px 6px;border-radius:4px;color:var(--muted)}.icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border-radius:14px;font-size:24px}.icon-button:hover,.pill:hover{background:#243047}.page{padding:12px 22px 22px}.avatar-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:19px}.avatar-heading h1{font-size:29px;margin-top:5px}.pill{border:1px solid var(--line);border-radius:24px;padding:9px 12px;font-size:12px;min-height:40px;display:flex;gap:9px;align-items:center}.avatar-stage{position:relative;height:clamp(265px,40dvh,420px);isolation:isolate;background:#142434;border-radius:26px;overflow:hidden;border:1px solid #36444b}.portrait,.avatar-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 30%}.portrait{filter:saturate(.8)}.avatar-video{opacity:1}.speaking-video{opacity:0}.avatar-stage.is-speaking .speaking-video{opacity:1}.avatar-stage.is-speaking #idleVideo{opacity:0}.stage-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(7,15,20,.28),transparent 32%,rgba(4,12,22,.03) 50%,rgba(4,12,22,.95));pointer-events:none}.connection{position:absolute;top:17px;left:17px;display:flex;align-items:center;gap:7px;font-size:10px;background:#071b25b0;padding:7px 11px;border-radius:30px;backdrop-filter:blur(8px)}.connection i{width:5px;height:5px;background:var(--accent);border-radius:50%}.stage-button{position:absolute;right:15px;top:12px;background:#071b2570;backdrop-filter:blur(8px);width:40px;height:40px;border-radius:50%;font-size:21px}.stage-caption{position:absolute;bottom:20px;left:20px;right:20px;text-align:center}.stage-caption p{font-size:18px;font-weight:550;line-height:1.25;margin:8px 0 4px}.stage-caption span{font-size:11px;color:#c5d0dc;display:block;overflow-wrap:anywhere}.wave{height:22px;display:flex;align-items:center;justify-content:center;gap:4px}.wave i{height:5px;width:3px;background:var(--accent);border-radius:4px}.wave i:nth-child(2n){height:11px}.wave i:nth-child(3n){height:18px}.is-speaking .wave i,.is-listening .wave i{animation:wave .7s ease-in-out infinite alternate}.wave i:nth-child(2n){animation-delay:-.3s}.wave i:nth-child(3n){animation-delay:-.6s}@keyframes wave{to{transform:scaleY(.3)}}.conversation-heading{display:flex;align-items:center;justify-content:space-between;margin:18px 0 10px}.text-button{font-size:12px;min-height:36px;display:flex;gap:12px;align-items:center;padding:0}.messages{max-height:32dvh;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#304454 transparent;display:flex;flex-direction:column;gap:14px}.message{max-width:93%;align-self:flex-start;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;background:var(--surface);padding:14px 15px;border-radius:2px 18px 18px 18px}.message.user{align-self:flex-end;background:#23384b;border-radius:18px 2px 18px 18px}.message-head{font-size:10px;color:var(--accent);display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:7px}.message.user .message-head{color:#bdd7ed}.message p{font-size:14px;margin:0;line-height:1.65}.message-foot{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.message-foot button{padding:6px 8px;font-size:11px;min-height:34px;background:#ffffff09;border-radius:8px;color:var(--muted)}.message a{display:block;margin-top:9px;font-size:12px}.suggestions{display:flex;gap:8px;overflow:auto;padding:5px 0 12px}.suggestions button{white-space:nowrap;font-size:11px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-height:40px;color:#c5d4e3}.composer{background:#131f30;border:1px solid #35465a;border-radius:20px;padding:11px 10px 8px;margin-top:12px}.composer:focus-within{border-color:#83baaf}textarea{resize:none;display:block;width:100%;min-height:38px;max-height:160px;overflow:auto;outline:none;border:0;background:transparent;color:var(--text);padding:5px 6px;font-size:16px;line-height:1.5}textarea::placeholder{color:#8191a6;font-size:13px}.composer-actions,.composer-actions>div{display:flex;align-items:center;gap:5px}.composer-actions{justify-content:space-between}.input-status{font-size:10px;color:var(--muted);max-width:150px}.send,.stop{border-radius:50%;height:39px;width:39px;min-width:39px;background:var(--accent);color:#0b2025;font-size:23px}.stop{background:#e8acae;font-size:15px}.mic.recording{color:#fdabae;background:#502a34}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:640px;z-index:5;display:flex;justify-content:space-around;border-top:1px solid var(--line);background:#0b1322f5;backdrop-filter:blur(18px);padding:9px 12px calc(8px + env(safe-area-inset-bottom))}.bottom-nav button{width:25%;padding:7px 3px;display:flex;align-items:center;flex-direction:column;gap:5px;min-height:55px;font-size:10px;color:#8697b0}.bottom-nav button.active{color:var(--accent)}.bottom-nav button.active:after{content:"";width:4px;height:4px;position:absolute;top:5px;background:var(--accent);border-radius:50%}.page>h1{margin:10px 0 16px}.page>h2{margin:28px 0 12px}.list{display:flex;flex-direction:column;gap:10px;margin-top:20px}.list-item{display:flex;align-items:flex-start;gap:13px;border-bottom:1px solid var(--line);padding:15px 0;text-align:left;color:inherit;text-decoration:none;overflow-wrap:anywhere}.list-item>div{flex:1;min-width:0}.list-item strong{font-weight:550;display:block;font-size:14px;overflow-wrap:anywhere}.list-item small{display:block;margin-top:4px;font-size:11px}.file-symbol{width:40px;height:44px;border:1px solid var(--line);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--accent);flex-shrink:0}.status-label{font-size:10px;color:var(--accent);margin-bottom:6px;display:block}.failed,.interrupted{color:#f5aaa5}.quick-actions{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:16px;overflow:hidden;margin:24px 0}.quick-actions button{display:flex;justify-content:space-between;text-align:left;min-height:52px;padding:15px;border-bottom:1px solid var(--line);font-size:13px}.quick-actions button:last-child{border:0}.quick-actions span{color:var(--accent)}.setting{padding:17px 0;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);gap:20px;font-size:14px}.setting small{font-size:11px;display:block;line-height:1.5;margin-top:4px}.setting input[type=checkbox]{appearance:none;flex-shrink:0;width:43px;height:25px;border-radius:20px;background:#334154;position:relative;cursor:pointer}.setting input[type=checkbox]:after{content:"";position:absolute;width:19px;height:19px;border-radius:50%;background:#9eafc3;left:3px;top:3px;transition:transform .15s}.setting input:checked{background:#558e7b}.setting input:checked:after{background:#dafbec;transform:translateX(18px)}.setting-button{width:100%;text-align:left;min-height:70px}.stacked{display:block}.stacked select{display:block;width:100%;border:1px solid var(--line);background:var(--surface);padding:12px;color:inherit;border-radius:10px;margin-top:10px}.information{margin:30px 0;padding:20px;background:#101c2a;border-radius:16px;color:var(--muted);font-size:12px}.information h3{color:var(--text)}.primary{background:var(--accent);color:#0b2425;border-radius:14px;min-height:50px;font-weight:600;padding:13px 18px}.wide{width:100%;display:flex;justify-content:space-between;align-items:center}.pairing{padding:30px 26px}.pair-art{margin:12px 0 50px;display:flex;justify-content:center;filter:drop-shadow(0 0 45px #6b73b64f)}.pairing h1{margin:15px 0 20px;font-size:33px;line-height:1.25}.pairing>p{color:var(--muted);font-size:14px}.pairing form{margin:30px 0 22px}.pairing label{display:block;font-size:12px;margin-bottom:8px}.pairing input,#chatSearch{width:100%;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;font-size:16px;margin-bottom:12px}dialog{color:inherit;background:#0f192a;border:1px solid var(--line);border-radius:25px;padding:22px;width:calc(100% - 24px);max-width:550px;max-height:85dvh}dialog::backdrop{background:#020712bd;backdrop-filter:blur(8px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;gap:15px}.dialog-head h2{font-size:20px}#chatSearch{margin-top:18px}.avatar-choice{display:flex;align-items:center;width:100%;gap:16px;padding:15px 0;border-bottom:1px solid var(--line);text-align:left}.avatar-choice img{width:68px;height:85px;object-fit:cover;border-radius:12px;object-position:top}.avatar-choice>span:nth-child(2){flex:1}.avatar-choice strong,.avatar-choice small{display:block}.avatar-choice strong{font-size:17px}.avatar-choice small{font-size:11px;margin-top:5px}.toast{position:fixed;bottom:calc(90px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:30;width:calc(100% - 40px);max-width:550px;background:#263b4c;border:1px solid #587481;box-shadow:0 12px 55px #0008;border-radius:15px;padding:14px 18px;font-size:13px}.notice{margin:0 20px;padding:12px 14px;background:#392731;border:1px solid #6f4754;border-radius:12px;font-size:12px}.attachments{display:flex;gap:8px;overflow:auto}.attachment{display:flex;align-items:center;gap:6px;flex-shrink:0;max-width:220px;padding:6px 9px;background:var(--surface);border:1px solid var(--line);border-radius:10px;font-size:11px}.attachment span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment button{min-height:32px;min-width:30px}body.chat-expanded .avatar-stage,body.chat-expanded .avatar-heading{display:none}body.chat-expanded .messages{max-height:calc(100dvh - 335px);min-height:150px}body.typing .avatar-stage{height:160px}body.typing .stage-caption{bottom:12px}body.typing .wave{display:none}@media(min-width:700px){#app{border-left:1px solid var(--line);border-right:1px solid var(--line)}.page{padding:18px 34px 25px}.avatar-stage{height:420px}.topbar{padding-left:34px;padding-right:34px}}@media(max-height:550px) and (orientation:landscape){.avatar-stage{height:180px}.avatar-heading{display:none}.bottom-nav{padding-top:2px}.bottom-nav button{min-height:42px;flex-direction:row;justify-content:center}.stage-caption{bottom:10px}.topbar{height:52px;padding-top:8px;padding-bottom:8px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
#chatTitle{display:block;width:100%;margin:12px 0 18px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;font-size:16px}
button.pill,.stage-button,.send,.stop,.text-button,.message-foot button{min-width:44px;min-height:44px}
@media(max-height:650px) and (orientation:portrait){#app .avatar-stage{height:200px}.avatar-heading{margin-bottom:12px}}

/* Avatar has reserved space. The page scrolls when content exceeds the viewport. */
.screen-reader-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.composer .response-style{min-height:32px;max-width:110px;width:auto;border:0;border-radius:8px;background:#0d1726;color:var(--muted);padding:4px 6px;font:inherit;font-size:11px;cursor:pointer}
.composer .response-style:hover{color:var(--text);background:#1b2d3d}
.composer .response-style:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.composer-actions>div{min-width:0}
.composer .input-status{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:420px){.composer .input-status{display:none}.composer .response-style{max-width:105px}}
#conversation{display:flex;flex-direction:column;min-height:0}
#conversation>*{flex-shrink:0}
#app #conversation .avatar-stage{display:block;flex:0 0 auto;height:clamp(320px,48svh,480px);min-height:320px}
#app #conversation .portrait,#app #conversation .avatar-video{object-fit:cover;object-position:center 30%}
#app #conversation .avatar-video{background:#142434}
#idleVideo:not(.media-ready),#speakingVideo:not(.media-ready){opacity:0}
#conversation .stage-shade{background:none}
#conversation .stage-caption{position:static;display:flex;align-items:center;gap:14px;text-align:left;padding:14px 4px;min-width:0}
#conversation .stage-caption>div:last-child{min-width:0}
#conversation .stage-caption p{margin:0 0 4px;font-size:15px}
#conversation .stage-caption .wave{flex:0 0 30px}
#conversation .avatar-stage.is-speaking+.stage-caption .wave i,#conversation .avatar-stage.is-listening+.stage-caption .wave i{animation:wave .7s ease-in-out infinite alternate}
.avatar-controls{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
#app #conversation .avatar-heading{display:flex;gap:12px}
body.avatar-expanded #app #conversation .avatar-stage{height:clamp(460px,72svh,760px)}
body.chat-expanded #app #conversation .avatar-stage,body.chat-expanded #conversation .stage-caption{display:none}
@media(max-width:420px){.avatar-controls{flex-direction:column}.avatar-controls .pill{justify-content:center}.avatar-heading .eyebrow{letter-spacing:1px}}
#conversation .conversation-heading{margin:10px 0 4px}
#conversation .messages{flex:0 0 auto;min-height:0;max-height:32dvh}
#conversation .message{flex-shrink:0}
body.chat-expanded #conversation .messages{min-height:150px;max-height:65dvh}
.avatar-stage.is-action #idleVideo,.avatar-stage.is-action #speakingVideo{opacity:0}.avatar-stage.is-action #actionVideo{opacity:1}.result-preview{display:block;width:100%;max-height:400px;object-fit:contain;border-radius:12px;margin-top:10px}
.voice-recovery{margin-top:8px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:12px;overflow-wrap:anywhere}.voice-recovery p{margin:0 0 6px}.voice-recovery>div{display:flex;gap:8px;flex-wrap:wrap}.voice-recovery button{min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:8px}.voice-recovery #retryVoice{color:var(--accent)}
/* Let real header/identity height determine the remaining space, rather than a
   fixed subtraction which hides input/recovery below the bottom navigation. */
#app{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
#app>.topbar,#app>.notice{flex-shrink:0}
#app>main{flex:1;min-height:0;overflow:auto}
#app #conversation{height:auto;min-height:100%;overflow:visible}
.has-voice-draft #suggestions{display:none}
.voice-recovery button{min-height:48px}
@media(max-height:760px){.has-voice-draft #conversation .avatar-heading{display:none}}
@media(max-height:550px){.has-voice-draft #conversation .conversation-heading{display:none}}
@media(max-height:480px) and (min-width:600px){
  #app{padding-bottom:calc(56px + env(safe-area-inset-bottom))}
  .has-voice-draft #app #conversation{display:flex;gap:8px}
  .has-voice-draft #app #conversation{padding-top:8px;padding-bottom:8px}
  .has-voice-draft #conversation .messages{display:none}
  .has-voice-draft #conversation .composer,.has-voice-draft .voice-recovery{margin-top:0}
  .has-voice-draft #conversation .composer{grid-row:1;grid-column:1}
  .has-voice-draft #conversation .voice-recovery{grid-row:1;grid-column:2}
  .has-voice-draft #conversation .attachments{grid-row:2;grid-column:1 / -1}
  .has-voice-draft #conversation .attachments:empty{display:none}
  .has-voice-draft .voice-recovery button{font-size:11px;padding:8px 6px}
  .has-voice-draft .voice-recovery p{font-size:11px;line-height:1.35}
}

/* Normal conversation is a flowing page, not two tiles competing for one
   screen. Avatar/input form one block; the complete transcript follows below. */
#app{min-height:0;height:var(--app-height,100dvh)}
#app>main{container-type:size;container-name:mobile-content}
#app #conversation{height:auto;min-height:100%;overflow:visible;padding-top:8px;padding-bottom:18px;gap:14px}
#conversation .conversation-interaction{display:flex;flex-direction:column;flex:0 0 auto;min-height:0;min-width:0;gap:0;background:#102a30;border:1px solid #2c535a;border-radius:20px;padding:10px}
#conversation .conversation-interaction>*{flex-shrink:0}
#app #conversation .avatar-heading{margin:0 0 8px;min-height:40px;align-items:center}
#conversation .avatar-heading h1{font-size:21px;margin:2px 0}
#conversation .avatar-heading .eyebrow{font-size:9px}
#conversation .avatar-controls{flex-direction:row}
#conversation .avatar-controls .pill{font-size:11px;padding:5px 9px}
#app #conversation .avatar-stage{flex:0 0 auto;height:clamp(320px,52svh,480px);min-height:320px;max-height:none}
#conversation .stage-caption{padding:7px 3px;gap:9px}
#conversation .stage-caption p{font-size:13px;margin:0}
#conversation .stage-caption span{font-size:10px;line-height:1.3}
#conversation .stage-caption .wave{flex-basis:25px}
#conversation .composer{margin-top:4px;padding:8px 9px 5px}
#conversation .composer textarea{max-height:90px;min-height:28px}
#conversation .conversation-history{flex:0 0 auto;min-height:380px;display:flex;flex-direction:column;overflow:visible;background:#211b36;border:1px solid #4e3d6a;border-radius:18px;padding:8px 10px 14px}
#conversation .conversation-history .conversation-heading .text-button{color:#d6c4f3}
#conversation .conversation-interaction .avatar-heading .eyebrow{color:#aedbd3}
#conversation .conversation-heading{margin:0;flex-shrink:0}
#conversation .messages{flex:0 0 auto;max-height:none!important;min-height:280px;overflow:visible;overscroll-behavior:auto}
#conversation .suggestions{margin:0;flex-shrink:0;flex-wrap:wrap}
#conversation .attachments{max-height:44px}
#conversation .result-reference{max-height:55px;overflow:auto}
#conversation .result-stage{flex:0 0 auto;height:clamp(320px,52svh,480px);max-height:none;min-height:260px;overflow:auto;margin-top:0}
#conversation .result-content{min-height:0}
#conversation .result-image{max-height:100%}
/* Focus views genuinely occupy the app screen. The return control is kept in
   the active block; normal navigation returns with the previous scroll offset. */
body:is(.avatar-expanded,.chat-expanded) #app{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
body:is(.avatar-expanded,.chat-expanded) #app>.topbar,body:is(.avatar-expanded,.chat-expanded) #nav{display:none}
body:is(.avatar-expanded,.chat-expanded) #app>main{overflow:hidden}
body:is(.avatar-expanded,.chat-expanded) #app #conversation{height:100%;min-height:0;overflow:auto;padding:8px;gap:8px}
body.avatar-expanded #conversation .conversation-interaction{flex:1 0 auto}
body.avatar-expanded #app #conversation .avatar-stage,body.avatar-expanded #conversation .result-stage{flex:1 0 260px;height:auto;min-height:260px;max-height:none}
body.avatar-expanded #conversation .conversation-history{display:none}
body.chat-expanded #conversation .conversation-interaction{flex:0 0 auto;min-height:0;order:2}
body.chat-expanded #app #conversation .avatar-heading{display:none}
body.chat-expanded #conversation .conversation-history{flex:1 1 auto;min-height:160px;overflow:hidden;order:1}
body.chat-expanded #conversation .conversation-heading{display:flex!important}
body.chat-expanded #conversation .messages{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
@media(max-width:640px){
  #app{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  #app .topbar{height:calc(56px + env(safe-area-inset-top));padding:calc(6px + env(safe-area-inset-top)) 12px 6px}
  #app #conversation{padding-left:12px;padding-right:12px}
  #conversation .conversation-interaction{padding:8px}
  #conversation .avatar-heading .eyebrow{display:none}
  #conversation .avatar-heading h1{font-size:19px}
  #conversation .avatar-controls{gap:4px}
  #conversation .avatar-controls .pill{padding:5px 7px;gap:4px}
  #nav{padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom))}
  #nav button{min-height:55px}
  #conversation .composer-actions>div{flex:1}
  #conversation .response-style{min-width:0;flex:0 1 105px}
}
/* Only an actual keyboard gets the compact portrait. Limit its width along
   with its height so Kevin's face cannot turn into a wide cropped strip. */
.conversation-keyboard #app .topbar{height:calc(44px + env(safe-area-inset-top));min-height:44px;padding-top:env(safe-area-inset-top);padding-bottom:0}
.conversation-keyboard #conversation .avatar-heading,.conversation-keyboard #conversation .stage-caption{display:none!important}
.conversation-keyboard #app #conversation{height:100%;min-height:0;overflow:auto;padding-top:8px;padding-bottom:8px}
.conversation-keyboard #conversation .conversation-interaction{flex:1 0 auto}
.conversation-keyboard #app #conversation .avatar-stage{flex:1 0 120px;height:auto;min-height:120px;max-height:none;max-width:min(100%,max(180px,calc((100cqh - 130px)*1.5)));width:100%;align-self:center}
.conversation-keyboard #conversation .composer textarea{max-height:55px}
.conversation-keyboard #nav{display:none}
.conversation-keyboard #app{padding-bottom:env(safe-area-inset-bottom)}
.conversation-keyboard #conversation .conversation-history{display:none}
.conversation-keyboard.avatar-expanded #app #conversation .avatar-heading{display:flex!important}
.conversation-keyboard.chat-expanded #conversation .conversation-history{display:flex}
.conversation-keyboard.chat-expanded #conversation .conversation-interaction{flex:0 0 auto}

/* Können is a browsable workspace, not a single wall of tools and old jobs. */
#tasks .ability-heading{padding:8px 0 10px}
#tasks .ability-heading .eyebrow{color:#9ed9d0;letter-spacing:1.6px}
#tasks .ability-heading h1{font-size:clamp(24px,5vw,30px);line-height:1.2;margin:10px 0}
#tasks .ability-heading p.muted{font-size:14px;line-height:1.6;max-width:460px}
#tasks .ability-tabs{display:flex;gap:6px;padding:5px;background:#121c2b;border:1px solid #28354b;border-radius:16px;margin:8px 0 22px}
#tasks .ability-tabs button{flex:1;min-width:0;min-height:48px;border-radius:11px;padding:10px 8px;color:#b6c4d8;font-size:13px;font-weight:600}
#tasks .ability-tabs button[aria-pressed="true"]{background:#234840;color:#d5fff1;box-shadow:inset 0 0 0 1px #36685e}
#tasks h2{font-size:17px;margin:0}
#tasks .favorites-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
#tasks #favoritesEmpty{font-size:12px;line-height:1.6;padding:14px;border:1px dashed #354659;border-radius:14px}
#tasks .capability-favorites{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:8px;margin:10px 0 22px}
#tasks .favorite-shortcut{display:flex;align-items:center;gap:9px;text-align:left;min-height:56px;min-width:0;padding:12px;border:1px solid #34625b;border-radius:14px;background:#132d30;color:#d9f6ed}
#tasks .favorite-shortcut strong{flex:1;font-size:13px;overflow-wrap:anywhere}
#tasks .favorite-star{color:#c4ddab}
#tasks .ability-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(130px,.6fr);gap:10px;margin:14px 0}
#tasks .ability-filters label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#b6c4d8;min-width:0}
#tasks .ability-filters input,#tasks .ability-filters select{width:100%;min-width:0;min-height:48px;border-radius:12px;padding:10px 12px;border:1px solid #344359;background:#101c2c;color:#e8f0fa;font:inherit;font-size:14px}
#tasks :is(input,select,button,summary):focus-visible{outline:2px solid #a4efd5;outline-offset:3px}
#tasks #capabilityCount,#tasks #taskCount{font-size:12px;line-height:1.5;min-height:18px}
#tasks .capability-list{display:grid;gap:10px;margin:12px 0 20px}
#tasks .capability-item{border-color:#303e56;border-radius:16px;background:linear-gradient(120deg,#162236,#111a29);padding:5px 14px}
#tasks .capability-item summary{min-height:64px;gap:12px;list-style:none}
#tasks .capability-item summary::-webkit-details-marker{display:none}
#tasks .capability-item summary strong{font-size:14px;line-height:1.4;flex:1;min-width:0;overflow-wrap:anywhere}
#tasks .capability-item summary small{flex-shrink:0;max-width:42%;padding:5px 8px;border-radius:8px;color:#c2c9e9;background:#292c48;overflow-wrap:anywhere}
#tasks .capability-item summary:after{content:'＋';color:#adbed2;font-size:16px}
#tasks .capability-item[open] summary:after{content:'−'}
#tasks .capability-item[open]{border-color:#506583}
#tasks .capability-item p{font-size:13px;line-height:1.65}
#tasks .capability-item .capability-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
#tasks .capability-actions button{min-height:48px;border:1px solid #385653;border-radius:10px;padding:9px 12px;font-size:12px;color:#baf4df;background:#152f31}
#tasks .capability-actions button:last-child{margin-left:auto;color:#d7daec;background:#242840;border-color:#424665}
#tasks .catalog-note{border-top:1px solid #293a50;padding-top:10px;font-size:12px;color:#aab9cd}
#tasks .catalog-note summary{min-height:48px;display:flex;align-items:center;cursor:pointer}
#tasks .catalog-note p{line-height:1.6}
#tasks .catalog-note button,#tasks #taskMore{min-height:48px}
#tasks #taskList{gap:10px}
#tasks #taskList .list-item{background:#151f30;border:1px solid #2c3a51;border-radius:16px;text-align:left;min-height:88px;padding:14px}
#tasks #taskList .list-item>div{min-width:0;flex:1}
#tasks #taskList strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere;line-height:1.55;font-size:14px;margin:7px 0}
#tasks #taskList small{display:block;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#tasks .status-label{display:inline-block;padding:4px 8px;background:#26364b;border-radius:7px;font-size:11px;color:#c5d5e9}
#tasks .status-label.completed{background:#173a32;color:#acedd2}
#tasks .status-label:is(.failed,.interrupted,.cancelled){background:#493222;color:#ffcf9c}
#tasks #taskMore{border:1px solid #384963;border-radius:12px;margin:14px 0 6px}
.orders-shortcut{min-height:40px;border:1px solid #3b5a62;border-radius:20px;background:#172c34;color:#b3f0da;padding:7px 12px;font:inherit;font-size:12px;white-space:nowrap}
#tasks.orders-view .ability-heading{display:none}
#tasks .orders-title{font-size:22px;line-height:1.3;margin:22px 0 16px}
.orders-settings{display:block;width:100%;margin:16px 0;border:1px solid #34564e;border-radius:12px;padding:12px;background:#162e30;color:#b6f3de;text-align:left;font:inherit;font-size:13px;min-height:48px}
#tasks .queued-orders{background:#142e32;border:1px solid #2e5458;border-radius:16px;padding:16px;margin:8px 0 24px}
#tasks .orders-heading{display:flex;gap:12px;align-items:center;justify-content:space-between}
#tasks .orders-heading h2,#tasks .queued-orders h2{font-size:17px;margin:0}
#tasks .order-card{background:#1e2035;border:1px solid #373953;border-radius:16px;overflow:hidden}
#tasks .order-card summary,#tasks .queued-order summary{cursor:pointer;padding:14px;min-height:48px;list-style-position:inside;overflow-wrap:anywhere}
#tasks .order-card summary strong{display:block;line-clamp:unset;-webkit-line-clamp:unset;margin:10px 0;font-size:14px}
#tasks .order-card summary small{color:#acb8cf}
#tasks .order-card[open]{border-color:#8bbfb2}
#tasks .order-detail{padding:0 16px 16px;border-top:1px solid #373953}
#tasks .order-detail h3{font-size:12px;color:#b8c8dc;margin:14px 0 6px}
#tasks .order-full-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:14px;max-height:none}
#tasks .queued-order{border:1px solid #386064;border-radius:10px;margin:8px 0}
#tasks .queued-order p{margin:8px 14px}
#tasks #taskList{max-height:none;overflow:visible}
@media(max-width:380px){.topbar{gap:5px}.topbar-actions{gap:4px}.brand>span{display:none}.orders-shortcut{padding:7px 9px}}
.work-world-open{align-self:flex-start;font-size:11px;color:#a8c9c3;padding:4px 2px;margin:0 0 4px}
#workWorldDialog{width:min(550px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:88dvh;overflow:auto;box-sizing:border-box}
#workWorldContent{overflow-wrap:anywhere}
.work-world-section{padding:14px;margin:12px 0;border:1px solid #314358;border-radius:14px;background:#101e2a}
.work-world-section h3{font-size:14px;margin:0 0 10px;color:#ade8d3}
.work-world-section p{white-space:pre-wrap;line-height:1.5}
.work-world-section blockquote{margin:10px 0;padding:0 0 0 12px;border-left:2px solid #8acbb6}
.work-world-section a{display:block;color:#b3efdc;padding:10px 0;min-height:44px;box-sizing:border-box}
.work-world-action{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:9px 0;border-bottom:1px solid #29394b}
.work-world-action span,.work-world-state{font-size:12px;color:#cbd7e7}
.work-world-memory-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.work-world-memory-controls button{min-height:44px;padding:8px 12px;border-radius:10px}
.work-world-memory-controls textarea{width:100%;box-sizing:border-box;min-height:90px;resize:vertical;font:inherit;padding:10px;border:1px solid #5b867f;border-radius:10px;background:#0a151f;color:#eef8f5}
@media(max-width:420px){
  #tasks .ability-filters{grid-template-columns:1fr}
  #tasks .ability-tabs button{font-size:12px}
  #tasks .favorites-heading .small{font-size:10px}
}
.internal-notice{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 10px;margin:6px 0;border:1px solid #448879;border-radius:12px;background:#173d38;color:#eafff6;font-size:12px;flex-shrink:0}
.internal-notice span{flex:1 1 150px;overflow-wrap:anywhere}
.internal-notice button{font:inherit;padding:6px 8px;border-radius:8px;min-height:32px}
.scan-pages{padding:0;list-style:none;display:grid;gap:12px}
.scan-pages li{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px;border:1px solid #355453;border-radius:14px}
.scan-pages img{width:74px;height:100px;object-fit:contain;margin:12px}
.scan-pages span{flex:1 1 100px;overflow-wrap:anywhere}
.scan-pages button{min-width:44px;min-height:44px;font:inherit}
#scanDialog,#companionDialog,#attachmentDialog{width:min(94vw,580px);max-height:88dvh;overflow-y:auto;overscroll-behavior:contain}
#companionContent details{padding:12px 0;border-top:1px solid #355453}
#companionContent p{font-size:13px;line-height:1.6;color:#bfd0db}
#companionContent li{margin:9px 0;overflow-wrap:anywhere}
.input-queue{flex-shrink:0;margin-top:8px;padding:8px 10px;border:1px solid #426969;border-radius:12px;background:#112c30;font-size:12px;color:#d3e7e6}
.input-queue>div{display:flex;align-items:center;justify-content:space-between;gap:8px}
.input-queue ol{list-style:none;margin:4px 0 0;padding:0;max-height:128px;overflow-y:auto;overscroll-behavior:contain}
.input-queue li{display:flex;align-items:center;gap:8px;border-top:1px solid #29494d;min-height:40px}
.input-queue li span{flex:1;min-width:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.input-queue button{flex-shrink:0;font:inherit;min-height:40px;padding:6px 8px}
.guest-archive{margin-top:16px;border-top:1px solid #29494d;color:#bfd0db}
.guest-archive summary{cursor:pointer;min-height:44px;padding:14px 0;box-sizing:border-box;font-size:13px}
.guest-archive .list-item{gap:12px;flex-wrap:wrap}
.guest-archive .list-item>div{min-width:0;overflow-wrap:anywhere}
.guest-archive button{min-height:44px}

/* Guest invitation: distinct, touch-friendly field and action, including narrow phones. */
#guestForm{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:18px 0 24px;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
#guestForm label{display:block;font-size:13px;font-weight:600;color:var(--text)}
#guestName{display:block;width:100%;min-width:0;min-height:48px;padding:12px 14px;border:1px solid #405167;border-radius:12px;background:var(--bg);color:var(--text);font-size:16px;line-height:1.5}
#guestName:focus{border-color:var(--accent)}
#guestForm .primary{margin-top:4px;justify-content:center;min-width:0;font-size:14px;line-height:1.4;text-align:center;white-space:normal;overflow-wrap:anywhere}

/* A passage remains a distinct quote above the ordinary text/voice composer. */
.message-content{user-select:text;-webkit-user-select:text;white-space:pre-wrap}
.selection-toolbar{position:fixed;z-index:40;display:flex;align-items:center;gap:2px;padding:4px;background:#203747;border:1px solid #688e96;border-radius:12px;box-shadow:0 6px 24px #0008}
.selection-toolbar button{flex:1;min-height:40px;padding:7px 10px;font-size:12px;line-height:1.25;border-radius:8px;text-align:center}
.selection-toolbar button:hover,.selection-toolbar button:focus-visible{background:#314d5d;color:var(--accent)}
.annotation-draft{display:grid;gap:8px;max-height:220px;overflow:auto;margin:0 2px 8px;overscroll-behavior:contain}
.annotation-card{border:1px solid #426c6c;border-radius:12px;background:#132c33;padding:8px 10px;min-width:0}
.annotation-head{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--accent)}
.annotation-head button{min-height:32px;min-width:32px;font-size:20px;line-height:1}
.annotation-card blockquote,.message-annotations blockquote{margin:3px 0 8px;padding:2px 0 2px 10px;border-left:2px solid var(--accent);font-size:12px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;max-height:85px;overflow:auto}
#conversation .composer textarea.annotation-comment{background:#0e202a;border-radius:8px;padding:8px;min-height:38px;max-height:80px;font-size:16px}
.annotation-comment::placeholder{font-size:12px}
.message-annotations{margin:8px 0;font-size:12px;border:1px solid #40596e;border-radius:10px;padding:8px 10px}
.message-annotations summary{color:var(--accent);cursor:pointer;min-height:28px}
@media(max-height:550px){.annotation-draft{max-height:140px}.annotation-card blockquote{max-height:48px}}
/* Queue editing is an independent sheet; the conversation draft stays untouched. */
.queue-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;align-items:center}
.queue-actions button{min-height:38px;padding:8px 12px;border:1px solid #354958;border-radius:10px}
.queue-actions button:first-child{background:#193b3e;color:#a4efdb;border-color:#35655e}
.queue-editor{box-sizing:border-box;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:22px;border:1px solid #35655e;border-radius:20px;background:#111e2d;color:#ecf5f7}
.queue-editor::backdrop{background:#030a14bc;backdrop-filter:blur(4px)}
.queue-editor h2{margin:0 0 12px;font-size:1.15rem}
.queue-editor textarea{box-sizing:border-box;width:100%;min-height:170px;max-height:40dvh;resize:vertical;padding:12px;margin:12px 0;border-radius:12px;border:1px solid #405667;background:#0b1522;color:inherit;font:inherit;line-height:1.5}
.queue-editor select{width:100%;margin-bottom:14px;min-height:40px}
.queue-file-label{display:block;margin:14px 0;font-size:.9rem}
.queue-file-label input{display:block;margin-top:8px;max-width:100%}
.queue-edit-attachments .attachment{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}
.queue-edit-attachments img{width:72px;height:60px;object-fit:contain;border-radius:8px;background:#07111c}
.queue-edit-attachments a{overflow-wrap:anywhere;color:#a4efdb}
:root .memory-entry{display:flex;justify-content:space-between;align-items:center;gap:16px;width:100%;margin:18px 0;padding:18px 20px;border:1px solid #3b5267;border-radius:18px;background:linear-gradient(120deg,#172e38,#25233f);color:#e5f8f2;text-align:left;white-space:normal}
:root .memory-entry span{display:block;font-size:.8rem;color:#b4c4d2;margin-top:5px}
#memoryQuickOpen{margin:6px 0 14px}
.affect-settings{margin:20px 0;padding:18px;border:1px solid #314457;border-radius:16px;background:#111e2b}
.affect-settings h3{margin:0 0 8px}.affect-settings p{font-size:.85rem;color:#afc1d2;line-height:1.5}
.affect-settings .setting{margin-top:12px;gap:12px}.affect-settings select{width:100%}
.affect-settings input[type=range]{width:100%;accent-color:#a4efdb}
.affect-settings>button{margin-top:18px;width:100%;white-space:normal}
.affect-history{margin-top:20px;border-top:1px solid #314457;padding-top:16px}
.affect-history article{padding:12px 0;border-bottom:1px solid #314457}
.affect-history blockquote{margin:8px 0;padding-left:12px;border-left:2px solid #8bcdb9;overflow-wrap:anywhere}
