/** Lectura full CSS: TTS + rating-feedback + bar. Built 2026-03-09 */

/* notes-tts.css */
/**
 * Notes TTS plugin — button, voice panel, and highlight styles
 * Buttons: same position/size as Reveal slide number (bottom 8px, small).
 */
/* Backdrop — darkened overlay when settings panel is open; click to close */
.reveal .notes-tts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.reveal .notes-tts-backdrop.notes-tts-backdrop-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reveal .notes-tts-wrap {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 3px;
}

.reveal .notes-tts-btn,
.reveal .notes-tts-gear {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: background 0.2s, transform 0.15s;
}
.reveal .notes-tts-btn {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
  box-shadow: 0 1px 4px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
}
.reveal .notes-tts-btn:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 1);
  transform: scale(1.1);
}
.reveal .notes-tts-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.reveal .notes-tts-btn.active {
  background: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
  box-shadow: 0 1px 4px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
}
.reveal .notes-tts-btn.active:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
}

.reveal .notes-tts-gear {
  background: rgba(55, 65, 81, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.reveal .notes-tts-gear:hover {
  background: rgba(55, 65, 81, 1);
  transform: scale(1.1);
}

/* Subtitles — current phrase being spoken (off by default in settings) */
.reveal .notes-tts-subtitle {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  border-radius: 8px;
  z-index: 99;
  pointer-events: none;
  display: none;
}
.reveal .notes-tts-subtitle strong { font-weight: 700; color: #fff; }
.reveal .notes-tts-subtitle em { font-style: italic; }
.reveal .notes-tts-subtitle br { display: block; content: ''; margin-top: 0.25em; }
.reveal .notes-tts-subtitle .notes-tts-subtitle-heading { display: block; font-size: 1.1em; font-weight: 700; margin-bottom: 0.3em; color: #e2e8f0; }
.reveal .notes-tts-subtitle .notes-tts-subtitle-hr { border: none; border-top: 1px solid rgba(255,255,255,0.3); margin: 0.4em 0; }

/* Progress bar — shows TTS progress through slide notes (top of screen) */
.reveal .notes-tts-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 97;
  overflow: hidden;
}
.reveal .notes-tts-progress-fill {
  height: 100%;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
  width: 0%;
  transition: width 0.2s ease-out;
}

/* Click animation [[click:.selector]] — unique ripple + bounce so user clearly sees what was triggered */
.reveal .notes-tts-click-flash {
  animation: notes-tts-click-flash 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}
.reveal .notes-tts-click-flash::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  animation: notes-tts-click-ripple 0.6s ease-out forwards;
}
@keyframes notes-tts-click-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.8);
    transform: scale(1);
  }
  25% {
    box-shadow: 0 0 0 16px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0);
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.08);
  }
  75% {
    transform: scale(0.98);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}
@keyframes notes-tts-click-ripple {
  0% {
    box-shadow: inset 0 0 0 0 rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.4);
  }
  100% {
    box-shadow: inset 0 0 0 20px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0);
  }
}

/* Big emoji overlay [[emoji:😂]] — pop in, hold, fade out. Darkened circle behind emoji, corners transparent. */
.reveal .notes-tts-emoji-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 98;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 8rem;
  line-height: 1;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.5) 28%,
    rgba(0, 0, 0, 0.2) 55%,
    transparent 75%
  );
  animation: notes-tts-emoji-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.reveal .notes-tts-emoji-overlay.notes-tts-emoji-out {
  animation: notes-tts-emoji-fade 0.45s ease-out forwards;
}
@keyframes notes-tts-emoji-pop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-8deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.12) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
@keyframes notes-tts-emoji-fade {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.08) rotate(3deg);
  }
}

/* Voice settings panel — opens above the wrap (bottom-left) */
.reveal .notes-tts-panel {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  padding: 10px 12px;
  min-width: 260px;
  max-width: 320px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  pointer-events: none;
}
.reveal .notes-tts-panel.notes-tts-panel-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.reveal .notes-tts-panel-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 6px;
}

/* Tabs */
.reveal .notes-tts-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}
.reveal .notes-tts-tab {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.reveal .notes-tts-tab:hover {
  color: #374151;
}
.reveal .notes-tts-tab.active {
  color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
  border-bottom-color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
}
.reveal .notes-tts-tab-panes {
  max-height:  min(70vh, 420px);
  overflow-y: auto;
}
.reveal .notes-tts-tab-pane {
  display: none;
}
.reveal .notes-tts-tab-pane.active {
  display: block;
}

/* Shortcuts table */
.reveal .notes-tts-shortcuts-table {
  width: 100%;
  font-size: 0.7rem;
  border-collapse: collapse;
}
.reveal .notes-tts-shortcuts-table th,
.reveal .notes-tts-shortcuts-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb;
}
.reveal .notes-tts-shortcuts-table th {
  color: #6b7280;
  font-weight: 600;
}
.reveal .notes-tts-shortcuts-table td:first-child {
  color: #374151;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

/* Playback controls — pause, previous, next slide */
.reveal .notes-tts-playback-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  transition: opacity 0.2s, max-height 0.2s, margin 0.2s, padding 0.2s, border 0.2s;
}
.reveal .notes-tts-playback-row.notes-tts-playback-row-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  overflow: hidden;
  pointer-events: none;
}
.reveal .notes-tts-playback-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.15);
  color: rgb(124, 58, 237);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}
.reveal .notes-tts-playback-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  transform: scale(1.1);
}
.reveal .notes-tts-playback-btn:active {
  transform: scale(0.98);
}

.reveal .notes-tts-lang-wrap {
  margin-bottom: 8px;
}
.reveal .notes-tts-lang-wrap .notes-tts-rate-label {
  display: block;
  margin-bottom: 2px;
}

/* Highlight color swatches */
.reveal .notes-tts-color-wrap {
  margin-bottom: 10px;
}
.reveal .notes-tts-color-label {
  font-size: 0.75rem;
  color: #374151;
  margin-bottom: 8px;
  text-align: center;
}
.reveal .notes-tts-color-swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}
.reveal .notes-tts-color-swatch {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}
.reveal .notes-tts-color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.reveal .notes-tts-color-swatch.notes-tts-color-swatch-selected {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.reveal .notes-tts-panel-voice {
  margin-bottom: 8px;
}
.reveal .notes-tts-voice-select {
  width: 100%;
  padding: 5px 6px;
  font-size: 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #111;
}
.reveal .notes-tts-rate-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.reveal .notes-tts-rate-label {
  font-size: 0.75rem;
  color: #374151;
  min-width: 38px;
}
.reveal .notes-tts-rate-value {
  font-size: 0.75rem;
  color: #6b7280;
  min-width: 28px;
}
.reveal .notes-tts-rate-slider {
  flex: 1;
  height: 5px;
  accent-color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
}
.reveal .notes-tts-auto-advance-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #374151;
}
.reveal .notes-tts-auto-advance-check {
  accent-color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
  width: 14px;
  height: 14px;
}
.reveal .notes-tts-auto-advance-label {
  flex: 1;
}
.reveal .notes-tts-panel-hint {
  font-size: 0.65rem;
  color: #9ca3af;
  line-height: 1.35;
  margin-top: 4px;
}

/* One-shot highlight [[highlight:selector]] — border-only pulse, no background */
.reveal .notes-tts-highlight {
  animation: notes-tts-highlight-pulse 3s ease-out;
  border-radius: 6px;
}
@keyframes notes-tts-highlight-pulse {
  0% {
    outline: 3px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.7);
    outline-offset: 2px;
  }
  40% {
    outline: 3px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.5);
    outline-offset: 5px;
  }
  100% {
    outline: 3px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0);
    outline-offset: 8px;
  }
}

.reveal .notes-tts-highlight-ring {
  outline: 4px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9) !important;
  outline-offset: 6px !important;
  border-radius: 6px;
  animation: notes-tts-ring-fade 6s ease-out forwards;
}
.reveal .controls button.notes-tts-highlight-ring {
  outline: 4px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9) !important;
  outline-offset: 6px !important;
  border-radius: 12px;
  animation: notes-tts-ring-fade 6s ease-out forwards;
}
@keyframes notes-tts-ring-fade {
  0%, 60% {
    outline-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
  }
  100% {
    outline-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0);
  }
}

/* Persistent highlight [[starthighlight:selector]] … [[stophighlight]] — border-only */
.reveal .notes-tts-highlight-on {
  border-radius: 6px;
  outline: 2.5px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.75);
  outline-offset: 3px;
  transition: outline 0.25s;
}

/* Highlight color theme — Reveal.js progress bar, slide number */
.reveal .progress {
  color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
}
.reveal .progress span {
  background: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
}
.reveal .slide-number {
  color: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237)) !important;
}
.reveal .slide-number a,
.reveal .slide-number a:hover,
.reveal .slide-number a:focus,
.reveal .slide-number a:visited {
  color: inherit !important;
}


/* rating-feedback.css */
/**
 * Rating & Feedback Plugin for Reveal.js
 * Reusable across presentations. Glassmorphism, dark theme, animations.
 * Accent color: uses --notes-tts-highlight-rgb when set (e.g. by Notes TTS plugin settings).
 */

:root {
  --rf-accent-rgb: var(--notes-tts-highlight-rgb, 124, 58, 237);
}

/* ---- Floating feedback button ---- */
.rf-fab-wrap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9998;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.rf-fab-wrap * {
  pointer-events: auto;
}

.rf-fab {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(30, 27, 42, 0.95) 0%, rgba(15, 13, 24, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.15);
  color: rgb(var(--rf-accent-rgb));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, color 0.2s ease;
  animation: rf-fab-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards, rf-fab-pulse 3s ease-in-out 1s infinite;
}
.rf-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}
.rf-fab-badge.rf-hidden {
  display: none !important;
}

/* Chat button when placed inside TTS wrap — match .notes-tts-gear exactly */
.notes-tts-wrap .rf-fab {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: background 0.2s, transform 0.15s;
  background: rgba(55, 65, 81, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: none;
}
.notes-tts-wrap .rf-fab:hover {
  background: rgba(55, 65, 81, 1);
  transform: scale(1.1);
  animation: none;
}
.notes-tts-wrap .rf-fab:active {
  transform: scale(0.98);
  animation: none;
}
.notes-tts-wrap .rf-fab:focus {
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: none;
}
.notes-tts-wrap .rf-fab:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}
.notes-tts-wrap .rf-fab svg {
  width: 11px;
  height: 11px;
}
.notes-tts-wrap .rf-fab-badge {
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: 0.6rem;
}

/* When chat button is in TTS bar, nudge slide number right so it doesn’t sit under the buttons */
.reveal.rf-chat-in-tts .slide-number {
  left: 88px !important;
}

/* Profile button (next to chat FAB, shown when signed in) */
.rf-profile-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(30, 27, 42, 0.95) 0%, rgba(15, 13, 24, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.15);
  color: rgb(var(--rf-accent-rgb));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.2s ease;
}
.rf-profile-btn.rf-hidden {
  display: none !important;
}
.rf-profile-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.35);
  color: rgba(var(--rf-accent-rgb), 0.95);
}
.rf-profile-btn svg {
  width: 24px;
  height: 24px;
}
.notes-tts-wrap .rf-profile-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: none;
  background: rgba(55, 65, 81, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.notes-tts-wrap .rf-profile-btn:hover {
  background: rgba(55, 65, 81, 1);
  transform: scale(1.1);
}
.notes-tts-wrap .rf-profile-btn svg {
  width: 11px;
  height: 11px;
}

/* Profile popup (above profile button) */
.rf-profile-popup {
  position: fixed;
  z-index: 10000;
  min-width: 220px;
  max-width: 280px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(30, 27, 42, 0.98) 0%, rgba(15, 13, 24, 0.99) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.rf-profile-popup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-profile-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.rf-profile-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--rf-accent-rgb), 0.3);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rf-profile-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-profile-email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0.25rem 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-profile-signout {
  display: block;
  width: 100%;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 0 0 11px 11px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.rf-profile-signout:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* ---- Full-screen profile page ---- */
.rf-profile-page {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rf-profile-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem 2rem;
}
.rf-profile-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}
.rf-profile-page-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.rf-profile-page-identity .rf-profile-photo {
  width: 56px;
  height: 56px;
}
.rf-profile-page-identity .rf-profile-initial {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}
.rf-profile-meta {
  min-width: 0;
}
.rf-profile-page-identity .rf-profile-name {
  font-size: 1.25rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-profile-page-identity .rf-profile-email {
  margin: 0.25rem 0 0 0;
}
.rf-profile-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.rf-profile-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.rf-profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 100%;
  margin: 0 auto;
}
.rf-profile-section h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.75rem 0;
}
.rf-profile-section p,
.rf-profile-empty {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.5rem 0;
}
.rf-profile-loading {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
.rf-profile-visited-list,
.rf-profile-ratings-list,
.rf-profile-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.rf-profile-visit-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-profile-visit-thumb {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}
.rf-profile-visit-no-thumb {
  width: 80px;
  height: 52px;
  border-radius: 8px;
  background: rgba(var(--rf-accent-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}
.rf-profile-visit-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.rf-profile-visit-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-profile-visit-open {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: rgb(var(--rf-accent-rgb));
  text-decoration: none;
}
.rf-profile-visit-open:hover {
  text-decoration: underline;
}
.rf-profile-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-profile-rating-row:last-child {
  border-bottom: none;
}
.rf-profile-rating-title {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-profile-stars {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}
.rf-profile-star {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.2);
}
.rf-profile-star.rf-filled {
  color: #fbbf24;
}
.rf-profile-comment-item {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-profile-comment-pres {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rf-profile-comment-slide {
  font-size: 0.8125rem;
  margin-left: 0.35rem;
}
.rf-profile-comment-link {
  color: rgb(var(--rf-accent-rgb));
  text-decoration: none;
}
.rf-profile-comment-link:hover {
  text-decoration: underline;
}
.rf-profile-comment-snippet {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.5rem 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-profile-notif-toggle-wrap {
  margin-bottom: 0.75rem;
}
.rf-profile-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.rf-profile-toggle input {
  width: 18px;
  height: 18px;
  accent-color: rgb(var(--rf-accent-rgb));
}
.rf-profile-notif-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-profile-notif-item {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(var(--rf-accent-rgb), 0.15);
  color: rgb(var(--rf-accent-rgb));
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background 0.2s ease;
}
.rf-profile-notif-item:hover {
  background: rgba(var(--rf-accent-rgb), 0.25);
}
.rf-profile-settings-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.5rem 0;
}
.rf-profile-guest-signin {
  padding: 0 0 1rem 0;
}
.rf-profile-guest-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(var(--rf-accent-rgb), 0.2);
  color: rgb(var(--rf-accent-rgb));
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.rf-profile-guest-signin-btn:hover {
  background: rgba(var(--rf-accent-rgb), 0.35);
  box-shadow: 0 2px 8px rgba(var(--rf-accent-rgb), 0.2);
}
.rf-profile-danger {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.rf-profile-danger h2 {
  margin-bottom: 0.75rem;
}
.rf-profile-danger .rf-profile-signout {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.rf-profile-danger .rf-profile-signout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.rf-profile-remove-account {
  display: block;
  width: 100%;
  padding: 0.6rem 1.25rem;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  background: transparent;
  color: #fca5a5;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.rf-profile-remove-account:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
}
.rf-profile-section .rf-loading {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.rf-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.35);
  color: rgba(var(--rf-accent-rgb), 0.95);
  animation: rf-fab-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.rf-fab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--rf-accent-rgb), 0.5);
}
.rf-fab svg {
  width: 24px;
  height: 24px;
}
@keyframes rf-fab-pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.15); }
  50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--rf-accent-rgb), 0.15), 0 0 20px 2px rgba(var(--rf-accent-rgb), 0.25); }
}

/* ---- Rating pill (shown on last / target slide) ---- */
.rf-rating-pill {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9997;
  padding: 0.6rem 0.5rem 0.6rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(30, 27, 42, 0.97) 0%, rgba(15, 13, 24, 0.99) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: rf-pill-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.rf-rating-pill.rf-hidden {
  display: none !important;
}
.rf-rating-pill.rf-pill-fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}
.rf-rating-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.rf-rating-close {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  margin-left: 0.15rem;
  font-family: inherit;
}
.rf-rating-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}
.rf-stars {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.rf-star {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.15s ease;
  color: rgba(255, 255, 255, 0.25);
}
.rf-star:hover,
.rf-star.rf-active {
  color: #fbbf24;
  transform: scale(1.15);
}
.rf-star:hover {
  background: rgba(251, 191, 36, 0.12);
}
.rf-star svg {
  width: 24px;
  height: 24px;
}
.rf-star.rf-active svg {
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

/* ---- Slides + Chat layout (side-by-side, no overlay) ---- */
.rf-slides-chat-wrap {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.rf-slides-chat-wrap .reveal {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.rf-slides-chat-wrap .reveal .slides {
  height: 100%;
}

/* ---- Drawer (chat panel beside slides) ---- */
.rf-drawer {
  flex: 0 0 auto;
  width: 0;
  min-width: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), min-width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(30, 27, 42, 0.99) 0%, rgba(15, 13, 24, 0.99) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}
.rf-drawer.rf-open {
  width: 380px;
  min-width: 380px;
}
.rf-drawer-inner {
  width: 380px;
  min-width: 380px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Fallback: when .reveal is not present, drawer overlays (fixed right) */
.rf-drawer-overlay {
  position: fixed !important;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  min-width: 380px;
  z-index: 10000;
  transform: translateX(100%);
}
.rf-drawer-overlay.rf-open {
  transform: translateX(0);
}

.rf-drawer-header {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-drawer-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}
.rf-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}
.rf-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.rf-drawer-close:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--rf-accent-rgb), 0.5);
}

.rf-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Subscribe block */
.rf-subscribe-block {
  flex-shrink: 0;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-subscribe-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem 0;
}
.rf-subscribe-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.75rem 0;
}
.rf-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-subscribe-email {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.rf-subscribe-email::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.rf-subscribe-email:focus {
  outline: none;
  border-color: rgba(var(--rf-accent-rgb), 0.5);
}
.rf-subscribe-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, rgb(var(--rf-accent-rgb)) 0%, rgba(var(--rf-accent-rgb), 0.88) 100%);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.rf-subscribe-btn:hover {
  transform: translateY(-1px);
}
.rf-subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.rf-subscribe-success {
  color: #86efac;
  font-size: 0.875rem;
  font-weight: 600;
}
.rf-subscribe-success.rf-hidden {
  display: none !important;
}
.rf-subscribe-form.rf-hidden {
  display: none !important;
}

/* ---- Chat login (when not signed in) ---- */
.rf-chat-login {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}
.rf-chat-login.rf-hidden {
  display: none !important;
}
.rf-chat-login-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.rf-chat-login-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}
.rf-chat-login-error {
  font-size: 0.8125rem;
  color: #fca5a5;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  margin: 0;
}
.rf-chat-login-error.rf-hidden {
  display: none !important;
}
.rf-chat-login-google,
.rf-chat-login-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  box-sizing: border-box;
}
.rf-chat-login-google:active,
.rf-chat-login-github:active {
  transform: scale(0.98);
}
.rf-chat-login-google:disabled,
.rf-chat-login-github:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.rf-login-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.rf-chat-login-google {
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
}
.rf-chat-login-google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);
}
.rf-chat-login-github {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #24292f;
  color: #fff;
}
.rf-chat-login-github:hover {
  background: #32383f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ---- Chat panel (per-slide thread) ---- */
.rf-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
}
.rf-chat-panel.rf-hidden {
  display: none !important;
}
.rf-chat-panel.rf-visible {
  animation: rf-fade-in 0.25s ease;
}
.rf-chat-slide-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.rf-chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-chat-empty {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 1rem;
  text-align: center;
}
.rf-chat-msg {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-chat-msg-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a78bfa;
}
.rf-chat-msg-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  width: 100%;
  word-break: break-word;
}
.rf-chat-msg-time {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.35);
  margin-left: auto;
}
.rf-chat-form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-chat-name {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.8125rem;
  box-sizing: border-box;
}
.rf-chat-name::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.rf-chat-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.875rem;
  resize: none;
  min-height: 52px;
  box-sizing: border-box;
}
.rf-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.rf-chat-input:focus,
.rf-chat-name:focus {
  outline: none;
  border-color: rgba(var(--rf-accent-rgb), 0.5);
}
.rf-chat-form-error {
  font-size: 0.75rem;
  color: #fca5a5;
  margin-top: 0.25rem;
  min-height: 1.25rem;
}
.rf-chat-form-error.rf-hidden {
  display: none !important;
}
.rf-chat-send {
  align-self: flex-end;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, rgb(var(--rf-accent-rgb)) 0%, rgba(var(--rf-accent-rgb), 0.88) 100%);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.rf-chat-send:hover {
  transform: translateY(-1px);
}
.rf-chat-send:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--rf-accent-rgb), 0.5);
}

/* ---- Chat alert on slide (toast when new message, drawer closed) ---- */
.rf-chat-toast-wrap {
  position: fixed;
  bottom: 5rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.rf-chat-toast-wrap .rf-chat-toast {
  pointer-events: auto;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(30, 27, 42, 0.98) 0%, rgba(15, 13, 24, 0.99) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(var(--rf-accent-rgb), 0.95);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: rf-toast-in 0.3s ease-out;
}
.rf-chat-toast-wrap .rf-chat-toast:hover {
  background: linear-gradient(135deg, rgba(49, 46, 66, 0.98) 0%, rgba(30, 27, 42, 0.99) 100%);
  color: rgb(var(--rf-accent-rgb));
}
@keyframes rf-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hidden field for presentation id */
.rf-hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Animations */
@keyframes rf-fab-in {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes rf-pill-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes rf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Mobile: slides on top, chat on bottom ---- */
@media (max-width: 768px) {
  .rf-slides-chat-wrap {
    flex-direction: column;
  }
  .rf-slides-chat-wrap .reveal {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 100%;
  }
  .rf-drawer {
    width: 100% !important;
    min-width: 100% !important;
    height: 0;
    min-height: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), min-height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .rf-drawer.rf-open {
    width: 100% !important;
    min-width: 100% !important;
    height: 50%;
    min-height: 260px;
    max-height: 70vh;
  }
  .rf-drawer-inner {
    width: 100%;
    min-width: 0;
    height: 100%;
  }
  .rf-chat-toast-wrap {
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    align-items: center;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .rf-fab,
  .rf-star,
  .rf-modal,
  .rf-overlay,
  .rf-rating-pill,
  .rf-chat-toast {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .rf-drawer {
    transition-duration: 0.05s !important;
  }
}


/* lectura.css */
/**
 * Lectura — unified bar: TTS, Chat, Profile, slide number (bottom-left).
 */
.reveal .lectura-bar {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reveal .lectura-bar-tts,
.reveal .lectura-bar-chat,
.reveal .lectura-bar-profile {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Chat slot always reserves space so the Chat button is visible */
.reveal .lectura-bar-chat {
  min-width: 0;
  flex-shrink: 0;
}

.reveal .lectura-bar-slide-number {
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.reveal .rf-presence {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.reveal .rf-presence:empty {
  display: none;
}

/* All bar buttons: unified 22px circle style */
.lectura-bar-btn,
.reveal .notes-tts-btn,
.reveal .notes-tts-gear {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(55, 65, 81, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.15s;
}
.lectura-bar-btn:hover,
.reveal .notes-tts-btn:hover,
.reveal .notes-tts-gear:hover {
  background: rgba(55, 65, 81, 1);
  transform: scale(1.1);
}
.reveal .notes-tts-btn {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
  box-shadow: 0 1px 4px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
}
.reveal .notes-tts-btn:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 1);
}
.reveal .notes-tts-btn.active {
  background: rgb(var(--notes-tts-highlight-rgb, 124, 58, 237));
}
.reveal .notes-tts-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.lectura-bar-btn .lectura-bar-btn-icon,
.reveal .notes-tts-btn .lectura-bar-btn-icon,
.reveal .notes-tts-gear .lectura-bar-btn-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.lectura-bar-chat-btn,
.lectura-bar-settings-btn {
  position: relative;
}
/* Hide TTS gear in bar — settings button replaces it */
.reveal .lectura-bar-tts .notes-tts-gear {
  display: none;
}

/* When TTS wrap is inside the bar, it has no extra margin */
.reveal .lectura-bar-tts .notes-tts-wrap {
  position: static;
  bottom: auto;
  left: auto;
}

/* Single Settings entry: hide TTS gear in bar; use the Settings pill for profile + TTS settings */
.reveal .lectura-bar-tts .notes-tts-wrap .notes-tts-gear {
  display: none;
}

.reveal .lectura-bar .slide-number {
  position: static;
  bottom: auto;
  left: auto;
}

/* Chat/Profile buttons in bar — match TTS size */
.lectura-bar .rf-fab.rf-fab-in-bar,
.lectura-bar .rf-profile-btn-bar {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(55, 65, 81, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.15s;
}
.lectura-bar .rf-fab.rf-fab-in-bar:hover,
.lectura-bar .rf-profile-btn-bar:hover {
  background: rgba(55, 65, 81, 1);
  transform: scale(1.1);
}
.lectura-bar .rf-fab.rf-fab-in-bar svg,
.lectura-bar .rf-profile-btn-bar svg {
  width: 11px;
  height: 11px;
}
.lectura-bar .rf-fab-badge {
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: 0.6rem;
}

/* Login overlay (Profile when not logged in) */
.rf-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.rf-login-overlay.rf-open {
  opacity: 1;
  visibility: visible;
}
.rf-login-overlay-inner {
  position: relative;
  padding: 2rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 27, 42, 0.98) 0%, rgba(15, 13, 24, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  max-width: 360px;
  width: 90%;
}
.rf-login-overlay-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
}
.rf-login-overlay-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 1.25rem 0;
}
.rf-login-overlay-inner .rf-chat-login-error {
  margin-bottom: 0.75rem;
}
.rf-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.rf-login-overlay-inner .rf-login-icon-svg {
  width: 18px;
  height: 18px;
}
.rf-login-overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.rf-login-overlay-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat login panel inside drawer */
.rf-chat-login {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-height: 0;
  gap: 0.75rem;
}
.rf-chat-login-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.rf-chat-login-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.45;
}
.rf-chat-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
}
.rf-chat-login-buttons .rf-login-icon-svg {
  width: 18px;
  height: 18px;
}

/* ════════════════════════════════════════════════════════════
   Settings page — sidebar nav + content panels
   ════════════════════════════════════════════════════════════ */
.rf-profile-page.rf-settings-page {
  z-index: 10002;
  background: #0d0b14;
  display: flex;
  flex-direction: column;
}

/* ── Layout: sidebar + main ── */
.rf-settings-layout {
  display: flex;
  height: 100%;
  width: 100%;
  min-height: 0;
}

/* ── Sidebar ── */
.rf-settings-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rf-settings-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
}
.rf-settings-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}
.rf-settings-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rf-settings-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Identity block in sidebar */
.rf-settings-ident {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  margin: 0.75rem 0.75rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.rf-settings-ident-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
  color: rgba(255, 255, 255, 0.95);
  object-fit: cover;
}
img.rf-settings-ident-avatar {
  display: block;
}
.rf-settings-ident-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.rf-settings-ident-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

}
.rf-settings-ident-email {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-settings-ident-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}
.rf-settings-ident-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.2);
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.85);
  width: fit-content;
  margin-top:5px;
}
.rf-settings-ident-badge-author {
  background: rgba(234, 179, 8, 0.2);
  color: rgba(250, 204, 21, 0.95);
}

/* Navigation */
.rf-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.5rem 0.75rem;
  flex: 1;
}
.rf-settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.rf-settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}
.rf-settings-nav-btn.rf-active {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.12);
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.95);
  font-weight: 600;
}
.rf-settings-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.rf-settings-nav-btn.rf-active .rf-settings-nav-icon {
  opacity: 1;
}
.rf-settings-nav-icon svg {
  width: 100%;
  height: 100%;
}

/* Author-only nav buttons: gold tint to distinguish from viewer tabs */
.rf-settings-nav-btn[data-section="insights"] {
  color: rgba(250, 204, 21, 0.6);
}
.rf-settings-nav-btn[data-section="insights"]:hover {
  background: rgba(234, 179, 8, 0.08);
  color: rgba(250, 204, 21, 0.85);
}
.rf-settings-nav-btn[data-section="insights"].rf-active {
  background: rgba(234, 179, 8, 0.15);
  color: rgba(250, 204, 21, 0.95);
}

/* ── Main content area ── */
.rf-settings-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2.5rem 3rem 3rem;
  display: flex;
  flex-direction: column;
}

/* Panels */
.rf-settings-panel {
  max-width: 100%;
  animation: rf-panel-in 0.15s ease;
}
.rf-settings-panel.rf-hidden {
  display: none;
}
@keyframes rf-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rf-settings-panel-head {
  margin-bottom: 2rem;
}
.rf-settings-panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.97);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.rf-settings-panel-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  line-height: 1.55;
}

/* ── Appearance: color picker ── */
.rf-settings-color-preview {
  margin-bottom: 1.5rem;
}
.rf-settings-color-preview-bar {
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.rf-settings-color-preview-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.rf-settings-color-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}
.rf-settings-color-swatch {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  border: 3px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.rf-settings-color-swatch:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.rf-settings-color-swatch.rf-active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: scale(1.15);
}
.rf-settings-color-note {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.5;
}

/* ── Form controls ── */
.rf-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.rf-settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rf-settings-field-full {
  grid-column: 1 / -1;
}
.rf-settings-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}
.rf-settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rf-settings-value {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}
.rf-settings-sync-note {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 1.5rem;
}
.rf-settings-empty {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
}
.rf-settings-panel .rf-loading {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  font-size: 0.875rem;
}

/* Select dropdown */
.rf-settings-select {
  display: block;
  width: 100%;
  padding: 0.6rem 2.25rem 0.6rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.45)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1.1rem;
}
.rf-settings-select:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.rf-settings-select:focus {
  outline: none;
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.15);
}
.rf-settings-select option {
  background: #1e1b2e;
  color: #fff;
}

/* Range slider */
.rf-settings-range {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 0.35rem;
}
.rf-settings-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.95);
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}
.rf-settings-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.rf-settings-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.95);
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.rf-settings-range:focus {
  outline: none;
}
.rf-settings-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Toggle switch */
.rf-settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.rf-settings-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.rf-settings-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.rf-settings-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
  cursor: pointer;
}
.rf-settings-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.rf-settings-toggle-input:checked + .rf-settings-toggle-track {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.65);
}
.rf-settings-toggle-input:checked + .rf-settings-toggle-track::after {
  transform: translateX(20px);
}
.rf-settings-toggle-input:focus + .rf-settings-toggle-track {
  box-shadow: 0 0 0 3px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.2);
}
.rf-settings-toggle-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

/* ── Notification settings ── */
.rf-settings-notif-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.rf-settings-notif-scope {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-settings-notif-scope legend {
  padding: 0;
  margin-bottom: 0.35rem;
}
.rf-settings-radio-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s;
}
.rf-settings-radio-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.rf-settings-radio-input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s;
}
.rf-settings-radio-input:checked {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
}
.rf-settings-radio-input:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
}
.rf-settings-radio-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.35;
}
.rf-settings-notif-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Account & action buttons ── */
.rf-settings-account-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 380px;
}
.rf-settings-account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Linked providers */
.rf-settings-linked-providers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rf-settings-provider-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rf-settings-provider-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-settings-provider-row.rf-linked {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25);
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.06);
}
.rf-settings-provider-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rf-settings-provider-icon svg {
  display: block;
}
.rf-settings-provider-name {
  flex: 1;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-settings-provider-status {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.3);
}
.rf-settings-provider-row.rf-linked .rf-settings-provider-status {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.85);
}
.rf-settings-signin-hero {
  max-width: 360px;
}
.rf-settings-signin-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-settings-signin-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.55;
  margin: 0 0 1.25rem;
}
.rf-settings-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.rf-settings-btn:active {
  transform: scale(0.98);
}
.rf-settings-btn-primary {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.4);
  color: #fff;
  font-weight: 600;
}
.rf-settings-btn-primary:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.55);
}
.rf-settings-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.rf-settings-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}
.rf-settings-btn-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: rgba(254, 202, 202, 0.9);
}
.rf-settings-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fff;
}

/* Version info — always visible at bottom center of main area */
.rf-settings-version-info {
  font-size: 0.675rem;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.03em;
  font-family: monospace;
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  margin-top: auto;
}

/* ── Activity list ── */
.rf-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-activity-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.rf-activity-card:hover {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25);
}
.rf-activity-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
}
.rf-activity-card-body {
  flex: 1;
  min-width: 0;
}
.rf-activity-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.55rem;
}
.rf-activity-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}
/* Stat buttons (messages / replies) */
.rf-activity-stat-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  cursor: default;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rf-activity-stat-btn svg {
  opacity: 0.55;
  flex-shrink: 0;
}
.rf-activity-stat-btn.rf-activity-stat-active {
  cursor: pointer;
}
.rf-activity-stat-btn.rf-activity-stat-active:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.1);
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25);
  color: rgba(255, 255, 255, 0.75);
}
.rf-activity-stat-btn.rf-activity-stat-active:hover svg {
  opacity: 0.85;
}
.rf-activity-stat-btn.rf-active {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.15);
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
  color: rgba(255, 255, 255, 0.9);
}
.rf-activity-stat-btn.rf-active svg {
  opacity: 1;
}
.rf-activity-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  font-weight: 500;
}
.rf-activity-stat-badge svg {
  opacity: 0.55;
  flex-shrink: 0;
}
/* Expandable panels (messages / replies) */
.rf-activity-expand-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.15);
  max-height: 260px;
  overflow-y: auto;
}
.rf-activity-expand-panel.rf-hidden {
  display: none;
}
.rf-activity-reply-row {
  padding: 0.45rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 2px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.4);
}
.rf-activity-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}
.rf-activity-reply-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}
.rf-activity-reply-slide {
  font-size: 0.65rem;
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.7);
  text-decoration: none;
}
a.rf-activity-reply-slide:hover {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 1);
  text-decoration: underline;
}
.rf-activity-reply-context {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-activity-reply-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}
.rf-activity-stars {
  display: inline-flex;
  gap: 2px;
}
.rf-activity-star {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.18);
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, transform 0.12s;
}
.rf-activity-star:hover {
  transform: scale(1.25);
}
.rf-activity-star.rf-filled {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
}
.rf-activity-star.rf-hover {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.6);
}
.rf-activity-msgs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rf-activity-msgs svg {
  opacity: 0.5;
}
.rf-activity-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.rf-activity-card-link:hover {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 1);
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.1);
}

/* ── Shared avatar styles (used by insights) ── */
.rf-reviews-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.rf-reviews-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Notification content ── */
.rf-settings-wip-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.18);
  color: rgba(250, 204, 21, 0.85);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}
.rf-settings-wip-banner svg {
  flex-shrink: 0;
  stroke: rgba(250, 204, 21, 0.85);
}
.rf-settings-disabled {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}
.rf-settings-notif-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rf-settings-notif-content .rf-profile-notif-list {
  margin-top: 0.5rem;
}
.rf-profile-notif-item {
  display: block;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: background 0.15s;
}
.rf-profile-notif-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════
   Insights dashboard (author-only)
   ════════════════════════════════════════════════════════════ */
.rf-insights-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rf-insights-loading {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
.rf-insights-section {
  margin-bottom: 2rem;
}
.rf-insights-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.75rem;
}
.rf-insights-section-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  margin: -0.5rem 0 0.75rem;
}

/* Overview cards */
.rf-insights-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.rf-insights-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.rf-insights-card:hover {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25);
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.04);
}
.rf-insights-card-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.rf-insights-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.3rem;
}

/* Slide engagement heatmap */
.rf-insights-heatmap-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.65rem;
}
.rf-insights-heatmap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.rf-insights-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.rf-insights-legend-msgs { background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.85); }
.rf-insights-legend-views { background: rgba(96, 165, 250, 0.8); }
.rf-insights-legend-dwell { background: rgba(52, 211, 153, 0.8); }
.rf-insights-legend-tts { background: rgba(251, 191, 36, 0.8); }
.rf-insights-heatmap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.rf-insights-heatmap::-webkit-scrollbar { width: 4px; }
.rf-insights-heatmap::-webkit-scrollbar-track { background: transparent; }
.rf-insights-heatmap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 2px; }
.rf-insights-heatmap-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2px 4px 2px 0;
  border-radius: 4px;
  transition: background 0.15s ease;
  position: relative;
}
.rf-insights-heatmap-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.rf-insights-heatmap-label {
  width: 28px;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rf-insights-heatmap-nav {
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 3px;
  transition: color 0.15s ease, background 0.15s ease;
}
.rf-insights-heatmap-nav:hover {
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.95);
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.12);
}
.rf-insights-heatmap-heading {
  position: absolute;
  left: 36px;
  bottom: 100%;
  margin-bottom: 2px;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  background: rgba(30, 30, 40, 0.92);
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.rf-insights-heatmap-row:hover .rf-insights-heatmap-heading {
  opacity: 1;
}
.rf-insights-heatmap-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.rf-insights-bar {
  height: 5px;
  border-radius: 2px;
  min-width: 0;
  transition: width 0.3s ease, height 0.15s ease;
  position: relative;
  cursor: default;
}
.rf-insights-bar[data-val]:hover {
  height: 8px;
}
.rf-insights-bar[data-val]::after {
  content: attr(data-val);
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translate(100%, -50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.rf-insights-heatmap-row:hover .rf-insights-bar[data-val]::after {
  opacity: 1;
}
.rf-insights-bar-msgs { background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.75); }
.rf-insights-bar-views { background: rgba(96, 165, 250, 0.6); }
.rf-insights-bar-dwell { background: rgba(52, 211, 153, 0.6); }
.rf-insights-bar-tts { background: rgba(251, 191, 36, 0.6); }

/* Anonymous striped overlay (pseudo-element on the bar) */
.rf-bar-has-anon::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--anon-start, 0%);
  width: calc(var(--anon-end, 0%) - var(--anon-start, 0%));
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(
    -45deg,
    rgba(var(--bar-rgb, 255,255,255), 0.55),
    rgba(var(--bar-rgb, 255,255,255), 0.55) 1.5px,
    transparent 1.5px,
    transparent 3.5px
  );
  pointer-events: none;
}

/* Old-version faded tail (right portion of bar beyond current data) */
.rf-bar-has-old::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--cur-end, 0%);
  width: calc(100% - var(--cur-end, 0%));
  height: 100%;
  border-radius: inherit;
  border: 1.5px dashed rgba(var(--bar-rgb, 255,255,255), 0.4);
  background: none;
  pointer-events: none;
  box-sizing: border-box;
}

/* Legend extras */
.rf-insights-legend-sep {
  color: rgba(255, 255, 255, 0.15);
  margin: 0 0.15rem;
}
.rf-insights-legend-old {
  background: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.4);
}
.rf-insights-legend-anon {
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0.45) 1.5px,
    transparent 1.5px,
    transparent 3.5px
  );
}

/* Rating distribution */
.rf-insights-rating-dist {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rf-insights-dist-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.rf-insights-dist-stars {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.rf-insights-dist-bar-wrap {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
  min-width: 0;
}
.rf-insights-dist-bar {
  height: 100%;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.65);
  border-radius: 5px;
  transition: width 0.3s ease;
  min-width: 0;
}
.rf-insights-dist-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  min-width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Expandable dist rows */
.rf-insights-dist-group {
  display: flex;
  flex-direction: column;
}
.rf-insights-dist-toggle {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  transition: background 0.15s ease;
}
.rf-insights-dist-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}
.rf-insights-dist-chevron {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease;
  margin-left: 0.25rem;
}
.rf-insights-dist-group.rf-expanded .rf-insights-dist-chevron {
  transform: rotate(180deg);
}
.rf-insights-dist-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0.4rem;
}
.rf-insights-dist-group.rf-expanded .rf-insights-dist-detail {
  max-height: 600px;
  padding: 0.5rem 0.4rem 0.3rem;
}

/* Rater rows (shared by dist detail + overview card detail) */
.rf-insights-rater-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.rf-insights-rater-row:last-child { border-bottom: none; }
.rf-insights-rater-row .rf-reviews-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.rf-insights-rater-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-insights-rater-chat {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
.rf-insights-rater-none {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.3rem 0;
}

/* Clickable overview card */
.rf-insights-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.rf-insights-card-clickable:hover {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.4);
  box-shadow: 0 0 0 1px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.15);
}
.rf-insights-card-clickable.rf-expanded {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.5);
}

/* Overview card detail panel */
.rf-insights-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0 0.75rem;
}
.rf-insights-card-detail.rf-expanded {
  max-height: 800px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Attention flags */
.rf-insights-flags {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-insights-flag {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border-left: 3px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}
.rf-insights-flag-confusion {
  border-left-color: rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.05);
}
.rf-insights-flag-complex {
  border-left-color: rgba(96, 165, 250, 0.7);
  background: rgba(96, 165, 250, 0.05);
}
.rf-insights-flag-silent {
  border-left-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}
.rf-insights-flag-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.3;
}
.rf-insights-flag-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.rf-insights-flag-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.rf-insights-flag-detail {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Chat hotspots */
.rf-insights-hotspots {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rf-insights-hotspot {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: border-color 0.15s;
}
.rf-insights-hotspot:hover {
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.25);
}
.rf-insights-hotspot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
}
.rf-insights-hotspot-slide {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.rf-insights-hotspot-count {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.8);
}
.rf-insights-hotspot-preview {
  padding: 0 0.85rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.rf-insights-hotspot-msg {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-insights-hotspot-author {
  font-weight: 600;
  color: rgba(167, 139, 250, 0.8);
  margin-right: 0.25rem;
}

/* Low rater feedback */
.rf-insights-low-raters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rf-insights-lr-card {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.rf-insights-lr-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.rf-insights-lr-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-insights-lr-messages {
  padding: 0.5rem 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rf-insights-lr-msg {
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.6);
  border-left: 2px solid rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.35);
  padding-left: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-insights-lr-msg-slide {
  font-weight: 600;
  color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.7);
  margin-right: 0.2rem;
}
.rf-insights-lr-none {
  border-left-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
}

/* Insights responsive */
@media (max-width: 767px) {
  .rf-insights-cards {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .rf-insights-card {
    padding: 1rem 0.5rem;
  }
  .rf-insights-card-num {
    font-size: 1.35rem;
  }
  .rf-insights-heatmap {
    max-height: 300px;
  }
  .rf-insights-heatmap-legend {
    gap: 0.5rem;
  }
}

/* ── Version banner & breakdown ── */
.rf-insights-version-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.rf-insights-version-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
}
.rf-insights-version-current {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.rf-insights-version-old {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.rf-insights-version-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
}
.rf-insights-version-old-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(251, 191, 36, 0.7);
}

/* Anonymous / signed-in dots */
.rf-insights-anon-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.6);
  margin-right: 0.3rem;
  vertical-align: middle;
}
.rf-insights-signed-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.7);
  margin-right: 0.3rem;
  vertical-align: middle;
}

/* Card sub-text for anonymous breakdown */
.rf-insights-card-sub {
  display: block;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* Viewer breakdown section */
.rf-insights-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-insights-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-insights-breakdown-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 7rem;
}
.rf-insights-breakdown-stat {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* Old version section */
.rf-insights-old-section {
  opacity: 0.65;
  border-top: 1px solid rgba(251, 191, 36, 0.15);
  padding-top: 1.25rem;
}
.rf-insights-old-section:hover {
  opacity: 1;
}
.rf-insights-old-section .rf-insights-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.rf-insights-purge-btn {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rf-insights-purge-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}
.rf-insights-purge-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.rf-insights-old-versions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rf-insights-old-version-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-insights-old-stat {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}
.rf-insights-old-anon {
  margin-left: auto;
  color: rgba(251, 191, 36, 0.55);
}

@media (max-width: 767px) {
  .rf-insights-breakdown-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .rf-insights-breakdown-label {
    min-width: unset;
    width: 100%;
  }
  .rf-insights-old-version-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* ── Legacy compat / profile helpers ── */
.rf-profile-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.rf-profile-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.rf-profile-empty,
.rf-profile-settings-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0.5rem 0 0 0;
}

/* ── Responsive: mobile ── */
@media (max-width: 767px) {
  .rf-settings-layout {
    flex-direction: column;
  }
  .rf-settings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    overflow-y: visible;
    flex-shrink: 0;
  }
  .rf-settings-sidebar-head {
    padding: 0.75rem 1rem 0;
  }
  .rf-settings-ident {
    margin: 0.5rem 0.75rem 0;
    padding: 0.5rem 0.75rem;
  }
  .rf-settings-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10003;
    flex-direction: row;
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    gap: 0;
    justify-content: stretch;
    background: rgba(13, 11, 20, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }
  .rf-settings-nav-btn {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.25rem;
    font-size: 0.6rem;
    border-radius: 6px;
    min-width: 0;
  }
  .rf-settings-nav-btn span:not(.rf-settings-nav-icon) {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
  }
  .rf-settings-nav-icon {
    width: 17px;
    height: 17px;
  }
  .rf-settings-main {
    padding: 1.5rem 1.25rem calc(2rem + 60px);
  }
  .rf-settings-panel-title {
    font-size: 1.25rem;
  }
  .rf-settings-panel-head {
    margin-bottom: 1.25rem;
  }
  .rf-settings-grid {
    grid-template-columns: 1fr;
  }
  .rf-settings-color-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
  }
  .rf-settings-account-content {
    max-width: none;
    width: 100%;
  }
  .rf-settings-signin-hero {
    max-width: none;
    width: 100%;
  }
  .rf-settings-btn {
    width: 100%;
    text-align: center;
  }
  .rf-settings-linked-providers,
  .rf-settings-account-actions {
    width: 100%;
  }
}

/* Chat auth loading (shown until first onAuthStateChanged) */
.rf-chat-auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 80px;
  padding: 1.25rem 1rem;
}
.rf-chat-auth-loading.rf-hidden {
  display: none;
}

.rf-chat-presence {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 0.5rem;
  font-weight: normal;
}

/* Chat messages loading state (shown until first snapshot) */
.rf-chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  min-height: 4rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}
.rf-chat-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: rf-chat-spin 0.7s linear infinite;
}
@keyframes rf-chat-spin {
  to { transform: rotate(360deg); }
}
.rf-chat-loading-text {
  font-size: 0.8125rem;
}

/* ========== Chat UX (overrides + best practices) ========== */
.rf-drawer-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rf-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 1rem 1rem;
}
.rf-chat-slide-label {
  flex-shrink: 0;
  padding: 0.75rem 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}
.rf-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.rf-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.rf-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.rf-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.rf-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Message bubble (Slack/Discord style) */
.rf-chat-msg {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rf-chat-msg:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}
.rf-chat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.rf-chat-msg-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.95); /* fallback; overridden by inline per-user color */
  flex-shrink: 0;
}
.rf-chat-msg-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.rf-chat-msg-time {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.35);
}
.rf-chat-msg-text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  word-break: break-word;
  white-space: pre-wrap;
}

/* New (unread) message — subtle left accent + pill */
.rf-chat-msg-new {
  background: rgba(124, 58, 237, 0.08);
  border-left: 3px solid rgba(124, 58, 237, 0.7);
  padding-left: calc(0.85rem - 3px);
}
.rf-chat-msg-new:hover {
  background: rgba(124, 58, 237, 0.1);
}
.rf-chat-msg-new-pill {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(167, 139, 250, 0.85);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.2);
  line-height: 1.2;
  white-space: nowrap;
}

/* Reply to message */
.rf-chat-msg-reply-btn {
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.9);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.rf-chat-msg-reply-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(167, 139, 250, 0.5);
}
.rf-chat-msg {
  position: relative;
}
.rf-chat-msg-delete-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(239, 68, 68, 0.65);
  border: 2px solid #0d0b14;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  opacity: 0;
  pointer-events: none;
}
.rf-chat-msg:hover .rf-chat-msg-delete-btn {
  opacity: 1;
  pointer-events: auto;
}
.rf-chat-msg-delete-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.15);
}
/* ── Delete confirmation dialog ── */
.rf-chat-delete-confirm {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  animation: rf-fade-in 0.12s ease-out;
}
@keyframes rf-fade-in { from { opacity: 0; } to { opacity: 1; } }
.rf-chat-delete-dialog {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  min-width: 200px;
  max-width: 260px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.rf-chat-delete-text {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}
.rf-chat-delete-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.rf-chat-delete-cancel,
.rf-chat-delete-ok {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.rf-chat-delete-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
.rf-chat-delete-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}
.rf-chat-delete-ok {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}
.rf-chat-delete-ok:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.03);
}

.rf-chat-msg-reply-quote {
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.5);
  border-left: 2px solid rgba(124, 58, 237, 0.5);
  padding: 0.25rem 0 0.25rem 0.5rem;
  margin-top: 0.2rem;
  margin-bottom: 0.15rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.rf-chat-msg-version-remark {
  display: block;
  font-size: 0.6875rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.35rem;
}

/* Reply preview in composer (above input) */
.rf-chat-reply-preview {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
}
.rf-chat-reply-preview.rf-hidden {
  display: none;
}
.rf-chat-reply-preview-text {
  flex: 1;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-chat-reply-preview-cancel {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.rf-chat-reply-preview-cancel:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Empty & loading states */
.rf-chat-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}
.rf-chat-loading {
  padding: 2rem 1rem;
}

/* Composer (reply preview + input + send) */
.rf-chat-form {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.4rem;
}
.rf-chat-form .rf-chat-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  max-height: 100px;
  padding: 0.45rem 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.35;
  resize: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rf-chat-form .rf-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.rf-chat-form .rf-chat-input:focus {
  outline: none;
  border-color: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.12);
}
.rf-chat-form .rf-chat-send {
  flex-shrink: 0;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 18px;
  border: none;
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.9);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.2s ease, transform 0.15s ease;
}
.rf-chat-form .rf-chat-send:hover {
  background: rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 1);
  transform: translateY(-1px);
}
.rf-chat-form .rf-chat-send:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--notes-tts-highlight-rgb, 124, 58, 237), 0.4);
}
.rf-chat-form-error {
  flex-basis: 100%;
  font-size: 0.7rem;
  color: #fca5a5;
  margin-top: 0.15rem;
}

/* Presence in header */
.rf-chat-presence {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

/* Mobile: chat padding to avoid overlap with bottom-left icons */
@media (max-width: 767px) {
  .rf-chat-panel {
    padding-bottom: 3rem;
  }
  .rf-chat-login {
    padding: 1.25rem 0.75rem 3rem;
  }
  .rf-chat-login-buttons {
    max-width: 100%;
  }
}

/* Legacy profile settings overrides (for TTS gear panel outside settings page) */
.rf-profile-page .notes-tts-rate-label,
.rf-profile-page .notes-tts-color-label {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 0.8125rem;
}
.rf-profile-page .notes-tts-rate-value {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.8125rem;
}
