/* Member Inbox — slice 2c styles. Two-pane layout: thread feed left,
 * thread reader right. @wordpress/components provides the buttons /
 * cards / notices; this file only handles the layout + minor density
 * tweaks so the inbox feels at home inside wp-admin.
 */

.em-inbox-wrap { max-width: 1400px; }

.em-inbox-toolbar {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.em-inbox-toolbar > div { flex: 0 1 360px; }

.em-inbox-thread-header > .components-button { margin-right: 8px; }
.em-inbox-thread-header h2 { margin: 8px 0 4px; font-size: 18px; }

.em-inbox-composer-modal .components-modal__content { max-width: 720px; }
.em-inbox-composer-from { margin: 0 0 12px; color: #50575e; font-size: 13px; }
.em-inbox-composer-from .em-inbox-link-btn {
    background: transparent; border: none; color: #2271b1;
    cursor: pointer; text-decoration: underline;
    font-size: 12px; margin-left: 8px;
}
.em-inbox-composer-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }

.em-inbox-composer-dropzone { position: relative; }
.em-inbox-composer-dropzone.is-dragging { outline: 2px dashed #2271b1; outline-offset: 4px; }
.em-inbox-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 113, 177, 0.08);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; color: #2271b1;
    pointer-events: none;
    border-radius: 4px;
}

.em-inbox-message.is-mine .em-inbox-message-from { color: #2271b1; }

.em-inbox-message-meta { display: flex; align-items: center; gap: 8px; }

.em-inbox-img-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8e1;
    border: 1px solid #f0d28a;
    padding: 6px 10px;
    border-radius: 3px;
    margin-bottom: 8px;
    font-size: 12px;
}
.em-inbox-img-banner > span { flex: 1; color: #6a4a00; }
.em-inbox-img-btn {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-img-btn:hover { background: #2271b1; color: #fff; border-color: #2271b1; }
img.em-inbox-blocked-img {
    width: 16px; height: 16px;
    background: #e8e8e8;
    border: 1px dashed #c3c4c7;
}
.em-inbox-msg-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}
.em-inbox-msg-status-sent     { background: #ecf7ed; color: #00692b; }
.em-inbox-msg-status-retrying { background: #fff8e1; color: #8a5a00; }
.em-inbox-msg-status-failed   { background: #fbebec; color: #b32d2e; }
.em-inbox-message.is-delivery-failed   { border-left: 3px solid #b32d2e; }
.em-inbox-message.is-delivery-retrying { border-left: 3px solid #d4a017; }

.em-inbox-filters { display: flex; gap: 0; }
.em-inbox-filter {
    background: transparent;
    border: 1px solid #c3c4c7;
    border-right: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #2c3338;
}
.em-inbox-filter:first-child { border-radius: 3px 0 0 3px; }
.em-inbox-filter:last-child  { border-radius: 0 3px 3px 0; border-right: 1px solid #c3c4c7; }
.em-inbox-filter.is-active   { background: #2271b1; color: #fff; border-color: #2271b1; }

.em-inbox-thread-row.is-unread .em-inbox-thread-sender,
.em-inbox-thread-row.is-unread .em-inbox-thread-subject {
    font-weight: 700;
}
.em-inbox-thread-row.is-unread { background: #fff; }
.em-inbox-thread-row:not(.is-unread) .em-inbox-thread-sender,
.em-inbox-thread-row:not(.is-unread) .em-inbox-thread-subject {
    font-weight: 400;
    color: #50575e;
}

.em-inbox-thread-actions { display: flex; gap: 6px; margin-top: 8px; }

.em-inbox-search-snippet {
    font-size: 12px;
    color: #50575e;
    margin-top: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.em-inbox-toolbar > .components-base-control:nth-child(2) { flex: 1 1 280px; }

.em-inbox-rte-label { display: block; font-weight: 600; font-size: 12px; color: #1d2327; margin: 12px 0 4px; }
.em-rte { border: 1px solid #c3c4c7; border-radius: 3px; background: #fff; }
.em-rte-toolbar {
    display: flex; align-items: center; gap: 2px;
    padding: 4px 6px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
}
.em-rte-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 13px;
    color: #2c3338;
    min-width: 28px;
}
.em-rte-btn:hover { background: #fff; border-color: #c3c4c7; }
.em-rte-sep { width: 1px; background: #c3c4c7; align-self: stretch; margin: 4px 4px; }
.em-rte-editor {
    min-height: 180px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}
.em-rte-editor:focus { background: #fff; }
.em-rte-editor blockquote {
    border-left: 3px solid #c3c4c7;
    padding-left: 12px;
    margin: 0 0 0 4px;
    color: #50575e;
}
.em-rte-editor ul, .em-rte-editor ol { padding-left: 24px; margin: 4px 0; }

.em-inbox-composer-attachments { margin-top: 12px; }
.em-inbox-att-add { display: inline-block; cursor: pointer; }
.em-inbox-att-add input[type=file] { display: none; }
.em-inbox-att-add span {
    display: inline-block;
    padding: 4px 10px;
    border: 1px dashed #c3c4c7;
    border-radius: 3px;
    font-size: 12px;
    color: #2c3338;
}
.em-inbox-att-add:hover span { border-color: #2271b1; color: #2271b1; }
.em-inbox-att-list { margin: 8px 0 0; list-style: none; padding: 0; }
.em-inbox-att-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px;
    border: 1px solid #f0f0f1;
    border-radius: 3px;
    margin-bottom: 4px;
    font-size: 12px;
}
.em-inbox-att-name { flex: 1; }
.em-inbox-att-size { color: #50575e; }
.em-inbox-att-remove {
    background: none; border: none; cursor: pointer;
    font-size: 16px; line-height: 1; color: #d63638; padding: 0 4px;
}

.em-inbox-body {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 16px;
    min-height: 600px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.em-inbox-feed {
    border-right: 1px solid #f0f0f1;
    overflow-y: auto;
    max-height: 75vh;
}
.em-inbox-feed-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #50575e;
    border-bottom: 1px solid #f0f0f1;
    background: #f6f7f7;
    position: sticky;
    top: 0;
    z-index: 1;
}
.em-inbox-thread-list {
    margin: 0;
    list-style: none;
    padding: 0;
}
.em-inbox-thread-row {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
    transition: background-color 0.1s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.em-inbox-thread-row > input[type=checkbox] { margin-top: 2px; flex: 0 0 auto; }
.em-inbox-thread-body { flex: 1; min-width: 0; }
.em-inbox-thread-row.is-selected { background-color: #fff8e1; }
.em-inbox-thread-row.is-focused {
    box-shadow: inset 3px 0 0 0 #2271b1;
}

.em-inbox-help-btn {
    background: transparent;
    border: 1px solid #c3c4c7;
    color: #50575e;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
}
.em-inbox-help-btn:hover { background: #f0f0f1; }

.em-inbox-vac-btn {
    background: transparent;
    border: 1px solid #c3c4c7;
    color: #50575e;
    border-radius: 14px;
    height: 28px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-vac-btn.is-active {
    background: #ecf7ed;
    color: #00692b;
    border-color: #00692b;
    font-weight: 600;
}
.em-inbox-vac-btn:hover { background: #f0f0f1; }

.em-vac-row { display: flex; gap: 12px; margin-top: 8px; }
.em-vac-row > .components-base-control { flex: 1; }
.em-inbox-help-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.em-inbox-help-table th {
    text-align: left; padding: 6px 12px 6px 0;
    font-family: Consolas, Monaco, monospace;
    color: #2271b1;
    width: 100px;
}
.em-inbox-help-table td { padding: 6px 0; color: #2c3338; }
.em-inbox-help-foot { color: #646970; font-size: 12px; margin-top: 12px; }

.em-inbox-search-wrap { flex: 1 1 280px; }

.em-inbox-undo-snack {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    border-radius: 4px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}
.em-inbox-undo-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.em-inbox-undo-btn:hover { background: rgba(255,255,255,0.1); }

.em-inbox-star {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #c3c4c7;
    padding: 0 4px;
    flex: 0 0 auto;
}
.em-inbox-star:hover         { color: #f0b400; }
.em-inbox-star.is-starred    { color: #f0b400; }
.em-inbox-star-header        { font-size: 22px; margin-right: 6px; }

.em-inbox-label-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f1;
    background: #fafafa;
    font-size: 12px;
}
.em-inbox-label-pill {
    background: transparent;
    border: 1px solid #2271b1;
    color: #2271b1;
    border-radius: 12px;
    padding: 2px 10px;
    cursor: pointer;
    font-size: 11px;
}
.em-inbox-label-pill.is-muted { border-color: #c3c4c7; color: #50575e; }
.em-inbox-label-pill.is-active { color: #fff; font-weight: 600; }
.em-inbox-label-manage {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #2271b1;
    cursor: pointer;
    text-decoration: underline;
    font-size: 11px;
}
.em-inbox-chip {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 10px;
    margin-right: 4px;
    vertical-align: middle;
}

.em-inbox-labels-modal .components-modal__content { max-width: 480px; }
.em-inbox-labels-list { list-style: none; padding: 0; margin: 0 0 12px; }
.em-inbox-labels-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f1;
}
.em-inbox-label-delete {
    background: transparent;
    border: none;
    color: #b32d2e;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-label-delete:hover { text-decoration: underline; }
.em-inbox-label-create { display: flex; gap: 8px; align-items: end; }
.em-inbox-label-create .components-base-control { flex: 1; margin: 0; }

.em-inbox-label-picker { position: relative; display: inline-block; }
.em-inbox-label-picker-btn {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-label-picker-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    z-index: 10;
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
}
.em-inbox-label-picker-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-label-picker-row:hover { background: #f6f7f7; }

.em-inbox-track-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: #2c3338;
}
.em-inbox-track-toggle input { margin-top: 2px; }
.em-inbox-track-toggle small { color: #50575e; }

.em-inbox-open-badge {
    background: #ecf7ed;
    color: #00692b;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
}

.em-inbox-auth-badge {
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
}
.em-auth-pass     { background: #ecf7ed; color: #00692b; }
.em-auth-partial  { background: #fff8e1; color: #8a5a00; }
.em-auth-fail     { background: #fbebec; color: #b32d2e; }
.em-auth-unknown  { background: #f0f0f1; color: #50575e; }
.em-inbox-selectall-row {
    background: #f0f0f1;
    font-size: 11px;
    text-transform: uppercase;
    color: #50575e;
    padding: 6px 16px;
}
.em-inbox-selectall-row .em-inbox-thread-subject { font-weight: 600; }

.em-inbox-bulk-bar {
    margin-top: 8px;
    padding: 6px 8px;
    background: #fff8e1;
    border: 1px solid #f0d28a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.em-inbox-bulk-bar > span { font-weight: 600; flex: 1; }
.em-inbox-bulk-act, .em-inbox-bulk-clear {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
}
.em-inbox-bulk-act:hover  { background: #2271b1; color: #fff; border-color: #2271b1; }
.em-inbox-bulk-clear:hover { background: #f0f0f1; }

.em-inbox-load-more {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #f0f0f1;
}
.em-inbox-thread-row:hover { background-color: #f6f7f7; }
.em-inbox-thread-row.is-open { background-color: #e8f0fe; }
.em-inbox-thread-sender { font-weight: 600; font-size: 13px; color: #1d2327; }
.em-inbox-thread-subject {
    font-size: 13px;
    color: #2c3338;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.em-inbox-thread-meta { font-size: 11px; color: #646970; margin-top: 4px; }
.em-inbox-empty { padding: 16px; color: #646970; font-style: italic; }

.em-inbox-thread {
    padding: 16px;
    overflow-y: auto;
    max-height: 75vh;
}
.em-inbox-thread-header { margin-bottom: 16px; }
.em-inbox-thread-header h2 { margin: 8px 0 4px; font-size: 18px; }
.em-inbox-thread-inbox { color: #646970; font-size: 12px; margin: 0; }

.em-inbox-messages > * + * { margin-top: 12px; }

.em-inbox-message-from { font-weight: 600; font-size: 13px; }
.em-inbox-message-date { font-size: 12px; color: #646970; }

.em-inbox-message-body { font-size: 14px; line-height: 1.5; }
.em-inbox-message-body img { max-width: 100%; height: auto; }

.em-inbox-message-plain {
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: transparent;
}

.em-inbox-attachments {
    margin: 16px 0 0;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    list-style: none;
}
.em-inbox-attachments li { padding: 4px 0; font-size: 13px; }
.em-inbox-att-meta { color: #646970; margin-left: 8px; font-size: 12px; }

.em-inbox-pane-placeholder {
    padding: 32px;
    color: #646970;
    font-style: italic;
    text-align: center;
    align-self: center;
}

/* Slice 2aa — snooze threads */
.em-inbox-snooze-wrap { position: relative; display: inline-block; }
.em-inbox-snooze-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 6px 0;
    z-index: 10;
}
.em-inbox-snooze-menu button {
    display: flex;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #1d2327;
    justify-content: space-between;
    gap: 12px;
}
.em-inbox-snooze-menu button:hover { background: #f0f0f1; }
.em-inbox-snooze-menu button .em-snooze-when { color: #646970; font-size: 12px; }
.em-inbox-snooze-menu .em-snooze-unsnooze { color: #b32d2e; border-top: 1px solid #f0f0f1; margin-top: 4px; padding-top: 10px; }
.em-inbox-snoozed-pill {
    display: inline-block;
    background: #f0eaff;
    color: #5524a7;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

/* Slice 2bb — scheduled send: composer Send dropdown */
.em-inbox-send-group { position: relative; display: inline-flex; }
.em-inbox-send-group .components-button { border-radius: 4px 0 0 4px; }
.em-inbox-send-group .em-inbox-send-caret {
    border-radius: 0 4px 4px 0;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 10px;
    padding-right: 10px;
    min-width: 0;
}
.em-inbox-sched-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    min-width: 320px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 6px 0;
    z-index: 20;
}
.em-inbox-sched-menu > button {
    display: flex;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #1d2327;
    justify-content: space-between;
    gap: 12px;
}
.em-inbox-sched-menu > button:hover { background: #f0f0f1; }
.em-inbox-sched-menu .em-sched-when { color: #646970; font-size: 12px; }
.em-inbox-sched-custom {
    border-top: 1px solid #f0f0f1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}
.em-inbox-sched-custom label { color: #646970; }
.em-inbox-sched-custom input { font: inherit; padding: 4px; }
.em-sched-clear {
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: transparent;
    border: 0;
    border-top: 1px solid #f0f0f1;
    cursor: pointer;
    font-size: 12px;
    color: #b32d2e;
}
.em-sched-clear:hover { background: #fdf0f0; }
.em-inbox-sched-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #5524a7;
    text-align: right;
}

/* Slice 2bb — Scheduled tab listing */
.em-inbox-scheduled-list { list-style: none; margin: 0; padding: 0; }
.em-inbox-scheduled-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f1;
}
.em-inbox-scheduled-meta { flex: 1; min-width: 0; }
.em-inbox-scheduled-when { font-weight: 600; color: #5524a7; font-size: 13px; }
.em-inbox-scheduled-to { color: #646970; font-size: 12px; margin-top: 2px; }
.em-inbox-scheduled-subject { font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-inbox-scheduled-cancel { flex-shrink: 0; }

/* Slice 2cc — filters engine */
.em-inbox-filters-btn {
    background: transparent;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 4px;
}
.em-inbox-filters-btn:hover { background: #f0f0f1; }
.em-inbox-filters-modal .components-modal__content { max-width: 720px; }
.em-inbox-filters-h3 { margin: 16px 0 8px; font-size: 14px; font-weight: 600; color: #1d2327; }
.em-inbox-filters-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}
.em-inbox-filters-row select, .em-inbox-filters-row input { font: inherit; padding: 4px 6px; }
.em-inbox-filters-row input[type="text"], .em-inbox-filters-row input[type="email"] { flex: 1; min-width: 0; }
.em-inbox-filters-noval { color: #646970; font-size: 12px; flex: 1; }
.em-inbox-row-add {
    background: transparent;
    border: 1px dashed #c3c4c7;
    color: #2271b1;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 4px 0 0;
}
.em-inbox-row-rm {
    background: transparent;
    border: 0;
    color: #b32d2e;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
}
.em-inbox-filters-list { list-style: none; margin: 0; padding: 0; }
.em-inbox-filters-row-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #f0f0f1;
}
.em-inbox-filters-toggle { display: flex; align-items: center; }
.em-inbox-filters-meta { flex: 1; min-width: 0; }
.em-inbox-filters-name { font-weight: 600; font-size: 14px; }
.em-inbox-filters-cond { color: #646970; font-size: 12px; margin-top: 2px; }
.em-inbox-filters-acts { color: #2271b1; font-size: 12px; }
.em-inbox-filters-stats { color: #8c8f94; font-size: 11px; margin-top: 2px; }
.em-inbox-filters-rm { color: #b32d2e !important; }

/* Slice 2ff — search highlight */
.em-inbox-search-snippet mark {
    background: #fff3a3;
    padding: 0 1px;
    border-radius: 2px;
}

/* Slice 2gg — quoted-reply collapsing */
.em-inbox-quote-toggle {
    display: inline-block;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    padding: 2px 12px;
    font-size: 12px;
    color: #646970;
    cursor: pointer;
    margin: 8px 0;
}
.em-inbox-quote-toggle:hover { background: #e6e6e8; color: #1d2327; }
.em-inbox-quoted-block.is-collapsed {
    display: none;
}
.em-inbox-quoted-block {
    border-left: 2px solid #dcdcde;
    padding-left: 10px;
    margin-left: 4px;
    color: #50575e;
}

/* Slice 2hh — composer From dropdown for delegated inboxes */
.em-inbox-from-select {
    font: inherit;
    padding: 2px 6px;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    background: #fff;
    margin-right: 8px;
}
.em-inbox-from-warning {
    color: #b32d2e;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

/* Slice 2ii — notification bell */
.em-inbox-bell {
    position: relative;
    background: transparent;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 4px;
    line-height: 1;
}
.em-inbox-bell:hover { background: #f0f0f1; }
.em-inbox-bell.has-unread { border-color: #b32d2e; }
.em-inbox-bell-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #b32d2e;
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}
.em-inbox-bell.is-pulsing { animation: em-inbox-bell-pulse 0.6s ease-in-out 3; }
@keyframes em-inbox-bell-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); background: #fff3a3; }
}

/* Slice 2qq — accessibility utilities */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (prefers-reduced-motion: reduce) {
    .em-inbox-bell.is-pulsing { animation: none; }
    .em-inbox-bell.is-pulsing { background: #fff3a3; }
}
.em-inbox-thread-body[role="button"]:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

/* Slice 2kk — drafts */
.em-inbox-draft-status {
    flex: 1;
    font-size: 12px;
    color: #646970;
    text-align: left;
}
.em-inbox-draft-err { color: #b32d2e; }
.em-inbox-composer-actions { align-items: center; }

/* Slice 2ll — attachment preview */
.em-inbox-att-preview {
    margin-left: 8px;
    background: transparent;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 1px 8px;
    font-size: 11px;
    cursor: pointer;
    color: #2271b1;
}
.em-inbox-att-preview:hover { background: #f0f0f1; }
.em-inbox-preview-modal .components-modal__content { max-width: 90vw; width: 900px; max-height: 90vh; }
.em-inbox-preview-img  { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; margin: 0 auto; }
.em-inbox-preview-pdf  { width: 100%; height: 70vh; border: 1px solid #dcdcde; }
.em-inbox-preview-text {
    background: #f6f7f7;
    padding: 12px;
    border-radius: 4px;
    max-height: 70vh;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    white-space: pre;
}

/* Slice 2oo — unified inbox origin chip */
.em-inbox-origin-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #ebebeb;
    color: #50575e;
    font-size: 10px;
    font-weight: 500;
}

/* ============================================================
 * SLICE 2ss — GLASSMORPHIC OVERHAUL
 * Borrowed design tokens from gend-society admin-style.css so the
 * inbox feels native to the platform. All styles are scoped to
 * .em-inbox-wrap so the rest of wp-admin keeps its default chrome.
 * ============================================================ */

.em-inbox-wrap {
    --gs-magenta: #b608c9;
    --gs-red:     #cc0000;
    --gs-blue:    #6ec1e4;
    --gs-accent:  #97e46e;
    --gs-bg:      #0b0e14;
    --gs-surface: rgba(15, 20, 32, 0.92);
    --gs-glass:   rgba(255, 255, 255, 0.05);
    --gs-glass-strong: rgba(255, 255, 255, 0.10);
    --gs-border:  rgba(255, 255, 255, 0.10);
    --gs-border-strong: rgba(255, 255, 255, 0.22);
    --gs-text:    #e8edf5;
    --gs-muted:   #8b98b0;
    --gs-radius:  14px;
    --gs-ease:    cubic-bezier(0.22, 1, 0.36, 1);

    max-width: 1600px;
    margin: 18px auto 40px;
    padding: 28px 28px 40px;
    background:
        radial-gradient(circle at 15% 0%, rgba(182, 8, 201, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 85% 100%, rgba(110, 193, 228, 0.16) 0%, transparent 55%),
        linear-gradient(180deg, #0b0e14 0%, #11161f 100%);
    border-radius: var(--gs-radius);
    border: 1px solid var(--gs-border);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    color: var(--gs-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Stagger source: each immediate child of .em-inbox animates in turn */
@keyframes em-inbox-rise {
    from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes em-inbox-rise-left {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes em-inbox-rise-right {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes em-inbox-pop {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.em-inbox-wrap > .em-inbox-toolbar,
.em-inbox-wrap > .em-inbox,
.em-inbox-wrap > .em-inbox > .em-inbox-toolbar,
.em-inbox-wrap > .em-inbox > .em-inbox-body {
    animation: em-inbox-rise 0.6s var(--gs-ease) both;
}

.em-inbox-toolbar { animation-delay: 0.05s; padding-bottom: 6px; }
.em-inbox-body    { animation-delay: 0.15s; }

/* === HEADER TOOLBAR === */

.em-inbox-toolbar {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 12px;
}
.em-inbox-toolbar > div { flex: 0 1 auto; }

/* Override the wp.components SelectControl chrome so the "Inbox" picker
 * matches the glass surface. */
.em-inbox-wrap .components-base-control__label,
.em-inbox-wrap .components-input-control__label,
.em-inbox-wrap .components-text-control__input + label {
    color: var(--gs-muted) !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.em-inbox-wrap .components-select-control__input,
.em-inbox-wrap .components-text-control__input,
.em-inbox-wrap .components-textarea-control__input,
.em-inbox-wrap input[type="text"],
.em-inbox-wrap input[type="email"],
.em-inbox-wrap input[type="datetime-local"],
.em-inbox-wrap select {
    background: var(--gs-glass) !important;
    border: 1px solid var(--gs-border) !important;
    color: var(--gs-text) !important;
    border-radius: 8px !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.em-inbox-wrap input::placeholder { color: var(--gs-muted); }

/* The platform-native <select> popup paints its <option> rows in
 * browser-default styling. Without explicit color, our white !important
 * text rule (above) bleeds through as white-on-white when the popup
 * opens (Chromium falls back to inheriting from the parent on Windows
 * when no `color` is set on the option). Pin option text to a dark
 * value so the popup is legible. Selected/highlighted state uses the
 * brand magenta. */
.em-inbox-wrap select option,
.em-inbox-wrap .components-select-control__input option {
    background: #ffffff !important;
    color: #1d2327 !important;
}
.em-inbox-wrap select option:checked,
.em-inbox-wrap .components-select-control__input option:checked {
    background: linear-gradient(135deg, var(--gs-magenta), var(--gs-blue)) #b608c9 !important;
    color: #ffffff !important;
}

/* The custom icon buttons in the header (help, vacation, filters,
 * sharing, bell, add-inbox) — give them a uniform glass treatment. */
.em-inbox-wrap .em-inbox-help-btn,
.em-inbox-wrap .em-inbox-vac-btn,
.em-inbox-wrap .em-inbox-filters-btn,
.em-inbox-wrap .em-inbox-bell,
.em-inbox-wrap .em-inbox-addinbox-btn {
    background: var(--gs-glass) !important;
    border: 1px solid var(--gs-border) !important;
    color: var(--gs-text) !important;
    border-radius: 10px !important;
    padding: 6px 12px !important;
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    transition: background 0.2s var(--gs-ease), transform 0.2s var(--gs-ease), border-color 0.2s var(--gs-ease);
}
.em-inbox-wrap .em-inbox-help-btn:hover,
.em-inbox-wrap .em-inbox-vac-btn:hover,
.em-inbox-wrap .em-inbox-filters-btn:hover,
.em-inbox-wrap .em-inbox-bell:hover,
.em-inbox-wrap .em-inbox-addinbox-btn:hover {
    background: var(--gs-glass-strong) !important;
    border-color: var(--gs-border-strong) !important;
    transform: translateY(-1px);
}

/* Compose button stays prominent — gradient brand color */
.em-inbox-wrap .em-inbox-toolbar .components-button.is-primary {
    background: linear-gradient(135deg, var(--gs-magenta) 0%, var(--gs-blue) 100%) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 8px 18px !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(182, 8, 201, 0.35);
    transition: transform 0.2s var(--gs-ease), box-shadow 0.2s var(--gs-ease);
}
.em-inbox-wrap .em-inbox-toolbar .components-button.is-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(182, 8, 201, 0.5);
}

/* === BODY: TWO-PANE === */

.em-inbox-body {
    background: var(--gs-surface) !important;
    border: 1px solid var(--gs-border) !important;
    border-radius: var(--gs-radius) !important;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
}

.em-inbox-feed {
    border-right: 1px solid var(--gs-border) !important;
    background: rgba(11, 14, 20, 0.55);
    animation: em-inbox-rise-left 0.6s var(--gs-ease) 0.2s both;
}
.em-inbox-feed-header {
    background: rgba(11, 14, 20, 0.65) !important;
    border-bottom: 1px solid var(--gs-border) !important;
    color: var(--gs-text) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 18px !important;
}

/* === FILTER PILLS (wrap-friendly + visible scroll) === */

.em-inbox-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 4px 0;
}
.em-inbox-filter {
    background: var(--gs-glass) !important;
    border: 1px solid var(--gs-border) !important;
    border-right: 1px solid var(--gs-border) !important;
    border-radius: 999px !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
    color: var(--gs-text) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s var(--gs-ease);
    white-space: nowrap;
    animation: em-inbox-pop 0.4s var(--gs-ease) both;
}
.em-inbox-filter:first-child,
.em-inbox-filter:last-child { border-radius: 999px !important; }
.em-inbox-filter:hover {
    background: var(--gs-glass-strong) !important;
    border-color: var(--gs-border-strong) !important;
}
.em-inbox-filter.is-active {
    background: linear-gradient(135deg, var(--gs-magenta), var(--gs-blue)) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(182, 8, 201, 0.35);
}
/* Stagger filter pills — up to 12 of them */
.em-inbox-filter:nth-child(1) { animation-delay: 0.25s; }
.em-inbox-filter:nth-child(2) { animation-delay: 0.30s; }
.em-inbox-filter:nth-child(3) { animation-delay: 0.35s; }
.em-inbox-filter:nth-child(4) { animation-delay: 0.40s; }
.em-inbox-filter:nth-child(5) { animation-delay: 0.45s; }
.em-inbox-filter:nth-child(6) { animation-delay: 0.50s; }
.em-inbox-filter:nth-child(7) { animation-delay: 0.55s; }
.em-inbox-filter:nth-child(8) { animation-delay: 0.60s; }
.em-inbox-filter:nth-child(9) { animation-delay: 0.65s; }
.em-inbox-filter:nth-child(10){ animation-delay: 0.70s; }

/* === LABEL BAR pills ===
 * Don't force a color here — the JSX renders each label with an inline
 * `color: l.color` style (the user's palette pick), and forcing
 * var(--gs-text) made the name invisible inside white modals like
 * ThreadLabelPicker / ManageLabels (slice 2zz fix). For the bare
 * "All labels" pill (no inline color), the cascade falls through to
 * the .is-muted / default rules at line 338, which use #50575e — that
 * reads fine on both dark (LeftRail) and light (modal) contexts. */
.em-inbox-wrap .em-inbox-label-pill {
    background: var(--gs-glass) !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
}
/* The "All labels" pill has no inline color. Keep it readable in any
 * context. The active vs muted modifiers already handle the two
 * states; explicit fallback color for the default-off branch. */
.em-inbox-wrap .em-inbox-label-pill:not([style*="color"]) {
    color: var(--gs-text);
}
/* In the LeftRail (dark glass), give user-colored label pills a
 * slightly tinted background so their per-label color contrasts. */
.em-inbox-wrap .em-inbox-leftrail .em-inbox-label-pill[style*="color"] {
    background: rgba(255, 255, 255, 0.08) !important;
}
.em-inbox-wrap .em-inbox-label-manage {
    background: transparent !important;
    color: var(--gs-blue) !important;
    border: 1px dashed var(--gs-border-strong) !important;
    border-radius: 999px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
}

/* === THREAD ROWS === */

.em-inbox-thread-row {
    border-bottom: 1px solid var(--gs-border) !important;
    background: transparent;
    padding: 12px 18px !important;
    color: var(--gs-text);
    transition: background 0.2s var(--gs-ease), padding-left 0.2s var(--gs-ease);
    animation: em-inbox-rise 0.5s var(--gs-ease) both;
}
.em-inbox-thread-row:hover {
    background: var(--gs-glass) !important;
    padding-left: 22px !important;
}
.em-inbox-thread-row.is-unread {
    background: var(--gs-glass) !important;
    box-shadow: inset 3px 0 0 0 var(--gs-accent);
}
.em-inbox-thread-row.is-unread .em-inbox-thread-sender,
.em-inbox-thread-row.is-unread .em-inbox-thread-subject {
    color: var(--gs-text) !important;
}
.em-inbox-thread-row:not(.is-unread) .em-inbox-thread-sender,
.em-inbox-thread-row:not(.is-unread) .em-inbox-thread-subject {
    color: var(--gs-muted) !important;
}
.em-inbox-thread-row.is-focused {
    box-shadow: inset 3px 0 0 0 var(--gs-blue) !important;
    background: var(--gs-glass) !important;
}
.em-inbox-thread-row.is-open {
    background: var(--gs-glass-strong) !important;
    box-shadow: inset 3px 0 0 0 var(--gs-magenta);
}
.em-inbox-thread-row.is-selected {
    background: rgba(151, 228, 110, 0.10) !important;
}
.em-inbox-thread-sender { font-size: 13px; font-weight: 600; }
.em-inbox-thread-subject { font-size: 13px; margin-top: 1px; }
.em-inbox-thread-meta { color: var(--gs-muted) !important; font-size: 11px; margin-top: 3px; }

/* Stagger thread rows — up to 25 */
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(1)  { animation-delay: 0.25s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(2)  { animation-delay: 0.30s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(3)  { animation-delay: 0.35s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(4)  { animation-delay: 0.40s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(5)  { animation-delay: 0.45s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(6)  { animation-delay: 0.50s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(7)  { animation-delay: 0.55s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(8)  { animation-delay: 0.60s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(9)  { animation-delay: 0.65s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(10) { animation-delay: 0.70s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(11) { animation-delay: 0.75s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(12) { animation-delay: 0.80s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(13) { animation-delay: 0.85s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(14) { animation-delay: 0.90s; }
.em-inbox-thread-list > li.em-inbox-thread-row:nth-child(15) { animation-delay: 0.95s; }

/* Star button glass */
.em-inbox-wrap .em-inbox-star {
    background: transparent !important;
    border: none !important;
    color: var(--gs-muted) !important;
    font-size: 16px;
}
.em-inbox-wrap .em-inbox-star.is-starred { color: var(--gs-accent) !important; }

/* === THREAD READER pane === */

.em-inbox-wrap .em-inbox-thread,
.em-inbox-wrap .em-inbox-pane-placeholder {
    background: transparent !important;
    color: var(--gs-text) !important;
    animation: em-inbox-rise-right 0.6s var(--gs-ease) 0.25s both;
}
.em-inbox-wrap .em-inbox-thread-header {
    border-bottom: 1px solid var(--gs-border) !important;
    padding: 16px 22px !important;
    background: rgba(11, 14, 20, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.em-inbox-wrap .em-inbox-thread-header h2 {
    color: var(--gs-text) !important;
    font-size: 18px !important;
    font-weight: 600;
}
.em-inbox-wrap .em-inbox-thread-inbox {
    color: var(--gs-muted) !important;
    font-size: 12px;
}

/* Message cards as floating glass blocks */
.em-inbox-wrap .em-inbox-message,
.em-inbox-wrap .em-inbox-message .components-card,
.em-inbox-wrap .em-inbox-message .components-card__header,
.em-inbox-wrap .em-inbox-message .components-card__body {
    background: rgba(11, 14, 20, 0.55) !important;
    border: 1px solid var(--gs-border) !important;
    border-radius: 12px !important;
    color: var(--gs-text) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.em-inbox-wrap .em-inbox-message .components-card__header { border-bottom: 1px solid var(--gs-border) !important; }
.em-inbox-wrap .em-inbox-message {
    margin: 16px 22px;
    animation: em-inbox-rise 0.5s var(--gs-ease) both;
}
.em-inbox-wrap .em-inbox-message-from { color: var(--gs-text) !important; font-weight: 600; }
.em-inbox-wrap .em-inbox-message.is-mine .em-inbox-message-from { color: var(--gs-blue) !important; }
.em-inbox-wrap .em-inbox-message-meta,
.em-inbox-wrap .em-inbox-message-date { color: var(--gs-muted) !important; font-size: 12px; }
.em-inbox-wrap .em-inbox-message-body { color: var(--gs-text) !important; }
.em-inbox-wrap .em-inbox-message-body a { color: var(--gs-blue) !important; }
.em-inbox-wrap .em-inbox-message-plain { color: var(--gs-text) !important; background: transparent !important; }

/* === ATTACHMENT LIST === */
.em-inbox-wrap .em-inbox-attachments {
    background: rgba(11, 14, 20, 0.5) !important;
    border: 1px solid var(--gs-border) !important;
    border-radius: 10px !important;
    color: var(--gs-text) !important;
}
.em-inbox-wrap .em-inbox-attachments a { color: var(--gs-blue) !important; }
.em-inbox-wrap .em-inbox-att-meta { color: var(--gs-muted) !important; }
.em-inbox-wrap .em-inbox-att-preview {
    color: var(--gs-blue) !important;
    border-color: var(--gs-border-strong) !important;
    background: var(--gs-glass) !important;
}

/* === BULK BAR + SEARCH RESULTS === */
.em-inbox-wrap .em-inbox-bulk-bar {
    background: rgba(11, 14, 20, 0.7) !important;
    border-bottom: 1px solid var(--gs-border) !important;
    color: var(--gs-text) !important;
    padding: 10px 18px !important;
}
.em-inbox-wrap .em-inbox-bulk-act,
.em-inbox-wrap .em-inbox-bulk-clear {
    background: var(--gs-glass) !important;
    border: 1px solid var(--gs-border) !important;
    color: var(--gs-text) !important;
    border-radius: 6px !important;
    padding: 3px 10px !important;
    font-size: 11px;
}
.em-inbox-wrap .em-inbox-bulk-act:hover { background: var(--gs-glass-strong) !important; }
.em-inbox-wrap .em-inbox-search-snippet { color: var(--gs-muted) !important; }
.em-inbox-wrap .em-inbox-empty { color: var(--gs-muted) !important; padding: 24px !important; text-align: center; }

/* === SCHEDULED + DRAFTS list rows === */
.em-inbox-wrap .em-inbox-scheduled-row {
    border-bottom: 1px solid var(--gs-border) !important;
    background: transparent;
    animation: em-inbox-rise 0.5s var(--gs-ease) both;
}
.em-inbox-wrap .em-inbox-scheduled-row:hover { background: var(--gs-glass) !important; }
.em-inbox-wrap .em-inbox-scheduled-when { color: var(--gs-accent) !important; }
.em-inbox-wrap .em-inbox-scheduled-to,
.em-inbox-wrap .em-inbox-scheduled-subject { color: var(--gs-text) !important; }

/* === BELL: brighter pulse on glass === */
.em-inbox-wrap .em-inbox-bell.has-unread { border-color: var(--gs-magenta) !important; }
.em-inbox-wrap .em-inbox-bell-badge {
    background: var(--gs-magenta) !important;
    box-shadow: 0 0 12px rgba(182, 8, 201, 0.6);
}
@keyframes em-inbox-bell-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); background: var(--gs-glass-strong) !important; }
}

/* === SELECT-PAGE row + thread-list select-all === */
.em-inbox-wrap .em-inbox-selectall-row {
    background: rgba(11,14,20,0.5) !important;
    border-bottom: 1px solid var(--gs-border) !important;
    color: var(--gs-muted) !important;
}

/* === Composer hint chips === */
.em-inbox-wrap .em-inbox-sched-hint { color: var(--gs-accent) !important; text-align: right; }
.em-inbox-wrap .em-inbox-origin-chip {
    background: var(--gs-glass-strong) !important;
    color: var(--gs-text) !important;
}
.em-inbox-wrap .em-inbox-snoozed-pill {
    background: rgba(182, 8, 201, 0.2) !important;
    color: #f4d4ff !important;
}

/* === Reduced motion respect === */
@media (prefers-reduced-motion: reduce) {
    .em-inbox-wrap *,
    .em-inbox-wrap *::before,
    .em-inbox-wrap *::after {
        animation-duration: 0.001s !important;
        animation-delay: 0s !important;
        transition: none !important;
    }
}

/* === Modals stay light to remain legible against wp-admin shell.
 * Override key tokens INSIDE modals so form inputs use light theme. */
.em-inbox-wrap .components-modal__frame,
.em-inbox-composer-modal,
.em-inbox-filters-modal,
.em-inbox-vacation-modal,
.em-inbox-preview-modal,
.em-inbox-labels-modal,
.em-inbox-addinbox-modal { /* light theme already from wp-components */ }

/* === SLICE 2uu / 2vv — Two-column body layout
 * Col 1: LeftRail (search + filters OR CustomerCard).
 * Col 2: toggles between the threads list (FeedView) and the open
 *        thread reader (ThreadView). User goes Back from the reader
 *        to return to the list — single pane reused.
 */
.em-inbox-body.em-inbox-body--three-col {
    display: grid !important;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 0;
}

.em-inbox-leftrail {
    background: rgba(11, 14, 20, 0.55);
    border-right: 1px solid var(--gs-border);
    padding: 16px 14px 18px;
    overflow-y: auto;
    max-height: 75vh;
    animation: em-inbox-rise-left 0.6s var(--gs-ease) 0.2s both;
}
.em-inbox-leftrail-search {
    margin: 0 0 14px;
    animation: em-inbox-rise 0.5s var(--gs-ease) 0.3s both;
}
.em-inbox-leftrail-filters {
    animation: em-inbox-rise 0.5s var(--gs-ease) 0.4s both;
}

/* Filter pills stack vertically in the left rail */
.em-inbox-wrap .em-inbox-filters.em-inbox-filters--column {
    flex-direction: column !important;
    align-items: stretch !important;
}
.em-inbox-wrap .em-inbox-filters.em-inbox-filters--column .em-inbox-filter {
    text-align: left !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    white-space: nowrap;
}

/* Label bar also stacks below the filter pills */
.em-inbox-wrap .em-inbox-label-bar.em-inbox-label-bar--column {
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--gs-border);
}
.em-inbox-wrap .em-inbox-label-bar.em-inbox-label-bar--column .em-inbox-label-pill {
    text-align: left !important;
    padding: 5px 10px !important;
}

/* === CustomerCard === */
.em-inbox-card {
    color: var(--gs-text);
    animation: em-inbox-rise 0.5s var(--gs-ease) 0.2s both;
}
.em-inbox-card--loading, .em-inbox-card--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--gs-muted);
}
.em-inbox-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gs-border);
}
.em-inbox-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--gs-border-strong);
    flex-shrink: 0;
}
.em-inbox-card-id { min-width: 0; flex: 1; }
.em-inbox-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gs-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.em-inbox-card-email {
    font-size: 12px;
    color: var(--gs-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.em-inbox-card-meta {
    font-size: 11px;
    color: var(--gs-muted);
    margin-top: 4px;
}
.em-inbox-card-meta-warn { color: #ffb84d !important; }

.em-inbox-card-section {
    background: var(--gs-glass);
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    animation: em-inbox-rise 0.5s var(--gs-ease) both;
}
.em-inbox-card-section:nth-child(2) { animation-delay: 0.30s; }
.em-inbox-card-section:nth-child(3) { animation-delay: 0.40s; }
.em-inbox-card-section:nth-child(4) { animation-delay: 0.50s; }
.em-inbox-card-section:nth-child(5) { animation-delay: 0.60s; }

.em-inbox-card-section h3 {
    margin: 0 0 8px;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gs-muted);
    font-weight: 600;
}
.em-inbox-card-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 0;
}
.em-inbox-card-stats dt {
    color: var(--gs-muted);
    font-size: 12px;
    margin: 0;
}
.em-inbox-card-stats dd {
    color: var(--gs-text);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    text-align: right;
}
.em-inbox-card-na {
    color: var(--gs-muted);
    font-style: italic;
    font-size: 11px;
    margin: 0;
}

/* === SLICE 2zz.3 — InboxOwnerCard (above the dark glass shell) === */
.em-inbox-owner-card-wrap {
    position: relative;
    max-width: 1600px;
    margin: 18px auto 14px;
    padding: 0 28px;
}
.em-inbox-owner-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background:
        linear-gradient(135deg, rgba(182, 8, 201, 0.12) 0%, rgba(110, 193, 228, 0.08) 100%),
        rgba(15, 20, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #e8edf5;
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
.em-inbox-owner-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}
.em-inbox-owner-card.is-open {
    border-color: rgba(182, 8, 201, 0.55);
    box-shadow: 0 8px 28px rgba(182, 8, 201, 0.25);
}
.em-inbox-owner-card.is-all .em-inbox-owner-card-avatar {
    background: linear-gradient(135deg, #b608c9, #6ec1e4);
}

.em-inbox-owner-card-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}
.em-inbox-owner-card-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-inbox-owner-card-fallback { font-family: inherit; }
.em-inbox-owner-card-all-glyph { font-size: 22px; line-height: 1; }

.em-inbox-owner-card-id {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.em-inbox-owner-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #e8edf5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.em-inbox-owner-card-email {
    font-size: 12px;
    color: #8b98b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.em-inbox-owner-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.em-inbox-owner-card-chip {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    color: #6ec1e4;
}
.em-inbox-owner-card-unread {
    background: linear-gradient(135deg, #b608c9, #6ec1e4);
    color: #fff;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(182, 8, 201, 0.4);
}
.em-inbox-owner-card-caret {
    color: #8b98b0;
    font-size: 14px;
    transition: transform 0.2s ease;
}
.em-inbox-owner-card.is-open .em-inbox-owner-card-caret { transform: rotate(180deg); }

/* === Picker popover === */
.em-inbox-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 28px;
    right: 28px;
    background: rgba(15, 20, 32, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    z-index: 50;
    overflow: hidden;
    animation: em-inbox-rise 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
.em-inbox-picker-search {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.em-inbox-picker-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 8px 12px;
    color: #e8edf5;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}
.em-inbox-picker-search input::placeholder { color: #8b98b0; }
.em-inbox-picker-search input:focus {
    outline: none;
    border-color: rgba(182, 8, 201, 0.5);
    box-shadow: 0 0 0 3px rgba(182, 8, 201, 0.18);
}
.em-inbox-picker-list { margin: 0; padding: 6px 0; list-style: none; max-height: 360px; overflow-y: auto; }
.em-inbox-picker-list li { margin: 0; }
.em-inbox-picker-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    color: #e8edf5;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    font-family: inherit;
}
.em-inbox-picker-row:hover { background: rgba(255, 255, 255, 0.04); }
.em-inbox-picker-row.is-current { background: rgba(182, 8, 201, 0.16); }
.em-inbox-picker-row .em-inbox-owner-card-avatar { width: 36px; height: 36px; font-size: 14px; }
.em-inbox-picker-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.em-inbox-picker-name { font-size: 13px; font-weight: 600; color: #e8edf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-inbox-picker-email { font-size: 11px; color: #8b98b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-inbox-picker-meta { flex-shrink: 0; }
.em-inbox-picker-unread {
    background: rgba(182, 8, 201, 0.28);
    color: #f4d4ff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.em-inbox-picker-empty { padding: 16px; color: #8b98b0; font-size: 12px; text-align: center; }
.em-inbox-picker-all .em-inbox-owner-card-avatar {
    background: linear-gradient(135deg, #b608c9, #6ec1e4);
}

/* The inbox toolbar no longer hosts the inbox selector — give it
 * appropriate spacing alone. */
.em-inbox-wrap .em-inbox-toolbar > .components-base-control { display: none; }

/* === ADD-INBOX modal (slice 2ss-D) === */
.em-inbox-addinbox-modal .components-modal__content { max-width: 480px; }
.em-inbox-addinbox-help {
    background: #f6f7f7;
    border-left: 3px solid #2271b1;
    padding: 8px 12px;
    font-size: 12px;
    color: #50575e;
    margin-bottom: 12px;
}

/* ============================================================
 * SLICE 2zz.8 — Cursor-following border glow, 3D tilt, spotlight,
 * + universal staggered entrance. JS (inbox-app.js) keeps the
 * --em-mx / --em-my CSS vars updated on whichever element the
 * pointer is over; everything else is pure CSS so the GPU does
 * all the work.
 * ============================================================ */

:root {
    --em-glow-magenta: rgba(182, 8, 201, 0.55);
    --em-glow-blue:    rgba(110, 193, 228, 0.55);
    --em-glow-accent:  rgba(151, 228, 110, 0.45);
}

/* ── Base hook ───────────────────────────────────────────────────
 * Every selector in the JS SELECTORS list. These rules don't bind
 * to the JS class; they're plain CSS additions to existing styles.
 * The pseudo-elements are inherited via `:is()` so we don't have
 * to duplicate them on every selector. */
.em-inbox-wrap .em-inbox-filter,
.em-inbox-wrap .em-inbox-thread-row,
.em-inbox-wrap .em-inbox-filters-btn,
.em-inbox-wrap .em-inbox-bell,
.em-inbox-wrap .em-inbox-help-btn,
.em-inbox-wrap .em-inbox-vac-btn,
.em-inbox-wrap .em-inbox-recovery-btn,
.em-inbox-wrap .em-inbox-addinbox-btn,
.em-inbox-wrap .em-inbox-message,
.em-inbox-wrap .em-inbox-card-section,
.em-inbox-wrap .em-inbox-scheduled-row,
.em-inbox-wrap .em-inbox-att-add,
.em-inbox-wrap .em-inbox-thread-actions .components-button,
.em-inbox-owner-card,
.em-inbox-picker-row,
.em-inbox-messages-tab,
.em-chat-subnav-item {
    position: relative;
    isolation: isolate;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ── Spotlight background ───────────────────────────────────────
 * A soft radial highlight that fades to nothing, painted under
 * the existing background. Visible only when the pointer is over
 * the element (--em-mx is unset otherwise). */
.em-inbox-wrap .em-inbox-filter::before,
.em-inbox-wrap .em-inbox-thread-row::before,
.em-inbox-wrap .em-inbox-filters-btn::before,
.em-inbox-wrap .em-inbox-bell::before,
.em-inbox-wrap .em-inbox-help-btn::before,
.em-inbox-wrap .em-inbox-vac-btn::before,
.em-inbox-wrap .em-inbox-recovery-btn::before,
.em-inbox-wrap .em-inbox-addinbox-btn::before,
.em-inbox-wrap .em-inbox-message::before,
.em-inbox-wrap .em-inbox-card-section::before,
.em-inbox-wrap .em-inbox-scheduled-row::before,
.em-inbox-wrap .em-inbox-att-add::before,
.em-inbox-owner-card::before,
.em-inbox-picker-row::before,
.em-inbox-messages-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle 240px at calc(var(--em-mx, 0.5) * 100%) calc(var(--em-my, 0.5) * 100%),
        rgba(110, 193, 228, 0.20) 0%,
        rgba(182, 8, 201, 0.10) 35%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 0;
}

/* ── Border glow ─────────────────────────────────────────────────
 * Magenta→blue diagonal gradient masked to a 1px ring around the
 * element. The radial-gradient inside the linear-gradient creates
 * a "spot" that brightens where the cursor is. */
.em-inbox-wrap .em-inbox-filter::after,
.em-inbox-wrap .em-inbox-thread-row::after,
.em-inbox-wrap .em-inbox-filters-btn::after,
.em-inbox-wrap .em-inbox-bell::after,
.em-inbox-wrap .em-inbox-help-btn::after,
.em-inbox-wrap .em-inbox-vac-btn::after,
.em-inbox-wrap .em-inbox-recovery-btn::after,
.em-inbox-wrap .em-inbox-addinbox-btn::after,
.em-inbox-wrap .em-inbox-message::after,
.em-inbox-wrap .em-inbox-card-section::after,
.em-inbox-wrap .em-inbox-scheduled-row::after,
.em-inbox-wrap .em-inbox-att-add::after,
.em-inbox-owner-card::after,
.em-inbox-picker-row::after,
.em-inbox-messages-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(
        circle 180px at calc(var(--em-mx, 0.5) * 100%) calc(var(--em-my, 0.5) * 100%),
        var(--em-glow-magenta) 0%,
        var(--em-glow-blue) 40%,
        rgba(255, 255, 255, 0.08) 70%,
        transparent 90%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 1;
}

/* Reveal both layers on hover (or when the JS adds .em-glow-active). */
.em-inbox-wrap .em-inbox-filter:hover::before,
.em-inbox-wrap .em-inbox-filter.em-glow-active::before,
.em-inbox-wrap .em-inbox-thread-row:hover::before,
.em-inbox-wrap .em-inbox-thread-row.em-glow-active::before,
.em-inbox-wrap .em-inbox-filters-btn:hover::before,
.em-inbox-wrap .em-inbox-bell:hover::before,
.em-inbox-wrap .em-inbox-help-btn:hover::before,
.em-inbox-wrap .em-inbox-vac-btn:hover::before,
.em-inbox-wrap .em-inbox-recovery-btn:hover::before,
.em-inbox-wrap .em-inbox-addinbox-btn:hover::before,
.em-inbox-wrap .em-inbox-message:hover::before,
.em-inbox-wrap .em-inbox-card-section:hover::before,
.em-inbox-wrap .em-inbox-scheduled-row:hover::before,
.em-inbox-wrap .em-inbox-att-add:hover::before,
.em-inbox-owner-card:hover::before,
.em-inbox-owner-card.em-glow-active::before,
.em-inbox-picker-row:hover::before,
.em-inbox-messages-tab:hover::before,
.em-inbox-wrap .em-inbox-filter:hover::after,
.em-inbox-wrap .em-inbox-filter.em-glow-active::after,
.em-inbox-wrap .em-inbox-thread-row:hover::after,
.em-inbox-wrap .em-inbox-thread-row.em-glow-active::after,
.em-inbox-wrap .em-inbox-filters-btn:hover::after,
.em-inbox-wrap .em-inbox-bell:hover::after,
.em-inbox-wrap .em-inbox-help-btn:hover::after,
.em-inbox-wrap .em-inbox-vac-btn:hover::after,
.em-inbox-wrap .em-inbox-recovery-btn:hover::after,
.em-inbox-wrap .em-inbox-addinbox-btn:hover::after,
.em-inbox-wrap .em-inbox-message:hover::after,
.em-inbox-wrap .em-inbox-card-section:hover::after,
.em-inbox-wrap .em-inbox-scheduled-row:hover::after,
.em-inbox-wrap .em-inbox-att-add:hover::after,
.em-inbox-owner-card:hover::after,
.em-inbox-owner-card.em-glow-active::after,
.em-inbox-picker-row:hover::after,
.em-inbox-messages-tab:hover::after {
    opacity: 1;
}

/* ── 3D tilt — perspective-based rotation that lets the surface
 *    "lean toward" the cursor. Combined with the existing
 *    translateY(-1px) hover lift via a CSS var. Subtle (4deg max). */
.em-inbox-wrap .em-inbox-thread-row.em-glow-active,
.em-inbox-wrap .em-inbox-message.em-glow-active,
.em-inbox-wrap .em-inbox-card-section.em-glow-active,
.em-inbox-wrap .em-inbox-scheduled-row.em-glow-active,
.em-inbox-owner-card.em-glow-active {
    transform:
        perspective(900px)
        translateY(-2px)
        rotateX(calc((0.5 - var(--em-my, 0.5)) * 4deg))
        rotateY(calc((var(--em-mx, 0.5) - 0.5) * 6deg));
}

/* The smaller pill / button items only lift, no rotate (rotation
 * on a 28px-tall pill looks jittery). */
.em-inbox-wrap .em-inbox-filter.em-glow-active,
.em-inbox-wrap .em-inbox-filters-btn.em-glow-active,
.em-inbox-wrap .em-inbox-bell.em-glow-active,
.em-inbox-wrap .em-inbox-help-btn.em-glow-active,
.em-inbox-wrap .em-inbox-vac-btn.em-glow-active,
.em-inbox-wrap .em-inbox-recovery-btn.em-glow-active,
.em-inbox-wrap .em-inbox-addinbox-btn.em-glow-active,
.em-inbox-messages-tab.em-glow-active {
    transform: translateY(-1px);
}

/* Keep the existing text/avatar above the glow layers. */
.em-inbox-wrap .em-inbox-thread-row > *,
.em-inbox-wrap .em-inbox-message > *,
.em-inbox-wrap .em-inbox-card-section > *,
.em-inbox-wrap .em-inbox-scheduled-row > *,
.em-inbox-wrap .em-inbox-filter > *,
.em-inbox-owner-card > *,
.em-inbox-picker-row > * {
    position: relative;
    z-index: 2;
}

/* ── Universal staggered entrance ──
 * --em-i is set by the JS stagger initializer in inbox-app.js.
 * Each child uses its index to compute its own delay. The keyframe
 * itself was defined back in slice 2ss; we just extend the parents
 * that get auto-staggered.
 */
.em-inbox-wrap [data-em-i] {
    animation: em-inbox-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--em-i, 0) * 45ms + 80ms);
}

/* Thread-list items animation override (the slice-2ss nth-child rules
 * only covered the first 15; --em-i scales arbitrarily). */
.em-inbox-wrap .em-inbox-thread-list > li.em-inbox-thread-row[data-em-i] {
    animation-name: em-inbox-rise;
    animation-delay: calc(var(--em-i, 0) * 45ms + 250ms);
}

/* Filter pills already use em-inbox-pop — keep them on it but drive
 * delay from --em-i for arbitrary length. */
.em-inbox-wrap .em-inbox-filters > .em-inbox-filter[data-em-i] {
    animation-name: em-inbox-pop;
    animation-delay: calc(var(--em-i, 0) * 35ms + 220ms);
}

/* ── Reduced-motion: kill the entrance + tilt, keep a flat fade. ── */
@media (prefers-reduced-motion: reduce) {
    .em-inbox-wrap [data-em-i] {
        animation: none !important;
    }
    .em-inbox-wrap .em-inbox-thread-row.em-glow-active,
    .em-inbox-wrap .em-inbox-message.em-glow-active,
    .em-inbox-wrap .em-inbox-card-section.em-glow-active,
    .em-inbox-wrap .em-inbox-scheduled-row.em-glow-active,
    .em-inbox-owner-card.em-glow-active {
        transform: none !important;
    }
    .em-inbox-wrap *::before,
    .em-inbox-wrap *::after,
    .em-inbox-owner-card::before,
    .em-inbox-owner-card::after,
    .em-inbox-picker-row::before,
    .em-inbox-picker-row::after,
    .em-inbox-messages-tab::before,
    .em-inbox-messages-tab::after {
        transition: none !important;
    }
}

/* ============================================================
 * Digital Loader (slice 3d)
 * Centered, multi-ring orbital loader with cascading-glyph
 * label. Used everywhere the inbox previously rendered the tiny
 * wp.components.Spinner in the top-left of its container.
 * ============================================================ */
.em-loader-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 260px;
    padding: 28px 16px;
    box-sizing: border-box;
    animation: em-loader-stage-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes em-loader-stage-in {
    0%   { opacity: 0; transform: translateY(10px) scale(0.97); filter: blur(10px); }
    55%  { filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.em-loader-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
}

.em-loader-grid {
    position: absolute;
    inset: -70px;
    pointer-events: none;
    background:
        linear-gradient(rgba(110, 193, 228, 0.10) 1px, transparent 1px) 0 0/22px 22px,
        linear-gradient(90deg, rgba(110, 193, 228, 0.10) 1px, transparent 1px) 0 0/22px 22px,
        radial-gradient(circle at 50% 50%, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.95) 70%);
    mask: radial-gradient(circle at 50% 50%, #000 0%, #000 30%, transparent 70%);
    -webkit-mask: radial-gradient(circle at 50% 50%, #000 0%, #000 30%, transparent 70%);
    opacity: 0.55;
    animation: em-loader-grid-pan 6s linear infinite;
}
@keyframes em-loader-grid-pan {
    from { background-position: 0 0, 0 0, 0 0; }
    to   { background-position: 22px 22px, 22px 22px, 0 0; }
}

.em-loader {
    position: relative;
    width: 92px;
    height: 92px;
    z-index: 1;
}
.em-loader::before,
.em-loader::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.em-loader::before {
    background: conic-gradient(from 0deg, transparent 0deg, transparent 200deg, #b608c9 290deg, #ffffff 340deg, transparent 360deg);
    -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%, #000 100%);
            mask: radial-gradient(circle, transparent 60%, #000 62%, #000 100%);
    filter: drop-shadow(0 0 8px rgba(182, 8, 201, 0.55));
    animation: em-loader-spin 1.6s linear infinite;
}
.em-loader::after {
    inset: 14px;
    background: conic-gradient(from 180deg, transparent 0deg, transparent 210deg, #6ec1e4 300deg, #ffffff 345deg, transparent 360deg);
    -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%, #000 100%);
            mask: radial-gradient(circle, transparent 55%, #000 57%, #000 100%);
    filter: drop-shadow(0 0 6px rgba(110, 193, 228, 0.55));
    animation: em-loader-spin-reverse 1.1s linear infinite;
}
.em-loader-core {
    position: absolute;
    inset: 30px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #ffffff 0%, #b608c9 38%, #6ec1e4 80%);
    box-shadow:
        0 0 22px rgba(182, 8, 201, 0.55),
        0 0 44px rgba(110, 193, 228, 0.35),
        inset 0 0 12px rgba(255, 255, 255, 0.25);
    animation: em-loader-core-pulse 1.25s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.em-loader-core::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, transparent 60%);
    filter: blur(4px);
    opacity: 0.65;
    animation: em-loader-halo 2.2s ease-in-out infinite;
}
.em-loader-tick {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255,255,255,0.9), 0 0 12px rgba(110, 193, 228, 0.7);
    transform-origin: center center;
    animation: em-loader-orbit 2.4s linear infinite;
}
.em-loader-tick:nth-child(2) { animation-delay: -0.8s; background: #ffd5fb; box-shadow: 0 0 6px rgba(255,213,251,0.9), 0 0 12px rgba(182, 8, 201, 0.7); }
.em-loader-tick:nth-child(3) { animation-delay: -1.6s; }

@keyframes em-loader-spin         { to { transform: rotate(360deg); } }
@keyframes em-loader-spin-reverse { to { transform: rotate(-360deg); } }
@keyframes em-loader-core-pulse {
    0%   { transform: scale(0.78); opacity: 0.85; }
    100% { transform: scale(1.08); opacity: 1; }
}
@keyframes em-loader-halo {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50%      { opacity: 0.75; transform: scale(1.15); }
}
@keyframes em-loader-orbit {
    from { transform: rotate(0deg) translateX(40px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

.em-loader-label {
    display: flex;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(232, 237, 245, 0.55);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    z-index: 1;
}
.em-loader-label span {
    display: inline-block;
    animation: em-loader-glyph 1.6s ease-in-out infinite;
    will-change: opacity, transform, color;
}
.em-loader-label span:nth-child(1) { animation-delay: 0.00s; }
.em-loader-label span:nth-child(2) { animation-delay: 0.08s; }
.em-loader-label span:nth-child(3) { animation-delay: 0.16s; }
.em-loader-label span:nth-child(4) { animation-delay: 0.24s; }
.em-loader-label span:nth-child(5) { animation-delay: 0.32s; }
.em-loader-label span:nth-child(6) { animation-delay: 0.40s; }
.em-loader-label span:nth-child(7) { animation-delay: 0.48s; }
.em-loader-label span:nth-child(8) { animation-delay: 0.56s; }
.em-loader-label span:nth-child(9) { animation-delay: 0.64s; }
.em-loader-label span:nth-child(10){ animation-delay: 0.72s; }
@keyframes em-loader-glyph {
    0%, 70%, 100% { opacity: 0.32; transform: translateY(0); color: rgba(232, 237, 245, 0.55); text-shadow: none; }
    35%           { opacity: 1;    transform: translateY(-3px); color: #ffffff; text-shadow: 0 0 8px rgba(182, 8, 201, 0.7), 0 0 14px rgba(110, 193, 228, 0.45); }
}

/* If the loader sits inside a small/inline slot, allow it to shrink. */
.em-loader-stage--compact {
    min-height: 120px;
    padding: 14px 8px;
}
.em-loader-stage--compact .em-loader { width: 56px; height: 56px; }
.em-loader-stage--compact .em-loader-core { inset: 18px; }
.em-loader-stage--compact .em-loader-tick { animation-name: em-loader-orbit-compact; }
@keyframes em-loader-orbit-compact {
    from { transform: rotate(0deg) translateX(24px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(24px) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .em-loader-stage,
    .em-loader::before,
    .em-loader::after,
    .em-loader-core,
    .em-loader-core::after,
    .em-loader-tick,
    .em-loader-label span,
    .em-loader-grid {
        animation: none !important;
    }
}
