/* Shared surfaces: quiet workspace, clear hierarchy, reachable controls. */
:root{--workspace-bg:#fafaf9;--workspace-border:#e5e5e2;--workspace-muted:#64645f}
body:not(.glanceMode){background:var(--workspace-bg)}
body:not(.glanceMode) .topbar{background:#fff;border-bottom:1px solid var(--workspace-border)}
body:not(.glanceMode) .sidebar{background:#f2f2ef;border-color:var(--workspace-border)}
body:not(.glanceMode) .composer{background:#fff;border-color:#deded9;box-shadow:0 8px 32px #20201808;border-radius:22px}
body:not(.glanceMode) .composerwrap{background:linear-gradient(transparent,var(--workspace-bg) 28%)}
.welcome{max-width:620px;margin:0 auto}.welcome .symbol{display:none}.welcomeEyebrow{display:block;font-size:10px;font-weight:650;letter-spacing:2px;color:var(--workspace-muted);margin-bottom:16px}.welcome h2{font-weight:550;font-size:clamp(27px,4vw,40px);line-height:1.15;letter-spacing:-1.2px}.welcome p{font-size:15px;color:var(--workspace-muted);line-height:1.7}.welcome .suggestions{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-width:460px;margin:26px auto 0}.welcome .suggestion{background:#fff;border:1px solid var(--workspace-border);border-radius:14px;min-height:58px;padding:14px;text-align:left;font-size:13px}.welcome .suggestion:hover{border-color:#a6a69f;box-shadow:0 3px 12px #00000006}
#soundLogoEntry{display:none}.composertools .tool{min-height:42px}.composertools{gap:5px}.composer .record{box-shadow:none}.libraryRow,.clipcard{border-radius:16px}.viewSearch{min-height:44px}.settingsShell .settingsHeader{background:#fafaf9}.settingsShell .settingsTab{min-height:46px;border-radius:10px}.dataOverview h3,.dataGroup h3{margin:0 0 8px;font-size:18px}.dataOverview>p,.dataGroup>p{color:var(--workspace-muted);line-height:1.7}.dataCounts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:20px 0}.dataCounts>div{min-width:0;padding:14px 10px;background:#f5f5f2;border:1px solid var(--workspace-border);border-radius:12px}.dataCounts strong{display:block;font-size:20px;font-weight:600;overflow-wrap:anywhere}.dataCounts span{font-size:11px;color:var(--workspace-muted)}.dataActions{display:flex;flex-wrap:wrap;gap:8px}.dataActions .btn{min-height:44px}.dataFootnote{font-size:12px}.dataGroup{border-top:1px solid var(--workspace-border);padding-top:22px;margin-top:24px}.dataGroup .btn{margin:4px 4px 4px 0;min-height:44px}#dataQuotaMeter{width:100%;height:8px;accent-color:#333;margin:0 0 18px}#storageSettings>.soundTools{margin-top:24px}.scriptFileTools{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.scriptFileTools>label{flex:1;min-width:90px}.scriptFileTools .btn{font-size:12px!important;min-height:38px!important;padding:6px 10px!important}.scriptStats{font-size:11px!important;color:#666;margin:8px 0}.cameraImmersive .videoStageTop{justify-content:flex-end}.cameraImmersive #videoBadge{position:absolute!important;top:calc(54px * var(--camera-ui-scale));left:0;margin:0}.cameraImmersive .stageTool{border-color:#ffffff33;box-shadow:0 2px 8px #0000000c}.cameraImmersive .videoPrompt{left:6%;right:6%;max-height:30%;background:#0005}.cameraImmersive #videoPromptText{line-height:1.65}.cameraImmersive .videoTake{padding:16px 0;border-bottom:1px solid #e5e5e5}.cameraImmersive .videoTake .row{flex-wrap:wrap}.cameraImmersive .videoSaved[open]{max-height:calc(100% - 100px * var(--camera-ui-scale));border:1px solid #ddd}.cameraImmersive #videoSearch{font-size:calc(14px * var(--camera-ui-scale));min-height:calc(44px * var(--camera-ui-scale));margin-top:14px}.cameraImmersive #videoSearchStatus{font-size:calc(11px * var(--camera-ui-scale));color:#666}.videoCameraHint>span{text-align:center;max-width:80%;line-height:1.6}
@media(max-width:760px){.welcome{padding-top:32px}.welcome .suggestions{gap:8px;margin-top:20px}.welcome .suggestion{font-size:12px;min-height:56px}.composertools{flex-wrap:wrap}.composertools .capture{font-size:10px}.dataCounts strong{font-size:18px}.dataCounts>div{padding:12px 8px}.settingsShell .settingsBody{overscroll-behavior:contain}.scriptFileTools .btn{font-size:12px!important}.phoneUI .videoScriptBody{padding-bottom:10px}.workspaceView{padding-inline:18px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.glanceMode .welcomeEyebrow,.glanceMode .welcome p,.glanceMode .dataOverview>p,.glanceMode .dataGroup>p,.glanceMode .dataCounts span{color:#ccc}.glanceMode .welcome .suggestion,.glanceMode .dataCounts>div,.glanceMode .settingsShell .settingsHeader{background:#111;color:#fff;border-color:#555}

.cameraImmersive #videoActionLabel{white-space:nowrap;justify-self:center}

/* Framing is adjustable before capture, without restarting the camera. */
#videoFlip svg{display:block;width:22px;height:22px}.cameraImmersive #videoFlip svg{width:calc(22px * var(--camera-ui-scale));height:calc(22px * var(--camera-ui-scale))}.cameraImmersive .videoStageTop{flex-wrap:wrap;row-gap:6px}.cameraImmersive #videoFramingToggle{font-size:calc(11px * var(--camera-ui-scale))!important;padding-inline:calc(9px * var(--camera-ui-scale));min-width:0}.cameraImmersive #videoBadge{top:calc(60px * var(--camera-ui-scale))}

/* Readable labels, predictable focus, and touch targets across the workspace. */
.libraryRow>div{min-width:0}.libraryRow h3,.libraryRow p,.settingsHeader h2{overflow-wrap:anywhere}
.workspaceView .viewSearch{width:100%;box-sizing:border-box}
.modal .btn:focus-visible,.workspaceNav button:focus-visible,.welcome .suggestion:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.phoneUI .modal input[type=text],.phoneUI .modal input[type=search],.phoneUI .modal input[type=number],.phoneUI .modal select{font-size:16px}
.phoneUI .modal .btn,.phoneUI .settingsHeader .icon,.phoneUI .settingsFooter .btn,.phoneUI .composertools .tool{min-height:44px}
.phoneUI .scriptFileTools .btn{min-height:44px!important}
.phoneUI .modal p{color:#64645f}
.phoneUI .settingsHeader h2{min-width:0}
.phoneUI .dataCounts strong{font-size:18px;line-height:1.4}
.phoneUI .dataOverview,.phoneUI .dataGroup{overflow-wrap:anywhere}
@media(max-width:360px){.welcome .suggestions{grid-template-columns:1fr}.libraryRow{flex-wrap:wrap}.dataCounts{gap:5px}.dataCounts>div{padding:10px 6px}.scriptFileTools>label{flex-basis:100%}}
@media(max-height:500px) and (orientation:landscape){.welcome{padding-top:16px}.welcomeEyebrow{margin-bottom:10px}.welcome .suggestions{margin-top:16px}.welcome h2{font-size:28px}}
.glanceMode.phoneUI .modal p{color:#ccc}

.topbar h1{min-width:0}.topbar h1 #sessionTitle{font:inherit;font-weight:inherit;text-align:left;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:44px;padding:0 4px;border-radius:8px}

.deviceCheckResult{font:12px/1.7 system-ui;white-space:pre-wrap;overflow-wrap:anywhere;background:#f5f5f2;border:1px solid #ddd;border-radius:10px;padding:14px}.dataGroup #problemNote{display:block;width:100%;min-height:100px;margin:8px 0 12px;font-size:16px}.glanceMode .deviceCheckResult{background:#111;border-color:#555}

.videoEffectsEntry{position:absolute;right:12px;top:66px;z-index:5}.cameraImmersive .videoEffectsEntry{right:calc(12px * var(--camera-ui-scale));top:calc(68px * var(--camera-ui-scale))}.cameraEffectsPanel{border-top:1px solid #e3e3df;margin-top:20px;padding-top:20px;scroll-margin-top:80px}.cameraEffectsPanel h3{font-size:18px;margin:0 0 8px}.cameraEffectsPanel>p{font-size:12px;line-height:1.6;color:#666}.cameraEffectsPanel fieldset{border:0;padding:0;margin:14px 0}.cameraLookPresets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:20px}.cameraLookPresets button{min-height:44px;border:1px solid #ddd;border-radius:12px;padding:8px 5px;font-size:13px;background:#fff;color:#333}.cameraLookPresets button[aria-pressed=true]{color:#fff;background:#222;border-color:#222}.cameraEffectsPanel label{display:flex;justify-content:space-between;gap:16px;font-size:13px;margin-top:14px}.cameraEffectsPanel output{font-variant-numeric:tabular-nums;color:#555}.cameraEffectsPanel input[type=range]{width:100%;height:32px;accent-color:#333;margin:0;cursor:pointer}.phoneUI .cameraEffectsPanel label{font-size:calc(13px * var(--camera-ui-scale))}.phoneUI .cameraLookPresets button{font-size:calc(12px * var(--camera-ui-scale));min-height:calc(44px * var(--camera-ui-scale))}.phoneUI .cameraEffectsPanel h3{font-size:calc(18px * var(--camera-ui-scale))}.phoneUI .cameraEffectsPanel input[type=range]{height:calc(36px * var(--camera-ui-scale))}.glanceMode .cameraLookPresets button{background:#111;color:#fff;border-color:#777}.glanceMode .cameraLookPresets button[aria-pressed=true]{background:#fff;color:#111}

/* Keep each camera task in a small sheet with its own actions. */
.videoOptionalSettings{border-top:1px solid var(--workspace-border);margin-top:14px;padding-top:8px}
.videoOptionalSettings>summary{cursor:pointer;min-height:44px;padding:10px 0;font-size:13px;font-weight:550;color:#444}
.videoOptionalSettings[open]>summary{margin-bottom:8px}
#videoMoreOptions .videoSettingsInfo{margin-top:12px}
#videoOptionsDialog>.videoSettingsGrid{grid-template-columns:1fr 1fr}
#videoOptionsDialog>.videoSettingsGrid>label[for=videoRatio]{grid-column:1;grid-row:1}
#videoOptionsDialog>.videoSettingsGrid>label[for=videoFacing]{grid-column:2;grid-row:1}
#videoOptionsDialog>.videoSettingsGrid>label[for=videoQuality]{grid-column:1/-1;grid-row:2}
#videoQualityInfo{font-size:12px;line-height:1.5;color:#666;margin:0 0 12px}
#cameraEffectsDialog{width:min(460px,calc(100% - 24px));padding:0;overflow:hidden;max-height:min(82dvh,calc(var(--camera-visible-height,100dvh) - 24px))}
#cameraEffectsDialog[open]{display:flex;flex-direction:column}
#cameraEffectsDialog>.videoSettingsHeader{padding:14px 18px;border-bottom:1px solid var(--workspace-border);flex:none;background:#fff}
#cameraEffectsDialog .videoSettingsHeader h2{font-size:20px;line-height:1.3;margin:0}
#cameraEffectsDialog .icon{min-width:44px;min-height:44px}
#cameraEffectsDialog .cameraEffectsBody{border:0;padding:16px 18px;margin:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#cameraEffectsDialog .cameraEffectsIntro{margin:0 0 14px;font-size:13px}
#cameraEffectsDialog .cameraEffectsControls{margin:0}
#cameraEffectsDialog .cameraLookPresets{margin-bottom:12px}
#cameraEffectsDialog .cameraLookPresets button{min-height:52px;font-size:13px}
#cameraEffectsDialog .cameraEffectsFooter{flex:none;margin:0;padding:12px 18px;border-top:1px solid var(--workspace-border);background:#fff}
#cameraEffectsDialog .cameraEffectsFooter .btn{min-width:88px;min-height:44px}
#cameraEffectsDialog .cameraEffectsPrivacy{font-size:11px;line-height:1.5;margin:14px 0 0}
#cameraEffectsDialog #cameraEffectsStatus{font-size:12px;line-height:1.5;margin:10px 0 0}
#cameraEffectsDialog fieldset{padding:0;margin:0;min-width:0}
#cameraEffectsDialog .videoOptionalSettings input[type=range]{min-height:36px}
#scriptDialog.readerCapturing .readerHeader>p,#scriptDialog.readerCapturing .readerEntryActions,#scriptDialog.readerCapturing .readerToolbar,#scriptDialog.readerCapturing #readerSettings,#scriptDialog.readerCapturing #scriptEditor,#scriptDialog.readerCapturing .readerMeta,#scriptDialog.readerCapturing .trackHeading,#scriptDialog.readerCapturing #trackStatus{display:none!important}
#scriptDialog.readerCapturing .readerHeader{padding-bottom:10px}
#scriptDialog.readerCapturing .readerWorkspace{padding-top:8px;min-height:0}
#scriptDialog.readerCapturing #trackText{font-size:var(--reader-size,20px);line-height:1.85;max-height:none;min-height:120px}
#scriptDialog.readerCapturing .readerStatus{margin:10px 0 0}
#scriptDialog.readerCapturing .readerControls{flex-shrink:0}
.glanceMode #cameraEffectsDialog>.videoSettingsHeader,.glanceMode #cameraEffectsDialog .cameraEffectsFooter{background:#111;color:#fff;border-color:#555}
.glanceMode .videoOptionalSettings>summary{color:#ddd}

/* Script language controls stay readable for mixed scripts and narrow screens. */
.scriptLanguageControls{display:grid;gap:8px;min-width:0;width:100%}
.scriptLanguageControls>label:not(.sr){display:grid;gap:6px;font-size:13px;color:#555;min-width:0}
.scriptLanguageControls select,.scriptLanguageControls .customLanguageCode{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #ddd;border-radius:10px;background:#fff;color:#222;font:inherit}
.scriptLanguageControls .customLanguageCode[hidden],.readerToolbar>.scripttabs[hidden]{display:none!important}
.scriptLanguageHint{font-size:12px;line-height:1.6;color:#666;margin:0 0 10px}
.scriptLanguageControls .scriptLanguageHint{margin:0}
#videoReadingOptions .scriptLanguageControls{margin-bottom:14px}
.videoSpeechOptIn{min-height:44px;display:flex;align-items:center;gap:8px;font-size:13px}
.videoSpeechOptIn input{width:18px;height:18px;flex:none}
#videoSpeechPrivacy{margin:4px 0 16px}
#videoSpeechStatus{margin:0 0 12px}
#scriptText,#trackText,#videoScript,#videoPromptText,#draftNotes,#draftText{text-align:start;unicode-bidi:plaintext}
.glanceMode .scriptLanguageControls>label:not(.sr),.glanceMode .scriptLanguageHint{color:#ddd}
.glanceMode .scriptLanguageControls select,.glanceMode .scriptLanguageControls .customLanguageCode{background:#111;color:#fff;border-color:#777}
.phoneUI #videoReadingOptions .scriptLanguageControls label,.phoneUI #videoReadingOptions .scriptLanguageHint,.phoneUI #videoSpeechStatus,.phoneUI .videoSpeechOptIn{font-size:calc(12px * var(--camera-ui-scale))}

#videoPromptText .matched{opacity:.6}#videoPromptText .current{background:#ffffff33;border-radius:4px;text-decoration:underline;text-underline-offset:4px}#videoPromptText[dir=auto],#trackText[dir=auto]{text-align:start;unicode-bidi:plaintext}#videoPromptText span[dir=auto]{unicode-bidi:normal}

.recognizedText{margin:14px 0;font-size:12px}.recognizedText>summary{min-height:40px;cursor:pointer}.recognizedText textarea{width:100%;min-height:90px!important;max-height:180px!important;font-size:16px!important;line-height:1.6}#scriptDialog.readerCapturing .recognizedText{display:none}.videoSpeechLive{position:absolute;z-index:5;top:calc(108px * var(--camera-ui-scale,1));left:12px;right:12px;max-width:90%;font-size:calc(11px * var(--camera-ui-scale,1));color:#fff;background:#0009;padding:6px 10px;border-radius:8px;pointer-events:none;margin:0}

/* Script words are inline text, never camera-overlay badges. Preserve Indic shaping. */
#videoPromptText span{position:static;display:inline;inset:auto;padding:0;margin:0;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;text-shadow:inherit;white-space:inherit}
#videoPromptText .current{background:#ffffff33;border-radius:4px;text-decoration:underline;text-underline-offset:4px}

/* Video library: keep navigation and destructive action reachable on phones. */
#videoDialog .videoSaved[open]{top:12px!important;bottom:12px!important;left:12px!important;right:12px!important;max-height:none!important;max-width:none!important;transform:none!important;overflow:auto;overscroll-behavior:contain;z-index:30}
#videoDialog .videoLibraryActions{position:sticky;top:0;z-index:2;display:flex;gap:8px;justify-content:space-between;padding:10px 0;background:#fff}
#videoDialog .videoLibraryActions .btn{min-height:44px}
#videoDialog .videoTake video{display:block;width:100%;height:auto;max-height:36dvh;object-fit:contain;background:#111}
#videoDialog .videoTake>.row{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
#videoDialog .videoTake>.row .btn{min-height:44px}
#videoDialog .videoActionLabel{display:block}
#videoDialog[data-review=true] #videoActionLabel{display:none}
#videoDialog[data-review=true] #videoStart:after{content:'New video'}

/* Device access alternatives remain usable in embedded mobile browsers. */
.audioAccessPanel{margin:16px auto;padding:20px;max-width:720px;border:1px solid #ddd;border-radius:16px;background:#fff;color:#222}
.audioAccessPanel[hidden]{display:none}.audioAccessPanel .row{display:flex;flex-wrap:wrap;gap:8px}.audioAccessPanel p{line-height:1.5}.videoMode .audioAccessPanel{display:none}
#videoCameraHint .videoAccessAlternatives{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:100%}
#videoCameraHint .videoAccessAlternatives .stageTool{min-height:44px;padding:10px 14px;font-size:14px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
#videoDialog[data-phase=off][data-review=false] .videoCameraHint{overflow:auto;padding:20px;gap:12px}
#videoDialog[data-camera-issue=permission] #videoCameraTitle{font-size:clamp(24px,5vw,34px)}
#videoDialog[data-camera-issue=permission] #videoCameraDescription{display:block;font-size:16px;line-height:1.5}
#videoDialog[data-camera-issue=permission] #videoEnable{display:inline-flex!important}

/* Video mode opens the preview; recovery choices appear only after an access error. */
#videoDialog[data-camera-issue=""] .videoAccessAlternatives{display:none!important}

/* Part 1: one visible recording timer, status and level meter. */
body:not([data-audio-state=idle])[data-audio-state] #timer,body:not([data-audio-state=idle])[data-audio-state] #liveStatus,body:not([data-audio-state=idle])[data-audio-state] #capture,body:not([data-audio-state=idle])[data-audio-state] #caption,body:not([data-audio-state=idle])[data-audio-state] .recordPrompt,body:not([data-audio-state=idle])[data-audio-state] .clip{display:none!important}
#liveCard #centralStatus,#liveCard #centralHint{display:none}#liveCard{padding:24px;text-align:center}#liveCard #signalHint{min-height:24px;font-size:16px}#liveCard #micLevel{width:100%;height:20px}.clipactions{display:flex;gap:8px;flex-wrap:wrap}.clipactions .btn{min-height:44px}.clipcard h3{overflow-wrap:anywhere;font-size:18px}.speedLabel{display:block;margin:12px 0;font-size:14px}.speedLabel select{padding:8px;border:1px solid #ddd;border-radius:8px}.takeBackup{display:flex;gap:12px;align-items:center;flex-wrap:wrap;border-top:1px solid #eee;padding-top:12px;margin-top:12px;font-size:14px}.takeBackup .btn{min-height:44px}#encodingProgress{width:100%;height:16px}#encodingProgress[hidden]{display:none}.audioStorageWarning{padding:14px;margin:12px;border:1px solid #d0a866;border-radius:12px;background:#fff8ed;color:#49320c}#unfinishedTakes .btn{margin:4px;min-height:44px}

.videoMode #unfinishedRecovery,.videoMode #audioStorageWarning{display:none!important}

.audioAccessBlocked:not(.videoMode) #thread,.audioAccessBlocked:not(.videoMode) .composerwrap{display:none!important}

#videoDialog[data-camera-issue=container] #videoCameraTitle{font-size:clamp(24px,5vw,34px)}

/* Keep microphone recovery attached to the recorder, not the Library page. */
#workspaceView:not([hidden]) ~ .audioAccessPanel{display:none!important}
/* An empty video library should size to its content instead of filling the screen. */
#videoDialog .videoSaved[open].emptyLibrary{top:50%!important;bottom:auto!important;max-height:min(380px,calc(100dvh - 48px))!important;transform:translateY(-50%)!important}
