.flow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 10px; }
.search-field { flex: 1; max-width: 390px; display: flex; align-items: center; gap: 5px; padding-left: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.search-field input { min-height: 38px; padding-left: 5px; border: 0; background: transparent; box-shadow: none; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.flow-toolbar #zoom-label { min-width: 50px; color: var(--muted); text-align: center; font-size: 12px; }
#flow-view { width: 100%; }
.flow-layout { display: block; }
.flow-canvas { position: relative; height: calc(100vh - 210px); min-height: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background-color: var(--surface-soft); background-image: radial-gradient(color-mix(in srgb, var(--subtle) 40%, transparent) 1px, transparent 1px); background-size: 24px 24px; box-shadow: inset 0 1px 2px rgb(20 32 54 / 3%); cursor: grab; }
:root[data-grid="hidden"] .flow-canvas { background-image: none; }
.flow-canvas.panning { cursor: grabbing; }
.flow-world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.flow-world svg { position: absolute; overflow: visible; pointer-events: none; }
.graph-edge { fill: none; stroke: var(--subtle); stroke-width: 2; }
.graph-edge.button { stroke: var(--brand); }
.graph-edge.action { stroke: color-mix(in srgb, var(--brand) 60%, var(--subtle)); }
.graph-edge-label { fill: var(--muted); font: 11px system-ui; }
.graph-node { position: absolute; width: 250px; overflow: visible; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: default; }
.graph-node.selected { border-color: color-mix(in srgb, var(--brand) 65%, var(--line)); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent); }
.graph-node.search-hit { border-color: #e1a127; box-shadow: 0 0 0 3px rgb(225 161 39 / 14%); }
.graph-node-head { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; background: var(--surface-soft); font-weight: 500; cursor: grab; }
.graph-node-head:active { cursor: grabbing; }
.graph-node.start .graph-node-head::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.graph-node-body { min-height: 62px; padding: 10px 13px; color: var(--muted); font-size: 12px; }
.graph-node-body strong { display: block; margin-bottom: 4px; color: var(--text); }
.graph-node-links { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.graph-node-links span { max-width: 100%; overflow: hidden; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 999px; color: var(--brand); text-overflow: ellipsis; white-space: nowrap; }
.node-port { position: absolute; width: 13px; height: 13px; border: 2px solid var(--surface); border-radius: 50%; background: var(--subtle); box-shadow: 0 0 0 1px var(--line-strong); }
.node-port.in { left: -7px; top: 36px; }
.node-port.out { right: -7px; bottom: 18px; background: var(--brand); cursor: crosshair; }
.canvas-help { position: absolute; left: 12px; bottom: 10px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: 11px; pointer-events: none; backdrop-filter: blur(8px); }
.node-editor-dialog { width: min(920px, calc(100vw - 32px)); max-width: none; height: min(900px, calc(100vh - 32px)); max-height: none; overflow: hidden; }
.node-editor-modal { height: 100%; display: flex; flex-direction: column; }
.node-editor-header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px 17px; border-bottom: 1px solid var(--line); }
.node-editor-header > div { min-width: 0; }
.node-editor-header span { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.node-editor-header h2 { overflow: hidden; margin: 2px 0 0; font-size: 22px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.node-editor-header small { display: block; margin-top: 3px; color: var(--muted); }
.node-editor-header .square { align-self: flex-start; width: 38px; min-width: 38px; padding: 0; font-size: 25px; font-weight: 400; }
.node-inspector { flex: 1; min-height: 0; overflow: auto; padding: 22px 24px 0; }
.empty-state { min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state > span { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 3px 0 0; font-size: 12px; }
.node-start-toggle { margin: 14px 0 22px; }
.node-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 12px; }
.node-section-heading h3 { margin: 0 0 3px; font-size: 17px; font-weight: 500; }
.node-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.node-add-actions, .node-buttons-heading > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }
.node-cards-empty { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }
.node-cards-empty strong { color: var(--text); font-weight: 500; }
.node-step { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.node-step-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -2px 0 15px; }
.node-step-head > div:first-child { display: grid; gap: 2px; }
.node-step-head span { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.node-step-head strong { font-size: 15px; font-weight: 500; }
.node-step-controls { display: flex; gap: 5px; }
.node-step-controls .icon, .node-button .icon { width: 34px; min-height: 34px; padding: 0; }
.node-kind-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.node-step > textarea { min-height: 125px; margin: 0; background: var(--surface); resize: vertical; }
.node-step > .field { margin-bottom: 10px; }
.node-question-settings { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--surface); }
.node-question-settings .full { grid-column: 1 / -1; }
.node-buttons-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.node-buttons-heading > div:first-child { display: grid; gap: 2px; }
.node-buttons-heading strong { font-size: 13px; font-weight: 500; }
.node-buttons-heading span { color: var(--muted); font-size: 11px; }
.node-button { display: grid; grid-template-columns: minmax(150px, 1fr) 175px minmax(190px, 1.2fr) auto; gap: 7px; align-items: center; margin-top: 8px; }
.node-meta { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); gap: 12px; }
.inspector-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 24px -24px 0; padding: 16px 24px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(12px); }

@media (max-width: 980px) {
  .flow-canvas { min-height: 500px; }
}

@media (max-width: 700px) {
  .flow-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .toolbar-actions { overflow-x: auto; }
  .toolbar-actions button { flex: none; }
  .node-editor-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .node-editor-header { padding: 16px; }
  .node-inspector { padding: 18px 16px 0; }
  .node-meta { grid-template-columns: 1fr; }
  .node-section-heading, .node-buttons-heading { align-items: flex-start; flex-direction: column; }
  .node-kind-row, .node-question-settings { grid-template-columns: 1fr; }
  .node-question-settings .full { grid-column: auto; }
  .node-button { grid-template-columns: 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
  .node-button .icon { justify-self: end; }
  .inspector-actions { margin-left: -16px; margin-right: -16px; padding: 12px 16px; }
  .inspector-actions button { flex: 1 1 auto; }
}

.forms-list { display: grid; gap: 10px; }
.form-list-item { width: 100%; min-height: 92px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 90px auto 20px; gap: 16px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.form-list-item:hover { border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); background: color-mix(in srgb, var(--surface) 96%, var(--brand)); transform: translateY(-1px); }
.form-list-item.active { border-color: color-mix(in srgb, var(--brand) 52%, var(--line)); background: var(--brand-soft); }
.form-list-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.form-list-icon .ui-icon { width: 22px; height: 22px; }
.form-list-copy { min-width: 0; display: grid; gap: 5px; }
.form-list-copy strong { overflow: hidden; font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.form-list-copy small,.form-list-stat small { color: var(--muted); font-size: 12px; }
.form-list-stat { display: grid; gap: 3px; text-align: right; }
.form-list-stat strong { font-size: 20px; font-weight: 500; line-height: 1; }
.form-list-arrow { color: var(--muted); font-size: 26px; line-height: 1; }
.forms-empty { min-height: 420px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.forms-empty .ui-icon { width: 38px; height: 38px; margin-bottom: 14px; color: var(--brand); }
.forms-empty h2 { margin: 0; color: var(--text); font-weight: 500; }
.forms-empty p { margin: 7px 0 0; }
.form-questions .forms-empty { min-height: 180px; }
.form-builder { min-width: 0; max-width: 1120px; margin: 0 auto; }
.form-back { margin-bottom: 18px; }
.form-builder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.form-builder-header > div:first-child { min-width: 0; flex: 1; display: grid; gap: 8px; }
.form-builder-header .campaign-title-input { width: 100%; }
.form-header-actions,.form-action-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.form-builder-tabs { display: flex; gap: 2px; margin-bottom: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); width: max-content; }
.form-builder-tabs button { min-height: 34px; padding: 6px 13px; background: transparent; color: var(--muted); }
.form-builder-tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); }
.form-builder-tabs span { margin-left: 5px; color: var(--brand); }
.form-settings { display: grid; gap: 18px; padding: 24px; }
.form-settings .field { max-width: none; }
.form-settings textarea { resize: vertical; }
.form-setting-row { display: grid; grid-template-columns: minmax(160px, .6fr) minmax(240px, 1fr); gap: 12px; }
.form-questions { display: grid; gap: 12px; margin: 14px 0; }
.form-question-card { padding: 24px; }
.form-question-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.form-question-head > div { display: flex; align-items: center; gap: 8px; }
.form-question-head > div > span:last-child { display: grid; gap: 3px; }
.form-question-head > div > span:last-child strong { font-size: 17px; font-weight: 500; }
.form-question-type-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-right: 3px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.form-question-type-icon .ui-icon { width: 21px; height: 21px; }
.form-question-index { color: var(--brand); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.form-question-actions { display: flex; gap: 4px; }
.form-question-actions button { width: 32px; min-height: 32px; padding: 0; }
.form-question-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .42fr); gap: 14px; padding-left: 55px; }
.form-question-fields .field { max-width: none; }
.form-question-fields .question-label-field { grid-column: 1 / -1; }
.form-question-fields .question-label-field input { min-height: 48px; font-size: 16px; }
.question-description-field { grid-column: 1 / -1; }
.form-question-options { grid-column: 1 / -1; display: grid; gap: 7px; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.form-option-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 7px; }
.form-option-row button { min-height: 36px; padding: 0; color: var(--red); }
.form-add-option { justify-self: start; }
.form-required { align-self: end; min-height: 40px; }
.chat-support-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.chat-support-note .ui-icon { width: 16px; height: 16px; flex: none; color: var(--brand); }
.form-add-question { display: grid; gap: 18px; padding: 24px; }
.form-add-heading { display: grid; gap: 4px; }
.form-add-heading strong { font-size: 16px; font-weight: 500; }
.form-add-heading span { color: var(--muted); font-size: 12px; }
.form-question-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.question-type-tile { min-height: 82px; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 11px; align-content: center; padding: 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); text-align: left; }
.question-type-tile:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); background: var(--brand-soft); }
.question-type-tile .ui-icon { grid-row: 1 / 3; align-self: center; width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 10px; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.question-type-tile span { align-self: end; font-weight: 500; }
.question-type-tile small { align-self: start; color: var(--muted); }
.form-integrations { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; margin-top: 12px; }
.form-integrations > div:first-child { display: flex; align-items: center; gap: 11px; }
.form-integrations > div:first-child > div { display: grid; gap: 2px; }
.form-integrations small { color: var(--muted); }
.form-integrations .switch-row { padding: 0; border: 0; }
.form-integrations .field { grid-column: 1 / -1; max-width: 400px; }
.form-action-bar { justify-content: flex-end; margin-top: 14px; padding: 14px 0; }
.form-responses { overflow-x: auto; }
.form-response-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.form-response-table th,.form-response-table td { max-width: 260px; padding: 11px 12px; border-bottom: 1px solid var(--line); overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.form-response-table th { background: var(--surface-soft); color: var(--muted); font-weight: 500; }
.form-response-empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.form-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.form-stat-grid .panel { display: grid; gap: 8px; padding: 18px; }
.form-stat-grid span { color: var(--muted); font-size: 12px; }
.form-stat-grid strong { font-size: 28px; font-weight: 500; }
.form-stat-breakdown { display: grid; gap: 10px; margin-top: 14px; }
.form-stat-question { display: grid; gap: 12px; padding: 20px; }
.form-stat-question h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.form-stat-row { display: grid; grid-template-columns: minmax(100px, .35fr) minmax(120px, 1fr) 36px; gap: 12px; align-items: center; font-size: 12px; }
.form-stat-row > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.form-stat-row i { height: 100%; display: block; border-radius: inherit; background: var(--brand); }
.form-stat-row strong { text-align: right; font-weight: 500; }
.legacy-question-note { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--amber) 8%, var(--surface)); color: var(--muted); font-size: 12px; }

@media (max-width: 950px) {
  .form-question-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .form-builder-header { flex-direction: column; }
  .form-header-actions { width: 100%; }
  .form-setting-row,.form-question-fields,.form-integrations { grid-template-columns: 1fr; }
  .form-question-fields .question-label-field,.form-question-options,.form-integrations .field { grid-column: 1; }
  .form-question-fields { padding-left: 0; }
  .question-description-field,.chat-support-note { grid-column: 1; }
  .form-question-types { grid-template-columns: 1fr; }
  .form-list-item { grid-template-columns: 42px minmax(0, 1fr) 18px; gap: 12px; padding: 15px; }
  .form-list-icon { width: 42px; height: 42px; }
  .form-list-stat,.form-list-item .campaign-status { display: none; }
  .form-stat-row { grid-template-columns: 90px minmax(90px, 1fr) 28px; gap: 8px; }
}
