/* ---- Viral Breakdown — Polished Minimalist Redesign ---- */

.vb-mode .tool-hero { display: none; }
.vb-mode .tool-detail-head { display: none; }
.vb-mode { padding: 0; border: 0; box-shadow: none; background: transparent; backdrop-filter: none; }

.vb-mode #viralBreakdownForm.tool-form,
.vb-mode #viralBreakdownForm.panel-card,
.vb-mode #viralBreakdownForm.tool-form-card,
.vb-mode #viralBreakdownProgress.tool-form,
.vb-mode #viralBreakdownProgress.panel-card,
.vb-mode #viralBreakdownProgress.tool-form-card,
.vb-mode #viralBreakdownResult.tool-form,
.vb-mode #viralBreakdownResult.panel-card,
.vb-mode #viralBreakdownResult.tool-form-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0 12px 20px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.vb-back-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #f8fafc; border: 1px solid #e2e8f0; color: #64748b; border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; }
.vb-back-link:hover { background: #f1f5f9; color: #334155; }
.vb-back-link:active { background: #e2e8f0; color: #334155; }
.vb-back-link svg { width: 18px; height: 18px; color: #6366f1; }

.vb-form-card { background: white; border-radius: 14px; padding: 16px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 14px; }
.vb-form-card,
.vb-progress-panel,
.vb-panel-head,
.vb-progress-list,
.vb-result,
.vb-result-header,
.vb-meta-grid,
.vb-result-actions,
.vb-block,
.vb-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.vb-form-header { display: flex; align-items: center; gap: 10px; }
.vb-form-header-icon { width: 28px; height: 28px; border-radius: 8px; background: #ede9fe; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vb-form-header-icon svg { width: 16px; height: 16px; color: #7c3aed; }
.vb-form-header h4 { margin: 0; font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.vb-form-label { font-size: 0.78rem; font-weight: 600; color: #334155; }
.vb-form-hint { font-size: 0.72rem; color: #94a3b8; }
.vb-textarea-wrap textarea { width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; font-size: 0.85rem; color: #334155; font-family: inherit; resize: vertical; min-height: 100px; transition: all 0.2s; line-height: 1.6; box-sizing: border-box; }
.vb-textarea-wrap textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); background: white; }
.vb-textarea-wrap textarea::placeholder { color: #94a3b8; }
.vb-btn-primary { width: 100%; padding: 14px; background: #6366f1; color: white; border: none; border-radius: 10px; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
.vb-btn-primary:active { opacity: 0.8; }

.vb-progress-panel { display: flex; flex-direction: column; gap: 14px; }
.vb-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px; background: white; border-radius: 14px; border: 1px solid #e2e8f0; }
.vb-panel-head-icon { width: 28px; height: 28px; border-radius: 8px; background: #fef3c7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vb-panel-head-icon svg { width: 16px; height: 16px; color: #d97706; }
.vb-panel-head h3 { margin: 0; font-size: 0.85rem; font-weight: 700; color: #1e293b; }
.vb-progress-list { display: flex; flex-direction: column; gap: 8px; }
.vb-progress-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; }
.vb-progress-index { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 0.78rem; font-weight: 800; }
.vb-progress-copy { min-width: 0; }
.vb-progress-copy strong { display: block; font-size: 0.85rem; font-weight: 600; color: #1e293b; }
.vb-progress-copy p { margin: 2px 0 0; font-size: 0.78rem; color: #94a3b8; }
.vb-progress-state { min-width: 56px; text-align: right; font-size: 0.72rem; font-weight: 600; color: #94a3b8; }
.vb-progress-item.is-active { border-color: #c7d2fe; background: #f5f3ff; }
.vb-progress-item.is-active .vb-progress-index { background: #6366f1; color: white; }
.vb-progress-item.is-active .vb-progress-state { color: #6366f1; }
.vb-progress-item.is-done { border-color: #bbf7d0; background: #f0fdf4; }
.vb-progress-item.is-done .vb-progress-index { background: #22c55e; color: white; }
.vb-progress-item.is-done .vb-progress-state { color: #22c55e; }

.vb-result { display: flex; flex-direction: column; gap: 14px; padding: 0; background: transparent; border: 0; box-shadow: none; }
.vb-result-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: #f0fdf4; border-radius: 12px; border: 1px solid #bbf7d0; }
.vb-result-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vb-result-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.vb-result-title { font-size: 0.85rem; font-weight: 700; color: #1e293b; min-width: 0; overflow-wrap: anywhere; }
.vb-reset-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.75rem; font-weight: 600; color: #64748b; cursor: pointer; transition: all 0.2s; }
.vb-reset-btn:hover { background: #f1f5f9; color: #334155; }

.vb-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.vb-meta-card { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; text-align: center; }
.vb-meta-card span { display: block; font-size: 0.68rem; color: #94a3b8; font-weight: 500; }
.vb-meta-card strong { display: block; font-size: 0.78rem; color: #1e293b; font-weight: 700; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vb-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vb-action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 1 1 180px; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid #e2e8f0; background: white; color: #475569; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; }
.vb-action-btn:hover { background: #f8fafc; }
.vb-action-btn--primary { background: #6366f1; color: white; border-color: #6366f1; }
.vb-action-btn--primary:hover { opacity: 0.9; }

.vb-block { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.vb-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vb-block-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vb-block-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vb-block-icon svg { width: 16px; height: 16px; }
.vb-block-icon--hook { background: #fef3c7; color: #d97706; }
.vb-block-icon--pain { background: #fee2e2; color: #dc2626; }
.vb-block-icon--emotion { background: #fce7f3; color: #db2777; }
.vb-block-icon--cta { background: #e0f2fe; color: #0284c7; }
.vb-block-icon--transcript { background: #f1f5f9; color: #64748b; }
.vb-block-icon--script { background: #ede9fe; color: #7c3aed; }
.vb-block-icon--tag { background: #d1fae5; color: #065f46; }
.vb-block-label { font-size: 0.82rem; font-weight: 700; color: #1e293b; min-width: 0; overflow-wrap: anywhere; }

.vb-content { padding: 12px 14px; line-height: 1.75; color: #475569; font-size: 0.82rem; background: white; border-radius: 10px; border: 1px solid #e2e8f0; white-space: pre-wrap; word-break: break-word; }
.vb-content--accent { background: #fffbeb; border-color: #fef3c7; }
.vb-content.is-collapsed { color: #94a3b8; max-height: 48px; overflow: hidden; position: relative; }
.vb-content.is-collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 24px; background: linear-gradient(transparent, white); }

.vb-copy-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.vb-copy-btn:hover { background: #f1f5f9; }
.vb-text-btn { background: none; border: none; color: #6366f1; font-size: 0.72rem; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.2s; }
.vb-text-btn:hover { background: #f5f3ff; }

.vb-tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.vb-tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; font-size: 0.72rem; font-weight: 600; background: #f1f5f9; color: #475569; border: none; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  .vb-progress-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .vb-progress-state {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    text-align: left;
  }

  .vb-result-header {
    align-items: flex-start;
  }

  .vb-reset-btn,
  .vb-text-btn,
  .vb-copy-btn {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .vb-meta-grid { grid-template-columns: 1fr; }
  .vb-result-actions { flex-direction: column; }
  .vb-action-btn { width: 100%; flex-basis: auto; }
  .vb-block-head { flex-direction: column; align-items: flex-start; }
}
