/* Ask Birley voice widget — Birley Digital High Street palette */
:root {
  --bv-ink: #12263a;
  --bv-coral: #ff715b;
  --bv-yellow: #ffbf3f;
  --bv-green: #2f7d68;
  --bv-cream: #f7f1e6;
  --bv-paper: #fffaf3;
  --bv-shadow: 0 18px 40px rgba(18, 38, 58, 0.22);
}

.bv-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 99980;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bv-coral), #ff8f5a);
  color: #fff;
  font: 650 0.95rem/1.1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  box-shadow: var(--bv-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bv-fab:hover,
.bv-fab:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 48px rgba(18, 38, 58, 0.28);
  outline: 2px solid var(--bv-yellow);
  outline-offset: 3px;
}

.bv-fab[aria-expanded="true"] {
  background: var(--bv-ink);
}

.bv-fab-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-grid;
  place-items: center;
}

.bv-fab-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.bv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99985;
  background: rgba(18, 38, 58, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bv-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bv-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 4.6rem;
  z-index: 99990;
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--bv-paper);
  color: var(--bv-ink);
  border: 1px solid rgba(18, 38, 58, 0.1);
  border-radius: 1.25rem;
  box-shadow: var(--bv-shadow);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bv-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bv-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.85rem;
  background: linear-gradient(160deg, var(--bv-ink) 0%, #1c3a55 100%);
  color: #fff;
}

.bv-panel-title {
  margin: 0;
  font: 700 1.05rem/1.25 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bv-panel-sub {
  margin: 0.25rem 0 0;
  font: 400 0.8rem/1.35 system-ui, sans-serif;
  opacity: 0.88;
}

.bv-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bv-close:hover,
.bv-close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 2px solid var(--bv-yellow);
  outline-offset: 2px;
}

.bv-panel-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: auto;
}

.bv-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--bv-cream);
  border: 1px solid rgba(18, 38, 58, 0.08);
  font: 500 0.9rem/1.35 system-ui, sans-serif;
}

.bv-status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #9aabb8;
  flex: none;
}

.bv-status[data-state="connecting"] .bv-status-dot,
.bv-status[data-state="listening"] .bv-status-dot {
  background: var(--bv-green);
  box-shadow: 0 0 0 0 rgba(47, 125, 104, 0.55);
  animation: bv-pulse 1.4s ease infinite;
}

.bv-status[data-state="speaking"] .bv-status-dot {
  background: var(--bv-coral);
  animation: bv-pulse 1s ease infinite;
}

.bv-status[data-state="error"] .bv-status-dot {
  background: #c0392b;
}

.bv-status[data-state="idle"] .bv-status-dot {
  background: var(--bv-yellow);
}

@keyframes bv-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 125, 104, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(47, 125, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 125, 104, 0); }
}

.bv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.bv-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: 650 0.88rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.bv-btn-primary {
  background: var(--bv-coral);
  color: #fff;
}

.bv-btn-primary:hover,
.bv-btn-primary:focus-visible {
  filter: brightness(1.05);
  outline: 2px solid var(--bv-ink);
  outline-offset: 2px;
}

.bv-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.bv-btn-ghost {
  background: transparent;
  color: var(--bv-ink);
  border: 1px solid rgba(18, 38, 58, 0.18);
}

.bv-btn-ghost:hover,
.bv-btn-ghost:focus-visible {
  background: rgba(18, 38, 58, 0.05);
  outline: 2px solid var(--bv-yellow);
  outline-offset: 2px;
}

.bv-callbox {
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: #fff;
  border: 1px dashed rgba(18, 38, 58, 0.18);
}

.bv-callbox a {
  color: var(--bv-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bv-callbox a:hover,
.bv-callbox a:focus-visible {
  color: var(--bv-coral);
}

.bv-callbox p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(18, 38, 58, 0.75);
}

.bv-note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(18, 38, 58, 0.62);
}

.bv-error {
  display: none;
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: #fdecea;
  color: #7a1f1a;
  font-size: 0.82rem;
  line-height: 1.4;
}

.bv-error.is-visible {
  display: block;
}

@media (max-width: 480px) {
  .bv-fab {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .bv-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 4.2rem;
    max-height: min(78vh, 620px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bv-fab,
  .bv-panel,
  .bv-backdrop,
  .bv-status-dot {
    transition: none !important;
    animation: none !important;
  }
}
