/* Event editor: two-panel workspace with bounded, independently scrolling areas. */
.gj-scene-workspace.ui-dialog {
  --event-panel: #111319;
  --event-raised: #171a21;
  --event-sidebar-width: 320px;
  --event-gap: 12px;
  flex-direction: column;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0d0f13;
  color: #f4f4f4;
}

.gj-scene-workspace.ui-dialog:not([open]) {
  display: none;
}

.gj-scene-workspace.ui-dialog[open] {
  display: flex;
}

.gj-scene-workspace [hidden] {
  display: none !important;
}

.gj-scene-workspace .event-header,
.gj-scene-workspace .event-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px clamp(12px, 1.6vw, 24px);
  background: var(--event-panel);
}

.gj-scene-workspace .event-header {
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.gj-scene-workspace .event-header h1,
.gj-scene-workspace .event-header h2 {
  overflow: hidden;
  margin: 0;
  font:
    600 clamp(18px, 1.5vw, 24px)/1.2 'Space Grotesk',
    sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-scene-workspace .event-header .ui-tabs {
  margin-left: auto;
}

.gj-scene-workspace .studio-heading {
  min-width: 0;
}
.gj-scene-workspace .studio-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.gj-scene-workspace .event-layout {
  display: grid;
  grid-template-columns: var(--event-sidebar-width, 320px) 8px minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--line);
}

.gj-scene-workspace .event-sidebar,
.gj-scene-workspace .event-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0d0f13;
}

.gj-scene-workspace .event-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--event-panel);
}

.gj-scene-workspace .event-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.gj-scene-workspace .event-sidebar-toggle {
  min-width: 36px;
  padding-inline: 9px;
}

.gj-scene-workspace .event-sidebar-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 12px;
}

.gj-scene-workspace .event-sidebar-content > * + * {
  margin-top: 12px;
}

.gj-scene-workspace .event-sidebar-forms {
  display: grid;
  gap: 16px;
}

.gj-scene-workspace .event-program-section {
  display: grid;
  gap: 8px;
}

.gj-scene-workspace .event-program-section h3 {
  margin: 0;
  font-size: 14px;
}

.gj-scene-workspace .event-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.gj-scene-workspace .event-toolbar > #event-picker,
.gj-scene-workspace .event-toolbar > .ui-status {
  grid-column: 1 / -1;
  max-width: none;
}

.gj-scene-workspace .event-toolbar .ui-button {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-scene-workspace .event-field-group,
.gj-scene-workspace .event-config-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.gj-scene-workspace .event-field-group > span,
.gj-scene-workspace .event-config-field > label,
.gj-scene-workspace .event-sidebar-content label {
  color: #d5d6da;
  font-size: 12px;
  font-weight: 600;
}

.gj-scene-workspace .event-sidebar-content .ui-field {
  min-height: 36px;
}

.gj-scene-workspace .event-field-group:has(> input[type='checkbox']) {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gj-scene-workspace .event-config-content .rotary-control {
  justify-self: start;
}

.gj-scene-workspace .event-config {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff04;
}

.gj-scene-workspace .event-config > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: #e6e7e9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.gj-scene-workspace .event-config > summary::-webkit-details-marker {
  display: none;
}

.gj-scene-workspace .event-config > summary::after {
  color: var(--muted);
  content: '⌄';
}

.gj-scene-workspace .event-config[open] > summary::after {
  content: '⌃';
}

.gj-scene-workspace .event-config-content {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.gj-scene-workspace .event-program {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-height: 190px;
  overflow: auto;
}

.gj-scene-workspace .event-set {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gj-scene-workspace .event-set:hover {
  border-color: var(--line);
  background: #ffffff0a;
}

.gj-scene-workspace .event-set.selected,
.gj-scene-workspace .event-set[aria-pressed='true'],
.gj-scene-workspace .event-set[aria-selected='true'] {
  border-color: #c8ff5470;
  background: #c8ff5412;
  color: var(--acid);
}

.gj-scene-workspace .event-set-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-scene-workspace .event-set-meta,
.gj-scene-workspace .event-muted,
.gj-scene-workspace .event-steps {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.gj-scene-workspace .event-set-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gj-scene-workspace .event-steps {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff04;
}

.gj-scene-workspace .event-sidebar-content .event-brand-preview {
  display: block;
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
}

.gj-scene-workspace .event-resizer {
  position: relative;
  z-index: 1;
  width: 8px;
  min-height: 0;
  background: #ffffff0a;
  cursor: col-resize;
  touch-action: none;
}

.gj-scene-workspace .event-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
  content: '';
}

.gj-scene-workspace .event-resizer:hover::after,
.gj-scene-workspace .event-resizer:focus-visible::after {
  background: var(--acid);
}

.gj-scene-workspace .event-resizer:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}

.gj-scene-workspace.sidebar-collapsed .event-layout {
  grid-template-columns: 52px 0 minmax(0, 1fr);
}

.gj-scene-workspace.sidebar-collapsed .event-sidebar-content {
  display: none;
}

.gj-scene-workspace.sidebar-collapsed .event-resizer {
  visibility: hidden;
  pointer-events: none;
}

.gj-scene-workspace.sidebar-collapsed .event-sidebar-top {
  justify-content: center;
  height: 100%;
  padding-inline: 4px;
  border-bottom: 0;
}

.gj-scene-workspace.sidebar-collapsed .event-sidebar-toggle {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.gj-scene-workspace .event-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.gj-scene-workspace .event-gallery {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.gj-scene-workspace .event-gallery-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px clamp(10px, 1.2vw, 18px);
  border-bottom: 1px solid var(--line);
  background: var(--event-panel);
}

.gj-scene-workspace .event-gallery-header h2,
.gj-scene-workspace .event-gallery-header h3 {
  margin: 0 auto 0 0;
  font-size: 15px;
}

.gj-scene-workspace .event-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.gj-scene-workspace .event-filters .ui-field {
  width: auto;
  min-width: 105px;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 12px;
}

.gj-scene-workspace .event-filters .event-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}

.gj-scene-workspace .event-filters .event-search-wrap .ui-field {
  flex: 1 1 150px;
  min-width: 0;
}

.gj-scene-workspace .event-gallery-workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--line);
  gap: 1px;
}

.gj-scene-workspace .event-branches,
.gj-scene-workspace .event-catalog-pane,
.gj-scene-workspace .event-selection {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #0d0f13;
  padding: 10px;
}

.gj-scene-workspace .event-branches {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--event-panel);
  overflow-x: hidden;
  overflow-y: auto;
}

.gj-scene-workspace .event-branches h3,
.gj-scene-workspace .event-catalog-section h3,
.gj-scene-workspace .event-selection h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.gj-scene-workspace .event-branch {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 3px 8px;
  padding-inline-start: calc(8px + var(--branch-depth, 0) * 13px);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #cfd3d9;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.gj-scene-workspace .event-branch-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gj-scene-workspace .event-branch-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.gj-scene-workspace .event-branch-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.gj-scene-workspace .event-branch-row .event-branch {
  flex: 1;
}

.gj-scene-workspace .event-branch-add {
  padding: 2px;
  min-width: 26px;
  min-height: 26px;
}

.gj-scene-workspace .event-card-metadata,
.gj-scene-workspace .event-family-label {
  color: var(--muted);
  font-size: 10px;
}

.gj-scene-workspace .event-catalog-card[aria-pressed='true'] {
  border-color: #c8ff5470;
  background: #c8ff540b;
}

.gj-scene-workspace .event-selected-family {
  padding: 8px 4px 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--acid);
  cursor: grab;
  grid-column: 1 / -1;
}

.gj-scene-workspace .event-remove-drop {
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.gj-scene-workspace .event-branch[data-depth='1'] {
  --branch-depth: 1;
}
.gj-scene-workspace .event-branch[data-depth='2'] {
  --branch-depth: 2;
}
.gj-scene-workspace .event-branch[data-depth='3'] {
  --branch-depth: 3;
}
.gj-scene-workspace .event-branch[data-depth='4'] {
  --branch-depth: 4;
}
.gj-scene-workspace .event-branch[data-depth='5'] {
  --branch-depth: 5;
}

.gj-scene-workspace .event-branch:hover,
.gj-scene-workspace .event-branch.selected,
.gj-scene-workspace .event-branch[aria-pressed='true'],
.gj-scene-workspace .event-branch[aria-selected='true'] {
  border-color: #c8ff5460;
  background: #c8ff5410;
  color: var(--acid);
}

.gj-scene-workspace .event-catalog-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gj-scene-workspace .event-catalog-section {
  display: grid;
  gap: 7px;
}

.gj-scene-workspace .event-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.gj-scene-workspace .event-catalog-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff05;
}

.gj-scene-workspace .event-section-head,
.gj-scene-workspace .event-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.gj-scene-workspace .event-section-head h4 {
  margin: 0 auto 0 0;
  font-size: 12px;
}

.gj-scene-workspace .event-section-head > .ui-button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11px;
}

.gj-scene-workspace .event-catalog-card:hover,
.gj-scene-workspace .event-catalog-card.selected,
.gj-scene-workspace .event-catalog-card[aria-selected='true'] {
  border-color: #c8ff5470;
  background: #c8ff5410;
}

.gj-scene-workspace .event-catalog-card-body {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gj-scene-workspace .event-catalog-card .event-thumbnail {
  display: block;
  width: min(100%, 60px);
  height: 38px;
  overflow: hidden;
  border-radius: 4px;
  background: #ffffff12;
}

.gj-scene-workspace .event-catalog-card .event-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gj-scene-workspace .event-catalog-name {
  display: -webkit-box;
  overflow: hidden;
  color: #d9dbe0;
  font-size: 11px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gj-scene-workspace .event-catalog-card .event-add {
  min-width: 30px;
  min-height: 30px;
  padding: 3px 6px;
  font-size: 12px;
}

.gj-scene-workspace .event-selection {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--event-panel);
}

.gj-scene-workspace .event-selection-head {
  position: sticky;
  top: -10px;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: -10px -10px 0;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--event-panel);
}

.gj-scene-workspace .event-selection-head h4 {
  margin: 0;
  font-size: 13px;
}

.gj-scene-workspace .event-selection-count {
  min-width: 0;
  overflow: hidden;
  color: #d9dbe0;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-scene-workspace .event-selection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.gj-scene-workspace .event-selection-actions .ui-button {
  min-height: 32px;
  padding: 4px 7px;
  font-size: 11px;
}

.gj-scene-workspace .event-selection-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 80px;
  flex: 1 1 0;
  overflow: auto;
}

.gj-scene-workspace .event-selection > :not(.event-selection-list) {
  flex-shrink: 0;
}

.gj-scene-workspace .event-scene-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff05;
}

.gj-scene-workspace .event-scene-select {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.gj-scene-workspace .event-scene-select .event-thumbnail {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
}

.gj-scene-workspace .event-scene-select .event-meters {
  grid-column: 2;
  width: 100%;
}

.gj-scene-workspace .event-remove {
  padding: 0;
  min-width: 24px;
  min-height: 28px;
}

.gj-scene-workspace .event-scene-row.selected,
.gj-scene-workspace .event-scene-row[aria-pressed='true'],
.gj-scene-workspace .event-scene-row[aria-selected='true'] {
  border-color: #c8ff5470;
  background: #c8ff540b;
}

.gj-scene-workspace .event-thumbnail {
  display: block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 4px;
  background: #ffffff12;
}

.gj-scene-workspace .event-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gj-scene-workspace .event-scene-name {
  overflow: hidden;
  min-width: 0;
  color: #e2e3e6;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-scene-workspace .event-meters {
  display: grid;
  gap: 4px;
  width: 58px;
}

.gj-scene-workspace .event-meter {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: #ffffff18;
}

.gj-scene-workspace .event-meter::before {
  display: block;
  width: var(--meter-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: #b7bac1;
  content: '';
}

.gj-scene-workspace .event-meter-hardness::before {
  background: var(--acid);
}

.gj-scene-workspace .event-duration-detail {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff04;
}

.gj-scene-workspace .event-duration-detail h3 {
  margin: 0;
  font-size: 12px;
}

.gj-scene-workspace .event-duration-detail p {
  margin: 0;
}

.gj-scene-workspace .event-duration-value {
  font: 12px monospace;
}

.gj-scene-workspace .event-duration-detail input[type='range'] {
  width: 100%;
  min-height: 24px;
  padding: 0;
  accent-color: var(--acid);
}

.gj-scene-workspace .event-duration-detail .event-hardness-readonly {
  color: var(--muted);
  font-size: 12px;
}

.gj-scene-workspace .event-gallery .event-empty {
  display: grid;
  place-items: center;
  min-height: 100px;
  padding: 16px;
  border: 1px dashed #ffffff30;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.gj-scene-workspace .event-gallery .drop-over {
  border-color: var(--acid) !important;
  background: #c8ff5418 !important;
  box-shadow: inset 0 0 0 1px var(--acid);
}

.gj-scene-workspace .event-gallery .dragging {
  opacity: 0.5;
  outline: 1px dashed var(--acid);
  outline-offset: 2px;
}

.gj-scene-workspace .event-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 60px;
  border-top: 1px solid var(--line);
}

.gj-scene-workspace .event-footer > .ui-status {
  margin-right: auto;
}

.gj-scene-workspace .event-show {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
}

.gj-scene-workspace .event-show > * + * {
  margin-top: 12px;
}

.gj-scene-workspace :focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .gj-scene-workspace.ui-dialog {
    --event-sidebar-width: 260px;
  }

  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: 140px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(150px, 30dvh);
  }

  .gj-scene-workspace .event-selection {
    grid-column: 1 / -1;
    max-height: 30dvh;
    border-top: 1px solid var(--line);
    overflow: auto;
  }

  .gj-scene-workspace .event-selection-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    flex: 0 0 auto;
    max-height: 240px;
  }
}

@media (max-width: 620px) {
  .gj-scene-workspace.ui-dialog {
    --event-sidebar-width: min(82vw, 320px);
  }

  .gj-scene-workspace .event-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    padding: 8px 10px;
  }

  .gj-scene-workspace .event-header .ui-tabs {
    grid-row: 2;
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .gj-scene-workspace .event-header .ui-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }

  .gj-scene-workspace .event-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .gj-scene-workspace .event-resizer {
    display: none;
  }

  .gj-scene-workspace .event-sidebar {
    max-height: 36dvh;
    border-bottom: 1px solid var(--line);
  }

  .gj-scene-workspace.sidebar-collapsed .event-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .gj-scene-workspace.sidebar-collapsed .event-sidebar {
    width: auto;
    min-height: 48px;
  }

  .gj-scene-workspace.sidebar-collapsed .event-sidebar-top {
    justify-content: flex-end;
    height: auto;
  }

  .gj-scene-workspace.sidebar-collapsed .event-sidebar-toggle {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(120px, 0.35fr) minmax(240px, 1fr) minmax(150px, 30dvh);
    overflow: auto;
  }

  .gj-scene-workspace .event-branches,
  .gj-scene-workspace .event-catalog-pane,
  .gj-scene-workspace .event-selection {
    overflow: auto;
    scrollbar-gutter: auto;
  }

  .gj-scene-workspace .event-branches {
    max-height: 20dvh;
    border-bottom: 1px solid var(--line);
  }

  .gj-scene-workspace .event-catalog-pane {
    min-height: 220px;
  }

  .gj-scene-workspace .event-selection {
    grid-column: auto;
    max-height: 30dvh;
    border-top: 1px solid var(--line);
  }

  .gj-scene-workspace .event-selection-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .gj-scene-workspace .event-gallery-header {
    align-items: stretch;
    padding: 8px;
  }

  .gj-scene-workspace .event-filters {
    flex: 1 1 100%;
  }

  .gj-scene-workspace .event-filters .ui-field {
    flex: 1 1 115px;
  }

  .gj-scene-workspace .event-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    padding: 8px 10px;
  }

  .gj-scene-workspace .event-footer > .ui-status,
  .gj-scene-workspace #event-start {
    grid-column: 1 / -1;
  }

  .gj-scene-workspace .event-footer > .ui-button {
    width: 100%;
  }
}

@media (pointer: coarse) {
  .gj-scene-workspace .event-set,
  .gj-scene-workspace .event-branch,
  .gj-scene-workspace .event-config > summary,
  .gj-scene-workspace .event-catalog-card .event-add,
  .gj-scene-workspace .event-selection-actions .ui-button {
    min-height: 44px;
  }

  .gj-scene-workspace .event-resizer {
    width: 12px;
  }
}

@media (max-width: 360px) {
  .gj-scene-workspace .event-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .gj-scene-workspace .event-toolbar > #event-picker,
  .gj-scene-workspace .event-toolbar > .ui-status {
    grid-column: auto;
  }

  .gj-scene-workspace .event-catalog {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  .gj-scene-workspace .event-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .gj-scene-workspace .event-footer > .ui-status,
  .gj-scene-workspace #event-start {
    grid-column: auto;
  }
}
.gj-scene-workspace .event-branding-library {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px clamp(12px, 2vw, 28px);
}
.gj-scene-workspace .event-branding-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.gj-scene-workspace .event-branding-heading h3 {
  margin: 0;
}
.gj-scene-workspace .event-branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  max-width: 1400px;
  margin-top: 20px;
}
.gj-scene-workspace .event-branding-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--event-panel);
}
.gj-scene-workspace .event-branding-card h4 {
  margin: 0;
  overflow-wrap: anywhere;
}
.gj-scene-workspace .event-branding-card > button {
  margin-top: auto;
}

/* UX audit 2026-10-26: steps, warnings, now/next, readability */
.gj-scene-workspace .event-howto {
  margin: 0 0 14px;
  padding: 10px 12px 10px 30px;
  border-radius: 10px;
  background: #ffffff08;
  color: #d4d5da;
  font-size: 12.5px;
  line-height: 1.6;
}
.gj-scene-workspace .event-warning {
  margin: 8px 0;
  color: #ffc46b;
  font-size: 12.5px;
  line-height: 1.45;
}
.gj-scene-workspace .event-muted,
.gj-scene-workspace .event-steps {
  color: #b4b6bd; /* ≥ 4.5:1 on the dark panel */
}
.gj-scene-workspace .ui-button {
  min-height: 40px;
}
.gj-scene-workspace .event-now {
  display: grid;
  gap: 4px;
  max-width: 560px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid #ffffff1c;
  border-radius: 12px;
  background: #ffffff08;
}
.gj-scene-workspace .event-now small {
  margin-top: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.gj-scene-workspace .event-now strong {
  font-size: 18px;
}
.gj-scene-workspace .event-show-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.gj-scene-workspace .event-show {
  padding: 20px;
  overflow: auto;
}
.gj-scene-workspace .ui-button {
  min-height: 0;
}
.gj-scene-workspace .event-footer .ui-button,
.gj-scene-workspace .event-toolbar .ui-button,
.gj-scene-workspace .event-show .ui-button,
.gj-scene-workspace .event-set-tools .ui-button {
  min-height: 40px;
}
.gj-scene-workspace .event-footer .ui-button.is-primary:not(:disabled) {
  background: var(--acid);
  color: #07080b;
  border-color: var(--acid);
  font-weight: 700;
}
.gj-scene-workspace .event-footer .ui-button:disabled {
  background: #ffffff08;
  color: #8a8c93;
  border-color: #ffffff22;
  opacity: 1;
}
.gj-scene-workspace .event-set-tools .is-danger {
  margin-left: auto;
}
.gj-scene-workspace .event-stale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #ffb54722;
  color: #ffd59a;
}
.gj-scene-workspace .event-stale[hidden] {
  display: none;
}
.gj-scene-workspace .event-show-sets {
  display: grid;
  gap: 6px;
  max-width: 560px;
  margin: 6px 0 14px;
}
.gj-scene-workspace .event-show-set {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
}
.gj-scene-workspace .event-show-set.is-playing {
  border-color: var(--acid);
}
.gj-scene-workspace .event-show h4 {
  margin: 14px 0 4px;
}
.account-local-first {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}
@media (max-width: 640px) {
  .gj-scene-workspace .event-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  .gj-scene-workspace .event-footer .ui-status {
    flex-basis: 100%;
  }
  .gj-scene-workspace .event-footer #event-start {
    flex: 1 1 100%;
    order: -1;
  }
}
.account-local-first + .account-note {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ffffff1a;
}
.gj-scene-workspace .event-footer .ui-status.is-warning {
  color: #ffc46b;
  font-weight: 600;
}
.gj-scene-workspace #event-black {
  border-color: #ff4fa066;
  color: #ff8cc4;
}
.gj-scene-workspace .event-live-controls #event-stop {
  margin-left: auto;
}
.gj-scene-workspace .event-live-controls[hidden] {
  display: none;
}
.gj-scene-workspace .event-property-filter {
  display: grid;
  flex: 1 1 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px 16px;
  padding: 0;
}
.gj-scene-workspace .event-property-filter .property-control {
  padding: 0;
  min-width: 0;
}
.gj-scene-workspace .event-property-filter .property-control.has-ignore .property-head {
  grid-template-columns: minmax(0, 1fr) 40px 36px;
  gap: 5px;
}
.gj-scene-workspace .event-property-filter .property-head label {
  font-size: 11px;
  line-height: 1.2;
}
.gj-scene-workspace .event-property-filter .property-band {
  display: none;
}
.gj-scene-workspace .event-property-filter .property-control.has-ignore .property-number {
  grid-column: 2;
  grid-row: 1;
  width: 40px;
  min-width: 0;
  min-height: 26px;
  height: 26px;
  padding: 2px 3px !important;
  font-size: 11px;
  appearance: textfield;
  -moz-appearance: textfield;
}
.gj-scene-workspace .event-property-filter .property-number::-webkit-inner-spin-button,
.gj-scene-workspace .event-property-filter .property-number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.gj-scene-workspace .event-property-filter .property-control.has-ignore .property-all {
  grid-column: 3;
  grid-row: 1;
  min-height: 26px;
  padding: 2px 5px;
  font-size: 11px;
}
.gj-scene-workspace .event-property-filter input[type='range'] {
  display: block;
  width: 100%;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
}
.gj-scene-workspace .event-property-filter .property-ends {
  justify-content: space-between;
  gap: 4px;
  font-size: 9px;
  line-height: 1.2;
}
@media (max-width: 640px) {
  .gj-scene-workspace .event-property-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
  }
  .gj-scene-workspace .event-property-filter .property-control.has-ignore .property-head {
    grid-template-columns: minmax(0, 1fr) 34px 32px;
    gap: 3px;
  }
  .gj-scene-workspace .event-property-filter .property-control.has-ignore .property-number {
    width: 34px;
  }
  .gj-scene-workspace .event-property-filter input[type='range'] {
    min-height: 28px;
    height: 28px;
  }
}
.gj-scene-workspace .event-catalog-card {
  position: relative;
}
.gj-scene-workspace .event-card-info {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #000a;
  border: 1px solid #ffffff44;
  color: #fff;
  font:
    italic 700 12px/1 Georgia,
    serif;
  cursor: help;
  opacity: 0.7;
}
.gj-scene-workspace .event-catalog-card:hover .event-card-info,
.gj-scene-workspace .event-card-info:focus-visible {
  opacity: 1;
  border-color: var(--acid);
}
.scene-info-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
}
.scene-info-dialog::backdrop {
  background: #0008;
}
.scene-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.scene-info-head h3 {
  margin: 0;
}
.scene-info-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 12px 0 8px;
  border-radius: 10px;
  background: #ffffff0a;
}
.scene-info-desc {
  color: #c9cad0;
  line-height: 1.5;
}
.scene-info-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 10px 0 16px;
  font-size: 13px;
}
.scene-info-facts dt {
  color: var(--muted);
}
.scene-info-facts dd {
  margin: 0;
}
.ui-dialog.scene-info-dialog {
  width: min(460px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100dvh - 40px);
  border-radius: 16px;
  overflow: auto;
  padding: 18px;
}
.ui-dialog.scene-info-dialog[open] {
  display: block;
  height: fit-content;
  min-height: 0;
  margin: auto;
}
.gj-scene-workspace .event-inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.gj-scene-workspace .event-inline-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--acid);
}
.gj-scene-workspace .event-show .is-danger:not(:disabled) {
  color: #ffb3b0;
  border-color: #ff7777aa;
}
.gj-scene-workspace #event-black {
  border-color: var(--line);
}
.gj-scene-workspace #event-black[aria-pressed='true'] {
  background: #ff4fa0;
  border-color: #ff4fa0;
  color: #07080b;
}
@media (max-width: 640px) {
  /* the toolbar's Nová akce already says what to do; skip the duplicate empty canvas on phones */
  .gj-scene-workspace .event-gallery > .event-empty {
    display: none;
  }
}
.camera-plan {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.camera-plan legend {
  padding: 0 4px;
  font-weight: 700;
}
.camera-plan-body {
  display: grid;
  gap: 8px;
}
.camera-plan-when {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.camera-plan-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.camera-plan-field {
  display: grid;
  grid-template-columns: 9em 1fr auto;
  align-items: center;
  gap: 8px;
}
.camera-plan small {
  color: #b4b6bd;
}

/* Studio routes: a quiet library first, event cards second, full-width scene editor last. */
.gj-scene-workspace .studio-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.gj-scene-workspace .studio-breadcrumbs .ui-button {
  padding: 3px 7px;
  min-height: 28px;
  font-size: 12px;
}
.gj-scene-workspace .studio-overview {
  flex: 1;
  overflow: auto;
  padding: clamp(20px, 4vw, 60px);
}
.gj-scene-workspace .studio-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1150px;
  margin: 0 auto 20px;
}
.gj-scene-workspace .studio-document-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.gj-scene-workspace .studio-document {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  min-width: 0;
  text-align: left;
  background: #171a21;
}
.gj-scene-workspace .studio-document strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.gj-scene-workspace[data-route='event'] .event-layout {
  display: block;
  overflow: auto;
}
.gj-scene-workspace[data-route='event'] .event-sidebar {
  max-width: 1150px;
  margin: auto;
  overflow: visible;
}
.gj-scene-workspace[data-route='event'] .event-sidebar-content {
  overflow: visible;
  padding: 24px;
}
.gj-scene-workspace[data-route='event'] .event-sidebar-top,
.gj-scene-workspace[data-route='event'] .event-resizer,
.gj-scene-workspace[data-route='event'] #event-picker {
  display: none;
}
.gj-scene-workspace .event-program {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
}
.gj-scene-workspace .studio-set-card {
  background: #171a21;
  border: 1px solid #343b49;
  border-radius: 12px;
  overflow: hidden;
}
.gj-scene-workspace .studio-set-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
}
.gj-scene-workspace .studio-set-card > summary::before {
  content: '▸';
  color: #c4f47a;
}
.gj-scene-workspace .studio-set-card[open] > summary::before {
  content: '▾';
}
.gj-scene-workspace .studio-home-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #101319;
}
.gj-scene-workspace .studio-list-header,
.gj-scene-workspace .studio-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.gj-scene-workspace .studio-list-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.gj-scene-workspace .studio-list-header h3 {
  margin: 0;
}
.gj-scene-workspace .studio-set-card > .event-config-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gj-scene-workspace .studio-identity,
.gj-scene-workspace .studio-options {
  display: grid;
  gap: 12px;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gj-scene-workspace .studio-event-identity {
  grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr);
  max-width: 740px;
}
.gj-scene-workspace .studio-set-identity {
  grid-template-columns: minmax(140px, 1.3fr) minmax(130px, 1fr) minmax(140px, 1.3fr) auto;
}
.gj-scene-workspace .studio-options {
  max-width: 900px;
}
.gj-scene-workspace .studio-identity .event-field-group,
.gj-scene-workspace .studio-options .event-field-group,
.gj-scene-workspace .studio-actions .event-field-group {
  margin: 0;
  min-width: 0;
}
.gj-scene-workspace .studio-identity .ui-button,
.gj-scene-workspace .studio-actions .ui-button {
  width: auto;
}
.gj-scene-workspace .studio-set-identity > :last-child {
  align-self: end;
}
.gj-scene-workspace .studio-choice-tools {
  display: flex;
  align-items: end;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.gj-scene-workspace .studio-choice-tools > .event-field-group {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.gj-scene-workspace .studio-choice-tools > small,
.gj-scene-workspace .studio-choice-tools > p {
  flex-basis: 100%;
  margin: 0;
}
.gj-scene-workspace .studio-branding {
  margin: 0;
}
.gj-scene-workspace .studio-branding > .event-config-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.gj-scene-workspace .studio-branding .studio-actions > .event-field-group {
  flex: 0 1 350px;
}
.gj-scene-workspace .studio-branding .event-branding-preview {
  max-height: 160px;
}
.gj-scene-workspace .studio-options .artist-controls {
  margin: 0;
  padding: 8px 12px;
  min-width: 0;
}
.gj-scene-workspace .studio-options .artist-controls p {
  font-size: 11px;
  margin: 6px 0 0;
}
.studio-prompt.ui-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
}
.studio-prompt h3 {
  margin: 0 0 12px;
}
.studio-prompt .studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.studio-prompt .ui-field {
  width: 100%;
}
.studio-prompt .event-muted {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .gj-scene-workspace .studio-set-identity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.gj-scene-workspace[data-route='scenes'] .event-layout,
.gj-scene-workspace[data-route='selection'] .event-layout {
  display: block;
}
.gj-scene-workspace .studio-scene-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.gj-scene-workspace .studio-scene-toolbar .event-field-group {
  margin: 0;
  flex: 1;
  max-width: 480px;
}
.gj-scene-workspace .event-gallery-workspace {
  grid-template-columns: 240px minmax(240px, 1fr) minmax(340px, 28vw);
}
.gj-scene-workspace .event-catalog-card[aria-pressed='true'] {
  background: #23382b;
  border: 2px solid #c4f47a;
  box-shadow: inset 0 0 0 2px #c4f47a44;
}
.gj-scene-workspace .event-branch[aria-pressed='true'] {
  background: #29412f;
  color: #d9ff9f;
  box-shadow: inset 3px 0 #c4f47a;
}
.gj-scene-workspace .event-branch.partially-selected {
  background: #203027;
  color: #d9ff9f;
}
.gj-scene-workspace .event-branch-filter {
  flex: 0 0 28px;
  padding: 2px;
}
.gj-scene-workspace .event-selection-estimate {
  color: #d9ff9f;
  font-size: 17px;
  font-weight: 600;
}
.gj-scene-workspace .event-standard-duration {
  color: #d9ff9f;
}
@media (max-width: 1100px) and (min-width: 721px) {
  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: 205px minmax(180px, 1fr) 310px;
  }
}
@media (max-width: 720px) {
  .gj-scene-workspace .studio-home-grid {
    grid-template-columns: 1fr;
    margin: 20px auto;
  }
  .gj-scene-workspace .studio-document {
    flex-direction: column;
  }
  .gj-scene-workspace .studio-identity,
  .gj-scene-workspace .studio-options {
    grid-template-columns: 1fr;
  }
  .gj-scene-workspace .studio-overview {
    padding: 12px;
  }
  .gj-scene-workspace[data-route='event'] .event-sidebar-content {
    padding: 12px;
  }
  .gj-scene-workspace .studio-home-section {
    padding: 12px;
  }
  .gj-scene-workspace .studio-set-card > summary {
    flex-wrap: wrap;
  }
  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 721px) {
  .gj-scene-workspace .event-gallery-workspace {
    grid-template-rows: minmax(0, 1fr);
  }
  .gj-scene-workspace .event-selection {
    grid-column: auto;
    max-height: none;
  }
  .gj-scene-workspace .event-selection-list {
    display: flex;
    flex-direction: column;
    max-height: none;
  }
}

.gj-scene-workspace[data-route='event'] .event-toolbar {
  display: flex;
  flex-wrap: wrap;
}
.gj-scene-workspace[data-route='event'] .event-toolbar .ui-button {
  width: auto;
}
.gj-scene-workspace[data-route='event'] .event-toolbar > .ui-status {
  margin-left: auto;
}
.gj-scene-workspace[data-route='event'] .storage-chip {
  font-size: 11px;
}
.gj-scene-workspace .studio-set-card > summary strong {
  flex: 1;
}
@media (min-width: 721px) {
  .gj-scene-workspace .event-selection-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 1 0 220px;
    min-height: 220px;
  }
}

.gj-scene-workspace .studio-set-card.is-current {
  border-color: #c4f47a80;
}

.gj-scene-workspace .studio-delete-event {
  width: auto;
  justify-self: start;
}

.gj-scene-workspace .studio-selection-jump {
  display: none;
}
@media (max-width: 720px) {
  .gj-scene-workspace .studio-selection-jump {
    display: inline-flex;
  }
  .gj-scene-workspace .studio-scene-toolbar > .event-field-group {
    flex: 1 0 100%;
    max-width: none;
  }
  .gj-scene-workspace .event-footer {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 6px;
  }
  .gj-scene-workspace .event-footer > .ui-status {
    grid-column: 1 / -1;
    font-size: 11px;
    line-height: 16px;
  }
  .gj-scene-workspace .event-footer #event-start {
    grid-column: auto;
    order: 0;
  }
  .gj-scene-workspace .event-footer > .ui-button {
    min-width: 0;
    min-height: 44px;
    padding: 6px 8px;
    font-size: 12px;
    white-space: normal;
  }
}

.gj-scene-workspace .studio-global-actions {
  max-width: 1150px;
  margin: 0 auto;
}
/* Global Studio controls and the complete scene hierarchy. */
.gj-scene-workspace .studio-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.gj-scene-workspace .studio-categories {
  font-size: 12px;
}
.gj-scene-workspace .studio-home-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.gj-scene-workspace .studio-home-grid {
  align-items: start;
}
.gj-scene-workspace .studio-branding-document {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.gj-scene-workspace .studio-branding-document .event-branding-preview {
  flex: 0 0 100px;
  width: 100px;
  max-height: 56px;
  pointer-events: none;
}
.gj-scene-workspace .event-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px;
  text-align: left;
  font-size: 13px;
  background: transparent;
}
.gj-scene-workspace .event-group-name {
  flex: 1;
}
.gj-scene-workspace .event-group-count {
  color: var(--muted);
}
.gj-scene-workspace .event-catalog-section {
  margin-left: calc(var(--group-depth, 0) * 10px);
}
.gj-scene-workspace .event-catalog-section[data-group-depth='0'] > .event-section-head {
  border-block: 1px solid #39414d;
  background: #1a1e27;
  margin-top: 12px;
}
.gj-scene-workspace .event-catalog-section[data-group-depth='0'] > .event-section-head .event-group-name {
  font-size: 16px;
  font-weight: 600;
}
.gj-scene-workspace .event-group-toggle[aria-pressed='true'] {
  background: #29412f;
  color: #d9ff9f;
  box-shadow: inset 3px 0 #c4f47a;
}
.gj-scene-workspace .event-group-toggle.partially-selected {
  background: #203027;
  color: #d9ff9f;
}
.gj-scene-workspace .event-tree-resizer {
  background: #171c24;
  cursor: col-resize;
  touch-action: none;
  position: relative;
}
.gj-scene-workspace .event-tree-resizer::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 48px;
  left: 3px;
  top: calc(50% - 24px);
  background: #657083;
  border-radius: 2px;
}
.gj-scene-workspace .event-tree-resizer:hover,
.gj-scene-workspace .event-tree-resizer:focus-visible {
  background: #c4f47a66;
}
.gj-scene-workspace .storage-chip,
.account-connection {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 300px;
  min-width: 0;
  text-align: left;
}
.studio-account-identity,
.studio-sync-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-sync-label {
  font-size: 10px;
  color: var(--muted);
}
[data-phase='saved'] > .studio-sync-label {
  color: #c4f47a;
}
[data-phase='error'] > .studio-sync-label,
[data-phase='conflict'] > .studio-sync-label {
  color: #ffb978;
}
.account-connection {
  max-width: 185px;
}
.studio-category-scope {
  padding: 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.gj-scene-workspace .event-header {
  flex-wrap: wrap;
}
@media (min-width: 721px) {
  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: var(--event-tree-width, 240px) 8px minmax(180px, 1fr) minmax(340px, 28vw);
  }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .gj-scene-workspace .event-gallery-workspace {
    grid-template-columns: var(--event-tree-width, 205px) 8px minmax(180px, 1fr) 310px;
  }
}
@media (max-width: 720px) {
  .gj-scene-workspace .event-tree-resizer {
    display: none;
  }
  .gj-scene-workspace .event-header > .storage-chip {
    flex: 1 1 180px;
    max-width: 100%;
  }
  .gj-scene-workspace .studio-title-row {
    gap: 8px;
  }
  .gj-scene-workspace .studio-title-row h2 {
    font-size: 18px;
  }
  .gj-scene-workspace .studio-home-stack {
    gap: 16px;
  }
  .account-connection {
    max-width: 130px;
  }
}

.gj-scene-workspace .studio-collection-link {
  font: inherit;
  padding: 0;
  border: 0;
  background: transparent;
}
.gj-scene-workspace .event-header > .storage-chip {
  margin-left: auto;
}
.gj-scene-workspace .studio-branding-document .branding-preview {
  flex: 0 0 100px;
  width: 100px;
  max-height: 56px;
  pointer-events: none;
}
@media (max-width: 720px) {
  .gj-scene-workspace .event-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .gj-scene-workspace .event-header > .studio-heading {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .gj-scene-workspace .event-header > .storage-chip {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    width: 100%;
  }
  .gj-scene-workspace .event-header > button:last-child {
    grid-column: 2;
    grid-row: 2;
  }
  .gj-scene-workspace .event-header .ui-tabs {
    grid-row: 3;
  }
}

.editor-account-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-width: 270px;
  margin-left: auto;
  padding: 4px 8px;
  font-size: 11px;
}
.branding-head {
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .editor-account-status {
    max-width: min(270px, 65vw);
  }
}
/* Keep the selection legible, with half-strength green highlighting in Studio's scene picker. */
.gj-scene-workspace .event-gallery .event-catalog-card[aria-pressed='true'] {
  background: #23382b80;
  border-color: #c4f47a80;
  box-shadow: inset 0 0 0 2px #c4f47a22;
}
.gj-scene-workspace .event-gallery .event-branch[aria-pressed='true'],
.gj-scene-workspace .event-gallery .event-group-toggle[aria-pressed='true'] {
  background: #29412f80;
  border-color: #c8ff5430;
  box-shadow: inset 3px 0 #c4f47a80;
}
.gj-scene-workspace .event-gallery .event-branch.partially-selected,
.gj-scene-workspace .event-gallery .event-group-toggle.partially-selected {
  background: #20302780;
}
.gj-scene-workspace .event-gallery .event-branch-filter[aria-pressed='true'] {
  background: #c8ff5409;
  border-color: #c8ff5438;
}
.gj-scene-workspace .event-gallery .event-scene-row.selected,
.gj-scene-workspace .event-gallery .event-scene-row[aria-pressed='true'],
.gj-scene-workspace .event-gallery .event-scene-row[aria-selected='true'] {
  background: #c8ff5406;
  border-color: #c8ff5438;
}

/* Compact identity strip: label, name, save, then storage information on the same baseline. */
.gj-scene-workspace .studio-scene-toolbar {
  gap: 10px;
  padding: 6px 20px;
}
.gj-scene-workspace .studio-scene-toolbar > .event-field-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 520px;
  max-width: 560px;
}
.gj-scene-workspace .studio-scene-toolbar > .event-field-group > span {
  flex: 0 0 auto;
  white-space: nowrap;
}
.gj-scene-workspace .studio-scene-toolbar .ui-field,
.gj-scene-workspace .studio-scene-toolbar > .ui-button {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  padding: 5px 10px;
}
.gj-scene-workspace .studio-scene-toolbar .ui-field {
  flex: 1 1 auto;
  min-width: 80px;
}
.gj-scene-workspace .studio-scene-toolbar > .ui-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
}
@media (max-width: 720px) {
  .gj-scene-workspace .studio-scene-toolbar {
    padding: 6px 10px;
    gap: 6px 8px;
  }
  .gj-scene-workspace .studio-scene-toolbar > .event-field-group {
    flex: 1 1 200px;
    max-width: none;
    gap: 8px;
  }
}

/* Keep global actions together on the right, with a common control height. */
.gj-scene-workspace .event-header > .studio-categories {
  margin-left: auto;
}
.gj-scene-workspace .event-header > .storage-chip {
  margin-left: 0;
  gap: 2px;
}
.gj-scene-workspace .event-header > .ui-button,
.gj-scene-workspace .event-header .ui-tabs > .ui-button {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 5px 12px;
}
.gj-scene-workspace .event-header .studio-account-identity {
  line-height: 14px;
}
.gj-scene-workspace .event-header .studio-sync-label {
  line-height: 12px;
}
@media (max-width: 720px) {
  .gj-scene-workspace .event-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .gj-scene-workspace .event-header > .studio-categories {
    grid-column: 1;
    grid-row: 2;
    margin-left: 0;
  }
  .gj-scene-workspace .event-header > .storage-chip {
    grid-column: 2;
    grid-row: 2;
  }
  .gj-scene-workspace .event-header > button:last-child {
    grid-column: 3;
    grid-row: 2;
  }
}

/* Shared scene-library views keep account and save state in their first header row. */
.lib-tabs > .library-account-status {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 40px;
  margin: 0 0 0 8px;
  padding: 5px 10px;
  min-width: 0;
  max-width: min(300px, 30vw);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.lib-tabs > .library-account-status .studio-account-identity {
  line-height: 14px;
}
.lib-tabs > .library-account-status .studio-sync-label {
  line-height: 12px;
}
.lib-tabs > button {
  box-sizing: border-box;
  min-height: 40px;
  height: 40px;
}
@media (max-width: 720px) {
  .lib-tabs {
    padding: 8px 10px;
  }
  .lib-tabs > .library-account-status {
    order: -2;
    flex: 1 1 calc(100% - 48px);
    max-width: none;
    margin-left: 0;
  }
  .lib-tabs > .lib-tabs-close {
    order: -1;
    margin-left: 0;
  }
  .lib-tabs > .lib-tabs-gap {
    display: none;
  }
}
/* Studio: live program shift (Řízení + Console) */
.program-control-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.program-control-tools button {
  min-height: 44px;
  min-width: 72px;
}
.program-control-state {
  font-weight: 600;
}
.program-control-sets {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}
.program-control-sets li {
  display: grid;
  grid-template-columns: 3.5em 1fr 44px 44px;
  align-items: center;
  gap: 6px;
}
.program-control-sets button {
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}
#console-program-control {
  margin-top: 12px;
}
/* Řízení: what plays behind Studio */
.gj-scene-workspace .event-now-thumb {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}
.gj-scene-workspace #event-watch {
  justify-self: start;
  margin-top: 6px;
}
/* Evening cockpit (Studio › Řízení right column and Console) */
.gj-scene-workspace .event-show-grid:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.3fr) minmax(280px, 360px);
  grid-template-areas: 'event stage cockpit';
  gap: 24px;
  align-items: start;
}
.gj-scene-workspace .event-show-main {
  grid-area: event;
  min-width: 0;
}
.gj-scene-workspace .event-show-stage {
  grid-area: stage;
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.gj-scene-workspace .event-show-stage .event-now {
  max-width: none;
  margin: 0;
}
.gj-scene-workspace .event-show-stage .event-now-preview {
  max-width: none;
}
.gj-scene-workspace #event-cockpit {
  grid-area: cockpit;
}
@media (max-width: 1240px) {
  .gj-scene-workspace .event-show-grid:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    grid-template-areas: 'stage cockpit' 'event cockpit';
  }
}
@media (max-width: 900px) {
  .gj-scene-workspace .event-show-grid:not([hidden]) {
    grid-template-columns: 1fr;
    grid-template-areas: 'stage' 'event' 'cockpit';
  }
  .gj-scene-workspace .event-show-stage {
    position: static;
  }
}
.cockpit {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #ffffff1c;
  border-radius: 12px;
  background: #ffffff08;
  position: sticky;
  top: 0;
}
.cockpit-row,
.cockpit-rhythm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.cockpit-row > b,
.cockpit-rhythm > b,
.cockpit-filter > b {
  flex-basis: 100%;
  font-size: 13px;
}
.cockpit-state[data-level='ok'] {
  color: var(--accent, #c8ff54);
}
.cockpit-state[data-level='warn'] {
  color: #ffb547;
}
.cockpit-state[data-level='off'] {
  opacity: 0.65;
}
.cockpit-button {
  min-height: 40px;
}
.cockpit-button[aria-pressed='true'] {
  border-color: var(--accent, #c8ff54);
  color: var(--accent, #c8ff54);
}
.cockpit-meter {
  display: flex;
  flex-basis: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
}
.cockpit-meter i {
  display: block;
  transition: flex-grow 0.3s;
}
.cockpit-meter .is-melody {
  background: #8fb6ff;
}
.cockpit-meter .is-rhythm {
  background: #ff8f6b;
}
.cockpit-filter {
  display: grid;
  gap: 8px;
}
.cockpit-note {
  opacity: 0.7;
}
#console-cockpit {
  margin-top: 12px;
  position: static;
}
.gj-scene-workspace .event-now-preview {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}
/* cockpit: a coloured dot says OK / attention / off at a glance */
.cockpit-state[data-level]::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
  background: #ffffff40;
}
.cockpit-state[data-level='ok']::before {
  background: var(--accent, #c8ff54);
}
.cockpit-state[data-level='warn']::before {
  background: #ffb547;
}
.cockpit-state[data-level='warn'] {
  font-weight: 600;
}
.gj-scene-workspace .event-now-stage {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.gj-scene-workspace .event-now-stage .event-now-preview {
  display: block;
  border-radius: 0;
}
.gj-scene-workspace .event-now-camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

/* compact cockpit: status chips in rows, short labels, filters side by side */
.cockpit.is-compact {
  position: static;
  gap: 6px 14px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
}
.cockpit.is-compact .cockpit-row,
.cockpit.is-compact .cockpit-rhythm {
  flex-wrap: nowrap;
  gap: 6px;
}
.cockpit.is-compact .cockpit-row > b,
.cockpit.is-compact .cockpit-rhythm > b {
  flex-basis: auto;
  font-size: 12px;
  opacity: 0.7;
}
.cockpit.is-compact .cockpit-button {
  min-height: 30px;
  padding: 2px 8px;
  font-size: 12px;
}
.cockpit.is-compact .cockpit-meter {
  flex: 0 0 70px;
  height: 6px;
}
.cockpit.is-compact .cockpit-ratio {
  display: none;
}
.cockpit.is-compact .cockpit-filter {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 14px;
}
.cockpit.is-compact .cockpit-filter > b,
.cockpit.is-compact .cockpit-filter > .cockpit-note,
.cockpit.is-compact .property-band,
.cockpit.is-compact .property-ends {
  display: none;
}
.cockpit.is-compact .property-control {
  padding: 2px 0;
}
.cockpit.is-compact .property-head {
  gap: 6px;
}
.cockpit.is-compact .property-head label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cockpit.is-compact .property-all {
  min-height: 26px !important;
  padding: 0 8px;
  font-size: 11px;
}
.cockpit.is-compact .property-number {
  width: 44px;
  min-width: 44px;
  padding: 2px !important;
  font-size: 11px;
}
.cockpit.is-compact .property-control input[type='range'] {
  margin: 4px 0 0;
}
@media (max-width: 900px) {
  #live-board .live-board-header {
    grid-template-columns: minmax(0, 1fr);
  }
  #live-board .live-board-header > *,
  #live-board .live-board-header > #console-preview {
    grid-column: 1;
    grid-row: auto;
  }
  .cockpit.is-compact .cockpit-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#live-board .live-branch-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  margin: 0;
  gap: 6px;
}
#live-board .cockpit.is-compact button {
  min-height: 30px;
}
#live-board .cockpit.is-compact .property-control.has-ignore .property-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
#live-board .cockpit.is-compact .property-head label {
  flex: 1;
  min-width: 0;
}
#live-board .cockpit.is-compact .property-number {
  order: 1;
}
#live-board .cockpit.is-compact .property-all {
  order: 2;
}
#live-board .live-board-header {
  padding-top: 12px;
}
/* Console: no hardness range; branches sit in one row above the scenes */
#live-board #live-board-range {
  display: none !important;
}
#live-board .live-board-content > #live-board-branches {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 28px;
  background: #101217;
  border-bottom: 1px solid var(--line);
}

/* ===== Console islands ===== */
#live-board .live-board-header {
  display: block;
  max-height: none;
  padding: 12px 24px 14px;
}
#live-board .ghostjockey-console-preview,
#live-board .gj-scroll-note {
  display: none !important;
}
.console-islands {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) minmax(190px, 0.8fr) minmax(240px, 1fr) minmax(250px, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 10px;
}
.console-island {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff06;
  min-width: 0;
  font-size: 13px;
}
.console-island-title {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
#console-preview {
  border-radius: 12px;
  align-self: start;
}
/* what plays: label above value, one per line, fixed rows */
.console-now .console-monitor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.console-now .console-monitor > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.console-now .console-monitor small {
  font-size: 11px;
  color: var(--muted);
}
.console-now .console-monitor strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.console-now .console-monitor progress {
  width: 100%;
  height: 4px;
}
.console-now .console-program {
  font-size: 12px;
  margin: 0;
}
/* state rows: label, status with a dot, actions; text never pushes the layout */
.console-state .cockpit-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 4px 8px;
  flex-wrap: nowrap;
}
.console-state .cockpit-row > b {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  opacity: 1;
}
.console-state .cockpit-state {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
.console-state .cockpit-row > button {
  grid-column: 2;
  justify-self: start;
}
.console-state .cockpit-row > button + button {
  margin-top: -4px;
}
#live-board .console-island button {
  min-height: 30px;
  padding: 2px 10px;
  font-size: 12px;
}
/* detection: BPM + section, flashing lamps, phrase position, mode and phrase start */
.console-detect-head,
.console-detect-foot,
.console-detect-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.console-detect-head .cockpit-state {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.console-detect-foot .cockpit-state {
  font-size: 12px;
  white-space: nowrap;
}
.cockpit-section {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}
.cockpit-section[data-section='drop'] {
  border-color: #ff5277;
  color: #ff5277;
}
.cockpit-section[data-section='break'] {
  border-color: #4dc3ff;
  color: #4dc3ff;
}
.cockpit-section[data-section='quiet'] {
  opacity: 0.6;
}
.cockpit-lights {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}
.cockpit-lamp {
  --lamp: #c9d1de;
  padding: 6px 0;
  border-radius: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff80;
  background: #ffffff0a;
  border: 1px solid #ffffff14;
}
.cockpit-lamp.is-kick { --lamp: #ff5277; }
.cockpit-lamp.is-snare { --lamp: #4dc3ff; }
.cockpit-lamp.is-sub { --lamp: #a77bff; }
.cockpit-lamp.is-hat { --lamp: #c9d1de; }
.cockpit-lamp.is-beat { --lamp: #3ddc97; }
.cockpit-lamp.is-down { --lamp: #ffb020; }
.cockpit-lamp.is-hit {
  animation: cockpit-lamp 0.35s ease-out;
}
@keyframes cockpit-lamp {
  from {
    background: var(--lamp);
    color: #0b0c10;
    border-color: var(--lamp);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cockpit-lamp.is-hit {
    animation-duration: 0.15s;
  }
}
.console-detect-actions .cockpit-row {
  display: flex;
  gap: 4px;
}
.console-detect-actions .cockpit-row > b {
  display: none;
}
/* scene panel: filters in one row, branches in one row, then the gallery */
.console-scenes {
  display: grid;
  gap: 10px;
  margin: 14px 24px 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff06;
}
.console-scenes .console-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 18px;
}
.console-scenes .console-filter > b,
.console-scenes .console-filter > .cockpit-note,
.console-scenes .property-band,
.console-scenes .property-ends {
  display: none;
}
.console-scenes .property-control {
  padding: 0;
}
.console-scenes .property-control.has-ignore .property-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.console-scenes .property-head label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.console-scenes .property-number {
  order: 1;
  width: 44px;
  min-width: 44px;
  padding: 2px !important;
  font-size: 11px;
}
#live-board .console-scenes .property-all {
  order: 2;
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}
.console-scenes .property-control input[type='range'] {
  margin: 4px 0 0;
}
#live-board .console-scenes #live-board-branches {
  position: static;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}
.console-finder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
#live-board .live-board-search {
  flex: 0 0 220px;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
}
#live-board .live-board-search:not(:placeholder-shown) {
  border-color: var(--acid);
}
@media (max-width: 700px) {
  .console-finder {
    flex-direction: column;
    align-items: stretch;
  }
  #live-board .live-board-search {
    flex-basis: auto;
  }
}
@media (max-width: 1200px) {
  .console-islands {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .console-islands,
  .console-scenes .console-filter {
    grid-template-columns: minmax(0, 1fr);
  }
}
.cockpit[hidden] {
  display: none !important;
}
.console-islands > #console-preview {
  min-width: 0;
  width: 100%;
}
.console-islands > #console-preview video {
  max-width: 100%;
}
.console-state .cockpit-row {
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: start;
}
.console-row-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
}
.console-row-body > .cockpit-state {
  flex: 1 1 100%;
}
.console-state .cockpit-row > b {
  padding-top: 1px;
}
/* islands keep their own content height; nothing stretches with the preview */
.console-islands {
  align-items: start;
}
.console-islands > #console-preview {
  aspect-ratio: 16 / 9;
  height: auto;
}
.cockpit-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.cockpit-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cockpit-preview-camera {
  opacity: 0;
  pointer-events: none;
}
/* Console: smaller preview; every island exactly as tall as the preview (content never sets the height) */
.console-islands {
  grid-template-columns:
    minmax(260px, 1.07fr) minmax(250px, 1fr) minmax(240px, 1fr) minmax(250px, 1fr);
  align-items: stretch;
}
.console-islands > #console-preview {
  align-self: start;
}
.console-islands > .console-island {
  contain: size;
  overflow: auto;
  scrollbar-width: thin;
}
.console-now {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.console-now .console-tx-manual {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-top: 6px;
  font-size: 11px;
  text-align: center;
}
.console-now .console-tx-manual select {
  max-width: 120px;
  font: inherit;
  font-size: 11px;
}
.console-now .console-pace {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 11px;
  text-align: center;
}
@media (max-width: 1200px) {
  .console-islands > .console-island {
    contain: none;
  }
}
/* Console header: who drives the show and which scene selection is active */
#live-board #live-board-status {
  display: none;
}
#live-board .live-board-bar {
  align-items: center;
}
.console-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  margin-left: 20px;
  min-width: 0;
}
.console-mode-badge {
  --mode: var(--acid, #c8ff54);
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--mode);
  color: var(--mode);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.console-mode[data-mode='auto'] .console-mode-badge {
  --mode: #4dc3ff;
}
.console-mode[data-mode='event'] .console-mode-badge {
  --mode: #ffb020;
}
.console-mode-source {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
#live-board .console-mode button {
  flex: none;
  min-height: 36px;
  padding: 4px 12px;
  font-size: 13px;
}
@media (max-width: 1200px) {
  .console-mode {
    flex-wrap: wrap;
    margin-left: 0;
  }
}
.console-mode .cockpit-source {
  width: auto;
  max-width: 220px;
  min-height: 36px;
}
.gj-live-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.gj-live-source > span {
  flex-basis: 100%;
  font-weight: 600;
}
.gj-live-source .property-note {
  margin: 0;
}
/* Studio home: four islands (Akce, Výběry scén, Branding, GhostReels) */
.gj-scene-workspace .studio-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}
.gj-scene-workspace .studio-home-section {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff05;
  min-width: 0;
}
.gj-scene-workspace .studio-import-link {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--acid, #c8ff54);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* ten rows, then the list scrolls */
.gj-scene-workspace .studio-document-list.is-long {
  max-height: calc(10 * 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}
.gj-scene-workspace .studio-document-row {
  position: relative;
  display: grid;
}
.gj-scene-workspace .studio-document-row > .studio-document {
  padding-right: 52px;
}
.gj-scene-workspace .studio-document-delete {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  opacity: 0.55;
}
.gj-scene-workspace .studio-document-row:hover .studio-document-delete,
.gj-scene-workspace .studio-document-delete:focus-visible {
  opacity: 1;
}
.gj-scene-workspace .studio-document-delete:hover {
  color: #ff6b6b;
}
@media (hover: none) {
  .gj-scene-workspace .studio-document-delete {
    opacity: 0.8;
  }
}
.studio-confirm {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  gap: 10px;
}
.studio-confirm:not([open]) {
  display: none;
}
.studio-confirm[open] {
  display: grid;
}
.studio-confirm p {
  margin: 0;
  font-weight: 600;
}
.studio-confirm .studio-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* five islands side by side on a wide screen, three or two on a laptop, one on a phone */
.gj-scene-workspace .studio-overview .studio-home-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 1900px;
  gap: 16px;
}
@media (max-width: 1650px) {
  .gj-scene-workspace .studio-overview .studio-home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.gj-scene-workspace .studio-custom-document {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.gj-scene-workspace .studio-custom-thumb {
  flex: 0 0 80px;
  width: 80px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  pointer-events: none;
}
@media (max-width: 1300px) {
  .gj-scene-workspace .studio-overview .studio-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .gj-scene-workspace .studio-overview .studio-home-grid {
    grid-template-columns: 1fr;
  }
}
.gj-scene-workspace .studio-document-list.is-long {
  max-height: calc(10 * 50px);
}
.branding-save-state {
  font-weight: 600;
}
.branding-save-state.is-warning::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ffb547;
}
/* Připravit: four steps at the top */
.gj-scene-workspace .event-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.gj-scene-workspace .event-step-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  min-height: 44px;
}
.gj-scene-workspace .event-step-number {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.gj-scene-workspace .event-step small {
  color: var(--muted);
  font-size: 12px;
}
.gj-scene-workspace .event-step[data-state='done'] .event-step-number {
  background: var(--acid, #c8ff54);
  border-color: var(--acid, #c8ff54);
  color: #0b0c10;
}
.gj-scene-workspace .event-step[data-state='todo'] .event-step-number {
  border-color: #ffb547;
  color: #ffb547;
}
.gj-scene-workspace .event-step[data-state='todo'] small {
  color: #ffb547;
}
/* glossary in Nápověda */
.gj-glossary {
  margin: 12px 0;
}
.gj-glossary summary {
  cursor: pointer;
  font-weight: 600;
}
.gj-glossary dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 10px 0 0;
}
.gj-glossary dt {
  font-weight: 600;
}
.gj-glossary dd {
  margin: 0;
  color: var(--muted);
}
.gj-scene-workspace .studio-document.is-pinned {
  border-color: #c8ff5440;
  background: #c8ff540a;
}

/* Studio: with the gallery closed the layout shows only the form, so its divider tint must not paint side bands */
#event-editor .event-layout:has(> .event-main[hidden]) {
  background: transparent;
}
/* Studio home: the four islands share one height */
.gj-scene-workspace .studio-overview .studio-home-grid {
  align-items: stretch;
}

/* time clashes are marked at the sets themselves */
.studio-set-card.has-clash > summary {
  box-shadow: inset 3px 0 0 #ff6b6b;
}
.event-clash {
  display: block;
  color: #ff9b9b;
  font-size: 12px;
}
.gj-scene-workspace .event-stale {
  flex-wrap: wrap;
}
.event-stale-list {
  flex-basis: 100%;
  margin: 4px 0;
  padding-left: 18px;
  font-size: 13px;
}
.gj-scene-workspace .event-stale > .event-muted {
  flex-basis: 100%;
  margin: 0 0 6px;
}

.studio-restore {
  max-width: min(560px, calc(100vw - 32px));
}
.studio-restore p {
  line-height: 1.5;
}
.studio-restore-facts {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

/* Console FX pads (core/fx-control.js): six big pads, lit in their colour while held */
/* FX strip: its own full-width row under the islands — title, strength knob, then ten pads in one row */
.console-islands > .console-fx {
  grid-column: 1 / -1;
  contain: none;
  overflow: visible;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
}
.console-fx > .fx-auto {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.console-fx > .fx-auto select {
  font: inherit;
  font-size: 12px;
}
#live-board .console-island .fx-pad.fx-auto-hit {
  background: var(--fx-color);
  color: #0a0a0a;
  outline: 2px solid #fff;
}
.console-fx > .console-island-title {
  margin: 0;
}
.console-fx > .fx-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.console-fx > .fx-amount .rotary-knob {
  width: 36px;
  height: 36px;
}
.fx-pads {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
#live-board .console-island .fx-pad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 4px 3px;
  border: 1px solid color-mix(in srgb, var(--fx-color) 55%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--fx-color) 10%, #0c0c10);
  color: #f2f2f2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  touch-action: none;
  user-select: none;
}
.fx-pad kbd {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 9px;
  opacity: 0.55;
}
#live-board .console-island .fx-pad[aria-pressed='true'],
#live-board .console-island .fx-pad:active {
  background: var(--fx-color);
  color: #0a0a0a;
  box-shadow: 0 0 14px color-mix(in srgb, var(--fx-color) 70%, transparent);
}
@media (max-width: 1100px) {
  .console-islands > .console-fx {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .console-fx > .fx-pads {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
