/* Conversation treatment. The approved empty state and landing keep their layout. */
.demo-toolbar[hidden]{display:none}
.demo-toolbar{width:min(100%,720px);margin:16px auto 0;padding:10px 12px;background:#f6f7f8;border-radius:10px;display:flex;align-items:center;gap:10px;font-size:12px;flex-shrink:0}
.demo-caption{display:flex;align-items:center;gap:7px;white-space:nowrap;color:var(--muted)}
.demo-caption:before{content:'';width:6px;height:6px;background:var(--accent);border-radius:50%}
.demo-toolbar label{margin-left:auto}
.demo-toolbar select{max-width:205px;border:0;background:transparent;font:inherit;color:var(--ink);padding:5px 20px 5px 4px}
.demo-replay{padding:6px 9px;font-size:12px;background:#fff;border:1px solid var(--line);border-radius:7px;white-space:nowrap}
.chat.is-started .messages{gap:20px;padding:22px 6px 8px}
.chat.is-started .messages>.message.is-continuation{margin-top:-13px}
.chat.is-started .message{max-width:89%;font-size:14px;line-height:1.4;white-space:normal}
.chat.is-started .message.user{padding:0;background:transparent;border-radius:0}
.message.user .message-copy{padding:10px 15px;background:#f3f4f5;border-radius:18px 18px 4px 18px;white-space:pre-wrap}
.chat.is-started .message.assistant{padding-left:0;display:block;align-self:flex-start;min-height:40px;max-width:92%}
.message-author{display:flex;align-items:center;gap:8px;margin-bottom:7px;white-space:normal}
.message.user .message-author{justify-content:flex-end}
.message-avatar{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;border-radius:50%;font-size:11px;font-weight:700;line-height:1;background:var(--accent-ink);color:#fff}
.message.user .message-avatar{background:#f3f4f5;color:var(--muted);border:1px solid var(--line)}
.message-author-name{font-size:11px;font-weight:600;color:var(--ink)}
.message.assistant .message-copy{background:#fff0f0;padding:10px 15px;border-radius:18px 18px 18px 4px;overflow-wrap:anywhere;white-space:pre-wrap}
.chat.is-started .mascot-slot{width:38px;height:38px;top:1px;border:0;background:#ffe8e8;border-radius:50%;overflow:hidden}
.chat.is-started .mascot-slot .mascot-still{display:block;width:100%;height:100%;border-radius:50%}
.mascot-portrait{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.message-copy{display:block;min-width:0}
.message-file{display:flex;gap:10px;align-items:center;padding-bottom:9px;margin-bottom:8px;border-bottom:1px solid #e2e4e6;white-space:normal;font-size:12px;line-height:1.4}
.message-file svg{flex-shrink:0;color:var(--accent-ink)}
.message-file strong{display:block;font-weight:600;overflow-wrap:anywhere}
.message-file small{display:block;margin-top:2px;color:var(--muted);font-size:11px}
.chat.is-started .composer{margin-top:16px;border-radius:14px}
.chat.is-started textarea{min-height:62px;max-height:150px}
.chat.is-started #file-card:empty{display:none}
.chat.is-started .state-box{margin:12px 6px 8px;border-radius:12px}
.chat.is-started .working-note{padding:18px 16px 16px 64px;background:transparent;align-items:flex-start;gap:10px}
.working-note>.mascot-slot{top:14px;left:6px}
.work-copy{flex:1;min-width:0}
.work-title{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600}
.work-copy small{display:block;margin-top:3px;font-size:13px;color:var(--muted)}
.work-dots{display:inline-flex;gap:3px;align-items:center}
.work-dots i{width:3px;height:3px;background:var(--accent);border-radius:50%;animation:work-dot 1.2s ease-in-out infinite}
.work-dots i:nth-child(2){animation-delay:.16s}.work-dots i:nth-child(3){animation-delay:.32s}
.work-track{display:flex;gap:4px;width:116px;margin-top:14px}
.work-track i{height:3px;flex:1;border-radius:3px;background:#e9eaeb;transition:background .3s}
.work-track i.reached{background:var(--accent)}
.stop-work{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:7px;background:white;padding:6px 9px;flex-shrink:0}
.work-status{margin:4px 6px 12px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.work-status-label{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}
.work-status-label i{width:5px;height:5px;border-radius:50%;background:var(--accent);animation:work-dot 1.7s ease-in-out infinite}
.recovery-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:2px 6px 12px}
.recovery-actions .secondary{font-size:12px;min-height:36px;padding:8px 13px}
.recovery-actions small,.chat-notice{color:var(--muted);font-size:12px;line-height:1.6}
.chat-notice{margin:4px 6px 12px}
#typing-indicator{margin:8px 6px 12px;flex-shrink:0}
#typing-indicator:empty{display:none}
#typing-indicator .message{width:fit-content;position:relative}
#typing-indicator .message-copy{width:fit-content;min-width:66px;min-height:41px}
.typing-dots{display:inline-flex;align-items:center;gap:5px;height:20px;vertical-align:middle}
.typing-dots i{width:6px;height:6px;background:#db7c7f;border-radius:50%;animation:typing-dot 1.05s ease-in-out infinite}
.typing-dots i:nth-child(2){animation-delay:.14s}.typing-dots i:nth-child(3){animation-delay:.28s}
.stream-content{display:grid}
.stream-content>span{grid-area:1/1}
.stream-measure{visibility:hidden}
.stream-text:after{content:'';display:inline-block;width:2px;height:1em;background:#cf7074;vertical-align:-2px;margin-left:2px;animation:typing-caret .7s step-end infinite}
@keyframes typing-dot{0%,65%,100%{opacity:.5;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@keyframes typing-caret{50%{opacity:0}}
.chat.is-started .result-card{margin:8px 6px 16px;padding:18px;grid-template-columns:72px minmax(0,1fr);gap:16px;border-radius:14px;background:#fff;box-shadow:0 3px 16px #171d2005}
.chat.is-started .thumb{width:72px;align-self:start;border-radius:5px;overflow:hidden}
.chat.is-started .thumb img{display:block;width:100%;height:auto}
.chat.is-started .result-meta{letter-spacing:0;font-size:11px;gap:8px}
.result-status{color:#446050;display:flex;gap:5px;align-items:center}
.result-status:before{content:'✓';font-size:12px}
.chat.is-started .result-title{font-size:15px;margin-top:7px;overflow-wrap:anywhere}
.chat.is-started .result-main>p{font-size:12px;margin-top:4px;line-height:1.6}
.chat.is-started .result-actions{gap:8px;margin-top:14px}
.chat.is-started .result-actions>button,.chat.is-started .result-actions>a{font-size:12px;min-height:38px;padding:9px 12px}
.chat.is-started .result-actions .primary{background:var(--ink);color:white}
.chat.is-started .result-main>.inline-note{margin:10px 0 0;color:var(--muted);font-size:11px}
.result-card.is-previous{opacity:.64;box-shadow:none}
.previous-result{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:2px 6px 12px;padding:3px 12px;background:#f6f7f8;border-radius:9px;font-size:12px;color:var(--muted)}
.previous-result .text-btn{font-size:12px;min-height:34px}
.demo-suggestion{margin:0 6px 12px;display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap}
.demo-suggestion button{font-size:12px;padding:8px 12px;border-radius:20px;border:1px solid var(--line);background:white;text-align:left}
.demo-suggestion button:hover{border-color:#aaa}
.demo-suggestion small{width:100%;color:var(--muted);font-size:11px;line-height:1.5}
.chat.is-started .terms{font-size:11px}
.message.is-new,.result-card.is-new{animation:chat-appear .28s ease-out both}
.mascot-button[data-state=working] .mascot-compact .bunny-rig{transform-origin:120px 170px;animation:chat-think 2.4s ease-in-out infinite}
.mascot-button[data-state=working] .bunny-ear-left{animation:chat-ear 2.4s ease-in-out infinite}
@keyframes work-dot{0%,75%,100%{opacity:.35;transform:translateY(0)}35%{opacity:1;transform:translateY(-2px)}}
@keyframes chat-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes chat-think{0%,100%{transform:rotate(0)}50%{transform:rotate(-3deg)}}
@keyframes chat-ear{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(6deg)}}
@media(max-width:600px){
 .demo-toolbar{margin-top:12px;gap:4px;flex-wrap:wrap;padding:8px 10px}
 .demo-caption{font-size:11px;flex-basis:100%;margin-bottom:2px}
 .demo-toolbar label{margin-left:0;flex:1;min-width:0}.demo-toolbar select{width:100%;max-width:100%;min-width:0;font-size:12px}
 .demo-replay{font-size:11px}.chat.is-started .messages{padding:12px 0 8px;gap:18px}
 .chat.is-started .messages>.message.is-continuation{margin-top:-11px}
 .chat.is-started .message{max-width:94%;font-size:13px}.message.user .message-copy{padding:9px 12px}
 .chat.is-started .result-card{margin:8px 0 12px;padding:14px;grid-template-columns:44px minmax(0,1fr);gap:10px}
 .chat.is-started .thumb{width:44px}.chat.is-started .result-title{font-size:13px}
 .chat.is-started .result-meta{flex-wrap:wrap;gap:2px;font-size:10px}.chat.is-started .version{font-size:10px;max-width:100%;padding:3px 0}
 .chat.is-started .result-main>.result-actions{display:none}.chat.is-started .mobile-actions{display:flex!important;grid-column:1/-1;flex-direction:column;margin-top:2px}
 .chat.is-started .mobile-actions>*{width:100%}.demo-suggestion{margin-left:0}
 .chat.is-started .working-note{padding-left:52px;padding-right:0;margin-left:0;margin-right:0}
 .work-title{font-size:14px}.work-copy small{font-size:12px}.working-note>.mascot-slot{left:0}
 .chat.is-started .composer{margin-top:8px}.chat.is-started textarea{min-height:54px;max-height:120px}
 .work-track{margin-top:10px}.stop-work{font-size:11px;padding:6px}
 .chat.is-started .message.assistant{padding-left:0;max-width:96%}
 .message.assistant .message-copy{padding:9px 12px;border-radius:16px 16px 16px 4px}
 .chat.is-started .mascot-slot{width:33px;height:33px;top:2px}
 #typing-indicator .message-copy{min-height:38px}
 #typing-indicator{margin:6px 0 10px}.work-status{margin-left:0}
 .recovery-actions,.chat-notice,.previous-result{margin-left:0}
 .work-status-label{font-size:11px;gap:5px}
}
/* Keep touch input at 16px to avoid focus zoom on iPhone. */
@media(hover:hover) and (pointer:fine){#request{font-size:15px}}
@media(prefers-reduced-motion:reduce){.message.is-new,.result-card.is-new,.work-dots i,.typing-dots i,.stream-text:after,.work-status-label i{animation:none}.work-track i{transition:none}.stream-text:after{display:none}}
