/**
 * AVC Builder — professional visual layer
 * Keeps the existing interaction model while tightening hierarchy and density.
 */

body.workflow-builder-page {
    --avc-ink: #172033;
    --avc-muted: #667085;
    --avc-subtle: #98a2b3;
    --avc-border: #e4e7ec;
    --avc-surface: #ffffff;
    --avc-surface-soft: #f8fafc;
    --avc-canvas: #f6f8fb;
    --avc-accent: #4f46e5;
    --avc-accent-soft: #eef2ff;
    --avc-success: #16a36a;
    color: var(--avc-ink);
    background: var(--avc-canvas);
}

/* Hypothèses & scénarios — modal compact et cohérent avec le builder */
.hypothesis-modal .hypothesis-modal__dialog {
    max-width: 760px;
}

.hypothesis-modal .hypothesis-modal__content {
    overflow: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(16, 24, 40, .18);
}

.hypothesis-modal .hypothesis-modal__header {
    min-height: 54px;
    padding: 12px 18px;
    color: #fff;
    background: #172033;
    border: 0;
}

.hypothesis-modal .hypothesis-modal__header .modal-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff !important;
    font-size: 16px;
    font-weight: 680;
}

.hypothesis-modal .hypothesis-modal__header .modal-title i,
.hypothesis-modal .hypothesis-modal__header .btn-close {
    color: #fff !important;
    opacity: 1;
}

.hypothesis-modal .hypothesis-modal__body {
    padding: 18px;
    background: #f8fafc;
}

.hypothesis-modal .hypothesis-modal__intro {
    margin: 0 0 14px;
    color: #667085;
    font-size: 12px;
}

.hypothesis-modal .hypothesis-scenarios-list {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.hypothesis-modal .hypothesis-scenario-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 9px;
}

.hypothesis-modal .hypothesis-scenario-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #eaecf0;
}

.hypothesis-modal .hypothesis-scenario-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #4338ca;
    background: #eef2ff;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 750;
}

.hypothesis-modal .scenario-name-input,
.hypothesis-modal .variable-key,
.hypothesis-modal .variable-value {
    min-height: 34px;
    height: 34px;
    padding: 6px 10px;
    color: #172033;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: none;
}

.hypothesis-modal .scenario-name-input {
    font-weight: 650;
}

.hypothesis-modal .form-control:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.hypothesis-modal .hypothesis-scenario-body {
    padding: 12px;
}

.hypothesis-modal .hypothesis-field-label {
    margin-bottom: 7px;
    color: #475467;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hypothesis-modal .scenario-variables-list {
    display: grid;
    gap: 7px;
    margin-bottom: 8px;
}

.hypothesis-modal .hypothesis-variable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 6px;
}

.hypothesis-modal .hypothesis-variable-equals {
    color: #98a2b3;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.hypothesis-modal .hypothesis-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #667085;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 11px;
}

.hypothesis-modal .hypothesis-icon-btn.danger {
    color: #c4324a;
}

.hypothesis-modal .hypothesis-icon-btn:hover {
    background: #f2f4f7;
}

.hypothesis-modal .hypothesis-add-variable,
.hypothesis-modal .hypothesis-add-scenario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    gap: 6px;
    color: #475467;
    background: #fff;
    border: 1px dashed #b8c0cc;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 650;
}

.hypothesis-modal .hypothesis-add-scenario {
    color: #4338ca;
    border-color: #a5b4fc;
}

.hypothesis-modal .hypothesis-add-variable:hover,
.hypothesis-modal .hypothesis-add-scenario:hover {
    background: #f5f7ff;
    border-color: #818cf8;
}

.hypothesis-modal .hypothesis-modal__footer {
    padding: 10px 18px;
    background: #fff;
    border-top: 1px solid #eaecf0;
}

.hypothesis-modal .hypothesis-btn-secondary,
.hypothesis-modal .hypothesis-btn-primary {
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 650;
}

.hypothesis-modal .hypothesis-btn-secondary {
    color: #344054;
    background: #fff;
    border: 1px solid #d0d5dd;
}

.hypothesis-modal .hypothesis-btn-primary {
    color: #fff;
    background: #4f46e5;
    border: 1px solid #4f46e5;
}

.hypothesis-modal .hypothesis-modal__footer .hypothesis-btn-primary,
body.workflow-builder-page .node-config-modal .node-config-modal__footer .hypothesis-btn-primary,
body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 104px;
    min-height: 34px;
    padding: 7px 13px;
    gap: 6px;
    color: #fff !important;
    background: #4f46e5 !important;
    border: 1px solid #4f46e5 !important;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 680;
    line-height: 1;
    box-shadow: none !important;
}

.hypothesis-modal .hypothesis-modal__footer .hypothesis-btn-primary:hover,
body.workflow-builder-page .node-config-modal .node-config-modal__footer .hypothesis-btn-primary:hover,
body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-footer .btn-primary:hover {
    color: #fff !important;
    background: #4338ca !important;
    border-color: #4338ca !important;
    transform: none;
    box-shadow: 0 2px 5px rgba(67, 56, 202, .18) !important;
}

.hypothesis-modal .hypothesis-modal__footer .hypothesis-btn-primary i,
body.workflow-builder-page .node-config-modal .node-config-modal__footer .hypothesis-btn-primary i,
body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-footer .btn-primary i {
    font-size: 10px;
}

@media (max-width: 600px) {
    .hypothesis-modal .hypothesis-variable-row {
        grid-template-columns: 1fr 24px 1fr 32px;
    }
}

/* Modals historiques des nœuds personnalisés */
body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-dialog,
body.workflow-builder-page .node-config-modal .modal-dialog {
    max-width: 760px;
}

body.workflow-builder-page .modal .modal-header[style*="linear-gradient"],
body.workflow-builder-page .node-config-modal .legacy-node-modal-header {
    min-height: 54px;
    padding: 12px 18px;
    color: #fff !important;
    background: #172033 !important;
    border: 0;
}

body.workflow-builder-page .modal .modal-header[style*="linear-gradient"] .modal-title,
body.workflow-builder-page .node-config-modal .legacy-node-modal-header .modal-title,
body.workflow-builder-page .modal .modal-header[style*="linear-gradient"] .modal-title i,
body.workflow-builder-page .node-config-modal .legacy-node-modal-header .modal-title i {
    color: #fff !important;
}

body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-content,
body.workflow-builder-page .node-config-modal .modal-content {
    overflow: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(16, 24, 40, .18);
}

body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-body,
body.workflow-builder-page .node-config-modal .node-config-modal__body {
    padding: 18px;
    background: #f8fafc;
}

/* Publication : formulaire court, sans texte d'aide redondant. */
body.workflow-builder-page #publishReportModal .modal-header {
    padding: 10px 16px;
}

body.workflow-builder-page #publishReportModal .modal-body {
    padding: 12px 16px;
}

body.workflow-builder-page #publishReportModal .modal-footer {
    padding: 8px 16px;
}

body.workflow-builder-page #publishReportModal .form-label {
    margin-bottom: 4px;
}

body.workflow-builder-page #publishReportModal .form-check {
    margin-bottom: 5px !important;
}

body.workflow-builder-page #publishReportModal .form-check .small {
    line-height: 1.15;
}

body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .modal-footer,
body.workflow-builder-page .node-config-modal .node-config-modal__footer {
    padding: 10px 18px;
    background: #fff;
    border-top: 1px solid #eaecf0;
}

body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .form-control,
body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .form-select,
body.workflow-builder-page .node-config-modal .form-control,
body.workflow-builder-page .node-config-modal .form-select {
    min-height: 34px;
    padding: 6px 10px;
    color: #172033;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: none;
}

body.workflow-builder-page .modal:has(.modal-header[style*="linear-gradient"]) .btn,
body.workflow-builder-page .node-config-modal .btn {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 650;
}

.parameters-modal .node-config-modal__intro {
    margin: 0 0 14px;
    color: #667085;
    font-size: 12px;
}

.parameters-modal .actuarial-parameters-list {
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
}

.parameters-modal .actuarial-parameter-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) 24px minmax(130px, 1fr) 90px 32px;
    align-items: center;
    gap: 6px;
}

.parameters-modal .actuarial-parameter-equals {
    color: #98a2b3;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.parameters-modal .hypothesis-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #c4324a;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 11px;
}

.parameters-modal .hypothesis-icon-btn:hover {
    background: #fff1f3;
    border-color: #f4b8c2;
}

@media (max-width: 680px) {
    .parameters-modal .actuarial-parameter-row {
        grid-template-columns: 1fr 24px 1fr 70px 32px;
    }
}

/* Application header */
body.workflow-builder-page .da-header {
    min-height: 48px;
    height: 48px;
    padding: 0 10px;
    gap: 8px;
    background: #172033;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .18);
}

body.workflow-builder-page .da-header-left,
body.workflow-builder-page .da-header-right {
    gap: 4px;
}

body.workflow-builder-page .da-logo {
    min-width: auto;
    padding: 0 9px 0 2px;
    border-right: 1px solid rgba(255, 255, 255, .12);
}

body.workflow-builder-page .da-logo img {
    display: none;
}

body.workflow-builder-page .da-logo-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.01em;
}

body.workflow-builder-page .da-product-nav-link {
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #cbd5e1;
    font-size: 11px;
}

body.workflow-builder-page .da-product-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .08);
}

.workflow-builder-container {
    height: calc(100vh - 48px);
    background: var(--avc-canvas);
}

.workflow-nav-v2 {
    gap: 6px;
}

.workflow-name-compact {
    width: min(220px, 18vw);
    height: 32px;
    padding: 0 8px;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 6px;
    background: rgba(255, 255, 255, .04);
}

.workflow-name-compact i {
    color: #a5b4fc;
    font-size: 12px;
}

.workflow-name-input-compact {
    height: 30px;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 550;
}

.workflow-name-input-compact::placeholder {
    color: #94a3b8;
}

.workflow-nav-v2 .workflow-actions-compact {
    gap: 4px;
}

.workflow-nav-v2 .da-nav-btn {
    min-height: 30px;
    height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    box-shadow: none;
}

.workflow-nav-v2 .da-nav-btn-secondary,
.workflow-nav-v2 .da-split-btn-main,
.workflow-nav-v2 .da-split-btn-arrow {
    color: #d0d5dd !important;
    background: transparent;
    border-color: rgba(255, 255, 255, .12);
}

.workflow-nav-v2 .da-nav-btn-secondary:hover,
.workflow-nav-v2 .da-split-btn-main:hover,
.workflow-nav-v2 .da-split-btn-arrow:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
    transform: none;
}

.workflow-nav-v2 .da-nav-btn-primary {
    min-width: 68px;
    background: var(--avc-success);
    border-color: #128158;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}

.workflow-nav-v2 .da-nav-btn-primary span {
    display: inline !important;
}

.workflow-nav-v2 .da-nav-btn-primary i {
    font-size: 10px;
}

.workflow-nav-v2 .da-nav-btn-primary:hover {
    background: #128158;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
}

.workflow-nav-v2 .toolbar-separator {
    height: 16px;
    margin: 0 2px;
    background: rgba(255, 255, 255, .12);
}

body.workflow-builder-page .da-header-right > div > .da-btn {
    min-height: 30px;
    height: 30px;
    padding: 4px 7px !important;
    background: transparent !important;
    border-color: rgba(255, 255, 255, .12) !important;
    border-radius: 6px;
    font-size: 10.5px;
    box-shadow: none;
}

body.workflow-builder-page #baseBuilderDropdownWrapper .da-btn {
    max-width: 112px;
}

body.workflow-builder-page #baseNavDropdownWrapper .da-btn {
    width: 38px;
    justify-content: center;
    padding: 4px 5px !important;
}

body.workflow-builder-page #baseNavDropdownWrapper .da-btn .btn-label {
    display: none;
}

body.workflow-builder-page #baseNavDropdownWrapper .da-btn .fa-chevron-down {
    margin-left: 0 !important;
}

body.workflow-builder-page #baseNavDropdownWrapper .da-btn > .fa-briefcase {
    font-size: 11px;
}

/* Sidebar */
.sidebar-tools {
    width: 252px;
    padding: 0 12px 18px;
    background: var(--avc-surface);
    border-right: 1px solid var(--avc-border);
    box-shadow: none;
}

.sidebar-tabs {
    margin: 0 -12px;
    background: #fff;
    border-bottom: 1px solid var(--avc-border);
}

.sidebar-tab {
    min-height: 45px;
    padding: 9px 6px;
    color: var(--avc-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0;
}

.sidebar-tab.active,
.sidebar-tab#tabCopilot.active {
    color: var(--avc-accent);
    border-bottom-color: var(--avc-accent);
}

.sidebar-tab:hover:not(.active) {
    color: var(--avc-ink);
    background: var(--avc-surface-soft);
}

.sidebar-search-wrap {
    margin: 0 -12px 16px;
    padding: 12px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--avc-border);
    box-shadow: none;
}

.sidebar-search-input {
    min-height: 36px;
    padding: 7px 10px 7px 32px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    color: var(--avc-ink);
    font-size: 12px;
}

.sidebar-search-input:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .09);
}

.sidebar-search-input::placeholder {
    color: var(--avc-subtle);
    font-size: 12px;
}

/* Copilot — panneau clair, compact et aligné avec le builder */
body.workflow-builder-page #sidebarCopilotPanel {
    color: #172033;
    background: #f8fafc;
    overflow: hidden;
    min-height: 0;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-header {
    order: 1;
    padding: 10px 11px 8px;
    background: #fff;
    border-bottom: 1px solid #eaecf0;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-mcp-pill {
    min-height: 34px;
    padding: 7px 10px;
    color: #087443;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 7px;
    font-size: 10px;
    box-shadow: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-mcp-pill strong {
    color: #475467;
    font-size: 10px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-mcp-dot {
    width: 6px;
    height: 6px;
    background: #17b26a;
    box-shadow: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-agents-section {
    order: 2;
    padding: 10px 11px 11px;
    background: #fff;
    border-bottom: 1px solid #eaecf0;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-agents-label {
    margin-bottom: 6px;
    color: #98a2b3;
    font-size: 8.5px;
    letter-spacing: .08em;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-agents-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-badge {
    justify-content: flex-start;
    width: 100%;
    min-height: 27px;
    padding: 4px 8px;
    gap: 5px;
    color: #344054;
    background: #f9fafb;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 9.5px;
    font-weight: 620;
    box-shadow: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-badge i {
    color: #667085;
    font-size: 8.5px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-badge--life {
    color: #087443;
    background: #ecfdf3;
    border-color: #abefc6;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-badge--support {
    color: #175cd3;
    background: #eff8ff;
    border-color: #b2ddff;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-badge.active {
    color: #fff;
    background: #4f46e5;
    border-color: #4f46e5;
    animation: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-wrap {
    position: sticky;
    z-index: 5;
    bottom: 0;
    order: 5;
    margin-top: auto;
    padding: 11px;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #eaecf0;
    border-bottom: 0;
    box-shadow: 0 -8px 22px rgba(16, 24, 40, .055);
    backdrop-filter: blur(8px);
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell::after {
    content: "";
    position: absolute;
    right: 100%;
    bottom: 0;
    width: 45%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, #22c55e, transparent);
    opacity: 0;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell.is-typing::after {
    opacity: 1;
    animation: copilot-input-flow 1.6s ease-in-out infinite;
}

@keyframes copilot-input-flow {
    from { transform: translateX(0); }
    to { transform: translateX(325%); }
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-effect {
    position: absolute;
    right: 9px;
    bottom: 7px;
    display: inline-flex;
    gap: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell.is-typing .cp-input-effect {
    opacity: 1;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-effect span {
    width: 3px;
    height: 3px;
    background: #6366f1;
    border-radius: 50%;
    animation: copilot-typing-dot .9s ease-in-out infinite;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-effect span:nth-child(2) {
    animation-delay: .12s;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-effect span:nth-child(3) {
    animation-delay: .24s;
}

@keyframes copilot-typing-dot {
    0%, 100% { opacity: .3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 78px;
    max-height: 126px;
    padding: 10px 11px;
    color: #172033;
    font-size: 11px;
    line-height: 1.5;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-textarea::placeholder {
    color: #98a2b3;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-input-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 38px;
    margin-top: 7px;
    gap: 6px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-send-btn {
    width: 100%;
    min-height: 34px;
    padding: 7px 11px;
    color: #fff;
    background: #4f46e5;
    border: 1px solid #4f46e5;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 680;
    letter-spacing: 0;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-send-btn:hover {
    background: #4338ca;
    border-color: #4338ca;
    opacity: 1;
    transform: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-clear-btn {
    width: 38px;
    min-height: 34px;
    padding: 0;
    color: #b42318;
    background: #fff;
    border: 1px solid #f4b8b3;
    border-radius: 7px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-height: 34px;
    padding: 0;
    color: #475467;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 10.5px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attach-btn:hover {
    color: #4338ca;
    background: #f5f7ff;
    border-color: #a5b4fc;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attachment {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 6px 7px;
    color: #344054;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: 9.5px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attachment > i {
    color: #4f46e5;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attachment span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attachment button {
    width: 22px;
    height: 22px;
    padding: 0;
    color: #b42318;
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 9px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-attachment button:hover {
    background: #fef3f2;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-clear-btn:hover {
    background: #fef3f2;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-shortcut-hint {
    margin-top: 5px;
    padding-right: 2px;
    color: #98a2b3;
    font-size: 8.5px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-loading {
    order: 4;
    color: #667085;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-response {
    order: 3;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 11px 16px;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-response::-webkit-scrollbar {
    width: 5px;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-response::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

body.workflow-builder-page #sidebarCopilotPanel > .modal {
    order: 6;
}

@media (max-width: 420px) {
    body.workflow-builder-page #sidebarCopilotPanel .cp-header,
    body.workflow-builder-page #sidebarCopilotPanel .cp-agents-section,
    body.workflow-builder-page #sidebarCopilotPanel .cp-input-wrap {
        padding-right: 9px;
        padding-left: 9px;
    }

    body.workflow-builder-page #sidebarCopilotPanel .cp-mcp-pill {
        min-height: 32px;
        padding: 6px 9px;
    }

    body.workflow-builder-page #sidebarCopilotPanel .cp-badge {
        min-height: 29px;
        padding: 5px 7px;
        font-size: 9px;
    }

    body.workflow-builder-page #sidebarCopilotPanel .cp-textarea {
        min-height: 86px;
        font-size: 10.5px;
    }
}

body.workflow-builder-page #sidebarCopilotPanel .cp-synthesis-card,
body.workflow-builder-page #sidebarCopilotPanel .copilot-agent-card {
    color: #344054;
    background: #fff;
    border: 1px solid #dfe3ea;
    box-shadow: none;
}

body.workflow-builder-page #sidebarCopilotPanel .cp-synthesis-body,
body.workflow-builder-page #sidebarCopilotPanel .copilot-agent-card-summary,
body.workflow-builder-page #sidebarCopilotPanel .copilot-agent-card-findings li {
    color: #475467;
}

@media (prefers-reduced-motion: reduce) {
    body.workflow-builder-page #sidebarCopilotPanel .cp-textarea-shell.is-typing::after,
    body.workflow-builder-page #sidebarCopilotPanel .cp-input-effect span {
        animation: none;
    }
}

.tool-category {
    margin-bottom: 22px;
}

.tool-category h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 9px;
    color: #667085;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .065em;
}

.tool-category h4 i {
    color: #98a2b3;
    font-size: 9px;
}

.tool-node {
    min-height: 58px;
    margin-bottom: 7px;
    padding: 9px 10px;
    gap: 10px;
    border: 1px solid var(--avc-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.tool-node:hover {
    transform: none;
    border-color: #a5b4fc;
    background: #fafaff;
    box-shadow: 0 3px 10px rgba(16, 24, 40, .07);
}

.tool-node-icon,
.tool-node .tool-node-icon[style] {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 7px;
    color: var(--avc-accent);
    background: var(--avc-accent-soft) !important;
    font-size: 14px;
}

.tool-node-name {
    color: var(--avc-ink);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
}

.tool-node-desc {
    margin-top: 2px;
    color: var(--avc-muted);
    font-size: 10.5px;
    line-height: 1.3;
}

.tool-node-action {
    width: 26px;
    height: 26px;
    color: var(--avc-accent);
    background: var(--avc-accent-soft);
    border-radius: 6px;
    box-shadow: none;
}

/* Canvas */
.canvas-container {
    background-color: var(--avc-canvas);
    background-image:
        linear-gradient(90deg, rgba(71, 84, 103, .055) 1px, transparent 1px),
        linear-gradient(rgba(71, 84, 103, .055) 1px, transparent 1px);
    background-size: 24px 24px;
}

.workflow-quick-toolbar {
    position: absolute;
    z-index: 80;
    top: 16px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 44px;
    padding: 5px 7px;
    transform: translateX(-50%);
    color: #475467;
    background: rgba(255, 255, 255, .97);
    border: 1px solid #d8dee8;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(16, 24, 40, .16);
    backdrop-filter: blur(8px);
}

.workflow-quick-toolbar__group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.workflow-quick-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    padding: 0;
    color: #475467;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}

.workflow-quick-toolbar__btn:hover:not(:disabled) {
    color: var(--avc-accent);
    background: var(--avc-accent-soft);
    transform: translateY(-1px);
}

.workflow-quick-toolbar__btn--danger:hover:not(:disabled) {
    color: #d92d20;
    background: #fef3f2;
}

.workflow-quick-toolbar__btn:focus-visible {
    outline: 2px solid var(--avc-accent);
    outline-offset: 1px;
}

.workflow-quick-toolbar__btn:disabled {
    color: #c4cbd4;
    cursor: default;
}

.workflow-quick-toolbar__separator {
    width: 1px;
    height: 24px;
    margin: 0 3px;
    background: #d8dee8;
}

.interaction-mode-toggle {
    top: 16px;
    left: 16px;
    padding: 3px;
    border: 1px solid var(--avc-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
}

@media (max-width: 900px) {
    .workflow-quick-toolbar {
        left: 72px;
        max-width: calc(100% - 88px);
        overflow-x: auto;
        transform: none;
    }
}

.mode-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: var(--avc-muted);
}

.mode-btn.active {
    color: #fff;
    background: var(--avc-accent);
    box-shadow: none;
}

.fullscreen-btn {
    top: 72px;
    right: 16px;
    width: 36px;
    height: 36px;
    color: var(--avc-muted);
    background: #fff;
    border: 1px solid var(--avc-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .07);
}

.canvas-controls {
    bottom: 16px;
    left: 268px;
    gap: 6px;
}

.controls-group,
.zoom-indicator {
    border-color: var(--avc-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .07);
}

.control-btn {
    width: 34px;
    height: 34px;
    color: var(--avc-muted);
}

.control-btn:hover {
    color: var(--avc-accent);
    background: var(--avc-accent-soft);
}

.zoom-indicator {
    padding: 5px 7px;
    color: var(--avc-muted);
    font-size: 10px;
}

.minimap-container {
    right: 318px;
    bottom: 16px;
    border-color: var(--avc-border);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(16, 24, 40, .08);
}

.minimap-header {
    padding: 7px 10px;
    background: #fff;
    border-bottom-color: var(--avc-border);
}

.minimap-title {
    color: var(--avc-muted);
    font-size: 9px;
    letter-spacing: .07em;
}

.minimap-content {
    width: 170px;
    height: 112px;
    background: var(--avc-surface-soft);
}

.minimap-viewport {
    border-color: var(--avc-accent);
    background: rgba(79, 70, 229, .06);
}

/* Properties and workflow nodes */
.properties-panel {
    width: 300px;
    background: #fff;
    border-left: 1px solid var(--avc-border);
    box-shadow: none;
}

.properties-panel h3 {
    min-height: 46px;
    padding: 13px 16px;
    color: var(--avc-ink);
    background: #fff;
    border-bottom: 1px solid var(--avc-border);
    font-size: 12px;
    font-weight: 700;
}

.properties-panel .properties-panel-toggle {
    border-color: var(--avc-border);
    color: var(--avc-muted);
    background: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .06);
}

.canvas-node {
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(16, 24, 40, .08);
}

.canvas-node:hover {
    transform: none;
    border-color: #a5b4fc;
    box-shadow: 0 6px 16px rgba(16, 24, 40, .1);
}

.canvas-node.selected {
    border-color: var(--avc-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .1), 0 6px 16px rgba(16, 24, 40, .1);
}

@media (max-width: 1180px) {
    .workflow-name-compact { width: 190px; }
    body.workflow-builder-page .da-product-nav-link span,
    .workflow-nav-v2 .da-nav-btn-secondary span:not(.run-label) { display: none; }
    .workflow-nav-v2 .da-nav-btn-secondary { width: 34px; padding: 6px 0; }
}

@media (max-width: 768px) {
    body.workflow-builder-page .da-header { padding: 0 10px; }
    .workflow-name-compact { width: 150px; }
    .canvas-controls { left: 16px; }
    .minimap-container { right: 16px; }
}
