.bgcb-shell {
  margin: 16px auto 32px;
  max-width: 1700px;
  padding: 0 16px;
}

.bgcb-sticky {
  position: sticky;
  top: 24px;
  z-index: 5;
  display: grid;
  gap: 12px;
}

.bgcb-header {
  background: #0d1626;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 12px 18px;
}

.bgcb-header__title {
  font-size: 20px;
}

.bgcb-header__subtitle {
  max-width: 520px;
}

.bgcb-layout {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.bgcb-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bgcb-input,
.bgcb-textarea {
  width: 100%;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e5e7eb;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.15);
}

.bgcb-input:focus,
.bgcb-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.bgcb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: #1a2d4a;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bgcb-btn:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.bgcb-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bgcb-btn--primary {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.6);
  color: #fff;
}

.bgcb-btn--danger {
  background: #2b1113;
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.bgcb-btn--ghost {
  background: #0b111e;
}

.bgcb-btn:focus-visible,
.bgcb-ribbon__step:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bgcb-ribbon {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #0d1626;
  border: 1px solid rgba(37, 99, 235, 0.2);
  flex-wrap: nowrap;
  overflow-x: auto;
}

.bgcb-ribbon__step {
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.bgcb-ribbon__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1f2a44;
  display: inline-block;
}

.bgcb-ribbon__label {
  margin-left: 6px;
}

.bgcb-ribbon__step.is-current {
  border-color: rgba(198, 166, 103, 0.6);
  color: #c6a667;
}

.bgcb-ribbon__step[data-state="ready"] .bgcb-ribbon__dot {
  background: #2563eb;
}

.bgcb-ribbon__step[data-state="complete"] .bgcb-ribbon__dot {
  background: #10b981;
}

.bgcb-ribbon__step[data-state="blocked"] {
  opacity: 0.6;
}

.bgcb-grid {
  display: grid;
  gap: 16px;
}

.bgcb-top-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bgcb-card__body {
  color: #e5e7eb;
}

.bgcb-main {
  display: grid;
  gap: 16px;
}

.bgcb-muted {
  color: #9ca3af;
  font-size: 13px;
}

.bgcb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #e5e7eb;
}

.bgcb-badge--warn {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.bgcb-badge--ok {
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.bgcb-badge--info {
  border-color: rgba(37, 99, 235, 0.6);
  color: #93c5fd;
}

.bgcb-panel {
  background: #101a2e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}

.bgcb-log {
  max-height: 220px;
  overflow: auto;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5f5;
  white-space: pre-wrap;
}

.bgcb-plan-actions {
  background: #0b111e;
}

.bgcb-notes {
  width: 100%;
  min-height: 140px;
}

.bgcb-project-meta {
  display: grid;
  gap: 10px;
}

.bgcb-project-meta__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
  padding-bottom: 8px;
}

.bgcb-project-meta__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bgcb-status-list {
  display: grid;
  gap: 10px;
}

.bgcb-status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.bgcb-status-item[data-state="failed"] {
  border-color: rgba(255, 107, 107, 0.4);
}

.bgcb-status-item[data-state="done"] {
  border-color: rgba(16, 185, 129, 0.45);
}

.bgcb-storyboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bgcb-beat-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.bgcb-beat-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bgcb-beat-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b111e;
  border-radius: 8px;
  overflow: hidden;
}

.bgcb-beat-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bgcb-beat-card__title {
  margin-bottom: 6px;
}

.bgcb-beat-card__details {
  display: grid;
  gap: 6px;
}

.bgcb-beat-toggle {
  justify-self: flex-start;
  display: none;
}

.bgcb-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: stretch;
}

.bgcb-strip--full .bgcb-strip__beat {
  min-width: 240px;
}

.bgcb-strip--refine .bgcb-strip__beat {
  min-width: 160px;
  padding: 10px;
}

.bgcb-strip__beat {
  min-width: 200px;
  background: #0b111e;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 12px;
  cursor: grab;
  position: relative;
  overflow: visible;
}

.bgcb-strip__beat.is-selected {
  border-color: rgba(198, 166, 103, 0.6);
}

.bgcb-strip__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b111e;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.bgcb-strip__thumb video,
.bgcb-strip__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bgcb-strip__beat:hover .bgcb-strip__thumb {
  transform: scale(1.08);
  z-index: 3;
}

.bgcb-strip__meta {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.bgcb-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
  margin-bottom: 4px;
}

.bgcb-group-underline {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--bgcb-group-color, #c6a667);
}

.bgcb-group-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  text-transform: uppercase;
  background: #0f172a;
  border: 1px solid var(--bgcb-group-color, rgba(198, 166, 103, 0.5));
  color: #f8fafc;
  cursor: pointer;
}

.bgcb-transition-chip {
  align-self: center;
  background: #0f172a;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: #cbd5f5;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.bgcb-refine-layout {
  display: grid;
  gap: 16px;
}

.bgcb-refine-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
}

.bgcb-refine-focus {
  display: grid;
  gap: 10px;
}

.bgcb-focus-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #05080f;
}

.bgcb-focus-media video,
.bgcb-focus-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bgcb-refine-inspector {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 140px;
  align-self: start;
}

.bgcb-inspector-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.bgcb-inspector-section {
  display: grid;
  gap: 10px;
}

.bgcb-inspector-empty {
  color: #9ca3af;
  font-size: 13px;
}

.bgcb-form-row {
  display: grid;
  gap: 6px;
}

.bgcb-form-row .bgcb-input,
.bgcb-form-row select,
.bgcb-form-row input[type="range"] {
  width: 100%;
}

.bgcb-range-value {
  font-size: 11px;
  color: #9ca3af;
}

.bgcb-creative-example {
  font-style: italic;
  margin-top: 6px;
}

.bgcb-creative-card .bgcb-card__body {
  display: grid;
  gap: 8px;
}

.bgcb-shell[data-step="refine"] .bgcb-top-cards {
  gap: 12px;
}

.bgcb-shell[data-step="refine"] .bgcb-card__body {
  padding-bottom: 6px;
}

.bgcb-refine-main {
  display: grid;
  gap: 16px;
}

.bgcb-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.bgcb-editor__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bgcb-editor__toggle {
  font-size: 12px;
}

.bgcb-editor-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.bgcb-editor-controls {
  display: grid;
  gap: 12px;
}

.bgcb-editor-preview__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05080f;
  border-radius: 10px;
  overflow: hidden;
}

.bgcb-editor-preview__media video,
.bgcb-editor-preview__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bgcb-refine-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bgcb-step-tools {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.bgcb-swap-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bgcb-swap-card {
  border-radius: 8px;
  padding: 8px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  display: grid;
  gap: 6px;
}

.bgcb-swap-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #0b111e;
  overflow: hidden;
}

.bgcb-preview-player {
  width: 100%;
  border-radius: 12px;
  background: #0b111e;
  aspect-ratio: 16 / 9;
}

.bgcb-preview-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.bgcb-preview-main {
  display: grid;
  gap: 14px;
}

.bgcb-preview-side {
  display: grid;
  gap: 12px;
}

.bgcb-cooker-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.bgcb-cooker-timeline,
.bgcb-cooker-output {
  display: grid;
  gap: 12px;
}

.bgcb-comfort-line {
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #9ca3af;
  font-size: 13px;
}

.bgcb-accordion .bgcb-accordion__toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bgcb-accordion__body {
  display: block;
}

@media (max-width: 1300px) {
  .bgcb-top-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bgcb-storyboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bgcb-preview-layout,
  .bgcb-cooker-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .bgcb-shell {
    padding: 0 10px;
  }

  .bgcb-sticky {
    top: 8px;
  }

  .bgcb-header {
    padding: 10px 12px;
  }

  .bgcb-top-cards {
    grid-template-columns: 1fr;
  }

  .bgcb-main {
    grid-template-columns: 1fr;
  }

  .bgcb-storyboard-grid {
    grid-template-columns: 1fr;
  }

  .bgcb-strip--full .bgcb-strip__beat {
    min-width: 220px;
  }

  .bgcb-strip--refine .bgcb-strip__beat {
    min-width: 150px;
  }

  .bgcb-editor-grid {
    grid-template-columns: 1fr;
  }

  .bgcb-refine-body {
    grid-template-columns: 1fr;
  }

  .bgcb-refine-inspector {
    position: static;
  }

  .bgcb-swap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bgcb-accordion:not(.is-open) .bgcb-accordion__body {
    display: none;
  }

  .bgcb-editor:not(.is-open) .bgcb-editor__body {
    display: none;
  }

  .bgcb-beat-card__details {
    display: none;
  }

  .bgcb-beat-card.is-expanded .bgcb-beat-card__details {
    display: grid;
  }

  .bgcb-beat-toggle {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .bgcb-swap-grid {
    grid-template-columns: 1fr;
  }

  .bgcb-beat-card {
    padding: 12px;
  }
}