/* Native <select> inherits the site's light text; the OS dropdown is white. */
select.language-switcher,
select.language-switcher:focus,
select.language-switcher:focus-visible {
  color: #f2f4ef;
  background-color: #0d1418;
}

select.language-switcher option,
select.language-switcher optgroup {
  color: #141414 !important;
  background-color: #ffffff !important;
}

select.language-switcher option:checked,
select.language-switcher option:hover,
select.language-switcher option:focus {
  color: #141414 !important;
  background-color: #d9e4ff !important;
}

html, body {
  overflow-x: clip;
}

select.language-switcher,
select.locale-select {
  min-height: 44px;
  min-width: 7.5rem;
  max-width: min(42vw, 11rem);
  padding: 0.35rem 0.55rem;
  font-size: 16px;
  border: 1px solid #505443;
  border-radius: 3px;
}

.chat-fab,
.messages-link--floating {
  z-index: 80;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  min-height: 52px !important;
  min-width: 52px;
  padding: 14px 18px !important;
  font-size: 16px !important;
}

html.crm-chat-open .chat-fab,
html.crm-chat-open .messages-link--floating,
html.crm-chat-open .chat-nudge,
body.crm-chat-open .chat-fab,
body.crm-chat-open .messages-link--floating,
body.crm-chat-open .chat-nudge {
  display: none !important;
}

.crm-ios-hint,
.crm-install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 120;
  display: none !important;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #171e1d;
  color: #e8d4ae;
  border: 1px solid #a89169;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 12px 40px #0008;
}

.crm-ios-hint p,
.crm-install-hint p {
  margin: 0;
  flex: 1;
}

.crm-install-hint strong {
  display: block;
  color: #f3e6c8;
  margin-bottom: 4px;
  font-size: 15px;
}

.crm-install-hint-actions,
.crm-ios-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-ios-hint button,
.crm-install-hint button {
  min-height: 44px;
  padding: 0 14px;
  color: #0b0f14;
  background: #d4b67c;
  border: 0;
  font: inherit;
  font-weight: 650;
}

.crm-install-hint button[data-crm-install-later] {
  color: #d6c09b;
  background: transparent;
  border: 1px solid #505443;
  font-weight: 500;
}

html.crm-chat-open .crm-ios-hint,
html.crm-chat-open .crm-install-hint,
body.crm-chat-open .crm-ios-hint,
body.crm-chat-open .crm-install-hint,
.crm-install-hint,
.crm-ios-hint,
.crm-install-section,
[data-crm-install-nav],
.visitor-chat-heading [data-crm-install-chat] {
  display: none !important;
}

#visitor-chat:has(form.visitor-contact) [data-crm-form-card],
#visitor-chat:has(form.visitor-contact) [data-crm-form-fallback],
#visitor-chat:has(form.visitor-contact) [data-crm-install-card] {
  display: none !important;
}

.crm-install-section {
  background: #171e1d;
  border-top: 1px solid #374034;
  border-bottom: 1px solid #374034;
}

.crm-install-section [data-crm-install-how] {
  color: #b0b9b1;
  max-width: 640px;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
}

.crm-install-page-btn {
  min-height: 52px;
  padding: 14px 22px;
  font-size: 16px;
  cursor: pointer;
}

.crm-install-done {
  color: #d6c09b;
  margin: 16px 0 0;
}

#main-navigation a[href="#apply"],
header nav a[href="#apply"],
.header-inner nav a[href="#apply"] {
  display: none !important;
}

.visitor-chat-heading .crm-install-chat-btn,
#visitor-chat .crm-install-chat-btn {
  min-width: auto !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  margin-inline-start: auto;
  color: #0c1014 !important;
  background: #d4b67c !important;
  border: 1px solid #c9ab74 !important;
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chat-install-card,
[data-crm-form-fallback],
.chat-install-card .chat-form-action,
[data-crm-form-card] .chat-form-action {
  pointer-events: auto !important;
  position: relative;
  z-index: 6;
}

.chat-install-card {
  margin: 0.6rem 0 0.9rem;
  padding: 0.95rem 1rem 1rem;
  background: #1c272b;
  border: 1px solid #a18a5f;
  border-inline-start: 3px solid #c7ad79;
  color: #f1f1ec;
}

.chat-install-card strong {
  display: block;
  color: #dcc595;
  margin-bottom: 0.45rem;
  font-size: 0.98rem;
}

.chat-install-card p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.chat-install-card .chat-form-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  margin: 0.25rem 0 0;
  border: 1px solid #d8bf8e;
  border-radius: 3px;
  background: #ceb787;
  color: #11191e;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.chat-install-card .chat-form-action:hover:not(:disabled) {
  background: #e0ca9d;
}

@media (max-width: 850px) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  select.language-switcher,
  .header-inner .language-switcher,
  .header-inner .locale-select {
    display: inline-block !important;
    max-width: min(46vw, 12rem);
  }

  .hero-actions .hero-apply,
  .hero-actions .primary-link,
  .chat-cta,
  .period-option,
  .country-picker button {
    min-height: 48px;
  }

  .calculator-layout,
  .offer-facts,
  .offer-perks,
  .offer-entry,
  .apply-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  input, select, textarea, button {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .chat-nudge {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
  }

  html[dir=rtl] .chat-fab,
  html[dir=rtl] .messages-link--floating {
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
  }
}
