/* Fase 3: editor del formulario con el aspecto del constructor de faithgroups.app/demo. */
body.view-reports[data-p3=form] #editor{
  margin:0;padding:0 0 calc(168px + env(safe-area-inset-bottom,0px));overflow:visible;
  background:none;border:0;border-radius:0;box-shadow:none
}
@media (max-width:1023px){
  body.view-reports[data-p3=form] .layout>.main{padding-bottom:16px}
}
body.view-reports[data-p3=form] #editor-details{border:0}
body.view-reports[data-p3=form] #editor-details > summary{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0
}
body.view-reports[data-p3=form] #form-editor{margin:0;padding:0;border:0}
body.view-reports[data-p3=form] #form-editor > label{
  display:block;margin:4px 0 0;font-size:13px;font-weight:600;color:var(--navy)
}
body.view-reports[data-p3=form] #form-editor > label select{
  min-height:48px;margin-top:4px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--navy)
}

.p3-fe-top{
  position:sticky;top:0;z-index:8;margin:0 -20px;padding:8px 20px 10px;
  display:flex;align-items:center;gap:8px;
  background:#fafcfd
}
.p3-fe-top .tt{flex:1;min-width:0;display:flex;flex-direction:column}
.p3-fe-top .tt strong{font-size:15.5px;font-weight:700;color:var(--navy)}
.p3-fe-top .tt small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.p3-fe-icon{
  width:48px;height:48px;border-radius:50%;border:0;background:none;color:var(--navy);
  display:grid;place-items:center;cursor:pointer;flex:none
}
.p3-fe-icon:active{transform:scale(.9);background:var(--soft)}
.p3-fe-icon .i,.p3-fe-warn .i,.p3-fe-note .i,.p3-fe-ti .i,.fg2-icon .i{
  width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round
}
.p3-fe-ti .i{width:18px;height:18px}

 .p3-fe-note{
  display:flex;gap:8px;align-items:flex-start;font-size:12px;margin:8px 0 0;color:var(--teal-d);
  background:var(--teal-50);padding:8px 12px;border-radius:14px
}
.p3-fe-note .i{flex:none;width:16px;height:16px;margin-top:1px}

 .p3-fe-warn{
  display:flex;gap:12px;align-items:flex-start;margin:8px 0 0;padding:12px 16px;
  border-radius:14px;background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn)
}
.p3-fe-warn .i{width:22px;height:22px;flex:none;margin-top:1px}
.p3-fe-warn div{display:flex;flex-direction:column;gap:2px;font-size:13.5px;min-width:0}
.p3-fe-warn b{font-size:15.5px;color:var(--warn)}
.p3-fe-warn span{color:#5d3a00}

body.view-reports[data-p3=form] #p3-templates{margin:16px 0 8px}

body.view-reports[data-p3=form] #editor-fields{display:flex;flex-direction:column;gap:16px;margin-top:8px}
body.view-reports[data-p3=form] #editor-fields fieldset{
  margin:0;padding:0;overflow:visible;background:none;border:0;border-radius:0;
  display:flex;flex-direction:column;gap:8px
}
body.view-reports[data-p3=form] #editor-fields legend{
  float:none;width:auto;box-sizing:border-box;padding:0;margin:4px 2px 2px;
  background:none;border:0;font-size:11px;font-weight:700;letter-spacing:.09em;
  text-transform:uppercase;color:var(--teal-d)
}
body.view-reports[data-p3=form] #editor-fields fieldset:first-child legend{margin-top:0}

body.view-reports[data-p3=form] .fg2-row{
  display:flex;flex-wrap:wrap;align-items:center;gap:12px;
  padding:8px 6px 8px 10px;margin:0;clear:both;
  border:1.5px solid var(--line);border-radius:14px;background:#fff;min-height:60px;
  grid-template-columns:none
}
body.view-reports[data-p3=form] .fg2-row.is-sel{border-color:var(--teal);background:var(--teal-50)}
body.view-reports[data-p3=form] .fg2-row.is-hidden{background:var(--soft)}
body.view-reports[data-p3=form] .fg2-row.is-hidden .p3-fe-tx strong{
  color:var(--muted);text-decoration:line-through;text-decoration-color:#b6c3cb
}
body.view-reports[data-p3=form] .fg2-row-top{display:contents}
.p3-fe-ti{
  display:grid;place-items:center;width:34px;height:34px;border-radius:10px;
  background:var(--soft);color:var(--muted);flex:none;order:1
}
body.view-reports[data-p3=form] .fg2-row.is-sel .p3-fe-ti{background:#fff;color:var(--teal-d)}
.p3-fe-tx{display:flex;flex-direction:column;min-width:0;flex:1;order:2;cursor:pointer}
.p3-fe-tx strong{font-size:13.5px;line-height:1.25;font-weight:600;color:var(--navy);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.p3-fe-tx small{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.view-reports[data-p3=form] .fg2-row-tools{display:flex;flex:none;gap:6px;order:3}
body.view-reports[data-p3=form] .fg2-drag{
  flex:none;order:0;width:44px;height:44px;min-height:44px;
  border:0;border-radius:12px;background:var(--soft);color:var(--navy);
  cursor:grab;touch-action:none
}
body.view-reports[data-p3=form] .fg2-drop{margin:4px 0}
body.view-reports[data-p3=form] .fg2-icon{
  width:40px;height:44px;min-height:44px;border:0;border-radius:12px;background:var(--soft);color:var(--navy)
}
body.view-reports[data-p3=form] .fg2-icon:hover{background:#e4eef2;border:0}
body.view-reports[data-p3=form] .fg2-icon.fg2-danger{color:var(--danger)}
body.view-reports[data-p3=form] .fg2-icon .i{width:20px;height:20px}
body.view-reports[data-p3=form] .fg2-show{
  display:none;flex:none;flex-basis:100%;order:4;min-height:44px;margin:0;font-size:13.5px;font-weight:600
}
body.view-reports[data-p3=form] .fg2-row.is-sel .fg2-show{display:flex}
body.view-reports[data-p3=form] .fg2-rename{
  display:none;flex-basis:100%;order:5;margin:0;font-size:12.5px;font-weight:600;color:var(--muted)
}
body.view-reports[data-p3=form] .fg2-row.is-sel .fg2-rename{display:block}
body.view-reports[data-p3=form] .fg2-rename input{
  min-height:44px;margin-top:4px;border:1px solid #c9d5dc;border-radius:14px;background:#fff;color:var(--navy)
}

body.view-reports[data-p3=form] .fg2-add{
  clear:both;display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;min-height:52px;margin:8px 0 0;padding:0 24px;
  border:1.5px solid var(--line);border-radius:999px;background:#fff;color:var(--navy);
  font-weight:600;font-size:15.5px;box-shadow:var(--shadow-sm)
}
body.view-reports[data-p3=form] .fg2-add:hover{background:var(--soft);border-color:var(--line);color:var(--navy)}
body.view-reports[data-p3=form] .fg2-add .i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

body.view-reports[data-p3=form] .editor-sticky{
  position:sticky;bottom:calc(64px + env(safe-area-inset-bottom,0px));z-index:7;
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;
  margin:16px -20px 0;padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));
  background:linear-gradient(to top,var(--bg,#fafcfd) 70%,rgba(250,252,253,0));border-bottom:0
}
@media (min-width:1024px){
  body.view-reports[data-p3=form] .editor-sticky{bottom:16px;margin-left:0;margin-right:0;padding-left:0;padding-right:0}
  body.view-reports[data-p3=form] .p3-fe-top{margin-left:0;margin-right:0;padding-left:0;padding-right:0}
}
body.view-reports[data-p3=form] #save-form{
  flex:1;display:inline-flex;align-items:center;justify-content:center;
  min-height:52px;margin:0;padding:0 24px;border:1.5px solid transparent;border-radius:999px;
  background:var(--teal);color:#fff;font-weight:600;font-size:15.5px;box-shadow:var(--shadow-sm)
}
body.view-reports[data-p3=form] #save-form:hover{background:var(--teal-d)}
body.view-reports[data-p3=form] #save-form:active{transform:scale(.965)}
body.view-reports[data-p3=form] #save-form[disabled]{opacity:.45}
body.view-reports[data-p3=form] #editor-status{flex:1 1 100%;margin:0;font-size:13.5px;color:var(--muted)}

/* Fase 5: borrador, vista previa y versiones del formulario de grupos. */
body.view-reports[data-p3=form] #editor, body.view-reports[data-p3=form] #form-editor{max-width:100%;box-sizing:border-box;overflow-x:hidden}
.p3-fe-cloud{display:inline-flex;align-items:center;gap:6px;margin:0 20px 12px;padding:6px 10px;border-radius:999px;background:#e8f6f0;color:#0b6b4a;font:600 12px/1.3 Inter,system-ui,sans-serif;max-width:calc(100% - 40px)}
.p3-fe-cloud .i{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.p3-fe-tabs{display:flex;gap:4px;margin:0 20px 14px;padding:3px;border-radius:999px;background:#eef3f6;width:calc(100% - 40px);max-width:100%;box-sizing:border-box}
.p3-fe-tabs button{flex:1;min-width:0;min-height:36px;border:0;border-radius:999px;background:transparent;color:#3b5368;font:700 12px/1.2 Inter,system-ui,sans-serif;cursor:pointer;padding:0 6px}
.p3-fe-tabs button.is-on{background:#fff;color:var(--navy,#05223a);box-shadow:0 1px 3px rgba(5,34,58,.08)}
.p3-fe-indep{display:flex;gap:8px;align-items:flex-start;margin:0 20px 14px;padding:10px 12px;border-radius:14px;background:#eef7f8;color:#3b5368;font:500 13px/1.45 Inter,system-ui,sans-serif}
.p3-fe-indep .i{width:18px;height:18px;margin-top:1px;flex:none;stroke:var(--teal-text,#007883);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.p3-fe-preview,.p3-fe-versions{margin:0 20px;padding-bottom:24px;max-width:100%;box-sizing:border-box}
.p3-fe-foot{padding-bottom:12px}
body.view-reports[data-p3=form] .p3-fe-preview,body.view-reports[data-p3=form] .p3-fe-versions{padding-bottom:calc(24px + 88px)}
.p3-fe-preview-cap{display:flex;align-items:center;gap:8px;margin:0 0 12px;color:#3b5368;font:500 13px/1.4 Inter,system-ui,sans-serif}
.p3-fe-preview-cap .i{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;flex:none}
.p3-fe-pv-sec{margin:16px 0 8px;font:800 11px/1.2 Inter,system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--teal-text,#007883)}
.p3-fe-pv-row{display:block;width:100%;margin:0 0 8px;padding:12px 14px;border:1px solid var(--line,#d7e0e6);border-radius:16px;background:#fff;color:var(--navy,#05223a);box-sizing:border-box}
.p3-fe-pv-row.is-stack span{display:block;margin:0 0 8px;font:700 15px/1.3 Inter,system-ui,sans-serif}
.p3-fe-pv-row input,.p3-fe-pv-row textarea{width:100%;margin:0;padding:10px 12px;border:1px solid var(--line,#d7e0e6);border-radius:14px;background:#fafcfd;color:var(--navy,#05223a);font:500 15px/1.3 Inter,system-ui,sans-serif;box-sizing:border-box}
.p3-fe-pv-yes{display:flex;gap:8px;margin-top:8px}
.p3-fe-pv-yes button{flex:1;min-height:40px;border:1px solid var(--line,#d7e0e6);border-radius:999px;background:#fff;color:var(--navy,#05223a);font:700 14px Inter,system-ui,sans-serif}
.p3-fe-ver-title{margin:0 0 12px;font:800 18px/1.25 Inter,system-ui,sans-serif;color:var(--navy,#05223a)}
.p3-fe-lead,.p3-fe-foot{margin:0 0 12px;font:500 13px/1.45 Inter,system-ui,sans-serif;color:#5b6e7e}
.p3-fe-vers{list-style:none;margin:0;padding:0}
.p3-fe-vers li{display:flex;align-items:center;gap:10px;margin:0 0 8px;padding:12px 14px;border:1px solid var(--line,#d7e0e6);border-radius:16px;background:#fff}
.p3-fe-vers li.is-on{border-color:var(--teal,#008d9b);background:#e6f5f6}
.p3-fe-vers .tx{flex:1;min-width:0}
.p3-fe-vers .tx b{display:block;font:800 16px/1.2 Inter,system-ui,sans-serif;color:var(--navy,#05223a)}
.p3-fe-vers .tx small{color:#5b6e7e;font:500 13px/1.3 Inter,system-ui,sans-serif}
.p3-fe-vers .use{color:#0b6b4a;font:700 13px Inter,system-ui,sans-serif;white-space:nowrap}
.p3-fe-vers .rest{min-height:36px;padding:0 12px;border:1px solid var(--line,#d7e0e6);border-radius:999px;background:#fff;color:var(--navy,#05223a);font:700 13px Inter,system-ui,sans-serif;cursor:pointer}
.p3-fe-vers .rest:hover{background:#e6f5f6;border-color:var(--teal,#008d9b);color:var(--navy,#05223a)}
body.view-reports[data-p3=form] .editor-sticky #save-form-draft,
#save-form-draft.p3-fe-draft{
  flex:1;display:inline-flex;align-items:center;justify-content:center;
  min-height:48px;margin:0;padding:0 18px;border:1.5px solid var(--line,#d7e0e6);border-radius:999px;
  background:#fff;color:var(--navy,#05223a);font-weight:600;font-size:15.5px;cursor:pointer
}
body.view-reports[data-p3=form] .editor-sticky #save-form-draft:hover,
#save-form-draft.p3-fe-draft:hover{background:#e6f5f6;border-color:var(--teal,#008d9b);color:var(--navy,#05223a)}
body.view-reports[data-p3=form] #save-form{min-height:48px}
body.view-reports[data-p3=form] #save-form .i{width:18px;height:18px;margin-right:6px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body.view-reports[data-p3=form] #save-form:hover{background:var(--teal,#008d9b);color:#fff;border-color:transparent}
.p3-fe-scrim{position:fixed;inset:0;z-index:50;background:rgba(5,34,58,.4);display:flex;align-items:flex-end;justify-content:center;padding:0}
.p3-fe-sheet{position:relative;width:min(100%,440px);max-height:min(90vh,760px);overflow:auto;background:#fafcfd;border-radius:20px 20px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom,0px));color:var(--navy,#05223a);box-sizing:border-box}
.p3-fe-sheet h2{margin:0 28px 12px 0;font:800 22px/1.25 Inter,system-ui,sans-serif}
.p3-fe-sheet p{margin:0 0 16px;font:500 15px/1.45 Inter,system-ui,sans-serif;color:#3b5368}
.p3-fe-sheet .x{position:absolute;right:14px;top:14px;width:36px;height:36px;border:0;background:transparent;color:var(--navy,#05223a);font:700 22px Inter,system-ui,sans-serif;cursor:pointer}
.p3-fe-sheet .row-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.p3-fe-sheet .ghost,.p3-fe-sheet .p3s-pill{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:1;min-height:48px;padding:0 14px;border-radius:999px;font:700 15px Inter,system-ui,sans-serif;cursor:pointer;border:0;max-width:100%}
.p3-fe-sheet .ghost{background:#fff;color:var(--navy,#05223a);border:1.5px solid var(--line,#d7e0e6)}
.p3-fe-sheet .ghost:hover{background:#e6f5f6;border-color:var(--teal,#008d9b);color:var(--navy,#05223a)}
.p3-fe-sheet .p3s-pill{background:var(--teal,#008d9b);color:#fff}
.p3-fe-sheet .p3s-pill:hover{background:var(--teal,#008d9b);color:#fff}
.p3-fe-sheet .p3s-pill .i{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2}
@media (min-width:1024px){
  .p3-fe-cloud,.p3-fe-tabs,.p3-fe-indep,.p3-fe-preview,.p3-fe-versions{margin-left:0;margin-right:0}
  .p3-fe-tabs{width:100%}
  .p3-fe-scrim{align-items:center;padding:24px}
  .p3-fe-sheet{border-radius:20px}
}
