.tool-workspace {
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 70vh;
    padding-bottom: 2rem;
}

.tool-panel {
    width: 100%;
    max-width: 1400px; /* Wider for split pane */
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.split-pane {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0; /* Prevents flex items from expanding beyond container */
}

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

.pane-header label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.btn-icon.success {
    color: #10b981;
}

textarea, .preview-area {
    flex: 1;
    width: 100%;
    height: 600px; /* Fixed height or flex */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    color: var(--text-main);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow-y: auto;
}

textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    resize: none;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.preview-area {
    background: rgba(0, 0, 0, 0.3);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
}

/* Basic Markdown styling inside preview */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #fff;
}
.markdown-body h1 { font-size: 2em; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.3em; }
.markdown-body p { margin-bottom: 1em; }
.markdown-body a { color: var(--accent-secondary); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1em; padding-left: 2em; }
.markdown-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}
.markdown-body pre {
    background: #0d1117;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
}
.markdown-body pre code {
    background: transparent;
    padding: 0;
}
.markdown-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1em;
    color: var(--text-muted);
    margin-bottom: 1em;
}
.markdown-body img {
    max-width: 100%;
    border-radius: 4px;
}
.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--glass-border);
    padding: 0.5em;
}
.markdown-body th {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .split-pane {
        flex-direction: column;
    }
}
