/**
 * Standalone online storyboard HTML — desk shell overrides (Tier A).
 * Loaded after storyboard-desk.css when embedding export HTML.
 */
html[data-cutgo-storyboard-html] #storyboardDeskShell,
html[data-cutgo-storyboard-html] .storyboard-desk-shell {
  display: flex !important;
  min-height: 100vh;
  flex-direction: column;
}

html[data-cutgo-storyboard-html] body {
  margin: 0;
  padding: 0;
  background: #101012;
}

html[data-cutgo-storyboard-html] .storyboard-desk-shell {
  --sb-desk-top-h: min(42vh, 520px);
}

#storyboardDeskPlayerSlot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

#storyboardDeskPlayerSlot video,
#storyboardDeskPlayerSlot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.sb-desk-portable-player-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
  color: rgba(245, 245, 247, 0.82);
  font-size: 13px;
}

.sb-desk-portable-link-preview {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.sb-desk-portable-link-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sb-desk-portable-link-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
}

body.cutgo-preview .sb-desk-export-wrap,
body.cutgo-preview .sb-desk-export-actions,
body.cutgo-preview #draftStatus {
  display: none !important;
}

body.cutgo-preview .storyboard-desk-shell {
  min-height: 480px;
}

body.cutgo-preview .sb-desk-ai-prompt,
body.cutgo-preview [data-desk-capability='ai'],
body.cutgo-preview [data-desk-capability='cuts'] {
  display: none !important;
}

.print-header {
  display: none;
}

@media print {
  @page :first {
    size: A4 landscape;
    margin: 12mm 12mm 10mm 12mm;
  }
  @page {
    size: A4 landscape;
    margin: 16mm 12mm 10mm 12mm;
  }
  :root {
    color-scheme: light !important;
  }
  html,
  body {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sb-desk-tabs,
  .sb-desk-row-resizer,
  .sb-desk-ai-rail,
  .sb-desk-transport,
  .cg-st-transport,
  .sb-desk-export-wrap,
  .sb-desk-col-settings,
  #draftStatus {
    display: none !important;
  }
  .print-header {
    display: block !important;
    margin: 0 0 10px;
    padding: 2mm 0 0;
    page-break-after: avoid;
  }
  .print-header h1 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #111 !important;
  }
  .print-header p {
    margin: 0;
    font-size: 9px;
    color: #333 !important;
    word-break: break-all;
  }
  body.desk-print-board .sb-desk-board {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 0 !important;
  }
  body.desk-print-board .sb-desk-script-wrap {
    display: none !important;
  }
  body.desk-print-board .sb-desk-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #bbb !important;
    background: #fff !important;
    color: #111 !important;
  }
  body.desk-print-script .sb-desk-board {
    display: none !important;
  }
  body.desk-print-script .sb-desk-script-wrap {
    display: block !important;
  }
  body.desk-print-script .script-print-root {
    display: block !important;
  }
  body.desk-print-script .script-print-root[hidden] {
    display: block !important;
  }
  body.desk-print-script .sb-desk-script-wrap {
    display: none !important;
  }
}
