.milo-cuerpo { margin: 0; background: #f2f4f7; }

#tessa.milo { max-width: 1180px; padding-top: 0; }

#tessa .milo-barra {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 14px 0; margin-bottom: 22px;
    border-bottom: 1px solid var(--linea);
}
#tessa .milo-marca {
    display: inline-flex; align-items: baseline; gap: 8px;
    font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--tx);
}
#tessa .milo-marca:hover { text-decoration: none; color: var(--tx); }

#tessa .milo-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
#tessa .milo-nav-grupo { position: relative; }
#tessa .milo-nav-titulo {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border: 0; border-radius: var(--r-sm); background: none;
    font: inherit; color: var(--tx-2); font-weight: 550; cursor: default;
}
#tessa .milo-nav-titulo span { font-size: 10px; color: var(--tx-3); }
#tessa .milo-nav-titulo.activo { background: var(--azul-luz); color: var(--azul); }
#tessa .milo-nav-grupo:hover .milo-nav-titulo,
#tessa .milo-nav-grupo:focus-within .milo-nav-titulo { background: var(--panel); color: var(--tx); }
#tessa .milo-nav-sub {
    position: absolute; top: 100%; left: 0; z-index: 800;
    display: none; flex-direction: column; min-width: 210px;
    padding: 6px; margin-top: 4px;
    background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r-md, 10px);
    box-shadow: 0 10px 28px rgba(16, 24, 40, .14);
}
#tessa .milo-nav-sub::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
#tessa .milo-nav-grupo:last-child .milo-nav-sub { left: auto; right: 0; }
#tessa .milo-nav-grupo:hover .milo-nav-sub,
#tessa .milo-nav-grupo:focus-within .milo-nav-sub { display: flex; }
#tessa .milo-nav-opcion {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-radius: var(--r-sm);
    color: var(--tx-2); font-weight: 550; white-space: nowrap;
}
#tessa .milo-nav-opcion:hover { background: var(--panel-2); color: var(--tx); text-decoration: none; }
#tessa .milo-nav-opcion.activo { background: var(--azul-luz); color: var(--azul); }
#tessa .milo-nav-opcion.inactiva { color: var(--tx-3); cursor: default; }
#tessa .milo-nav-opcion.inactiva:hover { background: none; color: var(--tx-3); }
#tessa .milo-nav-opcion small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }


#tessa.milo .enlaces-tablero .tarjeta { margin-bottom: 0; }

#tessa .milo-pasos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
#tessa .milo-pasos > * { min-width: 0; }

#tessa .milo-origen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#tessa .milo-origen form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
#tessa .milo-origen .campo { width: 100%; margin: 0; }

#tessa .milo-plantilla-activa {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 14px;
    background: var(--panel-2); border: 1px solid var(--linea); border-radius: var(--r-sm);
}
#tessa .milo-plantilla-activa strong { display: block; overflow-wrap: anywhere; }
#tessa .milo-plantilla-activa small { display: block; }

#tessa .milo-acciones { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }

#tessa .milo-vista {
    display: block; width: 100%; height: 620px;
    border: 0; background: #fff;
}

#tessa .milo-hallazgos { margin: 0; padding: 0; list-style: none; }
#tessa .milo-hallazgos li {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 0; border-bottom: 1px solid var(--linea);
}
#tessa .milo-hallazgos li:last-child { border-bottom: none; padding-bottom: 0; }
#tessa .milo-hallazgos li:first-child { padding-top: 0; }
#tessa .milo-hallazgos .etiqueta { flex: none; }
#tessa .milo-hallazgos .sub { display: block; color: var(--tx-3); font-size: 12px; }

#tessa .milo-avisos { margin: 0 0 14px; padding-left: 18px; color: var(--ambar); font-size: 12.5px; }

#tessa .milo-adjuntos { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--linea); border-radius: var(--r-sm); }
#tessa .milo-adjuntos li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--linea); font-size: 13px; }
#tessa .milo-adjuntos li:last-child { border-bottom: none; }
#tessa .milo-adjuntos a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#tessa .milo-adjuntar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#tessa .milo-adjuntar input[type="file"] { width: auto; flex: 1; min-width: 0; }
#tessa .milo-adjunto-hist { display: block; font-size: 12px; overflow-wrap: anywhere; }

#tessa .milo-error-envio { display: block; max-width: 340px; white-space: normal; overflow-wrap: anywhere; color: var(--rojo); font-size: 12px; }

#tessa .milo-subida input[type="file"] { width: auto; }
#tessa .milo-subida .milo-crece { width: auto; flex: 1; min-width: 160px; }

#tessa .milo-busqueda { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
#tessa .milo-busqueda input { width: 220px; }

#tessa .milo-nota-acciones { margin: 10px 0 0; }
#tessa .milo-hallazgos { margin-bottom: 12px; }

#tessa .milo-post > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; cursor: pointer; list-style: none;
}
#tessa .milo-post > summary::-webkit-details-marker { display: none; }
#tessa .milo-post > summary:hover { background: var(--panel-2); }
#tessa .milo-post[open] > summary { background: var(--panel-2); border-bottom: 1px solid var(--linea); }
#tessa .milo-post-quien { display: flex; flex-direction: column; min-width: 0; }
#tessa .milo-post-quien span { color: var(--tx-2); font-size: 12.5px; overflow-wrap: anywhere; }
#tessa .milo-post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#tessa .milo-post-fecha { color: var(--tx-3); font-size: 12.5px; }
#tessa .milo-post-datos { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; margin: 0 0 18px; }
#tessa .milo-post-datos dt { color: var(--tx-2); font-size: 12.5px; font-weight: 600; }
#tessa .milo-post-datos dd { margin: 0; overflow-wrap: anywhere; }
#tessa .milo-enlaces-caja {
    margin: 0 0 18px; padding: 4px 14px;
    background: var(--panel-2); border: 1px solid var(--linea); border-radius: var(--r);
}
#tessa .milo-enlaces-titulo {
    margin: 0; padding: 9px 0 7px;
    font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--tx-2);
    border-bottom: 1px solid var(--linea);
}
#tessa .milo-enlace-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 9px 0; border-bottom: 1px solid var(--linea);
}
#tessa .milo-enlace-item:last-child { border-bottom: none; }
#tessa .milo-enlace-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#tessa .milo-enlace-txt span { color: var(--tx-3); font-size: 12.5px; overflow-wrap: anywhere; }
#tessa .milo-enlace-botones { display: flex; gap: 6px; flex: none; }

#tessa .milo-post-eliminar { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--linea); }

.milo-publica .auth-caja { max-width: 520px; }
.milo-publica .milo-publica-marca { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.milo-publica textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--linea-2); border-radius: var(--r-sm);
    background: #fff; color: var(--tx);
    font-family: inherit; font-size: 14px; line-height: 1.45; resize: vertical;
}
.milo-publica textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-luz); }
.milo-publica input[type="file"] { padding: 6px 0; border: 0; background: none; font-size: 13px; }
.milo-publica input[type="file"]:focus { box-shadow: none; }
.milo-publica .milo-opcional { font-weight: 400; color: var(--tx-3); }
.milo-publica .milo-campo-error { display: block; margin-top: 4px; font-size: 12.5px; color: var(--rojo); }
.milo-publica .milo-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.milo-publica .auth-pie a { display: block; margin-top: 8px; }
.milo-publica .milo-etiqueta { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--tx-2); }
.milo-publica .milo-enlaces { display: flex; flex-direction: column; gap: 8px; }
.milo-publica .milo-enlace-fila { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
.milo-publica .milo-enlace-quitar {
    width: 34px; height: 34px; padding: 0; margin: 0;
    background: #fff; border: 1px solid var(--linea-2); border-radius: var(--r-sm);
    color: var(--tx-2); font-size: 18px; line-height: 1; font-weight: 400; cursor: pointer;
}
.milo-publica .milo-enlace-quitar:hover { background: var(--rojo-luz); border-color: var(--rojo-bor); color: var(--rojo); }
.milo-publica .milo-enlace-fila:only-child .milo-enlace-quitar { visibility: hidden; }
.milo-publica .milo-enlace-agregar {
    width: auto; margin: 8px 0 0; padding: 6px 12px;
    background: #fff; border: 1px dashed var(--linea-2); border-radius: var(--r-sm);
    color: var(--azul); font-size: 13px; font-weight: 600; cursor: pointer;
}
.milo-publica .milo-enlace-agregar:hover { background: var(--azul-luz); border-color: var(--azul-bor); }
.milo-publica .milo-enlace-agregar[hidden] { display: none; }
@media (max-width: 520px) {
    .milo-publica .milo-enlace-fila { grid-template-columns: minmax(0, 1fr) auto; }
    .milo-publica .milo-enlace-fila input:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    #tessa .milo-pasos { grid-template-columns: 1fr; }
    #tessa .milo-vista { height: 480px; }
}
@media (max-width: 620px) {
    #tessa .milo-origen { grid-template-columns: 1fr; }
    #tessa .milo-acciones > * { flex: 1; }
    #tessa .milo-post-datos { grid-template-columns: 1fr; gap: 2px 0; }
    #tessa .milo-post-datos dd { margin-bottom: 8px; }
}

/* Contenido */
#tessa [hidden] { display: none !important; }

#tessa .milo-seccion { margin-bottom: 26px; }
#tessa .milo-seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#tessa .milo-seccion-cab h2 { margin: 0; display: flex; align-items: center; gap: 8px; }

#tessa .milo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
#tessa .milo-cards > .vacio { grid-column: 1 / -1; }
#tessa .milo-card {
    display: flex; flex-direction: column; gap: 9px; align-items: stretch;
    width: 100%; margin: 0; padding: 16px; text-align: left; cursor: pointer;
    background: var(--panel); color: var(--tx); font: inherit;
    border: 1px solid var(--linea); border-radius: var(--r-lg); box-shadow: var(--s1);
    transition: border-color .15s, box-shadow .15s, transform .15s;
    /* es un <button>: hereda white-space:nowrap del estilo global de botones y el texto se salia de la caja */
    white-space: normal; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden;
}
#tessa .milo-card > * { min-width: 0; max-width: 100%; white-space: normal; }
#tessa .milo-card:hover { border-color: var(--azul-bor); box-shadow: var(--s3); transform: translateY(-1px); }
#tessa .milo-card:focus-visible, #tessa .milo-arch-fila:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
#tessa .milo-card h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
#tessa .milo-card p { margin: 0; color: var(--tx-2); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
#tessa .milo-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#tessa .milo-card-fecha { font-weight: 650; font-size: 13px; margin-right: auto; }
#tessa .milo-card-pie { color: var(--tx-3); font-size: 12px; overflow-wrap: anywhere; }

#tessa .milo-tag {
    display: inline-block; padding: 2px 8px; border-radius: 99px;
    background: var(--panel-2); border: 1px solid var(--linea); color: var(--tx-2);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
#tessa .milo-tag.es-atrasada { background: var(--rojo-luz); border-color: var(--rojo-bor); color: var(--rojo); }
#tessa .milo-tag.es-hoy { background: var(--ambar-luz); border-color: var(--ambar-bor); color: var(--ambar); }
#tessa .milo-tag.es-hoy.es-mas-tarde { border-style: dashed; }
/* Duracion del video: menos de 10 s (morado) vs 10 s o mas (azul) */
#tessa .milo-tag.dur-corta { background: var(--morado-luz); border-color: var(--morado-bor); color: var(--morado); }
#tessa .milo-tag.dur-larga { background: var(--azul-luz); border-color: var(--azul-bor); color: var(--azul); }
#tessa .milo-card.dur-corta { border-left: 4px solid var(--morado); }
#tessa .milo-card.dur-larga { border-left: 4px solid var(--azul); }
/* Caja "Para hoy" */
#tessa .milo-hoy-caja { padding: 14px; background: var(--ambar-luz); border: 1px solid var(--ambar-bor); border-radius: var(--r-lg); }
#tessa .milo-hoy-caja .milo-card { background: var(--panel); }

#tessa .milo-chips { display: flex; flex-wrap: wrap; gap: 5px; }
#tessa .milo-chip { padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--linea); background: var(--panel-2); color: var(--tx-3); }
#tessa .milo-chip.es-programado { background: var(--morado-luz); border-color: var(--morado-bor); color: var(--morado); }
#tessa .milo-chip.es-publicado { background: var(--verde-luz); border-color: var(--verde-bor); color: var(--verde); }

#tessa .milo-progreso { display: block; height: 5px; border-radius: 99px; background: var(--linea); overflow: hidden; }
#tessa .milo-progreso > span { display: block; height: 100%; background: var(--verde); transition: width .2s; }

#tessa .milo-archivo-barra { margin-bottom: 12px; }
#tessa .milo-archivo-barra input { max-width: 420px; }
#tessa .milo-arch-fila {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; margin: 0; padding: 11px 6px; text-align: left; cursor: pointer;
    background: none; color: var(--tx); font: inherit; border: 0; border-bottom: 1px solid var(--linea); border-radius: 0;
}
#tessa .milo-arch-fila:hover { background: var(--panel-2); }
#tessa .milo-arch-quien { display: flex; flex-direction: column; min-width: 0; }
#tessa .milo-arch-quien span { color: var(--tx-3); font-size: 12.5px; overflow-wrap: anywhere; }
#tessa .milo-arch-fecha { flex: none; color: var(--tx-2); font-size: 13px; }
#tessa .milo-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
#tessa .milo-pager-botones { display: flex; gap: 6px; }
#tessa .milo-pager button:disabled { opacity: .45; cursor: default; }

#tessa .milo-drive-estado { margin: 4px 0 0; }
#tessa .milo-en-linea { display: inline; }
#tessa .milo-en-linea .btn-enlace { display: inline; padding: 0; background: none; border: 0; color: var(--azul); cursor: pointer; font: inherit; text-decoration: underline; }

/* Panel de detalle */
#tessa .milo-velo { position: fixed; inset: 0; z-index: 900; display: flex; justify-content: flex-end; background: rgba(16, 20, 32, .45); }
body.milo-sin-scroll { overflow: hidden; }
#tessa .milo-cajon {
    display: flex; flex-direction: column; width: 100%; height: 100%;
    background: #f0f3f8;
}
#tessa .milo-cajon-cab {
    display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); align-items: center; gap: 18px;
    padding: 14px 22px; border-bottom: 1px solid #dce2ee;
    background: linear-gradient(110deg, #f2f0fc, #fff 45%, #edf5fa);
}
#tessa .milo-cajon-cab h2 { margin: 3px 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tessa .milo-produccion-id { min-width: 0; }
#tessa .milo-produccion-id .nota { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; }
#tessa .milo-publicacion { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px; border: 1px solid #dce2ee; border-radius: 12px; background: #ffffffb8; }
#tessa .milo-dato { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0 5px; color: #545b68; }
#tessa .milo-dato + .milo-dato { border-left: 1px solid #e3e7ef; }
#tessa .milo-dato svg { width: 17px; height: 17px; flex: none; }
#tessa .milo-dato input, #tessa .milo-dato select { width: auto; min-width: 0; height: 32px; padding: 3px; border: 1px solid transparent; background-color: transparent; font-size: 12px; box-shadow: none; }
#tessa .milo-dato input[type="number"] { width: 48px; }
#tessa .milo-dato #mc-fecha-texto { width: 90px; }
#tessa .milo-fecha-calendario { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; flex: none; margin: 0; cursor: pointer; border-radius: 5px; }
#tessa .milo-fecha-calendario:hover { background: #e7ebf3; }
#tessa .milo-fecha-calendario:focus-within { outline: 2px solid #7367b6; outline-offset: 1px; }
#tessa .milo-fecha-calendario input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
#tessa .milo-fecha-calendario input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
#tessa .milo-dato #mc-fecha-texto[aria-invalid="true"] { border-color: var(--rojo); }
#tessa .milo-dato span { font-size: 11px; }
#tessa .milo-produccion-estado { display: flex; align-items: flex-start; justify-content: flex-end; gap: 10px; min-width: 0; }
#tessa .milo-redes-resumen { display: flex; flex-direction: column; align-items: center; gap: 5px; }
#tessa .milo-redes-resumen > .milo-tag { font-size: 9px; letter-spacing: .02em; background: #fff9; }
#tessa #mc-redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
#tessa .milo-red-social { display: grid; place-items: center; width: 32px; height: 32px; padding: 6px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #4b5563; cursor: pointer; }
#tessa .milo-red-social svg { width: 20px; height: 20px; fill: currentColor; }
#tessa .milo-red-social:hover { background: #e9edf4; border-color: #d5dce7; }
#tessa .milo-red-social.es-publicado { color: #18804c; background: #e4f4eb; }
#tessa .milo-red-social.es-programado { color: #7851b7; background: #efe8fa; }
#tessa .milo-red-social.es-guardando { opacity: .55; }
#tessa .milo-red-social:disabled { opacity: .35; cursor: default; }
#tessa .milo-red-social:focus-visible { outline: 2px solid #7367b6; outline-offset: 2px; }
#tessa .milo-solo-lector { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#tessa .milo-btn-icono { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-width: 30px; flex: none; padding: 5px; border: 1px solid transparent; border-radius: 7px; color: #4c5360; background: transparent; cursor: pointer; vertical-align: middle; }
#tessa .milo-btn-icono svg { width: 17px; height: 17px; flex: none; }
#tessa .milo-btn-icono:hover { background: #e7ebf3; border-color: #d5dce7; color: #171e2b; }
#tessa .milo-btn-icono.es-copiado { background: #e5f5eb; color: #237147; }
#tessa .milo-btn-icono.es-error-copia { background: #fce9e7; color: #a83129; }
#tessa .milo-btn-icono:focus-visible, #tessa .milo-fuentes-resumen button:focus-visible { outline: 2px solid #7367b6; outline-offset: 2px; }
#tessa .milo-ojo { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
#tessa .milo-cajon-cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 18px 22px; }
#tessa .milo-cajon-pie {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    margin: 0; padding: 0; background: transparent; flex: none;
}
#tessa .milo-cajon-botones { display: flex; gap: 8px; margin-left: auto; }
#tessa .milo-fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#tessa .milo-campo-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
#tessa .milo-campo-cab label, #tessa .milo-campo-cab h3 { margin: 0; }
#tessa .milo-campo-cab .btn-sm { flex: none; }
#tessa .milo-cajon textarea { width: 100%; resize: vertical; }
/* El guion usa la altura disponible; los recursos tienen su propio desplazamiento. */
#tessa .milo-cols { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.8fr); gap: 18px; flex: 1; min-height: 0; }
#tessa .milo-col { min-width: 0; }
#tessa .milo-col-recursos { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 4px; }
#tessa .milo-panel { padding: 13px; border: 1px solid #dce2ec; border-radius: 12px; background: #fff; box-shadow: 0 2px 5px #25375805; }
#tessa .milo-panel.campo { margin: 0; }
#tessa .milo-panel-titulo { border-top: 3px solid #a59bd2; }
#tessa .milo-panel-caption { border-top: 3px solid #8fbdc9; }
#tessa .milo-panel-multimedia { border-top: 3px solid #d7ba83; }
#tessa .milo-panel-video { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; background: #f8f9fc; }
#tessa .milo-panel h3, #tessa .milo-panel label { font-size: 13px; }
#tessa .milo-panel h3 .nota { display: inline; font-size: 11px; }
#tessa .milo-col-guion { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
#tessa .milo-panel-guion { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 3px solid #9baee0; }
#tessa .milo-cajon textarea#mc-guion { flex: 1; min-height: 150px; height: 100%; resize: none; padding: 16px 18px; border-color: #e1e6f0; background: #fcfdff; font-size: 15px; line-height: 1.75; }
#tessa .milo-cajon textarea#mc-caption { height: 134px; min-height: 0; resize: none; border: 0; background: #f4f8fa; font-size: 13px; line-height: 1.6; cursor: default; }
#tessa .milo-col-guion .mensaje-error { flex: none; margin: 0; }
#tessa .milo-fuentes-abrir { display: inline-flex; align-items: center; gap: 8px; padding: 0; background: transparent; border: 0; color: #343b49; font: 600 13px var(--fuente); cursor: pointer; }
#tessa .milo-fuentes-abrir svg { width: 17px; height: 17px; }
#tessa .milo-fuentes-resumen { list-style: none; padding: 0; margin: 10px 0 0; }
#tessa .milo-fuentes-resumen:empty { display: none; }
#tessa .milo-fuentes-resumen li { display: flex; align-items: center; gap: 4px; border-top: 1px solid #edf0f5; }
#tessa .milo-fuentes-resumen [data-fuente-editar] { display: block; flex: 1; min-width: 0; padding: 8px 0; border: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; color: #485676; font: inherit; font-size: 12px; cursor: pointer; }
#tessa dialog.milo-editor-modal { width: min(720px, 94vw); }
#tessa .milo-editor-modal textarea { display: block; width: 100%; line-height: 1.65; }
#tessa #mc-caption-editar { min-height: min(45vh, 360px); }
#tessa .milo-modal-pie { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 1200px) {
    #tessa .milo-cajon-cab { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
    #tessa .milo-publicacion { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
    #tessa .milo-produccion-estado { grid-row: 1; grid-column: 2; }
}
@media (max-width: 760px) {
    #tessa .milo-cajon-cab { padding: 12px; gap: 10px; }
    #tessa .milo-cajon-cab h2 { font-size: 14px; }
    #tessa .milo-cajon-cab .milo-ojo { font-size: 9px; }
    #tessa .milo-produccion-id .nota { font-size: 10px; flex-wrap: wrap; }
    #tessa .milo-produccion-estado { gap: 4px; }
    #tessa #mc-redes { max-width: none; flex-wrap: nowrap; gap: 1px; }
    #tessa .milo-red-social { width: 28px; height: 30px; padding: 4px; }
    #tessa .milo-publicacion { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; box-sizing: border-box; gap: 4px 8px; padding: 6px; }
    #tessa .milo-dato { justify-content: flex-start; padding: 0 4px; min-width: 0; }
    #tessa .milo-dato #mc-fecha-texto, #tessa .milo-dato select { flex: 1; width: 100%; }
    #tessa .milo-dato + .milo-dato { border: 0; }
    #tessa .milo-cajon-cuerpo { overflow-y: auto; padding: 12px; }
    #tessa .milo-cols { display: flex; flex-direction: column; flex: none; gap: 12px; }
    #tessa .milo-col-recursos { overflow: visible; padding: 0; }
    #tessa .milo-col-guion { min-height: 520px; }
    #tessa .milo-cajon-botones { flex-wrap: wrap; gap: 6px; }
    #tessa .milo-cajon-botones .boton { padding: 8px 12px; }
}
#tessa .milo-bloque { margin: 6px 0 20px; padding-top: 16px; border-top: 1px solid var(--linea); }
#tessa .milo-bloque > h3 { margin: 0 0 10px; }

#tessa .milo-archivos { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--linea); border-radius: var(--r-sm); }
#tessa .milo-archivos:empty { display: none; }
#tessa .milo-archivos li { display: flex; align-items: center; gap: 5px; padding: 6px 8px; border-bottom: 1px solid var(--linea); font-size: 12px; }
#tessa .milo-archivos li:last-child { border-bottom: 0; }
#tessa .milo-archivos li.es-vacio { color: var(--tx-3); }
#tessa .milo-archivos li.es-error small { color: var(--rojo); }
#tessa .milo-arch-nombre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#tessa .milo-arch-nombre small { color: var(--tx-3); }
#tessa .milo-panel-multimedia .milo-arch-nombre small { display: block; font-size: 10px; }
#tessa .milo-panel-multimedia .milo-archivos { max-height: 172px; overflow-y: auto; }
#tessa .milo-arch-nombre .milo-progreso { margin-top: 5px; }

#tessa .milo-soltar {
    display: flex; position: relative; align-items: center; justify-content: center; gap: 10px; padding: 11px; margin: 0;
    border: 1.5px dashed #c9c1b0; border-radius: 8px; background: #fcf9f2;
    color: #555b65; font-size: 12px; text-align: left; cursor: pointer;
}
#tessa .milo-soltar:hover, #tessa .milo-soltar.es-activa { border-color: var(--azul); background: var(--azul-luz); }
#tessa .milo-soltar svg { width: 22px; height: 22px; flex: none; }
#tessa .milo-soltar small { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; }
#tessa .milo-soltar input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
#tessa .milo-soltar:focus-within { outline: 2px solid #7367b6; outline-offset: 2px; }
#tessa .milo-soltar:has(input:disabled) { opacity: .5; cursor: default; }
#tessa .milo-panel-multimedia #mc-cola:not(:empty) { margin: 10px 0 0; }

/* Visor */
#tessa .milo-visor { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(8, 10, 16, .92); }
#tessa .milo-visor-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; color: #fff; font-weight: 600; }
#tessa .milo-visor-cab > span:first-child { overflow-wrap: anywhere; }
#tessa .milo-visor-nav { display: flex; gap: 6px; flex: none; }
#tessa .milo-visor-cuerpo { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 18px 18px; }
#tessa .milo-visor-cuerpo video, #tessa .milo-visor-cuerpo img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); background: #000; }
#tessa .milo-visor-cuerpo audio { width: min(560px, 100%); }

.milo-aviso-flotante {
    position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translateX(-50%);
    max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r, 10px);
    background: #26333f; color: #fff; font: 500 12px/1.5 var(--fuente, system-ui, sans-serif); box-shadow: var(--s3, 0 6px 24px #10142026);
    transition: opacity .5s;
}
.milo-aviso-flotante.es-error { background: #b42318; }
.milo-aviso-flotante.sale { opacity: 0; }

@media (max-width: 620px) {
    #tessa .milo-fila-2 { grid-template-columns: 1fr; gap: 0; }
    #tessa .milo-cajon-cab, #tessa .milo-cajon-cuerpo { padding-left: 14px; padding-right: 14px; }
    #tessa .milo-cajon-pie { margin: 0 -14px; padding: 12px 14px; }
    #tessa .milo-cards { grid-template-columns: 1fr; }
}
#tessa .milo-uri { margin-top: 14px; overflow-wrap: anywhere; }

/* Modo lectura del guion (solo lectura, por encima del panel de producción) */
#tessa .milo-campo-acciones { display: flex; gap: 6px; flex: none; }
#tessa .milo-lectura {
    --lec-fondo: #eef0f3; --lec-papel: #fffefa; --lec-tx: #28323b; --lec-tx-2: #6c7580; --lec-linea: #e4e5e2;
    --lec-acento: #526d7a; --lec-foco: #edf2f4; --lec-sombra: #2633430a; --lec-tam: 1.3rem;
    position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column;
    background: var(--lec-fondo); color: var(--lec-tx);
}
#tessa .milo-lectura[hidden] { display: none; }
#tessa .milo-lectura[data-tema="sepia"] { --lec-fondo: #e9e1d3; --lec-papel: #fcf4e4; --lec-tx: #46392b; --lec-tx-2: #7f6e59; --lec-linea: #e6d9c3; --lec-acento: #8a6541; --lec-foco: #f1e5d0; --lec-sombra: #59452b0a; }
#tessa .milo-lectura[data-tema="oscuro"] { --lec-fondo: #12171e; --lec-papel: #1c232d; --lec-tx: #e3e7ed; --lec-tx-2: #a3adba; --lec-linea: #303a47; --lec-acento: #a1bac8; --lec-foco: #293746; --lec-sombra: #0000001c; }
#tessa .milo-lectura-cab {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
    padding: 12px 28px; background: var(--lec-papel); border-bottom: 1px solid var(--lec-linea); flex: none;
}
#tessa .milo-lectura .milo-ojo, #tessa .milo-lectura-datos, #tessa .milo-lectura-pie { color: var(--lec-tx-2); }
#tessa .milo-lectura-marca { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .01em; }
#tessa .milo-lectura-marca svg { width: 20px; height: 20px; color: var(--lec-acento); }
#tessa .milo-lectura-ctl { display: flex; align-items: center; gap: 10px; }
#tessa .milo-lectura-tipografia { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--lec-linea); border-radius: 9px; }
#tessa .milo-lectura-tipografia button { min-width: 33px; height: 30px; padding: 0 5px; border: 0; background: transparent; font-size: 13px; color: var(--lec-tx); }
#tessa .milo-lectura-tipografia output { min-width: 46px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--lec-tx-2); }
#tessa .milo-lectura-tema { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 96px; height: 38px; padding: 0 12px; border: 1px solid var(--lec-linea); border-radius: 9px; background: transparent; color: var(--lec-tx); font-size: 12px; }
#tessa .milo-lectura-muestra { width: 13px; height: 13px; border: 1px solid var(--lec-tx-2); border-radius: 50%; background: linear-gradient(90deg, var(--lec-tx-2) 50%, transparent 50%); }
#tessa .milo-lectura-salir { display: flex; align-items: center; justify-self: end; gap: 8px; }
#tessa .milo-lectura .milo-btn-icono { width: 34px; height: 34px; color: var(--lec-tx-2); }
#tessa .milo-lectura button:hover { background: var(--lec-foco); border-color: var(--lec-linea); color: var(--lec-tx); }
#tessa .milo-lectura button:focus-visible, #tessa .milo-lectura-texto p:focus-visible { outline: 2px solid var(--lec-acento); outline-offset: 3px; }
#tessa .milo-lectura button:disabled { opacity: .35; cursor: default; }
#tessa .milo-lectura-avance { height: 2px; flex: none; background: var(--lec-linea); }
#tessa .milo-lectura-avance > span { display: block; width: var(--lec-progreso, 0%); height: 100%; background: var(--lec-acento); }
#tessa .milo-lectura-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 40px 28px 56px; scroll-behavior: auto; scrollbar-color: var(--lec-linea) transparent; }
#tessa .milo-lectura-hoja { width: 100%; max-width: 880px; min-height: calc(100% - 2px); margin: 0 auto; padding: 58px 76px 30px; background: var(--lec-papel); border: 1px solid var(--lec-linea); border-radius: 5px; box-shadow: 0 6px 28px var(--lec-sombra); }
#tessa .milo-lectura-id { margin: 0 0 34px; padding-bottom: 30px; border-bottom: 1px solid var(--lec-linea); }
#tessa .milo-lectura .milo-ojo { margin: 0 0 14px; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
#tessa .milo-lectura-id h2 { margin: 0 0 18px; color: var(--lec-tx); font: 400 clamp(27px, 3.2vw, 40px)/1.22 Georgia, "Times New Roman", serif; letter-spacing: -.025em; overflow-wrap: anywhere; }
#tessa .milo-lectura-datos { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 16px; margin: 0; font-size: 11px; line-height: 1.6; }
#tessa .milo-lectura-datos span { white-space: nowrap; }
#tessa .milo-lectura-texto {
    margin: 0; font-family: Georgia, "Times New Roman", serif;
    font-size: var(--lec-tam); line-height: 1.85; overflow-wrap: anywhere; counter-reset: parrafo; -webkit-font-smoothing: antialiased;
}
#tessa .milo-lectura-texto, #tessa .milo-lectura-texto * { user-select: none; -webkit-user-select: none; }
#tessa .milo-lectura-texto p { position: relative; margin: 0 0 1.1em; padding: 8px 14px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; cursor: pointer; transition: opacity .18s, border-color .18s, background .18s; }
#tessa .milo-lectura-texto p:not(.vacio)::before { counter-increment: parrafo; content: counter(parrafo, decimal-leading-zero); position: absolute; top: 15px; right: calc(100% + 13px); width: 2em; white-space: nowrap; overflow-wrap: normal; text-align: right; color: var(--lec-tx-2); font: 10px/1.5 var(--fuente); font-variant-numeric: tabular-nums; opacity: .6; }
#tessa .milo-lectura-texto p:hover { background: var(--lec-foco); }
#tessa .milo-lectura-texto strong { font-weight: 700; }
#tessa .milo-lectura-texto.hay-foco p:not(.es-foco) { opacity: .5; }
#tessa .milo-lectura-texto p.es-foco { border-left-color: var(--lec-acento); background: var(--lec-foco); }
#tessa .milo-lectura-texto .vacio { color: var(--lec-tx-2); font-style: italic; cursor: default; }
#tessa .milo-lectura-fin { display: block; margin-top: 30px; text-align: center; color: var(--lec-acento); font-size: 9px; opacity: .55; }
#tessa .milo-lectura-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 28px; font-size: 11px; border-top: 1px solid var(--lec-linea); background: var(--lec-papel); flex: none; }
#tessa .milo-lectura-pie p { margin: 0; }
#tessa #mc-lectura-progreso { flex: none; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
#tessa .milo-lectura-ayuda-corta { display: none; }
#tessa dialog.milo-lectura-editor { background: var(--lec-papel); color: var(--lec-tx); border-color: var(--lec-linea); box-shadow: 0 18px 70px #0004; }
#tessa dialog.milo-lectura-editor .modal-cab { background: var(--lec-papel); border-color: var(--lec-linea); }
#tessa .milo-lectura-editor textarea { min-height: min(38vh, 320px); padding: 14px; background: var(--lec-fondo); color: var(--lec-tx); border-color: var(--lec-linea); font: 400 16px/1.7 Georgia, "Times New Roman", serif; user-select: text; }
#tessa .milo-lectura-editor .nota { margin: 10px 0 0; color: var(--lec-tx-2); font-size: 11px; }
#tessa .milo-lectura-editor .btn-sutil { color: var(--lec-tx); background: transparent; border-color: var(--lec-linea); }
#tessa .milo-lectura-editor .btn-primario { color: var(--lec-papel); background: var(--lec-acento); border-color: var(--lec-acento); }
#tessa .milo-lectura-editor .btn-primario:hover { color: var(--lec-papel); background: var(--lec-acento); filter: brightness(.94); }
#tessa .milo-lectura[data-tema="oscuro"] .milo-lectura-editor .mensaje-error { color: #ffb4b4; }
@media (max-width: 620px) {
    #tessa .milo-lectura-cab { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; }
    #tessa .milo-lectura-ctl { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
    #tessa .milo-lectura-marca { font-size: 12px; gap: 8px; }
    #tessa .milo-lectura-scroll { padding: 16px 10px 24px; }
    #tessa .milo-lectura-hoja { padding: 30px 24px 20px; }
    #tessa .milo-lectura-id { margin-bottom: 22px; padding-bottom: 22px; }
    #tessa .milo-lectura-texto p { padding: 8px 8px; }
    #tessa .milo-lectura-texto p:not(.vacio)::before { right: calc(100% + 4px); font-size: 8px; }
    #tessa .milo-lectura-pie { padding: 10px 16px; font-size: 10px; }
    #tessa .milo-lectura-ayuda-larga { display: none; }
    #tessa .milo-lectura-ayuda-corta { display: inline; }
}
@media (prefers-reduced-motion: reduce) { #tessa .milo-lectura-texto p { transition: none; } }

/* Borradores: tarjetas minimas de una linea */
#tessa .milo-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
#tessa .milo-mini {
    display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; margin: 0; padding: 5px 10px;
    text-align: left; cursor: pointer; font: inherit; font-size: 12.5px; line-height: 1.3; white-space: nowrap;
    background: var(--panel); color: var(--tx); border: 1px dashed var(--linea); border-radius: var(--r-sm);
    transition: border-color .15s, background .15s;
}
#tessa .milo-mini:hover { border-color: var(--azul-bor); background: var(--azul-luz); }
#tessa .milo-mini:focus-visible { outline: 2px solid var(--azul); outline-offset: 1px; }
#tessa .milo-mini-f { flex: none; font-weight: 650; color: var(--tx-2); }
#tessa .milo-mini-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#tessa .milo-tag.es-borrador { margin-left: 6px; background: #1d5cff; border-color: #1d5cff; color: #fff; font-weight: 700; text-transform: none; letter-spacing: 0; box-shadow: 0 2px 6px rgba(29, 92, 255, .4); }

/* Caja de ideas: ventana flotante (no bloquea la pagina), movible y redimensionable */
#tessa .milo-ideas {
    position: fixed; right: 24px; bottom: 24px; z-index: 1050; display: flex; flex-direction: column;
    width: 360px; height: 340px; min-width: 240px; min-height: 180px; max-width: 96vw; max-height: 90vh; resize: both; overflow: hidden;
    background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r-lg); box-shadow: 0 12px 36px rgba(16, 24, 40, .28);
}
#tessa .milo-ideas[hidden] { display: none; }
#tessa .milo-ideas-cab {
    display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; padding: 8px 10px 8px 14px; cursor: move; user-select: none; touch-action: none;
    background: var(--panel-2); border-bottom: 1px solid var(--linea);
}
#tessa .milo-ideas-cab strong { margin-right: auto; }
#tessa .milo-ideas-cab .nota { order: 1; flex-basis: 100%; margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 11.5px; }
#tessa .milo-ideas-cab .nota:empty { display: none; }
#tessa .milo-ideas-tam { display: inline-flex; gap: 2px; flex: none; }
#tessa .milo-ideas-tam button { min-width: 26px; padding: 2px 6px; font-weight: 700; }
#tessa .milo-ideas-tam button.on { background: var(--panel); border-color: var(--tx-3); color: var(--tx); }
#tessa .milo-ideas textarea {
    flex: 1; min-height: 0; width: 100%; margin: 0; padding: 12px 14px; resize: none; border: 0; border-radius: 0; box-shadow: none;
    font-size: 14px; line-height: 1.55; background: var(--panel); color: var(--tx);
}
#tessa .milo-ideas textarea:focus { outline: none; }
#tessa .milo-ideas-pestanas { display: flex; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--linea); background: #f6f8fb; flex: none; }
#tessa .milo-ideas-pestanas [role="tab"] { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1; padding: 6px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #687182; font: 500 12px var(--fuente); cursor: pointer; }
#tessa .milo-ideas-pestanas [aria-selected="true"] { background: #fff; border-color: #dfe4ee; color: #313c52; box-shadow: 0 1px 3px #29364d08; }
#tessa #mc-ideas-lista-cuenta { min-width: 17px; padding: 1px 4px; border-radius: 5px; background: #edf0f5; font-size: 10px; }
#tessa .milo-ideas-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#tessa .milo-ideas-lista { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 10px; list-style: none; }
#tessa .milo-idea-fila { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 28px); gap: 4px; align-items: center; margin-bottom: 7px; }
#tessa .milo-idea-fila input, #tessa #mc-idea-nueva { min-width: 0; width: 100%; height: 34px; padding: 6px 8px; border-color: #dce2eb; border-radius: 7px; background: #fff; font-size: 12px; }
#tessa .milo-idea-fila.es-modificada input { border-color: #a7b4d1; background: #fcfcff; }
#tessa .milo-idea-fila .milo-btn-icono { min-width: 28px; width: 28px; height: 30px; padding: 5px; border-radius: 6px; }
#tessa .milo-idea-fila .milo-idea-producir { background: #edf1f7; }
#tessa .milo-idea-fila [data-idea-quitar]:hover { color: #a54545; background: #fbeeee; }
#tessa .milo-idea-fila button:disabled { opacity: .35; cursor: default; }
#tessa .milo-idea-fila.es-ocupada { opacity: .65; }
#tessa .milo-ideas-lista .milo-ideas-vacio { padding: 22px 8px; text-align: center; color: #7b8493; font-size: 12px; }
#tessa .milo-ideas-lista-pie { padding: 10px; border-top: 1px solid var(--linea); background: #f8f9fc; flex: none; }
#tessa #mc-idea-nueva-form { display: flex; align-items: center; gap: 6px; }
#tessa #mc-idea-nueva { flex: 1; background: #fff; }
#tessa #mc-idea-agregar { border: 1px solid #dce2eb; background: #fff; }
#tessa #mc-ideas-lista-estado { min-height: 15px; margin: 6px 0 0; font-size: 10px; line-height: 1.5; }
#tessa #mc-ideas-lista-estado.es-error { color: #a83131; }
#tessa .milo-ideas-pestanas button:focus-visible { outline: 2px solid #7367b6; outline-offset: 1px; }
@media (max-width: 620px) {
    #tessa .milo-ideas { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: 50vh; }
    #tessa .milo-minis { grid-template-columns: 1fr; }
}

/* Vista de produccion: ordenada para copiar y producir */
#tessa .milo-vista { position: fixed; inset: 0; width: auto; height: auto; z-index: 960; display: flex; flex-direction: column; background: var(--panel-2); }
#tessa .milo-vista[hidden] { display: none; }
#tessa .milo-vista-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--linea); }
#tessa .milo-vista-id h2 { margin: 2px 0 6px; font-size: 20px; overflow-wrap: anywhere; }
#tessa .milo-vista-datos { display: flex; gap: 6px; flex-wrap: wrap; }
#tessa .milo-vista-ctl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#tessa .milo-vista-cuerpo { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 40px; }
#tessa .milo-vista-cols { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 1400px; margin: 0 auto; }
#tessa .milo-vista-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1000px) { #tessa .milo-vista-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
#tessa .milo-vb { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r-lg); padding: 12px 16px 16px; }
#tessa .milo-vb-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
#tessa .milo-vb-cab h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--tx-3); }
#tessa .milo-vb-bot { display: flex; gap: 6px; flex-wrap: wrap; }
#tessa .milo-vb-txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; color: var(--tx); }
#tessa .milo-vb-titulo { font-size: 19px; font-weight: 650; line-height: 1.35; }
#tessa .milo-vb-guion { max-height: 60vh; overflow-y: auto; padding-right: 6px; font-size: 15.5px; line-height: 1.7; }
#tessa .milo-vb .milo-archivos { margin: 0; }
#tessa .milo-vb-fuentes { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
#tessa .milo-vb-fuentes li { margin-bottom: 10px; overflow-wrap: anywhere; }
#tessa .milo-vb-fuentes small { color: var(--tx-3); }
#tessa .milo-fuente { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--linea); border-radius: var(--r-sm); background: var(--panel-2); }
#tessa .milo-fuente [data-f="url"], #tessa .milo-fuente textarea { grid-column: 1 / -1; }
#tessa .milo-fuente textarea { resize: vertical; min-height: 0; }
#tessa .milo-fuente .btn-sm { justify-self: end; grid-column: 1 / -1; }
@media (max-width: 560px) { #tessa .milo-fuente { grid-template-columns: 1fr; } }
#tessa a.btn-sutil.btn-sm { text-decoration: none; }
@media (max-width: 620px) { #tessa .milo-vista-cab, #tessa .milo-vista-cuerpo { padding-left: 14px; padding-right: 14px; } }

/* agenda semanal */
#tessa .milo-semana {
    position: fixed; top: 0; left: 0; z-index: 50;
    width: 396px; height: 100vh; height: 100dvh;
    padding: 14px; box-sizing: border-box;
}
body:has(.milo-semana) #tessa.milo { margin-left: 420px; margin-right: auto; max-width: min(1180px, calc(100vw - 420px)); }
#tessa .milo-semana-caja {
    display: flex; flex-direction: column; height: 100%; box-sizing: border-box;
    padding: 22px 12px 12px; overflow-y: auto;
    background: #fbfcfd; border: 1px solid #e3e6eb; border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
#tessa .milo-semana-cab { padding: 0 8px; }
#tessa .milo-semana-cab h2 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.02em; color: #141a26; }
#tessa .milo-semana-cab p { margin: 4px 0 0; font-size: 13.5px; color: #6b7384; }
#tessa .milo-semana-leyenda {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin: 16px 0 0; padding-bottom: 14px; border-bottom: 1px solid #e3e6eb;
}
#tessa .milo-sem-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600;
}
#tessa .milo-sem-pill svg { width: 16px; height: 16px; flex: none; }
#tessa .milo-sem-pill.es-micro, #tessa .milo-sem-chip.es-micro { background: #fdf0db; color: #b06f0a; }
#tessa .milo-sem-pill.es-largo, #tessa .milo-sem-chip.es-largo { background: #e5ecfd; color: #2457d6; }
#tessa .milo-sem-pill.es-borr, #tessa .milo-sem-chip.es-borr { background: #eceef2; color: #3b4252; }
#tessa .milo-sem-chip.es-otro { background: #eef0f3; color: #868d9c; }
#tessa .milo-semana-dias {
    display: flex; flex-direction: column; gap: 9px; flex: 1;
    margin: 18px 0 0; padding: 0; list-style: none;
}
#tessa .milo-sem-dia {
    display: grid; grid-template-columns: 36px 46px minmax(0, 1fr) 36px; align-items: center; column-gap: 10px;
    flex: 1; min-height: 64px; padding: 8px 10px 8px 16px; box-sizing: border-box;
    background: #fff; border: 1px solid #e6e8ec; border-radius: 11px;
}
#tessa .milo-sem-dia.es-hoy { background: #fffaef; border-color: #f4cd85; }
#tessa .milo-sem-fecha { display: flex; flex-direction: column; line-height: 1.1; }
#tessa .milo-sem-dow { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #6b7384; }
#tessa .milo-sem-fecha strong { margin: 2px 0 1px; font-size: 19px; font-weight: 750; color: #141a26; }
#tessa .milo-sem-mes { font-size: 11.5px; color: #6b7384; }
#tessa .milo-sem-hoy {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: #fdf0db; border: 1px solid #f6dcae; color: #b06f0a;
    font-size: 11.5px; font-weight: 600;
}
#tessa .milo-sem-chips { display: flex; gap: 4px; flex-wrap: wrap; }
#tessa .milo-sem-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 999px;
    border: 1px solid rgba(16, 24, 40, .06); box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
    font-size: 12px; font-weight: 650; line-height: 1;
}
#tessa .milo-sem-chip svg { width: 13px; height: 13px; flex: none; }
#tessa .milo-sem-mas {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 36px; height: 36px; padding: 0;
    background: #fff; border: 1px solid #d9dde3; border-radius: 50%;
    color: #2b3240; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
#tessa .milo-sem-mas svg { width: 18px; height: 18px; }
#tessa .milo-sem-mas:hover { background: #f4f6f9; border-color: #c4cad3; }
#tessa .milo-sem-mas:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
@media (max-width: 1000px) {
    #tessa .milo-semana { position: static; width: auto; height: auto; padding: 0; margin-bottom: 22px; }
    body:has(.milo-semana) #tessa.milo { margin-left: auto; max-width: 1180px; }
    #tessa .milo-semana-caja { height: auto; }
    #tessa .milo-sem-dia { flex: none; }
    #tessa .milo-semana-caja { overflow: visible; }
}

#tessa .ma-boveda { margin-bottom: 18px; }
#tessa .ma-boveda-abierta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#tessa .ma-boveda-abierta .nota { display: block; margin-top: 4px; }
#tessa .ma-botones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
#tessa .ma-boveda-abierta .ma-botones { margin-top: 0; }
#tessa .ma-llave {
    margin: 14px 0; padding: 14px 16px; border: 1.5px dashed var(--linea-2); border-radius: var(--r-sm);
    background: var(--panel-2); font: 600 17px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .04em; overflow-wrap: anywhere; user-select: all;
}
#tessa .ma-error { margin: 8px 0 0; min-height: 0; color: var(--rojo); font-size: 13px; }
#tessa .ma-error:empty { display: none; }
#tessa .ma-restaurar { border-top: 1px solid var(--linea); }
#tessa .ma-lista-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#tessa .ma-lista-cab h2 { margin: 0; }
#tessa .ma-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
#tessa .ma-rejilla .tarjeta { margin-bottom: 0; }
#tessa .ma-app h3 { margin: 0 0 6px; overflow-wrap: anywhere; }
#tessa .ma-chips { margin: 0 0 6px; }
#tessa .ma-paquete { overflow-wrap: anywhere; }
#tessa .ma-form { margin-top: 12px; }
#tessa .ma-form h3 { margin: 0 0 10px; }
#tessa .ma-titulo { margin: 0; overflow-wrap: anywhere; }
#tessa .ma-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
#tessa .ma-grupo { padding: 0 16px 8px; }
#tessa .ma-grupo h3 { margin: 14px 0 6px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3); }
#tessa .ma-celda-valor { overflow-wrap: anywhere; word-break: break-word; }
#tessa .ma-valor { white-space: pre-wrap; }
#tessa .ma-secreto { display: block; white-space: pre-wrap; padding: 6px 8px; border-radius: var(--r-sm); background: var(--panel-2); user-select: all; }
#tessa .ma-oculto { letter-spacing: .2em; color: var(--tx-3); }
#tessa .ma-acciones { white-space: normal; }
#tessa .ma-acciones .btn-sm { margin: 2px 2px 2px 0; }
#tessa .ma-sugeridos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
#tessa .ma-archivados { margin: 8px 16px 14px; }
#tessa .ma-archivados summary { cursor: pointer; color: var(--tx-2); }
#tessa .ma-subir { padding-top: 6px; }
#tessa .ma-actual { padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--linea); border-radius: var(--r-sm); background: var(--panel-2); overflow-wrap: anywhere; }
#tessa .ma-sha { display: block; overflow-wrap: anywhere; font-size: 12px; }
#tessa .ma-lista-error, #tessa .ma-lista-riesgo, #tessa .ma-lista-aviso { margin: 12px 0; padding: 10px 12px 10px 28px; border-radius: var(--r-sm); font-size: 13px; }
#tessa .ma-lista-error { background: #fdecea; color: #b42318; }
#tessa .ma-lista-riesgo { background: #fff4e0; color: #8a5a00; }
#tessa .ma-lista-aviso { background: var(--panel-2); color: var(--tx-2); }
#tessa .ma-form input[type="file"] { width: 100%; max-width: 100%; }

@media (max-width: 620px) {
    #tessa .ma-llave { font-size: 14px; }
    #tessa .ma-grupo { padding: 0 10px 8px; }
}

@media (max-width: 720px) {
    #tessa .milo-barra { gap: 4px 12px; padding: 10px 0 0; margin-bottom: 16px; }
    #tessa .milo-marca { order: 1; min-height: 40px; align-items: center; }
    #tessa .milo-nav { order: 2; flex-wrap: nowrap; gap: 2px; padding-bottom: 8px; }
    #tessa .milo-nav-titulo { min-height: 40px; padding: 0 10px; }
    #tessa .milo-nav-opcion { min-height: 40px; }
}

@media (max-width: 720px), (pointer: coarse) {
    .milo-publica textarea { font-size: 16px; }
    .milo-publica .milo-enlace-agregar { min-height: 40px; font-size: 14px; }
    .milo-publica .milo-enlace-quitar { min-height: 44px; min-width: 40px; }
    .milo-publica input[type="file"] { font-size: 14px; min-height: 40px; max-width: 100%; }
}

/* tipo de contenido */
#tessa .milo-tipo-ico {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 24px; height: 24px; border-radius: 7px; color: #fff; vertical-align: middle;
}
#tessa .milo-tipo-ico svg { width: 16px; height: 16px; }
#tessa .milo-tipo-ico.es-microvideo { background: #1d5cff; box-shadow: 0 2px 6px rgba(29, 92, 255, .45); }
#tessa .milo-tipo-ico.es-video_largo { background: #0fa958; box-shadow: 0 2px 6px rgba(15, 169, 88, .45); }
#tessa .milo-tipo-ico.es-otro { background: #e2109a; box-shadow: 0 2px 6px rgba(226, 16, 154, .45); }

/* confirmar modo */
#tessa dialog.milo-confirmar { width: min(440px, 92vw); }
#tessa .milo-confirmar p { margin: 0 0 18px; color: var(--tx-2); }
#tessa .milo-confirmar-botones { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

/* plantillas y prompts */
#tessa .pt-cargar { cursor: pointer; }
#tessa .pt-barra { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#tessa .pt-barra input { max-width: 360px; }
#tessa .pt-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
#tessa .pt-tarjeta { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 14px 16px; }
#tessa .pt-tarjeta[hidden] { display: none; }
#tessa .pt-id h2 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
#tessa .pt-id h2 span { color: var(--tx-3); font-weight: 500; }
#tessa .pt-id .nota { margin: 2px 0 0; }
#tessa .pt-vista {
    margin: 0; max-height: 9.2em; overflow: hidden; padding: 10px 12px;
    background: var(--panel-2); border: 1px solid var(--linea); border-radius: var(--r-sm);
    font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--tx-2);
    white-space: pre-wrap; overflow-wrap: anywhere;
    -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
}
#tessa .pt-acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#tessa .pt-acciones form { display: inline-flex; margin: 0; }
#tessa .pt-acciones .pt-accion { width: 44px; min-width: 44px; height: 30px; padding: 6px 12px; border: 1px solid; border-radius: 7px; text-decoration: none; transition: background .15s, border-color .15s; }
#tessa .pt-acciones .pt-eliminar { color: #b04a50; background: #fff8f8; border-color: #f0d7d9; }
#tessa .pt-acciones .pt-editar { color: #7351a3; background: #f8f5fc; border-color: #e5dbf2; }
#tessa .pt-acciones .pt-descargar { color: #367aa6; background: #f2f8fc; border-color: #d5e6f2; }
#tessa .pt-acciones .pt-copiar { margin-left: 4px; color: #fff; background: var(--rojo, #d72638); border-color: var(--rojo, #d72638); box-shadow: 0 2px 5px #d726381c; }
#tessa .pt-acciones .pt-eliminar:hover { background: #fbe9eb; border-color: #dba8ad; }
#tessa .pt-acciones .pt-editar:hover { background: #eee6f8; border-color: #c8b3e2; }
#tessa .pt-acciones .pt-descargar:hover { background: #e1f0fa; border-color: #a9cee7; }
#tessa .pt-acciones .pt-copiar:hover { background: #b91f30; border-color: #b91f30; }
#tessa .pt-acciones .pt-copiar.es-copiado { background: #237147; border-color: #237147; }
#tessa .pt-acciones .pt-copiar.es-error-copia { background: #922333; border-color: #922333; }
#tessa .pt-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
#tessa .pt-actualizar { color: #8c783c; }
#tessa .pt-actualizar.es-actualizando svg { animation: pt-girar 1s linear infinite; }
@keyframes pt-girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #tessa .pt-actualizar.es-actualizando svg { animation: none; } }
#tessa dialog.pt-editor { width: min(820px, 94vw); }
#tessa .pt-editor textarea { width: 100%; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
#tessa .pt-nombre-campo { display: flex; align-items: center; gap: 6px; }
#tessa .pt-nombre-campo input { flex: 1; }
#tessa .pt-nombre-campo span { color: var(--tx-3); }
@media (max-width: 620px) { #tessa .pt-rejilla { grid-template-columns: 1fr; } }
#tessa .pt-zips { margin-top: 22px; }
#tessa .pt-zips .tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#tessa .pt-zip-lista { margin: 0; padding: 0; list-style: none; }
#tessa .pt-zip-lista li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linea); }
#tessa .pt-zip-lista li:last-child { border-bottom: 0; }
#tessa .pt-zip-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: #fff4e0; color: #8a5a00; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
#tessa .pt-zip-nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#tessa .pt-zip-nombre strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tessa .pt-zip-nombre small { color: var(--tx-3); }
#tessa .pt-temas { border-color: #f2c94c; box-shadow: 0 0 0 1px #f2c94c inset; }
#tessa .pt-temas .pt-id h2::before { content: "★ "; color: #c99700; }
#tessa .pt-vacio { margin: 14px 0 0; }

/* temas de milo: boton doble */
#tessa .mc-temas { display: inline-flex; align-items: stretch; border-radius: var(--r-sm); overflow: hidden; background: #ffd23f; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
#tessa .mc-temas button, #tessa .mc-temas a {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; min-height: 36px; padding: 0;
    border: 0; background: transparent; color: #4a3b00; cursor: pointer;
}
#tessa .mc-temas a { border-left: 1px solid rgba(74, 59, 0, .22); }
#tessa .mc-temas button:hover, #tessa .mc-temas a:hover { background: #f5c400; text-decoration: none; }
#tessa .mc-temas button.ok { background: #e9b800; }
#tessa .mc-temas svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#tessa .mc-temas :focus-visible { outline: 2px solid #4a3b00; outline-offset: -3px; }

/* aviso antispam */
#tessa .ma-error-persistente{ margin-bottom: 16px; padding: 12px 16px; border: 1px solid #efc4c4; border-radius: 8px; background: #fff2f2; color: #a82424; }
#tessa .ma-subida-avance{ margin: 16px 0; }
#tessa .ma-subida-avance progress{ width: 100%; height: 12px; accent-color: #d72638; }
#tessa.milo .aviso-antispam { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--rojo-bor); border-left: 4px solid var(--rojo); border-radius: var(--r-sm); background: var(--rojo-luz); color: var(--rojo); font-size: 13px; line-height: 1.5; }
#tessa.milo .aviso-antispam strong { display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .02em; }
#tessa .pt-nombre-campo select { width: auto; flex: none; }
