/* ========================================
   Ask Mirror Talk Widget — Premium UX
   ======================================== */

/* Container */
.ask-mirror-talk {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 28px;
  border: 1px solid #e6e2dc;
  background: linear-gradient(180deg, #faf8f4 0%, #f5f2ed 100%);
  font-family: "Source Serif 4", Georgia, serif;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;     /* prevent iOS text inflation */
  text-size-adjust: 100%;
}

/* Subtle top accent bar */
.ask-mirror-talk::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2e2a24, #8b7355, #2e2a24);
}

/* Title */
.ask-mirror-talk h2 {
  margin-top: 0;
  margin-bottom: 4px;
  color: #2e2a24;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.ask-mirror-talk h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  color: #2e2a24;
  font-size: 18px;
  font-weight: 600;
}

/* Label */
.ask-mirror-talk label {
  display: block;
  font-size: 15px;
  color: #6b665d;
  margin-bottom: 4px;
  font-style: italic;
}

/* ========================================
   Form Input
   ======================================== */
#ask-mirror-talk-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.6;
  margin: 8px 0 12px;
  border: 2px solid #d4cec6;
  border-radius: 10px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
}

#ask-mirror-talk-input:focus {
  outline: none;
  border-color: #2e2a24;
  box-shadow: 0 0 0 4px rgba(46, 42, 36, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

#ask-mirror-talk-input::placeholder {
  color: #b5afa5;
  font-style: italic;
}

#ask-mirror-talk-input:disabled {
  background: #f0ede8;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* ========================================
   Submit Button
   ======================================== */
.ask-mirror-talk button[type="submit"] {
  background: linear-gradient(135deg, #2e2a24, #3d3731);
  color: #fff;
  border: none;
  padding: 13px 32px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(46, 42, 36, 0.2);
}

.ask-mirror-talk button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ask-mirror-talk button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #3d3731, #524b42);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(46, 42, 36, 0.3);
}

.ask-mirror-talk button[type="submit"]:hover:not(:disabled)::after {
  opacity: 1;
}

.ask-mirror-talk button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(46, 42, 36, 0.2);
}

.ask-mirror-talk button[type="submit"]:disabled {
  background: #8b8378;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

/* ========================================
   Response Section
   ======================================== */
.ask-mirror-talk-response {
  margin-top: 24px;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6e2dc;
  min-height: 0;
  line-height: 1.85;
  color: #2e2a24;
  font-size: 16px;
  position: relative;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  /* Smooth reveal — element stays in layout flow once shown;
     opacity + translate transition means no sudden pop-in */
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  contain: layout style;
  overflow-anchor: auto;
}

/* Subtle top accent on the response card */
.ask-mirror-talk-response.amt-visible::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #d4a857 40%, #8b7355 60%, transparent 100%);
  border-radius: 12px 12px 0 0;
  opacity: 0.6;
}

/* Visible state — added once on first question, never removed */
.ask-mirror-talk-response.amt-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lock min-height during loading and streaming to prevent height jumps */
.ask-mirror-talk-response.amt-streaming,
.ask-mirror-talk-response.amt-loading-state {
  min-height: 240px;
}

/* Response content — no animation during streaming to prevent layout bounce */
#ask-mirror-talk-output {
  overflow-anchor: none; /* prevent scroll anchoring thrash */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

#ask-mirror-talk-output p {
  margin: 0 0 16px 0;
}

#ask-mirror-talk-output p:last-child {
  margin-bottom: 0;
}

/* Streaming cursor — visible while streaming text */
.ask-mirror-talk-response.amt-streaming #ask-mirror-talk-output::after {
  content: '▍';
  display: inline;
  animation: blink 0.7s step-end infinite;
  color: #8b7355;
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Only animate paragraphs AFTER streaming is complete (class added by JS) */
#ask-mirror-talk-output.amt-complete p {
  animation: fadeInUp 0.4s ease-out both;
}

/* Stagger paragraph animations — only when complete */
#ask-mirror-talk-output.amt-complete p:nth-child(1) { animation-delay: 0.05s; }
#ask-mirror-talk-output.amt-complete p:nth-child(2) { animation-delay: 0.1s; }
#ask-mirror-talk-output.amt-complete p:nth-child(3) { animation-delay: 0.15s; }
#ask-mirror-talk-output.amt-complete p:nth-child(4) { animation-delay: 0.2s; }
#ask-mirror-talk-output.amt-complete p:nth-child(5) { animation-delay: 0.25s; }
#ask-mirror-talk-output.amt-complete p:nth-child(6) { animation-delay: 0.3s; }
#ask-mirror-talk-output.amt-complete p:nth-child(7) { animation-delay: 0.35s; }
#ask-mirror-talk-output.amt-complete p:nth-child(8) { animation-delay: 0.4s; }

/* Better spacing after headings in paragraphs */
.ask-mirror-talk-response p strong:only-child {
  display: block;
  margin-bottom: 8px;
}

/* Error state */
.ask-mirror-talk-response.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ========================================
   Loading Animation — Premium Shimmer
   ======================================== */
.amt-loading {
  padding: 8px 4px 20px;
  animation: fadeIn 0.25s ease-out;
}

/* Shimmer skeleton lines */
.amt-shimmer-group {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 22px;
}

.amt-shimmer {
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    #f0ede8 0%,
    #e8e3db 40%,
    #f0ede8 60%,
    #f0ede8 100%
  );
  background-size: 250% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

.amt-shimmer:nth-child(1) { width: 92%; }
.amt-shimmer:nth-child(2) { width: 77%; animation-delay: 0.1s; }
.amt-shimmer:nth-child(3) { width: 85%; animation-delay: 0.2s; }
.amt-shimmer:nth-child(4) { width: 63%; animation-delay: 0.3s; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.amt-loading-text {
  font-size: 13px;
  color: #a09380;
  font-style: italic;
  text-align: center;
  letter-spacing: 0.2px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: opacity 0.2s ease;
}

/* ========================================
   Citations Section
   ======================================== */
.ask-mirror-talk-citations {
  margin-top: 28px;
  /* display:none collapses the h3 heading so no blank space appears on page load.
     JS reveals it via: display:'' then rAF .amt-visible for the opacity transition. */
  display: none;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s ease;
}

.ask-mirror-talk-citations.amt-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ask-mirror-talk-citations h3 {
  margin-top: 0;
  margin-bottom: 14px;
  color: #6b665d;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
}

#ask-mirror-talk-citations {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Citation Items */
.citation-item {
  background: #fff;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 0;
  /* Use property-specific transitions instead of 'all' to avoid unintended animations */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  /* Fade in — no horizontal slide which can cause horizontal overflow/jank */
  animation: fadeIn 0.35s ease-out both;
  overflow: hidden;
}

/* Stagger citation fade-ins */
.citation-item:nth-child(1) { animation-delay: 0.04s; }
.citation-item:nth-child(2) { animation-delay: 0.1s; }
.citation-item:nth-child(3) { animation-delay: 0.16s; }
.citation-item:nth-child(4) { animation-delay: 0.22s; }
.citation-item:nth-child(5) { animation-delay: 0.28s; }

.citation-item:hover {
  border-color: #2e2a24;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.citation-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  gap: 12px;
  cursor: pointer;
  padding: 14px 18px;
  transition: background 0.2s ease;
}

.citation-link:hover {
  text-decoration: none;
  background: #faf8f4;
}

/* Citation info column (title + quote) */
.citation-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.citation-title {
  font-weight: 600;
  color: #2e2a24;
  font-size: 15px;
  line-height: 1.4;
  transition: color 0.2s ease;
}

/* Quote snippet under each citation */
.citation-quote {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: #6b665d;
  font-style: italic;
  border-left: 3px solid #d4cec6;
  padding: 4px 0 4px 10px;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.citation-link:hover .citation-quote {
  color: #4a453d;
  border-left-color: #8b7355;
}

.citation-time {
  font-size: 13px;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
  background: #2e2a24;
  padding: 5px 12px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  cursor: pointer;
}

.citation-link:hover .citation-title {
  color: #1a1815;
}

.citation-link:hover .citation-time {
  background: #8b7355;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

/* "Explore this episode" button */
.citation-explore {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #2e2a24;
  text-decoration: none;
  text-align: center;
  border-top: 1px solid #f0ede8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  background: #faf8f4;
}

.citation-explore:hover {
  color: #fff;
  background: #2e2a24;
  text-decoration: none;
}

/* ========================================
   Response Content Formatting
   ======================================== */
.ask-mirror-talk-response strong {
  font-weight: 700;
  color: #1a1815;
}

.ask-mirror-talk-response em {
  font-style: italic;
  color: #4a453d;
}

.ask-mirror-talk-response ol,
.ask-mirror-talk-response ul {
  margin: 16px 0;
  padding-left: 28px;
}

.ask-mirror-talk-response ol {
  list-style-type: decimal;
}

.ask-mirror-talk-response ul {
  list-style-type: disc;
}

.ask-mirror-talk-response li {
  margin: 8px 0;
  line-height: 1.7;
  padding-left: 4px;
}

.ask-mirror-talk-response li strong {
  color: #1a1815;
}

.ask-mirror-talk-response p + ol,
.ask-mirror-talk-response p + ul {
  margin-top: 12px;
}

/* ========================================
   Feedback Section (from analytics addon)
   ======================================== */
.amt-feedback-section {
  margin-top: 24px !important;
  padding: 20px !important;
  background: linear-gradient(135deg, #faf8f4, #f5f2ed) !important;
  border-radius: 10px !important;
  border: 1px solid #e6e2dc !important;
  animation: fadeInUp 0.5s ease-out;
}

.amt-feedback-question {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #2e2a24 !important;
  margin-bottom: 14px !important;
  text-align: center;
}

.amt-feedback-buttons {
  display: flex;
  gap: 10px;
}

.amt-feedback-btn {
  flex: 1;
  padding: 12px 20px !important;
  border: 2px solid transparent !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-feedback-positive {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

.amt-feedback-positive:hover {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.amt-feedback-negative {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}

.amt-feedback-negative:hover {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.amt-feedback-thanks {
  display: none;
  padding: 14px !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  border-radius: 8px !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@keyframes scaleIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Share Button
   ======================================== */
.amt-share-section {
  text-align: center;
  margin-top: 16px;
}

.amt-share-btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #8b7355;
  background: transparent;
  border: 2px solid #d4cec6;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-share-btn:hover {
  color: #2e2a24;
  border-color: #2e2a24;
  background: #faf8f4;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Inline Audio Player
   ======================================== */

/* Citation active state */
.citation-item.citation-playing {
  border-color: #2e2a24;
  box-shadow: 0 4px 20px rgba(46, 42, 36, 0.12);
}

.citation-item.citation-playing .citation-link {
  background: #faf8f4;
}

.citation-item.citation-playing .citation-time {
  background: #2e2a24;
  color: #fff;
}

/* Player container */
.amt-inline-player {
  padding: 16px 18px;
  border-top: 1px solid #e6e2dc;
  background: linear-gradient(180deg, #faf8f4 0%, #f5f2ed 100%);
  animation: playerSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.amt-inline-player.amt-player-closing {
  animation: playerSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes playerSlideIn {
  from {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    max-height: 300px;
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

@keyframes playerSlideOut {
  from {
    max-height: 300px;
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  to {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Player header */
.amt-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.amt-player-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b7355;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-player-close {
  background: none;
  border: 1px solid #d4cec6;
  color: #6b665d;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.amt-player-close:hover {
  background: #2e2a24;
  border-color: #2e2a24;
  color: #fff;
  transform: scale(1.1);
}

/* Episode title in player */
.amt-player-episode {
  font-size: 14px;
  font-weight: 600;
  color: #2e2a24;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Audio element */
.amt-inline-player .amt-audio {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  outline: none;
  margin-bottom: 10px;
}

/* Custom audio styling for webkit browsers */
.amt-inline-player .amt-audio::-webkit-media-controls-panel {
  background: #fff;
  border-radius: 8px;
}

/* Player action buttons */
.amt-player-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.amt-player-skip-back,
.amt-player-skip-fwd {
  background: #fff;
  border: 1px solid #d4cec6;
  color: #2e2a24;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-player-skip-back:hover,
.amt-player-skip-fwd:hover {
  background: #2e2a24;
  color: #fff;
  border-color: #2e2a24;
  transform: translateY(-1px);
}

.amt-player-external {
  margin-left: auto;
  font-size: 12px;
  color: #8b7355;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid #d4cec6;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-player-external:hover {
  background: #f5f2ed;
  color: #2e2a24;
  border-color: #2e2a24;
  text-decoration: none;
}

/* ========================================
   Keyframe Animations
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* slideInRight removed — replaced with fadeIn for citations to prevent horizontal jank */

/* ========================================
   Responsive Design — Tablet
   ======================================== */
@media (max-width: 768px) {
  .ask-mirror-talk {
    padding: 24px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .ask-mirror-talk h2 {
    font-size: 24px;
  }

  .citation-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .citation-time {
    align-self: flex-start;
  }

  .citation-explore {
    text-align: center;
  }

  .amt-topics-list {
    gap: 6px;
  }

  .amt-topic-btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .amt-feedback-buttons {
    flex-direction: column;
  }

  .amt-player-actions {
    flex-wrap: wrap;
  }

  .amt-player-external {
    margin-left: 0;
    flex: 1;
    text-align: center;
  }

  .amt-qotd-text {
    font-size: 16px;
  }

  .amt-qotd-inner {
    padding: 16px 18px;
  }
}

/* ========================================
   Responsive Design — Mobile (≤ 480px)
   ======================================== */
@media (max-width: 480px) {

  /* ── Container ──────────────────────── */
  .ask-mirror-talk {
    padding: 16px 12px;
    margin: 0 -12px;            /* bleed to screen edges inside WP padding */
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .ask-mirror-talk::before {
    height: 2px;
  }

  /* ── Typography ─────────────────────── */
  .ask-mirror-talk h2 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 2px;
  }

  .ask-mirror-talk h3 {
    font-size: 16px;
    margin-top: 18px;
    margin-bottom: 8px;
  }

  .ask-mirror-talk label {
    font-size: 14px;
    text-align: center;
  }

  /* ── Form Input ─────────────────────── */
  #ask-mirror-talk-input {
    font-size: 16px;            /* prevents iOS zoom on focus */
    padding: 12px 14px;
    margin: 6px 0 10px;
    border-radius: 10px;
    min-height: 72px;           /* compact on mobile */
  }

  /* ── Submit Button — full-width tap target ── */
  .ask-mirror-talk button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }

  .ask-mirror-talk button[type="submit"]:hover:not(:disabled) {
    transform: none;            /* no hover lift on touch */
  }

  .ask-mirror-talk button[type="submit"]:active:not(:disabled) {
    transform: scale(0.97);
    box-shadow: 0 1px 3px rgba(46, 42, 36, 0.15);
  }

  /* ── Question of the Day ────────────── */
  .amt-qotd-inner {
    padding: 14px 14px 16px;
    border-radius: 12px;
  }

  .amt-qotd-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
  }

  .amt-qotd-badge {
    font-size: 11px;
  }

  .amt-qotd-theme {
    font-size: 10px;
    padding: 2px 8px;
  }

  .amt-qotd-text {
    font-size: 16px;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .amt-qotd-ask {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }

  .amt-qotd-ask:hover {
    transform: none;
  }

  .amt-qotd-ask:active {
    transform: scale(0.97);
  }

  /* ── Browse by Topic ────────────────── */
  .amt-topics {
    margin-bottom: 14px;
  }

  .amt-topics-label {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .amt-topics-list {
    gap: 6px;
    /* Horizontally scrollable on narrow screens */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    margin: 0 -12px;           /* bleed to screen edges */
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;     /* Firefox */
  }

  .amt-topics-list::-webkit-scrollbar {
    display: none;             /* Chrome, Safari */
  }

  .amt-topic-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 20px;
    -webkit-tap-highlight-color: transparent;
  }

  .amt-topic-btn:hover {
    transform: none;
  }

  .amt-topic-btn:active {
    transform: scale(0.95);
    box-shadow: none;
  }

  .amt-topic-icon {
    font-size: 14px;
  }

  /* ── Suggested Questions ────────────── */
  .amt-suggestions {
    margin-bottom: 12px;
  }

  .amt-suggestions-label,
  .amt-followups-label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .amt-suggestions-list,
  .amt-followups-list {
    gap: 6px;
  }

  .amt-suggestion-btn,
  .amt-followup-btn {
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 18px;
    -webkit-tap-highlight-color: transparent;
    /* full-width on very narrow screens for easy tapping */
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    text-align: center;
  }

  .amt-suggestion-btn:hover,
  .amt-followup-btn:hover {
    transform: none;
  }

  .amt-suggestion-btn:active,
  .amt-followup-btn:active {
    transform: scale(0.96);
  }

  /* ── Response Section ───────────────── */
  .ask-mirror-talk-response {
    margin-top: 16px;
    padding: 16px 14px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.75;
  }

  #ask-mirror-talk-output p {
    margin: 0 0 12px 0;
  }

  .ask-mirror-talk-response ol,
  .ask-mirror-talk-response ul {
    padding-left: 20px;
    margin: 12px 0;
  }

  .ask-mirror-talk-response li {
    margin: 6px 0;
    line-height: 1.65;
  }

  /* ── Loading ────────────────────────── */
  .amt-loading {
    padding: 28px 12px;
  }

  .amt-loading-text {
    font-size: 14px;
  }

  /* ── Citations ──────────────────────── */
  .ask-mirror-talk-citations {
    margin-top: 18px;
  }

  .ask-mirror-talk-citations h3 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .citation-item {
    margin-bottom: 6px;
    border-radius: 10px;
  }

  /* Remove hover lift on touch */
  .citation-item:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .citation-link {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .citation-title {
    font-size: 14px;
    line-height: 1.4;
  }

  .citation-quote {
    font-size: 12.5px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    padding: 3px 0 3px 8px;
  }

  .citation-time {
    font-size: 12px;
    padding: 4px 10px;
    align-self: flex-start;
  }

  .citation-link:hover .citation-time {
    transform: none;            /* no hover scale on touch */
  }

  /* Explore button — full-width CTA on mobile */
  .citation-explore {
    text-align: center;
    padding: 10px 14px;
    font-size: 13px;
    -webkit-tap-highlight-color: transparent;
  }

  .citation-explore:hover {
    background: transparent;
  }

  .citation-explore:active {
    background: #faf8f4;
  }

  /* ── Inline Audio Player ────────────── */
  .amt-inline-player {
    padding: 12px 14px;
  }

  .amt-player-episode {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .amt-inline-player .amt-audio {
    height: 36px;
    margin-bottom: 8px;
  }

  .amt-player-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .amt-player-skip-back,
  .amt-player-skip-fwd {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .amt-player-skip-back:hover,
  .amt-player-skip-fwd:hover {
    transform: none;
  }

  .amt-player-external {
    margin-left: 0;
    flex: 1 1 100%;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .amt-player-external:hover {
    transform: none;
  }

  /* ── Feedback Section ───────────────── */
  .amt-feedback-section {
    margin-top: 16px !important;
    padding: 14px !important;
    border-radius: 10px !important;
  }

  .amt-feedback-question {
    font-size: 14px !important;
    margin-bottom: 10px !important;
  }

  .amt-feedback-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .amt-feedback-btn {
    padding: 12px 16px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    -webkit-tap-highlight-color: transparent;
  }

  .amt-feedback-positive:hover,
  .amt-feedback-negative:hover {
    transform: none;
    box-shadow: none;
  }

  .amt-feedback-positive:active {
    background: #10b981 !important;
    color: #fff !important;
    transform: scale(0.97);
  }

  .amt-feedback-negative:active {
    background: #ef4444 !important;
    color: #fff !important;
    transform: scale(0.97);
  }

  .amt-feedback-thanks {
    font-size: 14px !important;
    padding: 12px !important;
  }

  /* ── Follow-ups ─────────────────────── */
  .amt-followups {
    margin-top: 14px;
    padding-top: 12px;
  }
}

/* ========================================
   Accessibility
   ======================================== */
.ask-mirror-talk button:focus-visible,
#ask-mirror-talk-input:focus-visible {
  outline: 2px solid #2e2a24;
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Session Resume Hint
   ======================================== */
.amt-resume-hint {
  margin-bottom: 12px;
}

.amt-resume-hint-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.amt-resume-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  padding-left: 2px;
}

.amt-resume-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  color: #6b665d;
  background: #faf8f4;
  border: 1px dashed #d4cec6;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.amt-resume-btn:hover {
  color: #2e2a24;
  border-color: #2e2a24;
  border-style: solid;
  background: #f5f2ed;
}

/* ========================================
   Question of the Day
   ======================================== */
.amt-qotd {
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out;
}

.amt-qotd-inner {
  background: linear-gradient(135deg, #fdfbf6 0%, #f5f0e6 100%);
  border: 1.5px solid #e0d5c3;
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

/* Warm shimmer accent along the top */
.amt-qotd-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4a857, #8b7355, #d4a857);
}

.amt-qotd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.amt-qotd-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8b7355;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.amt-qotd-theme {
  font-size: 11px;
  font-weight: 600;
  color: #a09380;
  background: rgba(139, 115, 85, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.3px;
}

.amt-qotd-text {
  font-size: 18px;
  line-height: 1.5;
  color: #2e2a24;
  font-style: italic;
  font-weight: 500;
  margin: 0 0 14px 0;
}

.amt-qotd-ask {
  display: inline-block;
  background: linear-gradient(135deg, #2e2a24, #3d3731);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.3px;
}

.amt-qotd-ask:hover {
  background: linear-gradient(135deg, #3d3731, #524b42);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(46, 42, 36, 0.25);
}

.amt-qotd-ask:active {
  transform: translateY(0);
}

/* QOTD tablet adjustments handled in responsive section above */

/* ========================================
   Browse by Topic
   ======================================== */
.amt-topics {
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-out;
}

.amt-topics-label {
  font-size: 14px;
  color: #6b665d;
  margin: 0 0 10px 0;
  font-style: italic;
}

.amt-topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amt-topic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fff, #faf8f4);
  border: 1.5px solid #e6e2dc;
  border-radius: 24px;
  padding: 8px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #2e2a24;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.4;
}

.amt-topic-icon {
  font-size: 15px;
  line-height: 1;
}

.amt-topic-name {
  font-size: 13px;
}

.amt-topic-btn:hover {
  background: linear-gradient(135deg, #2e2a24, #3d3731);
  color: #fff;
  border-color: #2e2a24;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(46, 42, 36, 0.2);
}

.amt-topic-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(46, 42, 36, 0.15);
}

/* ========================================
   Suggested Questions
   ======================================== */
.amt-suggestions {
  margin-bottom: 16px;
}

.amt-suggestions-label,
.amt-followups-label {
  font-size: 14px;
  color: #6b665d;
  margin: 0 0 8px 0;
  font-style: italic;
}

.amt-suggestions-list,
.amt-followups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amt-suggestion-btn,
.amt-followup-btn {
  background: #fff;
  border: 1.5px solid #d4cec6;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  color: #2e2a24;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.amt-suggestion-btn:hover,
.amt-followup-btn:hover {
  background: #2e2a24;
  color: #fff;
  border-color: #2e2a24;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 42, 36, 0.15);
}

.amt-suggestion-btn:active,
.amt-followup-btn:active {
  transform: translateY(0);
}

/* ========================================
   Follow-up Questions — The Addictive Loop
   ======================================== */
.amt-followups {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e6e2dc;
  animation: fadeInUp 0.4s ease;
}

.amt-followups-label {
  position: relative;
}

/* Subtle glow on follow-up buttons to draw attention */
.amt-followup-btn {
  animation: followUpAppear 0.5s ease-out both;
}

.amt-followup-btn:nth-child(1) { animation-delay: 0.1s; }
.amt-followup-btn:nth-child(2) { animation-delay: 0.25s; }
.amt-followup-btn:nth-child(3) { animation-delay: 0.4s; }

@keyframes followUpAppear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Depth indicator — shows episode count searched */
.amt-depth-indicator {
  display: inline-block;
  font-size: 12px;
  color: #8b7355;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-top: 8px;
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.3s forwards;
}

.amt-depth-indicator::before {
  content: '📚 ';
}

/* ========================================
   PWA Install Banner — "Add to Home Screen"
   ======================================== */
.amt-install-banner {
  margin: -8px -8px 16px -8px;
  animation: fadeInUp 0.4s ease-out;
}

.amt-install-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #2e2a24, #3d3731);
  border-radius: 10px;
  color: #fff;
}

.amt-install-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.amt-install-text strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.amt-install-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
}

.amt-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.amt-install-btn {
  background: #fff;
  color: #2e2a24;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.amt-install-btn:hover {
  background: #f5f2ed;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.amt-install-btn:active {
  transform: scale(0.96);
}

.amt-install-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.amt-install-dismiss:hover {
  color: #fff;
}

.amt-install-banner.amt-install-hiding {
  animation: fadeOutUp 0.3s ease-in forwards;
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

/* Mobile: stack install banner vertically */
@media (max-width: 480px) {
  .amt-install-banner {
    margin: -4px -4px 12px -4px;
  }

  .amt-install-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    text-align: center;
  }

  .amt-install-actions {
    justify-content: center;
    gap: 10px;
  }

  .amt-install-btn {
    flex: 1;
    padding: 10px 16px;
  }
}

/* Hide install banner in standalone mode (already installed) */
@media (display-mode: standalone) {
  .amt-install-banner {
    display: none !important;
  }
}

/* ========================================
   Push Notification Opt-In Banner
   ======================================== */
.amt-notif-optin {
  margin: 16px 0;
  animation: amtSlideDown 0.3s ease-out;
}

.amt-notif-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #f0ede8 0%, #e8e4dd 100%);
  border: 1px solid #d4cfc5;
  border-radius: 12px;
  padding: 16px 20px;
}

.amt-notif-success {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: #a5d6a7;
  justify-content: center;
}

.amt-notif-error {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-color: #ffcc80;
  justify-content: center;
}

.amt-notif-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.amt-notif-text strong {
  font-size: 15px;
  color: #2e2a24;
}

.amt-notif-text span {
  font-size: 13px;
  color: #6b665d;
}

.amt-notif-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.amt-notif-enable {
  background: #2e2a24;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.amt-notif-enable:hover {
  background: #3d3731;
}

.amt-notif-enable:active {
  transform: scale(0.97);
}

.amt-notif-dismiss {
  background: transparent;
  border: 1px solid #c4bfb5;
  color: #6b665d;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.amt-notif-dismiss:hover {
  background: rgba(0,0,0,0.04);
  border-color: #a09a8f;
}

/* Preferences checkboxes */
.amt-notif-prefs {
  background: #faf8f4;
  border: 1px solid #d4cfc5;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: amtSlideDown 0.2s ease-out;
}

.amt-notif-pref {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #2e2a24;
  cursor: pointer;
}

.amt-notif-pref input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2e2a24;
  cursor: pointer;
}

.amt-notif-save {
  align-self: flex-start;
  background: #2e2a24;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: background 0.2s;
}

.amt-notif-save:hover {
  background: #3d3731;
}

.amt-notif-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.amt-notif-optin.amt-notif-hiding {
  animation: amtSlideUp 0.3s ease-in forwards;
}

@keyframes amtSlideDown {
  from { opacity: 0; max-height: 0; transform: translateY(-8px); }
  to { opacity: 1; max-height: 200px; transform: translateY(0); }
}

@keyframes amtSlideUp {
  from { opacity: 1; max-height: 200px; }
  to { opacity: 0; max-height: 0; margin: 0; padding: 0; overflow: hidden; }
}

/* Mobile: stack notification banner vertically */
@media (max-width: 600px) {
  .amt-notif-inner {
    flex-direction: column;
    text-align: center;
    padding: 14px 16px;
  }

  .amt-notif-actions {
    width: 100%;
    justify-content: center;
  }

  .amt-notif-enable {
    flex: 1;
    padding: 10px 16px;
  }

  .amt-notif-prefs {
    align-items: center;
  }

  .amt-notif-save {
    align-self: center;
    width: 100%;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .ask-mirror-talk button,
  #ask-mirror-talk-input,
  .ask-mirror-talk form,
  .amt-feedback-section,
  .amt-inline-player,
  .amt-suggestions,
  .amt-followups,
  .amt-install-banner {
    display: none;
  }

  .ask-mirror-talk {
    box-shadow: none;
    border: none;
  }
}

/* ========================================
   Gamification — Stats Bar, Badges, Toasts
   ======================================== */

/* ── Stats bar ── */
.amt-stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  flex-wrap: wrap;
}

.amt-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 0.85rem;
}

.amt-stat-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Pulse animation when streak ≥ 3 days */
.amt-streak-active {
  animation: streakPulse 1.6s ease-in-out infinite;
}

@keyframes streakPulse {
  0%, 100% { transform: scale(1);   filter: drop-shadow(0 0 0px #f7c948); }
  50%       { transform: scale(1.25); filter: drop-shadow(0 0 6px #f7c948); }
}

.amt-stat-value {
  font-weight: 700;
  font-size: 1rem;
  color: #f7c948;
  font-variant-numeric: tabular-nums;
}

.amt-stat-label {
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
}

.amt-stat-themes .amt-stat-value { color: #4ecdc4; }
.amt-stat-questions .amt-stat-value { color: #e884c8; }

.amt-badges-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 0.82rem;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.amt-badges-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ── Badge shelf ── */
.amt-badge-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  background: #0f0f23;
  border-radius: 12px;
  margin-bottom: 16px;
  animation: fadeIn 0.25s ease;
}

.amt-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  text-align: center;
  cursor: default;
  transition: transform 0.15s;
}

.amt-badge:hover { transform: scale(1.08); }

.amt-badge-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.amt-badge-name {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.amt-badge-locked .amt-badge-emoji { filter: grayscale(1) opacity(0.3); }
.amt-badge-locked .amt-badge-name  { color: rgba(255,255,255,0.3); }

.amt-badge-earned .amt-badge-emoji {
  filter: drop-shadow(0 0 6px rgba(247,201,72,0.7));
}

/* ── Milestone / badge toast ── */
.amt-milestone-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
  border: 1.5px solid rgba(247,201,72,0.4);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 99998;
  max-width: min(380px, 90vw);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s ease;
  pointer-events: none;
}

.amt-milestone-toast.amt-toast-in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.amt-milestone-toast.amt-toast-out {
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
}

.amt-toast-emoji { font-size: 2rem; flex-shrink: 0; }

.amt-milestone-toast strong {
  display: block;
  font-size: 0.95rem;
  color: #f7c948;
  margin-bottom: 2px;
}

.amt-milestone-toast span { color: rgba(255,255,255,0.75); }

/* ── Rating Section ──────────────────────────────────────────── */
.amt-feedback-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}

.amt-feedback-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-right: 4px;
}

.amt-feedback-btn {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amt-feedback-btn:not(:disabled):hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.12);
}

.amt-feedback-btn.amt-feedback-selected.amt-feedback-up {
  background: rgba(62,207,142,0.2);
  border-color: #3ecf8e;
}

.amt-feedback-btn.amt-feedback-selected.amt-feedback-down {
  background: rgba(232,67,147,0.2);
  border-color: #e84393;
}

.amt-feedback-btn:disabled {
  cursor: default;
  opacity: 0.5;
}

.amt-feedback-btn.amt-feedback-selected:disabled {
  opacity: 1;
}

.amt-feedback-thanks {
  font-size: 0.82rem;
  color: #3ecf8e;
  margin-left: 4px;
}

/* ── Save to Email ───────────────────────────────────────────── */
.amt-email-section {
  margin-top: 8px;
}

.amt-email-btn {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.amt-email-btn:hover {
  border-color: rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.85);
}

/* ── Citation Preview Button ─────────────────────────────────── */
.citation-preview-btn {
  display: inline-block;
  margin-top: 6px;
  margin-right: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.citation-preview-btn:hover {
  border-color: rgba(247,201,72,0.5);
  color: #f7c948;
}

/* ── Dark Mode ───────────────────────────────────────────────── */
.amt-dark-mode-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  background: rgba(46,42,36,0.9);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.amt-dark-mode-toggle:hover {
  transform: scale(1.05);
}

.amt-toggle-moon { line-height: 1; }

.amt-toggle-streak {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f7c948;
  letter-spacing: 0.01em;
}

/* Light mode overrides when .amt-light-mode is on body */
body.amt-light-mode .ask-mirror-talk {
  background: #f5f0eb;
  color: #2e2a24;
}

body.amt-light-mode .amt-feedback-section {
  background: rgba(0,0,0,0.05);
}

body.amt-light-mode .amt-feedback-label {
  color: rgba(0,0,0,0.5);
}

body.amt-light-mode .amt-feedback-btn {
  border-color: rgba(0,0,0,0.2);
}

body.amt-light-mode #ask-mirror-talk-output p,
body.amt-light-mode #ask-mirror-talk-output li,
body.amt-light-mode .ask-mirror-talk-response h3 {
  color: #2e2a24;
}

body.amt-light-mode .citation-item {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
}

body.amt-light-mode .amt-stat-label,
body.amt-light-mode .amt-followups-label,
body.amt-light-mode .amt-topics-label,
body.amt-light-mode .amt-suggestions-label {
  color: rgba(0,0,0,0.5);
}

/* ── Onboarding Overlay ──────────────────────────────────────── */
.amt-onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: amt-fade-in 0.3s ease;
}

@keyframes amt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.amt-onboarding-card {
  background: #2e2a24;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.amt-onboarding-card h2 {
  font-size: 1.5rem;
  color: #f7c948;
  margin: 0 0 10px;
}

.amt-onboarding-card p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin: 0 0 24px;
}

.amt-onboarding-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.amt-onboarding-example {
  background: rgba(247,201,72,0.1);
  border: 1px solid rgba(247,201,72,0.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.amt-onboarding-example:hover {
  background: rgba(247,201,72,0.18);
}

.amt-onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.amt-onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.2s;
}

.amt-onboarding-dot.active {
  background: #f7c948;
}

.amt-onboarding-next {
  background: #f7c948;
  color: #2e2a24;
  border: none;
  border-radius: 10px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.amt-onboarding-next:hover {
  transform: scale(1.03);
}

.amt-onboarding-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 0.82rem;
  cursor: pointer;
  margin-top: 12px;
  display: block;
  width: 100%;
  text-align: center;
}

/* ── Related Questions ───────────────────────────────────────── */
.amt-related-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.amt-related-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.amt-related-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.amt-related-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.amt-related-btn:hover {
  background: rgba(247,201,72,0.08);
  border-color: rgba(247,201,72,0.25);
  color: #fff;
}

/* ── Freshness year badge on citations ───────────────────────── */
.citation-year {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Topics: starter questions expand ───────────────────────── */
.amt-topic-starter-list {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.amt-topic-item.amt-topic-open .amt-topic-starter-list {
  display: flex;
}

.amt-topic-starter-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.amt-topic-starter-btn:hover {
  background: rgba(247,201,72,0.1);
  color: #fff;
}

.amt-topic-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.2s;
}

.amt-topic-item.amt-topic-open {
  border-color: rgba(247,201,72,0.3);
  background: rgba(247,201,72,0.04);
}

.amt-topic-item .amt-topic-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.amt-topic-expand-arrow {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  transition: transform 0.2s;
  margin-left: auto;
}

.amt-topic-item.amt-topic-open .amt-topic-expand-arrow {
  transform: rotate(90deg);
}
