/* ============================================
   NODE TAILLAGE — Thème cuivre/terracotta
   ============================================ */

/* Ligne d'accent cuivre pointillée en haut de la node taillage */
.node-type-taillage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: repeating-linear-gradient(90deg,
        var(--rnd-taillage) 0px, var(--rnd-taillage) 6px,
        transparent 6px, transparent 10px
    );
    opacity: 0.5;
    z-index: 1;
}

/* Chips catégorie */
.tai-cat-chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
}

.tai-cat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 7px;
    background: var(--rnd-bg-input, #0b0d12);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tai-cat-chip:hover {
    border-color: var(--rnd-border-hover, rgba(255,255,255,0.12));
    background: var(--rnd-bg-field, #13161d);
}

.tai-cat-chip.selected {
    border-color: var(--rnd-taillage-dim);
    background: var(--rnd-taillage-glow);
    box-shadow: 0 0 8px var(--rnd-taillage-glow);
}

.tai-cat-chip.selected .tai-cat-chip-icon {
    opacity: 1;
    transform: scale(1.1);
}

.tai-cat-chip.selected .tai-cat-chip-label {
    color: var(--rnd-taillage-soft);
}

.tai-cat-chip-icon {
    font-size: 14px;
    opacity: 0.45;
    transition: all 0.2s ease;
    line-height: 1;
}

.tai-cat-chip-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 7.5px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--rnd-text-muted, #555b69);
    text-transform: uppercase;
    transition: color 0.2s ease;
    line-height: 1.15;
    text-align: center;
}

/* Sélecteur technique taillage */
.tai-technique-selector {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Champs spec (taille, épaisseur, etc.) */
.tai-spec-row {
    display: flex;
    gap: 6px;
}

.tai-spec-input {
    width: 100%;
    padding: 7px 8px;
    background: var(--rnd-bg-input, #0b0d12);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 6px;
    color: var(--rnd-text, #f0f0f0);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.tai-spec-input::-webkit-outer-spin-button,
.tai-spec-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.tai-spec-input:focus {
    outline: none;
    border-color: var(--rnd-taillage-dim);
    background: var(--rnd-taillage-glow);
}

.tai-spec-input::placeholder {
    color: var(--rnd-text-placeholder, #3d4350);
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
}

.tai-spec-select {
    width: 100%;
    padding: 7px 24px 7px 8px;
    background: var(--rnd-bg-input, #0b0d12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555b69' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 6px;
    color: var(--rnd-text, #f0f0f0);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.tai-spec-select:focus {
    outline: none;
    border-color: var(--rnd-taillage-dim);
}

/* Toggle peau */
.tai-skin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
}

.tai-skin-toggle-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rnd-text-muted, #555b69);
}

.tai-skin-toggle {
    position: relative;
    width: 32px;
    height: 16px;
    cursor: pointer;
    display: inline-block;
}

.tai-skin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.tai-skin-toggle-track {
    position: absolute;
    inset: 0;
    background: var(--rnd-bg-input, #0b0d12);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 8px;
    transition: all 0.25s ease;
}

.tai-skin-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rnd-text-muted, #555b69);
    transition: all 0.25s ease;
    pointer-events: none;
}

.tai-skin-toggle input:checked ~ .tai-skin-toggle-track {
    border-color: var(--rnd-taillage-dim);
    background: var(--rnd-taillage-glow);
}

.tai-skin-toggle input:checked ~ .tai-skin-toggle-thumb {
    left: 18px;
    background: var(--rnd-taillage);
}

/* Compact body taillage */
.tai-compact-body {
    padding: 10px 12px;
}

.tai-compact-body .node-compact-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tai-compact-action-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.tai-compact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tai-compact-action-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--rnd-taillage-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tai-compact-detail {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--rnd-text-dim, #8a919e);
}

.tai-compact-skin {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rnd-text-muted, #555b69);
    padding: 2px 6px;
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 3px;
    margin-left: auto;
    flex-shrink: 0;
}

.tai-compact-skin.on {
    color: var(--rnd-taillage);
    border-color: var(--rnd-taillage-dim);
}

/* Modal technique taillage */
.tai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tai-modal {
    background: var(--rnd-bg-card, #0e1015);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 12px;
    width: 100%;
    max-width: 320px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
}

.tai-modal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--rnd-taillage-soft);
}

.tai-modal-close {
    background: none;
    border: none;
    color: var(--rnd-text-muted, #555b69);
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tai-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--rnd-text-dim, #8a919e);
}

.tai-modal-list {
    overflow-y: auto;
    padding: 8px;
}

.tai-modal-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tai-modal-item:hover {
    background: var(--rnd-taillage-glow);
}

.tai-modal-item.selected {
    background: var(--rnd-taillage-glow);
    border-left: 2px solid var(--rnd-taillage);
}

.tai-modal-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--rnd-text, #f0f0f0);
}

.tai-modal-item-desc {
    font-size: 10px;
    color: var(--rnd-text-dim, #8a919e);
}

/* Outils list + bouton ajouter */
.tai-outils-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}
.tai-outils-empty {
    font-size: 11px;
    color: var(--rnd-text-muted, #555b69);
    font-style: italic;
    padding: 4px 0;
}
.tai-outil-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 8px;
}
.tai-outil-icon {
    font-size: 14px;
}
.tai-outil-nom {
    font-size: 12px;
    color: var(--rnd-text, #f0f0f0);
    flex: 1;
}
.tai-outil-remove {
    background: none;
    border: none;
    color: var(--rnd-text-muted, #555b69);
    font-size: 16px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.tai-outil-remove:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff5050;
}
.tai-outil-add {
    background: none;
    border: 1px dashed var(--rnd-taillage-glow, rgba(255,255,255,0.1));
    color: var(--rnd-taillage-soft, var(--rnd-text-dim, #8a919e));
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tai-outil-add:hover {
    background: var(--rnd-taillage-glow, rgba(255,255,255,0.04));
    border-color: var(--rnd-taillage, rgba(255,255,255,0.15));
    color: var(--rnd-taillage, #f0f0f0);
}
.tai-outil-add.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Taillage: tous les éléments sont toujours interactifs (pas besoin de mode édition) */
.node-element:not(.editing) .tai-cat-chip,
.node-element:not(.editing) .tai-technique-selector,
.node-element:not(.editing) .tai-spec-input,
.node-element:not(.editing) .tai-spec-select,
.node-element:not(.editing) .tai-skin-toggle {
    pointer-events: auto;
    opacity: 1;
    cursor: pointer;
}

/* ============================================
   EXTRACTION NODE — Teal (#3db8a0)
   ============================================ */

/* Ligne d'accent teal — points en rang (gouttelettes) */
.node-type-extraction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: radial-gradient(circle, var(--rnd-extraction) 1px, transparent 1px);
    background-size: 8px 2px;
    opacity: 0.55;
    z-index: 1;
}

/* Chips catégorie extraction */
.ext-cat-chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
}

.ext-cat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 7px;
    background: var(--rnd-bg-input, #0b0d12);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ext-cat-chip:hover {
    border-color: var(--rnd-border-hover, rgba(255,255,255,0.12));
    background: var(--rnd-bg-field, #13161d);
}

.ext-cat-chip.selected {
    border-color: var(--rnd-extraction-dim);
    background: var(--rnd-extraction-glow);
    box-shadow: 0 0 8px var(--rnd-extraction-glow);
}

.ext-cat-chip.selected .ext-cat-chip-icon {
    opacity: 1;
    transform: scale(1.1);
}

.ext-cat-chip.selected .ext-cat-chip-label {
    color: var(--rnd-extraction-soft);
}

.ext-cat-chip-icon {
    font-size: 14px;
    opacity: 0.45;
    transition: all 0.2s ease;
    line-height: 1;
}

.ext-cat-chip-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 7.5px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--rnd-text-muted, #555b69);
    text-transform: uppercase;
    transition: color 0.2s ease;
    line-height: 1.15;
    text-align: center;
}

/* Sélecteur technique extraction */
.ext-technique-selector {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ext-technique-selector.has-value {
    border-color: var(--rnd-extraction-dim);
}

/* Context select (clarté / texture) */
.ext-context-select {
    width: 100%;
    padding: 7px 24px 7px 8px;
    background: var(--rnd-bg-input, #0b0d12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555b69' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 6px;
    color: var(--rnd-text, #f0f0f0);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ext-context-select:focus {
    outline: none;
    border-color: var(--rnd-extraction-dim);
}

/* Compact body extraction */
.ext-compact-body {
    padding: 10px 12px;
}

/* Modal technique extraction */
.ext-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ext-modal {
    background: var(--rnd-bg-card, #0e1015);
    border: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
    border-radius: 12px;
    width: 100%;
    max-width: 320px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ext-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rnd-border, rgba(255,255,255,0.06));
}

.ext-modal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--rnd-extraction-soft);
}

.ext-modal-close {
    background: none;
    border: none;
    color: var(--rnd-text-muted, #555b69);
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ext-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--rnd-text-dim, #8a919e);
}

.ext-modal-list {
    overflow-y: auto;
    padding: 8px;
}

.ext-modal-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ext-modal-item:hover {
    background: var(--rnd-extraction-glow);
}

.ext-modal-item.selected {
    background: var(--rnd-extraction-glow);
    border-left: 2px solid var(--rnd-extraction);
}

.ext-modal-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--rnd-text, #f0f0f0);
}

.ext-modal-item-desc {
    font-size: 10px;
    color: var(--rnd-text-dim, #8a919e);
}

/* Extraction: tous les éléments sont toujours interactifs */
.node-element:not(.editing) .ext-cat-chip,
.node-element:not(.editing) .ext-technique-selector,
.node-element:not(.editing) .ext-context-select {
    pointer-events: auto;
    opacity: 1;
    cursor: pointer;
}
