/* Shared interaction treatment, kept inside scrollable panels. */
/* Offset only the preparation rows; the Data page and headings remain untouched. */
body[data-section=preprocessing] .preparation-flow,
body[data-section=preprocessing] #preprocessing-open {
 translate:0 var(--paired-row-shift,0px);
}
/* One frame brightness and halo across inner pages; home keeps its own art direction. */
body:not([data-section=home]) {
 --shared-frame-accent:#48b9ed;
 --shared-frame:color-mix(in srgb,var(--shared-frame-accent) 48%,transparent);
 --shared-frame-active:color-mix(in srgb,var(--shared-frame-accent) 72%,transparent);
 --shared-frame-halo:color-mix(in srgb,var(--shared-frame-accent) 9%,transparent);
 --shared-frame-shadow:0 0 12px var(--shared-frame-halo),inset 0 0 12px var(--shared-frame-halo);
}
html[data-theme=human] body:not([data-section=home]) { --shared-frame-accent:#ffb52e; }
body:not([data-section=home]) #main :is(
 .data-hero-stats>div,.globe-label,.preparation-icon,.model-display-card,
 .chart-panel,.analytics-summary>article,.analytics-roc,.dataset-block,.preview-panel,
 .stage-tile,.pipeline-step,.preprocess-input,.dialogue-intro,.da-kpi,.da-section,
 .da-result-heading,.message,.upload-zone,.voice-microphone,.speech-player,
 .workspace-entity,.workspace-results-card,
 input:not([type=file]):not([type=checkbox]):not([type=radio]):not([type=range]),
 textarea,select,.site-select-trigger,.site-select-menu,
 .model-detail-button,.workspace-button,.voice-record-action,.analytics-download,
 .analytics-heading button,.chat-starters button,.dialogue-analysis-link,
 .dialogue-model select,#reset-chat,#chat-form,.contact-social,
 .workspace-tabs,.workspace-tabs button,.dialogue-tabs button[aria-selected=true]
) {
 border-color:var(--shared-frame) !important;
 box-shadow:var(--shared-frame-shadow) !important;
}
body:not([data-section=home]) #main :is(
 input:not([type=file]),textarea,select,.site-select-trigger,
 .model-detail-button,.workspace-button,.voice-record-action,.analytics-download,
 .analytics-heading button,.chat-starters button,.dialogue-analysis-link,
 #reset-chat,.contact-social,.upload-zone
):is(:hover,:focus-visible,:focus-within) {
 border-color:var(--shared-frame-active) !important;
}
body:not([data-section=home]) #main .section-anthe-outline {
 stroke:var(--shared-frame) !important;
 filter:drop-shadow(0 0 6px var(--shared-frame-halo));
}
body:not([data-section=home]) #main .section-anthe:is(:hover,:focus-visible) .section-anthe-outline {
 stroke:var(--shared-frame-active) !important;
}
body:not([data-section=home]) #main .contact-submit-outline {
 stroke:var(--shared-frame) !important;
 filter:drop-shadow(0 0 6px var(--shared-frame-halo));
}
.tablet :is(button,a,input:not([type=file]),textarea,select):focus-visible,
.tablet :is(input:not([type=file]),textarea,select):focus{
 outline:2px solid var(--accent);
 outline-offset:-3px;
}
.tablet .upload-zone:focus-within{
 outline:2px solid var(--accent);
 outline-offset:-3px;
}
/* The file control fills the drop zone; the visible label owns its focus ring. */
.tablet .upload-zone input[type=file]:focus{outline:none}

/* Content controls frame height. Only the browser page scrolls. */
body:not([data-section=home]):not([data-section=dialogue]):not([data-section=contacts]) .tablet{height:auto;min-height:calc(var(--tablet-header-height) + var(--tablet-scene-height) + 18px)}
body:not([data-section=home]):not([data-section=dialogue]):not([data-section=contacts]):not([data-section=data]) .tablet #main{height:auto;min-height:var(--tablet-scene-height);overflow:visible;overscroll-behavior:auto}
body[data-section=data] .tablet #main{height:auto;overflow:visible}
body:is([data-section=models],[data-section=analytics],[data-section=documents],[data-section=speech]) .page-content{height:auto;min-height:0}
@media(max-width:767px){
 body:not([data-section=home]):not([data-section=dialogue]):not([data-section=contacts]):not([data-section=data]) .tablet #main{min-height:calc(var(--tablet-header-height) + var(--tablet-scene-height) - 118px)}
}

/* Shared gutters for tool pages, including their stacked mobile layouts. */
body:is([data-section=models],[data-section=documents],[data-section=speech],[data-section=analytics]) .page-content{padding-inline:4.2%}
@media(max-width:767px){
 body:is([data-section=models],[data-section=documents],[data-section=speech],[data-section=analytics]) .page-content{padding-inline:18px}
 body[data-section=data] .tablet #main{height:auto;overflow:visible}
 body[data-section=preprocessing] .tablet #main{height:auto;overflow:visible}
}

/* Keep workspace controls wide; results follow the source and editor. */
body:is([data-section=documents],[data-section=speech]) .workspace{height:auto;min-height:0;padding-bottom:32px}
.workspace .workspace-columns{grid-template-columns:minmax(320px,.9fr) minmax(380px,1.2fr);grid-template-areas:"source editor" "results results";gap:30px;flex:none;align-items:start}
.workspace .workspace-columns>section{overflow:visible;overscroll-behavior:auto;min-height:0}
.workspace .workspace-source{grid-area:source}
.workspace .workspace-editor{grid-area:editor;min-height:520px;align-self:stretch}
.workspace .workspace-results{grid-area:results;border-left:0;border-top:1px solid var(--edge);padding:26px 0 0;display:grid;grid-template-columns:1fr 1fr;align-items:start;gap:14px 30px}
.workspace-results>h2{grid-column:1/-1}
.workspace-results #document-question{margin-top:0}
.workspace-results #workspace-result{min-width:0}
.workspace #workspace-text{min-height:360px}
.workspace .voice-recorder-visual{min-height:132px;gap:20px}
.workspace .voice-microphone{width:96px;height:96px;flex-basis:96px;padding:25px}
.workspace .voice-wave{width:calc((100% - 136px)/2);height:42px}
.workspace .voice-recorder-description{font-size:13px;line-height:1.6}
.workspace .workspace-button,.workspace .site-select-trigger{min-height:44px;font-size:13px}
.workspace .voice-record-action{min-height:40px;font-size:12px}
.workspace .workspace-meta,.workspace .workspace-privacy{font-size:12px;line-height:1.65}
.workspace .workspace-label,.workspace .workspace-analysis-settings label{font-size:13px}
.workspace .speech-time{font-size:12px}
.workspace .speech-play{width:40px;height:40px;flex-basis:40px}
.workspace #audio-seek{height:26px;min-height:26px}
@media(max-width:1000px){
 .workspace .workspace-columns{grid-template-columns:minmax(0,1fr);grid-template-areas:"source" "editor" "results";gap:28px}
 .workspace .workspace-columns>section+section{border-left:0;border-top:1px solid var(--edge);padding:24px 0 0}
 .workspace .workspace-source{max-width:none}
 .workspace .workspace-editor{min-height:420px}
 .workspace #workspace-text{min-height:280px}
}
@media(max-width:767px){
 body:not([data-section=home]):not([data-section=dialogue]):not([data-section=contacts]){padding-bottom:24px}
 body:not([data-section=home]):not([data-section=dialogue]):not([data-section=contacts]) .tablet{margin-top:24px;min-height:0}
 .workspace .workspace-results{display:flex;gap:14px}
 .workspace .workspace-columns{gap:26px}
 .workspace .workspace-analysis-settings{grid-template-columns:1fr;gap:8px}
 .workspace .site-select-trigger,.workspace .site-select-option{font-size:16px}
 .workspace .workspace-button{min-height:46px;font-size:14px}
 .workspace .voice-record-action{min-height:44px;font-size:13px}
 .workspace .voice-microphone{width:84px;height:84px;flex-basis:84px;padding:21px}
 .workspace .voice-recorder-visual{gap:12px;min-height:114px}
 .workspace .voice-wave{width:calc((100% - 108px)/2)}
 .workspace-source .upload-zone{min-height:96px}
 .workspace #workspace-text{font-size:16px;min-height:260px}
 body[data-section=preprocessing] .preprocessing-hero{height:auto;min-height:0;padding-top:32px;padding-bottom:32px}
}

/* Analysis is a full-width reading section, never a narrow scrolling sidebar. */
.workspace .workspace-results{display:block;width:100%;max-height:none;overflow:visible;border-left:0;border-top:1px solid var(--edge);padding:26px 0 0}
.workspace-results>h2{margin-bottom:20px}
.workspace-results #workspace-result{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 28px;width:100%;overflow:visible}
.workspace-results .workspace-result-row{min-width:0;padding:0 0 18px;margin-bottom:20px;border-bottom:1px solid var(--edge)}
.workspace-results .workspace-result-row>span{font-size:12px;line-height:1.6;margin-bottom:7px}
.workspace-results .workspace-result-row>strong{font-size:16px;line-height:1.5}
.workspace-results .workspace-result-row:last-child{grid-column:1/-1;margin-bottom:0;border-bottom:0;padding-bottom:0}
.workspace-results #workspace-result>.workspace-meta,.workspace-results .workspace-empty{grid-column:1/-1}
.workspace-results .workspace-empty{padding:18px 0;max-width:600px;margin:auto}
.workspace-results .workspace-entities{gap:10px;margin-top:12px}
.workspace-results .workspace-entity{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:8px 12px;font-size:13px;max-width:100%;overflow-wrap:anywhere;line-height:1.5}
.workspace-entity small{color:var(--text);opacity:.8;font-size:11px}
.workspace-entity strong{font-weight:500;color:var(--light)}
.workspace-results #document-question{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px 16px;border-top:1px solid var(--edge);padding-top:24px;margin-top:26px;width:100%;max-height:none;overflow:visible}
.workspace-results #document-question>label{grid-column:1/-1;color:var(--text);font-size:16px;line-height:1.5;font-weight:500;margin-bottom:4px}
.workspace-results #document-question>button{width:auto;min-width:180px;min-height:46px}
.workspace-results #document-query{height:46px;font-size:14px}
.workspace-results #document-question>.workspace-meta,.workspace-results #document-answer{grid-column:1/-1}
.workspace-results #document-answer:empty{display:none}
.workspace-results #document-question>.workspace-meta{max-width:760px}
@media(max-width:767px){
 .workspace-results #workspace-result{grid-template-columns:1fr;gap:0}
 .workspace-results .workspace-result-row{padding-bottom:14px;margin-bottom:14px}
 .workspace-results #document-question{grid-template-columns:1fr}
 .workspace-results #document-question>button{width:100%;min-width:0}
 .workspace-results #document-query{font-size:16px}
 .workspace-results .workspace-entity{padding:8px 10px}
}
