/* ═══════════════════════════════════════════════════════════
   generate-modal.css — AI deck generation modal
   3 states: input → progress → preview
   ═══════════════════════════════════════════════════════════ */

/* ── Deck engine CSS variables needed by blocks.css for slide rendering ── */
.gen-studio-canvas,
.gen-studio-slide-thumb {
  --teal: #00e5cc;
  --teal-dim: #00b8a4;
  --teal-glow: rgba(0,229,204,0.15);
  --navy: #060d1a;
  --navy-mid: #0d1e35;
  --navy-light: #142641;
  --dark-card: #0d1e35;
  --white: #f0f4f8;
  --gray: #8ea3b8;
  --gray-light: #c5d2de;
  --purple: #7b61ff;
  --purple-dim: rgba(123,97,255,0.2);
}

/* ── Overlay ── */
.gen-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: var(--font-body, 'Manrope', sans-serif);
}
.gen-modal-overlay.open {
  display: flex;
  opacity: 1;
}

body.light-mode .gen-modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

/* ── Modal shell ── */
.gen-modal {
  background: var(--surface, #1e293b);
  border-radius: 24px;
  width: min(720px, 92vw);
  max-height: min(86vh, 760px);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(69, 208, 189, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary, #fff);
}
.gen-modal-overlay.open .gen-modal {
  transform: translateY(0) scale(1);
}

/* Full-page mode for progress and preview states */
.gen-modal[data-state="progress"],
.gen-modal[data-state="preview"] {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

body.light-mode .gen-modal {
  background: #ffffff;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18),
              0 0 0 1px rgba(69, 208, 189, 0.25);
}
body.light-mode .gen-modal[data-state="progress"],
body.light-mode .gen-modal[data-state="preview"] {
  box-shadow: none;
}

/* ── Header ── */
.gen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0 28px;
  flex-shrink: 0;
}

.gen-modal-title {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  gap: 10px;
}

.gen-modal-title-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #45d0bd, #44b6e9);
  align-items: center;
  justify-content: center;
  color: #fff;
}

.gen-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.15s ease;
}
.gen-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #fff);
}
body.light-mode .gen-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ── Body ── */
.gen-modal-body {
  padding: 24px 28px 28px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gen-modal[data-state="progress"] .gen-modal-body,
.gen-modal[data-state="preview"] .gen-modal-body {
  padding: 0;
  overflow: hidden;
}

/* ── State visibility ── */
.gen-state {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 18px;
}
.gen-modal[data-state="input"] .gen-state-input { display: flex; }
.gen-modal[data-state="progress"] .gen-state-progress { display: flex; }
.gen-modal[data-state="preview"] .gen-state-preview { display: flex; }

/* ── Input state ── */
.gen-prompt-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gen-prompt-input {
  width: 100%;
  min-height: 120px;
  max-height: 240px;
  resize: vertical;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--text-primary, #fff);
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  transition: border 0.18s ease, background 0.18s ease;
}
.gen-prompt-input::placeholder {
  color: var(--text-muted, rgba(255, 255, 255, 0.35));
}
.gen-prompt-input:focus {
  border-color: rgba(69, 208, 189, 0.6);
  background: rgba(255, 255, 255, 0.06);
}
body.light-mode .gen-prompt-input {
  background: #f6f8fa;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .gen-prompt-input:focus {
  background: #ffffff;
  border-color: rgba(69, 208, 189, 0.7);
}

/* ── Style picker (visual cards matching New Blank Deck templates) ── */
.gen-style-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.gen-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.gen-style-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.gen-style-card.active {
  border-color: var(--color-accent, #45d0bd);
  box-shadow: 0 0 0 1px rgba(69, 208, 189, 0.3);
}
body.light-mode .gen-style-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .gen-style-card.active {
  border-color: rgba(0, 133, 119, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 133, 119, 0.2);
}

.gen-style-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
body.light-mode .gen-style-preview {
  border-color: rgba(0, 0, 0, 0.06);
}

.gen-style-title {
  position: absolute;
  bottom: 16%;
  left: 10%;
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 20px;
  font-weight: 800;
  pointer-events: none;
}

.gen-style-deco {
  position: absolute;
  pointer-events: none;
}

.gen-style-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, rgba(255, 255, 255, 0.4));
  letter-spacing: 0.03em;
  padding-bottom: 4px;
}

@media (max-width: 480px) {
  .gen-style-picker { grid-template-columns: repeat(2, 1fr); }
}

/* ── CSV dropzone ── */
.gen-dropzone {
  border: 2px dashed rgba(69, 208, 189, 0.35);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(69, 208, 189, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gen-dropzone:hover,
.gen-dropzone.drag-over {
  border-color: rgba(69, 208, 189, 0.8);
  background: rgba(69, 208, 189, 0.08);
}

.gen-dropzone-icon {
  color: var(--color-accent, #45d0bd);
  margin-bottom: 4px;
}

.gen-dropzone-text {
  font-size: 13px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}
.gen-dropzone-text strong {
  color: var(--color-accent, #45d0bd);
  font-weight: 600;
}

.gen-dropzone-hint {
  font-size: 11px;
  color: var(--text-muted, rgba(255, 255, 255, 0.4));
  margin-top: 2px;
}

/* ── File list (multi-file chips) ── */
.gen-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gen-file-chip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(69, 208, 189, 0.1);
  border: 1px solid rgba(69, 208, 189, 0.25);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-primary, #fff);
  max-width: 260px;
}
.gen-file-chip.active { display: inline-flex; }
.gen-file-chip-icon { font-size: 14px; flex-shrink: 0; }
.gen-file-chip-name {
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.gen-file-chip-meta {
  font-size: 10px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  flex-shrink: 0;
}
.gen-file-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  cursor: pointer;
  font-size: 14px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gen-file-chip-remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #fff);
}

/* ── Footer / actions ── */
.gen-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 28px 24px 28px;
  flex-shrink: 0;
}

/* In full-page mode, float actions on top of content */
.gen-modal[data-state="progress"] .gen-modal-actions,
.gen-modal[data-state="preview"] .gen-modal-actions {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 16px 28px;
  background: linear-gradient(transparent, var(--surface, #1e293b) 40%);
  z-index: 10;
}

body.light-mode .gen-modal[data-state="progress"] .gen-modal-actions,
body.light-mode .gen-modal[data-state="preview"] .gen-modal-actions {
  background: linear-gradient(transparent, #ffffff 40%);
}

.gen-btn {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gen-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, rgba(255, 255, 255, 0.75));
}
.gen-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #fff);
}
body.light-mode .gen-btn-secondary {
  background: #f1f2f3;
  color: #333;
}
body.light-mode .gen-btn-secondary:hover {
  background: #e6e7e8;
}

.gen-btn-primary {
  background: linear-gradient(90deg, #45d0bd, #44b6e9);
  color: #fff;
  box-shadow: 0 4px 16px rgba(69, 208, 189, 0.35);
}
.gen-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(69, 208, 189, 0.5);
}
.gen-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Spinner ── */
.gen-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(69, 208, 189, 0.18);
  border-top-color: #45d0bd;
  animation: gen-spin 0.85s linear infinite;
  flex-shrink: 0;
}

.gen-spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

@keyframes gen-spin {
  to { transform: rotate(360deg); }
}

.gen-progress-msg {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #fff);
  transition: opacity 0.3s ease;
  line-height: 1.3;
}

.gen-progress-sub {
  font-size: 11px;
  color: var(--text-muted, rgba(255, 255, 255, 0.45));
}

/* ── Studio layout (progress + preview states) ── */
.gen-state-progress,
.gen-state-preview {
  height: 100%;
}

.gen-studio {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar */
.gen-studio-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.light-mode .gen-studio-sidebar {
  background: #f0f2f5;
  border-right-color: rgba(0, 0, 0, 0.08);
}

.gen-studio-sidebar-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

body.light-mode .gen-studio-sidebar-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.gen-studio-status {
  flex: 1;
  min-width: 0;
}

.gen-preview-sidebar-header {
  padding: 16px;
}

.gen-preview-header {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.gen-studio-slide-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Slide thumbnail in sidebar */
.gen-studio-slide-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.gen-studio-slide-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
body.light-mode .gen-studio-slide-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.gen-studio-slide-item.active {
  background: rgba(69, 208, 189, 0.12);
  outline: 2px solid rgba(69, 208, 189, 0.5);
  outline-offset: -2px;
  border-radius: 8px;
}

.gen-studio-slide-num {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: rgba(69, 208, 189, 0.6);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.gen-studio-slide-thumb {
  flex: 1;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  /* Enable container queries so the scaled 1920×1080 slide below can self-size
     via `100cqw / 1920` — eliminates the rAF timing gap that caused right-edge
     whitespace when the sidebar width shifted mid-streaming. */
  container-type: inline-size;
}

body.light-mode .gen-studio-slide-thumb {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

.gen-studio-slide-thumb > .slide,
.gen-studio-slide-thumb > section.slide {
  transform-origin: top left;
  width: 1920px !important;
  height: 1080px !important;
  pointer-events: none;
  overflow: hidden;
  /* CSS-driven scale — always matches container width exactly, no JS rAF
     timing issues. `100cqw` is the container's inline size in length units;
     dividing by `1920px` (length/length) produces a unitless ratio that
     scale() accepts. Writing `/ 1920` (no unit) would make the result a
     length, which scale() silently rejects → thumb reverts to 1920×1080
     raw and overflows, which is what killed the preview thumbs initially. */
  transform: scale(calc(100cqw / 1920px));
}
/* Force all objects visible in thumbnails (skip entrance animations) */
.gen-studio-slide-thumb .anim-pending {
  opacity: 1 !important;
}

.gen-studio-slide-info {
  flex: 1;
  min-width: 0;
}

.gen-studio-slide-title {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.gen-studio-slide-type {
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: rgba(69, 208, 189, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Active slide indicator (writing) */
.gen-studio-slide-item.writing .gen-studio-slide-thumb {
  border-color: rgba(69, 208, 189, 0.4);
  box-shadow: 0 0 12px rgba(69, 208, 189, 0.1);
}

.gen-studio-slide-item.writing::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #45d0bd;
  animation: gen-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes gen-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Main canvas area */
.gen-studio-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-width: 0;
  position: relative;
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .gen-studio-main {
  background: #e8eaed;
}

.gen-studio-canvas {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  /* Matches the biostate-dark slide bg so the generation canvas already looks
     like the slide it's about to produce — no jarring white→dark flash. */
  background: #020d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
/* 22×22 white dot-grid overlay — same token as .slide::before in the deck */
.gen-studio-canvas::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

/* Force the biostate-dark aesthetic even in light mode while generating */
body.light-mode .gen-studio-canvas {
  background: #020d10;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.gen-studio-canvas > .slide {
  transform-origin: top left;
  width: 1920px !important;
  height: 1080px !important;
  pointer-events: none;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.gen-studio-canvas-label {
  margin-top: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, rgba(255, 255, 255, 0.45));
  text-align: center;
  min-height: 20px;
}

/* Empty state — biostate-dark loading with particle ring */
.gen-studio-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
}
/* Particle ring canvas — drawn by _startParticleRing() in generate-modal.js.
   aspect-ratio: 1/1 keeps it a perfect circle regardless of container shape.
   Grid overlay (column/row 1) puts it in the same cell as the text so the
   text sits at the center of the ring instead of stacked below it. */
.gen-particle-ring {
  grid-column: 1;
  grid-row: 1;
  width: min(420px, 55vmin);
  aspect-ratio: 1 / 1;
  height: auto;
  display: block;
  pointer-events: none;
}

.gen-studio-empty-text {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  font-family: 'Manrope', 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.gen-empty-line1 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(61,214,163,0.3);
}
.gen-empty-line2 {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}
.gen-empty-line3 {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}
body.light-mode .gen-empty-line1 { color: #ffffff; }
body.light-mode .gen-empty-line2 { color: rgba(255,255,255,0.6); }
body.light-mode .gen-empty-line3 { color: rgba(255,255,255,0.4); }

/* Live content preview in main canvas (during streaming) */
.gen-studio-live {
  position: absolute;
  inset: 0;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gen-studio-live-badge {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(69, 208, 189, 0.8);
  background: rgba(69, 208, 189, 0.1);
  border: 1px solid rgba(69, 208, 189, 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.gen-studio-live-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

body.light-mode .gen-studio-live-title {
  color: rgba(0, 0, 0, 0.8);
}

/* Wireframe layout preview */
.gen-studio-wireframe {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  gap: 6px;
  animation: gen-wireframe-in 0.4s ease;
}

@keyframes gen-wireframe-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode for live canvas */
.gen-studio-live.dark .gen-studio-live-title {
  color: rgba(255, 255, 255, 0.85);
}

.gen-studio-live.dark .gen-studio-live-badge {
  color: rgba(69, 208, 189, 0.9);
}

.gen-studio-live-loader {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(69, 208, 189, 0.08);
}

.gen-studio-live-loader-bar {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(69, 208, 189, 0.6), transparent);
  border-radius: 2px;
  animation: gen-build-sweep 1.5s ease-in-out infinite;
}

/* ── Error inline ── */
.gen-error {
  display: none;
  margin-top: 6px;
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  line-height: 1.4;
}
.gen-error.active { display: block; }

/* ── Featured action card (Dashboard side) ── */
.action-card.action-card-featured {
  background: linear-gradient(135deg, rgba(69, 208, 189, 0.15), rgba(68, 182, 233, 0.12));
  border-color: rgba(69, 208, 189, 0.4);
  position: relative;
}
.action-card.action-card-featured::before {
  opacity: 1 !important;
  background: linear-gradient(135deg, #45d0bd, #44b6e9, #8258c8);
}
.action-card.action-card-featured:hover {
  box-shadow: 0 12px 32px rgba(69, 208, 189, 0.35),
              0 0 0 1px rgba(69, 208, 189, 0.55);
}
.action-card.action-card-featured .action-icon {
  background: linear-gradient(135deg, #45d0bd, #44b6e9);
  color: #fff;
  box-shadow: 0 6px 20px rgba(69, 208, 189, 0.45);
}
.action-card.action-card-featured .action-label {
  background: linear-gradient(90deg, #45d0bd, #44b6e9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.action-card.action-card-featured .action-sparkle {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(69, 208, 189, 0.18);
  color: #45d0bd;
  padding: 3px 8px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .gen-modal { width: 96vw; }
  .gen-modal-body { padding: 20px 18px 22px; }
  .gen-modal-header { padding: 18px 18px 0 18px; }
  .gen-modal-actions { padding: 0 18px 18px 18px; }
}

@keyframes gen-build-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Build overlay — Figma-style dashed selection box with handles ── */
.gen-build-overlay {
  position: absolute;
  z-index: 10;
  border: 1.5px dashed rgba(61, 214, 163, 0.7);
  border-radius: 0;
  pointer-events: none;
  opacity: 0;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
  background: transparent;
}
/* Corner handles — 4 small white squares */
.gen-build-handle {
  position: absolute;
  width: 7px; height: 7px;
  background: #ffffff;
  border: 1px solid rgba(61, 214, 163, 0.8);
  z-index: 11;
  pointer-events: none;
}
.gen-build-handle.tl { top: -4px; left: -4px; }
.gen-build-handle.tr { top: -4px; right: -4px; }
.gen-build-handle.bl { bottom: -4px; left: -4px; }
.gen-build-handle.br { bottom: -4px; right: -4px; }
/* Mid-edge handles */
.gen-build-handle.tm { top: -4px; left: 50%; transform: translateX(-50%); }
.gen-build-handle.bm { bottom: -4px; left: 50%; transform: translateX(-50%); }
.gen-build-handle.ml { top: 50%; left: -4px; transform: translateY(-50%); }
.gen-build-handle.mr { top: 50%; right: -4px; transform: translateY(-50%); }

/* Object type label shown above the selection box */
.gen-build-label {
  position: absolute;
  top: -22px; left: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.5px;
  color: #3dd6a3;
  background: rgba(13, 17, 23, 0.85);
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.gen-build-overlay.active .gen-build-label { opacity: 1; }

/* ── Build layer — single container above ALL slide content ── */
.gen-build-layer {
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  border-radius: 12px;
}
.gen-build-layer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.77);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  transition: opacity 0.5s ease;
}

/* ── Typewriter blinking caret (appended via JS during _typewriterEl) ── */
.gen-typing-caret::after {
  content: '';
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: genCaretBlink 0.7s steps(2, start) infinite;
  opacity: 0.85;
}
@keyframes genCaretBlink {
  to { visibility: hidden; }
}

/* ── Particle ring overlay (inside build layer) ── */
.gen-particle-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.gen-particle-overlay canvas {
  width: 100%; height: 100%;
  display: block;
}
.gen-particle-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 9;
  pointer-events: none;
}
.gen-particle-text-main {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px; font-weight: 500;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(61, 214, 163, 0.4);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}
.gen-particle-text-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; font-weight: 400;
  color: #7a9bb5;
  margin-top: 8px;
}

/* ── Dark-theme slide rules scoped to generation containers ──
   These duplicate blocks.css body:not(.light-mode) rules so we never
   need to toggle the body class (which would flash the whole page dark).
   Uses [data-theme-mode="dark"] set by JS on the canvas/thumb element. */
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"],
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] {
  overflow: hidden;
  border-left: 2px solid #3dd6a3;
}
/* Top-edge shine removed per design system */
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"]::after,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 30% 0%, rgba(180,240,220,0.07), transparent);
  pointer-events: none;
  z-index: 0;
}
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content {
  position: relative;
  z-index: 1;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  color: #e8f0f8;
}
/* fact-tag: first strong = small uppercase label */
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong:first-child,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong:first-child {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #3dd6a3;
  display: block;
  margin-bottom: 8px;
}
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong {
  color: #5ee8b5;
  font-weight: 500;
}
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .stat-card-inner,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .stat-card-inner {
  position: relative;
  z-index: 1;
}
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .obj-text-content strong {
  color: #3dd6a3;
}
/* Stat label stays --text-primary (#e8f0f8) per biostate-dark design system
   in gen modal canvas/thumb contexts.
   Specificity (0,0,3,0) beats the dashboard-body-leak rule
   `body.light-mode .stat-label` (0,0,2,1), so this wins even when the
   dashboard is in light mode while previewing a dark-themed slide.
   Does NOT require data-has-fill — stat cards don't set it on the outer deck-object. */
.gen-studio-canvas[data-theme-mode="dark"] .stat-label,
.gen-studio-slide-thumb[data-theme-mode="dark"] .stat-label {
  color: #e8f0f8;
}
.gen-studio-canvas[data-theme-mode="dark"] .stat-desc,
.gen-studio-slide-thumb[data-theme-mode="dark"] .stat-desc {
  color: #7a9bb5;
}

/* Override body.light-mode stat-card rules that would wrongly style
   dark-theme slides inside the generation modal */
.gen-studio-canvas[data-theme-mode="dark"] .stat-card-inner,
.gen-studio-slide-thumb[data-theme-mode="dark"] .stat-card-inner {
  background: rgba(0,229,204,0.04);
  border-color: rgba(0,229,204,0.12);
}
.gen-studio-canvas[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .stat-card-inner,
.gen-studio-slide-thumb[data-theme-mode="dark"] .deck-object[data-has-fill="true"] .stat-card-inner {
  background: transparent;
  border-color: transparent;
}

/* ── Slide background layer CSS (from deck-engine.css, not loaded on dashboard) ── */

/* Aurora canvas bg (Biostate Dark) */
.gen-studio-canvas .aurora-canvas,
.gen-studio-slide-thumb .aurora-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.gen-studio-canvas .aurora-dot-grid,
.gen-studio-slide-thumb .aurora-dot-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.gen-studio-canvas .aurora-grain,
.gen-studio-slide-thumb .aurora-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: white; opacity: 0.08;
  mix-blend-mode: overlay;
  filter: url(#grain-filter);
}

/* Midnight purple bg */
.gen-studio-canvas .midnight-bg,
.gen-studio-slide-thumb .midnight-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('midnight-bg.svg') center/cover no-repeat;
}
.gen-studio-canvas .midnight-orb,
.gen-studio-slide-thumb .midnight-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  mix-blend-mode: screen; z-index: 1;
  animation: midnightBreathe var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.gen-studio-canvas .midnight-orb1,
.gen-studio-slide-thumb .midnight-orb1 {
  width: 20%; height: 67%; top: 8%; left: -5%;
  background: radial-gradient(ellipse at 60% 30%, #a0eeff 0%, #4488ff 30%, #6633cc 65%, transparent 100%);
  filter: blur(28px); opacity: 0.75; --dur: 5.2s; --delay: 0s;
}
.gen-studio-canvas .midnight-orb2,
.gen-studio-slide-thumb .midnight-orb2 {
  width: 48%; height: 86%; top: 4%; right: -6%;
  background: radial-gradient(ellipse at 40% 35%, #88aaff 0%, #cc44ff 35%, #6622cc 60%, #330088 80%, transparent 100%);
  filter: blur(32px); opacity: 0.8; --dur: 6.8s; --delay: -2.1s;
}
.gen-studio-canvas .midnight-orb3,
.gen-studio-slide-thumb .midnight-orb3 {
  width: 30%; height: 50%; top: 28%; left: 23%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,102,187,0.33) 0%, rgba(136,68,255,0.27) 50%, transparent 80%);
  filter: blur(50px); opacity: 0.6; --dur: 8s; --delay: -3.5s;
}
.gen-studio-canvas .midnight-overlay,
.gen-studio-slide-thumb .midnight-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(135deg, rgba(5,3,20,0.55) 0%, rgba(5,3,20,0.2) 60%, rgba(5,3,20,0.45) 100%);
}
.gen-studio-canvas .midnight-grid,
.gen-studio-slide-thumb .midnight-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.07;
  background-image:
    repeating-linear-gradient(90deg, white 0px, white 2px, transparent 2px, transparent 12.5%);
}

/* Fluid bright bg (Gradient Bloom) */
.gen-studio-canvas .fluid-wrap,
.gen-studio-slide-thumb .fluid-wrap {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.gen-studio-canvas .fluid-wrap svg,
.gen-studio-slide-thumb .fluid-wrap svg {
  width: 100%; height: 100%; display: block; position: absolute; inset: 0;
}
.gen-studio-canvas .fluid-fade,
.gen-studio-slide-thumb .fluid-fade {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 20%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
  pointer-events: none; z-index: 2;
}
.gen-studio-canvas .fluid-blob,
.gen-studio-slide-thumb .fluid-blob {
  position: absolute; border-radius: 50%;
  mix-blend-mode: multiply;
  will-change: transform;
  pointer-events: none;
  z-index: 1;
}
.gen-studio-canvas .fluid-blob.fb1,
.gen-studio-slide-thumb .fluid-blob.fb1 {
  width: 48%; height: 64%;
  background: radial-gradient(ellipse, rgba(68,182,233,0.55) 0%, rgba(49,121,255,0.35) 50%, transparent 80%);
  top: -11%; left: 14%;
  filter: blur(60px);
  animation: fluidBlob1 8s linear infinite;
}
.gen-studio-canvas .fluid-blob.fb2,
.gen-studio-slide-thumb .fluid-blob.fb2 {
  width: 43%; height: 58%;
  background: radial-gradient(ellipse, rgba(162,245,255,0.50) 0%, rgba(138,191,252,0.30) 55%, transparent 80%);
  top: -9%; right: 7%;
  filter: blur(55px);
  animation: fluidBlob2 11s linear infinite;
}

/* Warm earth bg */
.gen-studio-canvas .warm-wrap,
.gen-studio-slide-thumb .warm-wrap {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.gen-studio-canvas .warm-wrap svg,
.gen-studio-slide-thumb .warm-wrap svg {
  width: 100%; height: 100%; display: block; position: absolute; inset: 0;
}
.gen-studio-canvas .warm-fade,
.gen-studio-slide-thumb .warm-fade {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 18%;
  background: linear-gradient(to bottom, rgba(255,248,240,0) 0%, rgba(255,248,240,1) 100%);
  pointer-events: none; z-index: 1;
}

/* Bold mono bg */
.gen-studio-canvas .bold-wrap,
.gen-studio-slide-thumb .bold-wrap {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.gen-studio-canvas .bold-wrap svg,
.gen-studio-slide-thumb .bold-wrap svg {
  width: 100%; height: 100%; display: block; position: absolute; inset: 0;
}

/* Clean light bg */
.gen-studio-canvas .clean-wrap,
.gen-studio-slide-thumb .clean-wrap {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.gen-studio-canvas .clean-wrap svg,
.gen-studio-slide-thumb .clean-wrap svg {
  width: 100%; height: 100%; display: block; position: absolute; inset: 0;
}
.gen-studio-canvas .clean-strip,
.gen-studio-slide-thumb .clean-strip {
  position: absolute; top: 0; left: 0; width: 5.47%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.95)  0%,
    rgba(255,255,255,.95) 15%,
    rgba(255,255,255,.55) 35%,
    rgba(255,255,255,.55) 65%,
    rgba(255,255,255,.95) 85%,
    rgba(255,255,255,.95) 100%
  );
  border-right: 1px solid rgba(180,220,225,.40);
}

/* Mesh bg (default dark) */
.gen-studio-canvas .mesh,
.gen-studio-slide-thumb .mesh {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.45;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(0,229,204,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(123,97,255,0.07) 0%, transparent 50%);
}
.gen-studio-canvas .mesh-lines,
.gen-studio-slide-thumb .mesh-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0,229,204,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,229,204,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 80% 10%, black 0%, transparent 70%);
}

/* Slide child z-index: content above background layers */
.gen-studio-canvas .slide > *:not(.mesh):not(.mesh-lines):not(.sq-layer):not(.aurora-canvas):not(.aurora-dot-grid):not(.aurora-grain):not(.midnight-bg):not(.midnight-orb):not(.midnight-overlay):not(.midnight-grid):not(.fluid-wrap):not(.fluid-fade):not(.fluid-blob):not(.warm-wrap):not(.warm-fade):not(.bold-wrap):not(.clean-wrap):not(.clean-strip):not(.clean-author):not(.clean-bar),
.gen-studio-slide-thumb .slide > *:not(.mesh):not(.mesh-lines):not(.sq-layer):not(.aurora-canvas):not(.aurora-dot-grid):not(.aurora-grain):not(.midnight-bg):not(.midnight-orb):not(.midnight-overlay):not(.midnight-grid):not(.fluid-wrap):not(.fluid-fade):not(.fluid-blob):not(.warm-wrap):not(.warm-fade):not(.bold-wrap):not(.clean-wrap):not(.clean-strip):not(.clean-author):not(.clean-bar) {
  position: relative; z-index: 2;
}

/* Floating squares layer */
.gen-studio-canvas .sq-layer,
.gen-studio-slide-thumb .sq-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.gen-studio-canvas .fsq,
.gen-studio-slide-thumb .fsq {
  position: absolute;
  border: 1px solid rgba(0,229,204,0.28);
  background: rgba(0,229,204,0.035);
  will-change: transform, opacity;
  animation: driftFloat ease-in-out infinite;
}
@keyframes driftFloat {
  0%   { transform: translate(0px, 0px) rotate(0deg);                       opacity: var(--op-lo); }
  25%  { transform: translate(var(--dx1), var(--dy1)) rotate(var(--dr1));   opacity: var(--op-hi); }
  50%  { transform: translate(var(--dx2), var(--dy2)) rotate(var(--dr2));   opacity: var(--op-lo); }
  75%  { transform: translate(var(--dx3), var(--dy3)) rotate(var(--dr3));   opacity: var(--op-hi); }
  100% { transform: translate(0px, 0px) rotate(0deg);                       opacity: var(--op-lo); }
}

/* Keyframes for animated backgrounds (from deck-engine.css) */
@keyframes midnightBreathe {
  0%   { transform: scale(1);    opacity: var(--op-lo, 0.65); }
  50%  { transform: scale(1.08); opacity: var(--op-hi, 0.90); }
  100% { transform: scale(1);    opacity: var(--op-lo, 0.65); }
}
@keyframes fluidBlob1 {
  0%   { transform: translate(0px, 0px) scale(1.00); }
  25%  { transform: translate(-80px, 60px) scale(1.06); }
  50%  { transform: translate(-50px, 110px) scale(1.03); }
  75%  { transform: translate(70px, 70px) scale(0.97); }
  100% { transform: translate(0px, 0px) scale(1.00); }
}
@keyframes fluidBlob2 {
  0%   { transform: translate(0px, 0px) scale(1.00); }
  25%  { transform: translate(70px, -50px) scale(1.07); }
  50%  { transform: translate(85px, 65px) scale(1.05); }
  75%  { transform: translate(-10px, 80px) scale(1.02); }
  100% { transform: translate(0px, 0px) scale(1.00); }
}

/* ── Core slide/object styles from deck-engine.css (not loaded on dashboard) ── */

/* Legacy (non-template) slides: vertical-center layout used by placeholder/JSON decks.
   HTML-path slides ([data-template]) are scoped OUT so the template's own CSS
   (flex-column with padding 64/80/48, section-divider grid, etc.) fully applies. */
.gen-studio-canvas .slide:not([data-template]),
.gen-studio-slide-thumb .slide:not([data-template]) {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* HTML-path slides: only apply the invariants that must hold regardless of template */
.gen-studio-canvas .slide[data-template],
.gen-studio-slide-thumb .slide[data-template] {
  position: relative;
  overflow: hidden;
  /* display / flex-direction / justify-content come from the template CSS */
}

.gen-studio-canvas .deck-object,
.gen-studio-slide-thumb .deck-object {
  position: absolute;
  z-index: 2;
}

.gen-studio-canvas .obj-text-content,
.gen-studio-slide-thumb .obj-text-content {
  word-wrap: break-word;
  white-space: pre-wrap;
}
.gen-studio-canvas .obj-text-content strong,
.gen-studio-slide-thumb .obj-text-content strong {
  font-weight: 700;
}
/* Card heading (bold) — larger than body to create visual hierarchy */
.gen-studio-canvas .deck-object[data-has-fill="true"] .obj-text-content strong,
.gen-studio-slide-thumb .deck-object[data-has-fill="true"] .obj-text-content strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  display: block;
  margin-bottom: 6px;
}
.gen-studio-canvas .obj-text-content em,
.gen-studio-slide-thumb .obj-text-content em {
  font-style: italic;
}
.gen-studio-canvas .obj-text-content code,
.gen-studio-slide-thumb .obj-text-content code {
  font-family: 'DM Mono', monospace;
  background: rgba(0,229,204,0.08);
  padding: 2px 6px; border-radius: 3px;
}
.gen-studio-canvas .obj-text-content a,
.gen-studio-slide-thumb .obj-text-content a {
  color: var(--teal); text-decoration: underline;
}
.gen-studio-canvas .obj-list-bullet,
.gen-studio-slide-thumb .obj-list-bullet {
  padding-left: 24px; list-style-type: disc;
}
.gen-studio-canvas .obj-list-numbered,
.gen-studio-slide-thumb .obj-list-numbered {
  padding-left: 24px; list-style-type: decimal;
}

/* Card-style text objects with fill need padding */
.gen-studio-canvas .deck-object[data-object-type="text"][data-has-fill="true"][data-has-text-content="true"],
.gen-studio-canvas .deck-object[data-object-type="text"][data-has-border="true"][data-has-text-content="true"],
.gen-studio-slide-thumb .deck-object[data-object-type="text"][data-has-fill="true"][data-has-text-content="true"],
.gen-studio-slide-thumb .deck-object[data-object-type="text"][data-has-border="true"][data-has-text-content="true"] {
  padding: 28px 32px;
}
/* Light mode cards — compact padding */
[data-theme-mode="light"] .deck-object[data-object-type="text"][data-has-fill="true"][data-has-text-content="true"],
[data-theme-mode="light"] .deck-object[data-object-type="text"][data-has-border="true"][data-has-text-content="true"] {
  padding: 14px 18px;
}

.gen-studio-canvas .obj-image,
.gen-studio-slide-thumb .obj-image {
  overflow: hidden; border-radius: 8px; position: relative;
}
.gen-studio-canvas .obj-shape,
.gen-studio-slide-thumb .obj-shape {
  position: relative; overflow: visible;
}
.gen-studio-canvas .obj-shape svg,
.gen-studio-slide-thumb .obj-shape svg {
  pointer-events: none;
}
.gen-studio-canvas .obj-icon,
.gen-studio-slide-thumb .obj-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
}
.gen-studio-canvas .obj-icon svg,
.gen-studio-slide-thumb .obj-icon svg {
  flex-shrink: 0;
}

/* Stat bar (progress indicator in stat cards) */
.gen-studio-canvas .stat-bar,
.gen-studio-slide-thumb .stat-bar {
  margin-top: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(120,200,180,0.18);
  overflow: hidden;
}
.gen-studio-canvas .stat-bar-fill,
.gen-studio-slide-thumb .stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), #7eb8f0);
}
.gen-studio-canvas .stat-card-inner.purple .stat-bar-fill,
.gen-studio-slide-thumb .stat-card-inner.purple .stat-bar-fill {
  background: linear-gradient(90deg, var(--purple), #c4b5fd);
}

/* Stat card inner */
.gen-studio-canvas .stat-card-inner,
.gen-studio-slide-thumb .stat-card-inner {
  padding: 24px 20px; text-align: center;
  border-radius: 16px;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gen-studio-canvas .stat-value,
.gen-studio-slide-thumb .stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 48px; font-weight: 600;
  color: #5ee8b5; line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -1px;
}
.gen-studio-canvas .stat-card-inner.purple .stat-value,
.gen-studio-slide-thumb .stat-card-inner.purple .stat-value {
  color: #c4b5fd;
}
/* Stat label in gen modal canvas/thumb: defer to blocks.css base rule
   (10px / 600 / ls 2.5px / uppercase / #e8f0f8 per biostate-dark spec). */

/* Background decoration objects */
.gen-studio-canvas .obj-background,
.gen-studio-slide-thumb .obj-background {
  pointer-events: none !important;
  z-index: 1 !important;
  animation: bgFloat 12s ease-in-out infinite alternate;
}
@keyframes bgFloat {
  0%   { transform: translateY(0) rotate(var(--bg-rot, 0deg)); }
  50%  { transform: translateY(-8px) rotate(calc(var(--bg-rot, 0deg) + 3deg)); }
  100% { transform: translateY(4px) rotate(calc(var(--bg-rot, 0deg) - 2deg)); }
}
.gen-studio-canvas .obj-background:nth-child(odd),
.gen-studio-slide-thumb .obj-background:nth-child(odd) {
  animation-duration: 14s; animation-delay: -3s;
}
.gen-studio-canvas .obj-background:nth-child(3n),
.gen-studio-slide-thumb .obj-background:nth-child(3n) {
  animation-duration: 10s; animation-delay: -7s;
}
