/* ========== GLOBAL ========== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050305;
  color: #eaebe4;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5)),
    url("../../assets/img/Wide_3_bg.jpg") center top / contain no-repeat;
  transform: scaleX(-1);
  z-index: -1;
}

/* ========== LAYOUT ========== */

.dash-layout {
  display: flex;
  gap: 0;
  padding: 24px;
  max-width: 1800px;
  margin: 0 auto;
}

.dash-left {
  flex: 0 0 50%;
  min-width: 300px;
  max-width: 70%;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dash-right {
  flex: 1;
  min-width: 300px;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Column Resizer - hidden by default, visible only in edit layout mode */
.column-resizer {
  width: 6px;
  background: transparent;
  cursor: default;
  position: relative;
  flex-shrink: 0;
  border-radius: 3px;
  transition: background 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  opacity: 0;
}

body.edit-layout-mode .column-resizer {
  background: rgba(255, 255, 255, 0.08);
  cursor: col-resize;
  pointer-events: auto;
  opacity: 1;
}

body.edit-layout-mode .column-resizer:hover {
  background: rgba(239, 61, 36, 0.4);
}

.column-resizer.resizing {
  background: rgba(239, 61, 36, 0.6);
}

.column-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.edit-layout-mode .column-resizer::after {
  opacity: 1;
}

/* ========== DRAG & DROP ========== */

.draggable-section {
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.draggable-section .drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: grab;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 100;
  color: rgba(255, 255, 255, 0.5);
}

/* Drag handles only visible in edit layout mode */
body.edit-layout-mode .draggable-section .drag-handle {
  opacity: 1;
  pointer-events: auto;
}

body.edit-layout-mode .draggable-section {
  outline: 2px dashed rgba(239, 61, 36, 0.3);
  outline-offset: -2px;
}

body.edit-layout-mode .draggable-section:hover {
  outline-color: rgba(239, 61, 36, 0.6);
}

.draggable-section .drag-handle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.draggable-section .drag-handle:active {
  cursor: grabbing;
}

.draggable-section.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  z-index: 1000;
}

.draggable-section.drag-over {
  border: 2px dashed rgba(239, 61, 36, 0.6);
  background: rgba(239, 61, 36, 0.05);
}

.drop-placeholder {
  border: 2px dashed rgba(239, 61, 36, 0.5);
  background: rgba(239, 61, 36, 0.08);
  border-radius: 8px;
  min-height: 60px;
  margin: 8px 0;
  transition: all 0.2s ease;
}

/* Kolumny jako drop zones */
.dash-left,
.dash-right {
  min-height: 200px;
  transition: background 0.2s ease;
}

.dash-left.drag-over-column,
.dash-right.drag-over-column {
  background: rgba(239, 61, 36, 0.03);
  border-radius: 12px;
}

/* ========== LEWA KOLUMNA ========== */

/* .dash-left jest zdefiniowane wyżej z flex properties */

/* logo + tytuł */

.dash-logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  min-height: 68px;
}

.dash-logo-block img {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.dash-logo-text {
  display: flex;
  flex-direction: column;
}

.dash-logo-text h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dash-logo-text span {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dash-logo-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-btn-topbar {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 4px 7px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
  margin-left: 4px;
}
.logout-btn-topbar:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.4);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(120, 80, 220, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Montserrat', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  border: 1px solid rgba(120, 80, 220, 0.4);
  margin-left: 4px;
  letter-spacing: 0;
}

.user-avatar:empty {
  display: none;
}

.early-access-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.8;
  font-weight: 500;
}

.dash-logo-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 600;
  opacity: 0.9;
}

.dash-clock-big {
  margin-left: auto;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size: clamp(14px, 3vw, 22px);
  font-weight: 900;
  color: #eaebe4;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
}

.clock-time,
.timer-time {
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 900;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.clock-time.active,
.timer-time.active {
  color: #eaebe4;
  opacity: 1;
}

.clock-time:not(.active),
.timer-time:not(.active) {
  color: #eaebe4;
  opacity: 0.4;
}

.clock-separator {
  opacity: 0.5;
  margin: 0 2px;
}

.clock-mode-buttons {
  margin-left: 8px;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.clock-mode-btn {
  padding: 4px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #eaebe4;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
}

.clock-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.clock-mode-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: #050305;
  border-color: rgba(255, 255, 255, 0.95);
}

.clock-mode-btn:not(.active) {
  opacity: 0.4;
}

/* zegar + countdown */

.dash-clock-wrapper {
  display: flex;
  flex-direction: column;
}

.dash-clock {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.dash-clock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f5f5f5;
}

.dash-clock-row span:last-child {
  font-variant-numeric: tabular-nums;
}

.dash-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 6px 0;
}

.dash-row-buttons {
  display: flex;
  gap: 6px;
}

/* ========== BUG GRID ========== */

.dash-bugs {
  padding: 20px 16px 16px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  min-width: 0;
}

.dash-bugs-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-bugs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Bug Replay row - dropdown + button, both 50% width, locked (no edit controls) */
.dash-bugs-row-locked {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.dash-bugs-row-locked .bug-text-dropdown {
  flex: 1;
  min-width: 0;
  height: 32px;
}

.dash-bugs-row-locked .bug-button {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 32px;
}

/* Bug item wrapper */
.bug-item-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Half width - max 50% so two can fit in one row */
.bug-item-wrapper[data-bug-width="half"] {
  flex: 1 1 calc(50% - 4px);
  max-width: calc(50% - 4px);
  min-width: 0;
}

/* Full width - takes entire row */
.bug-item-wrapper[data-bug-width="full"] {
  flex: 1 1 100%;
  max-width: 100%;
}

.bug-item-wrapper .bug-button {
  flex: 1;
  min-width: 0;
}

/* Bug width toggle button - inline, visible only in edit mode */
.bug-width-btn {
  display: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.bug-width-btn:hover {
  background: rgba(239, 61, 36, 0.2);
  border-color: rgba(239, 61, 36, 0.5);
  color: rgba(239, 61, 36, 0.9);
}

/* Bug remove button - inline, visible only in edit mode */
.bug-remove-btn {
  display: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.bug-remove-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: rgba(220, 38, 38, 0.9);
}

/* Show edit controls in edit mode */
.scene-list-edit-mode .bug-width-btn,
.scene-list-edit-mode .bug-remove-btn {
  display: flex;
}

/* Highlight bugs section in edit mode */
.scene-list-edit-mode .dash-bugs-controls {
  outline: 2px dashed rgba(239, 61, 36, 0.5);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Bug drag & drop */
.bug-item-wrapper {
  cursor: grab;
}

.bug-item-wrapper:active {
  cursor: grabbing;
}

.bug-item-wrapper.dragging {
  opacity: 0.4;
}

.bug-item-wrapper.drag-over {
  outline: 2px dashed rgba(239, 61, 36, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

.bug-text-dropdown {
  width: 100%;
  padding: 6px 10px;
  padding-right: 32px; /* miejsce na strzałkę */
  border-radius: 8px;
  border: 1px solid #262626;
  background: #141414;
  color: #f5f3ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #aaaaaa 50%),
    linear-gradient(135deg, #aaaaaa 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 10px,
    calc(100% - 9px) 10px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.bug-text-dropdown:hover {
  border-color: #3a3a3a;
}

.bug-text-dropdown:focus {
  outline: none;
  border-color: #f08a3c;
  box-shadow: 0 0 0 1px rgba(240,138,60,0.5);
}

.bug-text-dropdown option {
  background: #141414;
  color: #f5f3ff;
  text-transform: uppercase;
}

.dash-bugs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.bug-button {
  /* Styl jak clock-mode-btn/action-btn */
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #eaebe4;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bug-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.bug-button:active {
  transform: translateY(1px);
}

/* Aktywny stan - pomarańczowy jak scene-toggle.active */
.bug-button.active {
  border-color: rgba(239,61,36,0.9);
  color: #000000;
  text-shadow: none;
  background:
    radial-gradient(circle at 0 100%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, #ff8b4a, #ef3d24);
  box-shadow:
    0 0 14px rgba(239,61,36,0.8),
    0 18px 38px rgba(0,0,0,1);
}

.bug-button.active:hover {
  color: #000000;
  text-shadow: none;
  box-shadow:
    0 0 8px rgba(239,61,36,0.6),
    0 14px 30px rgba(0,0,0,1);
}

.bug-button.active * {
  color: #000000;
  text-shadow: none;
}

/* Wyjątek: tekst z odliczaniem czasu zawsze biały z czarnym obramowaniem */
.bug-button.active .duration-timer-text {
  color: #ffffff !important;
  text-shadow: 
    -1px -1px 0 rgba(0, 0, 0, 0.8),
    1px -1px 0 rgba(0, 0, 0, 0.8),
    -1px 1px 0 rgba(0, 0, 0, 0.8),
    1px 1px 0 rgba(0, 0, 0, 0.8),
    0 0 2px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.7) !important;
}

/* Fioletowy stan - aktywna w preview (tak jak scene-toggle.preview-active) */
.bug-button.preview-active {
  border-color: rgba(138, 43, 226, 0.9);
  color: #fff;
  background:
    radial-gradient(circle at 0 100%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(138, 43, 226, 0.6));
  box-shadow:
    0 0 14px rgba(138, 43, 226, 0.8),
    0 18px 38px rgba(0,0,0,1);
}

.bug-button.preview-active:hover {
  box-shadow:
    0 0 8px rgba(138, 43, 226, 0.6),
    0 14px 30px rgba(0,0,0,1);
}

.bug-button-disabled {
  opacity: 0.4;
  cursor: default;
}

.bug-button-disabled:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  transform: none;
}

/* ========== L3 AUTOMATION ========== */

/* L3 Partner buttons - grid z maksymalnie 4 przyciskami w rzędzie */
#l3-partner-buttons-container,
.l3-automation-buttons-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.l3-partner-item {
  /* Grid zarządza pozycjonowaniem, nie potrzebujemy flex ani margin-left */
  min-width: 0;
}

.l3-partner-item .bug-button {
  width: 100%;
  min-width: 0;
  padding: 6px 12px; /* Takie same jak bug technical */
  font-size: 11px; /* Takie same jak bug technical */
  box-sizing: border-box;
  display: flex;
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
}

/* Dla przycisków z DURATION AUTO - szare tło zamiast pomarańczowego */
.l3-partner-item .bug-button.active.duration-auto-active {
  border-color: rgba(255, 255, 255, 0.2);
  color: #000000;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.l3-partner-item .bug-button.active.duration-auto-active:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  color: #000000;
  text-shadow: none;
}

.l3-partner-item .bug-button.active.duration-auto-active * {
  color: #000000;
  text-shadow: none;
}

/* Pomarańczowe wypełnienie dla przycisków z DURATION AUTO - POD tekstem */
.l3-partner-item .bug-button::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, #ff8b4a, #ef3d24);
  opacity: 0;
  pointer-events: none;
  z-index: 1; /* POD tekstem (tekst ma z-index: 10) */
  transform-origin: right center;
  transform: scaleX(0);
  transition: none;
}

.l3-partner-item .bug-button.duration-auto-fill::after {
  opacity: 1;
  transform: scaleX(1);
  transform-origin: right center;
  animation: durationAutoFill var(--duration-ms, 5000ms) linear forwards;
}

@keyframes durationAutoFill {
  0% {
    transform: scaleX(1);
    transform-origin: right center;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right center;
  }
}

/* Upewnij się, że tekst przycisku jest zawsze widoczny na wierzchu */
.l3-partner-item .bug-button {
  position: relative;
  color: #eaebe4;
}

/* Wszystkie elementy wewnątrz przycisku (tekst, ikony) muszą być NAD pomarańczowym wypełnieniem */
.l3-partner-item .bug-button > * {
  position: relative;
  z-index: 10;
}

/* Wszystkie węzły tekstowe i elementy są nad pomarańczowym paskiem */
.l3-partner-item .bug-button * {
  position: relative;
  z-index: 10;
}

/* Specjalny span dla tekstu z czasem - font jak w polu timer, biały z czarnym obramowaniem */
.l3-partner-item .bug-button .duration-timer-text {
  position: relative;
  z-index: 10;
  display: inline-block;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 900;
  color: #ffffff !important;
  font-variant-numeric: tabular-nums; /* Równe szerokości cyfr */
  text-shadow: 
    -1px -1px 0 rgba(0, 0, 0, 0.8),
    1px -1px 0 rgba(0, 0, 0, 0.8),
    -1px 1px 0 rgba(0, 0, 0, 0.8),
    1px 1px 0 rgba(0, 0, 0, 0.8),
    0 0 2px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.7) !important;
}

/* Upewnij się, że tekst z czasem jest biały nawet w aktywnych przyciskach */
.l3-partner-item .bug-button.active .duration-timer-text,
.l3-partner-item .bug-button.duration-auto-active .duration-timer-text,
.l3-partner-item .bug-button.duration-auto-fill .duration-timer-text {
  color: #ffffff !important;
  text-shadow: 
    -1px -1px 0 rgba(0, 0, 0, 0.8),
    1px -1px 0 rgba(0, 0, 0, 0.8),
    -1px 1px 0 rgba(0, 0, 0, 0.8),
    1px 1px 0 rgba(0, 0, 0, 0.8),
    0 0 2px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.7) !important;
}

/* Tekst przycisku L3 - zawsze nad pomarańczowym wypełnieniem */
.l3-partner-item .bug-button .l3-button-text {
  position: relative;
  z-index: 10;
  display: inline-block;
}

/* Ikony również muszą być nad pomarańczowym paskiem */
.l3-partner-item .bug-button .bug-icon {
  position: relative;
  z-index: 10;
  display: inline-block;
}

/* Dla nieaktywnych przycisków z DURATION AUTO - biały tekst */
.l3-partner-item .bug-button:not(.active).duration-auto-active {
  color: #eaebe4;
}

.l3-partner-item .bug-button:not(.active).duration-auto-active * {
  color: #eaebe4;
}

/* Tekst z czasem podczas animacji - musi być widoczny na pomarańczowym tle - dodaj ciemny cień */
.l3-partner-item .bug-button.duration-auto-fill {
  text-shadow: 
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.7),
    0 1px 2px rgba(0, 0, 0, 1),
    0 -1px 2px rgba(0, 0, 0, 1),
    1px 0 2px rgba(0, 0, 0, 1),
    -1px 0 2px rgba(0, 0, 0, 1);
}

.l3-partner-item .bug-button.duration-auto-fill * {
  text-shadow: 
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.7),
    0 1px 2px rgba(0, 0, 0, 1),
    0 -1px 2px rgba(0, 0, 0, 1),
    1px 0 2px rgba(0, 0, 0, 1),
    -1px 0 2px rgba(0, 0, 0, 1);
}

/* Ikony również muszą być widoczne na pomarańczowym tle */
.l3-partner-item .bug-button.duration-auto-active .bug-icon,
.l3-partner-item .bug-button.duration-auto-fill .bug-icon {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 1px 2px rgba(0, 0, 0, 1));
}

.l3-partners-settings-table {
  margin-top: 16px;
}

.l3-partners-settings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.l3-partners-settings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.l3-partners-settings-table tbody td {
  padding: 12px 10px;
  font-size: 13px;
}

.l3-partners-settings-table tbody td input[type="text"],
.l3-partners-settings-table tbody td input[type="number"] {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #f5f3ff;
  font-size: 13px;
}

/* Toggle switch dla duration mode - prosty styl */
.duration-mode-toggle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  justify-content: center;
}

.duration-mode-toggle-label-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.duration-mode-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.duration-mode-toggle.active {
  background: linear-gradient(135deg, #ff8b4a, #ef3d24);
  border-color: rgba(239, 61, 36, 0.8);
}

.duration-mode-toggle-slider {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  transition: left 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.duration-mode-toggle.active .duration-mode-toggle-slider {
  left: calc(100% - 24px);
}

.l3-partners-settings-table tbody td input[type="text"]:focus,
.l3-partners-settings-table tbody td input[type="number"]:focus {
  outline: none;
  border-color: rgba(240, 138, 60, 0.5);
  background: rgba(255, 255, 255, 0.15);
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Wyrównanie kolumny z toggle switch do lewej (jak tytuł kolumny) */
.l3-partners-settings-table tbody td .duration-mode-toggle-wrapper {
  margin: 0;
  align-items: flex-start;
}

/* Styl dla przycisku delete - większy X */
.l3-partners-settings-table tbody td button[id^="l3-partner-delete"] {
  font-size: 18px !important;
  font-weight: bold !important;
  line-height: 1 !important;
  padding: 6px 10px !important;
}

.l3-partners-settings-table tbody td select {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #f5f3ff;
  font-size: 13px;
  cursor: pointer;
}

.l3-partners-settings-table tbody td .file-name-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.l3-partners-settings-table tbody td .file-name-input-wrapper span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.bug-icon {
  width: 14px;
  height: 14px;
  opacity: 0.9;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ========== LISTA SCEN ========== */

.dash-scenes {
  padding: 20px 0 12px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  overflow: hidden;
}


.dash-scenes-title {
  padding: 0 16px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.7;
}

.dash-scenes-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
}

.dash-scenes-col {
  border-right: 1px solid rgba(255,255,255,0.05);
  min-width: 0;
}

.dash-scenes-col:last-child {
  border-right: none;
}

.dash-scenes-col-title {
  padding: 8px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.6;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.2);
}

.scene-row {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.02);
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.scene-row:hover {
  background: radial-gradient(circle at 0 0, #171a33, transparent 25%);
}

/* Scene drag handle - visible only in edit mode */
.scene-drag-handle {
  display: none;
  width: 20px;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  margin-right: 8px;
  margin-left: -8px;
}

.scene-drag-handle:hover {
  color: rgba(255, 255, 255, 0.6);
}

.scene-list-edit-mode .scene-drag-handle {
  display: flex;
}

.scene-list-edit-mode .scene-row {
  cursor: grab;
}

.scene-list-edit-mode .scene-row:active {
  cursor: grabbing;
}

.scene-list-edit-mode .scene-row.dragging {
  opacity: 0.4;
  background: rgba(239, 61, 36, 0.15);
}

/* Highlight lists in edit mode */
.scene-list-edit-mode #scene-list-fs,
.scene-list-edit-mode #scene-list-l3 {
  outline: 2px dashed rgba(239, 61, 36, 0.5);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Scene remove button (minus) */
.scene-remove-btn {
  display: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 8px;
  transition: all 0.15s ease;
}

.scene-remove-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: rgba(220, 38, 38, 0.9);
}

.scene-list-edit-mode .scene-remove-btn {
  display: flex;
}

/* Scene add button container */
.scene-add-btn-container {
  display: none;
  padding: 8px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.scene-list-edit-mode .scene-add-btn-container,
body.scene-list-edit-mode .scene-add-btn-container {
  display: block;
}

/* Bugs add button - inherits from .scene-add-btn-container, just override padding */
.dash-bugs .scene-add-btn-container {
  padding: 8px 0;
  border-top: none;
}

/* Force show bugs add button in edit mode */
body.scene-list-edit-mode .dash-bugs .scene-add-btn-container {
  display: block !important;
}

/* Scene add button (plus) */
.scene-add-btn {
  width: 100%;
  height: 36px;
  padding: 0;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.scene-add-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

/* Scene add menu (dropdown) */
.scene-add-menu {
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  padding: 4px;
}

.scene-add-menu-item {
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.1s ease;
}

.scene-add-menu-item:hover {
  background: rgba(239, 61, 36, 0.2);
  color: #fff;
}

.scene-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.scene-name {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f5f5f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.scene-name strong {
  font-weight: 600;
}

/* Short name by default (FS/L3 headers already indicate type) */
.scene-name-full {
  display: none;
}

.scene-name-short {
  display: inline;
}

.scene-desc {
  color: #9ca3af;
  font-weight: 400;
}

/* ========== SCENE TOGGLE (ON/OFF) ========== */

.scene-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.9);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  color: #ffffff;
  background: transparent;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.7),
    0 10px 24px rgba(0,0,0,0.8);
  transition:
    color 0.25s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease-out;
}

/* ikony */

.scene-toggle .icon {
  font-size: 10px;
  transform: translateY(0.5px);
}

.scene-toggle .icon::before {
  content: "▶";
}

.scene-toggle.active .icon::before {
  content: "■";
}

/* ON – fill od dołu */

.scene-toggle::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  top: 100%;
  height: 100%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.35), transparent 55%),
    #ffffff;
  z-index: -1;
  transition: top 0.3s ease-out;
}

.scene-toggle:not(.active):hover::before {
  top: 0;
}

.scene-toggle:not(.active):hover {
  color: #000000;
  box-shadow:
    0 0 10px rgba(255,255,255,0.25),
    0 16px 30px rgba(0,0,0,1);
}

/* klik */

.scene-toggle:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(0,0,0,1);
}

/* OFF – pełny pomarańcz */

.scene-toggle.active {
  border-color: rgba(239,61,36,0.9);
  color: #1b0503;
  background:
    radial-gradient(circle at 0 100%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, #ff8b4a, #ef3d24);
  box-shadow:
    0 0 14px rgba(239,61,36,0.8),
    0 18px 38px rgba(0,0,0,1);
}

.scene-toggle.active:hover {
  box-shadow:
    0 0 8px rgba(239,61,36,0.6),
    0 14px 30px rgba(0,0,0,1);
}

.scene-toggle.active::before {
  top: 100%;
  background: none;
}

.scene-toggle.preview-active {
  border-color: rgba(138, 43, 226, 0.9);
  color: #fff;
  background:
    radial-gradient(circle at 0 100%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(138, 43, 226, 0.6));
  box-shadow:
    0 0 14px rgba(138, 43, 226, 0.8),
    0 18px 38px rgba(0,0,0,1);
}

.scene-toggle.preview-active .icon::before {
  background: rgba(138, 43, 226, 0.9);
  box-shadow: 0 0 6px rgba(138, 43, 226, 0.6);
}

.scene-toggle.preview-active:hover {
  box-shadow:
    0 0 8px rgba(138, 43, 226, 0.6),
    0 14px 30px rgba(0,0,0,1);
}

/* ========== PRAWA KOLUMNA ========== */

/* .dash-right jest zdefiniowane wyżej z flex properties */

/* previewy */

.dash-previews {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr; /* Jedna kolumna - wszystko nałożone */
  gap: 12px;
}

/* opcjonalnie karta L3 trochę wyższa */
.preview-card-wide .preview-frame {
  padding-top: 56.25%; /* 16:9, ale możesz dać np. 65% żeby była wyższa */
}

.preview-card {
  position: relative;
  padding: 8px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.7;
}

.preview-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

.preview-frame.preview-mode-active {
  border: 3px solid rgba(138, 43, 226, 0.8);
  box-shadow: 
    0 0 20px rgba(138, 43, 226, 0.6),
    0 0 40px rgba(138, 43, 226, 0.4) inset;
}

/* Dashboard Preview Mode Disabled Overlay */
.dashboard-preview-mode-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(138, 43, 226, 1);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  pointer-events: none;
}

.dashboard-preview-mode-overlay.show {
  display: flex;
}

.dashboard-preview-mode-overlay-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.preview-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Nałożone preview - warstwy */
.preview-card-stacked .preview-frame {
  position: relative;
}

.preview-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

/* Preview header with tabs and controls */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.preview-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  flex: 1;
}

.preview-controls {
  display: flex;
  gap: 4px;
  padding: 8px;
  margin-left: auto;
  justify-content: flex-end;
}

.preview-control-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.preview-control-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}

.preview-control-btn.active {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}

.preview-control-btn-disabled,
.preview-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.preview-control-btn-disabled:hover,
.preview-control-btn:disabled:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
}

.preview-tab {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-tab:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}

.preview-tab.active {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,1);
  font-weight: 600;
}

.preview-tab.preview-active {
  background: rgba(138, 43, 226, 0.3);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  box-shadow: 0 0 8px rgba(138, 43, 226, 0.4);
}

.preview-tab.preview-active:hover {
  background: rgba(138, 43, 226, 0.4);
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.6);
}

.preview-layer {
  display: none;
}

.preview-layer.active {
  display: block;
}

.preview-layer.preview-fs {
  z-index: 1; /* Tło - FS */
}

.preview-layer.preview-bug {
  z-index: 2; /* Bug w rogu */
}

.preview-layer.preview-l3 {
  z-index: 3; /* L3 w rogu */
}

/* Combined view - wszystkie nałożone, ignorujemy klasę active */
.preview-frame.combined .preview-layer {
  display: block !important;
}

/* Gdy nie ma combined, ukryj warstwy FS/Bug/L3 nawet jeśli mają active */
.preview-frame:not(.combined) .preview-layer.preview-fs,
.preview-frame:not(.combined) .preview-layer.preview-bug,
.preview-frame:not(.combined) .preview-layer.preview-l3 {
  display: none !important;
  visibility: hidden !important;
}

/* Fullscreen preview modal */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.preview-modal-content {
  position: relative;
  width: 90%;
  height: 90%;
  max-width: 1920px;
  max-height: 1080px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 0 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

.preview-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.2s ease;
}

.preview-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.preview-modal-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.preview-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.preview-modal-frame .preview-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.preview-modal-frame .preview-layer.preview-fs {
  z-index: 1;
}

.preview-modal-frame .preview-layer.preview-bug {
  z-index: 2;
}

.preview-modal-frame .preview-layer.preview-l3 {
  z-index: 3;
}

/* Preview Modal Controls (Clear buttons at bottom) */
.preview-modal-controls {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.preview-modal-controls .action-btn {
  height: 36px;
  padding: 0 18px;
  font-size: 11px;
  text-transform: uppercase;
}

/* Output Matrix Modal */
.output-matrix-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.2s ease;
}

.output-matrix-modal-content {
  position: relative;
  width: 75%;
  max-width: 1000px;
  max-height: 90vh;
  background: #0d0b10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

.output-matrix-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: none;
  color: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.2s ease;
}

.output-matrix-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: none;
}

.output-matrix-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.output-matrix-modal-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  font-family: system-ui, -apple-system, sans-serif;
}

.output-matrix-modal-header p {
  margin: 4px 0 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
}

.output-matrix-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.output-matrix-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.output-matrix-modal-footer-left {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.output-matrix-modal-footer-center {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.output-matrix-modal-footer-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.output-matrix-modal-footer .action-btn {
  min-width: 80px;
  height: 32px;
  padding: 0 12px;
  font-size: 11px;
  text-transform: uppercase;
}

/* Action Log Container */
.action-log-container {
  padding: 12px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  max-height: 200px;
  display: flex;
  flex-direction: column;
}

.action-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.action-log-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
}

.action-log-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  opacity: 0.8;
}

.action-log {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.action-log::-webkit-scrollbar {
  width: 4px;
}

.action-log::-webkit-scrollbar-track {
  background: transparent;
}

.action-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

.action-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

.action-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-log-empty {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  padding: 4px 0;
}

.action-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  transition: background 0.2s ease;
}

.action-log-item:hover {
  background: rgba(255,255,255,0.06);
}

.action-log-item-time {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  font-family: 'Courier New', monospace;
  min-width: 60px;
}

.action-log-item-message {
  flex: 1;
}

.action-log-item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Notification toast */
.notification-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  z-index: 10001;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-toast.fade-out {
  animation: slideOutRight 0.3s ease;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========== SETTINGS PANEL ========== */

.dash-bottom {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
}

.dash-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.95)),
    url("../../assets/img/bg-4.png") center bottom / cover no-repeat;
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

.dash-settings {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  padding: 16px 18px;
  overflow: auto;
}

.dash-settings h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.dash-settings-hint {
  font-size: 13px;
  opacity: 0.7;
}

.dash-settings .field {
  margin-bottom: 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-settings textarea {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #262626;
  font-size: 12px;
  background: #141414;
  color: #f5f3ff;
  resize: vertical;
}

/* zakładki */

.tabs-header {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.tabs-header-top {
  background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
  margin: -4px -4px 8px;
  padding: 4px 4px 6px;
  border-radius: 8px 8px 0 0;
}

.tab-btn {
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
  border: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  background: transparent;
  color: #bbbbbb;
  opacity: 0.9;
}

.tab-btn.active {
  background: rgba(20,20,20,1);
  color: #f5f3ff;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.6);
}

.tabs-body {
  font-size: 13px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ========== GLOBAL BUTTON BASE ========== */

button {
  font-family: inherit;
}

/* ========== SETTINGS ACTION BUTTONS ========== */

.action-btn {
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #eaebe4;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn-clear-flash {
  background: rgba(220, 38, 38, 0.25) !important;
  border-color: rgba(220, 38, 38, 0.8) !important;
  color: #ff6b6b !important;
  transition: background 0.05s, border-color 0.05s, color 0.05s !important;
}

/* ========== OUTPUT ROW (MAIN SETTINGS) ========== */

.output-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.output-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.8;
}

.output-path {
  font-size: 12px;
  color: #e5e7eb;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-clock-row-top {
  align-items: center;
  gap: 12px;
}

.dash-clock-big {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dash-clock-big .clock-time,
.dash-clock-big .timer-time {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}

.clock-mode-buttons {
  margin-left: auto;
}

/* ========== SCOREBOARD ========== */

/* 3 kolumny: A | SCORE | B */
.sb-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  margin-top: 10px;
}

/* kolumny po bokach w pionie */
.sb-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Notes Textarea */
.notes-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #eaebe4;
  font-size: 14px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.notes-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.4);
}

.notes-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.sb-col-score {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sb-score-boxes {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  justify-content: center;
}

.sb-score-unit {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
}

.sb-score-box {
  width: 72px;
  height: 72px;
  background: #181818;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  border-radius: 12px 0 0 12px;
}

.sb-score-spinners {
  display: flex;
  flex-direction: column;
  width: 28px;
}

.sb-spin-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.sb-spin-btn:first-child {
  border-radius: 0 12px 0 0;
  border-bottom: none;
}

.sb-spin-btn:last-child {
  border-radius: 0 0 12px 0;
}

.sb-spin-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

.sb-spin-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

.sb-score-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* baza – kapsułki scoreboardu (reset/swap) */

.sb-score-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.9);
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.7),
    0 6px 14px rgba(0,0,0,0.8);
  transition:
    color 0.2s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.sb-score-btn::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  top: 100%;
  height: 100%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.35), transparent 55%),
    #ffffff;
  z-index: -1;
  transition: top 0.25s ease-out;
}

.sb-score-btn:hover::before {
  top: 0;
}

.sb-score-btn:hover {
  color: #000000;
  box-shadow:
    0 0 8px rgba(255,255,255,0.25),
    0 12px 24px rgba(0,0,0,1);
}

.sb-score-btn:active {
  transform: translateY(1px) scale(0.97);
}

.sb-score-swap {
  margin-top: 0;
}

/* ========== INNE ========== */

.sb-footer {
  margin-top: 16px;
  text-align: right;
}

.scene-row.active {
  background: radial-gradient(circle at 0 0, rgba(239,61,36,0.08), transparent 86%);
  box-shadow: 0 0 0 1px rgba(233, 26, 26, 0.08);
}

/* Ogólny styl selectów */

.dash-settings select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #262626;
  background: #141414;
  color: #f5f3ff;
  font-size: 12px;
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #aaaaaa 50%),
    linear-gradient(135deg, #aaaaaa 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 10px,
    calc(100% - 9px) 10px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.dash-settings select:focus {
  outline: none;
  border-color: #f08a3c;
  box-shadow: 0 0 0 1px rgba(240,138,60,0.5);
}

/* Styl inputu zgodny z selectem (dla FS Postroll) */
.dash-settings-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #262626;
  background: #141414;
  color: #f5f3ff;
  font-size: 12px;
  font-family: inherit;
}

.dash-settings-input:focus {
  outline: none;
  border-color: #f08a3c;
  box-shadow: 0 0 0 1px rgba(240,138,60,0.5);
}

.dash-settings-input::placeholder {
  color: rgba(245, 243, 255, 0.4);
}

/* Fix dla autocomplete przeglądarki - zachowaj ciemne tło */
.dash-settings-input:-webkit-autofill,
.dash-settings-input:-webkit-autofill:hover,
.dash-settings-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #141414 inset !important;
  -webkit-text-fill-color: #f5f3ff !important;
  border-color: #262626 !important;
  caret-color: #f5f3ff !important;
}

/* ========== CONTROL BOX ========== */

.dash-control-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10,10,10,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 68px;
}

.lock-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(20,20,20,0.8);
  color: #f5f3ff;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.lock-btn svg {
  width: 16px;
  height: 16px;
}

.lock-btn:hover {
  background: rgba(30,30,30,0.9);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

.lock-btn.active,
.lock-btn.locked {
  background: rgba(240,138,60,0.2);
  border-color: #f08a3c;
  color: #f08a3c;
  box-shadow: 0 0 10px rgba(240,138,60,0.4);
}

.lock-btn.active:hover,
.lock-btn.locked:hover {
  background: rgba(240,138,60,0.3);
  box-shadow: 0 0 15px rgba(240,138,60,0.6);
}

.dash-locked {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.5);
  user-select: none;
}

.dash-locked .lock-btn {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

.dash-locked .lock-modal,
.dash-locked .lock-modal * {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

/* Lock Modal */
.lock-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.lock-modal-content {
  background: rgba(10,10,10,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 32px;
  min-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lock-modal-content h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f5f3ff;
}

.lock-modal-content p {
  margin: 0 0 20px 0;
  font-size: 13px;
  opacity: 0.7;
  color: #eaebe4;
}

.lock-pin-input {
  -webkit-text-security: disc;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(20,20,20,0.8);
  color: #f5f3ff;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.2em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: all 0.2s ease;
}

.lock-pin-input:focus {
  outline: none;
  border-color: #f08a3c;
  box-shadow: 0 0 0 2px rgba(240,138,60,0.2);
}

.lock-modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.lock-modal-buttons .action-btn {
  width: 100%;
  height: 36px;
}

.lock-modal-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.4);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 12px;
  text-align: center;
}

.dash-control-box-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.7;
  white-space: nowrap;
}

.dash-control-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1;
  justify-content: stretch;
  align-items: center;
  min-height: 32px;
}

.dash-control-box .action-btn {
  height: 32px;
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.action-btn-disabled {
  opacity: 0.4;
  cursor: default;
}

.action-btn-disabled:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}


#btn-edit-layout.active {
  background: rgba(239, 61, 36, 0.3);
  border-color: rgba(239, 61, 36, 0.8);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 10px rgba(239, 61, 36, 0.4);
}

#btn-edit-layout.active:hover {
  background: rgba(239, 61, 36, 0.4);
  border-color: rgba(239, 61, 36, 1);
  box-shadow: 0 0 15px rgba(239, 61, 36, 0.6);
}

#btn-edit-scene-list.active {
  background: rgba(239, 61, 36, 0.3);
  border-color: rgba(239, 61, 36, 0.8);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 10px rgba(239, 61, 36, 0.4);
}

#btn-edit-scene-list.active:hover {
  background: rgba(239, 61, 36, 0.4);
  border-color: rgba(239, 61, 36, 1);
  box-shadow: 0 0 15px rgba(239, 61, 36, 0.6);
}

.icon-only-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px !important;
}

.layout-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-controls-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

/* L and T buttons in preview controls */
#btn-output-labels,
#btn-test-pattern {
  font-size: 14px;
  font-weight: 700;
}

#btn-output-labels.active,
#btn-test-pattern.active {
  background: rgba(239,61,36,0.3);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 10px rgba(239,61,36,0.4);
}

#btn-output-labels.active:hover,
#btn-test-pattern.active:hover {
  background: rgba(239,61,36,0.4);
  box-shadow: 0 0 15px rgba(239,61,36,0.6);
}

/* ========== TIMER REDESIGN ========== */

/* Timer i Bugs obok siebie */
.dash-timer-bugs-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  min-width: 0;
}

.dash-timer-bugs-wrapper > * {
  min-width: 0;
}

/* Timer Panel */
.timer-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer-header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.timer-mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-mode-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-mode-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 500;
}

.timer-mode-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

/* Manual Input Section */
.timer-manual-section {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
}

.timer-manual-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  min-width: 70px;
}

.timer-manual-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: #eaebe4;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  text-align: center;
  font-weight: 900;
}

.timer-manual-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.6);
}

.timer-manual-input.input-error {
  border-color: rgba(255, 0, 0, 0.8);
  background: rgba(255, 0, 0, 0.1);
}

.timer-manual-input.input-error:focus {
  border-color: rgba(255, 0, 0, 1);
  background: rgba(255, 0, 0, 0.15);
}

.timer-manual-set-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-manual-set-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.timer-circle-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timer-display-large {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: #eaebe4;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 8px 0;
}

/* Separator */
.timer-section-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 0;
}

/* To Hour Section */
.timer-to-hour-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-to-hour-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  min-width: 62px;
}

.timer-hour-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.timer-hour-controls .timer-to-hour-label {
  white-space: nowrap;
  flex: 0 0 auto;
}

.timer-hour-controls .timer-hour-next-half-btn {
  white-space: nowrap;
  flex: 1 1 auto;
}

.timer-hour-controls .timer-hour-input {
  flex: 1 1 auto;
  min-width: 50px;
}

.timer-hour-controls .timer-hour-set-btn {
  flex: 1 1 auto;
  min-width: fit-content;
}



/* To Hour Input */
.timer-hour-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-hour-next-half-btn {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.timer-hour-next-half-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.timer-hour-input {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: #eaebe4;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  text-align: center;
  font-weight: 400;
  min-width: 120px;
  width: 120px;
}

.timer-hour-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.6);
}

.timer-hour-input.input-error {
  border-color: rgba(255, 0, 0, 0.8);
  background: rgba(255, 0, 0, 0.1);
}

.timer-hour-input.input-error:focus {
  border-color: rgba(255, 0, 0, 1);
  background: rgba(255, 0, 0, 0.15);
}

.timer-hour-set-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-hour-set-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Main Controls - Large Buttons */
.timer-controls-main {
  display: grid;
  grid-template-columns: repeat(2, 1fr) repeat(2, 0.7fr);
  gap: 6px;
  margin-bottom: 8px;
}

.timer-btn-large {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.timer-btn-large::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.timer-btn-large:hover::before {
  opacity: 1;
}

.timer-btn-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.timer-btn-start {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.timer-btn-start:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.timer-btn-start.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.2));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(0.98);
}

.timer-btn-stop {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.timer-btn-stop:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.timer-btn-stop.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.2));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(0.98);
}

.timer-btn-small {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.timer-btn-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.timer-btn-small:hover::before {
  opacity: 1;
}

.timer-btn-add-minute {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.timer-btn-add-minute:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.timer-btn-subtract-minute {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.timer-btn-subtract-minute:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Presets */
.timer-presets {
  display: flex;
  gap: 6px;
}

.timer-presets-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-presets-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.timer-presets-buttons .timer-preset-btn {
  min-width: 0;
}

.timer-preset-btn {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.timer-preset-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* ========== STATUS SECTION ========== */

.status-section {
  padding: 16px;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.status-ok {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.status-dot.status-reconnecting {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.status-error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: #eaebe4;
}

/* ========== ASSETS MANAGEMENT ========== */

.assets-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.assets-dropzone:hover {
  border-color: rgba(239, 61, 36, 0.5);
  background: rgba(239, 61, 36, 0.05);
}

.assets-dropzone.drag-over {
  border-color: rgba(239, 61, 36, 0.8);
  background: rgba(239, 61, 36, 0.1);
  border-style: solid;
}

.assets-dropzone.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.assets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.assets-list::-webkit-scrollbar {
  width: 6px;
}

.assets-list::-webkit-scrollbar-track {
  background: transparent;
}

.assets-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.assets-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.assets-empty {
  text-align: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.asset-item:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.asset-item.asset-valid {
  border-left: 3px solid #22c55e;
}

.asset-item.asset-invalid {
  border-left: 3px solid #ef4444;
}

.asset-item.asset-warning {
  border-left: 3px solid #fbbf24;
}

.asset-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  flex-shrink: 0;
}

.asset-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.asset-name {
  font-size: 13px;
  font-weight: 500;
  color: #eaebe4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.asset-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.asset-status.status-ok {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.asset-status.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.asset-status.status-warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.asset-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.asset-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.asset-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.asset-info-btn {
  position: relative;
}

.asset-info-popup {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(20, 20, 20, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.asset-info-popup.visible {
  display: block;
}

.asset-info-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.asset-info-popup-label {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.asset-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Validation Report */
.assets-validation-errors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.validation-error-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  font-size: 12px;
}

.validation-error-item.warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.validation-error-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.validation-error-content {
  flex: 1;
}

.validation-error-title {
  font-weight: 500;
  color: #ef4444;
  margin-bottom: 2px;
}

.validation-error-item.warning .validation-error-title {
  color: #fbbf24;
}

.validation-error-detail {
  color: rgba(255, 255, 255, 0.6);
}

/* Upload Status */
.upload-status-success {
  padding: 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  color: #22c55e;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-status-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-status-warning {
  padding: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Code styling */
#tab-assets code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* ========== vMix TRANSITION BUTTONS ========== */

.vmix-transition-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vmix-transition-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid rgba(239, 61, 36, 0.6);
  border-radius: 8px;

  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;

  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(239, 61, 36, 0.2);
}

.vmix-transition-btn:hover {
  background: linear-gradient(135deg, #252550 0%, #1e2d4d 100%);
  border-color: rgba(239, 61, 36, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(239, 61, 36, 0.35);
  transform: translateY(-2px);
}

.vmix-transition-btn:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #ef3d24 0%, #c62d18 100%);
  border-color: #ef3d24;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(239, 61, 36, 0.5);
}

/* Transition OUT - niebieski kolor */
.vmix-transition-out {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(59, 130, 246, 0.2);
}

.vmix-transition-out:hover {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(59, 130, 246, 0.35);
}

.vmix-transition-out:active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(59, 130, 246, 0.5);
}

.vmix-transition-btn svg {
  flex-shrink: 0;
}

.vmix-transition-btn span {
  white-space: nowrap;
}

/* Animacja IN (czerwony) */
.vmix-transition-in.triggered {
  animation: vmix-pulse-in 0.4s ease-out;
}

@keyframes vmix-pulse-in {
  0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(239, 61, 36, 0.2); }
  50% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 60px rgba(239, 61, 36, 0.8); }
  100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(239, 61, 36, 0.2); }
}

/* Animacja OUT (niebieski) */
.vmix-transition-out.triggered {
  animation: vmix-pulse-out 0.4s ease-out;
}

@keyframes vmix-pulse-out {
  0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 60px rgba(59, 130, 246, 0.8); }
  100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.2); }
}

/* vMix AUTO toggle button */
.vmix-auto-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #1a1a3a 0%, #151530 100%);
  border: 2px solid rgba(100, 100, 120, 0.5);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vmix-auto-toggle .toggle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100, 100, 120, 0.4);
  border: 2px solid rgba(100, 100, 120, 0.6);
  transition: all 0.2s ease;
}

.vmix-auto-toggle:hover {
  border-color: rgba(140, 140, 160, 0.7);
  color: rgba(255, 255, 255, 0.8);
}

.vmix-auto-toggle.active {
  background: linear-gradient(135deg, #1a2a1a 0%, #152015 100%);
  border-color: rgba(34, 197, 94, 0.7);
  color: rgba(255, 255, 255, 0.9);
}

.vmix-auto-toggle.active .toggle-indicator {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.vmix-auto-toggle.active:hover {
  border-color: rgba(34, 197, 94, 0.9);
}

/* vMix External Output toggle button */
.vmix-external-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #1a1a3a 0%, #151530 100%);
  border: 2px solid rgba(100, 100, 120, 0.5);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vmix-external-toggle .toggle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100, 100, 120, 0.4);
  border: 2px solid rgba(100, 100, 120, 0.6);
  transition: all 0.2s ease;
}

.vmix-external-toggle:hover {
  border-color: rgba(140, 140, 160, 0.7);
  color: rgba(255, 255, 255, 0.8);
}

.vmix-external-toggle.active {
  background: linear-gradient(135deg, #1a2a1a 0%, #152015 100%);
  border-color: rgba(34, 197, 94, 0.7);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.2);
}

.vmix-external-toggle.active .toggle-indicator {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.vmix-external-toggle.active:hover {
  border-color: rgba(34, 197, 94, 0.9);
}

/* ========== EXTERNAL OUTPUT PANEL ========== */

.external-output-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.external-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.external-output-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.external-output-title {
  font-size: 11px;
  font-weight: 600;
  color: #eaebe4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.external-output-arrow {
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
}

.external-output-panel.expanded .external-output-arrow {
  transform: rotate(180deg);
}

.external-output-content {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.external-output-content .dash-control-box {
  min-width: 300px;
}

.ndi-preview-container {
  width: 100%;
  min-height: 300px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.ndi-preview-placeholder {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 40px;
}

.ndi-preview-placeholder svg {
  margin: 0 auto 16px;
  opacity: 0.4;
}

.ndi-preview-placeholder p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =============================
   NUMBER INPUT SPINNER STYLING
   ============================= */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Custom number input wrapper with dark styled buttons */
.number-input-wrapper {
  display: inline-flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
}

.number-input-wrapper input[type="number"] {
  border-radius: 6px 0 0 6px;
  border-right: none;
  text-align: center;
}

.number-input-btns {
  display: flex;
  flex-direction: column;
  width: 22px;
}

.number-input-btns button {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.number-input-btns button:first-child {
  border-radius: 0 6px 0 0;
  border-bottom: none;
}

.number-input-btns button:last-child {
  border-radius: 0 0 6px 0;
}

.number-input-btns button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

/* ── User menu dropdown ─────────────────────────────────── */
.user-menu-wrapper {
  position: relative;
  margin-left: 4px;
}

.user-avatar {
  cursor: pointer;
  user-select: none;
}

.user-dropdown {
  display: none;
  position: fixed;
  min-width: 200px;
  background: #0f0d12;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.65);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 11px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-dropdown-email {
  font-size: 11px;
  color: rgba(255,255,255,0.42);
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.user-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.user-dropdown-item-danger { color: rgba(255,90,70,0.75); }
.user-dropdown-item-danger:hover {
  background: rgba(255,60,40,0.08);
  color: rgba(255,100,80,1);
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 2px 0;
}

/* ── Output Matrix inline footer ───────────────────────── */
.settings-om-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}

.settings-om-footer-left,
.settings-om-footer-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── vMix buttons inside Settings Modal — match action-btn style ── */
.settings-modal .vmix-transition-btn,
.settings-modal .vmix-auto-toggle,
.settings-modal .vmix-external-toggle {
  padding: 6px 12px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #eaebe4;
  box-shadow: none;
  transform: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.settings-modal .vmix-transition-btn:hover,
.settings-modal .vmix-auto-toggle:hover,
.settings-modal .vmix-external-toggle:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.settings-modal .vmix-transition-btn:active,
.settings-modal .vmix-auto-toggle:active,
.settings-modal .vmix-external-toggle:active {
  background: rgba(255,255,255,0.16);
  box-shadow: none;
  transform: none;
}

.settings-modal .vmix-auto-toggle.active,
.settings-modal .vmix-external-toggle.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}

.settings-modal .vmix-auto-toggle.active .toggle-indicator {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: none;
}

.settings-modal .vmix-external-toggle.active .toggle-indicator {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: none;
}

/* ── Settings Modal ─────────────────────────────────────── */
.settings-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.settings-modal-overlay.open {
  display: flex;
}

.settings-modal {
  width: 1020px;
  max-width: 96vw;
  max-height: 90vh;
  background: #0d0b10;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.85);
}

.settings-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.settings-modal-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.38);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}

.settings-modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.settings-modal-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.settings-modal-nav {
  width: 156px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0,0,0,0.18);
}

.settings-nav-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.48);
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.settings-nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
}

.settings-nav-btn.active {
  background: rgba(120,80,220,0.18);
  color: rgba(180,140,255,0.95);
}

.settings-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
}

.settings-sec { display: none; }
.settings-sec.active { display: block; }

.settings-nav-footer {
  margin-top: auto;
  padding: 12px 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.settings-nav-email {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.settings-nav-version {
  font-size: 10px;
  color: rgba(255,255,255,0.18);
  font-family: system-ui, -apple-system, sans-serif;
}

.settings-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.settings-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.settings-card-row:last-child { border-bottom: none; }

.settings-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.48);
  font-family: system-ui, -apple-system, sans-serif;
}

.settings-card-value {
  font-size: 12px;
  color: rgba(255,255,255,0.82);
  font-family: system-ui, -apple-system, sans-serif;
  text-align: right;
}

.settings-sec-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0 0 18px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
