/* <email-chips> — campo de destinatarios como chips. Todo bajo .ec-chips (Bootstrap 3 es global). */

email-chips { display: block; }

.ec-chips { position: relative; font-size: 12px; text-align: left; }
.ec-chips .ec-field { position: relative; }

/* Caja: se ve como un .form-control.input-sm de Bootstrap 3 */
.ec-chips .ec-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    min-height: 30px; max-height: 118px; overflow-y: auto;
    padding: 3px 5px; background: #fff; cursor: text;
    border: 1px solid #ccc; border-radius: 3px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.ec-chips.ec-focus .ec-box,
.ec-chips .ec-box:focus-within {
    border-color: #66afe9;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}
.has-error .ec-chips .ec-box,
.ec-chips.ec-has-bad .ec-box { border-color: #a94442; }
.has-error .ec-chips.ec-focus .ec-box,
.ec-chips.ec-has-bad.ec-focus .ec-box { box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; }

/* Chip */
.ec-chips .ec-chip {
    display: inline-flex; align-items: center; max-width: 100%; min-width: 0;
    height: 22px; border-radius: 11px; overflow: hidden;
    background: #eaf1f8; border: 1px solid #c4d6e8; color: #1f3a55;
    transition: background-color .2s, box-shadow .2s;
}
.ec-chips .ec-chip-txt {
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border: 0; background: transparent; color: inherit; padding: 0 2px 0 9px; height: 20px; line-height: 20px;
    font-size: 12px; cursor: pointer;
}
.ec-chips .ec-chip-txt .fa { margin-right: 4px; }
.ec-chips .ec-chip-x {
    flex: 0 0 auto; border: 0; background: transparent; color: #5f7186;
    width: 22px; height: 20px; padding: 0; font-size: 15px; line-height: 18px; cursor: pointer; border-radius: 0 11px 11px 0;
}
.ec-chips .ec-chip-x:hover { color: #fff; background: #5f7186; }
.ec-chips .ec-chip-txt:focus,
.ec-chips .ec-chip-x:focus { outline: 0; }
.ec-chips .ec-chip-x:focus-visible { outline: 2px solid #1a6bb5; outline-offset: -2px; color: #fff; background: #1a6bb5; }
.ec-chips .ec-chip-txt:hover { text-decoration: underline; }

.ec-chips .ec-chip-bad { background: #fdecea; border-color: #e4a1a1; color: #a94442; }
.ec-chips .ec-chip-bad .ec-chip-x { color: #a94442; }
.ec-chips .ec-chip-bad .ec-chip-x:hover { color: #fff; background: #a94442; }

.ec-chips .ec-chip-flash { background: #fff3cd; border-color: #e0b93f; box-shadow: 0 0 0 2px rgba(224, 185, 63, .35); }

/* Input */
.ec-chips .ec-input {
    flex: 1 1 140px; min-width: 120px; height: 22px; padding: 0 2px;
    border: 0; outline: 0; background: transparent; box-shadow: none; font-size: 12px; color: #333;
}
.ec-chips .ec-input::-ms-clear { display: none; }

/* Sugerencias */
.ec-chips .ec-sug {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    margin: 2px 0 0; padding: 4px 0; list-style: none;
    max-height: 220px; overflow-y: auto;
    background: #fff; border: 1px solid rgba(0, 0, 0, .15); border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.ec-chips .ec-sug li {
    padding: 5px 10px; cursor: pointer; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ec-chips .ec-sug li .fa { color: #8a97a5; margin-right: 4px; }
.ec-chips .ec-sug li b { font-weight: 700; color: #1a6bb5; }
.ec-chips .ec-sug li.ec-sug-on { background: #1a6bb5; color: #fff; }
.ec-chips .ec-sug li.ec-sug-on .fa,
.ec-chips .ec-sug li.ec-sug-on b { color: #fff; }

/* Pie: contador / ayuda */
.ec-chips .ec-foot {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
    margin-top: 3px; font-size: 11.5px; line-height: 1.35; color: #737f8c;
}
.ec-chips .ec-count { font-weight: 600; color: #3c4a58; }
.ec-chips .ec-bad { color: #a94442; font-weight: 600; }
.ec-chips .ec-hint { color: #8a5300; }
.ec-chips .ec-help { margin-left: auto; }

@media (max-width: 767px) {
    .ec-chips .ec-help { margin-left: 0; flex-basis: 100%; }
    .ec-chips .ec-box { max-height: 140px; }
    .ec-chips .ec-chip { height: 26px; border-radius: 13px; }
    .ec-chips .ec-chip-txt { height: 24px; line-height: 24px; }
    .ec-chips .ec-chip-x { width: 28px; height: 24px; }
    .ec-chips .ec-input { height: 26px; font-size: 16px; } /* 16px evita el zoom de iOS */
}

@media (prefers-reduced-motion: reduce) {
    .ec-chips .ec-box, .ec-chips .ec-chip { transition: none; }
}
