/* One borderless country flag in the header. The dropdown uses actual SVGs,
   so Windows, Linux and mobile browsers render every flag consistently. */
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .rw-nav{flex-wrap:nowrap}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-switch{position:relative;order:4;flex:0 0 40px;width:40px;height:42px;margin:0 0 0 2px;border:0;background:transparent}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown{height:100%}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary{display:flex;align-items:center;justify-content:center;width:40px;height:42px;padding:0;border:0;border-radius:0;list-style:none;background:transparent;cursor:pointer}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::-webkit-details-marker{display:none}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::marker{content:""}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary:hover{background:transparent}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary:focus-visible{outline:2px solid var(--blue2);outline-offset:2px;border-radius:5px}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-flag{display:block;width:32px;height:24px;object-fit:cover;border:0;border-radius:0;box-shadow:none}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-list{position:absolute;z-index:240;display:none;right:0;top:calc(100% + 5px);width:min(360px,calc(100vw - 32px));max-height:min(70vh,550px);overflow-y:auto;overscroll-behavior:contain;padding:8px;border:1px solid var(--ui-stroke);border-radius:12px;background:var(--panel);box-shadow:0 14px 30px rgba(0,0,0,.3);direction:ltr}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown[open] .tr-country-list{display:grid;gap:2px}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option{display:flex;align-items:center;gap:13px;min-height:38px;padding:6px 10px;border:0;border-radius:8px;color:var(--text);font-size:14px;font-weight:560;text-decoration:none;white-space:nowrap;line-height:1.35}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option img{display:block;flex:none;width:28px;height:21px;border:0;border-radius:0;object-fit:cover}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option:hover,:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option:focus-visible{background:var(--panel2);color:var(--text);text-decoration:none}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option[aria-current="true"]{background:rgba(57,124,243,.16);color:var(--blue2);font-weight:700}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-nav-links{order:2}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-mobile-menu{order:3}
@media(max-width:900px){:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-switch{margin-left:0}:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-nav-links{order:2}}
@media(max-width:390px){:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .rw-brand .rw-logo{width:clamp(158px,51vw,190px)}:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .rw-nav{gap:10px}}


/* Keep country selector as the last action on every workspace header. */
.tr-workspace-page .rw-nav{position:relative;min-height:72px;flex-wrap:nowrap}
.tr-workspace-page .rw-nav .tr-nav-links{order:2;min-width:0}
.tr-workspace-page .rw-nav .tr-mobile-menu{order:3}
.tr-workspace-page .rw-nav .tr-country-switch{order:4;margin-left:2px}
@media(max-width:900px){
 .tr-workspace-page .rw-nav .tr-country-switch{flex:0 0 40px}
 .tr-workspace-page .rw-nav .tr-mobile-menu{margin-left:auto}
}


/* Primary conversion action is first among header actions, after the brand. */
:is(.tr-public-page,.tr-legal-page) .rw-nav .tr-header-start{
 order:1;display:inline-flex;align-items:center;justify-content:center;
 min-height:36px;padding:8px 13px;flex:0 0 auto;
 border:1px solid var(--blue);border-radius:8px;background:var(--blue);
 color:#fff;font-size:12px;font-weight:750;text-decoration:none;white-space:nowrap;
}
:is(.tr-public-page,.tr-legal-page) .rw-nav .tr-header-start:hover{background:#255edb;border-color:var(--blue2);color:#fff}
:is(.tr-public-page,.tr-legal-page) .rw-nav .tr-nav-links{order:2;margin-left:auto}
:is(.tr-public-page,.tr-legal-page) .rw-nav .tr-mobile-menu{order:3}
:is(.tr-public-page,.tr-legal-page) .rw-nav .tr-country-switch{order:4;margin-left:2px}
@media(max-width:900px){
 :is(.tr-public-page,.tr-legal-page) .rw-nav .tr-header-start{margin-left:auto}
 :is(.tr-public-page,.tr-legal-page) .rw-nav .tr-mobile-menu{margin-left:0}
}
@media(max-width:620px){
 :is(.tr-public-page,.tr-legal-page) .rw-nav{gap:7px}
 :is(.tr-public-page,.tr-legal-page) .rw-nav .tr-header-start{padding:7px 9px;min-height:32px;font-size:11px}
 :is(.tr-public-page,.tr-legal-page) .rw-nav .rw-logo{width:clamp(128px,38vw,195px)}
}


/* Flag-only country selector on every template, including legal pages.
 * Remove the browser's native details disclosure glyph and all pseudo arrows.
 */
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary{
 -webkit-appearance:none!important;appearance:none!important;
 list-style:none!important;white-space:normal!important;
 border:0!important;box-shadow:none!important;background:transparent!important;
}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::before,
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::after{
 content:none!important;display:none!important;
}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::marker{content:""!important;font-size:0!important}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-dropdown>summary::-webkit-details-marker{display:none!important}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-list{
 box-sizing:border-box!important;
 left:auto!important;right:0!important;
 width:min(352px,calc(100vw - 24px))!important;
 max-width:calc(100vw - 24px)!important;
 max-height:min(65vh,530px)!important;
 max-height:min(65dvh,530px)!important;
 overflow-x:hidden!important;overflow-y:auto!important;
 overscroll-behavior:contain;
 -webkit-overflow-scrolling:touch;
 z-index:500!important;
}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option{
 white-space:normal!important;overflow-wrap:anywhere;min-width:0;
}
:where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-option span{
 flex:1;min-width:0;
}
@media(max-width:620px){
 :where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .rw-nav .tr-country-switch{
  flex:0 0 40px!important;width:40px!important;margin-left:0!important;
 }
 :where(.tr-public-page,.tr-workspace-page,.tr-legal-page) .tr-country-list{
  right:0!important;
  max-height:min(65dvh,480px)!important;
 }
}
