/* PACOBS language picker — flag + dropdown (public + dashboard) */
.app-topbar-right,
.pacobs-lang-picker-mount--dash {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pacobs-lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1200;
}

.pacobs-lang-picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pacobs-lang-picker__btn:hover,
.pacobs-lang-picker__btn[aria-expanded='true'] {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(30, 41, 59, 0.9);
}

.pacobs-lang-picker__flag {
  font-size: 1.15rem;
  line-height: 1;
}

.pacobs-lang-picker__code {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pacobs-lang-picker__panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0f172a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  flex-direction: column;
}

.pacobs-lang-picker.is-open .pacobs-lang-picker__panel {
  display: flex;
}

.pacobs-lang-picker__search-wrap {
  padding: 10px 10px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.pacobs-lang-picker__search {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 16px;
}

.pacobs-lang-picker__featured {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.pacobs-lang-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  font-size: 0.72rem;
  cursor: pointer;
  min-height: 32px;
}

.pacobs-lang-picker__chip.is-active,
.pacobs-lang-picker__chip:hover {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.12);
}

.pacobs-lang-picker__list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px;
}

.pacobs-lang-picker__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
}

.pacobs-lang-picker__item:hover,
.pacobs-lang-picker__item.is-active {
  background: rgba(251, 191, 36, 0.1);
}

.pacobs-lang-picker__item-name {
  flex: 1;
}

.pacobs-lang-picker__item-code {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Dashboard fintech variant */
body.dashboard-fintech .pacobs-lang-picker__btn {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.5);
}

@media (max-width: 767.98px) {
  .app-topbar .pacobs-lang-picker__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(var(--app-tabbar-h, 56px) + env(safe-area-inset-bottom, 0px) + 12px);
    width: auto;
    max-height: 55vh;
  }

  body.dashboard-fintech .pacobs-lang-picker__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    max-height: 60vh;
  }
}

html[dir='rtl'] .pacobs-lang-picker__panel {
  right: auto;
  left: 0;
}
