.fae-dialog {
  --n: #153451; --t: #25858a; --m: #637783; --l: #e4e5de; --sand: #f1eee6; --card: #fffefa;
  width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--l); border-radius: 16px; background: var(--sand); color: var(--n);
  font-family: "Manrope", sans-serif; box-shadow: 0 24px 60px rgba(21, 52, 81, .2); overflow: hidden;
}
.fae-dialog::backdrop { background: rgba(17, 40, 57, .38); }
.fae-whatsapp-dialog { width: min(640px, calc(100vw - 24px)); }
.fae-whatsapp-dialog textarea { width: 100%; min-width: 0; resize: vertical; padding: 12px; border: 1px solid var(--l); border-radius: 10px; color: var(--n); background: white; font-size: 16px; line-height: 1.5; }
.fae-dialog * { box-sizing: border-box; font-family: inherit; }
.fae-dialog :focus-visible { outline: 3px solid #168a8e; outline-offset: 2px; }
.fae-frame { position: relative; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.fae-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; background: rgba(255, 254, 250, .97); border-bottom: 1px solid rgba(21, 52, 81, .08); }
.fae-kicker { margin: 0 0 3px; color: #73858b; font-size: .64rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.fae-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; }
.fae-x { flex: 0 0 40px; width: 40px; height: 40px; padding-bottom: 3px; border: 1px solid #dfe7e3; border-radius: 50%; background: var(--card); color: var(--n); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.fae-body { overflow: auto; padding: 20px 24px 24px; }
.fae-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fae-form, .fae-preview { display: grid; gap: 14px; padding: 19px; border: 1px solid var(--l); border-radius: 14px; background: var(--card); box-shadow: 0 4px 14px rgba(21, 52, 81, .045); min-width: 0; }
.fae-preview { position: sticky; top: 0; }
.fae-form.is-locked { opacity: .82; }
.fae-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fae-meta > div { display: grid; gap: 2px; padding: 11px 12px; border: 1px solid #e5ece7; border-radius: 10px; background: #f6f9f5; min-width: 0; }
.fae-meta small, .fae-mail-meta small, .fae-dl dt { color: #74858a; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fae-meta strong { font-size: .84rem; overflow-wrap: anywhere; }
.fae-meta span { color: var(--m); font-size: .74rem; overflow-wrap: anywhere; }
.fae-kinds { display: flex; gap: 6px; margin: 0; padding: 4px; border: 1px solid #dce5e1; border-radius: 10px; background: #f3f6f2; }
.fae-kinds legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fae-kinds label { flex: 1; position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 7px; color: #5b6f78; font-size: .76rem; font-weight: 700; cursor: pointer; }
.fae-kinds label.is-on { background: var(--card); color: var(--n); box-shadow: 0 1px 4px rgba(21, 52, 81, .1); }
.fae-kinds input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.fae-kinds label:has(input:focus-visible) { outline: 3px solid #168a8e; }
.fae-hint, .fae-hint-inline { margin: 0; color: #4d6e70; font-size: .72rem; line-height: 1.5; }
.fae-field { display: grid; gap: 6px; }
.fae-field > span { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; }
.fae-field em { color: #8a979b; font-style: normal; font-size: .68rem; font-weight: 600; }
.fae-field input, .fae-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d7e1dc; border-radius: 8px; background: #fffefa; color: var(--n); font: 500 .84rem/1.55 "Manrope", sans-serif; }
.fae-field textarea { min-height: 220px; resize: vertical; white-space: pre-wrap; }
.fae-field [aria-invalid="true"] { border-color: #c98a84; }
.fae-err { min-height: 0; color: #a65c57; font-size: .72rem; font-weight: 700; }
.fae-err:empty { display: none; }
.fae-attach { display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid #edf0ea; }
.fae-attach-head { display: grid; gap: 2px; }
.fae-attach-head strong { font-size: .8rem; }
.fae-attach-head span { color: var(--m); font-size: .7rem; }
.fae-warn { margin: 0; padding: 10px 12px; border: 1px solid #ebdbb9; border-radius: 10px; background: #fff5dc; color: #725420; font-size: .72rem; line-height: 1.5; }
.fae-file { position: relative; width: fit-content; }
.fae-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fae-file:has(input:focus-visible) { outline: 3px solid #168a8e; outline-offset: 2px; }
.fae-file:has(input:disabled) { opacity: .5; pointer-events: none; }
.fae-files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fae-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e5e9e3; border-radius: 9px; background: #fbfcf9; }
.fae-files .fae-empty { color: #8a979b; font-size: .72rem; border-style: dashed; background: transparent; }
.fae-ftype { flex: 0 0 38px; display: grid; place-items: center; height: 28px; border-radius: 6px; background: #edf4f1; color: #357877; font-size: .6rem; font-weight: 800; }
.fae-fname { flex: 1; min-width: 0; display: grid; font-size: .76rem; font-weight: 700; overflow-wrap: anywhere; }
.fae-fname small { color: #8a979b; font-weight: 600; }
.fae-link { min-height: 32px; padding: 4px 8px; border: 0; background: none; color: #a65c57; font-size: .7rem; font-weight: 700; cursor: pointer; }
.fae-link:disabled { opacity: .4; cursor: default; }
.fae-preview-head { display: flex; justify-content: space-between; align-items: center; }
.fae-preview-head strong { font-size: .9rem; }
.fae-preview-head span { padding: 3px 9px; border-radius: 999px; font-size: .66rem; font-weight: 800; }
.fae-preview-head .is-fresh { background: #e5f2eb; color: #35765e; }
.fae-preview-head .is-stale { background: #fbf0d6; color: #90621c; }
.fae-mail { display: grid; gap: 0; border: 1px solid #dfe5e0; border-radius: 12px; overflow: hidden; background: #fbfaf5; }
.fae-mail-empty { display: grid; place-items: center; min-height: 260px; padding: 24px; color: var(--m); font-size: .78rem; text-align: center; }
.fae-mail-meta { display: grid; gap: 6px; padding: 12px 14px; border-bottom: 1px solid #e6eae4; background: #f6f8f4; }
.fae-mail-meta > div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: .76rem; }
.fae-mail-meta span { overflow-wrap: anywhere; }
.fae-mail iframe { display: block; width: 100%; height: 400px; border: 0; background: #fffefa; transition: opacity .2s ease; }
.fae-mail .is-stale, .fae-mail iframe.is-stale { opacity: .5; }
.fae-mail > .fae-err { margin: 8px 14px; }
.fae-note { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: .74rem; line-height: 1.5; }
.fae-note p { margin: 0; }
.fae-note small { color: #7a878b; font-family: ui-monospace, monospace; font-size: .66rem; overflow-wrap: anywhere; }
.fae-note.is-ok { border-color: #cfe4d7; background: #eff7f1; color: #2f6a53; }
.fae-note.is-wait { border-color: #ebdbb9; background: #fff5dc; color: #725420; }
.fae-note.is-bad { border-color: #ecd8d1; background: #fff6f3; color: #8e5952; }
.fae-actions, .fae-row-end { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.fae-hint-inline { flex-basis: 100%; text-align: right; }
.fae-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border: 1px solid #cbded8; border-radius: 8px; background: #edf5f1; color: #346b68; font-size: .76rem; font-weight: 700; cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
.fae-btn:active { transform: translateY(1px); }
.fae-btn:disabled { opacity: .45; cursor: not-allowed; }
.fae-primary { border-color: var(--n); background: var(--n); color: #fffefa; }
.fae-busy { margin: 0; color: #4d6e70; font-size: .76rem; font-weight: 700; }
.fae-state { display: grid; gap: 8px; justify-items: start; max-width: 520px; margin: 40px auto; padding: 22px; border: 1px solid var(--l); border-radius: 14px; background: var(--card); }
.fae-state p { margin: 0; color: var(--m); font-size: .8rem; }
.fae-skel { display: grid; gap: 12px; padding: 20px; border-radius: 14px; background: var(--card); }
.fae-skel i { display: block; height: 16px; width: 60%; border-radius: 6px; background: #ece9e0; animation: fae-pulse 1.4s ease-in-out infinite; }
.fae-skel i.w { width: 100%; height: 44px; }
.fae-skel i.h { width: 100%; height: 200px; }
@keyframes fae-pulse { 50% { opacity: .45; } }
.fae-confirm { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: rgba(241, 238, 230, .82); }
.fae-confirm[hidden] { display: none; }
.fae-confirm-card { display: grid; gap: 12px; width: min(460px, 100%); padding: 22px; border: 1px solid var(--l); border-radius: 14px; background: var(--card); box-shadow: 0 16px 40px rgba(21, 52, 81, .16); }
.fae-confirm-card h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.fae-confirm-card p { margin: 0; color: #4f6671; font-size: .78rem; line-height: 1.55; }
.fae-dl { display: grid; grid-template-columns: 74px 1fr; gap: 6px 10px; margin: 0 0 10px; font-size: .78rem; }
.fae-dl dd { margin: 0; overflow-wrap: anywhere; }
.fae-mono { font-family: ui-monospace, monospace; font-size: .7rem !important; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .fae-dialog { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .fae-frame { max-height: 100dvh; height: 100%; }
  .fae-head { padding: 13px 14px; }
  .fae-body { padding: 14px; }
  .fae-grid, .fae-meta { grid-template-columns: minmax(0, 1fr); }
  .fae-preview { position: static; }
  .fae-form, .fae-preview { padding: 15px; }
  .fae-mail iframe { height: 340px; }
  .fae-actions .fae-btn { flex: 1 1 auto; min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .fae-dialog * { animation: none !important; transition: none !important; } }
