.rfg-app{
  --rfg-primary:#16346f;
  --rfg-active:#3563b1;
  --rfg-accent:#ffc900;
  --rfg-muted:#6f7890;
  --rfg-border:#d7dbe5;
  --rfg-shell-max:668px;
  --rfg-stage-max:470px;
  font-family:"Rethink Sans",Arial,sans-serif;
  color:#13295c;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  max-width:100%;
  background:#fff;
  overflow:hidden;
  container-type:inline-size;
}
.rfg-app *{box-sizing:border-box}
.rfg-topbar{height:5px;background:var(--rfg-accent);width:100%;}
.rfg-shell{width:100%;max-width:var(--rfg-shell-max);margin:0 auto;padding:56px 74px 38px;background:#fff;min-width:0}
.rfg-section-title{text-align:center;font-size:16px;line-height:1.2;font-weight:800;margin:4px 0 15px;color:#112657;letter-spacing:-.2px}
.rfg-format-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 auto 26px;width:100%;}
.rfg-format{
  appearance:none;-webkit-appearance:none;border:3px solid var(--rfg-border);background:#fff;
  border-radius:15px;min-width:0;height:114px;padding:10px 4px 8px;cursor:pointer;color:#18346f;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  font-family:"Rethink Sans",Arial,sans-serif;box-shadow:none;transition:.16s ease;overflow:hidden;
}
.rfg-format:hover{border-color:#bbc3d2;transform:translateY(-1px)}
.rfg-format:focus-visible{outline:3px solid rgba(53,99,177,.22);outline-offset:2px}
.rfg-format.is-active{background:var(--rfg-active);border-color:var(--rfg-active);color:#fff}
.rfg-format strong{font-size:18px;line-height:1.02;font-weight:900;letter-spacing:-.6px;margin-top:1px;max-width:100%}
.rfg-format small{font-size:10.5px;line-height:1.15;font-weight:500;opacity:.88;white-space:nowrap;margin-top:3px;max-width:100%}
.rfg-format-icon{display:block;flex:0 0 auto;border:3px solid currentColor;margin-bottom:5px;background:transparent}
.rfg-format-icon-profile{width:38px;height:38px;border-radius:4px}
.rfg-format-icon-round{width:39px;height:39px;border-radius:50%}
.rfg-format-icon-post{width:30px;height:39px;border-radius:4px}
.rfg-format-icon-story{width:21px;height:39px;border-radius:4px}
.rfg-editor-area{width:100%;max-width:var(--rfg-stage-max);margin:0 auto;min-width:0}
.rfg-stage-wrap{display:flex;justify-content:center;align-items:flex-start;width:100%;min-width:0}
.rfg-stage{
  position:relative;width:100%;max-width:var(--rfg-stage-max);overflow:hidden;border-radius:15px;background:#e8ebf1;
  box-shadow:0 10px 27px rgba(19,41,92,.13);touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;
  transform:translateZ(0);min-width:0;
}
.rfg-stage.is-round{border-radius:50%}
.rfg-stage:active{cursor:grabbing}.rfg-canvas{display:block;width:100%;height:100%}
.rfg-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;pointer-events:none;color:#17346f;text-align:center;background:transparent;padding:18px}
.rfg-empty::before{content:"";position:absolute;width:min(62%,250px);aspect-ratio:1;border-radius:50%;background:rgba(255,255,255,.82);box-shadow:0 8px 28px rgba(16,24,40,.14);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.rfg-empty>*{position:relative;z-index:1}
.rfg-empty[hidden]{display:none}.rfg-empty-icon{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;background:#fff;font-size:34px;line-height:1;box-shadow:0 5px 18px rgba(16,24,40,.12);color:var(--rfg-active);border:2px solid rgba(53,99,177,.12)}
.rfg-empty strong{font-size:14px;font-weight:800;margin-top:4px}.rfg-empty span:last-child{font-size:10.5px;max-width:190px;line-height:1.3;color:#66728b}
.rfg-stage:not(.is-round) .rfg-empty{inset:8% 8% 24%}
.rfg-stage.is-round .rfg-empty{inset:12%}

.rfg-controls{margin-top:24px;padding:0;background:transparent;border:0;width:100%}
.rfg-control-row{display:grid;align-items:center}.rfg-control-zoom{grid-template-columns:34px minmax(0,1fr) 34px;gap:7px}
.rfg-control-rotation{display:none}
.rfg-zoom-symbol{appearance:none;border:0;background:transparent;color:#193873;font-family:Arial,sans-serif;font-size:18px;line-height:1;height:26px;padding:0;cursor:pointer;font-weight:400}
.rfg-zoom{width:100%;min-width:0;height:20px;margin:0;accent-color:var(--rfg-active);cursor:pointer}
.rfg-zoom::-webkit-slider-runnable-track{height:6px;border-radius:99px;background:#d9d9d9;border:1px solid #a9a9a9}
.rfg-zoom::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:15px;height:15px;border-radius:50%;background:var(--rfg-active);border:0;margin-top:-5px}
.rfg-zoom::-moz-range-track{height:5px;border-radius:99px;background:#d9d9d9;border:1px solid #a9a9a9}
.rfg-zoom::-moz-range-progress{height:5px;border-radius:99px;background:var(--rfg-active)}
.rfg-zoom::-moz-range-thumb{width:15px;height:15px;border-radius:50%;background:var(--rfg-active);border:0}
.rfg-help{text-align:center;color:#7b8497;font-size:12px;line-height:1.45;margin:10px 0 14px;font-weight:400}
.rfg-final-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px;width:100%}
.rfg-btn,.rfg-download,.rfg-share,.rfg-btn-reset{font-family:"Rethink Sans",Arial,sans-serif;font-weight:800;cursor:pointer;transition:.15s ease}
.rfg-btn,.rfg-download{appearance:none;border:0;border-radius:14px;padding:13px 12px;font-size:13px;min-height:48px;white-space:normal}
.rfg-btn-upload{background:var(--rfg-active);color:#fff}.rfg-download{background:var(--rfg-accent);color:#17346f;margin:0;width:auto}
.rfg-btn:hover,.rfg-download:hover,.rfg-share:hover{filter:brightness(.97);transform:translateY(-1px)}
.rfg-btn:disabled,.rfg-download:disabled,.rfg-share:disabled,.rfg-btn-reset:disabled{opacity:.45;cursor:not-allowed;filter:none;transform:none}
.rfg-btn-reset{display:block;border:0;background:transparent;color:#55709f;font-size:11px;padding:8px 10px;margin:4px auto 0;text-decoration:underline;text-underline-offset:2px}
.rfg-share{display:block;width:100%;border:1px solid #d9dfe9;border-radius:12px;padding:11px 14px;font-size:12px;background:#fff;color:#17346f;margin-top:6px}
.rfg-status{min-height:16px;text-align:center;font-size:11px;margin-top:6px}.rfg-status.is-success{color:#157347}.rfg-status.is-warning{color:#946200}
.rfg-privacy{text-align:center;font-size:9.5px;line-height:1.4;color:#a1a8b7;margin-top:5px}

/* Tablet */
@media(max-width:780px){
  .rfg-shell{max-width:100%;padding:44px clamp(18px,5vw,42px) 30px}
  .rfg-format-grid{gap:8px}
  .rfg-format{height:104px;border-width:2.5px;border-radius:13px;padding:7px 3px}
  .rfg-format strong{font-size:15px}.rfg-format small{font-size:9px}
  .rfg-format-icon-profile{width:34px;height:34px}.rfg-format-icon-round{width:35px;height:35px}.rfg-format-icon-post{width:28px;height:36px}.rfg-format-icon-story{width:20px;height:36px}
}

/* Celular comum */
@media(max-width:520px){
  .rfg-topbar{height:4px}
  .rfg-shell{padding:30px 12px 24px}
  .rfg-section-title{font-size:15px;margin:3px 0 12px}
  .rfg-format-grid{gap:6px;margin-bottom:20px}
  .rfg-format{height:88px;border-radius:11px;border-width:2px;padding:6px 2px}
  .rfg-format strong{font-size:12.5px;letter-spacing:-.25px}
  .rfg-format small{font-size:7.5px;margin-top:2px}
  .rfg-format-icon{border-width:2px;margin-bottom:3px}
  .rfg-format-icon-profile{width:28px;height:28px}.rfg-format-icon-round{width:29px;height:29px}.rfg-format-icon-post{width:23px;height:30px}.rfg-format-icon-story{width:16px;height:30px}
  .rfg-stage{border-radius:13px;box-shadow:0 7px 20px rgba(19,41,92,.12)}
  .rfg-empty-icon{width:50px;height:50px;font-size:30px}
  .rfg-empty strong{font-size:13px}.rfg-empty span:last-child{font-size:10px}
  .rfg-controls{margin-top:18px}
  .rfg-help{font-size:11px;margin:8px 5px 12px}
  .rfg-final-actions{gap:8px}
  .rfg-btn,.rfg-download{font-size:11.5px;padding:11px 7px;min-height:44px;border-radius:12px}
  .rfg-share{font-size:11.5px;padding:10px 12px}
  .rfg-privacy{font-size:9px;padding:0 5px}
}

/* Celulares estreitos: mantém tudo legível sem estourar a largura */
@media(max-width:390px){
  .rfg-shell{padding-left:9px;padding-right:9px}
  .rfg-format-grid{gap:4px}
  .rfg-format{height:82px;border-radius:10px}
  .rfg-format strong{font-size:11px}
  .rfg-format small{font-size:6.8px}
  .rfg-format-icon-profile{width:25px;height:25px}.rfg-format-icon-round{width:26px;height:26px}.rfg-format-icon-post{width:20px;height:27px}.rfg-format-icon-story{width:14px;height:27px}
  .rfg-control-zoom{grid-template-columns:28px minmax(0,1fr) 28px;gap:4px}
}

/* Fallback para o plugin quando inserido em uma coluna estreita do Elementor. */
@container (max-width:520px){
  .rfg-shell{padding-left:12px;padding-right:12px}
}
@container (max-width:390px){
  .rfg-shell{padding-left:8px;padding-right:8px}
  .rfg-format-grid{gap:4px}
  .rfg-format strong{font-size:11px}
  .rfg-format small{font-size:6.8px}
}

@media(prefers-reduced-motion:reduce){
  .rfg-format,.rfg-btn,.rfg-download,.rfg-share,.rfg-btn-reset{transition:none!important}
}


/* Seletor de origem da foto — exibido apenas no mobile via JavaScript */
.rfg-mobile-source[hidden]{display:none!important}
.rfg-mobile-source{position:fixed;inset:0;z-index:999999;display:flex;align-items:flex-end;justify-content:center;font-family:"Rethink Sans",Arial,sans-serif}
.rfg-source-backdrop{position:absolute;inset:0;border:0;background:rgba(4,16,48,.58);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);cursor:pointer}
.rfg-source-sheet{position:relative;z-index:2;width:min(100%,520px);background:#fff;border-radius:26px 26px 0 0;padding:12px 18px max(20px,env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(6,27,75,.22);animation:rfgSheetUp .24s ease-out}
.rfg-source-handle{display:block;width:46px;height:5px;border-radius:99px;background:#d9dee8;margin:1px auto 17px}
.rfg-source-title{display:block;text-align:center;color:#13295c;font-size:20px;line-height:1.1;font-weight:800;letter-spacing:-.4px}
.rfg-source-subtitle{display:block;text-align:center;color:#7b8497;font-size:12px;margin:5px 0 17px}
.rfg-source-options{display:grid;gap:10px}
.rfg-source-option{appearance:none;width:100%;border:1.5px solid #e0e5ef;border-radius:17px;background:#fff;padding:14px;display:flex;align-items:center;gap:13px;text-align:left;color:#13295c;cursor:pointer;box-shadow:0 7px 20px rgba(18,52,111,.06);transition:.15s ease}
.rfg-source-option:active{transform:scale(.985);background:#f7f9fd}
.rfg-source-camera{border-color:rgba(53,99,177,.28);background:#f6f9ff}
.rfg-source-icon{width:50px;height:50px;flex:0 0 50px;border-radius:15px;display:grid;place-items:center;background:var(--rfg-active);color:#fff;font-size:23px;font-weight:800}
.rfg-source-gallery .rfg-source-icon{background:var(--rfg-accent);color:#17346f;font-size:24px}
.rfg-source-option span:last-child{min-width:0;display:block}
.rfg-source-option strong{display:block;font-size:15px;font-weight:800;line-height:1.15}
.rfg-source-option small{display:block;color:#7d8799;font-size:11px;margin-top:4px;line-height:1.25}
.rfg-source-cancel{appearance:none;width:100%;border:0;background:transparent;color:#68758d;font-size:13px;font-weight:700;padding:14px 10px 3px;cursor:pointer}
html.rfg-source-open,html.rfg-source-open body{overflow:hidden!important}
@keyframes rfgSheetUp{from{transform:translateY(28px);opacity:.4}to{transform:translateY(0);opacity:1}}
@media(min-width:821px){.rfg-mobile-source{display:none!important}}
@media(prefers-reduced-motion:reduce){.rfg-source-sheet{animation:none}.rfg-source-option{transition:none}}
