/* --- СТАРЫЕ СТИЛИ (База) --- */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Кнопки и инпуты */
.btn {
    background: #333; border: 1px solid #444; color: #ddd; padding: 5px 12px;
    cursor: pointer; border-radius: 3px; font-size: 13px; transition: all 0.1s;
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: #444; }
.btn.active { background: #007acc; border-color: #007acc; color: white; }
.btn-blue { background: #005f9e; border-color: #005f9e; }
.btn-green { background: #28a745; border-color: #28a745; color: white; }
.btn-danger { background: #d9534f; border-color: #d43f3a; color: white; }
.btn-large { width: 100%; padding: 8px; margin-bottom: 5px; justify-content: center; }
.btn-small { padding: 2px 8px; font-size: 11px; }

input[type="text"], input[type="number"], select {
    background: #252526; border: 1px solid #444; color: white; padding: 5px; border-radius: 3px;
}
input[type="color"] { border: none; width: 100%; height: 25px; cursor: pointer; background: none; padding: 0;}
input[type="file"] { display: none; }

header {
    background: #1f1f1f; padding: 0 15px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid #333; height: 50px; flex-shrink: 0;
    z-index: 200; /* Хедер всегда сверху */
}
.header-group { display: flex; gap: 10px; align-items: center; }
.view-controls { border-left: 1px solid #444; padding-left: 15px; margin-left: 5px; display: flex; gap: 5px;}

.toolbar {
    display: flex; background: #252526; border-bottom: 1px solid #333;
    justify-content: center; align-items: center; height: 36px; flex-shrink: 0;
    z-index: 200;
}
.toolbar-center { display: flex; align-items: center; gap: 10px; }
.tool-btn {
    padding: 5px 15px; border-radius: 20px; border: 1px solid #444; background: #1e1e1e;
    color: #aaa; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 5px;
}
.tool-btn:hover { background: #2a2a2a; }
.tool-btn.active { background: #007acc; color: white; border-color: #007acc; }
.group-creator { display: flex; align-items: center; gap: 5px; }
.group-creator input { width: 120px; font-size: 12px; padding: 4px; }


/* --- WORKSPACE --- */
.workspace { 
    display: flex; 
    flex: 1; 
    overflow: hidden; 
    position: relative; 
}

/* Tools Sidebar */
.tools-sidebar {
    width: 40px;
    background: #252526; border-right: 1px solid #333;
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: width 0.2s ease-in-out;
    overflow: hidden; position: relative; 
    z-index: 300; /* Панели инструментов выше таймлайна */
}
.tools-sidebar.expanded { width: 260px; }
.tool-tab {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    color: #888; cursor: pointer; border-bottom: 1px solid #333; transition: all 0.2s;
}
.tool-tab:hover { color: #fff; background: #333; }
.tool-tab.active { color: #007acc; border-left: 2px solid #007acc; background: #1e1e1e; }
.tool-content { flex: 1; min-width: 220px; padding: 15px; background: #1e1e1e; overflow-y: auto; display: none; }
.tools-sidebar.expanded .tool-content { display: block; }
.gen-group { margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.gen-label { display: block; font-size: 11px; color: #aaa; margin-bottom: 5px; font-weight: bold; text-transform: uppercase;}
.gen-row { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
.gen-row input, .gen-row select { width: 100%; font-size: 12px; }
.gen-btn { width: 100%; padding: 8px; margin-top: 5px; font-weight: bold; }


/* Canvas Container */
.canvas-container { 
    flex: 1; 
    position: relative; 
    background: #0f0f0f; 
    overflow: hidden; 
    min-width: 100px;
    z-index: 1;
}
canvas { display: block; width: 100%; height: 100%; }

/* Video Column */
.video-column {
    background: #1e1e1e; display: flex; flex-direction: column; border-left: 1px solid #333;
    flex-shrink: 0; min-width: 200px; max-width: 800px; 
    z-index: 300; /* Видео панель выше таймлайна */
    overflow: hidden;
}
.video-wrapper { 
    width: 100%; height: 180px; background: #000; flex-shrink: 0; position: relative; border-bottom: 1px solid #333; 
}
.video-blocker { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; background: transparent; }
.video-scroll-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* Resizers */
.resizer {
    width: 5px; cursor: col-resize; background: #252526; border-left: 1px solid #333; border-right: 1px solid #333;
    z-index: 400; flex-shrink: 0; transition: background 0.2s;
}
.resizer:hover { background: #007acc; }

.resizer-vertical {
    height: 5px; width: 100%; cursor: row-resize; background: #252526; border-top: 1px solid #333; border-bottom: 1px solid #333;
    z-index: 400; flex-shrink: 0; transition: background 0.2s;
}
.resizer-vertical:hover { background: #007acc; }


/* Inspector Sidebar */
.sidebar { 
    background: #1e1e1e; display: flex; flex-direction: column; border-left: 1px solid #333; 
    z-index: 300; /* Инспектор выше таймлайна */
    flex-shrink: 0; min-width: 200px; max-width: 600px;
}
.panel-section { border-bottom: 1px solid #2a2a2a; }
.panel-header { padding: 8px 15px; background: #252526; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: bold; color: #ccc; user-select: none; }
.panel-header:hover { background: #2d2d2d; color: white; }
.panel-header i { font-size: 10px; transition: transform 0.2s; }
.panel-header i.closed { transform: rotate(-90deg); }
.panel-content { background: #1e1e1e; overflow: hidden; display: block; }
.panel-content.closed { display: none; }
.groups-grid { padding: 10px; display: flex; flex-wrap: wrap; gap: 5px; max-height: 150px; overflow-y: auto; }
.group-tag { background: #333; border: 1px solid #555; padding: 4px 8px; font-size: 11px; color: #ddd; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.1s; }
.group-tag:hover { background: #444; border-color: #007acc; color: white; }
.group-delt { color: #888; font-weight: bold; font-size: 12px; margin-left: 2px; }
.group-delt:hover { color: #d9534f; }
.persistent-controls { padding: 10px 15px; }
.selection-status { text-align: center; font-size: 11px; color: #aaa; margin-bottom: 5px; font-weight: bold; }
.control-group { margin-top: 5px; padding-top: 5px; }
.slider-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #aaa; margin-bottom: 8px; }
.slider-row input[type=range] { flex: 1; margin-left: 10px; cursor: pointer; }
.properties-panel { padding: 15px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #1e1e1e; }
.empty-state { text-align: center; color: #555; margin-top: 40px; font-style: italic; font-size: 14px; }
.prop-section { background: #252526; padding: 10px; border-radius: 5px; border: 1px solid #333; }
.prop-title { font-size: 11px; font-weight: bold; color: #888; text-transform: uppercase; margin-bottom: 8px; display: block; }
.prop-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.prop-row label { color: #ccc; }
.prop-row input { width: 70px; }

/* MISC */
.overlay-info { position: absolute; top: 15px; left: 15px; pointer-events: none; color: #eee; font-size: 13px; font-family: 'Consolas', monospace; background: rgba(0,0,0,0.7); padding: 8px 12px; border-radius: 4px; border: 1px solid #444; }
.selection-bar { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(30, 30, 30, 0.9); border: 1px solid #444; border-radius: 8px; padding: 8px 15px; display: flex; gap: 10px; z-index: 500;}

/* TIMELINE AREA */
.playback-bar { background: #252526; border-top: 1px solid #333; padding: 0 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 50px; flex-shrink: 0; z-index: 200; }
.pb-center { display: flex; align-items: center; gap: 10px; justify-content: center; }
.media-btn { background: transparent; border: 1px solid #444; color: #ccc; width: 40px; height: 32px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.media-btn:hover { background: #333; color: white; }
.media-btn.big-play { width: 40px; height: 40px; border-radius: 50%; background: #333; border-color: #555; font-size: 18px; }
.media-btn.big-play:hover { background: #007acc; border-color: #007acc; }
.time-display-large { font-family: 'Consolas', monospace; font-size: 20px; color: #00aaff; font-weight: bold; min-width: 90px; text-align: center; }
.pb-right { display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
.zoom-controls { display: flex; align-items: center; gap: 8px; background: #1e1e1e; padding: 5px 10px; border-radius: 20px; border: 1px solid #333; }
.zoom-controls input[type=range] { width: 80px; height: 4px; cursor: pointer; }

.timeline-wrapper { 
    height: 280px; background: #181818; position: relative; overflow-x: auto; overflow-y: auto; flex-shrink: 0; display: flex;
    z-index: 10; /* Базовый слой таймлайна */
}

/* Фон (сетка) */
.timeline-content { 
    height: 100%; 
    position: relative; 
    min-width: 100%; 
    background-color: #181818;
    background-image: linear-gradient(to bottom, transparent 44px, #333 45px);
    background-size: 100% 45px;
    background-position: 0 25px; 
}

.track-headers-col {
    position: sticky; 
    left: 0; 
    width: 140px; 
    height: 100%; 
    background: #1e1e1e; 
    border-right: 1px solid #333; 
    /* БЫЛО: 150 */
    /* СТАЛО: 1200 (Выше плейхеда, у которого 1000) */
    z-index: 1200; 
    flex-shrink: 0; 
    display: none;
}
.track-header-item {
    height: 45px; border-bottom: 1px solid #333; box-sizing: border-box; display: flex; align-items: center;
    padding: 0 10px; font-size: 11px; color: #aaa; background: #252526; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.track-header-item.section-head { background: #333; color: #fff; font-weight: bold; height: 25px; font-size: 10px; }

/* Timeline Ruler */
.timeline-ruler { height: 25px; background: #222; border-bottom: 1px solid #444; position: relative; pointer-events: none; z-index: 120; }
.ruler-tick { position: absolute; bottom: 0; border-left: 1px solid #555; font-size: 10px; color: #777; padding-left: 3px; height: 10px; }
.ruler-tick.major { height: 100%; border-left: 1px solid #666; color: #aaa; background: rgba(255,255,255,0.02); }

/* --- ИСПРАВЛЕНИЕ: ПЛЕЙХЕД --- */
.playhead { 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    left: 0; 
    width: 2px; 
    background: #ff3333; 
    /* ВАЖНО: 1000 выше чем .track-container (20), поэтому плейхед всегда сверху */
    z-index: 1000; 
    pointer-events: none; 
}
.playhead::after { content: '▼'; position: absolute; top: 0; left: -5px; color: #ff3333; font-size: 10px; }

/* --- ИСПРАВЛЕНИЕ: КОНТЕЙНЕР ТРЕКОВ --- */
.track-container { 
    position: relative; 
    min-height: calc(100% - 25px); 
    width: 100%; 
    margin-top: 0; 
    /* ВАЖНО: Создаем новый контекст. Все клипы внутри (z:40, 50) заперты в слое 20. 
       Они никогда не перекроют Плейхед (z:1000) или Сайдбар (z:300) */
    z-index: 20; 
}

/* Блоки клипов */
.clip-block { 
    position: absolute; 
    height: 40px; 
    background: #444; 
    border: 1px solid rgba(255,255,255,0.3); 
    border-radius: 4px; 
    cursor: grab; 
    z-index: 10; 
    overflow: visible; 
    box-sizing: border-box; 
    transition: box-shadow 0.1s; 
}
/* Ховер и селект выше других клипов, но все равно внутри слоя .track-container (20) */
.clip-block:hover { z-index: 15; filter: brightness(1.1); }
.clip-block.selected { border: 2px solid #fc0; z-index: 20; box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); }

.clip-label { position: relative; font-size: 11px; padding: 4px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; height: 100%; pointer-events: none; z-index: 5; text-shadow: 0 0 3px black; }
.resize-handle { position: absolute; top: 0; bottom: 0; width: 10px; z-index: 25; cursor: col-resize; }
.resize-left { left: 0; border-left: 3px solid rgba(255,255,255,0.2); }
.resize-right { right: 0; border-right: 3px solid rgba(255,255,255,0.2); }

.fade-overlay { position: absolute; top: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); pointer-events: none; z-index: 2; }
.fade-in-overlay { left: 0; transform-origin: bottom left; clip-path: polygon(0 0, 100% 0, 0 100%); }
.fade-out-overlay { right: 0; transform-origin: bottom right; clip-path: polygon(100% 0, 100% 100%, 0 0); }
.fade-handle { position: absolute; top: -5px; width: 10px; height: 10px; background-color: #fff; border: 1px solid #000; border-radius: 50%; cursor: col-resize; z-index: 40; opacity: 0; transition: opacity 0.1s; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.fade-handle-in { transform: translateX(-50%); } 
.fade-handle-out { transform: translateX(50%); } 
.clip-block:hover .fade-handle, .clip-block.selected .fade-handle { opacity: 1; }

.toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 5000; pointer-events: none; }
.toast { background: rgba(30, 30, 30, 0.9); border: 1px solid #444; color: #fff; padding: 10px 20px; border-radius: 4px; font-size: 13px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); opacity: 0; transform: translateY(10px); transition: all 0.3s ease; display: flex; align-items: center; gap: 10px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 3px solid #28a745; }
.toast.error { border-left: 3px solid #d9534f; }
.toast.info { border-left: 3px solid #007acc; }
.marker-flag { position: absolute; top: 0; width: 0; height: 100%; border-left: 1px dashed #00ffcc; z-index: 5; pointer-events: none; }
.marker-head { position: absolute; top: 0; left: -4px; width: 8px; height: 8px; background: #00ffcc; transform: rotate(45deg); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 8000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(2px); }
.modal-overlay.active { display: flex; }
.modal-content { background: #1e1e1e; border: 1px solid #444; padding: 25px; border-radius: 8px; width: 400px; max-width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.8); position: relative; }
.modal-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; color: #fff; border-bottom: 1px solid #333; padding-bottom: 10px;}
.shortcut-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: #ccc; }
.key-badge { background: #333; padding: 2px 6px; border-radius: 4px; border: 1px solid #555; font-family: monospace; color: #fff; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; color: #666; font-size: 18px; cursor: pointer; transition: color 0.2s; }
.modal-close-btn:hover { color: #fff; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; margin-bottom: 10px; padding-bottom: 5px; }
.modal-header h2 { font-size: 18px; margin: 0; color: #fff; }
.info-content { width: 500px; }
.scrollable-text { max-height: 300px; overflow-y: auto; text-align: left; padding-right: 5px; font-size: 13px; color: #ccc; }
.scrollable-text h3 { color: #00adb5; font-size: 14px; margin-top: 15px; margin-bottom: 5px; }
.scrollable-text ul { padding-left: 20px; margin: 5px 0; }
.scrollable-text li { margin-bottom: 3px; }
.faq-item { margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.faq-item strong { color: #fff; display: block; margin-bottom: 5px; }
.faq-item p { margin: 0; color: #aaa; }
.welcome-menu { display: flex; gap: 10px; justify-content: center; margin-top: 20px; border-top: 1px solid #333; padding-top: 20px; }
.welcome-menu .btn { flex: 1; justify-content: center; padding: 8px; }

.clip-block.conflict { border: 2px dashed #ff3333 !important; background: repeating-linear-gradient( 45deg, rgba(255, 0, 0, 0.1), rgba(255, 0, 0, 0.1) 10px, rgba(68, 68, 68, 0.5) 10px, rgba(68, 68, 68, 0.5) 20px ) !important; box-shadow: 0 0 8px rgba(255, 50, 50, 0.6); }
.conflict-icon { position: absolute; right: 2px; top: 2px; font-size: 12px; color: #ff3333; background: rgba(0,0,0,0.8); border-radius: 50%; width: 16px; height: 16px; text-align: center; line-height: 16px; z-index: 50; pointer-events: none; font-weight: bold; }

.magnet-btn { width: 32px; height: 32px; border: 1px solid #444; border-radius: 4px; background: #333; color: #777; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.magnet-btn:hover { background: #444; }
.magnet-btn.active { background: #007acc; color: #fff; border-color: #007acc; box-shadow: 0 0 5px rgba(0, 122, 204, 0.5); }
.tl-selection-box { position: absolute; background: rgba(0, 122, 204, 0.2); border: 1px solid #007acc; z-index: 100; pointer-events: none; display: none; }
.snap-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: #00ffcc; z-index: 50; pointer-events: none; display: none; box-shadow: 0 0 4px #00ffcc; }

.drag-over { border: 15px outset #00aaff; background: rgba(0, 170, 255, 0.1); }
.recent-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; max-height: 200px; overflow-y: auto; }
.recent-card { background: #252526; border: 1px solid #444; padding: 10px 15px; border-radius: 5px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; text-align: left; }
.recent-card:hover { background: #333; border-color: #007acc; }
.recent-info { display: flex; flex-direction: column; }
.recent-name { color: #fff; font-weight: bold; font-size: 13px; }
.recent-date { color: #888; font-size: 11px; margin-top: 2px; }
.visibility-grid { display: flex; gap: 5px; justify-content: space-between; }
.vis-btn { width: 30px; height: 30px; background: #252526; border: 1px solid #444; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #555; cursor: pointer; transition: all 0.2s; }
.vis-btn:hover { background: #333; color: #888; }
.vis-btn.active { background: #007acc; border-color: #007acc; color: white; box-shadow: 0 0 5px rgba(0, 122, 204, 0.4); }

/* =========================================
   1. UI ЭЛЕМЕНТЫ (СКРОЛЛБАРЫ, ПОЛЗУНКИ, ИНПУТЫ)
   ========================================= */

/* --- 1.1 Широкий Темный Скроллбар --- */
::-webkit-scrollbar {
    width: 20px;  /* Ширина вертикального скролла */
    height: 20px; /* Высота горизонтального скролла */
}

::-webkit-scrollbar-track {
    background: #0f0f0f; /* Очень темная подложка */
    border-left: 1px solid #333;
}

::-webkit-scrollbar-thumb {
    background-color: #2a2a2a; /* Темный ползунок */
    border-radius: 10px;       /* Закругление */
    border: 3px solid #0f0f0f; /* Окантовка цветом фона (создает отступ) */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #444;    /* Подсветка при наведении */
    border-color: #0f0f0f;
}

/* Для Firefox */
* {
    scrollbar-width: auto;     /* Или thin, если все же захочешь узкий */
    scrollbar-color: #2a2a2a #0f0f0f;
}


/* --- 1.2 Темные Ползунки (Range Slider) --- */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
    cursor: pointer;
}

input[type=range]:focus {
    outline: none;
}

/* Дорожка ползунка */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #333;
}

/* Бегунок (Шарик) */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;             /* Крупный размер */
    width: 24px;
    border-radius: 50%;
    background: #1e1e1e;      /* Темный внутри */
    border: 2px solid #aaa;   /* Светлая окантовка для контраста */
    margin-top: -9px;         /* Центровка */
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
    transition: transform 0.1s, border-color 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: #17a2ff;       /* Ярко-белая окантовка при наведении */
    background: #2a2a2a;
}

/* Дублирование для Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #333;
}
input[type=range]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border: 2px solid #aaaaaa;
    border-radius: 50%;
    background: #1e1e1e;
    cursor: pointer;
}


/* --- 1.3 Группа кнопок для чисел (+/-) --- */

/* Контейнер [ - 123 + ] */
.number-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0; 
    background: #222;
    border-radius: 4px;
    border: 1px solid #444;
    overflow: hidden;
    width: fit-content; /* Ширина по содержимому */
    margin: 0 auto;     /* Центрирование, если нужно */
}

/* Кнопки */
.num-btn {
    background: #2a2a2a;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none;
}

.num-btn:hover {
    background: #444;
}
.num-btn:active {
    background: #666;
}

/* Инпут внутри группы */
.number-control input[type=number] {
    background: #111;
    color: #fff;
    border: none;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    width: 60px;
    height: 30px;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    -moz-appearance: textfield; /* Убрать стрелки Firefox */
}

/* Убрать стрелки Chrome/Safari */
.number-control input[type=number]::-webkit-outer-spin-button,
.number-control input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- 1.4 Фиксы слоев (Z-Index) --- */
/* Чтобы Playhead не перекрывал текст слева */
.track-info {
    position: relative;
    z-index: 10;
    background: #1e1e1e; /* Важно: непрозрачный фон */
}

#playhead {
    /* Уже настроен выше, но для надежности */
    pointer-events: none; 
}

/* --- CUSTOM COLOR PICKER --- */
.cp-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: 100%;
    max-width: 120px;
}

.cp-swatch {
    width: 100%;
    height: 25px;
    border-radius: 4px;
    border: 1px solid #444;
    cursor: pointer;
    background-color: #000;
    /* Убираем шашечки */
    background-image: none !important; 
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    transition: border-color 0.2s;
}
.cp-swatch:hover {
    border-color: #888;
}

.cp-popup {
    position: fixed; /* Фиксируем относительно окна */
    width: 180px;
    height: 165px; /* Фиксируем высоту, чтобы скрипт точно знал размер */
    background: #252526;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.95);
    z-index: 100000; /* Самый высокий слой для попапов */
    display: none;
    box-sizing: content-box; /* Важно для расчетов размеров */
}

.cp-popup.visible {
    display: block;
}

/* Панель насыщенности */
.cp-sv-panel {
    width: 100%;
    height: 120px;
    position: relative;
    background: red; 
    cursor: crosshair;
    margin-bottom: 10px;
    border: 1px solid #111;
}
.cp-sv-panel::before {
    content: ""; position: absolute; top:0; left:0; right:0; bottom:0;
    background: linear-gradient(to right, #fff, transparent);
    pointer-events: none;
}
.cp-sv-panel::after {
    content: ""; position: absolute; top:0; left:0; right:0; bottom:0;
    background: linear-gradient(to bottom, transparent, #000);
    pointer-events: none;
}

.cp-sv-cursor {
    width: 10px; height: 10px;
    border: 1px solid #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-5px, -5px);
    box-shadow: 0 0 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Полоска Hue */
.cp-hue-rail {
    width: 100%;
    height: 12px;
    position: relative;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    border: 1px solid #111;
}

.cp-hue-thumb {
    width: 8px; height: 14px;
    background: #fff;
    border: 1px solid #555;
    position: absolute;
    top: -2px;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    pointer-events: none;
}