/* Track colors by type */
.trackRow.audio { --track-rgb: 65, 205, 205; background: rgba(65,205,205,0.05); }
.trackRow.scene { --track-rgb: 100, 150, 255; background: rgba(100,150,255,0.03); }
.trackRow.shader { --track-rgb: 180, 100, 255; background: rgba(180,100,255,0.03); }
.trackRow.shader .seg { background: linear-gradient(135deg, #b080ff, rgba(200,150,255,.4)) !important; }
.trackRow.media { --track-rgb: 112, 210, 145; background: rgba(150,255,150,0.03); }
.trackRow.media .seg { background: linear-gradient(135deg, #8ecf8e, rgba(200,255,200,.4)) !important; }
.trackRow.postfx { --track-rgb: 244, 183, 90; background: rgba(255,180,100,0.03); }
.trackRow.postfx .seg { background: linear-gradient(135deg, var(--gold), rgba(255,255,255,.4)) !important; }
.trackRow.text { --track-rgb: 232, 116, 176; background: rgba(232,116,176,0.03); }
.trackRow.lut { --track-rgb: 245, 158, 11; background: rgba(245,158,11,0.03); }
.trackRow.lut .seg { background: linear-gradient(135deg, #f59e0b, rgba(251,191,36,.4)) !important; }

/* Track header - left side with drag handle, name, buttons */
.track-header {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: var(--timeline-track-header-width, 188px);
  max-width: var(--timeline-track-header-width, 188px);
  padding: 0 6px;
  background:
    linear-gradient(90deg, rgba(var(--track-rgb, 120, 140, 170), .14), transparent 72%),
    rgba(0,0,0,0.25);
  border-right: 1px solid var(--line);
  border-left: 2px solid rgba(var(--track-rgb, 120, 140, 170), .42);
  z-index: 5;
  flex-shrink: 0;
  box-sizing: border-box;
}
.track-drag-handle {
  cursor: grab;
  width: 12px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  user-select: none;
  flex: 0 0 auto;
}
.track-drag-handle:hover { color: var(--fg); }
.track-drag-handle:active { cursor: grabbing; }
.trackRow.dragging { opacity: 0.5; }
.trackRow.drag-over { border-top: 2px solid var(--accent); }
.trackRow.segment-drop-target { 
  background: rgba(100, 200, 255, 0.15) !important; 
  box-shadow: inset 0 0 0 2px rgba(100, 200, 255, 0.5);
}
.track-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-add-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--fg);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-add-btn:hover { background: rgba(255,255,255,0.2); }
.track-visibility-btn {
  appearance: none;
  width: 19px;
  height: 19px;
  padding: 2px;
  border: 0 !important;
  border-radius: 4px;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(var(--track-rgb, 170, 190, 220), .9);
  cursor: pointer;
  flex: 0 0 auto;
}
.track-visibility-btn svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.track-visibility-btn:hover {
  color: var(--fg);
  background: rgba(255,255,255,.1) !important;
}
.track-visibility-btn.is-hidden {
  color: var(--muted);
  opacity: .72;
}
.track-delete-btn {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-delete-btn:hover { color: #ff6666; opacity: 1; }
.track-delete-btn:disabled { opacity: 0.2; cursor: not-allowed; }
.track-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.track-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
  opacity: 0.5;
}

.track-header.selected {
  border-left-color: rgba(var(--track-rgb, 120, 180, 255), .95);
  background:
    linear-gradient(90deg, rgba(var(--track-rgb, 120, 180, 255), .24), transparent 82%),
    rgba(120, 180, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(var(--track-rgb, 120, 180, 255), .18);
}

.trackRow.track-hidden .track-content {
  opacity: .32;
  filter: saturate(.45);
}
.trackRow.track-hidden .track-header {
  background: rgba(0,0,0,.3);
}
.trackRow.track-hidden .track-name {
  color: var(--muted);
}

/* Minimized track styling */
.trackRow.minimized {
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
}
.trackRow.minimized .track-content {
  height: 24px;
  overflow: hidden;
}
.trackRow.minimized .seg {
  top: 2px !important;
  height: 18px !important;
  border-radius: 4px;
}
.trackRow.minimized .seg .title {
  top: 2px;
  font-size: 10px;
}
.trackRow.minimized .seg .meta {
  display: none;
}
.trackRow.minimized .track-hint {
  display: none;
}

/* All tracks use flexbox layout with header */
.trackRow {
  display: flex;
  align-items: stretch;
}

/* Audio track styling */
.trackRow.audio {
  min-height: 70px;
  height: 70px;
}
.trackRow.audio .track-header {
  background:
    linear-gradient(90deg, rgba(var(--track-rgb), .15), transparent 72%),
    rgba(0,0,0,0.3);
}
.trackRow.audio .seg {
  top: 4px;
  height: calc(100% - 8px);
  background: linear-gradient(135deg, rgba(22, 105, 145, 0.96), rgba(65, 205, 205, 0.68)) !important;
}
.legacy-audio-track {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}
.audio-segment-waveform {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  opacity: 0.9;
  pointer-events: none;
}
.trackRow.audio .seg .title,
.trackRow.audio .seg .meta {
  color: rgba(240, 253, 255, 0.96);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  z-index: 2;
}
.audio-track-waveform {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.audio-track-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.2);
  z-index: 1;
}
.audio-track-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,200,100,0.15);
  color: var(--gold);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.audio-track-btn:hover {
  background: rgba(255,200,100,0.3);
  transform: scale(1.1);
}
.audio-track-btn:active {
  transform: scale(0.95);
}
.audio-track-btn.delete {
  background: rgba(255,100,100,0.15);
  color: var(--bad);
}
.audio-track-btn.delete:hover {
  background: rgba(255,100,100,0.3);
}

/* Audio Analysis Modal */
.audio-analysis-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.audio-analysis-progress {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
#audioAnalysisProgressBar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--good));
  width: 0%;
  transition: width 0.3s ease-out;
}

/* Add button for tracks */
.trackAddBtn {
  position: absolute;
  right: 10px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,200,100,0.15);
  color: var(--gold);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.15s ease;
}
.trackAddBtn:hover {
  background: rgba(255,200,100,0.3);
  transform: scale(1.1);
}
.trackAddBtn:active {
  transform: scale(0.95);
}

/* Empty track hint */
.trackHint {
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  pointer-events: none;
}

/* Fullscreen mode */
body.fullscreen-mode {
  overflow: hidden;
}
body.fullscreen-mode #app {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
body.fullscreen-mode #viewportWrap {
  flex: 1 1 100%;
  height: 100vh;
  border: none;
}
body.fullscreen-mode #topNav,
body.fullscreen-mode #hud,
body.fullscreen-mode #splitter,
body.fullscreen-mode #editor {
  display: none !important;
}
body.fullscreen-mode #canvasContainer,
body.fullscreen-mode #threeCanvas {
  cursor: none;
}

/* Fullscreen hint overlay */
#fullscreenHint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10000;
}
body.fullscreen-mode #fullscreenHint.show {
  opacity: 1;
}

/* Play mode (iframe player) - hide all UI immediately via CSS */
body.play-mode #topNav,
body.play-mode #editorBar,
body.play-mode #editor,
body.play-mode #splitter,
body.play-mode #startOverlay,
body.play-mode #authLoading,
body.play-mode .panel,
body.play-mode .side-panel,
body.play-mode #hud {
  display: none !important;
}

body.play-mode {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.play-mode #app {
  width: 100%;
  height: 100%;
  position: relative;
}

body.play-mode #viewportWrap {
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  position: absolute !important;
  inset: 0 !important;
}

body.play-mode #canvasContainer {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.play-mode #threeCanvas,
body.play-mode #imageOverlayCanvas {
  /* Don't force 100% - let resizeRenderer handle the aspect ratio */
  max-width: 100% !important;
  max-height: 100% !important;
}

body.play-mode #imageOverlayCanvas {
  /* The overlay is the complete presentation surface on iOS. Unlike the
     flex-positioned WebGL canvas it is absolutely positioned, so center it
     explicitly inside portrait and square player viewports. */
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Play mode controls overlay */
.play-mode-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,.03)), rgba(16,21,33,0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

body.play-mode:hover .play-mode-controls,
body.play-mode.paused .play-mode-controls {
  opacity: 1;
}

.play-mode-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.play-mode-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* Side Panels */
.side-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(12,14,20,0.98), rgba(8,10,14,0.98));
  border: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
  min-width: 0;
}
#objectListPanel {
  left: 0;
  border-right: 1px solid var(--line);
}
#paramPanel {
  right: 0;
  border-left: 1px solid var(--line);
}
.panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header-actions {
  display: flex;
  gap: 4px;
}
.btn-small {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-small:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text);
}
.btn-small:active {
  transform: scale(0.95);
}
.panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}
.panel-empty {
  padding: 30px 15px;
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  line-height: 1.5;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
}
.toast {
  background: rgba(40, 40, 50, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 1.7s forwards;
  backdrop-filter: blur(10px);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Object List Items */
.obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text);
  transition: all 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
}
.obj-item:hover {
  background: rgba(255,255,255,0.06);
}
.obj-item.selected {
  background: rgba(120,180,255,0.12);
  border-color: rgba(120,180,255,0.35);
}
.obj-item .obj-visibility-btn {
  position: absolute;
  right: 28px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(100,150,255,0.15);
  border: none;
  color: #8ab4f8;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obj-item:hover .obj-visibility-btn {
  opacity: 1;
}
.obj-item .obj-visibility-btn:hover {
  background: rgba(100,150,255,0.3);
}
.obj-item .obj-visibility-btn.hidden {
  color: #666;
  background: rgba(100,100,100,0.2);
}
.obj-item .obj-delete-btn {
  position: absolute;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,80,80,0.2);
  border: none;
  color: #ff6060;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obj-item:hover .obj-delete-btn {
  opacity: 1;
}
.obj-item .obj-delete-btn:hover {
  background: rgba(255,80,80,0.4);
  color: #fff;
}
/* Multi-select styling */
.obj-item.multi-selected {
  background: rgba(120,180,255,0.08);
  border-color: rgba(120,180,255,0.25);
}
.obj-item.multi-selected.selected {
  background: rgba(120,180,255,0.15);
  border-color: rgba(120,180,255,0.4);
}
/* Group items */
.obj-item.is-group {
  background: rgba(180,120,255,0.1);
  border-color: rgba(180,120,255,0.25);
}
.obj-item.is-group.selected {
  background: rgba(180,120,255,0.18);
  border-color: rgba(180,120,255,0.4);
}
.obj-item .group-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(180,120,255,0.3);
  color: #c8a0ff;
  margin-left: 4px;
}
/* Group folder styles */
.obj-group-folder {
  margin-bottom: 2px;
}
.obj-group-folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text);
  transition: all 0.15s;
  border: 1px solid rgba(180,120,255,0.25);
  background: rgba(180,120,255,0.08);
  position: relative;
}
.obj-group-folder-header:hover {
  background: rgba(180,120,255,0.15);
}
.obj-group-folder-header.selected {
  background: rgba(180,120,255,0.2);
  border-color: rgba(180,120,255,0.45);
}
.obj-group-folder-header .folder-toggle {
  font-size: 10px;
  color: rgba(180,120,255,0.7);
  width: 14px;
  text-align: center;
  transition: transform 0.2s;
}
.obj-group-folder.expanded .folder-toggle {
  transform: rotate(90deg);
}
.obj-group-folder-header .icon {
  font-size: 14px;
}
.obj-group-folder-header .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.obj-group-folder-header .group-count {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 8px;
  background: rgba(180,120,255,0.25);
  color: #c8a0ff;
}
.obj-group-folder-header .obj-visibility-btn {
  position: absolute;
  right: 28px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(180,120,255,0.2);
  border: none;
  color: #c8a0ff;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obj-group-folder-header:hover .obj-visibility-btn {
  opacity: 1;
}
.obj-group-folder-header .obj-delete-btn {
  position: absolute;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,80,80,0.2);
  border: none;
  color: #ff6060;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.obj-group-folder-header:hover .obj-delete-btn {
  opacity: 1;
}
.obj-group-folder-contents {
  display: none;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid rgba(180,120,255,0.2);
  margin-top: 2px;
}
.obj-group-folder.expanded .obj-group-folder-contents {
  display: block;
}
.obj-group-folder-contents .obj-item {
  padding-left: 8px;
  opacity: 0.9;
}
.obj-group-folder-contents .obj-item::before {
  display: none; /* Remove the └ symbol since we have the border */
}
/* Selection count badge */
.selection-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(120,180,255,0.1);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.selection-actions .count {
  color: #8ab4f8;
  font-weight: 500;
}
.selection-actions button {
  padding: 3px 8px;
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.selection-actions button:hover {
  background: rgba(255,255,255,0.2);
}
.selection-actions button.danger {
  background: rgba(255,80,80,0.2);
  border-color: rgba(255,80,80,0.3);
  color: #ff8080;
}
.selection-actions button.danger:hover {
  background: rgba(255,80,80,0.35);
}
.obj-item .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.8;
  flex-shrink: 0;
}
.obj-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.obj-group {
  margin-bottom: 12px;
}
.obj-group-header {
  padding: 6px 10px 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.media-replace-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.media-replace-actions .btn-small {
  min-height: 32px;
  padding: 6px 7px;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
}
.clip-replace-actions {
  display: grid;
  margin-top: 8px;
}
.clip-replace-actions .btn-small {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
}
.clip-preset-name {
  overflow: hidden;
  padding: 7px 10px;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-waveform-detail {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.audio-waveform-detail .btn-small {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(190, 235, 255, 0.9);
  border-color: rgba(80, 190, 235, 0.32);
  background: rgba(35, 150, 190, 0.14);
}
.audio-waveform-detail .btn-small:hover:not(:disabled) {
  color: #e7f9ff;
  border-color: rgba(90, 205, 250, 0.52);
  background: rgba(35, 150, 190, 0.24);
}
.audio-waveform-detail .btn-small:disabled {
  cursor: default;
  opacity: 0.72;
}
.audio-waveform-detail .btn-small.is-ready {
  color: rgba(155, 235, 190, 0.9);
  border-color: rgba(95, 210, 145, 0.3);
  background: rgba(55, 165, 110, 0.13);
}
.audio-waveform-detail-status {
  min-height: 26px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.audio-waveform-detail-status.is-error {
  color: rgba(255, 155, 150, 0.88);
}

/* Parameter Controls */
.param-group {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line2);
}
.param-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.param-group-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.param-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.param-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.param-value {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.param-value input[type="range"] {
  flex: 1;
  height: 4px;
  min-width: 40px;
}

/* Custom font dropdown */
.font-dropdown {
  position: relative;
  width: 100%;
}
.font-dropdown-selected {
  padding: 6px 10px;
  background: #1a1d24;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.font-dropdown-selected:hover {
  border-color: rgba(255,255,255,0.4);
}
.font-dropdown-selected::after {
  content: '▼';
  font-size: 8px;
  opacity: 0.6;
}
.font-dropdown.open .font-dropdown-selected::after {
  content: '▲';
}
.font-dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #1a1d24;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  margin-top: 2px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.font-dropdown.open .font-dropdown-list {
  display: block;
}
.font-dropdown-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
}
.font-dropdown-item:hover {
  background: rgba(255,255,255,0.1);
}
.font-dropdown-item.selected {
  background: var(--accent);
  color: white;
}

/* Custom slider with value thumb */
.slider-wrapper {
  position: relative;
  flex: 1;
  min-width: 40px;
  height: 20px;
  display: flex;
  align-items: center;
}
.slider-wrapper input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
  margin: 0;
}
.slider-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 16px;
  background: transparent;
  cursor: pointer;
  border: none;
}
.slider-wrapper input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 16px;
  background: transparent;
  cursor: pointer;
  border: none;
}
.slider-wrapper input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.slider-wrapper input[type="range"]::-moz-range-track {
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.slider-thumb-value {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(80,140,200,0.9);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 1;
}
.slider-wrapper:hover .slider-thumb-value {
  background: rgba(100,160,220,1);
}
.slider-wrapper input[type="range"]:focus + .slider-thumb-value {
  background: rgba(120,180,255,1);
}

/* Grayed out sliders when keyframes exist */
.slider-wrapper.has-keyframes {
  opacity: 0.5;
  pointer-events: none;
}
.slider-wrapper.has-keyframes::after {
  content: '🔑';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.7;
}
input[type="range"].has-keyframes {
  opacity: 0.5;
  pointer-events: none;
}

.param-value input[type="number"] {
  width: 42px;
  min-width: 38px;
  padding: 4px 4px;
  font-size: 9px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-align: center;
  flex-shrink: 0;
}
.param-value input[type="number"]:focus {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
  outline: none;
}
.param-value input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
}
.param-value input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.slider-min, .slider-max {
  color: var(--muted) !important;
}
.slider-min:focus, .slider-max:focus {
  color: var(--text) !important;
}
.param-value .keyframe-toggle {
  margin-left: 2px;
}
.param-select {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  background: #1a1d24;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  min-width: 100px;
}
.param-select:hover {
  border-color: rgba(255,255,255,0.35);
}
.param-select:focus {
  outline: none;
  border-color: var(--accent, #4a9eff);
}
.param-select option {
  background: #1a1d24;
  color: #e0e0e0;
}
.param-xyz {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

/* Texture select styles */
.texture-select {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.texture-name {
  flex: 1;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  border: 1px solid var(--line);
}
.texture-name.has-texture {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}
.texture-btn {
  padding: 4px 8px !important;
  font-size: 12px !important;
  min-width: auto !important;
  height: auto !important;
}
.texture-clear-btn {
  padding: 4px 6px !important;
  font-size: 10px !important;
  min-width: auto !important;
  height: auto !important;
  color: #ff6666 !important;
}
.texture-clear-btn:hover {
  background: rgba(255,100,100,0.2) !important;
}

/* Select dropdown styling */
.param-value select {
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #1a1d24;
  color: var(--text);
  cursor: pointer;
  min-width: 80px;
}
.param-value select:hover {
  border-color: rgba(255,255,255,0.35);
}
.param-value select:focus {
  border-color: var(--accent);
  outline: none;
}
.param-value select option {
  background: #1a1d24;
  color: #e0e0e0;
}

.param-xyz input {
  width: 42px !important;
  min-width: 38px !important;
}
.param-xyz-label {
  font-size: 9px;
  color: var(--muted);
  width: 10px;
  text-align: center;
}

/* XYZ Slider Layout */
.param-xyz-sliders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.xyz-slider-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.xyz-axis {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.xyz-slider-row input[type="range"] {
  flex: 1;
  min-width: 40px;
  height: 4px;
}
.xyz-slider-row .slider-wrapper {
  flex: 1;
  min-width: 40px;
}
.xyz-min, .xyz-max {
  width: 36px !important;
  min-width: 32px !important;
  padding: 3px 4px !important;
  font-size: 9px !important;
  text-align: center;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  flex-shrink: 0;
}
.xyz-min:focus, .xyz-max:focus {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  outline: none;
  border-color: var(--accent);
}

/* Scale Lock Toggle */
.param-scale-container {
  width: 100%;
}
.scale-lock-row {
  margin-bottom: 8px;
}
.scale-lock-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
}
.scale-lock-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.scale-lock-label span {
  user-select: none;
}
.scale-lock-label:has(input:checked) span {
  color: var(--accent);
}

/* Hide panels in fullscreen */
body.fullscreen-mode .side-panel {
  display: none !important;
}
