.comfy-card { box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 16px; color: var(--text-primary, #eee); background: var(--panel-bg, #232326); border-radius: 14px; pointer-events: auto; font-family: inherit; font-size: 13px; line-height: 1.4; }
.comfy-card header,.comfy-card footer,.comfy-attach,.comfy-strength,.comfy-editor-dialog header { display: flex; align-items: center; gap: 8px; }
.comfy-card header,.comfy-card footer { justify-content: space-between; }
.comfy-card header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.comfy-card-actions { flex: none; display: flex; gap: 6px; }
.comfy-card-actions button { white-space: nowrap; }
.comfy-controls,.comfy-setup { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 10px; }
.comfy-setup { justify-content: center; align-items: flex-start; }
.comfy-setup p { margin: 0; color: var(--text-secondary, #bbb); }
.comfy-card label { display: grid; gap: 4px; color: var(--text-secondary, #bbb); font-size: 12px; }
.comfy-card select,.comfy-card textarea { width: 100%; box-sizing: border-box; color: inherit; background: var(--fill-subtle, #18181b); border: 1px solid var(--border-color, #47474e); border-radius: 6px; padding: 5px 7px; font: inherit; }
.comfy-card textarea { resize: none; }
.comfy-workflow-node > .comfy-card:has(> .comfy-controls) {
  /* The canvas normally stretches mounted node components with an inline flex value. */
  flex: none !important;
  align-self: flex-start;
  width: 100%;
  height: auto;
}
.comfy-card .comfy-strength { display: flex; }
.comfy-card label:has(> :disabled) { display: none; }
.comfy-strength input { min-width: 0; flex: 1; }
.comfy-strength output { font-variant-numeric: tabular-nums; }
.comfy-card button,.comfy-editor-dialog button,.comfy-workflow-picker button { color: inherit; background: #38383e; border: 1px solid #595961; padding: 5px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.comfy-card [data-run],.comfy-card [data-setup],.comfy-editor-dialog [data-save] { background: #dbddfd; color: #222139; border-color: transparent; font-weight: 600; }
.comfy-card button:disabled,.comfy-editor-dialog button:disabled,.comfy-workflow-picker button:disabled { opacity: .48; cursor: default; }
.comfy-attach span,.comfy-card [data-status] { font-size: 11px; color: var(--text-secondary, #bbb); overflow: hidden; text-overflow: ellipsis; }
.comfy-card [data-status][data-error="true"] { color: var(--danger, #f18e8e); overflow-wrap: anywhere; }
.comfy-attach span { white-space: nowrap; }
.comfy-attach button { flex: none; }
.comfy-card footer { margin-top: auto; }
.comfy-card footer button { white-space: nowrap; }
.comfy-model-result { width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: var(--panel-bg, #232326); color: var(--text-primary, #eee); }
.comfy-model-view { position: relative; display: grid; place-items: center; flex: 1; min-height: 0; touch-action: none; cursor: grab; background: radial-gradient(circle, var(--fill-subtle, #35363e), var(--panel-bg, #232326)); }
.comfy-model-view:active { cursor: grabbing; }
.comfy-model-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.comfy-model-view [role=status] { padding: 0 12px; font-size: 12px; text-align: center; }
.comfy-model-result footer { display: flex; justify-content: flex-end; padding: 7px 10px; }
.comfy-model-result a { color: inherit; font-size: 12px; text-underline-offset: 3px; }
.comfy-editor-dialog { width: min(1500px, 95vw); height: 90vh; max-width: 98vw; max-height: 96vh; box-sizing: border-box; margin: auto; padding: 0; overflow: hidden; border: 1px solid #55565f; border-radius: 12px; color: #eee; background: #202024; }
.comfy-editor-dialog[open] { display: flex; flex-direction: column; }
.comfy-editor-dialog::backdrop { background: #08090cb3; }
.comfy-editor-dialog header { padding: 9px 14px; min-height: 40px; }
.comfy-editor-dialog header span { flex: 1; font-size: 12px; }
.comfy-editor-dialog select { max-width: 35%; color: inherit; background: #38383e; border: 1px solid #595961; border-radius: 6px; padding: 5px; font: inherit; }
.comfy-editor-dialog iframe { flex: 1; min-height: 0; border: 0; width: 100%; }
.comfy-workflow-picker { width: min(510px, calc(100vw - 32px)); box-sizing: border-box; margin: auto; padding: 20px; border: 1px solid var(--border-color, #55565f); border-radius: 12px; background: var(--panel-bg, #232326); color: var(--text-primary, #eee); font: inherit; }
.comfy-workflow-picker::backdrop { background: #08090cb3; }
.comfy-workflow-picker form { display: grid; gap: 12px; }
.comfy-workflow-picker header,.comfy-workflow-picker footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.comfy-workflow-picker h2 { font-size: 16px; margin: 0; }
.comfy-workflow-picker input,.comfy-workflow-picker select { width: 100%; box-sizing: border-box; border: 1px solid var(--border-color, #595961); border-radius: 6px; padding: 7px 9px; background: var(--fill-subtle, #18181b); color: inherit; font: inherit; }
.comfy-workflow-picker option { padding: 5px 4px; }
.comfy-workflow-picker button[type=submit] { flex: none; background: #dbddfd; border-color: transparent; color: #222139; font-weight: 600; }
.comfy-workflow-picker [role=status] { font-size: 12px; color: var(--text-secondary, #bbb); }
.comfy-workflow-picker [data-error=true] { color: var(--danger, #f18e8e); }
/* Keep the shared tooltip above the canvas picker while the workflow menu is open. */
body:has(#comfy-workflow-menu) > .global-tooltip { z-index: 100001; }
.comfy-menu-columns {
  position: fixed;
  z-index: 100002;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.comfy-menu-columns[data-side="left"] { flex-direction: row-reverse; }
.comfy-menu-panel {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  width: var(--comfy-menu-width);
  max-height: min(450px, calc(100vh - 24px));
  min-height: 0;
  padding: 7px;
  border: 1px solid var(--stroke-default, #45454f);
  border-radius: var(--radius-12, 12px);
  background: var(--surface-node, #202024);
  color: var(--text-primary, #eee);
  box-shadow: var(--shadow-menu, 0 12px 28px #0006);
  backdrop-filter: blur(32px);
  font-size: 13px;
}
.comfy-menu-panel[hidden] { display: none; }
.comfy-menu-panel header { display: flex; flex: none; align-items: center; gap: 6px; min-width: 0; padding: 2px 2px 6px; }
.comfy-menu-panel header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comfy-menu-panel input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--stroke-default, #45454f);
  border-radius: 7px;
  background: var(--fill-subtle, #18181b);
  color: inherit;
  padding: 6px 8px;
  font: inherit;
}
.comfy-menu-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.comfy-menu-panel .comfy-menu-entry { font: inherit; min-height: 36px; gap: 8px; }
.comfy-menu-entry span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comfy-menu-entry small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted, #a3a3af); }
.comfy-menu-entry::before { content: ""; flex: none; width: 10px; height: 12px; border: 1px solid currentColor; border-radius: 2px; opacity: .65; }
.comfy-menu-entry[data-folder]::before { width: 12px; height: 9px; box-shadow: 0 -2px 0 -1px currentColor; }
.comfy-menu-trigger::after,.comfy-menu-entry[data-folder]::after,.comfy-menu-back::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
  margin-right: 3px;
}
.comfy-menu-trigger[aria-expanded="true"],.comfy-menu-entry[aria-expanded="true"] { background: var(--fill-hover-strong, #ffffff14); }
.comfy-menu-back,.comfy-menu-action {
  border: 0;
  border-radius: 6px;
  background: var(--fill-hover, #ffffff0c);
  color: var(--text-primary, #eee);
  cursor: pointer;
  font: inherit;
}
.comfy-menu-back { display: grid; place-items: center; flex: none; width: 28px; height: 28px; }
.comfy-menu-back::before { transform: rotate(-135deg); margin-right: 0; }
.comfy-menu-back:hover,.comfy-menu-action:hover { background: var(--fill-hover-strong, #ffffff14); }
.comfy-menu-panel :is(button,input):focus-visible { outline: 1px solid var(--indigo, #8988ec); outline-offset: -1px; }
.comfy-menu-feedback { padding: 7px 8px 4px; color: var(--text-secondary, #bbb); line-height: 1.4; overflow-wrap: anywhere; }
.comfy-menu-feedback:empty { display: none; }
.comfy-menu-feedback[data-error="true"] { color: var(--danger, #f18e8e); }
.comfy-menu-action { display: block; margin-top: 6px; padding: 5px 8px; }
.comfy-menu-columns[aria-busy="true"] .comfy-menu-entry { cursor: progress; opacity: .62; }
.comfy-compiler-frame { position: fixed; inset: 0 auto auto 0; width: 960px; height: 640px; opacity: 0; pointer-events: none; border: 0; }
.xgc-nav-icon { width: 15px; font: 17px/1 system-ui; text-align: center; }
.xgc-settings { color: var(--text-strong); }
.xgc-settings [hidden] { display: none !important; }
.xgc-section { max-width: 660px; margin: 0 0 24px; }
.xgc-section + .xgc-section { border-top: 1px solid var(--white-08, #383842); padding-top: 22px; }
.xgc-section p { margin: 5px 0 13px; }
.xgc-section a { color: var(--text-strong); text-underline-offset: 3px; }
.xgc-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.xgc-controls input,.xgc-controls select { flex: 1 1 220px; min-width: 0; }
.xgc-settings input,.xgc-settings select,.xgc-button { min-height: 36px; box-sizing: border-box; border: 1px solid var(--white-12, #555560); border-radius: 7px; padding: 7px 10px; color: var(--text-strong); background: var(--node-bg, #202028); font: inherit; }
.xgc-settings input:focus,.xgc-settings select:focus-visible { outline: 2px solid var(--indigo, #8988ec); outline-offset: 1px; }
.xgc-settings .settings-save-btn { flex: none; margin: 0; }
.xgc-settings button:disabled { opacity: .55; }
.xgc-port-label { display: block; margin: 16px 0 6px; }
#xgcPort { width: 110px; }
.xgc-binding,.xgc-feedback { font-size: 13px; }
.xgc-link { padding: 0; border: 0; background: transparent; font: inherit; text-decoration: underline; color: inherit; }
.xgc-reason { max-width: 660px; margin: 0 0 22px; padding: 10px 12px; border-radius: 7px; background: var(--indigo-18, #303046); }
.xgc-feedback[data-error="true"] { color: var(--danger, #f18e8e); }
