.im-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 8, 12, 0);
    transition: background .5s cubic-bezier(.16, 1, .3, 1);
}
.im-overlay.is-open { background: rgba(8, 8, 12, .6); }
.im-sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border-radius: 20px;
    border: 1px solid var(--border, #ececec);
    background: var(--surface, #fff);
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .5);
    opacity: 0;
    transform: translateY(22px) scale(.98);
    transition: opacity .55s cubic-bezier(.16, 1, .3, 1), transform .65s cubic-bezier(.16, 1, .3, 1);
}
.im-overlay.is-open .im-sheet { opacity: 1; transform: none; }
.im-corpo { display: flex; flex-direction: column; gap: 12px; padding: 26px 24px 22px; }
.im-ico {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(224, 31, 31, .1);
    color: #e01f1f;
}
.im-ico svg { width: 24px; height: 24px; }
.im-titulo { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text, #1a1a1a); }
.im-sub { margin: 0 0 4px; font-size: 13.5px; line-height: 1.5; color: var(--muted, #666); }
.im-campo { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.im-rotulo { font-size: 12.5px; font-weight: 800; color: var(--text, #1a1a1a); }
.im-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border, #e4e4e7);
    background: var(--surface-2, #f6f6f7);
    color: var(--text, #161616);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s cubic-bezier(.16, 1, .3, 1), background .4s cubic-bezier(.16, 1, .3, 1);
}
.im-input:focus { border-color: #e01f1f; box-shadow: 0 0 0 4px rgba(224, 31, 31, .12); background: var(--surface, #fff); }
.im-input-cupom { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.im-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.im-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border, #e4e4e7);
    background: transparent;
    color: var(--text, #1a1a1a);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
    transition: border-color .4s cubic-bezier(.16, 1, .3, 1), background .4s cubic-bezier(.16, 1, .3, 1), color .4s cubic-bezier(.16, 1, .3, 1);
}
.im-chip:hover { border-color: #e01f1f; }
.im-chip.is-ativo { border-color: #e01f1f; background: rgba(224, 31, 31, .1); color: #e01f1f; }
.im-previa { display: flex; align-items: center; gap: 12px; min-height: 0; transition: min-height .4s cubic-bezier(.16, 1, .3, 1); }
.im-previa.is-vazio { display: none; }
.im-previa.is-ok,
.im-previa.is-carregando {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border, #e4e4e7);
    background: var(--surface-2, #f6f6f7);
    animation: im-entra .5s cubic-bezier(.16, 1, .3, 1);
}
.im-previa-foto { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: rgba(127, 127, 140, .2); }
.im-previa-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.im-previa-txt strong { font-size: 14px; font-weight: 800; color: var(--text, #1a1a1a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-previa-txt small { font-size: 11.5px; color: var(--muted, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-previa-ok { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #16a34a; color: #fff; }
.im-previa-ok svg { width: 14px; height: 14px; }
.im-previa-aviso { font-size: 12.5px; font-weight: 700; color: #b45309; }
.im-skel { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(127,127,140,.15) 25%, rgba(127,127,140,.28) 37%, rgba(127,127,140,.15) 63%); background-size: 400% 100%; animation: im-brilho 1.4s ease infinite; }
.im-skel-linha { height: 11px; width: 70%; }
.im-skel-linha.curta { width: 45%; }
.im-erro { font-size: 12.5px; font-weight: 700; line-height: 1.45; color: #dc2626; }
.im-erro[hidden] { display: none; }
.im-botao {
    margin-top: 6px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: #e01f1f;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background .4s cubic-bezier(.16, 1, .3, 1), opacity .4s cubic-bezier(.16, 1, .3, 1), transform .4s cubic-bezier(.16, 1, .3, 1);
}
.im-botao:hover:not(:disabled) { background: #c81a1a; transform: translateY(-1px); }
.im-botao:disabled { opacity: .45; cursor: not-allowed; }
.im-depois {
    align-self: center;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: var(--muted, #888);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.im-depois:hover { color: var(--text, #1a1a1a); text-decoration: underline; }
.im-sucesso { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: stretch; animation: im-entra .6s cubic-bezier(.16, 1, .3, 1); }
.im-sucesso-ico { align-self: center; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: #16a34a; color: #fff; }
.im-sucesso-ico svg { width: 28px; height: 28px; }
.im-resumo { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2, #f6f6f7); text-align: left; }
.im-resumo div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.im-resumo span { color: var(--muted, #777); }
.im-resumo strong { color: var(--text, #1a1a1a); font-weight: 800; text-align: right; }
@keyframes im-entra { from { opacity: 0; transform: translateY(8px); } }
@keyframes im-brilho { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

[data-theme="dark"] .im-sheet { background: #17171a; border-color: rgba(255, 255, 255, .08); }
[data-theme="dark"] .im-input,
[data-theme="dark"] .im-previa.is-ok,
[data-theme="dark"] .im-previa.is-carregando,
[data-theme="dark"] .im-resumo { background: #1f1f23; border-color: rgba(255, 255, 255, .09); }
[data-theme="dark"] .im-input:focus { background: #232327; border-color: #ff6b6b; }
[data-theme="dark"] .im-chip { border-color: rgba(255, 255, 255, .14); }
[data-theme="dark"] .im-chip.is-ativo { color: #ff6b6b; border-color: #ff6b6b; }
[data-theme="dark"] .im-previa-aviso { color: #fbbf24; }
[data-theme="dark"] .im-erro { color: #f87171; }

@media (max-width: 560px) {
    .im-overlay { align-items: flex-end; padding: 0; }
    .im-sheet {
        max-width: none;
        border-radius: 22px 22px 0 0;
        max-height: 92vh;
        max-height: 92dvh;
        padding-bottom: env(safe-area-inset-bottom);
        transform: translateY(40px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .im-overlay, .im-sheet, .im-previa, .im-sucesso { transition: none; animation: none; }
}
.im-teste {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed #d97706;
    background: rgba(217, 119, 6, .1);
    color: #b45309;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}
[data-theme="dark"] .im-teste { color: #fbbf24; border-color: #fbbf24; background: rgba(251, 191, 36, .1); }
.im-aviso { animation: im-entra .6s cubic-bezier(.16, 1, .3, 1); }
.im-aviso[hidden] { display: none; }
.im-aviso .cx-alert { align-items: flex-start; text-align: left; }
.im-aviso .cx-alert-icon { margin-top: 1px; }
.im-aviso-txt { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(245, 158, 11, .32); background: rgba(245, 158, 11, .08); color: var(--text, #1a1a1a); font-size: 13px; line-height: 1.45; }
.im-erro:not([hidden]) { animation: im-entra .5s cubic-bezier(.16, 1, .3, 1); }
