/* Minimal chat only. Reader geometry and the four platform columns are unchanged. */
#chatPanel{color:#202124;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#fff;border:0;box-shadow:none}
#chatConversation[hidden],#chatEmpty[hidden],#chatStop[hidden],#chatLatest[hidden],#chatPanel .send[hidden]{display:none}
#chatConversation{display:flex;flex-direction:column;flex:1;min-height:0}
#chatPanel .chat-conversation-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;flex:none;border:0}
#chatPanel .chat-conversation-top h2{margin:0;font:600 14px/1.4 system-ui;color:inherit}
#chatPanel button{font-family:inherit;border:0;box-shadow:none;background:transparent;color:inherit;cursor:pointer}
#chatPanel button:disabled{cursor:default;color:#8b8b8b}
#chatPanel button:focus-visible,#chatPanel summary:focus-visible,#chatMessages:focus-visible{outline:2px solid #505050;outline-offset:2px}
#chatPanel #chatCollapse{display:grid;place-items:center;flex:none;width:40px;height:40px;border:0;border-radius:50%;font:26px/1 system-ui;color:#666}
#chatPanel button:hover:not(:disabled){background:#f3f3f3}
#chatMessages{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-color:#b8b8b8 transparent;padding:8px 24px 12px;scroll-padding:16px}
#chatEmpty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 20px;color:#666}
#chatEmpty h3{font:500 20px/1.4 system-ui;color:#242424;margin:0 0 8px}
#chatEmpty p{font:14px/1.6 system-ui;margin:0;max-width:36ch}
#chatEmpty:not([hidden])+#chatMessages{flex:0;padding:0}
#chatPanel .chat-turn{display:flex;flex-direction:column;gap:16px;margin:0 auto 20px;max-width:76ch}
#chatPanel .chat-message{max-width:100%;min-width:0;padding:0;border:0;border-radius:0;background:transparent;color:inherit;box-shadow:none}
#chatPanel .chat-user{align-self:flex-end;max-width:88%;margin-top:4px}
#chatPanel .chat-user>.chat-text{font-weight:500}
#chatPanel .chat-assistant{align-self:stretch;min-width:0}
#chatPanel .chat-speaker{display:block;font:600 12px/1.5 system-ui;letter-spacing:0;color:#606060;margin-bottom:4px}
#chatPanel .chat-text{font:400 clamp(15px,1vw,17px)/1.7 system-ui;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
#chatPanel .chat-reference,#chatPanel .chat-answer-status{display:block;font:11px/1.5 system-ui;color:#707070;margin:8px 0 0}
#chatPanel .chat-pending{font:14px/1.6 system-ui;color:#707070;margin:0}
#chatPanel .chat-response-footer{display:flex;align-items:start;gap:4px 12px;flex-wrap:wrap;margin-top:4px}
#chatPanel .chat-source-details{min-width:0;margin:0;padding:0;border:0;flex:1}
#chatPanel .chat-source-details[open]{flex-basis:100%}
#chatPanel .chat-source-details summary{cursor:pointer;font:12px/1.5 system-ui;color:#606060;padding:10px 0;min-height:40px;width:fit-content}
#chatPanel .chat-source,#chatPanel .chat-account{font:13px/1.5 system-ui;padding:8px 0;border:0;background:transparent;text-align:left;margin-top:4px;min-height:40px;text-decoration:underline;text-underline-offset:3px;border-radius:0}
#chatPanel .chat-source-text{font:13px/1.7 system-ui;margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}
#chatPanel .chat-source-details a{font:12px/1.6 system-ui;color:inherit;text-decoration:underline}
#chatPanel .chat-error-label{display:block;color:inherit;font:600 13px/1.5 system-ui;margin-bottom:6px}
#chatPanel .chat-message-actions{display:flex;gap:4px;flex-wrap:wrap;margin:0}
#chatPanel .chat-message-actions button,#chatPanel .chat-edit{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;padding:8px;border:0;border-radius:8px;background:transparent;color:#666;font:12px/1.4 system-ui}
#chatPanel .chat-user-meta{display:flex;align-items:center;gap:8px}
#chatPanel .chat-user-meta .chat-reference{margin:0}
#chatPanel .chat-user-meta .chat-edit{margin:0;min-width:32px;min-height:32px;padding:6px}
#chatPanel .chat-turn:last-child{margin-bottom:0}
#chatPanel .chat-action-icon{display:block;width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.6}
#chatPanel #chatLatest{align-self:center;margin:0 0 4px;min-height:40px;padding:8px 14px;font:12px/1.4 system-ui;border:0;background:#fff;color:#606060}
#chatPanel .chat-caption{margin-bottom:4px}
#chatPanel #chatTitle{color:#303030;font:600 13px/1.4 system-ui}
#chatPanel #chatTitle svg{color:inherit;width:16px;height:16px}
#chatPanel #chatVoiceStatus{color:#606060;font:12px/1.5 system-ui;white-space:normal;overflow-wrap:anywhere}
#chatVoiceStatus[data-idle=true]{display:none}
#chatPanel #chatForm{display:flex;flex:none;align-items:flex-end;height:auto;min-height:44px;gap:4px;padding:6px 4px 4px 0;border:0;border-top:1px solid #e5e5e5;border-radius:0;background:#fff;box-shadow:none}
#chatPanel:focus-within #chatForm{box-shadow:none}
#chatPanel #chatForm:has(#question:focus-visible){border-color:#777;box-shadow:none}
#chatPanel #question{flex:1;min-width:0;min-height:40px;max-height:120px;height:40px;padding:9px 8px 8px 0;resize:none;border:0;border-radius:0;background:transparent;color:#242424;font:16px/1.5 system-ui;overflow-y:auto}
#chatPanel #question::placeholder{color:#767676;opacity:1}
#chatPanel #question:focus,#chatPanel #question:focus-visible{outline:none;box-shadow:none}
#chatPanel .send,#chatPanel #chatStop,#chatPanel #chatVoiceToggle{display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;flex:none;padding:9px;border:0;border-radius:50%;box-shadow:none;margin:0}
#chatPanel .send,#chatPanel #chatStop{background:#242424;color:#fff}
#chatPanel .send:hover:not(:disabled),#chatPanel #chatStop:hover{background:#454545}
#chatPanel .send:disabled{background:#ededed;color:#a0a0a0;opacity:1}
#chatPanel .send svg,#chatPanel #chatStop svg{width:20px;height:20px;stroke:currentColor;fill:none}
#chatPanel #chatStop svg rect{fill:currentColor;stroke:none}
#chatPanel #chatVoiceToggle,#chatPanel #chatVoiceToggle[data-online=true]:not(:disabled){color:#404040;background:transparent;box-shadow:none}
#chatPanel #chatVoiceToggle[data-active=true]:not(:disabled){background:#242424;color:#fff;box-shadow:none}
#chatPanel #chatVoiceToggle[data-mic=true]::after{background:#242424;border-color:#fff}
#chatPanel #chatVoiceToggle:disabled{color:#a0a0a0;background:transparent;border:0;box-shadow:none;opacity:1}
#chatPanel:not([data-expanded=true]) #chatStop{display:none}
#chatPanel[data-expanded=true]{display:flex;flex-direction:column;justify-content:flex-start;position:absolute;z-index:10;top:var(--chat-expanded-top,50%);bottom:0;height:auto;margin:0;border:0;border-radius:0;background:#fff;box-shadow:0 -6px 18px #00000008;padding:0 0 8px;overflow:hidden}
#chatPanel[data-expanded=true] .chat-caption{flex:none;margin:0 20px 4px;justify-content:flex-end}
#chatPanel[data-expanded=true] .chat-caption:has(#chatVoiceStatus[data-idle=true]){display:none}
#chatPanel[data-expanded=true] #chatTitle{display:none}
#chatPanel[data-expanded=true] #chatVoiceStatus{max-width:100%}
#chatPanel[data-expanded=true] #chatForm{margin:0 20px;width:auto}
body:has(#chatPanel[data-expanded=true]) #verses{max-height:var(--chat-visible-verses);align-self:start;height:100%}
@media(min-width:1100px){.workspace>main{position:relative}#chatPanel[data-expanded=true]{left:17px;right:17px}}
@media(max-width:1099px){#chatPanel:not([data-expanded=true]){border:0;box-shadow:none}#chatPanel[data-expanded=true]{top:var(--chat-expanded-top,50%);left:332px;right:25px;padding-bottom:max(8px,env(safe-area-inset-bottom))}#chatPanel .send,#chatPanel #chatStop,#chatPanel #chatVoiceToggle{width:44px;height:44px;min-width:44px;min-height:44px}}
@media(max-width:740px){#chatPanel[data-expanded=true]{left:10px;right:10px}#chatPanel .chat-conversation-top{padding:4px 8px}#chatMessages{padding:12px 12px 20px}#chatPanel .chat-turn{gap:16px;margin-bottom:20px}#chatPanel .chat-user{max-width:92%}#chatPanel .chat-text{font-size:16px}#chatPanel[data-expanded=true] #chatForm{margin:0 8px}#chatPanel[data-expanded=true] .chat-caption{margin-right:8px}#chatPanel .chat-message-actions button,#chatPanel .chat-edit,#chatPanel .chat-source-details summary{min-height:44px}}
@media(forced-colors:active){#chatPanel #chatForm{border-bottom:1px solid CanvasText}#chatPanel .send,#chatPanel #chatStop,#chatPanel #chatVoiceToggle[data-active=true]{outline:1px solid ButtonText}}

/* Covered tools retain their grid space but cannot leave decorative edges behind the chat. */
.workspace>main:has(>#chatPanel[data-expanded=true])>:not(.reading):not(#chatPanel){visibility:hidden}
/* Reserve conversation space when a phone keyboard reduces the viewport. */
@media(max-width:1099px){#chatPanel #question{max-height:clamp(48px,calc(var(--app-viewport-height,100dvh) * .15),120px)}}
@media(max-height:500px){#chatPanel #chatEmpty{display:none}}
