/* Small Fin: a quiet conversation canvas, shared by full page and quick panel. */
#app .main.chat-main{height:100dvh;display:flex;flex-direction:column;padding:18px 32px 0;max-width:none}
#app .chat-main .topline{flex-shrink:0;margin:0;padding:0 0 8px;border:0;font-size:11px}
#app .chat-main #content{flex:1;min-height:0}
#app .chat-workspace{display:block;height:100%;margin:0}
#agent-inline-host,#agent-root.agent-inline{height:100%;min-height:0}
#agent-root.agent-inline .agent-panel{height:100%;min-height:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
#agent-root .agent-panel{display:flex;flex-direction:column;overflow:hidden}
#agent-root .agent-head,#agent-root.agent-inline .agent-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:20px 22px;margin:0;border:0;flex-shrink:0;background:transparent}
#agent-root.agent-inline .agent-head{padding:15px 6px 20px}
.agent-identity,.agent-head-actions{display:flex;align-items:center;gap:10px;min-width:0}
#agent-root .agent-head strong{font-size:17px;font-weight:600;white-space:nowrap}
.agent-logo{display:flex;width:29px;height:29px;align-items:center;justify-content:center;color:var(--gold)}
.agent-logo .ui-icon{width:27px;height:27px}
.agent-head-caption{font-size:11px;color:var(--muted);border-left:1px solid var(--line);padding-left:10px;white-space:nowrap}
#agent-root .agent-icon,#agent-root .agent-library-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 8px;min-height:32px;line-height:1;border:0;background:transparent;color:var(--muted);border-radius:8px;font-size:12px}
#agent-root .agent-icon{width:32px;font-size:22px}
#agent-root .agent-icon .ui-icon,#agent-root .agent-library-button .ui-icon{width:17px;height:17px}
#agent-root .agent-icon:hover,#agent-root .agent-library-button:hover,.agent-menu>summary:hover{background:var(--hi);color:var(--text);filter:none}
.agent-head-actions{gap:3px}
.agent-menu{position:relative}
.agent-menu>summary{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;cursor:pointer;list-style:none;color:var(--muted)}
.agent-menu>summary::-webkit-details-marker{display:none}
.agent-menu>summary .ui-icon{width:21px;height:21px;stroke-width:3}
.agent-menu>div{position:absolute;right:0;top:40px;z-index:4;width:165px;padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 30px var(--shadow)}
#agent-root .agent-menu button{display:block;text-align:left;width:100%;border:0;background:transparent;color:var(--text);font-size:12px;padding:10px;border-radius:7px}
#agent-root .agent-menu button:hover{background:var(--hi)}
#agent-root .agent-chat,#agent-root.agent-inline .agent-chat{padding:18px 24px 30px;scrollbar-width:thin;scrollbar-color:var(--line) transparent;overscroll-behavior:contain;scroll-behavior:auto}
#agent-root.agent-inline .agent-chat{padding:20px max(24px,calc((100% - 750px)/2)) 30px}
#agent-root .agent-message,#agent-root.agent-inline .agent-message{position:relative;max-width:none;padding:0;margin:0 0 28px;border:0;box-shadow:none;background:transparent;color:var(--text);font-size:14px;line-height:1.85;letter-spacing:0}
#agent-root.agent-inline .agent-message{font-size:15px}
#agent-root .agent-message.user,#agent-root.agent-inline .agent-message.user{width:fit-content;max-width:85%;margin:6px 0 30px auto;background:var(--hi);color:var(--text);padding:11px 16px;border-radius:18px 18px 4px 18px;text-align:left}
#agent-root .message-label{justify-content:flex-start;gap:7px;color:var(--text);font-size:12px;letter-spacing:0;font-weight:500;margin-bottom:10px}
.message-avatar{display:inline-flex;color:var(--gold)}
#agent-root .message-avatar .ui-icon{width:20px;height:20px}
#agent-root .message-scope{font-size:11px;color:var(--muted);margin:0 0 10px}
#agent-root .agent-rich p{margin:0 0 14px;line-height:1.9}
#agent-root .agent-rich h3{font-size:15px;line-height:1.7;margin:22px 0 12px}
#agent-root .agent-rich h3:first-child{margin-top:0}
#agent-root .agent-rich li{margin:6px 0}
#agent-root .agent-rich pre{overflow:auto;font-size:12px;background:var(--hi)}
#agent-root .agent-rich code{font-size:12px}
#agent-root .agent-rich .agent-table table{font-size:12px}
#agent-root .agent-rich>:last-child{margin-bottom:0}
#agent-root .agent-message details{margin-top:12px;font-size:11px}
#agent-root .agent-message summary{width:fit-content;cursor:pointer;color:var(--muted);padding:3px 0}
.message-actions{display:flex;align-items:center;gap:4px;margin:7px 0 0 -6px}
#agent-root .message-actions button{opacity:.55;width:28px;min-height:28px;padding:5px}
#agent-root .message-actions button:hover,#agent-root .message-actions button:focus-visible{opacity:1}
.copy-status{font-size:10px;color:var(--muted)}
#agent-root .agent-compose,#agent-root.agent-inline .agent-compose{border:0;background:transparent;padding:8px 18px 12px;flex-shrink:0;width:100%;margin:0 auto}
#agent-root.agent-inline .agent-compose{max-width:800px;padding:12px 24px 15px}
#agent-root #agent-form{background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:12px 14px 10px;box-shadow:0 3px 16px var(--shadow)}
#agent-root #agent-form:focus-within{border-color:var(--gold-border);box-shadow:0 3px 20px var(--shadow)}
#agent-root #agent-input{display:block;width:100%;min-height:40px;max-height:160px;padding:8px 4px;margin:0;border:0;border-radius:0;background:transparent;resize:none;color:var(--text);font-size:14px;line-height:24px;outline:none;box-shadow:none;overflow-y:auto}
.composer-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:6px}
.composer-scope{display:inline-flex;align-items:center;gap:5px;color:var(--muted);font-size:10px;line-height:1.5}
.composer-scope .ui-icon{width:13px;height:13px}
#agent-root .agent-send{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;padding:7px;border-radius:50%;background:var(--action);color:var(--action-text)}
#agent-root .agent-send .ui-icon{width:19px;height:19px}
#agent-root .agent-send:disabled{opacity:.28;cursor:default}
.composer-note{display:flex;justify-content:space-between;gap:10px;font-size:10px;line-height:1.5;color:var(--muted);opacity:.75;margin:10px 5px 0}
#agent-root:not(.agent-inline) .composer-note{justify-content:center}
#agent-root .agent-welcome,#agent-root.agent-inline .agent-welcome{width:100%;max-width:550px;margin:0 auto;padding:20px 0;text-align:center}
#agent-root .is-empty .agent-chat{display:flex;align-items:safe center;justify-content:center}
#agent-root .welcome-symbol{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;margin:0 0 18px;color:var(--gold);background:transparent;border:0;border-radius:0}
#agent-root .welcome-symbol .ui-icon{width:50px;height:50px}
#agent-root .agent-welcome h2{font-size:25px;letter-spacing:-.5px;font-weight:500;margin:0 0 10px}
#agent-root .agent-welcome p{font-size:12px;color:var(--muted);line-height:1.8;margin:0 0 25px}
.agent-suggestions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
#agent-root .agent-example{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:auto;margin:0;padding:9px 12px;font-size:11px;border:1px solid var(--line);border-radius:20px;background:transparent;color:var(--muted)}
#agent-root .agent-example:hover{background:var(--hi);color:var(--text)}
#agent-root:not(.agent-inline) .agent-head-caption{display:none}
#agent-root:not(.agent-inline) .agent-welcome h2{font-size:22px}
#agent-root .agent-pending{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);padding:8px 0 20px}
.thinking-dots{color:var(--gold);letter-spacing:3px;animation:fin-thinking 1.4s ease-in-out infinite}
@keyframes fin-thinking{50%{opacity:.25}}
@media(prefers-reduced-motion:reduce){.thinking-dots{animation:none}}
#agent-root .settings-open .agent-compose{display:none}
.agent-library-view,.agent-skills-view,.agent-memory-manager{max-width:720px;margin:0 auto}
.agent-library-view .row,.agent-skills-view .row{align-items:center;margin-bottom:15px}
#agent-root .agent-capabilities{max-height:none;overflow:visible;margin-top:24px;border:0;background:transparent;padding:0}
#agent-root .agent-capabilities>div{padding:12px 0;border-bottom:1px solid var(--line);font-size:12px}
#agent-root .agent-error{margin:0 24px 12px;font-size:12px;color:var(--red)}
#agent-root .agent-library-view h3,#agent-root .agent-skills-view h3{font-size:16px}
#agent-root :is(button,summary):focus-visible{outline:2px solid var(--gold-border);outline-offset:3px}
@media(max-width:760px){
 #app .main.chat-main{height:calc(100dvh - 70px);padding:12px 12px 0}
 #app .chat-main .topline{padding:0 4px 6px}
 #agent-root.agent-inline .agent-head{padding:12px 4px 15px}
 #agent-root .agent-head-caption{display:none}
 #agent-root.agent-inline .agent-chat{padding:15px 10px 24px}
 #agent-root .agent-chat{padding:20px}
 #agent-root.agent-inline .agent-compose{padding:8px 0 12px}
 #agent-root #agent-input{font-size:16px}
 #agent-root .agent-head-actions{gap:0}
 #agent-root .agent-library-button{padding:6px}
 #agent-root .agent-welcome h2{font-size:24px}
 #agent-root .composer-note{justify-content:center}
 #agent-root .composer-note>span{display:none}
 #agent-root .composer-note{font-size:0}
 #agent-root .composer-note>span{display:block;font-size:10px}
 #agent-root:not(.agent-inline) .composer-note{font-size:10px}
 #agent-root .agent-panel{padding-bottom:env(safe-area-inset-bottom)}
}
/* Keep the compact title bar horizontal when the site's mobile headers stack. */
#agent-root .agent-head,#agent-root.agent-inline .agent-head{flex-direction:row}

/* Original Xiao Qi identity, shared across conversation entry and messages. */
#agent-root .xiaoqi-avatar{display:block;width:40px;height:40px;max-width:none;object-fit:contain;flex-shrink:0}
#agent-root .agent-logo{width:40px;height:40px;flex-shrink:0}
#agent-root .message-avatar{width:34px;height:34px;align-items:center;justify-content:center}
#agent-root .message-avatar .xiaoqi-avatar{width:34px;height:34px}
#agent-root .agent-launch{display:inline-flex;align-items:center;gap:7px;padding:5px 13px 5px 6px;min-height:48px}
#agent-root.agent-inline .agent-launch{display:none}
#agent-root .xiaoqi-mascot{display:block;object-fit:contain;max-width:100%;flex-shrink:0}
#agent-root .welcome-symbol{width:180px;height:180px;margin:0 0 14px}
#agent-root .welcome-symbol .xiaoqi-mascot{width:100%;height:100%;animation:xiaoqi-greet 4s ease-in-out infinite;transform-origin:50% 90%}
#agent-root.agent-inline .welcome-symbol{width:200px;height:200px}
#agent-root .agent-pending .xiaoqi-mascot{width:64px;height:64px}
#agent-root .agent-error{display:flex;align-items:center;gap:12px;max-height:130px;overflow:auto;flex-shrink:0}
#agent-root .agent-error .xiaoqi-mascot{width:56px;height:56px}
#agent-root .agent-error p{margin:0;overflow-wrap:anywhere}
@keyframes xiaoqi-greet{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-5px) rotate(1deg)}}
@media(max-height:700px),(max-width:760px){
 #agent-root .welcome-symbol,#agent-root.agent-inline .welcome-symbol{width:138px;height:138px;margin-bottom:10px}
 #agent-root .agent-welcome{padding:8px 0}
}
@media(prefers-reduced-motion:reduce){#agent-root .welcome-symbol .xiaoqi-mascot{animation:none}}

body.agent-open #agent-root .agent-launch{display:none}

/* A quiet conversation rail, with the main conversation always pinned. */
#agent-root .agent-dialogue-layout{position:relative;display:flex;flex:1;min-height:0;min-width:0;overflow:hidden}
#agent-root .agent-conversation{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0}
#agent-root .agent-thread-sidebar{display:flex;flex-direction:column;gap:6px;width:216px;flex-shrink:0;padding:12px 14px 18px 6px;border-right:1px solid var(--line);overflow:auto;scrollbar-width:thin}
#agent-root #agent-new-thread{display:flex;align-items:center;gap:9px;justify-content:flex-start;width:100%;padding:11px 13px;margin-bottom:15px;font-size:12px;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--text)}
#agent-root #agent-new-thread .ui-icon{width:16px;height:16px}
#agent-root .thread-item{display:flex;align-items:center;justify-content:flex-start;gap:9px;width:100%;min-width:0;text-align:left;padding:11px 12px;margin:2px 0;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:12px;font-weight:400;box-shadow:none}
#agent-root .thread-item:hover{background:var(--hi);color:var(--text);filter:none}
#agent-root .thread-item.is-active{background:var(--hi);color:var(--text)}
#agent-root .thread-item-icon{display:flex;flex-shrink:0;opacity:.65}
#agent-root .thread-item-icon .ui-icon{width:15px;height:15px}
#agent-root .thread-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#agent-root .thread-group-label{margin:19px 12px 6px;color:var(--muted);font-size:10px;letter-spacing:.08em;opacity:.75}
#agent-root .thread-empty{padding:4px 12px;color:var(--muted);font-size:11px;line-height:1.8;opacity:.6}
#agent-root .conversation-heading{padding:9px 24px;color:var(--muted);font-size:11px;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#agent-root .composer-bottom{justify-content:flex-end;margin-top:2px}
#agent-root .agent-compose{padding-bottom:18px}
#agent-root :is(.thread-item,#agent-new-thread):disabled{opacity:.5;cursor:wait}
#agent-root .thread-dismiss{display:none}
#agent-root:not(.agent-inline) .agent-thread-sidebar{display:none}
#agent-root:not(.agent-inline) .history-open .agent-thread-sidebar{display:flex;position:absolute;inset:0 auto 0 0;width:236px;z-index:6;padding:16px 12px;background:var(--panel);border-right:1px solid var(--line)}
#agent-root:not(.agent-inline) .history-open .thread-dismiss{display:block;position:absolute;inset:0;z-index:5;border:0;border-radius:0;background:#0005}
@media(min-width:901px){#agent-root.agent-inline #agent-history-toggle{display:none}}
@media(max-width:900px){
 #agent-root.agent-inline .agent-thread-sidebar{display:none}
 #agent-root.agent-inline .history-open .agent-thread-sidebar{display:flex;position:absolute;inset:0 auto 0 0;width:236px;z-index:6;padding:16px 12px;background:var(--panel)}
 #agent-root.agent-inline .history-open .thread-dismiss{display:block;position:absolute;inset:0;z-index:5;border:0;border-radius:0;background:#0005}
 #agent-root .conversation-heading{padding:6px 12px}
}
