/*
 * BUBLEDUB design system — styles.css
 *
 * Sister brand of RODLEN.COM: the color/line/typography tokens are shared
 * DNA (copied from RODLEN's styles.css), extended with dubbing-service
 * semantics (status colors, progress, pipeline). Dark-first, terminal
 * flavored: IBM Plex Mono for UI, Iceland for display, 1px rules,
 * uppercase tracked labels, square corners everywhere except pills.
 *
 * Fonts are self-hosted (SIL OFL): IBM Plex Mono 400/500 latin+latin-ext,
 * Iceland 400 latin. No Cyrillic subsets shipped — UI copy is EN for now.
 */

@import "./fonts/fonts.css";

/* ------------------------------------------------------------------ tokens */

:root {
  --bg-top: #000000;
  --bg-bottom: #000000;
  --page-bg: #000000;
  --text-color: #ffffff;
  --subtle-text-color: rgba(255, 255, 255, 0.76);
  --strong-text-color: rgba(255, 255, 255, 0.92);
  --soft-text-color: rgba(255, 255, 255, 0.72);
  --muted-text-color: rgba(255, 255, 255, 0.54);
  --label-color: rgba(196, 211, 255, 0.9);
  --line-color: rgba(255, 255, 255, 0.08);
  --line-strong-color: rgba(255, 255, 255, 0.12);
  --line-action-color: rgba(255, 255, 255, 0.14);
  --line-action-hover-color: rgba(255, 255, 255, 0.24);
  --focus-color: rgba(255, 255, 255, 0.86);
  --brand-halo-background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(96, 122, 255, 0.045) 26%,
      rgba(0, 0, 0, 0) 68%
    );
  --brand-halo-opacity: 0.36;
  --brand-logo-shadow: rgba(255, 255, 255, 0.18);
  --brand-text-shadow: rgba(255, 255, 255, 0.08);
  --status-background: rgba(255, 255, 255, 0.02);
  --button-fill: rgba(255, 255, 255, 0.04);
  --button-fill-subtle: rgba(255, 255, 255, 0.02);
  --button-fill-hover: rgba(255, 255, 255, 0.06);
  --scrollbar-color: rgba(255, 255, 255, 0.18);
  /* BUBLEDUB semantics */
  --accent-color: rgba(196, 211, 255, 0.9);
  --accent-dim-color: rgba(196, 211, 255, 0.4);
  --accent-fill: rgba(82, 110, 255, 0.1);
  --ok-color: rgba(158, 235, 192, 0.9);
  --warn-color: rgba(255, 219, 153, 0.9);
  --err-color: rgba(255, 156, 156, 0.9);
  --thumb-background:
    radial-gradient(circle at 50% 30%, rgba(82, 110, 255, 0.16) 0%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-top: #eff4ff;
  --bg-bottom: #f8fbff;
  --page-bg: #f1f5ff;
  --text-color: #121a2d;
  --subtle-text-color: rgba(20, 31, 58, 0.78);
  --strong-text-color: rgba(12, 19, 36, 0.92);
  --soft-text-color: rgba(28, 39, 68, 0.68);
  --muted-text-color: rgba(22, 32, 58, 0.5);
  --label-color: rgba(61, 79, 140, 0.84);
  --line-color: rgba(22, 32, 58, 0.08);
  --line-strong-color: rgba(22, 32, 58, 0.12);
  --line-action-color: rgba(22, 32, 58, 0.16);
  --line-action-hover-color: rgba(22, 32, 58, 0.24);
  --focus-color: rgba(18, 27, 50, 0.6);
  --brand-halo-background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(112, 139, 255, 0.18) 24%,
      rgba(84, 109, 220, 0) 68%
    );
  --brand-halo-opacity: 0.58;
  --brand-logo-shadow: rgba(86, 104, 176, 0.16);
  --brand-text-shadow: rgba(93, 117, 194, 0.12);
  --status-background: rgba(255, 255, 255, 0.38);
  --button-fill: rgba(255, 255, 255, 0.46);
  --button-fill-subtle: rgba(255, 255, 255, 0.3);
  --button-fill-hover: rgba(255, 255, 255, 0.62);
  --scrollbar-color: rgba(24, 37, 72, 0.18);
  /* BUBLEDUB semantics */
  --accent-color: rgba(61, 79, 140, 0.84);
  --accent-dim-color: rgba(61, 79, 140, 0.38);
  --accent-fill: rgba(88, 116, 255, 0.12);
  --ok-color: rgba(22, 128, 74, 0.85);
  --warn-color: rgba(160, 108, 12, 0.85);
  --err-color: rgba(178, 44, 44, 0.85);
  --thumb-background:
    radial-gradient(circle at 50% 30%, rgba(88, 116, 255, 0.16) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%);
  color-scheme: light;
}

/* -------------------------------------------------------------------- base */

* {
  box-sizing: border-box;
}

html {
  background-color: var(--page-bg);
}

body {
  margin: 0;
  background-color: var(--page-bg);
  color: var(--text-color);
  font-family: "IBM Plex Mono", monospace;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--text-color);
  text-decoration: none;
}

a:hover {
  color: var(--strong-text-color);
}

button {
  font-family: inherit;
}

:where(a, button):focus-visible {
  outline: 1px solid var(--focus-color);
  outline-offset: 3px;
}

/* The brand surface: paints the page gradient + base text behind children.
   Use it on any root that is not already a BUBLEDUB page. */
.bd-surface {
  position: relative;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text-color);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
}

.bd-surface--pad {
  padding: clamp(18px, 4vw, 32px);
}

/* -------------------------------------------------------------------- type */

.bd-display {
  margin: 0;
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-weight: 400;
  font-size: clamp(30px, 6.6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--strong-text-color);
  text-wrap: balance;
}

.bd-display--sub {
  font-size: clamp(22px, 4.4vw, 40px);
}

.bd-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--label-color);
}

.bd-lead {
  margin: 0;
  max-width: 640px;
  font-size: clamp(13.5px, 3.5vw, 15px);
  line-height: 1.8;
  color: var(--soft-text-color);
  text-wrap: pretty;
}

.bd-hint {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

/* ------------------------------------------------------------------- brand */

/* The monogram: an open circle + handle drawn as one continuous monoline,
   with the BD sound-wave bars filled. Both take currentColor, so the mark
   inherits whatever text color its container sets (theme-agnostic).
   Stroke width is in viewBox units and scales with the mark — at the 26px
   header size that lands on ~1.4px, the same hairline as the 1px rules. */
.bd-logo {
  display: block;
  fill: none;
  stroke: none;
}

.bd-logo__ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 28;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bd-logo__bars rect {
  fill: currentColor;
  stroke: none;
}

.bd-lockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.bd-lockup__halo {
  position: absolute;
  inset: -34% -40%;
  background: var(--brand-halo-background);
  opacity: var(--brand-halo-opacity);
  pointer-events: none;
}

.bd-lockup__mark {
  position: relative;
  width: clamp(56px, 10vw, 96px);
  color: var(--strong-text-color);
  filter: drop-shadow(0 0 14px var(--brand-logo-shadow));
}

.bd-lockup__wordmark {
  position: relative;
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: clamp(30px, 6vw, 54px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--strong-text-color);
  text-shadow: 0 0 12px var(--brand-text-shadow);
}

.bd-lockup__tag {
  position: relative;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--label-color);
}

/* ------------------------------------------------------------------ header */

.bd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px clamp(16px, 4vw, 36px);
  border-bottom: 1px solid var(--line-color);
  background: color-mix(in srgb, var(--bg-top) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bd-head__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--strong-text-color);
}

.bd-head__logo {
  width: 26px;
  flex-shrink: 0;
}

.bd-head__wordmark {
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: 21px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bd-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
}

/* On a phone the section links do not fit next to the brand and the sign-in
   button, and they were pushing the whole page sideways — a landing that
   scrolls horizontally is a bad look for a product about phone video. The
   links only jump within the page, so dropping them below tablet width
   costs nothing: scrolling gets you to the same places. */
@media (max-width: 720px) {
  .bd-nav {
    display: none;
  }
}

.bd-nav__link {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--subtle-text-color);
  transition: color 0.22s ease;
}

.bd-nav__link:hover,
.bd-nav__link.is-active {
  color: var(--strong-text-color);
}

/* ----------------------------------------------------------------- buttons */

.bd-btn {
  min-height: 2.75rem;
  padding: 0.8rem 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  border-radius: 999px;
  border: 1px solid var(--line-action-color);
  background: var(--button-fill);
  color: var(--strong-text-color);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease;
}

.bd-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-action-hover-color);
  background: var(--button-fill-hover);
  color: var(--strong-text-color);
}

.bd-btn--secondary {
  color: var(--soft-text-color);
  background: var(--button-fill-subtle);
}

.bd-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--subtle-text-color);
}

.bd-btn--ghost:hover {
  background: var(--button-fill-subtle);
  border-color: transparent;
}

.bd-btn--big {
  min-height: 3.4rem;
  padding: 0 2.1rem;
  font-size: 0.86rem;
  letter-spacing: 0.2em;
}

.bd-btn__glyph {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6px;
  stroke-linecap: square;
}

/* ------------------------------------------------------------ badge/status */

.bd-badge {
  display: inline-block;
  padding: 6px 13px;
  border: 1px solid var(--line-color);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle-text-color);
}

.bd-badge--accent {
  color: var(--label-color);
  border-color: var(--line-strong-color);
  background: var(--accent-fill);
}

.bd-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted-text-color);
}

.bd-status__dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  transform: rotate(45deg);
  background: currentColor;
}

.bd-status--queued { color: var(--warn-color); }
.bd-status--processing { color: var(--accent-color); }
.bd-status--processing .bd-status__dot { animation: bdBlinkSoft 1.4s ease-in-out infinite; }
.bd-status--done { color: var(--ok-color); }
.bd-status--error { color: var(--err-color); }

/* ---------------------------------------------------------------- progress */

.bd-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.bd-progress__track {
  position: relative;
  flex: 1;
  height: 8px;
  border: 1px solid var(--line-strong-color);
  background: var(--button-fill-subtle);
  overflow: hidden;
}

.bd-progress__fill {
  position: absolute;
  inset: 1px auto 1px 1px;
  width: var(--p, 40%);
  background: repeating-linear-gradient(
    90deg,
    var(--accent-color) 0,
    var(--accent-color) 4px,
    transparent 4px,
    transparent 6px
  );
  transition: width 0.4s ease;
}

.bd-progress--live .bd-progress__fill {
  animation: bdBlinkSoft 2.2s ease-in-out infinite;
}

.bd-progress__read {
  min-width: 4.5ch;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--label-color);
}

/* ---------------------------------------------------------------- dropzone */

.bd-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--line-color);
  background: var(--button-fill-subtle);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.bd-drop:hover,
.bd-drop.is-active {
  border-color: var(--line-action-hover-color);
  background: var(--button-fill);
}

.bd-drop__tick {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--label-color);
  pointer-events: none;
}

.bd-drop__tick--tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.bd-drop__tick--tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.bd-drop__tick--bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.bd-drop__tick--br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.bd-drop__glyph {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--label-color);
  stroke-width: 1.2px;
  stroke-linecap: square;
}

.bd-drop.is-active .bd-drop__glyph {
  animation: bdBlinkSoft 1.2s ease-in-out infinite;
}

.bd-drop__label {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-drop__label em {
  font-style: normal;
  color: var(--label-color);
}

.bd-drop__meta {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

/* ---------------------------------------------------------- language pair */

.bd-langpair {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.bd-lang {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--line-color);
  background: var(--button-fill-subtle);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.bd-lang:hover,
.bd-lang.is-open {
  border-color: var(--line-action-hover-color);
  background: var(--button-fill);
}

.bd-lang__role {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-lang__value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bd-lang__code {
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: 26px;
  letter-spacing: 0.12em;
  color: var(--strong-text-color);
}

.bd-lang__name {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft-text-color);
}

.bd-langpair__swap {
  align-self: center;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line-action-color);
  border-radius: 999px;
  background: var(--button-fill);
  color: var(--label-color);
  cursor: pointer;
  transition: border-color 0.22s ease, transform 0.22s ease;
}

.bd-langpair__swap:hover {
  border-color: var(--line-action-hover-color);
  transform: rotate(180deg);
}

.bd-langpair__swap svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4px;
  stroke-linecap: square;
}

/* ---------------------------------------------------------------- waveform */

.bd-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  color: var(--accent-dim-color);
}

.bd-wave--live {
  color: var(--accent-color);
}

.bd-wave span {
  width: 2px;
  height: calc(100% * var(--h, 0.5));
  background: currentColor;
  flex-shrink: 0;
}

.bd-wave--live span {
  animation: bdBarPulse 1.1s ease-in-out calc(var(--i, 0) * 0.09s) infinite;
}

/* ------------------------------------------------------------- voice picker */

.bd-voice-list {
  display: flex;
  flex-direction: column;
}

.bd-voice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 4px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line-color);
  cursor: pointer;
  text-align: left;
  color: var(--soft-text-color);
  transition: color 0.22s ease;
}

.bd-voice:last-child {
  border-bottom: 1px solid var(--line-color);
}

.bd-voice:hover {
  color: var(--strong-text-color);
}

.bd-voice__mark {
  position: relative;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1px solid var(--muted-text-color);
  transform: rotate(45deg);
}

.bd-voice.is-active .bd-voice__mark {
  border-color: var(--label-color);
}

.bd-voice.is-active .bd-voice__mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--label-color);
}

.bd-voice__name {
  flex: 1;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: currentColor;
}

.bd-voice.is-active .bd-voice__name {
  color: var(--strong-text-color);
}

.bd-voice__tag {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

/* ---------------------------------------------------------------- pipeline */

.bd-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 18px;
}

.bd-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bd-step__marker {
  position: relative;
  height: 36px;
}

.bd-step__marker-line {
  position: absolute;
  left: 30px;
  right: 0;
  top: 17px;
  height: 1px;
  background: var(--line-strong-color);
}

.bd-step__marker-diamond {
  position: absolute;
  left: 6px;
  top: 10px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--label-color);
  transform: rotate(45deg);
}

.bd-step__marker-core {
  position: absolute;
  left: 9px;
  top: 13px;
  width: 8px;
  height: 8px;
  background: var(--label-color);
  transform: rotate(45deg);
  opacity: 0.2;
  animation: bdBlinkSoft 2.6s ease-in-out infinite;
}

.bd-step__marker-dot {
  position: absolute;
  left: 30px;
  right: 6px;
  top: 15px;
  height: 5px;
  pointer-events: none;
}

.bd-step__marker-dot::after {
  content: "";
  position: absolute;
  top: 0;
  width: 5px;
  height: 5px;
  background: var(--label-color);
  opacity: 0;
  animation: bdSlide 2.6s linear calc(var(--i, 0) * 0.65s + 0.6s) infinite;
}

.bd-step__num {
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: 30px;
  letter-spacing: 0.06em;
  color: var(--label-color);
}

.bd-step__headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bd-step__title {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-step__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--soft-text-color);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- job card */

.bd-job {
  display: flex;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line-color);
  background: var(--button-fill-subtle);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.bd-job:hover {
  border-color: var(--line-action-color);
  background: var(--button-fill);
}

.bd-job__thumb {
  position: relative;
  width: 52px;
  aspect-ratio: 9 / 16;
  flex-shrink: 0;
  border: 1px solid var(--line-strong-color);
  background: var(--thumb-background);
  display: grid;
  place-items: center;
  color: var(--label-color);
  overflow: hidden;
}

.bd-job__thumb svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.bd-job__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.bd-job__toprow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bd-job__name {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--strong-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-job__meta {
  display: flex;
  gap: 14px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-text-color);
  white-space: nowrap;
}

.bd-job__meta em {
  font-style: normal;
  color: var(--label-color);
}

/* ------------------------------------------------------------- video frame */

.bd-frame {
  position: relative;
  width: 100%;
  max-width: 250px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line-strong-color);
  background: var(--thumb-background);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bd-frame__sys {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-frame__badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

.bd-frame__play {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-action-hover-color);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-top) 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--strong-text-color);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.bd-frame__play:hover {
  transform: scale(1.06);
  border-color: var(--focus-color);
}

.bd-frame__play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-left: 3px;
}

.bd-frame__subs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg-top) 86%, transparent) 42%);
  text-align: center;
}

.bd-frame__sub-orig {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted-text-color);
  text-decoration: line-through;
  text-decoration-color: var(--accent-dim-color);
}

.bd-frame__sub-dub {
  font-size: 11px;
  line-height: 1.5;
  color: var(--strong-text-color);
}

.bd-frame__sub-dub em {
  font-style: normal;
  color: var(--label-color);
}

/* ---------------------------------------------------------------- terminal */

.bd-term {
  border: 1px solid var(--line-strong-color);
  background: var(--button-fill-subtle);
  font-size: clamp(10.5px, 3vw, 12.5px);
  line-height: 2.1;
}

.bd-term__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-color);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-term__live {
  color: var(--label-color);
  animation: bdBlinkSoft 2.2s ease-in-out infinite;
}

.bd-term__body {
  padding: 14px 18px;
}

.bd-term__line {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.bd-term__prompt {
  color: var(--muted-text-color);
}

.bd-term__value {
  color: var(--text-color);
}

.bd-term__value--ok { color: var(--ok-color); }
.bd-term__value--accent { color: var(--label-color); }

.bd-term__caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-top: 6px;
  background: var(--label-color);
  animation: bdBlink 1.1s steps(1) infinite;
}

/* ---------------------------------------------------------------- sections */

.bd-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bd-section-head__index {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--label-color);
  white-space: nowrap;
}

.bd-section-head__title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line-color);
}

.bd-facts {
  display: flex;
  flex-direction: column;
}

.bd-fact {
  display: grid;
  grid-template-columns: minmax(76px, 110px) 1fr;
  gap: clamp(12px, 3.5vw, 18px);
  padding: 15px 0;
  border-top: 1px solid var(--line-color);
}

.bd-fact__label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label-color);
  padding-top: 2px;
}

.bd-fact__value {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-color);
}

/* ----------------------------------------------------------------- pricing */

.bd-price {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 4.6vw, 24px);
  border: 1px solid var(--line-color);
  background: var(--button-fill-subtle);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.bd-price:hover {
  border-color: var(--line-action-color);
  background: var(--button-fill);
}

.bd-price--featured {
  border-color: var(--line-strong-color);
  background: var(--accent-fill);
}

.bd-price__toprow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bd-price__name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-price__amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.bd-price__minutes {
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--strong-text-color);
}

.bd-price__unit {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-price__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.bd-price__list li {
  padding: 10px 0;
  border-top: 1px solid var(--line-color);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft-text-color);
}

/* ------------------------------------------------------ language picker */
/* 50+ targets would swamp the panel, so the list lives in a fixed-height
   scroller behind a search field. Selected languages are pinned above it
   so they never disappear behind a filter. */

.bd-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-action-color);
  background: var(--button-fill-subtle);
  transition: border-color 0.2s ease;
}

.bd-search:focus-within {
  border-color: var(--focus-color);
}

.bd-search__glyph {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted-text-color);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.bd-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-search input::placeholder {
  color: var(--muted-text-color);
  letter-spacing: 0.14em;
}

.bd-langs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(82px, 100%), 1fr));
  gap: 7px;
  max-height: 208px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color) transparent;
}

.bd-langs::-webkit-scrollbar {
  width: 6px;
}

.bd-langs::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color);
}

.bd-lang {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 6px;
  border: 1px solid var(--line-action-color);
  background: var(--button-fill-subtle);
  color: var(--soft-text-color);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bd-lang:hover {
  border-color: var(--line-action-hover-color);
  background: var(--button-fill);
}

.bd-lang.is-active {
  border-color: var(--line-strong-color);
  background: var(--accent-fill);
  color: var(--strong-text-color);
}

.bd-lang__code {
  font-size: 10px;
  letter-spacing: 0.16em;
}

.bd-lang__name {
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--muted-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-lang.is-active .bd-lang__name {
  color: var(--label-color);
}

.bd-langs__empty {
  grid-column: 1 / -1;
  padding: 18px 0;
  text-align: center;
}

/* ----------------------------------------------------- legal documents */
/* Long-form reading inside the terminal look: wider measure, quieter type
   than the marketing pages, numbered sections that can be linked to. */

.bd-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) clamp(18px, 5vw, 40px) clamp(48px, 8vw, 96px);
}

.bd-doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-color);
}

.bd-doc h2 {
  margin: clamp(28px, 5vw, 44px) 0 12px;
  font-size: clamp(13px, 2.4vw, 15px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-doc h3 {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label-color);
}

.bd-doc p,
.bd-doc li {
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--soft-text-color);
}

.bd-doc p {
  margin: 0 0 12px;
}

.bd-doc ul {
  margin: 0 0 12px;
  padding-left: 18px;
}

.bd-doc li {
  margin-bottom: 6px;
}

.bd-doc strong {
  color: var(--strong-text-color);
  font-weight: 500;
}

.bd-doc a {
  color: var(--label-color);
}

.bd-doc__callout {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--line-strong-color);
  background: var(--accent-fill);
}

.bd-doc__callout p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------ cookie consent */

.bd-consent {
  position: fixed;
  left: 50%;
  bottom: clamp(12px, 3vw, 24px);
  z-index: 40;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong-color);
  background: var(--page-bg);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.55);
}

.bd-consent__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bd-consent__row .bd-btn {
  flex: 1 1 auto;
  min-height: 2.2rem;
  padding: 0.5rem 1rem;
  font-size: 0.66rem;
}

/* -------------------------------------------------------- credit packs */
/* Brighter than the rest of the system on purpose: this is the one place
   in the studio that asks for money, so the featured pack carries an
   accent rail, a halo and a lift on hover. Everything still runs on the
   theme tokens, so light mode inherits it. */

.bd-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(16px, 3.4vw, 20px);
  border: 1px solid var(--line-color);
  background: var(--button-fill-subtle);
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease,
    transform 0.25s ease, box-shadow 0.25s ease;
}

.bd-pack::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(96, 122, 255, 0) 0%,
    rgba(96, 122, 255, 0.75) 50%,
    rgba(96, 122, 255, 0) 100%
  );
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

.bd-pack:hover {
  border-color: var(--line-action-hover-color);
  background: var(--button-fill);
  transform: translateY(-2px);
}

.bd-pack:hover::before {
  opacity: 0.9;
}

.bd-pack--featured {
  border-color: rgba(96, 122, 255, 0.42);
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(96, 122, 255, 0.16) 0%, rgba(96, 122, 255, 0) 72%),
    var(--button-fill);
  box-shadow: 0 14px 44px -22px rgba(96, 122, 255, 0.75);
}

.bd-pack--featured::before {
  opacity: 1;
}

.bd-pack__badge {
  align-self: flex-start;
  padding: 4px 8px;
  border: 1px solid rgba(96, 122, 255, 0.4);
  background: var(--accent-fill);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label-color);
}

.bd-pack__name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}

.bd-pack__credits {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: clamp(34px, 6vw, 42px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--strong-text-color);
}

.bd-pack__credits em {
  font-family: inherit;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--label-color);
}

.bd-pack__equiv {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-pack__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-color);
}

.bd-pack__price {
  font-family: "Iceland", "IBM Plex Mono", monospace;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--strong-text-color);
}

.bd-pack__value {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ok-color);
}

/* -------------------------------------------------------------------- tabs */

.bd-tabs {
  display: inline-flex;
  border: 1px solid var(--line-color);
  border-radius: 999px;
  overflow: hidden;
}

.bd-tabs__btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle-text-color);
  transition: color 0.22s ease, background-color 0.22s ease;
}

.bd-tabs__btn.is-active {
  background: var(--button-fill);
  color: var(--strong-text-color);
}

/* -------------------------------------------------------------------- hero */

.bd-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-color);
}

.bd-hero__ascii {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0.4em;
  color: var(--label-color);
  opacity: 0.16;
  pointer-events: none;
  user-select: none;
  white-space: pre;
}

.bd-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3.4vw, 26px);
  text-align: center;
  max-width: 940px;
  width: 100%;
  padding: clamp(44px, 9vw, 70px) clamp(18px, 5vw, 40px);
}

.bd-hero__cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.bd-hero__status {
  display: flex;
  gap: clamp(12px, 3vw, 30px);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(10px, 2.5vw, 22px);
  font-size: clamp(9px, 2.4vw, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-text-color);
}

.bd-hero__status em {
  font-style: normal;
  color: var(--label-color);
}

.bd-caret {
  display: inline-block;
  width: 0.42em;
  height: 0.82em;
  margin-left: 0.08em;
  background: var(--label-color);
  animation: bdBlink 1.1s steps(1) infinite;
}

/* ------------------------------------------------------------------ motion */

@keyframes bdBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes bdBlinkSoft {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@keyframes bdBarPulse {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

@keyframes bdSlide {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

@keyframes bdPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}

@keyframes bdRise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

/* ------------------------------------------------------------- splash --- */
/* Session hand-off screen for auth.html and studio.html. Driven purely by
   the html.auth-pending class: visible while the class is on, fades away
   when the page's auth script removes it. Markup is static in the HTML so
   the splash paints before any JS runs — its whole job is covering the
   window where Firebase is still deciding who you are. */

.bd-splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background: var(--page-bg);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s ease, visibility 0s linear 0s;
}

html:not(.auth-pending) .bd-splash {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0s linear 0.32s;
}

.bd-splash__wave {
  height: 30px;
  color: var(--accent-dim-color);
}

.bd-splash__status {
  letter-spacing: 0.26em;
  animation: bdBlinkSoft 1.6s ease-in-out infinite;
}

/* -------------------------------------------------------- lang switcher --- */
/* Sister of rodlen.com's .lang-switch pill — same border/radius/tracking —
   but 55 languages open a dropdown panel instead of sitting inline. */

.bd-langswitch {
  position: relative;
}

.bd-langswitch__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line-action-color);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--subtle-text-color);
  transition: color 0.22s ease, border-color 0.22s ease;
}

.bd-langswitch__btn:hover {
  color: var(--strong-text-color);
  border-color: var(--line-action-hover-color);
}

.bd-langswitch__btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}

/* The author display beats the UA's [hidden]{display:none}, so restate it —
   without this the panel simply never closes. */
.bd-langswitch__panel[hidden] {
  display: none;
}

.bd-langswitch__panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 2px;
  width: min(340px, calc(100vw - 32px));
  max-height: min(430px, 70vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line-strong-color);
  background: var(--page-bg);
  box-shadow: 0 18px 40px rgba(10, 16, 34, 0.18);
}

.bd-langswitch__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--soft-text-color);
}

.bd-langswitch__item:hover {
  background: var(--button-fill-hover);
  color: var(--strong-text-color);
}

.bd-langswitch__item.is-active {
  background: var(--accent-fill);
  color: var(--strong-text-color);
}

.bd-langswitch__flag {
  flex-shrink: 0;
}

/* --------------------------------------------------------------- rtl ----- */
/* Arabic-script languages: connected letters must not be tracked apart,
   and the terminal-style letter-spacing means nothing there. Flex layouts
   mirror on their own via dir="rtl". */

html[dir="rtl"] * {
  letter-spacing: 0 !important;
}

/* ------------------------------------------------ studio wizard (steps) */
.bd-wiz {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bd-wiz__step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line-color);
  background: transparent;
  color: var(--muted-text-color);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: default;
  white-space: nowrap;
}
.bd-wiz__num {
  color: var(--label-color);
}
.bd-wiz__step.is-done {
  border-color: var(--line-strong-color);
  color: var(--soft-text-color);
  cursor: pointer;
}
.bd-wiz__step.is-done .bd-wiz__num::after {
  content: " ✓";
  color: var(--ok-color);
}
.bd-wiz__step.is-active {
  border-color: var(--accent-color);
  color: var(--strong-text-color);
  background: var(--accent-fill);
}
.bd-wiz__sep {
  color: var(--line-strong-color);
  font-size: 10px;
}

.bd-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line-strong-color);
  background: var(--button-fill-subtle);
  color: var(--soft-text-color);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.bd-mode-card:hover:not([disabled]) {
  border-color: var(--line-action-hover-color);
}
.bd-mode-card.is-active {
  border-color: var(--accent-color);
  background: var(--accent-fill);
}
.bd-mode-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.bd-mode-card__title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--strong-text-color);
}
.bd-mode-card__desc {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-text-color);
  line-height: 1.7;
}
.bd-mode-card__soon {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong-color);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--label-color);
}

/* --------------------------------------- studio shell (mission control) */
/* Studio v2: fixed left rail (nav + wallet) with the active view on the
   right. Under 900px the rail collapses to a top strip and navigation
   moves into a fixed bottom tab bar, app-style. */

.mc-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}

.mc-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  border-right: 1px solid var(--line-color);
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.mc-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: none;
  border-top: 1px solid var(--line-strong-color);
  background: var(--page-bg);
}

@media (max-width: 900px) {
  .mc-shell { grid-template-columns: 1fr; }
  .mc-rail {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line-color);
  }
  .mc-rail nav { display: none !important; }
  .mc-wallet { margin-top: 0 !important; margin-left: auto; }
  .mc-tabbar { display: grid; grid-template-columns: repeat(4, 1fr); }
  #view { padding-bottom: 96px !important; }
}

@keyframes bdRiseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes bdFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bdPulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* The rail pins the language switcher to the viewport bottom, so its
   dropdown must open upward or it renders below the fold. */
.mc-rail .bd-langswitch__panel {
  top: auto;
  bottom: calc(100% + 10px);
  inset-inline-end: auto;
  inset-inline-start: 0;
}
