/**
 * Designer d'expériences - Styles
 * Copié depuis nodeR/www/styles.css pour rendre l'éditeur autonome.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #404040 #252525;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: #252525;
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
    background: #505050;
}
*::-webkit-scrollbar-corner {
    background: #252525;
}
.theme-light * {
    scrollbar-color: #bbb #e8e8e8;
}
.theme-light *::-webkit-scrollbar-track {
    background: #e8e8e8;
}
.theme-light *::-webkit-scrollbar-thumb {
    background: #bbb;
}
.theme-light *::-webkit-scrollbar-thumb:hover {
    background: #999;
}
.theme-light *::-webkit-scrollbar-corner {
    background: #e8e8e8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1e1e1e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

/* --- Mise en page Hébergement --- */

.hosting-body {
    background: #1e1e1e;
    color: #e0e0e0;
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

.hosting-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

.hosting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hosting-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hosting-logo-link img {
    display: block;
    height: 36px;
}

.hosting-title-block h1 {
    font-size: 1.4rem;
    margin-bottom: 0.15rem;
}

.hosting-subtitle {
    font-size: 0.9rem;
    color: #aaa;
}

.hosting-main {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.hosting-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.hosting-text {
    font-size: 0.9rem;
    color: #c0c0c0;
    margin-bottom: 0.75rem;
}

.hosting-form {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem 1rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: #151515;
}

.hosting-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.hosting-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.hosting-form-row label {
    font-size: 0.85rem;
}

.hosting-help {
    font-size: 0.8rem;
    color: #888;
}

.hosting-form-actions {
    margin-top: 0.25rem;
}

.hosting-alert {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.hosting-alert-error {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.hosting-alert-success {
    background: rgba(25, 135, 84, 0.12);
    border: 1px solid rgba(25, 135, 84, 0.5);
}

.hosting-alert ul {
    padding-left: 1.1rem;
}

.hosting-table-wrapper {
    margin-top: 0.75rem;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
}

.hosting-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.hosting-table th,
.hosting-table td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #333;
}

.hosting-table th {
    background: #181818;
    text-align: left;
    font-weight: 500;
}

.hosting-table tr:nth-child(even) td {
    background: #141414;
}

.hosting-table-stats td:nth-child(4),
.hosting-table-stats td:nth-child(5) {
    font-size: 0.8rem;
}

.hosting-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.hosting-tag-ok {
    background: rgba(25, 135, 84, 0.1);
    color: #8be3aa;
}

.hosting-tag-danger {
    background: rgba(220, 53, 69, 0.08);
    color: #f39ba6;
}

.hosting-tag-muted {
    background: rgba(255, 255, 255, 0.04);
    color: #999;
}

@media (max-width: 768px) {
    .hosting-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: #151515;
    border-bottom: 1px solid #404040;
    display: flex;
    flex-direction: column;
}

.ribbon-row .app-logo {
    flex-shrink: 0;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ribbon-row .app-logo img {
    display: block;
    height: 28px;
}

.app-version {
    font-size: 0.75rem;
    color: #888;
    margin-left: 0.5rem;
    cursor: pointer;
}
.app-version:hover { color: #aaa; }

.app-doc-link {
    font-size: 0.75rem;
    color: #6af;
    margin-left: 0.5rem;
    text-decoration: none;
}
.app-doc-link:hover { text-decoration: underline; }

.ribbon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem 0 0.5rem;
    min-height: 44px;
    border-bottom: 1px solid #404040;
    gap: 0.5rem;
}

.ribbon-row .ribbon-tabs {
    border-bottom: none;
    padding: 0;
    align-self: flex-end;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-top: -4px;
}

.btn-icon {
    padding: 0.35rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #e0e0e0;
}
.btn-icon:hover {
    color: #4a9eff;
}
.btn-icon .theme-icon-light {
    display: none;
}
.theme-light .btn-icon .theme-icon-dark {
    display: none;
}
.theme-light .btn-icon .theme-icon-light {
    display: inline-block;
}
.theme-light .btn-icon {
    color: #333;
}
.theme-light .btn-icon:hover {
    color: #4a9eff;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #4a9eff;
    color: white;
}

.btn-primary:hover {
    background: #3a8eef;
}

.btn-secondary {
    background: #404040;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #505050;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Avatar utilisateur (initiale colorée) */

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4a9eff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 0.25rem;
    box-shadow: 0 0 0 2px #1e1e1e;
}

.user-avatar-initial {
    display: inline-block;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.main-content-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.main-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #404040;
    flex-shrink: 0;
    background: #1a1a1a;
}

.main-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.9rem;
}

.main-tab:hover {
    color: #e0e0e0;
}

.main-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
}

.main-content-left .canvas-container,
.main-content-left .preview-iframe-container {
    flex: 1;
    min-height: 0;
}

.preview-iframe-container {
    display: flex;
    position: relative;
    background: #111;
}

.preview-iframe-container.hidden {
    display: none !important;
}

.main-content-left .canvas-container.hidden {
    display: none !important;
}

#preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.ribbon {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #404040;
    border-bottom: 1px solid #404040;
    width: 100%;
    position: relative;
    z-index: 10;
    overflow: visible;
    flex-shrink: 0;
}

.ribbon-tabs {
    display: flex;
    padding: 0 0.5rem;
    border-bottom: 1px solid #404040;
}

.ribbon-tab {
    padding: 0.5rem 1rem;
    padding-bottom: calc(0.5rem + 1px);
    background: transparent;
    border: none;
    border-radius: 4px 4px 0 0;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    margin-right: 0.25rem;
    margin-bottom: -1px;
    transition: background 0.15s, color 0.15s;
}

.ribbon-tab:hover {
    background: #353535;
    color: #4a9eff;
}

.ribbon-tab.active {
    background: #252525;
    color: #4a9eff;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

.ribbon-panels {
    background: #252525;
    padding: 0.5rem 0.75rem 0.5rem;
    overflow: visible;
    min-height: 6.5rem;
    height: 6.5rem;
    display: flex;
    align-items: flex-start;
}

.ribbon-panel {
    display: none;
    gap: 0.2rem 0.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
    height: 100%;
    min-height: 5.5rem;
}

.ribbon-panel.active {
    display: flex;
}

.ribbon-panel.active .ribbon-button,
.ribbon-panel.active .ribbon-group {
    animation: ribbon-slide-in 0.18s ease-out;
}

@keyframes ribbon-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#experienceRibbon .ribbon-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
    align-items: flex-start;
}

.ribbon-group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: flex-start;
}

.ribbon-group-buttons--small {
    flex-direction: column;
    align-items: stretch;
}

.ribbon-group-buttons-stack {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    gap: 0.08rem;
    align-items: start;
    margin: 0;
    flex-shrink: 0;
}

.ribbon-group-label {
    width: 100%;
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 0.15rem;
    font-weight: 600;
    text-align: center;
}

.ribbon-group + .ribbon-group {
    border-left: 1px solid #404040;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}

button.ribbon-button {
    font-family: inherit;
    border: 1px solid transparent;
    background: none;
    color: inherit;
}

button.ribbon-button.ribbon-button--primary .ribbon-button-icon {
    color: #7ad6ff;
}

.ribbon-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 80px;
    padding: 0.3rem 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    user-select: none;
    position: relative;
    overflow: visible;
}

.ribbon-button:hover {
    background: #353535;
    border-color: #4a9eff;
    transform: translateY(-1px);
}

.ribbon-button-tooltip {
    display: none;
}

.ribbon-global-tooltip {
    position: fixed;
    left: 0;
    width: 100vw;
    box-sizing: border-box;
    padding: 0.5rem 1.5rem;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    font-size: 0.8rem;
    color: #e0e0e0;
    white-space: normal;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
    z-index: 20;
}

.ribbon-global-tooltip.is-visible {
    opacity: 1;
}

.ribbon-global-tooltip--warning {
    color: #ffb84a;
}

.theme-light .ribbon-global-tooltip--warning {
    color: #ff9800;
}

.ribbon-button-icon {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a9eff;
}

/* Nœud dont la définition provient d'un fichier d'expérience (nodeDefs) */
.ribbon-button--from-file .ribbon-button-icon {
    color: #ffb84a; /* orange warning */
}

.theme-light .ribbon-button--from-file .ribbon-button-icon {
    color: #ff9800;
}

.ribbon-button-icon i {
    font-size: 2rem;
    line-height: 1;
}

.ribbon-button-label {
    text-align: center;
}

.ribbon-button-name {
    display: block;
    font-size: 0.8rem;
    color: #e0e0e0;
}

.ribbon-button-desc {
    display: block;
    font-size: 0.7rem;
    color: #999;
}

/* ribbon_size: small — icône à gauche (moitié taille), texte à droite, boutons empilables */
.ribbon-button--small {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 100px;
    padding: 0.1rem 0.2rem;
    gap: 0.2rem;
    margin: 0;
}

.ribbon-button--small .ribbon-button-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.ribbon-button--small .ribbon-button-icon i {
    font-size: 1rem;
}

.ribbon-button--small .ribbon-button-label {
    text-align: left;
    min-width: 0;
}

.ribbon-button--small .ribbon-button-name {
    font-size: 0.75rem;
}

.ribbon-button--small:hover {
    transform: none;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    background-image:
        linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
    cursor: default;
    width: 100%;
}

.connection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 2000000px;
    min-height: 2000000px;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
}

.loop-regions-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 2000000px;
    min-height: 2000000px;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.connection-canvas path.connection-line {
    pointer-events: stroke !important;
}

.node-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    min-width: 100%;
    min-height: 100%;
    pointer-events: auto;
    overflow: visible;
}

.node {
    position: absolute;
    background: #2d2d2d;
    border: 2px solid #404040;
    border-radius: 8px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: move;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s;
    z-index: 5;
}

.node:hover {
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.3);
}

.node.selected {
    border-color: #4a9eff;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.node-header {
    background: #353535;
    padding: 0.75rem;
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-title {
    font-weight: 600;
    color: #4a9eff;
    font-size: 0.9rem;
}

.node-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.node-close,
.node-collapse,
.node-duplicate {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0;
}

/* Menu contextuel du canevas (clic droit) */
.canvas-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 160px;
    padding: 0.25rem 0;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    list-style: none;
    margin: 0;
}
.canvas-context-menu.hidden {
    display: none;
}
.canvas-context-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: #e0e0e0;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.canvas-context-menu-item:hover,
.canvas-context-menu-item:focus {
    background: #404040;
    color: #fff;
    outline: none;
}
.canvas-context-menu-item--danger:hover,
.canvas-context-menu-item--danger:focus {
    background: #8b2635;
    color: #fff;
}

.node-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 1rem;
    padding: 0.75rem;
}

.node-ports {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.node-ports-output {
    margin-left: auto;
}

.node-param-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.node-param-row > label {
    max-width: 50%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.node-param-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.node-param-label-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.node-param-row-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.node-param-row--text .node-param-content {
    width: 100%;
}

.node .CodeMirror {
    min-height: 120px;
    max-height: 280px;
    height: 200px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #404040;
    user-select: text;
}
.node .CodeMirror-wrap pre {
    word-break: break-word;
}
.node .CodeMirror .CodeMirror-scroll {
    max-height: 280px;
}

.node-param-row--checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.node-param-row--checkbox .node-input {
    width: auto;
}

.node-port {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.port {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #404040;
    cursor: crosshair;
    position: relative;
    z-index: 15;
    transition: all 0.2s;
    pointer-events: auto;
    box-sizing: content-box;
}

/* Ports multi-connexions : rectangle arrondi vertical (étendue plus grande) */
.port[data-multiconnect="true"] {
    width: 10px;
    height: 28px;
    border-radius: 5px;
}

.port:hover {
    transform: scale(1.3);
    border-color: #4a9eff;
}

.port.input {
    margin-left: -6px;
}

.port.output {
    margin-right: -6px;
}

.port-label {
    flex: 1;
    color: #ccc;
}

.node-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.node-input:focus {
    outline: none;
    border-color: #4a9eff;
}

/* Textarea dans un nœud : redimensionnement vertical uniquement, ne dépasse pas la largeur du nœud */
.node textarea.node-input {
    resize: vertical;
    min-height: 2.5rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Modal agrandi pour éditer les paramètres d'un nœud (double-clic) */
.node-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    z-index: 10000;
    padding: 0;
}

.node-modal-panel {
    background: #252525;
    border: none;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.node-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #404040;
    flex-shrink: 0;
}

.node-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
}

.node-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.node-modal-close:hover {
    color: #e0e0e0;
    background: #404040;
}

.node-modal-body {
    overflow-y: auto;
    padding: 1rem;
    flex: 1;
    min-height: 0;
}

.node-modal-body-clone .node-ports {
    display: none;
}

.node-modal-body-clone .node-param-row {
    margin-bottom: 0.75rem;
}

.node-modal-body-clone .node-input,
.node-modal-body-clone textarea.node-input {
    min-height: 2.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
}

.node-modal-body-clone textarea.node-input {
    min-height: 4rem;
    resize: vertical;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.node-modal-body-clone .CodeMirror {
    min-height: 200px;
    height: 50vh;
    max-height: 70vh;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #404040;
    user-select: text;
}
.node-modal-body-clone .CodeMirror .CodeMirror-scroll {
    max-height: 70vh;
}

.node-textarea {
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 2rem;
    line-height: 1.4;
    font-family: inherit;
}

.code-panel {
    width: 400px;
    background: #252525;
    border-left: 1px solid #404040;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
}

.code-header {
    padding: 1rem;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header h2 {
    font-size: 1.1rem;
    color: #4a9eff;
}

.results-header {
    padding: 1rem;
    border-top: 1px solid #404040;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
}

.results-output {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    min-height: 150px;
}

.data-col-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.data-col-source-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    padding: 0.1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #d4a017;
    border-radius: 4px;
    cursor: help;
}
.data-col-source-count:hover {
    background: #e6b82e;
}

#data-table tbody td:first-child {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.connection-line {
    stroke-width: 3;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
    transition: all 0.2s;
}

.connection-line:hover {
    stroke: #ff6b6b;
    stroke-width: 4;
}

/* --- Modal de création de nœud --- */

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-dialog {
    position: relative;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #404040;
    width: 720px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

.modal-header,
.modal-footer {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-footer {
    border-top: 1px solid #404040;
    border-bottom: none;
}

.modal-header h2 {
    font-size: 1rem;
    color: #4a9eff;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modal Nouveautés */
.modal-dialog--nouveautes { max-width: 480px; }
.nouveautes-block { margin-bottom: 1rem; }
.nouveautes-block:last-child { margin-bottom: 0; }
.nouveautes-block-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.nouveautes-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
}
.nouveautes-version-num {
    font-size: 0.75rem;
    color: #888;
    font-weight: normal;
}
.nouveautes-version {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
.nouveautes-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.nouveautes-list li { margin-bottom: 0.25rem; }
.nouveautes-empty { color: #888; font-size: 0.9rem; }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row label {
    font-size: 0.8rem;
    color: #ccc;
}

.form-error {
    margin-top: 0.5rem;
    color: #ff6b6b;
    font-size: 0.8rem;
    min-height: 1rem;
}

/* --- Thème clair --- */

.theme-light body {
    background: #f0f0f0;
    color: #222;
}

.theme-light header {
    background: #e8e8e8;
    border-bottom-color: #ccc;
}

.theme-light .ribbon-row {
    border-bottom-color: #ccc;
}

.theme-light .main-tabs {
    background: #e8e8e8;
    border-bottom-color: #ccc;
}

.theme-light .main-tab {
    color: #555;
}

.theme-light .main-tab:hover {
    color: #222;
    background: #ddd;
}

.theme-light .main-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
    background: #f5f5f5;
}

.theme-light .ribbon-tab {
    color: #333;
}
.theme-light .ribbon-tab:hover {
    background: #ddd;
    color: #4a9eff;
}
.theme-light .ribbon-tab.active {
    background: #f5f5f5;
    color: #4a9eff;
}

.theme-light .ribbon-panels {
    background: #f5f5f5;
}

.theme-light .ribbon-button-icon {
    color: #4a9eff;
}
.theme-light .ribbon-button-name {
    color: #333;
}
.theme-light .ribbon-button:hover {
    background: #e0e0e0;
}

.theme-light .ribbon-global-tooltip {
    background: #f5f5f5;
    border-bottom-color: #ccc;
    color: #333;
}

.theme-light .canvas-container {
    background: #e5e5e5;
    background-image:
        linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

.theme-light .preview-iframe-container {
    background: #f5f5f5;
}

.theme-light .node {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.theme-light .node:hover {
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}
.theme-light .node.selected {
    border-color: #4a9eff;
}
.theme-light .node-header {
    background: #f5f5f5;
    border-bottom-color: #ddd;
}
.theme-light .node-title {
    color: #4a9eff;
}
.theme-light .node-input {
    background: #fff;
    border-color: #ccc;
    color: #222;
}
.theme-light .port-label {
    color: #555;
}

.theme-light .code-panel {
    background: #e8e8e8;
    border-left-color: #ccc;
}
.theme-light .code-header h2,
.theme-light .results-header {
    border-color: #ccc;
    background: #f0f0f0;
}
.theme-light .results-output {
    background: #fff;
    color: #222;
}

.theme-light .btn-secondary {
    background: #ccc;
    color: #333;
}
.theme-light .btn-secondary:hover {
    background: #bbb;
}

.theme-light .user-avatar {
    box-shadow: 0 0 0 2px #f0f0f0;
}

.theme-light .modal-dialog {
    background: #fff;
    border-color: #ccc;
}
.theme-light .modal-backdrop {
    background: rgba(0, 0, 0, 0.35);
}
.theme-light .node-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}
.theme-light .node-modal-panel {
    background: #fff;
    border: none;
    box-shadow: none;
}
.theme-light .node-modal-header {
    border-bottom-color: #ddd;
}
.theme-light .node-modal-title {
    color: #333;
}
.theme-light .node-modal-close {
    color: #666;
}
.theme-light .node-modal-close:hover {
    color: #222;
    background: #e8e8e8;
}
.theme-light .node-modal-body-clone .node-param-row label {
    color: #555;
}
.theme-light .node-modal-body-clone .node-input,
.theme-light .node-modal-body-clone textarea.node-input {
    background: #fff;
    border-color: #ccc;
    color: #333;
}
.theme-light .canvas-context-menu {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.theme-light .canvas-context-menu-item {
    color: #333;
}
.theme-light .canvas-context-menu-item:hover,
.theme-light .canvas-context-menu-item:focus {
    background: #e8e8e8;
    color: #222;
}
.theme-light .canvas-context-menu-item--danger:hover,
.theme-light .canvas-context-menu-item--danger:focus {
    background: #e8b4b8;
    color: #8b2635;
}
.theme-light .nouveautes-date { color: #333; }
.theme-light .nouveautes-version-num { color: #666; }
.theme-light .form-row label {
    color: #555;
}