/* Final layout layer for ComfyUI only.
   This file is intentionally scoped to #comfyPage so Banana/SD remain untouched. */

#comfyPage {
    background: #000 !important;
    height: 100% !important;
    min-height: 100% !important;
}

#comfyPage.tab-page {
    height: 100% !important;
    min-height: 100% !important;
}

#comfyPage.tab-page.active {
    display: block !important;
}

.main-content > #comfyPage {
    height: 100% !important;
    min-height: 100% !important;
}

#comfyPage #wk-app-container.pages-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

#comfyPage #workflow-page.page.active {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
    min-height: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    background: rgba(8, 12, 20, 1) !important;
}

#comfyPage #workflow-page .connection-panel,
#comfyPage #workflow-page .workflow-container,
#comfyPage #workflow-page .settings-bar-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

#comfyPage #workflow-page .connection-panel {
    flex: 0 0 auto !important;
}

#comfyPage #workflow-page .connection-panel {
    min-height: auto !important;
    padding: 10px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(71, 85, 105, 0.42) !important;
    background: rgba(15, 23, 42, 0.92) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22) !important;
    overflow: visible !important;
}

#comfyPage #workflow-page .message-container {
    position: static !important;
    width: 100% !important;
    padding: 8px 0 0 0 !important;
    margin: 0 !important;
    text-align: center !important;
}

#comfyPage #workflow-page .welcome-message,
#comfyPage #workflow-page .error-message {
    font-size: 13px !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: none !important;
    text-align: center !important;
}

#comfyPage #workflow-page .connection-panel .connection-buttons {
    gap: 6px !important;
}

#comfyPage #workflow-page .connection-panel .status-bar {
    width: 100% !important;
    margin-top: 4px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    min-height: 22px !important;
    justify-content: center !important;
    order: 2 !important;
}

#comfyPage #workflow-page .workflow-container {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    border-radius: 12px !important;
    border: 1px solid rgba(71, 85, 105, 0.42) !important;
    background: rgba(15, 23, 42, 0.92) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22) !important;
    overflow: hidden !important;
}

#comfyPage #workflow-page .workflow-header {
    height: auto !important;
    min-height: 42px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: rgba(2, 6, 23, 0.5) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.28) !important;
}

#comfyPage #workflow-page .workflow-header h2 {
    visibility: visible !important;
    color: #e5e7eb !important;
    font-size: 13px !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
}

#comfyPage #workflow-page .workflow-list-wrapper {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    overflow-y: auto !important;
    background: transparent !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(99, 102, 241, 0.45) transparent !important;
    height: auto !important;
}

#comfyPage #workflow-page .workflow-list-wrapper::-webkit-scrollbar {
    width: 8px !important;
}

#comfyPage #workflow-page .workflow-list-wrapper::-webkit-scrollbar-track {
    background: transparent !important;
}

#comfyPage #workflow-page .workflow-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45) !important;
    border-radius: 999px !important;
}

#comfyPage #workflow-page .workflow-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

#comfyPage .workflow-category-header {
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(71, 85, 105, 0.42) !important;
    box-shadow: none !important;
}

#comfyPage .workflow-category-header:hover,
#comfyPage .workflow-category-header.expanded {
    background: rgba(37, 99, 235, 0.16) !important;
    border-color: rgba(59, 130, 246, 0.42) !important;
    box-shadow: none !important;
}

#comfyPage .workflow-category-header .category-title,
#comfyPage .workflow-category-header:hover .category-title,
#comfyPage .workflow-category-header.expanded .category-title {
    color: #e5e7eb !important;
    text-shadow: none !important;
}

#comfyPage .workflow-category-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 0 2px 0 !important;
}

#comfyPage .workflow-category-container.collapsed {
    display: none !important;
}

#comfyPage .workflow-category-container .workflow-item {
    width: calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 38px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(71, 85, 105, 0.42) !important;
    background: rgba(17, 24, 39, 0.96) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

#comfyPage .workflow-item:hover {
    background: rgba(30, 41, 59, 0.98) !important;
    border-color: rgba(99, 102, 241, 0.42) !important;
    transform: none !important;
    box-shadow: none !important;
}

#comfyPage .workflow-item .workflow-name,
#comfyPage .workflow-item:hover .workflow-name {
    color: #e5e7eb !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
    background: none !important;
}

#comfyPage #workflow-page .settings-bar-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    margin-top: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

#comfyPage #workflow-page .settings-bar {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#comfyPage #workflow-page .settings-button {
    height: 38px !important;
    width: 100% !important;
    border-radius: 10px !important;
}

#comfyPage #workflow-page #info-container {
    display: none !important;
}

#comfyPage #editor-page.page.active {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100% !important;
    padding: 0 !important;
    background: rgba(8, 12, 20, 1) !important;
}

#comfyPage #editor-page .workflow-title-container,
#comfyPage #editor-page .workflow-title-icon {
    display: none !important;
}

#comfyPage #editor-page .editor-content {
    margin: 0 !important;
    padding: 12px 12px 108px !important;
    min-height: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#comfyPage #editor-page .workflow-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

#comfyPage #editor-page .fixed-bottom {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: 10px !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 64px) !important;
    max-width: calc(100% - 64px) !important;
    padding: 12px !important;
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(71, 85, 105, 0.42) !important;
    border-radius: 12px !important;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#comfyPage #editor-page .progress-area {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 12, 20, 0.98)) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
    box-sizing: border-box !important;
}

#comfyPage #editor-page .progress-title {
    display: none !important;
}

#comfyPage #editor-page .header-buttons {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
}

#comfyPage #editor-page .header-buttons button,
#comfyPage #editor-page .header-button {
    flex: 1 1 0 !important;
    width: auto !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(71, 85, 105, 0.56) !important;
    background-color: rgba(24, 33, 48, 0.96) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 18px 18px !important;
    color: #e5e7eb !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

#comfyPage #editor-page .header-buttons button:hover,
#comfyPage #editor-page .header-button:hover {
    background-color: rgba(37, 99, 235, 0.22) !important;
    border-color: rgba(96, 165, 250, 0.6) !important;
}

#comfyPage #editor-page #back-btn {
    background-image: url('../assets/fanhui.png') !important;
}

#comfyPage #editor-page #generate-btn {
    background-image: url('../assets/yunxing.png') !important;
}

#comfyPage #editor-page #interrupt-btn {
    background-image: url('../assets/zhongzhi.png') !important;
}

#comfyPage #editor-page .task-input-container {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#comfyPage #editor-page .task-input-container .number-display,
#comfyPage #editor-page .task-input-container .number-edit-input {
    width: 100% !important;
    height: 100% !important;
    border-radius: 10px !important;
    margin: 0 !important;
    border: 1px solid rgba(71, 85, 105, 0.56) !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96)) !important;
    color: #e5e7eb !important;
    box-sizing: border-box !important;
}

#comfyPage #editor-page .progress-text {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    color: #cbd5e1 !important;
    text-shadow: none !important;
    pointer-events: none !important;
}

#comfyPage #editor-page .node-progress-text {
    top: -18px !important;
    font-size: 11px !important;
    color: #93c5fd !important;
    text-shadow: none !important;
}


.wk-comfyui-combo-list::-webkit-scrollbar,
.wk-comfyui-combo-dropdown::-webkit-scrollbar {
    width: 8px !important;
}

.wk-comfyui-combo-list::-webkit-scrollbar-thumb,
.wk-comfyui-combo-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45) !important;
    border-radius: 999px !important;
}

#comfyPage #editor-page .progress-container {
    width: 100% !important;
    margin: 0 !important;
    height: 20px !important;
    border-radius: 10px !important;
    background: rgba(2, 6, 23, 0.96) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    overflow: hidden !important;
}
