/* Main console density, kept separate from shared dialogs and scene galleries.
   One size per input method: compact mouse controls, full-size touch targets. */
body > header.chrome,
body > footer.chrome {
  --gj-control-height: 32px;
  --gj-control-padding: 6px 9px;
}
body > header.chrome {
  gap: 16px;
  padding: 12px 24px;
}
body > header.chrome .brand {
  font-size: 26px;
  letter-spacing: -1.5px;
}
body > header.chrome .edition {
  padding-left: 16px;
}
body > header.chrome .top-actions {
  gap: 6px;
}
body > header.chrome .top-actions > #fps {
  margin-right: 4px;
}
body > header.chrome .top-actions :is(button, select),
footer.chrome .transport button:not(.rotary-knob),
footer.chrome .deck #camera,
footer.chrome .deck button:not(.section-link) {
  min-height: var(--gj-control-height);
  padding: var(--gj-control-padding);
  font-size: 12px;
  line-height: 1.2;
  border-radius: 7px;
}
body > header.chrome .top-actions #language {
  padding-inline: 6px;
}
footer.chrome .transport {
  gap: 8px;
  margin-bottom: 10px;
}
footer.chrome :is(.transport-left, .transport-right) {
  gap: 6px;
}
footer.chrome .transport :is(#prev, #pause) {
  min-width: 32px;
}
footer.chrome .transport #prev {
  font-size: 18px;
}
footer.chrome .transport .separator {
  margin-inline: 3px;
}
footer.chrome #library-toggle b {
  margin-left: 6px;
}
footer.chrome .deck {
  padding: 12px 0;
}
footer.chrome .deck-section {
  padding-inline: 16px;
}
footer.chrome .section-label {
  margin-bottom: 8px;
}
footer.chrome .section-link {
  min-height: 28px;
  padding-block: 4px;
}
footer.chrome .secondary-button {
  margin-top: 6px;
}
footer.chrome :is(.gain-row, .rhythm-row) {
  margin-top: 10px;
}
footer.chrome .meter {
  margin-top: 8px;
}
footer.chrome .camera-uses {
  margin: 6px 0;
}
footer.chrome .camera-uses .check-row {
  min-height: 26px;
}
footer.chrome .camera-shot-buttons button {
  font-size: 11px;
}
footer.chrome .bottom-line {
  padding-block: 10px;
  gap: 6px 12px;
}
footer.chrome #gj-file-player {
  margin-bottom: 10px;
}
.simple-ui #play-bar {
  gap: 6px 10px;
  padding: 5px 8px;
  border-radius: 12px;
}
#play-bar button:not(.rotary-knob) {
  padding: 6px 9px;
  border-radius: 7px;
}
@media (max-width: 1500px), (max-height: 800px) {
  body:not(.hidden-ui):not(.simple-ui) > main.chrome {
    margin-block: 16px 28px;
  }
}
@media (min-width: 601px) and (max-width: 1000px) {
  footer.chrome .camera-section {
    margin-top: 12px;
    padding-top: 12px;
  }
}
@media (max-width: 600px) {
  body > header.chrome {
    padding: max(10px, env(safe-area-inset-top)) 12px 0;
    gap: 8px;
  }
  footer.chrome .deck {
    padding: 0 12px;
  }
  footer.chrome .deck-section {
    padding: 12px 0;
  }
  footer.chrome #auto-setup-open {
    grid-column: 1 / -1;
  }
}
@media (pointer: coarse), (max-width: 1000px) {
  body > header.chrome,
  body > footer.chrome {
    --gj-control-height: 44px;
  }
  footer.chrome .section-link,
  footer.chrome .camera-uses .check-row {
    min-height: 44px;
  }
  footer.chrome .transport :is(#prev, #pause) {
    min-width: 44px;
  }
}

/* The full cockpit starts with the actual compact toolbar, not a second copy. */
body:not(.simple-ui):not(.hidden-ui) footer.chrome > #play-bar {
  display: flex;
  position: relative;
  inset: auto;
  transform: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}
footer.chrome > #play-bar .pb-actions {
  margin-left: auto;
}
footer.chrome > #play-bar .pb-actions > :last-child {
  display: none;
}
/* Retain legacy entry points for keyboard, Remote and existing integrations. */
footer.chrome .transport :is(#gj-live, #auto, #live-board-open, #remote-open),
#track-toggle[hidden] {
  display: none;
}
/* Width:100% on responsive transport buttons used to stretch round controls. */
.rotary-control > button.rotary-knob,
#play-bar .pb-input-gain > button.rotary-knob {
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
}
.gj-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  vertical-align: -0.22em;
  pointer-events: none;
}
@media (pointer: coarse), (max-width: 1000px) {
  #play-bar button:not(.rotary-knob) {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  body:not(.simple-ui):not(.hidden-ui) footer.chrome > #play-bar {
    padding-inline: 12px;
  }
  footer.chrome > #play-bar .pb-actions {
    margin-left: 0;
  }
  footer.chrome .transport-left {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  footer.chrome .transport-left > button {
    width: auto;
  }
  footer.chrome .transport-left > #auto-setup-open {
    flex: 1 1 100%;
  }
}

@media (pointer: coarse), (max-width: 1000px) {
  footer.chrome .transport #random {
    min-width: 44px;
  }
}
button > .gj-icon + span {
  margin-inline-start: 4px;
}
/* Product entry points: Free has a selection editor; the developer library is G-only. */
#library-toggle[hidden],
.welcome-intent[hidden] {
  display: none !important;
}
.gj-selection-source {
  display: grid;
  gap: 8px;
}
.gj-selection-source > p {
  margin: 0;
}
.gj-selection-note {
  margin: 0;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--muted);
}
.gj-quick-selection > .event-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.gj-quick-selection .event-gallery-workspace {
  height: 100%;
}
.gj-quick-selection .event-footer .ui-status {
  flex: 1;
}
@media (max-width: 600px) {
  .gj-quick-selection .event-footer {
    flex-wrap: wrap;
  }
  .gj-quick-selection .event-footer .ui-status {
    flex-basis: 100%;
  }
  .settings-tabs {
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
    scrollbar-color: var(--acid) #171a21;
    padding-bottom: 6px;
  }
  .settings-tabs::-webkit-scrollbar {
    height: 5px;
  }
  .settings-tabs::-webkit-scrollbar-thumb {
    background: var(--acid);
    border-radius: 3px;
  }
}
/* Keep the library's close action anchored even in the G-only developer view. */
.lib-tabs {
  position: relative;
  padding-inline-end: 54px;
}
.lib-tabs .lib-tabs-close {
  position: absolute;
  right: 8px;
  top: 8px;
  min-width: 44px;
  min-height: 44px;
}
.gj-settings-topic {
  display: none;
}
.gj-selection-advanced {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.gj-selection-advanced select {
  width: 100%;
  margin-block: 4px;
}
.gj-selection-advanced summary {
  cursor: pointer;
  padding: 8px;
}
@media (max-width: 600px) {
  .gj-settings-topic {
    display: grid;
    gap: 6px;
  }
  #settings-dialog .settings-tabs {
    display: none;
  }
}
.gj-gallery-detail {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.gj-gallery-detail p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
/* This editor has no Studio tab row: its heading and close button fit on one line. */
.gj-quick-selection .event-header {
  flex-wrap: nowrap;
  align-items: center;
  min-height: 48px;
}
.gj-quick-selection .event-header h2 {
  flex: 1 1 auto;
}
#identity-open {
  display: none;
}

.gj-scene-workspace .event-catalog-item {
  position: relative;
  min-width: 0;
}
.gj-scene-workspace .event-catalog-item .event-catalog-card {
  width: 100%;
  height: 100%;
}
.gj-scene-workspace .event-card-info {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
}

/* Live values must never resize or reflow the floating operator toolbar. */
.simple-ui:not(.hidden-ui) #play-bar {
  box-sizing: border-box;
  width: min(1260px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 10px;
}
.simple-ui #play-bar .pb-status {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: 28px 16px;
  gap: 0 6px;
  min-width: 0;
  height: 44px;
}
.simple-ui #play-bar .pb-input-gain {
  grid-row: 1 / 3;
}
.simple-ui #play-bar .pb-status > button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 28px;
  padding: 3px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
/* With no secondary status, center the input label against the full knob height. */
.simple-ui #play-bar .pb-status:not(:has(.gj-input-details > :not([hidden]))) > button {
  grid-row: 1 / 3;
  align-self: center;
}
.gj-input-details {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.simple-ui #play-bar .gj-input-details {
  grid-column: 2;
  grid-row: 2;
  height: 16px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11px;
}
.simple-ui #play-bar .pb-track {
  flex: 1;
  min-width: 0;
  font-size: inherit;
}
.simple-ui #play-bar .pb-actions {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr 0.9fr 1.1fr 0.5fr 1fr 0.8fr;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.simple-ui #play-bar .pb-actions > button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding-inline: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 1000px) {
  .simple-ui #play-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .simple-ui #play-bar .pb-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* D diagnostics can be arranged without changing the projection or canvas resolution. */
.gj-debug-window {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: min(240px, calc(100vw - 16px));
  min-height: min(120px, calc(100dvh - 16px));
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  resize: both;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090b10ed;
  color: var(--text);
}
.gj-debug-window[hidden] {
  display: none;
}
.gj-debug-window-head {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.4;
  cursor: move;
  touch-action: none;
  user-select: none;
  border-bottom: 1px solid var(--line);
}
.gj-debug-window-head:focus-visible {
  outline: 1px solid var(--acid);
  outline-offset: -2px;
}
.gj-debug-window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.gj-debug-window-body > canvas:is(#rhythm-debug, #mid-debug, #character-debug) {
  display: block;
  position: static;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
}
.gj-debug-window-body > #performance-debug {
  width: 100%;
  max-width: none;
  background: transparent;
}

.gj-debug-window-body > #check-overlay {
  position: static;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}
.gj-debug-window-body > #check-overlay canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Header actions need their own contrast over bright scene imagery. */
body > header.chrome .top-actions :is(button, select),
body > header.chrome .top-actions #language {
  background-color: rgb(7 8 11 / 70%);
  border-color: rgb(255 255 255 / 28%);
}
body > header.chrome .top-actions :is(button, select):hover,
body > header.chrome .top-actions #language:hover {
  background-color: rgb(7 8 11 / 90%);
}

/* The play bar gained buttons (identity, selection, event control): columns adapt to however many are shown,
   and a label never breaks letter by letter. */
.simple-ui #play-bar .pb-actions {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}
.simple-ui #play-bar .pb-actions > button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
@media (max-width: 600px) {
  .simple-ui #play-bar .pb-actions {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }
}

/* Readability floor: no label under 12 px (audit 2026-11-13). Uppercase eyebrows keep their tracking. */
.scene-info .eyebrow,
.scene-info .eyebrow span,
.scene-tags span,
.signal .eyebrow,
.signal .tempo small,
.signal .drop-status,
.signal .signal-note,
.deck-section .section-label,
.deck-section .section-label span,
.deck-section .section-link,
.gain-row label,
.gain-row output,
.rhythm-row .bpm-input,
.top-actions > #fps,
.rotary-control > span,
.rotary-control > output,
.account-connection .studio-sync-label,
.chrome kbd {
  font-size: 12px;
}
.bottom-line,
.bottom-line span,
.bottom-line i,
.bottom-line a,
.bottom-line button,
.bottom-line #engine-status b {
  font-size: 12px;
}

/* DJ Link indicator (core/deck-link-badge.js): bottom bar, Console header, title bar of the check windows */
.dl-badge,
#play-bar button.dl-badge,
#live-board .live-board-bar button.dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  min-height: 24px;
  padding: 2px 8px;
  font: 700 11px/1 'Space Grotesk', Manrope, sans-serif;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: #0b0c0e;
  background: #c8ff54;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: default;
}
.dl-badge[hidden],
.dl-replaced {
  display: none !important;
}
/* the states need the same weight as the bar/Console rules above, otherwise "off" stayed green there */
.dl-badge[data-state='wait'],
#play-bar button.dl-badge[data-state='wait'],
#live-board .live-board-bar button.dl-badge[data-state='wait'] {
  background: #ffb547;
}
.dl-badge[data-state='demo'],
#play-bar button.dl-badge[data-state='demo'],
#live-board .live-board-bar button.dl-badge[data-state='demo'] {
  background: #8fd3ff;
}
/* switched off: plainly grey, no fill, struck through */
.dl-badge[data-state='off'],
#play-bar button.dl-badge[data-state='off'],
#live-board .live-board-bar button.dl-badge[data-state='off'] {
  color: #8a8d94;
  background: #ffffff0a;
  border-color: #ffffff24;
  cursor: pointer;
}
.dl-badge[data-state='off'] span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.gj-debug-window-head .dl-badge {
  margin-left: 10px;
  vertical-align: middle;
}
#live-board .live-board-bar > div > .dl-badge {
  margin-top: 4px;
}
#live-board .live-board-bar > div > .dl-badge {
  margin-left: 6px;
}

/* Gallery: one line on what the window is for, with a link to the scene selection */
.library-what {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.library-what button {
  padding: 0;
  min-height: 0;
  font: inherit;
  color: var(--acid);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}
.console-mode-source {
  white-space: nowrap;
}
/* Phone: the status row sits above the buttons (three per row) instead of beside a tall column,
   and the scene name moves right of the logo instead of under it. */
@media (max-width: 1000px) {
  .simple-ui:not(.hidden-ui) #play-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  #play-scene-name {
    top: calc(22px + env(safe-area-inset-top));
    left: auto;
    right: 12px;
    transform: none;
    max-width: calc(100vw - 232px);
    text-align: right;
  }
}
#live-board .console-mode-source {
  flex: none;
  overflow: visible;
}
#live-board .console-mode {
  margin-left: 12px;
  gap: 8px;
}
#live-board .console-mode-badge {
  padding: 6px 9px;
}
#live-board .console-mode {
  margin-left: 4px;
  gap: 6px;
}
#live-board .console-mode button {
  padding: 4px 8px;
}

/* Console tidy-up (2026-11-13): header controls share one height and baseline; the islands, the filter
   panel and the scene groups share one left and right edge; category buttons are one row height. */
#live-board .live-board-bar {
  gap: 8px;
}
#live-board .live-board-bar > button,
#live-board .live-board-bar > select,
#live-board .live-board-bar .console-mode button,
#live-board .live-board-bar .console-mode select,
#live-board .live-board-bar .console-mode-badge {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  margin-block: 0;
}
#live-board .live-board-bar > button,
#live-board .live-board-bar .console-mode button {
  padding: 0 14px;
  font-size: 14px;
}
#live-board .live-board-bar .console-mode-badge {
  display: inline-flex;
  align-items: center;
  padding-block: 0;
}
#live-board .console-islands {
  grid-template-rows: 240px;
}
#live-board .console-scenes {
  margin-inline: 0;
}
#live-board .console-scenes #live-board-branches,
#live-board .console-scenes #live-board-branches .live-branch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  overflow: visible;
}
#live-board .console-scenes #live-board-branches button {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}
#live-board .console-islands {
  margin-inline: 4px;
}
#live-board .console-state {
  gap: 6px;
}
#live-board .console-state .cockpit-row {
  gap: 3px 8px;
}
#live-board .console-state .cockpit-row > button {
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
#live-board .console-state .cockpit-row > button + button {
  margin-top: 0;
}
#live-board .console-islands {
  grid-template-rows: 262px;
}
#live-board .live-board-bar .console-mode button {
  padding: 0 10px;
}
/* state island: the two camera buttons share a line, so nothing is cut off at the bottom */
#live-board .console-state .cockpit-row {
  grid-template-columns: 74px max-content max-content minmax(0, 1fr);
}
#live-board .console-state .cockpit-row > .cockpit-state {
  grid-column: 2 / -1;
}
#live-board .console-state .cockpit-row > button {
  grid-column: auto;
  grid-row: 2;
}
#live-board .console-state .cockpit-row > button:first-of-type {
  grid-column: 2;
}
#live-board .console-state .cockpit-row,
#live-board .console-state .cockpit-row > .cockpit-state {
  min-width: 0;
  max-width: 100%;
}

/* Bottom bar buttons take the width their label needs (long "Jméno a logo", short "Víc") and share the
   rest, instead of equal columns that cut the long labels. Phones keep three per row. */
@media (min-width: 601px) {
  .simple-ui #play-bar .pb-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .simple-ui #play-bar .pb-actions > button {
    flex: 1 1 auto;
    width: auto;
    padding-inline: 12px;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Console: switches for the DJ name and the DJ Link track names over the picture */
#live-board .console-titles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
#live-board .console-titles-cap {
  flex: 1 1 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* "Odkud jde hudba?": the input in use, above the choices */
.wiz-now {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.wiz-now.is-on {
  color: var(--text, #f2f2f2);
  border-color: var(--acid);
}
