.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Workspace Panels */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 6px;
}

.pane {
    flex: 1;
    min-width: 0; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* transition: flex 0.3s ease; Removed transition to prevent jerky resize dragging */
}

#left-pane {
    gap: 6px;
    flex: 4;
}

#right-pane {
    flex: 6;
}

.pane.hidden-pane {
    flex: 0 !important;
    display: none !important;
}

/* Vertical Resizer & Debug Console */
.v-resizer {
    height: 6px;
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none;
    flex-shrink: 0;
}
.v-resizer:hover, .v-resizer.dragging {
    background: var(--btn-hover);
}
.v-resizer-handle {
    height: 4px;
    width: 48px;
    background: var(--splitter-color);
    border-radius: 2px;
}

/* Resizer Panel */
.resizer {
    width: 6px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.2s;
    user-select: none;
}

.resizer:hover, .resizer.dragging {
    background: var(--btn-hover);
}

.resizer-handle {
    width: 4px;
    height: 48px;
    background: var(--splitter-color);
    border-radius: 2px;
}

/* Right Pane (Graph viewer) */
#graph-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    width: 100%;
    height: 100%;
}

.mermaid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mermaid svg {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.1s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        padding: 8px;
        gap: 8px;
    }
    .toolbar {
        padding: 8px;
        gap: 12px;
        justify-content: center;
    }
    .layout-controls {
        display: flex; /* Zezwalamy na przełączanie */
    }
    #btn-layout-split {
        display: none !important; /* Na małych ekranach split wyłączony */
    }
    .resizer {
        display: none !important; /* Żaden resizer nie jest potrzebny gdy ekran jest pojedynczy */
    }
    
    .graph-controls {
        bottom: 16px;
        right: 16px;
        flex-direction: column-reverse; /* Guzik na samym dole */
        align-items: flex-end;
        z-index: 100;
    }
    
    .tools-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        background: var(--accent);
        color: #fff;
        z-index: 105; /* Upewniamy się, że z-index jest wysoki! */
    }

    .graph-tools-inner {
        flex-direction: column;
        align-items: center; 
        gap: 12px;
        
        position: absolute;
        bottom: 56px; 
        right: 0;
        
        opacity: 0;
        pointer-events: none;
        transform: translateY(16px);
        transition: all 0.3s ease;
        z-index: 100;

        /* Piony układ w telefonach odwracany - więc musi być ucięty wysokością by móc załapać się na scroll przy Landscape! */
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .graph-controls.expanded .graph-tools-inner {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    
    .graph-tools-inner .swatch-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .graph-tools-inner .divider {
        width: 32px !important;
        height: 1px !important;
        margin: 4px 0 !important;
    }
    
    .workspace {
        flex-direction: column;
    }
    .pane {
        width: 100%;
    }
}

