.language-widget{position:relative;display:inline-block;max-width:200px;z-index:70;font:12px/1.4 system-ui,sans-serif;direction:ltr;color:#1c2440}.language-widget>summary{cursor:pointer;padding:8px 10px;border:1px solid #dce4ed;border-radius:8px;background:#fff;white-space:nowrap;list-style:none}.language-widget>summary::-webkit-details-marker{display:none}.language-panel{position:absolute;right:0;top:calc(100% + 5px);width:240px;max-width:calc(100vw - 30px);box-sizing:border-box;background:#fff;padding:16px;border:1px solid #d4dee8;border-radius:12px;box-shadow:0 10px 35px #19324c25;z-index:200;text-align:left}.language-panel label{display:grid;gap:8px;font-weight:650}.language-panel select{width:100%;background:#fff;color:#1c2440;border:1px solid #c2d0dc;border-radius:6px;min-height:40px;padding:6px;font:14px system-ui}.language-panel p{font-size:11px;white-space:normal;line-height:1.5;margin:10px 0}.language-panel a{font-size:10px;color:#587181}.language-board{margin-inline-start:5px}.language-board>summary{padding:5px 7px}html[dir=rtl] .nav,html[dir=rtl] .hero,html[dir=rtl] main,html[dir=rtl] footer,html[dir=rtl] .usage-dialog{direction:rtl;text-align:right}html[dir=rtl] #boardWrap,html[dir=rtl] #toolbar,html[dir=rtl] .board-plan-status{direction:ltr}html[dir=rtl] #toolbar .btntext{direction:rtl}html[dir=rtl] .language-widget{direction:ltr}html:not([lang=es]) #toolbar .toolbtn{max-width:160px}html:not([lang=es]) .board-plan-status{gap:10px}.board-plan-upgrade{white-space:normal;text-align:center;max-width:170px}.board-plan-caption{white-space:normal;max-width:140px}.board-plan-note{white-space:normal;max-width:140px}@media(max-width:600px){.language-panel{position:fixed;right:12px;top:75px}.language-board .language-panel{top:110px}.language-widget{max-width:160px}.public-nav nav{flex-wrap:wrap}.board-plan-upgrade{max-width:110px}.board-plan-caption{max-width:100px}.board-plan-note{max-width:120px}}

/* The language control shares the tab row, leaving room for save/undo/account. */
#toolbar .ribbon__tabrow > .language-widget{flex:0 1 auto;min-width:44px;max-width:130px;margin-inline-start:auto}
#toolbar .language-widget > summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.touch-menu #toolbar .ribbon__tabrow > .language-widget{max-width:94px}
body.touch-menu #toolbar .language-widget > summary{min-height:44px;box-sizing:border-box;display:flex;align-items:center;padding:6px}
#toolbar #recordStatus{white-space:normal;overflow-wrap:anywhere;max-width:360px}
#toolbar #recordDownloads{display:flex;flex-wrap:wrap;gap:6px;max-width:100%}
#toolbar #recordDownloads > span{display:flex;flex-wrap:wrap;gap:6px;max-width:100%}
#toolbar #recordDownloads .toolbtn{white-space:normal;overflow-wrap:anywhere;height:auto}

/* The editor language belongs inside Profile, never on the ribbon or canvas. */
#accountMenu .language-profile{display:block;position:static;width:100%;max-width:none;min-width:0;flex-shrink:0;margin:4px 0 0;padding:12px 0 0;border-top:1px solid #dce4ed;color:#233047;text-align:start;direction:inherit}
#accountMenu .language-profile .language-panel{display:block;position:static;inset:auto;width:100%;max-width:none;min-width:0;padding:0;border:0;border-radius:0;box-shadow:none;color:#233047;background:#fff;text-align:start}
#accountMenu .language-profile label{color:#233047;white-space:normal}
#toolbar #accountMenu .language-profile select{display:block;width:100%;min-width:0;max-width:none;min-height:42px;height:auto;font-size:14px;background:#fff;color:#233047}
#accountMenu .language-profile p{color:#4b5b70;white-space:normal}
#accountMenu .language-profile a{color:#405569}
