/**
 * Email drag-and-drop editor bento animation.
 * Scoped to body.pl-landing-time only.
 */
body.pl-landing-time .pl-time-email-editor-stage {
    margin-top: auto;
    flex: 0 0 auto;
    height: 276px;
    min-height: 276px;
    max-height: 276px;
    padding: 14px 14px 0;
    display: flex;
    align-items: stretch;
    background: #fafafa;
    border-color: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim {
    --email-editor-cycle: 12s;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

body.pl-landing-time .pl-email-editor-anim__shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 12px 28px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateY(8px);
    animation: plEmailEditorShellIn var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #fafafa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex: 0 0 auto;
}

body.pl-landing-time .pl-email-editor-anim__toolbar > span {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #111;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.pl-landing-time .pl-email-editor-anim__send {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: scale(0.92);
    animation: plEmailEditorToolbarSend var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__workspace {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: 8px;
}

body.pl-landing-time .pl-email-editor-anim__palette {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim__blocks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-height: 0;
    justify-content: space-between;
}

body.pl-landing-time .pl-email-editor-anim__block {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-height: 0;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    font-size: 7px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: #374151;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
    white-space: nowrap;
}

body.pl-landing-time .pl-email-editor-anim__block--btn {
    animation: plEmailEditorPaletteBtn var(--email-editor-cycle) ease-in-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__block--text {
    animation: plEmailEditorPaletteText var(--email-editor-cycle) ease-in-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__block--image {
    animation: plEmailEditorPaletteImage var(--email-editor-cycle) ease-in-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__canvas {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    background: #f8fafc;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

body.pl-landing-time .pl-email-editor-anim__email {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

/* Blocks stay out of the canvas until dragged in */
body.pl-landing-time .pl-email-editor-anim__added {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    opacity: 0;
    max-height: 0;
    transform: scale(0.96);
    pointer-events: none;
}

body.pl-landing-time .pl-email-editor-anim__added--image {
    animation: plEmailEditorAddImage var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__added--text {
    animation: plEmailEditorAddText var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__added--cta {
    animation: plEmailEditorAddCta var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__image {
    height: 88px;
    border-radius: 6px;
    background: #e5e7eb;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.pl-landing-time .pl-email-editor-anim__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 2px 0;
}

body.pl-landing-time .pl-email-editor-anim__line {
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
}

body.pl-landing-time .pl-email-editor-anim__line--short {
    width: 58%;
}

body.pl-landing-time .pl-email-editor-anim__cta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 30px;
}

body.pl-landing-time .pl-email-editor-anim__cta span {
    padding: 5px 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

body.pl-landing-time .pl-email-editor-anim__drag {
    position: absolute;
    z-index: 5;
    left: 5%;
    top: 44%;
    pointer-events: none;
    opacity: 0;
    transform-origin: 0 0;
}

body.pl-landing-time .pl-email-editor-anim__drag--image {
    animation: plEmailEditorDragImage var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__drag--text {
    animation: plEmailEditorDragText var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__drag--btn {
    animation: plEmailEditorDragBtn var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__cursor {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 21px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='21' viewBox='0 0 16 21'%3E%3Cpath fill='%23111' stroke='%23fff' stroke-width='1.1' stroke-linejoin='round' d='M1 1v14.5L5 12l2.2 5.8 1.8-.7L6.8 11H13L1 1z'/%3E%3C/svg%3E") no-repeat 0 0 / contain;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

body.pl-landing-time .pl-email-editor-anim__floater {
    position: absolute;
    left: 8px;
    top: 6px;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    font-size: 7px;
    font-weight: 650;
    color: #374151;
    white-space: nowrap;
}

/* Native-style campaign send sheet (right panel) */
body.pl-landing-time .pl-email-editor-anim__sheet {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    animation: plEmailEditorSheetScrim var(--email-editor-cycle) ease-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(148px, 48%);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.12);
    transform: translateX(105%);
    animation: plEmailEditorSheetIn var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim__sheet-head {
    flex: 0 0 auto;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.pl-landing-time .pl-email-editor-anim__sheet-head strong {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #111;
}

body.pl-landing-time .pl-email-editor-anim__sheet-body {
    flex: 1;
    min-height: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim__sheet-subject {
    padding: 7px 8px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fafafa;
    font-size: 9px;
    font-weight: 600;
    color: #111;
    letter-spacing: -0.01em;
}

body.pl-landing-time .pl-email-editor-anim__sheet-group {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    padding: 7px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.pl-landing-time .pl-email-editor-anim__sheet-row:last-child {
    border-bottom: none;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row span {
    font-size: 8px;
    font-weight: 650;
    color: #111;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row em {
    font-style: normal;
    font-size: 7px;
    font-weight: 600;
    color: #9ca3af;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row svg {
    opacity: 0.4;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--list {
    animation: plEmailEditorSheetRowPulse var(--email-editor-cycle) ease-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--list em {
    animation: plEmailEditorSheetListEm var(--email-editor-cycle) steps(1, end) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--list em::before {
    content: "Choose lists";
    animation: plEmailEditorSheetListLabel var(--email-editor-cycle) steps(1, end) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule {
    animation: plEmailEditorSheetSchedulePulse var(--email-editor-cycle) ease-out 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule em {
    animation: plEmailEditorSheetScheduleEm var(--email-editor-cycle) steps(1, end) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule em::before {
    content: "Immediately";
    animation: plEmailEditorSheetScheduleLabel var(--email-editor-cycle) steps(1, end) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-foot {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
}

body.pl-landing-time .pl-email-editor-anim__sheet-action {
    display: grid;
    place-items: center;
    padding: 7px 6px;
    border-radius: 7px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body.pl-landing-time .pl-email-editor-anim__sheet-action--test {
    background: #fff;
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

body.pl-landing-time .pl-email-editor-anim__sheet-action--send {
    background: #111;
    color: #fff;
    animation: plEmailEditorSheetSmashSend var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-success {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px;
    text-align: center;
    background: #fff;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    animation: plEmailEditorSheetSuccess var(--email-editor-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-email-editor-anim__sheet-success strong {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #111;
}

body.pl-landing-time .pl-email-editor-anim__sheet-success span {
    font-size: 8px;
    font-weight: 600;
    color: #6b7280;
}

body.pl-landing-time .pl-email-editor-anim__sheet-success span::before {
    content: "Scheduled · Mon 10:00 AM";
}

@keyframes plEmailEditorShellIn {
    0%, 3% { opacity: 0; transform: translateY(8px); }
    8%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes plEmailEditorToolbarSend {
    0%, 56% { opacity: 0; transform: scale(0.92); }
    60%, 64% { opacity: 1; transform: scale(1.06); }
    68%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes plEmailEditorSheetScrim {
    0%, 62% { background: rgba(0, 0, 0, 0); }
    66%, 100% { background: rgba(0, 0, 0, 0.18); }
}

@keyframes plEmailEditorSheetIn {
    0%, 62% { transform: translateX(105%); }
    68%, 100% { transform: translateX(0); }
}

@keyframes plEmailEditorSheetRowPulse {
    0%, 70% { background: transparent; }
    72%, 78% { background: #f3f4f6; }
    82%, 100% { background: transparent; }
}

@keyframes plEmailEditorSheetListLabel {
    0%, 75% { content: "Choose lists"; }
    76%, 100% { content: "All subscribers"; }
}

@keyframes plEmailEditorSheetListEm {
    0%, 75% { color: #9ca3af; }
    76%, 100% { color: #374151; }
}

@keyframes plEmailEditorSheetSmashSend {
    0%, 88% { transform: scale(1); box-shadow: none; }
    91% { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.16); }
    95%, 100% { transform: scale(1); box-shadow: none; }
}

@keyframes plEmailEditorSheetSchedulePulse {
    0%, 80% { background: transparent; }
    82%, 88% { background: #f3f4f6; }
    92%, 100% { background: transparent; }
}

@keyframes plEmailEditorSheetScheduleLabel {
    0%, 85% { content: "Immediately"; }
    86%, 100% { content: "Mon · 10:00 AM"; }
}

@keyframes plEmailEditorSheetScheduleEm {
    0%, 85% { color: #9ca3af; }
    86%, 100% { color: #374151; }
}

@keyframes plEmailEditorSheetSuccess {
    0%, 93% { opacity: 0; transform: scale(0.96); }
    96%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes plEmailEditorPaletteImage {
    0%, 8% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
    10%, 18% { border-color: rgba(0, 0, 0, 0.18); background: #f3f4f6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06); }
    20%, 100% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
}

@keyframes plEmailEditorPaletteText {
    0%, 24% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
    26%, 34% { border-color: rgba(0, 0, 0, 0.18); background: #f3f4f6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06); }
    36%, 100% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
}

@keyframes plEmailEditorPaletteBtn {
    0%, 40% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
    42%, 50% { border-color: rgba(0, 0, 0, 0.18); background: #f3f4f6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06); }
    52%, 100% { border-color: rgba(0, 0, 0, 0.08); background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03); }
}

@keyframes plEmailEditorAddImage {
    0%, 16% { opacity: 0; max-height: 0; transform: scale(0.96); }
    20%, 100% { opacity: 1; max-height: 100px; transform: scale(1); }
}

@keyframes plEmailEditorAddText {
    0%, 32% { opacity: 0; max-height: 0; transform: scale(0.96); }
    36%, 100% { opacity: 1; max-height: 36px; transform: scale(1); }
}

@keyframes plEmailEditorAddCta {
    0%, 48% { opacity: 0; max-height: 0; transform: scale(0.96); }
    52%, 100% { opacity: 1; max-height: 40px; transform: scale(1); }
}

@keyframes plEmailEditorDragImage {
    0%, 8% { opacity: 0; left: 5%; top: 38%; transform: scale(0.96); }
    10% { opacity: 1; left: 5%; top: 38%; transform: scale(1); }
    16% { opacity: 1; left: 55%; top: 32%; transform: scale(1); }
    18%, 100% { opacity: 0; left: 55%; top: 32%; transform: scale(0.96); }
}

@keyframes plEmailEditorDragText {
    0%, 24% { opacity: 0; left: 5%; top: 32%; transform: scale(0.96); }
    26% { opacity: 1; left: 5%; top: 32%; transform: scale(1); }
    32% { opacity: 1; left: 55%; top: 52%; transform: scale(1); }
    34%, 100% { opacity: 0; left: 55%; top: 52%; transform: scale(0.96); }
}

@keyframes plEmailEditorDragBtn {
    0%, 40% { opacity: 0; left: 5%; top: 44%; transform: scale(0.96); }
    42% { opacity: 1; left: 5%; top: 44%; transform: scale(1); }
    48% { opacity: 1; left: 34%; top: 72%; transform: scale(1); }
    50%, 100% { opacity: 0; left: 34%; top: 72%; transform: scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
    body.pl-landing-time .pl-email-editor-anim__shell,
    body.pl-landing-time .pl-email-editor-anim__block,
    body.pl-landing-time .pl-email-editor-anim__added,
    body.pl-landing-time .pl-email-editor-anim__drag,
    body.pl-landing-time .pl-email-editor-anim__send,
    body.pl-landing-time .pl-email-editor-anim__sheet,
    body.pl-landing-time .pl-email-editor-anim__sheet-panel,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--list,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--list em::before,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--list em,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule em::before,
    body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule em,
    body.pl-landing-time .pl-email-editor-anim__sheet-action--send,
    body.pl-landing-time .pl-email-editor-anim__sheet-success {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        max-height: none !important;
    }

    body.pl-landing-time .pl-email-editor-anim__drag {
        display: none;
    }

    body.pl-landing-time .pl-email-editor-anim__sheet {
        background: rgba(0, 0, 0, 0.18);
    }

    body.pl-landing-time .pl-email-editor-anim__sheet-panel {
        transform: none;
    }

    body.pl-landing-time .pl-email-editor-anim__sheet-row--list em::before {
        content: "All subscribers";
    }

    body.pl-landing-time .pl-email-editor-anim__sheet-row--schedule em::before {
        content: "Mon · 10:00 AM";
    }
}
