/* Language controls and logical layout share the existing visual vocabulary. */
.sidebar .primary-navigation { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.language-picker.mobile-language { display: none; }
.language-picker { display: inline-flex; align-items: center; flex-shrink: 0; }
.language-picker select {
  min-width: 102px;
  min-height: 40px;
  width: auto;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 650;
  background-color: var(--white);
}

/* An inset chevron leaves a consistent text gutter in every select. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23142f36' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-inline-start: 13px;
  padding-inline-end: 40px;
  line-height: 1.5;
  text-overflow: ellipsis;
}
.result-controls { min-width: 0; }
.result-controls select { min-height: 44px; }
.profile-fields select, .workspace-strip select, .quote-filter-bar select,
.budget-layout .form-label select { padding-inline-end: 40px; }
.brand, .mobile-brand, .footer-brand { direction: ltr; unicode-bidi: isolate; }
.offer-mark { direction: ltr; unicode-bidi: isolate; }
input[type="number"], input[type="date"], input[type="email"], input[type="url"] {
  direction: ltr;
  unicode-bidi: isolate;
}
input[type="text"], input[type="search"], textarea { unicode-bidi: plaintext; }
.offer-heading-wrapper, .category-copy, .ribbon-copy { min-width: 0; }

/* Arabic letters stay joined: tracking is reserved for the Latin wordmark. */
html[lang="ar"] { font-family: "Noto Sans Arabic", Tahoma, "Segoe UI", Arial, sans-serif; }
html[lang="ar"] :is(h1,h2,h3,h4,.eyebrow,.category-kicker,.category-copy strong,
  .hero-title-city,.ribbon-copy,.page-heading h1,.profile-cover h1,
  .profile-editor-form legend,.profile-perspective h2,.project-snapshot h2,
  .living-price,.offer-price,.budget-big,.snapshot-budget strong,.source-tag,
  .hero-route-stamp > strong,.hero-route-stamp > span,.wizard-steps > span) {
  letter-spacing: 0;
}
html[lang="ar"] .hero.hero-photographic h1 { line-height: 1.3; font-size: clamp(48px, 5.3vw, 72px); }
html[lang="ar"] .hero-title-city { font-size: 15px; line-height: 1.8; }
html[lang="ar"] :is(.page-heading h1,.profile-cover h1) { line-height: 1.4; }
html[lang="ar"] :is(.project-snapshot h2,.profile-perspective h2,.modal-title) { line-height: 1.45; }
html[lang="ar"] .hero-route-stamp > strong { font-size: 21px; line-height: 1.35; }
html[dir="rtl"] select:not([multiple]):not([size]) { background-position: left 14px center; }
html[dir="rtl"] :is(.ribbon-item,.wizard-option,.quote-table td,.quote-table th,
  .comparison-table td,.comparison-table th,.panel-heading .text-button) { text-align: start; }
html[dir="rtl"] .hero.hero-photographic .hero-photo { inset: 18px auto 0 0; }
html[dir="rtl"] .hero.hero-photographic .hero-copy { padding-inline-start: 0; padding-inline-end: 28px; }
html[dir="rtl"] .hero-orbit { left: auto; right: 43%; transform: scaleX(-1); }
html[dir="rtl"] .hero-route-stamp { right: auto; left: 5%; transform: rotate(-6deg); }
html[dir="rtl"] .hero-photo-caption { right: auto; left: 78px; }
html[dir="rtl"] .ribbon-item + .ribbon-item::before { left: auto; right: 0; border-left: 0; border-right: 1px solid #476168; }
html[dir="rtl"] .ribbon-arrow { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .directory-toolbar > label .icon { left: auto; right: 15px; }
html[dir="rtl"] .directory-toolbar > label input { padding-left: 12px; padding-right: 42px; }
html[dir="rtl"] .profile-budget > span:last-child { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .profile-editor-form legend { float: right; }
html[dir="rtl"] .profile-editor-form legend span { margin-right: 0; margin-inline-end: 12px; }
html[dir="rtl"] .profile-cutout { left: auto; right: 43%; transform: scaleX(-1); }
html[dir="rtl"] .amount-input > span { padding-right: 0; padding-inline-end: 12px; }
html[dir="rtl"] :is(.clean-list li,.detail-list,.comparison-table ul) { padding-left: 0; padding-inline-start: 20px; }
html[dir="rtl"] .clean-list li::before { left: auto; right: 0; }
html[dir="rtl"] .offer-header { padding-right: 0; padding-left: 25px; }
html[dir="rtl"] .favorite-button, html[dir="rtl"] .cards.list-view .favorite-button { right: auto; left: 14px; }
html[dir="rtl"] .cards.list-view .offer-actions { border-left: 0; border-inline-start: 1px solid var(--line); padding-left: 0; padding-inline-start: 17px; }
html[dir="rtl"] .offer-price small { margin-left: 0; margin-inline-start: 4px; }
html[dir="rtl"] #tray-chips { margin-right: 0; margin-inline-end: auto; }
html[dir="rtl"] .danger-link { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .quote-filter-bar .small-muted { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .main-footer a { text-align: start; }

@media (min-width: 801px) and (max-width: 1100px) {
  .sidebar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; padding-block: 12px; }
  .sidebar > .brand { grid-column: 1; grid-row: 1; }
  .sidebar > .header-tools { grid-column: 2; grid-row: 1; justify-self: end; }
  .sidebar .primary-navigation { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .sidebar .nav-item { padding-inline: 8px; }
  .header-tools { gap: 7px; }
  .language-picker select { min-width: 88px; font-size: 11px; padding-inline-start: 11px; }
  .project-aside, .profile-perspective, .budget-summary { top: 145px; }
  #page-profil [id], .category-context { scroll-margin-top: 150px; }
  html[dir="rtl"] .cards.list-view .offer-actions { border-inline-start: 0; padding-inline-start: 0; }
  html[dir="rtl"] .cards.list-view .offer-actions .text-button { margin-right: 0; margin-inline-end: auto; }
}
@media (max-width: 800px) {
  .topbar-actions { gap: 10px; min-width: 0; }
  .language-picker.mobile-language { display: inline-flex; }
  .mobile-language select { min-width: 94px; max-width: 98px; min-height: 38px; padding-inline-start: 11px; padding-inline-end: 30px; background-position: right 10px center; background-size: 12px; }
  html[dir="rtl"] .mobile-language select { background-position: left 10px center; }
  html[dir="rtl"] .sidebar { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid #adbcb4; transform: translateX(105%); box-shadow: -5px 0 25px #142f3626; }
  html[dir="rtl"] .sidebar.open { transform: translateX(0); }
  html[dir="rtl"] .drawer-close { right: auto; left: 14px; }
  html[dir="rtl"] .sidebar .brand { margin-left: 0; margin-right: 9px; align-self: flex-start; }
  html[dir="rtl"] .sidebar .small-count { margin-left: 0; margin-inline-start: auto; }
  html[dir="rtl"] .hero.hero-photographic .hero-photo { inset: 15px auto 0 0; }
  html[dir="rtl"] .hero-route-stamp { left: 3%; }
  html[dir="rtl"] .hero-photo-caption { left: 42px; }
  html[dir="rtl"] .cards.list-view .offer-actions { border-inline-start: 0; padding-inline-start: 0; }
  html[dir="rtl"] .cards.list-view .offer-actions .text-button { margin-right: 0; margin-inline-end: auto; }
}
@media (max-width: 620px) {
  .topbar-actions { gap: 7px; }
  .topbar-left { min-width: 0; }
  .result-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .result-controls select { width: 100%; max-width: 100%; font-size: 12px; }
  #sort { grid-column: 1 / -1; }
  html[lang="ar"] .hero.hero-photographic h1 { font-size: clamp(42px, 11vw, 60px); }
  html[dir="rtl"] .hero.hero-photographic .hero-copy { padding-inline: 0; }
  html[dir="rtl"] .hero.hero-photographic .hero-photo { inset: auto; }
  html[dir="rtl"] .hero-orbit { right: 3%; }
  html[dir="rtl"] .hero-photo-caption { left: 54px; }
  html[dir="rtl"] .profile-cutout { right: auto; left: 5%; }
  html[dir="rtl"] .offer-header, html[dir="rtl"] .cards.list-view .offer-header { padding-right: 0; padding-left: 25px; }
  html[dir="rtl"] .compare-tray #tray-chips { margin: 0; }
  html[dir="rtl"] .profile-editor-form legend span { margin-inline-end: 9px; }
  html[dir="rtl"] .quote-filter-bar .small-muted { margin: 0; }
}
@media (max-width: 360px) {
  .topbar .mobile-brand { gap: 5px; }
  .topbar .mobile-brand > img { width: 27px; height: 27px; }
  .topbar .mobile-brand > span { font-size: 10px; }
  .topbar #launch-wizard { font-size: 10px; gap: 4px; }
  .mobile-language select { min-width: 88px; max-width: 94px; font-size: 11px; }
  .topbar-actions { gap: 5px; }
  .topbar .wizard-link-short { display: none; }
  .topbar #launch-wizard { min-width: 30px; min-height: 40px; justify-content: center; }
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]) { appearance: auto; background-image: none; padding-inline-end: 12px; }
}

.source-date { display: block; font-size: 11px; color: var(--muted); margin-top: 9px; }
html[dir="rtl"] .offer-price small { margin-inline: 6px 0; }

.profile-editor-form .field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; }
.profile-editor-form .field-label .small-muted { font-size: 10px; font-weight: 400; }
