/**
 * Storyboard Desk (分镜台) — shell layout.
 * Loaded with workspace; active when html.cutgo-mode-desk.
 * Panel gutters use --workspace-split-gap / --workspace-card-gutter (same as 工作区).
 */

.workspace-mode-switch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 3px;
  z-index: 2;
}

.workspace-mode-switch button {
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--cg-text-secondary, #8e8e93);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.workspace-mode-switch button:hover {
  color: var(--cg-text, #f5f5f7);
}

.workspace-mode-switch button:focus,
.workspace-mode-switch button:focus-visible,
.workspace-mode-switch button.is-active:focus,
.workspace-mode-switch button.is-active:focus-visible {
  outline: none;
}

.workspace-mode-switch button.is-active {
  background: rgba(163, 230, 53, 0.22);
  color: #a3e635;
  box-shadow: none;
}

html.cutgo-mode-desk .split-workspace {
  display: none !important;
}

/* Desk mode: import is workspace-only */
html.cutgo-mode-desk #btnImport {
  display: none !important;
}

#storyboardDeskShell {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
  background: var(--cg-bg-raised, #101012);
}

html.cutgo-mode-desk #storyboardDeskShell {
  display: flex;
}

html.cutgo-mode-desk .program-monitor-shell .workspace-left-stage-tail {
  display: none !important;
}

html.cutgo-mode-desk .program-monitor-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

/* Fill the aspect-sized slot — no pillarbox gutter beside the picture */
html.cutgo-mode-desk .program-monitor-surface {
  justify-content: stretch !important;
  align-items: stretch !important;
}

html.cutgo-mode-desk #playerBox.player-container {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  justify-content: stretch !important;
}

html.cutgo-mode-desk #playerBox.player-container video,
html.cutgo-mode-desk #playerBox video {
  object-fit: contain !important;
  object-position: center center !important;
}

html.cutgo-mode-desk .program-monitor-shell .player-wrapper,
html.cutgo-mode-desk .program-monitor-shell .program-monitor-surface,
html.cutgo-mode-desk .program-monitor-shell #playerBox {
  flex: 1 1 auto;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

html.cutgo-mode-desk .player-wrapper.video-viewport-host {
  min-height: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

html.cutgo-mode-desk .program-monitor-surface {
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

html.cutgo-mode-desk #playerBox.player-container:not(.empty) {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

html.cutgo-mode-desk #playerBox.player-container video,
html.cutgo-mode-desk #playerBox video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.sb-desk-top {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  /* Outer inset comes from .main-app-wrapper --workspace-pad (same as 工作区).
     Only keep the column gap here — do not double-pad the top seam. */
  gap: var(--workspace-split-gap, 4px);
  padding: 0;
  border-bottom: 0;
  min-height: 0;
  /* Height is set by JS so the player slot stays exact 16:9 */
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  background: transparent;
  position: relative;
  box-sizing: border-box;
}

.sb-desk-row-resizer {
  flex: 0 0 var(--workspace-split-gap, 4px);
  height: var(--workspace-split-gap, 4px);
  cursor: row-resize;
  position: relative;
  touch-action: none;
  user-select: none;
  background: transparent;
  border-bottom: 0;
  z-index: 200;
}

.sb-desk-row-resizer::before {
  content: none;
  display: none;
}

.sb-desk-row-resizer:hover::before,
.sb-desk-row-resizer.is-active::before {
  content: none;
  display: none;
}

/* Exact 16:9 player window — width/height applied by layoutDeskPlayer() */
.sb-desk-player-col {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.sb-desk-player-slot {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: none;
  max-height: none;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 10px;
}

html.cutgo-mode-desk .program-monitor-shell {
  border-radius: 10px !important;
}

/* Hover overlay transport (HTML player form): tools above scrub; compact keeps thin bar */
.sb-desk-transport {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
  pointer-events: auto;
  transition: gap 0.18s ease;
}

.sb-desk-transport.is-compact {
  gap: 0;
}

.sb-desk-player-col::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sb-desk-player-col:has(.cg-st-transport.is-expanded)::after,
.sb-desk-player-col:has(.cg-st-transport.is-scrubbing)::after,
.sb-desk-player-col:has(.sb-desk-transport.is-expanded)::after,
.sb-desk-player-col:has(.sb-desk-transport.is-scrubbing)::after {
  opacity: 1;
}

.sb-desk-player-col:has(.cg-st-transport.is-compact)::after,
.sb-desk-player-col:has(.sb-desk-transport.is-compact)::after {
  opacity: 0.45;
}

.sb-desk-tl-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  max-height: 48px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  transition: opacity 0.18s ease, max-height 0.18s ease, transform 0.18s ease, margin 0.18s ease;
}

.sb-desk-transport.is-compact .sb-desk-tl-tools {
  opacity: 0;
  max-height: 0;
  margin: 0;
  pointer-events: none;
  transform: translateY(6px);
  overflow: hidden;
}

.sb-desk-tl-track {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  min-width: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  outline: none;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 12, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  transition: padding 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease,
    border-radius 0.18s ease;
  box-sizing: border-box;
}

.sb-desk-transport.is-compact .sb-desk-tl-track {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: 22px;
}

/* Lane is the sole progress coordinate system (fill + playhead share % of this box). */
.sb-desk-tl-lane {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: visible;
  transition: height 0.12s ease;
}

.sb-desk-tl-track:hover .sb-desk-tl-lane,
.sb-desk-transport.is-scrubbing .sb-desk-tl-lane {
  height: 8px;
}

.sb-desk-tl-shots,
.sb-desk-tl-fill,
.sb-desk-tl-cuts {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.sb-desk-tl-shots {
  overflow: hidden;
  z-index: 1;
}

.sb-desk-tl-shot {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}

.sb-desk-tl-shot:nth-child(odd) {
  background: rgba(255, 255, 255, 0.07);
}

.sb-desk-tl-fill {
  width: 0%;
  right: auto;
  background: linear-gradient(90deg, rgba(163, 230, 53, 0.5), rgba(163, 230, 53, 0.82));
  z-index: 2;
}

.sb-desk-tl-cuts {
  z-index: 3;
  overflow: visible;
}

.sb-desk-tl-cut {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: rgba(255, 255, 255, 0.55);
}

.sb-desk-tl-playhead {
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 16px;
  margin: 0;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(163, 230, 53, 0.45);
  z-index: 4;
  pointer-events: none;
  transition: height 0.12s ease;
}

.sb-desk-tl-track:hover .sb-desk-tl-playhead,
.sb-desk-transport.is-scrubbing .sb-desk-tl-playhead {
  height: 20px;
  width: 3px;
}

.sb-desk-tl-time {
  font: 650 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: rgba(245, 245, 247, 0.92);
  letter-spacing: -0.02em;
  white-space: nowrap;
  min-width: 0;
  padding: 3px 10px;
  min-height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 12, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.sb-desk-tl-time .now {
  color: #fff;
}

.sb-desk-tl-time .sep {
  margin: 0 4px;
  color: rgba(142, 142, 147, 0.75);
  font-weight: 500;
}

.sb-desk-tl-chips {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 12, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  flex: 0 0 auto;
}

.sb-desk-tl-chip {
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245, 245, 247, 0.92);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.sb-desk-tl-chip svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sb-desk-tl-chip-sep {
  width: 1px;
  height: 16px;
  margin: 0 2px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 1px;
}

.sb-desk-tl-chip.is-frame svg {
  width: 18px;
  height: 18px;
}

.sb-desk-tl-chip.is-shot svg {
  width: 16px;
  height: 16px;
}

.sb-desk-tl-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sb-desk-tl-chip.is-play {
  width: 36px;
  color: #a3e635;
  background: rgba(163, 230, 53, 0.16);
  border-color: rgba(163, 230, 53, 0.35);
}

.sb-desk-tl-chip.is-play:hover {
  filter: none;
  color: #a3e635;
  background: rgba(163, 230, 53, 0.24);
  border-color: rgba(163, 230, 53, 0.5);
}

.sb-desk-tl-chip.is-play.is-playing {
  background: rgba(163, 230, 53, 0.22);
  border-color: rgba(163, 230, 53, 0.45);
  color: #a3e635;
}

/* Desk: speed joins the tools row (above scrub), not the video corner */
html.cutgo-mode-desk .cg-st-chips .player-speed-ctrl {
  position: relative;
  bottom: auto;
  right: auto;
  top: auto;
  left: auto;
  z-index: 1;
  height: 32px;
  margin: 0 0 0 2px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 11px;
  font-weight: 700;
  color: rgba(245, 245, 247, 0.92);
}

html.cutgo-mode-desk .cg-st-chips .player-speed-ctrl:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

html.cutgo-mode-desk .cg-st-chips .player-speed-ctrl .speed-menu {
  bottom: calc(100% + 8px);
  top: auto;
  right: 0;
}

html.cutgo-mode-desk .video-ui-layer > .player-speed-ctrl {
  display: none !important;
}

/* AI-first rail: player | slim AI (no field wall) — matches CUTGO_STORYBOARD_DESK_AI_FIRST */
.sb-desk-ai-rail {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  /* visible so CSS tooltips are not clipped by the rail chrome */
  overflow: visible;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(163, 230, 53, 0.28);
  background: linear-gradient(180deg, rgba(163, 230, 53, 0.08), rgba(22, 22, 24, 0.7));
}

.sb-desk-ai-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  flex: 0 0 auto;
  min-width: 0;
}

.sb-desk-ai-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3e635;
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
  flex: 0 0 auto;
}

.sb-desk-ai-chip em {
  margin-left: 4px;
  font-style: normal;
  color: #8e8e93;
  font-weight: 500;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sb-desk-ai-chip-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.sb-desk-sub {
  color: #8e8e93;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-desk-icon-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: #f5f5f7;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.sb-desk-icon-btn:hover {
  border-color: rgba(163, 230, 53, 0.45);
  color: #a3e635;
  z-index: 10060;
}

/* Instant CSS tooltips (avoid slow native title delay) */
#storyboardDeskShell [data-tooltip] {
  position: relative;
  z-index: 1;
}

#storyboardDeskShell [data-tooltip]:hover,
#storyboardDeskShell [data-tooltip]:focus-visible {
  z-index: 10060;
}

#storyboardDeskShell [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(28, 28, 30, 0.96);
  color: #d1d1d6;
  border: 1px solid #3a3a3c;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100000;
  transition: none;
  transition-delay: 0s;
}

#storyboardDeskShell [data-tooltip]:hover::after,
#storyboardDeskShell [data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* Near the top of the rail: tip below the control so it is not clipped by chrome */
#storyboardDeskShell .sb-desk-ai-chip [data-tooltip]::after,
#storyboardDeskShell .sb-desk-ai-copy[data-tooltip]::after {
  top: calc(100% + 7px);
  bottom: auto;
}

/* Wide action buttons: tip above, allow wrapping for longer copy */
#storyboardDeskShell .sb-desk-ai-actions [data-tooltip]::after,
#storyboardDeskShell .sb-desk-batch-tab-btn[data-tooltip]::after {
  white-space: normal;
  max-width: 220px;
  width: max-content;
  text-align: center;
}

.sb-desk-ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 0 0 auto;
}

.sb-desk-ai-actions button {
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 245, 247, 0.92);
  text-align: center;
  cursor: pointer;
  line-height: 1.25;
  white-space: nowrap;
}

.sb-desk-ai-actions button.is-primary {
  /* 本镜分析 = 主操作：实心品牌绿 */
  background: #a3e635;
  border-color: #a3e635;
  color: #111;
  font-weight: 750;
}

.sb-desk-ai-actions button.is-primary:hover {
  filter: brightness(1.05);
  color: #111;
  background: #a3e635;
  border-color: #a3e635;
}

.sb-desk-ai-actions button.is-secondary {
  background: transparent;
  border-color: rgba(163, 230, 53, 0.45);
  color: #a3e635;
  font-weight: 650;
}

.sb-desk-ai-actions button:hover {
  border-color: rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.1);
  color: #a3e635;
}

.sb-desk-ai-actions button.is-primary:hover {
  filter: brightness(1.05);
  color: #111;
  background: #a3e635;
  border-color: #a3e635;
}

.sb-desk-ai-actions button:disabled,
.sb-desk-batch-tab-btn:disabled {
  cursor: wait;
  opacity: 0.55;
  filter: none;
  pointer-events: none;
}

.sb-desk-ai-actions button.is-busy,
.sb-desk-batch-tab-btn.is-busy {
  opacity: 1;
  cursor: wait;
  pointer-events: none;
  animation: sb-desk-ai-pulse 1.1s ease-in-out infinite;
}

.sb-desk-ai-actions button.is-busy.is-primary {
  background: #8bc41f;
  border-color: #8bc41f;
  color: #111;
  filter: none;
}

.sb-desk-ai-actions button.is-busy.is-secondary {
  background: rgba(163, 230, 53, 0.16);
  border-color: rgba(163, 230, 53, 0.55);
  color: #a3e635;
}

.sb-desk-batch-tab-btn.is-busy {
  background: #8bc41f;
  border-color: #8bc41f;
  color: #111;
  filter: none;
}

@keyframes sb-desk-ai-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.86);
  }
}

#storyboardDeskShell.is-ai-busy [data-tooltip]:hover::after {
  opacity: 0;
  visibility: hidden;
}

.sb-desk-ai-prompt {
  flex: 0 0 auto;
  min-width: 0;
}

.sb-desk-ai-prompt-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #8e8e93;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.sb-desk-ai-prompt-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #d1d1d6;
  border-color: rgba(255, 255, 255, 0.14);
}

.sb-desk-ai-prompt-toggle.is-expanded {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  color: #d1d1d6;
}

.sb-desk-ai-prompt-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.sb-desk-ai-prompt-title {
  font-weight: 700;
  color: #f5f5f7;
  font-size: 12px;
}

.sb-desk-ai-prompt-hint {
  font-size: 10px;
  font-weight: 500;
  color: #6e6e73;
}

.sb-desk-ai-prompt-toggle:hover .sb-desk-ai-prompt-hint {
  color: #8e8e93;
}

.sb-desk-ai-prompt-chevron {
  flex: 0 0 auto;
  font-size: 10px;
  opacity: 0.85;
}

.sb-desk-ai-prompt-panel {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: rgba(0, 0, 0, 0.28);
}

.sb-desk-ai-prompt-panel.is-open {
  display: flex;
}

.sb-desk-ai-prompt-panel[hidden] {
  display: none !important;
}

.sb-desk-ai-prompt-edit {
  display: block;
  width: 100%;
  min-height: 96px;
  resize: vertical;
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  color: #d1d1d6;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}

.sb-desk-ai-prompt-edit:focus {
  border-color: rgba(163, 230, 53, 0.35);
  color: #f5f5f7;
}

.sb-desk-ai-prompt-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #8e8e93;
}

.sb-desk-ai-result {
  flex: 1 1 auto;
  min-height: 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* no bottom pad — avoids the empty strip under 画面描述 */
  padding: 10px 12px 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 0;
  /* keep visible so copy / action tooltips are not clipped */
  overflow: visible;
}

.sb-desk-ai-desc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 22px;
  position: relative;
  z-index: 2;
}

.sb-desk-ai-desc-head .sb-desk-ai-edit-label {
  margin: 0;
}

.sb-desk-ai-copy {
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #d1d1d6;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}

.sb-desk-ai-copy:hover {
  border-color: rgba(163, 230, 53, 0.45);
  color: #a3e635;
  background: rgba(163, 230, 53, 0.08);
}

.sb-desk-ai-copy:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.sb-desk-ai-edit-label {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #8e8e93;
  flex: 0 0 auto;
}

.sb-desk-ai-field-label {
  margin: 0;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 700;
}

.sb-desk-ai-edit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(245, 245, 247, 0.95);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  box-shadow: none;
  min-height: 44px;
}

input.sb-desk-ai-edit {
  min-height: 32px;
  height: 32px;
}

.sb-desk-ai-edit.is-desc {
  flex: 1 1 auto;
  min-height: 72px;
  min-width: 0;
  overflow: auto;
  /* flush to card bottom — no nested box line under 画面描述 */
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 4px 2px 10px;
  resize: none;
}

.sb-desk-ai-edit:focus {
  border-color: rgba(163, 230, 53, 0.4);
  color: #f5f5f7;
}

.sb-desk-ai-edit.is-desc:focus {
  border-color: transparent;
  box-shadow: none;
}

.sb-desk-ai-edit::placeholder {
  color: #636366;
}

.sb-desk-ai-result.is-empty .sb-desk-ai-edit {
  color: #8e8e93;
}

.sb-desk-ai-status {
  margin: 0;
  padding: 0 2px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #8e8e93;
  white-space: pre-wrap;
}

.sb-desk-ai-status[hidden] {
  display: none !important;
}

.sb-desk-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.35;
}

.sb-desk-time-range {
  color: #f5f5f7;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-desk-time-dur {
  color: #8e8e93;
  font-size: 11px;
}

.sb-desk-cut-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sb-desk-cut-actions button {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #8e8e93;
  background: transparent;
  cursor: pointer;
}

.sb-desk-cut-actions button:hover:not(:disabled) {
  color: #f5f5f7;
  border-color: rgba(163, 230, 53, 0.4);
}

.sb-desk-cut-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

.sb-desk-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f5f7;
}

.sb-desk-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sb-desk-btn.primary {
  background: #a3e635;
  border-color: #a3e635;
  color: #111;
}

.sb-desk-btn.quiet {
  background: transparent;
  color: #a3e635;
  box-shadow: inset 0 0 0 1px rgba(163, 230, 53, 0.45);
}

.sb-desk-export-wrap {
  position: relative;
  margin-left: 0;
}

.sb-desk-export-menu,
.sb-desk-top-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 148px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(22, 22, 24, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 40;
}

.top-export-group {
  position: relative;
}

.sb-desk-export-menu[hidden],
.sb-desk-top-export-menu[hidden] {
  display: none !important;
}

.sb-desk-export-menu button,
.sb-desk-top-export-menu button {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.9);
  cursor: pointer;
}

.sb-desk-export-menu button:hover,
.sb-desk-top-export-menu button:hover {
  background: rgba(163, 230, 53, 0.12);
  color: #a3e635;
}

.sb-desk-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #121214;
  flex: 0 0 auto;
}

.sb-desk-tabs button[data-desk-tab] {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 650;
  color: #8e8e93;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.sb-desk-tabs button[data-desk-tab]:focus,
.sb-desk-tabs button[data-desk-tab]:focus-visible {
  outline: none;
}

.sb-desk-tabs button[data-desk-tab].is-active {
  color: #a3e635;
  border-bottom-color: #a3e635;
}

.sb-desk-tabs-trail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.sb-desk-empty-hint {
  font-size: 11px;
  font-weight: 550;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.sb-desk-empty-hint[hidden] {
  display: none !important;
}

.sb-desk-col-settings {
  position: relative;
  flex: 0 0 auto;
  margin-left: 2px;
}

.sb-desk-col-settings[hidden] {
  display: none !important;
}

.sb-desk-col-toggle {
  appearance: none;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 245, 247, 0.88);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.sb-desk-col-toggle:hover,
.sb-desk-col-toggle[aria-expanded='true'] {
  border-color: rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.12);
  color: #a3e635;
}

.sb-desk-col-settings .script-col-panel {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 6px);
  z-index: 50;
  width: 272px;
  max-height: min(460px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(22, 22, 24, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

.sb-desk-col-settings .script-col-panel[hidden] {
  display: none !important;
}

.sb-desk-col-settings .script-col-panel-head {
  flex: 0 0 auto;
  padding: 12px 12px 0;
}

.sb-desk-col-settings .script-col-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px;
  -webkit-overflow-scrolling: touch;
}

.sb-desk-col-settings .script-col-panel h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8e8e93;
}

.sb-desk-col-settings .script-col-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(142, 142, 147, 0.88);
}

.sb-desk-col-settings .script-thumb-size {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-desk-col-settings .script-thumb-size-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8e8e93;
}

.sb-desk-col-settings .thumb-size-switch {
  display: flex;
  gap: 4px;
}

.sb-desk-col-settings .thumb-size-switch .thumb-size-btn {
  flex: 1;
  appearance: none;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 247, 0.9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sb-desk-col-settings .thumb-size-switch .thumb-size-btn.is-active {
  background: rgba(163, 230, 53, 0.14);
  border-color: rgba(163, 230, 53, 0.45);
  color: #a3e635;
}

.sb-desk-col-settings .thumb-size-switch .thumb-size-btn:hover {
  border-color: rgba(163, 230, 53, 0.35);
}

.sb-desk-col-settings .script-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-desk-col-settings .script-col-list-wrap {
  position: relative;
}

.sb-desk-col-settings .script-col-ghost {
  position: fixed;
  z-index: 2147483646;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  list-style: none;
}

.sb-desk-col-settings .script-col-row {
  display: grid;
  grid-template-columns: 18px 20px minmax(0, 1fr) auto auto;
  gap: 4px 6px;
  align-items: center;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  color: rgba(245, 245, 247, 0.92);
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.sb-desk-col-settings .script-col-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.sb-desk-col-settings .script-col-row.is-dragging-source {
  opacity: 0.28;
  border-color: rgba(163, 230, 53, 0.35);
}

.sb-desk-col-settings .script-col-row.is-fixed .script-col-handle {
  visibility: hidden;
  pointer-events: none;
}

.sb-desk-col-settings .script-col-index {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #636366;
  text-align: center;
}

.sb-desk-col-settings .script-col-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(163, 230, 53, 0.14);
  color: #a3e635;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  cursor: grab;
  touch-action: none;
  letter-spacing: -0.12em;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(163, 230, 53, 0.24);
}

.sb-desk-col-settings .script-col-handle:hover {
  background: rgba(163, 230, 53, 0.22);
  color: #c7f058;
}

.sb-desk-col-settings .script-col-handle:active {
  cursor: grabbing;
}

.sb-desk-col-settings .script-col-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}

.sb-desk-col-settings .script-col-row input[type='checkbox'] {
  accent-color: #a3e635;
  flex: 0 0 auto;
}

.sb-desk-col-settings .script-col-row.is-required label {
  opacity: 0.72;
  cursor: default;
}

/* Per-column「AI」opt-in pill + hint input (column-driven AI). */
.sb-desk-col-settings .script-col-ai {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8e8e93;
  cursor: pointer;
  user-select: none;
}

.sb-desk-col-settings .script-col-ai input[type='checkbox'] {
  width: 11px;
  height: 11px;
  margin: 0;
}

.sb-desk-col-settings .script-col-row.is-ai-on .script-col-ai {
  border-color: rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.12);
  color: #a3e635;
}

.sb-desk-col-settings .script-col-ai-hint {
  grid-column: 3 / -1;
  height: 24px;
  min-width: 0;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(163, 230, 53, 0.22);
  background: rgba(0, 0, 0, 0.24);
  color: #d9d9de;
  font-size: 11px;
  outline: none;
}

.sb-desk-col-settings .script-col-ai-hint:focus {
  border-color: rgba(163, 230, 53, 0.5);
}

.sb-desk-col-settings .script-col-ai-hint::placeholder {
  color: rgba(142, 142, 147, 0.7);
}

.sb-desk-col-settings .script-col-remove {
  appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ff6b6b;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.sb-desk-col-settings .script-col-insert-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(163, 230, 53, 0.88);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(163, 230, 53, 0.28);
}

.sb-desk-col-settings .script-col-insert-line[hidden] {
  display: none !important;
}

.sb-desk-col-settings .script-col-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-desk-col-settings .script-col-add input {
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.24);
  color: #f5f5f7;
  font-size: 12px;
  outline: none;
}

.sb-desk-col-settings .script-col-add input:focus {
  border-color: rgba(163, 230, 53, 0.45);
}

.sb-desk-col-settings .script-col-add button {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.14);
  color: #a3e635;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sb-desk-batch-tab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  flex: 0 0 auto;
  /* Primary CTA for empty-shot fill — solid brand green */
  border: 1px solid #a3e635;
  background: #a3e635;
  color: #111;
  box-shadow: none;
}

.sb-desk-batch-tab-btn:hover {
  filter: brightness(1.05);
  background: #a3e635;
  border-color: #a3e635;
  color: #111;
}

.sb-desk-batch-tab-btn.is-muted {
  opacity: 0.55;
  filter: none;
}

.sb-desk-batch-tab-btn.is-muted:hover {
  filter: none;
  background: #a3e635;
}

.sb-desk-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3c transparent;
}

.sb-desk-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sb-desk-body::-webkit-scrollbar-track {
  background: transparent;
}

.sb-desk-body::-webkit-scrollbar-thumb {
  background: #3a3a3c;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sb-desk-body::-webkit-scrollbar-thumb:hover {
  background: #48484a;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#storyboardDeskShell,
#sbDeskAiResult .sb-desk-ai-edit {
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3c transparent;
}

#sbDeskAiResult .sb-desk-ai-edit::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#sbDeskAiResult .sb-desk-ai-edit::-webkit-scrollbar-track {
  background: transparent;
}

#sbDeskAiResult .sb-desk-ai-edit::-webkit-scrollbar-thumb {
  background: #3a3a3c;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sb-desk-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--shot-grid-gap, 8px);
  padding: 0;
}

.sb-desk-card {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #161618;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sb-desk-card:hover {
  border-color: rgba(163, 230, 53, 0.35);
}

.sb-desk-card.is-on {
  border-color: #a3e635;
  box-shadow: 0 0 0 1px rgba(163, 230, 53, 0.42), 0 12px 30px rgba(0, 0, 0, 0.24);
  outline: none;
}

.sb-desk-card .pic {
  aspect-ratio: 16 / 9;
  background: #000 center / cover no-repeat;
}

.sb-desk-card .meta {
  padding: 10px 12px 12px;
}

.sb-desk-card .shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.sb-desk-card .shot-id {
  flex: 0 0 auto;
  font: 760 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
  color: rgba(245, 245, 247, 0.95);
}

.sb-desk-card .shot-duration {
  flex: 0 0 auto;
  font: 650 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(142, 142, 147, 0.82);
}

.sb-desk-card .shot-range {
  margin-top: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font: 500 11px/1.25 ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-desk-card .card-note {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: #d1d1d6;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
  box-shadow: none;
  cursor: text;
}

.sb-desk-card .card-note:focus {
  color: #f5f5f7;
}

.sb-desk-card .card-note::placeholder {
  color: #636366;
}

.sb-desk-script-wrap {
  min-width: 0;
}

.sb-desk-script-xscroll {
  width: 100%;
  min-width: 100%;
  /*
   * The parent .sb-desk-body owns both axes. A nested overflow-x:auto becomes
   * the sticky containing block and prevents the header from following the
   * vertical desk scroll.
   */
  overflow: visible;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3c transparent;
}

.sb-desk-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
  background: rgba(16, 16, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.sb-desk-table th {
  position: sticky;
  top: 0;
  z-index: 6;
  text-align: left;
  padding: 10px 8px;
  background: #181a12;
  color: rgba(163, 230, 53, 0.85);
  border-bottom: 1px solid rgba(163, 230, 53, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(163, 230, 53, 0.16);
  overflow: visible;
}

.sb-desk-table th:first-child,
.sb-desk-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.sb-desk-table th .col-head-label {
  display: block;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-desk-col-resize {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
  user-select: none;
}

.sb-desk-col-resize::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.sb-desk-col-resize:hover::after,
.sb-desk-col-resize.is-dragging::after {
  background: rgba(10, 132, 255, 0.88);
}

.sb-desk-table th.is-resizing {
  user-select: none;
}

.sb-desk-col-resize-guide {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(10, 132, 255, 0.9);
  pointer-events: none;
  z-index: 100000;
  display: none;
}

.sb-desk-col-resize-guide.is-on {
  display: block;
}

html.sb-desk-col-resizing,
html.sb-desk-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.sb-desk-table td {
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 16, 18, 0.92);
  min-width: 0;
}

.sb-desk-table tr.is-on td {
  background: rgba(163, 230, 53, 0.06);
}

.sb-desk-table tr:hover td {
  background: rgba(28, 28, 30, 0.96);
}

.sb-desk-table tr.is-on:hover td {
  background: rgba(163, 230, 53, 0.08);
}

.sb-desk-table tr {
  cursor: pointer;
}

.sb-desk-table td.col-id {
  text-align: center;
  padding: 8px 4px;
  font: 760 13px/1.2 ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: rgba(245, 245, 247, 0.96);
}

.sb-desk-table td.col-thumb {
  padding: 0;
  line-height: 0;
  vertical-align: middle;
}

.sb-desk-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  background-color: #0a0a0b;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  border: 0;
}

.sb-desk-table td.col-time {
  padding: 8px 8px;
}

.sb-desk-table th[data-col]:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-desk-table td[data-col='shotSize'],
.sb-desk-table td[data-col='cameraMove'],
.sb-desk-table td[data-col='lighting'],
.sb-desk-table td[data-col='desc'],
.sb-desk-table td[data-col='note'],
.sb-desk-table td[data-col='audio'],
.sb-desk-table td[data-col='dialogue'],
.sb-desk-table td[data-col='bgm'],
.sb-desk-table td.col-custom {
  position: relative;
  padding: 0;
  vertical-align: stretch;
  height: 1px;
}

.sb-desk-table td[data-col]:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.sb-desk-note {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  resize: none;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  color: #d1d1d6;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
  outline: none;
}

.sb-desk-note:focus {
  color: #f5f5f7;
  background: transparent;
  outline: none;
  box-shadow: none;
}

.sb-desk-note::placeholder {
  color: #636366;
}

.sb-desk-empty {
  padding: 32px;
  text-align: center;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.5;
}

#storyboardDeskShell .hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .sb-desk-top {
    flex-direction: column;
    max-height: none;
  }
  .sb-desk-player-col {
    width: 100% !important;
    max-width: 100% !important;
  }
  .sb-desk-player-slot {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
  }
  .sb-desk-ai-rail {
    min-width: 0;
    max-width: none;
  }
  .sb-desk-empty-hint {
    max-width: 28vw;
  }
}

/* Workspace chrome: hide when printing desk script/board */
@media print {
  body.desk-print-script .title-bar,
  body.desk-print-board .title-bar,
  body.desk-print-script .footer-shortcuts,
  body.desk-print-board .footer-shortcuts,
  body.desk-print-script .split-workspace,
  body.desk-print-board .split-workspace,
  body.desk-print-script #exportPopoutPanel,
  body.desk-print-board #exportPopoutPanel,
  body.desk-print-script #exportPopoutBackdrop,
  body.desk-print-board #exportPopoutBackdrop,
  body.desk-print-script .sb-desk-top,
  body.desk-print-board .sb-desk-top,
  body.desk-print-script .sb-desk-row-resizer,
  body.desk-print-board .sb-desk-row-resizer,
  body.desk-print-script .sb-desk-tabs,
  body.desk-print-board .sb-desk-tabs,
  body.desk-print-script #settingsOverlay,
  body.desk-print-board #settingsOverlay {
    display: none !important;
  }
  body.desk-print-script #storyboardDeskShell,
  body.desk-print-board #storyboardDeskShell {
    display: block !important;
    position: static !important;
    inset: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  body.desk-print-script .sb-desk-body,
  body.desk-print-board .sb-desk-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
}
