.jack-voice {
  position: absolute;
  left: 50%;
  bottom: 68px; /* Anchored to top edge of .bottom-nav */
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  pointer-events: none;
}

.jack-voice > * {
  pointer-events: auto;
}

#jackVoice[hidden],
#jackVoice.is-disabled,
#jackVoicePanel[hidden] {
  display: none !important;
}

.jack-voice-fab {
  position: relative;
  width: 52px;
  height: 25px;
  padding: 0;
  border: 1px solid #a3ded2;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: #ffffff;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, .06);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
  -webkit-tap-highlight-color: transparent;
  transform-origin: bottom center;
  color: #000000;
}

.jack-voice-fab::before {
  content: "";
  position: absolute;
  top: -16px;
  left: -10px;
  right: -10px;
  bottom: 0;
}

.jack-voice-icon {
  width: 22px;
  height: 13px;
  margin-top: 3px;
}

.jack-voice-fab:hover {
  background: #ffffff;
  color: #000000;
  border-color: #78cdbd;
}

.jack-voice-fab:focus-visible {
  outline: 2px solid #78cdbd;
  outline-offset: 2px;
}
.jack-voice-fab:focus-visible .jack-voice-icon {
  color: #000000;
}

.jack-voice.is-listening .jack-voice-fab {
  color: #000000;
  background: #ffffff;
  border-color: #78cdbd;
  box-shadow: 0 -3px 12px rgba(120, 205, 189, .24);
}

.jack-voice.is-listening .jack-voice-icon {
  animation: jack-pulse-mark 1.1s ease-in-out infinite alternate;
}

/* Hide the old orb structure, since the new style is a subtle light indicator */
.jack-voice-orb {
  display: none;
}

.jack-voice-panel {
  width: min(330px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  color: #f7f8fc;
  background: rgba(13, 14, 21, .96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  backdrop-filter: blur(22px);
  direction: rtl;
  margin-bottom: 4px; /* Give it a bit of space above the hill */
  transform-origin: bottom center;
  animation: jack-panel-open 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jack-panel-open {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes jack-pulse-bar {
  0% { opacity: 0.6; transform: scaleX(0.9); }
  100% { opacity: 1; transform: scaleX(1.1); }
}

.jack-voice-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.jack-voice-panel__head strong,
.jack-voice-panel__head small {
  display: block;
}

.jack-voice-panel__head strong { font-size: 17px; }
.jack-voice-panel__head small { margin-top: 2px; color: rgba(247, 248, 252, .62); font-size: 12px; }

.jack-voice-close {
  min-width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .09);
  font-size: 22px;
  cursor: pointer;
}

.jack-voice-languages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 14px 0 10px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  direction: ltr;
}

.jack-voice-languages button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, .68);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.jack-voice-languages button[aria-pressed="true"] {
  color: #080a0d;
  background: #b5ff4d;
}

.jack-voice-listen {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(105deg, #7c3aed, #2563eb 52%, #0d9488);
  font: 800 15px/1 "Heebo", "Inter", sans-serif;
  cursor: pointer;
}

.jack-voice-listen__icon {
  display: inline-block;
  margin-inline-end: 7px;
  font-size: 23px;
  vertical-align: -2px;
}

.jack-voice-status {
  min-height: 36px;
  margin: 10px 2px 0;
  color: rgba(247, 248, 252, .72);
  font-size: 12px;
  line-height: 1.45;
}

.jack-voice-status.is-error { color: #ff9ab9; }
.jack-voice-status.is-success { color: #b5ff4d; }

.jack-setting-switch {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  cursor: pointer;
}

.jack-setting-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.jack-setting-switch > span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  transition: background .2s ease;
}

.jack-setting-switch > span::after {
  content: "";
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}

.jack-setting-switch input:checked + span { background: #70c72b; }
.jack-setting-switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .jack-setting-switch input:checked + span::after { transform: translateX(-20px); }

@keyframes jack-float {
  to { transform: translate(6px, 5px) scale(1.12); }
}

@keyframes jack-pulse {
  50% { transform: scale(1.055); }
}




@media (prefers-reduced-motion: reduce) {
  .jack-voice.is-listening .jack-voice-fab::after { animation: none; }
  .jack-voice-panel { animation: none; }
}
