/* Documents and speech fit the same tablet as the other sections. */
body:is([data-section=documents],[data-section=speech]) .tablet{height:calc(var(--tablet-header-height) + var(--tablet-scene-height) + 18px)!important;min-height:0!important}
body:is([data-section=documents],[data-section=speech]) .tablet #main{height:var(--tablet-scene-height)!important;min-height:0!important;overflow:visible}
body:is([data-section=documents],[data-section=speech]) .workspace{height:100%;min-height:0;padding-top:24px;padding-bottom:16px;gap:0}
.workspace .workspace-heading{margin-bottom:18px}
.workspace .workspace-columns{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr) minmax(0,1fr);grid-template-areas:"source editor results";gap:24px;flex:1;min-height:0;align-items:stretch}
.workspace .workspace-columns>section{display:flex;flex-direction:column;min-height:0;overflow:visible;gap:10px;align-self:stretch}
.workspace .workspace-columns>section+section{border-top:0;border-left:1px solid var(--edge);padding:0 0 0 24px}
.workspace .workspace-results{max-height:none;width:auto}
.workspace .workspace-results>h2{margin:0 0 4px}
.workspace .workspace-editor{min-height:0}
.workspace #workspace-text{min-height:90px;resize:none;flex:1;font-size:13px;padding:12px}
.workspace h2{font-size:15px}
.workspace .workspace-heading h1{margin-bottom:8px}
.workspace .workspace-button,.workspace .site-select-trigger{min-height:40px;font-size:12px}
.workspace .workspace-source{gap:10px}
.workspace .voice-recorder{gap:6px;padding:0 0 10px;margin:0}
.workspace .voice-recorder-visual{min-height:115px;gap:12px}
.workspace .voice-microphone{width:82px;height:82px;flex-basis:82px;padding:21px}
.workspace .voice-wave{width:calc((100% - 106px)/2);height:34px}
.workspace .voice-record-action{min-height:36px}
.workspace .workspace-file-pane{display:flex;flex-direction:column;gap:8px}
.workspace .upload-zone{min-height:110px;padding:12px}
.workspace .workspace-privacy,.workspace .workspace-meta{font-size:11px;line-height:1.5}
.workspace .workspace-privacy{margin-top:auto}
.workspace .workspace-analysis-settings{grid-template-columns:auto minmax(0,1fr);gap:10px}
.workspace .speech-play{width:34px;height:34px;flex-basis:34px}
.workspace .speech-time{font-size:10px}
.workspace #audio-seek{height:20px;min-height:20px}
.workspace-view-tabs{display:none}
.workspace-source-tabs,.workspace-result-tabs{display:flex;gap:4px;flex-shrink:0;border-bottom:1px solid var(--edge);padding-bottom:8px}
.workspace-source-tabs button,.workspace-result-tabs button,.workspace-view-tabs button{flex:1;min-width:0;padding:8px 5px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text);font:inherit;font-size:12px;cursor:pointer}
:is(.workspace-source-tabs,.workspace-result-tabs,.workspace-view-tabs) button[aria-pressed=true]{border-color:var(--edge);background:var(--halo);color:var(--light)}
/* Keep the document result switch legible within its own column. */
body[data-section=documents] .workspace .workspace-result-tabs{width:100%;align-self:stretch;box-sizing:border-box;gap:4px;padding:4px;border:1px solid var(--edge);border-radius:10px;background:var(--bg)}
body[data-section=documents] .workspace .workspace-result-tabs button{display:flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:44px;padding:10px 14px;border-radius:7px;font-size:14px;line-height:1.25;transition:background-color .18s ease,border-color .18s ease,color .18s ease}
body[data-section=documents] .workspace .workspace-result-tabs button[aria-pressed=true]{background:var(--halo);border-color:var(--edge);color:var(--light);font-weight:600}
body[data-section=documents] .workspace .workspace-result-tabs button:hover{background:var(--halo);color:var(--light)}
body[data-section=documents] .workspace .workspace-result-tabs button:focus-visible{outline:2px solid var(--light);outline-offset:2px}
@media(prefers-reduced-motion:reduce){body[data-section=documents] .workspace .workspace-result-tabs button{transition:none}}
.workspace .workspace-results #workspace-result{display:block;min-height:0}
.workspace .workspace-results .workspace-result-row{padding:0 0 9px;margin-bottom:10px}
.workspace .workspace-results .workspace-result-row>span{font-size:11px;line-height:1.4;margin-bottom:4px}
.workspace .workspace-results .workspace-result-row>strong{font-size:14px;line-height:1.4}
.workspace .workspace-results .workspace-entities{gap:5px;margin-top:6px;max-height:105px;overflow:hidden}
.workspace .workspace-results .workspace-entity{display:block;font-size:11px;padding:5px 7px;line-height:1.4}
.workspace-entity small{font-size:10px;margin-right:5px}
.workspace .workspace-results #document-question{display:flex;border:0;gap:10px;padding:0;margin:0}
.workspace .workspace-results #document-question>label{font-size:13px;margin:0}
.workspace .workspace-results #document-query{height:40px;font-size:12px}
.workspace .workspace-results #document-question>button{width:100%;min-width:0;min-height:40px}
.workspace #document-answer blockquote{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
#workspace-expand-result{align-self:flex-end;border:0;background:none;color:var(--light);font:inherit;font-size:12px;min-height:30px;cursor:pointer}
.workspace #workspace-status{font-size:11px;margin-top:6px;line-height:1.4;max-height:31px;overflow:hidden}
#workspace-detail{width:min(720px,calc(100% - 24px));max-height:85dvh;margin:auto;padding:24px;border:1px solid var(--edge);border-radius:14px;background:var(--bg);color:var(--text);overflow:auto}
#workspace-detail::backdrop{background:#000b}
#workspace-detail-close{display:block;margin:0 0 20px auto;min-height:40px;padding:8px 14px;border:1px solid var(--edge);border-radius:7px;background:var(--halo);color:var(--text)}
#workspace-detail-content .workspace-entities{display:flex;flex-wrap:wrap;gap:8px;max-height:none;overflow:visible}
#workspace-detail-content .workspace-entity{padding:7px 10px}
@media(max-width:1100px){
 .workspace-view-tabs{display:flex;gap:6px;margin-bottom:18px;flex-shrink:0}
 .workspace .workspace-columns{display:block;min-height:0}
 .workspace .workspace-columns>section{height:100%;border:0;padding:0;display:none}
 .workspace[data-view=source] .workspace-source,.workspace[data-view=editor] .workspace-editor,.workspace[data-view=results] .workspace-results{display:flex}
 .workspace .workspace-source{max-width:640px;margin-inline:auto}
 .workspace .workspace-results .workspace-entities{max-height:150px}
 .workspace .workspace-results #workspace-result{width:100%}
}
@media(max-width:767px){
 body:is([data-section=documents],[data-section=speech]) .tablet{margin-top:24px}
 body:is([data-section=documents],[data-section=speech]) .tablet #main{height:calc(var(--tablet-header-height) + var(--tablet-scene-height) - 118px)!important;min-height:0!important}
 .workspace .workspace-heading h1{font-size:28px}
 .workspace .workspace-heading>p{font-size:12px}
 .workspace .workspace-columns>section{gap:12px}
 .workspace .workspace-button,.workspace .site-select-trigger{min-height:44px;font-size:14px}
 .workspace #workspace-text,.workspace .workspace-results #document-query{font-size:16px}
 .workspace .workspace-results .workspace-entities{max-height:190px}
 .workspace .upload-zone{min-height:140px}
 .workspace .voice-recorder-visual{min-height:145px}
}

@media(min-width:768px) and (max-height:850px){
 .workspace .workspace-source{gap:8px}
 .workspace .voice-recorder-visual{min-height:96px}
}

/* Document upload stays inside the source column, with a clearer scale. */
body[data-section=documents] .workspace .workspace-source>h2{font-size:17px}
body[data-section=documents] .workspace .workspace-source .upload-zone{min-height:180px;gap:13px;padding:22px 18px;box-sizing:border-box;border-radius:12px;transition:border-color .18s ease,background-color .18s ease}
body[data-section=documents] .workspace .workspace-source .upload-zone svg{width:40px;height:48px;flex-shrink:0}
body[data-section=documents] .workspace .workspace-source .upload-zone strong{font-size:16px;line-height:1.4}
body[data-section=documents] .workspace .workspace-source .upload-zone>span{font-size:12px;line-height:1.5}
body[data-section=documents] .workspace .workspace-source .upload-zone:hover{border-color:var(--accent);background:var(--halo)}
body[data-section=documents] .workspace .workspace-source .workspace-meta{font-size:12px}
body[data-section=documents] .workspace .workspace-source>.workspace-button{min-height:46px;font-size:14px}
@media(min-width:768px) and (max-height:750px){body[data-section=documents] .workspace .workspace-source .upload-zone{min-height:148px;padding-block:14px;gap:10px}}
@media(prefers-reduced-motion:reduce){body[data-section=documents] .workspace .workspace-source .upload-zone{transition:none}}

/* Selected microphone design; speech controls remain in the source column. */
body[data-section=speech] .workspace .workspace-source>h2{font-size:17px}
body[data-section=speech] .workspace .workspace-source-tabs{width:100%;align-self:stretch;box-sizing:border-box;gap:4px;padding:4px;border:1px solid var(--edge);border-radius:10px;background:var(--bg)}
body[data-section=speech] .workspace .workspace-source-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:9px 6px;font-size:14px;border-radius:7px;line-height:1.3}
body[data-section=speech] .workspace .workspace-source-tabs button svg{width:16px;height:16px;flex-shrink:0}
body[data-section=speech] .workspace .voice-recorder{gap:18px;padding:12px 0 18px;border-bottom:0;margin:0}
body[data-section=speech] .workspace .voice-recorder-visual{min-height:132px;gap:17px;padding:8px 0}
body[data-section=speech] .workspace .voice-microphone{width:104px;height:104px;flex:0 0 104px;padding:22px;box-sizing:border-box}
body[data-section=speech] .workspace .voice-microphone svg{width:44px;height:55px;max-width:100%;max-height:100%}
body[data-section=speech] .workspace .voice-wave{width:calc((100% - 138px)/2);min-width:0;height:42px;flex:1}
body[data-section=speech] .workspace .voice-record-action{min-height:44px;min-width:174px;font-size:14px;padding:10px 20px;gap:10px;background:var(--halo);border-radius:8px}
body[data-section=speech] .workspace .voice-record-action i{width:6px;height:6px}
body[data-section=speech] .workspace #record-status{font-size:12px;line-height:1.5;margin:0;min-height:18px}
body[data-section=speech] .workspace .speech-language{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--muted);line-height:1.5;margin:0 0 2px}
body[data-section=speech] .workspace .speech-language svg{width:17px;height:17px;flex-shrink:0}
body[data-section=speech] .workspace .voice-record-action.is-recording i{width:8px;height:8px;border-radius:1px}
body[data-section=speech] .workspace .workspace-source>#workspace-extract{min-height:46px;font-size:14px}
body[data-section=speech] .workspace .workspace-file-pane .upload-zone{min-height:142px;padding:18px;gap:12px;box-sizing:border-box}
body[data-section=speech] .workspace .workspace-file-pane .upload-zone strong{font-size:16px;line-height:1.4}
body[data-section=speech] .workspace .workspace-file-pane .upload-zone>span{font-size:12px;line-height:1.5}
body[data-section=speech] .workspace .workspace-file-pane .workspace-meta{font-size:12px}
/* Short screens (1024×768, 1280×720, 1366×768): a smaller microphone block keeps the language line and
   the Recognize button inside the frame instead of making the frame scroll. */
@media(min-width:768px) and (max-height:820px){
 body[data-section=speech] .workspace .voice-recorder{gap:10px;padding:4px 0 8px}
 body[data-section=speech] .workspace .voice-recorder-visual{min-height:92px;padding:4px 0}
 body[data-section=speech] .workspace .voice-microphone{width:84px;height:84px;flex-basis:84px;padding:18px}
 body[data-section=speech] .workspace .voice-microphone svg{width:36px;height:45px}
}
@media(max-width:380px){body[data-section=speech] .workspace .voice-recorder-visual{gap:10px}body[data-section=speech] .workspace .voice-wave{width:calc((100% - 124px)/2)}body[data-section=speech] .workspace .workspace-source-tabs button{font-size:12px}}
@media(max-width:380px){body[data-section=speech] .workspace .workspace-source-tabs button{gap:4px;padding-inline:4px}body[data-section=speech] .workspace .workspace-source-tabs button[data-source-mode=microphone]{flex:1.18}body[data-section=speech] .workspace .workspace-source-tabs button svg{width:13px;height:15px}}

.workspace .workspace-results #workspace-result{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px}
.workspace .workspace-results .workspace-result-row{min-width:0}
.workspace .workspace-results .workspace-result-row:last-child{grid-column:1/-1}
.workspace .workspace-results .workspace-entities{max-height:90px}
.workspace .workspace-results .workspace-empty,.workspace .workspace-results #workspace-result>.workspace-meta{grid-column:1/-1}
