.visual-editor { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-2) 74%, var(--surface)); padding: 16px; }
.visual-editor[hidden] { display: none; }
.generator-form.visual-mode > .generator-engine,
.generator-form.visual-mode > .generator-prompt,
.generator-form.visual-mode > .generator-reference,
.generator-form.visual-mode > .generator-controls,
.generator-form.visual-mode > .generator-seed,
.generator-form.visual-mode > .generator-submit,
.generator-form.visual-mode > .generator-status,
.generator-form.visual-mode > .generator-queue-panel { display: none; }
.visual-editor-head, .visual-source-row, .visual-actions, .visual-brush-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.visual-editor-head h3 { margin: 2px 0 0; font-size: 18px; }
.visual-service-state { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--muted); font-size: 12px; }
.visual-service-state[data-state="online"] { border-color: color-mix(in srgb, var(--hot) 70%, var(--line)); color: var(--hot); }
.visual-service-state[data-state="offline"] { color: #d56b65; }
.visual-tool-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; overflow-x: auto; }
.visual-tool-tabs button, .visual-source-row button, .visual-panel button, .visual-brush-row button { min-height: 38px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); cursor: pointer; }
.visual-tool-tabs button { padding: 7px 8px; white-space: nowrap; }
.visual-tool-tabs button[aria-selected="true"] { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 11%, var(--surface)); color: var(--text); }
.visual-upload { display: grid; place-items: center; gap: 3px; min-height: 92px; border: 1px dashed var(--line); border-radius: 4px; color: var(--muted); cursor: pointer; text-align: center; }
.visual-upload:hover { border-color: var(--hot); }
.visual-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.visual-upload > span { color: var(--hot); font-size: 24px; line-height: 1; }
.visual-upload strong { color: var(--text); font-size: 13px; }
.visual-upload small, .visual-source-row span, .visual-help { color: var(--muted); font-size: 12px; }
.visual-source-row { flex-wrap: wrap; justify-content: flex-start; }
.visual-source-row button, .visual-panel button, .visual-brush-row button { padding: 6px 9px; font-size: 12px; }
.visual-source-row span { overflow: hidden; flex: 1 1 150px; text-overflow: ellipsis; white-space: nowrap; }
.visual-canvas-stage { position: relative; display: grid; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: repeating-conic-gradient(#151816 0 25%, #111310 0 50%) 50% / 20px 20px; }
.visual-canvas-stage canvas { display: block; grid-area: 1 / 1; width: 100%; max-height: 420px; margin: auto; touch-action: none; }
#visual-mask-canvas { cursor: crosshair; }
.visual-panel { display: grid; gap: 10px; }
.visual-panel > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.visual-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.visual-field em { font-style: normal; color: color-mix(in srgb, var(--hot) 78%, var(--text)); }
.visual-field textarea, .visual-field input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 4px; outline: 0; background: var(--surface); color: var(--text); padding: 9px 10px; font: inherit; line-height: 1.55; }
.visual-field textarea:focus, .visual-field input:focus { border-color: var(--hot); }
.visual-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.visual-anchor { display: grid; grid-template-columns: auto 108px; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
#visual-anchor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
#visual-anchor-grid button { aspect-ratio: 1; min-height: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); cursor: pointer; }
#visual-anchor-grid button[aria-pressed="true"] { border-color: var(--hot); background: var(--hot); box-shadow: inset 0 0 0 2px var(--surface); }
.visual-range { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.visual-range > span { display: flex; justify-content: space-between; gap: 12px; }
.visual-range output { color: var(--text); }
.visual-range input { width: 100%; accent-color: var(--hot); }
.visual-brush-row { justify-content: stretch; align-items: end; }
.visual-brush-row .visual-range { flex: 1; }
.visual-actions { align-items: center; }
#visual-run { min-height: 42px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--bg); cursor: pointer; font-weight: 700; padding: 0 15px; }
#visual-run:disabled { cursor: wait; opacity: .65; }
#visual-status { flex: 1; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 620px) { .visual-editor { padding: 13px; } .visual-editor-head { align-items: flex-start; flex-direction: column; } .visual-tool-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; } .visual-tool-tabs button { white-space: normal; } .visual-actions { align-items: stretch; flex-direction: column; } .visual-brush-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .visual-brush-row .visual-range { grid-column: 1 / -1; } }
