/* One translator screen: one shared card, two readable text areas, no page scroll. */
body:has(#translatorView.active){--header-height:56px;--nav-height:48px;--hosting-footer:0px}
main:has(> #translatorView.active){display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0 8px 4px}
#translatorView.active{display:flex;flex:1;flex-direction:column;min-height:0;height:100%;gap:5px;padding:5px 0}
#translatorView .section-head{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:6px;margin:0;padding:0 3px}
#translatorView .section-head h1{margin:0;font-size:20px;line-height:1.2}
#translatorView #conversationStart{display:flex;flex:0 0 auto;align-items:center;justify-content:center;width:auto;min-height:30px;height:30px;margin:0;padding:2px 7px;border:1px solid #7890a5;border-radius:8px;background:#102f48;color:#ffe3a0;font:inherit;font-size:14px;font-weight:700;white-space:nowrap}
#translatorView .translator-grid{display:flex;flex:1;flex-direction:column;min-height:0;gap:3px;overflow:hidden;margin:0;padding:3px;border:1px solid #536b83;border-radius:12px;background:#071a30}
#translatorView .language-row{display:grid;flex:0 0 auto;grid-template-columns:max-content 32px max-content;justify-content:center;gap:5px;padding:0}
#translatorView .language-row select,#translatorView .swap-btn{width:auto;min-width:0;max-width:calc(50vw - 28px);height:32px;min-height:32px;padding:3px 7px;font-size:16px}
#translatorView #swapLanguages{display:flex!important;align-items:center;justify-content:center;width:32px;min-width:32px;padding:2px;font-size:19px}
#translatorView .translation-photo-status{flex:0 0 auto;margin:0;padding:2px 5px;color:#ffe3a0;font-size:14px;line-height:1.25}
#translatorView .translation-photo-status[data-error]{color:#ffc5b6}
#translatorView .translation-photo-status:empty{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
#translatorView .tone-label{font-size:14px}
#translatorView .tone-select{height:36px;min-height:36px;font-size:15px}
#translatorView .conversation-toggle{min-height:32px;font-size:14px}
#translatorView .translation-writing-area{display:grid;flex:1 1 0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr);min-height:130px;gap:0;overflow:hidden;padding:0;border:0;border-radius:0;background:transparent}
#translatorView .translation-panel{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;padding:3px 4px 2px;border:0;border-radius:0;background:transparent}
#translatorView .translation-panel+ .translation-panel{border-top:1px solid #536b83;background:#0b233b}
#translatorView .translation-panel-heading{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:6px;min-height:25px}
#translatorView .translation-panel .translation-language{margin:0;color:#ffe3a0;font-size:16px;line-height:1.25}
#translatorView .translation-enlarge{flex:0 0 auto;min-height:26px;padding:2px 6px;border:1px solid #587089;border-radius:7px;background:#102f48;color:#ffe3a0;font:inherit;font-size:13px;font-weight:700}
#translatorView .translation-panel #sourceText,#translatorView .translation-panel #translatedText{display:block;flex:1 1 auto;width:100%;min-width:0;height:0;min-height:34px!important;max-height:none;box-sizing:border-box;resize:none;overflow:auto;overscroll-behavior:contain;padding:4px 2px;border:0;border-radius:0;background:transparent;color:#fff4df;font-size:clamp(18px,5vw,22px);line-height:1.4}
#translatorView .translation-panel #sourceText::placeholder,#translatorView .translation-panel #translatedText::placeholder{color:#aebdcb;opacity:1}
#translatorView .translation-panel .text-actions{display:flex;flex:0 0 auto;gap:4px;margin-top:2px}
#translatorView .translation-panel .text-actions button{flex:1;min-width:0;min-height:30px;padding:3px 4px;border:1px solid #788ba0;border-radius:7px;background:#102f48;color:#ffe3a0;font:inherit;font-size:15px;font-weight:750;line-height:1.1;white-space:nowrap}
#translatorView .translation-panel .text-actions button:disabled{opacity:.48}
#translatorView .translation-panel .text-actions[hidden]{display:none!important}
#translatorView #translationProgress{flex:0 0 auto;max-height:38px;overflow:auto;margin:0 0 3px;font-size:14px}
/* Keep the badge beside navigation, never over the translation or microphone controls. */
body:has(#translatorView.active):has(#nl-badge-frame) .bottom-nav{box-sizing:border-box;justify-content:flex-start;gap:0;padding-right:calc(106px + env(safe-area-inset-right))}
body:has(#translatorView.active):has(#nl-badge-frame) .bottom-nav .nav-btn{min-width:0}
body:has(#translatorView.active) #nl-badge-frame{position:fixed!important;top:auto!important;bottom:calc(7px + env(safe-area-inset-bottom))!important;left:auto!important;right:calc(4px + env(safe-area-inset-right))!important;width:150px!important;max-width:150px!important;max-height:60px!important;margin:0!important;transform:scale(.65)!important;transform-origin:bottom right!important}
body:has(#conversation:not([hidden])):has(#nl-badge-frame) #conversation{padding-bottom:calc(42px + env(safe-area-inset-bottom))}
body:has(#conversation:not([hidden])) #nl-badge-frame{z-index:10000!important}
body:has(#translatorView.active) .bottom-nav .nav-btn{min-height:44px;padding:0 2px;gap:1px;font-size:18px}
body:has(#translatorView.active) .bottom-nav .nav-btn span{font-size:10px;line-height:1.1}
#translatorView .translator-composer{position:static;z-index:auto;flex:0 0 auto;padding:3px 0 0;border-top:1px solid #324c65;background:transparent}
#translatorView .translate-actions{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1.15fr) minmax(0,1.35fr) minmax(0,.9fr);gap:4px;padding:0}
#translatorView .translate-actions:not(:has(#translateNow:not([hidden]))){grid-template-columns:repeat(3,minmax(0,1fr))}
#translatorView .translate-actions>*{grid-column:auto!important;grid-row:auto!important;min-width:0;min-height:30px;padding:3px 2px;font-size:15px;line-height:1.1;white-space:nowrap}
#translatorView .translate-actions #voiceInput{grid-column:auto!important;grid-row:auto!important;width:auto!important;min-height:30px;padding:3px 2px;font-size:16px;font-weight:700;border-color:#d8b96e;background:#193c57}
#translatorView .translate-actions #translateNow{font-size:15px;padding-inline:1px}
#translatorView .translation-status{flex:0 0 auto;min-height:0;max-height:2.5em;margin:0;font-size:13px;line-height:1.25;overflow:hidden}
#translatorView .translation-status:empty{display:none!important}
#translatorView .legacy-translation,#translatorView .translator-tabs{display:none!important}
body.yoryi-keyboard-open #translatorView .section-head{display:none!important}
@media(max-width:360px){#translatorView .section-head h1{font-size:20px}#translatorView #conversationStart{font-size:13px;padding-inline:5px}#translatorView .translation-panel{padding-inline:3px}#translatorView .translation-panel .text-actions{gap:3px}}
@media(max-height:540px){#translatorView .section-head>div{display:none}#translatorView .section-head{justify-content:flex-end}#translatorView .translator-grid{gap:2px;padding:2px}#translatorView .language-row select,#translatorView .swap-btn{height:30px;min-height:30px}#translatorView .translation-panel{padding-block:2px}#translatorView .translation-enlarge{min-height:23px;padding:1px 5px}#translatorView .translation-panel .text-actions button{min-height:28px;padding-block:2px}#translatorView .translate-actions>*{min-height:28px}#translatorView .translation-status{display:none}}
@media(max-height:410px){#translatorView .translation-writing-area{min-height:90px}}

/* Keep media and languages in one row without shrinking the touch targets. */
#translatorView .translator-header-actions{display:flex;flex:0 0 auto;align-items:center;gap:5px}
#translatorView .translator-icon,#translatorView #swapLanguages{display:grid;place-items:center;box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #7890a5;border-radius:9px;background:#102f48;color:#ffe3a0;font:inherit;font-size:21px}
#translatorView .translator-icon svg{width:22px;height:22px}
#translatorView .translator-icon:focus-visible,#translatorView #swapLanguages:focus-visible,#translatorView .language-row select:focus-visible{outline:2px solid #fff4df;outline-offset:-3px}
#translatorView #translationPhotoActions{grid-template-columns:44px minmax(0,1fr) 44px minmax(0,1fr) 44px;gap:3px}
#translatorView #translationPhotoActions select{box-sizing:border-box;width:100%;max-width:none;min-height:44px;height:44px;padding:4px;border-radius:9px}
#translatorView #translationPhotoActions option{font-size:16px}
#translatorView #translatorOptionsDialog{box-sizing:border-box;width:min(340px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;border:1px solid #7890a5;border-radius:14px;background:#0a2038;color:#fff4df}
#translatorView #translatorOptionsDialog::backdrop{background:rgb(0 10 22 / .68)}
#translatorView .translator-settings-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
#translatorView .translator-settings-head h2{margin:0;font-size:19px}
#translatorView .translator-settings-head form{margin:0}
#translatorView #translatorOptionsDialog .tone-label{font-size:16px}
#translatorView #translatorOptionsDialog .tone-select{box-sizing:border-box;width:100%;height:44px;min-height:44px;margin:0;padding:4px 8px;font-size:16px;appearance:auto;background:#0a1d33}
#translatorView #translatorOptionsDialog .conversation-toggle{display:flex;min-height:44px;margin-top:6px;font-size:16px}
@media (max-width:380px){#translatorView #translationPhotoActions select{font-size:15px}}
@media (max-width:345px){#translatorView #translationPhotoActions select{appearance:none;background-image:none;text-align:center;padding-inline:2px}}

/* One scrolling writing surface. Entries take only the space their text needs. */
#translatorView #translationWritingArea{display:flex;flex:1 1 0;flex-direction:column;gap:8px;min-height:0;overflow:auto;overscroll-behavior:contain;padding:5px 4px;border:1px solid #536b83;border-radius:10px;background:#081c32}
#translatorView #translationWritingArea .translation-panel{flex:0 0 auto;overflow:visible;padding:3px 5px;border:0;border-radius:0;background:transparent}
#translatorView #translationWritingArea .translation-result{padding-top:9px;border-top:1px solid #405e78}
#translatorView #translationResultPanel:not([aria-busy="true"]):not(:has(#translationProgress:not([hidden]),#translatedTextActions:not([hidden]))){display:none}
#translatorView #translationWritingArea:not(:has(#translationResultPanel[aria-busy="true"],#translationProgress:not([hidden]),#translatedTextActions:not([hidden]))) #translationSourcePanel{flex:1 0 auto}
#translatorView #translationWritingArea:not(:has(#translationResultPanel[aria-busy="true"],#translationProgress:not([hidden]),#translatedTextActions:not([hidden]))) #translationSourcePanel #sourceText{flex:1 0 auto}
#translatorView #translationWritingArea .translation-language{font-size:15px;overflow-wrap:anywhere}
#translatorView #translationWritingArea :is(#sourceText,#translatedText){display:block;flex:none;field-sizing:content;height:auto;min-height:40px!important;max-height:none;overflow:hidden;overscroll-behavior:auto}
#translatorView #translationWritingArea :is(#sourceText,#translatedText):focus-visible{outline:2px solid #c4a565;outline-offset:-2px}
@supports not (field-sizing:content){
 #translatorView #translationWritingArea :is(#sourceText,#translatedText){height:var(--translation-content-height,auto)}
}

#translatorView .translation-dialect-notice{margin:3px 0 5px;color:#d8e3ee;font-size:.875rem;line-height:1.35}
#translatorView .translation-dialect-notice[hidden]{display:none}
#pilotFeedbackQuick{display:flex;gap:6px;padding-top:4px}
#pilotFeedbackQuick[hidden],#pilotReviewTranslations[hidden]{display:none!important}
#pilotFeedbackQuick button,#pilotReviewTranslations,#pilotFeedbackDialog button{min-height:44px;padding:5px 9px;border:1px solid #7890a5;border-radius:8px;background:#102f48;color:#ffe3a0;font:inherit;font-size:.95rem}
#pilotFeedbackQuick button[aria-pressed="true"],#pilotFeedbackDialog button[aria-pressed="true"]{border:2px solid #ffe3a0;text-decoration:underline}
#pilotReviewTranslations{margin-top:8px}
#pilotFeedbackDialog{width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;border:1px solid #7890a5;border-radius:14px;background:#0a2038;color:#fff4df}
#pilotFeedbackDialog::backdrop{background:rgb(0 10 22 / .68)}
#pilotFeedbackDialog h2,#pilotFeedbackDialog p{margin:0 0 .65em}
#pilotFeedbackDialog article{margin:.5em 0;padding:.35em;border-bottom:1px solid #405c76;overflow-wrap:anywhere}
#pilotFeedbackDialog .pilot-feedback-edit{display:grid;gap:7px}
#pilotFeedbackDialog label{display:grid;gap:3px}
#pilotFeedbackDialog textarea{width:100%;padding:6px;color:#fff4df;background:#09192a;border:1px solid #7890a5;border-radius:6px;font-size:1rem}
#pilotFeedbackDialog .pilot-feedback-ratings{display:flex;flex-wrap:wrap;gap:5px}
#pilotFeedbackDialog button:disabled{opacity:.55}

/* Keep action targets readable without reducing text size on narrow phones. */
#translatorView .section-head h1{overflow-wrap:normal;word-break:normal}
#translatorView #conversationStart{min-height:44px;height:auto;padding:5px 8px}
#translatorView .translate-actions>*,
#translatorView .translate-actions #voiceInput{min-height:44px;white-space:normal;overflow-wrap:normal}
#translatorView .translation-panel .text-actions button,
#translatorView .translation-enlarge{min-height:44px;white-space:normal;overflow-wrap:normal}
@media(max-width:390px){
 #translatorView .section-head h1>[aria-hidden="true"]{display:none}
 #translatorView #conversationStart>[aria-hidden="true"]{display:none}
 #translatorView #translationPhotoActions{gap:2px}
 #translatorView #translationPhotoActions select{appearance:none;background-image:none;text-align:center;padding-inline:0}
 #translatorView .translate-actions:has(#translateNow:not([hidden])){grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:345px){
 #translatorView #translationPhotoActions:has(#targetLanguage option[value="es-DO"]:checked):not(:has(#sourceLanguage option[value="es-DO"]:checked)){grid-template-columns:44px minmax(0,1fr) 44px minmax(0,1.25fr) 44px}
 #translatorView #translationPhotoActions:has(#sourceLanguage option[value="es-DO"]:checked):not(:has(#targetLanguage option[value="es-DO"]:checked)){grid-template-columns:44px minmax(0,1.25fr) 44px minmax(0,1fr) 44px}
 #translatorView .section-head{gap:3px}
 #translatorView #conversationStart{max-width:125px;white-space:normal;text-align:center}
}
