/* First v2 shell. Values follow StudioKit's Pro dark theme (ui/src/themes.js).
   The current Slop Studio editor remains active underneath this optional skin. */
body[data-editor="v2"] {
  --sk-bg: #141518;
  --sk-body: #1b1c20;
  --sk-body-alt: #1f2025;
  --sk-header: #23252b;
  --sk-header-alt: #272930;
  --sk-text: #d7dae1;
  --sk-text-dim: #80858f;
  --sk-cue: #7fc7ff;
  --sk-ruler: #202227;
  --sk-lane-edge: #101114;
  --accent: #7fc7ff;
  background: var(--sk-bg);
  color: var(--sk-text);
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body[data-editor="v2"] [hidden] { display: none !important; }
body[data-editor="v2"] small,
body[data-editor="v2"] .muted,
body[data-editor="v2"] .nle-small { color: #9ca2af; }
body[data-editor="v2"] a { color: var(--sk-cue); }
body[data-editor="v2"] :focus-visible { outline: 2px solid var(--sk-cue); outline-offset: 2px; }

/* Productions remain a quiet entry point; the NLE is the primary destination. */
body[data-editor="v2"] #productionPage { background: var(--sk-bg); }
body[data-editor="v2"] .production-card {
  background: var(--sk-body);
  color: var(--sk-text);
  border-color: #373a44;
  border-radius: 6px;
}
body[data-editor="v2"] .production-card:hover { border-color: var(--sk-cue); background: #252b35; }
body[data-editor="v2"] .production-card span { color: #a7adba; }
body[data-editor="v2"] .production-card small { color: var(--sk-cue); }

body[data-editor="v2"] button,
body[data-editor="v2"] input,
body[data-editor="v2"] select,
body[data-editor="v2"] textarea {
  border-radius: 4px;
  border-color: #444853;
  color: var(--sk-text);
}
body[data-editor="v2"] input,
body[data-editor="v2"] select,
body[data-editor="v2"] textarea { background: #202228; }
body[data-editor="v2"] button {
  background: #30343d;
  color: #e2e6ef;
  border: 1px solid #454b58;
}
body[data-editor="v2"] button:hover:not(:disabled) { border-color: #78b9e9; background: #394453; }
body[data-editor="v2"] button.secondary { background: #262a32; color: #c9ceda; }
body[data-editor="v2"] button[aria-pressed="true"],
body[data-editor="v2"] #nle button[aria-pressed="true"] {
  color: #ecf8ff;
  background: #27526d;
  border-color: #7fc7ff;
}
body[data-editor="v2"] input[type="checkbox"],
body[data-editor="v2"] input[type="range"] { accent-color: var(--sk-cue); }

/* Header: views, wall toggle and one menu. */
body[data-editor="v2"][data-view="editor"] #appHeader {
  height: 58px;
  min-height: 58px;
  padding: 7px 16px;
  gap: 12px;
  background: var(--sk-header);
  border-bottom: 1px solid #343943;
  position: relative;
  z-index: 60;
  box-shadow: 0 2px 10px #080a0d55;
}
body[data-editor="v2"] #appHeader #productionHeading { flex: 0 1 230px; }
body[data-editor="v2"] #appHeader #productionHeading h2 {
  font-size: 14px;
  font-weight: 600;
  color: #eff2f8;
  text-overflow: ellipsis;
}
body[data-editor="v2"] #appHeader > .nle-toolbar { overflow: visible; gap: 10px; }
body[data-editor="v2"] #appHeader .plan-tabs { gap: 2px; padding: 3px; background: #191b20; border-radius: 5px; }
body[data-editor="v2"] #appHeader .plan-tabs button {
  border: 0;
  background: transparent;
  padding: 6px 13px !important;
  color: #aeb5c2;
  font-weight: 600;
}
body[data-editor="v2"] #appHeader .plan-tabs button:hover { color: #edf6ff; background: #303a47; }
body[data-editor="v2"] #appHeader .plan-tabs button[aria-pressed="true"] {
  background: #315a78;
  color: #f0f9ff;
  box-shadow: inset 0 -2px var(--sk-cue);
}
body[data-editor="v2"] #appHeader #mcGridToggle { border-color: #4b6678; }
body[data-editor="v2"] #appHeader #mcGridToggle[aria-pressed="true"] { background: #254862; border-color: var(--sk-cue); }
body[data-editor="v2"] #appHeader #workspaceActions { margin-left: auto; }
body[data-editor="v2"] #appHeader #exportOpen,
body[data-editor="v2"] #nlePlay { background: #357298; border-color: #69b9ea; color: #fff; font-weight: 700; }
body[data-editor="v2"] #appHeader #notice {
  background: #253747;
  color: #c6e7fa;
  border-color: #466780;
  max-width: 24vw;
}

/* The existing buttons keep their event handlers when moved into native menus. */
body[data-editor="v2"] .v2-menu { position: relative; flex: none; margin: 0; }
body[data-editor="v2"] .v2-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #454b58;
  border-radius: 4px;
  background: #2b3038;
  color: #d4d9e4;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
body[data-editor="v2"] .v2-menu > summary::-webkit-details-marker { display: none; }
body[data-editor="v2"] .v2-menu > summary::after { content: "⌄"; font-size: 13px; color: #aeb9c8; }
body[data-editor="v2"] .v2-menu[open] > summary { border-color: var(--sk-cue); background: #304455; }
body[data-editor="v2"] .v2-menu-content {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 220px;
  max-width: min(90vw, 340px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px;
  border: 1px solid #495363;
  border-radius: 6px;
  background: #232831;
  box-shadow: 0 16px 40px #080a0de0;
  color: #dce3ed;
}
body[data-editor="v2"] .v2-menu:not([open]) .v2-menu-content { display: none; }
body[data-editor="v2"] .v2-menu-content button { text-align: left; width: 100%; }
body[data-editor="v2"] .v2-menu-content label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
body[data-editor="v2"] .v2-menu-content label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }
body[data-editor="v2"] .v2-menu-content input[type="checkbox"] { width: 15px !important; height: 15px; margin: 0 !important; }
body[data-editor="v2"] .v2-menu-content a { padding: 6px 4px; font-size: 11px; }
body[data-editor="v2"] #appHeader .v2-menu #mcPlaybackMode { width: 100%; max-width: none; }
body[data-editor="v2"] #appHeader .v2-playback-order:has(select[hidden]) { display: none; }
body[data-editor="v2"] #appHeader .v2-menu #mcPassControls { display: flex; flex-direction: column; align-items: stretch; }
body[data-editor="v2"] #workspaceModeHelp { display: none; }
body[data-editor="v2"] .v2-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
body[data-editor="v2"] #backProductions,
body[data-editor="v2"] #mcGridToggle { display: inline-flex; align-items: center; gap: 5px; }
body[data-editor="v2"]:not([data-mode="preview"]) #mcGridToggle { display: none; }
body[data-editor="v2"] #appHeader .v2-header-menu > summary { gap: 6px; }
body[data-editor="v2"] #v2Preferences {
  width: min(450px, 92vw);
  max-height: 82vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid #526273;
  border-radius: 7px;
  background: #20242c;
  color: #e4eaf3;
  box-shadow: 0 24px 64px #050608c9;
}
body[data-editor="v2"] #v2Preferences::backdrop { background: #05080dbb; }
body[data-editor="v2"] #v2Preferences h2 { margin: 0 0 18px; font-size: 20px; }
body[data-editor="v2"] #v2Preferences section { border: 1px solid #3d4652; border-radius: 5px; padding: 13px; margin: 10px 0; display: grid; gap: 10px; background: #232831; }
body[data-editor="v2"] #v2Preferences h3 { margin: 0; font-size: 12px; color: #b8d7ec; }
body[data-editor="v2"] #v2Preferences .v2-account-credits { margin: 0; color: #c8dced; font-size: 12px; line-height: 1.5; }
body[data-editor="v2"] #v2Preferences label { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
body[data-editor="v2"] #v2Preferences label:has(input[type="checkbox"]) { flex-direction: row-reverse; }
body[data-editor="v2"] #v2Preferences label:has(select) { align-items: start; flex-direction: column; gap: 5px; }
body[data-editor="v2"] #v2Preferences input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
body[data-editor="v2"] #v2Preferences input[type="range"] { width: 150px; margin: 0; }
body[data-editor="v2"] #v2Preferences select { width: 100%; margin: 0; }
body[data-editor="v2"] #v2Preferences > button:last-child { margin-top: 16px; background: #357298; border-color: #69b9ea; }

/* StudioKit's canvas owns the v2 timeline. The original DOM stays laid out so the
   existing monitor and take wall can share its playback clock during the adapter pass. */
body[data-editor="v2"] .studiokit-timeline { position: relative; overflow: hidden; }
body[data-editor="v2"] .studiokit-timeline > .nle-labels,
body[data-editor="v2"] .studiokit-timeline > .nle-scroll { visibility: hidden; pointer-events: none; }
body[data-editor="v2"] .studiokit-timeline > sk-grid { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
body[data-editor="v2"] .sk-tools { display: flex; align-items: center; gap: 5px; padding: 5px 10px; background: #20252c; border-top: 1px solid #39414d; color: #b8d7ec; font-size: 11px; }
body[data-editor="v2"] .sk-tools span { margin-right: 8px; text-transform: uppercase; letter-spacing: .08em; }
body[data-editor="v2"] .sk-tools button { padding: 3px 9px; font-size: 11px; }
body[data-editor="v2"] .nle-transport label:has(#nleZoom) { display: none; }
body[data-editor="v2"] .sk-context { position: fixed; z-index: 120; display: grid; min-width: 170px; padding: 5px; background: #232831; border: 1px solid #5a6b7d; border-radius: 6px; box-shadow: 0 12px 32px #050608c9; }
body[data-editor="v2"] .sk-context button { text-align: left; border: 0; background: transparent; padding: 8px; }

/* Preview and take wall stay dominant. */
body[data-editor="v2"] #nle { background: var(--sk-body); }
body[data-editor="v2"] #nle .nle-stage { background: #111317; grid-template-columns: minmax(0,1fr) 10px var(--nle-drawer-width,360px); }
body[data-editor="v2"] #nle .nle-monitor { background: #0b0d10; border-color: #30343d; padding: 12px; }
body[data-editor="v2"] #nle .nle-canvas { background: #06080b; border: 1px solid #303944; }
body[data-editor="v2"] #nle .nle-inspector {
  background: var(--sk-body);
  border-left: 1px solid #3a404a;
  padding: 14px;
}
body[data-editor="v2"] #nle .nle-inspector:not(.take-grid-open),
body[data-editor="v2"] #nle .nle-stage:has(.nle-inspector:not(.take-grid-open)) .nle-drawer-resize { display: none; }
body[data-editor="v2"] #nle .nle-stage:has(.nle-inspector:not(.take-grid-open)) { grid-template-columns: minmax(0,1fr); }
body[data-editor="v2"] #nle .nle-drawer-resize { background: #313844; }

/* Scene preparation has its own page within the production workspace. */
body[data-editor="v2"][data-mode="direction"] #nle { display: none; }
body[data-editor="v2"] #v2SceneWorkspace { margin: 0; padding: 22px; border: 0; border-radius: 0; background: var(--sk-bg); min-height: calc(100dvh - 58px); }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; max-width: 1140px; margin: 0 auto 22px; }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-heading small { letter-spacing: .12em; color: var(--sk-cue); }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-heading h2 { margin: 4px 0 6px; font-size: 24px; }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-heading p { margin: 0; color: #aeb8c6; font-size: 13px; }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-content { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 16px; max-width: 1140px; margin: auto; align-items: start; }
body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-content > div { min-width: 0; padding: 18px; border: 1px solid #3c4856; border-radius: 7px; background: #20242b; }
body[data-editor="v2"] #v2SceneWorkspace h3 { margin: 0 0 10px; }
body[data-editor="v2"] #v2SceneWorkspace textarea { min-height: 170px; }
body[data-editor="v2"] #v2SceneWorkspace .nle-nav { margin-bottom: 8px; }
body[data-editor="v2"] #v2SceneWorkspace .nle-controls { gap: 6px; }
body[data-editor="v2"] #v2SceneWorkspace .nle-controls button { margin: 0; }
body[data-editor="v2"] #v2SceneWorkspace .nle-board-list { flex-wrap: wrap; }
body[data-editor="v2"] #v2SceneWorkspace .nle-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-editor="v2"] #nle .take-grid-heading { color: #e3e7ee; }
body[data-editor="v2"] #nle .take-grid-heading small { color: #98a4b4; }
body[data-editor="v2"] #nle .take-grid-cards { gap: 8px; }
body[data-editor="v2"] #nle .take-grid-card { background: #11151a; border-color: #3e4855; border-radius: 5px; }
body[data-editor="v2"] #nle .take-grid-card:hover { border-color: #87c9f3; }
body[data-editor="v2"] #nle .take-grid-card.selected { outline-color: #7fc7ff; }
body[data-editor="v2"] #nle .take-grid-card.is-default { border-color: #667d92; }
body[data-editor="v2"] #nle .take-grid-pick { background: transparent; color: #e8edf5; }
body[data-editor="v2"] #nle .take-grid-pick > small { color: #a5b0be; }
body[data-editor="v2"] #nle .take-grid-screen { background: #080a0e; }
body[data-editor="v2"] #nle .take-grid-status { background: #17202ac9; color: #d0e2ef; }
body[data-editor="v2"] #nle #takeGridArchived { background: #1d222a; border-color: #3d4855; }

/* A short transport. Editing tools and playback choices have named homes. */
body[data-editor="v2"] #nle .nle-transport {
  position: relative;
  z-index: 25;
  overflow: visible;
  min-height: 48px;
  padding: 7px 14px;
  gap: 8px;
  background: #202329;
  border-top-color: #363b45;
  border-bottom-color: #3b424d;
}
body[data-editor="v2"] #nle .nle-clock { color: #e5edf6; font-size: 15px; }
body[data-editor="v2"] #nle .nle-compare-controls { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
body[data-editor="v2"] #nle .nle-compare-controls { display: none; }
body[data-editor="v2"] #nle .nle-compare-controls button { padding: 5px 8px; }
body[data-editor="v2"] #nle .v2-take-menu:not(:has(button:not(:disabled):not([hidden]))) { display: none; }
body[data-editor="v2"] #nle .nle-transport > label:has(#nleZoom) { margin-left: auto; color: #aab4c1; }
body[data-editor="v2"] #nle #nleZoom { width: 135px !important; }
body[data-editor="v2"] #nle .v2-transport-menu .v2-menu-content { bottom: calc(100% + 6px); top: auto; }
body[data-editor="v2"] #nle .v2-transport-menu #nleSectionName { width: 100%; }
body[data-editor="v2"] #nle .v2-cut-details { margin: 5px 0 0; border-top: 1px solid #495563; padding-top: 8px; }
body[data-editor="v2"] #nle .v2-cut-details summary { cursor: pointer; font-size: 12px; }
body[data-editor="v2"] #nle .v2-cut-details .nle-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-editor="v2"] #nle .v2-cut-details input { width: 100%; }
body[data-editor="v2"] #nle #nleTakesLabel,
body[data-editor="v2"] #nle #nleTakes { display: none !important; }

/* StudioKit Pro dark surfaces and blue time cues. */
body[data-editor="v2"] #nle .nle-timeline-wrap { height: clamp(160px, 23vh, 230px); grid-template-columns: 124px minmax(0,1fr); }
body[data-editor="v2"] #nle .nle-labels { background: var(--sk-header); color: #c4cbd6; border-right-color: #3c424c; }
body[data-editor="v2"] #nle .nle-labels div { border-bottom-color: #373d47; letter-spacing: .5px; }
body[data-editor="v2"] #nle .nle-scroll { background: var(--sk-body); scrollbar-color: #64748a #1b1c20; }
body[data-editor="v2"] #nle .nle-ruler { background: var(--sk-ruler); }
body[data-editor="v2"] #nle .nle-ruler span { color: #9ea8b8; border-left-color: #526074; }
body[data-editor="v2"] #nle .nle-lane { border-bottom-color: #353b45; }
body[data-editor="v2"] #nle .nle-section-lane { background: #1e2631; }
body[data-editor="v2"] #nle .nle-section-marker { border-left-color: #7fc7ff; color: #d0eaff; }
body[data-editor="v2"] #nle #nleOverlayTrack { background: #252330; }
body[data-editor="v2"] #nle .nle-wave-lane { background: transparent; }
body[data-editor="v2"] #nle .nle-playhead,
body[data-editor="v2"] #nle #nleCue { border-top-color: #f2f3f5; background: #f2f3f5; }
body[data-editor="v2"] #nle .nle-playhead::before { border-top-color: #f2f3f5; }
body[data-editor="v2"] #nle .nle-resize { background: #2d3642; border-top-color: #526174; }
body[data-editor="v2"] #nle .nle-resize:hover { background: #436887; }
body[data-editor="v2"] #nle .nle-footer { background: #1a1d22; color: #8e99a8; }
body[data-editor="v2"] #nle .nle-footer b { color: #b9d8ea; }
body[data-editor="v2"] #nle .nle-history { background: #242a33; border-color: #465261; }
body[data-editor="v2"] #nle .mc-placement { background: #2f4051; border-color: #6286a7; }
body[data-editor="v2"] #nle .mc-placement.selected { outline-color: #f2f3f5; }
body[data-editor="v2"] #nle .nle-clip { background: #293747; border-color: #5c7893; }
body[data-editor="v2"] #nle .nle-clip.selected { background: #34536d; border-color: #9ed6fa; }
body[data-editor="v2"] .nle-context-menu { background: #252b34; border-color: #57677a; box-shadow: 0 14px 32px #080a0de0; }
body[data-editor="v2"] .nle-context-menu button { background: transparent; color: #e1e8f1; }
body[data-editor="v2"] .nle-context-menu button:hover,
body[data-editor="v2"] .nle-context-menu button:focus-visible { background: #36516b; }
body[data-editor="v2"] #nle .nle-dialog,
body[data-editor="v2"] .workspace-dialog { background: #20242c; color: #e4e9f1; border-color: #536074; }

@media (max-width: 1150px) {
  body[data-editor="v2"] #appHeader #productionHeading { flex-basis: 160px; }
  body[data-editor="v2"] #nle .nle-timeline-wrap { grid-template-columns: 100px minmax(0,1fr); }
  body[data-editor="v2"] #nle .nle-compare-controls { max-width: 45vw; }
}
@media (max-width: 800px) {
  body[data-editor="v2"] #v2SceneWorkspace .v2-scenes-content { grid-template-columns: 1fr; }
  body[data-editor="v2"] #appHeader #productionHeading { display: none; }
  body[data-editor="v2"] #appHeader .plan-tabs button { padding: 5px 8px !important; }
  body[data-editor="v2"] #nle .nle-stage { grid-template-columns: 1fr; }
  body[data-editor="v2"] #nle .nle-drawer-resize { display: none; }
  body[data-editor="v2"] #nle .nle-timeline-wrap { grid-template-columns: 76px minmax(0,1fr); height: clamp(150px, 23vh, 220px); }
  body[data-editor="v2"] #nle .nle-transport { flex-wrap: wrap; }
}
