/* V28 — sélecteur « Langue de l'interface utilisateur » */
:root {
  --lp-bg: #ffffff; --lp-text: #1f1e1c; --lp-muted: #7a776e; --lp-line: #e6e2d6;
  --lp-hover: #f4f2ec; --lp-sel-bg: #e8f0fe; --lp-sel-text: #1a56db; --lp-sel-ring: #b9cffb;
  --lp-shadow: 0 18px 48px rgba(20, 18, 12, .16), 0 2px 6px rgba(20, 18, 12, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lp-bg: #262522; --lp-text: #f1efe8; --lp-muted: #a8a49a; --lp-line: #3a3833;
    --lp-hover: #2f2e2a; --lp-sel-bg: rgba(59, 130, 246, .18); --lp-sel-text: #93c5fd; --lp-sel-ring: rgba(147, 197, 253, .35);
    --lp-shadow: 0 18px 48px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --lp-bg: #262522; --lp-text: #f1efe8; --lp-muted: #a8a49a; --lp-line: #3a3833;
  --lp-hover: #2f2e2a; --lp-sel-bg: rgba(59, 130, 246, .18); --lp-sel-text: #93c5fd; --lp-sel-ring: rgba(147, 197, 253, .35);
  --lp-shadow: 0 18px 48px rgba(0, 0, 0, .5);
}

.languageControl.lpControl { position: relative; padding: 0; gap: 0; }
.lpControl select[hidden], .lpControl > span[hidden] { display: none !important; }
.lpTrigger {
  display: inline-flex; align-items: center; gap: 8px; height: 100%; min-height: 36px;
  padding: 0 10px 0 12px; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: inherit;
}
.lpTrigger:focus-visible { outline: 2px solid var(--lp-sel-text); outline-offset: 2px; }
.lpTriggerName { color: var(--lp-text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpChevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .15s ease; }
.lpNotice {
  position: fixed; z-index: 10001; width: max-content; max-width: min(280px, calc(100vw - 32px));
  padding: 8px 12px; border-radius: 10px; background: #b42318; color: #fff; font-size: 12.5px; font-weight: 500;
  line-height: 1.4; box-shadow: var(--lp-shadow); white-space: normal;
}
.lpNotice[hidden] { display: none; }
.lpBusy { display: none; align-items: center; gap: 6px; color: var(--lp-muted); font-weight: 500; font-size: 12.5px; }
.lpLoading .lpBusy { display: inline-flex; }
.lpLoading .lpTriggerName { display: none; }
.lpLoading .lpTrigger { cursor: progress; }
.lpSpinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--lp-line);
  border-top-color: var(--lp-sel-text); animation: lpSpin .8s linear infinite;
}
@keyframes lpSpin { to { transform: rotate(360deg); } }
.lpControl.isOpen .lpChevron { transform: rotate(180deg); }

.lpFlag {
  flex: none; width: 24px; height: 18px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.lpTriggerFlag { display: inline-flex; }
.lpFlagGlobe { display: inline-grid; place-items: center; background: var(--lp-hover); box-shadow: none; color: var(--lp-muted); }
.lpFlagGlobe svg, .lpHead svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.lpPanel {
  position: fixed; z-index: 10000;
  width: min(360px, calc(100vw - 32px)); background: var(--lp-bg); color: var(--lp-text);
  border: 1px solid var(--lp-line); border-radius: 16px; box-shadow: var(--lp-shadow);
  overflow: hidden; animation: lpIn .14s ease both; text-align: start;
}
.lpPanel[hidden] { display: none; }
@keyframes lpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.lpHead {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px 12px;
  font-size: 13px; font-weight: 700; color: var(--lp-text); border-bottom: 1px solid var(--lp-line);
}
.lpHead svg { width: 18px; height: 18px; color: var(--lp-sel-text); }
.lpList {
  list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60vh); overflow-y: auto;
  overscroll-behavior: contain; outline: none; scrollbar-width: thin;
}
.lpItem {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1.3;
}
.lpItem:hover, .lpItem.isActive { background: var(--lp-hover); }
.lpNative { font-weight: 700; color: var(--lp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpFrench { color: var(--lp-muted); font-size: 13px; white-space: nowrap; }
.lpItem.isSelected { background: var(--lp-sel-bg); box-shadow: inset 0 0 0 1px var(--lp-sel-ring); }
.lpItem.isSelected .lpNative, .lpItem.isSelected .lpFrench { color: var(--lp-sel-text); }
.lpSeparator {
  margin: 8px 10px 4px; padding-top: 10px; border-top: 1px solid var(--lp-line);
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lp-muted);
}

/* Téléphone : le menu s'ouvre en panneau depuis le bas de l'écran. */
@media (max-width: 640px) {
  .lpTriggerName { max-width: 110px; }
  body.lpOpen::after {
    content: ""; position: fixed; inset: 0; z-index: 9999; background: rgba(15, 14, 10, .38);
  }
  .lpPanel {
    inset: auto 0 0 0 !important; width: auto; border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .lpList { max-height: 65vh; }
  .lpItem { padding: 12px 10px; }
}
