/* Quiz flow uses the dashboard's email-builder canvas and settings panel. */
.flow-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: stretch; gap: 14px; min-width: 0; min-height: 700px; }
.flow-canvas-host { min-width: 0; min-height: 700px; }
.flow-inspector { min-width: 0; height: 700px; overflow-y: auto; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.flow-inspector .focused-editor { padding: 0; border: 0; border-radius: 0; }
.flow-inspector > div > label, .flow-inspector .flow-routes > label, .flow-route-rule > label { margin-top: 16px; }
.flow-inspector .product-choice-list { margin-top: 20px; }
.flow-inspector .question-body h4 { margin-top: 0; }
.flow-empty { display: grid; justify-items: center; align-content: center; min-height: 320px; padding: 28px; text-align: center; }
.flow-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; background: #edf2ff; color: var(--primary); font-size: 22px; }
.flow-empty h3 { font-size: 14px; }
.flow-empty p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.flow-inspector-note { margin: 14px 0; }
.flow-inspector-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.flow-inspector-section-heading h4 { margin: 0; }
.flow-answer-entry { background: #f6f7f3; }
.flow-inspector .answer-entry label, .flow-inspector .option-images label { margin-top: 14px; }
.flow-question-toggles { grid-template-columns: 1fr; }
.flow-routes { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.flow-routes > summary, .flow-question-appearance > summary { color: var(--foreground); font-weight: 700; cursor: pointer; }
.flow-routes > .hint { margin-top: 10px; }
.flow-routes > .add-question { margin-top: 12px; }
.flow-route-rule { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f6f7f3; }
.flow-route-head { display: flex; align-items: center; gap: 4px; }
.flow-route-head strong { flex: 1; }
.flow-icon-button { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--input); border-radius: 6px; background: var(--card); color: var(--foreground); }
.flow-icon-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.flow-icon-button:disabled { opacity: .4; }
.flow-route-rule .condition-choices { margin: 12px 0 0; }
.flow-route-rule .remove-question { margin-top: 8px; }
.flow-order { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.flow-inspector-footer { margin-top: 20px; }
.flow-remove-result { margin: 18px 0 0 8px; }
@media (max-width: 1000px) {
  .flow-workspace { grid-template-columns: minmax(0, 1fr) minmax(270px, 320px); }
}
@media (max-width: 760px) {
  .flow-workspace { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .flow-canvas-host { min-height: 470px; height: 55vh; max-height: 580px; }
  .flow-inspector { height: auto; min-height: 160px; max-height: 70vh; }
  .flow-empty { min-height: 160px; }
}

/* Let the canvas occupy the editor's full working area, as in sequences. */
@media (min-width: 761px) {
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) main { padding: 16px 20px 28px; }
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) .heading { margin-bottom: 12px; }
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) .editor-top { padding: 12px 18px 8px; }
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) .editor-tabs { padding: 0 18px 10px; }
  #section-content.editor-section { padding: 0; }
  .flow-section-heading { margin: 0; padding: 11px 18px; border-bottom: 1px solid #eff0ec; }
  .flow-workspace { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 0; height: max(620px, calc(100dvh - 270px)); min-height: 620px; }
  .flow-canvas-host { height: 100%; min-height: 0; }
  .flow-canvas-host .quiz-flow-canvas { min-height: 0; border: 0; border-radius: 0 0 0 12px; }
  .flow-inspector { height: 100%; padding: 20px; border-width: 0 0 0 1px; border-radius: 0 0 12px 0; background: #fbfbf9; }
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) .editor-footer { padding: 8px 18px; }
}
.quiz-flow-canvas, .quiz-flow-stage .react-flow { background: #f1f2ee; }
.quiz-flow-toolbar { background: #f8f9f6; border-color: #ebede8; }
.quiz-flow-node { border-color: #ebede8; box-shadow: 0 1px 2px rgb(20 30 20 / 3%); }
.quiz-flow-node:hover { box-shadow: 0 0 0 2px rgb(47 111 235 / 16%); }
.flow-product-detail { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f7f8f5; }
.flow-product-detail > summary, .flow-product-exclude > summary { cursor: pointer; font-weight: 700; }
.flow-product-detail > label, .flow-product-exclude > label { margin-top: 14px; }
.flow-product-exclude { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.flow-product-exclude h4 { margin: 14px 0 0; }
@media (max-width: 760px) {
  body:has(#local-controls:not([hidden]) > #section-content:not([hidden])) main { padding-left: 8px; padding-right: 8px; }
  #section-content.editor-section { padding: 0; }
  .flow-section-heading { margin: 0; padding: 16px; }
  .flow-workspace { gap: 0; }
  .flow-canvas-host .quiz-flow-canvas { border-left: 0; border-right: 0; border-radius: 0; }
  .flow-inspector { height: auto; max-height: none; overflow: visible; border-width: 0; border-radius: 0; }
}
/* The settings card floats inside the same canvas, like the email builder. */
@media (min-width: 761px) {
  .flow-workspace { position: relative; display: block; }
  .flow-canvas-host { width: 100%; }
  .flow-canvas-host .quiz-flow-canvas { border-radius: 0 0 12px 12px; }
  .flow-inspector { position: absolute; z-index: 5; top: 80px; right: 16px; bottom: 16px; width: min(340px, 33%); height: auto; border: 1px solid #e6e9e3; border-radius: 12px; background: rgba(251, 252, 249, .96); box-shadow: 0 8px 28px rgba(50, 60, 48, .06); backdrop-filter: blur(12px); }
}
.flow-saved-options { margin-top: 12px; }
.flow-saved-options > summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.flow-saved-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.flow-saved-option span { overflow-wrap: anywhere; }
