
/* Dialog de confirmation suppression */
.delete-confirmation-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 60px -28px rgba(15, 23, 42, 0.45);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.delete-confirmation-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.delete-confirmation-dialog[open] {
  animation: fadeIn 0.2s ease-out;
}

.delete-confirmation-dialog[closing] {
  animation: fadeOut 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

.modal-content {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: var(--bg-primary);
}

.modal-header,
.modal-footer {
  padding: var(--space-4) var(--space-5);
  border: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(79, 70, 229, 0.08);
  color: var(--text-primary);
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.modal-body {
  padding: var(--space-5);
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  background: var(--bg-primary);
}

.pulse-animation {
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

/* Mise en page générale */
.five-why-main {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: calc(100vh - 76px);
  padding: var(--space-6) clamp(var(--space-4), 3vw, var(--space-6)) var(--space-12);
  padding-top: max(6.75rem, calc(var(--space-6) + 4.5rem));
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  color: var(--text-primary);
}

.five-why-main--guest {
  padding-top: max(7.5rem, calc(var(--space-8) + 5rem));
}

.five-why-main .container {
  width: min(var(--tool-page-max-width, 1100px), 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: stretch;
}

.five-why-header {
  text-align: center;
  margin: 0 auto;
  max-width: 760px;
  padding: var(--space-1) 0 var(--space-3);

  h1 {
    font-size: clamp(1.9rem, 2.6vw, 2.6rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
  }

  .lead {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
  }
}

.five-why-controls {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  padding: var(--space-4) var(--space-5);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  /* Comme Pareto / AMDEC / barre _tool_buttons : groupe à gauche, pas d’écart type space-between */
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
  position: relative;
  z-index: 2;
}

.five-why-controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.65rem 1.4rem !important;
  border-radius: 999px !important;
  border: none;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 14px 28px -18px rgba(15, 23, 42, 0.35);
  font-size: 0.95rem;
}

.five-why-controls .btn:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

.five-why-controls .btn-primary,
.root-cause-trigger .root-cause-btn:not(:disabled) {
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, #6366f1 100%) !important;
  color: hsl(var(--primary-foreground)) !important;
}

.five-why-controls .btn-secondary {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%) !important;
  color: #fff !important;
}

.five-why-controls .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
}

.five-why-controls .btn-info {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  color: #fff !important;
}

.five-why-controls .btn:hover:not(:disabled),
.root-cause-trigger .root-cause-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -20px rgba(37, 99, 235, 0.45);
}

.five-why-controls .dropdown-menu {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.15);
  padding: var(--space-2) 0;
  z-index: 2050;
}

.five-why-controls .dropdown-item {
  padding: var(--space-3) var(--space-5);
  font-weight: 500;
  color: var(--text-primary);
}

.five-why-controls .dropdown-item:hover {
  background: rgba(79, 70, 229, 0.08);
  color: hsl(var(--primary));
}

.five-why-container,
.five-why-page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 100%;
}

.five-why-page-stack > * {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* CAPA : supprimer le .container imbriqué (double padding / largeur réduite) */
.five-why-main .five-why-page-stack .qse-capa-tool-toolbar.container {
  max-width: none !important;
  width: 100%;
  padding-inline: 0;
  margin-bottom: 0 !important;
}

.five-why-main .five-why-page-stack [data-qse-capa-soft-cta] [data-slot="card"],
.five-why-main .five-why-page-stack [data-qse-capa-soft-cta] .rounded-xl.border {
  width: 100%;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}

/* Lead CTA & DDWin : pleine largeur, même rythme visuel que les cartes d'analyse */
.five-why-main .five-why-page-stack .tool-lead-cta {
  margin-bottom: 0;
  width: 100%;
  max-width: none;
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.five-why-main .five-why-page-stack .cta-ddwin {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-left: 4px solid #2563eb;
  background: linear-gradient(135deg, rgba(240, 244, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.five-why-main .five-why-page-stack .five-why-seo {
  margin-top: 0;
}

.guide-card {
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(14, 165, 233, 0.1) 100%);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.guide-card__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  font-weight: 700;
  color: hsl(var(--primary));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-card__list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.guide-card__list li {
  position: relative;
  padding-left: var(--space-5);
}

.guide-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, #6366f1 100%);
  transform: translateY(-50%);
}

.alert-warning {
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.12) 100%);
  color: #854d0e;
}

.alert-warning strong {
  color: #b45309;
}

.problem-statement,
.why-step,
.root-cause,
.root-cause-trigger {
  background: var(--bg-primary);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  position: relative;
}

.problem-statement {
  border-left: 4px solid hsl(var(--primary));
}

.problem-statement h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.root-cause__subtitle {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.root-cause h3 i {
  display: none;
}

.problem-statement input,
.why-content input,
.why-content textarea {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.85rem 1rem;
  font-size: 0.975rem;
  background: rgba(248, 250, 252, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: var(--text-primary);
}

.problem-statement input:focus,
.why-content input:focus,
.why-content textarea:focus {
  border-color: hsl(var(--primary));
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
  outline: none;
}

.problem-statement small {
  color: var(--text-muted);
}

.why-chain {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.why-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: 0;
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: none;
}

.why-step:first-child {
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
}

.why-step:last-child {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom-left-radius: var(--radius-2xl);
  border-bottom-right-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}

.why-step:only-child {
  border-radius: var(--radius-2xl);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-lg);
}

.why-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.why-step__connector {
  flex: 1;
  width: 2px;
  min-height: 24px;
  margin-top: var(--space-2);
  background: linear-gradient(180deg, hsl(var(--primary) / 0.55) 0%, hsl(var(--primary) / 0.15) 100%);
  border-radius: 999px;
}

.why-step__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.why-step__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.why-number {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, hsl(var(--primary)), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px -10px hsl(var(--primary) / 0.65);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.why-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.why-question,
.why-answer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.why-question label,
.why-answer label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.why-content textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.why-chain-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 2px dashed rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-xl);
  background: rgba(248, 250, 252, 0.7);
  text-align: center;
}

.why-chain-footer__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 36rem;
  line-height: 1.5;
}

.why-chain-add-btn {
  width: min(100%, 320px);
}

.why-chain-add-btn--disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.five-why-clarity-score {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  border: 1px solid hsl(var(--primary) / 0.18);
  background: hsl(var(--primary) / 0.06);
}

.five-why-clarity-score__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.five-why-clarity-score__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.remove-step-btn {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.1);
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.remove-step-btn:hover {
  background: rgba(248, 113, 113, 0.22);
  transform: translateY(-1px);
}

.remove-step-btn i {
  font-size: 0.9rem;
}

.root-cause-trigger {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  margin-top: var(--space-2);
  padding: var(--space-5);
  border: 1px solid hsl(var(--primary) / 0.2);
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.root-cause-trigger[data-visible="true"] {
  display: flex;
}

.root-cause-trigger .root-cause-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  min-width: min(100%, 320px);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 28px -14px hsl(var(--primary) / 0.55);
}

.root-cause-trigger .root-cause-btn:not(:disabled) {
  background: hsl(var(--primary)) !important;
  color: #ffffff !important;
}

.root-cause-trigger .root-cause-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -16px hsl(var(--primary) / 0.65);
}

.root-cause-trigger .root-cause-btn:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
}

.root-cause-helper {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 34rem;
  line-height: 1.55;
}

/* ─── Synthèse : cause racine & plan d'action ─────────────────────────── */
.five-why-outcome {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
  width: 100%;
}

.five-why-outcome__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0;
}

.five-why-outcome[hidden] {
  display: none !important;
}

.five-why-outcome .root-cause--result,
.five-why-outcome .root-cause--plan {
  width: 100%;
}

.five-why-outcome__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.five-why-outcome__lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.root-cause--result,
.root-cause--plan {
  padding: 0;
  overflow: hidden;
  border: none;
}

.root-cause--result {
  background:
    radial-gradient(ellipse 110% 90% at 0% 0%, rgba(16, 185, 129, 0.16) 0%, transparent 58%),
    linear-gradient(165deg, #ffffff 0%, rgba(16, 185, 129, 0.04) 100%);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.16) inset,
    0 18px 42px -22px rgba(16, 185, 129, 0.35),
    var(--shadow-lg);
}

.root-cause--plan {
  background:
    radial-gradient(ellipse 110% 90% at 100% 0%, rgba(6, 182, 212, 0.14) 0%, transparent 58%),
    linear-gradient(165deg, #ffffff 0%, rgba(6, 182, 212, 0.04) 100%);
  box-shadow:
    0 0 0 1px rgba(6, 182, 212, 0.16) inset,
    0 18px 42px -22px rgba(6, 182, 212, 0.28),
    var(--shadow-lg);
}

.root-cause__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.root-cause__head-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--text-primary);
}

.root-cause__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28) inset,
    0 10px 24px -12px rgba(15, 23, 42, 0.35);
}

.root-cause__icon--result {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%);
}

.root-cause__icon--plan {
  background: linear-gradient(145deg, #06b6d4 0%, #0891b2 100%);
}

.root-cause__quote {
  margin: 0;
  padding: var(--space-5) var(--space-5) var(--space-5) calc(var(--space-5) + 1.75rem);
  position: relative;
  border: none;
  background: transparent;
}

.root-cause__quote::before {
  content: '\201C';
  position: absolute;
  left: var(--space-4);
  top: var(--space-3);
  font-size: 3.25rem;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  color: rgba(16, 185, 129, 0.22);
  pointer-events: none;
}

.root-cause--plan .root-cause__quote::before {
  content: none;
}

.root-cause__quote p {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.root-cause__editor {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.root-cause__plan-input {
  width: 100%;
  min-height: 140px;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.root-cause__plan-input:focus {
  border-color: #0891b2;
  background: #fff;
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    0 0 0 4px rgba(6, 182, 212, 0.14);
  outline: none;
}

.root-cause__plan-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.root-cause {
  display: none;
  flex-direction: column;
  gap: 0;
}

.root-cause[style*="display: block"],
.root-cause.is-visible {
  display: flex !important;
}

/* SEO premium (zone bas de page) */
.five-why-main .five-why-seo {
  max-width: none;
  margin: var(--space-8) 0 0;
  padding: var(--space-6);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, var(--bg-primary) 100%);
  color: var(--text-secondary);
}

.five-why-seo__title {
  margin: 0 0 var(--space-5);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--text-primary);
}

.five-why-seo__block {
  padding: var(--space-4) 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);

  &:first-of-type {
    border-top: none;
    padding-top: 0;
  }

  h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  p {
    margin: 0;
    line-height: 1.65;
  }
}

.five-why-seo__steps,
.five-why-seo__list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  line-height: 1.6;
}

.five-why-seo__steps li::marker {
  color: hsl(var(--primary));
  font-weight: 700;
}

.five-why-seo__list li::marker {
  color: hsl(var(--primary));
}

/* Formulaire et focus */
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

/* ─── Rapport export (PDF / PNG / JPEG) ─────────────────────────────────── */
.five-why-export-report {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 794px;
  z-index: -1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  background: #ffffff;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  box-sizing: border-box;
}

.five-why-export-report__header {
  border-bottom: 2px solid rgba(79, 70, 229, 0.15);
  padding-bottom: var(--space-3);
}

.five-why-export-report__source {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4f46e5;
  text-align: center;
}

.five-why-export-report__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.five-why-export-report__date {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.five-why-export-report__problem,
.five-why-export-report__chain-section {
  background: rgba(248, 250, 252, 0.95);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: var(--space-4);
}

.five-why-export-report__problem h3,
.five-why-export-report__chain-section h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.five-why-export-report__problem p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-line;
}

.five-why-export-report__chain {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.five-why-export-report__step {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 4px solid #4f46e5;
  background: #ffffff;
  padding: var(--space-3) var(--space-4);
}

.five-why-export-report__step-badge {
  display: block;
  margin: 0 0 var(--space-1);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4f46e5;
}

.five-why-export-report__step-question {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.five-why-export-report__step-answer {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-line;
}

.five-why-export-report__step-answer--empty {
  font-style: italic;
  color: var(--text-muted);
}

.five-why-export-report__root-cause {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(16, 185, 129, 0.25);
  background:
    radial-gradient(ellipse 110% 90% at 0% 0%, rgba(16, 185, 129, 0.14) 0%, transparent 58%),
    linear-gradient(165deg, #ffffff 0%, rgba(16, 185, 129, 0.05) 100%);
  padding: var(--space-4);
}

.five-why-export-report__root-cause h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f766e;
}

.five-why-export-report__quote {
  margin: 0;
  padding: 0 0 0 calc(var(--space-4) + 0.5rem);
  border: none;
  position: relative;
}

.five-why-export-report__quote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: -0.25rem;
  font-size: 2.5rem;
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  color: rgba(16, 185, 129, 0.25);
}

.five-why-export-report__quote p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 500;
  color: var(--text-primary);
  white-space: pre-line;
}

.five-why-export-report__plan {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(6, 182, 212, 0.25);
  background:
    radial-gradient(ellipse 110% 90% at 100% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 58%),
    linear-gradient(165deg, #ffffff 0%, rgba(6, 182, 212, 0.04) 100%);
  padding: var(--space-4);
}

.five-why-export-report__plan h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0e7490;
}

.five-why-export-report__plan p {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-line;
}

.five-why-export-report__footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.five-why-export-report__stats-line {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.five-why-export-report__branding {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 992px) {
  .five-why-main {
    padding: var(--space-6) clamp(var(--space-3), 4vw, var(--space-5)) var(--space-10);
    padding-top: max(6.75rem, calc(var(--space-6) + 4.75rem));
  }

  .five-why-controls {
    align-items: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .five-why-main .container {
    gap: var(--space-4);
  }

  .five-why-controls {
    padding: var(--space-4);
  }

  .five-why-controls .btn {
    width: 100%;
    justify-content: center;
  }

  .five-why-controls .dropdown {
    width: 100%;
  }

  .five-why-controls .dropdown-menu {
    width: 100%;
  }

  .why-step {
    grid-template-columns: 1fr;
    padding: var(--space-4);
  }

  .why-step__rail {
    flex-direction: row;
    justify-content: flex-start;
    margin-bottom: var(--space-2);
  }

  .why-step__connector {
    display: none;
  }

  .why-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .why-chain-footer {
    padding: var(--space-3);
  }

  .why-chain-add-btn,
  .root-cause-trigger .root-cause-btn {
    width: 100%;
    min-width: 0;
  }

  .five-why-clarity-score {
    flex-direction: column;
    align-items: flex-start;
  }

  .root-cause__head {
    padding: var(--space-4);
    flex-direction: column;
    align-items: stretch;
  }

  .root-cause__icon {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .root-cause__quote {
    padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + 1.25rem);
  }

  .root-cause__quote::before {
    left: var(--space-3);
    font-size: 2.5rem;
  }

  .root-cause__editor {
    padding: var(--space-3) var(--space-4) var(--space-4);
  }

  .remove-step-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 576px) {
  .five-why-main {
    padding: var(--space-5) var(--space-3) var(--space-8);
    padding-top: max(6.75rem, calc(var(--space-6) + 5rem));
  }

  .five-why-controls {
    border-radius: var(--radius-xl);
  }

  .problem-statement,
  .why-step,
  .root-cause,
  .root-cause-trigger {
    border-radius: var(--radius-xl);
    padding: var(--space-4);
  }
}
