/* ================================================
   TRACK EDITOR CSS — VocalGenix Phase 3
   ================================================ */

/* ── Base layout ── */
.editor-body {
    overflow: hidden;
    background: #060810;
}

.editor-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(108,99,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(0,255,136,0.04) 0%, transparent 50%),
        #060810;
}

/* ══════════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════════ */
.editor-topbar {
    height: 54px;
    background: rgba(8,10,18,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    padding: 0 0.8rem;
    gap: 0.8rem;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    z-index: 50;
}

.etb-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.etb-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.etb-left, .etb-right {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
}
.etb-right { justify-content: flex-end; }

.etb-project {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.project-name-input {
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    border-bottom: 1px solid transparent;
    padding: 0.2rem 0.3rem;
    min-width: 160px;
    transition: border-color 0.2s;
}
.project-name-input:focus {
    border-bottom-color: rgba(108,99,255,0.5);
}

/* TRANSPORT */
.transport-bar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
}

.transport-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.transport-btn:hover { background: rgba(255,255,255,0.08); color: white; }

.play-btn {
    background: linear-gradient(135deg, #6c63ff, #4a00e0) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}
.play-btn:hover { transform: scale(1.05); }

.record-btn { color: #ff4444 !important; }
.record-btn:hover { background: rgba(255,68,68,0.15) !important; }
.record-btn.recording {
    background: rgba(255,68,68,0.2) !important;
    animation: recordPulse 1s ease-in-out infinite;
}
@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(255,68,68,0); }
}

.timecode {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-green);
    min-width: 90px;
    text-align: center;
    letter-spacing: 1px;
    padding: 0 0.5rem;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
    margin: 0 0.2rem;
}

.bpm-display, .time-sig-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
}
.bpm-lbl, .ts-lbl { color: var(--text-muted); text-transform: uppercase; font-size: 0.65rem; }
.bpm-input {
    width: 42px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.15rem;
    outline: none;
}

/* ZOOM */
.zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.zoom-btn {
    width: 24px; height: 24px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.zoom-btn:hover { background: rgba(255,255,255,0.12); color: white; }
.zoom-slider {
    width: 80px;
    appearance: none;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.zoom-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px; height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}
.zoom-val {
    font-size: 0.72rem;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
    min-width: 24px;
}

.etb-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.78rem !important;
}

/* ══════════════════════════════════════════════
   MAIN EDITOR LAYOUT
══════════════════════════════════════════════ */
.editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ══════════════════════════════════════════════
   LEFT PANEL — TOOLS + LIBRARY
══════════════════════════════════════════════ */
.editor-left {
    width: 180px;
    flex-shrink: 0;
    background: rgba(8,10,18,0.9);
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0.8rem 1rem 0.4rem;
}

.panel-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.8rem;
}

/* Tools */
.tools-panel {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0.5rem;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.3rem 0.5rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}
.tool-btn:hover { background: rgba(255,255,255,0.06); color: white; }
.tool-btn.active {
    background: rgba(108,99,255,0.18);
    color: #a78bfa;
    border-left: 2px solid #6c63ff;
}
.tool-btn span { font-size: 0.8rem; }

.tools-shortcuts {
    padding: 0.4rem 1rem;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.2);
    line-height: 1.6;
}

/* Library */
.library-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.lib-import-btn {
    width: 22px; height: 22px;
    background: rgba(108,99,255,0.2);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 4px;
    color: #a78bfa;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.lib-import-btn:hover { background: rgba(108,99,255,0.35); }

.lib-search {
    margin: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: white;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    outline: none;
    transition: border-color 0.2s;
    width: calc(100% - 1.2rem);
}
.lib-search:focus { border-color: rgba(108,99,255,0.4); }

.lib-tabs {
    display: flex;
    gap: 0.2rem;
    padding: 0 0.6rem 0.4rem;
}
.lib-tab {
    flex: 1;
    padding: 0.25rem 0.2rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.lib-tab:hover { color: white; }
.lib-tab.active {
    background: rgba(108,99,255,0.2);
    border-color: rgba(108,99,255,0.4);
    color: #a78bfa;
}

.lib-items {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lib-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.15s;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.lib-item:hover {
    background: rgba(108,99,255,0.08);
    border-color: rgba(108,99,255,0.2);
    color: white;
}
.lib-item.dragging { opacity: 0.5; cursor: grabbing; }

.lib-item-icon {
    width: 28px; height: 28px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.lib-item-info { flex: 1; min-width: 0; }
.lib-item-name {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    font-weight: 600;
}
.lib-item-meta { font-size: 0.62rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════
   CENTER — MONITOR + TIMELINE
══════════════════════════════════════════════ */
.editor-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Monitor Row */
.monitor-row {
    height: 180px;
    flex-shrink: 0;
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(6,8,16,0.8);
    overflow: hidden;
}

.monitor-left-spacer {
    width: 180px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}

.monitor-preview {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

#monitor-canvas {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.monitor-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s;
}
.monitor-overlay:hover { color: rgba(255,255,255,0.6); }
.monitor-overlay.hidden { display: none; }

.monitor-timecode {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: rgba(0,255,136,0.8);
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.5);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* Channel Strip */
.channel-strip {
    width: 200px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cs-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0.6rem 0.8rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cs-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-size: 0.78rem;
}

/* ══════════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════════ */
.timeline-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* TRACK HEADERS fixed column */
.tl-headers {
    width: 180px;
    flex-shrink: 0;
    background: rgba(8,10,18,0.95);
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.tl-ruler-corner {
    height: 28px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.5rem;
}

.tl-add-track-btn {
    width: 20px; height: 20px;
    background: rgba(108,99,255,0.2);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 3px;
    color: #a78bfa;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.tl-add-track-btn:hover { background: rgba(108,99,255,0.35); }

.tl-track-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    flex-shrink: 0;
}
.tl-track-header:hover { background: rgba(255,255,255,0.03); }
.tl-track-header.selected { background: rgba(108,99,255,0.08); }

.tl-header-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.track-type-icon {
    width: 20px; height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    flex-shrink: 0;
}

.tl-track-name {
    font-size: 0.75rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
}
.tl-track-name:focus {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    padding: 0 0.2rem;
    cursor: text;
}

.tl-header-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tl-ctrl-btn {
    width: 18px; height: 18px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-muted);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.tl-ctrl-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.tl-ctrl-btn.muted   { background: rgba(255,68,68,0.2);  color: #ff6b6b; }
.tl-ctrl-btn.soloed  { background: rgba(255,215,0,0.2);  color: #ffd700; }

.tl-vol-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.tl-vol-slider {
    flex: 1;
    appearance: none;
    height: 2px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
.tl-vol-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px; height: 10px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}
.tl-vol-val {
    font-size: 0.6rem;
    color: var(--text-muted);
    min-width: 24px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* ── CANVAS AREA ── */
.tl-canvas-wrap {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    min-width: 0;
}

.tl-ruler {
    height: 28px;
    background: rgba(8,10,18,0.9);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-width: 100%;
}

.ruler-mark {
    position: absolute;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ruler-tick {
    width: 1px;
    background: rgba(255,255,255,0.2);
}
.ruler-tick.major { background: rgba(255,255,255,0.4); }
.ruler-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.4);
    font-family: 'Courier New', monospace;
    margin-bottom: 3px;
    position: absolute;
    bottom: 10px;
    white-space: nowrap;
}

.tl-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    z-index: 20;
    pointer-events: none;
    transition: left 0.05s linear;
}
.tl-playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--accent-green);
}

/* TRACKS */
.tl-tracks {
    position: relative;
    min-width: 100%;
}

.tl-track-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
    cursor: crosshair;
    transition: background 0.15s;
}
.tl-track-row:hover { background: rgba(255,255,255,0.01); }
.tl-track-row.selected-track { background: rgba(108,99,255,0.04); }

/* CLIPS */
.tl-clip {
    position: absolute;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    transition: filter 0.15s;
    user-select: none;
}
.tl-clip:hover { filter: brightness(1.15); }
.tl-clip.selected { border-color: white; border-width: 2px; }

.tl-clip-label {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 10px);
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.tl-clip-wave {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tl-clip-fade-in,
.tl-clip-fade-out {
    position: absolute;
    top: 0;
    width: 20px;
    height: 100%;
    pointer-events: none;
}
.tl-clip-fade-in  { left: 0;  background: linear-gradient(to right, rgba(0,0,0,0.5), transparent); }
.tl-clip-fade-out { right: 0; background: linear-gradient(to left, rgba(0,0,0,0.5), transparent); }

.tl-clip-resize-handle {
    position: absolute;
    top: 0; right: 0;
    width: 6px; height: 100%;
    cursor: ew-resize;
    background: rgba(255,255,255,0.2);
    opacity: 0;
    transition: opacity 0.15s;
}
.tl-clip:hover .tl-clip-resize-handle { opacity: 1; }

/* ══════════════════════════════════════════════
   RIGHT PANEL — FX + TRANSITIONS
══════════════════════════════════════════════ */
.editor-right {
    width: 230px;
    flex-shrink: 0;
    background: rgba(8,10,18,0.9);
    border-left: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* FX Units */
.fx-panel { padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.06); }

.fx-unit {
    margin: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.fx-unit:hover { border-color: rgba(255,255,255,0.12); }

.fx-unit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.7rem;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
}
.fx-unit-name {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fx-unit-btns { display: flex; gap: 0.3rem; }

.fx-toggle {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.fx-toggle.active {
    background: rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.4);
    color: var(--accent-green);
}

.fx-unit-body {
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* EQ Bands */
.eq-bands {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    padding: 0.2rem 0;
}
.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.eq-knob-wrap {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.eq-knob {
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.eq-knob::-webkit-slider-thumb {
    appearance: none;
    width: 14px; height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-blue);
}
.eq-label {
    font-size: 0.6rem;
    text-align: center;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

/* FX Rows */
.fx-row {
    display: grid;
    grid-template-columns: 52px 1fr 30px;
    align-items: center;
    gap: 0.4rem;
}
.fx-row label {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.fx-slider {
    appearance: none;
    height: 3px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
.fx-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px; height: 10px;
    background: #a78bfa;
    border-radius: 50%;
    cursor: pointer;
}
.fx-val {
    font-size: 0.62rem;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* Transitions */
.transitions-panel { padding: 0.5rem; }

.transition-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.3rem 0;
}

.trans-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    padding: 0.6rem 0.4rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.68rem;
    color: var(--text-muted);
}
.trans-card:hover {
    background: rgba(108,99,255,0.1);
    border-color: rgba(108,99,255,0.3);
    color: #a78bfa;
}
.trans-card.active {
    background: rgba(108,99,255,0.2);
    border-color: rgba(108,99,255,0.5);
    color: white;
}
.trans-preview {
    height: 28px;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.3);
}

/* ══════════════════════════════════════════════
   AI PROMPT BAR (bottom)
══════════════════════════════════════════════ */
.ai-prompt-bar {
    height: 52px;
    background: rgba(6,8,16,0.98);
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.8rem;
    flex-shrink: 0;
    z-index: 30;
}

.apb-agent-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00ff88, #00cf70);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #001a0d;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0,255,136,0.3);
}

.apb-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}
.apb-input:focus {
    border-color: rgba(0,255,136,0.35);
    background: rgba(255,255,255,0.07);
}
.apb-input::placeholder { color: rgba(255,255,255,0.3); }

.apb-plugin-selector { flex-shrink: 0; }
.apb-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    outline: none;
    cursor: pointer;
}
.apb-select option { background: #1a1c28; }

.apb-send {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #00ff88, #00cf70);
    color: #001a0d;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s;
    white-space: nowrap;
    flex-shrink: 0;
}
.apb-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,255,136,0.3);
}

.apb-history {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.apb-history:hover { background: rgba(255,255,255,0.1); color: white; }

/* AI History Drawer */
.ai-history-drawer {
    position: fixed;
    bottom: 52px;
    right: 0;
    width: 300px;
    max-height: 300px;
    background: rgba(10,12,20,0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-md) 0 0 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(20px);
    box-shadow: -4px -4px 20px rgba(0,0,0,0.4);
}
.ai-history-drawer.open { display: flex; }

.ahd-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.82rem;
    font-weight: 600;
}
.ahd-head button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.ahd-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.ahd-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
}
.ahd-item-prompt { color: var(--accent-green); margin-bottom: 0.2rem; }
.ahd-item-result { color: var(--text-muted); font-size: 0.72rem; }

/* ══════════════════════════════════════════════
   CONTEXT MENU
══════════════════════════════════════════════ */
.context-menu {
    position: fixed;
    background: rgba(14,16,26,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.3rem;
    z-index: 999;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    backdrop-filter: blur(16px);
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.1s;
    font-family: var(--font-body);
}
.ctx-item:hover { background: rgba(108,99,255,0.15); color: white; }
.ctx-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.2rem 0;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 68px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(14,16,26,0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    color: white;
    font-size: 0.85rem;
    backdrop-filter: blur(20px);
    z-index: 999;
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
    pointer-events: none;
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Channel Strip dynamic content */
.cs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.75rem;
}
.cs-key { color: var(--text-muted); }
.cs-val { color: white; font-weight: 600; font-family: 'Courier New', monospace; }

.cs-slider-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.3rem 0;
}
.cs-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.cs-slider {
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
.cs-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px; height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
