* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: #f1f5f9;
  color: #0f172a;
}

.no-sb::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-sb,
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Topic & category filter pills */
.vd-topic-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.vd-topic-pill:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.vd-topic-pill:active {
  transform: scale(0.97);
}

.vd-topic-pill.is-active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Active playing sentence / card / dialogue line highlight */
.vd-audio-active-row,
.dialogue-line-active {
  background-color: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.2),
    0 4px 12px rgba(37, 99, 235, 0.08) !important;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

/* Mobile bottom navigation with SVG icons & safe-area support */
.vd-mobile-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(3.75rem + env(safe-area-inset-bottom, 0px));
}

.vd-mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  padding: 0.25rem 0.125rem;
  min-width: 0;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease;
}

.vd-mobile-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 1.5rem;
  border-radius: 9999px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.vd-mobile-tab-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vd-mobile-tab.is-active {
  color: #2563eb;
}

.vd-mobile-tab.is-active .vd-mobile-tab-icon {
  background-color: #dbeafe;
  color: #1d4ed8;
}

@keyframes vdPulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.vd-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  border-width: 1px;
  transition:
    transform 0.14s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.vd-speak-btn:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.vd-speak-btn:active {
  transform: scale(0.95);
}

.vd-speak-btn.is-playing,
.btn-playing {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: vdPulseRing 1.4s infinite;
}

.vd-speak-btn.is-playing .vd-icon-play,
.btn-playing .vd-icon-play {
  display: none;
}

.vd-speak-btn.is-playing .vd-icon-stop,
.btn-playing .vd-icon-stop {
  display: inline-flex;
}

.vd-speak-btn:not(.is-playing):not(.btn-playing) .vd-icon-stop {
  display: none;
}
