* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  padding: 40px 20px;
  font-family: system-ui, sans-serif;
}
.header { text-align: center; margin-bottom: 32px; }
.header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 48px; font-weight: 400; color: #fff;
  letter-spacing: 4px; margin: 0 0 8px 0;
}
.header .subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: rgba(255,255,255,0.5);
  letter-spacing: 4px; text-transform: uppercase;
}
.header .hint {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; color: rgba(255,255,255,0.4);
  margin-top: 12px; font-style: italic;
}
.header .tutorial-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.3);
  margin-top: 6px; cursor: pointer;
  letter-spacing: 1px; text-transform: uppercase;
  transition: color 0.2s;
}
.header .tutorial-link:hover {
  color: rgba(255,255,255,0.6);
}

/* Global response-mode toggle (top-right corner) */
.global-mode-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.08); border-radius: 14px;
  padding: 2px; backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.global-mode-toggle .mode-btn {
  background: none; border: none; color: rgba(255,255,255,0.35);
  font-size: 13px; padding: 3px 8px; border-radius: 12px;
  cursor: pointer; transition: all 0.2s; line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.global-mode-toggle .mode-btn:hover { color: rgba(255,255,255,0.6); }
.global-mode-toggle .mode-btn.active {
  background: rgba(255,255,255,0.15); color: #fff;
}

/* Filter buttons */
.filters {
  display: flex; justify-content: center; gap: 12px;
  margin-bottom: 32px;
}
.filter-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 20px; border-radius: 20px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent; color: rgba(255,255,255,0.6);
  transition: all 0.3s ease;
}
.filter-btn:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
.filter-btn.active {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-align: center; margin-bottom: 24px;
}

/* Cards grid */
.cards-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 28px; max-width: 1600px; margin: 0 auto;
}
.card-container {
  width: 270px; height: 560px; perspective: 1200px; cursor: pointer;
}
.card-container.animating {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card-container.hidden { display: none; }
.card-container.lumina-glow .card-front {
  box-shadow: 0 0 18px 4px rgba(255, 215, 80, 0.45), 0 0 40px 8px rgba(255, 200, 50, 0.2);
}
.card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
}
.card.flip-ready {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.card.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; border-radius: 12px; overflow: hidden;
}

/* Front */
.card-front {
  display: flex; flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.portrait-section { position: relative; flex: 1; min-height: 0; background: #111; z-index: 1; }
.portrait-section img {
  width: 100%; height: 100%; object-fit: contain; object-position: center;
}
.portrait-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 80px; opacity: 0.3;
}
.badge-gender {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px;
  border-radius: 4px; font-size: 9px;
  font-family: 'JetBrains Mono', monospace; font-weight: bold; z-index: 10;
}
.symbol-badge {
  position: absolute; bottom: 14px; left: 10px; z-index: 20;
  font-size: 24px; text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.card-info { padding: 14px 16px 16px; height: 187px; }
.name-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.name-row h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 600; color: #fff;
  margin: 0; letter-spacing: 1px;
}
.name-row .title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  text-align: right; max-width: 120px; line-height: 1.3;
}
.tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px; font-style: italic; color: rgba(255,255,255,0.8);
  margin: 0 0 10px 0; line-height: 1.4;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.stat-label {
  display: flex; justify-content: space-between; font-size: 8px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;
  margin-bottom: 2px; text-transform: uppercase; color: rgba(255,255,255,0.6);
}
.stat-track {
  height: 3px; background: rgba(255,255,255,0.2);
  border-radius: 2px; overflow: hidden;
}
.stat-fill { height: 100%; border-radius: 2px; }
.flip-hint {
  position: absolute; bottom: 6px; right: 10px; font-size: 8px;
  color: rgba(255,255,255,0.25); font-family: 'JetBrains Mono', monospace;
}

/* Back */
.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  padding: 16px; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.card-back::-webkit-scrollbar { width: 4px; }
.card-back::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.card-back::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.back-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px;
}
.back-portrait {
  width: 44px; height: 58px; border-radius: 4px;
  border-width: 2px; border-style: solid; overflow: hidden; flex-shrink: 0;
}
.back-portrait img { width: 100%; height: 100%; object-fit: cover; }
.back-name-block h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px; color: #fff; margin: 0;
}
.back-name-block .title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px;
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase;
  display: block; margin: 10px 0 4px;
}
.back-section {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 11px; color: rgba(255,255,255,0.85);
  line-height: 1.5; margin-bottom: 2px;
  overflow-wrap: break-word; word-wrap: break-word;
}
.detail-row {
  margin-bottom: 6px;
}
.label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.5px; text-transform: uppercase;
  display: block; margin-bottom: 2px;
}
.value {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 11px; color: rgba(255,255,255,0.8); line-height: 1.4;
  display: block; overflow-wrap: break-word; word-wrap: break-word;
}
.likes-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.like-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; padding: 3px 8px; border-radius: 10px;
  border-width: 1px; border-style: solid; letter-spacing: 0.5px;
}
.aspirations-list {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 10.5px; color: rgba(255,255,255,0.7);
  line-height: 1.6; padding-left: 16px; margin: 4px 0;
}
.traits-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.trait-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; padding: 3px 8px; border-radius: 10px;
  border-width: 1px; border-style: solid; letter-spacing: 0.5px;
}
.quote {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 10.5px; font-style: italic;
  color: rgba(255,255,255,0.7); padding: 5px 0 5px 10px;
  border-left: 2px solid; margin: 4px 0; line-height: 1.4;
}
.best-for-list {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 10.5px; color: rgba(255,255,255,0.7);
  line-height: 1.6; padding-left: 16px;
}

/* Play button overlay — always visible */
.play-btn-overlay {
  position: absolute; bottom: 4px; right: 10px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.7); border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0.85; transition: opacity 0.3s ease, transform 0.15s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}
.play-btn-overlay:hover { opacity: 1; transform: scale(1.1); border-color: rgba(255,255,255,0.9); background: rgba(0,0,0,0.85); }
.play-btn-overlay.playing {
  opacity: 1; background: rgba(30,120,255,0.7); border-color: rgba(100,180,255,0.8);
  animation: pulse-ring 1.5s ease-in-out infinite;
}
.play-btn-overlay.loading {
  opacity: 1; background: rgba(255,165,0,0.5); border-color: rgba(255,200,100,0.7);
}
.play-btn-overlay.loading .play-icon {
  border-color: transparent; width: 16px; height: 16px; margin-left: 0;
  border-width: 3px; border-style: solid; border-radius: 50%;
  border-top-color: #fff; animation: spin 0.8s linear infinite;
}
.play-btn-overlay.error {
  opacity: 1; background: rgba(255,50,50,0.6); border-color: rgba(255,100,100,0.7);
}
.play-btn-overlay .play-icon {
  width: 0; height: 0; border-style: solid;
  border-width: 8px 0 8px 15px; border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.play-btn-overlay.playing .play-icon {
  border-width: 0; width: 14px; height: 14px; margin-left: 0;
  border-left: 4px solid #fff; border-right: 4px solid #fff;
  border-top: none; border-bottom: none; border-radius: 0; animation: none;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(100,180,255,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(100,180,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(100,180,255,0); }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ask button overlay */
.ask-btn-overlay {
  position: absolute; bottom: 4px; left: 60px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.7); border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0.85; transition: opacity 0.3s ease, transform 0.15s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
  font-size: 16px; color: #fff; font-family: 'JetBrains Mono', monospace; font-weight: bold;
}
.ask-btn-overlay:hover { opacity: 1; transform: scale(1.1); border-color: rgba(255,255,255,0.9); background: rgba(0,0,0,0.85); }

/* Chat modal */
.chat-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: #0a0a14;
  align-items: center; justify-content: center;
}
.chat-overlay.open { display: flex; }
.chat-modal {
  width: 440px; max-width: 95vw; height: 600px; max-height: 85vh;
  background: #1a1a2e; border-radius: 16px; display: flex; flex-direction: column;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-header-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.3);
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px; color: #fff;
}
.chat-header-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: rgba(255,255,255,0.5);
  letter-spacing: 1px; text-transform: uppercase;
}
.chat-header-title-row {
  display: flex; align-items: center; gap: 8px;
}
.chat-header-skills-pill {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 9px; color: rgba(255,255,255,0.6);
  cursor: pointer; padding: 3px 9px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap; letter-spacing: 0.2px;
}
.chat-header-skills-pill:hover {
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}
.chat-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.1); color: #fff; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-close:hover { background: rgba(255,255,255,0.2); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex;
  flex-direction: column; gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.chat-bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 16px;
  font-family: 'Source Serif Pro', Georgia, serif; font-size: 14px;
  line-height: 1.5; word-wrap: break-word;
}
.chat-bubble.user {
  align-self: flex-end; background: rgba(255,255,255,0.12);
  color: #fff; border-bottom-right-radius: 4px;
  position: relative;
}
.chat-bubble.user .bubble-copy-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  cursor: pointer; color: rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; opacity: 0; pointer-events: none;
}
.chat-bubble.user:hover .bubble-copy-btn {
  opacity: 1; pointer-events: auto;
}
.chat-bubble.user .bubble-copy-btn:hover {
  background: rgba(255,255,255,0.2); color: #fff;
}
.chat-bubble.user .bubble-copy-btn svg { width: 12px; height: 12px; }
.chat-bubble.user .bubble-copy-btn.copied {
  opacity: 1; pointer-events: auto;
  color: #4ade80; background: rgba(74,222,128,0.15);
}
.chat-bubble.assistant {
  align-self: flex-start; background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9); border-bottom-left-radius: 4px;
}
.chat-bubble.assistant.typing {
  color: rgba(255,255,255,0.4); font-style: italic;
}
.chat-bubble.compacting {
  color: rgba(255,255,255,0.7); font-style: italic;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
}
.chat-bubble.speaking {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 60px; padding: 12px 20px;
}
.audio-wave {
  display: flex; align-items: center; gap: 3px; height: 20px;
  cursor: pointer;
}
.audio-wave span {
  display: block; width: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.5);
  animation: audioWave 1s ease-in-out infinite;
  animation-play-state: paused;
}
.audio-playing .audio-wave span {
  animation-play-state: running;
}
.audio-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.audio-wave span:nth-child(2) { height: 16px; animation-delay: 0.15s; }
.audio-wave span:nth-child(3) { height: 8px; animation-delay: 0.3s; }
@keyframes audioWave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.8); }
}
.chat-bubble.interrupted {
  opacity: 0.45; font-style: italic;
}
.chat-bubble.interrupted::after {
  content: ' [interrupted]'; font-size: 0.8em; opacity: 0.7;
}
.chat-bubble.assistant.composing {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 60px; padding: 12px 20px;
}
.composing-indicator {
  display: flex; align-items: center; gap: 5px; height: 20px;
}
.composing-indicator span {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.45);
  animation: composingPulse 1.4s ease-in-out infinite;
}
.composing-indicator span:nth-child(1) { animation-delay: 0s; }
.composing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.composing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes composingPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}
/* PDF missed hint */
.pdf-missed-hint {
  align-self: flex-start; max-width: 80%; padding: 8px 12px;
  border-radius: 10px; background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25); color: rgba(255,255,255,0.7);
  font-size: 12px; font-family: -apple-system, sans-serif; line-height: 1.4;
}
/* Tool status indicator */
.chat-bubble.tool-status {
  color: rgba(255,255,255,0.6); font-style: italic; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.tool-status-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.5); border-radius: 50%;
  animation: toolSpin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes toolSpin {
  to { transform: rotate(360deg); }
}
.tool-done { opacity: 0.7; }
.tool-error { color: #e74c3c; opacity: 0.7; }
/* PDF download card */
.pdf-download-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.pdf-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.pdf-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.pdf-info-section {
  flex: 1; min-width: 0;
}
.pdf-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdf-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.pdf-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.pdf-download-btn:hover { background: rgba(255,255,255,0.22); }
.pdf-download-btn:active { background: rgba(255,255,255,0.32); }
.pdf-download-btn.downloading {
  opacity: 0.6; pointer-events: none;
}
.sms-sent-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.sms-card-inner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
}
.sms-icon-section {
  flex-shrink: 0; color: rgba(100,200,120,0.7); margin-top: 2px;
}
.sms-info-section {
  flex: 1; min-width: 0;
}
.sms-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sms-card-preview {
  font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 3px;
  line-height: 1.4; max-height: 34px; overflow: hidden;
}
.sms-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px;
}

/* Presentation card */
.presentation-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.presentation-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.presentation-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.presentation-info-section {
  flex: 1; min-width: 0;
}
.presentation-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.presentation-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.presentation-card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.presentation-view-btn, .presentation-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.presentation-view-btn:hover, .presentation-download-btn:hover {
  background: rgba(255,255,255,0.22);
}
.presentation-view-btn:active, .presentation-download-btn:active {
  background: rgba(255,255,255,0.32);
}
.presentation-download-btn.downloading {
  opacity: 0.6; pointer-events: none;
}

/* Slideshow viewer overlay */
.slideshow-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  animation: illustFadeIn 0.2s ease;
}
.slideshow-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.slideshow-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  flex: 1; padding-right: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slideshow-counter {
  font-size: 13px; color: rgba(255,255,255,0.4); margin-right: 16px;
}
.slideshow-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background 0.2s, color 0.2s;
}
.slideshow-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.slideshow-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 24px; position: relative;
}
.slideshow-slide {
  background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: min(90vw, 960px);
  padding: 48px 56px; position: relative;
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; justify-content: flex-start;
  overflow: auto;
}
.slideshow-slide.title-slide {
  justify-content: center; align-items: center; text-align: center;
}
.slideshow-slide-heading {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 28px; font-weight: 700; color: #1a1a2e;
  margin-bottom: 20px; line-height: 1.2;
}
.slideshow-slide.title-slide .slideshow-slide-heading {
  font-size: 36px; margin-bottom: 12px;
}
.slideshow-slide-subtitle {
  font-size: 18px; color: #666; margin-bottom: 24px;
}
.slideshow-slide-content {
  font-size: 18px; line-height: 1.6; color: #333; flex: 1;
}
.slideshow-slide-content ul { padding-left: 24px; margin: 0; }
.slideshow-slide-content li { margin-bottom: 8px; }
.slideshow-slide-content table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
}
.slideshow-slide-content th, .slideshow-slide-content td {
  padding: 8px 12px; border: 1px solid #ddd; text-align: left; font-size: 16px;
}
.slideshow-slide-content th { font-weight: 600; color: #fff; }
.slideshow-slide-branding {
  position: absolute; bottom: 16px; right: 24px;
  font-size: 11px; color: #aaa;
}
.slideshow-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 16px; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.slideshow-nav-btn {
  background: rgba(255,255,255,0.12); border: none; border-radius: 8px;
  color: #fff; padding: 10px 20px; font-size: 14px; cursor: pointer;
  transition: background 0.2s;
}
.slideshow-nav-btn:hover { background: rgba(255,255,255,0.22); }
.slideshow-nav-btn:disabled { opacity: 0.3; cursor: default; }
.slideshow-dots {
  display: flex; gap: 6px; align-items: center;
}
.slideshow-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.2); transition: background 0.2s;
  cursor: pointer; border: none; padding: 0;
}
.slideshow-dot.active { background: rgba(255,255,255,0.8); }

/* Spreadsheet card */
.spreadsheet-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.spreadsheet-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.spreadsheet-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.spreadsheet-info-section {
  flex: 1; min-width: 0;
}
.spreadsheet-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spreadsheet-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.spreadsheet-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.spreadsheet-download-btn:hover { background: rgba(255,255,255,0.22); }
.spreadsheet-download-btn:active { background: rgba(255,255,255,0.32); }
.spreadsheet-download-btn.downloading { opacity: 0.6; pointer-events: none; }

/* Diagram card */
.diagram-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.diagram-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.diagram-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.diagram-info-section {
  flex: 1; min-width: 0;
}
.diagram-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diagram-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.diagram-card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.diagram-view-btn, .diagram-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.diagram-view-btn:hover, .diagram-download-btn:hover { background: rgba(255,255,255,0.22); }
.diagram-view-btn:active, .diagram-download-btn:active { background: rgba(255,255,255,0.32); }
/* Diagram modal */
.diagram-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  animation: illustFadeIn 0.2s ease;
}
.diagram-modal {
  background: #1a1a2e; border-radius: 16px;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.diagram-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.diagram-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  flex: 1; padding-right: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diagram-modal-actions {
  display: flex; gap: 8px;
}
.diagram-modal-download, .diagram-modal-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background 0.2s, color 0.2s;
}
.diagram-modal-download:hover, .diagram-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.diagram-modal-body {
  padding: 24px; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
  background: #fff; border-radius: 0 0 16px 16px;
}
.diagram-modal-body svg {
  max-width: 100%; max-height: 75vh;
}

/* Practice Modeler card */
.practice-modeler-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(91,110,62,0.3) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.practice-modeler-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.practice-modeler-icon-section {
  flex-shrink: 0; color: #7A8F5C;
}
.practice-modeler-info-section {
  flex: 1; min-width: 0;
}
.practice-modeler-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.practice-modeler-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.practice-modeler-card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.practice-modeler-open-btn {
  flex-shrink: 0; background: rgba(91,110,62,0.3);
  color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 12px; cursor: pointer;
  transition: background 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.practice-modeler-open-btn:hover { background: rgba(91,110,62,0.5); }
/* Practice Modeler overlay */
.practice-modeler-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  animation: illustFadeIn 0.2s ease;
}
.practice-modeler-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.practice-modeler-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  flex: 1; padding-right: 12px;
}
.practice-modeler-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background 0.2s, color 0.2s;
}
.practice-modeler-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.practice-modeler-body {
  flex: 1; overflow: hidden;
}
.practice-modeler-iframe {
  width: 100%; height: 100%; border: none;
}

/* Calendar card */
.calendar-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.calendar-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.calendar-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.calendar-info-section {
  flex: 1; min-width: 0;
}
.calendar-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.calendar-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.calendar-download-btn:hover { background: rgba(255,255,255,0.22); }
.calendar-download-btn:active { background: rgba(255,255,255,0.32); }

/* Audio generation card */
.audio-gen-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.audio-gen-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.audio-gen-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.audio-gen-info-section {
  flex: 1; min-width: 0;
}
.audio-gen-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.audio-gen-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.audio-gen-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.audio-gen-download-btn:hover { background: rgba(255,255,255,0.22); }
.audio-gen-download-btn:active { background: rgba(255,255,255,0.32); }
.audio-gen-download-btn.downloading { opacity: 0.6; pointer-events: none; }
.audio-gen-recording {
  display: flex; align-items: center; gap: 6px;
}
.audio-gen-recording-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff4444;
  animation: audioRecPulse 1.2s ease-in-out infinite;
}
@keyframes audioRecPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.audio-gen-recording-text {
  font-size: 12px; color: rgba(255,255,255,0.6);
}

/* Video generation card */
.video-gen-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.video-gen-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.video-gen-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.video-gen-info-section {
  flex: 1; min-width: 0;
}
.video-gen-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-gen-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.video-gen-card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.video-gen-preview-btn, .video-gen-download-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.video-gen-preview-btn:hover, .video-gen-download-btn:hover {
  background: rgba(255,255,255,0.22);
}
.video-gen-progress-bar {
  height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px;
  margin-top: 6px; overflow: hidden;
}
.video-gen-progress-fill {
  height: 100%; background: #4682B4; border-radius: 2px;
  width: 0%; transition: width 0.3s ease;
}
.video-gen-spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: videoGenSpin 0.8s linear infinite;
}
@keyframes videoGenSpin { to { transform: rotate(360deg); } }
.video-preview-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  animation: illustFadeIn 0.2s ease;
}
.video-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.video-preview-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  flex: 1;
}
.video-preview-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.video-preview-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.video-preview-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

/* Education Video Card */
.edu-video-card {
  background: linear-gradient(135deg, rgba(74,102,112,0.15), rgba(74,102,112,0.08));
  border: 1px solid rgba(74,102,112,0.25);
  border-radius: 12px;
  padding: 0;
  margin: 8px 0;
  max-width: 420px;
  overflow: hidden;
}
.edu-video-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.edu-video-card-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(74,102,112,0.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.edu-video-card-info {
  flex: 1; min-width: 0;
}
.edu-video-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600;
  color: var(--chat-text, #e8e0d4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.edu-video-card-meta {
  font-size: 12px; color: rgba(232,224,212,0.5); margin-top: 2px;
}
.edu-video-card-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.edu-video-play-btn {
  background: #4A6670; border: none; border-radius: 8px;
  color: #fff; padding: 8px 16px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.15s;
}
.edu-video-play-btn:hover { background: #5a7a85; }
.edu-video-open-btn {
  background: transparent; border: 1px solid rgba(74,102,112,0.4);
  border-radius: 8px; color: rgba(232,224,212,0.6);
  padding: 8px 12px; cursor: pointer; font-size: 12px;
  transition: all 0.15s; white-space: nowrap;
}
.edu-video-open-btn:hover {
  border-color: rgba(74,102,112,0.7);
  color: rgba(232,224,212,0.9);
}
/* Education Video Iframe Overlay */
.edu-video-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  animation: illustFadeIn 0.2s ease;
}
.edu-video-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.edu-video-overlay-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff; flex: 1;
}
.edu-video-overlay-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.edu-video-overlay-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.edu-video-overlay-body {
  flex: 1; display: flex; align-items: stretch; justify-content: center;
  padding: 0;
}
.edu-video-overlay-body iframe {
  width: 100%; height: 100%; border: none;
}

/* Platform Guide Screenshot Card */
.platform-guide-card {
  background: linear-gradient(135deg, rgba(74,102,112,0.15), rgba(74,102,112,0.08));
  border: 1px solid rgba(74,102,112,0.25);
  border-radius: 12px;
  padding: 0;
  max-width: 420px;
  overflow: hidden;
}
.platform-guide-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.platform-guide-card-thumb {
  width: 60px; height: 45px; flex-shrink: 0;
  background: rgba(74,102,112,0.2);
  border-radius: 6px;
  overflow: hidden;
}
.platform-guide-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.platform-guide-card-info {
  flex: 1; min-width: 0;
}
.platform-guide-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600;
  color: var(--chat-text, #e8e0d4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.platform-guide-card-caption {
  font-size: 12px; color: rgba(232,224,212,0.6); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.platform-guide-card-meta {
  font-size: 11px; color: rgba(232,224,212,0.4); margin-top: 3px;
}
.platform-guide-card-actions {
  display: flex; flex-shrink: 0;
}
.platform-guide-view-btn {
  background: #4A6670; border: none; border-radius: 8px;
  color: #fff; padding: 8px 16px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.15s;
}
.platform-guide-view-btn:hover { background: #5a7a85; }
/* Platform Guide Image Overlay */
.platform-guide-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  animation: illustFadeIn 0.2s ease;
}
.platform-guide-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.platform-guide-overlay-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff; flex: 1;
}
.platform-guide-overlay-close {
  background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.platform-guide-overlay-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.platform-guide-overlay-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; overflow: auto;
}
.platform-guide-overlay-body img {
  max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain;
  border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.platform-guide-overlay-caption {
  font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 12px;
  text-align: center; max-width: 700px; line-height: 1.5;
}

/* Research card (compact, similar to PDF card) */
.research-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.research-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.research-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.research-info-section {
  flex: 1; min-width: 0;
}
.research-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.research-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.research-view-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.research-view-btn:hover { background: rgba(255,255,255,0.22); }
.research-view-btn:active { background: rgba(255,255,255,0.32); }

/* Research modal overlay */
.research-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: researchFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes researchFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.research-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 520px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.research-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.research-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.research-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.research-modal-copy, .research-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.research-modal-close { font-size: 18px; }
.research-modal-copy svg { width: 15px; height: 15px; }
.research-modal-copy:hover, .research-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.research-modal-copy.copied {
  color: #4ade80; background: rgba(74,222,128,0.15);
}
.research-modal-body {
  overflow-y: auto; padding: 16px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.research-summary {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.75);
}
.research-summary p {
  margin: 0 0 10px;
}
.research-summary p:last-child { margin-bottom: 0; }
.research-summary strong {
  color: #fff; font-weight: 600;
}
.research-summary em {
  font-style: italic;
}
.research-summary ul, .research-summary ol {
  margin: 6px 0 10px; padding-left: 20px;
}
.research-summary li {
  margin-bottom: 4px;
}
.research-summary .ref-cite {
  color: #7eb8ff; font-weight: 500; font-size: 12px;
  text-decoration: none;
}
.research-summary a.ref-cite:hover {
  text-decoration: underline;
}
.research-summary a {
  color: #7eb8ff; text-decoration: none;
}
.research-summary a:hover {
  text-decoration: underline; color: #a8d0ff;
}
.research-summary .research-section-heading {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 700; color: #7eb8ff;
  margin: 14px 0 6px; padding: 0;
}
.research-summary .research-section-heading:first-child {
  margin-top: 0;
}
.research-ref-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.research-ref-item:last-child { border-bottom: none; }
.research-ref-number {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.research-ref-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 4px;
}
.research-ref-title a {
  color: #7eb8ff; text-decoration: none;
}
.research-ref-title a:hover {
  text-decoration: underline; color: #a8d0ff;
}
.research-ref-title span {
  color: #fff;
}
.research-ref-meta {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 6px;
}
.research-ref-tallies {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.research-tally {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  font-weight: 500;
}
.research-tally.supporting {
  background: rgba(76,175,80,0.15); color: #81c784;
}
.research-tally.contradicting {
  background: rgba(244,67,54,0.15); color: #ef9a9a;
}
.research-tally.mentioning {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
}

/* ClinVar variant card (compact, matches research card layout) */
.clinvar-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.clinvar-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.clinvar-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.clinvar-info-section {
  flex: 1; min-width: 0;
}
.clinvar-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clinvar-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.clinvar-view-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.clinvar-view-btn:hover { background: rgba(255,255,255,0.22); }
.clinvar-view-btn:active { background: rgba(255,255,255,0.32); }

/* ClinVar modal */
.clinvar-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes clinvarFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.clinvar-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.clinvar-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.clinvar-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.clinvar-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.clinvar-modal-copy, .clinvar-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.clinvar-modal-close { font-size: 18px; }
.clinvar-modal-copy svg { width: 15px; height: 15px; }
.clinvar-modal-copy:hover, .clinvar-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.clinvar-modal-copy.copied {
  color: #4ade80; background: rgba(74,222,128,0.15);
}
.clinvar-modal-body {
  overflow-y: auto; padding: 16px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.websearch-answer {
  color: rgba(255,255,255,0.85); font-size: 14px; line-height: 1.65;
}
.websearch-answer p { margin: 0 0 12px; }
.websearch-answer p:last-child { margin-bottom: 0; }
.websearch-answer strong { color: #fff; font-weight: 600; }
.websearch-answer em { font-style: italic; color: rgba(255,255,255,0.9); }
.websearch-answer ul, .websearch-answer ol { margin: 0 0 12px; padding-left: 20px; }
.websearch-answer li { margin-bottom: 4px; }
.websearch-answer .research-section-heading {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 15px; font-weight: 700; color: #7eb8ff;
  margin: 16px 0 8px;
}
.websearch-answer .research-section-heading:first-child { margin-top: 0; }
.websearch-answer a { color: rgba(120,180,255,0.9); text-decoration: none; }
.websearch-answer a:hover { text-decoration: underline; color: #a8d0ff; }
.websearch-answer .ref-cite {
  font-size: 11px; vertical-align: super; color: rgba(120,180,255,0.8);
  text-decoration: none; cursor: pointer;
}
.websearch-answer .ref-cite:hover { color: #a8d0ff; text-decoration: underline; }

/* YouTube video card */
.youtube-card {
  background: linear-gradient(135deg, rgba(255,0,0,0.12) 0%, rgba(40,40,50,0.85) 100%);
  border: 1px solid rgba(255,0,0,0.2);
  border-radius: 14px; padding: 14px 16px; margin: 10px 0 6px;
  max-width: 420px;
}
.youtube-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.youtube-card-icon {
  flex-shrink: 0; color: #ff4444;
}
.youtube-card-title {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.youtube-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px;
}
.youtube-video-list {
  display: flex; flex-direction: column; gap: 8px;
}
.youtube-video-item {
  display: flex; gap: 10px; padding: 8px; border-radius: 10px;
  background: rgba(255,255,255,0.04); cursor: pointer; text-decoration: none;
  transition: background 0.15s;
}
.youtube-video-item:hover { background: rgba(255,255,255,0.1); }
.youtube-thumb {
  width: 100px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: rgba(0,0,0,0.3);
}
.youtube-video-info { flex: 1; min-width: 0; }
.youtube-video-name {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.88);
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.youtube-video-channel {
  font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.youtube-video-stats {
  font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px;
}
.youtube-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,0,0,0.18); border: 1px solid rgba(255,0,0,0.25);
  color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 600;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; margin-top: 10px;
}
.youtube-view-btn:hover { background: rgba(255,0,0,0.28); }
.youtube-view-btn:active { background: rgba(255,0,0,0.38); }

.clinvar-search-summary {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5;
}
.clinvar-search-summary strong { color: rgba(255,255,255,0.75); font-weight: 600; }
.clinvar-variant-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.clinvar-variant-item:last-child { border-bottom: none; }
.clinvar-variant-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 6px;
}
.clinvar-variant-title a { color: #7eb8ff; text-decoration: none; }
.clinvar-variant-title a:hover { text-decoration: underline; color: #a8d0ff; }
.clinvar-variant-title span { color: #fff; }
.clinvar-sig-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.clinvar-sig-badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 4px;
}
.clinvar-sig-badge.pathogenic { background: rgba(239,83,80,0.15); color: #ef5350; }
.clinvar-sig-badge.likely-pathogenic { background: rgba(255,167,38,0.15); color: #ffa726; }
.clinvar-sig-badge.vus { background: rgba(255,238,88,0.15); color: #fff176; }
.clinvar-sig-badge.likely-benign { background: rgba(102,187,106,0.15); color: #66bb6a; }
.clinvar-sig-badge.benign { background: rgba(102,187,106,0.15); color: #66bb6a; }
.clinvar-sig-badge.conflicting { background: rgba(66,165,245,0.15); color: #42a5f5; }
.clinvar-sig-badge.other { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.clinvar-review-status {
  font-size: 11px; color: rgba(255,255,255,0.35);
}
.clinvar-variant-meta {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; line-height: 1.5;
}
.clinvar-variant-accession {
  font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px;
}
.clinvar-variant-accession a { color: rgba(255,255,255,0.4); text-decoration: none; }
.clinvar-variant-accession a:hover { color: #7eb8ff; text-decoration: underline; }

/* dbSNP variant card (compact, matches clinvar card layout) */
.dbsnp-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.dbsnp-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.dbsnp-icon-section {
  flex-shrink: 0; color: #26c6da;
}
.dbsnp-info-section {
  flex: 1; min-width: 0;
}
.dbsnp-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dbsnp-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.dbsnp-view-btn {
  flex-shrink: 0; background: rgba(38,198,218,0.15);
  color: #26c6da; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.dbsnp-view-btn:hover { background: rgba(38,198,218,0.28); }
.dbsnp-view-btn:active { background: rgba(38,198,218,0.38); }

/* dbSNP modal */
.dbsnp-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: dbsnpFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes dbsnpFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.dbsnp-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.dbsnp-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dbsnp-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.dbsnp-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.dbsnp-modal-copy, .dbsnp-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.dbsnp-modal-close { font-size: 18px; }
.dbsnp-modal-copy svg { width: 15px; height: 15px; }
.dbsnp-modal-copy:hover, .dbsnp-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.dbsnp-modal-copy.copied {
  color: #4ade80; background: rgba(74,222,128,0.15);
}
.dbsnp-modal-body {
  overflow-y: auto; padding: 16px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.dbsnp-search-summary {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5;
}
.dbsnp-search-summary strong { color: rgba(255,255,255,0.75); font-weight: 600; }
.dbsnp-snp-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dbsnp-snp-item:last-child { border-bottom: none; }
.dbsnp-snp-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 6px;
}
.dbsnp-snp-title a { color: #26c6da; text-decoration: none; }
.dbsnp-snp-title a:hover { text-decoration: underline; color: #4dd0e1; }
.dbsnp-snp-title span { color: #fff; }
.dbsnp-maf-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.dbsnp-maf-badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 4px;
}
.dbsnp-maf-badge.rare { background: rgba(38,198,218,0.15); color: #26c6da; }
.dbsnp-maf-badge.low-freq { background: rgba(66,165,245,0.15); color: #42a5f5; }
.dbsnp-maf-badge.common { background: rgba(102,187,106,0.15); color: #66bb6a; }
.dbsnp-maf-badge.unknown { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.dbsnp-func-class {
  font-size: 11px; color: rgba(255,255,255,0.35);
}
.dbsnp-snp-meta {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; line-height: 1.5;
}
.dbsnp-snp-accession {
  font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px;
}
.dbsnp-snp-accession a { color: rgba(255,255,255,0.4); text-decoration: none; }
.dbsnp-snp-accession a:hover { color: #26c6da; text-decoration: underline; }

/* ClinGen gene card (compact, matches clinvar card layout) */
.clingen-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.clingen-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.clingen-icon-section {
  flex-shrink: 0; color: #ffb74d;
}
.clingen-info-section {
  flex: 1; min-width: 0;
}
.clingen-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clingen-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.clingen-view-btn {
  flex-shrink: 0; background: rgba(255,183,77,0.15);
  color: #ffb74d; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.clingen-view-btn:hover { background: rgba(255,183,77,0.28); }
.clingen-view-btn:active { background: rgba(255,183,77,0.38); }

/* ClinGen modal */
.clingen-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clingenFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes clingenFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.clingen-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.clingen-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.clingen-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.clingen-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.clingen-modal-copy, .clingen-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.clingen-modal-close { font-size: 18px; }
.clingen-modal-copy svg { width: 15px; height: 15px; }
.clingen-modal-copy:hover, .clingen-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.clingen-modal-copy.copied {
  color: #4ade80; background: rgba(74,222,128,0.15);
}
.clingen-modal-body {
  overflow-y: auto; padding: 16px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.clingen-search-summary {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5;
}
.clingen-search-summary strong { color: rgba(255,255,255,0.75); font-weight: 600; }
.clingen-gene-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.clingen-gene-item:last-child { border-bottom: none; }
.clingen-gene-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 6px;
}
.clingen-gene-title a { color: #ffb74d; text-decoration: none; }
.clingen-gene-title a:hover { text-decoration: underline; color: #ffc97d; }
.clingen-gene-title span { color: #fff; }
.clingen-gene-subtitle {
  font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 6px;
  font-style: italic;
}
.clingen-badge-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}
.clingen-type-badge {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(255,183,77,0.12); color: #ffb74d;
}
.clingen-gene-meta {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; line-height: 1.5;
}
.clingen-gene-summary {
  font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 6px; line-height: 1.5;
}
.clingen-gene-accession {
  font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px;
}
.clingen-gene-accession a { color: rgba(255,255,255,0.4); text-decoration: none; }
.clingen-gene-accession a:hover { color: #ffb74d; text-decoration: underline; }

/* PharmGKB card */
.pharmgkb-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.pharmgkb-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.pharmgkb-icon-section {
  flex-shrink: 0; color: #81c784;
}
.pharmgkb-info-section {
  flex: 1; min-width: 0;
}
.pharmgkb-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pharmgkb-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.pharmgkb-view-btn {
  flex-shrink: 0; background: rgba(129,199,132,0.15);
  color: #81c784; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.pharmgkb-view-btn:hover { background: rgba(129,199,132,0.28); }
.pharmgkb-view-btn:active { background: rgba(129,199,132,0.38); }
/* PharmGKB modal */
.pharmgkb-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
.pharmgkb-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.pharmgkb-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.pharmgkb-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.pharmgkb-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pharmgkb-modal-copy, .pharmgkb-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.pharmgkb-modal-close { font-size: 18px; }
.pharmgkb-modal-copy svg { width: 15px; height: 15px; }
.pharmgkb-modal-copy:hover, .pharmgkb-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.pharmgkb-modal-copy.copied {
  color: #81c784; background: rgba(129,199,132,0.15);
}
.pharmgkb-modal-body {
  overflow-y: auto; padding: 16px 20px 20px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.pharmgkb-search-summary {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5;
}
.pharmgkb-search-summary strong { color: rgba(255,255,255,0.75); font-weight: 600; }
.pharmgkb-section-header {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 13px; font-weight: 600; color: #81c784;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(129,199,132,0.2);
}
.pharmgkb-section-header:first-child { margin-top: 0; }
.pharmgkb-guideline-item {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pharmgkb-guideline-item:last-child { border-bottom: none; }
.pharmgkb-guideline-title {
  font-size: 13px; font-weight: 500; color: #fff; line-height: 1.4;
}
.pharmgkb-guideline-title a { color: #81c784; text-decoration: none; }
.pharmgkb-guideline-title a:hover { text-decoration: underline; }
.pharmgkb-guideline-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px;
}
.pharmgkb-guideline-meta a { color: rgba(129,199,132,0.7); text-decoration: none; }
.pharmgkb-guideline-meta a:hover { text-decoration: underline; }
.pharmgkb-annotation-item {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pharmgkb-annotation-item:last-child { border-bottom: none; }
.pharmgkb-annotation-title {
  font-size: 13px; font-weight: 500; color: #fff; line-height: 1.4;
}
.pharmgkb-annotation-title a { color: #81c784; text-decoration: none; }
.pharmgkb-annotation-title a:hover { text-decoration: underline; }
.pharmgkb-badge-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.pharmgkb-evidence-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}
.pharmgkb-evidence-badge.strong {
  background: rgba(129,199,132,0.2); color: #81c784;
}
.pharmgkb-evidence-badge.moderate {
  background: rgba(255,183,77,0.2); color: #ffb74d;
}
.pharmgkb-evidence-badge.low {
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6);
}
.pharmgkb-evidence-badge.limited {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
}
.pharmgkb-type-badge {
  display: inline-block; font-size: 11px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5);
}
.pharmgkb-annotation-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px;
}

/* UniProt card */
.uniprot-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.uniprot-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.uniprot-icon-section {
  flex-shrink: 0; color: #4dd0e1;
}
.uniprot-info-section {
  flex: 1; min-width: 0;
}
.uniprot-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uniprot-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.uniprot-view-btn {
  flex-shrink: 0; background: rgba(77,208,225,0.15);
  color: #4dd0e1; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.uniprot-view-btn:hover { background: rgba(77,208,225,0.28); }
.uniprot-view-btn:active { background: rgba(77,208,225,0.38); }
/* UniProt modal */
.uniprot-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
.uniprot-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.uniprot-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.uniprot-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.uniprot-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.uniprot-modal-copy, .uniprot-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.uniprot-modal-close { font-size: 18px; }
.uniprot-modal-copy svg { width: 15px; height: 15px; }
.uniprot-modal-copy:hover, .uniprot-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.uniprot-modal-copy.copied {
  color: #4dd0e1; background: rgba(77,208,225,0.15);
}
.uniprot-modal-body {
  overflow-y: auto; padding: 16px 20px 20px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.uniprot-entry-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.uniprot-entry-item:last-child { border-bottom: none; }
.uniprot-entry-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 4px;
}
.uniprot-entry-title a { color: #4dd0e1; text-decoration: none; }
.uniprot-entry-title a:hover { text-decoration: underline; }
.uniprot-entry-subtitle {
  font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 6px;
}
.uniprot-section-label {
  font-size: 11px; font-weight: 600; color: #4dd0e1;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.uniprot-section-label:first-child { margin-top: 0; }
.uniprot-text-block {
  font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5;
  margin-bottom: 6px;
}
.uniprot-disease-item {
  font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.4;
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.uniprot-disease-item:last-child { border-bottom: none; }
.uniprot-disease-name { font-weight: 500; color: rgba(255,255,255,0.7); }
.uniprot-disease-name a { color: #4dd0e1; text-decoration: none; }
.uniprot-disease-name a:hover { text-decoration: underline; }
.uniprot-domain-badge {
  display: inline-block; font-size: 11px;
  padding: 2px 8px; border-radius: 4px; margin: 2px 4px 2px 0;
  background: rgba(77,208,225,0.12); color: #4dd0e1;
}
.uniprot-entry-meta {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 6px;
}
.uniprot-entry-meta a { color: rgba(255,255,255,0.45); text-decoration: none; }
.uniprot-entry-meta a:hover { color: #4dd0e1; text-decoration: underline; }

/* MONDO disease ontology card */
.mondo-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.mondo-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.mondo-icon-section {
  flex-shrink: 0; color: #ce93d8;
}
.mondo-info-section {
  flex: 1; min-width: 0;
}
.mondo-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mondo-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.mondo-view-btn {
  flex-shrink: 0; background: rgba(206,147,216,0.15);
  color: #ce93d8; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.mondo-view-btn:hover { background: rgba(206,147,216,0.28); }
.mondo-view-btn:active { background: rgba(206,147,216,0.38); }
/* MONDO modal */
.mondo-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
.mondo-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.mondo-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.mondo-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.mondo-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.mondo-modal-copy, .mondo-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.mondo-modal-close { font-size: 18px; }
.mondo-modal-copy svg { width: 15px; height: 15px; }
.mondo-modal-copy:hover, .mondo-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.mondo-modal-copy.copied {
  color: #ce93d8; background: rgba(206,147,216,0.15);
}
.mondo-modal-body {
  overflow-y: auto; padding: 16px 20px 20px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.mondo-search-summary {
  font-size: 12px; color: rgba(255,255,255,0.4);
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mondo-disease-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mondo-disease-item:last-child { border-bottom: none; }
.mondo-disease-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 4px;
}
.mondo-disease-title a { color: #ce93d8; text-decoration: none; }
.mondo-disease-title a:hover { text-decoration: underline; }
.mondo-disease-desc {
  font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5;
  margin-bottom: 6px;
}
.mondo-disease-meta {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px;
}
.mondo-xref-badge {
  display: inline-block; font-size: 10px;
  padding: 2px 6px; border-radius: 4px; margin: 2px 4px 2px 0;
  background: rgba(206,147,216,0.12); color: #ce93d8;
}
.mondo-section-label {
  font-size: 11px; font-weight: 600; color: #ce93d8;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.mondo-phenotype-item {
  font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.4;
  padding: 3px 0;
}
.mondo-phenotype-item a { color: #ce93d8; text-decoration: none; }
.mondo-phenotype-item a:hover { text-decoration: underline; }

/* FDA Drug Label card */
.drug-label-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.drug-label-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.drug-label-icon-section {
  flex-shrink: 0; color: #ef9a9a;
}
.drug-label-info-section {
  flex: 1; min-width: 0;
}
.drug-label-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drug-label-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.drug-label-view-btn {
  flex-shrink: 0; background: rgba(239,154,154,0.15);
  color: #ef9a9a; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.drug-label-view-btn:hover { background: rgba(239,154,154,0.28); }
.drug-label-view-btn:active { background: rgba(239,154,154,0.38); }
/* Drug Label modal */
.drug-label-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
.drug-label-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.drug-label-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.drug-label-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.drug-label-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.drug-label-modal-copy, .drug-label-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.drug-label-modal-close { font-size: 18px; }
.drug-label-modal-copy svg { width: 15px; height: 15px; }
.drug-label-modal-copy:hover, .drug-label-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.drug-label-modal-copy.copied {
  color: #ef9a9a; background: rgba(239,154,154,0.15);
}
.drug-label-modal-body {
  overflow-y: auto; padding: 16px 20px 20px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.drug-label-search-summary {
  font-size: 12px; color: rgba(255,255,255,0.4);
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drug-label-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drug-label-item:last-child { border-bottom: none; }
.drug-label-drug-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 2px; color: #fff;
}
.drug-label-drug-subtitle {
  font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 8px;
}
.drug-label-section-header {
  font-size: 11px; font-weight: 600; color: #ef9a9a;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.drug-label-section-content {
  font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5;
  margin-bottom: 6px; white-space: pre-wrap;
}
.drug-label-boxed-warning {
  border: 2px solid #ef5350; background: rgba(239,83,80,0.12);
  padding: 12px; border-radius: 8px; margin: 8px 0;
}
.drug-label-boxed-warning-header {
  color: #ef5350; font-weight: 700; text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.5px; margin-bottom: 6px;
}
.drug-label-boxed-warning-text {
  font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.5;
  white-space: pre-wrap;
}
.drug-label-meta {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 8px;
}
.drug-label-meta a { color: rgba(255,255,255,0.45); text-decoration: none; }
.drug-label-meta a:hover { color: #ef9a9a; text-decoration: underline; }

/* MedlinePlus health topic card */
.medlineplus-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.medlineplus-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.medlineplus-icon-section {
  flex-shrink: 0; color: #80cbc4;
}
.medlineplus-info-section {
  flex: 1; min-width: 0;
}
.medlineplus-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.medlineplus-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.medlineplus-view-btn {
  flex-shrink: 0; background: rgba(128,203,196,0.15);
  color: #80cbc4; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.medlineplus-view-btn:hover { background: rgba(128,203,196,0.28); }
.medlineplus-view-btn:active { background: rgba(128,203,196,0.38); }
/* MedlinePlus modal */
.medlineplus-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: clinvarFadeIn 0.2s ease;
  overflow: hidden;
}
.medlineplus-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 560px; width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.medlineplus-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.medlineplus-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.medlineplus-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.medlineplus-modal-copy, .medlineplus-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.medlineplus-modal-close { font-size: 18px; }
.medlineplus-modal-copy svg { width: 15px; height: 15px; }
.medlineplus-modal-copy:hover, .medlineplus-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.medlineplus-modal-copy.copied {
  color: #80cbc4; background: rgba(128,203,196,0.15);
}
.medlineplus-modal-body {
  overflow-y: auto; padding: 16px 20px 20px; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.medlineplus-search-summary {
  font-size: 12px; color: rgba(255,255,255,0.4);
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.medlineplus-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.medlineplus-item:last-child { border-bottom: none; }
.medlineplus-topic-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  margin-bottom: 4px; color: #fff;
}
.medlineplus-topic-title a { color: #80cbc4; text-decoration: none; }
.medlineplus-topic-title a:hover { text-decoration: underline; }
.medlineplus-topic-snippet {
  font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5;
  margin-bottom: 6px;
}
.medlineplus-topic-link {
  font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px;
}
.medlineplus-topic-link a { color: rgba(255,255,255,0.45); text-decoration: none; }
.medlineplus-topic-link a:hover { color: #80cbc4; text-decoration: underline; }

/* Illustration card */
.illustration-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 340px;
  min-height: 58px;
  width: 340px;
  align-self: flex-start;
}
.illustration-card-inner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.illustration-icon-section {
  flex-shrink: 0; color: rgba(255,255,255,0.65);
}
.illustration-info-section {
  flex: 1; min-width: 0;
}
.illustration-card-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.illustration-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px;
}
.illustration-view-btn {
  flex-shrink: 0; background: rgba(255,255,255,0.12);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.illustration-view-btn:hover { background: rgba(255,255,255,0.22); }
.illustration-view-btn:active { background: rgba(255,255,255,0.32); }

/* Illustration modal */
.illustration-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  animation: illustFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes illustFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.illustration-modal {
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; max-width: 680px; width: 92vw;
  max-height: 90vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}
.illustration-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.illustration-modal-title {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  line-height: 1.3; flex: 1; padding-right: 12px;
}
.illustration-modal-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.illustration-modal-download, .illustration-modal-close {
  flex-shrink: 0; background: rgba(255,255,255,0.08);
  border: none; border-radius: 8px; color: rgba(255,255,255,0.5);
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.illustration-modal-download:hover, .illustration-modal-close:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}
.illustration-modal-close { font-size: 18px; }
.illustration-modal-body {
  flex: 1; overflow: auto; padding: 16px 20px 20px;
  display: flex; align-items: center; justify-content: center;
}
.illustration-modal-body img {
  max-width: 100%; max-height: 65vh;
  border-radius: 8px; object-fit: contain;
}
.illustration-loading {
  color: rgba(255,255,255,0.4); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}

.audio-played-row {
  display: flex; align-items: center; gap: 8px;
}
.audio-played {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.3); font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.audio-played-icon {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.3);
  position: relative;
}
.audio-played-icon::after {
  content: ''; position: absolute; left: 4px; top: 3px;
  border-style: solid; border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent rgba(255,255,255,0.3);
}
.show-text-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,0.4); font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer; transition: all 0.2s;
  padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.show-text-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.25); }
/* Narrating row: bars + Receiving/Read button side by side */
.audio-narrating-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.chat-bubble.speaking.has-inline-text,
.chat-bubble.has-inline-text {
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  max-width: 100%;
}
.inline-response-text {
  margin-top: 10px; max-height: 200px; overflow-y: auto;
  position: relative; padding-right: 32px;
  overscroll-behavior: contain;
}
.inline-text-content {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; line-height: 1.5;
  color: rgba(255,255,255,0.85);
  white-space: pre-wrap; word-wrap: break-word;
}
.inline-text-copy {
  position: absolute; top: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  cursor: pointer; color: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.inline-text-copy svg { width: 14px; height: 14px; }
.inline-text-copy:hover { background: rgba(255,255,255,0.2); color: #fff; }
.inline-text-copy.copied { color: #4ade80; background: rgba(74,222,128,0.15); }

/* Response text modal */
.response-text-overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.response-text-overlay.open { display: flex; }
.response-text-modal {
  width: 480px; max-width: 92vw; max-height: 80vh;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.15);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.response-text-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.response-text-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; color: #fff; font-weight: 400;
}
.response-text-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.response-text-close:hover { background: rgba(255,255,255,0.2); }
.response-text-copy {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s; margin-left: auto; margin-right: 8px; flex-shrink: 0;
}
.response-text-copy:hover { background: rgba(255,255,255,0.2); color: #fff; }
.response-text-copy svg { width: 15px; height: 15px; }
.response-text-copy.copied { color: #4ade80; background: rgba(74,222,128,0.15); }
.response-text-body {
  padding: 18px; overflow-y: auto; flex: 1;
  overscroll-behavior: contain;
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 15px; line-height: 1.7; color: rgba(255,255,255,0.85);
  word-wrap: break-word;
}
.response-text-body p { margin: 0 0 12px 0; }
.response-text-body p:last-child { margin-bottom: 0; }
.response-text-body strong { color: #fff; }
.response-text-body em { font-style: italic; color: rgba(255,255,255,0.9); }
.response-text-body ul, .response-text-body ol {
  margin: 0 0 12px 0; padding-left: 22px;
}
.response-text-body li { margin-bottom: 4px; }
.response-text-body .research-section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; font-weight: 600; color: #fff;
  margin: 16px 0 8px 0;
}
.response-text-body .research-section-heading:first-child { margin-top: 0; }
.response-text-body a { color: #93c5fd; text-decoration: underline; }

/* "What I can do" modal */
.skills-overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center;
  padding-top: 60px;
}
.skills-overlay.open { display: flex; }
.skills-modal {
  width: 460px; max-width: 92vw; max-height: 80vh;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.15);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.skills-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.skills-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px; color: #fff; font-weight: 400; margin: 0;
}
.skills-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.skills-close:hover { background: rgba(255,255,255,0.2); }
.skills-body {
  padding: 18px; overflow-y: auto; flex: 1;
  overscroll-behavior: contain;
}
.skills-description {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; line-height: 1.65; color: rgba(255,255,255,0.8);
  margin: 0 0 18px 0;
}
.skills-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.4); margin: 0 0 8px 0;
}
.skills-list {
  list-style: none; padding: 0; margin: 0 0 18px 0;
}
.skills-list li {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 13px; color: rgba(255,255,255,0.75);
  padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  cursor: pointer; border-radius: 6px; margin: 0 -8px;
  transition: background 0.15s;
}
.skills-list li:hover { background: rgba(255,255,255,0.04); }
.skills-list li.skill-expanded { background: rgba(255,255,255,0.03); }
.skills-list li:last-child { border-bottom: none; }
.skills-list .skill-icon {
  font-size: 11px; flex-shrink: 0; width: 16px; text-align: center;
}
.skill-label-text { flex: 1; }
.skill-chevron {
  margin-left: auto; font-size: 14px; color: rgba(255,255,255,0.25);
  transition: transform 0.2s; flex-shrink: 0;
}
li.skill-expanded .skill-chevron { transform: rotate(90deg); }
.skill-example-card {
  width: 100%; max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
  opacity: 0; margin: 0 0 0 24px;
  border-left: 2px solid rgba(255,255,255,0.15);
  padding: 0 0 0 12px;
}
.skill-example-card.open {
  max-height: 140px; opacity: 1; padding: 8px 0 8px 12px;
}
.skill-example-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 4px;
}
.skill-example-text {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 13px; font-style: italic;
  color: rgba(255,255,255,0.7); line-height: 1.5;
}
.skill-example-use-btn {
  display: inline-block; margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 3px 10px;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.skill-example-use-btn:hover {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
}

.chat-char-counter {
  text-align: right; padding: 2px 20px 0; font-size: 11px;
  font-family: -apple-system, sans-serif; color: rgba(255,255,255,0.35);
  transition: color 0.2s; display: none; flex-shrink: 0;
}
.chat-char-counter.visible { display: block; }
.chat-char-counter.warn { color: #f59e0b; }
.chat-char-counter.over { color: #ef4444; }
.chat-input-row {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0; align-items: flex-end;
}
.chat-input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
  color: #fff; font-family: 'Source Serif Pro', Georgia, serif; font-size: 14px;
  outline: none; transition: border-color 0.2s;
  -webkit-user-select: text; user-select: text;
  resize: none; overflow-y: hidden; min-height: 40px; max-height: 100px; line-height: 20px;
}
.chat-input::placeholder { color: rgba(255,255,255,0.3); }
.chat-input:focus { border-color: rgba(255,255,255,0.35); }
.chat-input.stt-preview { color: rgba(255,255,255,0.5); }
.chat-input.stt-listening::placeholder { color: rgba(255,255,255,0.5); }
.chat-input.stt-sending { color: rgba(34,197,94,0.8); }
.chat-send {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-send:hover { background: rgba(255,255,255,0.25); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-mic {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-mic:hover { background: rgba(255,255,255,0.25); }
.chat-mic:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-mic.recording {
  background: rgba(220,38,38,0.8);
  /* Audio-level driven glow — JS sets --mic-level (0-1) via style property */
  box-shadow: 0 0 0 calc(var(--mic-level, 0) * 14px) rgba(220,38,38,calc(0.5 - var(--mic-level, 0) * 0.3));
  transition: box-shadow 0.08s ease-out;
}
.chat-mic.recording.mic-idle {
  /* Gentle pulse when recording but no speech detected yet */
  animation: micIdlePulse 2s ease-in-out infinite;
}
/* ── Voice mode states ── */
.chat-mic.voice-listening {
  background: rgba(34,197,94,0.85);
  /* Audio-level driven glow (green) */
  box-shadow: 0 0 0 calc(var(--mic-level, 0) * 14px) rgba(34,197,94,calc(0.5 - var(--mic-level, 0) * 0.3));
  transition: box-shadow 0.08s ease-out, background 0.2s;
}
.chat-mic.voice-listening.mic-idle {
  /* Noticeable green pulse while waiting for user to speak */
  animation: micVoiceIdlePulse 1.6s ease-in-out infinite;
}
.chat-mic.voice-narrating {
  /* Red: persona is speaking, mic is blocked */
  background: rgba(220,38,38,0.65);
  transition: background 0.2s;
}
@keyframes micVoiceIdlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50% { box-shadow: 0 0 0 9px rgba(34,197,94,0); }
}
.chat-mic.transcribing { opacity: 0.6; pointer-events: none; }
.chat-mic.auto-sending {
  background: rgba(34,197,94,0.8);
  animation: micSendPulse 0.4s ease-out;
}
@keyframes micIdlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
@keyframes micSendPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  100% { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
}

/* ── File Attachment ── */
.chat-attach {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-attach:hover { background: rgba(255,255,255,0.25); }
.chat-attach:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-attach svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-attach-preview { padding: 4px 16px 0; flex-shrink: 0; }
.chat-attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
  font-family: 'Source Serif Pro', Georgia, serif; font-size: 12px;
  max-width: 100%;
}
.chat-attach-chip .attach-icon { flex-shrink: 0; font-size: 14px; }
.chat-attach-chip .attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-attach-chip .attach-size { color: rgba(255,255,255,0.5); flex-shrink: 0; }
.chat-attach-chip .attach-remove {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.15); color: #fff;
  cursor: pointer; font-size: 12px; display: flex;
  align-items: center; justify-content: center; transition: background 0.2s;
}
.chat-attach-chip .attach-remove:hover { background: rgba(255,255,255,0.3); }
/* Attachment card (user-sent files) */
.attachment-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  margin: 6px 0 4px auto;
  max-width: 340px;
  align-self: flex-end;
  overflow: hidden;
  flex-shrink: 0;
}
.attachment-card-inner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.attachment-card-icon { flex-shrink: 0; color: rgba(255,255,255,0.5); }
.attachment-card-info { flex: 1; min-width: 0; }
.attachment-card-name {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachment-card-meta { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.attachment-card-thumb {
  width: 100%; max-height: 200px; object-fit: contain;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: block;
}

/* ── Chat Identification (Google Sign-In) ── */
.chat-identify {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; padding: 32px 24px; gap: 16px; text-align: center;
}
.chat-identify h3 {
  font-family: 'Playfair Display', serif; font-size: 22px; color: #fff;
  margin: 0 0 4px 0; font-weight: 600;
}
.chat-identify .id-hint {
  font-family: 'Source Serif Pro', serif; font-size: 13px; color: rgba(255,255,255,0.5);
  margin: 0; line-height: 1.4; max-width: 280px;
}
.chat-identify .id-error {
  font-family: 'Source Serif Pro', serif; font-size: 13px;
  color: #ff6b6b; margin: 0; min-height: 18px;
}
.chat-identify .google-btn-container {
  min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.chat-identify .gsi-unavailable {
  font-family: 'Source Serif Pro', serif; font-size: 13px; color: rgba(255,255,255,0.5);
  margin: 8px 0; line-height: 1.4;
}
/* Loading state shown during device-token check */
.chat-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; padding: 32px 24px; gap: 12px; text-align: center;
}
.chat-loading .loading-text {
  font-family: 'Source Serif Pro', serif; font-size: 15px; color: rgba(255,255,255,0.5);
}
.chat-loading .loading-dots::after {
  content: ''; animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
/* "Not you?" link for switching identity */
.not-you-link {
  font-family: 'Source Serif Pro', serif; font-size: 12px;
  color: rgba(255,255,255,0.35); cursor: pointer; text-decoration: underline;
  transition: color 0.2s; margin-top: 4px;
}
.not-you-link:hover { color: rgba(255,255,255,0.6); }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loading-overlay.dismissing {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.loading-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 32px; padding: 40px 24px; text-align: center;
}
.loading-brand h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 48px; font-weight: 400; color: #fff;
  letter-spacing: 4px; margin: 0 0 8px 0;
}
.loading-brand .subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: rgba(255,255,255,0.5);
  letter-spacing: 4px; text-transform: uppercase;
}
.loading-dots {
  display: flex; gap: 8px; justify-content: center;
}
.loading-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  animation: loading-pulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loading-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}
.loading-auth {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; padding: 40px 24px; text-align: center;
}
.loading-auth .auth-hint {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; color: rgba(255,255,255,0.5);
  margin: 0; line-height: 1.4;
}
.loading-auth .google-btn-container {
  min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.loading-auth .auth-error {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 13px; color: #ff6b6b; margin: 0; min-height: 18px;
}
.test-user-toggle {
  margin-top: 4px; text-align: center;
}
.test-user-link {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 12px; color: rgba(255,255,255,0.35);
  text-decoration: underline; cursor: pointer;
  transition: color 0.2s;
}
.test-user-link:hover { color: rgba(255,255,255,0.6); }
.test-user-form {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 4px;
}
.test-user-input {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 8px 14px;
  outline: none; width: 180px;
  transition: border-color 0.2s;
}
.test-user-input::placeholder { color: rgba(255,255,255,0.3); }
.test-user-input:focus { border-color: rgba(255,255,255,0.45); }
.test-user-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.7); background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 8px 16px;
  cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.test-user-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.loading-timeout {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; padding: 40px 24px; text-align: center;
}
.loading-timeout .auth-hint {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; color: rgba(255,255,255,0.5);
  margin: 0; line-height: 1.4;
}
.timeout-resume-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; letter-spacing: 1px;
  color: #fff; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 24px; padding: 12px 32px;
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.timeout-resume-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}

/* ── Tablet ── */
@media (max-width: 768px) {
  body { padding: 24px 12px; }
  .header h1 { font-size: 32px; letter-spacing: 2px; }
  .header .subtitle { font-size: 10px; letter-spacing: 2px; }
  .header .hint { font-size: 12px; }
  .filters { flex-wrap: wrap; gap: 8px; }
  .filter-btn { font-size: 10px; padding: 6px 14px; }
  .cards-grid { gap: 20px; }
  .card-container { width: 240px; height: 500px; }
  .name-row h2 { font-size: 20px; }
  /* Performance: remove blur filters on tablet */
  .play-btn-overlay, .ask-btn-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0,0,0,0.8); }
  .card-front, .card-back { box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  body { padding: 16px 8px; }
  .header { margin-bottom: 20px; }
  .header h1 { font-size: 24px; letter-spacing: 1px; }
  .header .subtitle { font-size: 9px; letter-spacing: 1.5px; }
  .header .hint { font-size: 11px; margin-top: 8px; }
  .filters { gap: 6px; margin-bottom: 20px; }
  .filter-btn { font-size: 9px; padding: 5px 10px; }
  .count-badge { font-size: 10px; margin-bottom: 16px; }
  .cards-grid { gap: 16px; }
  .card-container { width: calc(100vw - 32px); max-width: 320px; height: 520px; contain: layout style paint; content-visibility: auto; contain-intrinsic-size: auto 320px 520px; }
  .name-row h2 { font-size: 22px; }
  .name-row .title { font-size: 9px; max-width: 100px; }
  .tagline { font-size: 11px; }
  .card-info { padding: 12px 14px 14px; }
  .play-btn-overlay { width: 48px; height: 48px; }
  .ask-btn-overlay { width: 48px; height: 48px; }
  /* Performance: drop blur + simplify shadows on mobile */
  .play-btn-overlay, .ask-btn-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0,0,0,0.85); }
  .chat-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
  /* Performance: crossfade instead of 3D flip on mobile */
  .card-container { perspective: none; }
  .card { transform-style: flat; }
  .card.flipped { transform: none; }
  .card-face { backface-visibility: visible; }
  .card-back { transform: none; opacity: 0; pointer-events: none; }
  .card.flipped .card-front { opacity: 0; pointer-events: none; }
  .card.flipped .card-back { opacity: 1; pointer-events: auto; }
  .card.flip-ready .card-front,
  .card.flip-ready .card-back { transition: opacity 0.3s ease; }
  .card-front, .card-back { box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
  .chat-modal { box-shadow: none; }
  .back-header { gap: 8px; margin-bottom: 10px; }
  .card-back { padding: 14px; }
  .chat-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .chat-input { font-size: 16px; }
  .chat-bubble { max-width: 90%; font-size: 15px; }
  .loading-brand h1 { font-size: 28px; letter-spacing: 2px; }
  .loading-brand .subtitle { font-size: 10px; letter-spacing: 2px; }
  .tutorial-tooltip { width: calc(100vw - 24px); max-width: none; left: 12px !important; right: 12px !important; padding: 18px 16px 14px; }
  .tutorial-tooltip-title { font-size: 16px; }
  .tutorial-tooltip-body { font-size: 13px; }
  .tutorial-tooltip::before { display: none; }
}

/* ── Tutorial / Onboarding ── */
.tutorial-backdrop { display: none; position: fixed; inset: 0; z-index: 1499; pointer-events: auto; cursor: default; }
.tutorial-backdrop.active { display: block; }
.tutorial-spotlight {
  display: none; position: fixed; z-index: 1500;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
  transition: top 0.4s cubic-bezier(0.4,0,0.2,1), left 0.4s cubic-bezier(0.4,0,0.2,1), width 0.4s cubic-bezier(0.4,0,0.2,1), height 0.4s cubic-bezier(0.4,0,0.2,1), border-radius 0.4s ease, opacity 0.3s ease;
  pointer-events: none;
}
.tutorial-spotlight.active { display: block; }
.tutorial-spotlight.circular { border-radius: 50%; }
.tutorial-spotlight.wide { border-radius: 16px; }
.tutorial-tooltip {
  display: none; position: fixed; z-index: 1501;
  width: 380px; max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, #1e1e36 0%, #161628 100%);
  border: 2px solid #f0c040;
  border-radius: 14px;
  padding: 22px 20px 18px;
  box-shadow: 0 0 18px rgba(240,192,64,0.35), 0 16px 48px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.tutorial-tooltip.active { display: block; }
.tutorial-tooltip.visible { opacity: 1; transform: translateY(0); }
.tutorial-tooltip-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px; color: #fff;
  margin: 0 0 8px 0; line-height: 1.3;
}
.tutorial-tooltip-body {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px; color: rgba(255,255,255,0.75);
  line-height: 1.6; margin: 0 0 16px 0;
}
.tutorial-tooltip-footer { display: flex; align-items: center; justify-content: space-between; }
.tutorial-dots { display: flex; gap: 6px; }
.tutorial-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s ease;
}
.tutorial-dot.active { background: rgba(255,255,255,0.7); }
.tutorial-dot.completed { background: rgba(255,255,255,0.4); }
.tutorial-btns { display: flex; gap: 10px; }
.tutorial-skip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4); background: none;
  border: none; cursor: pointer; padding: 6px 12px;
  transition: color 0.2s;
}
.tutorial-skip:hover { color: rgba(255,255,255,0.7); }
.tutorial-next {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
  color: #fff; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 7px 20px;
  cursor: pointer; transition: all 0.2s;
}
.tutorial-next:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.tutorial-highlight { position: relative !important; z-index: 1500 !important; }
.play-btn-overlay.tutorial-highlight,
.ask-btn-overlay.tutorial-highlight { position: absolute !important; }
.tutorial-tooltip::before {
  content: ''; position: absolute;
  width: 12px; height: 12px;
  background: #1e1e36;
  border: 2px solid #f0c040;
  border-right: none; border-bottom: none;
  transform: rotate(45deg);
}
.tutorial-tooltip.arrow-top::before { top: -7px; left: 28px; }
.tutorial-tooltip.arrow-bottom::before { bottom: -7px; left: 28px; transform: rotate(225deg); }
.tutorial-tooltip.arrow-left::before { left: -7px; top: 24px; transform: rotate(-45deg); }
.tutorial-tooltip.no-arrow::before { display: none; }
@keyframes tutorial-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); } 50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
.tutorial-pulse { animation: tutorial-pulse 1.5s ease-in-out infinite; }


/* ── Multiple-choice question card ── */
.mcq-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 8px 0 4px;
  max-width: 480px;
  flex-shrink: 0;
}
.mcq-card.answered {
  opacity: 0.65;
}
.mcq-question {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  margin-bottom: 12px;
  line-height: 1.45;
}
.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mcq-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 9px;
  padding: 9px 14px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.mcq-option-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.28);
}
.mcq-option-btn.selected {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.mcq-option-btn:disabled {
  cursor: default;
}
.mcq-option-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.mcq-option-btn.selected .mcq-option-num {
  background: rgba(255,255,255,0.35);
  color: #fff;
}
.mcq-answered-label {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-align: right;
}

/* ── Patient record cards ── */
.patient-summary-card,
.patient-detail-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  max-width: 420px;
  width: 420px;
  align-self: flex-start;
}
.patient-card-inner {
  padding: 14px 16px;
}
.patient-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.patient-card-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.patient-card-name {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-card-pid {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}
.patient-card-demos {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.patient-card-summary {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin-bottom: 10px;
}
.patient-card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}
.patient-stat-col {
  flex: 1;
  min-width: 0;
}
.patient-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.patient-card-list {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
}
.patient-card-list li {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-dims {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  margin-top: 6px;
}
.patient-dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.patient-dim-name {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  width: 90px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patient-dim-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.patient-dim-fill {
  height: 100%;
  background: rgba(255,255,255,0.45);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.patient-dim-score {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.patient-dim-summary {
  width: 100%;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
  padding-left: 98px;
  margin-top: -2px;
  margin-bottom: 3px;
}
.patient-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.patient-section-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 2px 8px;
  text-transform: capitalize;
}
.patient-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  margin-top: 6px;
}
.patient-data-badge {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}
.patient-data-badge .badge-detail {
  color: rgba(255,255,255,0.4);
}
