/* Main Container (act as flex wrapper now) */
#prob-tree-app {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    font-family: 'Inter', sans-serif;
    /* Box styling removed as requested */
}

.pt-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pt-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #334155;
}

/* Instructions Card */
.tool-instructions {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
    font-family: 'Inter', sans-serif;
}

.tool-instructions h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.tool-instructions ul {
    padding-left: 1.5rem;
    color: #475569;
}

.tool-instructions li {
    margin-bottom: 0.5rem;
}

/* Tree Editor Surface */
.tree-editor-wrapper {
    overflow-x: auto;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    min-height: 400px;
    display: flex;
    align-items: center;
    /* Vertically center the whole tree */
    justify-content: flex-start;
    position: relative;
}

/* Tree Structure */
.t-node-wrapper {
    display: flex;
    align-items: center;
}

.t-children {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 3rem;
    /* Space for edge lines */
    position: relative;
    gap: 1rem;
}

/* The visual Node */
.t-node {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.t-node-content {
    background: #fff;
    border: 2px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    min-width: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.t-node-content:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.t-node-content.is-root {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.t-node-controls {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.t-node:hover .t-node-controls {
    opacity: 1;
}

/* Buttons */
.btn-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: white;
}

.btn-add {
    background: #10b981;
}

.btn-add:hover {
    background: #059669;
}

.btn-del {
    background: #ef4444;
}

.btn-del:hover {
    background: #dc2626;
}

/* Edge Labels (floating) */
.t-edge-label {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 5;
    white-space: nowrap;
}

.t-edge-label:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* SVG Line Layer */
#tree-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#tree-labels-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: auto;
    /* Allow clicking labels */
}

/* Textarea Output */
#latex-output {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8fafc;
    resize: vertical;
}

/* Action Buttons */
.btn-action {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-action:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}