/* Meu Portal · Ferramentas › Formulários na conversa
   Lista em duas abas (Agendamento × Formulários de pedido) e o editor visual, usado pelos dois
   tipos: o formulário é editado como o cliente o vê. Cores da casca (--mp-*); a folha de papel do
   editor usa as cores do chat do dono (.fpv, 03-aparencia-chat.css). */

[data-mp-tool="formularios"], #fmEditor {
  --fm-brand-l: #b8dcd5;
  --fm-in: #2849b8;
  --fm-in-t: #ebf0fd;
  --fm-in-l: #c7d3f5;
  --fm-field: #d3d9d4;
  --fm-dash: #b9c4bd;
}

/* ---------- Peças ---------- */
.fm-crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--mp-muted); font-size: 13px; }
.fm-crumb a { color: var(--mp-muted); text-decoration: none; }
.fm-crumb a:hover { color: var(--mp-brand); }
.fm-crumb b { color: var(--mp-ink); font-weight: 600; }

.fm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: 1px solid var(--mp-line); border-radius: 10px; background: #fff; color: var(--mp-ink); font: 600 14px var(--mp-font); white-space: nowrap; cursor: pointer; }
.fm-btn:hover { background: var(--mp-hover); }
.fm-btn.p { background: var(--mp-brand); border-color: var(--mp-brand); color: #fff; }
.fm-btn.p:hover { background: var(--mp-brand-d); }
.fm-btn.sm { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.fm-btn.ghost { background: transparent; }
.fm-btn.danger { border-color: #f2cdc9; background: #fff; color: var(--mp-red); }
.fm-btn.danger:hover { background: var(--mp-red-t); }
.fm-btn:disabled { opacity: .4; cursor: not-allowed; }
.fm-ib { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--mp-line); border-radius: 8px; background: #fff; color: var(--mp-muted); cursor: pointer; }
.fm-ib:hover { background: var(--mp-hover); color: var(--mp-ink); }
.fm-lnk { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--mp-brand); font: 600 13px var(--mp-font); cursor: pointer; }
.fm-lnk:hover { color: var(--mp-brand-d); text-decoration: underline; }
.fm-chip { padding: 4px 10px; border: 1px solid var(--mp-line); border-radius: 999px; background: #fff; color: var(--mp-ink); font: 600 12px var(--mp-font); cursor: pointer; }
.fm-chip:hover { border-color: var(--mp-brand); color: var(--mp-brand); }
.fm-kind { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.fm-kind.cal { background: var(--mp-brand-t); color: var(--mp-brand-d); }
.fm-kind.frm { background: var(--fm-in-t); color: var(--fm-in); }
.fm-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; height: fit-content; padding: 4px 10px; border-radius: 999px; background: var(--mp-off-t); color: var(--mp-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fm-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mp-faint); }
.fm-pill.on { background: #e3f4ea; color: #17663b; }
.fm-pill.on i { background: #1f9d55; }
.fm-sw { position: relative; width: 42px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 999px; background: #cfd6d1; cursor: pointer; transition: background .15s; }
.fm-sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.fm-sw.on { background: var(--mp-brand); }
.fm-sw.on i { transform: translateX(18px); }
.fm-sw:disabled { opacity: .4; cursor: not-allowed; }
.fm-fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fm-fld > label { color: var(--mp-ink2); font-size: 13px; font-weight: 700; }
.fm-o { color: var(--mp-faint); font-weight: 500; }
.fm-fld input, .fm-fld textarea, .fm-cond-s select, .fm-opt input { width: 100%; box-sizing: border-box; margin: 0; padding: 10px 12px; border: 1px solid var(--fm-field); border-radius: 10px; outline: none; background: #fff; color: var(--mp-ink); font: 400 14px var(--mp-font); }
.fm-fld textarea { min-height: 0; line-height: 1.45; resize: vertical; }
.fm-fld input:focus, .fm-fld textarea:focus, .fm-opt input:focus, .fm-cond-s select:focus { border-color: var(--mp-brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.fm-fld input:disabled, .fm-fld textarea:disabled { background: var(--mp-off-t); color: var(--mp-muted); }
.fm-fld.fm-bad input, .fm-fld.fm-bad textarea { border-color: var(--mp-red); }
.fm-err { margin: 0; color: var(--mp-red); font-size: 12.5px; font-weight: 600; }
.fm-help { color: var(--mp-muted); font-size: 12px; line-height: 1.4; }
.fm-swrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
.fm-swrow > span { display: flex; flex-direction: column; gap: 2px; }
.fm-swrow b { font-size: 14px; font-weight: 600; }
.fm-swrow small { color: var(--mp-muted); font-size: 12.5px; line-height: 1.4; }
.fm-swrow.sm { padding: 4px 0 0; }
.fm-swrow.sm b { font-size: 13px; }
.fm-hint { margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--mp-off-t); color: var(--mp-muted); font-size: 12.5px; }
.fm-cond-s { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--fm-in-t); color: var(--fm-in); font-size: 13px; font-weight: 600; }
.fm-cond-s select { width: auto; max-width: 100%; padding: 7px 10px; font-weight: 600; }
.fm-opts { display: flex; flex-direction: column; gap: 8px; }
.fm-opt { display: flex; align-items: center; gap: 8px; }
.fm-opt input { padding: 8px 10px; }
.fm-opt-mk { width: 16px; height: 16px; flex: none; box-sizing: border-box; border: 2px solid #b9c2bc; border-radius: 50%; }
.fm-opt-mk.sq { border-radius: 4px; }
.fm-opts-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; }
.fm-opts-pre { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--mp-muted); font-size: 12px; }
.fm-more { margin: 2px 0 14px; border-top: 1px solid var(--mp-line2); }
.fm-more > summary { padding: 12px 0 8px; color: var(--mp-brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.fa-p { margin: 0 0 14px; color: var(--mp-muted); font-size: 13.5px; line-height: 1.5; }

/* ---------- Lista: abas ---------- */
.fb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 0; }
.fb-tab { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--mp-line); border-bottom: 0; border-radius: 16px 16px 0 0; background: #eef0ea; color: var(--mp-ink); font-family: var(--mp-font); text-align: left; cursor: pointer; }
.fb-tab-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: #fff; color: var(--mp-muted); }
.fb-tab-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fb-tab-t b { font-size: 15px; }
.fb-tab-t small { color: var(--mp-muted); font-size: 12.5px; }
.fb-tab-n { padding: 3px 9px; border-radius: 999px; background: #fff; color: var(--mp-muted); font-size: 12px; font-weight: 700; }
.fb-tab.on { background: #fff; }
.fb-tab.cal.on { border-color: var(--fm-brand-l); box-shadow: inset 0 4px 0 var(--mp-brand); }
.fb-tab.cal.on .fb-tab-ic { background: var(--mp-brand); color: #fff; }
.fb-tab.cal.on .fb-tab-n { background: var(--mp-brand-t); color: var(--mp-brand-d); }
.fb-tab.frm.on { border-color: var(--fm-in-l); box-shadow: inset 0 4px 0 var(--fm-in); }
.fb-tab.frm.on .fb-tab-ic { background: var(--fm-in); color: #fff; }
.fb-tab.frm.on .fb-tab-n { background: var(--fm-in-t); color: var(--fm-in); }
.fb-panel { margin-top: -1.5px; padding: 24px; border: 1.5px solid var(--mp-line); border-radius: 0 0 18px 18px; background: #fff; }
.fb-panel.cal { border-color: var(--fm-brand-l); }
.fb-panel.frm { border-color: var(--fm-in-l); }

/* Lista: agendamento */
.fb-cal { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.fb-cal.solo { grid-template-columns: minmax(0, 1fr); }
.fb-cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.fb-cal-head h2 { margin: 0; color: var(--mp-ink); font: 700 19px/1.2 var(--mp-display); letter-spacing: -.02em; }
.fb-cal-head p { margin: 5px 0 0; color: var(--mp-muted); font-size: 14px; line-height: 1.5; }
.fb-jr-l { margin-bottom: 10px; color: var(--mp-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fb-jr { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
.fb-jr-g { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; }
.fb-jr-g.agenda { background: var(--mp-brand-t); }
.fb-jr-g.own { border: 1.5px dashed #9fb0a8; background: #fff; }
.fb-jr-gh { display: flex; align-items: center; gap: 6px; color: var(--mp-brand-d); font-size: 12px; font-weight: 700; }
.fb-jr-g.own .fb-jr-gh { color: var(--mp-ink); }
.fb-jr-steps { display: flex; flex-direction: column; gap: 6px; }
.fb-jr-s { display: flex; align-items: center; gap: 10px; }
.fb-jr-s > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.fb-jr-s b { font-size: 13.5px; }
.fb-jr-s small { color: var(--mp-muted); font-size: 12px; }
.fb-jr-s.off b { color: var(--mp-muted); font-weight: 600; }
.fb-jr-s.off .fb-jr-ic { color: var(--mp-faint); }
.fb-jr-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--mp-brand); }
.fb-jr-g.own .fb-jr-ic { background: var(--mp-ink); color: #fff; }
.fb-jr-links { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 4px; }
.fb-jr-ul { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0 0 0 40px; color: var(--mp-ink2); font-size: 13px; }
.fb-jr-ul i { margin-left: 2px; color: var(--mp-red); font-style: normal; }
.fb-jr-p { margin: 0; color: var(--mp-ink2); font-size: 13px; line-height: 1.45; }
.fb-jr-g.own .fm-btn { align-self: flex-start; margin-top: auto; }
.fb-cal-pv { display: flex; align-items: center; justify-content: center; padding: 16px 0; border-radius: 16px; background: var(--mp-brand-t); }
.fb-cal-pv .aw-phone { width: 252px; padding: 7px; border-radius: 32px; }
.fb-cal-pv .aw-phone::before { display: none; }
.fb-cal-pv .fpv-foot:not(.is-review) { flex-wrap: nowrap; }
.fb-cal-pv .fpv-foot:not(.is-review) .fpv-btn-primary { flex: 1 1 0; min-width: 0; }
.fb-cal-pv .preview-screen { height: 440px; border-radius: 25px; }
.fb-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px; border-radius: 12px; background: var(--mp-off-t); color: var(--mp-ink2); font-size: 14px; line-height: 1.5; }

/* Lista: formulários de pedido */
.fb-forms-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.fb-forms-h p { max-width: 60ch; margin: 0; color: var(--mp-muted); font-size: 14px; line-height: 1.5; }
.fb-rows { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--mp-line); border-radius: 14px; }
.fb-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 90px 90px 80px 24px; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--mp-line2); background: #fff; }
.fb-row:first-child { border-top: 0; }
.fb-row:hover:not(.hd) { background: #fafbf8; }
.fb-row.hd { padding: 9px 16px; background: #f8f9f6; color: var(--mp-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fb-row-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--fm-in-t); color: var(--fm-in); }
.fb-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-row-open { padding: 0; border: 0; background: none; color: var(--mp-ink); font: 700 14.5px var(--mp-font); text-align: left; cursor: pointer; }
.fb-row-open::after { content: ""; position: absolute; inset: 0; }
.fb-row-open:focus-visible { outline: none; }
.fb-row-open:focus-visible::after { outline: 2px solid var(--mp-brand); outline-offset: -2px; }
.fb-row-t small { overflow: hidden; color: var(--mp-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.fb-row-t small.m { display: none; }
.fb-row-n { font-size: 14px; font-weight: 600; }
.fb-row-sw { position: relative; z-index: 1; display: flex; }
.fb-row-chev { color: var(--mp-faint); }
.fb-empty { padding: 28px 16px; border: 1.5px dashed var(--fm-dash); border-radius: 14px; color: var(--mp-muted); font-size: 14px; line-height: 1.5; text-align: center; }

/* ---------- Editor ---------- */
body.fm-ed-open { overflow: hidden; }
#fmEditor { position: fixed; top: 0; right: 0; bottom: 0; left: var(--mp-sb-w); z-index: 60; display: flex; flex-direction: column; background: var(--mp-bg); color: var(--mp-ink); font-family: var(--mp-font); font-size: 14.5px; line-height: 1.45; }
#fmEditor.hidden { display: none; }
.fb-top { flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--mp-line); background: #fff; }
.fa-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 0; border: 0; background: none; color: var(--mp-muted); font: 600 14px var(--mp-font); cursor: pointer; }
.fa-back:hover { color: var(--mp-ink); }
.fa-top-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fa-top-t b { overflow: hidden; font: 700 17px/1.2 var(--mp-display); letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.fb-mode { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--mp-off-t); }
.fb-mode button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 8px; background: none; color: var(--mp-muted); font: 700 13px var(--mp-font); cursor: pointer; }
.fb-mode button.on { background: #fff; color: var(--mp-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.fb-grid3 { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) 350px; }
.fb-grid3.hidden { display: none; }

.fb-outline { display: flex; flex-direction: column; gap: 2px; overflow: auto; padding: 16px 12px; border-right: 1px solid var(--mp-line); background: #fff; }
.fb-ol-h { padding: 0 8px 8px; color: var(--mp-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fb-ol-sub { padding: 10px 8px 4px; color: var(--mp-ink2); font-size: 12px; font-weight: 700; }
.fb-ol-i { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--mp-ink2); font: 400 13px var(--mp-font); text-align: left; cursor: pointer; }
.fb-ol-i:hover { background: var(--mp-hover); }
.fb-ol-i.on { background: var(--mp-brand-t); color: var(--mp-brand-d); font-weight: 700; }
.fb-ol-i.lock { margin-bottom: 3px; background: var(--mp-brand-t); color: var(--mp-brand-d); cursor: default; }
.fb-ol-i.lock small { font-size: 11px; font-weight: 600; opacity: .8; }
.fb-ol-n { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--mp-off-t); font-size: 11px; font-weight: 700; }
.fb-ol-i.on .fb-ol-n { background: var(--mp-brand); color: #fff; }
.fb-ol-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-ol-req { color: var(--mp-red); font-style: normal; }
.fb-ol-add { padding: 10px 8px; }

.fb-canvas { min-height: 0; overflow: auto; padding: 28px 24px 60px; background-color: var(--mp-bg); background-image: radial-gradient(#d6dbd3 1px, transparent 1px); background-size: 18px 18px; }
/* .fpv traz as cores, a fonte e os cantos do chat do dono; aqui a folha cresce com as perguntas. */
.fpv.fb-paper { position: relative; height: auto; min-height: 0; max-width: 520px; margin: 0 auto; overflow: visible; padding: 26px 22px 22px; border-radius: 20px; background: var(--chat-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 20px 40px -20px rgba(19, 32, 34, .25); }
.fb-paper-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--mp-ink); color: #fff; font: 600 11.5px var(--mp-font); white-space: nowrap; }
.fb-paper-h { padding: 0 10px 14px; }
.fb-paper-h small { color: var(--chat-muted); font-size: 12px; font-weight: 700; }
.fb-paper-h h2 { margin: 2px 0 0; color: var(--chat-bot-text); font: inherit; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.fb-title-in, .fb-desc-in { display: block; width: calc(100% + 12px); box-sizing: border-box; margin: 2px -6px 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; outline: none; background: transparent; }
.fb-title-in { color: var(--chat-bot-text); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.fb-desc-in { color: var(--chat-muted); font-size: 14px; line-height: 1.5; resize: none; }
.fb-title-in:hover, .fb-desc-in:hover { border-color: var(--chat-line-strong); }
.fb-title-in:focus, .fb-desc-in:focus { border-color: var(--mp-brand); }
.fb-title-in::placeholder, .fb-desc-in::placeholder { color: var(--chat-muted); opacity: .8; }
.fb-lockbar { margin: 0 10px 14px; padding: 12px; border-radius: 12px; background: var(--mp-brand-t); font-family: var(--mp-font); }
.fb-lockbar-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--mp-brand-d); font-size: 12.5px; font-weight: 700; }
.fb-lockbar-s { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-lockbar-s span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: #fff; color: var(--mp-brand-d); font-size: 12px; font-weight: 600; }
.fb-f { position: relative; padding: 12px 10px 4px; border: 1.5px solid transparent; border-radius: 12px; cursor: pointer; }
.fb-f:hover { border-color: var(--chat-line-strong); border-style: dashed; }
.fb-f:focus-visible { outline: 2px solid var(--mp-brand); outline-offset: 1px; }
.fb-f.on { border: 1.5px solid var(--mp-brand); background: rgba(15, 118, 110, .05); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.fb-f-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-family: var(--mp-font); }
.fb-f-n { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--mp-off-t); color: var(--mp-ink2); font-size: 11px; font-weight: 700; }
.fb-f.on .fb-f-n { background: var(--mp-brand); color: #fff; }
.fb-f-type { display: inline-flex; align-items: center; gap: 4px; color: var(--chat-muted); font-size: 11.5px; font-weight: 600; }
.fb-f-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.fb-f-tag.lock { background: var(--mp-brand-t); color: var(--mp-brand-d); }
.fb-f-tag.cond { background: var(--fm-in-t); color: var(--fm-in); }
.fb-f-pv { pointer-events: none; }
.fb-paper .fpv-field > label, .fb-paper .fpv-field > .fpv-label { font-size: 14px; }
.fb-paper .fpv-input, .fb-paper .fpv-select { min-height: 42px; font-size: 14px; }
.fb-f-tools { position: absolute; top: -16px; right: 10px; z-index: 2; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--mp-line); border-radius: 10px; background: #fff; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .25); }
.fb-f-tools button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--mp-ink2); cursor: pointer; }
.fb-f-tools button:hover { background: var(--mp-hover); }
.fb-f-tools button:disabled { opacity: .3; cursor: not-allowed; }
.fb-f-tools button.del { color: var(--mp-red); }
.fb-ins { position: relative; display: block; width: 100%; height: 16px; padding: 0; border: 0; background: none; cursor: pointer; }
.fb-ins span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--mp-brand); color: #fff; opacity: 0; transition: opacity .12s; }
.fb-ins::before { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; border-top: 1.5px dashed var(--mp-brand); opacity: 0; transition: opacity .12s; }
.fb-ins:hover span, .fb-ins:hover::before, .fb-ins:focus-visible span, .fb-ins:focus-visible::before { opacity: 1; }
.fb-ins.last { height: auto; margin-top: 10px; }
.fb-ins.last::before { display: none; }
.fb-ins.last span { position: static; transform: none; width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; border: 1.5px dashed var(--fm-dash); border-radius: 12px; background: var(--mp-surface); color: var(--mp-brand); font: 700 14px var(--mp-font); opacity: 1; }
.fb-ins.last:hover span { border-color: var(--mp-brand); background: var(--mp-brand-t); }
.fb-tmenu { margin: 8px 0; padding: 12px; border: 1.5px solid var(--mp-brand); border-radius: 14px; background: #fff; color: var(--mp-ink); font-family: var(--mp-font); }
.fb-tmenu-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.fb-tmenu-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-tmenu-g button { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--mp-line); border-radius: 10px; background: #fff; color: var(--mp-ink); font-family: var(--mp-font); text-align: left; cursor: pointer; }
.fb-tmenu-g button:hover { border-color: var(--mp-brand); background: var(--mp-brand-t); }
.fb-tmenu-g svg { flex: none; }
.fb-tmenu-g b { display: block; font-size: 13px; }
.fb-tmenu-g small { color: var(--mp-muted); font-size: 11px; }
.fb-paper-foot { display: flex; margin-top: 10px; padding: 16px 10px 0; border-top: 1px solid var(--chat-line); }
.fb-paper-foot .fpv-btn { flex: 1; }

.fb-props { overflow: auto; padding: 18px; border-left: 1px solid var(--mp-line); background: #fff; }
.fb-props-in { display: flex; flex-direction: column; }
.fb-props-in.hidden { display: none; }
.fb-props-h { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 14px; }
.fb-props-k { color: var(--mp-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fb-types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-types button { display: flex; align-items: center; gap: 7px; padding: 8px 9px; border: 1.5px solid var(--mp-line); border-radius: 9px; background: #fff; color: var(--mp-ink); font: 600 13px var(--mp-font); text-align: left; cursor: pointer; }
.fb-types button:hover { border-color: #b5c0b9; }
.fb-types button.on { border-color: var(--mp-brand); background: var(--mp-brand-t); color: var(--mp-brand-d); }
.fb-props-sep { height: 1px; margin: 2px 0 4px; background: var(--mp-line2); }
.fb-props-tools { display: none; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--mp-line2); }
.fb-props-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--mp-line2); }
.fb-tip { display: flex; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; background: var(--mp-off-t); color: var(--mp-ink2); font-size: 13px; line-height: 1.45; }
.fb-tip svg { flex: none; margin-top: 1px; color: var(--mp-brand); }

.fb-test { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; gap: 36px; padding: 24px 16px; background: var(--mp-bg); }
.fb-test.hidden { display: none; }
.fb-test .aw-phone { width: 316px; box-sizing: border-box; }
.fb-test .preview-screen { height: min(620px, calc(100vh - 190px)); min-height: 420px; }
.fb-test-note { max-width: 260px; padding-top: 40px; }
.fb-test-note b { font: 700 16px var(--mp-display); }
.fb-test-note p { margin: 8px 0 0; color: var(--mp-muted); font-size: 14px; line-height: 1.55; }

.fa-mbar { display: none; grid-template-columns: auto 1fr 1fr; gap: 8px; flex: none; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mp-line); background: rgba(255, 255, 255, .97); }
.fb-scrim { display: none; position: absolute; inset: 0; z-index: 40; background: rgba(19, 32, 34, .4); }
.fb-sheet-grab { display: none; width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 3px; background: var(--fm-field); }
.fm-only-m { display: none; }
.fm-btn.hidden, .fa-mbar.hidden { display: none !important; }
/* O que muda entre os dois tipos de formulário (classe .is-cal posta pelo editor). */
#fmEditor.is-cal .fm-mode-std, #fmEditor:not(.is-cal) .fm-mode-cal { display: none; }

/* Tela média: a estrutura sai primeiro, para sobrar folha */
@media (max-width: 1240px) {
  .fb-grid3 { grid-template-columns: minmax(0, 1fr) 350px; }
  .fb-outline { display: none; }
}

/* Editor compacto: folha inteira e ajustes em folha inferior (classe posta pelo editor) */
#fmEditor.m .fb-top { gap: 8px; padding: 10px 12px; }
#fmEditor.m .fa-back span, #fmEditor.m .fa-top-t b, #fmEditor.m .fb-top [data-fm="save"] { display: none; }
#fmEditor.m .fb-grid3 { display: flex; flex-direction: column; }
#fmEditor.m .fb-grid3.hidden { display: none; }
#fmEditor.m .fb-canvas { flex: 1; padding: 22px 12px 30px; }
#fmEditor.m .fpv.fb-paper { padding: 22px 14px 16px; border-radius: 16px; }
#fmEditor.m .fb-tmenu-g small { display: none; }
#fmEditor.m .fa-mbar { display: grid; }
#fmEditor.m .fb-props { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; display: none; max-height: 80%; padding: 6px 16px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 40px -10px rgba(0, 0, 0, .25); }
#fmEditor.m.sheet-on .fb-props { display: block; }
#fmEditor.m.sheet-on .fb-scrim { display: block; }
#fmEditor.m .fb-sheet-grab { display: block; }
#fmEditor.m .fm-only-m { display: inline-flex; }
#fmEditor.m .fm-wide-only { display: none; }
#fmEditor.m .fb-props-tools { display: flex; }
#fmEditor.m .fb-test { padding: 14px 10px; }
#fmEditor.m .fb-test-note { display: none; }
#fmEditor.m .fb-test-c { width: min(316px, 100%); }
#fmEditor.m .fb-test .aw-phone { width: 100%; }
#fmEditor.m .fb-test .preview-screen { height: min(560px, calc(100dvh - 190px)); }

@media (hover: none) {
  .fb-ins span, .fb-ins::before { opacity: .55; }
}

/* Lista em telas estreitas */
@media (max-width: 900px) {
  .fb-cal { grid-template-columns: minmax(0, 1fr); }
  .fb-cal-pv { display: none; }
}
@media (max-width: 759px) {
  #fmEditor { left: 0; }
  .fb-tabs { gap: 8px; }
  .fb-tab { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .fb-tab-n { position: absolute; top: 12px; right: 12px; }
  .fb-panel { padding: 16px; }
  .fb-cal-head { flex-direction: column; gap: 10px; }
  .fb-jr { grid-template-columns: minmax(0, 1fr); }
  .fb-forms-h { flex-direction: column; align-items: stretch; }
  .fb-row { grid-template-columns: 36px minmax(0, 1fr) auto 18px; gap: 10px; padding: 12px; }
  .fb-row.hd, .fb-row-n { display: none; }
  .fb-row-ic { width: 34px; height: 34px; }
  .fb-row-t small.d { display: none; }
  .fb-row-t small.m { display: block; }
}

/* Aviso (ação recusada ou com efeito colateral) */
.mp-toast.warn svg { color: #fbbf24; }
