/* Language controls and direction-aware overrides, loaded after mobile.css. */
.language-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #8b754950;
  border-radius: 13px;
  background: #d5b46a0c;
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.language-toggle:hover { border-color: #d4b66d; background: #d5b46a18; }
.language-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.language-toggle svg { width: 18px; height: 18px; }
.language-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 16px; }
.language-option {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: start;
  font-size: 14px;
  line-height: 1.6;
}
.language-option small { color: var(--muted); font-size: 12px; }
.language-option.active, .language-option[aria-pressed="true"] { border-color: var(--gold-dark); background: #d5b46a12; color: var(--gold-light); }

html[dir="ltr"] { font-family: "Segoe UI", Arial, sans-serif; }
html[dir="ltr"] body { direction: ltr; }
html[dir="ltr"] .page-heading, html[dir="ltr"] .hero-copy,
html[dir="ltr"] .sidebar-nav .nav-item, html[dir="ltr"] table,
html[dir="ltr"] .hero-metric strong { text-align: start; }
html[dir="ltr"] .direction-arrow { transform: rotate(180deg); }
html[dir="ltr"] .wallet-address { direction: ltr; text-align: left; }
html[dir="ltr"] .level-badge { right: auto; left: auto; inset-inline-end: 16px; }
html[dir="ltr"] .stat-icon { right: auto; left: auto; inset-inline-end: 16px; }
html[dir="ltr"] .hero-title { letter-spacing: -.6px; }
html[dir="ltr"] .hero-description, html[dir="ltr"] .page-heading p,
html[dir="ltr"] .card p { overflow-wrap: break-word; }

@media screen and (min-width: 1024px) {
  html[dir="ltr"] .topbar-meta { margin: 0; margin-inline-start: 14px; }
  html[dir="ltr"] .toast { left: 258px; right: 30px; }
}

@media screen and (min-width: 1280px) {
  html[dir="ltr"] .stat-icon { inset-inline-end: 18px; }
  html[dir="ltr"] .toast { left: 276px; right: 30px; }
}

@media screen and (max-width: 1023px) {
  .topbar-title, .mobile-brand, .mobile-brand > span { min-width: 0; }
  .mobile-brand small { overflow-wrap: anywhere; }
  .language-toggle { min-height: 44px; padding-inline: 9px; font-size: 12px; }
  html[dir="ltr"] .home-stats .stat-card:first-child .stat-icon { left: auto; right: auto; inset-inline-end: 18px; }
  html[dir="ltr"] .home-hero .hero-title { font-size: clamp(21px, 5.6vw, 26px); line-height: 1.35; }
  html[dir="ltr"] .home-hero .hero-mobile-description { font-size: 12px; line-height: 1.7; }
  html[dir="ltr"] .home-hero .hero-actions .button { min-height: 48px; font-size: 12px; }
  html[dir="ltr"] .home-stats .stat-card:not(:first-child) .stat-label { white-space: normal; min-height: 32px; font-size: 10px; line-height: 1.6; }
  html[dir="ltr"] .quick-action > strong { font-size: 12px; }
  html[dir="ltr"] .mobile-nav .nav-item { font-size: 10.5px; }
  html[dir="ltr"] .network-badge { white-space: normal; }
  html[dir="ltr"] .referral-mobile-values dt { font-size: 10px; }
  html[dir="ltr"] .team-requirements > .list-row { font-size: 12px; }
  html[dir="ltr"] .level-badge { inset-inline-end: 18px; }
}

@media screen and (max-width: 430px) {
  .topbar-actions > .avatar { display: none; }
  .topbar-actions { gap: 6px; }
  .mobile-brand { gap: 8px; }
  html[dir="ltr"] .quick-action { gap: 5px 8px; }
}

@media screen and (max-width: 359px) {
  .language-toggle { padding-inline: 8px; }
  html[dir="ltr"] .home-hero .hero-title { font-size: 21px; }
  html[dir="ltr"] .home-hero .hero-actions .button { padding-inline: 6px; font-size: 11px; }
  html[dir="ltr"] .home-stats .stat-card:not(:first-child) .stat-value { font-size: 18px; }
  html[dir="ltr"] .quick-action > .muted { font-size: 9px; }
}
