/**
 * github.com/tawsiftorabi/ishkrin
 * ishkrin oled studio by tawsif torabi under kathaltech
 */

:root {
  /* Modern Dark Claymorphism Palette */
  --clay-bg: #131620;
  --clay-surface: #1a1e2d;
  --clay-surface-light: #242a3e;
  --clay-surface-pressed: #151824;
  --clay-border: rgba(255, 255, 255, 0.07);

  /* Clay Shadows (Outer soft drop + inner dual bevel) */
  --clay-shadow-card: 
    8px 8px 18px rgba(0, 0, 0, 0.45),
    -5px -5px 14px rgba(255, 255, 255, 0.04),
    inset 1px 1px 2px rgba(255, 255, 255, 0.12),
    inset -2px -2px 4px rgba(0, 0, 0, 0.35);

  --clay-shadow-btn: 
    5px 5px 12px rgba(0, 0, 0, 0.4),
    -3px -3px 8px rgba(255, 255, 255, 0.04),
    inset 1px 1px 1.5px rgba(255, 255, 255, 0.18),
    inset -1px -1px 3px rgba(0, 0, 0, 0.4);

  --clay-shadow-btn-active:
    2px 2px 6px rgba(0, 0, 0, 0.5),
    inset 2px 2px 5px rgba(0, 0, 0, 0.5),
    inset -1px -1px 2px rgba(255, 255, 255, 0.08);

  --clay-shadow-input:
    inset 2px 2px 5px rgba(0, 0, 0, 0.5),
    inset -1px -1px 3px rgba(255, 255, 255, 0.05);

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-cyan: #00f0ff;
  --accent-mint: #10b981;
  --accent-coral: #ef4444;
  --accent-amber: #f59e0b;

  --text-main: #f3f5fa;
  --text-muted: #9aa3be;
  --text-dim: #656d88;

  /* Separated Canvas Colors */
  --viewport-bg: #0d0f17;
  --oled-screen-bg: #000000;
  --oled-pixel-on: #00f0ff;
  --oled-pixel-off: #05070c;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--clay-surface-pressed);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--clay-surface-light);
  border-radius: 8px;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--clay-surface-light) var(--clay-surface-pressed);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--clay-bg);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Zero page scroll */
}

/* =========================================
   TOP HEADER TOOLBAR
   ========================================= */
header {
  background: var(--clay-surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 28px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0;
  padding: 0;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.4px;
  opacity: 0.95;
}

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #00f0ff);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: var(--clay-shadow-btn);
  display: flex;
  align-items: center;
  gap: 6px;
}

header h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--clay-surface-pressed);
  padding: 4px 12px;
  border-radius: 24px;
  box-shadow: var(--clay-shadow-input);
}

.header-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--clay-border);
}

.save-status-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-mint);
  margin-left: 6px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--clay-surface-pressed);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--clay-shadow-btn);
  border: 1px solid rgba(239, 68, 68, 0.4);
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
  animation: connectAttentionFlash 1.6s infinite ease-in-out;
}

@keyframes connectAttentionFlash {
  0%, 100% {
    background: var(--clay-surface-pressed);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: var(--clay-shadow-btn), 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: var(--clay-shadow-btn), 0 0 18px rgba(239, 68, 68, 0.6);
  }
}

.status-pill-btn:hover {
  background: var(--clay-surface-light);
  transform: translateY(-1px);
}

.status-pill-btn.connected {
  animation: none;
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--clay-surface-pressed);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 6px var(--accent-coral);
  animation: beaconPulse 1.6s infinite ease-in-out;
  transition: all 0.3s ease;
}

@keyframes beaconPulse {
  0%, 100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 10px 4px rgba(239, 68, 68, 0.5);
  }
}

.status-pill-btn.connected .status-dot {
  background: var(--accent-mint);
  box-shadow: 0 0 8px var(--accent-mint);
  animation: none;
  transform: scale(1);
}

.status-pill-btn.connecting {
  animation: connectingPulse 1.4s infinite ease-in-out;
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.08);
}

.status-pill-btn.connecting .status-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: beaconPulseCyan 1.2s infinite ease-in-out;
}

.status-pill-btn.reconnecting {
  animation: reconnectingPulse 1.4s infinite ease-in-out;
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
}

.status-pill-btn.reconnecting .status-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: beaconPulseAmber 1.2s infinite ease-in-out;
}

.status-pill-btn.flash-pill-btn {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
  cursor: pointer;
  text-decoration: none;
}

.status-pill-btn.flash-pill-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

@keyframes connectingPulse {
  0%, 100% {
    box-shadow: var(--clay-shadow-btn), 0 0 0 rgba(0, 240, 255, 0);
  }
  50% {
    box-shadow: var(--clay-shadow-btn), 0 0 14px rgba(0, 240, 255, 0.45);
  }
}

@keyframes reconnectingPulse {
  0%, 100% {
    box-shadow: var(--clay-shadow-btn), 0 0 0 rgba(245, 158, 11, 0);
  }
  50% {
    box-shadow: var(--clay-shadow-btn), 0 0 14px rgba(245, 158, 11, 0.45);
  }
}

@keyframes beaconPulseCyan {
  0%, 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7); }
  50% { transform: scale(1.25); box-shadow: 0 0 10px 3px rgba(0, 240, 255, 0.5); }
}

@keyframes beaconPulseAmber {
  0%, 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  50% { transform: scale(1.25); box-shadow: 0 0 10px 3px rgba(245, 158, 11, 0.5); }
}

/* =========================================
   3-COLUMN APP LAYOUT
   ========================================= */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 66px 1fr 280px; /* Minimal Left Toolstrip! */
  gap: 10px;
  padding: 10px 14px;
  overflow: hidden;
  height: calc(100vh - 52px);
}

.panel {
  background: var(--clay-surface);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--clay-shadow-card);
  overflow-y: auto;
  min-height: 0;
}

.panel-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================================
   MINIMAL VERTICAL ICON TOOL STRIP (LEFT)
   ========================================= */
.tool-strip {
  padding: 8px 6px;
  align-items: center;
  gap: 8px;
  overflow-x: hidden;
}

.tool-icons-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
}

.tool-icon-btn {
  width: 44px;
  height: 42px;
  padding: 0;
  font-size: 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-strip-divider {
  width: 36px;
  height: 1px;
  background: var(--clay-border);
  margin: 4px 0;
}

.brush-strip-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brush-size-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.brush-btn-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-icon-sm {
  width: 28px;
  height: 24px;
  padding: 0;
  font-size: 10px;
  border-radius: 6px;
}

/* Common Clay Buttons */
button {
  background: var(--clay-surface-light);
  color: var(--text-main);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--clay-shadow-btn);
  transition: all 0.12s ease;
  position: relative;
}

button:hover {
  background: #2b3248;
  transform: translateY(-1px);
}

button:active {
  box-shadow: var(--clay-shadow-btn-active);
  transform: translateY(1px);
}

button.active {
  background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: var(--clay-shadow-btn-active), 0 0 10px rgba(59, 130, 246, 0.5);
}

button.primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
}

button.primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

button.danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

button.btn-icon {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
}

button.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 8px;
}

.btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.btn-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

/* Inputs & selects */
input[type="text"], input[type="password"], select, .text-input {
  background: var(--clay-surface-pressed);
  color: var(--text-main);
  border: 1px solid var(--clay-border);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  width: 100%;
  outline: none;
  box-shadow: var(--clay-shadow-input);
}

input:focus, select:focus {
  border-color: var(--accent-blue);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* =========================================
   CANVAS WORKSPACE & VIEWPORT
   ========================================= */
.canvas-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--clay-surface);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--clay-shadow-card);
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.canvas-viewport {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--viewport-bg);
  background-image: 
    radial-gradient(#1c2236 1px, transparent 1px),
    radial-gradient(#141826 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border-radius: 14px;
  box-shadow: var(--clay-shadow-input);
  position: relative;
  cursor: crosshair;
}

.canvas-zoom-container {
  position: relative;
  border-radius: 6px;
  background: var(--oled-screen-bg);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.85),
    0 0 20px rgba(0, 240, 255, 0.08),
    0 0 0 3px #1a2233;
  display: inline-block;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
}

#drawCanvas, #overlayCanvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

#drawCanvas {
  background-color: var(--oled-pixel-off);
}

#overlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* =========================================
   CANVAS BOTTOM BAR (DISPLAY MODEL & ZOOM)
   ========================================= */
.canvas-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.canvas-bar-left, .canvas-bar-center, .canvas-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clay-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--clay-surface-pressed);
  padding: 3px 8px;
  border-radius: 20px;
  box-shadow: var(--clay-shadow-input);
  font-size: 11px;
}

.clay-pill-group select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  width: auto;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  cursor: pointer;
}

/* =========================================
   TOP DOCKED CONTEXT BAR FOR TEXT
   ========================================= */
.text-flyout {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  border-radius: 24px;
  padding: 5px 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), var(--clay-shadow-btn);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 95%;
  pointer-events: auto;
}

.text-flyout-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Inline Direct Canvas Text Box (Inside Zoom Container) */
.inline-canvas-text {
  position: absolute;
  z-index: 50;
  display: flex;
  align-items: center;
  border: 1px dashed var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  cursor: move;
  transform-origin: 0 0;
  pointer-events: auto;
}

.inline-text-field {
  background: transparent !important;
  border: none !important;
  color: var(--accent-cyan) !important;
  font-weight: 700;
  outline: none !important;
  padding: 2px 4px !important;
  box-shadow: none !important;
  width: auto;
  min-width: 35px;
  cursor: text;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.inline-text-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  font-size: 9px;
  color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.65);
  border-left: 1px dashed var(--accent-cyan);
  cursor: grab;
  user-select: none;
}

.inline-text-drag-handle:active {
  cursor: grabbing;
}

.font-search-box {
  position: relative;
}

.font-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 8px;
  max-height: 140px;
  overflow-y: auto;
  z-index: 110;
  display: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

.font-result-item {
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s;
}

.font-result-item:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* =========================================
   ILLUSTRATOR-STYLE LAYERS PANEL
   ========================================= */
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--clay-surface-pressed);
  border-radius: 12px;
  padding: 6px;
  max-height: 230px;
  overflow-y: auto;
  box-shadow: var(--clay-shadow-input);
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--clay-surface-light);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 11px;
  box-shadow: var(--clay-shadow-btn);
}

.layer-item:hover {
  background: #2b3248;
}

.layer-item.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.15);
}

.layer-icon-btn {
  background: transparent;
  border: none;
  padding: 1px 3px;
  cursor: pointer;
  font-size: 11px;
  box-shadow: none;
  color: var(--text-muted);
}

.layer-icon-btn:hover {
  color: #fff;
}

.layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* Dropzone (Clay) */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: var(--clay-surface-pressed);
  box-shadow: var(--clay-shadow-input);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.dropzone-icon {
  font-size: 22px;
  margin-bottom: 2px;
  color: var(--accent-cyan);
}

/* =========================================
   MODAL DIALOGS (Connection & Image Staging)
   ========================================= */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  border-radius: 20px;
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), var(--clay-shadow-card);
  overflow: hidden;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--clay-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.modal-body {
  padding: 16px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-preview-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview-box {
  background: #000;
  border: 2px solid #222;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

#ditherModalPreview {
  image-rendering: pixelated;
  display: block;
}

.modal-controls-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--clay-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.stats-box {
  background: var(--clay-surface-pressed);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--clay-shadow-input);
}

.stats-row {
  display: flex;
  justify-content: space-between;
}

.stats-val {
  color: var(--accent-cyan);
  font-weight: bold;
}

/* =========================================
   GLOBAL FLOATING TOOLTIP
   (Never clipped by container overflow, never off-screen)
   ========================================= */
.clay-floating-tooltip {
  position: fixed;
  z-index: 99999;
  background: rgba(15, 18, 28, 0.95);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid var(--clay-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 240, 255, 0.12);
  opacity: 0;
  transition: opacity 0.12s ease-out;
  transform: translate(0, 0);
}

.clay-floating-tooltip.visible {
  opacity: 1;
}

/* =========================================
   STUDIO MODE NAVIGATION & VIEWS
   ========================================= */
.studio-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--clay-surface-pressed);
  padding: 4px 6px;
  border-radius: 22px;
  box-shadow: var(--clay-shadow-input);
}

.studio-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.studio-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.studio-tab.active {
  background: linear-gradient(135deg, #2563eb, #00f0ff);
  color: #ffffff;
  box-shadow: var(--clay-shadow-btn);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.studio-view {
  display: none !important;
  flex: 1;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.studio-view.active {
  display: grid !important;
}

/* =========================================
   VIDEO STUDIO LAYOUT
   ========================================= */
.video-layout {
  display: grid;
  grid-template-columns: 1fr 10px var(--video-control-panel-width, 350px);
  gap: 6px;
  padding: 10px 14px;
  position: relative;
}

.workspace-v-splitter {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  width: 10px;
  user-select: none;
  z-index: 20;
  border-radius: 5px;
  background: transparent;
  transition: background 0.15s ease;
}

.workspace-v-splitter:hover,
.workspace-v-splitter.is-dragging {
  background: rgba(0, 240, 255, 0.14);
}

.workspace-v-splitter .splitter-grip-bar {
  width: 4px;
  height: 48px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  transition: all 0.15s ease;
}

.workspace-v-splitter:hover .splitter-grip-bar,
.workspace-v-splitter.is-dragging .splitter-grip-bar {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
  height: 72px;
}

.video-source-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-canvas-container {
  flex: 1;
  background: #000;
  border-radius: 12px;
  border: 1px solid var(--clay-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  min-height: 220px;
}

#videoSourceCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: crosshair;
  transition: transform 0.08s ease-out;
  transform-origin: center center;
}

/* Floating Canvas Zoom Controls */
.video-canvas-zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  padding: 3px 6px;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.video-canvas-zoom-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.video-canvas-zoom-controls button:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.video-canvas-zoom-controls button:active {
  transform: scale(0.92);
}

.video-canvas-zoom-controls .zoom-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 6px;
  min-width: 44px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.video-canvas-zoom-controls .zoom-badge:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

/* Low-CPU Performance Mode Overlay & Buttons */
.btn-perf-toggle {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-perf-toggle.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.btn-perf-toggle.disabled-preview {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-oled-only-toggle.active {
  background: rgba(52, 211, 153, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.5) !important;
  color: var(--accent-mint) !important;
  font-weight: 700;
}

.video-perf-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 18px;
  text-align: center;
}

.perf-overlay-card {
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.perf-overlay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-mint);
  background: rgba(52, 211, 153, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.perf-overlay-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.perf-overlay-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.video-playback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--clay-surface-pressed);
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: var(--clay-shadow-input);
}

.scrub-slider {
  flex: 1;
}

.time-display {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 90px;
}

.fps-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.video-dropzone {
  padding: 14px;
  border-radius: 12px;
}

.video-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Video Orientation Selector */
.video-orientation-toggle {
  display: flex;
  gap: 6px;
  background: var(--clay-surface-pressed);
  padding: 4px;
  border-radius: 10px;
  box-shadow: var(--clay-shadow-input);
}

.btn-orient {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

.btn-orient.active {
  background: linear-gradient(135deg, #2563eb, #00f0ff);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.35);
}

.btn-orient.flip-active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-rotate-source {
  margin-top: 6px;
  width: 100%;
  font-size: 11px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Pre-render Lock Prompt Banner */
.video-lock-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 10px;
  padding: 8px 12px;
  animation: lockPulse 2s infinite ease-in-out;
}

.video-lock-prompt.shake {
  animation: lockShake 0.4s ease-in-out;
}

.lock-prompt-icon {
  font-size: 20px;
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-prompt-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #fbbf24;
}

.lock-prompt-content strong {
  font-size: 12px;
  color: #fef08a;
}

.lock-prompt-desc {
  color: rgba(254, 240, 138, 0.9);
  line-height: 1.3;
  font-size: 10.5px;
}

.btn-danger-ghost {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid #ef4444;
  color: #fca5a5;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  border-radius: 7px;
  padding: 4px 10px;
  transition: all 0.2s;
}

.btn-danger-ghost:hover {
  background: #ef4444;
  color: #fff;
}

@keyframes lockPulse {
  0%, 100% { border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
  50% { border-color: rgba(245, 158, 11, 0.85); box-shadow: 0 0 18px rgba(245, 158, 11, 0.35); }
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Media Bin Collapsed State */
.video-mediabin-panel.mediabin-collapsed .mediabin-grid,
.video-mediabin-panel.mediabin-collapsed .video-missing-files-banner {
  display: none !important;
}
.video-mediabin-panel.mediabin-collapsed {
  padding-bottom: 6px;
}

/* Timeline Height Splitter (Premiere Pro style) */
.timeline-h-splitter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 12px;
  cursor: row-resize;
  user-select: none;
  z-index: 15;
  margin: -2px 0 2px 0;
  transition: all 0.15s ease;
  position: relative;
}

.timeline-h-splitter .splitter-line-h {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  transition: all 0.15s ease;
}

.timeline-h-splitter .splitter-grip-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 11px;
  border-radius: 5px;
  background: #1a202e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 8px;
  transition: all 0.15s ease;
}

.timeline-h-splitter:hover .splitter-line-h,
.timeline-h-splitter.is-dragging .splitter-line-h {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.timeline-h-splitter:hover .splitter-grip-pill,
.timeline-h-splitter.is-dragging .splitter-grip-pill {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

body.resizing-row {
  cursor: row-resize !important;
  user-select: none !important;
}
body.resizing-col {
  cursor: col-resize !important;
  user-select: none !important;
}

/* =========================================
   PREMIERE-PRO STYLE INTERACTIVE TIMELINE
   ========================================= */
.premiere-timeline-panel {
  --ptl-headers-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #141721;
  border: 1px solid var(--clay-border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--clay-shadow-card);
  user-select: none;
}

.ptl-toolbar,
.ptl-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #1a1e2b;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Premiere-Pro Style Timeline Layout: Vertical Toolbar on Left + Tracks on Right */
.ptl-body-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

/* Vertical Button Toolbar (Like Adobe Premiere Pro Tools Panel) */
.ptl-vertical-toolbar {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  grid-auto-rows: 27px;
  gap: 3px;
  align-content: start;
  background: #161924;
  border: 1px solid var(--clay-border);
  border-radius: 8px;
  padding: 4px;
  width: 74px;
  min-width: 74px;
  height: var(--ptl-tracks-height, 252px);
  min-height: 140px;
  max-height: 600px;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.08), 2px 2px 8px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.btn-vtool {
  position: relative;
  width: 32px;
  height: 27px;
  background: var(--clay-surface-pressed);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s ease;
  box-shadow: var(--clay-shadow-btn);
  padding: 0;
}

.btn-vtool:hover:not(:disabled) {
  background: var(--clay-surface-light);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.btn-vtool.active {
  background: rgba(0, 240, 255, 0.18);
  color: #00f0ff;
  border-color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.btn-vtool:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.btn-vtool.danger:hover:not(:disabled) {
  color: var(--accent-coral);
  border-color: rgba(239, 68, 68, 0.5);
}

.vtool-kbd {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 7px;
  font-family: monospace;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.btn-vtool.active .vtool-kbd {
  color: #00f0ff;
}

/* Master Video Files Audio Volume Group */
.ptl-video-audio-group {
  background: #0d0f15;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Premiere Pro Track Pre-Render Group & Button */
.ptl-prerender-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-track-prerender {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-track-prerender:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.25));
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.btn-track-prerender.rendered {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #10b981;
}

.btn-track-prerender.rendering {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fbbf24;
}

#btnVideoCache.rendered {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

.btn-icon-xs.muted,
.btn-icon-sm.muted,
.btn-xs.muted {
  color: var(--accent-coral) !important;
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.ptl-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ptl-transport .btn-icon-sm {
  width: 28px;
  height: 26px;
  font-size: 11px;
}

.btn-play-pause {
  min-width: 68px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ptl-timecode {
  background: #0d0f15;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
}

.ptl-tc-icon {
  color: var(--text-muted);
  font-size: 11px;
}

.ptl-timecode-val {
  font-weight: 700;
  color: #00f0ff;
  letter-spacing: 0.5px;
  min-width: 60px;
}

.ptl-sep {
  color: rgba(255, 255, 255, 0.2);
}

.ptl-frame-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ptl-frame-input {
  width: 48px;
  height: 20px;
  background: #1e2333;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 0 2px;
}

.ptl-frame-input:focus {
  outline: none;
  border-color: #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.ptl-frame-total {
  font-size: 10px;
  color: var(--text-muted);
}

.ptl-btn-kf {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ptl-auto-kf {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.ptl-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  transition: all 0.2s;
}

.ptl-auto-kf input:not(:checked) + .ptl-rec-dot {
  background: #475569;
  box-shadow: none;
}

.ptl-fps-group {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Tracks Container */
.ptl-tracks-container {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #0f121a;
  border: 1px solid var(--clay-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  height: var(--ptl-tracks-height, 252px);
  min-height: 140px;
  max-height: 600px;
}

/* Pinned Track Headers Column */
.ptl-tracks-headers-col {
  width: var(--ptl-headers-width, 260px);
  min-width: var(--ptl-headers-width, 260px);
  max-width: var(--ptl-headers-width, 260px);
  display: flex;
  flex-direction: column;
  background: #1a202e;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}

/* Vertical Resizer Splitter between Track Headers and Lanes (Premiere Pro style) */
.timeline-v-splitter {
  width: 6px;
  min-width: 6px;
  max-width: 6px;
  cursor: col-resize;
  background: rgba(255, 255, 255, 0.04);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  flex-shrink: 0;
  height: 100%;
}

.timeline-v-splitter:hover,
.timeline-v-splitter.is-dragging {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.splitter-grip-v {
  width: 2px;
  height: 20px;
  border-left: 1px dotted rgba(255, 255, 255, 0.4);
  border-right: 1px dotted rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

body.resizing-col,
body.resizing-col * {
  cursor: col-resize !important;
  user-select: none !important;
}

.ptl-tracks-headers-col::-webkit-scrollbar {
  display: none;
}

.ptl-tracks-headers-col .ptl-track-header {
  width: 100%;
  min-width: 100%;
  border-right: none;
  box-sizing: border-box;
}

.ptl-tracks-headers-col .ptl-ruler-header {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  flex: 0 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ptl-tracks-headers-col .ptl-video-header {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  flex: 0 0 46px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptl-tracks-headers-col .ptl-audio-header {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptl-tracks-headers-col .ptl-led-header {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex: 0 0 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(14, 165, 233, 0.03);
}

.ptl-tracks-headers-col .ptl-crop-header {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
}

/* Scrollable Lanes Viewport & Zoomed Content */
.ptl-lanes-scroll-area {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ptl-lanes-scroll-area::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.ptl-lanes-scroll-area::-webkit-scrollbar-track {
  background: #0d1017;
}

.ptl-lanes-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ptl-lanes-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.45);
}

.ptl-lanes-content {
  position: relative;
  min-width: 100%;
  width: 100%;
  min-height: 246px;
  display: flex;
  flex-direction: column;
  transition: width 0.08s ease-out;
}

.ptl-ruler-body {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  flex: 0 0 26px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.ptl-track-lane.ptl-video-lane {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  flex: 0 0 46px;
  position: relative;
  background: #0d1017;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  overflow: hidden;
}

.ptl-track-lane.ptl-audio-lane {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  position: relative;
  background: #0d1017;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  overflow: hidden;
}

.ptl-track-lane.ptl-led-lane {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex: 0 0 52px;
  position: relative;
  background: #0a0d13;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  overflow: hidden;
}

.ptl-track-lane.ptl-crop-lane {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  position: relative;
  background: #0d1017;
  box-sizing: border-box;
  overflow: hidden;
}

/* Track Lane Locked State */
.ptl-track-lane.track-locked {
  background: repeating-linear-gradient(
    -45deg,
    rgba(15, 18, 26, 0.96),
    rgba(15, 18, 26, 0.96) 12px,
    rgba(26, 32, 46, 0.96) 12px,
    rgba(26, 32, 46, 0.96) 24px
  ) !important;
}

.ptl-track-lane.track-locked .ptl-clip-block,
.ptl-track-lane.track-locked .ptl-audio-clip-block,
.ptl-track-lane.track-locked .ptl-kf-diamond {
  opacity: 0.5 !important;
  filter: grayscale(0.6);
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.ptl-track-lane.track-locked::after {
  content: 'LOCKED';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 8;
}

/* Timeline Zoom Toolbar Group */
.ptl-zoom-group {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #0d0f15;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
}

.ptl-zoom-val {
  font-family: monospace;
  font-size: 10px;
  color: #38bdf8;
  min-width: 32px;
  text-align: right;
  font-weight: 600;
}

#timelineZoomSlider {
  accent-color: #38bdf8;
  height: 4px;
  cursor: pointer;
}

/* Media Bin & Asset Library */
.video-mediabin-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--clay-shadow-card);
}

.mediabin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mediabin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.mediabin-title i {
  color: #38bdf8;
}

.mediabin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mediabin-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  max-height: 96px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
}

.mediabin-grid::-webkit-scrollbar {
  height: 5px;
}

.mediabin-grid::-webkit-scrollbar-thumb {
  background: var(--clay-border);
  border-radius: 3px;
}

.mediabin-drop-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mediabin-drop-hint:hover,
.mediabin-drop-hint.dragover {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.05);
  color: var(--text-main);
}

.mediabin-card {
  min-width: 140px;
  max-width: 170px;
  height: 56px;
  background: #191e2b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: grab;
  transition: all 0.2s ease;
  flex-shrink: 0;
  user-select: none;
}

.mediabin-card[draggable="true"]:active {
  cursor: grabbing;
}

.mediabin-card.is-dragging {
  opacity: 0.45;
  border: 1px dashed var(--accent) !important;
  transform: scale(0.96);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.mediabin-card:hover {
  border-color: #38bdf8;
  background: #1e2536;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mediabin-card.active {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* Highlight timeline lane when dragging over with media */
.ptl-track-lane.drag-target-lane {
  background: rgba(0, 240, 255, 0.08) !important;
  outline: 1px dashed rgba(0, 240, 255, 0.6);
  outline-offset: -1px;
}

.ptl-track-lane.drag-target-locked {
  background: rgba(239, 68, 68, 0.1) !important;
  outline: 1px dashed rgba(239, 68, 68, 0.6);
  outline-offset: -1px;
}

/* Live Ghost Placement Fit Box */
.ptl-drop-ghost-fit {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 6px;
  border: 2px dashed #00f0ff;
  background: rgba(0, 240, 255, 0.24);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.2);
  pointer-events: none;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px 8px;
  overflow: hidden;
  box-sizing: border-box;
  animation: ghostPulse 1.2s ease-in-out infinite;
  transition: left 0.04s ease-out, width 0.04s ease-out;
}

@keyframes ghostPulse {
  0%, 100% {
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 240, 255, 0.15);
  }
  50% {
    border-color: #38bdf8;
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.75), inset 0 0 14px rgba(0, 240, 255, 0.35);
  }
}

.ptl-drop-ghost-fit.ghost-v2 {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5);
}

.ptl-drop-ghost-fit.ghost-audio {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

.ptl-drop-ghost-fit.ghost-locked {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.3) !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6) !important;
  animation: none !important;
}

.ptl-drop-ghost-fit .ghost-fit-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.ptl-drop-ghost-fit .ghost-track-pill {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  color: #38bdf8;
}

.ghost-v2 .ghost-track-pill {
  color: #c084fc;
}
.ghost-audio .ghost-track-pill {
  color: #34d399;
}

.ptl-drop-ghost-fit .ghost-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.ptl-drop-ghost-fit .ghost-fit-time {
  font-size: 9px;
  font-family: ui-monospace, monospace;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.ptl-drop-ghost-fit .ghost-dur-badge {
  font-size: 8px;
  opacity: 0.85;
}

.ptl-drop-ghost-fit .ghost-snap-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(251, 191, 36, 0.6);
  padding: 0 4px;
  border-radius: 3px;
  color: #fbbf24;
  font-weight: 600;
}

.ptl-drop-ghost-fit .ghost-extend-badge {
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.6);
  padding: 0 4px;
  border-radius: 3px;
  color: #38bdf8;
  font-weight: 600;
}

.ptl-drop-ghost-fit .ghost-locked-badge {
  font-size: 8px;
  font-weight: 800;
  color: #fca5a5;
  background: rgba(185, 28, 28, 0.7);
  padding: 0 4px;
  border-radius: 3px;
}

.ptl-drop-ghost-fit .ghost-fit-badge {
  font-size: 8px;
  font-weight: 600;
  color: #a7f3d0;
  background: rgba(6, 95, 70, 0.6);
  padding: 0 4px;
  border-radius: 3px;
}

.mediabin-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #0d1017;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 16px;
  color: #38bdf8;
  flex-shrink: 0;
}

.mediabin-thumb img,
.mediabin-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mediabin-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mediabin-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mediabin-meta {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-media-type {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-type-video {
  background: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge-type-gif {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.badge-type-audio {
  background: rgba(16, 185, 129, 0.3);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.mediabin-card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-card-add {
  background: #2563eb;
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.btn-card-add:hover {
  background: #3b82f6;
}

.btn-card-del {
  background: transparent;
  border: none;
  color: #94a3b8;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 9px;
  cursor: pointer;
}

.btn-card-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* Multi-Track Timeline & Clips */
.ptl-clip-tools {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 8px;
}

.btn-icon-xs {
  width: 22px;
  height: 20px;
  padding: 0;
  font-size: 10px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-xs:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.ptl-video-track-row {
  height: 44px;
  background: #11141e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptl-audio-track-row {
  height: 38px;
  background: #0f171d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ptl-keyframe-track-row {
  height: 34px;
  background: #0e1118;
}

.ptl-clips-container,
.ptl-audio-clips-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
}

/* Video Clip Blocks on V1 Track */
.ptl-clip-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.55), rgba(79, 70, 229, 0.65));
  border: 1.5px solid rgba(99, 102, 241, 0.85);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  z-index: 4;
}

.ptl-clip-block:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.ptl-clip-block.selected {
  border-color: #00f0ff !important;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.7), rgba(99, 102, 241, 0.8)) !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.65), inset 0 0 8px rgba(0, 240, 255, 0.25) !important;
  z-index: 6;
}

.ptl-clip-block:active {
  cursor: grabbing;
}

/* Trim Handles */
.clip-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  z-index: 8;
  cursor: col-resize;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.clip-trim-handle::after {
  content: '';
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1px;
}

.clip-trim-handle:hover {
  background: #00f0ff !important;
}

.clip-trim-handle:hover::after {
  background: #000;
}

.clip-trim-handle.trim-left {
  left: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.4);
}

.clip-trim-handle.trim-right {
  right: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.4);
}

.clip-content {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  pointer-events: none;
}

.clip-label {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.clip-sublabel {
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.75);
  font-family: monospace;
}

/* Audio Waveform Canvas */
#videoAudioWaveformCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.ptl-audio-clip-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.45));
  border: 1.5px solid rgba(16, 185, 129, 0.8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  z-index: 3;
}

.ptl-audio-clip-block:active {
  cursor: grabbing;
}

.ptl-audio-clip-block.selected {
  border-color: #34d399 !important;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6) !important;
}
.ptl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 15;
  pointer-events: none;
  transform: translateX(-50%);
  left: 0;
}

.ptl-playhead-handle {
  width: 16px;
  height: 20px;
  background: #00f0ff;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  clip-path: polygon(0% 0%, 100% 0%, 100% 60%, 50% 100%, 0% 60%);
  cursor: ew-resize;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.6);
  transition: transform 0.1s ease;
}

.ptl-playhead-handle:hover,
.ptl-playhead-handle:active {
  transform: translateX(-50%) scale(1.15);
  background: #ffffff;
  box-shadow: 0 0 12px #00f0ff;
}

.ptl-playhead-line {
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.8);
  transform: translateX(-50%);
}

/* Ruler Row */
.ptl-ruler-row {
  display: flex;
  height: 26px;
  background: #161b26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ptl-track-header {
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  background: #1a202e;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  z-index: 2;
  user-select: none;
}

.ptl-ruler-header {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ptl-ruler-body {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

#videoRulerCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Track Row */
.ptl-track-row {
  display: flex;
  height: 42px;
  background: #11141d;
  position: relative;
}

/* Track Locking Styles */
.btn-track-lock {
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-track-lock:hover {
  color: #fbbf24 !important;
}

.btn-track-lock.locked {
  color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}

.ptl-track-header.track-locked .ptl-track-name {
  color: #fbbf24 !important;
}

.ptl-track-row.track-locked {
  position: relative;
}

.ptl-track-row.track-locked .ptl-track-lane {
  background: repeating-linear-gradient(
    -45deg,
    rgba(15, 18, 26, 0.96),
    rgba(15, 18, 26, 0.96) 12px,
    rgba(26, 32, 46, 0.96) 12px,
    rgba(26, 32, 46, 0.96) 24px
  ) !important;
}

.ptl-track-row.track-locked .ptl-clip-block,
.ptl-track-row.track-locked .ptl-audio-clip-block,
.ptl-track-row.track-locked .ptl-kf-diamond {
  opacity: 0.5 !important;
  filter: grayscale(0.6);
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.ptl-track-row.track-locked::after {
  content: 'LOCKED';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(245, 158, 11, 0.6);
  pointer-events: none;
  z-index: 9;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Video Studio Toast */
.video-toast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #f8fafc;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: videoToastFade 2.2s forwards;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-toast.warning {
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
}

@keyframes videoToastFade {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

/* Autosave & Timeline Rebuild Styling */
.save-status-badge.saving {
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
  background: rgba(251, 191, 36, 0.12) !important;
}

.save-status-badge.warning {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  background: rgba(248, 113, 113, 0.12) !important;
}

.video-missing-files-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 4px;
  animation: fadeIn 0.25s ease-out;
}

.missing-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fef3c7;
  font-size: 11px;
}

.missing-banner-content i {
  color: #fbbf24;
  font-size: 15px;
}

.missing-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Rebuild Modal Styling */
.rebuild-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151a26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.rebuild-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rebuild-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.rebuild-status-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.rebuild-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.rebuild-status-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.rebuild-summary-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.rebuild-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.04);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rebuild-dropzone:hover,
.rebuild-dropzone.dragover {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
}

.rebuild-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rebuild-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.15s ease;
}

.rebuild-file-row.missing {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.04);
}

.rebuild-file-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rebuild-file-thumb {
  width: 44px;
  height: 32px;
  border-radius: 4px;
  background: #0d1017;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #38bdf8;
  flex-shrink: 0;
}

.rebuild-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rebuild-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rebuild-file-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.rebuild-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.rebuild-file-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge-rebuild-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-rebuild-status.ready {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-rebuild-status.missing {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mediabin-card.missing-media {
  border-color: rgba(245, 158, 11, 0.5) !important;
  background: rgba(245, 158, 11, 0.06) !important;
}

.ptl-clip-block.missing-clip,
.ptl-audio-clip-block.missing-clip {
  border: 1px dashed rgba(245, 158, 11, 0.75) !important;
  box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.25);
}

.btn-warning-glow {
  border-color: rgba(245, 158, 11, 0.8) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.ptl-track-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.ptl-track-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ptl-anchor-val {
  font-family: monospace;
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.ptl-track-lane {
  position: relative;
  cursor: crosshair;
  overflow: hidden;
  background: #0d1017;
}

.ptl-lane-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 100%;
}

.ptl-kf-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
}

/* Keyframe Diamonds */
.ptl-kf-diamond {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #00f0ff;
  border: 1.5px solid #ffffff;
  border-radius: 2px;
  cursor: grab;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  z-index: 5;
}

.ptl-kf-diamond:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.3);
  background: #ffffff;
  box-shadow: 0 0 12px #ffffff;
}

.ptl-kf-diamond:active {
  cursor: grabbing;
}

.ptl-kf-diamond.selected {
  background: #ffb700;
  border-color: #ffffff;
  box-shadow: 0 0 14px #ffb700;
  transform: translate(-50%, -50%) rotate(45deg) scale(1.35);
}

.ptl-footer-hint {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
}

.switch-label-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.anchor-readout {
  font-family: monospace;
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}

.video-oled-bezel {
  background: #000;
  border: 4px solid #1e2333;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.18), inset 0 0 10px rgba(0, 0, 0, 0.9);
  transition: all 0.3s ease;
}

#videoOledCanvas {
  width: 256px;
  height: 128px;
  image-rendering: pixelated;
  background: #000;
  transition: width 0.3s ease, height 0.3s ease;
}

.video-oled-bezel.vertical #videoOledCanvas {
  width: 128px;
  height: 256px;
}

.btn-stream {
  width: 100%;
  font-size: 13px;
  padding: 10px;
}

.btn-stream.active,
#btnAnimStream.active {
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: #fff !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  animation: streamPulseMinimal 2s infinite ease-in-out;
  transform: none !important;
}

.btn-stream.active i,
#btnAnimStream.active i {
  animation: streamIconBlink 1.6s infinite ease-in-out;
}

@keyframes streamPulseMinimal {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 3px 16px rgba(239, 68, 68, 0.6);
  }
}

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

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================
   ANIMATION STUDIO LAYOUT
   ========================================= */
.anim-layout {
  grid-template-rows: 1fr 240px;
  gap: 10px;
  padding: 10px 14px;
}

.anim-top-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 10px;
  min-height: 0;
}

.anim-stage-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anim-stage-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.anim-stage-viewport {
  flex: 1;
  background: #080a10;
  border-radius: 12px;
  border: 1px solid var(--clay-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.85);
}

#animStageCanvas {
  image-rendering: pixelated;
}

.anim-playback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--clay-surface-pressed);
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: var(--clay-shadow-input);
}

.anim-inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.prop-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Timeline Panel */
.anim-timeline-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  min-height: 0;
}

.timeline-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-filename {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.timeline-hints {
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-ruler-container {
  height: 20px;
  background: var(--clay-surface-pressed);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  box-shadow: var(--clay-shadow-input);
  overflow: hidden;
}

.timeline-playhead-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  pointer-events: none;
  z-index: 10;
  transition: left 0.04s linear;
}

.timeline-playhead-needle::after {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 8px;
  background: #ef4444;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.timeline-waveform-row {
  display: flex;
  align-items: center;
  height: 38px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--clay-border);
}

.waveform-header {
  width: 90px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-left: 10px;
  flex-shrink: 0;
}

.waveform-canvas-box {
  flex: 1;
  height: 100%;
  position: relative;
}

#animWaveformCanvas {
  width: 100%;
  height: 100%;
}

.timeline-tracks-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.anim-track-row {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--clay-surface-pressed);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.anim-track-row:hover {
  background: var(--clay-surface-light);
}

.anim-track-row.active {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.05);
}

.anim-track-header {
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  border-right: 1px solid var(--clay-border);
}

.track-actions {
  display: flex;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.track-actions i:hover {
  color: var(--text-main);
}

.anim-track-lane {
  flex: 1;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.keyframe-diamond {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent-cyan);
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--accent-cyan);
  cursor: grab;
  transition: transform 0.1s ease;
}

.keyframe-diamond:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.3);
}

.keyframe-diamond.selected {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* =========================================
   WIFI PUSH PROVISIONING CARD IN MODAL
   ========================================= */
.wifi-push-card {
  background: var(--clay-surface-pressed);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--clay-shadow-input);
  margin-top: 4px;
}

.wifi-push-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.badge-mini {
  font-size: 9px;
  font-weight: 800;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wifi-feedback-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.wifi-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-mint);
}

.wifi-feedback-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-coral);
}

.wifi-feedback-box.loading {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-blue);
}

/* =========================================
   ANIMATION PRESETS LIBRARY (110+ PRESETS)
   ========================================= */
.presets-modal-card {
  max-width: 960px !important;
  width: 94vw;
  max-height: 88vh;
  height: 88vh;
  display: flex;
  flex-direction: column;
}

.presets-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.presets-modal-toolbar {
  padding: 12px 18px;
  background: var(--clay-surface-pressed);
  border-bottom: 1px solid var(--clay-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.presets-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: var(--clay-shadow-input);
}

.presets-search-box i {
  color: var(--text-dim);
  font-size: 13px;
}

.presets-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
}

.presets-search-box input::placeholder {
  color: var(--text-dim);
}

.presets-category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.btn-cat {
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.18s ease;
  box-shadow: var(--clay-shadow-btn);
}

.btn-cat:hover {
  background: var(--clay-surface-light);
  color: var(--text-main);
}

.btn-cat.active {
  background: var(--clay-surface-light);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25), inset 1px 1px 2px rgba(255, 255, 255, 0.15);
}

.btn-cat .cat-count {
  font-size: 10px;
  opacity: 0.65;
}

.presets-modal-body {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  background: var(--clay-bg);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.preset-card {
  background: var(--clay-surface);
  border: 1px solid var(--clay-border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--clay-shadow-btn);
  position: relative;
  overflow: hidden;
}

.preset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 240, 255, 0.2);
}

.preset-thumb-wrap {
  width: 100%;
  height: 84px;
  background: #000000;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
}

.preset-thumb-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.preset-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(10, 14, 24, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  letter-spacing: 0.3px;
}

.preset-badge.badge-deskbuddy {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.preset-badge.badge-meme {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.preset-badge.badge-emoji {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.4);
}

.preset-badge.badge-ui {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.preset-badge.badge-retro {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
}

.preset-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preset-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card-meta {
  font-size: 10px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.preset-card-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 28px;
}

.preset-card-btn {
  margin-top: auto;
  width: 100%;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--clay-surface-light);
  border: 1px solid var(--clay-border);
  color: var(--text-main);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.preset-card:hover .preset-card-btn {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
}

.presets-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.presets-empty-state i {
  font-size: 38px;
  color: var(--text-dim);
}

.presets-empty-state p {
  font-size: 13px;
}

.presets-modal-footer {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--clay-border);
  background: var(--clay-surface);
}

.presets-footer-hint {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.presets-footer-hint i {
  color: var(--accent-cyan);
}

/* ==========================================
   VIDEO STUDIO ENHANCEMENTS: MULTI-TRACK, SPEED REMAP & PER-CLIP DITHER
   ========================================== */

/* Time Remapping / Rate Stretch Button */
#btnTimeRemapTool.active {
  background: rgba(245, 158, 11, 0.25) !important;
  border-color: rgba(245, 158, 11, 0.8) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.timeline-stretch-mode .clip-trim-handle {
  background: rgba(245, 158, 11, 0.35) !important;
  cursor: ew-resize !important;
}

.timeline-stretch-mode .clip-trim-handle::after {
  background: #fbbf24 !important;
}

.timeline-stretch-mode .clip-trim-handle:hover {
  background: #f59e0b !important;
}

/* Clip Speed & Dither Badges */
.clip-speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
}

.clip-dither-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.clip-brightness-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.clip-brightness-box {
  transition: all 0.2s ease;
}

.clip-brightness-box:hover {
  border-color: rgba(251, 191, 36, 0.45) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

/* Zoom & History Controls */
.ptl-zoom-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ptl-history-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Track V2 Styling (Overlay Video / GIF) */
#rowV2Track {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#rowV2Track .ptl-track-header {
  border-left: 3px solid #a855f7;
}

#videoClipsTrackLaneV2 {
  position: relative;
  height: 100%;
}

.ptl-clip-block.v2-clip {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.6), rgba(192, 38, 211, 0.7));
  border-color: rgba(192, 38, 211, 0.85);
}

.ptl-clip-block.v2-clip.selected {
  border-color: #f0abfc !important;
  box-shadow: 0 0 14px rgba(240, 171, 252, 0.65), inset 0 0 8px rgba(240, 171, 252, 0.25) !important;
}

/* Track Lock Buttons */
.ptl-track-meta .btn-icon-xs.locked {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.18) !important;
}

/* =========================================
   WEBSOCKET AUTO-CONNECT & PROMPT STYLES
   ========================================= */
.ws-autoconnect-card {
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--clay-shadow-card);
  margin-top: 4px;
}

.ws-autoconnect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-autoconnect-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.control-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.control-checkbox input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Prompt Hero inside wsAutoConnectPromptModal */
.ws-prompt-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
}

.ws-prompt-icon {
  position: relative;
  width: 50px;
  height: 50px;
  min-width: 50px;
  background: var(--clay-surface);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25), var(--clay-shadow-btn);
}

.ws-prompt-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--accent-mint);
  border: 2px solid var(--clay-surface);
  border-radius: 50%;
  font-size: 9px;
  color: #0b101b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-prompt-text h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.ws-prompt-text p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.ws-prompt-options {
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 10px 14px;
}

/* =========================================
   GLOBAL APP TOAST NOTIFICATIONS
   ========================================= */
.app-toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  color: #f8fafc;
  background: rgba(19, 22, 32, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--clay-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), var(--clay-shadow-btn);
  animation: appToastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 90vw;
  transition: all 0.25s ease;
}

.app-toast.info {
  border-color: rgba(0, 240, 255, 0.45);
}
.app-toast.info i {
  color: var(--accent-cyan);
}

.app-toast.success {
  border-color: rgba(16, 185, 129, 0.5);
}
.app-toast.success i {
  color: var(--accent-mint);
}

.app-toast.warning {
  border-color: rgba(245, 158, 11, 0.55);
}
.app-toast.warning i {
  color: var(--accent-amber);
}

.app-toast.error {
  border-color: rgba(239, 68, 68, 0.55);
}
.app-toast.error i {
  color: var(--accent-coral);
}

.app-toast .app-toast-action {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s ease;
}

.app-toast .app-toast-action:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

@keyframes appToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appToastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

/* =========================================
   CLIP TRANSFORM & KEYFRAMING STYLES
   ========================================= */
.clip-transform-box {
  transition: all 0.2s ease;
}

.clip-kf-bar button.active {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.clip-transform-diamond {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  background: #38bdf8;
  border: 1px solid #ffffff;
  transform: translate(-50%, -50%) rotate(45deg);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.8);
}

.clip-transform-diamond:hover {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.35);
  background: #60a5fa;
  border-color: #ffffff;
  z-index: 6;
}

.clip-transform-diamond.active {
  background: #fbbf24;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.9);
}

.mediabin-badge.image {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.crop-control-box {
  transition: all 0.2s ease;
}
.crop-control-box:hover {
  border-color: rgba(0, 240, 255, 0.45) !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}






/* ==========================================================================
   PHYSICAL LED TRACK (L1), INSPECTOR & AUDIO FFT STYLES
   ========================================================================== */

/* L1 Track Sublanes Guide */
.ptl-led-sublanes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.ptl-led-sublane-row {
  height: 13px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
  position: relative;
  display: flex;
  align-items: center;
}

.sublane-badge {
  position: absolute;
  left: 4px;
  font-size: 8px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  line-height: 11px;
  opacity: 0.35;
  user-select: none;
  letter-spacing: 0.3px;
}

.sublane-badge.ch1 { color: #00f0ff; background: rgba(0, 240, 255, 0.15); }
.sublane-badge.ch2 { color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.sublane-badge.ch3 { color: #a855f7; background: rgba(168, 85, 247, 0.15); }
.sublane-badge.ch4 { color: #ec4899; background: rgba(236, 72, 153, 0.15); }

/* LED Clip Blocks Container & Blocks */
.ptl-led-clips-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ptl-led-clip-block {
  position: absolute;
  height: 11px;
  border-radius: 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  cursor: grab;
  z-index: 5;
  transition: box-shadow 0.1s ease, border-color 0.1s ease;
}

.ptl-led-clip-block:active {
  cursor: grabbing;
}

.ptl-led-clip-block.ch1 {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.65), rgba(0, 240, 255, 0.35));
  border: 1px solid #00f0ff;
}
.ptl-led-clip-block.ch2 {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.65), rgba(59, 130, 246, 0.35));
  border: 1px solid #3b82f6;
}
.ptl-led-clip-block.ch3 {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.65), rgba(168, 85, 247, 0.35));
  border: 1px solid #a855f7;
}
.ptl-led-clip-block.ch4 {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.65), rgba(236, 72, 153, 0.35));
  border: 1px solid #ec4899;
}

.ptl-led-clip-block.selected {
  border-color: #ffffff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.5) !important;
  z-index: 8;
}

.ptl-led-clip-handle {
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity 0.1s ease;
}
.ptl-led-clip-block:hover .ptl-led-clip-handle,
.ptl-led-clip-block.selected .ptl-led-clip-handle {
  opacity: 0.9;
}

.btn-fft-sparkle {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.25)) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
  font-weight: 600;
  font-size: 10px !important;
  padding: 1px 7px !important;
  gap: 4px;
}
.btn-fft-sparkle:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(168, 85, 247, 0.45)) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
}

/* LED Indicator Orbs in Inspector */
.led-orbs-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.led-orb-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.led-orb-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.85);
}

.led-orb-light {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #11141e;
  border: 1.5px solid #283042;
  transition: all 0.05s ease-out;
}

.led-orb-light.ch1 { border-color: rgba(0, 240, 255, 0.4); }
.led-orb-light.ch2 { border-color: rgba(59, 130, 246, 0.4); }
.led-orb-light.ch3 { border-color: rgba(168, 85, 247, 0.4); }
.led-orb-light.ch4 { border-color: rgba(236, 72, 153, 0.4); }

.led-orb-pin {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
}

.led-orb-pin.ch1 { color: #00f0ff; }
.led-orb-pin.ch2 { color: #3b82f6; }
.led-orb-pin.ch3 { color: #a855f7; }
.led-orb-pin.ch4 { color: #ec4899; }

.led-orb-val {
  font-size: 9px;
  font-family: monospace;
  color: var(--text-muted);
}

.led-orb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 3px;
}

/* Tactile Rotary Knobs for LED Limiters */
.led-knob-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.led-rotary-knob {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #222b3d, #0d111a);
  border: 2px solid #1e2638;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.led-rotary-knob:hover,
.led-rotary-knob.is-dragging {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.led-rotary-knob.ch1:hover, .led-rotary-knob.ch1.is-dragging { border-color: #00f0ff; box-shadow: 0 0 12px rgba(0, 240, 255, 0.6); }
.led-rotary-knob.ch2:hover, .led-rotary-knob.ch2.is-dragging { border-color: #3b82f6; box-shadow: 0 0 12px rgba(59, 130, 246, 0.6); }
.led-rotary-knob.ch3:hover, .led-rotary-knob.ch3.is-dragging { border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, 0.6); }
.led-rotary-knob.ch4:hover, .led-rotary-knob.ch4.is-dragging { border-color: #ec4899; box-shadow: 0 0 12px rgba(236, 72, 153, 0.6); }

.knob-dial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  transform-origin: 50% 50%;
  pointer-events: none;
  transition: transform 0.04s ease-out;
}

.knob-pointer {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: #cbd5e1;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}

.knob-pointer.ch1 { background: #00f0ff; box-shadow: 0 0 6px #00f0ff; }
.knob-pointer.ch2 { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.knob-pointer.ch3 { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
.knob-pointer.ch4 { background: #ec4899; box-shadow: 0 0 6px #ec4899; }

.knob-val {
  font-size: 10px;
  font-family: monospace;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-top: 1px;
}

.knob-sublabel {
  font-size: 7px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Auto FFT Modal Beat Sync Cards */
.fft-algo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}

.fft-algo-grid::-webkit-scrollbar {
  width: 5px;
}

.fft-algo-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.fft-algo-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.fft-algo-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

/* Mini sliders for LED limiters and compact inspectors */
.slider-mini {
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #1e2638;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.slider-mini::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
}

.slider-mini::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.9);
}

.led-limiter-row:hover .slider-mini {
  background: #2a354d;
}

.fft-algo-card {
  background: #0f131c;
  border: 1.5px solid #1e2638;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fft-algo-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: #131926;
}
.fft-algo-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}
.fft-algo-card .algo-title {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fft-algo-card .algo-title i {
  color: #38bdf8;
}
.fft-algo-card .algo-desc {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
}

/* =========================================================================
   KATHALTECH BRANDING, ABOUT / CHANGELOG MODAL & STORE STYLES
   ========================================================================= */

.btn-kit-purchase {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16) 0%, rgba(37, 99, 235, 0.28) 100%) !important;
  border: 1px solid rgba(0, 240, 255, 0.45) !important;
  color: #00f0ff !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22) !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-kit-purchase:hover {
  background: linear-gradient(135deg, #00f0ff 0%, #0070f3 100%) !important;
  color: #060e1a !important;
  border-color: transparent !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.5) !important;
}

.btn-kit-purchase i {
  font-size: 13px;
}

.btn-about-trigger {
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-about-trigger:hover {
  color: var(--accent-cyan);
}

/* About Modal Card & Tabs */
.about-modal-card {
  max-width: 820px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}

.about-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--clay-surface);
  border-bottom: 1px solid var(--clay-border);
}

.about-header-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-header-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.about-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}

.about-header-sub {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.about-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  background: var(--clay-surface-pressed);
  border-bottom: 1px solid var(--clay-border);
}

.about-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.about-tab-btn:hover {
  color: #ffffff;
}

.about-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.about-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  max-height: calc(88vh - 140px);
}

.about-tab-pane {
  display: none;
}

.about-tab-pane.active {
  display: block;
}

/* About Tab Hero */
.about-hero-box {
  background: linear-gradient(135deg, rgba(20, 24, 38, 0.95), rgba(15, 18, 28, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.about-hero-logo-large {
  max-width: 140px;
  height: auto;
  object-fit: contain;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.about-hero-details {
  flex: 1;
}

.about-hero-details h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-hero-details .hero-tagline {
  font-size: 12.5px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 3px;
}

.about-hero-details p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 10px;
}

.about-action-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.about-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--clay-surface-light);
  border: 1px solid var(--clay-border);
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.about-pill-link:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.about-pill-link.github-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
}

.about-pill-link.kathaltech-pill {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(0, 112, 243, 0.25));
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
}

.about-pill-link.kathaltech-pill:hover {
  background: linear-gradient(135deg, #00f0ff, #0070f3);
  color: #060e1a;
}

/* About Features Grid */
.about-section-heading {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-section-heading i {
  color: var(--accent-cyan);
}

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.about-feature-card {
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.about-feature-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.about-feature-card h4 i {
  color: var(--accent-cyan);
}

.about-feature-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Specs Table */
.about-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-bottom: 20px;
  background: var(--clay-surface-pressed);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--clay-border);
}

.about-specs-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.about-specs-table tr:last-child td {
  border-bottom: none;
}

.about-specs-table td.spec-key {
  color: var(--text-muted);
  font-weight: 600;
  width: 35%;
  background: rgba(0, 0, 0, 0.15);
}

.about-specs-table td.spec-val {
  color: #ffffff;
  font-weight: 500;
}

/* Changelog Timeline & Search */
.changelog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.changelog-search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}

.changelog-search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 12px;
}

.changelog-search-box input {
  width: 100%;
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  color: #ffffff;
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.changelog-search-box input:focus {
  border-color: var(--accent-cyan);
}

.changelog-stats-badge {
  font-size: 11px;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.changelog-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-card {
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.changelog-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: #141826;
}

.changelog-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.changelog-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.changelog-commit-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.changelog-commit-tag.feat {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.changelog-commit-tag.fix {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.changelog-commit-hash {
  font-family: monospace;
  font-size: 11px;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.changelog-meta-right {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.changelog-commit-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
  line-height: 1.4;
}

.changelog-commit-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
}

/* Store Products Grid */
.store-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.store-product-card {
  background: var(--clay-surface-pressed);
  border: 1px solid var(--clay-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.store-product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.store-card-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.store-card-badge.cyan { background: rgba(0, 240, 255, 0.15); color: #00f0ff; border: 1px solid rgba(0, 240, 255, 0.35); }
.store-card-badge.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.35); }
.store-card-badge.emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.store-card-badge.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.35); }

.store-product-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.store-product-specs {
  font-size: 11px;
  color: var(--accent-cyan);
  font-family: monospace;
  margin-bottom: 8px;
  background: rgba(0, 240, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
}

.store-product-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.store-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  margin-top: 4px;
}

.store-product-price {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.store-buy-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 112, 243, 0.2));
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.store-buy-btn:hover {
  background: linear-gradient(135deg, #00f0ff, #0070f3);
  color: #060e1a;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

