.language-control { display:flex; align-items:center; gap:6px; max-width:100%; flex:0 1 auto; }
/* Shared by every app page. Keep dropdown geometry independent of fonts and
   component background/padding shorthands, including native mobile pickers. */
:root { --circuit-select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23506b82' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select:not([multiple]):not([size]),select:not([multiple])[size="1"] {
  -webkit-appearance:none; appearance:none;
  background-image:var(--circuit-select-chevron) !important;
  background-repeat:no-repeat !important;
  background-position:right 12px center !important;
  background-size:16px 16px !important;
  padding-inline-end:40px !important;
}
select:not([multiple]):dir(rtl) { background-position:left 12px center !important; }
.circuit-select-trigger { position:relative; padding-inline-end:40px; }
.circuit-select-trigger .circuit-select-arrow {
  position:absolute; inset-inline-end:12px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; font-size:0; line-height:0; pointer-events:none;
}
.circuit-select-arrow::before {
  content:""; display:block; width:100%; height:100%; background:currentColor;
  -webkit-mask:var(--circuit-select-chevron) center / contain no-repeat;
  mask:var(--circuit-select-chevron) center / contain no-repeat;
}
@media(forced-colors:active) {
  select:not([multiple]):not([size]),select:not([multiple])[size="1"] {
    -webkit-appearance:auto; appearance:auto;
    background-image:none !important; padding-inline-end:11px !important;
  }
  .circuit-select-arrow::before { background:ButtonText; forced-color-adjust:none; }
}
.language-picker { display:flex; align-items:center; gap:7px; min-width:0; color:#60626c; font:12px/1.4 Arial,sans-serif; }
.language-picker select { display:block; width:auto; min-width:118px; max-width:170px; min-height:40px; margin:0; padding:8px 26px 8px 10px; border:1px solid #dddbd4; border-radius:14px; background-color:#fff; color:#161618; font:inherit; cursor:pointer; }
.language-help-button { display:grid; place-items:center; flex:0 0 32px; width:32px; height:40px; padding:0; border:0; border-radius:14px; background:transparent; color:#60626c; font:14px Arial,sans-serif; cursor:pointer; }
.language-picker select:focus-visible,.language-help-button:focus-visible { outline:3px solid #2a64e2; outline-offset:2px; }
.auth-card > .language-control { justify-content:flex-end; margin:0 0 24px; }
.onboarding-header > div { flex-wrap:wrap; }
.language-help { box-sizing:border-box; width:min(460px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:28px; border:1px solid #e3e1da; border-radius:24px; background:#fff; color:#161618; font:15px/1.6 Arial,sans-serif; }
.language-help::backdrop { background:rgba(10,32,64,.4); }
.language-help form { display:flex; justify-content:flex-end; margin:-12px -10px 0 0; }
.language-help-close { width:40px; height:40px; padding:0; border:0; background:transparent; color:inherit; font-size:26px; cursor:pointer; }
.language-help h2 { font-family:inherit; font-size:22px; margin:0 0 12px; }
.language-help a { color:#0d44ba; text-decoration:underline; }
html[lang="fr"] .topbar { flex-wrap:wrap; height:auto; min-height:72px; row-gap:12px; }
.topbar > .auth-account { flex-wrap:wrap; }
html[lang="fr"] .heading-actions { flex-wrap:wrap; }
html[lang="fr"] .nav-label { letter-spacing:.08em; }

/* Account controls must stay anchored when translation, long addresses or font
   metrics make the toolbar wrap. Apply this to every workspace page, not only
   the dashboard, and retain compatibility with existing hosted HTML. */
.app-shell header.topbar {
  height:auto; min-height:72px; padding-block:12px;
  flex-wrap:wrap; gap:12px 20px;
}
.topbar > div:first-child { flex:0 0 auto; max-width:100%; }
.app-shell .topbar > .auth-account {
  flex:1 1 640px; min-width:0; max-width:100%;
  justify-content:flex-end; gap:12px 18px;
}
.topbar .data-mode-label,.topbar .language-control { flex-shrink:0; }
.topbar #auth-account {
  flex:0 1 auto; min-width:0; max-width:100%;
  margin-inline-start:auto; gap:10px;
}
.topbar #auth-account-email { flex:0 1 auto; min-width:0; }
.topbar #sign-out,.onboarding-header #setup-signout {
  flex:none; white-space:nowrap; min-height:40px; line-height:1.4;
}
.topbar .language-help-button { padding:0; border:0; }

/* Keep the onboarding identity and sign-out control in the same grid row. */
.onboarding-header { gap:16px; flex-wrap:wrap; }
.onboarding-header > div {
  display:grid; grid-template-columns:auto minmax(0,220px) auto;
  align-items:center; gap:12px; min-width:0; max-width:100%;
  margin-inline-start:auto;
}
.onboarding-header #setup-email {
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.onboarding-header > div > .language-control { order:0; min-width:0; }
@media(max-width:900px) {
  .app-shell .topbar > .auth-account { flex-basis:100%; width:100%; }
  .onboarding-header > div { grid-template-columns:minmax(0,1fr) auto; }
  .onboarding-header .language-picker { flex:1 1 auto; }
  .onboarding-header .language-picker select { min-width:0; width:100%; }
}
@media(max-width:650px) {
  .language-picker { gap:5px; }
  .language-picker select { min-height:44px; max-width:160px; }
  .language-help-button { height:44px; flex-basis:36px; width:36px; }
  .topbar .language-picker > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .onboarding-header .language-control { order:2; }
  .onboarding-header { flex-wrap:wrap; gap:12px; }
  .onboarding-header > div { min-width:0; max-width:100%; justify-content:flex-end; }
  .onboarding-header .language-picker > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .auth-card > .language-control { margin-bottom:18px; }
}
