/* =============================================================================
   MUNDO CONAN · CHAT v2
   -----------------------------------------------------------------------------
   Hoja de estilos independiente del chat. Todo va bajo el prefijo .mcc- para
   que no choque con nada de style.css (el chat viejo usaba .msg, .chat-btn…,
   clases demasiado genéricas que se pisaban con el resto de la web).

   Los colores salen de variables propias que heredan del tema global de la web
   (atributo data-theme en <html>), así el chat cambia de claro a oscuro solo.
============================================================================= */

/* ─────────────────────────────────────────────────────────────────────────────
   1. TOKENS

   Van en :root, NO en .mcc. Es importante: los modales, los avisos flotantes,
   la ficha de usuario, el menú de reacciones y el visor de imágenes se cuelgan
   de <body>, fuera del contenedor del chat. Si los tokens vivieran en .mcc,
   ahí fuera no existirían y `background: var(--mcc-bg-raised)` se quedaría sin
   valor: el fondo saldría transparente y el texto ilegible.
   ────────────────────────────────────────────────────────────────────────── */
:root {
    color-scheme: light;

    --mcc-bg:            #ffffff;
    --mcc-bg-sunken:     #f4f6fb;
    --mcc-bg-raised:     #ffffff;
    --mcc-bg-hover:      #eef1f8;
    --mcc-bg-own:        #eaf0ff;

    --mcc-text:          #1c2333;
    --mcc-text-soft:     #4a5568;
    /* Sobre blanco, un gris más claro que este no llega al contraste mínimo
       para textos pequeños (horas, contadores, etiquetas). */
    --mcc-text-faint:    #6b7690;

    --mcc-border:        rgba(16, 25, 53, 0.10);
    --mcc-border-strong: rgba(16, 25, 53, 0.18);

    --mcc-brand:         #4f7cff;
    --mcc-brand-ink:     #2c5ae0;
    --mcc-accent:        #e63955;
    --mcc-gold:          #e9a527;
    /* Verde y ámbar oscurecidos para el modo claro: los tonos vivos que se
       usan en oscuro se vuelven ilegibles sobre fondo blanco. */
    --mcc-green:         #0d7d50;
    --mcc-warn:          #b3700c;
    --mcc-spoiler-bg:       #cfd6e6;
    --mcc-spoiler-bg-hover: #bcc5da;
    --mcc-staff-bg:         rgba(233, 165, 39, .10);
    --mcc-staff-bg-hover:   rgba(233, 165, 39, .17);
    --mcc-danger:        #d93450;

    --mcc-shadow-sm:     0 2px 8px rgba(23, 32, 66, 0.07);
    --mcc-shadow:        0 8px 28px rgba(23, 32, 66, 0.12);
    --mcc-shadow-lg:     0 22px 60px rgba(23, 32, 66, 0.22);

    --mcc-radius:        18px;
    --mcc-radius-sm:     11px;
    --mcc-radius-pill:   999px;

    --mcc-font:          'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mcc-font-title:    'Outfit', 'Nunito', system-ui, sans-serif;

    --mcc-header:        linear-gradient(120deg, #101935 0%, #1e2c66 55%, #3a2b6e 100%);
    --mcc-stream-h:      clamp(360px, 52vh, 620px);
}

[data-theme="dark"] {
    color-scheme: dark;

    --mcc-bg:            #131a33;
    --mcc-bg-sunken:     #0d1226;
    --mcc-bg-raised:     #182144;
    --mcc-bg-hover:      #1e2851;
    --mcc-bg-own:        #1b2a5c;

    --mcc-text:          #e8ecf8;
    --mcc-text-soft:     #b6c0dd;
    --mcc-text-faint:    #7c88ac;

    --mcc-border:        rgba(255, 255, 255, 0.09);
    --mcc-border-strong: rgba(255, 255, 255, 0.18);

    --mcc-brand:         #7aa2ff;
    --mcc-brand-ink:     #9ab8ff;
    --mcc-accent:        #ff5c77;
    --mcc-gold:          #f5c04e;
    --mcc-green:         #3ad395;
    --mcc-warn:          #f0a03a;
    --mcc-spoiler-bg:       #333c5e;
    --mcc-spoiler-bg-hover: #414c73;
    --mcc-staff-bg:         rgba(245, 192, 78, .09);
    --mcc-staff-bg-hover:   rgba(245, 192, 78, .16);
    --mcc-danger:        #ff6b83;

    --mcc-shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.35);
    --mcc-shadow:        0 8px 28px rgba(0, 0, 0, 0.45);
    --mcc-shadow-lg:     0 22px 60px rgba(0, 0, 0, 0.6);

    --mcc-header:        linear-gradient(120deg, #0a0f22 0%, #16204d 55%, #2a1f5e 100%);
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. CONTENEDOR
   ────────────────────────────────────────────────────────────────────────── */
.mcc,
.mcc *,
.mcc-modal *,
.mcc-card * { box-sizing: border-box; }

/* Los <button>, <input>, <select> y <textarea> NO heredan la tipografía del
   padre por defecto: hay que decírselo o salen con la fuente del sistema.
   Se aplica también a los trozos que viven fuera de .mcc (modales, ficha…). */
.mcc button, .mcc input, .mcc select, .mcc textarea,
.mcc-modal button, .mcc-modal input, .mcc-modal select, .mcc-modal textarea,
.mcc-card button, .mcc-mentions, .mcc-toast {
    font-family: var(--mcc-font);
}

/* Chrome pinta un fondo amarillo propio en los campos autocompletados que
   ignora el `background` normal. Se tapa con una sombra interior enorme. */
.mcc-input:-webkit-autofill,
.mcc-input:-webkit-autofill:hover,
.mcc-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--mcc-text);
    -webkit-box-shadow: 0 0 0 1000px var(--mcc-bg-raised) inset;
    caret-color: var(--mcc-text);
    transition: background-color 9999s ease-in-out 0s;
}

.mcc {
    width: 100%;
    margin: 32px 0;
    font-family: var(--mcc-font);
    color: var(--mcc-text);
    background: var(--mcc-bg);
    border: 1px solid var(--mcc-border);
    border-radius: var(--mcc-radius);
    box-shadow: var(--mcc-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

.mcc[hidden] { display: none; }

.main-content .mcc { grid-column: 1 / -1; }

/* ─────────────────────────────────────────────────────────────────────────────
   3. CABECERA
   ────────────────────────────────────────────────────────────────────────── */
.mcc-head {
    background: var(--mcc-header);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.mcc-head::after {
    content: '';
    position: absolute;
    inset: auto -60px -120px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 57, 85, 0.30), transparent 70%);
    pointer-events: none;
}

.mcc-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.mcc-head-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 1.15rem;
}

.mcc-head h2 {
    margin: 0;
    font-family: var(--mcc-font-title);
    font-size: clamp(1.05rem, 3.4vw, 1.35rem);
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    line-height: 1.15;
}

.mcc-head-sub {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    color: rgba(255, 255, 255, .74);
    font-weight: 600;
    margin-top: 3px;
}

/* Colores fijos a propósito: la cabecera es oscura en los dos temas, así que
   aquí NO valen los tokens (el verde del modo claro es oscuro y desaparecería
   sobre el degradado azul marino). */
.mcc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ad395;
    box-shadow: 0 0 0 0 rgba(58, 211, 149, .6);
    animation: mcc-pulse 2.4s infinite;
    flex: 0 0 auto;
}
.mcc-dot.is-off  { background: #f0a03a; animation: none; }
.mcc-dot.is-down { background: #ff6b83; animation: none; }

@keyframes mcc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(58, 211, 149, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(58, 211, 149, 0); }
    100% { box-shadow: 0 0 0 0 rgba(58, 211, 149, 0); }
}

.mcc-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.mcc-hbtn {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: .95rem;
    transition: background .18s, transform .18s, border-color .18s;
}
.mcc-hbtn:hover  { background: rgba(255, 255, 255, .24); transform: translateY(-1px); }
.mcc-hbtn:active { transform: translateY(0); }
.mcc-hbtn.is-on  { background: var(--mcc-accent); border-color: transparent; }
.mcc-hbtn[hidden] { display: none; }

/* Identidad del usuario dentro de la cabecera */
.mcc-me {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 5px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--mcc-radius-pill);
    max-width: 210px;
}
.mcc-me img {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,.2);
}
.mcc-me.is-staff {
    background: rgba(233, 165, 39, .22);
    border-color: rgba(233, 165, 39, .45);
}
.mcc-me .mcc-tag { flex: 0 0 auto; }

.mcc-me-name {
    font-weight: 800;
    font-size: .85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. AVISOS (anuncio fijado, modo lento, chat cerrado, sanciones)
   ────────────────────────────────────────────────────────────────────────── */
.mcc-notice {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 18px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.45;
    border-bottom: 1px solid var(--mcc-border);
    background: var(--mcc-bg-sunken);
    color: var(--mcc-text-soft);
}
.mcc-notice i { margin-top: 2px; flex: 0 0 auto; }
.mcc-notice[hidden] { display: none; }

.mcc-notice.is-pin  { background: rgba(233, 165, 39, .12); color: var(--mcc-text); border-left: 4px solid var(--mcc-gold); }
.mcc-notice.is-warn { background: rgba(240, 160, 58, .12); color: var(--mcc-text); border-left: 4px solid var(--mcc-warn); }
.mcc-notice.is-stop { background: rgba(217, 52, 80, .12);  color: var(--mcc-text); border-left: 4px solid var(--mcc-danger); }

/* ─────────────────────────────────────────────────────────────────────────────
   5. PUERTA DE ENTRADA (elegir cómo participar)
   ────────────────────────────────────────────────────────────────────────── */
.mcc-gate { padding: 26px 20px 30px; background: var(--mcc-bg-sunken); }
.mcc-gate[hidden] { display: none; }

/* La puerta y los formularios viven debajo de la lista de mensajes: el chat
   se puede leer sin sesión y solo cambia lo que hay bajo el hilo. */
.mcc-body > .mcc-gate,
.mcc-body > .mcc-form { border-top: 1px solid var(--mcc-border); }

.mcc-gate-head { text-align: center; max-width: 520px; margin: 0 auto 22px; }
.mcc-gate-head h3 {
    margin: 0 0 6px;
    font-family: var(--mcc-font-title);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--mcc-text);
}
.mcc-gate-head p { margin: 0; color: var(--mcc-text-soft); font-size: .9rem; line-height: 1.5; }

.mcc-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    max-width: 640px;
    margin: 0 auto;
}

.mcc-choice {
    text-align: left;
    background: var(--mcc-bg-raised);
    border: 1.5px solid var(--mcc-border);
    border-radius: var(--mcc-radius-sm);
    padding: 18px 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--mcc-text);
    transition: border-color .18s, transform .18s, box-shadow .18s;
    display: flex;
    gap: 13px;
    align-items: flex-start;
}
.mcc-choice:hover {
    border-color: var(--mcc-brand);
    transform: translateY(-2px);
    box-shadow: var(--mcc-shadow-sm);
}
.mcc-choice-ico {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, var(--mcc-brand), var(--mcc-brand-ink));
}
.mcc-choice.is-guest .mcc-choice-ico { background: linear-gradient(135deg, #7c88ac, #4a5568); }
.mcc-choice strong { display: block; font-size: .98rem; font-weight: 800; margin-bottom: 3px; }
.mcc-choice span   { display: block; font-size: .82rem; color: var(--mcc-text-soft); line-height: 1.45; }

/* ─────────────────────────────────────────────────────────────────────────────
   6. FORMULARIOS
   ────────────────────────────────────────────────────────────────────────── */
.mcc-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 24px 20px 28px;
    background: var(--mcc-bg-sunken);
}
.mcc-form[hidden] { display: none; }

.mcc-form h3 {
    margin: 0 0 4px;
    font-family: var(--mcc-font-title);
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    color: var(--mcc-text);
}
.mcc-form-hint {
    text-align: center;
    color: var(--mcc-text-soft);
    font-size: .84rem;
    margin: 0 0 18px;
    line-height: 1.5;
}

.mcc-field { margin-bottom: 13px; position: relative; }
.mcc-field > label {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--mcc-text-faint);
    margin-bottom: 6px;
}

.mcc-input {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: .95rem;
    color: var(--mcc-text);
    background: var(--mcc-bg-raised);
    border: 1.5px solid var(--mcc-border-strong);
    border-radius: var(--mcc-radius-sm);
    transition: border-color .18s, box-shadow .18s;
}
.mcc-input::placeholder { color: var(--mcc-text-faint); }
.mcc-input:focus {
    outline: none;
    border-color: var(--mcc-brand);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .18);
}
.mcc-input.has-error { border-color: var(--mcc-danger); }

.mcc-pass { position: relative; }
.mcc-pass .mcc-input { padding-right: 44px; }
.mcc-eye {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--mcc-text-faint);
    width: 34px; height: 34px;
    border-radius: 9px;
    cursor: pointer;
}
.mcc-eye:hover { color: var(--mcc-brand); background: var(--mcc-bg-hover); }

.mcc-msg {
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: var(--mcc-radius-sm);
    display: none;
}
.mcc-msg.show { display: block; }
.mcc-msg.is-error { background: rgba(217, 52, 80, .12); color: var(--mcc-danger); }
.mcc-msg.is-ok    { background: rgba(22, 165, 106, .12); color: var(--mcc-green); }

/* Botones */
.mcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    font-size: .93rem;
    color: #fff;
    background: linear-gradient(120deg, var(--mcc-brand), var(--mcc-brand-ink));
    border: none;
    border-radius: var(--mcc-radius-sm);
    cursor: pointer;
    transition: transform .16s, box-shadow .16s, opacity .16s;
}
.mcc-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--mcc-shadow-sm); }
.mcc-btn:disabled { opacity: .55; cursor: not-allowed; }
.mcc-btn.is-ghost {
    background: none;
    color: var(--mcc-text-soft);
    border: 1.5px solid var(--mcc-border-strong);
}
.mcc-btn.is-ghost:hover:not(:disabled) { color: var(--mcc-text); border-color: var(--mcc-brand); }
.mcc-btn.is-link {
    background: none;
    color: var(--mcc-brand);
    text-decoration: underline;
    padding: 8px;
    font-size: .85rem;
}
.mcc-btn.is-link:hover:not(:disabled) { transform: none; box-shadow: none; }
.mcc-btn.is-danger { background: linear-gradient(120deg, #e6455f, var(--mcc-danger)); }

.mcc-form-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

/* Selector de avatares */
.mcc-avatars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
    background: var(--mcc-bg-raised);
    border: 1.5px solid var(--mcc-border);
    border-radius: var(--mcc-radius-sm);
}
.mcc-avatar-opt {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2.5px solid transparent;
    opacity: .68;
    transition: opacity .18s, border-color .18s, transform .18s;
    background: var(--mcc-bg-sunken);
}
.mcc-avatar-opt:hover { opacity: 1; transform: scale(1.06); }
.mcc-avatar-opt.is-sel {
    opacity: 1;
    border-color: var(--mcc-brand);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   7. LISTA DE MENSAJES
   ────────────────────────────────────────────────────────────────────────── */
.mcc-body { position: relative; display: flex; flex-direction: column; min-height: 0; }
.mcc-body[hidden] { display: none; }

.mcc-stream {
    height: var(--mcc-stream-h);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 14px 8px;
    background: var(--mcc-bg-sunken);
    scrollbar-width: thin;
    scrollbar-color: var(--mcc-border-strong) transparent;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mcc-stream::-webkit-scrollbar { width: 9px; }
.mcc-stream::-webkit-scrollbar-track { background: transparent; }
.mcc-stream::-webkit-scrollbar-thumb {
    background: var(--mcc-border-strong);
    border-radius: 9px;
    border: 2px solid var(--mcc-bg-sunken);
}
.mcc-stream::-webkit-scrollbar-thumb:hover { background: var(--mcc-text-faint); }

.mcc-loadmore { display: flex; justify-content: center; padding: 4px 0 12px; }
.mcc-loadmore[hidden] { display: none; }
.mcc-loadmore button {
    font: inherit;
    font-size: .8rem;
    font-weight: 800;
    color: var(--mcc-brand);
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border);
    border-radius: var(--mcc-radius-pill);
    padding: 7px 18px;
    cursor: pointer;
    transition: background .18s;
}
.mcc-loadmore button:hover { background: var(--mcc-bg-hover); }

/* Separador de día */
.mcc-daysep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 4px 10px;
    color: var(--mcc-text-faint);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.mcc-daysep::before,
.mcc-daysep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mcc-border);
}

/* Cada entrada de la lista: el separador de día (si toca) más el mensaje.
   Se agrupan en un envoltorio para que el reciclado de nodos pueda mover
   ambas cosas juntas sin descuadrar el orden. */
.mcc-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Mensaje ── */
.mcc-m {
    display: flex;
    gap: 11px;
    padding: 5px 10px 5px 8px;
    border-radius: var(--mcc-radius-sm);
    position: relative;
    transition: background .15s;
    animation: mcc-in .28s ease both;
}
@keyframes mcc-in {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}
.mcc-m:hover { background: var(--mcc-bg-hover); }

/* Mensajes seguidos del mismo autor: se agrupan y se quita la cabecera */
.mcc-m.is-grouped { padding-top: 1px; }
.mcc-m.is-grouped .mcc-m-head { display: none; }
.mcc-m.is-grouped .mcc-m-av   { visibility: hidden; height: 0; }

.mcc-m.is-own .mcc-m-body { background: var(--mcc-bg-own); }

/* Mensajes del equipo. Se marcan de tres formas a la vez —franja dorada,
   fondo tintado y nombre en oro— para que se distingan de un vistazo aunque
   la etiqueta quede fuera de pantalla al plegarse la cabecera del mensaje. */
.mcc-m.is-staff {
    background: var(--mcc-staff-bg);
    box-shadow: inset 3px 0 0 var(--mcc-gold);
    border-radius: 0 var(--mcc-radius-sm) var(--mcc-radius-sm) 0;
}
.mcc-m.is-staff:hover { background: var(--mcc-staff-bg-hover); }
.mcc-m.is-mention { background: rgba(233, 165, 39, .13); box-shadow: inset 3px 0 0 var(--mcc-gold); }
.mcc-m.is-highlight { animation: mcc-flash 1.6s ease; }
@keyframes mcc-flash {
    0%, 100% { background: transparent; }
    25%      { background: rgba(79, 124, 255, .28); }
}

.mcc-m-av {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--mcc-bg-hover);
    border: 2px solid var(--mcc-border);
    cursor: pointer;
    transition: border-color .18s, transform .18s;
}
.mcc-m-av:hover { transform: scale(1.07); }
.mcc-m.is-staff  .mcc-m-av { border-color: var(--mcc-gold); }
.mcc-m.is-guest  .mcc-m-av { border-style: dashed; }

.mcc-m-main { min-width: 0; flex: 1; }

.mcc-m-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.mcc-m-name {
    font-weight: 800;
    font-size: .89rem;
    color: var(--mcc-text);
    cursor: pointer;
}
.mcc-m-name:hover { text-decoration: underline; }
.mcc-m.is-staff .mcc-m-name { color: var(--mcc-gold); }
.mcc-m-time { font-size: .72rem; color: var(--mcc-text-faint); font-weight: 600; }
.mcc-m-edited { font-size: .7rem; color: var(--mcc-text-faint); font-style: italic; }

/* Distintivos de rol */
.mcc-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .64rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: var(--mcc-radius-pill);
    line-height: 1.5;
    white-space: nowrap;
}
.mcc-tag.is-admin { background: linear-gradient(120deg, #e9a527, #e6455f); color: #fff; }
.mcc-tag.is-mod   { background: linear-gradient(120deg, #4f7cff, #7a5cff); color: #fff; }
.mcc-tag.is-vip   { background: linear-gradient(120deg, #16a56a, #3ad395); color: #05261a; }
.mcc-tag.is-guest { background: var(--mcc-bg-hover); color: var(--mcc-text-faint); border: 1px solid var(--mcc-border); }

.mcc-m-body {
    font-size: .93rem;
    line-height: 1.55;
    color: var(--mcc-text);
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    padding: 2px 0;
    border-radius: 9px;
}
.mcc-m-body.is-removed {
    font-style: italic;
    color: var(--mcc-text-faint);
    white-space: normal;
}

.mcc-m-body a {
    color: var(--mcc-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.mcc-m-body a:hover { color: var(--mcc-accent); }

.mcc-emo { width: 22px; height: 22px; vertical-align: -5px; display: inline-block; }
.mcc-mention {
    background: rgba(79, 124, 255, .16);
    color: var(--mcc-brand-ink);
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 6px;
}
[data-theme="dark"] .mcc-mention { color: var(--mcc-brand); }
.mcc-mention.is-me { background: rgba(233, 165, 39, .28); color: var(--mcc-text); }

/* ── Spoiler:  ||texto oculto||  ─────────────────────────────────────────────
   Tapado, el texto se vuelve del color del fondo y se le añade un desenfoque:
   así no se lee ni seleccionándolo con el ratón. Al pulsarlo se descubre. */
.mcc-spoiler {
    background: var(--mcc-spoiler-bg);
    color: transparent;
    border-radius: 5px;
    padding: 1px 4px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;   /* sin menú de "copiar" al mantener pulsado */
    text-shadow: none;
    filter: blur(0.35em);
    transition: filter .22s ease, background .22s ease, color .22s ease;
}
.mcc-spoiler * { visibility: hidden; }
.mcc-spoiler:hover { background: var(--mcc-spoiler-bg-hover); }

.mcc-spoiler.is-open {
    background: var(--mcc-bg-hover);
    color: inherit;
    cursor: auto;
    user-select: auto;
    filter: none;
}
.mcc-spoiler.is-open * { visibility: visible; }

/* Aviso para quien no puede ver el efecto (lectores de pantalla, impresión). */
@media print {
    .mcc-spoiler { filter: none; color: inherit; background: var(--mcc-bg-hover); }
    .mcc-spoiler * { visibility: visible; }
}

/* Imagen adjunta */
.mcc-m-img {
    display: block;
    margin-top: 7px;
    max-width: min(340px, 100%);
    max-height: 260px;
    width: auto;
    border-radius: 12px;
    border: 1px solid var(--mcc-border);
    cursor: zoom-in;
    object-fit: cover;
    background: var(--mcc-bg-hover);
}

/* Cita de respuesta */
.mcc-quote {
    display: flex;
    gap: 7px;
    align-items: center;
    font-size: .78rem;
    color: var(--mcc-text-soft);
    margin-bottom: 4px;
    padding-left: 9px;
    border-left: 3px solid var(--mcc-brand);
    cursor: pointer;
    max-width: 100%;
}
.mcc-quote:hover { color: var(--mcc-text); }
.mcc-quote b { color: var(--mcc-brand); font-weight: 800; }
.mcc-quote span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .85;
}

/* Reacciones */
.mcc-reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mcc-react {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--mcc-radius-pill);
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border);
    color: var(--mcc-text-soft);
    cursor: pointer;
    transition: transform .15s, border-color .15s, background .15s;
}
.mcc-react:hover { transform: translateY(-1px); border-color: var(--mcc-brand); }
.mcc-react.is-mine { background: rgba(79, 124, 255, .16); border-color: var(--mcc-brand); color: var(--mcc-brand-ink); }
[data-theme="dark"] .mcc-react.is-mine { color: var(--mcc-brand); }

/* Barra de acciones al pasar el ratón */
.mcc-m-tools {
    position: absolute;
    top: -10px; right: 10px;
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border);
    border-radius: 10px;
    box-shadow: var(--mcc-shadow-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 3;
}
.mcc-m:hover .mcc-m-tools,
.mcc-m:focus-within .mcc-m-tools { opacity: 1; pointer-events: auto; }

.mcc-tool {
    background: none;
    border: none;
    color: var(--mcc-text-faint);
    width: 28px; height: 28px;
    border-radius: 7px;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: .82rem;
    transition: background .15s, color .15s;
}
.mcc-tool:hover { background: var(--mcc-bg-hover); color: var(--mcc-brand); }
.mcc-tool.is-danger:hover { color: var(--mcc-danger); }

/* Estado vacío / esqueleto de carga */
.mcc-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--mcc-text-faint);
}
.mcc-empty i { font-size: 2.2rem; opacity: .4; display: block; margin-bottom: 12px; }
.mcc-empty p { margin: 0; font-size: .9rem; font-weight: 600; }

.mcc-skel { display: flex; gap: 11px; padding: 8px; }
.mcc-skel-av, .mcc-skel-line {
    background: linear-gradient(90deg, var(--mcc-bg-hover) 25%, var(--mcc-bg-raised) 50%, var(--mcc-bg-hover) 75%);
    background-size: 200% 100%;
    animation: mcc-shimmer 1.4s infinite;
    border-radius: 7px;
}
.mcc-skel-av { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; }
.mcc-skel-col { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.mcc-skel-line { height: 10px; }
.mcc-skel-line.w1 { width: 30%; }
.mcc-skel-line.w2 { width: 78%; }
@keyframes mcc-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* Píldora de "mensajes nuevos" */
.mcc-jump {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translate(-50%, 20px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--mcc-brand);
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    border: none;
    border-radius: var(--mcc-radius-pill);
    box-shadow: var(--mcc-shadow);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s, transform .22s;
    z-index: 4;
}
.mcc-jump.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ─────────────────────────────────────────────────────────────────────────────
   8. REDACTOR
   ────────────────────────────────────────────────────────────────────────── */
.mcc-composer {
    border-top: 1px solid var(--mcc-border);
    background: var(--mcc-bg);
    padding: 12px 14px 14px;
    position: relative;
}

/* Barra de contexto: respondiendo a… / editando… */
.mcc-context {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--mcc-text-soft);
    background: var(--mcc-bg-sunken);
    border-left: 3px solid var(--mcc-brand);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 9px;
}
.mcc-context[hidden] { display: none; }
.mcc-context span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.mcc-context button {
    background: none; border: none;
    color: var(--mcc-text-faint);
    cursor: pointer; padding: 2px 5px; border-radius: 6px;
}
.mcc-context button:hover { color: var(--mcc-danger); background: var(--mcc-bg-hover); }

/* Previsualización de imagen */
.mcc-preview { margin-bottom: 9px; position: relative; display: inline-block; }
.mcc-preview[hidden] { display: none; }
.mcc-preview img {
    max-height: 110px;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--mcc-border);
    display: block;
}
.mcc-preview button {
    position: absolute;
    top: -8px; right: -8px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--mcc-danger);
    color: #fff;
    border: 2px solid var(--mcc-bg);
    cursor: pointer;
    font-size: .7rem;
    display: grid; place-items: center;
}

.mcc-inputbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--mcc-bg-sunken);
    border: 1.5px solid var(--mcc-border-strong);
    border-radius: var(--mcc-radius);
    padding: 6px 6px 6px 10px;
    transition: border-color .18s, box-shadow .18s;
}
.mcc-inputbar:focus-within {
    border-color: var(--mcc-brand);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}

.mcc-textarea {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    resize: none;
    font: inherit;
    font-size: .95rem;
    line-height: 1.5;
    color: var(--mcc-text);
    padding: 8px 2px;
    max-height: 140px;
    overflow-y: auto;
}
.mcc-textarea:focus { outline: none; }
.mcc-textarea::placeholder { color: var(--mcc-text-faint); }
.mcc-textarea:disabled { cursor: not-allowed; }

.mcc-cbtn {
    background: none;
    border: none;
    color: var(--mcc-text-faint);
    width: 36px; height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.mcc-cbtn:hover:not(:disabled) { background: var(--mcc-bg-hover); color: var(--mcc-brand); }
.mcc-cbtn:disabled { opacity: .4; cursor: not-allowed; }
.mcc-cbtn.is-on { color: var(--mcc-brand); background: var(--mcc-bg-hover); }

.mcc-send {
    background: linear-gradient(120deg, var(--mcc-brand), var(--mcc-brand-ink));
    color: #fff;
    border: none;
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: .95rem;
    transition: transform .16s, opacity .16s;
}
.mcc-send:hover:not(:disabled) { transform: translateY(-1px) scale(1.03); }
.mcc-send:disabled { opacity: .45; cursor: not-allowed; }

.mcc-composer-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
    padding: 0 4px;
    font-size: .74rem;
    color: var(--mcc-text-faint);
    font-weight: 600;
    flex-wrap: wrap;
}
.mcc-counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.mcc-counter.is-near { color: var(--mcc-warn); }
.mcc-counter.is-over { color: var(--mcc-danger); font-weight: 800; }
.mcc-kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--mcc-bg-hover);
    border: 1px solid var(--mcc-border);
    font-family: ui-monospace, Consolas, monospace;
    font-size: .68rem;
}

/* Aviso de bloqueo del redactor */
.mcc-blocked {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px;
    border-radius: var(--mcc-radius-sm);
    background: rgba(217, 52, 80, .1);
    color: var(--mcc-text);
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.5;
}
.mcc-blocked[hidden] { display: none; }
.mcc-blocked i { font-size: 1.3rem; color: var(--mcc-danger); flex: 0 0 auto; }

/* ─────────────────────────────────────────────────────────────────────────────
   9. PANEL DE EMOJIS
   ────────────────────────────────────────────────────────────────────────── */
.mcc-emojis {
    position: absolute;
    bottom: calc(100% - 4px);
    right: 12px;
    width: min(340px, calc(100vw - 40px));
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border-strong);
    border-radius: var(--mcc-radius);
    box-shadow: var(--mcc-shadow-lg);
    z-index: 20;
    overflow: hidden;
    animation: mcc-pop .18s ease both;
}
.mcc-emojis[hidden] { display: none; }
@keyframes mcc-pop {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.mcc-emojis-search { padding: 10px 10px 8px; border-bottom: 1px solid var(--mcc-border); }
.mcc-emojis-search input {
    width: 100%;
    padding: 8px 11px;
    font: inherit;
    font-size: .85rem;
    color: var(--mcc-text);
    background: var(--mcc-bg-sunken);
    border: 1px solid var(--mcc-border);
    border-radius: 9px;
}
.mcc-emojis-search input:focus { outline: none; border-color: var(--mcc-brand); }

.mcc-emojis-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--mcc-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.mcc-emojis-tabs::-webkit-scrollbar { display: none; }
.mcc-etab {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 6px 9px;
    border-radius: 8px;
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s, background .15s;
    flex: 0 0 auto;
}
.mcc-etab:hover { opacity: 1; background: var(--mcc-bg-hover); }
.mcc-etab.is-on { opacity: 1; background: var(--mcc-bg-hover); box-shadow: inset 0 -2px 0 var(--mcc-brand); }

.mcc-emojis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 2px;
    padding: 8px;
    max-height: 210px;
    overflow-y: auto;
}
.mcc-emojis-grid button {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .12s, transform .12s;
}
.mcc-emojis-grid button:hover { background: var(--mcc-bg-hover); transform: scale(1.15); }
.mcc-emojis-grid img { width: 24px; height: 24px; display: block; }

.mcc-emojis-none {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 8px;
    color: var(--mcc-text-faint);
    font-size: .82rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   10. MENÚS FLOTANTES (menciones y acciones de usuario)
   ────────────────────────────────────────────────────────────────────────── */
.mcc-mentions {
    position: absolute;
    z-index: 30;
    min-width: 190px;
    max-width: 260px;
    color: var(--mcc-text);
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border-strong);
    border-radius: var(--mcc-radius-sm);
    box-shadow: var(--mcc-shadow-lg);
    overflow: hidden;
    padding: 5px;
}
.mcc-mentions[hidden] { display: none; }
.mcc-mention-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 700;
    color: var(--mcc-text);
}
.mcc-mention-item img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.mcc-mention-item.is-active,
.mcc-mention-item:hover { background: var(--mcc-bg-hover); color: var(--mcc-brand); }

/* Tarjeta de usuario */
.mcc-card {
    position: fixed;
    z-index: 10050;
    width: 264px;
    font-family: var(--mcc-font);
    color: var(--mcc-text);
    background: var(--mcc-bg-raised);
    border: 1px solid var(--mcc-border-strong);
    border-radius: var(--mcc-radius);
    box-shadow: var(--mcc-shadow-lg);
    overflow: hidden;
    animation: mcc-pop .16s ease both;
}
.mcc-card[hidden] { display: none; }
.mcc-card-top {
    background: var(--mcc-header);
    height: 62px;
    position: relative;
}
.mcc-card-av {
    position: absolute;
    left: 16px; bottom: -26px;
    width: 62px; height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--mcc-bg-raised);
    background: var(--mcc-bg-hover);
}
.mcc-card-main { padding: 34px 16px 14px; }
.mcc-card-name { font-family: var(--mcc-font-title); font-weight: 800; font-size: 1.02rem; color: var(--mcc-text); }
.mcc-card-meta { font-size: .78rem; color: var(--mcc-text-faint); margin-top: 3px; line-height: 1.6; }
.mcc-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.mcc-card-acts { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.mcc-card-acts .mcc-btn { width: auto; flex: 1; padding: 8px 12px; font-size: .8rem; }

/* ─────────────────────────────────────────────────────────────────────────────
   11. MODALES Y AVISOS
   ────────────────────────────────────────────────────────────────────────── */
.mcc-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 8, 18, .78);
    backdrop-filter: blur(6px);
    animation: mcc-fade .2s ease both;
}
.mcc-modal[hidden] { display: none; }
@keyframes mcc-fade { from { opacity: 0; } to { opacity: 1; } }

.mcc-modal-box {
    background: var(--mcc-bg-raised);
    color: var(--mcc-text);
    border-radius: var(--mcc-radius);
    box-shadow: var(--mcc-shadow-lg);
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    animation: mcc-pop .24s cubic-bezier(.34, 1.4, .64, 1) both;
    font-family: var(--mcc-font);
}
.mcc-modal-head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--mcc-border);
    display: flex;
    align-items: center;
    gap: 11px;
}
.mcc-modal-head h3 {
    margin: 0;
    font-family: var(--mcc-font-title);
    font-size: 1.05rem;
    font-weight: 800;
    flex: 1;
}
.mcc-modal-body { padding: 18px 20px; font-size: .9rem; line-height: 1.6; color: var(--mcc-text-soft); }
.mcc-modal-body p { margin: 0 0 12px; }
.mcc-modal-body p:last-child { margin-bottom: 0; }
.mcc-modal-foot { padding: 0 20px 18px; display: flex; gap: 9px; }
.mcc-modal-foot .mcc-btn { flex: 1; }

/* Visor de imágenes */
.mcc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10070;
    background: rgba(4, 6, 14, .93);
    display: grid;
    place-items: center;
    padding: 24px;
    cursor: zoom-out;
    animation: mcc-fade .2s ease both;
}
.mcc-lightbox[hidden] { display: none; }
.mcc-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: var(--mcc-shadow-lg);
}

/* Avisos flotantes */
.mcc-toasts {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 10080;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: min(340px, calc(100vw - 32px));
    pointer-events: none;
}
.mcc-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--mcc-radius-sm);
    background: var(--mcc-bg-raised);
    color: var(--mcc-text);
    border: 1px solid var(--mcc-border-strong);
    border-left: 4px solid var(--mcc-brand);
    box-shadow: var(--mcc-shadow);
    font-family: var(--mcc-font);
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.45;
    pointer-events: auto;
    animation: mcc-slide .26s cubic-bezier(.34, 1.4, .64, 1) both;
}
@keyframes mcc-slide {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: none; }
}
.mcc-toast.is-out { animation: mcc-slide .2s ease reverse both; }
.mcc-toast.is-ok    { border-left-color: var(--mcc-green); }
.mcc-toast.is-error { border-left-color: var(--mcc-danger); }
.mcc-toast.is-warn  { border-left-color: var(--mcc-warn); }
.mcc-toast i { margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────────────────────
   12. RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */
/* ── Tabletas ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* La unidad dvh mide el alto REALMENTE visible. Con vh, la barra de
       direcciones del navegador móvil queda contada y el redactor se va por
       debajo del borde de la pantalla. */
    .mcc { --mcc-stream-h: clamp(340px, 55vh, 560px); }
    @supports (height: 1dvh) {
        .mcc { --mcc-stream-h: clamp(340px, 55dvh, 560px); }
    }
}

/* ── Móviles ─────────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
    .mcc { margin: 20px 0; border-radius: 14px; }
    .mcc { --mcc-stream-h: clamp(300px, 52vh, 520px); }
    @supports (height: 1dvh) {
        .mcc { --mcc-stream-h: clamp(300px, 52dvh, 520px); }
    }

    .mcc-head { padding: 13px 14px; gap: 10px; }
    .mcc-head-icon { width: 36px; height: 36px; flex-basis: 36px; font-size: 1rem; }
    .mcc-me { max-width: 140px; padding: 4px; }
    .mcc-me-name { display: none; }

    .mcc-stream { padding: 12px 8px 6px; }
    .mcc-m { gap: 9px; padding: 5px 6px; }
    .mcc-m-av { width: 33px; height: 33px; flex-basis: 33px; }
    .mcc-m-body { font-size: .9rem; }

    .mcc-composer { padding: 10px; }
    .mcc-emojis { right: 8px; left: 8px; width: auto; }
    .mcc-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
    .mcc-gate { padding: 20px 14px 24px; }
    .mcc-choices { grid-template-columns: 1fr; }
    .mcc-modal-foot { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .mcc-composer-foot .mcc-hide-xs { display: none; }
    .mcc-card { width: calc(100vw - 24px); }
    /* Con pantalla muy estrecha, la barra de escribir se queda sin sitio.
       Se recuperan unos 80px quitando los dos botones secundarios; sus dos
       funciones siguen disponibles escribiendo ||spoiler|| y desde el panel
       de emojis. */
    .mcc-inputbar .mcc-cbtn.is-extra { display: none; }
}

/* ── Táctil ──────────────────────────────────────────────────────────────────
   Se consulta el puntero, NO el ancho: una tableta de 1024px sin ratón
   necesita esto igual que un móvil de 360px, y un portátil estrecho no. */
@media (hover: none) {
    /* Sin ratón no hay :hover, así que las acciones del mensaje no se pueden
       dejar escondidas. Se bajan a su propia línea en lugar de flotar encima:
       así no tapan el mensaje de arriba ni se salen por la derecha cuando hay
       muchos botones (responder, editar, retirar, denunciar, sancionar…). */
    .mcc-m { flex-wrap: wrap; }
    .mcc-m-tools {
        position: static;
        opacity: 1;
        pointer-events: auto;
        width: 100%;
        justify-content: flex-end;
        margin: 4px 0 0 49px;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: 4px;
    }
    /* Objetivos táctiles: 28px es demasiado pequeño para un dedo. */
    .mcc-tool { width: 36px; height: 36px; background: var(--mcc-bg-raised); border: 1px solid var(--mcc-border); }
    .mcc-cbtn { width: 40px; height: 40px; flex-basis: 40px; }
    .mcc-react { padding: 5px 11px; }
    .mcc-etab { padding: 9px 12px; }
    .mcc-emojis-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
    .mcc-emojis-grid button { padding: 9px; }

    /* Quita el retardo de 300 ms que algunos navegadores dejan por si es un
       doble toque para hacer zoom. */
    .mcc button, .mcc a, .mcc-modal button, .mcc-card button { touch-action: manipulation; }
}

/* Safari en iOS hace zoom automático al enfocar un campo con letra menor de
   16px, y deja la página descolocada. Con 16px justos no se dispara. */
@media (pointer: coarse) {
    .mcc-textarea,
    .mcc-input,
    .mcc-emojis-search input,
    .mcc-modal input,
    .mcc-modal select { font-size: 16px; }

    /* Los distintivos de rol y las teclas del pie rondan los 10px: en un móvil
       en la mano eso ya cuesta de leer. Un punto más y siguen siendo discretos. */
    .mcc-tag { font-size: .7rem; padding: 3px 8px; }
    .mcc-kbd { font-size: .72rem; }
    .mcc-m-time { font-size: .75rem; }
}

/* Accesibilidad: respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .mcc *,
    .mcc-modal, .mcc-toast, .mcc-card, .mcc-lightbox {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Foco visible y coherente en todo el chat */
.mcc :focus-visible,
.mcc-modal :focus-visible,
.mcc-card :focus-visible {
    outline: 2px solid var(--mcc-brand);
    outline-offset: 2px;
    border-radius: 6px;
}
