 * {
            box-sizing: border-box;
            user-select: none; /* Verhindert ungewolltes Markieren beim Ziehen */
        }

        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
            background: #eef2f7;
            margin: 0;
            min-height: 100vh;
            padding: 24px;
        }

        .name-input {
            border: 1px solid #3b82f6;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 0.9rem;
            font-weight: 500;
            font-family: inherit;
            background: white;
            outline: none;
        }

        .name-input:focus {
            box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
        }

        .children-wrapper {
            margin-left: 30px;
            border-left: 2px dashed #cbd5e1;
            padding-left: 10px;
            min-height: 5px;
        }

            .node-item.drag-over {
                background: #dbeafe !important;
                border: 2px solid #3b82f6 !important;
            }

        /* Haupt-Layout */
        .app-container {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            gap: 28px;
            flex-wrap: wrap;
        }

        /* LINKER POOL */
        .pool {
            flex: 1.2;
            min-width: 260px;
            background: white;
            border-radius: 32px;
            box-shadow: 0 12px 28px rgba(0,0,0,0.08);
            padding: 20px 16px;
            height: fit-content;
            border: 1px solid #dce5ef;
        }

        .pool h2 {
            font-size: 1.4rem;
            margin: 0 0 8px 0;
            display: flex;
            align-items: center;
            gap: 10px;
            color: #1a2c3e;
            border-bottom: 3px solid #cbdde9;
            padding-bottom: 12px;
        }

        .pool-sub {
            font-size: 0.8rem;
            color: #4a627a;
            margin-bottom: 20px;
            border-left: 3px solid #3b82f6;
            padding-left: 12px;
        }

        /* Baustein-Karten im Pool */
        .pool-cards {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .draggable-card {
            background: #f8fafc;
            border: 2px solid #cbd5e1;
            border-radius: 20px;
            padding: 14px 18px;
            cursor: grab;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
            gap: 14px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        }

        .draggable-card:active {
            cursor: grabbing;
        }

        .draggable-card:hover {
            background: #eef2ff;
            border-color: #3b82f6;
            transform: translateY(-2px);
        }

        .card-icon {
            font-size: 1.8rem;
            width: 44px;
            text-align: center;
        }

        .card-info h4 {
            margin: 0 0 4px 0;
            font-weight: 700;
        }

        .card-info p {
            margin: 0;
            font-size: 0.7rem;
            color: #475569;
        }

        .rule-badge {
            font-size: 0.65rem;
            background: #e2e8f0;
            padding: 2px 8px;
            border-radius: 30px;
            display: inline-block;
            margin-top: 4px;
        }

        /* RECHTER BAUPLATZ */
        .workspace {
            display: flex;
            flex-direction: column;
            flex: 2.5;
            min-width: 460px;
            background: #fefefe;
            border-radius: 32px;
            box-shadow: 0 12px 28px rgba(0,0,0,0.08);
            padding: 20px;
            border: 1px solid #dce5ef;
            display: flex;
            flex-direction: column;
        }

        .workspace-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            border-bottom: 2px dashed #cbd5e1;
            padding-bottom: 12px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .workspace-header h2 {
            margin: 0;
            font-size: 1.4rem;
        }

        .menu-wrapper {
            display: flex;
            gap: 21px;
        }

        .reset-btn {
            background: none;
            border: 1px solid #e2e8f0;
            padding: 6px 14px;
            border-radius: 40px;
            cursor: pointer;
            font-weight: 500;
            transition: 0.1s;
        }

        .reset-btn:hover {
            background: #fee2e2;
            border-color: #f87171;
            color: #b91c1c;
        }

        /* Hierarchischer Tree (Struktur-Anzeige) */
        .tree-container {
            min-height: 500px;
            background: #fbfdff;
            border-radius: 24px;
            padding: 8px;
            flex-grow: 1; 
        }

        .tree-node {
            margin: 6px 0;
            position: relative;
        }

        .node-item {
            background: white;
            border: 1px solid #e2edf7;
            border-radius: 18px;
            padding: 10px 12px 10px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 1px 3px rgba(0,0,0,0.03);
            transition: 0.08s linear;
            cursor: pointer;
        }

        .node-item.drag-over {
            background: #d9efff;
            border: 2px solid #3b82f6;
            box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
        }

        .node-content {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .node-type-badge {
            font-weight: 700;
            background: #eef2ff;
            border-radius: 40px;
            padding: 4px 12px;
            font-size: 0.75rem;
            font-family: monospace;
        }

        .node-name {
            font-weight: 500;
        }

        .delete-node {
            background: #f1f5f9;
            border: none;
            border-radius: 30px;
            padding: 4px 12px;
            cursor: pointer;
            font-size: 0.7rem;
            opacity: 0.6;
        }

        .delete-node:hover {
            opacity: 1;
            background: #fee2e2;
            color: red;
        }

        .children-wrapper {
            margin-left: 32px;
            padding-left: 12px;
            border-left: 2px dotted #cbd5e1;
        }

        .empty-message {
            text-align: center;
            color: #94a3b8;
            padding: 48px 20px;
            background: #f9f9fc;
            border-radius: 28px;
            font-style: italic;
        }

        .rule-violation {
            font-size: 0.7rem;
            color: #e11d48;
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* Drop zwischen Nodes */
        .drop-indicator {
            height: 4px;
            background: #3b82f6;
            margin: 6px 0;
            border-radius: 4px;
            transition: 0.05s;
        }

        footer {
            font-size: 0.7rem;
            text-align: center;
            margin-top: 32px;
            color: #5b6e8c;
        }

        @media print {
            .pool, .reset-btn, footer, .delete-node, .drop-zone-between, .empty-drop-zone {
                display: none !important;
            }
            
            .workspace {
                box-shadow: none;
                padding: 0;
                margin: 0;
                width: 100%;
            }
            
            .node-item {
                break-inside: avoid;
                page-break-inside: avoid;
            }
            
            .children-wrapper {
                break-inside: avoid;
            }
        }