:root {
  --bb-language-ink: #0a0a0a;
  --bb-language-paper: #eeede8;
  --bb-language-muted: #666;
  --bb-language-line: #c9c8c2;
  --bb-language-accent: #78e6a4;
}

.bb-language-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-left: 14px;
}

.bb-language-control--floating {
  position: fixed;
  z-index: 90;
  top: 18px;
  right: 18px;
  margin: 0;
}

.bb-language-trigger {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 1px solid #686868;
  border-radius: 50%;
  background: #080808d9;
  color: #f4f3ef;
  font: 500 11px/1 "DM Sans", Manrope, Arial, sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.bb-language-trigger:hover {
  border-color: #f4f3ef;
  background: #f4f3ef;
  color: #090909;
}

.bb-language-trigger__code {
  min-width: 0;
  color: var(--bb-language-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-align: center;
}

.bb-language-trigger__text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bb-language-trigger:hover .bb-language-trigger__code {
  color: #155d34;
}

.bb-language-trigger:focus-visible,
.bb-language-search__input:focus-visible,
.bb-language-dialog button:focus-visible {
  outline: 3px solid var(--bb-language-accent);
  outline-offset: 3px;
}

body.bb-language-modal-open {
  overflow: hidden;
}

.bb-language-dialog {
  width: min(660px, calc(100vw - 28px));
  max-width: none;
  max-height: min(780px, calc(100dvh - 28px));
  padding: 0;
  border: 1px solid #303030;
  border-radius: 2px;
  background: var(--bb-language-paper);
  color: var(--bb-language-ink);
  box-shadow: 0 30px 110px #000d;
  overflow: hidden;
  overscroll-behavior: contain;
}

.bb-language-dialog[open] {
  display: flex;
  flex-direction: column;
}

.bb-language-dialog::backdrop {
  background: #000c;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.bb-language-dialog--fallback {
  position: fixed;
  z-index: 250;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax #000c, 0 30px 110px #000d;
}

.bb-language-dialog__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 27px 23px;
  border-bottom: 1px solid #303030;
  background: #090909;
  color: #fff;
}

.bb-language-dialog__eyebrow {
  margin: 0 0 9px;
  color: #9b9b9b;
  font: 500 9px/1.2 "DM Sans", Manrope, Arial, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.bb-language-dialog__header h2 {
  margin: 0;
  color: #fff;
  font: 500 clamp(25px, 4vw, 34px)/1.05 Manrope, "DM Sans", Arial, sans-serif;
  letter-spacing: -.035em;
}

.bb-language-dialog__close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid #555;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: 300 25px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.bb-language-dialog__close:hover {
  border-color: #fff;
  background: #fff;
  color: #090909;
}

.bb-language-dialog__body {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 24px 27px 25px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bb-language-dialog__description {
  margin: 0 0 19px;
  color: #4f4f4f;
  font: 400 13px/1.55 "DM Sans", Manrope, Arial, sans-serif;
}

.bb-language-search {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}

.bb-language-search__label {
  color: #242424;
  font: 600 11px/1.25 "DM Sans", Manrope, Arial, sans-serif;
  letter-spacing: .04em;
}

.bb-language-search__input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #777;
  border-radius: 2px;
  background: #fff;
  color: #111;
  font: 500 15px/1.3 "DM Sans", Manrope, Arial, sans-serif;
  appearance: none;
}

.bb-language-search__input::placeholder {
  color: #686868;
  opacity: 1;
}

.bb-language-search__input::-webkit-search-cancel-button {
  cursor: pointer;
}

.bb-language-search-status {
  min-height: 18px;
  margin: 0 0 8px;
  color: #555;
  font: 500 10px/1.4 "DM Sans", Manrope, Arial, sans-serif;
}

.bb-language-list {
  min-height: 130px;
  max-height: min(380px, 42dvh);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  border-top: 1px solid var(--bb-language-line);
  border-left: 1px solid var(--bb-language-line);
  background: #f7f6f2;
  overflow-y: auto;
  scrollbar-color: #777 #deddd8;
  scrollbar-width: thin;
}

.bb-language-option {
  min-width: 0;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  padding: 11px 13px;
  border: 0;
  border-right: 1px solid var(--bb-language-line);
  border-bottom: 1px solid var(--bb-language-line);
  background: transparent;
  color: #111;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.bb-language-option:hover,
.bb-language-option:focus-visible {
  background: #deddd7;
}

.bb-language-option[aria-selected="true"] {
  background: #0b0b0b;
  color: #fff;
}

.bb-language-option[aria-selected="true"]:hover,
.bb-language-option[aria-selected="true"]:focus-visible {
  background: #1b1b1b;
}

.bb-language-option__name {
  max-width: 100%;
  overflow: hidden;
  font: 500 15px/1.15 "DM Sans", Manrope, Arial, sans-serif;
  overflow-wrap: anywhere;
}

.bb-language-option__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #686868;
  font: 500 9px/1.2 "DM Sans", Manrope, Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bb-language-option__code {
  color: #333;
  font-weight: 700;
}

.bb-language-option__kind {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-language-option[aria-selected="true"] .bb-language-option__meta,
.bb-language-option[aria-selected="true"] .bb-language-option__code {
  color: var(--bb-language-accent);
}

.bb-language-option[data-available="false"] {
  background: #ecebe6;
  color: #3d3d3d;
  cursor: help;
}

.bb-language-option[data-available="false"]:hover,
.bb-language-option[data-available="false"]:focus-visible {
  background: #deddd7;
}

.bb-language-option[data-available="false"] .bb-language-option__kind {
  color: #76551d;
  font-weight: 700;
}

.bb-language-empty {
  margin: 0;
  padding: 22px 16px;
  border: 1px solid var(--bb-language-line);
  background: #f7f6f2;
  color: #4f4f4f;
  font: 500 12px/1.5 "DM Sans", Manrope, Arial, sans-serif;
  text-align: center;
}

.bb-language-empty[hidden] {
  display: none;
}

.bb-language-action-status {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #278451;
  background: #dce9df;
  color: #163d27;
  font: 500 11px/1.45 "DM Sans", Manrope, Arial, sans-serif;
}

.bb-language-action-status:empty {
  display: none;
}

.bb-language-privacy {
  margin: 13px 0 0;
  color: #5c5c5c;
  font: 400 10px/1.5 "DM Sans", Manrope, Arial, sans-serif;
}

@media (max-width: 1180px) {
  .site-header .bb-language-control {
    margin-left: 10px;
  }
}

@media (max-width: 800px) {
  .site-header .bb-language-control {
    margin-left: 0;
  }

  .bb-language-dialog {
    max-height: calc(100dvh - 18px);
  }

  .bb-language-dialog__header {
    padding: 21px 20px 19px;
  }

  .bb-language-dialog__body {
    padding: 20px;
  }

  .bb-language-list {
    max-height: 43dvh;
  }
}

@media (max-width: 520px) {
  .bb-language-control--floating {
    top: 12px;
    right: 12px;
  }

  .bb-language-dialog {
    width: calc(100vw - 16px);
  }

  .bb-language-dialog__description {
    font-size: 12px;
  }

  .bb-language-search__input {
    font-size: 16px;
  }

  .bb-language-list {
    grid-template-columns: 1fr;
    max-height: 44dvh;
  }

  .bb-language-option {
    min-height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-language-trigger,
  .bb-language-dialog__close,
  .bb-language-option {
    transition: none;
  }
}
