/* Localized UI labels. The selector values used by the app remain canonical. */
html.standalone-auth .i18n-language-control {
  display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap;
  gap:6px 10px; width:100%; margin:0 0 18px; box-sizing:border-box;
  color:var(--auth-muted,#aaa5b7); font:400 12px/1.4 var(--ui,system-ui);
}
html.standalone-auth .i18n-language-control>span { min-width:0; overflow-wrap:anywhere; }
html.standalone-auth .i18n-language-control>[data-i18n-language-picker] {
  appearance:auto; -webkit-appearance:menulist; min-width:0; max-width:100%;
  width:auto; min-height:44px; padding:9px 12px; margin:0; box-sizing:border-box;
  border:1px solid var(--auth-border,#37323f); border-radius:9px;
  background:var(--auth-surface,#15141b); color:var(--auth-text,#f2f0f8);
  font:500 14px/1.4 var(--ui,system-ui); letter-spacing:normal; cursor:pointer;
}
html.standalone-auth .i18n-language-control>[data-i18n-language-picker]:focus-visible {
  outline:2px solid var(--auth-link,#bea5ff); outline-offset:3px;
}
@media(max-width:900px) {
  /* Language names remain native and get full touch targets in the toolbar. */
  html body #smenu { width:220px; max-width:calc(100vw - 16px); box-sizing:border-box; }
  html body #smenu>button { min-height:44px; padding:10px 12px; font-size:14px; line-height:1.4; }
  /* A translated action must not force the phone form header past its edge. */
  html body .trade-editor-mask .trade-create-head { flex-wrap:wrap; gap:12px; }
  html body .trade-editor-mask .trade-create-head>h2 { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  html body .trade-editor-mask .trade-create-head>[data-spot-import] {
    flex:0 1 auto; max-width:100%; height:auto; min-height:44px;
    padding-top:10px; padding-bottom:10px; overflow-wrap:anywhere;
  }
  html body .account-modal .acct-nv { min-width:0; overflow-wrap:anywhere; }
  html #view#view#view table.mobile-financial-list tr>:is(td,th)[data-i18n-label]::before {
    content:attr(data-i18n-label);
  }
}

/* Existing generated labels need the same source-aware translations as DOM text. */
html .side.lock .navlab[data-i18n-label]::before,
html .side:not(.lock) #nav > .navlab[data-i18n-label]::before {
  content:attr(data-i18n-label);
}
/* Phone reports keep their translated labels in a local scroll surface.
   Desktop widths belong to fitReportColumns; overriding them with max-content
   breaks both reports and splits headings even in the source language. */
@layer number-alignment {
  @media(max-width:900px) {
    html #view#view :is(.repbox,.monthly-setup-table) table {
      table-layout:auto!important; width:max-content!important; min-width:100%!important;
    }
    html #view#view :is(.repbox,.monthly-setup-table) thead th {
      min-width:128px!important; max-width:150px!important; height:auto!important;
      white-space:normal!important; overflow-wrap:anywhere!important; hyphens:none!important;
      line-height:1.4!important; padding-top:10px!important; padding-bottom:10px!important;
    }
  }
}
