/* One chat surface: large conversation, three composer actions. */
#chatView .section-head{position:relative;flex:0 0 auto;margin:0 0 8px;min-height:40px;align-items:center}
#chatView .section-head h1{font-size:23px;margin:0}
#chatView .section-head p,#chatWorking,#chatView .assistant-bar{display:none!important}
#chatView .chat-conversation-frame{background:#081c30;border:1px solid #2c4862;border-radius:16px;padding:0 8px 8px;min-height:0}
#chatView .messages{padding:12px 3px;scroll-padding:12px}
#chatView .message.ai .bubble{font-size:19px;line-height:1.45;padding:6px 3px}
#chatView .message.user .bubble{font-size:19px;line-height:1.4;max-width:96%}
#chatView .message.ai:last-child{min-height:0}
#chatView .message time{font-size:13px}
#chatView .composer{background:#122b43;border-color:#64829c;padding:7px;gap:0}
#chatView .composer textarea{min-height:56px!important;max-height:92px!important;height:56px;font-size:19px;line-height:25px;padding:8px;resize:none}
#chatView .chat-actions{display:flex;gap:8px;align-items:center;padding:4px 0 0}
#chatView .composer .chat-photo,#chatView .composer .chat-mic,#chatView .composer .send-btn{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;height:44px;border-radius:10px;font-size:17px;padding:0 10px;width:auto;min-width:44px}
#chatView .composer .chat-photo{flex:1 1 auto}
#chatView .composer .chat-mic{flex:0 0 44px;padding:0}
#chatView .composer .send-btn{flex:0 1 auto;margin-left:auto;max-width:55%;font-weight:700}
#chatView .chat-actions svg{width:22px;height:22px;flex:0 0 auto}
#chatView .chat-photo svg{display:none}
#chatView .attach-label{white-space:nowrap;line-height:1.15}
#chatView .chat-photo-preview:not([hidden]),#chatView .image-reference:not([hidden]){display:flex;align-items:center;gap:10px;flex:0 0 auto;max-height:56px;overflow:auto;margin:3px 2px 5px;padding:6px;border-radius:10px;background:#1d3c55}
#chatView .attached-photo,#chatView .image-reference img{width:44px;height:44px;object-fit:contain;border-radius:8px;background:#061629;flex:0 0 44px}
#chatView #chatPhotoFilename,#chatView .image-reference span{flex:1 1 auto;font-size:17px;overflow-wrap:anywhere;line-height:1.3}
#chatView #chatPhotoRemove,#chatView .image-reference button{flex:0 0 44px;width:44px;min-height:44px;border-radius:10px}
#chatView .assistant-status{flex:0 0 auto;font-size:17px;line-height:1.35;max-height:65px;padding:4px 3px;margin:0 0 5px;border:0;background:transparent;color:#ffe3a0;overflow:auto}
#chatView[aria-busy="true"]>.assistant-status:not([hidden]){display:block}
#chatView .chat-retry{font-size:17px;min-height:40px;padding:6px 10px;flex:0 0 auto;align-self:flex-start;margin:0 0 6px}
#chatView .chat-options{margin-left:auto;position:relative;z-index:40}
#chatView .chat-options>summary{list-style:none;cursor:pointer;color:#ffe3a0;border:1px solid #4f6980;border-radius:10px;padding:7px 12px;min-height:40px;box-sizing:border-box;font-size:17px}
#chatView .chat-options>summary::-webkit-details-marker{display:none}
#chatOptionsBody{position:absolute;right:0;top:calc(100% + 6px);width:min(290px,80vw);box-sizing:border-box;padding:10px;border:1px solid #627d92;border-radius:12px;background:#102b43;box-shadow:0 12px 30px #0009;display:flex;flex-direction:column;gap:7px;max-height:60dvh;overflow:auto}
#chatView #chatOptionsBody button{font:inherit;font-size:18px;width:100%;min-height:44px;height:auto;padding:9px 10px;border:1px solid #4a6880;background:#193c57;color:#ffe3a0;border-radius:9px;text-align:left;display:flex;gap:8px;align-items:center}
#chatView #chatOptionsBody #clearChatBtn{max-width:none;width:100%}
#chatView #chatOptionsBody .memory-label{font-size:18px}
#chatView #chatOptionsBody .chat-reader{display:flex;flex-direction:column;gap:6px;padding:0;border:0;margin:0;background:transparent}
#chatView #chatOptionsBody svg{width:22px;height:22px;flex:0 0 22px}
#chatView .generated-image{margin:10px 0;max-width:100%}
#chatView .generated-image img{max-width:100%;width:100%;height:auto;border-radius:12px}
#chatView .generated-image figcaption{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
#chatView .generated-image button,#chatView .generated-image .image-save{font-size:18px;min-height:44px;padding:8px 12px;box-sizing:border-box}
#chatView .image-error:empty{display:none}
#chatView .image-error{width:100%;font-size:18px;color:#ffe3a0}
#chatView .remember-actions{margin-top:6px}
#chatView .remember-actions button{font-size:15px;min-height:36px;padding:5px 8px;background:#153b55;color:#ffe3a0;border:1px solid #45637a;border-radius:8px}
#chatView [hidden]{display:none!important}
body.yoryi-keyboard-open #chatView .composer textarea{min-height:56px!important;max-height:80px!important}
@media(max-height:600px){#chatView .composer textarea{min-height:56px!important;max-height:80px!important}#chatView .message.ai .bubble{font-size:19px}}
@media(max-width:359px){#chatView .composer .chat-photo,#chatView .composer .send-btn{font-size:16px;padding:0 6px}#chatView .chat-actions{gap:6px}#chatView .message.ai .bubble{font-size:19px}}

/* The conversation owns all remaining height; the empty draft is one line. */
#chatView .chat-conversation-frame{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden;border:1px solid #35516a;border-radius:14px;background:#081c30;padding:0 8px 5px}
#chatView .messages{flex:1 1 0;min-height:0!important;overflow-y:auto}
#chatView .composer{flex:0 0 auto;border:0;border-radius:0;background:transparent;padding:0;box-shadow:none}
#chatView .composer:focus-within{border:0}
#chatView .composer textarea,body.yoryi-keyboard-open #chatView .composer textarea{flex:0 0 auto;min-height:44px!important;max-height:92px!important;height:44px;line-height:26px;font-size:20px;background:transparent;border:0;border-radius:0;padding:8px 4px;box-shadow:none}
#chatView .chat-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr) minmax(0,1fr);gap:5px}
#chatView .composer .chat-photo,#chatView .composer .send-btn,#chatView .composer .chat-clear{max-width:none;width:100%;min-width:0;height:44px;margin:0;font-size:15px;padding:0 4px;white-space:nowrap}
#chatView .composer .chat-clear{background:#193c57;color:#ffe3a0;border:1px solid #49677e;border-radius:10px}
#chatView #chatPhotoFilename{display:none}
#chatView .chat-photo-preview:not([hidden]){justify-content:space-between}
#chatView .chat-voice-status{font-size:15px;max-height:none;overflow:visible}
#chatView .chat-options>summary{font-size:16px;padding:6px 10px}
#chatView .generated-image figcaption{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#chatView .generated-image figcaption button{width:100%;min-width:0;font-size:16px;padding:7px 4px;justify-content:center}
#chatView .generated-image[data-media-selected]{outline:2px solid #f2c66d;outline-offset:3px;border-radius:12px}
#chatView .generated-image .image-error{grid-column:1/-1}
#chatView .media-confirm{min-height:44px;font-size:17px;padding:8px;background:#f2c66d;color:#07182c;border:0;border-radius:10px;margin-top:6px}

#chatOptionsBody select{width:100%;min-height:44px;font:inherit;font-size:17px;background:#193c57;color:#ffe3a0;border:1px solid #4a6880;border-radius:9px;padding:8px}

#chatView .messages{display:block;overflow-y:auto;min-height:0!important}
#chatTimeline{display:flow-root;min-width:0}
#chatPreview .bubble{white-space:pre-wrap;overflow-wrap:anywhere}
#chatView .chat-conversation-frame .assistant-status{margin:4px 2px;max-height:2.6em}
#chatView .chat-conversation-frame .chat-retry{margin:0;min-height:36px}
#chatOptionsBody .professor-option{display:flex;align-items:center;gap:8px;padding:8px;min-height:44px;color:#ffe3a0}
#chatOptionsBody .professor-option input{width:20px;height:20px;flex:none}
#chatView .chat-conversation-frame>.chat-actions{flex:0 0 auto;margin:0;padding:5px 0 0}
#chatView .chat-conversation-frame>.chat-actions>button{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-width:0;height:44px;min-height:44px;margin:0;padding:0 4px;border:1px solid #49677e;border-radius:10px;background:#193c57;color:#f8e1a5;font:inherit;font-size:15px;white-space:nowrap}
#chatView .chat-conversation-frame>.chat-actions>.chat-clear{white-space:normal}
#chatView .chat-conversation-frame>.chat-actions>.send-btn{background:linear-gradient(135deg,#ffe8a7,#f2c66d);color:#07182c;border:0;font-weight:700}
#chatView .chat-conversation-frame>.chat-actions>.chat-mic.is-recording{background:#852c3e;border-color:#f4979f}
#chatView .chat-actions .chat-photo svg{display:none}

/* Read, dictate and write in the same conversational scroll area. Only actions stay fixed. */
#chatView .chat-conversation-frame>.messages{flex:1 1 0;min-height:0!important;overflow-y:auto;overscroll-behavior:contain}
#chatView #messages>#chatForm{display:flex;position:static;flex:0 0 auto;width:100%;min-width:0;max-height:none;overflow:visible;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#chatView #chatForm textarea,body.yoryi-keyboard-open #chatView #chatForm textarea{display:block;box-sizing:border-box;align-self:stretch;width:100%;min-width:0;min-height:48px!important;max-height:none!important;overflow:hidden;padding:8px 7px;border:0;border-radius:0;background:transparent;color:#f5f2eb;font-size:20px;line-height:1.4;resize:none;box-shadow:none}
#chatView #chatForm textarea:focus-visible{outline:0;box-shadow:inset 0 -2px #e3bc72}
#chatView #chatForm textarea::placeholder{color:#d3deea;opacity:1}
#chatView #chatForm .chat-voice-status{margin:3px 7px;font-size:15px;line-height:1.4}
#chatView #chatForm .chat-voice-status:empty{display:none}
#chatView .chat-actions{grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr) minmax(0,1fr)}
@media(max-width:359px){#chatView #chatForm textarea{font-size:19px}#chatView .chat-conversation-frame>.chat-actions>button{font-size:14px}}
