/* Touch and narrow-screen refinements, scoped to the local translator. */
html .translate-page #st-source-toolbar #sourceTtsBtn:not(:disabled){color:var(--ed-ink)!important;opacity:1!important}
html .translate-page #st-source-toolbar #sourceTtsBtn:not(:disabled) svg,
html .translate-page #st-source-toolbar #sourceTtsBtn:not(:disabled) svg path{color:inherit!important;stroke:currentColor!important;opacity:1!important}
@media(pointer:coarse),(max-width:767px){
 html .translate-page :is(#sourceLangBtn,#targetLangBtn,#swapLangsBtn,#overflowMenuBtn,#sourceCopyBtn,#st-settings-close,.st-drawer-close,.st-chat-reset-btn,.st-chat-mic-btn,.st-chat-send-btn){min-width:44px!important;min-height:44px!important}
 html .translate-page #st-source-toolbar :is(#micBtn,.format-btn,#sourceStopBtn){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
 html .translate-page #st-source-toolbar #ed-voice-chevron{width:auto!important;min-width:76px!important}
 html .translate-page #st-source-toolbar #calmTriggerBtn{width:auto!important;min-width:82px!important}
 html .translate-page :is(#st-tone-options .st-tone-preset-btn,.st-lang-option,.calm-popover-btn,.ed-overflow-voice-btn,.sk-voice-preview){min-height:44px!important}
 html .translate-page #st-source-toolbar .sk-voice-preview{width:44px!important;min-width:44px!important}
 html .translate-page #drawer .message-actions .action-icon{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
 html .translate-page #drawer #chatInput{font-size:16px!important}
 html .translate-page #drawer .st-chat-input-wrapper{padding:4px 6px 4px 12px!important}
 html .translate-page #st-tone-trigger{min-height:44px!important}
 html .translate-page :is(.calm-source-pills button,.st-floating-actions .st-float-btn){min-width:44px!important;min-height:44px!important}
 html .translate-page :is(.calm-source-pills button,.st-floating-actions .st-float-btn,.st-chat-mic-btn,.st-chat-send-btn,.st-drawer-close)::before{content:none!important}
 html .translate-page :is(.calm-source-pills button,.st-floating-actions button):focus-visible{outline:none!important;text-decoration:underline;background:var(--tr-raised)!important}
 html .translate-page .st-settings-row{min-height:64px}
 html #st-review-host .ss-comparison :is(.ss-comparison-listen,.ss-comparison-reject){min-width:44px!important;min-height:44px!important;opacity:1!important}
 html #st-review-host .ss-comparison .ss-comparison-cell{padding-inline-end:50px}
 html #st-review-host .ss-comparison .ss-comparison-listen{inset-inline-end:0!important}
 html #st-review-host .ss-comparison .ss-comparison-rejectable{padding-inline-end:94px}
 html #st-review-host .ss-comparison .ss-comparison-rejectable .ss-comparison-listen{inset-inline-end:44px!important}
}
/* Keep related controls together, and wrap groups rather than shrinking targets. */
@media(max-width:1250px){
 html body .translate-page .split-translator #st-source-toolbar{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;align-items:center!important;gap:4px!important;width:max-content!important;max-width:calc(100% - 24px)!important;height:auto!important;min-height:56px!important;padding:6px!important;overflow:visible!important}
 html body .translate-page #st-source-toolbar :is(.ctl-sub,.format-toolbar,.group-1,.ed-injected-right){display:contents!important}
 html body .translate-page #st-source-toolbar :is(.format-divider,.format-separator,.st-calm-sep){display:none!important}
 html body .translate-page #st-source-toolbar .ctl-sub::after,
 html body .translate-page #st-source-toolbar::before,
 html body .translate-page #st-source-toolbar::after{display:none!important}
 html body .translate-page #st-source-toolbar .group-2{display:flex!important;align-items:center;gap:0!important;padding:0!important;margin:0!important}
 html body .translate-page #st-source-toolbar #clearBtn{margin:0!important}
 html body .translate-page #st-source-toolbar .calm-trigger-label{display:inline!important}
 html body .translate-page #st-source-toolbar #calmTriggerBtn{gap:6px!important}
 html body .translate-page .split-translator .st-floating-translate{bottom:146px!important}
 html body .translate-page .st-source-editor .ql-editor{padding-bottom:190px!important}
 html body .translate-page .st-floating-actions{flex-wrap:wrap!important;gap:4px!important;height:auto!important;padding:6px!important;max-width:calc(100% - 24px)!important}
 html body .translate-page .st-floating-actions .st-float-divider{display:none!important}
}
@media(max-width:1023px),(max-height:500px) and (pointer:coarse){
 html body .translate-page{height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;scroll-padding-bottom:90px}
 html body .translate-page .robot-container{height:auto!important;min-height:100%!important;overflow:visible!important}
 html body .translate-page .split-translator{height:auto!important;min-height:100%!important;padding-bottom:12px!important;background:transparent!important}
 /* Separate page controls from the source card using the same gap as the output card. */
 html body .translate-page .st-panels{height:auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;gap:12px!important;margin-top:12px!important;overflow:visible!important}
 html body .translate-page :is(.st-source-panel,.st-target-panel){flex:none!important;min-height:0!important;height:auto!important;overflow:visible!important}
 html body .translate-page :is(.st-editor-wrap,.st-target-wrap){display:flex!important;flex-direction:column!important;position:relative!important;min-height:0!important;overflow:visible!important}
 html body .translate-page :is(#sourceEditor,#targetOutput){flex:none!important;height:auto!important;min-height:190px!important;max-height:420px!important;overflow-y:auto!important}
 html body .translate-page :is(#sourceEditor,#targetOutput) .ql-editor{min-height:190px!important;max-height:420px!important;height:auto!important;overflow-y:auto!important;padding:18px 20px!important}
 html body .translate-page .split-translator #translateBtn{position:static!important;inset:auto!important;transform:none!important;translate:none!important;align-self:center!important;flex:none!important;width:auto!important;min-height:44px!important;margin:12px auto!important;padding:10px 18px!important;border-radius:22px!important}
 html body .translate-page .split-translator #st-source-toolbar{position:static!important;inset:auto!important;transform:none!important;translate:none!important;flex:none!important;margin:0 auto 12px!important}
 html body .translate-page .st-editor-wrap>.calm-source-pills{position:static!important;justify-content:center!important;flex-wrap:wrap;gap:6px!important;margin:0 12px 14px!important}
 html body .translate-page #main-content .st-target-wrap>.st-floating-actions{position:relative!important;inset:auto!important;transform:none!important;translate:none!important;align-self:center!important;flex:none!important;justify-content:center!important;margin:12px auto 18px!important;width:max-content!important;max-width:calc(100% - 24px)!important;overflow:visible!important}
 html body .translate-page .st-floating-actions #chatIconBtn{order:3;flex-basis:100%;justify-content:center}
 html body .translate-page #responseNav{position:static!important;transform:none!important;align-self:center;order:0;margin:8px auto}
 html body .translate-page .st-panels.st-reviewing{flex:none!important;height:calc(100dvh - 140px)!important;min-height:340px!important}
 html body .translate-page .st-reviewing>.st-source-panel,
 html body .translate-page .st-reviewing>.st-target-panel{display:none!important}
 html body .translate-page #drawer .st-chat-input-area{padding:10px 12px max(12px,env(safe-area-inset-bottom))!important}
 html body .translate-page #drawer .st-chat-messages{padding:20px 16px!important}
 html body .translate-page #drawer.st-drawer{max-height:100dvh!important}
 html body .translate-page #st-calm-heading-popover{max-height:calc(100dvh - 24px)!important}
}

@media(pointer:coarse),(max-width:767px){
 html body .translate-page #st-source-toolbar .format-toolbar #st-source-audio-controls #sourceStopBtn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
 html body #st-calm-heading-popover .calm-popover-btn{min-height:44px!important}
 html body .translate-page #settingsPopover .st-settings-toggle{position:relative;overflow:visible!important}
 html body .translate-page #settingsPopover .st-settings-toggle::before{content:'';position:absolute;inset:-11px -1px;width:auto;height:auto;transform:none}
 html body .translate-page :is(.st-history-tab,.st-drawer-reset,.st-history-clear,.st-response-nav button){min-height:44px!important;min-width:44px!important}
 html body .translate-page :is(input[type=text],.st-lang-search){font-size:16px!important}
}
@media(max-width:1250px){
 html body .translate-page #st-source-toolbar #calmTriggerBtn .st-format-caption{display:inline!important}
}

@media(min-width:768px) and (max-height:500px) and (pointer:coarse){
 html body .translate-page{padding-bottom:16px!important}
}
@container(max-width:650px){
 html #st-review-host .ss-comparison .ss-comparison-cell{padding-inline-end:0!important}
 html #st-review-host .ss-comparison .ss-comparison-mobile-label{min-height:44px;display:flex;align-items:center;padding-inline-end:94px}
 html #st-review-host .ss-comparison .ss-comparison-cell :is(.ss-comparison-listen,.ss-comparison-reject){top:0!important}
}

@media(pointer:coarse),(max-width:767px){
 html body .translate-page :is(.st-lang-search-submit,.st-lang-expand-btn,.st-edit-card .st-edit-undo){min-width:44px!important;min-height:44px!important}
}
@media(max-width:1023px),(max-height:500px) and (pointer:coarse){
 html body .translate-page .st-language-bar{background:var(--tr-bg,#f7f4ef)!important}
}

/* Child controls use explicit visibility, so remove the covered drawer from layout. */
body.st-comparing #drawer,body.st-comparing .st-drawer-backdrop{display:none!important}

@media(pointer:coarse),(max-width:767px){
 html body #downloadDropdown.st-download-dropdown.download-menu .st-dropdown-item{min-height:44px!important}
}

@media(pointer:coarse),(max-width:767px){
 html body .translate-page #st-source-toolbar .format-toolbar #ed-voice-popover .sk-voice-row{padding-inline-start:62px!important}
 html body .translate-page #st-source-toolbar .format-toolbar #ed-voice-popover .sk-voice-preview{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;left:8px!important}
}

/* Keep active icons readable on the existing warm dark surfaces. */
html[data-theme=dark] .translate-page #st-source-toolbar{--ed-ink:var(--tr-ink);--ed-muted:var(--tr-muted)}
html[data-theme=dark] body .translate-page :is(#sourceCopyBtn,.st-floating-actions .st-float-btn,.calm-source-pills button){color:var(--tr-ink)!important}
html[data-theme=dark] body .translate-page .calm-source-pills button{background:var(--tr-card)!important;border-color:var(--tr-line)!important}
html[data-theme=dark] body .translate-page .st-language-bar{background:transparent!important}

html[data-theme=dark] body .translate-page #st-source-toolbar :is(#micBtn,#sourceTtsBtn,#clearBtn):not(:disabled){color:var(--tr-ink)!important;opacity:1!important}

/* Native text selection: exact Writing palette and forced-colors fallback. */
.translate-page{--st-selection-bg:#cbdccd;--st-selection-text:#243d30}
[data-theme=dark] .translate-page,.translate-page[data-theme=dark]{--st-selection-bg:#526d5a;--st-selection-text:#fffaf0}
.translate-page .ql-editor::selection,
.translate-page .ql-editor *::selection{background:var(--st-selection-bg)!important;color:var(--st-selection-text)!important}
@media(forced-colors:active){
 .translate-page{--st-selection-bg:Highlight!important;--st-selection-text:HighlightText!important}
}

/* A single compact row. Secondary actions retain their real controls in disclosure. */
html body .translate-page .split-translator #st-source-toolbar.st-compact{flex-wrap:nowrap!important;gap:2px!important;width:max-content!important;padding:6px!important;min-height:56px!important}
html body .translate-page #st-source-toolbar.st-compact :is(.ctl-sub,.format-toolbar,.group-2){display:contents!important}
html body .translate-page #st-source-toolbar.st-compact :is(.format-divider,.format-separator,.st-calm-sep){display:none!important}
html body .translate-page #st-source-toolbar.st-compact .ctl-sub::after{display:none!important}
html body .translate-page #st-source-toolbar.st-compact :is(#micBtn,#sourceTtsBtn){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
html body .translate-page #st-source-toolbar.st-compact #calmTriggerBtn{width:82px!important;min-width:82px!important;height:44px!important;gap:6px!important}
html body .translate-page #st-source-toolbar.st-compact #calmTriggerBtn .st-format-caption{display:inline!important}
html body .translate-page #st-source-toolbar #st-toolbar-more{display:inline-flex!important;align-items:center;justify-content:center;gap:4px!important;width:66px!important;min-width:66px!important;height:44px!important;padding:0 4px!important;font:inherit;font-size:13px}
html body .translate-page #st-source-toolbar #st-toolbar-more[hidden]{display:none!important}
html body .translate-page .st-editor-wrap>.calm-source-pills{display:none!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra{position:fixed!important;inset:auto;margin:0!important;width:260px!important;max-width:calc(100vw - 24px)!important;padding:8px!important;border:1px solid var(--ed-border)!important;border-radius:16px!important;background:var(--ed-paper)!important;color:var(--ed-ink)!important;box-shadow:0 8px 28px #443c351c!important;overflow:auto!important;font-size:14px}
html body .translate-page #st-source-toolbar #st-toolbar-extra:not(:popover-open){display:none!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra:popover-open{display:flex!important;flex-direction:column!important;gap:4px!important}
html body .translate-page #st-toolbar-extra :is(.group-1,.ed-injected-right,.audio-controls,.ed-voice-wrap){display:flex!important;width:100%!important;gap:4px!important;flex-wrap:wrap;position:static!important;margin:0!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra :is(button.format-btn,#sourceStopBtn){display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;flex:1!important;width:auto!important;min-width:0!important;height:44px!important;min-height:44px!important;padding:0 12px!important;font-size:14px!important}
html body .translate-page #st-toolbar-extra [data-compact-label]::after{content:attr(data-compact-label)!important;position:static!important;display:inline!important;opacity:1!important;visibility:visible!important;transform:none!important;background:none!important;box-shadow:none!important;color:inherit!important;font:inherit!important;padding:0!important}
html body .translate-page #st-toolbar-extra button::before{display:none!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra #ed-voice-chevron::before{content:attr(data-voice-label)!important;display:inline!important;position:static!important;background:none!important;font:inherit!important;color:var(--ed-muted)!important;padding:0!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra #ed-voice-chevron{justify-content:flex-start!important;max-width:none!important}
html body .translate-page #st-toolbar-extra .st-extra-imports{display:grid;gap:2px;border-top:1px solid var(--ed-border);padding-top:4px;margin-top:4px}
html body .translate-page #st-toolbar-extra .st-extra-imports button{border:0!important;background:transparent!important;color:var(--ed-ink)!important;min-height:44px;text-align:left;padding:8px 12px;border-radius:8px;font:inherit}
html body .translate-page #st-toolbar-extra .st-extra-imports button:is(:hover,:focus-visible){background:var(--ed-hover)!important;outline:none;text-decoration:underline;text-underline-offset:4px}
html body .translate-page .st-source-panel:has(.st-compact) .st-floating-translate{bottom:114px!important}
@media(max-width:767px){html body .translate-page .st-source-panel:has(.st-compact) .st-floating-translate{bottom:auto!important}}

html body .translate-page #st-source-toolbar #st-toolbar-extra #st-source-audio-controls:has(#sourceStopBtn:disabled){display:none!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra #sourceStopBtn{max-width:none!important;white-space:nowrap!important}

/* Writing selection toolbar: two actions, matching warm surface and selected text. */
#st-selection-tools{position:fixed;z-index:2147482000}
#st-selection-tools[hidden],#st-selection-tools [hidden]{display:none!important}
.st-selection-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
::highlight(st-selection-speech){background:#cbdccd;color:#243d30}
.dv-live{z-index:2147483000}.dv-live .dv-toolbar{display:none!important}
[data-theme=dark] ::highlight(st-selection-speech){background:#526d5a;color:#fffaf0}
@media(forced-colors:active){::highlight(st-selection-speech){background:Highlight;color:HighlightText}}

html body .translate-page #st-source-toolbar #st-toolbar-more{width:44px!important;min-width:44px!important;padding:0!important}
html body #st-calm-heading-popover{overflow-x:hidden!important;border-radius:16px 16px 0 0!important}
html body:has(#st-source-toolbar.st-compact) #st-calm-heading-popover{border-radius:16px!important}
html body #st-calm-heading-popover .calm-format-name{white-space:nowrap!important}
html body #st-calm-heading-popover .calm-popover-btn{min-width:0!important;font-size:12px!important;gap:6px!important}
html body .translate-page #st-source-toolbar.st-compact.format-tray-open{border-radius:16px!important}
.dv-live .dv-section-heading{display:flex;align-items:center;gap:8px;margin-bottom:8px}.dv-live .dv-section-heading h3{margin:0}.dv-live .dv-section-heading .dv-read{flex-shrink:0;width:36px;min-width:36px;height:36px;padding:9px}
@media(max-width:1023px),(max-height:500px) and (pointer:coarse){
 html body .translate-page #main-content{height:auto!important;min-height:0!important;overflow:visible!important;flex:none!important;width:100%!important}
 html body .translate-page .robot-container,html body .translate-page .split-translator{height:auto!important;min-height:0!important}
 html body .translate-page :is(#sourceEditor,#targetOutput),html body .translate-page :is(#sourceEditor,#targetOutput) .ql-editor{max-height:none!important;overflow:visible!important;height:auto!important}
 html body .translate-page .st-target-wrap>.st-floating-actions:not(.is-hidden){display:flex!important;visibility:visible!important;opacity:1!important}
 html body .translate-page .st-target-wrap>.st-floating-actions{margin-top:16px!important;margin-bottom:20px!important}
 html body .translate-page .st-floating-actions :is(#copyBtn,#ttsBtn){width:auto!important;min-width:44px!important;gap:6px!important;padding:0 10px!important}
 html body .translate-page .st-floating-actions #copyBtn::after{content:'Kopiér';font-size:13px}
 html body .translate-page .st-floating-actions #ttsBtn::after{content:'Læs op';font-size:13px}
 html body .translate-page .st-floating-actions #ttsBtn[data-tts-state=playing]::after{content:'Pause'}
 html body .translate-page .st-floating-actions #ttsBtn[data-tts-state=paused]::after{content:'Fortsæt'}
}

/* Let mobile content establish its own height; keep every output action above navigation. */
@media(max-width:1023px),(max-height:500px) and (pointer:coarse){
 html body .translate-page{display:block!important}
 html body .translate-page #main-content{display:block!important;max-height:none!important}
 html body .translate-page #main-content .split-translator .st-language-bar{background:var(--tr-bg,#f7f4ef)!important;z-index:20!important}
 html body .translate-page #main-content .st-target-wrap>.st-floating-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;width:max-content!important;max-width:calc(100% - 28px)!important;height:auto!important;padding:6px!important;gap:4px!important}
 html body .translate-page #main-content .st-target-wrap>.st-floating-actions.is-hidden{display:none!important}
 html body .translate-page #main-content .st-floating-actions :is(#copyBtn,#ttsBtn,#downloadBtn){display:inline-flex!important;flex:0 0 auto!important;min-width:44px!important;min-height:44px!important;height:44px!important;width:auto!important}
 html body .translate-page #main-content .st-floating-actions #ttsBtn::after{content:'Læs op'!important;position:static!important;inset:auto!important;transform:none!important;display:inline!important;opacity:1!important;visibility:visible!important;background:none!important;box-shadow:none!important;padding:0!important;color:inherit!important;font:500 13px system-ui!important}
 html body .translate-page #main-content .st-floating-actions #ttsBtn[data-tts-state=playing]::after{content:'Pause'!important}
 html body .translate-page #main-content .st-floating-actions #ttsBtn[data-tts-state=paused]::after{content:'Fortsæt'!important}
 html body .translate-page #main-content .st-floating-actions #chatIconBtn{order:3!important;flex:0 0 100%!important;justify-content:center!important;min-height:44px!important;height:44px!important}
 html body .translate-page #main-content .st-floating-actions .calm-clear-btn{display:none!important}
}

.st-chat-short-label{display:none!important}
/* Output uses the same single-row footprint: familiar utility icons and a labeled chat action. */
@media(max-width:1023px),(max-height:500px) and (pointer:coarse){
 html body .translate-page #main-content .st-target-wrap>.st-floating-actions{flex-wrap:nowrap!important;gap:2px!important;width:max-content!important;padding:6px!important}
 html body .translate-page #main-content .st-floating-actions :is(#copyBtn,#ttsBtn,#downloadBtn){width:44px!important;min-width:44px!important;padding:0!important;flex:0 0 44px!important}
 html body .translate-page #main-content .st-floating-actions #chatIconBtn{order:3!important;flex:0 0 auto!important;min-width:84px!important;padding:0 10px!important}
 html body .translate-page #main-content .st-floating-actions :is(#copyBtn,#ttsBtn)::after{display:none!important;content:none!important}
 html body .translate-page #main-content .st-floating-actions .st-chat-full-label{display:none!important}
 html body .translate-page #main-content .st-floating-actions .st-chat-short-label{display:inline!important;font-size:13px!important}
}

html body .translate-page #st-source-toolbar #st-toolbar-extra #st-source-audio-controls{width:100%!important;min-width:0!important;flex:0 0 auto!important;height:auto!important}

html body .translate-page #st-source-toolbar #st-toolbar-extra>.ed-voice-wrap{height:auto!important;min-height:44px!important;flex:0 0 auto!important;align-items:stretch!important}
html body .translate-page #st-source-toolbar #st-toolbar-extra>*{flex-shrink:0!important}

html body .translate-page #st-source-toolbar #st-toolbar-extra button:focus-visible{outline:none!important;box-shadow:none!important;background:var(--ed-hover)!important;text-decoration:underline!important;text-underline-offset:4px}

body:has(#st-calm-heading-popover.open) #st-selection-tools,body:has(#st-toolbar-extra:popover-open) #st-selection-tools{visibility:hidden!important;pointer-events:none!important}

html[data-theme=dark] body .translate-page #main-content .split-translator .st-language-bar{background:transparent!important}

@media(max-width:1023px),(max-height:500px) and (pointer:coarse){html body .translate-page #main-content .st-target-wrap>.st-floating-actions #chatIconBtn{height:44px!important;min-height:44px!important;flex:0 0 auto!important;padding:0 10px!important}}

html[data-theme=dark] body .translate-page #st-source-toolbar{--ed-ink:#eee8df;--ed-muted:#b6afa4}
html[data-theme=dark] body .translate-page #st-source-toolbar :is(#micBtn,#sourceTtsBtn,#clearBtn):not(:disabled){color:var(--ed-ink)!important}

/* Keep mobile menus and the chat composer inside the visible keyboard area. */
@media(max-width:767px){
 html body .translate-page #st-source-toolbar{z-index:10!important}
 html body .translate-page .split-translator .st-lang-dropdown.open{left:12px!important;right:12px!important;width:calc(100vw - 24px)!important;min-width:0!important;max-width:none!important;max-height:calc(var(--ss-vv-height,100dvh) - 85px)!important}
 html.ss-mobile-kb-open body .translate-page{height:var(--ss-vv-height,100dvh)!important;padding-bottom:12px!important}
 html.ss-mobile-kb-open body .translate-page :is(.robot-container,.split-translator){height:auto!important;max-height:none!important}
 html.ss-mobile-kb-open body .translate-page #drawer.st-drawer{top:var(--ss-vv-offset,0px)!important;bottom:auto!important;height:var(--ss-vv-height,100dvh)!important;max-height:var(--ss-vv-height,100dvh)!important}
}
@media(pointer:coarse),(max-width:767px){
 .dv-live .dv-section-heading .dv-read{width:44px;min-width:44px;height:44px}
 .dv-live [role=tab]{min-width:44px}
}
/* Panel width controls disclosure, including when a drawer reduces desktop space. */
html body .translate-page .split-translator #st-source-toolbar,
html body .translate-page #main-content .st-target-wrap>.st-floating-actions{flex-wrap:nowrap!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions{gap:2px!important;padding:6px!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions .calm-clear-btn{display:none!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions :is(#copyBtn,#downloadBtn,#ttsBtn,#targetStopBtn){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;flex:0 0 44px!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions #chatIconBtn{height:44px!important;min-height:44px!important;min-width:84px!important;padding:0 10px!important;flex:0 0 auto!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions .st-chat-full-label{display:none!important}
html body .translate-page #main-content .st-target-compact .st-floating-actions .st-chat-short-label{display:inline!important;font-size:13px!important}

html body .translate-page #st-source-toolbar:not(.st-compact) #st-source-audio-controls{width:44px!important;min-width:44px!important;height:44px!important;flex:0 0 44px!important;align-items:center!important}
html body .translate-page #st-source-toolbar:not(.st-compact) #sourceStopBtn{width:44px!important;min-width:44px!important;height:44px!important}

/* Match the source's inline stop control, without a second playback popup. */
html body .translate-page #main-content .st-target-narrow .st-floating-actions #chatIconBtn{width:44px!important;min-width:44px!important;padding:0!important;flex:0 0 44px!important}
html body .translate-page #main-content .st-target-narrow .st-floating-actions #chatIconBtn span{display:none!important}
/* Later legacy button rules must not restore light-theme ink on dark controls. */
html[data-theme="dark"] body .translate-page #main-content #st-source-toolbar :is(.format-btn,#sourceStopBtn):not(:disabled),
html[data-theme="dark"] body .translate-page #main-content .st-target-wrap>.st-floating-actions .st-float-btn:not(:disabled){color:var(--ed-ink)!important}
html[data-theme="dark"] body .translate-page #main-content #st-source-toolbar #sourceTtsBtn:is([data-tts-state="loading"],[data-tts-state="playing"],[data-tts-state="paused"]),
html[data-theme="dark"] body .translate-page #main-content .st-target-wrap>.st-floating-actions #ttsBtn:is([data-tts-state="loading"],[data-tts-state="playing"],[data-tts-state="paused"]){color:var(--ed-active-ink)!important}

/* Translation dark mode: keep the open header and use existing surface roles.
   The theme lives on html; portalled dictionary UI needs its own scoped tokens. */
html[data-theme="dark"] .translate-page .st-detected-hint{color:var(--tr-muted)!important;opacity:1!important}
html[data-theme="dark"] .translate-page #settingsPopover .st-settings-toggle[aria-checked="true"] .st-toggle-thumb{background:#24392e!important}
html[data-theme="dark"] .translate-page #drawer .message-actions{opacity:1!important}
html[data-theme="dark"] body:has(.translate-page) .dv-live{
 --dv-paper:#2b2a27;--dv-ink:#e8e6e1;--dv-muted:#bcb7ad;
 --dv-green:#92b8a5;--dv-soft:#394d3e;--dv-line:#514f47;--dv-hover:#34332e;
 color-scheme:dark;
}
html[data-theme="dark"] body:has(.translate-page) .dv-live .dv-card{box-shadow:0 8px 32px #0005}
html[data-theme="dark"] body:has(.translate-page) .dv-live .dv-visible-forms{background:var(--dv-hover)}
html[data-theme="dark"] body:has(.translate-page) .dv-live .dv-example{border-color:var(--dv-green)}
html[data-theme="dark"] body:has(.translate-page) .dv-live .dv-syn-item+.dv-syn-item{border-color:var(--dv-line)}
html[data-theme="dark"] body:has(.translate-page) .dv-live .dv-entry-tabs button[aria-selected="true"]::after{background:var(--dv-green)}
html[data-theme="dark"] body:has(.translate-page) .dv-live :is(button,a,[role="tabpanel"]):focus-visible{background:var(--dv-soft);color:var(--dv-ink)}
html[data-theme="dark"] body:has(.translate-page) .dv-live :is(.dv-read,.dv-entry-link):hover{color:var(--dv-green);background:var(--dv-hover)}

/* A stacked translator still shares a row with the tablet/desktop navigation rail. */
@media(min-width:768px) and (max-width:1023px),(min-width:768px) and (max-height:500px) and (pointer:coarse){
 html body .translate-page{display:flex!important;padding-bottom:0!important;overflow:hidden!important}
 html body .translate-page #main-content{flex:1!important;width:auto!important;height:100%!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important}
 html body .translate-page .st-panel-divider{display:none!important}
}
/* Let long language names shrink without overlapping the swap or settings controls. */
@media(max-width:1023px){
 html body .translate-page #main-content .split-translator .st-language-bar{display:grid!important;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr) 44px;gap:4px!important;height:auto!important;min-height:56px!important}
 html body .translate-page .st-language-bar .st-lang-group{min-width:0!important;max-width:none!important}
 html body .translate-page #main-content .split-translator .st-language-bar :is(#swapLangsBtn,#swapLangsBtn+.st-lang-group){position:static!important;inset:auto!important;transform:none!important}
 html body .translate-page .st-language-bar .st-lang-selector{width:100%!important;min-width:0!important;padding-inline:4px!important}
 html body .translate-page .st-language-bar .st-lang-name{min-width:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html body .translate-page .st-language-bar #overflowMenuBtn{width:44px!important;min-width:44px!important;padding:0!important;margin:0!important}
 html body .translate-page .st-language-bar #overflowMenuBtn>span{display:none!important}
 html body .translate-page .st-language-bar .st-langbar-tools{display:none!important}
}
html body .translate-page :is(.st-source-editor,.st-target-output) .ql-editor{overflow-wrap:anywhere}
