/* Compact shared language picker; labels remain available to screen readers. */
.hr-language-picker { position: relative; display: inline-block; color: #1b3024; font-size: 13px; line-height: 1.4; letter-spacing: normal; text-transform: none; }
.hr-language-picker summary { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 8px; border-radius: 8px; cursor: pointer; list-style: none; font-weight: 500; transition: background-color .15s ease; }
.hr-language-picker summary::-webkit-details-marker { display: none; }
.hr-language-picker summary::after { content: ""; width: 5px; height: 5px; margin-inline-start: 2px; border-inline-end: 1px solid currentColor; border-block-end: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .55; }
.hr-language-picker summary:hover, .hr-language-picker[open] summary { background: rgba(27, 48, 36, .045); }
.hr-language-current { color: #505b53; font-weight: 500; }
/* The homepage navigation sits directly over myRunID's dark hero. */
.myrun-site.mr-editorial .myrun-nav .hr-language-picker,
.myrun-site.mr-editorial .myrun-nav .hr-language-current { color: #fff; }
.myrun-site.mr-editorial .myrun-nav .hr-language-picker summary:hover,
.myrun-site.mr-editorial .myrun-nav .hr-language-picker[open] summary { background: rgba(255, 255, 255, .12); }
.hr-language-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 1100; box-sizing: border-box; width: min(280px, calc(100vw - 32px)); padding: 12px; border: 1px solid #e3e6df; border-radius: 12px; background: #fff; color: #1b3024; box-shadow: 0 8px 28px #10231714; text-align: start; }
.hr-language-panel form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0; }
.hr-language-select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 36px; font-size: 16px; padding: 6px 8px; border: 1px solid #dce0d6; border-radius: 7px; background: white; color: #1b3024; }
.hr-language-save { width: auto; max-width: 110px; min-height: 36px; padding: 6px 12px; margin: 0; border: 0; border-radius: 7px; background: #c9a24d; color: #16271d; font-size: 13px; line-height: 1.3; font-weight: 600; white-space: normal; cursor: pointer; }
.hr-language-picker :is(summary, select, input[type="submit"]):focus-visible { outline: 2px solid #9a762d; outline-offset: 3px; }
.hr-language-status { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.hr-language-status:empty { display: none; }
.hr-language-save:disabled { opacity: .6; cursor: wait; }
html[dir="rtl"] .myrun-site { font-family: "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif; }
html[dir="rtl"] .myrun-brand, html[dir="rtl"] .myrun-brand em, .hr-language-current { unicode-bidi: isolate; }
html[dir="rtl"] .myrun-brand { direction: ltr; }
@media(max-width: 600px) { .hr-language-current { display: none; } .myrun-site .myrun-nav { flex-wrap: wrap; } .myrun-site .myrun-nav-links { flex-wrap: wrap; margin-inline-start: auto; } .hr-language-panel { position: fixed; inset-inline-start: auto; inset-inline-end: 16px; top: 76px; width: min(280px, calc(100vw - 32px)); } }

/* Latin identifiers retain their order inside right-to-left interfaces. */
.myrun-site .myrun-brand, .me-hero-id { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .mf-return h1, html[dir="rtl"] .mf-welcome-top>p { letter-spacing: normal; }
html[dir="rtl"] .mf-journey li { font-size: 12px; }
html[lang="ja"] .mf-return h1, html[lang="ko"] .mf-return h1, html[lang^="zh"] .mf-return h1 { line-height: 1.2; letter-spacing: -.02em; }

.mf-return h1>span { display: block; text-wrap: balance; }
.mf-return h2, .mc-card-header h1 { text-wrap: balance; }

/* Let translated words wrap within the existing grid instead of widening phones. */
html:not([lang="en"]) .me-passport-inner>*, html:not([lang="en"]) .me-find>* { min-width: 0; }
html:not([lang="en"]) .me-home h2 { overflow-wrap: anywhere; hyphens: auto; }

@media(max-width: 600px) {
  .myrun-site .myrun-nav { height: auto; min-height: 74px; row-gap: 0; }
  .myrun-site .myrun-nav-links { gap: 8px; }
}

/* Preserve the existing heading sizes while allowing translated words to wrap. */
html:not([lang="en"]) :is(.hr-display, .hr-display-sm, .hr-hero-title, .hr-panel-title) { overflow-wrap: anywhere; hyphens: auto; }
html[dir="rtl"] :is(.navbar-brand, .brand-stack, .footer-brand-text) { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] :is(.hr-display, .hr-display-sm, .hr-hero-title, .hr-panel-title) { letter-spacing: normal; }

/* Keep translated sticky actions compact rather than squeezing supporting copy. */
@media(max-width: 600px) {
  html:not([lang="en"]) .hr-sticky-cta > .container { gap: 8px; flex-wrap: wrap; }
  html:not([lang="en"]) .hr-sticky-cta > .container > div:first-child .small { display: none; }
  html:not([lang="en"]) .hr-sticky-cta > .container > div:last-child { max-width: 100%; flex-wrap: wrap; margin-inline-start: auto; }
  html:not([lang="en"]) .hr-sticky-cta .btn { font-size: .75rem; }
}

/* Keep onboarding Back and X at separate edges when reading right to left. */
html[dir="rtl"] .hr-onboard-top > form { position: static; margin: 0; }
html[dir="rtl"] .hr-onboard-top .hr-onboard-x,
html[dir="rtl"] .hr-onboard-brand .hr-onboard-x { position: static; }
html[dir="rtl"] .hr-onboard-top .hr-onboard-back { display: inline-block; transform: scaleX(-1); }
html[dir="rtl"] .hr-onboard-brand > form:has(.hr-onboard-x) { margin-inline-start: auto; }

/* Let long translated action labels wrap without clipping their hit targets. */
.hr-onboard-manual-actions .btn { max-inline-size: 100%; overflow-wrap: anywhere; }

/* On phones, race actions get their own row so names and translations stay readable. */
@media(max-width: 600px) {
  .hr-onboard-result { display: grid !important; grid-template-columns: 96px minmax(0, 1fr); gap: 12px !important; }
  .hr-onboard-result > .flex-shrink-0 { grid-column: 1 / -1; min-inline-size: 0; justify-content: flex-end; }
  .hr-onboard-result > .flex-shrink-0 form { min-inline-size: 0; max-inline-size: 100%; }
  .hr-onboard-result .btn { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* Keep long translated plan features inside the existing three-column cards. */
html:not([lang="en"]) .hr-pricing-plan-highlights { grid-template-columns: minmax(0, 1fr); }
html:not([lang="en"]) .hr-pricing-plan-highlights :is(li, span) { min-inline-size: 0; }
html:not([lang="en"]) .hr-pricing-plan-highlights span { overflow-wrap: anywhere; hyphens: auto; }
html[dir="rtl"] .hr-pricing-plan-highlights { padding-inline-start: 0; }

/* Keep translated metric labels within the existing spotlight cards. */
html:not([lang="en"]) .hr-wall-spotlight-demo__metrics span { overflow-wrap: anywhere; hyphens: auto; }

/* Clip decorative/Bootstrap row overhang without changing the content gutters. */
.hr-spectate-page { overflow-x: clip; }
html:not([lang="en"]) .hr-spectate-page :is(h1, h2, h3) { overflow-wrap: anywhere; hyphens: auto; }

/* Translated state pills keep their width; adjacent demo descriptions can wrap. */
html:not([lang="en"]) .hr-competitive-person > div { min-inline-size: 0; overflow-wrap: anywhere; hyphens: auto; }
html:not([lang="en"]) .hr-competitive-person em { flex-shrink: 0; max-inline-size: 100%; overflow-wrap: anywhere; }

/* Keep the full careers email visible when a translated inquiry label expands. */
html:not([lang="en"]) .hr-careers-hero .card-body > .d-flex { flex-wrap: wrap; gap: .5rem; }

/* The long partnership email gets a full row when the contact card needs it. */
.hr-partners-hero .card-body > .d-flex { flex-wrap: wrap; gap: .5rem; }

/* Translated completion copy must not squeeze the existing 76px progress ring. */
#hrProfileCompletionCard .hr-progress-ring { flex-shrink: 0; }
#hrProfileCompletionCard .hr-progress-ring__inner { max-inline-size: 60px; }
html:not([lang="en"]) #hrProfileCompletionCard .hr-progress-ring__sub { overflow-wrap: anywhere; hyphens: auto; }

/* Availability feedback is a full sentence in some languages, so let it wrap. */
html:not([lang="en"]) #usernameStatusPill { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; text-align: start; }

/* Long translated audience labels may wrap inside the existing segmented row. */
html:not([lang="en"]) #hrPrivacyLastName .btn-group .btn { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }

/* Translated Diary labels wrap within the existing controls on narrow screens. */
html:not([lang="en"]) .hr-trend-card .hr-activity-view-toggle { max-inline-size: 100%; }
html:not([lang="en"]) .hr-trend-card .hr-activity-view-toggle__button { min-inline-size: 0; flex: 1; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
@media(max-width: 576px) {
  html:not([lang="en"]) #profileDiaryTabsContent .hr-status-band { height: auto; min-height: 22px; }
  html:not([lang="en"]) #profileDiaryTabsContent .hr-status-text { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; }
}

/* Keep both translated form actions inside the existing custom-race card. */
html:not([lang="en"]) #customPastRaceCollapse .col-12.d-flex { flex-wrap: wrap; }
html:not([lang="en"]) #customPastRaceCollapse :is(.btn, input[type="submit"]) { max-inline-size: 100%; }

/* Keep translated Diary filter labels within the existing segmented control. */
html:not([lang="en"]) .hr-diary-pref-form { flex-wrap: wrap; }
html:not([lang="en"]) .hr-diary-filter-toggle { min-inline-size: 0; max-inline-size: 100%; }
html:not([lang="en"]) .hr-diary-filter-track { max-inline-size: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html:not([lang="en"]) .hr-diary-filter-option { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; hyphens: auto; line-height: 1.2; text-align: center; }

/* Keep Diary clocks, distances and character counts in numeric reading order. */
html[dir="rtl"] :is(.hr-pb-time, .hr-race-distance, .hr-total-run-heatmap__day-total, .hr-total-run-heatmap__activity-distance, .hr-rmsg-counter) { direction: ltr; unicode-bidi: isolate; }

/* Keep translated follow-list header actions within the existing mobile column. */
html:not([lang="en"]) .hr-follow-list-actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

/* Translated series review controls retain their shape and wrap only as needed. */
html:not([lang="en"]) .hr-review-gate__button {
  white-space: normal;
  overflow-wrap: anywhere;
}
html:not([lang="en"]) #reviewFormCollapse .card-body > form > .d-flex.align-items-center.justify-content-between.mb-2 {
  flex-wrap: wrap;
  gap: .5rem;
}
html:not([lang="en"]) #reviewFormCollapse .card-body > form > .d-flex > .badge {
  max-inline-size: 100%;
  white-space: normal;
  line-height: 1.4;
}
/* Series pages also declare toast styles inline; preserve translated wrapping. */
html:not([lang="en"]) #hr-toast-container .hr-toast {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Translated library card badges wrap within the existing compact card. */
html:not([lang="en"]) .hr-saved-card .badge {
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
