@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-soft: #1f6feb;
  --border-subtle: #30363d;
  --border-light: #444c56;
  --text: #e6edf3;
  --text-secondary: #b1bac4;
  --text-muted: #8b949e;
  --card-bg: #1c2432;
  --card-bg-hover: #243044;
  --card-border: #30363d;
  --success: #3fb950;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #1a2332 0%, #0d1117 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

/* Header */

.app-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.8) 100%);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.5), rgba(16, 163, 127, 0.5), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  animation: float 4s ease-in-out infinite;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(88, 166, 255, 0.4));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand-text h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.brand-text h1 span {
  background: linear-gradient(135deg, #58a6ff 0%, #10a37f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-text p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Loader Section */

.loader {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.loader-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

textarea::placeholder {
  color: var(--text-muted);
}

/* How-to Steps */

.how-to-steps {
  margin-bottom: 1.25rem;
}

.how-to-steps h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
}

.step-card[data-step] {
  cursor: pointer;
}

.step-card-centered {
  justify-content: center;
}

.step-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.step-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.step-icon svg {
  width: 100%;
  height: 100%;
}

.step-image {
  width: 100%;
  height: 120px;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.step-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: var(--bg);
  padding: 4px;
}

.step-card:hover .step-image img {
  opacity: 1;
  transform: scale(1.02);
}

.step-card .step-number {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.step-desc strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.step-desc kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(110, 118, 129, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text);
}

.step-desc code {
  background: rgba(110, 118, 129, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

/* Input Method Tabs */

.input-tabs-container {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-method-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.input-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.input-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transform: none;
  box-shadow: none;
}

.input-tab.active {
  background: rgba(88, 166, 255, 0.08);
  color: var(--accent);
}

.input-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.input-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.input-tab.active svg {
  opacity: 1;
}

.tab-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.input-tab-content {
  display: none;
  padding: 1.25rem;
}

.input-tab-content.active {
  display: block;
}

.input-tab-content .field {
  margin-bottom: 0.75rem;
}

/* Link input styling */
.link-input-wrapper {
  position: relative;
}

.link-input-wrapper input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.link-input-wrapper input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-stack);
}

.field-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Input Area (for paste tab) */

.input-area {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.input-area .field {
  margin-bottom: 0.75rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Tabs (removed - keeping for potential future use) */

.input-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-subtle);
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.tab-content {
  display: none;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
}

.tab-content.active {
  display: block;
}

.tab-content .field {
  margin-bottom: 0.75rem;
}

.instructions {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.instructions summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  padding: 0.25rem 0;
}

.instructions summary:hover {
  color: var(--accent-hover);
}

.instructions ol {
  margin: 0.75rem 0 0 1.5rem;
  padding: 0;
}

.instructions li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.instructions code {
  background: rgba(110, 118, 129, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* Buttons */

button {
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent-soft);
  color: #fff;
  transition: all 0.15s ease;
}

button:hover {
  background: #388bfd;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: #21262d;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

button.secondary:hover {
  background: #30363d;
  color: var(--text);
  border-color: var(--border-light);
}

.tiny-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.4em;
}

/* Controls */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.view-buttons {
  display: inline-flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.view-buttons button {
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.view-buttons button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transform: none;
  box-shadow: none;
}

.view-buttons button.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: #fff;
}

.search-wrapper {
  flex: 1 1 280px;
  display: flex;
  justify-content: flex-end;
}

#searchInput {
  width: 100%;
  max-width: 320px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  color: var(--text);
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

/* Views Container */

.view-container {
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius-lg);
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  overflow: auto;
}

.view-container > p {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Grid View */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.qa-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qa-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--border-light);
  background: var(--card-bg-hover);
}

.qa-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qa-meta span:last-child {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.topic-tag {
  border: 1px solid;
}

.qa-section {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.qa-section-question {
  background: rgba(88, 166, 255, 0.08);
  border-left: 3px solid var(--accent);
}

.qa-section-answer {
  background: rgba(16, 163, 127, 0.06);
  border-left: 3px solid #10a37f;
  position: relative;
}

.qa-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.qa-label-assistant {
  color: #10a37f;
}

.qa-question {
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.qa-answer-preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 4.8em;
  overflow: hidden;
}

.qa-section-answer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(transparent, rgba(16, 163, 127, 0.06));
  pointer-events: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.qa-card:hover .qa-section-answer::after {
  background: linear-gradient(transparent, rgba(16, 163, 127, 0.08));
}

/* Timeline View */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--border-subtle) 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 1rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.timeline-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeline-card:hover {
  border-color: var(--border-light);
  background: var(--card-bg-hover);
  box-shadow: var(--shadow-card);
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: var(--text);
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.timeline-meta::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.timeline-preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 4.8em;
  overflow: hidden;
  position: relative;
}

.timeline-preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background: linear-gradient(transparent, var(--card-bg));
  pointer-events: none;
}

.timeline-card:hover .timeline-preview::after {
  background: linear-gradient(transparent, var(--card-bg-hover));
}

/* Bubbles View */

.bubbles-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.bubbles-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.bubbles-stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bubbles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  min-height: 300px;
}

.bubble {
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  animation: bubbleIn 0.5s ease-out backwards;
  animation-delay: var(--bubble-delay);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes bubbleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bubble-glow {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bubble-color) 0%, transparent 70%);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.bubble:hover .bubble-glow {
  opacity: 0.5;
}

.bubble-content {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bubble-color) 0%, color-mix(in srgb, var(--bubble-color) 70%, #000) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--bubble-color) 40%, transparent),
              inset 0 0 30px rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.bubble:hover .bubble-content {
  transform: scale(1.05);
}

.bubble-count {
  font-size: calc(var(--bubble-size) * 0.25);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.bubble-label {
  font-size: calc(var(--bubble-size) * 0.1);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding: 0 0.5rem;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.25rem;
}

/* Expanded bubble */
.bubble.expanded {
  z-index: 10;
}

.bubble.expanded .bubble-content {
  transform: scale(1.1);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--bubble-color) 60%, transparent),
              inset 0 0 30px rgba(255, 255, 255, 0.15);
}

.bubble-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 220px;
  max-width: 300px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: panelIn 0.2s ease-out;
  z-index: 20;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.bubble-item {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bubble-item:last-child {
  border-bottom: none;
}

.bubble-item:hover {
  background: var(--card-bg-hover);
}

.bubble-item-q {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
  .bubbles-container {
    gap: 0.75rem;
  }

  .bubble {
    --bubble-size: calc(var(--bubble-size) * 0.8) !important;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* Cluster View */

.clusters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.cluster-column {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cluster-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.cluster-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(139, 148, 158, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-item {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cluster-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-light);
}

.cluster-qa {
  padding: 0.5rem;
}

.cluster-qa .qa-question {
  font-size: 0.85rem;
}

.cluster-qa .qa-answer-preview {
  max-height: 3em;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 5vh 1rem;
  z-index: 100;
  overflow-y: auto;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  position: relative;
  width: min(900px, 100%);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 1.5rem 2rem 2rem;
  max-height: 85vh;
  overflow: auto;
}

/* Modal Question (User message style) */
.modal-question {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  border-left: 4px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-question::before {
  content: "You";
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Modal Answer (ChatGPT response style) */
.modal-answer {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.modal-answer::before {
  content: "ChatGPT";
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #10a37f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-answer p {
  margin: 0 0 1rem;
}

.modal-answer p:last-child {
  margin-bottom: 0;
}

.modal-answer h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.modal-answer h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.modal-answer h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}

.modal-answer strong {
  font-weight: 600;
  color: var(--text);
}

.modal-answer em {
  font-style: italic;
}

.modal-answer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-answer a:hover {
  color: var(--accent-hover);
}

/* Lists */
.modal-answer ul,
.modal-answer ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.modal-answer li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.modal-answer li:last-child {
  margin-bottom: 0;
}

/* Code blocks */
.modal-answer .code-block {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  background: #1e1e1e;
  overflow: hidden;
}

.modal-answer .code-block .code-lang {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #2d2d2d;
  border-bottom: 1px solid #3d3d3d;
  text-transform: lowercase;
}

.modal-answer .code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

.modal-answer .code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #d4d4d4;
  background: transparent;
  padding: 0;
}

/* Inline code */
.modal-answer .inline-code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(110, 118, 129, 0.25);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #e6edf3;
}

/* Blockquotes */
.modal-answer blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent-soft);
  background: rgba(31, 111, 235, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* Horizontal rule */
.modal-answer hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

.modal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.15s ease;
}

.modal-back-btn:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.modal-back-btn svg {
  flex-shrink: 0;
}

/* Markdown Preview (shared styles for cards) */

.markdown-preview {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.markdown-preview p {
  margin: 0 0 0.5em;
}

.markdown-preview p:last-child {
  margin-bottom: 0;
}

.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.75em 0 0.25em;
  color: var(--text);
}

.markdown-preview h2:first-child,
.markdown-preview h3:first-child,
.markdown-preview h4:first-child {
  margin-top: 0;
}

.markdown-preview strong {
  font-weight: 600;
  color: var(--text);
}

.markdown-preview em {
  font-style: italic;
}

.markdown-preview ul,
.markdown-preview ol {
  margin: 0.5em 0;
  padding-left: 1.25rem;
}

.markdown-preview li {
  margin-bottom: 0.25em;
}

.markdown-preview .code-block {
  margin: 0.5em 0;
  border-radius: 4px;
  background: #1e1e1e;
  overflow: hidden;
}

.markdown-preview .code-block .code-lang {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #2d2d2d;
  border-bottom: 1px solid #3d3d3d;
}

.markdown-preview .code-block pre {
  margin: 0;
  padding: 0.5rem;
  overflow-x: auto;
}

.markdown-preview .code-block code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  color: #d4d4d4;
  background: transparent;
  padding: 0;
}

.markdown-preview .inline-code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(110, 118, 129, 0.25);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  color: #e6edf3;
}

.markdown-preview blockquote {
  margin: 0.5em 0;
  padding: 0.4rem 0.75rem;
  border-left: 2px solid var(--accent-soft);
  background: rgba(31, 111, 235, 0.08);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
}

.markdown-preview hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0.75em 0;
}

.markdown-preview a {
  color: var(--accent);
  text-decoration: underline;
}

/* Ensure pre/code from pasted HTML are styled */
.markdown-preview pre {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  background: #1e1e1e;
  border-radius: 4px;
}

.markdown-preview pre code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #d4d4d4;
  background: transparent;
  padding: 0;
  white-space: pre;
}

.modal-answer pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: #1e1e1e;
  border-radius: var(--radius-sm);
}

.modal-answer pre code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #d4d4d4;
  background: transparent;
  padding: 0;
  white-space: pre;
}

/* Viewer Page Styles */

.viewer-page .app-header {
  padding: 1rem 2rem;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-header .brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.9;
}

.viewer-header .brand-text p {
  display: none;
}

.viewer-header .brand-text h1 {
  font-size: 1.5rem;
}

.viewer-header .brand-icon {
  width: 36px;
  height: 36px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-to-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.back-to-upload:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--accent);
}

.back-to-upload svg {
  flex-shrink: 0;
}

/* Viewer main area */
.viewer-main {
  padding-top: 1rem;
}

/* Upload page centering */
.upload-page .app-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.upload-main {
  max-width: 1000px;
}

/* No data message */
.no-data-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.no-data-message p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.no-data-message .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-soft);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.no-data-message .back-link:hover {
  background: #388bfd;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* Footer */

.app-footer {
  padding: 1.25rem 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  background: rgba(13, 17, 23, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-credit {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-credit strong {
  background: linear-gradient(135deg, #58a6ff 0%, #10a37f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.footer-tech {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */

@media (max-width: 768px) {
  .app-header {
    padding: 1.25rem 1.25rem 1rem;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .brand-text h1 {
    font-size: 1.5rem;
  }

  .brand-text p {
    font-size: 0.85rem;
  }

  .app-main {
    padding: 1rem 1.25rem 1.5rem;
    gap: 1rem;
  }

  .loader {
    padding: 1rem;
  }

  .tab-content {
    padding: 1rem;
  }

  .controls {
    gap: 0.75rem;
  }

  .view-buttons {
    width: 100%;
    justify-content: center;
  }

  .view-buttons button {
    flex: 1;
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
  }

  .search-wrapper {
    flex-basis: 100%;
    justify-content: stretch;
  }

  #searchInput {
    max-width: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .clusters {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 1.25rem;
  }

  .modal h2 {
    font-size: 1.1rem;
  }

  .modal pre {
    font-size: 0.95rem;
    padding: 1rem;
  }

  /* Viewer header responsive */
  .viewer-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .viewer-header .brand-text h1 {
    font-size: 1.25rem;
  }

  .viewer-header .brand-icon {
    width: 32px;
    height: 32px;
  }

  .back-to-upload {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .back-to-upload span {
    display: none;
  }
}

/* Step Image Modal */

.step-image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 300;
  animation: fadeIn 0.2s ease-out;
}

.step-image-modal {
  width: min(1000px, 95%);
  max-height: 90vh;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

.step-image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  z-index: 10;
}

.step-image-modal-close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.7);
  transform: none;
  box-shadow: none;
}

.step-image-modal-body {
  display: flex;
  min-height: 400px;
}

.step-image-modal-image {
  flex: 1.5;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  overflow: hidden;
}

.step-image-modal-image img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.step-image-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg);
  border-left: 1px solid var(--border-subtle);
}

.step-image-modal-number {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #58a6ff 0%, #10a37f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.step-image-modal-instruction {
  flex: 1;
}

.step-image-modal-instruction p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
}

.step-image-modal-tip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.step-image-modal-tip svg {
  flex-shrink: 0;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .step-image-modal-overlay {
    padding: 1rem;
  }

  .step-image-modal {
    width: 100%;
    max-height: 95vh;
  }

  .step-image-modal-body {
    flex-direction: column;
    min-height: auto;
  }

  .step-image-modal-image {
    padding: 1rem;
    max-height: 40vh;
  }

  .step-image-modal-image img {
    max-height: 35vh;
  }

  .step-image-modal-info {
    padding: 1.25rem;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }

  .step-image-modal-number {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .step-image-modal-instruction p {
    font-size: 1rem;
  }
}

/* Grid Filter Bar */

.grid-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tag:hover {
  border-color: var(--tag-color);
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 10%, transparent);
  transform: none;
  box-shadow: none;
}

.filter-tag.active {
  background: color-mix(in srgb, var(--tag-color) 20%, transparent);
  border-color: var(--tag-color);
  color: var(--tag-color);
}

.filter-tag-count {
  font-size: 0.7rem;
  opacity: 0.7;
}

.filter-clear-all {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f85149;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.filter-clear-all:hover {
  background: rgba(248, 81, 73, 0.2);
  border-color: #f85149;
  transform: none;
  box-shadow: none;
}

@media (max-width: 768px) {
  .grid-filter-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .filter-label {
    font-size: 0.85rem;
    width: 100%;
  }

  .filter-tags {
    width: 100%;
  }

  .filter-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Bubble Modal */

.bubble-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 5vh 2rem;
  z-index: 200;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bubble-modal {
  width: min(1000px, 100%);
  max-height: 85vh;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

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

.bubble-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  flex-wrap: wrap;
}

.bubble-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.bubble-modal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bubble-modal-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(139, 148, 158, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.bubble-modal-search {
  flex: 1;
  min-width: 200px;
}

.bubble-modal-search input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bubble-modal-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.bubble-modal-search input::placeholder {
  color: var(--text-muted);
}

.bubble-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.bubble-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

.bubble-modal-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.bubble-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.bubble-modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.bubble-modal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: var(--border-light);
  background: var(--card-bg-hover);
}

.bubble-card-num {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bubble-modal-card .qa-section {
  padding: 0.5rem;
}

.bubble-modal-card .qa-question {
  font-size: 0.85rem;
}

.bubble-modal-card .qa-answer-preview {
  font-size: 0.8rem;
  max-height: 3.2em;
}

/* Responsive for bubble modal */
@media (max-width: 768px) {
  .bubble-modal-overlay {
    padding: 2vh 1rem;
  }

  .bubble-modal {
    max-height: 90vh;
  }

  .bubble-modal-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .bubble-modal-header {
    padding: 0.75rem 1rem;
  }

  .bubble-modal-title {
    font-size: 1rem;
  }
}

/* Scrollbar styling */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Focus visible for accessibility */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
