/* ===== Webmail — layout em 3 cartões, ocupa toda a área útil ===== */
.page.em-page { max-width: none; width: 100%; padding: 18px 22px 22px; }
.em-app {
  display: grid; grid-template-columns: 250px minmax(340px, 420px) minmax(0, 1fr); gap: 16px;
  height: calc(100dvh - 108px); min-height: 520px;
}
.em-app > * { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; box-shadow: var(--shadow); min-width: 0; min-height: 0; overflow: hidden; }

/* Pastas */
.em-folders { padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.em-novo { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--gold-line);
  border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; margin-bottom: 8px; transition: transform .15s, background .15s; }
.em-novo:hover { background: var(--brand-gold); color: var(--brand-charcoal); transform: translateY(-1px); }
.em-btn { background: var(--brand-gold); color: var(--brand-charcoal); border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: filter .15s; }
.em-btn:hover { filter: brightness(1.06); }
.em-btn:disabled { opacity: .6; cursor: wait; }
.em-link { background: none; border: 0; color: var(--muted); font-size: .8rem; text-align: left; padding: 8px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; }
.em-link:hover { color: var(--ink); background: var(--surface-2); }
.em-danger { color: #f87171 !important; }
.em-pasta { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: .88rem; cursor: pointer; color: var(--muted); transition: background .12s, color .12s; }
.em-pasta i { font-size: 1.02rem; }
.em-pasta:hover { background: var(--surface-2); color: var(--ink); }
.em-pasta.on { background: var(--accent-soft); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand-gold); }
.em-pasta .n:not(:empty) { margin-left: auto; font-size: .7rem; font-weight: 700; background: var(--brand-gold); color: var(--brand-charcoal); border-radius: var(--radius-pill); padding: 1px 8px; }
.em-pasta .n:empty { display: none; }
.em-pasta .acts { display: none; margin-left: auto; gap: 8px; }
.em-pasta.custom:hover .acts { display: flex; }
.em-pasta.custom:hover .n { display: none; }
.em-pasta .acts i { font-size: .85rem; }
.em-pasta .acts i:hover { color: var(--ink); }
.em-sep { height: 1px; background: var(--hairline); margin: 8px 6px; }

/* Lista */
.em-list { display: flex; flex-direction: column; }
.em-list-bar { display: flex; gap: 10px; align-items: center; padding: 14px 14px 10px; }
.em-search { position: relative; flex: 1; min-width: 0; }
.em-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }
.em-search input { width: 100%; background: var(--surface-2); color: inherit; border: 1px solid transparent; border-radius: 12px; padding: 10px 12px 10px 36px; font-size: .86rem; outline: none; transition: border-color .15s, background .15s; }
.em-search input:focus { border-color: var(--gold-line); background: var(--bg-sunken, var(--surface-2)); }
.em-chip { font-size: .76rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-pill); padding: 7px 12px; cursor: pointer; white-space: nowrap; user-select: none; }
.em-chip.on { background: var(--accent-soft); color: var(--ink); border-color: var(--gold-line); }
.em-batch { display: flex; align-items: center; gap: 6px; margin: 0 14px 6px; padding: 6px 10px; border-radius: 12px; background: var(--accent-soft); font-size: .78rem; font-weight: 600; }
.em-batch span { margin-right: auto; }
.em-ib { background: transparent; border: 0; color: var(--ink); border-radius: 10px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; transition: background .12s; }
.em-ib:hover { background: var(--surface-2); }
.em-batch .em-ib:hover { background: rgba(255,255,255,.08); }
.em-msgs { flex: 1; overflow-y: auto; padding: 0 8px; }
.em-msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 1px 12px; align-items: center; padding: 11px 10px; margin: 2px 0; border-radius: 14px; cursor: pointer; font-size: .84rem; transition: background .12s; }
.em-msg:hover { background: var(--surface-2); }
.em-msg.on { background: var(--accent-soft); }
.em-av { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: #fff; position: relative; }
.em-av input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.em-av .tick { position: absolute; inset: 0; border-radius: 50%; background: var(--brand-gold); color: var(--brand-charcoal); display: none; align-items: center; justify-content: center; font-size: 1.1rem; }
.em-msg:hover .em-av .tick, .em-av input:checked ~ .tick { display: flex; }
.em-av input:not(:checked) ~ .tick i { opacity: .35; }
.em-msg .de { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.em-msg .as { grid-column: 2 / 4; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-msg .dt { font-size: .72rem; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-self: end; }
.em-msg.unread .de, .em-msg.unread .as { font-weight: 700; color: var(--ink); }
.em-msg.unread::before { content: ''; position: absolute; left: 0; top: 50%; width: 4px; height: 22px; margin-top: -11px; border-radius: 0 4px 4px 0; background: var(--brand-gold); }
.em-msg .flag { color: #fbbf24; }
.em-pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--hairline); font-size: .76rem; color: var(--muted); }
.em-pager button { background: none; border: 0; color: var(--ink); width: 32px; height: 32px; border-radius: 10px; }
.em-pager button:hover:not(:disabled) { background: var(--surface-2); }
.em-pager button:disabled { opacity: .3; }

/* Leitura */
.em-read { display: flex; flex-direction: column; }
.em-empty { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.em-empty i { font-size: 3rem; opacity: .5; }
.em-head { padding: 22px 28px 16px; border-bottom: 1px solid var(--hairline); }
.em-head h3 { font-size: 1.3rem; font-weight: 700; margin: 0 0 14px; line-height: 1.3; }
.em-who { display: flex; align-items: center; gap: 14px; }
.em-who .em-av { width: 46px; height: 46px; }
.em-who .meta { flex: 1; min-width: 0; font-size: .8rem; color: var(--muted); }
.em-who .meta strong { color: var(--ink); font-size: .92rem; }
.em-acts { display: flex; gap: 2px; flex-shrink: 0; }
.em-acts .em-ib { width: 38px; height: 38px; font-size: 1.1rem; }
.em-acts .em-ib.pri { background: var(--accent-soft); }
.em-acts .em-ib.pri:hover { background: var(--brand-gold); color: var(--brand-charcoal); }
.em-corpo-wrap { flex: 1; min-height: 0; padding: 16px 22px 16px; display: flex; flex-direction: column; }
.em-frame { flex: 1; width: 100%; border: 0; background: #fff; border-radius: 14px; min-height: 0; }
.em-aviso { margin: 12px 22px 0; padding: 9px 14px; font-size: .8rem; background: rgba(251,191,36,.1); color: #fcd34d; border-radius: 12px; display: flex; gap: 10px; align-items: center; }
.em-aviso button { background: none; border: 0; color: inherit; text-decoration: underline; font-weight: 600; }
.em-anx { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 22px 16px; }
.em-anx button { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink); border-radius: 12px; padding: 7px 12px; font-size: .78rem; display: inline-flex; gap: 6px; align-items: center; }
.em-anx button:hover { border-color: var(--gold-line); }

/* Configurações da caixa (a tela de conexão está no fim do arquivo) */
.em-cfg label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted); }
.em-cfg textarea, .em-compose > input, .em-ccrow input { background: var(--surface-2); color: inherit; border: 1px solid transparent; border-radius: 12px; padding: 11px 14px; font-size: .88rem; outline: none; }
.em-cfg textarea:focus, .em-compose > input:focus, .em-ccrow input:focus { border-color: var(--gold-line); }
.em-muted { color: var(--muted); font-size: .86rem; margin: 0; }
.em-err { color: #f87171; font-size: .8rem; }
.em-conta { font-size: .8rem; color: var(--muted); margin-right: 6px; }

/* Escrever */
.em-modal { position: fixed; inset: 0; background: rgba(8,12,11,.6); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: flex-end; justify-content: flex-end; padding: 22px; }
.em-modal[hidden] { display: none; }
.em-compose { position: relative; width: min(720px, 100%); max-height: 92vh; background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 10px; padding: 18px; overflow: auto; }
.em-compose header { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.em-compose header button { background: none; border: 0; color: var(--muted); width: 34px; height: 34px; border-radius: 10px; }
.em-compose header button:hover { background: var(--surface-2); color: var(--ink); }
.em-ccrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.em-tools { display: flex; gap: 4px; }
.em-tools button { background: transparent; border: 0; color: var(--muted); border-radius: 10px; width: 34px; height: 32px; }
.em-tools button:hover { background: var(--surface-2); color: var(--ink); }
.em-corpo { min-height: 220px; max-height: 42vh; overflow: auto; background: var(--surface-2); border-radius: 14px; padding: 14px 16px; font-size: .9rem; outline: none; border: 1px solid transparent; }
.em-corpo:focus { border-color: var(--gold-line); }
.em-compose footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.em-anexos { font-size: .76rem; color: var(--muted); }

@media (max-width: 1280px) { .em-app { grid-template-columns: 220px minmax(300px, 380px) minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .em-app { grid-template-columns: 1fr; height: auto; }
  .em-folders { flex-direction: row; flex-wrap: wrap; }
  .em-msgs { max-height: 50vh; }
  .em-read { min-height: 70vh; }
  .em-who { flex-wrap: wrap; }
}

/* Diálogos, avisos e detalhes */
.em-pararow { display: flex; gap: 8px; align-items: center; }
.em-pararow input { flex: 1; background: var(--surface-2); color: inherit; border: 1px solid transparent; border-radius: 12px; padding: 11px 14px; font-size: .88rem; outline: none; }
.em-pararow input:focus { border-color: var(--gold-line); }
.em-modal.em-center { align-items: center; justify-content: center; z-index: 3000; }
.em-dialog { width: min(420px, 92vw); background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; }
.em-dialog h4 { margin: 0; font-size: 1.05rem; }
.em-dialog p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.em-dialog input { background: var(--surface-2); color: inherit; border: 1px solid var(--gold-line); border-radius: 12px; padding: 11px 14px; font-size: .9rem; outline: none; }
.em-dlg-b { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.em-dbtn { background: var(--surface-2); color: var(--ink); border: 1px solid var(--hairline); border-radius: 12px; padding: 9px 16px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.em-dbtn:hover { border-color: var(--gold-line); }
.em-dbtn.pri { background: var(--brand-gold); color: var(--brand-charcoal); border-color: transparent; }
.em-dbtn.perigo { background: #b4413a; color: #fff; border-color: transparent; }
.em-pick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.em-pick button { display: flex; gap: 12px; align-items: center; background: none; border: 0; color: var(--ink); text-align: left; padding: 10px 12px; border-radius: 12px; font-size: .88rem; }
.em-pick button:hover { background: var(--accent-soft); }
.em-toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.em-toast { background: var(--brand-charcoal-3, #2e3a37); color: #f1efe0; border: 1px solid var(--gold-line); border-radius: 14px; padding: 11px 18px; font-size: .86rem; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); animation: em-in .2s ease; max-width: min(560px, 92vw); }
.em-toast.erro { border-color: #b4413a; background: #3a2422; }
.em-toast.aviso { border-color: #fbbf24; }
@keyframes em-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* anexos: chips, arrastar e soltar, aviso de anexo esquecido */
.em-anexos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.em-anexos:empty { display: none; }
.em-anexo { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: .78rem; color: var(--ink); }
.em-anexo > i { color: var(--muted); }
.em-anexo button { background: none; border: 0; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.em-anexo button:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.em-nota { width: 100%; }
.em-drop { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--gold-line); border-radius: 22px; background: rgba(20,28,26,.88); color: var(--ink); font-size: 1rem; pointer-events: none; }
.em-drop i { font-size: 2.4rem; color: var(--gold-line); }
.em-drop[hidden] { display: none; }
.em-compose .em-aviso { display: flex; align-items: center; gap: 10px; background: rgba(214,178,82,.12); border: 1px solid var(--gold-line); border-radius: 12px; padding: 9px 12px; font-size: .8rem; }
.em-compose .em-aviso[hidden] { display: none; }
.em-compose .em-aviso > i { color: var(--gold-line); }
.em-compose .em-aviso span { flex: 1; }
.em-compose .em-aviso button { background: none; border: 0; color: var(--ink); border-radius: 8px; padding: 4px 10px; font-size: .78rem; }
.em-compose .em-aviso button:first-of-type { border: 1px solid var(--gold-line); }
.em-compose .em-aviso button:hover { background: rgba(255,255,255,.08); }

/* completar destinatários */
.em-sug { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.6); padding: 4px; overflow: hidden; }
.em-sug[hidden] { display: none; }
.em-sug div { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; font-size: .82rem; cursor: pointer; }
.em-sug div small { color: var(--muted); font-size: .72rem; }
.em-sug div.on, .em-sug div:hover { background: var(--surface-2); }
.em-sug footer { color: var(--muted); font-size: .68rem; padding: 4px 10px 2px; display: block; }

/* enviar depois + lista de agendados */
.em-pasta .n.erro:not(:empty) { background: #b4413a; color: #fff; }
.em-quando { width: min(440px, 94vw); }
.em-quando .em-pick button { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.em-quando .em-pick button small { color: var(--muted); font-size: .74rem; }
.em-qcustom { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; border-top: 1px solid var(--hairline); padding-top: 12px; }
.em-qcustom label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--muted); }
.em-qcustom input { padding: 9px 10px; border-color: var(--hairline); color-scheme: dark; }
.em-qerr { color: #f08a82; font-size: .78rem; min-height: 1em; }
.em-ag { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.em-ag h3 { margin: 0; font-size: 1.15rem; }
.em-ag .quando { display: flex; align-items: center; gap: 10px; background: rgba(214,178,82,.12); border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 14px; font-size: .86rem; }
.em-ag .quando.erro { background: rgba(180,65,58,.14); border-color: #b4413a; }
.em-ag dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 0; font-size: .84rem; }
.em-ag dt { color: var(--muted); }
.em-ag dd { margin: 0; word-break: break-word; }
.em-ag .texto { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; font-size: .86rem; line-height: 1.55; white-space: pre-wrap; max-height: 40vh; overflow: auto; }
.em-ag .acoes { display: flex; gap: 10px; align-items: center; }

/* marcar reunião */
.em-reu { width: min(460px, 94vw); }
.em-reu label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--muted); }
.em-reu input, .em-reu select { background: var(--surface-2); color: inherit; border: 1px solid var(--hairline); border-radius: 12px; padding: 9px 12px; font-size: .88rem; outline: none; color-scheme: dark; }
.em-reu input:focus, .em-reu select:focus { border-color: var(--gold-line); }
.em-reu .grade { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.em-reu .convid { font-size: .8rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 9px 12px; word-break: break-word; }
.em-reu .convid b { color: var(--ink); font-weight: 600; }
.em-reu .marca { flex-direction: row; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink); }
.em-reu .marca input { accent-color: var(--brand-gold); padding: 0; width: 16px; height: 16px; }


/* =====================================================================
   Animações e carregamento
   ===================================================================== */
@keyframes em-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes em-spin { to { transform: rotate(360deg); } }
@keyframes em-card { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes em-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-fade-out { to { opacity: 0; } }
@keyframes em-row { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes em-pop { 0% { opacity: 0; transform: scale(.92) translateY(10px); } 60% { transform: scale(1.015); } 100% { opacity: 1; transform: none; } }
@keyframes em-pop-out { to { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes em-sobe { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes em-desce { to { opacity: 0; transform: translateY(20px) scale(.98); } }
@keyframes em-sai-linha { from { opacity: 1; max-height: 96px; } 60% { opacity: 0; transform: translateX(-28px); max-height: 96px; } to { opacity: 0; transform: translateX(-28px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes em-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes em-float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(14px, -18px) scale(1.08); } }
@keyframes em-ring { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes em-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes em-menu { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* esqueleto: usado enquanto a caixa carrega */
.sk, .em-sk-rows i, .em-skrow .sk { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 30%, rgba(128,128,128,.16) 45%, var(--surface-2) 60%); background-size: 300% 100%; animation: em-shimmer 1.4s linear infinite; }
.em-boot { display: grid; grid-template-columns: 250px minmax(340px, 420px) minmax(0, 1fr); gap: 16px; height: calc(100dvh - 108px); min-height: 520px; }
.em-boot[hidden] { display: none; }
.em-sk-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.sk-btn { height: 44px; border-radius: 14px; margin-bottom: 8px; }
.sk-line { height: 36px; }
.sk-bar { height: 40px; border-radius: 12px; }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; }
.em-sk-rows { display: flex; flex-direction: column; gap: 10px; }
.em-sk-rows i { height: 58px; border-radius: 14px; }
.em-skrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 46px; gap: 8px 12px; align-items: center; padding: 11px 10px; margin: 2px 0; }
.em-skrow .a { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 50%; }
.em-skrow .l1 { height: 11px; width: 62%; }
.em-skrow .l2 { grid-column: 2 / 4; height: 10px; width: 88%; }
.em-skrow .l3 { height: 9px; }
.em-skrow:nth-child(3n) .l1 { width: 48%; } .em-skrow:nth-child(3n+1) .l2 { width: 72%; }
.em-skread { padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; animation: em-fade .2s both; }
.em-skread .t { height: 22px; width: 62%; }
.em-skread .q { display: flex; gap: 14px; align-items: center; }
.em-skread .q .a { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.em-skread .q .m { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.em-skread .q .m .sk { height: 10px; }
.em-skread .c { height: 12px; }
.em-sk-read .em-empty { opacity: .5; }

/* entrada da tela */
.em-app:not([hidden]) > * { animation: em-card .5s cubic-bezier(.2, .7, .2, 1) both; }
.em-app:not([hidden]) > :nth-child(2) { animation-delay: .06s; }
.em-app:not([hidden]) > :nth-child(3) { animation-delay: .12s; }
.em-msgs.stagger .em-msg, .em-msgs.stagger .em-empty { animation: em-row .38s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 24ms); }
.em-msg.saindo { animation: em-sai-linha .3s ease forwards; overflow: hidden; pointer-events: none; }
.em-read > .em-head, .em-read > .em-corpo-wrap, .em-read > .em-anx, .em-read > .em-ag, .em-read > .em-aviso { animation: em-fade .28s ease both; }
.em-read > .em-corpo-wrap { animation-delay: .05s; }
.em-read > .em-empty { animation: em-fade .3s ease both; }
.em-empty i { transition: transform .3s; }
.em-msg { transition: background .15s, transform .15s; }
.em-msg:active { transform: scale(.992); }
.em-pasta { position: relative; }
.em-pasta:active { transform: scale(.98); }
#emAtualizar.girando i { animation: em-spin .8s linear infinite; }

/* botões com carregamento */
.em-btn { position: relative; transition: filter .15s, transform .15s, background .25s; }
.em-btn:active:not(:disabled) { transform: scale(.97); }
.em-btn .spin { display: none; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: em-spin .7s linear infinite; }
.em-btn .ok { display: none; }
.em-btn.carregando { pointer-events: none; opacity: .85; }
.em-btn.carregando .spin { display: inline-block; }
.em-btn.carregando > i:not(.ok) { display: none; }

/* janelas: escrever, configurações, diálogos */
.em-modal:not([hidden]) { animation: em-fade .2s ease both; }
.em-modal:not([hidden]) > .em-compose { animation: em-sobe .32s cubic-bezier(.2, .8, .2, 1) both; }
.em-modal.em-center:not([hidden]) > .em-dialog, .em-modal.em-center > .em-dialog { animation: em-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
.em-modal.fechando { animation: em-fade-out .18s ease forwards !important; pointer-events: none; }
.em-modal.fechando > .em-compose { animation: em-desce .18s ease forwards !important; }
.em-modal.fechando > .em-dialog { animation: em-pop-out .16s ease forwards !important; }
.em-modal.fechando.voando > .em-compose { animation: em-voou .5s cubic-bezier(.5, 0, .9, .4) forwards !important; }
@keyframes em-voou { 0% { opacity: 1; transform: none; } 35% { transform: translate(-6px, 8px) scale(.98); } 100% { opacity: 0; transform: translate(60px, -120px) scale(.55) rotate(3deg); } }
.em-modal.fechando.voando { animation: em-fade-out .5s ease .1s forwards !important; }
.em-anexo { animation: em-pop .22s ease both; }
.em-sug:not([hidden]) { animation: em-menu .14s ease both; }
.em-dialog .em-pick button { transition: background .12s, transform .12s; }
.em-dialog .em-pick button:hover { transform: translateX(3px); }
.em-dbtn { transition: border-color .15s, transform .15s, filter .15s; }
.em-dbtn:active { transform: scale(.97); }

/* aviso (toast) com ícone e barra de tempo */
.em-toast { position: relative; display: flex; align-items: center; gap: 10px; overflow: hidden; animation: em-pop .28s cubic-bezier(.2, .8, .2, 1) both; padding-right: 20px; }
.em-toast > i { font-size: 1.1rem; color: #7bd3a2; flex: none; }
.em-toast.erro > i { color: #f08a82; }
.em-toast.aviso > i { color: #fbbf24; }
.em-toast::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .35; transform-origin: left; animation: em-timer var(--dur, 4s) linear forwards; }
.em-toast.saindo { animation: em-pop-out .2s ease forwards; }

/* animação de envio: o avião sai da janela e vira um "ok" */
.em-voo { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; pointer-events: none; animation: em-voo-bg 1.7s ease forwards; }
@keyframes em-voo-bg { 0% { background: rgba(8,12,11,0); } 15%, 75% { background: rgba(8,12,11,.45); } 100% { background: rgba(8,12,11,0); } }
.em-voo-c { position: relative; width: 104px; height: 104px; border-radius: 50%; background: var(--brand-gold); color: var(--brand-charcoal); display: grid; place-items: center; font-size: 2.6rem; box-shadow: 0 20px 60px -12px rgba(0,0,0,.55); animation: em-voo-c 1.7s cubic-bezier(.2, .8, .2, 1) forwards; }
.em-voo-c::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand-gold); animation: em-ring .9s ease-out .55s both; }
.em-voo-c i { position: absolute; }
.em-voo-c .plane { animation: em-voo-plane .95s cubic-bezier(.5, 0, .9, .5) .15s both; }
.em-voo-c .check { opacity: 0; animation: em-voo-check .45s cubic-bezier(.2, 1.4, .4, 1) .62s forwards; }
.em-voo-t { color: #f1efe0; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; text-shadow: 0 2px 12px rgba(0,0,0,.5); opacity: 0; animation: em-voo-t 1.7s ease forwards; }
@keyframes em-voo-c { 0% { opacity: 0; transform: scale(.5); } 18% { opacity: 1; transform: scale(1.04); } 26% { transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.9) translateY(-12px); } }
@keyframes em-voo-plane { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); } 40% { opacity: 1; transform: translate(-6px, 8px) rotate(-8deg) scale(.95); } 100% { opacity: 0; transform: translate(150px, -170px) rotate(18deg) scale(.5); } }
@keyframes em-voo-check { from { opacity: 0; transform: scale(.2) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes em-voo-t { 0%, 40% { opacity: 0; transform: translateY(8px); } 55%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* seletor de caixa (várias contas) */
.em-acc { position: relative; margin-bottom: 8px; }
.em-acc-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.em-acc-btn:hover, .em-acc-btn[aria-expanded="true"] { border-color: var(--gold-line); }
.em-acc-btn > i { color: var(--muted); font-size: .9rem; transition: transform .2s; }
.em-acc-btn[aria-expanded="true"] > i { transform: rotate(180deg); }
.em-acc-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .78rem; flex: none; position: relative; }
.em-acc-av .pt { position: absolute; right: -2px; top: -2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: var(--brand-gold); color: var(--brand-charcoal); font-size: .6rem; line-height: 15px; font-weight: 800; text-align: center; border: 2px solid var(--surface-2); box-sizing: content-box; }
.em-acc-tx { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.em-acc-tx b { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-acc-tx small { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-acc-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: 0 22px 50px -14px rgba(0,0,0,.55); padding: 6px; animation: em-menu .18s cubic-bezier(.2, .8, .2, 1) both; }
.em-acc-menu[hidden] { display: none; }
.em-acc-it { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.em-acc-it:hover { background: var(--surface-2); }
.em-acc-it.on { background: var(--accent-soft); }
.em-acc-it .em-acc-av { width: 30px; height: 30px; font-size: .7rem; }
.em-acc-it .em-acc-tx small { max-width: 100%; }
.em-acc-it .n { font-size: .68rem; font-weight: 800; background: var(--brand-gold); color: var(--brand-charcoal); border-radius: 99px; padding: 1px 7px; }
.em-acc-it .n.erro { background: #b4413a; color: #fff; }
.em-acc-it > .bi-check2 { color: var(--accent-strong); }
.em-acc-sep { height: 1px; background: var(--hairline); margin: 5px 4px; }
.em-acc-act { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--ink); padding: 9px 10px; border-radius: 11px; font-size: .82rem; cursor: pointer; text-align: left; }
.em-acc-act:hover { background: var(--surface-2); }
.em-acc-act i { color: var(--muted); }
.em-derow { display: flex; align-items: center; gap: 10px; }
.em-derow[hidden] { display: none; }
.em-derow label { font-size: .78rem; color: var(--muted); width: 28px; }
.em-derow select { flex: 1; background: var(--surface-2); color: inherit; border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; font-size: .86rem; outline: none; color-scheme: dark; }
.em-derow select:focus { border-color: var(--gold-line); }
.em-derow select:disabled { opacity: .7; }
.em-cfg-conta { flex: 1; margin: 0 10px; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tela de conexão da caixa */
.em-setup-wrap { display: flex; justify-content: center; padding: 5vh 12px; animation: em-card .55s cubic-bezier(.2, .7, .2, 1) both; }
.em-setup-wrap[hidden] { display: none; }
.em-setup-wrap.modal { position: fixed; inset: 0; z-index: 2500; align-items: center; padding: 20px; background: rgba(8,12,11,.62); backdrop-filter: blur(4px); animation: em-fade .2s ease both; }
.em-setup-wrap.modal.fechando { animation: em-fade-out .18s ease forwards; }
.em-setup { position: relative; width: min(880px, 100%); display: grid; grid-template-columns: 1fr 1.05fr; background: var(--surface); border: 1px solid var(--hairline); border-radius: 26px; box-shadow: 0 30px 80px -24px rgba(0,0,0,.5); overflow: hidden; }
.em-setup.shake { animation: em-shake .42s ease; }
.em-setup-x { position: absolute; right: 12px; top: 12px; z-index: 5; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.em-setup-x:hover { background: var(--surface-2); color: var(--ink); }
.em-setup-x[hidden] { display: none; }
.em-setup-hero { position: relative; overflow: hidden; padding: 40px 34px; color: #ece8d2; background: linear-gradient(155deg, #2b3a36 0%, #1b2523 60%, #171f1d 100%); display: flex; flex-direction: column; justify-content: center; gap: 22px; min-height: 420px; }
.em-orb { position: absolute; border-radius: 50%; filter: blur(34px); opacity: .55; animation: em-float 9s ease-in-out infinite; }
.em-orb.o1 { width: 220px; height: 220px; background: rgba(207,203,150,.35); left: -70px; top: -60px; }
.em-orb.o2 { width: 180px; height: 180px; background: rgba(74,127,196,.28); right: -60px; bottom: 30px; animation-delay: -3s; }
.em-orb.o3 { width: 120px; height: 120px; background: rgba(59,143,127,.35); left: 40%; bottom: -40px; animation-delay: -6s; }
.em-hero-ic { position: relative; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem; color: var(--brand-charcoal); background: var(--brand-gold); box-shadow: 0 14px 34px -10px rgba(207,203,150,.5); z-index: 1; }
.em-hero-ic::after { content: ''; position: absolute; inset: 0; border-radius: 20px; border: 2px solid var(--brand-gold); animation: em-ring 2.4s ease-out infinite; }
.em-setup-hero h2 { position: relative; z-index: 1; margin: 0; font-size: 1.5rem; line-height: 1.2; font-weight: 700; }
.em-hero-list { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.em-hero-list li { display: flex; align-items: center; gap: 12px; font-size: .88rem; opacity: 0; animation: em-row .5s cubic-bezier(.2, .7, .2, 1) forwards; }
.em-hero-list li:nth-child(1) { animation-delay: .25s; } .em-hero-list li:nth-child(2) { animation-delay: .35s; } .em-hero-list li:nth-child(3) { animation-delay: .45s; } .em-hero-list li:nth-child(4) { animation-delay: .55s; }
.em-hero-list li i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--brand-gold); flex: none; }
.em-setup-form { padding: 40px 36px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.em-setup-form h3 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.em-field { position: relative; }
.em-field input { width: 100%; background: var(--surface-2); color: inherit; border: 1.5px solid transparent; border-radius: 14px; padding: 22px 44px 8px 15px; font-size: .92rem; outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.em-field input:focus { border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.em-field input:-webkit-autofill, .em-field input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 100px var(--surface-2) inset; transition: background-color 9999s ease-out; border-radius: 14px; }
.em-field label { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: .88rem; color: var(--muted); pointer-events: none; transition: top .15s, transform .15s, font-size .15s, color .15s; }
.em-field input:focus + label, .em-field input:not(:placeholder-shown) + label { top: 10px; transform: none; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-strong); }
.em-field > i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.em-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.em-eye:hover { background: var(--surface); color: var(--ink); }
.em-setup .em-err { min-height: 1.1em; transition: opacity .2s; }
.em-btn-lg { width: 100%; justify-content: center; padding: 14px 18px; font-size: .92rem; border-radius: 14px; }
.em-btn-lg.sucesso { background: #5fb98a; color: #0f2a1d; pointer-events: none; }
.em-btn-lg.sucesso .ok { display: inline-block; animation: em-voo-check .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.em-btn-lg.sucesso .spin { display: none; }
.em-seguro { display: flex; gap: 10px; align-items: flex-start; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.em-seguro i { color: var(--accent-strong); margin-top: 1px; }
@media (max-width: 760px) {
  .em-setup { grid-template-columns: 1fr; }
  .em-setup-hero { min-height: 0; padding: 26px 24px; }
  .em-hero-list { display: none; }
  .em-setup-form { padding: 26px 22px; }
  .em-boot { grid-template-columns: 1fr; height: auto; }
  .em-boot .em-sk-card:not(:nth-child(2)) { display: none; }
}
@media (max-width: 1000px) and (min-width: 761px) { .em-boot { grid-template-columns: 1fr; height: auto; } .em-boot .em-sk-card:not(:nth-child(2)) { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .em-app > *, .em-msgs.stagger .em-msg, .em-modal, .em-modal > *, .em-toast, .em-voo, .em-voo *, .em-setup-wrap, .em-hero-list li, .em-orb, .em-hero-ic::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .sk, .em-sk-rows i, .em-skrow .sk { animation: none; }
}

.em-acc-av .pt.novo { animation: em-pt .6s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes em-pt { 0% { transform: scale(.2); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.em-acc-av .pt::after { content: ''; position: absolute; inset: -2px; border-radius: 99px; border: 2px solid var(--brand-gold); opacity: 0; animation: em-ring 2.2s ease-out infinite; }


/* =====================================================================
   Etiquetas coloridas e menu de clique direito
   ===================================================================== */
.em-tags-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 0 12px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.em-tags-h .em-ib { width: 28px; height: 28px; font-size: .85rem; color: var(--muted); }
.em-tg-pasta .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.em-tg-pasta span:not(.dot):not(.n) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-tg-vazio { font-size: .76rem; color: var(--muted); padding: 4px 12px 8px; line-height: 1.4; }

/* chip da etiqueta (lista, leitura, menu) */
.em-tg { display: inline-flex; align-items: center; gap: 4px; max-width: 120px; padding: 1px 8px; border-radius: 99px; font-size: .66rem; font-weight: 700; line-height: 1.5; color: color-mix(in srgb, var(--c) 55%, var(--ink)); background: color-mix(in srgb, var(--c) 20%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: em-pop .22s ease both; }
.em-tg.mais { color: var(--muted); background: var(--surface-2); border-color: transparent; }
.em-tg button { background: none; border: 0; padding: 0; margin: 0 -3px 0 0; width: 16px; height: 16px; border-radius: 50%; color: inherit; display: grid; place-items: center; cursor: pointer; font-size: .8rem; }
.em-tg button:hover { background: color-mix(in srgb, var(--c) 35%, transparent); }
.em-msg .as { display: flex; gap: 6px; align-items: center; }
.em-msg .as .tgs { display: flex; gap: 4px; flex: none; }
.em-msg .as .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-msg.tg { background: color-mix(in srgb, var(--tc) 11%, transparent); box-shadow: inset -3px 0 0 var(--tc); }
.em-msg.tg:hover { background: color-mix(in srgb, var(--tc) 18%, var(--surface-2)); }
.em-msg.tg.on { background: color-mix(in srgb, var(--tc) 22%, transparent); }
.em-msg.ctx { outline: 1.5px solid var(--gold-line); outline-offset: -1.5px; }
.em-rtags { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.em-rtags:empty { display: none; }
.em-rtags .em-tg { font-size: .72rem; padding: 2px 6px 2px 10px; }

/* menu de clique direito / seletor de etiquetas */
.em-ctx { position: fixed; z-index: 3500; min-width: 230px; max-width: 290px; max-height: calc(100dvh - 16px); overflow: auto; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.6); padding: 6px; animation: em-menu .14s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top left; }
.em-ctx[hidden] { display: none; }
.em-ctx-h { padding: 6px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.em-ctx-i { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; color: var(--ink); text-align: left; padding: 8px 10px; border-radius: 9px; font-size: .84rem; cursor: pointer; transition: background .1s; }
.em-ctx-i:hover, .em-ctx-i:focus-visible { background: var(--surface-2); outline: none; }
.em-ctx-i > i { width: 16px; text-align: center; color: var(--muted); font-size: .95rem; flex: none; }
.em-ctx-i .sw { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; margin: 0 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 24%, transparent); }
.em-ctx-i .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-ctx-i .ck { color: var(--accent-strong); margin-left: auto; font-size: .95rem; }
.em-ctx-i.perigo, .em-ctx-i.perigo > i { color: #f08a82; }
.em-ctx-sep { height: 1px; background: var(--hairline); margin: 5px 4px; }
.em-ctx-vazio { padding: 6px 12px 8px; font-size: .78rem; color: var(--muted); }

/* gerenciar etiquetas */
.em-tagmgr { width: min(440px, 94vw); }
.em-tg-lista { display: flex; flex-direction: column; gap: 2px; max-height: 44vh; overflow: auto; }
.em-tg-lin { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 11px; }
.em-tg-lin:hover { background: var(--surface-2); }
.em-tg-lin .sw { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.em-tg-lin .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.em-tg-lin .em-ib { width: 30px; height: 30px; font-size: .9rem; color: var(--muted); }
.em-tg-lin .em-ib:hover { color: var(--ink); }
.em-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.em-swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; display: grid; place-items: center; color: #fff; font-size: .9rem; transition: transform .12s, border-color .12s; }
.em-swatches button:hover { transform: scale(1.12); }
.em-swatches button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.em-swatches button i { opacity: 0; }
.em-swatches button.on i { opacity: 1; }


/* Janela de escrever: maior, com o corpo ocupando a altura; botão de expandir */
#emCompose { padding: 22px 28px; }
#emCompose .em-compose { width: min(940px, 100%); height: min(90dvh, 860px); max-height: none; padding: 22px 24px 20px; gap: 12px; overflow: hidden; transition: width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1); }
#emCompose .em-compose.max { width: min(1320px, 100%); height: calc(100dvh - 44px); }
#emCompose .em-compose header { font-size: 1.08rem; }
.em-hbtns { display: flex; gap: 2px; }
#emCompose .em-corpo { flex: 1 1 auto; min-height: 220px; max-height: none; font-size: .96rem; line-height: 1.6; padding: 18px 20px; }
#emCompose .em-compose > input, #emCompose .em-pararow input { padding: 13px 16px; font-size: .94rem; }
#emCompose .em-compose footer { flex: none; padding-top: 4px; }
#emCompose .em-anexos, #emCompose .em-aviso, #emCompose .em-tools, #emCompose .em-pararow, #emCompose .em-derow, #emCompose .em-ccrow { flex: none; }
@media (max-width: 760px) { #emCompose { padding: 0; align-items: stretch; } #emCompose .em-compose, #emCompose .em-compose.max { width: 100%; height: 100dvh; border-radius: 0; } }


/* Prévia de anexo */
.em-anx button .dl { margin-left: 6px; padding: 3px; border-radius: 6px; color: var(--muted); font-size: .8rem; }
.em-anx button .dl:hover { background: var(--accent-soft); color: var(--ink); }
.em-prev { background: rgba(6,9,8,.78); backdrop-filter: blur(5px); }
.em-previa { position: relative; width: min(1120px, 96vw); height: min(90dvh, 940px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; box-shadow: 0 40px 100px -24px rgba(0,0,0,.75); display: grid; grid-template-rows: auto 1fr; overflow: hidden; animation: em-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
.em-modal.fechando > .em-previa { animation: em-pop-out .16s ease forwards !important; }
.em-previa header { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.em-previa header .ic { font-size: 1.5rem; color: var(--accent-strong); flex: none; }
.em-previa .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.em-previa .tt b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-previa .tt small { color: var(--muted); font-size: .76rem; }
.em-previa .ac { display: flex; align-items: center; gap: 8px; }
.em-previa .ac .em-dbtn { display: inline-flex; align-items: center; gap: 8px; }
.em-previa .ac .x { background: none; border: 0; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.em-previa .ac .x:hover { background: var(--surface-2); color: var(--ink); }
.pv-corpo { position: relative; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; background: rgba(0,0,0,.28); }
.pv-corpo img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; animation: em-fade .25s ease both; }
.pv-corpo.zoom { place-items: start center; }
.pv-corpo.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.pv-corpo.pdf { background: #fff; }
.pv-corpo iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-corpo video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.pv-corpo.audio { padding: 40px; }
.pv-corpo pre { width: 100%; margin: 0; padding: 22px 26px; align-self: start; white-space: pre-wrap; word-break: break-word; font: .82rem/1.6 var(--font-mono, ui-monospace, monospace); color: var(--ink); animation: em-fade .2s ease both; }
.pv-sem { text-align: center; padding: 30px; color: var(--muted); max-width: 420px; }
.pv-sem i { font-size: 4rem; opacity: .55; }
.pv-sem b { display: block; color: var(--ink); margin: 10px 0 6px; word-break: break-word; }
.pv-sem p { margin: 0; font-size: .86rem; line-height: 1.5; }
.pv-carrega { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: .84rem; }
.pv-carrega .spin { width: 30px; height: 30px; border: 3px solid var(--hairline); border-top-color: var(--brand-gold); border-radius: 50%; animation: em-spin .8s linear infinite; }
.pv-nav { position: absolute; top: 50%; z-index: 3; width: 46px; height: 46px; margin-top: 16px; border-radius: 50%; border: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 8px 24px -8px rgba(0,0,0,.6); transition: transform .15s, background .15s; }
.pv-nav:hover { background: var(--brand-gold); color: var(--brand-charcoal); transform: scale(1.08); }
.pv-nav.ant { left: 16px; } .pv-nav.prox { right: 16px; }
@media (max-width: 760px) { .em-previa { width: 100vw; height: 100dvh; border-radius: 0; } }


/* Assinatura */
.em-sg { display: flex; flex-direction: column; gap: 10px; }
.em-sg-top { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; }
.em-sg-tools { margin: 0; }
.em-sg-ed { min-height: 150px; max-height: 38vh; overflow: auto; background: #fff; color: #222; border-radius: 12px; padding: 16px 18px; font-size: 13px; outline: none; border: 1px solid transparent; }
.em-sg-ed:focus { border-color: var(--gold-line); }
.em-sg-ed:empty::before { content: attr(data-ph); color: #999; }
.em-sg-ed img { max-width: 100%; height: auto; }
.em-chk { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--ink) !important; font-size: .84rem !important; cursor: pointer; }
.em-chk input { accent-color: var(--brand-gold); width: 16px; height: 16px; }
.em-sg-dica { color: var(--muted); font-size: .76rem; }
#emCfgModal .em-cfg { width: min(640px, 100%); }

/* No editor (fundo escuro) a assinatura aparece num cartão branco, como o destinatário a verá */
#emCorpo [data-assin] { background: #fff; color: #333; border-radius: 10px; padding: 12px 16px; display: inline-block; max-width: 100%; margin: 4px 0; }
#emCorpo [data-assin] a { color: #1a5fb4; }


/* Criador de assinatura */
.em-sgb { width: min(1040px, 96vw); max-height: 92dvh; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; box-shadow: 0 40px 100px -24px rgba(0,0,0,.75); display: flex; flex-direction: column; overflow: hidden; animation: em-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
.em-modal.fechando > .em-sgb { animation: em-pop-out .16s ease forwards !important; }
.em-sgb header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.em-sgb header .x { background: none; border: 0; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.em-sgb header .x:hover { background: var(--surface-2); color: var(--ink); }
.sgb-corpo { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; padding: 20px; overflow: auto; }
.sgb-form { display: flex; flex-direction: column; gap: 12px; }
.sgb-form label { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--muted); }
.sgb-form input[type=text] { background: var(--surface-2); color: var(--ink); border: 1px solid transparent; border-radius: 12px; padding: 11px 14px; font-size: .9rem; outline: none; }
.sgb-form input[type=text]:focus { border-color: var(--gold-line); }
.sgb-foto { display: flex; gap: 14px; align-items: flex-end; }
.sgb-foto canvas { width: 120px; height: 129px; flex: none; border: 1px dashed var(--hairline); border-radius: 17px; background: var(--surface-2); touch-action: none; cursor: default; }
.sgb-foto canvas.arr { cursor: grabbing; }
.sgb-foto-ctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sgb-foto-ctl small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.sgb-zoom { flex-direction: row !important; align-items: center; gap: 8px !important; }
.sgb-zoom input { width: 100%; accent-color: var(--brand-gold); }
.sgb-prev { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sgb-prev-t { font-size: .78rem; color: var(--muted); }
.sgb-prev-c { background: #fff; border-radius: 12px; padding: 18px; overflow: auto; display: flex; align-items: flex-start; justify-content: center; min-height: 240px; }
.em-sgb footer { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--hairline); }
.em-sgb footer .em-err { margin-right: auto; }
@media (max-width: 860px) { .sgb-corpo { grid-template-columns: 1fr; } }

.sgb-prev-c canvas { width: 100%; max-width: 600px; height: auto; display: block; }

.em-sg-acoes { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; }
