.docv3-shell {
  --ink: #0f172a;
  --ink-muted: #1f2937;
  --muted: #475569;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --accent: #0ea5e9;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
  --spacing-1: 8px;
  --spacing-2: 12px;
  --spacing-3: 16px;
  --spacing-4: 20px;
  max-width: 1320px;
  margin: 24px auto 56px;
  padding: 0 24px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
}

.docv3-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-3);
  padding: var(--spacing-3) 18px;
  margin-bottom: var(--spacing-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffffd9;
  backdrop-filter: blur(6px);
  transition: box-shadow 0.2s ease;
}

.docv3-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  position: sticky;
  top: 10px;
  z-index: 12;
  gap: var(--spacing-2);
}

.docv3-actions-nav {
  display: flex;
  align-items: center;
  min-width: 0;
}

.docv3-header.scrolled {
  box-shadow: var(--shadow-soft);
}

.docv3-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-weight: 700;
  color: var(--ink);
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.docv3-title h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.docv3-title .subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.docv3-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
  flex-wrap: wrap;
}

.btn-pill {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  padding: 8px 14px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-pill:hover {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  text-decoration: none;
}

.btn-pill.ghost {
  background: #e2e8f0;
  color: var(--ink);
  box-shadow: none;
  border: 1px solid #cbd5e1;
}

.docv3-back-link {
  white-space: nowrap;
}

.docv3-status {
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}

.docv3-status.public {
  background: #ecfeff;
  color: #0ea5e9;
  border-color: #a5f3fc;
}

.docv3-status.private {
  background: #fff7ed;
  color: #f97316;
  border-color: #fed7aa;
}

.docv3-grid {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: var(--spacing-4);
  width: 100%;
}

.docv3-tabs {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  align-self: start;
}

.tab-groups {
  display: grid;
  gap: var(--spacing-4);
}

.tab-group {
  background: #0b1220;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 35px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.tab-group:not(:last-child) {
  position: relative;
}

.tab-group:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.4), transparent);
  pointer-events: none;
}

.group-title {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-2);
  color: #a5b4fc;
  font-weight: 700;
}

.tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-btn:last-child {
  margin-bottom: 0;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.35);
  color: #fff;
}

.tab-btn:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.55);
}

.tab-btn:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.interview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--spacing-2);
  min-width: 0;
  overflow: hidden;
}

.interview-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #14b8a6);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.interview-card .detail {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-muted);
  min-width: 0;
}

.interview-card .label {
  font-weight: 600;
  color: var(--muted);
}

.interview-card .value {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.interview-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.interview-card .btn-secondary.block {
  text-align: center;
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.docv3-panels {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  min-height: 640px;
  min-width: 0;
  width: 100%;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}

.panel-body {
  line-height: 1.75;
  color: var(--ink-muted);
  font-size: 15px;
}

.panel-body h1,
.panel-body h2,
.panel-body h3 {
  margin-top: 20px;
  color: var(--ink);
}

.panel-body p + p,
.panel-body ul,
.panel-body ol {
  margin-top: 12px;
}

.panel-body ul,
.panel-body ol {
  padding-left: 20px;
}

.panel-body strong {
  color: var(--ink);
}

.regen-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.25);
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  margin-left: auto;
}

.regen-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.3);
}

.audio-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-subtle);
}

.audio-player {
  width: 100%;
}

.audio-aux {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 14px;
}

.audio-error {
  color: #ef4444;
}

.btn-link {
  color: #2563eb;
  font-weight: 600;
}

.mobile-warning {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 600;
}

.mobile-warning.visible {
  display: block;
}

@media (max-width: 1100px) {
  .docv3-grid {
    grid-template-columns: minmax(180px, 220px) 1fr;
  }

  .tab-btn {
    padding: 10px;
    font-size: 13px;
  }

  .docv3-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: sticky;
    top: 0;
  }

  .docv3-actions-bar {
    justify-content: space-between;
    position: sticky;
    top: 6px;
  }

  .docv3-panels {
    padding: 18px;
  }
}

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

  .docv3-tabs {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tab-group {
    width: calc(50% - 8px);
  }

  .tab-btn {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .docv3-shell {
    padding: 0 14px;
  }

  .tab-group {
    width: 100%;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================================
   TRANSCRIPT EDIT MODE
   ============================================================================ */

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Edit button */
.edit-content-btn,
.edit-transcript-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.edit-content-btn:hover,
.edit-transcript-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.12);
}

/* Restore Original button */
.restore-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.restore-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Edit Mode Header */
.edit-mode-header {
  background: #f0f4ff;
  border-bottom: 2px solid var(--primary) !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 12px 16px;
}

.edit-mode-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.edit-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.edit-cancel-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.edit-cancel-btn:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.edit-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.15s ease;
}

.edit-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.edit-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.edit-save-btn.saving {
  background: #6b7280;
  box-shadow: none;
}

/* Transcript Editor Textarea */
.edit-mode-container {
  margin-top: -1px;
}

.transcript-editor {
  width: 100%;
  min-height: 500px;
  padding: 20px;
  border: 2px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-muted);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.transcript-editor:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.edit-helper-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Toast Notification */
.transcript-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
}

.transcript-toast.toast-success {
  background: #059669;
  color: #fff;
}

.transcript-toast.toast-error {
  background: #dc2626;
  color: #fff;
}

.transcript-toast.toast-info {
  background: var(--primary);
  color: #fff;
}

/* Confirm Modal Overlay */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.confirm-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ink);
}

.confirm-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-dialog .btn-keep {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.confirm-dialog .btn-discard {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.confirm-dialog .btn-restore {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================================
   LINKEDIN / BLOG SUB-TABS
   ============================================================================ */
.linkedin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.linkedin-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.linkedin-tab-btn:hover {
  color: var(--primary);
}

.linkedin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.linkedin-panel {
  display: none;
}

.linkedin-panel.active {
  display: block;
}

.linkedin-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}

.blog-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.blog-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-tab-btn:hover {
  color: var(--primary);
}

.blog-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.blog-panel {
  display: none;
}

.blog-panel.active {
  display: block;
}

.blog-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}

/* ============================================================================
   GENERATE NOW
   ============================================================================ */
.generate-now-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 40px 20px;
}

.generate-now-content {
  text-align: center;
  max-width: 480px;
}

.generate-now-icon {
  font-size: 48px;
  color: var(--primary, #6366f1);
  margin-bottom: 20px;
  opacity: 0.8;
}

.generate-now-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin-bottom: 12px;
}

.generate-now-description {
  color: var(--muted, #666);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-generate-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary, #6366f1), #8b5cf6);
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-generate-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-generate-now:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate-now.generating {
  background: #888;
  cursor: wait;
}

.generate-now-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted, #888);
}

.generate-now-error {
  color: #ef4444;
  margin-top: 12px;
  font-size: 0.9rem;
}
