:root {
  --lf-btn-size: 64px;
  --lf-gap: 8px;
  --lf-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  --lf-x: calc(100vw - var(--lf-btn-size) - 16px);
  --lf-y: calc(50vh - var(--lf-btn-size) / 2);
  --lf-btn-bg: rgba(255, 255, 255, 0.92);
}

.lf-btn {
  position: fixed;  
  left: var(--lf-x);
  top: var(--lf-y);
  width: var(--lf-btn-size);
  height: var(--lf-btn-size);
  border-radius: 50%;
  background: var(--lf-btn-bg);
  backdrop-filter: blur(6px);
  place-items: center;
  border: 0;
  box-shadow: var(--lf-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .08s ease, box-shadow .2s ease;
  z-index: 1000;
  touch-action: none;
}

.lf-btn:active {
  cursor: grabbing;
}

.lf-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  gap: var(--lf-gap);
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: var(--lf-shadow);
  z-index: 1000;
}

.lf-menu.is-open {
  display: flex;
}

.lf-menu.open-left {
  left: calc(var(--lf-x) - 12px);
  top: calc(var(--lf-y) + var(--lf-btn-size) / 2);
  transform: translate(-100%, -50%);
}

.lf-menu.open-right {
  left: calc(var(--lf-x) + var(--lf-btn-size) + 12px);
  top: calc(var(--lf-y) + var(--lf-btn-size) / 2);
  transform: translate(0, -50%);
}

.lf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-width: 180px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}

.lf-item:hover {
  background: #f7f7f7;
}

.lf-item.is-active {
  background: #f9fbff;
  border-color: #dbe7ff;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.02),
    0 0 0 3px rgba(38, 132, 255, 0.12);
}

.lf-item.is-active .lf-flag .fi {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

.lf-item:focus-visible {
  outline: 2px solid #2684ff;
  outline-offset: 2px;
  background: #f3f8ff;
}


.lf-flag {
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lf-flag .fi {
  width: 20px;
  height: 14px;
  border-radius: 2px;
}