/* Pulido visual del correo corporativo. Se mantiene dentro del módulo de correo. */
.email-page {
    --email-ink: #2d3530;
    --email-muted: #656f68;
    --email-line: #e5e8e3;
    --email-accent: #1f6f4f;
    --email-accent-soft: #eef0ec;
    height: calc(100vh - 100px);
    min-height: 650px;
    padding-bottom: 18px;
    color: var(--email-ink);
}

.email-head {
    align-items: center;
    margin-bottom: 14px;
}

.email-head h2 {
    letter-spacing: -.025em;
}

.email-head > div:last-child > .btn {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 8px;
    font-weight: 650;
}

.email-layout {
    grid-template-columns: minmax(175px, 205px) minmax(340px, min(34vw, 460px)) minmax(0, 1fr);
    height: calc(100% - 82px);
    min-height: 560px;
    border-color: #e5e8e3;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(45,53,48,.08);
}

.email-sidebar {
    padding: 14px 12px;
    background: #f6f7f4;
}

.email-sidebar select,
.email-toolbar label:first-child,
.email-classify .form-control {
    border-color: #e5e8e3;
    border-radius: 8px;
}

#email-folders {
    gap: 5px;
}

#email-folders button {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    transition: color .15s ease, background .15s ease;
}

#email-folders button:hover,
#email-folders button.active {
    color: #1a5a41;
    background: #eef0ec;
}

.email-inbox {
    min-height: 0;
    background: #ffffff;
}

.email-toolbar {
    min-height: 0;
    flex-shrink: 0;
    gap: 8px 12px;
    padding: 8px 10px;
    background: #fbfbf9;
}

.email-toolbar label:first-child {
    min-height: 38px;
    padding: 6px 10px;
}

.email-toolbar label:first-child:focus-within {
    border-color: #9aa39c;
    box-shadow: 0 0 0 3px rgba(31,111,79,.11);
}

.email-toolbar label:first-child input {
    width: 100%;
    min-width: 0;
    color: var(--email-ink);
}

.email-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
}

.email-toolbar .email-search-field {
    width: 100%;
    min-width: 0;
}

.email-toolbar .email-filter-row,
.email-toolbar .email-filter-set {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.email-toolbar .email-filter-row {
    justify-content: flex-start;
    gap: 10px;
}

.email-toolbar .email-filter-set {
    min-width: 0;
}

.email-toolbar .email-filter-set + .email-filter-set {
    padding-left: 10px;
    border-left: 1px solid #e5e8e3;
}

.email-toolbar label.email-filter-check {
    position: relative;
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e8e3;
    border-radius: 7px;
    color: #59635c;
    background: #ffffff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.email-toolbar .email-filter-check:hover {
    border-color: #c2c8c1;
    color: #1a5a41;
}

.email-toolbar .email-filter-check:has(input:checked) {
    border-color: #424b45;
    color: #ffffff;
    background: #424b45;
}
.email-filter-check > i { font-size: 22px; line-height: 1; pointer-events: none; }
.email-filter-check:has(input:checked)::after { content: "✓"; position: absolute; right: 3px; bottom: 1px; color: #ffffff; font-size: 11px; font-weight: 700; pointer-events: none; }

.email-toolbar .email-filter-check input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.email-toolbar .email-filter-check:focus-within {
    outline: 2px solid rgba(31,111,79,.24);
    outline-offset: 1px;
}
.email-toolbar .email-filter-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 25;
    width: max-content;
    max-width: 180px;
    padding: 7px 10px;
    border-radius: 6px;
    color: #ffffff;
    background: #2d3530;
    box-shadow: 0 3px 10px rgba(28,36,32,.18);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
    visibility: hidden;
    pointer-events: none;
}
.email-filter-tooltip::before { content: ""; position: absolute; top: -5px; left: 16px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-bottom: 5px solid #2d3530; }
.email-filter-set:last-child .email-filter-tooltip { right: 0; left: auto; }
.email-filter-set:last-child .email-filter-tooltip::before { right: 16px; left: auto; }
.email-filter-check:not([data-tooltip-dismissed]):hover .email-filter-tooltip,
.email-filter-check:not([data-tooltip-dismissed]):focus-within .email-filter-tooltip { visibility: visible; }

.email-list {
    min-height: 0;
    flex: 1;
    scrollbar-color: #d9ddd7 transparent;
    scrollbar-width: thin;
}

.email-item {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    height: 50px;
    min-height: 50px;
    padding: 6px 10px;
    border-radius: 0;
    border-bottom-color: #eef0ec;
    transition: background .14s ease, box-shadow .14s ease;
}

.email-item:hover {
    background: #fbfbf9;
}

.email-item.unread {
    background: #f6f7f4;
}

.email-item.selected {
    background: #eef0ec;
    box-shadow: inset 3px 0 #1f6f4f;
}
.email-item:focus-visible { outline: 2px solid #1f6f4f; outline-offset: -2px; }
.email-item.unread .email-item-heading strong { font-weight: 750; }
.email-item.unread .email-item-subject-row b { font-weight: 650; }

.email-avatar {
    width: 28px;
    height: 28px;
    color: #ffffff;
    background: #656f68;
    font-size: 11px;
}

.email-item-content {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.email-item-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.email-item-heading strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #424b45;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-item-heading time {
    flex: 0 0 auto;
    color: #656f68;
    font-size: 11px;
    white-space: nowrap;
    line-height: 16px;
}

.email-item b {
    display: block;
    overflow: hidden;
    margin-top: 0;
    color: #424b45;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-item-subject-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.email-item-subject-row > b { min-width: 0; flex: 1; }
.email-item-indicators { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; color: #656f68; font-size: 12px; line-height: 16px; }

.email-item-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.email-item-foot small {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    margin: 0;
    color: #656f68;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-item-foot em {
    position: static;
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    color: #8a4a15;
    background: #fbf7ec;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.email-item-foot .email-client-badge {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.email-item-foot .email-client-badge.is-client {
    color: #2d5d98;
    background: #eff5fb;
}

.email-item-foot .email-client-badge.is-other {
    color: #656f68;
    background: #eef0ec;
}

.email-item-foot > i {
    flex: 0 0 auto;
    color: #656f68;
    font-size: 14px;
}

.email-item.is-outbound {
    box-shadow: inset 3px 0 #82c4a4;
}

.email-item.is-outbound.selected {
    box-shadow: inset 3px 0 #1f6f4f;
}

.email-item.is-outbound .email-avatar {
    color: #1f6f4f;
    background: #eef0ec;
}

.email-item-heading .email-account-name {
    color: #1f6f4f;
}

.email-item .email-item-recipient {
    display: block;
    min-width: 0;
    overflow: hidden;
    margin: 0;
    color: #656f68;
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#email-folders button[data-folder="inbox"] i { color: #1f6f4f; }
#email-folders button[data-folder="sentitems"] i { color: #2d5d98; }
#email-folders button[data-folder="drafts"] i { color: #7659c4; }
#email-folders button[data-folder="archive"] i { color: #656f68; }
#email-folders button[data-folder="pending"] i { color: #8a4a15; }

.email-accounts-list > .email-owner-account-card {
    overflow: hidden;
}

.email-owner-account-card .email-account-actions {
    width: 100%;
    max-width: 100%;
}

.email-owner-account-card .email-account-actions .btn {
    flex: 0 1 auto;
    min-width: 0;
}

.email-detail {
    min-height: 0;
    scrollbar-color: #d9ddd7 transparent;
    scrollbar-width: thin;
}

.email-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 3px 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbf9 100%);
}

.email-detail-head > span {
    grid-column: 1;
    grid-row: 1;
    color: var(--email-accent);
    letter-spacing: .055em;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.email-detail-head > small { grid-column: 2; grid-row: 1; font-size: 11px; line-height: 1.4; text-align: right; }
.email-detail-head > p { grid-column: 1 / -1; margin: 0; line-height: 1.5; overflow-wrap: anywhere; }

.email-detail-head h3 {
    grid-column: 1 / -1;
    margin: 0;
    color: #2d3530;
    font-size: clamp(18px, 1.45vw, 22px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.email-detail-actions {
    gap: 7px;
    padding: 6px 12px;
    border-bottom: 1px solid #eef0ec;
}

.email-detail-actions .btn {
    min-height: 33px;
    border-color: #e5e8e3;
    border-radius: 7px;
    color: #59635c;
    font-size: 11px;
    font-weight: 650;
    background: #ffffff;
}

.email-detail-actions .btn:hover {
    color: #1a5a41;
    border-color: #c2c8c1;
    background: #f6f7f4;
}

.email-detail-actions .btn-outline-primary {
    color: #1a5a41;
    border-color: #9aa39c;
}

.email-body {
    min-width: 0;
    min-height: 0;
    padding: 10px 12px;
    color: #424b45;
    font-size: 14px;
    line-height: 1.72;
    overflow-wrap: anywhere;
    overflow-x: auto;
}
.email-body > :first-child { margin-top: 0; }
.email-body > :last-child { margin-bottom: 0; }

.email-body img,
.email-body video {
    max-width: 100%;
    height: auto;
}

.email-body table {
    max-width: 100%;
}

.email-body td,
.email-body th {
    overflow-wrap: anywhere;
}

.email-ai {
    margin: 12px 24px 8px;
    padding: 14px 16px;
    border-color: #d9ddd7;
    border-radius: 10px;
    color: #1a5a41;
    background: #f6f7f4;
}

.email-ai-heading,.email-ai-reply>div { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.email-ai-heading>div>span,.email-assistant-kicker { display:block;color:#1f6f4f;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase; }
.email-ai-heading>div>strong,.email-ai-reply strong { display:block;color:#424b45;font-size:14px; }
.email-ai-priority { border-radius:20px;padding:5px 10px;background:#eef0ec;color:#59635c;font-size:11px;font-weight:700; }
.email-ai-priority.priority-high { background:#fef6ec;color:#a93a28; }
.email-ai-priority.priority-medium { background:#fbf7ec;color:#7a571d; }
.email-ai-overview,.email-ai-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0; }
.email-ai-overview>div,.email-ai-item { min-width:0;padding:10px 12px;border:1px solid #e5e8e3;border-radius:8px;background:#ffffff; }
.email-ai-overview small,.email-ai-overview strong { display:block; }
.email-ai-overview small,.email-ai-item strong { color:#656f68;font-size:11px; }
.email-ai-overview strong { margin-top:4px;color:#424b45;font-size:12px;font-weight:600;overflow-wrap:anywhere; }
.email-ai-item ul { margin:6px 0 0;padding-left:18px;color:#59635c;font-size:12px;line-height:1.5; }
.email-ai-item li+li { margin-top:4px; }
.email-ai-alert { padding:9px 11px;border-radius:7px;background:#fef6ec;color:#8a4a15;font-size:12px; }
.email-ai-reply { margin-top:10px;padding:12px 14px;border:1px solid #e5e8e3;border-radius:8px;background:#ffffff; }
.email-ai-reply small { display:block;margin-top:3px;color:#656f68;font-size:11px; }
.email-ai-reply p { margin:9px 0;white-space:pre-wrap;color:#424b45;font-size:12px;line-height:1.55; }
.email-ai>small { display:block;margin-top:9px;color:#656f68; }
.email-assistant { margin:12px 24px;padding:14px;border:1px solid #d9ddd7;border-radius:12px;background:linear-gradient(145deg,#fbfbf9,#ffffff); }
.email-assistant-heading { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.email-assistant-heading strong,.email-assistant-heading small { display:block; }
.email-assistant-heading strong { margin:2px 0;color:#2d3530;font-size:16px; }
.email-assistant-heading small { color:#656f68;font-size:11px; }
.email-assistant-heading>i { color:#1f6f4f;font-size:22px; }
.email-assistant-prompts { display:flex;flex-wrap:wrap;gap:6px;margin:11px 0; }
.email-assistant-prompts .btn { border:1px solid #d9ddd7;border-radius:18px;background:#ffffff;color:#424b45;font-size:11px; }
.email-assistant-thread { display:grid;gap:8px;max-height:270px;overflow:auto;padding:2px 2px 8px; }
.email-assistant-turn { max-width:90%;padding:9px 12px;border:1px solid #e5e8e3;border-radius:10px;background:#ffffff; }
.email-assistant-turn.from-user { justify-self:end;border-color:#d9ddd7;background:#eef7f2; }
.email-assistant-turn strong { display:block;margin-bottom:3px;color:#59635c;font-size:11px; }
.email-assistant-turn p { margin:0;color:#424b45;font-size:12px;line-height:1.55;overflow-wrap:anywhere; }
.email-assistant-empty { display:flex;align-items:center;gap:9px;padding:10px 12px;border-radius:9px;background:#ffffff;color:#656f68;font-size:12px; }
.email-assistant-empty i { color:#1f6f4f;font-size:18px; }
.email-assistant-form { display:flex;align-items:flex-end;gap:8px; }
.email-assistant-form textarea { flex:1;min-width:0;resize:vertical;border:1px solid #d9ddd7;border-radius:9px;padding:9px 11px;font-size:12px; }
.email-assistant-form button { flex:none; }
.email-assistant-status { display:block;margin-top:7px;color:#656f68;font-size:11px; }

.email-detail-section { border-top:1px solid #eef0ec; }
.email-detail-section > summary { display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px;padding:8px 12px;color:#424b45;cursor:pointer;list-style:none; }
.email-detail-section > summary::-webkit-details-marker { display:none; }
.email-detail-section > summary::after { content:"+";flex:none;color:#656f68;font-size:18px;font-weight:500;line-height:1; }
.email-detail-section[open] > summary { border-bottom:1px solid #eef0ec; }
.email-detail-section[open] > summary::after { content:"−"; }
.email-detail-section > summary span { font-size:12px;font-weight:700; }
.email-detail-section > summary small { margin-left:auto;color:#656f68;font-size:11px;text-align:right; }

.email-attachments,
.email-classify {
    border: 1px solid var(--email-line);
    border-radius: 11px;
    background: #fbfbf9;
}

.email-attachments {
    margin: 0;
    padding: 10px 12px;
    border-width: 1px 0 0;
    border-radius: 0;
}

.email-classify {
    gap: 10px;
    margin: 14px 24px 24px;
    padding: 16px;
}

.email-classify .form-control {
    min-width: 0;
}

.email-classify .form-control:disabled {
    color: #656f68;
    background-color: #f6f7f4;
    cursor: not-allowed;
}

.email-classify > button {
    min-height: 37px;
    border-radius: 7px;
}

.email-empty {
    min-height: 260px;
    gap: 8px;
    padding: 24px;
}

.email-empty i {
    color: #656f68;
}

.email-accounts-list article {
    padding: 12px 13px;
    border-color: #e5e8e3;
    border-radius: 10px;
    background: #ffffff;
}

/* Las cuentas se muestran como tarjetas apiladas para que las acciones no
   ensanchen el panel lateral ni oculten botones detrás de un scroll horizontal. */
.email-accounts-list {
    max-height: 340px;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 5px 2px 2px;
}

.email-accounts-list > article {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border-color: #e5e8e3;
    border-radius: 11px;
    opacity: 1;
    box-shadow: 0 2px 7px rgba(45,53,48,.035);
}

.email-accounts-list > article.is-inactive {
    border-color: #e5e8e3;
    background: #f6f7f4;
    opacity: 1;
}

.email-account-card-head,
.email-account-identity,
.email-account-actions,
.email-account-meta {
    display: flex;
    min-width: 0;
    align-items: center;
}

.email-account-card-head {
    justify-content: space-between;
    gap: 12px;
}

.email-account-identity {
    flex: 1 1 auto;
    gap: 11px;
}

.email-account-identity > div {
    min-width: 0;
}

.email-account-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    color: #1f6f4f;
    background: #eef0ec;
    font-size: 18px;
}

.email-account-identity strong {
    color: #2d3530;
    font-size: 14px;
    line-height: 1.35;
}

.email-account-identity small {
    overflow-wrap: anywhere;
    color: #656f68;
    font-size: 12px;
}

.email-account-identity em {
    display: block;
    margin-top: 5px;
    padding: 7px 9px;
    border-radius: 7px;
    color: #a93a28;
    background: #fdf1ef;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.email-account-meta {
    flex-wrap: wrap;
    gap: 6px 15px;
    padding-left: 49px;
    color: #656f68;
    font-size: 11px;
}

.email-account-actions {
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px solid #eef0ec;
}

.email-account-actions .btn {
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

.email-accounts-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed #d9ddd7;
    border-radius: 9px;
    color: #656f68;
    text-align: center;
}

.email-owner-maintenance {
    margin: 20px 0;
    padding: 17px;
    border: 1px solid #d9ddd7;
    border-radius: 12px;
    background: #fbfbf9;
}

.email-owner-maintenance h5 {
    margin-bottom: 5px;
    color: #8a3022;
    font-size: 18px;
}

.email-owner-maintenance > p {
    margin: 0 0 12px;
    color: #656f68;
    font-size: 12px;
    line-height: 1.55;
}

.email-owner-account-card .email-account-icon {
    color: #59635c;
    background: #eef0ec;
}

@media (max-width: 575px) {
    .email-accounts-list {
        max-height: 300px;
        padding-right: 2px;
    }

    .email-accounts-list > article {
        padding: 12px;
    }

    .email-account-card-head {
        align-items: flex-start;
    }

    .email-account-meta {
        padding-left: 0;
    }

    .email-account-actions .btn {
        flex: 1 1 auto;
    }
}

.email-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e5e8e3;
    border-radius: 9px;
    color: #59635c;
    background: #f6f7f4;
    font-size: 13px;
    line-height: 1.6;
}

.email-callout > i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: #1f6f4f;
    font-size: 18px;
}

.email-compose-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    padding: 5px;
    border: 1px solid #e5e8e3;
    border-radius: 8px 8px 0 0;
    background: #f6f7f4;
}

.email-compose-toolbar button {
    min-width: 32px;
    height: 30px;
    padding: 3px 8px;
    border: 0;
    border-radius: 5px;
    color: #424b45;
    background: transparent;
}

.email-compose-toolbar button:hover,
.email-compose-toolbar button:focus-visible {
    outline: 0;
    background: #eef0ec;
}

.email-compose-toolbar > span {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: #d9ddd7;
}

.email-compose-editor {
    min-height: 190px;
    max-height: 45vh;
    overflow: auto;
    border-radius: 0 0 8px 8px;
    white-space: pre-wrap;
}

.email-compose-editor:empty::before {
    content: attr(data-placeholder);
    color: #656f68;
    pointer-events: none;
}

.email-compose-recipient,
.email-compose-case {
    position: relative;
}

.email-lookup-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 270px;
    overflow: auto;
    padding: 5px;
    border: 1px solid #e5e8e3;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(45,53,48,.16);
}

.email-lookup-option {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 11px;
    border: 0;
    border-radius: 7px;
    color: #2d3530;
    background: transparent;
    text-align: left;
}

.email-lookup-option:hover,
.email-lookup-option:focus-visible {
    outline: 0;
    background: #eef0ec;
}

.email-lookup-option span,
.email-lookup-empty {
    color: #656f68;
    font-size: 12px;
}

.email-lookup-empty {
    padding: 11px;
}

.email-lookup-none {
    color: #59635c;
    border-bottom: 1px solid #eef0ec;
    border-radius: 0;
}

.email-file-dropzone {
    display: flex;
    min-height: 94px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed #c2c8c1;
    border-radius: 11px;
    color: #59635c;
    background: #fbfbf9;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.email-file-dropzone > i {
    color: #1f6f4f;
    font-size: 28px;
}

.email-file-dropzone > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.email-file-dropzone > div span {
    color: #656f68;
    font-size: 12px;
}

.email-file-dropzone:focus-visible,
.email-file-dropzone.is-dragging {
    outline: 0;
    border-color: #2c8a63;
    background: #f6f7f4;
    box-shadow: 0 0 0 3px rgba(44,138,99,.12);
}

.email-file-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.email-file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.email-file-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 68px;
    align-items: center;
    gap: 10px;
    padding: 9px 36px 9px 9px;
    border: 1px solid #e5e8e3;
    border-radius: 9px;
    background: #ffffff;
}

.email-file-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.email-file-info strong,
.email-file-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-file-info strong {
    color: #424b45;
    font-size: 12px;
}

.email-file-info small {
    color: #656f68;
    font-size: 11px;
}

.email-file-thumb,
.email-file-icon {
    display: flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 7px;
    color: #59635c;
    background: #eef0ec;
    object-fit: cover;
}

.email-file-thumb {
    display: block;
}

.email-file-icon i {
    font-size: 22px;
}

.email-file-media {
    width: 118px;
    max-height: 54px;
    flex: 0 0 118px;
}

.email-file-remove {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 25px;
    height: 25px;
    border: 0;
    border-radius: 50%;
    color: #656f68;
    background: #f6f7f4;
    font-size: 18px;
    line-height: 1;
}

.email-file-remove:hover,
.email-file-remove:focus-visible {
    outline: 0;
    color: #a93a28;
    background: #eef0ec;
}

@media (max-width: 575.98px) {
    .email-file-dropzone {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .email-file-dropzone .btn {
        margin-left: auto;
    }
}

.email-action-modal-content {
    overflow: hidden;
    border: 1px solid #e5e8e3;
    border-radius: 14px;
    box-shadow: 0 18px 54px rgba(28,36,32,.2);
}

.email-action-modal-content .modal-header {
    align-items: center;
    padding: 18px 22px;
    border-bottom-color: #eef0ec;
    background: #fbfbf9;
}

.email-action-modal-content .modal-header h4 {
    margin: 2px 0 0;
    color: #2d3530;
    font-size: 22px;
    font-weight: 700;
}

.email-modal-kicker {
    color: #656f68;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.email-action-context {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #59635c;
    background: #f6f7f4;
    font-size: 13px;
}

.email-action-modal-content label {
    margin-bottom: 6px;
    color: #424b45;
    font-size: 12px;
    font-weight: 700;
}

.email-action-modal-content .form-control {
    border-color: #d9ddd7;
    border-radius: 8px;
}

.email-action-modal-content .form-control:focus {
    border-color: #9aa39c;
    box-shadow: 0 0 0 3px rgba(31,111,79,.12);
}

.email-action-modal-content .form-group small {
    display: block;
    margin-top: 5px;
    color: #656f68;
    font-size: 11px;
}

.email-action-message {
    min-height: 150px;
    resize: vertical;
}

.email-action-modal-content .modal-footer {
    border-top-color: #eef0ec;
    background: #fbfbf9;
}

.email-standard-settings > .email-callout {
    margin-top: 4px;
}

.email-toast-container {
    position: fixed;
    z-index: 20050;
    top: 82px;
    right: 22px;
    display: grid;
    width: min(390px, calc(100vw - 32px));
    gap: 9px;
    pointer-events: none;
}

.email-toast {
    display: flex !important;
    align-items: center;
    gap: 11px;
    width: 100%;
    max-width: none;
    padding: 13px 14px;
    border: 1px solid #e5e8e3;
    border-radius: 10px;
    color: #424b45;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(45,53,48,.16);
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-7px);
    transition: opacity .18s ease, transform .18s ease;
}

.email-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.email-toast > i {
    flex: 0 0 auto;
    color: #2c8a63;
    font-size: 22px;
}

.email-toast-warning > i {
    color: #cf761d;
}

.email-toast-error {
    border-color: #d9ddd7;
}

.email-toast-error > i {
    color: #c94a35;
}

.email-toast-copy {
    min-width: 0;
    flex: 1;
    font-size: 13px;
    line-height: 1.45;
}

.email-toast-close {
    flex: 0 0 auto;
    padding: 0 2px;
    border: 0;
    color: #656f68;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .email-layout {
        grid-template-columns: minmax(155px, 185px) minmax(320px, 38vw) minmax(0, 1fr);
    }
}

@media (max-width: 1200px) {
    .email-page {
        min-height: 0;
        height: auto;
    }

    .email-layout {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        min-height: 0;
    }

    .email-inbox {
        max-height: none;
    }
    .email-list { flex: 0 1 auto; max-height: 400px; }
    .email-sidebar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
    .email-sidebar > select { width: auto; max-width: 100%; flex: 0 1 180px; }
    #email-folders { display: flex; flex: 1 1 300px; flex-wrap: wrap; }
    #email-folders button { width: auto; min-height: 36px; padding: 6px 8px; }
    #email-account-status { flex: 1 1 100%; margin: 0; }

    .email-detail-head,
    .email-detail-actions,
    .email-body {
        padding-right: 12px;
        padding-left: 12px;
    }

    .email-ai,
    .email-classify {
        margin-right: 17px;
        margin-left: 17px;
    }

    .email-detail-section > summary { padding-right:12px;padding-left:12px; }

    .email-toast-container {
        top: 72px;
        right: 12px;
    }
}

@media (max-width: 600px) {
    .email-page {
        padding-right: 10px;
        padding-left: 10px;
    }

    .email-head > div:last-child {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .email-head > div:last-child > .btn:first-child {
        grid-column: 1 / -1;
    }

    .email-item {
        padding-right: 9px;
        padding-left: 9px;
    }

    .email-item-heading time {
        font-size: 11px;
    }

    .email-classify {
        grid-template-columns: minmax(0, 1fr);
        margin-right: 12px;
        margin-left: 12px;
    }

    .email-classify h5,
    .email-classify > small {
        grid-column: 1;
    }

    .email-ai-overview,.email-ai-grid { grid-template-columns:1fr; }
    .email-assistant { margin-right:12px;margin-left:12px; }
    .email-assistant-form { align-items:stretch;flex-direction:column; }
}

/* Ajustes guiados por Correcciones Video 01 */
.email-compose-sender-preview{display:block;margin-top:6px;color:#1a5a41;font-weight:600}
.email-document-picker{margin-top:8px;padding:11px;border:1px solid #e5e8e3;border-radius:8px;background:#fbfbf9}
.email-document-picker-heading{display:flex;justify-content:space-between;gap:8px;margin-bottom:8px;color:#424b45;font-size:12px}
.email-document-picker-heading span{color:#656f68;font-size:11px}
.email-document-picker-list{display:grid;gap:5px;max-height:180px;overflow:auto}
.email-document-picker-row{display:flex;align-items:flex-start;gap:8px;margin:0;padding:8px;border:1px solid #e5e8e3;border-radius:6px;background:#ffffff;cursor:pointer}
.email-document-picker-row>input{margin-top:3px}.email-document-picker-row>span{display:grid;min-width:0;gap:2px}.email-document-picker-row strong{overflow:hidden;color:#424b45;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.email-document-picker-row small,.email-document-picker-help,.email-document-picker-empty{color:#656f68;font-size:11px}.email-document-picker-help{display:block;margin-top:8px}.email-document-picker-empty{margin:0;padding:8px}
.email-lookup-external{display:block;margin-top:7px;padding:0;border:0;color:#1a5a41;background:none;font-size:11px;font-weight:700;text-align:left;cursor:pointer}.email-lookup-empty small{display:block;margin-top:6px;color:#656f68;font-size:11px}
.email-detail-actions{display:flex;flex-direction:row;align-items:center;gap:6px;flex-wrap:wrap}
.email-detail-actions > .email-action-group{display:contents}
.email-action-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.email-action-group+.email-action-group{margin:0;padding:0;border:0}
.email-tools-actions{color:#59635c}
.email-attachments-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.email-attachments-heading h5{margin:0 0 6px;font-size:14px;font-weight:650;line-height:1.4}
.email-attachments > .email-attachments-heading { padding: 0; border: 0; }
.email-attachments > .email-attachment-row { padding: 6px 0; line-height: 1.4; }
.email-attachments > .email-attachment-row > span { font-size: 13px; line-height: 1.45; }
.email-attachments .email-attachment-row small { margin-top: 3px; line-height: 1.4; }
.email-attachments .email-attachments-note { margin-top: 6px; line-height: 1.4; }
@media (max-width: 600px) {
    .email-attachments > .email-attachment-row > span { flex: 1 1 calc(100% - 32px); min-width: 0; }
}
.email-attachment-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 0;border-top:1px solid #e5e8e3}.email-attachment-row>span{flex:1;min-width:160px;overflow-wrap:anywhere}.email-attachment-row>span small{display:block;color:#656f68;font-size:11px}.email-attachment-row>i{color:#656f68}.email-attachments-note,.email-attachments-empty{display:block;margin:8px 0 0;color:#656f68;font-size:11px}.email-attachment-row .btn{flex:none}
@media(max-width:600px){.email-attachment-row{align-items:flex-start}.email-attachment-row>span{flex-basis:calc(100% - 30px)}.email-attachment-row .btn{font-size:11px}.email-action-group .btn{padding:6px 8px}}

/* Adjuntos recibidos: miniatura y visor. */
.email-attachment-open {
    display: flex; align-items: center; gap: 10px; flex: 1 1 220px;
    min-width: 0; padding: 4px; border: 0; border-radius: 7px;
    background: transparent; color: #424b45; text-align: left; cursor: pointer;
}
.email-attachment-open:hover { background: #eef0ec; }
.email-attachment-open:focus-visible { outline: 2px solid #424b45; outline-offset: 2px; }
.email-attachment-thumbnail {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden;
    border: 1px solid #e5e8e3; border-radius: 6px; background: #f6f7f4; color: #59635c;
}
.email-attachment-thumbnail > img { width: 100%; height: 100%; object-fit: contain; }
.email-attachment-thumbnail > i { font-size: 28px; }
.email-attachment-thumbnail > small { font-size: 11px; }
.email-attachment-thumbnail[aria-busy="true"] { opacity: .55; }
.email-attachment-copy { display: block; min-width: 0; overflow-wrap: anywhere; }
.email-attachment-copy > strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.4; }
.email-attachment-copy > small { display: block; color: #656f68; font-size: 11px; }
.email-attachment-preview-hint { display: block; margin-top: 4px; font-size: 11px; color: #424b45; }
.email-attachment-preview-dialog:not([open]) { display: none; }
.email-attachment-preview-dialog[open] {
    display: flex; flex-direction: column; position: fixed; inset: 0;
    width: min(1000px, calc(100vw - 32px)); max-width: none;
    height: min(800px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px);
    margin: auto; padding: 0; border: 1px solid #e5e8e3; border-radius: 12px;
    background: #ffffff; color: #424b45; overflow: hidden; box-shadow: 0 20px 80px #15271c55;
}
.email-attachment-preview-dialog::backdrop { background: #11261bb3; }
.email-attachment-preview-dialog > header,
.email-attachment-preview-dialog > footer { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex: none; }
.email-attachment-preview-dialog > header { border-bottom: 1px solid #e5e8e3; }
.email-attachment-preview-dialog > header > div { flex: 1; min-width: 0; }
.email-attachment-preview-dialog header small { font-size: 11px; color: #656f68; }
.email-attachment-preview-dialog h4 { margin: 2px 0 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.email-attachment-preview-close { width: 44px; height: 44px; flex: none; border: 1px solid #e5e8e3; border-radius: 7px; background: #ffffff; font-size: 28px; cursor: pointer; }
.email-attachment-preview-content { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 12px; overflow: auto; background: #eef0ec; }
.email-attachment-preview-content > img,
.email-attachment-preview-content > video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.email-attachment-preview-content > iframe { width: 100%; height: 100%; border: 0; background: #ffffff; }
.email-attachment-preview-content > audio { width: min(100%, 600px); }
.email-attachment-preview-content > pre { align-self: stretch; width: 100%; margin: 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: #ffffff; font-size: 13px; }
.email-attachment-preview-dialog > footer { border-top: 1px solid #e5e8e3; justify-content: space-between; }
.email-attachment-preview-info { min-width: 0; overflow-wrap: anywhere; color: #656f68; font-size: 11px; }
.email-attachment-preview-dialog footer button { flex: none; min-height: 44px; }
@media (max-width: 600px) {
    .email-attachment-open { flex-basis: 100%; }
    .email-attachment-preview-dialog[open] { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 8px; }
    .email-attachment-preview-dialog > header, .email-attachment-preview-dialog > footer { padding: 10px; }
    .email-attachment-preview-dialog h4 { font-size: 14px; }
    .email-attachment-preview-content { padding: 6px; }
}

/* Compositor completo para respuestas y reenvíos. */
.email-action-dialog{max-width:min(1370px,calc(100vw - 36px));}
.email-action-modal-content{max-height:calc(100vh - 36px);display:flex;flex-direction:column;background:#ffffff}
.email-action-modal-content form{display:flex;min-height:0;flex:1;flex-direction:column}
.email-action-header{display:flex;align-items:center;gap:18px;min-height:82px;padding:14px 30px;color:#ffffff;background:linear-gradient(115deg,#2d3530,#59635c)}
.email-action-header>i{font-size:28px}
.email-action-header .email-modal-kicker{color:#d8eee2;font-size:12px;font-weight:500;letter-spacing:.1em}
.email-action-header h4{margin:2px 0 0;color:#ffffff;font-size:28px;font-weight:650}
.email-action-header .close{margin-left:auto;color:#ffffff;opacity:.9;font-size:32px;font-weight:400;text-shadow:none}
.email-action-body{display:flex;min-height:0;overflow:auto;padding:18px 28px 16px;flex-direction:column}
.email-action-original{margin-bottom:13px;padding:10px 16px;border-radius:9px;background:#f6f7f4;color:#59635c;line-height:1.6}
.email-action-original div{display:grid;grid-template-columns:118px minmax(0,1fr);gap:12px}
.email-action-original strong{color:#2d3530;font-weight:650}
.email-action-context{margin:0 0 10px;padding:8px 12px;color:#59635c;background:#f6f7f4;font-size:12px}
.email-action-address-row,.email-action-subject-row{display:grid;grid-template-columns:100px minmax(0,1fr) 52px;align-items:center;gap:12px;margin-bottom:8px}
.email-action-address-row>label,.email-action-subject-row>label{margin:0;color:#2d3530;font-size:16px;font-weight:500}
.email-action-address-row .form-control,.email-action-subject-row .form-control{height:43px;border:1px solid #e5e8e3;border-radius:6px;color:#2d3530;font-size:16px}
.email-action-address-row .form-control:focus,.email-action-subject-row .form-control:focus{border-color:#8db3de;box-shadow:0 0 0 2px rgba(92,144,203,.12)}
.email-action-contact{height:43px;border:1px solid #e5e8e3;border-radius:6px;color:#2d3530;background:#ffffff;font-size:18px}
.email-action-client-dialog {
    width: min(560px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 0;
    border: 1px solid #e5e8e3;
    border-radius: 12px;
    color: #424b45;
    background: #ffffff;
    box-shadow: 0 18px 60px rgba(28,36,32,.25);
}
.email-action-client-dialog[open] { display: flex; flex-direction: column; }
.email-action-client-dialog:not([open]) { display: none; }
.email-action-client-dialog::backdrop { background: rgba(28,36,32,.45); }
.email-action-client-dialog > header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e5e8e3; }
.email-action-client-dialog h4 { margin: 0; font-size: 22px; }
.email-action-client-dialog > header button { flex: 0 0 44px; height: 44px; margin-left: auto; padding: 0; border: 0; border-radius: 6px; background: #f6f7f4; color: inherit; font-size: 28px; }
.email-action-client-body { display: flex; min-height: 0; flex-direction: column; gap: 8px; padding: 16px 20px; }
.email-action-client-body > p { margin: 0 0 4px; color: #656f68; font-size: 13px; line-height: 1.5; }
.email-action-client-body > label { margin: 0; font-size: 14px; font-weight: 600; }
.email-action-client-body > input { flex: 0 0 44px; min-width: 0; font-size: 16px; }
#email-action-client-count { color: #656f68; font-size: 12px; }
.email-action-client-results { display: grid; gap: 8px; min-height: 0; max-height: 340px; overflow: auto; padding: 3px; }
.email-action-client-option { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid #e5e8e3; border-radius: 7px; color: #424b45; background: #ffffff; text-align: left; }
.email-action-client-option > span { display: grid; flex: 1; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.email-action-client-option strong { font-size: 14px; }
.email-action-client-option small { color: #656f68; font-size: 12px; }
.email-action-client-option:disabled { opacity: .55; cursor: not-allowed; }
.email-action-client-option:hover:not(:disabled) { background: #f6f7f4; border-color: #c2c8c1; }
.email-action-client-dialog button:focus-visible { outline: 2px solid #656f68; outline-offset: 1px; }
.email-action-client-empty { margin: 0; padding: 16px 8px; color: #656f68; font-size: 14px; }
.email-action-client-dialog > footer { display: flex; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid #e5e8e3; }
.email-action-client-dialog > footer .btn { min-height: 44px; font-size: 14px; }
.email-action-document-client { margin: 0 0 8px; color: #424b45; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .email-action-client-dialog > header, .email-action-client-body, .email-action-client-dialog > footer { padding: 12px; }
}
.email-action-subject-row{grid-template-columns:100px minmax(0,1fr);margin-top:12px;margin-bottom:12px}
.email-action-subject-row .form-control{font-weight:650}
.email-action-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
    flex: 0 0 auto;
}
.email-action-options > .email-action-priority,
.email-action-options > .email-action-check,
.email-action-options > .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #d9ddd7;
    border-radius: 6px;
    color: #424b45;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-sizing: border-box;
}
.email-action-priority > label { margin: 0; font: inherit; }
#email-action-priority {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 30px;
    min-height: 0;
    padding: 2px 0;
    border: 0;
    background-color: transparent;
    color: inherit;
    font: inherit;
}
.email-action-check { cursor: pointer; }
.email-action-check input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #424b45;
    cursor: pointer;
}
.email-action-options > .email-action-check:has(input:checked) { border-color: #c2c8c1; background: #f6f7f4; }
.email-action-options > .email-action-check:hover,
.email-action-options > .btn:hover { background: #f6f7f4; border-color: #c2c8c1; }
.email-action-options > :focus-within { outline: 2px solid #656f68; outline-offset: 2px; }
.email-action-schedule{display:grid;grid-template-columns:auto minmax(220px,330px) auto 1fr;align-items:center;gap:9px;margin:-3px 0 12px;padding:11px 13px;border:1px solid #e5e8e3;border-radius:7px;background:#fbfbf9}
.email-action-schedule label{margin:0;color:#424b45;font-size:12px;font-weight:700}
.email-action-schedule .form-control{height:36px}
.email-action-schedule small{color:#656f68;font-size:11px}
.email-action-toolbar {
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border-color: #e5e8e3;
    border-radius: 7px 7px 0 0;
    background: #fbfbf9;
    flex: 0 0 auto;
    flex-wrap: wrap;
}
.email-action-tool-group { display: flex; align-items: center; gap: 4px; max-width: 100%; flex-wrap: wrap; }
.email-action-toolbar button,
.email-action-toolbar select,
.email-action-toolbar input[type=color] {
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #e5e8e3;
    border-radius: 5px;
    color: #424b45;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}
.email-action-toolbar button:hover { background: #eef0ec; }
.email-action-toolbar button:focus-visible,
.email-action-toolbar select:focus-visible,
.email-action-toolbar input[type=color]:focus-visible { outline: 2px solid #656f68; outline-offset: 1px; background: #eef0ec; }
.email-action-toolbar select { min-width: 0; max-width: 100%; padding: 6px 4px; }
.email-action-toolbar input[type=color] { width: 44px; padding: 10px; cursor: pointer; }
.email-action-editor-wrap{position:relative;display:flex;min-height:clamp(220px,28vh,340px);flex:1 1 auto}
.email-action-message{width:100%;min-height:220px;max-height:42vh;flex:1 1 auto;overflow:auto;padding:15px 16px 34px;border:1px solid #e5e8e3;border-top:0;border-radius:0 0 7px 7px;outline:none;color:#2d3530;font-size:16px;line-height:1.55;white-space:normal}
.email-action-message:focus{border-color:#9aa39c;box-shadow:0 0 0 2px rgba(31,111,79,.1)}
.email-action-message:empty::before{content:attr(data-placeholder);color:#656f68;pointer-events:none}
#email-action-word-count{position:absolute;right:14px;bottom:8px;color:#656f68;font-size:11px;pointer-events:none}
.email-action-attachments{display:flex;align-items:center;gap:14px;margin:13px 0 0;padding:11px 14px;border:1px dashed #e5e8e3;border-radius:8px;background:#fbfbf9}
.email-action-attachments.is-dragging{border-color:#4fa67f;background:#eef0ec;box-shadow:0 0 0 3px rgba(31,111,79,.1)}
.email-action-attachments>i{color:#424b45;font-size:28px}
.email-action-attachment-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}
.email-action-attachment-copy strong{color:#424b45;font-size:14px}
.email-action-attachment-copy span,.email-action-attachment-copy small{color:#656f68;font-size:11px}
.email-action-attachments .btn{height:40px;padding:7px 12px;border-color:#e5e8e3;color:#424b45;background:#ffffff;font-size:13px}
.email-action-files-list{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.email-action-file{display:flex;align-items:center;gap:8px;max-width:100%;padding:6px 9px;border:1px solid #e5e8e3;border-radius:6px;color:#424b45;background:#ffffff;font-size:11px}
.email-action-file button{padding:0 2px;border:0;color:#656f68;background:none;font-size:18px}
.email-action-file span{display:grid;min-width:0;gap:2px}
.email-action-file strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.email-action-file small{color:#656f68;font-size:11px;white-space:nowrap}
.email-action-forward-files{display:grid;gap:5px;margin-top:8px;padding:10px 12px;border:1px solid #e5e8e3;border-radius:7px;background:#fbfbf9}
.email-action-forward-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;color:#424b45;font-size:12px}
.email-action-forward-heading small,.email-action-forward-empty{margin:0;color:#656f68;font-size:11px}
.email-action-forward-file{display:flex;align-items:flex-start;gap:8px;margin:0;padding:7px 8px;border:1px solid #e5e8e3;border-radius:6px;background:#ffffff;cursor:pointer}
.email-action-forward-file input{flex:0 0 auto;margin:3px 0 0;accent-color:#1f6f4f}
.email-action-forward-file span{display:grid;min-width:0;gap:2px}
.email-action-forward-file strong{overflow:hidden;color:#424b45;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.email-action-forward-file small{color:#656f68;font-size:11px}
.email-action-legal-panel{margin-top:8px;padding:11px;border:1px solid #e5e8e3;border-radius:7px;background:#fbfbf9}
.email-action-legal-panel label{display:block;margin-bottom:6px;color:#424b45;font-size:12px;font-weight:700}
.email-action-legal-panel select{min-height:76px}
.email-action-legal-panel small{display:block;margin-top:5px;color:#656f68;font-size:11px}
.email-action-file .email-action-document-preview-button{padding:4px 8px;border:1px solid #e5e8e3;border-radius:5px;color:#1a5a41;background:#fbfbf9;font-size:11px;font-weight:650;white-space:nowrap}
.email-action-file .email-action-document-preview-button:hover{border-color:#c2c8c1;background:#eef0ec}
.email-action-document-preview{margin-top:9px;border:1px solid #e5e8e3;border-radius:8px;overflow:hidden;background:#ffffff}
.email-action-document-preview-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 11px;border-bottom:1px solid #e5e8e3;color:#424b45;font-size:12px}
.email-action-document-preview-header strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.email-action-document-preview-header button{flex:none;padding:0 4px;border:0;color:#656f68;background:transparent;font-size:22px;line-height:1;cursor:pointer}
.email-action-document-preview-content{display:flex;min-height:100px;max-height:420px;align-items:center;justify-content:center;overflow:auto;background:#f6f7f4}
.email-action-document-preview-content img{display:block;max-width:100%;max-height:400px;object-fit:contain}
.email-action-document-preview-content iframe{width:100%;height:390px;border:0;background:#ffffff}
.email-action-document-preview-content video{max-width:100%;max-height:390px;background:#121815}
.email-action-document-preview-content audio{width:min(500px,90%)}
.email-action-document-preview-status{display:flex;align-items:center;gap:8px;padding:18px;color:#656f68;font-size:12px;text-align:center}
.email-action-document-preview-status.is-error{color:#a93a28}
.email-document-thumbnail-picker.is-open .multi-select-menu {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: min(440px, 60vh);
}
.email-document-thumbnail-picker .multi-select-options { min-height: 0; max-height: 280px; }
.email-document-thumbnail-picker .multi-select-tools > div { align-items: center; flex-wrap: wrap; gap: 8px; }
.email-document-thumbnail-picker .email-document-related-heading {
    flex: 1 1 240px;
    min-width: 0;
    margin: 0 auto 0 0;
    color: #424b45;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.email-document-thumbnail-picker .multi-select-option { min-width: 0; min-height: 82px; gap: 10px !important; }
.email-document-thumbnail-picker .email-document-thumbnail {
    display: flex;
    flex: 0 0 64px;
    width: 64px;
    height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    border: 1px solid #e5e8e3;
    border-radius: 6px;
    color: #656f68;
    background: #f6f7f4;
}
.email-document-thumbnail > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.email-document-thumbnail > i { font-size: 22px; }
.email-document-thumbnail-picker .email-document-thumbnail > small { font-size: 11px !important; line-height: 1.2 !important; }
.email-document-thumbnail.is-loading { opacity: .55; }
.email-document-thumbnail-picker .email-document-option-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.email-document-option-copy > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-document-option-copy > small { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .email-document-thumbnail-picker .email-document-related-heading { flex-basis: 100%; font-size: 18px; }
    .email-document-thumbnail-picker .multi-select-option { min-height: 70px; gap: 8px !important; padding: 8px !important; }
    .email-document-thumbnail-picker .email-document-thumbnail { flex-basis: 52px; width: 52px; height: 52px; }
}
.email-signature-settings>p{margin:3px 0 12px}
.email-account-signatures-list{display:grid;gap:10px;margin-bottom:10px}
.email-signature-setting{padding:12px;border:1px solid #e5e8e3;border-radius:8px;background:#fbfbf9}
.email-signature-setting-head{display:grid;grid-template-columns:minmax(150px,1fr) auto auto;align-items:center;gap:10px;margin-bottom:9px}
.email-signature-setting-head>label{display:flex;align-items:center;gap:6px;margin:0;color:#424b45;font-size:12px;font-weight:600;white-space:nowrap}
.email-signature-setting-head input[type=radio]{accent-color:#1f6f4f}
.email-signature-setting textarea{min-height:76px;resize:vertical}
.email-signature-setting>small{display:block;margin-top:5px;color:#656f68}
.email-signature-empty{margin:0;padding:12px;border:1px dashed #d9ddd7;border-radius:8px;color:#656f68;font-size:13px}
.email-action-signature-preview{white-space:pre-wrap}
@media(max-width:600px){.email-signature-setting-head{grid-template-columns:minmax(0,1fr) auto}.email-signature-setting-head>label{grid-column:1}.email-signature-setting-head>[data-signature-remove]{grid-column:2;grid-row:1/3}}
.email-action-signature{display:grid;grid-template-columns:minmax(240px,1fr) minmax(0,1fr);gap:16px;margin-top:12px;padding:10px 12px;border:1px solid #e5e8e3;border-radius:7px;background:#ffffff}
.email-action-signature label{display:block;margin-bottom:5px;color:#424b45;font-size:12px;font-weight:700}
.email-action-signature .form-control{height:38px}
.email-action-signature-preview{min-height:38px;overflow:hidden;padding:7px 10px;border-left:1px solid #e5e8e3;color:#656f68;font-size:11px;line-height:1.4;white-space:pre-wrap}
.email-action-more-options{margin-top:8px;padding:9px 12px;border-radius:6px;color:#656f68;background:#f6f7f4;font-size:11px}
.email-action-footer{justify-content:space-between;gap:12px;padding:12px 22px;border-top:1px solid #e5e8e3;background:#fbfbf9}
.email-action-footer-left,.email-action-footer-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.email-action-footer .btn{min-height:40px;border-radius:6px;font-size:13px}
.email-action-footer-left .btn{border:0;color:#424b45;background:transparent}
.email-action-footer-right .btn{padding:8px 15px}
.email-action-footer-right .btn-primary{border-color:#424b45;background:#424b45;font-weight:650}
@media(max-width:760px){.email-action-dialog{max-width:calc(100vw - 18px);margin:9px auto}.email-action-modal-content{max-height:calc(100vh - 18px)}.email-action-header{min-height:69px;padding:12px 16px}.email-action-header h4{font-size:22px}.email-action-body{padding:13px 15px}.email-action-address-row,.email-action-subject-row{grid-template-columns:62px minmax(0,1fr) 38px;gap:7px}.email-action-address-row>label,.email-action-subject-row>label{font-size:13px}.email-action-subject-row{grid-template-columns:62px minmax(0,1fr)}.email-action-schedule{grid-template-columns:1fr 1fr}.email-action-schedule small{grid-column:1/-1}.email-action-signature{grid-template-columns:1fr}.email-action-signature-preview{border-top:1px solid #e5e8e3;border-left:0}.email-action-footer{align-items:stretch;flex-direction:column;padding:10px 14px}.email-action-footer-left,.email-action-footer-right{justify-content:flex-end}.email-action-footer-left{justify-content:flex-start}.email-action-footer-right .btn{flex:1}.email-action-attachments{gap:8px;flex-wrap:wrap}.email-action-attachment-copy{flex-basis:calc(100% - 48px)}}

/* Keep complete controls visible as the reply dialog narrows. */
@media (max-width: 900px) {
    .email-action-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .email-action-toolbar { gap: 6px; padding: 6px; }
    .email-action-type-tools { flex: 1 1 100%; }
    .email-action-toolbar select { font-size: 16px; }
    #email-action-priority { font-size: 16px; }
    .email-action-schedule { grid-template-columns: minmax(0, 1fr); }
    .email-action-schedule .form-control { min-width: 0; width: 100%; }
}
@media (max-width: 479px) {
    .email-action-options { grid-template-columns: minmax(0, 1fr); }
    .email-action-options > .email-action-priority { justify-content: space-between; }
    #email-action-priority { flex: 0 1 130px; }
}
