/* ── Accordion Side Panel ── */

.accordion-sidebar {
    position: fixed;
    z-index: 45;
    display: flex;
    pointer-events: none;
}

.accordion-sidebar.is-open {
    pointer-events: auto;
}

/* ── Floating (cloned) panels ── */

.accordion-sidebar.accordion-floating {
    position: fixed;
    z-index: 100;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    width: auto;
    height: auto;
    max-height: 80vh;
    top: auto; bottom: auto; left: auto; right: auto;
}

.accordion-sidebar.accordion-floating .accordion-tabbar {
    border-radius: 12px 0 0 12px;
}

.accordion-sidebar.accordion-floating .accordion-content {
    transform: none !important;
    border-radius: 0 12px 12px 0;
    overflow: auto;
}

.accordion-sidebar.accordion-floating:not(.is-open) .accordion-content,
.accordion-sidebar.accordion-snapped:not(.is-open) .accordion-content {
    display: none;
}

.accordion-sidebar.accordion-floating .accordion-resizer {
    display: none;
}

.accordion-sidebar:not(.is-open) .accordion-resizer {
    display: none !important;
}

.floating-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 10;
}

.floating-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-resize-handle:hover::after {
    border-color: var(--accent-border-strong);
}

.accordion-sidebar.accordion-floating .accordion-section-header {
    cursor: grab;
}

.accordion-sidebar.accordion-floating .accordion-section-header:active {
    cursor: grabbing;
}

/* ── Snapped panels (docked inside DockLayout) ── */

.accordion-sidebar.accordion-snapped {
    z-index: 46;
    pointer-events: auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.accordion-sidebar.accordion-snapped .accordion-content {
    transform: none !important;
    opacity: 1;
    border-radius: 0;
}

.accordion-sidebar.accordion-snapped .accordion-tabbar {
    border-color: rgba(255, 255, 255, 0.06);
}

.accordion-sidebar.accordion-snapped .accordion-section-header {
    cursor: grab;
}

.accordion-sidebar.accordion-snapped .accordion-section-header:active {
    cursor: grabbing;
}

/* ── Dock: left (default) ── */

.accordion-sidebar.dock-left {
    top: 0; left: 0; bottom: 0;
    flex-direction: row;
}

.accordion-sidebar.dock-left .accordion-tabbar {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-sidebar.dock-left .accordion-content {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(-100%);
}

.accordion-sidebar.dock-left.is-open .accordion-content {
    transform: translateX(0);
}

/* ── Dock: right ── */

.accordion-sidebar.dock-right {
    top: 0; right: 0; bottom: 0;
    flex-direction: row-reverse;
}

.accordion-sidebar.dock-right .accordion-tabbar {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-sidebar.dock-right .accordion-content {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(100%);
}

.accordion-sidebar.dock-right.is-open .accordion-content {
    transform: translateX(0);
}

/* ── Dock: top ── */

.accordion-sidebar.dock-top {
    top: 0; left: 0; right: 0;
    flex-direction: column;
}

.accordion-sidebar.dock-top .accordion-tabbar {
    width: auto; height: 44px;
    flex-direction: row;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-sidebar.dock-top .accordion-content {
    width: auto; height: var(--accordion-width, 320px);
    min-width: unset; max-width: unset;
    min-height: 160px; max-height: 100vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateY(-100%);
}

.accordion-sidebar.dock-top.is-open .accordion-content {
    transform: translateY(0);
}

/* ── Dock: bottom ── */

.accordion-sidebar.dock-bottom {
    bottom: 0; left: 0; right: 0;
    flex-direction: column-reverse;
}

.accordion-sidebar.dock-bottom .accordion-tabbar {
    width: auto; height: 44px;
    flex-direction: row;
    padding: 0 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-sidebar.dock-bottom .accordion-content {
    width: auto; height: var(--accordion-width, 320px);
    min-width: unset; max-width: unset;
    min-height: 160px; max-height: 100vh;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateY(100%);
}

.accordion-sidebar.dock-bottom.is-open .accordion-content {
    transform: translateY(0);
}

/* ── Tab Bar (иконки) ── */

.accordion-tabbar {
    width: 44px;
    background: #141416;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 2px;
    pointer-events: auto;
    z-index: 2;
}

.accordion-tab-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

.accordion-tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #d1d5db;
}

.accordion-tab-btn.is-active {
    background: var(--accent-subtle);
    border-color: var(--accent-border);
    color: var(--accent);
}

.accordion-tab-btn .lucide {
    width: 16px;
    height: 16px;
}

/* ── Content Panel ── */

.accordion-content {
    width: var(--accordion-width, 320px);
    min-width: 240px;
    max-width: 100vw;
    background: #141416;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.15s ease;
    z-index: 1;
}

.accordion-sidebar.is-open .accordion-content {
    opacity: 1;
}

/* ── Section Header ── */

.accordion-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    user-select: none;
}

.accordion-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.accordion-section-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.accordion-section-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f3f4f6;
}

/* ── Section Body (placeholder) ── */

.accordion-section-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.accordion-section-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* ── Resize Handle ── */

.accordion-resizer {
    position: absolute;
    z-index: 10;
    background: transparent;
    transition: background 0.15s ease;
}

.accordion-resizer:hover,
.accordion-resizer.is-dragging {
    background: rgba(var(--accent-rgb), 0.15);
}

.accordion-resizer.resizer-h {
    top: 0; bottom: 0;
    width: 18px;
    cursor: col-resize;
}

.accordion-resizer.resizer-v {
    left: 0; right: 0;
    height: 18px;
    cursor: row-resize;
}

.dock-left .accordion-resizer  { right: 0; transform: translateX(9px); }
.dock-right .accordion-resizer { left: 0; transform: translateX(-9px); }
.dock-top .accordion-resizer   { bottom: 0; transform: translateY(9px); }
.dock-bottom .accordion-resizer { top: 0; transform: translateY(-9px); }

/* ── Dock Picker ── */

.accordion-dock-picker {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 8px;
    gap: 2px;
    align-items: center;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 50;
}

.accordion-dock-picker.is-visible {
    display: flex;
}

.accordion-dock-picker-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-right: 4px;
}

.accordion-dock-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.12s ease;
}

.accordion-dock-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}

.accordion-dock-btn.is-active {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent-border);
    color: var(--accent);
}

/* ── Main area inside dock-pane: fill available space ── */

#main-area {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#bottomControls {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, #0a0a0a 30%);
}
