.presentation-main .split-panel {
  height: calc(100vh - 96px);
}

.presentation-main .split-panel:fullscreen,
.presentation-main .split-panel:-webkit-full-screen {
  width: 100%;
  height: 100dvh !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #07111f;
}

.program-header-container {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
}

.program-name-container {
  flex: 1 1 auto;
  min-width: 0;
}

.program-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#recuperarProgramas.bt-folder {
  flex: 0 0 75px;
  margin-left: auto;
}

/* Modo Tira: layout vertical, palco em largura total */
.presentation-main.layout-strip .container {
  max-width: none;
  width: 100%;
}

.split-panel.layout-strip {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}

.split-panel.layout-strip #stage-column {
  width: 100% !important;
  flex: 0 0 auto;
  min-height: 160px;
  max-height: 38vh;
}

/* Reduzir padding do palco em modo Tira */
.split-panel.layout-strip .presentation-stage-header {
  padding: 2px 6px 4px;
}

.split-panel.layout-strip .presentation-wall {
  padding: 4px 6px;
  height: calc(100% - 90px);
}

.split-panel.layout-strip #code-column {
  width: 100% !important;
  flex: 1 1 auto;
  min-height: 320px;
  margin-top: -75px;
}

/* Ocultar barra de galerias em modo Tira - só palco e workspace visíveis */
.split-panel.layout-strip .build-stage-container {
  display: none;
}

.split-panel.layout-strip #presentationBlockly {
  min-height: 300px;
  border-top: none;
}

#stage-column,
#code-column {
  height: 100%;
}

#code-column {
  display: flex;
  flex-direction: column;
}

#presentationBlockly {
  flex: 1;
  min-height: 260px;
  border-top: 1px solid #d7ddea;
}

.presentation-stage-label {
  font-weight: 700;
  color: #22304f;
  font-size: 12px;
  padding: 4px 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.split-panel.layout-strip .presentation-stage-label {
  padding: 2px 6px 0;
}

.presentation-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
  border-bottom: 1px solid #d7ddea;
  background: #fff;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.stage-toolbar input,
.stage-toolbar select {
  border: 1px solid #c7d2ea;
  border-radius: 6px;
  padding: 0 6px;
  height: 28px;
}

.stage-code-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.stage-code-buttons .code-play,
.stage-code-buttons .code-stop,
.stage-code-buttons .code-reload {
  display: block;
  text-indent: -999px;
  overflow: hidden;
  margin: 0;
}

.stage-code-buttons .code-clear-elements {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-left: 6px;
  line-height: 1.4;
  vertical-align: middle;
  background: #c62828;
  color: #fff;
  border: 1px solid #8e1b1b;
}

.stage-code-buttons .code-clear-elements:hover {
  background: #8e1b1b;
}

.stage-code-buttons .is-disabled,
.stage-code-buttons .button-disabled {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.2);
  cursor: default;
}

.presentation-wall {
  position: relative;
  height: calc(100% - 110px);
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
  overflow: auto;
  background: #eef1f7;
}

.presentation-wall.is-fullscreen-mode {
  padding: 0;
  overflow: hidden;
  background: #07111f;
}

.presentation-wall.is-fullscreen-mode .station-wall {
  display: none;
}

.station-wall {
  display: grid;
  grid-template-columns: repeat(40, 168px);
  gap: 8px;
  min-width: max-content;
  position: relative;
  z-index: 1;
}

.station-wall.grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  min-width: 100%;
}

.station-cell {
  border: 2px solid #26354e;
  border-radius: 8px;
  background: #fff;
  height: 110px;
  position: relative;
  overflow: hidden;
}

.station-cell.local {
  border-color: #2f66f4;
}

.station-screen {
  width: 100%;
  height: 100%;
  position: relative;
}

.station-preview-actor {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

.station-preview-actor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.station-preview-url {
  z-index: 2;
}

.station-screen img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.station-screen img.station-bg {
  object-fit: cover;
  z-index: 1;
}

.station-screen img.station-element {
  object-fit: contain;
  z-index: 2;
}

.station-text {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px;
  text-align: center;
  font-weight: 700;
  line-height: 1.15;
  z-index: 3;
  pointer-events: none;
  box-sizing: border-box;
}

.badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: #ef8c2f;
  color: #fff;
  border-radius: 12px;
  font-size: 11px;
  padding: 2px 6px;
}

.pl-fullscreen-viewport {
  display: none;
  position: absolute;
  inset: 0;
}

.presentation-wall.is-fullscreen-mode .pl-fullscreen-viewport {
  display: block;
}

.split-panel.network-fullscreen {
  display: block;
}

.split-panel.network-fullscreen #stage-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: none;
}

.split-panel.network-fullscreen #stage-column .stage-container {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.split-panel.network-fullscreen .presentation-wall {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.split-panel:fullscreen #stage-column,
.split-panel:fullscreen .stage-container,
.split-panel:fullscreen .presentation-wall,
.split-panel:-webkit-full-screen #stage-column,
.split-panel:-webkit-full-screen .stage-container,
.split-panel:-webkit-full-screen .presentation-wall {
  height: 100%;
  min-height: 0;
}

.presentation-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-top: 1px solid #d7ddea;
  font-size: 12px;
  background: #fff;
}

.status-pill {
  font-weight: 700;
  color: #294a9f;
}

.footer-status-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.status-details {
  color: #4f5f82;
  line-height: 1.4;
  word-break: break-word;
}

.split-panel.layout-strip .presentation-footer {
  padding: 6px;
}

.presentation-name-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.presentation-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.presentation-inline {
  display: block;
  flex: 1;
  min-width: 250px;
  font-size: 13px;
  font-weight: 600;
  color: #22304f;
  margin-bottom: 6px;
}

.presentation-inline input.form-control {
  margin-top: 4px;
  font-weight: 400;
}

.presentation-secondary-actions {
  margin-top: 18px;
}

.presentation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.presentation-grid.scenery {
  max-height: 520px;
}

.presentation-grid.colors {
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
}

.presentation-grid.actors {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  max-height: 560px;
  position: relative;
}

.presentation-grid.elementos {
  max-height: 600px;
}

.presentation-choice {
  border: 1px solid #d4dbe9;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  text-align: center;
  cursor: pointer;
  font-size: 11px;
}

.presentation-choice:hover {
  border-color: #8eaaff;
  background: #f4f7ff;
}

.presentation-choice img {
  width: 100%;
  height: 52px;
  object-fit: contain;
}

.presentation-choice.color {
  height: 44px;
  padding: 0;
}

.presentation-choice.active {
  border-color: #2f66f4;
  box-shadow: inset 0 0 0 2px rgba(47, 102, 244, 0.25);
}

.actor-main {
  border: 2px solid #d4dbe9;
}

.actor-main.active {
  border-color: #2f66f4;
  background: #eef3ff;
}

.element-main {
  border: 2px solid #d4dbe9;
}

.element-main.active {
  border-color: #2f66f4;
  background: #eef3ff;
}

.actor-poses-popup {
  position: absolute;
  z-index: 9999;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid #c7d2ea;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(34, 48, 79, 0.18), 0 1px 4px rgba(34, 48, 79, 0.10);
  width: 220px;
}

.actor-poses-popup::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #c7d2ea;
  border-top: 1px solid #c7d2ea;
  transform: rotate(45deg);
}

.element-size-popup {
  position: absolute;
  z-index: 9999;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid #c7d2ea;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(34, 48, 79, 0.18), 0 1px 4px rgba(34, 48, 79, 0.10);
  width: 180px;
}

.element-size-popup::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #c7d2ea;
  border-top: 1px solid #c7d2ea;
  transform: rotate(45deg);
}

.pose-choice {
  padding: 2px;
  font-size: 10px;
}

.pose-choice img {
  height: 40px;
}

.element-size-choice {
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 700;
}

/* --- Setup / Preparar --- */
.stage-code-buttons .code-setup,
.stage-code-buttons .code-cancel-setup {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-left: 6px;
  line-height: 1.4;
  vertical-align: middle;
}

.stage-code-buttons .code-setup {
  background: #f57c00;
  color: #fff;
  border: 1px solid #e56800;
}

.stage-code-buttons .code-setup:hover {
  background: #e56800;
}

.stage-code-buttons .code-cancel-setup {
  background: #d32f2f;
  color: #fff;
  border: 1px solid #b71c1c;
}

.stage-code-buttons .code-cancel-setup:hover {
  background: #b71c1c;
}

/* --- Apresentar (rede) --- */
.stage-code-buttons .code-present,
.stage-code-buttons .code-present {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-left: 6px;
  line-height: 1.4;
  vertical-align: middle;
  background: #2e7d32;
  color: #fff;
  border: 1px solid #1b5e20;
  box-shadow: 0 1px 4px rgba(46, 125, 50, .35);
}

.stage-code-buttons .code-present:hover,
.stage-code-buttons .code-present:hover {
  background: #1b5e20;
}

/* --- Voltar ao preview --- */
.stage-code-buttons .code-exit-network {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-left: 6px;
  line-height: 1.4;
  vertical-align: middle;
  background: #546e7a;
  color: #fff;
  border: 1px solid #37474f;
}

.stage-code-buttons .code-exit-network:hover {
  background: #37474f;
}

/* Station setup overlays */
.station-setup-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.3s ease;
}

.station-setup-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.station-overlay-absent {
  background: rgba(211, 47, 47, 0.85);
}

.station-overlay-absent .station-setup-text {
  color: #fff;
}

.station-overlay-loading {
  background: rgba(255, 193, 7, 0.85);
}

.station-overlay-loading .station-setup-text {
  color: #333;
}

.station-overlay-ready {
  background: rgba(46, 125, 50, 0.85);
}

.station-overlay-ready .station-setup-text {
  color: #fff;
}

.station-overlay-timeout {
  background: rgba(239, 108, 0, 0.9);
}

.station-overlay-timeout .station-setup-text {
  color: #fff;
}
