/* Deep dive section interactive demos */

/* Report builder → preview → PDF */
.report-builder-mock {
  position: relative; aspect-ratio: 3/2; min-height: 280px; overflow: hidden;
  background: #F1F5F9;
}
.rbm-phase {
  position: absolute; inset: 0; padding: 12px 14px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease, visibility .45s;
}
.rbm-phase.is-active { opacity: 1; visibility: visible; transform: none; }
.rbm-builder { display: grid; grid-template-columns: 34% 1fr; gap: 8px; height: 100%; }
.rbm-lib, .rbm-canvas-wrap {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-sm);
  padding: 8px; display: grid; gap: 6px; align-content: start; min-height: 0;
}
.rbm-canvas-wrap { grid-template-rows: auto 1fr; height: 100%; align-content: stretch; }
.rbm-lib > b, .rbm-canvas-head b { font-size: 10px; color: var(--text-primary); }
.rbm-lib-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 9px; font-weight: 600; color: var(--primary); padding: 7px 8px;
  background: var(--secondary); border: 1px solid var(--border-light); border-radius: 6px;
}
.rbm-lib-item i {
  width: 16px; height: 16px; border-radius: 4px; background: var(--primary-light);
  color: var(--primary); font-style: normal; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.rbm-lib-item--a.is-pulse { border-color: #C7D2FE; box-shadow: 0 0 0 2px rgba(79, 70, 229, .15); }
.rbm-canvas-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rbm-preview-btn {
  font-size: 8px; font-weight: 700; color: #fff; background: var(--primary);
  padding: 5px 8px; border-radius: var(--r-full);
}
.rbm-preview-btn.is-pulse { transform: scale(.96); box-shadow: inset 0 2px 4px rgba(0,0,0,.15); }
.rbm-canvas {
  position: relative; flex: 1; min-height: 150px; background: var(--secondary);
  border: 1px dashed var(--border); border-radius: 6px; padding: 6px; display: grid; gap: 5px; align-content: start;
}
.rbm-canvas-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 9px; color: var(--text-tertiary); transition: opacity .3s ease;
}
.rbm-canvas-mod {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid #C7D2FE; border-radius: 6px;
  padding: 6px 8px; font-size: 9px; font-weight: 600; color: var(--text-primary);
  opacity: 0; transform: translateX(-12px); transition: opacity .35s ease, transform .35s ease;
}
.rbm-canvas-mod.is-added { opacity: 1; transform: none; }
.rbm-canvas-mod em { font-size: 8px; font-style: normal; color: var(--text-tertiary); }
.rbm-canvas.has-modules .rbm-canvas-empty { opacity: 0; pointer-events: none; }
.rbm-drag-ghost {
  position: absolute; left: 18px; top: 52px; z-index: 3; pointer-events: none;
  font-size: 9px; font-weight: 600; color: var(--primary); background: var(--surface);
  border: 1px solid #C7D2FE; border-radius: 6px; padding: 6px 10px;
  opacity: 0; transform: translate(0, 0); transition: none;
}
.report-builder-mock.is-dragging .rbm-drag-ghost {
  opacity: 1; animation: rbm-drag 1s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes rbm-drag {
  0% { transform: translate(0, 0); opacity: 1; }
  70% { transform: translate(108px, 42px); opacity: 1; }
  100% { transform: translate(108px, 42px); opacity: 0; }
}
.rbm-preview-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 10px; font-weight: 700; color: var(--text-primary);
}
.rbm-export-btns { display: flex; gap: 4px; }
.rbm-export {
  font-size: 8px; font-weight: 600; padding: 4px 8px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border-light); color: var(--text-secondary);
}
.rbm-export--pdf.is-active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.rbm-export--pdf.is-pulse { transform: scale(.95); }
.rbm-report-doc {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-sm);
  padding: 10px; display: grid; gap: 8px; height: calc(100% - 30px);
}
.rbm-report-head b { display: block; font-size: 12px; color: var(--text-primary); }
.rbm-report-head span { font-size: 9px; color: var(--text-tertiary); }
.rbm-report-summary em {
  display: block; font-size: 8px; font-style: normal; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
.rbm-report-summary p { font-size: 9px; line-height: 1.45; color: var(--text-secondary); margin: 0; }
.rbm-report-chart {
  background: var(--secondary); border: 1px solid var(--border-light); border-radius: 6px;
  padding: 8px; display: grid; gap: 6px; flex: 1;
}
.rbm-report-chart span { font-size: 9px; font-weight: 600; color: var(--text-primary); }
.rbm-report-chart svg { width: 100%; height: 70px; display: block; }
.rbm-pdf-shell { height: 100%; display: grid; gap: 8px; }
.rbm-pdf-toolbar {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--r-sm); padding: 8px 10px;
}
.rbm-pdf-toolbar svg { width: 18px; height: 18px; flex-shrink: 0; }
.rbm-pdf-toolbar b { font-size: 10px; color: var(--text-primary); flex: 1; }
.rbm-pdf-toolbar span {
  font-size: 8px; font-weight: 600; color: #16A34A; background: #DCFCE7;
  padding: 3px 8px; border-radius: var(--r-full);
}
.rbm-pdf-page {
  background: #fff; border: 1px solid var(--border-light); border-radius: 4px;
  box-shadow: var(--shadow-md); padding: 14px; display: grid; gap: 8px;
  transform: scale(.92); opacity: 0; transition: transform .5s ease, opacity .5s ease;
}
.rbm-phase--pdf.is-active .rbm-pdf-page { transform: scale(1); opacity: 1; }
.rbm-pdf-logo {
  font-size: 8px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: .06em;
}
.rbm-pdf-page h4 { font-size: 13px; margin: 0; color: var(--text-primary); }
.rbm-pdf-range { font-size: 9px; color: var(--text-tertiary); margin: 0; }
.rbm-pdf-block { display: grid; gap: 5px; }
.rbm-pdf-block i { display: block; height: 6px; background: var(--border-light); border-radius: 4px; }
.rbm-pdf-block i:first-child { width: 95%; } .rbm-pdf-block i:nth-child(2) { width: 88%; } .rbm-pdf-block i:nth-child(3) { width: 72%; }
.rbm-pdf-block--short i { width: 80%; } .rbm-pdf-block--short i:last-child { width: 55%; }
.rbm-pdf-chart {
  height: 56px; border-radius: 6px; border: 1px solid var(--border-light);
  background: linear-gradient(180deg, #F8FAFC 0%, #fff 100%);
  position: relative; overflow: hidden;
}
.rbm-pdf-chart::before {
  content: ''; position: absolute; inset: 12px 10px 10px;
  background: linear-gradient(90deg, transparent 0%, transparent 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0,30 C30,26 60,18 100,22 S160,10 200,14' fill='none' stroke='%2364748B' stroke-width='2'/%3E%3Cpath d='M0,24 C30,22 60,28 100,25 S160,20 200,22' fill='none' stroke='%2322C55E' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
