/* Bascule de société dans l'en-tête mobile. */
.m-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.m-header-right .m-header-logo {
  margin-left: 0;
  min-width: 0;
}

.m-header-right .brand-word {
  max-width: 96px;
  height: auto;
}

.m-company-menu {
  display: none;
  position: relative;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .m-company-menu {
    display: block;
  }
}

.m-company-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 2px 2px 2px 4px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
}

.m-company-trigger::-webkit-details-marker {
  display: none;
}

.m-company-trigger .company-switch-btn {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.m-company-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.18s ease;
}

.m-company-menu[open] .m-company-caret {
  transform: rotate(180deg);
}

.m-company-panel {
  position: fixed;
  top: calc(var(--m-header-h) + env(safe-area-inset-top, 0px) + 6px);
  left: 10px;
  right: 10px;
  z-index: 70;
  max-height: calc(100vh - var(--m-header-h) - env(safe-area-inset-top, 0px) - 24px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.m-company-panel-title {
  margin: 4px 8px 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.m-company-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.m-company-row:hover,
.m-company-row:focus-visible,
.m-company-row.is-on {
  background: var(--blue-pale);
  color: var(--ink);
  text-decoration: none;
}

.m-company-row .company-switch-btn {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.m-company-row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.m-company-row-text b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-company-row-text small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.m-company-check {
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.m-company-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 11px 8px 6px;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.m-company-add:hover {
  color: var(--blue);
  text-decoration: none;
}

.m-company-add svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 380px) {
  .m-header-right .brand-word {
    display: none;
  }
}
