/* Read Aloud Widget */

/* ── Floating action button ───────────────────────────────────────────── */
#ra-fab {
  position: fixed;
  bottom: 2vh;
  left: 3vw;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: var(--color-yellow);
  color: #000;
  /* font-size: 22px; */
  /* cursor: pointer; */
  box-shadow: 2px 2px #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  margin:0;
}

#ra-fab img,
#ra-fab svg {
  height: 28px !important;
  width: 28px !important;
   max-height: 28px !important;
  max-width: 28px !important;
  /* margin-top:8px;
  margin-left: 5px; */
  margin: 7px 0 0 5px !important;
  padding:0 !important;
  border:none !important;
  border-radius: 0 !important;
}



#ra-fab:hover {
  background: var(--color-yellow-dark);
  /* transform: scale(1.05); */
}
/* 
#ra-fab:active {
  transform: scale(0.96);
} */

/* ── Panel ────────────────────────────────────────────────────────────── */
#ra-panel {
  position: fixed;
  bottom: 84px;
  left: 24px;
  z-index: 9999;
  width: 270px;
  max-height: 62vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.ra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: var(--color-yellow);
  color: #000;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
}

.ra-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.ra-close {
  background: white;
  border: none;
  color: #000;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.ra-close:hover { opacity: 1; }

/* ── Section list ─────────────────────────────────────────────────────── */
.ra-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
  -webkit-overflow-scrolling: touch;
}

.ra-section-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #222;
  min-height: 44px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ra-section-btn:last-child {
  border-bottom: none;
}

.ra-section-btn:hover,
.ra-section-btn:focus {
  background: var(--color-bg-2);
  outline: none;
}

.ra-section-btn.ra-active {
  background: var(--color-yellow-light);
  color: var(--color-yellow-dark);
  font-weight: 600;
}

.ra-icon {
  font-size: 11px;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  color: var(--color-yellow-dark);
}

.ra-active .ra-icon {
  color: var(--color-yellow-dark);
}

.ra-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.ra-empty {
  font-size: 13px;
  color: #888;
  text-align: center;
  padding: 18px 14px;
  margin: 0;
}

/* ── Stop button ──────────────────────────────────────────────────────── */
.ra-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: #f5f5f5;
  border: none;
  border-top: 1px solid #e0e0e0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #c0392b;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0 0 14px 14px;
  min-height: 44px;
}

.ra-stop-btn:hover {
  background: #fdecea;
}

/* ── Mobile adjustments ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  #ra-fab {
    bottom: 16px;
    right: 16px;
  }

  #ra-panel {
    bottom: 76px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: 55vh;
  }
}
